diff options
889 files changed, 38365 insertions, 24937 deletions
diff --git a/.travis.yml b/.travis.yml index 8d1dd1ef90..8a6f80002b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,10 +71,14 @@ matrix: env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes" os: linux compiler: clang + addons: + apt: + packages: + - openjdk-8-jdk - name: macOS editor (debug, Clang) stage: build - env: PLATFORM=osx TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-clang + env: PLATFORM=osx TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-clang EXTRA_ARGS="warnings=extra werror=yes" os: osx compiler: clang @@ -116,14 +120,14 @@ before_install: install: - pip install --user scons; - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$PLATFORM" = "android" ]; then + export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64; + export PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:${PATH}; + java -version; misc/travis/android-tools-linux.sh; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH=${PATH}:/Users/travis/Library/Python/2.7/bin; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$PLATFORM" = "android" ]; then - misc/travis/android-tools-osx.sh; - fi before_script: - if [ "$PLATFORM" = "android" ]; then diff --git a/AUTHORS.md b/AUTHORS.md index 4ae6db35d7..c5981306c4 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -55,6 +55,7 @@ name is available. Dana Olson (adolson) Daniel J. Ramirez (djrm) Daniel Rakos (aqnuep) + David Sichma (DavidSichma) Dharkael (lupoDharkael) Dmitry Koteroff (Krakean) DualMatrix @@ -120,6 +121,7 @@ name is available. Patrick (firefly2442) Paul Batty (Paulb23) Paul Joannon (paulloz) + Paul Trojahn (ptrojahn) Pawel Kowal (pkowal1982) Pedro J. Estébanez (RandomShaper) Pieter-Jan Briers (PJB3005) @@ -14,10 +14,12 @@ generous deed immortalized in the next stable release of Godot Engine. Enjin Coin <https://enjincoin.io> Heroic Labs <https://heroiclabs.com> + Interblock <http://interblockgaming.com> ## Gold sponsors Gamblify <https://www.gamblify.com> + Image Campus <https://www.imagecampus.edu.ar> Moonwards <https://www.moonwards.com> ## Mini sponsors @@ -27,8 +29,7 @@ generous deed immortalized in the next stable release of Godot Engine. Anandarup Mallik Andrew Dunai Brandon Lamb - Christian Chipont - Christian Uldall Pedersen + Christopher Montesano Christoph Woinke Darkhan Baimyrza Denis Malyavin @@ -42,6 +43,7 @@ generous deed immortalized in the next stable release of Godot Engine. Javary Co. Jeffery Chiu Jeppe Zapp + John Benard (Linuxydable) Justin Arnold Justo Delgado Baudà Kyle Szklenski @@ -52,7 +54,6 @@ generous deed immortalized in the next stable release of Godot Engine. Mike King Nathan Warden Neal Gompa (Conan Kudo) - Patrick Aarstad ScottMakesGames Slobodan Milnovic Stephan Lanfermann @@ -64,7 +65,6 @@ generous deed immortalized in the next stable release of Godot Engine. Andrei cheese65536 - Daniel Hartmann Dave David Gehrig David Snopek @@ -82,18 +82,17 @@ generous deed immortalized in the next stable release of Godot Engine. Taylor Ritenour Zaven Muradyan + _ Alexander Trey Saunders Asher Glick Austen McRae Bernhard Werner beVR Brian van der Stel - Cameron MacNair Carlo Cabanilla Daniel James David Giardi Default Name - Edward E Florian Breisch Gamejunkey Gero @@ -103,6 +102,7 @@ generous deed immortalized in the next stable release of Godot Engine. Jon Woodward Jose Fernando Alexandre Karl Werf + Klavdij Voncina Lex Steers Luke Maciej Pendolski @@ -115,11 +115,11 @@ generous deed immortalized in the next stable release of Godot Engine. Scott Wadden Sergey Shawn Yu + The Architect thechris Tom Langwaldt tukon Unseen Domains - wmww Alex Khayrullin Branwyn Tylwyth @@ -129,19 +129,18 @@ generous deed immortalized in the next stable release of Godot Engine. Conrad Curry Craig Smith Darrian Little - Dean Harmon Ivan Trombley + Jakub Dering Joan Fons Joshua Flores Krzysztof Jankowski Lord Bloodhound - Lucas Ferreira Franca Nathan Lundquist - Nicklas Breum Pascal Grüter Petr Malac Rami Reneator + Rob Robert Willes Ronnie Ashlock Thomas Bjarnelöf @@ -156,6 +155,7 @@ generous deed immortalized in the next stable release of Godot Engine. André Frélicot andres eduardo lopez Andrew Bowen + aoshiwik Ben Botwin Carlos de Sousa Marques Chase Taranto @@ -166,7 +166,6 @@ generous deed immortalized in the next stable release of Godot Engine. D Daniel Eichler David White - Eric Eric Monson Erik Hatfield Eugenio Hugo Salgüero Jáñez @@ -189,8 +188,6 @@ generous deed immortalized in the next stable release of Godot Engine. Juraj Móza Kasper Jeppesen kinfox - Klaus The - Klavdij Voncina Maarten Elings Marcelo Dornbusch Lopes Markus Fehr @@ -199,7 +196,6 @@ generous deed immortalized in the next stable release of Godot Engine. Marvin Matt Eunson Max Bulai - Max R.R. Collada MuffinManKen Nick Nikitin Oliver Dick @@ -218,7 +214,9 @@ generous deed immortalized in the next stable release of Godot Engine. Scott Pilet spilldata Stoned Xander + TheLevelOfDetail . Thomas Krampl + Thomas Kurz Tobias Bocanegra Urho Zie Weaver @@ -236,27 +234,25 @@ generous deed immortalized in the next stable release of Godot Engine. Adam Smeltzer Adisibio Adrian Demetrescu - Aggelos Arnaoutis Agustinus Arya Aidan O'Flannagain + Aki Mimoto Albin Jonasson Svärdsby Alder Stefano Alessandro Senese - Alexander Koppe Alexandre Alex Davies-Moore Allen Schade Andreas Evers Andreas Krampitz - Andreas Schüle André Simões Andrés RodrÃguez Andrew Thomas Andrzej Skalski + Angelos Arnaoutis Anthony Bongiovanni Anthony Staunton Anton Kurkin - Antony K. Jones AP Condomines Arda Erol Arseniy M @@ -266,7 +262,6 @@ generous deed immortalized in the next stable release of Godot Engine. Avencherus B A Balázs Batári - Beliar Benedikt Ben G Ben Phelan @@ -278,20 +273,21 @@ generous deed immortalized in the next stable release of Godot Engine. Bryan Stevenson Carl van der Geest Carwyn Edwards + Casey M. Chris Brown Chris Chapin Christian Baune + Christian Chipont Christian Winter Christoffer Sundbom Christopher Schmitt Clay Heaton - Cobaltum Collin Shooltz Daniel Johnson + Daniel Kimblad DanielMaximiano Daniel Pontillo Daniel Reed - David Cravens David May David Rapisarda David Woodard @@ -308,14 +304,16 @@ generous deed immortalized in the next stable release of Godot Engine. Ellen Marie Dash Elmeri '- Duy Kevin Nguyen Emanuel Kotzayan + Ennemoser Ernst Eric Ellingson Eric Martini Eric Williams + Erkki Seppälä EugeneTel Evan Rose Felix Kollmann - fengjiongmax Flaredown + Florian Richer FuDiggity G3Dev sà rl Gadzhi Kharkharov @@ -324,6 +322,7 @@ generous deed immortalized in the next stable release of Godot Engine. George Marques gmmath Greg Olson + GREGORY C FEIN Greg P Greyson Richey Guldoman @@ -332,7 +331,6 @@ generous deed immortalized in the next stable release of Godot Engine. Hiroshi Naruo Hunter Jones Hylpher - ialex32x Iiari IndustrialRobot Isaac Morton @@ -341,6 +339,7 @@ generous deed immortalized in the next stable release of Godot Engine. Jaime Ruiz-Borau Vizárraga Jako Danar James A F Manley + Jannik Gröger Jax Jed Jeff Hungerford @@ -353,7 +352,6 @@ generous deed immortalized in the next stable release of Godot Engine. Joel Fivat Joel Setterberg Johannes Wuensch - John Selig Jomei Jackson Jonas Rudlang Jonas Yamazaki @@ -365,9 +363,7 @@ generous deed immortalized in the next stable release of Godot Engine. Jose Andrés Mejias Rojas Jose C. Rubio Joseph Catrambone - Josh 'Cheeseness' Bush Juanfran - Juan Negrier Judd Julian Murgia JungleRobba @@ -378,7 +374,6 @@ generous deed immortalized in the next stable release of Godot Engine. KC Chan Keedong Park Keith Bradner - Kevin Kolcheck Kevin McPhillips kickmaniac Kiyohiro Kawamura (kyorohiro) @@ -400,12 +395,12 @@ generous deed immortalized in the next stable release of Godot Engine. Malik Ahmed Malik Nejer Marcus Richter - Markus Lohaus Markus Michael Egger Martin Candela Martin Holas Martin LiÅ¡ka Matthew Little + Matti Pohjanvirta Maxime Blade Maxwell medecau @@ -417,12 +412,11 @@ generous deed immortalized in the next stable release of Godot Engine. Michael Haney Michael Labbe Mikael Olsson - Mikayla Hutchinson + Mikayla Mike Birkhead Mitchell J. Wagner MoM Nathan Fish - Nathan W Natrim nee Neil Blakey-Milner @@ -440,20 +434,19 @@ generous deed immortalized in the next stable release of Godot Engine. Olivier Omar Delarosa Oscar Norlander - Pafka Pan Ip - Patrick Forringer Patrick Nafarrete Paul Gieske Paul Mason PaweÅ‚ Kowal + Penguin + Petrus Prinsloo Philip Cohoe Pierre-Igor Berthet Pitsanu Tongprasin Point08 Poryg Rafa Laguna - Rafal Wyszomirski rainerLinux Raphael Leroux Remi Rampin @@ -462,6 +455,7 @@ generous deed immortalized in the next stable release of Godot Engine. Ricardo Alcantara Richard Diss Richard Ivánek + Richard Patching Robert Farr (Larington) Robert Hernandez Rodrigo Loli @@ -471,7 +465,7 @@ generous deed immortalized in the next stable release of Godot Engine. Ronan Jouchet Ryan Groom Ryan Hentz - Saad Khoudmi + Sam.C Sam Edson Samuele Zolfanelli Sanka.X @@ -487,13 +481,11 @@ generous deed immortalized in the next stable release of Godot Engine. SK smbe19 Sootstone - Stonepyre Svenne Krap - The Architect + tezuvholovdr thomas Thomas Bechtold Thomas Kelly - Thomas Kurz tiansheng li Tim Drumheller Timothy B. MacDonald @@ -504,7 +496,6 @@ generous deed immortalized in the next stable release of Godot Engine. Torsten Crass Travis O'Brien Trent Skinner - Triptych Troy Bonneau Tryggve Sollid Turgut Temucin diff --git a/core/SCsub b/core/SCsub index ed9a0a231d..755c5c65c6 100644 --- a/core/SCsub +++ b/core/SCsub @@ -80,6 +80,8 @@ if env['builtin_zlib']: env_thirdparty.Prepend(CPPPATH=[thirdparty_zlib_dir]) # Needs to be available in main env too env.Prepend(CPPPATH=[thirdparty_zlib_dir]) + if (env['target'] == 'debug'): + env_thirdparty.Append(CPPDEFINES=['ZLIB_DEBUG']) env_thirdparty.add_source_files(env.core_sources, thirdparty_zlib_sources) @@ -118,6 +120,8 @@ if env['builtin_zstd']: "compress/zstd_ldm.c", "compress/zstd_opt.c", "compress/zstdmt_compress.c", + "compress/zstd_compress_literals.c", + "compress/zstd_compress_sequences.c", "decompress/huf_decompress.c", "decompress/zstd_ddict.c", "decompress/zstd_decompress_block.c", diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index d07ba44788..1544503045 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -468,6 +468,16 @@ bool _OS::is_in_low_processor_usage_mode() const { return OS::get_singleton()->is_in_low_processor_usage_mode(); } +void _OS::set_low_processor_usage_mode_sleep_usec(int p_usec) { + + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(p_usec); +} + +int _OS::get_low_processor_usage_mode_sleep_usec() const { + + return OS::get_singleton()->get_low_processor_usage_mode_sleep_usec(); +} + String _OS::get_executable_path() const { return OS::get_singleton()->get_executable_path(); @@ -1136,6 +1146,16 @@ bool _OS::request_permission(const String &p_name) { return OS::get_singleton()->request_permission(p_name); } +bool _OS::request_permissions() { + + return OS::get_singleton()->request_permissions(); +} + +Vector<String> _OS::get_granted_permissions() const { + + return OS::get_singleton()->get_granted_permissions(); +} + _OS *_OS::singleton = NULL; void _OS::_bind_methods() { @@ -1222,6 +1242,9 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("set_low_processor_usage_mode", "enable"), &_OS::set_low_processor_usage_mode); ClassDB::bind_method(D_METHOD("is_in_low_processor_usage_mode"), &_OS::is_in_low_processor_usage_mode); + ClassDB::bind_method(D_METHOD("set_low_processor_usage_mode_sleep_usec", "usec"), &_OS::set_low_processor_usage_mode_sleep_usec); + ClassDB::bind_method(D_METHOD("get_low_processor_usage_mode_sleep_usec"), &_OS::get_low_processor_usage_mode_sleep_usec); + ClassDB::bind_method(D_METHOD("get_processor_count"), &_OS::get_processor_count); ClassDB::bind_method(D_METHOD("get_executable_path"), &_OS::get_executable_path); @@ -1319,12 +1342,15 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_power_percent_left"), &_OS::get_power_percent_left); ClassDB::bind_method(D_METHOD("request_permission", "name"), &_OS::request_permission); + ClassDB::bind_method(D_METHOD("request_permissions"), &_OS::request_permissions); + ClassDB::bind_method(D_METHOD("get_granted_permissions"), &_OS::get_granted_permissions); ADD_PROPERTY(PropertyInfo(Variant::STRING, "clipboard"), "set_clipboard", "get_clipboard"); ADD_PROPERTY(PropertyInfo(Variant::INT, "current_screen"), "set_current_screen", "get_current_screen"); ADD_PROPERTY(PropertyInfo(Variant::INT, "exit_code"), "set_exit_code", "get_exit_code"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vsync_enabled"), "set_use_vsync", "is_vsync_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "low_processor_usage_mode"), "set_low_processor_usage_mode", "is_in_low_processor_usage_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "low_processor_usage_mode_sleep_usec"), "set_low_processor_usage_mode_sleep_usec", "get_low_processor_usage_mode_sleep_usec"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keep_screen_on"), "set_keep_screen_on", "is_keep_screen_on"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "min_window_size"), "set_min_window_size", "get_min_window_size"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "max_window_size"), "set_max_window_size", "get_max_window_size"); @@ -1346,6 +1372,7 @@ void _OS::_bind_methods() { ADD_PROPERTY_DEFAULT("exit_code", 0); ADD_PROPERTY_DEFAULT("vsync_enabled", true); ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false); + ADD_PROPERTY_DEFAULT("low_processor_usage_mode_sleep_usec", 6900); ADD_PROPERTY_DEFAULT("keep_screen_on", true); ADD_PROPERTY_DEFAULT("min_window_size", Vector2()); ADD_PROPERTY_DEFAULT("max_window_size", Vector2()); @@ -3153,6 +3180,9 @@ Ref<JSONParseResult> _JSON::parse(const String &p_json) { result->error = JSON::parse(p_json, result->result, result->error_string, result->error_line); + if (result->error != OK) { + ERR_PRINTS(vformat("Error parsing JSON at line %s: %s", result->error_line, result->error_string)); + } return result; } diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 693b85710a..18182860c6 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -222,6 +222,9 @@ public: void set_low_processor_usage_mode(bool p_enabled); bool is_in_low_processor_usage_mode() const; + void set_low_processor_usage_mode_sleep_usec(int p_usec); + int get_low_processor_usage_mode_sleep_usec() const; + String get_executable_path() const; int execute(const String &p_path, const Vector<String> &p_arguments, bool p_blocking, Array p_output = Array(), bool p_read_stderr = false); @@ -349,6 +352,8 @@ public: bool has_feature(const String &p_feature) const; bool request_permission(const String &p_name); + bool request_permissions(); + Vector<String> get_granted_permissions() const; static _OS *get_singleton() { return singleton; } diff --git a/core/color.cpp b/core/color.cpp index a54a3115cc..a6ad50b745 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -214,6 +214,11 @@ void Color::set_hsv(float p_h, float p_s, float p_v, float p_alpha) { } } +bool Color::is_equal_approx(const Color &p_color) const { + + return Math::is_equal_approx(r, p_color.r) && Math::is_equal_approx(g, p_color.g) && Math::is_equal_approx(b, p_color.b) && Math::is_equal_approx(a, p_color.a); +} + void Color::invert() { r = 1.0 - r; diff --git a/core/color.h b/core/color.h index 8fb78d1ced..b34a82ef19 100644 --- a/core/color.h +++ b/core/color.h @@ -86,6 +86,8 @@ struct Color { void operator/=(const Color &p_color); void operator/=(const real_t &rvalue); + bool is_equal_approx(const Color &p_color) const; + void invert(); void contrast(); Color inverted() const; diff --git a/core/crypto/hashing_context.cpp b/core/crypto/hashing_context.cpp index bd863f546b..b5aa0ddc18 100644 --- a/core/crypto/hashing_context.cpp +++ b/core/crypto/hashing_context.cpp @@ -50,6 +50,7 @@ Error HashingContext::start(HashType p_type) { Error HashingContext::update(PoolByteArray p_chunk) { ERR_FAIL_COND_V(ctx == NULL, ERR_UNCONFIGURED); size_t len = p_chunk.size(); + ERR_FAIL_COND_V(len == 0, FAILED); PoolByteArray::Read r = p_chunk.read(); switch (type) { case HASH_MD5: diff --git a/core/dictionary.cpp b/core/dictionary.cpp index 5e4dfb9a5a..0d9945991e 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -192,13 +192,9 @@ uint32_t Dictionary::hash() const { uint32_t h = hash_djb2_one_32(Variant::DICTIONARY); - List<Variant> keys; - get_key_list(&keys); - - for (List<Variant>::Element *E = keys.front(); E; E = E->next()) { - - h = hash_djb2_one_32(E->get().hash(), h); - h = hash_djb2_one_32(operator[](E->get()).hash(), h); + for (OrderedHashMap<Variant, Variant, VariantHasher, VariantComparator>::Element E = _p->variant_map.front(); E; E = E.next()) { + h = hash_djb2_one_32(E.key().hash(), h); + h = hash_djb2_one_32(E.value().hash(), h); } return h; @@ -207,10 +203,11 @@ uint32_t Dictionary::hash() const { Array Dictionary::keys() const { Array varr; - varr.resize(size()); if (_p->variant_map.empty()) return varr; + varr.resize(size()); + int i = 0; for (OrderedHashMap<Variant, Variant, VariantHasher, VariantComparator>::Element E = _p->variant_map.front(); E; E = E.next()) { varr[i] = E.key(); @@ -223,10 +220,11 @@ Array Dictionary::keys() const { Array Dictionary::values() const { Array varr; - varr.resize(size()); if (_p->variant_map.empty()) return varr; + varr.resize(size()); + int i = 0; for (OrderedHashMap<Variant, Variant, VariantHasher, VariantComparator>::Element E = _p->variant_map.front(); E; E = E.next()) { varr[i] = E.get(); @@ -255,11 +253,8 @@ Dictionary Dictionary::duplicate(bool p_deep) const { Dictionary n; - List<Variant> keys; - get_key_list(&keys); - - for (List<Variant>::Element *E = keys.front(); E; E = E->next()) { - n[E->get()] = p_deep ? operator[](E->get()).duplicate(p_deep) : operator[](E->get()); + for (OrderedHashMap<Variant, Variant, VariantHasher, VariantComparator>::Element E = _p->variant_map.front(); E; E = E.next()) { + n[E.key()] = p_deep ? E.value().duplicate(true) : E.value(); } return n; diff --git a/core/error_macros.cpp b/core/error_macros.cpp index 0e8e4a9bb4..55a215cfb6 100644 --- a/core/error_macros.cpp +++ b/core/error_macros.cpp @@ -31,22 +31,11 @@ #include "error_macros.h" #include "core/io/logger.h" +#include "core/ustring.h" #include "os/os.h" -bool _err_error_exists = false; - static ErrorHandlerList *error_handler_list = NULL; -void _err_set_last_error(const char *p_err) { - - OS::get_singleton()->set_last_error(p_err); -} - -void _err_clear_last_error() { - - OS::get_singleton()->clear_last_error(); -} - void add_error_handler(ErrorHandlerList *p_handler) { _global_lock(); @@ -80,28 +69,47 @@ void remove_error_handler(ErrorHandlerList *p_handler) { } void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, ErrorHandlerType p_type) { + _err_print_error(p_function, p_file, p_line, p_error, "", p_type); +} + +void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, ErrorHandlerType p_type) { + _err_print_error(p_function, p_file, p_line, p_error.utf8().get_data(), "", p_type); +} - OS::get_singleton()->print_error(p_function, p_file, p_line, p_error, _err_error_exists ? OS::get_singleton()->get_last_error() : "", (Logger::ErrorType)p_type); +void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, const char *p_message, ErrorHandlerType p_type) { + + OS::get_singleton()->print_error(p_function, p_file, p_line, p_error, p_message, (Logger::ErrorType)p_type); _global_lock(); ErrorHandlerList *l = error_handler_list; while (l) { - l->errfunc(l->userdata, p_function, p_file, p_line, p_error, _err_error_exists ? OS::get_singleton()->get_last_error() : "", p_type); + l->errfunc(l->userdata, p_function, p_file, p_line, p_error, p_message, p_type); l = l->next; } _global_unlock(); +} - if (_err_error_exists) { - OS::get_singleton()->clear_last_error(); - _err_error_exists = false; - } +void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, const char *p_message, ErrorHandlerType p_type) { + _err_print_error(p_function, p_file, p_line, p_error.utf8().get_data(), p_message, p_type); } -void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, bool fatal) { +void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, const String &p_message, ErrorHandlerType p_type) { + _err_print_error(p_function, p_file, p_line, p_error, p_message.utf8().get_data(), p_type); +} + +void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, const String &p_message, ErrorHandlerType p_type) { + _err_print_error(p_function, p_file, p_line, p_error.utf8().get_data(), p_message.utf8().get_data(), p_type); +} + +void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, const char *p_message, bool fatal) { String fstr(fatal ? "FATAL: " : ""); String err(fstr + "Index " + p_index_str + "=" + itos(p_index) + " out of size (" + p_size_str + "=" + itos(p_size) + ")"); - _err_print_error(p_function, p_file, p_line, err.utf8().get_data()); + _err_print_error(p_function, p_file, p_line, err.utf8().get_data(), p_message); +} + +void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, const String &p_message, bool fatal) { + _err_print_index_error(p_function, p_file, p_line, p_index, p_size, p_index_str, p_size_str, p_message.utf8().get_data(), fatal); } diff --git a/core/error_macros.h b/core/error_macros.h index 65802de9d2..6d17fd2cb5 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -55,9 +55,8 @@ enum ErrorHandlerType { ERR_HANDLER_SHADER, }; +class String; typedef void (*ErrorHandlerFunc)(void *, const char *, const char *, int p_line, const char *, const char *, ErrorHandlerType p_type); -void _err_set_last_error(const char *p_err); -void _err_clear_last_error(); struct ErrorHandlerList { @@ -77,7 +76,13 @@ void add_error_handler(ErrorHandlerList *p_handler); void remove_error_handler(ErrorHandlerList *p_handler); void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, ErrorHandlerType p_type = ERR_HANDLER_ERROR); -void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, bool fatal = false); +void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, ErrorHandlerType p_type = ERR_HANDLER_ERROR); +void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, const char *p_message, ErrorHandlerType p_type = ERR_HANDLER_ERROR); +void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, const char *p_message, ErrorHandlerType p_type = ERR_HANDLER_ERROR); +void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, const String &p_message, ErrorHandlerType p_type = ERR_HANDLER_ERROR); +void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, const String &p_message, ErrorHandlerType p_type = ERR_HANDLER_ERROR); +void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, const char *p_message = "", bool fatal = false); +void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, const String &p_message, bool fatal = false); #ifndef _STR #define _STR(m_x) #m_x @@ -88,29 +93,6 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li /** An index has failed if m_index<0 or m_index >=m_size, the function exits */ -extern bool _err_error_exists; - -#ifdef DEBUG_ENABLED -/** Print a warning string. - */ -#define ERR_EXPLAINC(m_reason) \ - { \ - _err_set_last_error(m_reason); \ - _err_error_exists = true; \ - } -#define ERR_EXPLAIN(m_string) \ - { \ - _err_set_last_error(String(m_string).utf8().get_data()); \ - _err_error_exists = true; \ - } - -#else - -#define ERR_EXPLAIN(m_text) -#define ERR_EXPLAINC(m_text) - -#endif - #ifdef __GNUC__ //#define FUNCTION_STR __PRETTY_FUNCTION__ - too annoying #define FUNCTION_STR __FUNCTION__ @@ -137,17 +119,14 @@ extern bool _err_error_exists; _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ return; \ } \ - _err_error_exists = false; \ } while (0); // (*) -#define ERR_FAIL_INDEX_MSG(m_index, m_size, m_msg) \ - do { \ - if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ - return; \ - } \ - _err_error_exists = false; \ +#define ERR_FAIL_INDEX_MSG(m_index, m_size, m_msg) \ + do { \ + if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ + _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), m_msg); \ + return; \ + } \ } while (0); // (*) /** An index has failed if m_index<0 or m_index >=m_size, the function exits. @@ -161,17 +140,14 @@ extern bool _err_error_exists; _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ return m_retval; \ } \ - _err_error_exists = false; \ } while (0); // (*) -#define ERR_FAIL_INDEX_V_MSG(m_index, m_size, m_retval, m_msg) \ - do { \ - if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ - return m_retval; \ - } \ - _err_error_exists = false; \ +#define ERR_FAIL_INDEX_V_MSG(m_index, m_size, m_retval, m_msg) \ + do { \ + if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ + _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), m_msg); \ + return m_retval; \ + } \ } while (0); // (*) /** An index has failed if m_index >=m_size, the function exits. @@ -185,37 +161,33 @@ extern bool _err_error_exists; _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ return m_retval; \ } \ - _err_error_exists = false; \ } while (0); // (*) -#define ERR_FAIL_UNSIGNED_INDEX_V_MSG(m_index, m_size, m_retval, m_msg) \ - do { \ - if (unlikely((m_index) >= (m_size))) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ - return m_retval; \ - } \ - _err_error_exists = false; \ +#define ERR_FAIL_UNSIGNED_INDEX_V_MSG(m_index, m_size, m_retval, m_msg) \ + do { \ + if (unlikely((m_index) >= (m_size))) { \ + _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), m_msg); \ + return m_retval; \ + } \ } while (0); // (*) /** Use this one if there is no sensible fallback, that is, the error is unrecoverable. * We'll return a null reference and try to keep running. */ -#define CRASH_BAD_INDEX(m_index, m_size) \ - do { \ - if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ - _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), true); \ - GENERATE_TRAP \ - } \ +#define CRASH_BAD_INDEX(m_index, m_size) \ + do { \ + if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ + _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), "", true); \ + GENERATE_TRAP \ + } \ } while (0); // (*) -#define CRASH_BAD_INDEX_MSG(m_index, m_size, m_msg) \ - do { \ - if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), true); \ - GENERATE_TRAP \ - } \ +#define CRASH_BAD_INDEX_MSG(m_index, m_size, m_msg) \ + do { \ + if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ + _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), m_msg, true); \ + GENERATE_TRAP \ + } \ } while (0); // (*) /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). @@ -228,17 +200,14 @@ extern bool _err_error_exists; _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null."); \ return; \ } \ - _err_error_exists = false; \ } -#define ERR_FAIL_NULL_MSG(m_param, m_msg) \ - { \ - if (unlikely(!m_param)) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null."); \ - return; \ - } \ - _err_error_exists = false; \ +#define ERR_FAIL_NULL_MSG(m_param, m_msg) \ + { \ + if (unlikely(!m_param)) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null.", m_msg); \ + return; \ + } \ } #define ERR_FAIL_NULL_V(m_param, m_retval) \ @@ -247,17 +216,14 @@ extern bool _err_error_exists; _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null."); \ return m_retval; \ } \ - _err_error_exists = false; \ } -#define ERR_FAIL_NULL_V_MSG(m_param, m_retval, m_msg) \ - { \ - if (unlikely(!m_param)) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null."); \ - return m_retval; \ - } \ - _err_error_exists = false; \ +#define ERR_FAIL_NULL_V_MSG(m_param, m_retval, m_msg) \ + { \ + if (unlikely(!m_param)) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null.", m_msg); \ + return m_retval; \ + } \ } /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). @@ -270,17 +236,14 @@ extern bool _err_error_exists; _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true."); \ return; \ } \ - _err_error_exists = false; \ } -#define ERR_FAIL_COND_MSG(m_cond, m_msg) \ - { \ - if (unlikely(m_cond)) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true."); \ - return; \ - } \ - _err_error_exists = false; \ +#define ERR_FAIL_COND_MSG(m_cond, m_msg) \ + { \ + if (unlikely(m_cond)) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true.", m_msg); \ + return; \ + } \ } /** Use this one if there is no sensible fallback, that is, the error is unrecoverable. @@ -294,13 +257,12 @@ extern bool _err_error_exists; } \ } -#define CRASH_COND_MSG(m_cond, m_msg) \ - { \ - if (unlikely(m_cond)) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Condition ' " _STR(m_cond) " ' is true."); \ - GENERATE_TRAP \ - } \ +#define CRASH_COND_MSG(m_cond, m_msg) \ + { \ + if (unlikely(m_cond)) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Condition ' " _STR(m_cond) " ' is true.", m_msg); \ + GENERATE_TRAP \ + } \ } /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). @@ -315,17 +277,14 @@ extern bool _err_error_exists; _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. returned: " _STR(m_retval)); \ return m_retval; \ } \ - _err_error_exists = false; \ } -#define ERR_FAIL_COND_V_MSG(m_cond, m_retval, m_msg) \ - { \ - if (unlikely(m_cond)) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. returned: " _STR(m_retval)); \ - return m_retval; \ - } \ - _err_error_exists = false; \ +#define ERR_FAIL_COND_V_MSG(m_cond, m_retval, m_msg) \ + { \ + if (unlikely(m_cond)) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. returned: " _STR(m_retval), m_msg); \ + return m_retval; \ + } \ } /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). @@ -338,17 +297,14 @@ extern bool _err_error_exists; _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Continuing..:"); \ continue; \ } \ - _err_error_exists = false; \ } -#define ERR_CONTINUE_MSG(m_cond, m_msg) \ - { \ - if (unlikely(m_cond)) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Continuing..:"); \ - continue; \ - } \ - _err_error_exists = false; \ +#define ERR_CONTINUE_MSG(m_cond, m_msg) \ + { \ + if (unlikely(m_cond)) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Continuing..:", m_msg); \ + continue; \ + } \ } /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). @@ -361,17 +317,14 @@ extern bool _err_error_exists; _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Breaking..:"); \ break; \ } \ - _err_error_exists = false; \ } -#define ERR_BREAK_MSG(m_cond, m_msg) \ - { \ - if (unlikely(m_cond)) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Breaking..:"); \ - break; \ - } \ - _err_error_exists = false; \ +#define ERR_BREAK_MSG(m_cond, m_msg) \ + { \ + if (unlikely(m_cond)) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Breaking..:", m_msg); \ + break; \ + } \ } /** Print an error string and return @@ -380,14 +333,13 @@ extern bool _err_error_exists; #define ERR_FAIL() \ { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method/Function Failed."); \ - _err_error_exists = false; \ return; \ } -#define ERR_FAIL_MSG(m_msg) \ - { \ - ERR_EXPLAIN(m_msg); \ - ERR_FAIL(); \ +#define ERR_FAIL_MSG(m_msg) \ + { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method/Function Failed.", m_msg); \ + return; \ } /** Print an error string and return with value @@ -396,14 +348,13 @@ extern bool _err_error_exists; #define ERR_FAIL_V(m_value) \ { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method/Function Failed, returning: " __STR(m_value)); \ - _err_error_exists = false; \ return m_value; \ } -#define ERR_FAIL_V_MSG(m_value, m_msg) \ - { \ - ERR_EXPLAIN(m_msg); \ - ERR_FAIL_V(m_value); \ +#define ERR_FAIL_V_MSG(m_value, m_msg) \ + { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method/Function Failed, returning: " __STR(m_value), m_msg); \ + return m_value; \ } /** Use this one if there is no sensible fallback, that is, the error is unrecoverable. @@ -415,10 +366,10 @@ extern bool _err_error_exists; GENERATE_TRAP \ } -#define CRASH_NOW_MSG(m_msg) \ - { \ - ERR_EXPLAIN(m_msg); \ - CRASH_NOW(); \ +#define CRASH_NOW_MSG(m_msg) \ + { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Method/Function Failed.", m_msg); \ + GENERATE_TRAP \ } /** Print an error string. @@ -427,13 +378,11 @@ extern bool _err_error_exists; #define ERR_PRINT(m_string) \ { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string); \ - _err_error_exists = false; \ } -#define ERR_PRINTS(m_string) \ - { \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, String(m_string).utf8().get_data()); \ - _err_error_exists = false; \ +#define ERR_PRINTS(m_string) \ + { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string); \ } #define ERR_PRINT_ONCE(m_string) \ @@ -441,7 +390,6 @@ extern bool _err_error_exists; static bool first_print = true; \ if (first_print) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string); \ - _err_error_exists = false; \ first_print = false; \ } \ } @@ -452,13 +400,11 @@ extern bool _err_error_exists; #define WARN_PRINT(m_string) \ { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string, ERR_HANDLER_WARNING); \ - _err_error_exists = false; \ } -#define WARN_PRINTS(m_string) \ - { \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, String(m_string).utf8().get_data(), ERR_HANDLER_WARNING); \ - _err_error_exists = false; \ +#define WARN_PRINTS(m_string) \ + { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string, ERR_HANDLER_WARNING); \ } #define WARN_PRINT_ONCE(m_string) \ @@ -466,7 +412,6 @@ extern bool _err_error_exists; static bool first_print = true; \ if (first_print) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string, ERR_HANDLER_WARNING); \ - _err_error_exists = false; \ first_print = false; \ } \ } @@ -476,20 +421,17 @@ extern bool _err_error_exists; static volatile bool warning_shown = false; \ if (!warning_shown) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "This method has been deprecated and will be removed in the future", ERR_HANDLER_WARNING); \ - _err_error_exists = false; \ warning_shown = true; \ } \ } -#define WARN_DEPRECATED_MSG(m_msg) \ - { \ - static volatile bool warning_shown = false; \ - if (!warning_shown) { \ - ERR_EXPLAIN(m_msg); \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "This method has been deprecated and will be removed in the future", ERR_HANDLER_WARNING); \ - _err_error_exists = false; \ - warning_shown = true; \ - } \ +#define WARN_DEPRECATED_MSG(m_msg) \ + { \ + static volatile bool warning_shown = false; \ + if (!warning_shown) { \ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "This method has been deprecated and will be removed in the future", m_msg, ERR_HANDLER_WARNING); \ + warning_shown = true; \ + } \ } #endif diff --git a/core/hash_map.h b/core/hash_map.h index 38da1d59ab..edc67e7806 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -210,6 +210,7 @@ private: e->next = hash_table[index]; e->hash = hash; e->pair.key = p_key; + e->pair.data = TData(); hash_table[index] = e; elements++; diff --git a/core/image.cpp b/core/image.cpp index e0b0a1f8be..74706535b3 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -885,8 +885,8 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) { bool mipmap_aware = p_interpolation == INTERPOLATE_TRILINEAR /* || p_interpolation == INTERPOLATE_TRICUBIC */; - ERR_FAIL_COND_MSG(p_width <= 0, "Image width cannot be greater than 0."); - ERR_FAIL_COND_MSG(p_height <= 0, "Image height cannot be greater than 0."); + ERR_FAIL_COND_MSG(p_width <= 0, "Image width must be greater than 0."); + ERR_FAIL_COND_MSG(p_height <= 0, "Image height must be greater than 0."); ERR_FAIL_COND_MSG(p_width > MAX_WIDTH, "Image width cannot be greater than " + itos(MAX_WIDTH) + "."); ERR_FAIL_COND_MSG(p_height > MAX_HEIGHT, "Image height cannot be greater than " + itos(MAX_HEIGHT) + "."); @@ -1284,8 +1284,8 @@ static void _generate_po2_mipmap(const Component *p_src, Component *p_dst, uint3 Component *dst_ptr = &p_dst[i * dst_w * CC]; uint32_t count = dst_w; - while (count--) { - + while (count) { + count--; for (int j = 0; j < CC; j++) { average_func(dst_ptr[j], rup_ptr[j], rup_ptr[j + right_step], rdown_ptr[j], rdown_ptr[j + right_step]); } @@ -1322,6 +1322,8 @@ void Image::expand_x2_hq2x() { PoolVector<uint8_t>::Read r = data.read(); PoolVector<uint8_t>::Write w = dest.write(); + ERR_FAIL_COND(!r.ptr()); + hq2x_resize((const uint32_t *)r.ptr(), width, height, (uint32_t *)w.ptr()); } @@ -1373,6 +1375,7 @@ void Image::shrink_x2() { int ps = get_format_pixel_size(format); new_img.resize((width / 2) * (height / 2) * ps); ERR_FAIL_COND(new_img.size() == 0); + ERR_FAIL_COND(data.size() == 0); { PoolVector<uint8_t>::Write w = new_img.write(); @@ -2895,6 +2898,8 @@ void Image::bumpmap_to_normalmap(float bump_scale) { PoolVector<uint8_t>::Read rp = data.read(); PoolVector<uint8_t>::Write wp = result_image.write(); + ERR_FAIL_COND(!rp.ptr()); + unsigned char *write_ptr = wp.ptr(); float *read_ptr = (float *)rp.ptr(); @@ -2930,7 +2935,7 @@ void Image::srgb_to_linear() { if (data.size() == 0) return; - static const uint8_t srgb2lin[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 92, 93, 94, 95, 97, 98, 99, 101, 102, 103, 105, 106, 107, 109, 110, 112, 113, 114, 116, 117, 119, 120, 122, 123, 125, 126, 128, 129, 131, 132, 134, 135, 137, 139, 140, 142, 144, 145, 147, 148, 150, 152, 153, 155, 157, 159, 160, 162, 164, 166, 167, 169, 171, 173, 175, 176, 178, 180, 182, 184, 186, 188, 190, 192, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 218, 220, 222, 224, 226, 228, 230, 232, 235, 237, 239, 241, 243, 245, 248, 250, 252 }; + static const uint8_t srgb2lin[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 92, 93, 94, 95, 97, 98, 99, 101, 102, 103, 105, 106, 107, 109, 110, 112, 113, 114, 116, 117, 119, 120, 122, 123, 125, 126, 128, 129, 131, 132, 134, 135, 137, 139, 140, 142, 144, 145, 147, 148, 150, 152, 153, 155, 157, 159, 160, 162, 164, 166, 167, 169, 171, 173, 175, 176, 178, 180, 182, 184, 186, 188, 190, 192, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 218, 220, 222, 224, 226, 228, 230, 232, 235, 237, 239, 241, 243, 245, 248, 250, 252, 255 }; ERR_FAIL_COND(format != FORMAT_RGB8 && format != FORMAT_RGBA8); diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index 0ba84d0c8f..1426dbbd4d 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -602,7 +602,16 @@ void MultiplayerAPI::_add_peer(int p_id) { void MultiplayerAPI::_del_peer(int p_id) { connected_peers.erase(p_id); - path_get_cache.erase(p_id); // I no longer need your cache, sorry. + // Cleanup get cache. + path_get_cache.erase(p_id); + // Cleanup sent cache. + // Some refactoring is needed to make this faster and do paths GC. + List<NodePath> keys; + path_send_cache.get_key_list(&keys); + for (List<NodePath>::Element *E = keys.front(); E; E = E->next()) { + PathSentCache *psc = path_send_cache.getptr(E->get()); + psc->confirmed_peers.erase(p_id); + } emit_signal("network_peer_disconnected", p_id); } diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index ae2b56e7b7..bfa8b90344 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -164,36 +164,59 @@ void AStar::connect_points(int p_id, int p_with_id, bool bidirectional) { } Segment s(p_id, p_with_id); - if (s.from == p_id) { - s.from_point = a; - s.to_point = b; - } else { - s.from_point = b; - s.to_point = a; + if (bidirectional) s.direction = Segment::BIDIRECTIONAL; + + Set<Segment>::Element *element = segments.find(s); + if (element != NULL) { + s.direction |= element->get().direction; + if (s.direction == Segment::BIDIRECTIONAL) { + // Both are neighbours of each other now + a->unlinked_neighbours.remove(b->id); + b->unlinked_neighbours.remove(a->id); + } + segments.erase(element); } segments.insert(s); } -void AStar::disconnect_points(int p_id, int p_with_id) { - - Segment s(p_id, p_with_id); - ERR_FAIL_COND(!segments.has(s)); - - segments.erase(s); +void AStar::disconnect_points(int p_id, int p_with_id, bool bidirectional) { Point *a; bool a_exists = points.lookup(p_id, a); - CRASH_COND(!a_exists); + ERR_FAIL_COND(!a_exists); Point *b; bool b_exists = points.lookup(p_with_id, b); - CRASH_COND(!b_exists); + ERR_FAIL_COND(!b_exists); + + Segment s(p_id, p_with_id); + int remove_direction = bidirectional ? (int)Segment::BIDIRECTIONAL : s.direction; + + Set<Segment>::Element *element = segments.find(s); + if (element != NULL) { + // s is the new segment + // Erase the directions to be removed + s.direction = (element->get().direction & ~remove_direction); + + a->neighbours.remove(b->id); + if (bidirectional) { + b->neighbours.remove(a->id); + if (element->get().direction != Segment::BIDIRECTIONAL) { + a->unlinked_neighbours.remove(b->id); + b->unlinked_neighbours.remove(a->id); + } + } else { + if (s.direction == Segment::NONE) + b->unlinked_neighbours.remove(a->id); + else + a->unlinked_neighbours.set(b->id, b); + } - a->neighbours.remove(b->id); - a->unlinked_neighbours.remove(b->id); - b->neighbours.remove(a->id); - b->unlinked_neighbours.remove(a->id); + segments.erase(element); + if (s.direction != Segment::NONE) + segments.insert(s); + } } bool AStar::has_point(int p_id) const { @@ -227,10 +250,13 @@ PoolVector<int> AStar::get_point_connections(int p_id) { return point_list; } -bool AStar::are_points_connected(int p_id, int p_with_id) const { +bool AStar::are_points_connected(int p_id, int p_with_id, bool bidirectional) const { Segment s(p_id, p_with_id); - return segments.has(s); + const Set<Segment>::Element *element = segments.find(s); + + return element != NULL && + (bidirectional || (element->get().direction & s.direction) == s.direction); } void AStar::clear() { @@ -284,13 +310,17 @@ Vector3 AStar::get_closest_position_in_segment(const Vector3 &p_point) const { for (const Set<Segment>::Element *E = segments.front(); E; E = E->next()) { - if (!(E->get().from_point->enabled && E->get().to_point->enabled)) { + Point *from_point = nullptr, *to_point = nullptr; + points.lookup(E->get().u, from_point); + points.lookup(E->get().v, to_point); + + if (!(from_point->enabled && to_point->enabled)) { continue; } Vector3 segment[2] = { - E->get().from_point->pos, - E->get().to_point->pos, + from_point->pos, + to_point->pos, }; Vector3 p = Geometry::get_closest_point_to_segment(p_point, segment); @@ -376,11 +406,11 @@ float AStar::_estimate_cost(int p_from_id, int p_to_id) { Point *from_point; bool from_exists = points.lookup(p_from_id, from_point); - CRASH_COND(!from_exists); + ERR_FAIL_COND_V(!from_exists, 0); Point *to_point; bool to_exists = points.lookup(p_to_id, to_point); - CRASH_COND(!to_exists); + ERR_FAIL_COND_V(!to_exists, 0); return from_point->pos.distance_to(to_point->pos); } @@ -392,11 +422,11 @@ float AStar::_compute_cost(int p_from_id, int p_to_id) { Point *from_point; bool from_exists = points.lookup(p_from_id, from_point); - CRASH_COND(!from_exists); + ERR_FAIL_COND_V(!from_exists, 0); Point *to_point; bool to_exists = points.lookup(p_to_id, to_point); - CRASH_COND(!to_exists); + ERR_FAIL_COND_V(!to_exists, 0); return from_point->pos.distance_to(to_point->pos); } @@ -532,8 +562,8 @@ void AStar::_bind_methods() { ClassDB::bind_method(D_METHOD("is_point_disabled", "id"), &AStar::is_point_disabled); ClassDB::bind_method(D_METHOD("connect_points", "id", "to_id", "bidirectional"), &AStar::connect_points, DEFVAL(true)); - ClassDB::bind_method(D_METHOD("disconnect_points", "id", "to_id"), &AStar::disconnect_points); - ClassDB::bind_method(D_METHOD("are_points_connected", "id", "to_id"), &AStar::are_points_connected); + ClassDB::bind_method(D_METHOD("disconnect_points", "id", "to_id", "bidirectional"), &AStar::disconnect_points, DEFVAL(true)); + ClassDB::bind_method(D_METHOD("are_points_connected", "id", "to_id", "bidirectional"), &AStar::are_points_connected, DEFVAL(true)); ClassDB::bind_method(D_METHOD("get_point_count"), &AStar::get_point_count); ClassDB::bind_method(D_METHOD("get_point_capacity"), &AStar::get_point_capacity); diff --git a/core/math/a_star.h b/core/math/a_star.h index 0a5d3e992c..8ff62e646b 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -81,24 +81,35 @@ class AStar : public Reference { struct Segment { union { struct { - int32_t from; - int32_t to; + int32_t u; + int32_t v; }; uint64_t key; }; - Point *from_point; - Point *to_point; + enum { + NONE = 0, + FORWARD = 1, + BACKWARD = 2, + BIDIRECTIONAL = FORWARD | BACKWARD + }; + unsigned char direction; bool operator<(const Segment &p_s) const { return key < p_s.key; } - Segment() { key = 0; } + Segment() { + key = 0; + direction = NONE; + } Segment(int p_from, int p_to) { - if (p_from > p_to) { - SWAP(p_from, p_to); + if (p_from < p_to) { + u = p_from; + v = p_to; + direction = FORWARD; + } else { + u = p_to; + v = p_from; + direction = BACKWARD; } - - from = p_from; - to = p_to; } }; @@ -133,8 +144,8 @@ public: bool is_point_disabled(int p_id) const; void connect_points(int p_id, int p_with_id, bool bidirectional = true); - void disconnect_points(int p_id, int p_with_id); - bool are_points_connected(int p_id, int p_with_id) const; + void disconnect_points(int p_id, int p_with_id, bool bidirectional = true); + bool are_points_connected(int p_id, int p_with_id, bool bidirectional = true) const; int get_point_count() const; int get_point_capacity() const; diff --git a/core/math/aabb.cpp b/core/math/aabb.cpp index a4eb1fe2a5..27da061274 100644 --- a/core/math/aabb.cpp +++ b/core/math/aabb.cpp @@ -69,6 +69,11 @@ void AABB::merge_with(const AABB &p_aabb) { size = max - min; } +bool AABB::is_equal_approx(const AABB &p_aabb) const { + + return position.is_equal_approx(p_aabb.position) && size.is_equal_approx(p_aabb.size); +} + AABB AABB::intersection(const AABB &p_aabb) const { Vector3 src_min = position; diff --git a/core/math/aabb.h b/core/math/aabb.h index 52e5ed3626..c3ce33c6f4 100644 --- a/core/math/aabb.h +++ b/core/math/aabb.h @@ -64,6 +64,7 @@ public: bool operator==(const AABB &p_rval) const; bool operator!=(const AABB &p_rval) const; + bool is_equal_approx(const AABB &p_aabb) const; _FORCE_INLINE_ bool intersects(const AABB &p_aabb) const; /// Both AABBs overlap _FORCE_INLINE_ bool intersects_inclusive(const AABB &p_aabb) const; /// Both AABBs (or their faces) overlap _FORCE_INLINE_ bool encloses(const AABB &p_aabb) const; /// p_aabb is completely inside this diff --git a/core/math/basis.cpp b/core/math/basis.cpp index 0a491010e2..d77501c0f6 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -106,17 +106,17 @@ Basis Basis::orthonormalized() const { } bool Basis::is_orthogonal() const { - Basis id; + Basis identity; Basis m = (*this) * transposed(); - return is_equal_approx(id, m); + return m.is_equal_approx(identity); } bool Basis::is_diagonal() const { return ( - Math::is_equal_approx(elements[0][1], 0) && Math::is_equal_approx(elements[0][2], 0) && - Math::is_equal_approx(elements[1][0], 0) && Math::is_equal_approx(elements[1][2], 0) && - Math::is_equal_approx(elements[2][0], 0) && Math::is_equal_approx(elements[2][1], 0)); + Math::is_zero_approx(elements[0][1]) && Math::is_zero_approx(elements[0][2]) && + Math::is_zero_approx(elements[1][0]) && Math::is_zero_approx(elements[1][2]) && + Math::is_zero_approx(elements[2][0]) && Math::is_zero_approx(elements[2][1])); } bool Basis::is_rotation() const { @@ -557,16 +557,9 @@ void Basis::set_euler_yxz(const Vector3 &p_euler) { *this = ymat * xmat * zmat; } -bool Basis::is_equal_approx(const Basis &a, const Basis &b, real_t p_epsilon) const { +bool Basis::is_equal_approx(const Basis &p_basis) const { - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 3; j++) { - if (!Math::is_equal_approx(a.elements[i][j], b.elements[i][j], p_epsilon)) - return false; - } - } - - return true; + return elements[0].is_equal_approx(p_basis.elements[0]) && elements[1].is_equal_approx(p_basis.elements[1]) && elements[2].is_equal_approx(p_basis.elements[2]); } bool Basis::is_equal_approx_ratio(const Basis &a, const Basis &b, real_t p_epsilon) const { diff --git a/core/math/basis.h b/core/math/basis.h index 4be4ea4cd3..9b2e38b3d3 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -127,7 +127,9 @@ public: return elements[0][2] * v[0] + elements[1][2] * v[1] + elements[2][2] * v[2]; } - bool is_equal_approx(const Basis &a, const Basis &b, real_t p_epsilon = CMP_EPSILON) const; + bool is_equal_approx(const Basis &p_basis) const; + // TODO: Break compatibility in 4.0 by getting rid of this so that it's only an instance method. See also TODO in variant_call.cpp + bool is_equal_approx(const Basis &a, const Basis &b) const { return a.is_equal_approx(b); } bool is_equal_approx_ratio(const Basis &a, const Basis &b, real_t p_epsilon = UNIT_EPSILON) const; bool operator==(const Basis &p_matrix) const; diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index cfa698282e..ece293d036 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -364,7 +364,7 @@ static int _bsp_create_node(const Face3 *p_faces, const Vector<int> &p_indices, const Face3 &f = p_faces[indices[i]]; /* - if (f.get_plane().is_almost_like(divisor_plane)) + if (f.get_plane().is_equal_approx(divisor_plane)) continue; */ @@ -412,7 +412,7 @@ static int _bsp_create_node(const Face3 *p_faces, const Vector<int> &p_indices, for (int i = 0; i < p_planes.size(); i++) { - if (p_planes[i].is_almost_like(divisor_plane)) { + if (p_planes[i].is_equal_approx(divisor_plane)) { divisor_plane_idx = i; break; } diff --git a/core/math/delaunay.h b/core/math/delaunay.h index 3f8013a3e6..89a34de082 100644 --- a/core/math/delaunay.h +++ b/core/math/delaunay.h @@ -80,11 +80,11 @@ public: } static bool edge_compare(const Vector<Vector2> &p_vertices, const Edge &p_a, const Edge &p_b) { - if (p_vertices[p_a.edge[0]] == p_vertices[p_b.edge[0]] && p_vertices[p_a.edge[1]] == p_vertices[p_b.edge[1]]) { + if (p_vertices[p_a.edge[0]].is_equal_approx(p_vertices[p_b.edge[0]]) && p_vertices[p_a.edge[1]].is_equal_approx(p_vertices[p_b.edge[1]])) { return true; } - if (p_vertices[p_a.edge[0]] == p_vertices[p_b.edge[1]] && p_vertices[p_a.edge[1]] == p_vertices[p_b.edge[0]]) { + if (p_vertices[p_a.edge[0]].is_equal_approx(p_vertices[p_b.edge[1]]) && p_vertices[p_a.edge[1]].is_equal_approx(p_vertices[p_b.edge[0]])) { return true; } diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index 9078abea68..a94b27fcc5 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -472,7 +472,7 @@ public: return p_step != 0 ? Math::stepify(p_target - p_offset, p_step) + p_offset : p_target; } - static _ALWAYS_INLINE_ float snap_scalar_seperation(float p_offset, float p_step, float p_target, float p_separation) { + static _ALWAYS_INLINE_ float snap_scalar_separation(float p_offset, float p_step, float p_target, float p_separation) { if (p_step != 0) { float a = Math::stepify(p_target - p_offset, p_step + p_separation) + p_offset; float b = a; diff --git a/core/math/plane.cpp b/core/math/plane.cpp index b01853c4ac..d55957cd0a 100644 --- a/core/math/plane.cpp +++ b/core/math/plane.cpp @@ -32,9 +32,6 @@ #include "core/math/math_funcs.h" -#define _PLANE_EQ_DOT_EPSILON 0.999 -#define _PLANE_EQ_D_EPSILON 0.0001 - void Plane::set_normal(const Vector3 &p_normal) { normal = p_normal; @@ -91,7 +88,7 @@ bool Plane::intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r real_t denom = vec3_cross(normal0, normal1).dot(normal2); - if (ABS(denom) <= CMP_EPSILON) + if (Math::is_zero_approx(denom)) return false; if (r_result) { @@ -156,9 +153,9 @@ bool Plane::intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vec /* misc */ -bool Plane::is_almost_like(const Plane &p_plane) const { +bool Plane::is_equal_approx(const Plane &p_plane) const { - return (normal.dot(p_plane.normal) > _PLANE_EQ_DOT_EPSILON && Math::absd(d - p_plane.d) < _PLANE_EQ_D_EPSILON); + return normal.is_equal_approx(p_plane.normal) && Math::is_equal_approx(d, p_plane.d); } Plane::operator String() const { diff --git a/core/math/plane.h b/core/math/plane.h index ec817edd2c..9abf24fbba 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -68,7 +68,7 @@ public: /* misc */ Plane operator-() const { return Plane(-normal, -d); } - bool is_almost_like(const Plane &p_plane) const; + bool is_equal_approx(const Plane &p_plane) const; _FORCE_INLINE_ bool operator==(const Plane &p_plane) const; _FORCE_INLINE_ bool operator!=(const Plane &p_plane) const; @@ -125,12 +125,12 @@ Plane::Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_ bool Plane::operator==(const Plane &p_plane) const { - return normal == p_plane.normal && Math::is_equal_approx(d, p_plane.d); + return normal == p_plane.normal && d == p_plane.d; } bool Plane::operator!=(const Plane &p_plane) const { - return normal != p_plane.normal || !Math::is_equal_approx(d, p_plane.d); + return normal != p_plane.normal || d != p_plane.d; } #endif // PLANE_H diff --git a/core/math/quat.cpp b/core/math/quat.cpp index 1a67be7384..a4f91844b9 100644 --- a/core/math/quat.cpp +++ b/core/math/quat.cpp @@ -121,6 +121,11 @@ Quat Quat::operator*(const Quat &q) const { return r; } +bool Quat::is_equal_approx(const Quat &p_quat) const { + + return Math::is_equal_approx(x, p_quat.x) && Math::is_equal_approx(y, p_quat.y) && Math::is_equal_approx(z, p_quat.z) && Math::is_equal_approx(w, p_quat.w); +} + real_t Quat::length() const { return Math::sqrt(length_squared()); diff --git a/core/math/quat.h b/core/math/quat.h index 3d6602e466..27885f4152 100644 --- a/core/math/quat.h +++ b/core/math/quat.h @@ -43,6 +43,7 @@ public: real_t x, y, z, w; _FORCE_INLINE_ real_t length_squared() const; + bool is_equal_approx(const Quat &p_quat) const; real_t length() const; void normalize(); Quat normalized() const; diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index fc2eb1454d..f71f00afd6 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -401,7 +401,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me ERR_CONTINUE(O == E); ERR_CONTINUE(O == NULL); - if (O->get().plane.is_almost_like(f.plane)) { + if (O->get().plane.is_equal_approx(f.plane)) { //merge and delete edge and contiguous face, while repointing edges (uuugh!) int ois = O->get().indices.size(); int merged = 0; diff --git a/core/math/rect2.cpp b/core/math/rect2.cpp index fea128afbd..e31776672e 100644 --- a/core/math/rect2.cpp +++ b/core/math/rect2.cpp @@ -30,6 +30,11 @@ #include "core/math/transform_2d.h" // Includes rect2.h but Rect2 needs Transform2D +bool Rect2::is_equal_approx(const Rect2 &p_rect) const { + + return position.is_equal_approx(p_rect.position) && size.is_equal_approx(p_rect.size); +} + bool Rect2::intersects_segment(const Point2 &p_from, const Point2 &p_to, Point2 *r_pos, Point2 *r_normal) const { real_t min = 0, max = 1; diff --git a/core/math/rect2.h b/core/math/rect2.h index f58756ee40..71221ffb1b 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -153,6 +153,7 @@ struct Rect2 { return true; } + bool is_equal_approx(const Rect2 &p_rect) const; bool operator==(const Rect2 &p_rect) const { return position == p_rect.position && size == p_rect.size; } bool operator!=(const Rect2 &p_rect) const { return position != p_rect.position || size != p_rect.size; } diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 4056975da8..5dcc6ab9f0 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -182,6 +182,11 @@ Transform Transform::orthonormalized() const { return _copy; } +bool Transform::is_equal_approx(const Transform &p_transform) const { + + return basis.is_equal_approx(p_transform.basis) && origin.is_equal_approx(p_transform.origin); +} + bool Transform::operator==(const Transform &p_transform) const { return (basis == p_transform.basis && origin == p_transform.origin); diff --git a/core/math/transform.h b/core/math/transform.h index 90e2b07583..da65a183cf 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -70,6 +70,7 @@ public: void orthonormalize(); Transform orthonormalized() const; + bool is_equal_approx(const Transform &p_transform) const; bool operator==(const Transform &p_transform) const; bool operator!=(const Transform &p_transform) const; diff --git a/core/math/transform_2d.cpp b/core/math/transform_2d.cpp index 1d0387bd45..a1c0814637 100644 --- a/core/math/transform_2d.cpp +++ b/core/math/transform_2d.cpp @@ -147,6 +147,7 @@ void Transform2D::orthonormalize() { elements[0] = x; elements[1] = y; } + Transform2D Transform2D::orthonormalized() const { Transform2D on = *this; @@ -154,6 +155,11 @@ Transform2D Transform2D::orthonormalized() const { return on; } +bool Transform2D::is_equal_approx(const Transform2D &p_transform) const { + + return elements[0].is_equal_approx(p_transform.elements[0]) && elements[1].is_equal_approx(p_transform.elements[1]) && elements[2].is_equal_approx(p_transform.elements[2]); +} + bool Transform2D::operator==(const Transform2D &p_transform) const { for (int i = 0; i < 3; i++) { diff --git a/core/math/transform_2d.h b/core/math/transform_2d.h index e8b44ab197..0ec39a1765 100644 --- a/core/math/transform_2d.h +++ b/core/math/transform_2d.h @@ -96,6 +96,7 @@ struct Transform2D { void orthonormalize(); Transform2D orthonormalized() const; + bool is_equal_approx(const Transform2D &p_transform) const; bool operator==(const Transform2D &p_transform) const; bool operator!=(const Transform2D &p_transform) const; diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index 972bccc0ac..fbedeb8eb2 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -203,6 +203,10 @@ Vector2 Vector2::reflect(const Vector2 &p_normal) const { return 2.0 * p_normal * this->dot(p_normal) - *this; } +bool Vector2::is_equal_approx(const Vector2 &p_v) const { + return Math::is_equal_approx(x, p_v.x) && Math::is_equal_approx(y, p_v.y); +} + /* Vector2i */ Vector2i Vector2i::operator+(const Vector2i &p_v) const { diff --git a/core/math/vector2.h b/core/math/vector2.h index 1a73831891..7fcaadab00 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -92,6 +92,8 @@ struct Vector2 { Vector2 bounce(const Vector2 &p_normal) const; Vector2 reflect(const Vector2 &p_normal) const; + bool is_equal_approx(const Vector2 &p_v) const; + Vector2 operator+(const Vector2 &p_v) const; void operator+=(const Vector2 &p_v); Vector2 operator-(const Vector2 &p_v) const; @@ -221,11 +223,11 @@ _FORCE_INLINE_ Vector2 Vector2::operator-() const { _FORCE_INLINE_ bool Vector2::operator==(const Vector2 &p_vec2) const { - return Math::is_equal_approx(x, p_vec2.x) && Math::is_equal_approx(y, p_vec2.y); + return x == p_vec2.x && y == p_vec2.y; } _FORCE_INLINE_ bool Vector2::operator!=(const Vector2 &p_vec2) const { - return !Math::is_equal_approx(x, p_vec2.x) || !Math::is_equal_approx(y, p_vec2.y); + return x != p_vec2.x || y != p_vec2.y; } Vector2 Vector2::linear_interpolate(const Vector2 &p_b, real_t p_t) const { diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index ebc1599820..e3211c8fb1 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -149,6 +149,11 @@ Basis Vector3::to_diagonal_matrix() const { 0, 0, z); } +bool Vector3::is_equal_approx(const Vector3 &p_v) const { + + return Math::is_equal_approx(x, p_v.x) && Math::is_equal_approx(y, p_v.y) && Math::is_equal_approx(z, p_v.z); +} + Vector3::operator String() const { return (rtos(x) + ", " + rtos(y) + ", " + rtos(z)); diff --git a/core/math/vector3.h b/core/math/vector3.h index de1743d88f..43fa09ffac 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -119,6 +119,8 @@ struct Vector3 { _FORCE_INLINE_ Vector3 bounce(const Vector3 &p_normal) const; _FORCE_INLINE_ Vector3 reflect(const Vector3 &p_normal) const; + bool is_equal_approx(const Vector3 &p_v) const; + /* Operators */ _FORCE_INLINE_ Vector3 &operator+=(const Vector3 &p_v); @@ -330,11 +332,12 @@ Vector3 Vector3::operator-() const { bool Vector3::operator==(const Vector3 &p_v) const { - return (Math::is_equal_approx(x, p_v.x) && Math::is_equal_approx(y, p_v.y) && Math::is_equal_approx(z, p_v.z)); + return x == p_v.x && y == p_v.y && z == p_v.z; } bool Vector3::operator!=(const Vector3 &p_v) const { - return (!Math::is_equal_approx(x, p_v.x) || !Math::is_equal_approx(y, p_v.y) || !Math::is_equal_approx(z, p_v.z)); + + return x != p_v.x || y != p_v.y || z != p_v.z; } bool Vector3::operator<(const Vector3 &p_v) const { diff --git a/core/object.cpp b/core/object.cpp index 6facf38733..ed3ae4f25d 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -436,7 +436,7 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid } else if (p_name == CoreStringNames::get_singleton()->_meta) { //set_meta(p_name,p_value); - metadata = p_value; + metadata = p_value.duplicate(); if (r_valid) *r_valid = true; return; diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 30fca0c155..f09a904953 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -49,11 +49,11 @@ bool InputEvent::is_action(const StringName &p_action) const { return InputMap::get_singleton()->event_is_action(Ref<InputEvent>((InputEvent *)this), p_action); } -bool InputEvent::is_action_pressed(const StringName &p_action) const { +bool InputEvent::is_action_pressed(const StringName &p_action, bool p_allow_echo) const { bool pressed; bool valid = InputMap::get_singleton()->event_get_action_status(Ref<InputEvent>((InputEvent *)this), p_action, &pressed); - return valid && pressed && !is_echo(); + return valid && pressed && (p_allow_echo || !is_echo()); } bool InputEvent::is_action_released(const StringName &p_action) const { @@ -112,7 +112,7 @@ void InputEvent::_bind_methods() { ClassDB::bind_method(D_METHOD("get_device"), &InputEvent::get_device); ClassDB::bind_method(D_METHOD("is_action", "action"), &InputEvent::is_action); - ClassDB::bind_method(D_METHOD("is_action_pressed", "action"), &InputEvent::is_action_pressed); + ClassDB::bind_method(D_METHOD("is_action_pressed", "action", "allow_echo"), &InputEvent::is_action_pressed, DEFVAL(false)); ClassDB::bind_method(D_METHOD("is_action_released", "action"), &InputEvent::is_action_released); ClassDB::bind_method(D_METHOD("get_action_strength", "action"), &InputEvent::get_action_strength); @@ -557,10 +557,31 @@ InputEventMouseButton::InputEventMouseButton() { //////////////////////////////////////////// +void InputEventMouseMotion::set_tilt(const Vector2 &p_tilt) { + + tilt = p_tilt; +} + +Vector2 InputEventMouseMotion::get_tilt() const { + + return tilt; +} + +void InputEventMouseMotion::set_pressure(float p_pressure) { + + pressure = p_pressure; +} + +float InputEventMouseMotion::get_pressure() const { + + return pressure; +} + void InputEventMouseMotion::set_relative(const Vector2 &p_relative) { relative = p_relative; } + Vector2 InputEventMouseMotion::get_relative() const { return relative; @@ -570,6 +591,7 @@ void InputEventMouseMotion::set_speed(const Vector2 &p_speed) { speed = p_speed; } + Vector2 InputEventMouseMotion::get_speed() const { return speed; @@ -590,6 +612,8 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co mm->set_modifiers_from_event(this); mm->set_position(l); + mm->set_pressure(get_pressure()); + mm->set_tilt(get_tilt()); mm->set_global_position(g); mm->set_button_mask(get_button_mask()); @@ -665,17 +689,27 @@ bool InputEventMouseMotion::accumulate(const Ref<InputEvent> &p_event) { void InputEventMouseMotion::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_tilt", "tilt"), &InputEventMouseMotion::set_tilt); + ClassDB::bind_method(D_METHOD("get_tilt"), &InputEventMouseMotion::get_tilt); + + 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_relative", "relative"), &InputEventMouseMotion::set_relative); ClassDB::bind_method(D_METHOD("get_relative"), &InputEventMouseMotion::get_relative); ClassDB::bind_method(D_METHOD("set_speed", "speed"), &InputEventMouseMotion::set_speed); ClassDB::bind_method(D_METHOD("get_speed"), &InputEventMouseMotion::get_speed); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "tilt"), "set_tilt", "get_tilt"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "pressure"), "set_pressure", "get_pressure"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "relative"), "set_relative", "get_relative"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "speed"), "set_speed", "get_speed"); } InputEventMouseMotion::InputEventMouseMotion() { + + pressure = 0; } //////////////////////////////////////// diff --git a/core/os/input_event.h b/core/os/input_event.h index 28658e3865..a4db618bfe 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -184,7 +184,7 @@ public: int get_device() const; bool is_action(const StringName &p_action) const; - bool is_action_pressed(const StringName &p_action) const; + bool is_action_pressed(const StringName &p_action, bool p_allow_echo = false) const; bool is_action_released(const StringName &p_action) const; float get_action_strength(const StringName &p_action) const; @@ -351,6 +351,9 @@ public: class InputEventMouseMotion : public InputEventMouse { GDCLASS(InputEventMouseMotion, InputEventMouse); + + Vector2 tilt; + float pressure; Vector2 relative; Vector2 speed; @@ -358,6 +361,12 @@ protected: static void _bind_methods(); public: + void set_tilt(const Vector2 &p_tilt); + Vector2 get_tilt() const; + + void set_pressure(float p_pressure); + float get_pressure() const; + void set_relative(const Vector2 &p_relative); Vector2 get_relative() const; diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 5587e827ba..146a301995 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -65,6 +65,8 @@ void MainLoop::_bind_methods() { BIND_CONSTANT(NOTIFICATION_OS_IME_UPDATE); BIND_CONSTANT(NOTIFICATION_APP_RESUMED); BIND_CONSTANT(NOTIFICATION_APP_PAUSED); + + ADD_SIGNAL(MethodInfo("on_request_permissions_result", PropertyInfo(Variant::STRING, "permission"), PropertyInfo(Variant::BOOL, "granted"))); }; void MainLoop::set_init_script(const Ref<Script> &p_init_script) { diff --git a/core/os/memory.cpp b/core/os/memory.cpp index d1de51f3db..f4ed1d6e27 100644 --- a/core/os/memory.cpp +++ b/core/os/memory.cpp @@ -50,20 +50,17 @@ void *operator new(size_t p_size, void *(*p_allocfunc)(size_t p_size)) { #ifdef _MSC_VER void operator delete(void *p_mem, const char *p_description) { - ERR_EXPLAINC("Call to placement delete should not happen."); - CRASH_NOW(); + CRASH_NOW_MSG("Call to placement delete should not happen."); } void operator delete(void *p_mem, void *(*p_allocfunc)(size_t p_size)) { - ERR_EXPLAINC("Call to placement delete should not happen."); - CRASH_NOW(); + CRASH_NOW_MSG("Call to placement delete should not happen."); } void operator delete(void *p_mem, void *p_pointer, size_t check, const char *p_description) { - ERR_EXPLAINC("Call to placement delete should not happen."); - CRASH_NOW(); + CRASH_NOW_MSG("Call to placement delete should not happen."); } #endif diff --git a/core/os/os.cpp b/core/os/os.cpp index b44487b908..25889de1b3 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -196,29 +196,6 @@ bool OS::is_stdout_verbose() const { return _verbose_stdout; } -void OS::set_last_error(const char *p_error) { - - GLOBAL_LOCK_FUNCTION - if (p_error == NULL) - p_error = "Unknown Error"; - - if (last_error) - memfree(last_error); - last_error = NULL; - int len = 0; - while (p_error[len++]) - ; - - last_error = (char *)memalloc(len); - for (int i = 0; i < len; i++) - last_error[i] = p_error[i]; -} - -const char *OS::get_last_error() const { - GLOBAL_LOCK_FUNCTION - return last_error ? last_error : ""; -} - void OS::dump_memory_to_file(const char *p_file) { //Memory::dump_static_mem_to_file(p_file); @@ -297,14 +274,6 @@ void OS::dump_resources_to_file(const char *p_file) { ResourceCache::dump(p_file); } -void OS::clear_last_error() { - - GLOBAL_LOCK_FUNCTION - if (last_error) - memfree(last_error); - last_error = NULL; -} - void OS::set_no_window_mode(bool p_enable) { _no_window = p_enable; @@ -764,7 +733,6 @@ OS::OS() { void *volatile stack_bottom; restart_on_exit = false; - last_error = NULL; singleton = this; _keep_screen_on = true; // set default value to true, because this had been true before godot 2.0. low_processor_usage_mode = false; @@ -790,8 +758,6 @@ OS::OS() { } OS::~OS() { - if (last_error) - memfree(last_error); memdelete(_logger); singleton = NULL; } diff --git a/core/os/os.h b/core/os/os.h index 9b46b43081..687ccaaba5 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -61,8 +61,6 @@ class OS { bool _allow_layered; bool _use_vsync; - char *last_error; - void *_stack_bottom; CompositeLogger *_logger; @@ -155,10 +153,6 @@ public: virtual void alert(const String &p_alert, const String &p_title = "ALERT!") = 0; virtual String get_stdin_string(bool p_block = true) = 0; - virtual void set_last_error(const char *p_error); - virtual const char *get_last_error() const; - virtual void clear_last_error(); - enum MouseMode { MOUSE_MODE_VISIBLE, MOUSE_MODE_HIDDEN, @@ -530,6 +524,8 @@ public: List<String> get_restart_on_exit_arguments() const; virtual bool request_permission(const String &p_name) { return true; } + virtual bool request_permissions() { return true; } + virtual Vector<String> get_granted_permissions() const { return Vector<String>(); } virtual void process_and_drop_events() {} OS(); diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index 003e7e7428..7afaf7f0f1 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -137,6 +137,7 @@ uint32_t PackedDataContainer::_type_at_ofs(uint32_t p_ofs) const { int PackedDataContainer::_size(uint32_t p_ofs) const { PoolVector<uint8_t>::Read rd = data.read(); + ERR_FAIL_COND_V(!rd.ptr(), 0); const uint8_t *r = &rd[p_ofs]; uint32_t type = decode_uint32(r); diff --git a/core/pool_vector.h b/core/pool_vector.h index fbd4d630be..a698e72e18 100644 --- a/core/pool_vector.h +++ b/core/pool_vector.h @@ -385,6 +385,7 @@ public: } inline int size() const; + inline bool empty() const; T get(int p_index) const; void set(int p_index, const T &p_val); void push_back(const T &p_val); @@ -475,6 +476,12 @@ int PoolVector<T>::size() const { } template <class T> +bool PoolVector<T>::empty() const { + + return alloc ? alloc->size == 0 : true; +} + +template <class T> T PoolVector<T>::get(int p_index) const { return operator[](p_index); diff --git a/core/project_settings.cpp b/core/project_settings.cpp index c2241ed926..7704c7b377 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -107,7 +107,7 @@ String ProjectSettings::localize_path(const String &p_path) const { if (plocal == "") { return ""; }; - return plocal + path.substr(sep, path.size() - sep); + return plocal + path.substr((sep + 1), path.size() - (sep + 1)); }; } diff --git a/core/ref_ptr.cpp b/core/ref_ptr.cpp index 961f143e5c..6da73ca41a 100644 --- a/core/ref_ptr.cpp +++ b/core/ref_ptr.cpp @@ -49,6 +49,14 @@ bool RefPtr::operator==(const RefPtr &p_other) const { return *ref == *ref_other; } +bool RefPtr::operator!=(const RefPtr &p_other) const { + + Ref<Reference> *ref = reinterpret_cast<Ref<Reference> *>(&data[0]); + Ref<Reference> *ref_other = reinterpret_cast<Ref<Reference> *>(const_cast<char *>(&p_other.data[0])); + + return *ref != *ref_other; +} + RefPtr::RefPtr(const RefPtr &p_other) { memnew_placement(&data[0], Ref<Reference>); diff --git a/core/ref_ptr.h b/core/ref_ptr.h index f745ababa1..320cf35609 100644 --- a/core/ref_ptr.h +++ b/core/ref_ptr.h @@ -50,6 +50,7 @@ public: bool is_null() const; void operator=(const RefPtr &p_other); bool operator==(const RefPtr &p_other) const; + bool operator!=(const RefPtr &p_other) const; RID get_rid() const; void unref(); _FORCE_INLINE_ void *get_data() const { return data; } diff --git a/core/script_language.cpp b/core/script_language.cpp index 7201773ea5..cbe4681eca 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -218,6 +218,7 @@ void ScriptServer::global_classes_clear() { } void ScriptServer::add_global_class(const StringName &p_class, const StringName &p_base, const StringName &p_language, const String &p_path) { + ERR_FAIL_COND_MSG(p_class == p_base || (global_classes.has(p_base) && get_global_class_native_base(p_base) == p_class), "Cyclic inheritance in script class."); GlobalScriptClass g; g.language = p_language; g.path = p_path; diff --git a/core/script_language.h b/core/script_language.h index 116918fdc0..f90bb4b6c3 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -427,31 +427,6 @@ class ScriptDebugger { ScriptLanguage *break_lang; public: - typedef void (*RequestSceneTreeMessageFunc)(void *); - - struct LiveEditFuncs { - - void *udata; - void (*node_path_func)(void *, const NodePath &p_path, int p_id); - void (*res_path_func)(void *, const String &p_path, int p_id); - - void (*node_set_func)(void *, int p_id, const StringName &p_prop, const Variant &p_value); - void (*node_set_res_func)(void *, int p_id, const StringName &p_prop, const String &p_value); - void (*node_call_func)(void *, int p_id, const StringName &p_method, VARIANT_ARG_DECLARE); - void (*res_set_func)(void *, int p_id, const StringName &p_prop, const Variant &p_value); - void (*res_set_res_func)(void *, int p_id, const StringName &p_prop, const String &p_value); - void (*res_call_func)(void *, int p_id, const StringName &p_method, VARIANT_ARG_DECLARE); - void (*root_func)(void *, const NodePath &p_scene_path, const String &p_scene_from); - - void (*tree_create_node_func)(void *, const NodePath &p_parent, const String &p_type, const String &p_name); - void (*tree_instance_node_func)(void *, const NodePath &p_parent, const String &p_path, const String &p_name); - void (*tree_remove_node_func)(void *, const NodePath &p_at); - void (*tree_remove_and_keep_node_func)(void *, const NodePath &p_at, ObjectID p_keep_id); - void (*tree_restore_node_func)(void *, ObjectID p_id, const NodePath &p_at, int p_at_pos); - void (*tree_duplicate_node_func)(void *, const NodePath &p_at, const String &p_new_name); - void (*tree_reparent_node_func)(void *, const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos); - }; - _FORCE_INLINE_ static ScriptDebugger *get_singleton() { return singleton; } void set_lines_left(int p_left); int get_lines_left() const; @@ -480,8 +455,6 @@ public: virtual bool is_remote() const { return false; } virtual void request_quit() {} - virtual void set_request_scene_tree_message_func(RequestSceneTreeMessageFunc p_func, void *p_udata) {} - virtual void set_live_edit_funcs(LiveEditFuncs *p_funcs) {} virtual void set_multiplayer(Ref<MultiplayerAPI> p_multiplayer) {} virtual bool is_profiling() const = 0; diff --git a/core/translation.cpp b/core/translation.cpp index a0902d71fc..4a1ac26433 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -986,6 +986,7 @@ Array TranslationServer::get_loaded_locales() const { for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) { const Ref<Translation> &t = E->get(); + ERR_FAIL_COND_V(t.is_null(), Array()); String l = t->get_locale(); locales.push_back(l); @@ -1057,6 +1058,7 @@ StringName TranslationServer::translate(const StringName &p_message) const { for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) { const Ref<Translation> &t = E->get(); + ERR_FAIL_COND_V(t.is_null(), StringName("")); String l = t->get_locale(); if (lptr[0] != l[0] || lptr[1] != l[1]) continue; // Language code does not match. @@ -1085,6 +1087,7 @@ StringName TranslationServer::translate(const StringName &p_message) const { for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) { const Ref<Translation> &t = E->get(); + ERR_FAIL_COND_V(t.is_null(), StringName("")); String l = t->get_locale(); if (fptr[0] != l[0] || fptr[1] != l[1]) continue; // Language code does not match. diff --git a/core/ustring.cpp b/core/ustring.cpp index f029ae4200..0f82ca7e15 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -1337,7 +1337,17 @@ String String::num_scientific(double p_num) { char buf[256]; #if defined(__GNUC__) || defined(_MSC_VER) + +#if (defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER < 1900)) && defined(_TWO_DIGIT_EXPONENT) && !defined(_UCRT) + // MinGW and old MSC require _set_output_format() to conform to C99 output for printf + unsigned int old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT); +#endif snprintf(buf, 256, "%lg", p_num); + +#if (defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER < 1900)) && defined(_TWO_DIGIT_EXPONENT) && !defined(_UCRT) + _set_output_format(old_exponent_format); +#endif + #else sprintf(buf, "%.16lg", p_num); #endif @@ -4058,6 +4068,11 @@ String itos(int64_t p_val) { return String::num_int64(p_val); } +String uitos(uint64_t p_val) { + + return String::num_uint64(p_val); +} + String rtos(double p_val) { return String::num(p_val); diff --git a/core/ustring.h b/core/ustring.h index 15e2c07d9f..dfc5044942 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -369,6 +369,7 @@ String operator+(const char *p_chr, const String &p_str); String operator+(CharType p_chr, const String &p_str); String itos(int64_t p_val); +String uitos(uint64_t p_val); String rtos(double p_val); String rtoss(double p_val); //scientific version diff --git a/core/variant.cpp b/core/variant.cpp index 16bbf94c54..e0cc6685f4 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -3299,7 +3299,7 @@ String vformat(const String &p_text, const Variant &p1, const Variant &p2, const bool error = false; String fmt = p_text.sprintf(args, &error); - ERR_FAIL_COND_V(error, String()); + ERR_FAIL_COND_V_MSG(error, String(), fmt); return fmt; } diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 40b944744b..6e593a308d 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -351,12 +351,13 @@ struct _VariantCall { r_ret = retval; } - VCALL_LOCALMEM0R(Vector2, normalized); + VCALL_LOCALMEM1R(Vector2, distance_to); + VCALL_LOCALMEM1R(Vector2, distance_squared_to); VCALL_LOCALMEM0R(Vector2, length); VCALL_LOCALMEM0R(Vector2, length_squared); + VCALL_LOCALMEM0R(Vector2, normalized); VCALL_LOCALMEM0R(Vector2, is_normalized); - VCALL_LOCALMEM1R(Vector2, distance_to); - VCALL_LOCALMEM1R(Vector2, distance_squared_to); + VCALL_LOCALMEM1R(Vector2, is_equal_approx); VCALL_LOCALMEM1R(Vector2, posmod); VCALL_LOCALMEM1R(Vector2, posmodv); VCALL_LOCALMEM1R(Vector2, project); @@ -385,24 +386,28 @@ struct _VariantCall { VCALL_LOCALMEM0R(Vector2, sign); VCALL_LOCALMEM0R(Rect2, get_area); + VCALL_LOCALMEM0R(Rect2, has_no_area); + VCALL_LOCALMEM1R(Rect2, has_point); + VCALL_LOCALMEM1R(Rect2, is_equal_approx); VCALL_LOCALMEM1R(Rect2, intersects); VCALL_LOCALMEM1R(Rect2, encloses); - VCALL_LOCALMEM0R(Rect2, has_no_area); VCALL_LOCALMEM1R(Rect2, clip); VCALL_LOCALMEM1R(Rect2, merge); - VCALL_LOCALMEM1R(Rect2, has_point); + VCALL_LOCALMEM1R(Rect2, expand); VCALL_LOCALMEM1R(Rect2, grow); VCALL_LOCALMEM2R(Rect2, grow_margin); VCALL_LOCALMEM4R(Rect2, grow_individual); - VCALL_LOCALMEM1R(Rect2, expand); VCALL_LOCALMEM0R(Rect2, abs); VCALL_LOCALMEM0R(Vector3, min_axis); VCALL_LOCALMEM0R(Vector3, max_axis); + VCALL_LOCALMEM1R(Vector3, distance_to); + VCALL_LOCALMEM1R(Vector3, distance_squared_to); VCALL_LOCALMEM0R(Vector3, length); VCALL_LOCALMEM0R(Vector3, length_squared); - VCALL_LOCALMEM0R(Vector3, is_normalized); VCALL_LOCALMEM0R(Vector3, normalized); + VCALL_LOCALMEM0R(Vector3, is_normalized); + VCALL_LOCALMEM1R(Vector3, is_equal_approx); VCALL_LOCALMEM0R(Vector3, inverse); VCALL_LOCALMEM1R(Vector3, snapped); VCALL_LOCALMEM2R(Vector3, rotated); @@ -418,8 +423,6 @@ struct _VariantCall { VCALL_LOCALMEM0R(Vector3, floor); VCALL_LOCALMEM0R(Vector3, ceil); VCALL_LOCALMEM0R(Vector3, round); - VCALL_LOCALMEM1R(Vector3, distance_to); - VCALL_LOCALMEM1R(Vector3, distance_squared_to); VCALL_LOCALMEM1R(Vector3, posmod); VCALL_LOCALMEM1R(Vector3, posmodv); VCALL_LOCALMEM1R(Vector3, project); @@ -433,6 +436,7 @@ struct _VariantCall { VCALL_LOCALMEM0R(Plane, normalized); VCALL_LOCALMEM0R(Plane, center); VCALL_LOCALMEM0R(Plane, get_any_point); + VCALL_LOCALMEM1R(Plane, is_equal_approx); VCALL_LOCALMEM1R(Plane, is_point_over); VCALL_LOCALMEM1R(Plane, distance_to); VCALL_LOCALMEM2R(Plane, has_point); @@ -467,6 +471,7 @@ struct _VariantCall { VCALL_LOCALMEM0R(Quat, length_squared); VCALL_LOCALMEM0R(Quat, normalized); VCALL_LOCALMEM0R(Quat, is_normalized); + VCALL_LOCALMEM1R(Quat, is_equal_approx); VCALL_LOCALMEM0R(Quat, inverse); VCALL_LOCALMEM1R(Quat, dot); VCALL_LOCALMEM1R(Quat, xform); @@ -492,6 +497,7 @@ struct _VariantCall { VCALL_LOCALMEM1R(Color, darkened); VCALL_LOCALMEM1R(Color, to_html); VCALL_LOCALMEM4R(Color, from_hsv); + VCALL_LOCALMEM1R(Color, is_equal_approx); VCALL_LOCALMEM0R(RID, get_id); @@ -626,6 +632,7 @@ struct _VariantCall { } VCALL_LOCALMEM0R(PoolByteArray, size); + VCALL_LOCALMEM0R(PoolByteArray, empty); VCALL_LOCALMEM2(PoolByteArray, set); VCALL_LOCALMEM1R(PoolByteArray, get); VCALL_LOCALMEM1(PoolByteArray, push_back); @@ -638,6 +645,7 @@ struct _VariantCall { VCALL_LOCALMEM2R(PoolByteArray, subarray); VCALL_LOCALMEM0R(PoolIntArray, size); + VCALL_LOCALMEM0R(PoolIntArray, empty); VCALL_LOCALMEM2(PoolIntArray, set); VCALL_LOCALMEM1R(PoolIntArray, get); VCALL_LOCALMEM1(PoolIntArray, push_back); @@ -649,6 +657,7 @@ struct _VariantCall { VCALL_LOCALMEM0(PoolIntArray, invert); VCALL_LOCALMEM0R(PoolRealArray, size); + VCALL_LOCALMEM0R(PoolRealArray, empty); VCALL_LOCALMEM2(PoolRealArray, set); VCALL_LOCALMEM1R(PoolRealArray, get); VCALL_LOCALMEM1(PoolRealArray, push_back); @@ -660,6 +669,7 @@ struct _VariantCall { VCALL_LOCALMEM0(PoolRealArray, invert); VCALL_LOCALMEM0R(PoolStringArray, size); + VCALL_LOCALMEM0R(PoolStringArray, empty); VCALL_LOCALMEM2(PoolStringArray, set); VCALL_LOCALMEM1R(PoolStringArray, get); VCALL_LOCALMEM1(PoolStringArray, push_back); @@ -672,6 +682,7 @@ struct _VariantCall { VCALL_LOCALMEM1R(PoolStringArray, join); VCALL_LOCALMEM0R(PoolVector2Array, size); + VCALL_LOCALMEM0R(PoolVector2Array, empty); VCALL_LOCALMEM2(PoolVector2Array, set); VCALL_LOCALMEM1R(PoolVector2Array, get); VCALL_LOCALMEM1(PoolVector2Array, push_back); @@ -683,6 +694,7 @@ struct _VariantCall { VCALL_LOCALMEM0(PoolVector2Array, invert); VCALL_LOCALMEM0R(PoolVector3Array, size); + VCALL_LOCALMEM0R(PoolVector3Array, empty); VCALL_LOCALMEM2(PoolVector3Array, set); VCALL_LOCALMEM1R(PoolVector3Array, get); VCALL_LOCALMEM1(PoolVector3Array, push_back); @@ -694,6 +706,7 @@ struct _VariantCall { VCALL_LOCALMEM0(PoolVector3Array, invert); VCALL_LOCALMEM0R(PoolColorArray, size); + VCALL_LOCALMEM0R(PoolColorArray, empty); VCALL_LOCALMEM2(PoolColorArray, set); VCALL_LOCALMEM1R(PoolColorArray, get); VCALL_LOCALMEM1(PoolColorArray, push_back); @@ -732,13 +745,16 @@ struct _VariantCall { VCALL_PTR0R(AABB, get_area); VCALL_PTR0R(AABB, has_no_area); VCALL_PTR0R(AABB, has_no_surface); + VCALL_PTR1R(AABB, has_point); + VCALL_PTR1R(AABB, is_equal_approx); VCALL_PTR1R(AABB, intersects); VCALL_PTR1R(AABB, encloses); - VCALL_PTR1R(AABB, merge); - VCALL_PTR1R(AABB, intersection); VCALL_PTR1R(AABB, intersects_plane); VCALL_PTR2R(AABB, intersects_segment); - VCALL_PTR1R(AABB, has_point); + VCALL_PTR1R(AABB, intersection); + VCALL_PTR1R(AABB, merge); + VCALL_PTR1R(AABB, expand); + VCALL_PTR1R(AABB, grow); VCALL_PTR1R(AABB, get_support); VCALL_PTR0R(AABB, get_longest_axis); VCALL_PTR0R(AABB, get_longest_axis_index); @@ -746,8 +762,6 @@ struct _VariantCall { VCALL_PTR0R(AABB, get_shortest_axis); VCALL_PTR0R(AABB, get_shortest_axis_index); VCALL_PTR0R(AABB, get_shortest_axis_size); - VCALL_PTR1R(AABB, expand); - VCALL_PTR1R(AABB, grow); VCALL_PTR1R(AABB, get_endpoint); VCALL_PTR0R(Transform2D, inverse); @@ -760,6 +774,7 @@ struct _VariantCall { VCALL_PTR1R(Transform2D, scaled); VCALL_PTR1R(Transform2D, translated); VCALL_PTR2R(Transform2D, interpolate_with); + VCALL_PTR1R(Transform2D, is_equal_approx); static void _call_Transform2D_xform(Variant &r_ret, Variant &p_self, const Variant **p_args) { @@ -816,7 +831,7 @@ struct _VariantCall { VCALL_PTR0R(Basis, get_orthogonal_index); VCALL_PTR0R(Basis, orthonormalized); VCALL_PTR2R(Basis, slerp); - VCALL_PTR2R(Basis, is_equal_approx); + VCALL_PTR2R(Basis, is_equal_approx); // TODO: Break compatibility in 4.0 to change this to an instance method (a.is_equal_approx(b) as VCALL_PTR1R) for consistency. VCALL_PTR0R(Basis, get_rotation_quat); VCALL_PTR0R(Transform, inverse); @@ -827,6 +842,7 @@ struct _VariantCall { VCALL_PTR0R(Transform, orthonormalized); VCALL_PTR2R(Transform, looking_at); VCALL_PTR2R(Transform, interpolate_with); + VCALL_PTR1R(Transform, is_equal_approx); static void _call_Transform_xform(Variant &r_ret, Variant &p_self, const Variant **p_args) { @@ -1607,19 +1623,20 @@ void register_variant_methods() { ADDFUNC0R(STRING, POOL_BYTE_ARRAY, String, to_ascii, varray()); ADDFUNC0R(STRING, POOL_BYTE_ARRAY, String, to_utf8, varray()); - ADDFUNC0R(VECTOR2, VECTOR2, Vector2, normalized, varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, length, varray()); ADDFUNC0R(VECTOR2, REAL, Vector2, angle, varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, length_squared, varray()); - ADDFUNC0R(VECTOR2, BOOL, Vector2, is_normalized, varray()); + ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to, VECTOR2, "to", varray()); + ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to_point, VECTOR2, "to", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, direction_to, VECTOR2, "b", varray()); ADDFUNC1R(VECTOR2, REAL, Vector2, distance_to, VECTOR2, "to", varray()); ADDFUNC1R(VECTOR2, REAL, Vector2, distance_squared_to, VECTOR2, "to", varray()); + ADDFUNC0R(VECTOR2, REAL, Vector2, length, varray()); + ADDFUNC0R(VECTOR2, REAL, Vector2, length_squared, varray()); + ADDFUNC0R(VECTOR2, VECTOR2, Vector2, normalized, varray()); + ADDFUNC0R(VECTOR2, BOOL, Vector2, is_normalized, varray()); + ADDFUNC1R(VECTOR2, BOOL, Vector2, is_equal_approx, VECTOR2, "v", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmod, REAL, "mod", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmodv, VECTOR2, "modv", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, project, VECTOR2, "b", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to, VECTOR2, "to", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to_point, VECTOR2, "to", varray()); ADDFUNC2R(VECTOR2, VECTOR2, Vector2, linear_interpolate, VECTOR2, "b", REAL, "t", varray()); ADDFUNC2R(VECTOR2, VECTOR2, Vector2, slerp, VECTOR2, "b", REAL, "t", varray()); ADDFUNC4R(VECTOR2, VECTOR2, Vector2, cubic_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", REAL, "t", varray()); @@ -1641,31 +1658,36 @@ void register_variant_methods() { ADDFUNC0R(VECTOR2, VECTOR2, Vector2, sign, varray()); ADDFUNC0R(RECT2, REAL, Rect2, get_area, varray()); + ADDFUNC0R(RECT2, BOOL, Rect2, has_no_area, varray()); + ADDFUNC1R(RECT2, BOOL, Rect2, has_point, VECTOR2, "point", varray()); + ADDFUNC1R(RECT2, BOOL, Rect2, is_equal_approx, RECT2, "rect", varray()); ADDFUNC1R(RECT2, BOOL, Rect2, intersects, RECT2, "b", varray()); ADDFUNC1R(RECT2, BOOL, Rect2, encloses, RECT2, "b", varray()); - ADDFUNC0R(RECT2, BOOL, Rect2, has_no_area, varray()); ADDFUNC1R(RECT2, RECT2, Rect2, clip, RECT2, "b", varray()); ADDFUNC1R(RECT2, RECT2, Rect2, merge, RECT2, "b", varray()); - ADDFUNC1R(RECT2, BOOL, Rect2, has_point, VECTOR2, "point", varray()); + ADDFUNC1R(RECT2, RECT2, Rect2, expand, VECTOR2, "to", varray()); ADDFUNC1R(RECT2, RECT2, Rect2, grow, REAL, "by", varray()); ADDFUNC2R(RECT2, RECT2, Rect2, grow_margin, INT, "margin", REAL, "by", varray()); ADDFUNC4R(RECT2, RECT2, Rect2, grow_individual, REAL, "left", REAL, "top", REAL, "right", REAL, " bottom", varray()); - ADDFUNC1R(RECT2, RECT2, Rect2, expand, VECTOR2, "to", varray()); ADDFUNC0R(RECT2, RECT2, Rect2, abs, varray()); ADDFUNC0R(VECTOR3, INT, Vector3, min_axis, varray()); ADDFUNC0R(VECTOR3, INT, Vector3, max_axis, varray()); + ADDFUNC1R(VECTOR3, REAL, Vector3, angle_to, VECTOR3, "to", varray()); + ADDFUNC1R(VECTOR3, VECTOR3, Vector3, direction_to, VECTOR3, "b", varray()); + ADDFUNC1R(VECTOR3, REAL, Vector3, distance_to, VECTOR3, "b", varray()); + ADDFUNC1R(VECTOR3, REAL, Vector3, distance_squared_to, VECTOR3, "b", varray()); ADDFUNC0R(VECTOR3, REAL, Vector3, length, varray()); ADDFUNC0R(VECTOR3, REAL, Vector3, length_squared, varray()); - ADDFUNC0R(VECTOR3, BOOL, Vector3, is_normalized, varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, normalized, varray()); + ADDFUNC0R(VECTOR3, BOOL, Vector3, is_normalized, varray()); + ADDFUNC1R(VECTOR3, BOOL, Vector3, is_equal_approx, VECTOR3, "v", varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, inverse, varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, snapped, VECTOR3, "by", varray()); ADDFUNC2R(VECTOR3, VECTOR3, Vector3, rotated, VECTOR3, "axis", REAL, "phi", varray()); ADDFUNC2R(VECTOR3, VECTOR3, Vector3, linear_interpolate, VECTOR3, "b", REAL, "t", varray()); ADDFUNC2R(VECTOR3, VECTOR3, Vector3, slerp, VECTOR3, "b", REAL, "t", varray()); ADDFUNC4R(VECTOR3, VECTOR3, Vector3, cubic_interpolate, VECTOR3, "b", VECTOR3, "pre_a", VECTOR3, "post_b", REAL, "t", varray()); - ADDFUNC1R(VECTOR3, VECTOR3, Vector3, direction_to, VECTOR3, "b", varray()); ADDFUNC2R(VECTOR3, VECTOR3, Vector3, move_toward, VECTOR3, "to", REAL, "delta", varray()); ADDFUNC1R(VECTOR3, REAL, Vector3, dot, VECTOR3, "b", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, cross, VECTOR3, "b", varray()); @@ -1675,12 +1697,9 @@ void register_variant_methods() { ADDFUNC0R(VECTOR3, VECTOR3, Vector3, floor, varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, ceil, varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, round, varray()); - ADDFUNC1R(VECTOR3, REAL, Vector3, distance_to, VECTOR3, "b", varray()); - ADDFUNC1R(VECTOR3, REAL, Vector3, distance_squared_to, VECTOR3, "b", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, posmod, REAL, "mod", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, posmodv, VECTOR3, "modv", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, project, VECTOR3, "b", varray()); - ADDFUNC1R(VECTOR3, REAL, Vector3, angle_to, VECTOR3, "to", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, slide, VECTOR3, "n", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, bounce, VECTOR3, "n", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, reflect, VECTOR3, "n", varray()); @@ -1689,6 +1708,7 @@ void register_variant_methods() { ADDFUNC0R(PLANE, PLANE, Plane, normalized, varray()); ADDFUNC0R(PLANE, VECTOR3, Plane, center, varray()); ADDFUNC0R(PLANE, VECTOR3, Plane, get_any_point, varray()); + ADDFUNC1R(PLANE, BOOL, Plane, is_equal_approx, PLANE, "plane", varray()); ADDFUNC1R(PLANE, BOOL, Plane, is_point_over, VECTOR3, "point", varray()); ADDFUNC1R(PLANE, REAL, Plane, distance_to, VECTOR3, "point", varray()); ADDFUNC2R(PLANE, BOOL, Plane, has_point, VECTOR3, "point", REAL, "epsilon", varray(CMP_EPSILON)); @@ -1701,6 +1721,7 @@ void register_variant_methods() { ADDFUNC0R(QUAT, REAL, Quat, length_squared, varray()); ADDFUNC0R(QUAT, QUAT, Quat, normalized, varray()); ADDFUNC0R(QUAT, BOOL, Quat, is_normalized, varray()); + ADDFUNC1R(QUAT, BOOL, Quat, is_equal_approx, QUAT, "quat", varray()); ADDFUNC0R(QUAT, QUAT, Quat, inverse, varray()); ADDFUNC1R(QUAT, REAL, Quat, dot, QUAT, "b", varray()); ADDFUNC1R(QUAT, VECTOR3, Quat, xform, VECTOR3, "v", varray()); @@ -1726,6 +1747,7 @@ void register_variant_methods() { ADDFUNC1R(COLOR, COLOR, Color, darkened, REAL, "amount", varray()); ADDFUNC1R(COLOR, STRING, Color, to_html, BOOL, "with_alpha", varray(true)); ADDFUNC4R(COLOR, COLOR, Color, from_hsv, REAL, "h", REAL, "s", REAL, "v", REAL, "a", varray(1.0)); + ADDFUNC1R(COLOR, BOOL, Color, is_equal_approx, COLOR, "color", varray()); ADDFUNC0R(_RID, INT, RID, get_id, varray()); @@ -1782,6 +1804,7 @@ void register_variant_methods() { ADDFUNC0R(ARRAY, NIL, Array, min, varray()); ADDFUNC0R(POOL_BYTE_ARRAY, INT, PoolByteArray, size, varray()); + ADDFUNC0R(POOL_BYTE_ARRAY, BOOL, PoolByteArray, empty, varray()); ADDFUNC2(POOL_BYTE_ARRAY, NIL, PoolByteArray, set, INT, "idx", INT, "byte", varray()); ADDFUNC1(POOL_BYTE_ARRAY, NIL, PoolByteArray, push_back, INT, "byte", varray()); ADDFUNC1(POOL_BYTE_ARRAY, NIL, PoolByteArray, append, INT, "byte", varray()); @@ -1799,6 +1822,7 @@ void register_variant_methods() { ADDFUNC2R(POOL_BYTE_ARRAY, POOL_BYTE_ARRAY, PoolByteArray, decompress, INT, "buffer_size", INT, "compression_mode", varray(0)); ADDFUNC0R(POOL_INT_ARRAY, INT, PoolIntArray, size, varray()); + ADDFUNC0R(POOL_INT_ARRAY, BOOL, PoolIntArray, empty, varray()); ADDFUNC2(POOL_INT_ARRAY, NIL, PoolIntArray, set, INT, "idx", INT, "integer", varray()); ADDFUNC1(POOL_INT_ARRAY, NIL, PoolIntArray, push_back, INT, "integer", varray()); ADDFUNC1(POOL_INT_ARRAY, NIL, PoolIntArray, append, INT, "integer", varray()); @@ -1809,6 +1833,7 @@ void register_variant_methods() { ADDFUNC0(POOL_INT_ARRAY, NIL, PoolIntArray, invert, varray()); ADDFUNC0R(POOL_REAL_ARRAY, INT, PoolRealArray, size, varray()); + ADDFUNC0R(POOL_REAL_ARRAY, BOOL, PoolRealArray, empty, varray()); ADDFUNC2(POOL_REAL_ARRAY, NIL, PoolRealArray, set, INT, "idx", REAL, "value", varray()); ADDFUNC1(POOL_REAL_ARRAY, NIL, PoolRealArray, push_back, REAL, "value", varray()); ADDFUNC1(POOL_REAL_ARRAY, NIL, PoolRealArray, append, REAL, "value", varray()); @@ -1819,6 +1844,7 @@ void register_variant_methods() { ADDFUNC0(POOL_REAL_ARRAY, NIL, PoolRealArray, invert, varray()); ADDFUNC0R(POOL_STRING_ARRAY, INT, PoolStringArray, size, varray()); + ADDFUNC0R(POOL_STRING_ARRAY, BOOL, PoolStringArray, empty, varray()); ADDFUNC2(POOL_STRING_ARRAY, NIL, PoolStringArray, set, INT, "idx", STRING, "string", varray()); ADDFUNC1(POOL_STRING_ARRAY, NIL, PoolStringArray, push_back, STRING, "string", varray()); ADDFUNC1(POOL_STRING_ARRAY, NIL, PoolStringArray, append, STRING, "string", varray()); @@ -1830,6 +1856,7 @@ void register_variant_methods() { ADDFUNC1(POOL_STRING_ARRAY, STRING, PoolStringArray, join, STRING, "delimiter", varray()); ADDFUNC0R(POOL_VECTOR2_ARRAY, INT, PoolVector2Array, size, varray()); + ADDFUNC0R(POOL_VECTOR2_ARRAY, BOOL, PoolVector2Array, empty, varray()); ADDFUNC2(POOL_VECTOR2_ARRAY, NIL, PoolVector2Array, set, INT, "idx", VECTOR2, "vector2", varray()); ADDFUNC1(POOL_VECTOR2_ARRAY, NIL, PoolVector2Array, push_back, VECTOR2, "vector2", varray()); ADDFUNC1(POOL_VECTOR2_ARRAY, NIL, PoolVector2Array, append, VECTOR2, "vector2", varray()); @@ -1840,6 +1867,7 @@ void register_variant_methods() { ADDFUNC0(POOL_VECTOR2_ARRAY, NIL, PoolVector2Array, invert, varray()); ADDFUNC0R(POOL_VECTOR3_ARRAY, INT, PoolVector3Array, size, varray()); + ADDFUNC0R(POOL_VECTOR3_ARRAY, BOOL, PoolVector3Array, empty, varray()); ADDFUNC2(POOL_VECTOR3_ARRAY, NIL, PoolVector3Array, set, INT, "idx", VECTOR3, "vector3", varray()); ADDFUNC1(POOL_VECTOR3_ARRAY, NIL, PoolVector3Array, push_back, VECTOR3, "vector3", varray()); ADDFUNC1(POOL_VECTOR3_ARRAY, NIL, PoolVector3Array, append, VECTOR3, "vector3", varray()); @@ -1850,6 +1878,7 @@ void register_variant_methods() { ADDFUNC0(POOL_VECTOR3_ARRAY, NIL, PoolVector3Array, invert, varray()); ADDFUNC0R(POOL_COLOR_ARRAY, INT, PoolColorArray, size, varray()); + ADDFUNC0R(POOL_COLOR_ARRAY, BOOL, PoolColorArray, empty, varray()); ADDFUNC2(POOL_COLOR_ARRAY, NIL, PoolColorArray, set, INT, "idx", COLOR, "color", varray()); ADDFUNC1(POOL_COLOR_ARRAY, NIL, PoolColorArray, push_back, COLOR, "color", varray()); ADDFUNC1(POOL_COLOR_ARRAY, NIL, PoolColorArray, append, COLOR, "color", varray()); @@ -1864,13 +1893,16 @@ void register_variant_methods() { ADDFUNC0R(AABB, REAL, AABB, get_area, varray()); ADDFUNC0R(AABB, BOOL, AABB, has_no_area, varray()); ADDFUNC0R(AABB, BOOL, AABB, has_no_surface, varray()); + ADDFUNC1R(AABB, BOOL, AABB, has_point, VECTOR3, "point", varray()); + ADDFUNC1R(AABB, BOOL, AABB, is_equal_approx, AABB, "aabb", varray()); ADDFUNC1R(AABB, BOOL, AABB, intersects, AABB, "with", varray()); ADDFUNC1R(AABB, BOOL, AABB, encloses, AABB, "with", varray()); - ADDFUNC1R(AABB, AABB, AABB, merge, AABB, "with", varray()); - ADDFUNC1R(AABB, AABB, AABB, intersection, AABB, "with", varray()); ADDFUNC1R(AABB, BOOL, AABB, intersects_plane, PLANE, "plane", varray()); ADDFUNC2R(AABB, BOOL, AABB, intersects_segment, VECTOR3, "from", VECTOR3, "to", varray()); - ADDFUNC1R(AABB, BOOL, AABB, has_point, VECTOR3, "point", varray()); + ADDFUNC1R(AABB, AABB, AABB, intersection, AABB, "with", varray()); + ADDFUNC1R(AABB, AABB, AABB, merge, AABB, "with", varray()); + ADDFUNC1R(AABB, AABB, AABB, expand, VECTOR3, "to_point", varray()); + ADDFUNC1R(AABB, AABB, AABB, grow, REAL, "by", varray()); ADDFUNC1R(AABB, VECTOR3, AABB, get_support, VECTOR3, "dir", varray()); ADDFUNC0R(AABB, VECTOR3, AABB, get_longest_axis, varray()); ADDFUNC0R(AABB, INT, AABB, get_longest_axis_index, varray()); @@ -1878,8 +1910,6 @@ void register_variant_methods() { ADDFUNC0R(AABB, VECTOR3, AABB, get_shortest_axis, varray()); ADDFUNC0R(AABB, INT, AABB, get_shortest_axis_index, varray()); ADDFUNC0R(AABB, REAL, AABB, get_shortest_axis_size, varray()); - ADDFUNC1R(AABB, AABB, AABB, expand, VECTOR3, "to_point", varray()); - ADDFUNC1R(AABB, AABB, AABB, grow, REAL, "by", varray()); ADDFUNC1R(AABB, VECTOR3, AABB, get_endpoint, INT, "idx", varray()); ADDFUNC0R(TRANSFORM2D, TRANSFORM2D, Transform2D, inverse, varray()); @@ -1896,6 +1926,7 @@ void register_variant_methods() { ADDFUNC1R(TRANSFORM2D, VECTOR2, Transform2D, basis_xform, VECTOR2, "v", varray()); ADDFUNC1R(TRANSFORM2D, VECTOR2, Transform2D, basis_xform_inv, VECTOR2, "v", varray()); ADDFUNC2R(TRANSFORM2D, TRANSFORM2D, Transform2D, interpolate_with, TRANSFORM2D, "transform", REAL, "weight", varray()); + ADDFUNC1R(TRANSFORM2D, BOOL, Transform2D, is_equal_approx, TRANSFORM2D, "transform", varray()); ADDFUNC0R(BASIS, BASIS, Basis, inverse, varray()); ADDFUNC0R(BASIS, BASIS, Basis, transposed, varray()); @@ -1912,7 +1943,7 @@ void register_variant_methods() { ADDFUNC1R(BASIS, VECTOR3, Basis, xform_inv, VECTOR3, "v", varray()); ADDFUNC0R(BASIS, INT, Basis, get_orthogonal_index, varray()); ADDFUNC2R(BASIS, BASIS, Basis, slerp, BASIS, "b", REAL, "t", varray()); - ADDFUNC2R(BASIS, BOOL, Basis, is_equal_approx, BASIS, "b", REAL, "epsilon", varray(CMP_EPSILON)); + ADDFUNC2R(BASIS, BOOL, Basis, is_equal_approx, BASIS, "b", REAL, "epsilon", varray(CMP_EPSILON)); // TODO: Replace in 4.0, see other TODO. ADDFUNC0R(BASIS, QUAT, Basis, get_rotation_quat, varray()); ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, inverse, varray()); @@ -1923,6 +1954,7 @@ void register_variant_methods() { ADDFUNC1R(TRANSFORM, TRANSFORM, Transform, translated, VECTOR3, "ofs", varray()); ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, looking_at, VECTOR3, "target", VECTOR3, "up", varray()); ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, interpolate_with, TRANSFORM, "transform", REAL, "weight", varray()); + ADDFUNC1R(TRANSFORM, BOOL, Transform, is_equal_approx, TRANSFORM, "transform", varray()); ADDFUNC1R(TRANSFORM, NIL, Transform, xform, NIL, "v", varray()); ADDFUNC1R(TRANSFORM, NIL, Transform, xform_inv, NIL, "v", varray()); diff --git a/core/vmap.h b/core/vmap.h index fde9723d71..ed66b46993 100644 --- a/core/vmap.h +++ b/core/vmap.h @@ -196,8 +196,7 @@ public: int pos = _find_exact(p_key); if (pos < 0) { - V val; - pos = insert(p_key, val); + pos = insert(p_key, V()); } return _cowdata.get_m(pos).value; diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index 7dcfa5345d..61e1ea9b8d 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -176,6 +176,14 @@ Returns [code]true[/code] if the [AABB] intersects the line segment between [code]from[/code] and [code]to[/code]. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="aabb" type="AABB"> + </argument> + <description> + </description> + </method> <method name="merge"> <return type="AABB"> </return> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index e835af01e8..6304bd34f6 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -1,11 +1,23 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AStar" inherits="Reference" category="Core" version="3.2"> <brief_description> - AStar class representation that uses 3d-vectors as edges. + An implementation of A* to find shortest paths among connected points in space. </brief_description> <description> - A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting an efficiently directed path between multiple points. It enjoys widespread use due to its performance and accuracy. Godot's A* implementation make use of vectors as points. - You must add points manually with [method add_point] and create segments manually with [method connect_points]. So you can test if there is a path between two points with the [method are_points_connected] function, get the list of existing ids in the found path with [method get_id_path], or the points list with [method get_point_path]. + A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in three-dimensional space and Euclidean distances by default. + You must add points manually with [method add_point] and create segments manually with [method connect_points]. Then you can test if there is a path between two points with the [method are_points_connected] function, get a path containing indices by [method get_id_path], or one containing actual coordinates with [method get_point_path]. + It is also possible to use non-Euclidean distances. To do so, create a class that extends [code]AStar[/code] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example. + [codeblock] + class MyAStar: + extends AStar + + func _compute_cost(u, v): + return abs(u - v) + + func _estimate_cost(u, v): + return min(0, abs(u - v) - 1) + [/codeblock] + [method _estimate_cost] should return a lower bound of the distance, i.e. [code]_estimate_cost(u, v) <= _compute_cost(u, v)[/code]. This serves as a hint to the algorithm because the custom [code]_compute_cost[/code] might be computation-heavy. If this is not the case, make [method _estimate_cost] return the same value as [method _compute_cost] to provide the algorithm with the most accurate information. </description> <tutorials> </tutorials> @@ -19,6 +31,7 @@ </argument> <description> Called when computing the cost between two connected points. + Note that this function is hidden in the default [code]AStar[/code] class. </description> </method> <method name="_estimate_cost" qualifiers="virtual"> @@ -30,6 +43,7 @@ </argument> <description> Called when estimating the cost between a point and the path's ending point. + Note that this function is hidden in the default [code]AStar[/code] class. </description> </method> <method name="add_point"> @@ -57,8 +71,10 @@ </argument> <argument index="1" name="to_id" type="int"> </argument> + <argument index="2" name="bidirectional" type="bool" default="true"> + </argument> <description> - Returns whether there is a connection/segment between the given points. + Returns whether the two given points are directly connected by a segment. If [code]bidirectional[/code] is [code]false[/code], returns whether movement from [code]id[/code] to [code]to_id[/code] is possible through this segment. </description> </method> <method name="clear"> @@ -94,8 +110,10 @@ </argument> <argument index="1" name="to_id" type="int"> </argument> + <argument index="2" name="bidirectional" type="bool" default="true"> + </argument> <description> - Deletes the segment between the given points. + Deletes the segment between the given points. If [code]bidirectional[/code] is [code]false[/code], only movement from [code]id[/code] to [code]to_id[/code] is prevented, and a unidirectional segment possibly remains. </description> </method> <method name="get_available_point_id" qualifiers="const"> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index bc64cfbb19..97da8c9980 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -34,7 +34,7 @@ <method name="animation_track_get_key_animation" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -44,7 +44,7 @@ <method name="animation_track_insert_key"> <return type="int"> </return> - <argument index="0" name="track" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time" type="float"> </argument> @@ -56,7 +56,7 @@ <method name="animation_track_set_key_animation"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -68,7 +68,7 @@ <method name="audio_track_get_key_end_offset" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -78,7 +78,7 @@ <method name="audio_track_get_key_start_offset" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -88,7 +88,7 @@ <method name="audio_track_get_key_stream" qualifiers="const"> <return type="Resource"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -98,7 +98,7 @@ <method name="audio_track_insert_key"> <return type="int"> </return> - <argument index="0" name="track" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time" type="float"> </argument> @@ -114,7 +114,7 @@ <method name="audio_track_set_key_end_offset"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -126,7 +126,7 @@ <method name="audio_track_set_key_start_offset"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -138,7 +138,7 @@ <method name="audio_track_set_key_stream"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -150,7 +150,7 @@ <method name="bezier_track_get_key_in_handle" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -160,7 +160,7 @@ <method name="bezier_track_get_key_out_handle" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -170,7 +170,7 @@ <method name="bezier_track_get_key_value" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -180,7 +180,7 @@ <method name="bezier_track_insert_key"> <return type="int"> </return> - <argument index="0" name="track" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time" type="float"> </argument> @@ -196,7 +196,7 @@ <method name="bezier_track_interpolate" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="track" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time" type="float"> </argument> @@ -206,7 +206,7 @@ <method name="bezier_track_set_key_in_handle"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -218,7 +218,7 @@ <method name="bezier_track_set_key_out_handle"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -230,7 +230,7 @@ <method name="bezier_track_set_key_value"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -249,7 +249,7 @@ <method name="copy_track"> <return type="void"> </return> - <argument index="0" name="track" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="to_animation" type="Animation"> </argument> @@ -276,7 +276,7 @@ <method name="method_track_get_key_indices" qualifiers="const"> <return type="PoolIntArray"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time_sec" type="float"> </argument> @@ -289,7 +289,7 @@ <method name="method_track_get_name" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -300,7 +300,7 @@ <method name="method_track_get_params" qualifiers="const"> <return type="Array"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -311,7 +311,7 @@ <method name="remove_track"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Removes a track by specifying the track index. @@ -320,7 +320,7 @@ <method name="track_find_key" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time" type="float"> </argument> @@ -333,7 +333,7 @@ <method name="track_get_interpolation_loop_wrap" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Returns [code]true[/code] if the track at [code]idx[/code] wraps the interpolation loop. New tracks wrap the interpolation loop by default. @@ -342,7 +342,7 @@ <method name="track_get_interpolation_type" qualifiers="const"> <return type="int" enum="Animation.InterpolationType"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Returns the interpolation type of a given track. @@ -351,7 +351,7 @@ <method name="track_get_key_count" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Returns the amount of keys in a given track. @@ -360,7 +360,7 @@ <method name="track_get_key_time" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -371,7 +371,7 @@ <method name="track_get_key_transition" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -382,7 +382,7 @@ <method name="track_get_key_value" qualifiers="const"> <return type="Variant"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -393,7 +393,7 @@ <method name="track_get_path" qualifiers="const"> <return type="NodePath"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Gets the path of a track. For more information on the path format, see [method track_set_path]. @@ -402,7 +402,7 @@ <method name="track_get_type" qualifiers="const"> <return type="int" enum="Animation.TrackType"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Gets the type of a track. @@ -411,7 +411,7 @@ <method name="track_insert_key"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time" type="float"> </argument> @@ -426,7 +426,7 @@ <method name="track_is_enabled" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Returns [code]true[/code] if the track at index [code]idx[/code] is enabled. @@ -435,7 +435,7 @@ <method name="track_is_imported" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Returns [code]true[/code] if the given track is imported. Else, return [code]false[/code]. @@ -444,7 +444,7 @@ <method name="track_move_down"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Moves a track down. @@ -453,7 +453,7 @@ <method name="track_move_to"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="to_idx" type="int"> </argument> @@ -464,7 +464,7 @@ <method name="track_move_up"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Moves a track up. @@ -473,7 +473,7 @@ <method name="track_remove_key"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -484,7 +484,7 @@ <method name="track_remove_key_at_position"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="position" type="float"> </argument> @@ -495,7 +495,7 @@ <method name="track_set_enabled"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="enabled" type="bool"> </argument> @@ -506,7 +506,7 @@ <method name="track_set_imported"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="imported" type="bool"> </argument> @@ -517,7 +517,7 @@ <method name="track_set_interpolation_loop_wrap"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="interpolation" type="bool"> </argument> @@ -528,7 +528,7 @@ <method name="track_set_interpolation_type"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="interpolation" type="int" enum="Animation.InterpolationType"> </argument> @@ -539,7 +539,7 @@ <method name="track_set_key_time"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -552,7 +552,7 @@ <method name="track_set_key_transition"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> </argument> @@ -565,7 +565,7 @@ <method name="track_set_key_value"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="key" type="int"> </argument> @@ -578,7 +578,7 @@ <method name="track_set_path"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="path" type="NodePath"> </argument> @@ -590,7 +590,7 @@ <method name="track_swap"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="with_idx" type="int"> </argument> @@ -601,7 +601,7 @@ <method name="transform_track_insert_key"> <return type="int"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time" type="float"> </argument> @@ -618,7 +618,7 @@ <method name="transform_track_interpolate" qualifiers="const"> <return type="Array"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time_sec" type="float"> </argument> @@ -629,7 +629,7 @@ <method name="value_track_get_key_indices" qualifiers="const"> <return type="PoolIntArray"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="time_sec" type="float"> </argument> @@ -642,7 +642,7 @@ <method name="value_track_get_update_mode" qualifiers="const"> <return type="int" enum="Animation.UpdateMode"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <description> Returns the update mode of a value track. @@ -651,7 +651,7 @@ <method name="value_track_set_update_mode"> <return type="void"> </return> - <argument index="0" name="idx" type="int"> + <argument index="0" name="track_idx" type="int"> </argument> <argument index="1" name="mode" type="int" enum="Animation.UpdateMode"> </argument> diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml index c71a06d931..d8ea7fea5b 100644 --- a/doc/classes/AnimationNodeBlendSpace2D.xml +++ b/doc/classes/AnimationNodeBlendSpace2D.xml @@ -125,7 +125,7 @@ </methods> <members> <member name="auto_triangles" type="bool" setter="set_auto_triangles" getter="get_auto_triangles" default="true"> - If true, the blend space is triangulated automatically. The mesh updates every time you add or remove points with [method add_blend_point] and [method remove_blend_point]. + If [code]true[/code], the blend space is triangulated automatically. The mesh updates every time you add or remove points with [method add_blend_point] and [method remove_blend_point]. </member> <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="AnimationNodeBlendSpace2D.BlendMode" default="0"> Controls the interpolation between animations. See [enum BlendMode] constants. diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 5bb4a6e3c7..60d04649a8 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -5,6 +5,7 @@ </brief_description> <description> An animation player is used for general-purpose playback of [Animation] resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels. + Updating the target properties of animations occurs at process time. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/animations.html</link> @@ -28,7 +29,7 @@ <argument index="0" name="delta" type="float"> </argument> <description> - Shifts position in the animation timeline. Delta is the time in seconds to shift. Events between the current frame and [code]delta[/code] are handled. + Shifts position in the animation timeline and immediately updates the animation. [code]delta[/code] is the time in seconds to shift. Events between the current frame and [code]delta[/code] are handled. </description> </method> <method name="animation_get_next" qualifiers="const"> @@ -145,6 +146,7 @@ <description> Plays the animation with key [code]name[/code]. Custom speed and blend times can be set. If [code]custom_speed[/code] is negative and [code]from_end[/code] is [code]true[/code], the animation will play backwards. If the animation has been paused by [method stop], it will be resumed. Calling [method play] without arguments will also resume the animation. + [b]Note:[/b] The animation will be updated the next time the AnimationPlayer is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call [code]advance(0)[/code]. </description> </method> <method name="play_backwards"> @@ -157,6 +159,7 @@ <description> Plays the animation with key [code]name[/code] in reverse. If the animation has been paused by [code]stop(true)[/code], it will be resumed backwards. Calling [code]play_backwards()[/code] without arguments will also resume the animation backwards. + [b]Note:[/b] This is the same as [code]play[/code] in regards to process/update behavior. </description> </method> <method name="queue"> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index e1cb9056da..9a5870c73d 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -7,6 +7,7 @@ 2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping). </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/using_area_2d.html</link> </tutorials> <methods> <method name="get_collision_layer_bit" qualifiers="const"> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index a1529f3eb3..e09c1f4b08 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -316,7 +316,7 @@ <argument index="3" name="deep" type="bool" default="False"> </argument> <description> - Duplicates the subset described in the function and returns it in an array, deeply copying the array if [code]deep[/code] is true. Lower and upper index are inclusive, with the [code]step[/code] describing the change between indices while slicing. + Duplicates the subset described in the function and returns it in an array, deeply copying the array if [code]deep[/code] is [code]true[/code]. Lower and upper index are inclusive, with the [code]step[/code] describing the change between indices while slicing. </description> </method> <method name="sort"> diff --git a/doc/classes/BackBufferCopy.xml b/doc/classes/BackBufferCopy.xml index 9bb32e0444..945af0c701 100644 --- a/doc/classes/BackBufferCopy.xml +++ b/doc/classes/BackBufferCopy.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="BackBufferCopy" inherits="Node2D" category="Core" version="3.2"> <brief_description> - Copies a region of the screen (or the whole screen) to a buffer so it can be accessed with [code]SCREEN_TEXTURE[/code] in the [code]texture()[/code] function. + Copies a region of the screen (or the whole screen) to a buffer so it can be accessed in your shader scripts through the [code]texture(SCREEN_TEXTURE, ...)[/code] function. </brief_description> <description> - Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is bufferized with the content of the screen it covers, or the entire screen according to the copy mode set. Use [code]SCREEN_TEXTURE[/code] in the [code]texture()[/code] function to access the buffer. + Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is bufferized with the content of the screen it covers, or the entire screen according to the copy mode set. Use the [code]texture(SCREEN_TEXTURE, ...)[/code] function in your shader scripts to access the buffer. </description> <tutorials> </tutorials> diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml index d410800141..3b4313b204 100644 --- a/doc/classes/Camera.xml +++ b/doc/classes/Camera.xml @@ -77,10 +77,10 @@ </return> <argument index="0" name="screen_point" type="Vector2"> </argument> - <argument index="1" name="z_depth" type="float" default="0"> + <argument index="1" name="z_depth" type="float"> </argument> <description> - Returns the 3D point in worldspace that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given distance into the scene away from the camera. + Returns the 3D point in worldspace that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given [code]z_depth[/code] distance into the scene away from the camera. </description> </method> <method name="project_ray_normal" qualifiers="const"> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 87b8f5c83d..8372d15324 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -22,6 +22,28 @@ Called (if exists) to draw the canvas item. </description> </method> + <method name="draw_arc"> + <return type="void"> + </return> + <argument index="0" name="center" type="Vector2"> + </argument> + <argument index="1" name="radius" type="float"> + </argument> + <argument index="2" name="start_angle" type="float"> + </argument> + <argument index="3" name="end_angle" type="float"> + </argument> + <argument index="4" name="point_count" type="int"> + </argument> + <argument index="5" name="color" type="Color"> + </argument> + <argument index="6" name="width" type="float" default="1.0"> + </argument> + <argument index="7" name="antialiased" type="bool" default="false"> + </argument> + <description> + </description> + </method> <method name="draw_char"> <return type="float"> </return> @@ -341,6 +363,7 @@ <return type="void"> </return> <description> + Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. </description> </method> <method name="get_canvas" qualifiers="const"> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 46499ed349..deba30712e 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -151,6 +151,14 @@ [/codeblock] </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="color" type="Color"> + </argument> + <description> + </description> + </method> <method name="lightened"> <return type="Color"> </return> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 05ffac803a..75d5a72fb1 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -62,7 +62,7 @@ </argument> <description> Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. Use [code]for_text[/code] parameter to determine what text the tooltip should contain (likely the contents of [member hint_tooltip]). - The returned node must be of type [Control] or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When null or non-Control node is returned, the default tooltip will be used instead. + The returned node must be of type [Control] or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When [code]null[/code] or non-Control node is returned, the default tooltip will be used instead. [b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member rect_min_size] to some non-zero value. Example of usage with custom-constructed node: [codeblock] @@ -652,7 +652,18 @@ <argument index="0" name="control" type="Control"> </argument> <description> - Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. + Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree. + [codeblock] + export (Color, RGBA) var color = Color(1, 0, 0, 1) + + func get_drag_data(position): + # Use a control that is not in the tree + var cpb = ColorPickerButton.new() + cpb.color = color + cpb.rect_size = Vector2(50, 50) + set_drag_preview(cpb) + return color + [/codeblock] </description> </method> <method name="set_end"> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 831a0bb02f..7cb6b1b754 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -83,7 +83,13 @@ <return type="int"> </return> <description> - Returns a hashed integer value representing the dictionary contents. + Returns a hashed integer value representing the dictionary contents. This can be used to compare dictionaries by value: + [codeblock] + var dict1 = {0: 10} + var dict2 = {0: 10} + # The line below prints `true`, whereas it would have printed `false` if both variables were compared directly. + print(dict1.hash() == dict2.hash()) + [/codeblock] </description> </method> <method name="keys"> diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index cab5af3985..a713e06585 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -6,7 +6,7 @@ <description> This plugins allows adding custom property editors to [EditorInspector]. Plugins are registered via [method EditorPlugin.add_inspector_plugin]. - When an object is edited, the [method can_handle] function is called and must return true if the object type is supported. + When an object is edited, the [method can_handle] function is called and must return [code]true[/code] if the object type is supported. If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class. Subsequently, the [method parse_category] and [method parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. Finally [method parse_end] will be called. @@ -54,7 +54,7 @@ <argument index="0" name="object" type="Object"> </argument> <description> - Returns true if this object can be handled by this plugin. + Returns [code]true[/code] if this object can be handled by this plugin. </description> </method> <method name="parse_begin" qualifiers="virtual"> diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml index 5c49e227be..981e0a6180 100644 --- a/doc/classes/EditorScript.xml +++ b/doc/classes/EditorScript.xml @@ -5,7 +5,7 @@ </brief_description> <description> Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File > Run[/b] menu option (or by pressing [code]Ctrl+Shift+X[/code]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead. - [b]Note:[/b] Extending scripts need to have [code]tool mode[/code] enabled. + [b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled. [b]Example script:[/b] [codeblock] tool diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml new file mode 100644 index 0000000000..bf01ebfe82 --- /dev/null +++ b/doc/classes/EditorSpinSlider.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="EditorSpinSlider" inherits="Range" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false"> + </member> + <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" /> + <member name="label" type="String" setter="set_label" getter="get_label" default=""""> + </member> + <member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index 1a2d5cab81..52e4b94051 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -44,6 +44,7 @@ </return> <description> Returns the response's body length. + [b]Note:[/b] Some Web servers may not send a body length. In this case, the value returned will be [code]-1[/code]. If using chunked transfer encoding, the body length will also be [code]-1[/code]. </description> </method> <method name="get_response_code" qualifiers="const"> @@ -175,7 +176,7 @@ <argument index="0" name="bytes" type="int"> </argument> <description> - Sets the size of the buffer used and maximum bytes to read per iteration. see [method read_response_body_chunk] + Sets the size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk]. </description> </method> </methods> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 53ee0b6132..d0e8a5972f 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -1,13 +1,43 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="HTTPRequest" inherits="Node" category="Core" version="3.2"> <brief_description> - A node with the ability to send HTTP requests. + A node with the ability to send HTTP(S) requests. </brief_description> <description> A node with the ability to send HTTP requests. Uses [HTTPClient] internally. Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP. + [b]Example of loading and displaying an image using HTTPRequest:[/b] + [codeblock] + func _ready(): + # Create an HTTP request node and connect its completion signal. + var http_request = HTTPRequest.new() + add_child(http_request) + http_request.connect("request_completed", self, "_http_request_completed") + + # Perform the HTTP request. The URL below returns a PNG image as of writing. + var error = http_request.request("https://via.placeholder.com/512") + if error != OK: + push_error("An error occurred in the HTTP request.") + + + # Called when the HTTP request is completed. + func _http_request_completed(result, response_code, headers, body): + var image = Image.new() + var error = image.load_png_from_buffer(body) + if error != OK: + push_error("Couldn't load the image.") + + var texture = ImageTexture.new() + texture.create_from_image(image) + + # Display the image in a TextureRect node. + var texture_rect = TextureRect.new() + add_child(texture_rect) + texture_rect.texture = texture + [/codeblock] </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/networking/http_request_class.html</link> <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> </tutorials> <methods> @@ -23,6 +53,7 @@ </return> <description> Returns the response body length. + [b]Note:[/b] Some Web servers may not send a body length. In this case, the value returned will be [code]-1[/code]. If using chunked transfer encoding, the body length will also be [code]-1[/code]. </description> </method> <method name="get_downloaded_bytes" qualifiers="const"> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index d297bc98ae..c6d63035d1 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -415,7 +415,7 @@ <argument index="1" name="grayscale" type="bool" default="false"> </argument> <description> - Saves the image as an EXR file to [code]path[/code]. If grayscale is true and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module. + Saves the image as an EXR file to [code]path[/code]. If [code]grayscale[/code] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module. </description> </method> <method name="save_png" qualifiers="const"> @@ -456,6 +456,15 @@ <argument index="1" name="color" type="Color"> </argument> <description> + Sets the [Color] of the pixel at [code](dst.x, dst.y)[/code] if the image is locked. Note that the [code]dst[/code] values must be integers. Example: + [codeblock] + var img = Image.new() + img.create(img_width, img_height, false, Image.FORMAT_RGBA8) + img.lock() + img.set_pixelv(Vector2(x, y), color) # Works + img.unlock() + img.set_pixelv(Vector2(x, y), color) # Does not have an effect + [/codeblock] </description> </method> <method name="shrink_x2"> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 4c8d83adba..d412ce09e2 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -51,8 +51,10 @@ </return> <argument index="0" name="action" type="String"> </argument> + <argument index="1" name="allow_echo" type="bool" default="false"> + </argument> <description> - Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. + Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events, unless [code]allow_echo[/code] is [code]true[/code]). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. </description> </method> <method name="is_action_released" qualifiers="const"> diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index fab4cc0fb9..5cd6a0c285 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -4,7 +4,7 @@ Input event type for mouse motion events. </brief_description> <description> - Contains mouse motion information. Supports relative, absolute positions and speed. See [method Node._input]. + Contains mouse and pen motion information. Supports relative, absolute positions and speed. See [method Node._input]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link> @@ -12,12 +12,18 @@ <methods> </methods> <members> + <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> <member name="relative" type="Vector2" setter="set_relative" getter="get_relative" default="Vector2( 0, 0 )"> The mouse position relative to the previous position (position at the last frame). </member> <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" default="Vector2( 0, 0 )"> The mouse speed in pixels per second. </member> + <member name="tilt" type="Vector2" setter="set_tilt" getter="get_tilt" default="Vector2( 0, 0 )"> + Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from [code]-1.0[/code] to [code]1.0[/code] for both axes. + </member> </members> <constants> </constants> diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml index 9e65da8eea..9457800825 100644 --- a/doc/classes/MainLoop.xml +++ b/doc/classes/MainLoop.xml @@ -167,6 +167,17 @@ </description> </method> </methods> + <signals> + <signal name="on_request_permissions_result"> + <argument index="0" name="permission" type="String"> + </argument> + <argument index="1" name="granted" type="bool"> + </argument> + <description> + Emitted when an user responds to permission request. + </description> + </signal> + </signals> <constants> <constant name="NOTIFICATION_WM_MOUSE_ENTER" value="1002"> Notification received from the OS when the mouse enters the game window. diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index b206d4a4d2..1f685aab81 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -40,8 +40,9 @@ <return type="String"> </return> <description> - The string returned from this method is displayed as a warning in the "Scene Dock" if the script that overrides it is a [code]tool[/code] script. + The string returned from this method is displayed as a warning in the Scene Dock if the script that overrides it is a [code]tool[/code] script. Returning an empty string produces no warning. + Call [method update_configuration_warning] when the warning needs to be updated for this node. </description> </method> <method name="_input" qualifiers="virtual"> @@ -818,6 +819,14 @@ Sets whether this is an instance load placeholder. See [InstancePlaceholder]. </description> </method> + <method name="update_configuration_warning"> + <return type="void"> + </return> + <description> + Updates the warning displayed for this node in the Scene Dock. + Use [method _get_configuration_warning] to setup the warning message to display. + </description> + </method> </methods> <members> <member name="custom_multiplayer" type="MultiplayerAPI" setter="set_custom_multiplayer" getter="get_custom_multiplayer"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 9e1b25abe1..6da0547352 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -157,6 +157,8 @@ <return type="PoolStringArray"> </return> <description> + Returns an array of MIDI device names. + The returned array will be empty if the system MIDI driver has not previously been initialised with [method open_midi_inputs]. </description> </method> <method name="get_current_video_driver" qualifiers="const"> @@ -217,6 +219,13 @@ Returns the path to the current engine executable. </description> </method> + <method name="get_granted_permissions" qualifiers="const"> + <return type="PoolStringArray"> + </return> + <description> + With this function you can get the list of dangerous permissions that have been granted to the Android application. + </description> + </method> <method name="get_ime_selection" qualifiers="const"> <return type="Vector2"> </return> @@ -692,6 +701,7 @@ <return type="void"> </return> <description> + Initialises the singleton for the system MIDI driver. </description> </method> <method name="print_all_resources"> @@ -744,6 +754,13 @@ At the moment this function is only used by [code]AudioDriverOpenSL[/code] to request permission for [code]RECORD_AUDIO[/code] on Android. </description> </method> + <method name="request_permissions"> + <return type="bool"> + </return> + <description> + With this function you can request dangerous permissions since normal permissions are automatically granted at install time in Android application. + </description> + </method> <method name="set_icon"> <return type="void"> </return> @@ -861,6 +878,9 @@ <member name="low_processor_usage_mode" type="bool" setter="set_low_processor_usage_mode" getter="is_in_low_processor_usage_mode" default="false"> If [code]true[/code], the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile. </member> + <member name="low_processor_usage_mode_sleep_usec" type="int" setter="set_low_processor_usage_mode_sleep_usec" getter="get_low_processor_usage_mode_sleep_usec" default="6900"> + The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. + </member> <member name="max_window_size" type="Vector2" setter="set_max_window_size" getter="get_max_window_size" default="Vector2( 0, 0 )"> The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system default value. </member> diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml index fb74c5a3d4..7bfea8bce4 100644 --- a/doc/classes/Particles.xml +++ b/doc/classes/Particles.xml @@ -24,6 +24,7 @@ <argument index="0" name="pass" type="int"> </argument> <description> + Returns the [Mesh] that is drawn at index [code]pass[/code]. </description> </method> <method name="restart"> @@ -41,6 +42,7 @@ <argument index="1" name="mesh" type="Mesh"> </argument> <description> + Sets the [Mesh] that is drawn at index [code]pass[/code]. </description> </method> </methods> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index 69dfe28ac4..bb72f2734e 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -116,6 +116,14 @@ Returns the intersection point of a segment from position [code]begin[/code] to position [code]end[/code] with this plane. If no intersection is found, [code]null[/code] is returned. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="plane" type="Plane"> + </argument> + <description> + </description> + </method> <method name="is_point_over"> <return type="bool"> </return> diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index 21bf078017..867f042cd2 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -53,6 +53,13 @@ Returns a new [PoolByteArray] with the data decompressed. Set [code]buffer_size[/code] to the size of the uncompressed data. Set the compression mode using one of [enum File.CompressionMode]'s constants. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="get_string_from_ascii"> <return type="String"> </return> diff --git a/doc/classes/PoolColorArray.xml b/doc/classes/PoolColorArray.xml index a1fb868ef5..34cfa0ab53 100644 --- a/doc/classes/PoolColorArray.xml +++ b/doc/classes/PoolColorArray.xml @@ -33,6 +33,13 @@ Appends a [PoolColorArray] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolIntArray.xml b/doc/classes/PoolIntArray.xml index 28a28b2bba..25e1e718f7 100644 --- a/doc/classes/PoolIntArray.xml +++ b/doc/classes/PoolIntArray.xml @@ -34,6 +34,13 @@ Appends a [PoolIntArray] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolRealArray.xml b/doc/classes/PoolRealArray.xml index 7eaec82338..e8afe46640 100644 --- a/doc/classes/PoolRealArray.xml +++ b/doc/classes/PoolRealArray.xml @@ -33,6 +33,13 @@ Appends a [PoolRealArray] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolStringArray.xml b/doc/classes/PoolStringArray.xml index a408a18b19..f41a3c7a68 100644 --- a/doc/classes/PoolStringArray.xml +++ b/doc/classes/PoolStringArray.xml @@ -33,6 +33,13 @@ Appends a [PoolStringArray] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolVector2Array.xml b/doc/classes/PoolVector2Array.xml index 623247e639..321846d08b 100644 --- a/doc/classes/PoolVector2Array.xml +++ b/doc/classes/PoolVector2Array.xml @@ -33,6 +33,13 @@ Appends a [PoolVector2Array] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PoolVector3Array.xml b/doc/classes/PoolVector3Array.xml index adc28b46cb..c82bd62a11 100644 --- a/doc/classes/PoolVector3Array.xml +++ b/doc/classes/PoolVector3Array.xml @@ -33,6 +33,13 @@ Appends a [PoolVector3Array] at the end of this array. </description> </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> <method name="insert"> <return type="int"> </return> diff --git a/doc/classes/PopupDialog.xml b/doc/classes/PopupDialog.xml index d85f568abf..939453b977 100644 --- a/doc/classes/PopupDialog.xml +++ b/doc/classes/PopupDialog.xml @@ -12,4 +12,9 @@ </methods> <constants> </constants> + <theme_items> + <theme_item name="panel" type="StyleBox"> + Sets a custom [StyleBox] for the panel of the [PopupDialog]. + </theme_item> + </theme_items> </class> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 691aec2eb1..bdb6ca84ee 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -444,7 +444,7 @@ <argument index="1" name="enable" type="bool"> </argument> <description> - Sets the type of the item at the specified index [code]idx[/code] to radio button. If false, sets the type of the item to plain text. + Sets the type of the item at the specified index [code]idx[/code] to radio button. If [code]false[/code], sets the type of the item to plain text. </description> </method> <method name="set_item_as_separator"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 9657982016..772c2f5073 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -6,6 +6,7 @@ <description> Contains global variables accessible from everywhere. Use [method get_setting], [method set_setting] or [method has_setting] to access them. Variables stored in [code]project.godot[/code] are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options. When naming a Project Settings property, use the full path to the setting including the category. For example, [code]"application/config/name"[/code] for the project name. Category and property names can be viewed in the Project Settings dialog. + [b]Overriding:[/b] Any project setting can be overridden by creating a file named [code]override.cfg[/code] in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. </description> <tutorials> </tutorials> @@ -144,6 +145,7 @@ <argument index="1" name="value" type="Variant"> </argument> <description> + Sets the specified property's initial value. This is the value the property reverts to. </description> </method> <method name="set_order"> @@ -165,6 +167,11 @@ <argument index="1" name="value" type="Variant"> </argument> <description> + Sets the value of a setting. + [b]Example:[/b] + [codeblock] + ProjectSettings.set_setting("application/config/name", "Example") + [/codeblock] </description> </method> </methods> @@ -201,6 +208,7 @@ </member> <member name="application/config/project_settings_override" type="String" setter="" getter="" default=""""> Specifies a file to override project settings. For example: [code]user://custom_settings.cfg[/code]. + [b]Note:[/b] Regardless of this setting's value, [code]res://override.cfg[/code] will still be read to override the project settings (see this class' description at the top). </member> <member name="application/config/use_custom_user_dir" type="bool" setter="" getter="" default="false"> If [code]true[/code], the project will save user data to its own user directory (see [member application/config/custom_user_dir_name]). This setting is only effective on desktop platforms. A name must be set in the [member application/config/custom_user_dir_name] setting for this to take effect. If [code]false[/code], the project will save user data to [code](OS user data directory)/Godot/app_userdata/(project name)[/code]. @@ -274,6 +282,9 @@ <member name="debug/gdscript/warnings/enable" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables specific GDScript warnings (see [code]debug/gdscript/warnings/*[/code] settings). If [code]false[/code], disables all GDScript warnings. </member> + <member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true"> + If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings. + </member> <member name="debug/gdscript/warnings/function_conflicts_constant" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables warnings when a function is declared with the same name as a constant. </member> @@ -420,9 +431,6 @@ <member name="display/window/vsync/use_vsync" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5). </member> - <member name="editor/active" type="bool" setter="" getter="" default="false"> - Internal editor setting, don't touch. - </member> <member name="editor/script_templates_search_path" type="String" setter="" getter="" default=""res://script_templates""> </member> <member name="editor/search_in_file_extensions" type="PoolStringArray" setter="" getter="" default="PoolStringArray( "gd", "shader" )"> diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 9d163e926c..f5ee99d30c 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -94,6 +94,14 @@ Returns the inverse of the quaternion. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="quat" type="Quat"> + </argument> + <description> + </description> + </method> <method name="is_normalized"> <return type="bool"> </return> diff --git a/doc/classes/RayCast.xml b/doc/classes/RayCast.xml index 19f62a57bd..5e17d6e7d7 100644 --- a/doc/classes/RayCast.xml +++ b/doc/classes/RayCast.xml @@ -11,6 +11,7 @@ RayCast calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame), use [method force_raycast_update] after adjusting the raycast. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="add_exception"> diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml index 81d66ef496..c5ba5da24e 100644 --- a/doc/classes/RayCast2D.xml +++ b/doc/classes/RayCast2D.xml @@ -11,6 +11,7 @@ RayCast2D calculates intersection every physics frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <methods> <method name="add_exception"> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 9d6bfbf398..07fa7777fe 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -137,6 +137,14 @@ Returns [code]true[/code] if the [Rect2] overlaps with another. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="rect" type="Rect2"> + </argument> + <description> + </description> + </method> <method name="merge"> <return type="Rect2"> </return> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index faf2ac1ff9..2962391b99 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -16,8 +16,13 @@ </return> <argument index="0" name="image" type="Texture"> </argument> + <argument index="1" name="width" type="int" default="0"> + </argument> + <argument index="2" name="height" type="int" default="0"> + </argument> <description> - Adds an image's opening and closing tags to the tag stack. + Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image. + If [code]width[/code] or [code]height[/code] is set to 0, the image size will be adjusted in order to keep the original aspect ratio. </description> </method> <method name="add_text"> @@ -128,6 +133,18 @@ Adds an [code][align][/code] tag based on the given [code]align[/code] value. See [enum Align] for possible values. </description> </method> + <method name="push_bold"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="push_bold_italics"> + <return type="void"> + </return> + <description> + </description> + </method> <method name="push_cell"> <return type="void"> </return> @@ -162,6 +179,12 @@ Adds an [code][indent][/code] tag to the tag stack. Multiplies "level" by current tab_size to determine new margin length. </description> </method> + <method name="push_italics"> + <return type="void"> + </return> + <description> + </description> + </method> <method name="push_list"> <return type="void"> </return> @@ -180,6 +203,18 @@ Adds a [code][meta][/code] tag to the tag stack. Similar to the BBCode [code][url=something]{text}[/url][/code], but supports non-[String] metadata types. </description> </method> + <method name="push_mono"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="push_normal"> + <return type="void"> + </return> + <description> + </description> + </method> <method name="push_strikethrough"> <return type="void"> </return> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index bd81a48ff5..e14a3b3759 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -204,6 +204,7 @@ </argument> <description> If [code]true[/code], the application automatically accepts quitting. Enabled by default. + For mobile platforms, see [method set_quit_on_go_back]. </description> </method> <method name="set_group"> @@ -248,6 +249,7 @@ </argument> <description> If [code]true[/code], the application quits automatically on going back (e.g. on Android). Enabled by default. + To handle 'Go Back' button when this option is disabled, use [constant MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST]. </description> </method> <method name="set_screen_stretch"> diff --git a/doc/classes/SoftBody.xml b/doc/classes/SoftBody.xml index 5cde31fa59..a51907b1bf 100644 --- a/doc/classes/SoftBody.xml +++ b/doc/classes/SoftBody.xml @@ -7,6 +7,7 @@ A deformable physics body. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/soft_body.html</link> </tutorials> <methods> <method name="add_collision_exception_with"> @@ -43,12 +44,6 @@ Returns an individual bit on the collision mask. </description> </method> - <method name="is_ray_pickable" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> <method name="remove_collision_exception_with"> <return type="void"> </return> @@ -80,25 +75,17 @@ Sets individual bits on the collision mask. Use this if you only need to change one layer's value. </description> </method> - <method name="set_ray_pickable"> - <return type="void"> - </return> - <argument index="0" name="ray_pickable" type="bool"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="areaAngular_stiffness" type="float" setter="set_areaAngular_stiffness" getter="get_areaAngular_stiffness" default="0.5"> </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> - The physics layers this area is in. + The physics layers this SoftBody is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> - The physics layers this area scans for collisions. + The physics layers this SoftBody scans for collisions. </member> <member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01"> </member> @@ -107,15 +94,20 @@ <member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.5"> </member> <member name="parent_collision_ignore" type="NodePath" setter="set_parent_collision_ignore" getter="get_parent_collision_ignore" default="NodePath("")"> + [NodePath] to a [CollisionObject] this SoftBody should avoid clipping. </member> <member name="pose_matching_coefficient" type="float" setter="set_pose_matching_coefficient" getter="get_pose_matching_coefficient" default="0.0"> </member> <member name="pressure_coefficient" type="float" setter="set_pressure_coefficient" getter="get_pressure_coefficient" default="0.0"> </member> + <member name="ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" default="true"> + If [code]true[/code], the [SoftBody] will respond to [RayCast]s. + </member> <member name="simulation_precision" type="int" setter="set_simulation_precision" getter="get_simulation_precision" default="5"> Increasing this value will improve the resulting simulation, but can affect performance. Use with care. </member> <member name="total_mass" type="float" setter="set_total_mass" getter="get_total_mass" default="1.0"> + The SoftBody's mass. </member> <member name="volume_stiffness" type="float" setter="set_volume_stiffness" getter="get_volume_stiffness" default="0.5"> </member> diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml index 09a5bf3b8f..0309e73eec 100644 --- a/doc/classes/Spatial.xml +++ b/doc/classes/Spatial.xml @@ -15,6 +15,7 @@ <return type="void"> </return> <description> + Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. </description> </method> <method name="get_parent_spatial" qualifiers="const"> @@ -48,6 +49,7 @@ <argument index="0" name="scale" type="Vector3"> </argument> <description> + Scales the global (world) transformation by the given [Vector3] scale factors. </description> </method> <method name="global_translate"> @@ -77,6 +79,7 @@ <return type="bool"> </return> <description> + Returns whether this node uses a scale of [code](1, 1, 1)[/code] or its local transformation scale. </description> </method> <method name="is_set_as_toplevel" qualifiers="const"> @@ -206,6 +209,7 @@ <argument index="0" name="disable" type="bool"> </argument> <description> + Sets whether the node uses a scale of [code](1, 1, 1)[/code] or its local transformation scale. Changes to the local transformation scale are preserved. </description> </method> <method name="set_identity"> diff --git a/doc/classes/SpringArm.xml b/doc/classes/SpringArm.xml index 438d96f2b3..133ff68859 100644 --- a/doc/classes/SpringArm.xml +++ b/doc/classes/SpringArm.xml @@ -1,8 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="SpringArm" inherits="Spatial" category="Core" version="3.2"> <brief_description> + A helper node, mostly used in 3rd person cameras. </brief_description> <description> + The SpringArm node is a node that casts a ray (or collision shape) along its z axis and moves all its direct children to the collision point, minus a margin. + The most common use case for this is to make a 3rd person camera that reacts to collisions in the environment. + The SpringArm will either cast a ray, or if a shape is given, it will cast the shape in the direction of its z axis. + If you use the SpringArm as a camera controller for your player, you might need to exclude the player's collider from the SpringArm's collision check. </description> <tutorials> </tutorials> @@ -13,18 +18,21 @@ <argument index="0" name="RID" type="RID"> </argument> <description> + Adds the object with the given [RID] to the list of objects excluded from the collision check. </description> </method> <method name="clear_excluded_objects"> <return type="void"> </return> <description> + Clears the list of objects excluded from the collision check. </description> </method> <method name="get_hit_length"> <return type="float"> </return> <description> + Returns the proportion between the current arm length (after checking for collisions) and the [member spring_length]. Ranges from 0 to 1. </description> </method> <method name="remove_excluded_object"> @@ -33,17 +41,26 @@ <argument index="0" name="RID" type="RID"> </argument> <description> + Removes the given [RID] from the list of objects excluded from the collision check. </description> </method> </methods> <members> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> + The layers against which the collision check shall be done. </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.01"> + When the collision check is made, a candidate length for the SpringArm is given. + The margin is then subtracted to this length and the translation is applied to the child objects of the SpringArm. + This margin is useful for when the SpringArm has a [Camera] as a child node: without the margin, the [Camera] would be placed on the exact point of collision, while with the margin the [Camera] would be placed close to the point of collision. </member> <member name="shape" type="Shape" setter="set_shape" getter="get_shape"> + The [Shape] to use for the SpringArm. + When the shape is set, the SpringArm will cast the [Shape] on its z axis instead of performing a ray cast. </member> <member name="spring_length" type="float" setter="set_length" getter="get_length" default="1.0"> + The maximum extent of the SpringArm. This is used as a length for both the ray and the shape cast used internally to calculate the desired position of the SpringArm's child nodes. + To know more about how to perform a shape cast or a ray cast, please consult the [PhysicsDirectSpaceState] documentation. </member> </members> <constants> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index cf152e716e..e0a4a24299 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -459,7 +459,7 @@ <argument index="1" name="what" type="String"> </argument> <description> - Inserts a substring at a given position. + Returns a copy of the string with the substring [code]what[/code] inserted at the given position. </description> </method> <method name="is_abs_path"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 8a114efd34..75fceac500 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -54,7 +54,7 @@ <return type="void"> </return> <description> - Clears all the syntax coloring information. + Clears all custom syntax coloring information previously added with [method add_color_region] or [method add_keyword_color]. </description> </method> <method name="clear_undo_history"> @@ -94,7 +94,7 @@ </argument> <description> Moves the cursor at the specified [code]column[/code] index. - If [code]adjust_viewport[/code] is set to true, the viewport will center at the cursor position after the move occurs. + If [code]adjust_viewport[/code] is set to [code]true[/code], the viewport will center at the cursor position after the move occurs. </description> </method> <method name="cursor_set_line"> @@ -110,8 +110,8 @@ </argument> <description> Moves the cursor at the specified [code]line[/code] index. - If [code]adjust_viewport[/code] is set to true, the viewport will center at the cursor position after the move occurs. - If [code]can_be_hidden[/code] is set to true, the specified [code]line[/code] can be hidden using [method set_line_as_hidden]. + If [code]adjust_viewport[/code] is set to [code]true[/code], the viewport will center at the cursor position after the move occurs. + If [code]can_be_hidden[/code] is set to [code]true[/code], the specified [code]line[/code] can be hidden using [method set_line_as_hidden]. </description> </method> <method name="cut"> @@ -310,7 +310,15 @@ <argument index="3" name="from_column" type="int"> </argument> <description> - Perform a search inside the text. Search flags can be specified in the[code]SEARCH_*[/code] enum. + Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum. + Returns an empty [code]PoolIntArray[/code] if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [enum SearchResult] enum, e.g: + [codeblock] + var result = search(key, flags, line, column) + if result.size() > 0: + # result found + var res_line = result[TextEdit.SEARCH_RESULT_LINE] + var res_column = result[TextEdit.SEARCH_RESULT_COLUMN] + [/codeblock] </description> </method> <method name="select"> @@ -504,8 +512,14 @@ <constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags"> Search from end to beginning. </constant> + <constant name="SEARCH_RESULT_COLUMN" value="0" enum="SearchResult"> + Used to access the result column from [method search]. + </constant> + <constant name="SEARCH_RESULT_LINE" value="1" enum="SearchResult"> + Used to access the result line from [method search]. + </constant> <constant name="MENU_CUT" value="0" enum="MenuItems"> - Cuts (Copies and clears) the selected text. + Cuts (copies and clears) the selected text. </constant> <constant name="MENU_COPY" value="1" enum="MenuItems"> Copies the selected text. @@ -530,7 +544,7 @@ </constant> </constants> <theme_items> - <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 1 )"> + <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )"> Sets the background [Color] of this [TextEdit]. [member syntax_highlighting] has to be enabled. </theme_item> <theme_item name="bookmark_color" type="Color" default="Color( 0.08, 0.49, 0.98, 1 )"> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index e4db9243ef..dd12c5af23 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -15,6 +15,7 @@ <return type="void"> </return> <description> + Clears all values on the theme. </description> </method> <method name="clear_color"> @@ -85,6 +86,7 @@ <argument index="0" name="other" type="Theme"> </argument> <description> + Sets the Theme's values to a copy of a given theme. </description> </method> <method name="get_color" qualifiers="const"> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 75eb8b5862..7376f624cb 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -43,6 +43,7 @@ <argument index="1" name="y" type="int"> </argument> <description> + Returns the coordinate of the autotile variation in the tileset. Returns a zero vector if the cell doesn't have autotiling. </description> </method> <method name="get_cellv" qualifiers="const"> @@ -255,6 +256,7 @@ </methods> <members> <member name="cell_clip_uv" type="bool" setter="set_clip_uv" getter="get_clip_uv" default="false"> + If [code]true[/code], the cell's UVs will be clipped. </member> <member name="cell_custom_transform" type="Transform2D" setter="set_custom_transform" getter="get_custom_transform" default="Transform2D( 64, 0, 0, 64, 0, 0 )"> The custom [Transform2D] to be applied to the TileMap's cells. @@ -294,6 +296,7 @@ If [code]true[/code], TileMap collisions will be handled as a kinematic body. If [code]false[/code], collisions will be handled as static body. </member> <member name="collision_use_parent" type="bool" setter="set_collision_use_parent" getter="get_collision_use_parent" default="false"> + If [code]true[/code], this tilemap's collision shape will be added to the collision shape of the parent. The parent has to be a [CollisionObject2D]. </member> <member name="compatibility_mode" type="bool" setter="set_compatibility_mode" getter="is_compatibility_mode_enabled" default="false"> If [code]true[/code], the compatibility with the tilemaps made in Godot 3.1 or earlier is maintained (textures move when the tile origin changes and rotate if the texture size is not homogeneous). This mode presents problems when doing [code]flip_h[/code], [code]flip_v[/code] and [code]transpose[/code] tile operations on non-homogeneous isometric tiles (e.g. 2:1), in which the texture could not coincide with the collision, thus it is not recommended for isometric or non-square tiles. diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index fccfb4cd6d..3d18534a68 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -37,7 +37,7 @@ The button's shape. </member> <member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered" default="true"> - If [code]true[/code], the button's shape is centered. + If [code]true[/code], the button's shape is centered in the provided texture. If no texture is used, this property has no effect. </member> <member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible" default="true"> If [code]true[/code], the button's shape is visible. diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 6ebc389ed7..034a1b2f5b 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -89,6 +89,14 @@ Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="transform" type="Transform"> + </argument> + <description> + </description> + </method> <method name="looking_at"> <return type="Transform"> </return> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 580da080b3..89ccffc2e9 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -106,6 +106,14 @@ Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="transform" type="Transform2D"> + </argument> + <description> + </description> + </method> <method name="orthonormalized"> <return type="Transform2D"> </return> diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml index 4c06195d5c..6240178b82 100644 --- a/doc/classes/VScrollBar.xml +++ b/doc/classes/VScrollBar.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VScrollBar" inherits="ScrollBar" category="Core" version="3.2"> <brief_description> - Vertical version of [ScrollBar], which goes from left (min) to right (max). + Vertical version of [ScrollBar], which goes from top (min) to bottom (max). </brief_description> <description> </description> diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml index 522e131b45..9d55f5846f 100644 --- a/doc/classes/Variant.xml +++ b/doc/classes/Variant.xml @@ -4,7 +4,37 @@ The most important data type in Godot. </brief_description> <description> + In computer programming, a Variant class is a class that is designed to store a variety of other types. Dynamic programming languages like PHP, Lua, JavaScript and GDScript like to use them to store variables' data on the backend. With these Variants, properties are able to change value types freely. + [codeblock] + var foo = 2 # foo is dynamically an integer + foo = "Now foo is a string!" + foo = Reference.new() # foo is an Object + var bar: int = 2 # bar is a statically typed integer. + # bar = "Uh oh! I can't make static variables become a different type!" + [/codeblock] + Godot tracks all scripting API variables within Variants. Without even realizing it, you use Variants all the time. When a particular language enforces its own rules for keeping data typed, then that language is applying its own custom logic over the base Variant scripting API. + - GDScript automatically wrap values in them. It keeps all data in plain Variants by default and then optionally enforces custom static typing rules on variable types. + - VisualScript tracks properties inside Variants as well, but it also uses static typing. The GUI interface enforces that properties have a particular type that doesn't change over time. + - C# is statically typed, but uses the Mono [code]object[/code] type in place of Godot's Variant class when it needs to represent a dynamic value. [code]object[/code] is the Mono runtime's equivalent of the same concept. + - The statically-typed language NativeScript C++ does not define a built-in Variant-like class. Godot's GDNative bindings provide their own godot::Variant class for users; Any point at which the C++ code starts interacting with the Godot runtime is a place where you might have to start wrapping data inside Variant objects. + The global [method @GDScript.typeof] function returns the enumerated value of the Variant type stored in the current variable. These correspond to [code]TYPE_*[/code] constants in the [@GlobalScope] docs. + [codeblock] + var foo = 2 + match typeof(foo): + TYPE_NIL: + print("foo is null") + TYPE_INTEGER: + print("foo is an integer") + TYPE_OBJECT: + # Note that Objects are their own special category. + # To get the name of the underlying Object type, you need the `get_class()` method. + print("foo is a(n) %s" % foo.get_class()) # inject the class name into a formatted string. + # Note also that there is not yet any way to get a script's `class_name` string easily. + # To fetch that value, you need to dig deeply into a hidden ProjectSettings setting: an Array of Dictionaries called "_global_script_classes". + # Open your project.godot file to see it up close. + [/codeblock] A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time. Instead, they are used mainly for communication, editing, serialization and moving data around. + Godot has specifically invested in making its Variant class as flexible as possible; so much so that it is used for a multitude of operations to facilitate communication between all of Godot's systems. A Variant: - Can store almost any datatype. - Can perform operations between many variants. GDScript uses Variant as its atomic/native datatype. @@ -16,10 +46,11 @@ - Can be serialized to text and use it for printing values and editable settings. - Can work as an exported property, so the editor can edit it universally. - Can be used for dictionaries, arrays, parsers, etc. - [b]Containers ([Array] and [Dictionary]):[/b] Both are implemented using variants. A [Dictionary] can match any datatype used as key to any other datatype. An [Array] just holds an array of Variants. Of course, a Variant can also hold a [Dictionary] and an [Array] inside, making it even more flexible. + [b]Containers (Array and Dictionary):[/b] Both are implemented using variants. A [Dictionary] can match any datatype used as key to any other datatype. An [Array] just holds an array of Variants. Of course, a Variant can also hold a [Dictionary] and an [Array] inside, making it even more flexible. Modifications to a container will modify all references to it. A [Mutex] should be created to lock it if multi-threaded access is desired. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/development/cpp/variant_class.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 987ed9867b..8ae5caf68c 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -153,6 +153,14 @@ Returns the vector with all components rounded down. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="v" type="Vector2"> + </argument> + <description> + </description> + </method> <method name="is_normalized"> <return type="bool"> </return> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 05ce6c43ae..29c24709e2 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -129,6 +129,14 @@ Returns the inverse of the vector. This is the same as [code]Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )[/code]. </description> </method> + <method name="is_equal_approx"> + <return type="bool"> + </return> + <argument index="0" name="v" type="Vector3"> + </argument> + <description> + </description> + </method> <method name="is_normalized"> <return type="bool"> </return> diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml index 2215f26c23..804489f7f1 100644 --- a/doc/classes/VideoPlayer.xml +++ b/doc/classes/VideoPlayer.xml @@ -16,7 +16,7 @@ Returns the video stream's name. </description> </method> - <method name="get_video_texture"> + <method name="get_video_texture" qualifiers="const"> <return type="Texture"> </return> <description> diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index b95b970816..28365c213b 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -2782,6 +2782,22 @@ <description> </description> </method> + <method name="particles_is_inactive"> + <return type="bool"> + </return> + <argument index="0" name="particles" type="RID"> + </argument> + <description> + </description> + </method> + <method name="particles_request_process"> + <return type="void"> + </return> + <argument index="0" name="particles" type="RID"> + </argument> + <description> + </description> + </method> <method name="particles_restart"> <return type="void"> </return> @@ -4238,6 +4254,12 @@ <constant name="VIEWPORT_MSAA_16X" value="4" enum="ViewportMSAA"> Multisample antialiasing is set to 16×. </constant> + <constant name="VIEWPORT_MSAA_EXT_2X" value="5" enum="ViewportMSAA"> + Multisample antialiasing is set to 2× on external texture. Special mode for GLES2 VR for the Oculus Quest. + </constant> + <constant name="VIEWPORT_MSAA_EXT_4X" value="6" enum="ViewportMSAA"> + Multisample antialiasing is set to 4× on external texture. Special mode for GLES2 VR for the Oculus Quest. + </constant> <constant name="VIEWPORT_USAGE_2D" value="0" enum="ViewportUsage"> The Viewport does not render 3D but samples. </constant> diff --git a/doc/classes/VisualShader.xml b/doc/classes/VisualShader.xml index f0f03b6c21..15216948e4 100644 --- a/doc/classes/VisualShader.xml +++ b/doc/classes/VisualShader.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisualShader" inherits="Shader" category="Core" version="3.2"> <brief_description> + A custom shader program with a visual editor. </brief_description> <description> + This class allows you to define a custom shader program that can be used for various materials to render objects. + The visual shader editor creates the shader. </description> <tutorials> </tutorials> diff --git a/doc/classes/VisualShaderNodeCubeMap.xml b/doc/classes/VisualShaderNodeCubeMap.xml index 36465a6b4d..29ebe95086 100644 --- a/doc/classes/VisualShaderNodeCubeMap.xml +++ b/doc/classes/VisualShaderNodeCubeMap.xml @@ -12,10 +12,16 @@ <member name="cube_map" type="CubeMap" setter="set_cube_map" getter="get_cube_map"> </member> <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> + <member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeCubeMap.Source" default="0"> + </member> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeCubeMap.TextureType" default="0"> </member> </members> <constants> + <constant name="SOURCE_TEXTURE" value="0" enum="Source"> + </constant> + <constant name="SOURCE_PORT" value="1" enum="Source"> + </constant> <constant name="TYPE_DATA" value="0" enum="TextureType"> </constant> <constant name="TYPE_COLOR" value="1" enum="TextureType"> diff --git a/doc/classes/VisualShaderNodeInput.xml b/doc/classes/VisualShaderNodeInput.xml index 302c8dff71..bfcd4c734c 100644 --- a/doc/classes/VisualShaderNodeInput.xml +++ b/doc/classes/VisualShaderNodeInput.xml @@ -7,6 +7,12 @@ <tutorials> </tutorials> <methods> + <method name="get_input_real_name" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> </methods> <members> <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 1b27e4a35a..ef38299680 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -435,21 +435,30 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S # Signals if len(class_def.signals) > 0: f.write(make_heading('Signals', '-')) + index = 0 + for signal in class_def.signals.values(): - #f.write(".. _class_{}_{}:\n\n".format(class_name, signal.name)) + if index != 0: + f.write('----\n\n') + f.write(".. _class_{}_signal_{}:\n\n".format(class_name, signal.name)) _, signature = make_method_signature(class_def, signal, False, state) f.write("- {}\n\n".format(signature)) - if signal.description is None or signal.description.strip() == '': - continue - f.write(rstize_text(signal.description.strip(), state)) - f.write("\n\n") + if signal.description is not None and signal.description.strip() != '': + f.write(rstize_text(signal.description.strip(), state) + '\n\n') + + index += 1 # Enums if len(class_def.enums) > 0: f.write(make_heading('Enumerations', '-')) + index = 0 + for e in class_def.enums.values(): + if index != 0: + f.write('----\n\n') + f.write(".. _enum_{}_{}:\n\n".format(class_name, e.name)) # Sphinx seems to divide the bullet list into individual <ul> tags if we weave the labels into it. # As such I'll put them all above the list. Won't be perfect but better than making the list visually broken. @@ -463,8 +472,11 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S f.write("- **{}** = **{}**".format(value.name, value.value)) if value.text is not None and value.text.strip() != '': f.write(' --- ' + rstize_text(value.text.strip(), state)) + f.write('\n\n') + index += 1 + # Constants if len(class_def.constants) > 0: f.write(make_heading('Constants', '-')) @@ -477,6 +489,7 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S f.write("- **{}** = **{}**".format(constant.name, constant.value)) if constant.text is not None and constant.text.strip() != '': f.write(' --- ' + rstize_text(constant.text.strip(), state)) + f.write('\n\n') # Class description @@ -494,11 +507,15 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S # Property descriptions if any(not p.overridden for p in class_def.properties.values()) > 0: f.write(make_heading('Property Descriptions', '-')) + index = 0 + for property_def in class_def.properties.values(): if property_def.overridden: continue - #f.write(".. _class_{}_{}:\n\n".format(class_name, property_def.name)) + if index != 0: + f.write('----\n\n') + f.write(".. _class_{}_property_{}:\n\n".format(class_name, property_def.name)) f.write('- {} **{}**\n\n'.format(property_def.type_name.to_rst(state), property_def.name)) @@ -514,24 +531,30 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S format_table(f, info) if property_def.text is not None and property_def.text.strip() != '': - f.write(rstize_text(property_def.text.strip(), state)) - f.write('\n\n') + f.write(rstize_text(property_def.text.strip(), state) + '\n\n') + + index += 1 # Method descriptions if len(class_def.methods) > 0: f.write(make_heading('Method Descriptions', '-')) + index = 0 + for method_list in class_def.methods.values(): for i, m in enumerate(method_list): + if index != 0: + f.write('----\n\n') + if i == 0: - #f.write(".. _class_{}_{}:\n\n".format(class_name, m.name)) f.write(".. _class_{}_method_{}:\n\n".format(class_name, m.name)) + ret_type, signature = make_method_signature(class_def, m, False, state) f.write("- {} {}\n\n".format(ret_type, signature)) - if m.description is None or m.description.strip() == '': - continue - f.write(rstize_text(m.description.strip(), state)) - f.write("\n\n") + if m.description is not None and m.description.strip() != '': + f.write(rstize_text(m.description.strip(), state) + '\n\n') + + index += 1 def make_class_list(class_list, columns): # type: (List[str], int) -> None @@ -897,7 +920,7 @@ def rstize_text(text, state): # type: (str, State) -> str def format_table(f, data, remove_empty_columns=False): # type: (TextIO, Iterable[Tuple[str, ...]]) -> None if len(data) == 0: return - + column_sizes = [0] * len(data[0]) for row in data: for i, text in enumerate(row): @@ -912,7 +935,7 @@ def format_table(f, data, remove_empty_columns=False): # type: (TextIO, Iterabl sep += "+" + "-" * (size + 2) sep += "+\n" f.write(sep) - + for row in data: row_text = "|" for i, text in enumerate(row): diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp index 3b06c47244..9081fccd3a 100644 --- a/drivers/coreaudio/audio_driver_coreaudio.cpp +++ b/drivers/coreaudio/audio_driver_coreaudio.cpp @@ -186,15 +186,15 @@ OSStatus AudioDriverCoreAudio::output_callback(void *inRefCon, for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) { AudioBuffer *abuf = &ioData->mBuffers[i]; - int frames_left = inNumberFrames; + unsigned int frames_left = inNumberFrames; int16_t *out = (int16_t *)abuf->mData; while (frames_left) { - int frames = MIN(frames_left, ad->buffer_frames); + unsigned int frames = MIN(frames_left, ad->buffer_frames); ad->audio_server_process(frames, ad->samples_in.ptrw()); - for (int j = 0; j < frames * ad->channels; j++) { + for (unsigned int j = 0; j < frames * ad->channels; j++) { out[j] = ad->samples_in[j] >> 16; } @@ -231,7 +231,7 @@ OSStatus AudioDriverCoreAudio::input_callback(void *inRefCon, OSStatus result = AudioUnitRender(ad->input_unit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, &bufferList); if (result == noErr) { - for (int i = 0; i < inNumberFrames * ad->capture_channels; i++) { + for (unsigned int i = 0; i < inNumberFrames * ad->capture_channels; i++) { int32_t sample = ad->input_buf[i] << 16; ad->capture_buffer_write(sample); diff --git a/drivers/coremidi/midi_driver_coremidi.cpp b/drivers/coremidi/midi_driver_coremidi.cpp index 7a92ac0702..28665b5190 100644 --- a/drivers/coremidi/midi_driver_coremidi.cpp +++ b/drivers/coremidi/midi_driver_coremidi.cpp @@ -39,7 +39,7 @@ void MIDIDriverCoreMidi::read(const MIDIPacketList *packet_list, void *read_proc_ref_con, void *src_conn_ref_con) { MIDIPacket *packet = const_cast<MIDIPacket *>(packet_list->packet); - for (int i = 0; i < packet_list->numPackets; i++) { + for (UInt32 i = 0; i < packet_list->numPackets; i++) { receive_input_packet(packet->timeStamp, packet->data, packet->length); packet = MIDIPacketNext(packet); } diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index 088ce3d198..6bcda62e7f 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -131,7 +131,7 @@ void RasterizerSceneGLES2::shadow_atlas_set_size(RID p_atlas, int p_size) { //maximum compatibility, renderbuffer and RGBA shadow glGenRenderbuffers(1, &shadow_atlas->depth); - glBindRenderbuffer(GL_RENDERBUFFER, directional_shadow.depth); + glBindRenderbuffer(GL_RENDERBUFFER, shadow_atlas->depth); glRenderbufferStorage(GL_RENDERBUFFER, storage->config.depth_internalformat, shadow_atlas->size, shadow_atlas->size); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, shadow_atlas->depth); @@ -2767,6 +2767,8 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p if (use_post_process) { next_buffer = storage->frame.current_rt->mip_maps[0].sizes[0].fbo; + } else if (storage->frame.current_rt->external.fbo != 0) { + next_buffer = storage->frame.current_rt->external.fbo; } else { // set next_buffer to front buffer so multisample blit can happen if needed next_buffer = storage->frame.current_rt->fbo; @@ -2795,9 +2797,15 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p // In GLES2 Android Blit is not available, so just copy color texture manually _copy_texture_to_buffer(storage->frame.current_rt->multisample_color, next_buffer); +#else + // TODO: any other platform not supported? this will fail.. maybe we should just call _copy_texture_to_buffer here as well? #endif } else if (use_post_process) { - _copy_texture_to_buffer(storage->frame.current_rt->color, storage->frame.current_rt->mip_maps[0].sizes[0].fbo); + if (storage->frame.current_rt->external.fbo != 0) { + _copy_texture_to_buffer(storage->frame.current_rt->external.color, storage->frame.current_rt->mip_maps[0].sizes[0].fbo); + } else { + _copy_texture_to_buffer(storage->frame.current_rt->color, storage->frame.current_rt->mip_maps[0].sizes[0].fbo); + } } if (!use_post_process) { @@ -3220,14 +3228,12 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const } else { state.render_no_shadows = false; - if (storage->frame.current_rt->external.fbo != 0) { + if (storage->frame.current_rt->multisample_active) { + current_fb = storage->frame.current_rt->multisample_fbo; + } else if (storage->frame.current_rt->external.fbo != 0) { current_fb = storage->frame.current_rt->external.fbo; } else { - if (storage->frame.current_rt->multisample_active) { - current_fb = storage->frame.current_rt->multisample_fbo; - } else { - current_fb = storage->frame.current_rt->fbo; - } + current_fb = storage->frame.current_rt->fbo; } env = environment_owner.getornull(p_environment); @@ -3769,6 +3775,10 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_ glEnable(GL_SCISSOR_TEST); glClearDepth(1.0f); glClear(GL_DEPTH_BUFFER_BIT); + if (storage->config.use_rgba_3d_shadows) { + glClearColor(1.0, 1.0, 1.0, 1.0); + glClear(GL_COLOR_BUFFER_BIT); + } glDisable(GL_SCISSOR_TEST); if (light->reverse_cull) { diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 451d6adaa9..82cb1ef90b 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -114,7 +114,7 @@ void RasterizerStorageGLES2::bind_quad_array() const { glEnableVertexAttribArray(VS::ARRAY_TEX_UV); } -Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_will_need_resize) const { +Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, 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 { r_gl_format = 0; Ref<Image> image = p_image; @@ -261,7 +261,7 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_ } break; case Image::FORMAT_DXT1: { - if (config.s3tc_supported && !p_will_need_resize) { + if (config.s3tc_supported) { r_gl_internal_format = _EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; @@ -273,7 +273,7 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_ } break; case Image::FORMAT_DXT3: { - if (config.s3tc_supported && !p_will_need_resize) { + if (config.s3tc_supported) { r_gl_internal_format = _EXT_COMPRESSED_RGBA_S3TC_DXT3_EXT; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; @@ -285,7 +285,7 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_ } break; case Image::FORMAT_DXT5: { - if (config.s3tc_supported && !p_will_need_resize) { + if (config.s3tc_supported) { r_gl_internal_format = _EXT_COMPRESSED_RGBA_S3TC_DXT5_EXT; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; @@ -424,7 +424,7 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_ } break; case Image::FORMAT_ETC: { - if (config.etc1_supported && !p_will_need_resize) { + if (config.etc1_supported) { r_gl_internal_format = _EXT_ETC1_RGB8_OES; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; @@ -467,7 +467,7 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_ } } - if (need_decompress) { + if (need_decompress || p_force_decompress) { if (!image.is_null()) { @@ -638,7 +638,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p if (texture->resize_to_po2) { if (p_image->is_compressed()) { - ERR_PRINTS("Texture '" + texture->path + "' was required to be a power of 2 (because it uses either mipmaps or repeat), so it was decompressed. This will hurt performance and memory usage."); + ERR_PRINTS("Texture '" + texture->path + "' is required to be a power of 2 because it uses either mipmaps or repeat, so it was decompressed. This will hurt performance and memory usage."); } if (img == p_image) { @@ -659,12 +659,13 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p img->resize(texture->alloc_width, texture->alloc_height, Image::INTERPOLATE_BILINEAR); } - }; + } GLenum blit_target = (texture->target == GL_TEXTURE_CUBE_MAP) ? _cube_side_enum[p_layer] : GL_TEXTURE_2D; texture->data_size = img->get_data().size(); PoolVector<uint8_t>::Read read = img->get_data().read(); + ERR_FAIL_COND(!read.ptr()); glActiveTexture(GL_TEXTURE0); glBindTexture(texture->target, texture->tex_id); @@ -718,7 +719,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p int size, ofs; img->get_mipmap_offset_and_size(i, ofs, size); - if (texture->compressed) { + if (compressed) { glPixelStorei(GL_UNPACK_ALIGNMENT, 4); int bw = w; @@ -3236,12 +3237,14 @@ Color RasterizerStorageGLES2::multimesh_instance_get_custom_data(RID p_multimesh void RasterizerStorageGLES2::multimesh_set_as_bulk_array(RID p_multimesh, const PoolVector<float> &p_array) { MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); ERR_FAIL_COND(!multimesh); + ERR_FAIL_COND(!multimesh->data.ptr()); int dsize = multimesh->data.size(); ERR_FAIL_COND(dsize != p_array.size()); PoolVector<float>::Read r = p_array.read(); + ERR_FAIL_COND(!r.ptr()); copymem(multimesh->data.ptrw(), r.ptr(), dsize * sizeof(float)); multimesh->dirty_data = true; @@ -4691,7 +4694,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) { /* For MSAA */ #ifndef JAVASCRIPT_ENABLED - if (rt->msaa != VS::VIEWPORT_MSAA_DISABLED && config.multisample_supported) { + if (rt->msaa >= VS::VIEWPORT_MSAA_2X && rt->msaa <= VS::VIEWPORT_MSAA_16X && config.multisample_supported) { rt->multisample_active = true; @@ -4733,21 +4736,39 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0, msaa); + glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->multisample_color, 0, msaa); #endif GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { + // Delete allocated resources and default to no MSAA + WARN_PRINT_ONCE("Cannot allocate back framebuffer for MSAA"); printf("err status: %x\n", status); - _render_target_clear(rt); - ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE); + config.multisample_supported = false; + rt->multisample_active = false; + + glDeleteFramebuffers(1, &rt->multisample_fbo); + rt->multisample_fbo = 0; + + glDeleteRenderbuffers(1, &rt->multisample_depth); + rt->multisample_depth = 0; +#ifdef ANDROID_ENABLED + glDeleteTextures(1, &rt->multisample_color); +#else + glDeleteRenderbuffers(1, &rt->multisample_color); +#endif + rt->multisample_color = 0; } glBindRenderbuffer(GL_RENDERBUFFER, 0); + glBindFramebuffer(GL_FRAMEBUFFER, 0); +#ifdef ANDROID_ENABLED + glBindTexture(GL_TEXTURE_2D, 0); +#endif } else -#endif +#endif // JAVASCRIPT_ENABLED { rt->multisample_active = false; } @@ -4983,10 +5004,10 @@ void RasterizerStorageGLES2::_render_target_clear(RenderTarget *rt) { glDeleteRenderbuffers(1, &rt->multisample_depth); rt->multisample_depth = 0; -#ifdef GLES_OVER_GL - glDeleteRenderbuffers(1, &rt->multisample_color); -#else +#ifdef ANDROID_ENABLED glDeleteTextures(1, &rt->multisample_color); +#else + glDeleteRenderbuffers(1, &rt->multisample_color); #endif rt->multisample_color = 0; } @@ -5069,6 +5090,11 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar // free this glDeleteFramebuffers(1, &rt->external.fbo); + // and this + if (rt->external.depth != 0) { + glDeleteRenderbuffers(1, &rt->external.depth); + } + // clean up our texture Texture *t = texture_owner.get(rt->external.texture); t->alloc_height = 0; @@ -5081,6 +5107,7 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar rt->external.fbo = 0; rt->external.color = 0; + rt->external.depth = 0; } } else { Texture *t; @@ -5115,6 +5142,7 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar t->render_target = rt; rt->external.texture = texture_owner.make_rid(t); + } else { // bind our frame buffer glBindFramebuffer(GL_FRAMEBUFFER, rt->external.fbo); @@ -5133,16 +5161,42 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar t->alloc_height = rt->width; t->alloc_width = rt->height; - // is there a point to setting the internal formats? we don't know them.. + // Switch our texture on our frame buffer +#if ANDROID_ENABLED + if (rt->msaa >= VS::VIEWPORT_MSAA_EXT_2X && rt->msaa <= VS::VIEWPORT_MSAA_EXT_4X) { + // This code only applies to the Oculus Go and Oculus Quest. Due to the the tiled nature + // of the GPU we can do a single render pass by rendering directly into our texture chains + // texture and apply MSAA as we render. + + // On any other hardware these two modes are ignored and we do not have any MSAA, + // the normal MSAA modes need to be used to enable our two pass approach + + static const int msaa_value[] = { 2, 4 }; + int msaa = msaa_value[rt->msaa - VS::VIEWPORT_MSAA_EXT_2X]; + + if (rt->external.depth == 0) { + // create a multisample depth buffer, we're not reusing Godots because Godot's didn't get created.. + glGenRenderbuffers(1, &rt->external.depth); + glBindRenderbuffer(GL_RENDERBUFFER, rt->external.depth); + glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa, config.depth_internalformat, rt->width, rt->height); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->external.depth); + } - // set our texture as the destination for our framebuffer - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, p_texture_id, 0); + // and set our external texture as the texture... + glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, p_texture_id, 0, msaa); - // seeing we're rendering into this directly, better also use our depth buffer, just use our existing one :) - if (config.support_depth_texture) { - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0); - } else { - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth); + } else +#endif + { + // set our texture as the destination for our framebuffer + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, p_texture_id, 0); + + // seeing we're rendering into this directly, better also use our depth buffer, just use our existing one :) + if (config.support_depth_texture) { + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0); + } else { + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth); + } } // check status and unbind @@ -5727,14 +5781,20 @@ void RasterizerStorageGLES2::initialize() { config.support_npot_repeat_mipmap = true; config.depth_internalformat = GL_DEPTH_COMPONENT; config.depth_type = GL_UNSIGNED_INT; - #else config.float_texture_supported = config.extensions.has("GL_ARB_texture_float") || config.extensions.has("GL_OES_texture_float"); config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc"); config.etc1_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture") || config.extensions.has("WEBGL_compressed_texture_etc1"); - config.pvrtc_supported = config.extensions.has("IMG_texture_compression_pvrtc"); + config.pvrtc_supported = config.extensions.has("IMG_texture_compression_pvrtc") || config.extensions.has("WEBGL_compressed_texture_pvrtc"); config.support_npot_repeat_mipmap = config.extensions.has("GL_OES_texture_npot"); - + // on mobile check for 24 bit depth support + if (config.extensions.has("GL_OES_depth24")) { + config.depth_internalformat = _DEPTH_COMPONENT24_OES; + config.depth_type = GL_UNSIGNED_INT; + } else { + config.depth_internalformat = GL_DEPTH_COMPONENT16; + config.depth_type = GL_UNSIGNED_SHORT; + } #endif #ifndef GLES_OVER_GL @@ -5771,7 +5831,7 @@ void RasterizerStorageGLES2::initialize() { config.support_depth_cubemaps = true; #else config.use_rgba_2d_shadows = !(config.float_texture_supported && config.extensions.has("GL_EXT_texture_rg")); - config.support_depth_texture = config.extensions.has("GL_OES_depth_texture"); + config.support_depth_texture = config.extensions.has("GL_OES_depth_texture") || config.extensions.has("WEBGL_depth_texture"); config.use_rgba_3d_shadows = !config.support_depth_texture; config.support_depth_cubemaps = config.extensions.has("GL_OES_depth_texture_cube_map"); #endif @@ -5798,7 +5858,7 @@ void RasterizerStorageGLES2::initialize() { #endif config.rgtc_supported = config.extensions.has("GL_EXT_texture_compression_rgtc") || config.extensions.has("GL_ARB_texture_compression_rgtc") || config.extensions.has("EXT_texture_compression_rgtc"); - config.bptc_supported = config.extensions.has("GL_ARB_texture_compression_bptc"); + config.bptc_supported = config.extensions.has("GL_ARB_texture_compression_bptc") || config.extensions.has("EXT_texture_compression_bptc"); //determine formats for depth textures (or renderbuffers) if (config.support_depth_texture) { @@ -5811,7 +5871,7 @@ void RasterizerStorageGLES2::initialize() { GLuint depth; glGenTextures(1, &depth); glBindTexture(GL_TEXTURE_2D, depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 32, 32, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, 32, 32, 0, config.depth_internalformat, config.depth_type, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -5827,10 +5887,7 @@ void RasterizerStorageGLES2::initialize() { glBindTexture(GL_TEXTURE_2D, 0); glDeleteTextures(1, &depth); - if (status == GL_FRAMEBUFFER_COMPLETE) { - config.depth_internalformat = GL_DEPTH_COMPONENT; - config.depth_type = GL_UNSIGNED_INT; - } else { + if (status != GL_FRAMEBUFFER_COMPLETE) { // If it fails, test to see if it supports a framebuffer texture using UNSIGNED_SHORT // This is needed because many OSX devices don't support either UNSIGNED_INT or UNSIGNED_SHORT @@ -5863,15 +5920,6 @@ void RasterizerStorageGLES2::initialize() { glBindTexture(GL_TEXTURE_2D, 0); glDeleteTextures(1, &depth); } - } else { - // Will use renderbuffer for depth, on mobile check for 24 bit depth support - if (config.extensions.has("GL_OES_depth24")) { - config.depth_internalformat = _DEPTH_COMPONENT24_OES; - config.depth_type = GL_UNSIGNED_INT; - } else { - config.depth_internalformat = GL_DEPTH_COMPONENT16; - config.depth_type = GL_UNSIGNED_SHORT; - } } //picky requirements for these diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index 2e78910614..6de530d8c3 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -337,7 +337,7 @@ public: mutable RID_Owner<Texture> texture_owner; - Ref<Image> _get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_will_need_resize) const; + Ref<Image> _get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, 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; virtual RID texture_create(); virtual void texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, VS::TextureType p_type, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT); @@ -1182,10 +1182,13 @@ public: struct External { GLuint fbo; GLuint color; + GLuint depth; RID texture; External() : - fbo(0) { + fbo(0), + color(0), + depth(0) { } } external; diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 1db8a870a2..7e9b6fdb82 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -809,15 +809,6 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener code += "else\n"; code += _dump_node_code(cf_node->blocks[1], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning); } - } else if (cf_node->flow_op == SL::FLOW_OP_SWITCH) { - code += _mktab(p_level) + "switch (" + _dump_node_code(cf_node->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + ")\n"; - code += _dump_node_code(cf_node->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning); - } else if (cf_node->flow_op == SL::FLOW_OP_CASE) { - code += _mktab(p_level) + "case " + _dump_node_code(cf_node->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + ":\n"; - code += _dump_node_code(cf_node->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning); - } else if (cf_node->flow_op == SL::FLOW_OP_DEFAULT) { - code += _mktab(p_level) + "default:\n"; - code += _dump_node_code(cf_node->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning); } else if (cf_node->flow_op == SL::FLOW_OP_DO) { code += _mktab(p_level); code += "do"; diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index 57c2d886b3..e36e776881 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -729,9 +729,6 @@ uniform highp vec2 viewport_size; uniform vec2 screen_pixel_size; #endif -// I think supporting this in GLES2 is difficult -// uniform highp sampler2D depth_buffer; - #if defined(SCREEN_TEXTURE_USED) uniform highp sampler2D screen_texture; //texunit:-4 #endif diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 95be67a5b7..71737426a9 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -135,13 +135,13 @@ void glTexStorage2DCustom(GLenum target, GLsizei levels, GLenum internalformat, GLuint RasterizerStorageGLES3::system_fbo = 0; -Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool &srgb) const { +Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool &r_srgb, bool p_force_decompress) const { r_compressed = false; r_gl_format = 0; r_real_format = p_format; Ref<Image> image = p_image; - srgb = false; + r_srgb = false; bool need_decompress = false; @@ -188,7 +188,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? GL_SRGB8 : GL_RGB8; r_gl_format = GL_RGB; r_gl_type = GL_UNSIGNED_BYTE; - srgb = true; + r_srgb = true; } break; case Image::FORMAT_RGBA8: { @@ -196,7 +196,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? GL_SRGB8_ALPHA8 : GL_RGBA8; r_gl_type = GL_UNSIGNED_BYTE; - srgb = true; + r_srgb = true; } break; case Image::FORMAT_RGBA4444: { @@ -278,7 +278,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -294,7 +294,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -310,7 +310,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -355,7 +355,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -395,7 +395,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -410,7 +410,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -426,7 +426,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -442,7 +442,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -527,7 +527,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGB; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -542,7 +542,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -557,7 +557,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - srgb = true; + r_srgb = true; } else { @@ -570,7 +570,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ } } - if (need_decompress) { + if (need_decompress || p_force_decompress) { if (!image.is_null()) { image = image->duplicate(); @@ -584,7 +584,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ r_gl_type = GL_UNSIGNED_BYTE; r_compressed = false; r_real_format = Image::FORMAT_RGBA8; - srgb = true; + r_srgb = true; return image; } @@ -677,8 +677,22 @@ void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_ } break; } + texture->is_npot_repeat_mipmap = false; +#ifdef JAVASCRIPT_ENABLED + // WebGL 2.0 on browsers does not seem to properly support compressed non power-of-two (NPOT) + // textures with repeat/mipmaps, even though NPOT textures should be supported as per the spec. + // Force decompressing them to work it around on WebGL 2.0 at a performance cost (GH-33058). + int po2_width = next_power_of_2(p_width); + int po2_height = next_power_of_2(p_height); + bool is_po2 = p_width == po2_width && p_height == po2_height; + + if (!is_po2 && (p_flags & VS::TEXTURE_FLAG_REPEAT || p_flags & VS::TEXTURE_FLAG_MIPMAPS)) { + texture->is_npot_repeat_mipmap = true; + } +#endif // JAVASCRIPT_ENABLED + Image::Format real_format; - _get_gl_image_and_format(Ref<Image>(), texture->format, texture->flags, real_format, format, internal_format, type, compressed, srgb); + _get_gl_image_and_format(Ref<Image>(), texture->format, texture->flags, real_format, format, internal_format, type, compressed, srgb, texture->is_npot_repeat_mipmap); texture->alloc_width = texture->width; texture->alloc_height = texture->height; @@ -753,13 +767,9 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p if (config.keep_original_textures && !(texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING)) { texture->images.write[p_layer] = p_image; } -#ifndef GLES_OVER_GL - if (p_image->is_compressed() && p_image->has_mipmaps() && !p_image->is_size_po2()) { - ERR_PRINTS("Texuture '" + texture->path + "' is compressed, has mipmaps but is not of powerf-of-2 size. This does not work on OpenGL ES 3.0."); - } -#endif + Image::Format real_format; - Ref<Image> img = _get_gl_image_and_format(p_image, p_image->get_format(), texture->flags, real_format, format, internal_format, type, compressed, srgb); + Ref<Image> img = _get_gl_image_and_format(p_image, p_image->get_format(), texture->flags, real_format, format, internal_format, type, compressed, srgb, texture->is_npot_repeat_mipmap); if (config.shrink_textures_x2 && (p_image->has_mipmaps() || !p_image->is_compressed()) && !(texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING)) { @@ -795,6 +805,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p texture->data_size = img->get_data().size(); PoolVector<uint8_t>::Read read = img->get_data().read(); + ERR_FAIL_COND(!read.ptr()); glActiveTexture(GL_TEXTURE0); glBindTexture(texture->target, texture->tex_id); @@ -992,7 +1003,7 @@ void RasterizerStorageGLES3::texture_set_data_partial(RID p_texture, const Ref<I } Image::Format real_format; - Ref<Image> img = _get_gl_image_and_format(p_sub_img, p_sub_img->get_format(), texture->flags, real_format, format, internal_format, type, compressed, srgb); + Ref<Image> img = _get_gl_image_and_format(p_sub_img, p_sub_img->get_format(), texture->flags, real_format, format, internal_format, type, compressed, srgb, texture->is_npot_repeat_mipmap); GLenum blit_target = GL_TEXTURE_2D; @@ -1091,7 +1102,8 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer) gl_internal_format, gl_type, compressed, - srgb); + srgb, + texture->is_npot_repeat_mipmap); PoolVector<uint8_t> data; @@ -1197,7 +1209,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer) GLenum gl_type; bool compressed; bool srgb; - _get_gl_image_and_format(Ref<Image>(), texture->format, texture->flags, real_format, gl_format, gl_internal_format, gl_type, compressed, srgb); + _get_gl_image_and_format(Ref<Image>(), texture->format, texture->flags, real_format, gl_format, gl_internal_format, gl_type, compressed, srgb, false); PoolVector<uint8_t> data; @@ -1267,7 +1279,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer) GLenum gl_type; bool compressed; bool srgb; - _get_gl_image_and_format(Ref<Image>(), texture->format, texture->flags, real_format, gl_format, gl_internal_format, gl_type, compressed, srgb); + _get_gl_image_and_format(Ref<Image>(), texture->format, texture->flags, real_format, gl_format, gl_internal_format, gl_type, compressed, srgb, texture->is_npot_repeat_mipmap); PoolVector<uint8_t> data; @@ -4718,6 +4730,7 @@ void RasterizerStorageGLES3::multimesh_set_as_bulk_array(RID p_multimesh, const MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); ERR_FAIL_COND(!multimesh); + ERR_FAIL_COND(!multimesh->data.ptr()); int dsize = multimesh->data.size(); @@ -4854,15 +4867,16 @@ RID RasterizerStorageGLES3::immediate_create() { return immediate_owner.make_rid(im); } -void RasterizerStorageGLES3::immediate_begin(RID p_immediate, VS::PrimitiveType p_rimitive, RID p_texture) { +void RasterizerStorageGLES3::immediate_begin(RID p_immediate, VS::PrimitiveType p_primitive, RID p_texture) { + ERR_FAIL_INDEX(p_primitive, (int)VS::PRIMITIVE_MAX); Immediate *im = immediate_owner.get(p_immediate); ERR_FAIL_COND(!im); ERR_FAIL_COND(im->building); Immediate::Chunk ic; ic.texture = p_texture; - ic.primitive = p_rimitive; + ic.primitive = p_primitive; im->chunks.push_back(ic); im->mask = 0; im->building = true; @@ -6947,7 +6961,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) { rt->buffers.active = true; - static const int msaa_value[] = { 0, 2, 4, 8, 16 }; + static const int msaa_value[] = { 0, 2, 4, 8, 16, 4, 16 }; // MSAA_EXT_nX is a GLES2 temporary hack ignored in GLES3 for now... int msaa = msaa_value[rt->msaa]; int max_samples = 0; diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 84632308b4..3b1021d0e1 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -266,6 +266,8 @@ public: int mipmaps; + bool is_npot_repeat_mipmap; + bool active; GLuint tex_id; @@ -342,7 +344,7 @@ public: mutable RID_Owner<Texture> texture_owner; - Ref<Image> _get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool &srgb) const; + Ref<Image> _get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool &r_srgb, bool p_force_decompress) const; virtual RID texture_create(); virtual void texture_allocate(RID p_texture, int p_width, int p_height, int p_depth_3d, Image::Format p_format, VS::TextureType p_type, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT); @@ -869,7 +871,7 @@ public: mutable RID_Owner<Immediate> immediate_owner; virtual RID immediate_create(); - virtual void immediate_begin(RID p_immediate, VS::PrimitiveType p_rimitive, RID p_texture = RID()); + virtual void immediate_begin(RID p_immediate, VS::PrimitiveType p_primitive, RID p_texture = RID()); virtual void immediate_vertex(RID p_immediate, const Vector3 &p_vertex); virtual void immediate_normal(RID p_immediate, const Vector3 &p_normal); virtual void immediate_tangent(RID p_immediate, const Plane &p_tangent); diff --git a/drivers/png/png_driver_common.cpp b/drivers/png/png_driver_common.cpp index 7deac1d118..46e45d07d3 100644 --- a/drivers/png/png_driver_common.cpp +++ b/drivers/png/png_driver_common.cpp @@ -43,7 +43,6 @@ namespace PNGDriverCommon { static bool check_error(const png_image &image) { const png_uint_32 failed = PNG_IMAGE_FAILED(image); if (failed & PNG_IMAGE_ERROR) { - ERR_EXPLAINC(image.message); return true; } else if (failed) { #ifdef TOOLS_ENABLED @@ -67,7 +66,7 @@ Error png_to_image(const uint8_t *p_source, size_t p_size, Ref<Image> p_image) { // fetch image properties int success = png_image_begin_read_from_memory(&png_img, p_source, p_size); - ERR_FAIL_COND_V(check_error(png_img), ERR_FILE_CORRUPT); + ERR_FAIL_COND_V_MSG(check_error(png_img), ERR_FILE_CORRUPT, png_img.message); ERR_FAIL_COND_V(!success, ERR_FILE_CORRUPT); // flags to be masked out of input format to give target format @@ -112,7 +111,7 @@ Error png_to_image(const uint8_t *p_source, size_t p_size, Ref<Image> p_image) { // read image data to buffer and release libpng resources success = png_image_finish_read(&png_img, NULL, writer.ptr(), stride, NULL); - ERR_FAIL_COND_V(check_error(png_img), ERR_FILE_CORRUPT); + ERR_FAIL_COND_V_MSG(check_error(png_img), ERR_FILE_CORRUPT, png_img.message); ERR_FAIL_COND_V(!success, ERR_FILE_CORRUPT); p_image->create(png_img.width, png_img.height, 0, dest_format, buffer); @@ -176,7 +175,7 @@ Error image_to_png(const Ref<Image> &p_image, PoolVector<uint8_t> &p_buffer) { PoolVector<uint8_t>::Write writer = p_buffer.write(); success = png_image_write_to_memory(&png_img, &writer[buffer_offset], &compressed_size, 0, reader.ptr(), 0, NULL); - ERR_FAIL_COND_V(check_error(png_img), FAILED); + ERR_FAIL_COND_V_MSG(check_error(png_img), FAILED, png_img.message); } if (!success) { @@ -190,7 +189,7 @@ Error image_to_png(const Ref<Image> &p_image, PoolVector<uint8_t> &p_buffer) { PoolVector<uint8_t>::Write writer = p_buffer.write(); success = png_image_write_to_memory(&png_img, &writer[buffer_offset], &compressed_size, 0, reader.ptr(), 0, NULL); - ERR_FAIL_COND_V(check_error(png_img), FAILED); + ERR_FAIL_COND_V_MSG(check_error(png_img), FAILED, png_img.message); ERR_FAIL_COND_V(!success, FAILED); } diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 8be1d5d8f3..e3026f9fd9 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -56,6 +56,12 @@ #define S_ISREG(m) ((m)&S_IFREG) #endif +#ifndef NO_FCNTL +#include <fcntl.h> +#else +#include <sys/ioctl.h> +#endif + void FileAccessUnix::check_errors() const { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); @@ -123,11 +129,24 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) { } break; } return last_error; - } else { - last_error = OK; - flags = p_mode_flags; - return OK; } + + // Set close on exec to avoid leaking it to subprocesses. + int fd = fileno(f); + + if (fd != -1) { +#if defined(NO_FCNTL) + unsigned long par = 0; + ioctl(fd, FIOCLEX, &par); +#else + int opts = fcntl(fd, F_GETFD); + fcntl(fd, F_SETFD, opts | FD_CLOEXEC); +#endif + } + + last_error = OK; + flags = p_mode_flags; + return OK; } void FileAccessUnix::close() { @@ -256,6 +275,7 @@ void FileAccessUnix::store_8(uint8_t p_dest) { void FileAccessUnix::store_buffer(const uint8_t *p_src, int p_length) { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); + ERR_FAIL_COND(!p_src); ERR_FAIL_COND((int)fwrite(p_src, 1, p_length, f) != p_length); } diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index da46b393c6..5f99a40c79 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -70,6 +70,7 @@ #define SOCK_CBUF(x) x #define SOCK_IOCTL ioctl #define SOCK_CLOSE ::close +#define SOCK_CONNECT(p_sock, p_addr, p_addr_len) ::connect(p_sock, p_addr, p_addr_len) /* Windows */ #elif defined(WINDOWS_ENABLED) @@ -83,6 +84,9 @@ #define SOCK_CBUF(x) (const char *)(x) #define SOCK_IOCTL ioctlsocket #define SOCK_CLOSE closesocket +// connect is broken on windows under certain conditions, reasons unknown: +// See https://github.com/godotengine/webrtc-native/issues/6 +#define SOCK_CONNECT(p_sock, p_addr, p_addr_len) ::WSAConnect(p_sock, p_addr, p_addr_len, NULL, NULL, NULL, NULL) // Workaround missing flag in MinGW #if defined(__MINGW32__) && !defined(SIO_UDP_NETRESET) @@ -409,7 +413,7 @@ Error NetSocketPosix::connect_to_host(IP_Address p_host, uint16_t p_port) { struct sockaddr_storage addr; size_t addr_size = _set_addr_storage(&addr, p_host, p_port, _ip_type); - if (::connect(_sock, (struct sockaddr *)&addr, addr_size) != 0) { + if (SOCK_CONNECT(_sock, (struct sockaddr *)&addr, addr_size) != 0) { NetError err = _get_socket_error(); diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index b3d98a0648..25dee6aedb 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -126,7 +126,9 @@ void OS_Unix::initialize_core() { RWLockDummy::make_default(); #else ThreadPosix::make_default(); +#if !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED) SemaphorePosix::make_default(); +#endif MutexPosix::make_default(); RWLockPosix::make_default(); #endif diff --git a/drivers/unix/semaphore_posix.cpp b/drivers/unix/semaphore_posix.cpp index 5aa51d77d1..fc2d5b0dfe 100644 --- a/drivers/unix/semaphore_posix.cpp +++ b/drivers/unix/semaphore_posix.cpp @@ -30,7 +30,7 @@ #include "semaphore_posix.h" -#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED) +#if (defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)) && !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED) #include "core/os/memory.h" #include <errno.h> diff --git a/drivers/unix/semaphore_posix.h b/drivers/unix/semaphore_posix.h index 83e75c9a82..8aff01fc27 100644 --- a/drivers/unix/semaphore_posix.h +++ b/drivers/unix/semaphore_posix.h @@ -33,7 +33,7 @@ #include "core/os/semaphore.h" -#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED) +#if (defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)) && !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED) #include <semaphore.h> diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index adc3cc8d65..336d5c5814 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -76,7 +76,7 @@ public: CMMNotificationClient() : _cRef(1), _pEnumerator(NULL) {} - ~CMMNotificationClient() { + virtual ~CMMNotificationClient() { if ((_pEnumerator) != NULL) { (_pEnumerator)->Release(); (_pEnumerator) = NULL; diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index fb21c0c5a1..4dc1b74310 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -96,7 +96,7 @@ Error FileAccessWindows::_open(const String &p_path, int p_mode_flags) { if (p_mode_flags == READ) { WIN32_FIND_DATAW d; HANDLE f = FindFirstFileW(path.c_str(), &d); - if (f) { + if (f != INVALID_HANDLE_VALUE) { String fname = d.cFileName; if (fname != String()) { diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 7183d34d4f..33f833afa4 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -5818,6 +5818,7 @@ AnimationTrackEditor::AnimationTrackEditor() { info_message->set_valign(Label::VALIGN_CENTER); info_message->set_align(Label::ALIGN_CENTER); info_message->set_autowrap(true); + info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); info_message->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); main_panel->add_child(info_message); diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 226eef9c1e..3e0b644b20 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -337,7 +337,7 @@ AnimationTrackEditAudio::AnimationTrackEditAudio() { AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", this, "_preview_changed"); } -/// SPRITE FRAME /// +/// SPRITE FRAME / FRAME_COORDS /// int AnimationTrackEditSpriteFrame::get_key_height() const { @@ -439,14 +439,24 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) { - int frame = get_animation()->track_get_key_value(get_track(), p_index); - texture = object->call("get_texture"); if (!texture.is_valid()) { AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right); return; } + int hframes = object->call("get_hframes"); + int vframes = object->call("get_vframes"); + + Vector2 coords; + if (is_coords) { + coords = get_animation()->track_get_key_value(get_track(), p_index); + } else { + int frame = get_animation()->track_get_key_value(get_track(), p_index); + coords.x = frame % hframes; + coords.y = frame / hframes; + } + region.size = texture->get_size(); if (bool(object->call("is_region"))) { @@ -454,9 +464,6 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in region = Rect2(object->call("get_region_rect")); } - int hframes = object->call("get_hframes"); - int vframes = object->call("get_vframes"); - if (hframes > 1) { region.size.x /= hframes; } @@ -464,8 +471,8 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in region.size.y /= vframes; } - region.position.x += region.size.x * (frame % hframes); - region.position.y += region.size.y * (frame / hframes); + region.position.x += region.size.x * coords.x; + region.position.y += region.size.y * coords.y; } else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) { @@ -532,6 +539,11 @@ void AnimationTrackEditSpriteFrame::set_node(Object *p_object) { id = p_object->get_instance_id(); } +void AnimationTrackEditSpriteFrame::set_as_coords() { + + is_coords = true; +} + /// SUB ANIMATION /// int AnimationTrackEditSubAnim::get_key_height() const { @@ -1297,6 +1309,14 @@ AnimationTrackEdit *AnimationTrackEditDefaultPlugin::create_value_track_edit(Obj return sprite; } + if (p_property == "frame_coords" && (p_object->is_class("Sprite") || p_object->is_class("Sprite3D"))) { + + AnimationTrackEditSpriteFrame *sprite = memnew(AnimationTrackEditSpriteFrame); + sprite->set_as_coords(); + sprite->set_node(p_object); + return sprite; + } + if (p_property == "current_animation" && (p_object->is_class("AnimationPlayer"))) { AnimationTrackEditSubAnim *player = memnew(AnimationTrackEditSubAnim); diff --git a/editor/animation_track_editor_plugins.h b/editor/animation_track_editor_plugins.h index 5f0ea6196c..1013cccf72 100644 --- a/editor/animation_track_editor_plugins.h +++ b/editor/animation_track_editor_plugins.h @@ -81,6 +81,7 @@ class AnimationTrackEditSpriteFrame : public AnimationTrackEdit { GDCLASS(AnimationTrackEditSpriteFrame, AnimationTrackEdit); ObjectID id; + bool is_coords; public: virtual int get_key_height() const; @@ -89,6 +90,9 @@ public: virtual void draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right); void set_node(Object *p_object); + void set_as_coords(); + + AnimationTrackEditSpriteFrame() { is_coords = false; } }; class AnimationTrackEditSubAnim : public AnimationTrackEdit { diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index f2471e80d4..906139e239 100644 --- a/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -267,9 +267,9 @@ void ArrayPropertyEdit::edit(Object *p_obj, const StringName &p_prop, const Stri default_type = p_deftype; if (!p_hint_string.empty()) { - int hint_subtype_seperator = p_hint_string.find(":"); - if (hint_subtype_seperator >= 0) { - String subtype_string = p_hint_string.substr(0, hint_subtype_seperator); + int hint_subtype_separator = p_hint_string.find(":"); + if (hint_subtype_separator >= 0) { + String subtype_string = p_hint_string.substr(0, hint_subtype_separator); int slash_pos = subtype_string.find("/"); if (slash_pos >= 0) { @@ -277,7 +277,7 @@ void ArrayPropertyEdit::edit(Object *p_obj, const StringName &p_prop, const Stri subtype_string = subtype_string.substr(0, slash_pos); } - subtype_hint_string = p_hint_string.substr(hint_subtype_seperator + 1, p_hint_string.size() - hint_subtype_seperator - 1); + subtype_hint_string = p_hint_string.substr(hint_subtype_separator + 1, p_hint_string.size() - hint_subtype_separator - 1); subtype = Variant::Type(subtype_string.to_int()); } } diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 4c31797c50..1a821ddd02 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -191,7 +191,9 @@ void FindReplaceBar::_replace() { results_count = -1; } - search_current(); + if (!search_current()) { + search_next(); + } } void FindReplaceBar::_replace_all() { diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 5344658223..fb7cf494cd 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -151,6 +151,10 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p if (!ClassDB::is_parent_class(p_type, base_type)) return; } else { + if (!search_loaded_scripts.has(p_type)) { + search_loaded_scripts[p_type] = ed.script_class_load_script(p_type); + } + if (!ScriptServer::is_global_class(p_type) || !ed.script_class_is_parent(p_type, base_type)) return; @@ -352,7 +356,12 @@ void CreateDialog::_update_search() { } else { bool found = false; - String type2 = I->get(); + String type2 = type; + + if (!cpp_type && !search_loaded_scripts.has(type)) { + search_loaded_scripts[type] = ed.script_class_load_script(type); + } + while (type2 != "" && (cpp_type ? ClassDB::is_parent_class(type2, base_type) : ed.script_class_is_parent(type2, base_type)) && type2 != base_type) { if (search_box->get_text().is_subsequence_ofi(type2)) { @@ -361,10 +370,15 @@ void CreateDialog::_update_search() { } type2 = cpp_type ? ClassDB::get_parent_class(type2) : ed.script_class_get_base(type2); + + if (!cpp_type && !search_loaded_scripts.has(type2)) { + search_loaded_scripts[type2] = ed.script_class_load_script(type2); + } } - if (found) - add_type(I->get(), search_options_types, root, &to_select); + if (found) { + add_type(type, search_options_types, root, &to_select); + } } if (EditorNode::get_editor_data().get_custom_types().has(type) && ClassDB::is_parent_class(type, base_type)) { @@ -470,6 +484,7 @@ void CreateDialog::_notification(int p_what) { } break; case NOTIFICATION_POPUP_HIDE: { EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "create_new_node", get_rect()); + search_loaded_scripts.clear(); } break; } } diff --git a/editor/create_dialog.h b/editor/create_dialog.h index f3ed1d7af6..1150ac60da 100644 --- a/editor/create_dialog.h +++ b/editor/create_dialog.h @@ -51,6 +51,7 @@ class CreateDialog : public ConfirmationDialog { LineEdit *search_box; Tree *search_options; HashMap<String, TreeItem *> search_options_types; + HashMap<String, RES> search_loaded_scripts; bool is_replace_mode; String base_type; String preferred_search_result_type; diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 8a03292708..f75d9c98e0 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -58,6 +58,7 @@ void EditorAbout::_notification(int p_what) { void EditorAbout::_license_tree_selected() { TreeItem *selected = _tpl_tree->get_selected(); + _tpl_text->scroll_to_line(0); _tpl_text->set_text(selected->get_metadata(0)); } diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index b331a39535..acfdea28e2 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1329,7 +1329,8 @@ EditorAudioBuses::EditorAudioBuses() { add_child(top_hb); file = memnew(Label); - file->set_text(String(TTR("Layout")) + ": " + "default_bus_layout.tres"); + String layout_path = ProjectSettings::get_singleton()->get("audio/default_bus_layout"); + file->set_text(String(TTR("Layout")) + ": " + layout_path.get_file()); file->set_clip_text(true); file->set_h_size_flags(SIZE_EXPAND_FILL); top_hb->add_child(file); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 777eda2170..1cafd1d1f4 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -820,7 +820,7 @@ void EditorData::save_edited_scene_state(EditorSelection *p_selection, EditorHis ERR_FAIL_INDEX(current_edited_scene, edited_scene.size()); EditedScene &es = edited_scene.write[current_edited_scene]; - es.selection = p_selection->get_selected_node_list(); + es.selection = p_selection->get_full_selected_node_list(); es.history_current = p_history->current; es.history_stored = p_history->history; es.editor_states = get_editor_states(); @@ -870,7 +870,7 @@ bool EditorData::script_class_is_parent(const String &p_class, const String &p_i if (!ScriptServer::is_global_class(p_class)) return false; String base = script_class_get_base(p_class); - Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class), "Script"); + Ref<Script> script = script_class_load_script(p_class); Ref<Script> base_script = script->get_base_script(); while (p_inherits != base) { @@ -889,12 +889,7 @@ bool EditorData::script_class_is_parent(const String &p_class, const String &p_i StringName EditorData::script_class_get_base(const String &p_class) const { - if (!ScriptServer::is_global_class(p_class)) - return StringName(); - - String path = ScriptServer::get_global_class_path(p_class); - - Ref<Script> script = ResourceLoader::load(path, "Script"); + Ref<Script> script = script_class_load_script(p_class); if (script.is_null()) return StringName(); @@ -910,7 +905,7 @@ Object *EditorData::script_class_instance(const String &p_class) { if (ScriptServer::is_global_class(p_class)) { Object *obj = ClassDB::instance(ScriptServer::get_global_class_native_base(p_class)); if (obj) { - RES script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class)); + Ref<Script> script = script_class_load_script(p_class); if (script.is_valid()) obj->set_script(script.get_ref_ptr()); return obj; @@ -919,6 +914,15 @@ Object *EditorData::script_class_instance(const String &p_class) { return NULL; } +Ref<Script> EditorData::script_class_load_script(const String &p_class) const { + + if (!ScriptServer::is_global_class(p_class)) + return Ref<Script>(); + + String path = ScriptServer::get_global_class_path(p_class); + return ResourceLoader::load(path, "Script"); +} + void EditorData::script_class_set_icon_path(const String &p_class, const String &p_icon_path) { _script_class_icon_paths[p_class] = p_icon_path; } @@ -1142,6 +1146,16 @@ List<Node *> &EditorSelection::get_selected_node_list() { return selected_node_list; } +List<Node *> EditorSelection::get_full_selected_node_list() { + + List<Node *> node_list; + for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) { + node_list.push_back(E->key()); + } + + return node_list; +} + void EditorSelection::clear() { while (!selection.empty()) { diff --git a/editor/editor_data.h b/editor/editor_data.h index df83135942..aa3e84d5a4 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -219,6 +219,8 @@ public: StringName script_class_get_base(const String &p_class) const; Object *script_class_instance(const String &p_class); + Ref<Script> script_class_load_script(const String &p_class) const; + StringName script_class_get_name(const String &p_path) const; void script_class_set_name(const String &p_path, const StringName &p_class); @@ -273,6 +275,7 @@ public: void clear(); List<Node *> &get_selected_node_list(); + List<Node *> get_full_selected_node_list(); Map<Node *, Object *> &get_selection() { return selection; } EditorSelection(); diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index 0636ae3aea..525c5aa62d 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -95,7 +95,9 @@ void EditorDirDialog::_notification(int p_what) { } if (p_what == NOTIFICATION_EXIT_TREE) { - EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "reload"); + if (EditorFileSystem::get_singleton()->is_connected("filesystem_changed", this, "reload")) { + EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "reload"); + } } if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 9510092a86..7ae8a9e0ce 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -376,6 +376,12 @@ Error EditorExportPlatform::_save_zip_file(void *p_userdata, const String &p_pat return OK; } +Ref<ImageTexture> EditorExportPlatform::get_option_icon(int p_index) const { + Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme(); + ERR_FAIL_COND_V(theme.is_null(), Ref<ImageTexture>()); + return theme->get_icon("Play", "EditorIcons"); +} + String EditorExportPlatform::find_export_template(String template_file_name, String *err) const { String current_version = VERSION_FULL_CONFIG; @@ -1403,7 +1409,7 @@ bool EditorExport::poll_export_platforms() { bool changed = false; for (int i = 0; i < export_platforms.size(); i++) { - if (export_platforms.write[i]->poll_devices()) { + if (export_platforms.write[i]->poll_export()) { changed = true; } } diff --git a/editor/editor_export.h b/editor/editor_export.h index 11dc464b5a..b0e27af629 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -243,10 +243,12 @@ public: Error save_pack(const Ref<EditorExportPreset> &p_preset, const String &p_path, Vector<SharedObject> *p_so_files = NULL, bool p_embed = false, int64_t *r_embedded_start = NULL, int64_t *r_embedded_size = NULL); Error save_zip(const Ref<EditorExportPreset> &p_preset, const String &p_path); - virtual bool poll_devices() { return false; } - virtual int get_device_count() const { return 0; } - virtual String get_device_name(int p_device) const { return ""; } - virtual String get_device_info(int p_device) const { return ""; } + virtual bool poll_export() { return false; } + virtual int get_options_count() const { return 0; } + virtual String get_options_tooltip() const { return ""; } + virtual Ref<ImageTexture> get_option_icon(int p_index) const; + virtual String get_option_label(int p_device) const { return ""; } + virtual String get_option_tooltip(int p_device) const { return ""; } enum DebugFlags { DEBUG_FLAG_DUMB_CLIENT = 1, diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 02a9cc905b..2db4f03859 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -253,6 +253,12 @@ void EditorFileDialog::_post_popup() { else item_list->grab_focus(); + if (mode == MODE_OPEN_DIR) { + file_box->set_visible(false); + } else { + file_box->set_visible(true); + } + if (is_visible_in_tree() && get_current_file() != "") _request_single_thumbnail(get_current_dir().plus_file(get_current_file())); @@ -703,6 +709,9 @@ void EditorFileDialog::update_file_list() { item_list->clear(); + // Scroll back to the top after opening a directory + item_list->get_v_scroll()->set_value(0); + if (display_mode == DISPLAY_THUMBNAILS) { item_list->set_max_columns(0); @@ -1658,19 +1667,19 @@ EditorFileDialog::EditorFileDialog() { prev_cc->add_child(preview); preview_vb->hide(); - HBoxContainer *filename_hbc = memnew(HBoxContainer); - filename_hbc->add_child(memnew(Label(TTR("File:")))); + file_box = memnew(HBoxContainer); + file_box->add_child(memnew(Label(TTR("File:")))); file = memnew(LineEdit); file->set_stretch_ratio(4); file->set_h_size_flags(SIZE_EXPAND_FILL); - filename_hbc->add_child(file); + file_box->add_child(file); filter = memnew(OptionButton); filter->set_stretch_ratio(3); filter->set_h_size_flags(SIZE_EXPAND_FILL); filter->set_clip_text(true); // Too many extensions overflow it. - filename_hbc->add_child(filter); - filename_hbc->set_h_size_flags(SIZE_EXPAND_FILL); - item_vb->add_child(filename_hbc); + file_box->add_child(filter); + file_box->set_h_size_flags(SIZE_EXPAND_FILL); + item_vb->add_child(file_box); dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES); access = ACCESS_RESOURCES; diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 2ecfa7db15..af52f6af5b 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -106,10 +106,11 @@ private: TextureRect *preview; VBoxContainer *preview_vb; HSplitContainer *list_hb; + HBoxContainer *file_box; LineEdit *file; + OptionButton *filter; AcceptDialog *mkdirerr; AcceptDialog *exterr; - OptionButton *filter; DirAccess *dir_access; ConfirmationDialog *confirm_save; DependencyRemoveDialog *remove_dialog; diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 3663bdee27..2467e1f722 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -325,14 +325,12 @@ void EditorFileSystem::_save_filesystem_cache() { String fscache = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(CACHE_FILE_NAME); FileAccess *f = FileAccess::open(fscache, FileAccess::WRITE); - if (f == NULL) { - ERR_PRINTS("Error writing fscache '" + fscache + "'."); - } else { - f->store_line(filesystem_settings_version_for_import); - _save_filesystem_cache(filesystem, f); - f->close(); - memdelete(f); - } + ERR_FAIL_COND_MSG(!f, "Cannot create file '" + fscache + "'. Check user write permissions."); + + f->store_line(filesystem_settings_version_for_import); + _save_filesystem_cache(filesystem, f); + f->close(); + memdelete(f); } void EditorFileSystem::_thread_func(void *_userdata) { @@ -1373,6 +1371,7 @@ void EditorFileSystem::_save_late_updated_files() { //files that already existed, and were modified, need re-scanning for dependencies upon project restart. This is done via saving this special file String fscache = EditorSettings::get_singleton()->get_project_settings_dir().plus_file("filesystem_update4"); FileAccessRef f = FileAccess::open(fscache, FileAccess::WRITE); + ERR_FAIL_COND_MSG(!f, "Cannot create file '" + fscache + "'. Check user write permissions."); for (Set<String>::Element *E = late_update_files.front(); E; E = E->next()) { f->store_line(E->get()); } diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp index 96653fec70..9f13049a6b 100644 --- a/editor/editor_folding.cpp +++ b/editor/editor_folding.cpp @@ -135,6 +135,10 @@ void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p } void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path) { + FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES); + if (!file_check->file_exists(p_path)) //This can happen when creating scene from FilesystemDock. It has path, but no file. + return; + Ref<ConfigFile> config; config.instance(); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 4a1e93eaad..dd49e38d7f 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -172,7 +172,9 @@ void EditorHelp::_class_desc_input(const Ref<InputEvent> &p_input) { void EditorHelp::_class_desc_resized() { // Add extra horizontal margins for better readability. // The margins increase as the width of the editor help container increases. - const int display_margin = MAX(30 * EDSCALE, get_parent_anchorable_rect().size.width - 900 * EDSCALE) * 0.5; + Ref<Font> doc_code_font = get_font("doc_source", "EditorFonts"); + real_t char_width = doc_code_font->get_char_size('x').width; + const int display_margin = MAX(30 * EDSCALE, get_parent_anchorable_rect().size.width - char_width * 120 * EDSCALE) * 0.5; Ref<StyleBox> class_desc_stylebox = EditorNode::get_singleton()->get_theme_base()->get_stylebox("normal", "RichTextLabel")->duplicate(); class_desc_stylebox->set_default_margin(MARGIN_LEFT, display_margin); @@ -1222,11 +1224,18 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { Ref<Font> doc_font = p_rt->get_font("doc", "EditorFonts"); Ref<Font> doc_bold_font = p_rt->get_font("doc_bold", "EditorFonts"); Ref<Font> doc_code_font = p_rt->get_font("doc_source", "EditorFonts"); + Color font_color_hl = p_rt->get_color("headline_color", "EditorHelp"); - Color link_color = p_rt->get_color("accent_color", "Editor").linear_interpolate(font_color_hl, 0.8); + Color accent_color = p_rt->get_color("accent_color", "Editor"); + Color link_color = accent_color.linear_interpolate(font_color_hl, 0.8); + Color code_color = accent_color.linear_interpolate(font_color_hl, 0.6); String bbcode = p_bbcode.dedent().replace("\t", "").replace("\r", "").strip_edges(); + // remove extra new lines around code blocks + bbcode = bbcode.replace("[codeblock]\n", "[codeblock]"); + bbcode = bbcode.replace("\n[/codeblock]", "[/codeblock]"); + List<String> tag_stack; bool code_tag = false; @@ -1274,9 +1283,14 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { tag_stack.pop_front(); pos = brk_end + 1; - code_tag = false; - if (tag != "/img") + if (tag != "/img") { p_rt->pop(); + if (code_tag) { + p_rt->pop(); + } + } + code_tag = false; + } else if (code_tag) { p_rt->add_text("["); @@ -1321,6 +1335,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { //use monospace font p_rt->push_font(doc_code_font); + p_rt->push_color(code_color); code_tag = true; pos = brk_end + 1; tag_stack.push_front(tag); @@ -1467,6 +1482,11 @@ void EditorHelp::_notification(int p_what) { _update_doc(); } break; + case NOTIFICATION_THEME_CHANGED: { + if (is_visible_in_tree()) { + _class_desc_resized(); + } + } break; default: break; } } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 78e058eeaa..96b6a32914 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -644,7 +644,19 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) { emit_signal("property_keyed", property, use_keying_next()); if (use_keying_next()) { - call_deferred("emit_changed", property, object->get(property).operator int64_t() + 1, "", false); + if (property == "frame_coords" && (object->is_class("Sprite") || object->is_class("Sprite3D"))) { + Vector2 new_coords = object->get(property); + new_coords.x++; + if (new_coords.x >= object->get("hframes").operator int64_t()) { + new_coords.x = 0; + new_coords.y++; + } + + call_deferred("emit_changed", property, new_coords, "", false); + } else { + call_deferred("emit_changed", property, object->get(property).operator int64_t() + 1, "", false); + } + call_deferred("update_property"); } } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 2c3a84857a..0e373a5deb 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -33,6 +33,7 @@ #include "core/bind/core_bind.h" #include "core/class_db.h" #include "core/io/config_file.h" +#include "core/io/image_loader.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/io/stream_peer_ssl.h" @@ -56,6 +57,7 @@ #include "editor/editor_help.h" #include "editor/editor_properties.h" #include "editor/editor_settings.h" +#include "editor/editor_spin_slider.h" #include "editor/editor_themes.h" #include "editor/import/editor_import_collada.h" #include "editor/import/editor_scene_importer_gltf.h" @@ -69,6 +71,7 @@ #include "editor/import/resource_importer_texture.h" #include "editor/import/resource_importer_texture_atlas.h" #include "editor/import/resource_importer_wav.h" +#include "editor/multi_node_edit.h" #include "editor/plugins/animation_blend_space_1d_editor.h" #include "editor/plugins/animation_blend_space_2d_editor.h" #include "editor/plugins/animation_blend_tree_editor_plugin.h" @@ -370,7 +373,7 @@ void EditorNode::_notification(int p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { scene_tabs->set_tab_close_display_policy((bool(EDITOR_GET("interface/scene_tabs/always_show_close_button")) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); - Ref<Theme> theme = create_editor_theme(theme_base->get_theme()); + theme = create_editor_theme(theme_base->get_theme()); theme_base->set_theme(theme); gui_base->set_theme(theme); @@ -1063,7 +1066,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { img->crop_from_point(x, y, vp_size, vp_size); } else { int ratio = vp_size / preview_size; - int size = preview_size * (ratio / 2); + int size = preview_size * MAX(1, ratio / 2); x = (img->get_width() - size) / 2; y = (img->get_height() - size) / 2; @@ -1469,7 +1472,7 @@ void EditorNode::_dialog_action(String p_file) { config.instance(); Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config()); - if (err == ERR_CANT_OPEN) { + if (err == ERR_FILE_CANT_OPEN || err == ERR_FILE_NOT_FOUND) { config.instance(); // new config } else if (err != OK) { show_warning(TTR("Error trying to save layout!")); @@ -1740,15 +1743,37 @@ void EditorNode::_edit_current() { } else { + Node *selected_node = NULL; + if (current_obj->is_class("ScriptEditorDebuggerInspectedObject")) { editable_warning = TTR("This is a remote object, so changes to it won't be kept.\nPlease read the documentation relevant to debugging to better understand this workflow."); capitalize = false; disable_folding = true; + } else if (current_obj->is_class("MultiNodeEdit")) { + Node *scene = get_edited_scene(); + if (scene) { + MultiNodeEdit *multi_node_edit = Object::cast_to<MultiNodeEdit>(current_obj); + int node_count = multi_node_edit->get_node_count(); + if (node_count > 0) { + List<Node *> multi_nodes; + for (int node_index = 0; node_index < node_count; ++node_index) { + Node *node = scene->get_node(multi_node_edit->get_node(node_index)); + if (node) { + multi_nodes.push_back(node); + } + } + if (!multi_nodes.empty()) { + // Pick the top-most node + multi_nodes.sort_custom<Node::Comparator>(); + selected_node = multi_nodes.front()->get(); + } + } + } } get_inspector()->edit(current_obj); node_dock->set_node(NULL); - scene_tree_dock->set_selected(NULL); + scene_tree_dock->set_selected(selected_node); inspector_dock->update(NULL); } @@ -3558,6 +3583,7 @@ void EditorNode::register_editor_types() { ClassDB::register_class<AnimationTrackEditPlugin>(); ClassDB::register_class<ScriptCreateDialog>(); ClassDB::register_class<EditorFeatureProfile>(); + ClassDB::register_class<EditorSpinSlider>(); // FIXME: Is this stuff obsolete, or should it be ported to new APIs? ClassDB::register_class<EditorScenePostImport>(); @@ -3637,6 +3663,20 @@ StringName EditorNode::get_object_custom_type_name(const Object *p_object) const return StringName(); } +Ref<ImageTexture> EditorNode::_load_custom_class_icon(const String &p_path) const { + if (p_path.length()) { + Ref<Image> img = memnew(Image); + Error err = ImageLoader::load_image(p_path, img); + if (err == OK) { + Ref<ImageTexture> icon = memnew(ImageTexture); + img->resize(16 * EDSCALE, 16 * EDSCALE, Image::INTERPOLATE_LANCZOS); + icon->create_from_image(img); + return icon; + } + } + return NULL; +} + Ref<Texture> EditorNode::get_object_icon(const Object *p_object, const String &p_fallback) const { ERR_FAIL_COND_V(!p_object || !gui_base, NULL); @@ -3650,8 +3690,10 @@ Ref<Texture> EditorNode::get_object_icon(const Object *p_object, const String &p while (base_script.is_valid()) { StringName name = EditorNode::get_editor_data().script_class_get_name(base_script->get_path()); String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(name); - if (icon_path.length()) - return ResourceLoader::load(icon_path); + Ref<ImageTexture> icon = _load_custom_class_icon(icon_path); + if (icon.is_valid()) { + return icon; + } // should probably be deprecated in 4.x StringName base = base_script->get_instance_base_type(); @@ -3689,12 +3731,9 @@ Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_f if (ScriptServer::is_global_class(p_class)) { String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(p_class); - RES icon; - - if (FileAccess::exists(icon_path)) { - icon = ResourceLoader::load(icon_path); - if (icon.is_valid()) - return icon; + Ref<ImageTexture> icon = _load_custom_class_icon(icon_path); + if (icon.is_valid()) { + return icon; } Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class), "Script"); @@ -3702,10 +3741,9 @@ Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_f while (script.is_valid()) { String current_icon_path; script->get_language()->get_global_class_name(script->get_path(), NULL, ¤t_icon_path); - if (FileAccess::exists(current_icon_path)) { - RES texture = ResourceLoader::load(current_icon_path); - if (texture.is_valid()) - return texture; + icon = _load_custom_class_icon(current_icon_path); + if (icon.is_valid()) { + return icon; } script = script->get_base_script(); } @@ -5156,14 +5194,20 @@ void EditorNode::_open_imported() { } void EditorNode::dim_editor(bool p_dimming, bool p_force_dim) { - // Dimming can be forced regardless of the editor setting, which is useful when quitting the editor + // Dimming can be forced regardless of the editor setting, which is useful when quitting the editor. if ((p_force_dim || EditorSettings::get_singleton()->get("interface/editor/dim_editor_on_dialog_popup")) && p_dimming) { + dimmed = true; gui_base->set_modulate(Color(0.5, 0.5, 0.5)); } else { + dimmed = false; gui_base->set_modulate(Color(1, 1, 1)); } } +bool EditorNode::is_editor_dimmed() const { + return dimmed; +} + void EditorNode::open_export_template_manager() { export_template_manager->popup_manager(); @@ -5472,6 +5516,7 @@ EditorNode::EditorNode() { singleton = this; exiting = false; + dimmed = false; last_checked_version = 0; changing_scene = false; _initializing_addons = false; @@ -5638,6 +5683,9 @@ EditorNode::EditorNode() { editor_export = memnew(EditorExport); add_child(editor_export); + // Exporters might need the theme + theme = create_custom_theme(); + register_exporters(); GLOBAL_DEF("editor/main_run_args", ""); @@ -5679,7 +5727,6 @@ EditorNode::EditorNode() { theme_base->add_child(gui_base); gui_base->set_anchors_and_margins_preset(Control::PRESET_WIDE); - Ref<Theme> theme = create_custom_theme(); theme_base->set_theme(theme); gui_base->set_theme(theme); gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); diff --git a/editor/editor_node.h b/editor/editor_node.h index 5ecb472e64..b7775b5e83 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -260,6 +260,7 @@ private: int tab_closing; bool exiting; + bool dimmed; int old_split_ofs; VSplitContainer *top_split; @@ -655,6 +656,7 @@ private: void _feature_profile_changed(); bool _is_class_editor_disabled_by_feature_profile(const StringName &p_class); + Ref<ImageTexture> _load_custom_class_icon(const String &p_path) const; protected: void _notification(int p_what); @@ -849,6 +851,7 @@ public: void restart_editor(); void dim_editor(bool p_dimming, bool p_force_dim = false); + bool is_editor_dimmed() const; void edit_current() { _edit_current(); }; diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index f487a3048b..e4a939c379 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -132,6 +132,15 @@ void EditorPath::_id_pressed(int p_idx) { EditorNode::get_singleton()->push_item(obj); } +void EditorPath::_notification(int p_what) { + + switch (p_what) { + case NOTIFICATION_THEME_CHANGED: { + update_path(); + } break; + } +} + void EditorPath::_bind_methods() { ClassDB::bind_method("_about_to_show", &EditorPath::_about_to_show); diff --git a/editor/editor_path.h b/editor/editor_path.h index 2dc4d21f9b..a84da9f5ac 100644 --- a/editor/editor_path.h +++ b/editor/editor_path.h @@ -48,6 +48,7 @@ class EditorPath : public MenuButton { void _add_children_to_popup(Object *p_obj, int p_depth = 0); protected: + void _notification(int p_what); static void _bind_methods(); public: diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index fbb66744a7..e14beabfa2 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -1884,6 +1884,23 @@ void EditorPropertyColor::_bind_methods() { void EditorPropertyColor::update_property() { picker->set_pick_color(get_edited_object()->get(get_edited_property())); + const Color color = picker->get_pick_color(); + + // Add a tooltip to display each channel's values without having to click the ColorPickerButton + if (picker->is_editing_alpha()) { + picker->set_tooltip(vformat( + "R: %s\nG: %s\nB: %s\nA: %s", + rtos(color.r).pad_decimals(2), + rtos(color.g).pad_decimals(2), + rtos(color.b).pad_decimals(2), + rtos(color.a).pad_decimals(2))); + } else { + picker->set_tooltip(vformat( + "R: %s\nG: %s\nB: %s", + rtos(color.r).pad_decimals(2), + rtos(color.g).pad_decimals(2), + rtos(color.b).pad_decimals(2))); + } } void EditorPropertyColor::setup(bool p_show_alpha) { @@ -2205,7 +2222,14 @@ void EditorPropertyResource::_menu_option(int p_which) { case OBJ_MENU_NEW_SCRIPT: { if (Object::cast_to<Node>(get_edited_object())) { - EditorNode::get_singleton()->get_scene_tree_dock()->open_script_dialog(Object::cast_to<Node>(get_edited_object())); + EditorNode::get_singleton()->get_scene_tree_dock()->open_script_dialog(Object::cast_to<Node>(get_edited_object()), false); + } + + } break; + case OBJ_MENU_EXTEND_SCRIPT: { + + if (Object::cast_to<Node>(get_edited_object())) { + EditorNode::get_singleton()->get_scene_tree_dock()->open_script_dialog(Object::cast_to<Node>(get_edited_object()), true); } } break; @@ -2338,7 +2362,8 @@ void EditorPropertyResource::_update_menu_items() { menu->clear(); if (get_edited_property() == "script" && base_type == "Script" && Object::cast_to<Node>(get_edited_object())) { - menu->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script"), OBJ_MENU_NEW_SCRIPT); + menu->add_icon_item(get_icon("ScriptCreate", "EditorIcons"), TTR("New Script"), OBJ_MENU_NEW_SCRIPT); + menu->add_icon_item(get_icon("ScriptExtend", "EditorIcons"), TTR("Extend Script"), OBJ_MENU_EXTEND_SCRIPT); menu->add_separator(); } else if (base_type != "") { int idx = 0; @@ -2633,7 +2658,6 @@ void EditorPropertyResource::update_property() { if (res == RES()) { assign->set_icon(Ref<Texture>()); assign->set_text(TTR("[empty]")); - assign->set_tooltip(""); } else { assign->set_icon(EditorNode::get_singleton()->get_object_icon(res.operator->(), "Object")); @@ -2909,7 +2933,7 @@ void EditorInspectorDefaultPlugin::parse_begin(Object *p_object) { bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage) { - double default_float_step = EDITOR_GET("interface/inspector/default_float_step"); + float default_float_step = EDITOR_GET("interface/inspector/default_float_step"); switch (p_type) { diff --git a/editor/editor_properties.h b/editor/editor_properties.h index b8d6aa00c2..952b0447e2 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -550,7 +550,8 @@ class EditorPropertyResource : public EditorProperty { OBJ_MENU_COPY = 5, OBJ_MENU_PASTE = 6, OBJ_MENU_NEW_SCRIPT = 7, - OBJ_MENU_SHOW_IN_FILE_SYSTEM = 8, + OBJ_MENU_EXTEND_SCRIPT = 8, + OBJ_MENU_SHOW_IN_FILE_SYSTEM = 9, TYPE_BASE_ID = 100, CONVERT_BASE_ID = 1000 diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 8abe91bdc1..c75b66c601 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -475,16 +475,16 @@ void EditorPropertyArray::setup(Variant::Type p_array_type, const String &p_hint array_type = p_array_type; if (array_type == Variant::ARRAY && !p_hint_string.empty()) { - int hint_subtype_seperator = p_hint_string.find(":"); - if (hint_subtype_seperator >= 0) { - String subtype_string = p_hint_string.substr(0, hint_subtype_seperator); + int hint_subtype_separator = p_hint_string.find(":"); + if (hint_subtype_separator >= 0) { + String subtype_string = p_hint_string.substr(0, hint_subtype_separator); int slash_pos = subtype_string.find("/"); if (slash_pos >= 0) { subtype_hint = PropertyHint(subtype_string.substr(slash_pos + 1, subtype_string.size() - slash_pos - 1).to_int()); subtype_string = subtype_string.substr(0, slash_pos); } - subtype_hint_string = p_hint_string.substr(hint_subtype_seperator + 1, p_hint_string.size() - hint_subtype_seperator - 1); + subtype_hint_string = p_hint_string.substr(hint_subtype_separator + 1, p_hint_string.size() - hint_subtype_separator - 1); subtype = Variant::Type(subtype_string.to_int()); } } diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 65a1704770..e383dadfb0 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -201,13 +201,13 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref< if (has_small_texture) { ResourceSaver::save(cache_base + "_small.png", r_small_texture); } - Error err; - FileAccess *f = FileAccess::open(cache_base + ".txt", FileAccess::WRITE, &err); - ERR_FAIL_COND_MSG(err != OK, "Cannot create file '" + cache_base + ".txt'."); + FileAccess *f = FileAccess::open(cache_base + ".txt", FileAccess::WRITE); + ERR_FAIL_COND_MSG(!f, "Cannot create file '" + cache_base + ".txt'. Check user write permissions."); f->store_line(itos(thumbnail_size)); f->store_line(itos(has_small_texture)); f->store_line(itos(FileAccess::get_modified_time(p_item.path))); f->store_line(FileAccess::get_md5(p_item.path)); + f->close(); memdelete(f); } } @@ -295,11 +295,17 @@ void EditorResourcePreview::_thread() { //update modified time f = FileAccess::open(file, FileAccess::WRITE); - f->store_line(itos(thumbnail_size)); - f->store_line(itos(has_small_texture)); - f->store_line(itos(modtime)); - f->store_line(md5); - memdelete(f); + if (!f) { + // Not returning as this would leave the thread hanging and would require + // some proper cleanup/disabling of resource preview generation. + ERR_PRINTS("Cannot create file '" + file + "'. Check user write permissions."); + } else { + f->store_line(itos(thumbnail_size)); + f->store_line(itos(has_small_texture)); + f->store_line(itos(modtime)); + f->store_line(md5); + memdelete(f); + } } } else { memdelete(f); diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index 585ea0ec69..64e90f2488 100644 --- a/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -75,20 +75,18 @@ void EditorRunNative::_notification(int p_what) { Ref<EditorExportPlatform> eep = EditorExport::get_singleton()->get_export_platform(E->key()); MenuButton *mb = E->get(); - int dc = eep->get_device_count(); + int dc = eep->get_options_count(); if (dc == 0) { mb->hide(); } else { mb->get_popup()->clear(); mb->show(); - if (dc == 1) { - mb->set_tooltip(eep->get_device_name(0) + "\n\n" + eep->get_device_info(0).strip_edges()); - } else { - mb->set_tooltip("Select device from the list"); + mb->set_tooltip(eep->get_options_tooltip()); + if (dc > 1) { for (int i = 0; i < dc; i++) { - mb->get_popup()->add_icon_item(get_icon("Play", "EditorIcons"), eep->get_device_name(i)); - mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() - 1, eep->get_device_info(i).strip_edges()); + mb->get_popup()->add_icon_item(eep->get_option_icon(i), eep->get_option_label(i)); + mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() - 1, eep->get_option_tooltip(i)); } } } @@ -111,7 +109,7 @@ void EditorRunNative::_run_native(int p_idx, int p_platform) { ERR_FAIL_COND(eep.is_null()); if (p_idx == -1) { - if (eep->get_device_count() == 1) { + if (eep->get_options_count() == 1) { menus[p_platform]->get_popup()->hide(); p_idx = 0; } else { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 672844117d..a3a02dbd4c 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -436,7 +436,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("text_editor/indent/size", 4); hints["text_editor/indent/size"] = PropertyInfo(Variant::INT, "text_editor/indent/size", PROPERTY_HINT_RANGE, "1, 64, 1"); // size of 0 crashes. _initial_set("text_editor/indent/auto_indent", true); - _initial_set("text_editor/indent/convert_indent_on_save", false); + _initial_set("text_editor/indent/convert_indent_on_save", true); _initial_set("text_editor/indent/draw_tabs", true); _initial_set("text_editor/indent/draw_spaces", false); diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 918b0ef96d..fbc4a5ee5c 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -112,7 +112,7 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { if (mm->get_control()) { set_value(Math::round(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10)); } else { - set_value(pre_grab_value + get_step() * grabbing_spinner_dist_cache * 10); + set_value(pre_grab_value + get_step() * grabbing_spinner_dist_cache); } } } else if (updown_offset != -1) { @@ -228,9 +228,9 @@ void EditorSpinSlider::_notification(int p_what) { draw_style_box(focus, Rect2(Vector2(), get_size())); } - draw_string(font, Vector2(sb->get_offset().x, vofs), label, lc * Color(1, 1, 1, 0.5)); + draw_string(font, Vector2(Math::round(sb->get_offset().x), vofs), label, lc * Color(1, 1, 1, 0.5)); - draw_string(font, Vector2(sb->get_offset().x + string_width + sep, vofs), numstr, fc, number_width); + draw_string(font, Vector2(Math::round(sb->get_offset().x + string_width + sep), vofs), numstr, fc, number_width); if (get_step() == 1) { Ref<Texture> updown2 = get_icon("updown", "SpinBox"); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 0c7c2c6cc3..f05c7709d4 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -648,9 +648,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_constant("hseparation", "CheckBox", 4 * EDSCALE); theme->set_constant("check_vadjust", "CheckBox", 0 * EDSCALE); + // PopupDialog + theme->set_stylebox("panel", "PopupDialog", style_popup); + // PopupMenu - Ref<StyleBoxFlat> style_popup_menu = style_popup; - theme->set_stylebox("panel", "PopupMenu", style_popup_menu); + theme->set_stylebox("panel", "PopupMenu", style_popup); theme->set_stylebox("separator", "PopupMenu", style_popup_separator); theme->set_stylebox("labeled_separator_left", "PopupMenu", style_popup_labeled_separator_left); theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right); @@ -1087,7 +1089,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_icon("port", "GraphNode", theme->get_icon("GuiGraphNodePort", "EditorIcons")); // GridContainer - theme->set_constant("vseperation", "GridContainer", (extra_spacing + default_margin_size) * EDSCALE); + theme->set_constant("vseparation", "GridContainer", (extra_spacing + default_margin_size) * EDSCALE); // FileDialog theme->set_icon("folder", "FileDialog", theme->get_icon("Folder", "EditorIcons")); diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 1cdf9848ef..f47f9b8b92 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -69,9 +69,15 @@ void ExportTemplateManager::_update_template_list() { memdelete(d); String current_version = VERSION_FULL_CONFIG; - // Downloadable export templates are only available for stable, alpha, beta and RC versions. + // Downloadable export templates are only available for stable and official alpha/beta/RC builds + // (which always have a number following their status, e.g. "alpha1"). // Therefore, don't display download-related features when using a development version - const bool downloads_available = String(VERSION_STATUS) != String("dev"); + // (whose builds aren't numbered). + const bool downloads_available = + String(VERSION_STATUS) != String("dev") && + String(VERSION_STATUS) != String("alpha") && + String(VERSION_STATUS) != String("beta") && + String(VERSION_STATUS) != String("rc"); Label *current = memnew(Label); current->set_h_size_flags(SIZE_EXPAND_FILL); @@ -155,38 +161,27 @@ void ExportTemplateManager::_uninstall_template(const String &p_version) { void ExportTemplateManager::_uninstall_template_confirm() { - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - Error err = d->change_dir(EditorSettings::get_singleton()->get_templates_dir()); - - ERR_FAIL_COND(err != OK); - - err = d->change_dir(to_remove); - - ERR_FAIL_COND(err != OK); - - Vector<String> files; - d->list_dir_begin(); - String c = d->get_next(); - while (c != String()) { - if (!d->current_is_dir()) { - files.push_back(c); - } - c = d->get_next(); - } - d->list_dir_end(); + DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + const String &templates_dir = EditorSettings::get_singleton()->get_templates_dir(); + Error err = da->change_dir(templates_dir); + ERR_FAIL_COND_MSG(err != OK, "Could not access templates directory at '" + templates_dir + "'."); + err = da->change_dir(to_remove); + ERR_FAIL_COND_MSG(err != OK, "Could not access templates directory at '" + templates_dir.plus_file(to_remove) + "'."); - for (int i = 0; i < files.size(); i++) { - d->remove(files[i]); - } + err = da->erase_contents_recursive(); + ERR_FAIL_COND_MSG(err != OK, "Could not remove all templates in '" + templates_dir.plus_file(to_remove) + "'."); - d->change_dir(".."); - d->remove(to_remove); + da->change_dir(".."); + da->remove(to_remove); + ERR_FAIL_COND_MSG(err != OK, "Could not remove templates directory at '" + templates_dir.plus_file(to_remove) + "'."); _update_template_list(); } bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_progress) { + // unzClose() will take care of closing the file stored in the unzFile, + // so we don't need to `memdelete(fa)` in this method. FileAccess *fa = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&fa); @@ -251,7 +246,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ String template_path = EditorSettings::get_singleton()->get_templates_dir().plus_file(version); - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + DirAccessRef d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); Error err = d->make_dir_recursive(template_path); if (err != OK) { EditorNode::get_singleton()->show_warning(TTR("Error creating path for templates:") + "\n" + template_path); @@ -259,8 +254,6 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ return false; } - memdelete(d); - ret = unzGoToFirstFile(pkg); EditorProgress *p = NULL; @@ -316,7 +309,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ } String to_write = template_path.plus_file(file); - FileAccess *f = FileAccess::open(to_write, FileAccess::WRITE); + FileAccessRef f = FileAccess::open(to_write, FileAccess::WRITE); if (!f) { ret = unzGoToNextFile(pkg); @@ -326,8 +319,6 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ f->store_buffer(data.ptr(), data.size()); - memdelete(f); - #ifndef WINDOWS_ENABLED FileAccess::set_unix_permissions(to_write, (info.external_fa >> 16) & 0x01FF); #endif @@ -343,7 +334,6 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ unzClose(pkg); _update_template_list(); - return true; } diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index e3f0021fbc..fb591b51df 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -71,11 +71,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory subdirectory_item->select(0); } - if ((path.begins_with(lpath) && path != lpath)) { - subdirectory_item->set_collapsed(false); - } else { - subdirectory_item->set_collapsed(uncollapsed_paths.find(lpath) < 0); - } + subdirectory_item->set_collapsed(uncollapsed_paths.find(lpath) < 0); if (searched_string.length() > 0 && dname.to_lower().find(searched_string) >= 0) { parent_should_expand = true; } @@ -115,6 +111,10 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory file_item->select(0); file_item->set_as_cursor(0); } + String main_scene = ProjectSettings::get_singleton()->get("application/run/main_scene"); + if (main_scene == file_metadata) { + file_item->set_custom_color(0, get_color("accent_color", "Editor")); + } Array udata; udata.push_back(tree_update_id); udata.push_back(file_item); @@ -333,10 +333,11 @@ void FileSystemDock::_notification(int p_what) { case NOTIFICATION_DRAG_BEGIN: { Dictionary dd = get_viewport()->gui_get_drag_data(); if (tree->is_visible_in_tree() && dd.has("type")) { - if ((String(dd["type"]) == "files") || (String(dd["type"]) == "files_and_dirs") || (String(dd["type"]) == "resource")) { + if (dd.has("favorite")) { + if ((String(dd["favorite"]) == "all")) + tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN); + } else if ((String(dd["type"]) == "files") || (String(dd["type"]) == "files_and_dirs") || (String(dd["type"]) == "resource")) { tree->set_drop_mode_flags(Tree::DROP_MODE_ON_ITEM | Tree::DROP_MODE_INBETWEEN); - } else if ((String(dd["type"]) == "favorite")) { - tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN); } } } break; @@ -1564,6 +1565,15 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } } break; + case FILE_MAIN_SCENE: { + // Set as main scene with selected scene file. + if (p_selected.size() == 1) { + ProjectSettings::get_singleton()->set("application/run/main_scene", p_selected[0]); + ProjectSettings::get_singleton()->save(); + _update_tree(_compute_uncollapsed_paths()); + } + } break; + case FILE_INSTANCE: { // Instance all selected scenes. Vector<String> paths; @@ -1839,7 +1849,7 @@ Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) all_not_favorites &= !is_favorite; selected = tree->get_next_selected(selected); } - if (all_favorites) { + if (!all_not_favorites) { paths = _tree_get_selected(false); } else { paths = _tree_get_selected(); @@ -1857,12 +1867,9 @@ Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) if (paths.empty()) return Variant(); - if (!all_favorites && !all_not_favorites) - return Variant(); - Dictionary drag_data = EditorNode::get_singleton()->drag_files_and_dirs(paths, p_from); - if (all_favorites) { - drag_data["type"] = "favorite"; + if (!all_not_favorites) { + drag_data["favorite"] = all_favorites ? "all" : "mixed"; } return drag_data; } @@ -1870,7 +1877,11 @@ Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) bool FileSystemDock::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { Dictionary drag_data = p_data; - if (drag_data.has("type") && String(drag_data["type"]) == "favorite") { + if (drag_data.has("favorite")) { + + if (String(drag_data["favorite"]) != "all") { + return false; + } // Moving favorite around. TreeItem *ti = tree->get_item_at_position(p_point); @@ -1937,7 +1948,11 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, Vector<String> dirs = EditorSettings::get_singleton()->get_favorites(); - if (drag_data.has("type") && String(drag_data["type"]) == "favorite") { + if (drag_data.has("favorite")) { + + if (String(drag_data["favorite"]) != "all") { + return; + } // Moving favorite around. TreeItem *ti = tree->get_item_at_position(p_point); if (!ti) @@ -2132,6 +2147,9 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str if (filenames.size() == 1) { p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open Scene"), FILE_OPEN); p_popup->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("New Inherited Scene"), FILE_INHERIT); + if (ProjectSettings::get_singleton()->get("application/run/main_scene") != filenames[0]) { + p_popup->add_icon_item(get_icon("PlayScene", "EditorIcons"), TTR("Set As Main Scene"), FILE_MAIN_SCENE); + } } else { p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open Scenes"), FILE_OPEN); } diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 49eb31e330..099f4ad273 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -74,6 +74,7 @@ private: enum FileMenu { FILE_OPEN, FILE_INHERIT, + FILE_MAIN_SCENE, FILE_INSTANCE, FILE_ADD_FAVORITE, FILE_REMOVE_FAVORITE, diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index 4cefb53617..74d81bf561 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -529,6 +529,7 @@ GroupDialog::GroupDialog() { group_empty->set_valign(Label::VALIGN_CENTER); group_empty->set_align(Label::ALIGN_CENTER); group_empty->set_autowrap(true); + group_empty->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); nodes_to_remove->add_child(group_empty); group_empty->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); diff --git a/editor/icons/icon_crypto_key.svg b/editor/icons/icon_crypto_key.svg new file mode 100644 index 0000000000..45b53c815d --- /dev/null +++ b/editor/icons/icon_crypto_key.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 4.233 4.233" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m2.397.34-.374.373-.375.374v.375l.188.187-1.497 1.496v.375l.374.374h.374l.187-.188.282-.092.092-.282.282-.093.093-.28.094-.28.28-.095.187-.187.187.187h.374l.375-.375.373-.373.001-.374-1.122-1.122zm.374.858a.264.264 0 1 1 .002.528.264.264 0 0 1 -.002-.528z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_x509_certificate.svg b/editor/icons/icon_x509_certificate.svg new file mode 100644 index 0000000000..e175fa3234 --- /dev/null +++ b/editor/icons/icon_x509_certificate.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 4.233 4.233" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3.967.263-3.704.001v2.646h1.427a.993.993 0 0 1 -.022-.096.993.993 0 0 1 -.012-.099.993.993 0 0 1 -.002-.07.993.993 0 0 1 .005-.1.993.993 0 0 1 .014-.097.993.993 0 0 1 .025-.096.993.993 0 0 1 .034-.093.993.993 0 0 1 .043-.09.993.993 0 0 1 .052-.085.993.993 0 0 1 .06-.079.993.993 0 0 1 .068-.072.993.993 0 0 1 .074-.066.993.993 0 0 1 .08-.057.993.993 0 0 1 .087-.05.993.993 0 0 1 .09-.04.993.993 0 0 1 .095-.031.993.993 0 0 1 .096-.022.993.993 0 0 1 .099-.012.993.993 0 0 1 .07-.003.993.993 0 0 1 .099.006.993.993 0 0 1 .098.014.993.993 0 0 1 .096.025.993.993 0 0 1 .094.034.993.993 0 0 1 .089.043.993.993 0 0 1 .084.052.993.993 0 0 1 .08.06.993.993 0 0 1 .072.068.993.993 0 0 1 .065.074.993.993 0 0 1 .058.08.993.993 0 0 1 .05.087.993.993 0 0 1 .04.09.993.993 0 0 1 .031.095.993.993 0 0 1 .022.096.993.993 0 0 1 .012.099.993.993 0 0 1 .002.07.993.993 0 0 1 -.004.1.993.993 0 0 1 -.015.097.993.993 0 0 1 -.017.068h.365z" fill="#e0e0e0"/><g fill="#ff8484"><path d="m2.116 3.175v.793l.53-.253.529.253v-.793z"/><circle cx="2.646" cy="2.645" r=".794"/></g></svg>
\ No newline at end of file diff --git a/editor/multi_node_edit.cpp b/editor/multi_node_edit.cpp index 85e47594a8..0792d5c95f 100644 --- a/editor/multi_node_edit.cpp +++ b/editor/multi_node_edit.cpp @@ -34,12 +34,10 @@ #include "editor_node.h" bool MultiNodeEdit::_set(const StringName &p_name, const Variant &p_value) { - return _set_impl(p_name, p_value, ""); } bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value, const String &p_field) { - Node *es = EditorNode::get_singleton()->get_edited_scene(); if (!es) return false; @@ -88,7 +86,6 @@ bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value, } bool MultiNodeEdit::_get(const StringName &p_name, Variant &r_ret) const { - Node *es = EditorNode::get_singleton()->get_edited_scene(); if (!es) return false; @@ -117,7 +114,6 @@ bool MultiNodeEdit::_get(const StringName &p_name, Variant &r_ret) const { } void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const { - HashMap<String, PLData> usage; Node *es = EditorNode::get_singleton()->get_edited_scene(); @@ -171,17 +167,23 @@ void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const { } void MultiNodeEdit::clear_nodes() { - nodes.clear(); } void MultiNodeEdit::add_node(const NodePath &p_node) { - nodes.push_back(p_node); } -void MultiNodeEdit::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) { +int MultiNodeEdit::get_node_count() const { + return nodes.size(); +} +NodePath MultiNodeEdit::get_node(int p_index) const { + ERR_FAIL_INDEX_V(p_index, nodes.size(), NodePath()); + return nodes[p_index]; +} + +void MultiNodeEdit::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) { _set_impl(p_property, p_value, p_field); } diff --git a/editor/multi_node_edit.h b/editor/multi_node_edit.h index b9192b206a..33df4a2ca5 100644 --- a/editor/multi_node_edit.h +++ b/editor/multi_node_edit.h @@ -54,6 +54,9 @@ public: void clear_nodes(); void add_node(const NodePath &p_node); + int get_node_count() const; + NodePath get_node(int p_index) const; + void set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field); MultiNodeEdit(); diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index d6df3bd369..7ba1796600 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -129,6 +129,7 @@ NodeDock::NodeDock() { select_a_node = memnew(Label); select_a_node->set_text(TTR("Select a single node to edit its signals and groups.")); + select_a_node->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); select_a_node->set_v_size_flags(SIZE_EXPAND_FILL); select_a_node->set_valign(Label::VALIGN_CENTER); select_a_node->set_align(Label::ALIGN_CENTER); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 235c204265..e147206ec4 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -534,6 +534,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano updating = true; Set<String> paths; + HashMap<String, Set<String> > types; { List<StringName> animations; player->get_animation_list(&animations); @@ -542,7 +543,27 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano Ref<Animation> anim = player->get_animation(E->get()); for (int i = 0; i < anim->get_track_count(); i++) { - paths.insert(anim->track_get_path(i)); + String track_path = anim->track_get_path(i); + paths.insert(track_path); + + String track_type_name; + Animation::TrackType track_type = anim->track_get_type(i); + switch (track_type) { + case Animation::TrackType::TYPE_ANIMATION: { + track_type_name = TTR("Anim Clips"); + } break; + case Animation::TrackType::TYPE_AUDIO: { + track_type_name = TTR("Audio Clips"); + } break; + case Animation::TrackType::TYPE_METHOD: { + track_type_name = TTR("Functions"); + } break; + default: { + } break; + } + if (!track_type_name.empty()) { + types[track_path].insert(track_type_name); + } } } } @@ -646,10 +667,22 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano } } else { if (ti) { - //just a node, likely call or animation track + //just a node, not a property track + String types_text = "["; + if (types.has(path)) { + Set<String>::Element *F = types[path].front(); + types_text += F->get(); + while (F->next()) { + F = F->next(); + types_text += " / " + F->get(); + } + } + types_text += "]"; + ti = filters->create_item(ti); + ti->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); + ti->set_text(0, types_text); ti->set_editable(0, true); ti->set_selectable(0, true); - ti->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); ti->set_checked(0, anode->is_path_filtered(path)); ti->set_metadata(0, path); } diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index bc22d9315e..ce400ad6dd 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1117,15 +1117,17 @@ void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) { undo_redo->add_do_method(this, "_update_graph"); undo_redo->add_undo_method(this, "_update_graph"); undo_redo->commit_action(); + name_edit->hide(); updating = false; state_machine_draw->update(); - - name_edit->hide(); } void AnimationNodeStateMachineEditor::_name_edited_focus_out() { + if (updating) + return; + _name_edited(name_edit->get_text()); } diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index d5b1f46333..95767a96d8 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1137,9 +1137,12 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const initial_loading = false; - // The loading text only needs to be displayed before the first page is loaded + // The loading text only needs to be displayed before the first page is loaded. + // Therefore, we don't need to show it again. library_loading->hide(); + library_error->hide(); + if (asset_items) { memdelete(asset_items); } @@ -1187,6 +1190,11 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const asset_bottom_page = _make_pages(page, pages, page_len, total_items, result.size()); library_vb->add_child(asset_bottom_page); + if (result.empty()) { + library_error->set_text(vformat(TTR("No results for \"%s\"."), filter->get_text())); + library_error->show(); + } + for (int i = 0; i < result.size(); i++) { Dictionary r = result[i]; @@ -1453,6 +1461,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { library_loading->set_align(Label::ALIGN_CENTER); library_vb->add_child(library_loading); + library_error = memnew(Label); + library_error->set_align(Label::ALIGN_CENTER); + library_error->hide(); + library_vb->add_child(library_error); + asset_top_page = memnew(HBoxContainer); library_vb->add_child(asset_top_page); diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h index 94289f3b49..70ffbd9eed 100644 --- a/editor/plugins/asset_library_editor_plugin.h +++ b/editor/plugins/asset_library_editor_plugin.h @@ -184,6 +184,7 @@ class EditorAssetLibrary : public PanelContainer { ScrollContainer *library_scroll; VBoxContainer *library_vb; Label *library_loading; + Label *library_error; LineEdit *filter; OptionButton *categories; OptionButton *repository; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 2a31d53a7e..7170ce30cc 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -67,13 +67,18 @@ class SnapDialog : public ConfirmationDialog { SpinBox *grid_offset_y; SpinBox *grid_step_x; SpinBox *grid_step_y; + SpinBox *primary_grid_steps; SpinBox *rotation_offset; SpinBox *rotation_step; + SpinBox *scale_step; public: SnapDialog() { const int SPIN_BOX_GRID_RANGE = 16384; const int SPIN_BOX_ROTATION_RANGE = 360; + const float SPIN_BOX_SCALE_MIN = 0.01f; + const float SPIN_BOX_SCALE_MAX = 100; + Label *label; VBoxContainer *container; GridContainer *child_container; @@ -132,8 +137,28 @@ public: grid_step_y->set_h_size_flags(SIZE_EXPAND_FILL); child_container->add_child(grid_step_y); + child_container = memnew(GridContainer); + child_container->set_columns(2); + container->add_child(child_container); + + label = memnew(Label); + label->set_text(TTR("Primary Line Every:")); + label->set_h_size_flags(SIZE_EXPAND_FILL); + child_container->add_child(label); + + primary_grid_steps = memnew(SpinBox); + primary_grid_steps->set_min(0); + primary_grid_steps->set_step(1); + primary_grid_steps->set_max(100); + primary_grid_steps->set_allow_greater(true); + primary_grid_steps->set_suffix(TTR("steps")); + primary_grid_steps->set_h_size_flags(SIZE_EXPAND_FILL); + child_container->add_child(primary_grid_steps); + container->add_child(memnew(HSeparator)); + // We need to create another GridContainer with the same column count, + // so we can put an HSeparator above child_container = memnew(GridContainer); child_container->set_columns(2); container->add_child(child_container); @@ -161,22 +186,44 @@ public: rotation_step->set_suffix("deg"); rotation_step->set_h_size_flags(SIZE_EXPAND_FILL); child_container->add_child(rotation_step); + + container->add_child(memnew(HSeparator)); + + child_container = memnew(GridContainer); + child_container->set_columns(2); + container->add_child(child_container); + label = memnew(Label); + label->set_text(TTR("Scale Step:")); + child_container->add_child(label); + label->set_h_size_flags(SIZE_EXPAND_FILL); + + scale_step = memnew(SpinBox); + scale_step->set_min(SPIN_BOX_SCALE_MIN); + scale_step->set_max(SPIN_BOX_SCALE_MAX); + scale_step->set_allow_greater(true); + scale_step->set_h_size_flags(SIZE_EXPAND_FILL); + scale_step->set_step(0.01f); + child_container->add_child(scale_step); } - void set_fields(const Point2 p_grid_offset, const Point2 p_grid_step, const float p_rotation_offset, const float p_rotation_step) { + void set_fields(const Point2 p_grid_offset, const Point2 p_grid_step, const int p_primary_grid_steps, const float p_rotation_offset, const float p_rotation_step, const float p_scale_step) { grid_offset_x->set_value(p_grid_offset.x); grid_offset_y->set_value(p_grid_offset.y); grid_step_x->set_value(p_grid_step.x); grid_step_y->set_value(p_grid_step.y); + primary_grid_steps->set_value(p_primary_grid_steps); rotation_offset->set_value(p_rotation_offset * (180 / Math_PI)); rotation_step->set_value(p_rotation_step * (180 / Math_PI)); + scale_step->set_value(p_scale_step); } - void get_fields(Point2 &p_grid_offset, Point2 &p_grid_step, float &p_rotation_offset, float &p_rotation_step) { + void get_fields(Point2 &p_grid_offset, Point2 &p_grid_step, int &p_primary_grid_steps, float &p_rotation_offset, float &p_rotation_step, float &p_scale_step) { p_grid_offset = Point2(grid_offset_x->get_value(), grid_offset_y->get_value()); p_grid_step = Point2(grid_step_x->get_value(), grid_step_y->get_value()); + p_primary_grid_steps = int(primary_grid_steps->get_value()); p_rotation_offset = rotation_offset->get_value() / (180 / Math_PI); p_rotation_step = rotation_step->get_value() / (180 / Math_PI); + p_scale_step = scale_step->get_value(); } }; @@ -898,7 +945,7 @@ void CanvasItemEditor::_commit_canvas_item_state(List<CanvasItem *> p_canvas_ite } void CanvasItemEditor::_snap_changed() { - ((SnapDialog *)snap_dialog)->get_fields(grid_offset, grid_step, snap_rotation_offset, snap_rotation_step); + ((SnapDialog *)snap_dialog)->get_fields(grid_offset, grid_step, primary_grid_steps, snap_rotation_offset, snap_rotation_step, snap_scale_step); grid_step_multiplier = 0; viewport->update(); } @@ -1180,8 +1227,8 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bo } if (panning) { - if (!b->is_pressed()) { - // Stop panning the viewport (for any mouse button press) + if (!b->is_pressed() && (pan_on_scroll || (b->get_button_index() != BUTTON_WHEEL_DOWN && b->get_button_index() != BUTTON_WHEEL_UP))) { + // Stop panning the viewport (for any mouse button press except zooming) panning = false; } } @@ -1268,6 +1315,7 @@ bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) { // Start dragging if we still have nodes if (drag_selection.size() > 0) { + _save_canvas_item_state(drag_selection); drag_from = transform.affine_inverse().xform((b.is_valid()) ? b->get_position() : viewport->get_local_mouse_position()); Vector2 new_pos; if (drag_selection.size() == 1) { @@ -1281,7 +1329,6 @@ bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) { } drag_type = DRAG_PIVOT; - _save_canvas_item_state(drag_selection); } return true; } @@ -1791,7 +1838,7 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { if (_is_node_movable(canvas_item)) { Transform2D xform = transform * canvas_item->get_global_transform_with_canvas(); - Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * Transform2D(canvas_item->_edit_get_rotation(), canvas_item->_edit_get_position())).orthonormalized(); + Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * canvas_item->_edit_get_transform()).orthonormalized(); Transform2D simple_xform = viewport->get_transform() * unscaled_transform; drag_type = DRAG_SCALE_BOTH; @@ -1825,10 +1872,11 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { drag_to = transform.affine_inverse().xform(m->get_position()); Transform2D parent_xform = canvas_item->get_global_transform_with_canvas() * canvas_item->get_transform().affine_inverse(); - Transform2D unscaled_transform = (transform * parent_xform * Transform2D(canvas_item->_edit_get_rotation(), canvas_item->_edit_get_position())).orthonormalized(); + Transform2D unscaled_transform = (transform * parent_xform * canvas_item->_edit_get_transform()).orthonormalized(); Transform2D simple_xform = (viewport->get_transform() * unscaled_transform).affine_inverse() * transform; bool uniform = m->get_shift(); + bool is_ctrl = Input::get_singleton()->is_key_pressed(KEY_CONTROL); Point2 drag_from_local = simple_xform.xform(drag_from); Point2 drag_to_local = simple_xform.xform(drag_to); @@ -1859,6 +1907,12 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { } } } + + if (snap_scale && !is_ctrl) { + scale.x = roundf(scale.x / snap_scale_step) * snap_scale_step; + scale.y = roundf(scale.y / snap_scale_step) * snap_scale_step; + } + canvas_item->call("set_scale", scale); return true; } @@ -2274,7 +2328,7 @@ bool CanvasItemEditor::_gui_input_ruler_tool(const Ref<InputEvent> &p_event) { Point2 previous_origin = ruler_tool_origin; if (!ruler_tool_active) - ruler_tool_origin = snap_point(viewport->get_local_mouse_position() / zoom + view_offset) * zoom; + ruler_tool_origin = snap_point(viewport->get_local_mouse_position() / zoom + view_offset); if (b.is_valid() && b->get_button_index() == BUTTON_LEFT) { if (b->is_pressed()) { @@ -2287,9 +2341,7 @@ bool CanvasItemEditor::_gui_input_ruler_tool(const Ref<InputEvent> &p_event) { return true; } - bool is_snap_active = smart_snap_active ^ Input::get_singleton()->is_key_pressed(KEY_CONTROL); - - if (m.is_valid() && (ruler_tool_active || (is_snap_active && previous_origin != ruler_tool_origin))) { + if (m.is_valid() && (ruler_tool_active || (grid_snap_active && previous_origin != ruler_tool_origin))) { viewport->update(); return true; @@ -2641,41 +2693,72 @@ void CanvasItemEditor::_draw_rulers() { } void CanvasItemEditor::_draw_grid() { - if (show_grid || grid_snap_active) { - //Draw the grid - Size2 s = viewport->get_size(); - int last_cell = 0; - Transform2D xform = transform.affine_inverse(); + if (show_grid || grid_snap_active) { + // Draw the grid Vector2 real_grid_offset; - List<CanvasItem *> selection = _get_edited_canvas_items(); + const List<CanvasItem *> selection = _get_edited_canvas_items(); + if (snap_relative && selection.size() > 0) { - Vector2 topleft = _get_encompassing_rect_from_list(selection).position; + const Vector2 topleft = _get_encompassing_rect_from_list(selection).position; real_grid_offset.x = fmod(topleft.x, grid_step.x * (real_t)Math::pow(2.0, grid_step_multiplier)); real_grid_offset.y = fmod(topleft.y, grid_step.y * (real_t)Math::pow(2.0, grid_step_multiplier)); } else { real_grid_offset = grid_offset; } - const Color grid_color = EditorSettings::get_singleton()->get("editors/2d/grid_color"); + // Draw a "primary" line every several lines to make measurements easier. + // The step is configurable in the Configure Snap dialog. + const Color secondary_grid_color = EditorSettings::get_singleton()->get("editors/2d/grid_color"); + const Color primary_grid_color = + Color(secondary_grid_color.r, secondary_grid_color.g, secondary_grid_color.b, secondary_grid_color.a * 2.5); + + const Size2 viewport_size = viewport->get_size(); + const Transform2D xform = transform.affine_inverse(); + int last_cell = 0; + if (grid_step.x != 0) { - for (int i = 0; i < s.width; i++) { - int cell = Math::fast_ftoi(Math::floor((xform.xform(Vector2(i, 0)).x - real_grid_offset.x) / (grid_step.x * Math::pow(2.0, grid_step_multiplier)))); - if (i == 0) + for (int i = 0; i < viewport_size.width; i++) { + const int cell = + Math::fast_ftoi(Math::floor((xform.xform(Vector2(i, 0)).x - real_grid_offset.x) / (grid_step.x * Math::pow(2.0, grid_step_multiplier)))); + + if (i == 0) { last_cell = cell; - if (last_cell != cell) - viewport->draw_line(Point2(i, 0), Point2(i, s.height), grid_color, Math::round(EDSCALE)); + } + + if (last_cell != cell) { + Color grid_color; + if (primary_grid_steps == 0) { + grid_color = secondary_grid_color; + } else { + grid_color = cell % primary_grid_steps == 0 ? primary_grid_color : secondary_grid_color; + } + + viewport->draw_line(Point2(i, 0), Point2(i, viewport_size.height), grid_color, Math::round(EDSCALE)); + } last_cell = cell; } } if (grid_step.y != 0) { - for (int i = 0; i < s.height; i++) { - int cell = Math::fast_ftoi(Math::floor((xform.xform(Vector2(0, i)).y - real_grid_offset.y) / (grid_step.y * Math::pow(2.0, grid_step_multiplier)))); - if (i == 0) + for (int i = 0; i < viewport_size.height; i++) { + const int cell = + Math::fast_ftoi(Math::floor((xform.xform(Vector2(0, i)).y - real_grid_offset.y) / (grid_step.y * Math::pow(2.0, grid_step_multiplier)))); + + if (i == 0) { last_cell = cell; - if (last_cell != cell) - viewport->draw_line(Point2(0, i), Point2(s.width, i), grid_color, Math::round(EDSCALE)); + } + + if (last_cell != cell) { + Color grid_color; + if (primary_grid_steps == 0) { + grid_color = secondary_grid_color; + } else { + grid_color = cell % primary_grid_steps == 0 ? primary_grid_color : secondary_grid_color; + } + + viewport->draw_line(Point2(0, i), Point2(viewport_size.width, i), grid_color, Math::round(EDSCALE)); + } last_cell = cell; } } @@ -2687,19 +2770,17 @@ void CanvasItemEditor::_draw_ruler_tool() { if (tool != TOOL_RULER) return; - bool is_snap_active = smart_snap_active ^ Input::get_singleton()->is_key_pressed(KEY_CONTROL); - if (ruler_tool_active) { Color ruler_primary_color = get_color("accent_color", "Editor"); Color ruler_secondary_color = ruler_primary_color; ruler_secondary_color.a = 0.5; - Point2 begin = ruler_tool_origin - view_offset * zoom; + Point2 begin = (ruler_tool_origin - view_offset) * zoom; Point2 end = snap_point(viewport->get_local_mouse_position() / zoom + view_offset) * zoom - view_offset * zoom; Point2 corner = Point2(begin.x, end.y); Vector2 length_vector = (begin - end).abs() / zoom; - bool draw_secondary_lines = (begin.y != corner.y && end.x != corner.x); + bool draw_secondary_lines = !(Math::is_equal_approx(begin.y, corner.y) || Math::is_equal_approx(end.x, corner.x)); viewport->draw_line(begin, end, ruler_primary_color, Math::round(EDSCALE * 3), true); if (draw_secondary_lines) { @@ -2721,8 +2802,10 @@ void CanvasItemEditor::_draw_ruler_tool() { viewport->draw_string(font, text_pos, vformat("%.2f px", length_vector.length()), font_color); if (draw_secondary_lines) { - int horizontal_axis_angle = round(180 * atan2(length_vector.y, length_vector.x) / Math_PI); - int vertictal_axis_angle = 90 - horizontal_axis_angle; + const float horizontal_angle_rad = atan2(length_vector.y, length_vector.x); + const float vertical_angle_rad = Math_PI / 2.0 - horizontal_angle_rad; + const int horizontal_angle = round(180 * horizontal_angle_rad / Math_PI); + const int vertical_angle = round(180 * vertical_angle_rad / Math_PI); Point2 text_pos2 = text_pos; text_pos2.x = begin.x < text_pos.x ? MIN(text_pos.x - text_width, begin.x - text_width / 2) : MAX(text_pos.x + text_width, begin.x - text_width / 2); @@ -2731,7 +2814,7 @@ void CanvasItemEditor::_draw_ruler_tool() { Point2 v_angle_text_pos = Point2(); v_angle_text_pos.x = CLAMP(begin.x - angle_text_width / 2, angle_text_width / 2, viewport->get_rect().size.x - angle_text_width); v_angle_text_pos.y = begin.y < end.y ? MIN(text_pos2.y - 2 * text_height, begin.y - text_height * 0.5) : MAX(text_pos2.y + text_height * 3, begin.y + text_height * 1.5); - viewport->draw_string(font, v_angle_text_pos, vformat("%d deg", vertictal_axis_angle), font_secondary_color); + viewport->draw_string(font, v_angle_text_pos, vformat("%d deg", vertical_angle), font_secondary_color); text_pos2 = text_pos; text_pos2.y = end.y < text_pos.y ? MIN(text_pos.y - text_height * 2, end.y - text_height / 2) : MAX(text_pos.y + text_height * 2, end.y - text_height / 2); @@ -2742,20 +2825,48 @@ void CanvasItemEditor::_draw_ruler_tool() { if (begin.y < end.y) { h_angle_text_pos.y = end.y + text_height * 1.5; if (ABS(text_pos2.x - h_angle_text_pos.x) < text_width) { - int height_multiplier = 1.5 + (int)is_snap_active; + int height_multiplier = 1.5 + (int)grid_snap_active; h_angle_text_pos.y = MAX(text_pos.y + height_multiplier * text_height, MAX(end.y + text_height * 1.5, text_pos2.y + height_multiplier * text_height)); } } else { h_angle_text_pos.y = end.y - text_height * 0.5; if (ABS(text_pos2.x - h_angle_text_pos.x) < text_width) { - int height_multiplier = 1 + (int)is_snap_active; + int height_multiplier = 1 + (int)grid_snap_active; h_angle_text_pos.y = MIN(text_pos.y - height_multiplier * text_height, MIN(end.y - text_height * 0.5, text_pos2.y - height_multiplier * text_height)); } } - viewport->draw_string(font, h_angle_text_pos, vformat("%d deg", horizontal_axis_angle), font_secondary_color); + viewport->draw_string(font, h_angle_text_pos, vformat("%d deg", horizontal_angle), font_secondary_color); + + // Angle arcs + int arc_point_count = 8; + float arc_radius_max_length_percent = 0.1; + float ruler_length = length_vector.length() * zoom; + float arc_max_radius = 50.0; + float arc_line_width = 2.0; + + const Vector2 end_to_begin = (end - begin); + + float arc_1_start_angle = + end_to_begin.x < 0 ? + (end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 - vertical_angle_rad : Math_PI / 2.0) : + (end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 : Math_PI / 2.0 - vertical_angle_rad); + float arc_1_end_angle = arc_1_start_angle + vertical_angle_rad; + // Constrain arc to triangle height & max size + float arc_1_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.y)), arc_max_radius); + + float arc_2_start_angle = + end_to_begin.x < 0 ? + (end_to_begin.y < 0 ? 0.0 : -horizontal_angle_rad) : + (end_to_begin.y < 0 ? Math_PI - horizontal_angle_rad : Math_PI); + float arc_2_end_angle = arc_2_start_angle + horizontal_angle_rad; + // Constrain arc to triangle width & max size + float arc_2_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.x)), arc_max_radius); + + viewport->draw_arc(begin, arc_1_radius, arc_1_start_angle, arc_1_end_angle, arc_point_count, ruler_primary_color, Math::round(EDSCALE * arc_line_width)); + viewport->draw_arc(end, arc_2_radius, arc_2_start_angle, arc_2_end_angle, arc_point_count, ruler_primary_color, Math::round(EDSCALE * arc_line_width)); } - if (is_snap_active) { + if (grid_snap_active) { text_pos = (begin + end) / 2 + Vector2(-text_width / 2, text_height / 2); text_pos.x = CLAMP(text_pos.x, text_width / 2, viewport->get_rect().size.x - text_width * 1.5); @@ -2766,20 +2877,20 @@ void CanvasItemEditor::_draw_ruler_tool() { Point2 text_pos2 = text_pos; text_pos2.x = begin.x < text_pos.x ? MIN(text_pos.x - text_width, begin.x - text_width / 2) : MAX(text_pos.x + text_width, begin.x - text_width / 2); - viewport->draw_string(font, text_pos2, vformat("%d units", (int)(length_vector.y / grid_step.y)), font_secondary_color); + viewport->draw_string(font, text_pos2, vformat("%d units", roundf(length_vector.y / grid_step.y)), font_secondary_color); text_pos2 = text_pos; text_pos2.y = end.y < text_pos.y ? MIN(text_pos.y - text_height * 2, end.y + text_height / 2) : MAX(text_pos.y + text_height * 2, end.y + text_height / 2); - viewport->draw_string(font, text_pos2, vformat("%d units", (int)(length_vector.x / grid_step.x)), font_secondary_color); + viewport->draw_string(font, text_pos2, vformat("%d units", roundf(length_vector.x / grid_step.x)), font_secondary_color); } else { viewport->draw_string(font, text_pos, vformat("%d units", roundf((length_vector / grid_step).length())), font_color); } } } else { - if (is_snap_active) { + if (grid_snap_active) { Ref<Texture> position_icon = get_icon("EditorPosition", "EditorIcons"); - viewport->draw_texture(get_icon("EditorPosition", "EditorIcons"), ruler_tool_origin - view_offset * zoom - position_icon->get_size() / 2); + viewport->draw_texture(get_icon("EditorPosition", "EditorIcons"), (ruler_tool_origin - view_offset) * zoom - position_icon->get_size() / 2); } } } @@ -3048,7 +3159,7 @@ void CanvasItemEditor::_draw_selection() { } } else { - Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * Transform2D(canvas_item->_edit_get_rotation(), canvas_item->_edit_get_position())).orthonormalized(); + Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * canvas_item->_edit_get_transform()).orthonormalized(); Transform2D simple_xform = viewport->get_transform() * unscaled_transform; viewport->draw_set_transform_matrix(simple_xform); viewport->draw_texture(position_icon, -(position_icon->get_size() / 2)); @@ -3060,7 +3171,7 @@ void CanvasItemEditor::_draw_selection() { if (canvas_item->_edit_use_pivot()) { // Draw the node's pivot - Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * Transform2D(canvas_item->_edit_get_rotation(), canvas_item->_edit_get_position() + canvas_item->_edit_get_pivot())).orthonormalized(); + Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * canvas_item->_edit_get_transform()).orthonormalized(); Transform2D simple_xform = viewport->get_transform() * unscaled_transform; viewport->draw_set_transform_matrix(simple_xform); @@ -3105,7 +3216,7 @@ void CanvasItemEditor::_draw_selection() { bool is_alt = Input::get_singleton()->is_key_pressed(KEY_ALT); if ((is_alt && is_ctrl) || tool == TOOL_SCALE || drag_type == DRAG_SCALE_X || drag_type == DRAG_SCALE_Y) { if (_is_node_movable(canvas_item)) { - Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * Transform2D(canvas_item->_edit_get_rotation(), canvas_item->_edit_get_position())).orthonormalized(); + Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * canvas_item->_edit_get_transform()).orthonormalized(); Transform2D simple_xform = viewport->get_transform() * unscaled_transform; Size2 scale_factor = Size2(SCALE_HANDLE_DISTANCE, SCALE_HANDLE_DISTANCE); @@ -3324,7 +3435,7 @@ void CanvasItemEditor::_draw_invisible_nodes_positions(Node *p_node, const Trans // Draw the node's position Ref<Texture> position_icon = get_icon("EditorPositionUnselected", "EditorIcons"); - Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * Transform2D(canvas_item->_edit_get_rotation(), canvas_item->_edit_get_position())).orthonormalized(); + Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * canvas_item->_edit_get_transform()).orthonormalized(); Transform2D simple_xform = viewport->get_transform() * unscaled_transform; viewport->draw_set_transform_matrix(simple_xform); viewport->draw_texture(position_icon, -position_icon->get_size() / 2, Color(1.0, 1.0, 1.0, 0.5)); @@ -3700,6 +3811,7 @@ void CanvasItemEditor::_notification(int p_what) { grid_snap_button->set_icon(get_icon("SnapGrid", "EditorIcons")); snap_config_menu->set_icon(get_icon("GuiTabMenu", "EditorIcons")); skeleton_menu->set_icon(get_icon("Bone", "EditorIcons")); + override_camera_button->set_icon(get_icon("Camera2D", "EditorIcons")); pan_button->set_icon(get_icon("ToolPan", "EditorIcons")); ruler_button->set_icon(get_icon("Ruler", "EditorIcons")); pivot_button->set_icon(get_icon("EditPivot", "EditorIcons")); @@ -3769,6 +3881,15 @@ void CanvasItemEditor::_notification(int p_what) { anchor_mode_button->set_icon(get_icon("Anchor", "EditorIcons")); } + + if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + if (!is_visible() && override_camera_button->is_pressed()) { + ScriptEditorDebugger *debugger = ScriptEditor::get_singleton()->get_debugger(); + + debugger->set_camera_override(ScriptEditorDebugger::OVERRIDE_NONE); + override_camera_button->set_pressed(false); + } + } } void CanvasItemEditor::_selection_changed() { @@ -4110,6 +4231,15 @@ void CanvasItemEditor::_button_toggle_grid_snap(bool p_status) { grid_snap_active = p_status; viewport->update(); } +void CanvasItemEditor::_button_override_camera(bool p_pressed) { + ScriptEditorDebugger *debugger = ScriptEditor::get_singleton()->get_debugger(); + + if (p_pressed) { + debugger->set_camera_override(ScriptEditorDebugger::OVERRIDE_2D); + } else { + debugger->set_camera_override(ScriptEditorDebugger::OVERRIDE_NONE); + } +} void CanvasItemEditor::_button_tool_select(int p_index) { @@ -4207,6 +4337,17 @@ void CanvasItemEditor::_button_toggle_anchor_mode(bool p_status) { viewport->update(); } +void CanvasItemEditor::_update_override_camera_button(bool p_game_running) { + if (p_game_running) { + override_camera_button->set_disabled(false); + override_camera_button->set_tooltip(TTR("Game Camera Override\nOverrides game camera with editor viewport camera.")); + } else { + override_camera_button->set_disabled(true); + override_camera_button->set_pressed(false); + override_camera_button->set_tooltip(TTR("Game Camera Override\nNo game instance running.")); + } +} + void CanvasItemEditor::_popup_callback(int p_op) { last_option = MenuOption(p_op); @@ -4271,6 +4412,11 @@ void CanvasItemEditor::_popup_callback(int p_op) { int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_ROTATION); snap_config_menu->get_popup()->set_item_checked(idx, snap_rotation); } break; + case SNAP_USE_SCALE: { + snap_scale = !snap_scale; + int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_SCALE); + snap_config_menu->get_popup()->set_item_checked(idx, snap_scale); + } break; case SNAP_RELATIVE: { snap_relative = !snap_relative; int idx = snap_config_menu->get_popup()->get_item_index(SNAP_RELATIVE); @@ -4283,8 +4429,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { snap_config_menu->get_popup()->set_item_checked(idx, snap_pixel); } break; case SNAP_CONFIGURE: { - ((SnapDialog *)snap_dialog)->set_fields(grid_offset, grid_step, snap_rotation_offset, snap_rotation_step); - snap_dialog->popup_centered(Size2(220, 160)); + ((SnapDialog *)snap_dialog)->set_fields(grid_offset, grid_step, primary_grid_steps, snap_rotation_offset, snap_rotation_step, snap_scale_step); + snap_dialog->popup_centered(Size2(220, 160) * EDSCALE); } break; case SKELETON_SHOW_BONES: { skeleton_show_bones = !skeleton_show_bones; @@ -4799,6 +4945,8 @@ void CanvasItemEditor::_bind_methods() { ClassDB::bind_method("_button_zoom_plus", &CanvasItemEditor::_button_zoom_plus); ClassDB::bind_method("_button_toggle_smart_snap", &CanvasItemEditor::_button_toggle_smart_snap); ClassDB::bind_method("_button_toggle_grid_snap", &CanvasItemEditor::_button_toggle_grid_snap); + ClassDB::bind_method(D_METHOD("_button_override_camera", "pressed"), &CanvasItemEditor::_button_override_camera); + ClassDB::bind_method(D_METHOD("_update_override_camera_button", "game_running"), &CanvasItemEditor::_update_override_camera_button); ClassDB::bind_method("_button_toggle_anchor_mode", &CanvasItemEditor::_button_toggle_anchor_mode); ClassDB::bind_method("_update_scroll", &CanvasItemEditor::_update_scroll); ClassDB::bind_method("_update_scrollbars", &CanvasItemEditor::_update_scrollbars); @@ -4831,8 +4979,10 @@ Dictionary CanvasItemEditor::get_state() const { state["ofs"] = view_offset; state["grid_offset"] = grid_offset; state["grid_step"] = grid_step; + state["primary_grid_steps"] = primary_grid_steps; state["snap_rotation_offset"] = snap_rotation_offset; state["snap_rotation_step"] = snap_rotation_step; + state["snap_scale_step"] = snap_scale_step; state["smart_snap_active"] = smart_snap_active; state["grid_snap_active"] = grid_snap_active; state["snap_node_parent"] = snap_node_parent; @@ -4850,6 +5000,7 @@ Dictionary CanvasItemEditor::get_state() const { state["show_zoom_control"] = zoom_hb->is_visible(); state["show_edit_locks"] = show_edit_locks; state["snap_rotation"] = snap_rotation; + state["snap_scale"] = snap_scale; state["snap_relative"] = snap_relative; state["snap_pixel"] = snap_pixel; state["skeleton_show_bones"] = skeleton_show_bones; @@ -4879,6 +5030,10 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) { grid_step = state["grid_step"]; } + if (state.has("primary_grid_steps")) { + primary_grid_steps = state["primary_grid_steps"]; + } + if (state.has("snap_rotation_step")) { snap_rotation_step = state["snap_rotation_step"]; } @@ -4887,6 +5042,10 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) { snap_rotation_offset = state["snap_rotation_offset"]; } + if (state.has("snap_scale_step")) { + snap_scale_step = state["snap_scale_step"]; + } + if (state.has("smart_snap_active")) { smart_snap_active = state["smart_snap_active"]; smart_snap_button->set_pressed(smart_snap_active); @@ -4987,6 +5146,12 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) { snap_config_menu->get_popup()->set_item_checked(idx, snap_rotation); } + if (state.has("snap_scale")) { + snap_scale = state["snap_scale"]; + int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_SCALE); + snap_config_menu->get_popup()->set_item_checked(idx, snap_scale); + } + if (state.has("snap_relative")) { snap_relative = state["snap_relative"]; int idx = snap_config_menu->get_popup()->get_item_index(SNAP_RELATIVE); @@ -5068,9 +5233,11 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { previous_update_view_offset = view_offset; // Moves the view a little bit to the left so that (0,0) is visible. The values a relative to a 16/10 screen grid_offset = Point2(); grid_step = Point2(10, 10); + primary_grid_steps = 8; // A power-of-two value works better as a default grid_step_multiplier = 0; snap_rotation_offset = 0; snap_rotation_step = 15 / (180 / Math_PI); + snap_scale_step = 0.1f; smart_snap_active = false; grid_snap_active = false; snap_node_parent = true; @@ -5080,6 +5247,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { snap_other_nodes = true; snap_guides = true; snap_rotation = false; + snap_scale = false; snap_relative = false; snap_pixel = false; snap_target[0] = SNAP_TARGET_NONE; @@ -5111,6 +5279,9 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { editor_selection->connect("selection_changed", this, "update"); editor_selection->connect("selection_changed", this, "_selection_changed"); + editor->call_deferred("connect", "play_pressed", this, "_update_override_camera_button", make_binds(true)); + editor->call_deferred("connect", "stop_pressed", this, "_update_override_camera_button", make_binds(false)); + hb = memnew(HBoxContainer); add_child(hb); hb->set_anchors_and_margins_preset(Control::PRESET_WIDE); @@ -5293,6 +5464,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p->connect("id_pressed", this, "_popup_callback"); p->set_hide_on_checkable_item_selection(false); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_rotation_snap", TTR("Use Rotation Snap")), SNAP_USE_ROTATION); + p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_scale_snap", TTR("Use Scale Snap")), SNAP_USE_SCALE); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_relative", TTR("Snap Relative")), SNAP_RELATIVE); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_pixel_snap", TTR("Use Pixel Snap")), SNAP_USE_PIXEL); p->add_submenu_item(TTR("Smart Snapping"), "SmartSnapping"); @@ -5355,6 +5527,15 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { hb->add_child(memnew(VSeparator)); + override_camera_button = memnew(ToolButton); + hb->add_child(override_camera_button); + override_camera_button->connect("toggled", this, "_button_override_camera"); + override_camera_button->set_toggle_mode(true); + override_camera_button->set_disabled(true); + _update_override_camera_button(false); + + hb->add_child(memnew(VSeparator)); + view_menu = memnew(MenuButton); view_menu->set_text(TTR("View")); hb->add_child(view_menu); @@ -5438,7 +5619,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_auto_insert_button->set_toggle_mode(true); key_auto_insert_button->set_focus_mode(FOCUS_NONE); //key_auto_insert_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY)); - key_auto_insert_button->set_tooltip(TTR("Auto insert keys when objects are translated, rotated on scaled (based on mask).\nKeys are only added to existing tracks, no new tracks will be created.\nKeys must be inserted manually for the first time.")); + key_auto_insert_button->set_tooltip(TTR("Auto insert keys when objects are translated, rotated or scaled (based on mask).\nKeys are only added to existing tracks, no new tracks will be created.\nKeys must be inserted manually for the first time.")); key_auto_insert_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/anim_auto_insert_key", TTR("Auto Insert Key"))); animation_hb->add_child(key_auto_insert_button); diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 480fb89621..3fdf00d611 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -108,6 +108,7 @@ private: SNAP_USE_GRID, SNAP_USE_GUIDES, SNAP_USE_ROTATION, + SNAP_USE_SCALE, SNAP_RELATIVE, SNAP_CONFIGURE, SNAP_USE_PIXEL, @@ -255,10 +256,12 @@ private: Point2 grid_offset; Point2 grid_step; + int primary_grid_steps; int grid_step_multiplier; float snap_rotation_step; float snap_rotation_offset; + float snap_scale_step; bool smart_snap_active; bool grid_snap_active; @@ -269,6 +272,7 @@ private: bool snap_other_nodes; bool snap_guides; bool snap_rotation; + bool snap_scale; bool snap_relative; bool snap_pixel; bool skeleton_show_bones; @@ -360,6 +364,7 @@ private: ToolButton *ungroup_button; MenuButton *skeleton_menu; + ToolButton *override_camera_button; MenuButton *view_menu; HBoxContainer *animation_hb; MenuButton *animation_menu; @@ -533,8 +538,11 @@ private: void _button_zoom_plus(); void _button_toggle_smart_snap(bool p_status); void _button_toggle_grid_snap(bool p_status); + void _button_override_camera(bool p_pressed); void _button_tool_select(int p_index); + void _update_override_camera_button(bool p_game_running); + HSplitContainer *palette_split; VSplitContainer *bottom_split; diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 9160920c50..727d92ba05 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -736,6 +736,9 @@ void CurveEditor::_draw() { if (_selected_point > 0 && _selected_point + 1 < curve.get_point_count()) { text_color.a *= 0.4; draw_string(font, Vector2(50, font_height), TTR("Hold Shift to edit tangents individually"), text_color); + } else if (curve.get_point_count() == 0) { + text_color.a *= 0.4; + draw_string(font, Vector2(50, font_height), TTR("Right click to add point"), text_color); } } diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 8acc41a2c7..007ce58bd7 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -103,9 +103,11 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 img = ltex->to_image(); } else { Ref<Texture> tex = p_from; - img = tex->get_data(); - if (img.is_valid()) { - img = img->duplicate(); + if (tex.is_valid()) { + img = tex->get_data(); + if (img.is_valid()) { + img = img->duplicate(); + } } } diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp index 635b934333..22df8fd8f4 100644 --- a/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_editor_plugin.cpp @@ -180,6 +180,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { CollisionShape *cshape = memnew(CollisionShape); cshape->set_shape(shapes[i]); + cshape->set_transform(node->get_transform()); Node *owner = node->get_owner(); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index ecb2354aa1..f63445dab8 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -571,6 +571,7 @@ void ScriptTextEditor::_validate_script() { String error_text = "error(" + itos(line) + "," + itos(col) + "): " + errortxt; code_editor->set_error(error_text); code_editor->set_error_pos(line - 1, col - 1); + script_is_valid = false; } else { code_editor->set_error(""); line = -1; @@ -585,6 +586,7 @@ void ScriptTextEditor::_validate_script() { functions.push_back(E->get()); } + script_is_valid = true; } _update_connected_methods(); @@ -967,12 +969,17 @@ void ScriptTextEditor::_update_connected_methods() { text_edit->clear_info_icons(); missing_connections.clear(); + if (!script_is_valid) { + return; + } + Node *base = get_tree()->get_edited_scene_root(); if (!base) { return; } Vector<Node *> nodes = _find_all_node_for_script(base, base, script); + Set<StringName> methods_found; for (int i = 0; i < nodes.size(); i++) { List<Connection> connections; nodes[i]->get_signals_connected_to_this(&connections); @@ -989,28 +996,41 @@ void ScriptTextEditor::_update_connected_methods() { continue; } - if (!ClassDB::has_method(script->get_instance_base_type(), connection.method)) { + if (methods_found.has(connection.method)) { + continue; + } - int line = script->get_language()->find_function(connection.method, text_edit->get_text()); - if (line < 0) { - // There is a chance that the method is inherited from another script. - bool found_inherited_function = false; - Ref<Script> inherited_script = script->get_base_script(); - while (!inherited_script.is_null()) { - line = inherited_script->get_language()->find_function(connection.method, inherited_script->get_source_code()); - if (line != -1) { - found_inherited_function = true; - break; - } - - inherited_script = inherited_script->get_base_script(); + if (!ClassDB::has_method(script->get_instance_base_type(), connection.method)) { + int line = -1; + + for (int j = 0; j < functions.size(); j++) { + String name = functions[j].get_slice(":", 0); + if (name == connection.method) { + line = functions[j].get_slice(":", 1).to_int(); + text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.method); + methods_found.insert(connection.method); + break; } + } - if (!found_inherited_function) { - missing_connections.push_back(connection); + if (line >= 0) { + continue; + } + + // There is a chance that the method is inherited from another script. + bool found_inherited_function = false; + Ref<Script> inherited_script = script->get_base_script(); + while (!inherited_script.is_null()) { + if (inherited_script->has_method(connection.method)) { + found_inherited_function = true; + break; } - } else { - text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.method); + + inherited_script = inherited_script->get_base_script(); + } + + if (!found_inherited_function) { + missing_connections.push_back(connection); } } } @@ -1186,7 +1206,7 @@ void ScriptTextEditor::_edit_option(int p_op) { if (expression.parse(line) == OK) { Variant result = expression.execute(Array(), Variant(), false); if (expression.get_error_text() == "") { - results.append(whitespace + (String)result); + results.append(whitespace + result.get_construct_string()); } else { results.append(line); } @@ -1718,6 +1738,7 @@ void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color, bool p ScriptTextEditor::ScriptTextEditor() { theme_loaded = false; + script_is_valid = false; VSplitContainer *editor_box = memnew(VSplitContainer); add_child(editor_box); diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index eba75befd4..2ba0be8feb 100644 --- a/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h @@ -59,6 +59,7 @@ class ScriptTextEditor : public ScriptEditorBase { RichTextLabel *warnings_panel; Ref<Script> script; + bool script_is_valid; Vector<String> functions; diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 1d8fd38858..e0189f8a92 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -901,6 +901,8 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> b = p_event; if (b.is_valid()) { + emit_signal("clicked", this); + float zoom_factor = 1 + (ZOOM_MULTIPLIER - 1) * b->get_factor(); switch (b->get_button_index()) { @@ -2760,8 +2762,10 @@ void SpatialEditorViewport::_menu_option(int p_option) { void SpatialEditorViewport::_preview_exited_scene() { + preview_camera->disconnect("toggled", this, "_toggle_camera_preview"); preview_camera->set_pressed(false); _toggle_camera_preview(false); + preview_camera->connect("toggled", this, "_toggle_camera_preview"); view_menu->show(); } @@ -3031,6 +3035,9 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { view_menu->get_popup()->set_item_checked(idx, previewing_cinema); } + if (preview_camera->is_connected("toggled", this, "_toggle_camera_preview")) { + preview_camera->disconnect("toggled", this, "_toggle_camera_preview"); + } if (p_state.has("previewing")) { Node *pv = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["previewing"]); if (Object::cast_to<Camera>(pv)) { @@ -3043,6 +3050,7 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { preview_camera->show(); } } + preview_camera->connect("toggled", this, "_toggle_camera_preview"); } Dictionary SpatialEditorViewport::get_state() const { @@ -3096,6 +3104,7 @@ void SpatialEditorViewport::_bind_methods() { ClassDB::bind_method(D_METHOD("drop_data_fw"), &SpatialEditorViewport::drop_data_fw); ADD_SIGNAL(MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport"))); + ADD_SIGNAL(MethodInfo("clicked", PropertyInfo(Variant::OBJECT, "viewport"))); } void SpatialEditorViewport::reset() { @@ -4369,6 +4378,19 @@ void SpatialEditor::_menu_item_toggled(bool pressed, int p_option) { tool_option_button[TOOL_OPT_USE_SNAP]->set_pressed(pressed); snap_enabled = pressed; } break; + + case MENU_TOOL_OVERRIDE_CAMERA: { + ScriptEditorDebugger *const debugger = ScriptEditor::get_singleton()->get_debugger(); + + if (pressed) { + using Override = ScriptEditorDebugger::CameraOverride; + + debugger->set_camera_override((Override)(Override::OVERRIDE_3D_1 + camera_override_viewport_id)); + } else { + debugger->set_camera_override(ScriptEditorDebugger::OVERRIDE_NONE); + } + + } break; } } @@ -4396,6 +4418,35 @@ void SpatialEditor::_menu_gizmo_toggled(int p_option) { update_all_gizmos(); } +void SpatialEditor::_update_camera_override_button(bool p_game_running) { + Button *const button = tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]; + + if (p_game_running) { + button->set_disabled(false); + button->set_tooltip(TTR("Game Camera Override\nNo game instance running.")); + } else { + button->set_disabled(true); + button->set_pressed(false); + button->set_tooltip(TTR("Game Camera Override\nOverrides game camera with editor viewport camera.")); + } +} + +void SpatialEditor::_update_camera_override_viewport(Object *p_viewport) { + SpatialEditorViewport *current_viewport = Object::cast_to<SpatialEditorViewport>(p_viewport); + + if (!current_viewport) + return; + + ScriptEditorDebugger *const debugger = ScriptEditor::get_singleton()->get_debugger(); + + camera_override_viewport_id = current_viewport->index; + if (debugger->get_camera_override() >= ScriptEditorDebugger::OVERRIDE_3D_1) { + using Override = ScriptEditorDebugger::CameraOverride; + + debugger->set_camera_override((Override)(Override::OVERRIDE_3D_1 + camera_override_viewport_id)); + } +} + void SpatialEditor::_menu_item_pressed(int p_option) { switch (p_option) { @@ -5290,6 +5341,7 @@ void SpatialEditor::_notification(int p_what) { tool_option_button[SpatialEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_icon("Object", "EditorIcons")); tool_option_button[SpatialEditor::TOOL_OPT_USE_SNAP]->set_icon(get_icon("Snap", "EditorIcons")); + tool_option_button[SpatialEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_icon("Camera", "EditorIcons")); view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_icon("Panels1", "EditorIcons")); view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_icon("Panels2", "EditorIcons")); @@ -5305,6 +5357,9 @@ void SpatialEditor::_notification(int p_what) { get_tree()->connect("node_removed", this, "_node_removed"); EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", this, "_refresh_menu_icons"); editor_selection->connect("selection_changed", this, "_refresh_menu_icons"); + + editor->connect("stop_pressed", this, "_update_camera_override_button", make_binds(false)); + editor->connect("play_pressed", this, "_update_camera_override_button", make_binds(true)); } else if (p_what == NOTIFICATION_ENTER_TREE) { _register_all_gizmos(); @@ -5339,6 +5394,13 @@ void SpatialEditor::_notification(int p_what) { // Update grid color by rebuilding grid. _finish_grid(); _init_grid(); + } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + if (!is_visible() && tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->is_pressed()) { + ScriptEditorDebugger *debugger = ScriptEditor::get_singleton()->get_debugger(); + + debugger->set_camera_override(ScriptEditorDebugger::OVERRIDE_NONE); + tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_pressed(false); + } } } @@ -5483,6 +5545,8 @@ void SpatialEditor::_bind_methods() { ClassDB::bind_method("_request_gizmo", &SpatialEditor::_request_gizmo); ClassDB::bind_method("_toggle_maximize_view", &SpatialEditor::_toggle_maximize_view); ClassDB::bind_method("_refresh_menu_icons", &SpatialEditor::_refresh_menu_icons); + ClassDB::bind_method("_update_camera_override_button", &SpatialEditor::_update_camera_override_button); + ClassDB::bind_method("_update_camera_override_viewport", &SpatialEditor::_update_camera_override_viewport); ADD_SIGNAL(MethodInfo("transform_key_request")); ADD_SIGNAL(MethodInfo("item_lock_status_changed")); @@ -5536,6 +5600,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { snap_key_enabled = false; tool_mode = TOOL_MODE_SELECT; + camera_override_viewport_id = 0; + hbc_menu = memnew(HBoxContainer); vbc->add_child(hbc_menu); @@ -5633,6 +5699,17 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { hbc_menu->add_child(memnew(VSeparator)); + tool_option_button[TOOL_OPT_OVERRIDE_CAMERA] = memnew(ToolButton); + hbc_menu->add_child(tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]); + tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_toggle_mode(true); + tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_flat(true); + tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_disabled(true); + button_binds.write[0] = MENU_TOOL_OVERRIDE_CAMERA; + tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->connect("toggled", this, "_menu_item_toggled", button_binds); + _update_camera_override_button(false); + + hbc_menu->add_child(memnew(VSeparator)); + // Drag and drop support; preview_node = memnew(Spatial); preview_bounds = AABB(); @@ -5721,6 +5798,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { viewports[i] = memnew(SpatialEditorViewport(this, editor, i)); viewports[i]->connect("toggle_maximize_view", this, "_toggle_maximize_view"); + viewports[i]->connect("clicked", this, "_update_camera_override_viewport"); viewports[i]->assign_pending_data_pointers(preview_node, &preview_bounds, accept); viewport_base->add_child(viewports[i]); } diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index fe91c33642..65e3c32ca8 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -494,6 +494,7 @@ public: TOOL_OPT_LOCAL_COORDS, TOOL_OPT_USE_SNAP, + TOOL_OPT_OVERRIDE_CAMERA, TOOL_OPT_MAX }; @@ -559,6 +560,7 @@ private: MENU_TOOL_LIST_SELECT, MENU_TOOL_LOCAL_COORDS, MENU_TOOL_USE_SNAP, + MENU_TOOL_OVERRIDE_CAMERA, MENU_TRANSFORM_CONFIGURE_SNAP, MENU_TRANSFORM_DIALOG, MENU_VIEW_USE_1_VIEWPORT, @@ -585,9 +587,6 @@ private: PopupMenu *gizmos_menu; MenuButton *view_menu; - ToolButton *lock_button; - ToolButton *unlock_button; - AcceptDialog *accept; ConfirmationDialog *snap_dialog; @@ -615,13 +614,16 @@ private: void _menu_item_pressed(int p_option); void _menu_item_toggled(bool pressed, int p_option); void _menu_gizmo_toggled(int p_option); + void _update_camera_override_button(bool p_game_running); + void _update_camera_override_viewport(Object *p_viewport); HBoxContainer *hbc_menu; void _generate_selection_box(); UndoRedo *undo_redo; - void _instance_scene(); + int camera_override_viewport_id; + void _init_indicators(); void _update_gizmos_menu(); void _update_gizmos_menu_theme(); @@ -716,7 +718,7 @@ public: void set_can_preview(Camera *p_preview); SpatialEditorViewport *get_editor_viewport(int p_idx) { - ERR_FAIL_INDEX_V(p_idx, 4, NULL); + ERR_FAIL_INDEX_V(p_idx, static_cast<int>(VIEWPORTS_COUNT), NULL); return viewports[p_idx]; } diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index defc0a40ea..c4a9803ff4 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -64,21 +64,24 @@ void StyleBoxPreview::edit(const Ref<StyleBox> &p_stylebox) { void StyleBoxPreview::_sb_changed() { preview->update(); +} + +void StyleBoxPreview::_redraw() { if (stylebox.is_valid()) { - Size2 ms = stylebox->get_minimum_size() * 4 / 3; - ms.height = MAX(ms.height, 150 * EDSCALE); - preview->set_custom_minimum_size(ms); + preview->draw_style_box(stylebox, preview->get_rect()); } } void StyleBoxPreview::_bind_methods() { ClassDB::bind_method("_sb_changed", &StyleBoxPreview::_sb_changed); + ClassDB::bind_method("_redraw", &StyleBoxPreview::_redraw); } StyleBoxPreview::StyleBoxPreview() { - - preview = memnew(Panel); + preview = memnew(Control); + preview->set_custom_minimum_size(Size2(0, 150 * EDSCALE)); + preview->connect("draw", this, "_redraw"); add_margin_child(TTR("Preview:"), preview); } diff --git a/editor/plugins/style_box_editor_plugin.h b/editor/plugins/style_box_editor_plugin.h index d31a28b3e4..fead8e0de8 100644 --- a/editor/plugins/style_box_editor_plugin.h +++ b/editor/plugins/style_box_editor_plugin.h @@ -41,10 +41,11 @@ class StyleBoxPreview : public VBoxContainer { GDCLASS(StyleBoxPreview, VBoxContainer); - Panel *preview; + Control *preview; Ref<StyleBox> stylebox; void _sb_changed(); + void _redraw(); protected: static void _bind_methods(); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 21eebf9ca2..bda3d142fa 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -866,8 +866,8 @@ void TextureRegionEditor::_edit_region() { Vector2 TextureRegionEditor::snap_point(Vector2 p_target) const { if (snap_mode == SNAP_GRID) { - p_target.x = Math::snap_scalar_seperation(snap_offset.x, snap_step.x, p_target.x, snap_separation.x); - p_target.y = Math::snap_scalar_seperation(snap_offset.y, snap_step.y, p_target.y, snap_separation.y); + p_target.x = Math::snap_scalar_separation(snap_offset.x, snap_step.x, p_target.x, snap_separation.x); + p_target.y = Math::snap_scalar_separation(snap_offset.y, snap_step.y, p_target.y, snap_separation.y); } return p_target; diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 2d66087699..10567557d6 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -1996,6 +1996,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { info_message->set_valign(Label::VALIGN_CENTER); info_message->set_align(Label::ALIGN_CENTER); info_message->set_autowrap(true); + info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); info_message->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); palette->add_child(info_message); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index e0bf8dfdb2..cc4c21cc04 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -584,6 +584,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { empty_message->set_valign(Label::VALIGN_CENTER); empty_message->set_align(Label::ALIGN_CENTER); empty_message->set_autowrap(true); + empty_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); empty_message->set_v_size_flags(SIZE_EXPAND_FILL); main_vb->add_child(empty_message); @@ -3038,8 +3039,8 @@ Vector2 TileSetEditor::snap_point(const Vector2 &point) { } if (tools[TOOL_GRID_SNAP]->is_pressed()) { - p.x = Math::snap_scalar_seperation(snap_offset.x, snap_step.x, p.x, snap_separation.x); - p.y = Math::snap_scalar_seperation(snap_offset.y, snap_step.y, p.y, snap_separation.y); + p.x = Math::snap_scalar_separation(snap_offset.x, snap_step.x, p.x, snap_separation.x); + p.y = Math::snap_scalar_separation(snap_offset.y, snap_step.y, p.y, snap_separation.y); } if (tools[SHAPE_KEEP_INSIDE_TILE]->is_pressed()) { if (p.x < region.position.x) diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index d4f985e1de..783797ada4 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -106,29 +106,20 @@ void VersionControlEditorPlugin::_initialize_vcs() { register_editor(); - if (EditorVCSInterface::get_singleton()) { - - ERR_EXPLAIN(EditorVCSInterface::get_singleton()->get_vcs_name() + " is already active"); - return; - } + ERR_FAIL_COND_MSG(EditorVCSInterface::get_singleton(), EditorVCSInterface::get_singleton()->get_vcs_name() + " is already active"); const int id = set_up_choice->get_selected_id(); String selected_addon = set_up_choice->get_item_text(id); String path = ScriptServer::get_global_class_path(selected_addon); Ref<Script> script = ResourceLoader::load(path); - if (!script.is_valid()) { - ERR_EXPLAIN("VCS Addon path is invalid"); - } + ERR_FAIL_COND_MSG(!script.is_valid(), "VCS Addon path is invalid"); EditorVCSInterface *vcs_interface = memnew(EditorVCSInterface); ScriptInstance *addon_script_instance = script->instance_create(vcs_interface); - if (!addon_script_instance) { - ERR_FAIL_NULL(addon_script_instance); - return; - } + ERR_FAIL_COND_MSG(!addon_script_instance, "Failed to create addon script instance."); // The addon is attached as a script to the VCS interface as a proxy end-point vcs_interface->set_script_and_instance(script.get_ref_ptr(), addon_script_instance); @@ -137,10 +128,8 @@ void VersionControlEditorPlugin::_initialize_vcs() { EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_refresh_stage_area"); String res_dir = OS::get_singleton()->get_resource_dir(); - if (!EditorVCSInterface::get_singleton()->initialize(res_dir)) { - ERR_EXPLAIN("VCS was not initialized"); - } + ERR_FAIL_COND_MSG(!EditorVCSInterface::get_singleton()->initialize(res_dir), "VCS was not initialized"); _refresh_stage_area(); } @@ -397,8 +386,9 @@ void VersionControlEditorPlugin::clear_stage_area() { void VersionControlEditorPlugin::shut_down() { if (EditorVCSInterface::get_singleton()) { - - EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "_refresh_stage_area"); + if (EditorFileSystem::get_singleton()->is_connected("filesystem_changed", this, "_refresh_stage_area")) { + EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "_refresh_stage_area"); + } EditorVCSInterface::get_singleton()->shut_down(); memdelete(EditorVCSInterface::get_singleton()); EditorVCSInterface::set_singleton(NULL); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 3a9e48cfdb..1a74779fb5 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -109,11 +109,12 @@ void VisualShaderEditor::clear_custom_types() { for (int i = 0; i < add_options.size(); i++) { if (add_options[i].is_custom) { add_options.remove(i); + i--; } } } -void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_sub_category) { +void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_subcategory) { ERR_FAIL_COND(!p_name.is_valid_identifier()); ERR_FAIL_COND(!p_script.is_valid()); @@ -131,9 +132,25 @@ void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script> ao.return_type = p_return_icon_type; ao.description = p_description; ao.category = p_category; - ao.sub_category = p_sub_category; + ao.sub_category = p_subcategory; ao.is_custom = true; + bool begin = false; + + for (int i = 0; i < add_options.size(); i++) { + if (add_options[i].is_custom) { + if (add_options[i].category == p_category) { + if (!begin) { + begin = true; + } + } else { + if (begin) { + add_options.insert(i, ao); + return; + } + } + } + } add_options.push_back(ao); } @@ -184,6 +201,7 @@ void VisualShaderEditor::update_custom_nodes() { clear_custom_types(); List<StringName> class_list; ScriptServer::get_global_class_list(&class_list); + Dictionary added; for (int i = 0; i < class_list.size(); i++) { if (ScriptServer::get_global_class_native_base(class_list[i]) == "VisualShaderNodeCustom") { @@ -222,14 +240,44 @@ void VisualShaderEditor::update_custom_nodes() { category = "Custom"; } - String sub_category = ""; + String subcategory = ""; if (ref->has_method("_get_subcategory")) { - sub_category = (String)ref->call("_get_subcategory"); + subcategory = (String)ref->call("_get_subcategory"); } - add_custom_type(name, script, description, return_icon_type, category, sub_category); + Dictionary dict; + dict["name"] = name; + dict["script"] = script; + dict["description"] = description; + dict["return_icon_type"] = return_icon_type; + dict["category"] = category; + dict["subcategory"] = subcategory; + + String key; + key = category; + key += "/"; + if (subcategory != "") { + key += subcategory; + key += "/"; + } + key += name; + + added[key] = dict; } } + + Array keys = added.keys(); + keys.sort(); + + for (int i = 0; i < keys.size(); i++) { + + const Variant &key = keys.get(i); + + const Dictionary &value = (Dictionary)added[key]; + + add_custom_type(value["name"], value["script"], value["description"], value["return_icon_type"], value["category"], value["subcategory"]); + } + _update_options_menu(); } @@ -2414,7 +2462,7 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Darken", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Darken operator."), VisualShaderNodeColorOp::OP_DARKEN, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Difference", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Difference operator."), VisualShaderNodeColorOp::OP_DIFFERENCE, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Dodge", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Dodge operator."), VisualShaderNodeColorOp::OP_DODGE, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("HardLight", "Color", "Operators", "VisualShaderNodeColorOp", TTR("HardLight operator"), VisualShaderNodeColorOp::OP_HARD_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("HardLight", "Color", "Operators", "VisualShaderNodeColorOp", TTR("HardLight operator."), VisualShaderNodeColorOp::OP_HARD_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Lighten", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Lighten operator."), VisualShaderNodeColorOp::OP_LIGHTEN, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Overlay", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Overlay operator."), VisualShaderNodeColorOp::OP_OVERLAY, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Screen", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Screen operator."), VisualShaderNodeColorOp::OP_SCREEN, VisualShaderNode::PORT_TYPE_VECTOR)); @@ -2483,9 +2531,11 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Alpha", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "alpha"), "alpha", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); add_options.push_back(AddOption("Binormal", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "binormal"), "binormal", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); add_options.push_back(AddOption("Color", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "color"), "color", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("DepthTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "depth_texture"), "depth_texture", VisualShaderNode::PORT_TYPE_SAMPLER, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); add_options.push_back(AddOption("FragCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord"), "fragcoord", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); add_options.push_back(AddOption("FrontFacing", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "front_facing"), "front_facing", VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); add_options.push_back(AddOption("PointCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "point_coord"), "point_coord", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ScreenTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_texture"), "screen_texture", VisualShaderNode::PORT_TYPE_SAMPLER, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); add_options.push_back(AddOption("ScreenUV", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_uv"), "screen_uv", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); add_options.push_back(AddOption("Side", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "side"), "side", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); add_options.push_back(AddOption("Tangent", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "tangent"), "tangent", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SPATIAL)); @@ -2519,9 +2569,12 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("FragCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord"), "fragcoord", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("LightPass", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "light_pass"), "light_pass", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("NormalTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "normal_texture"), "normal_texture", VisualShaderNode::PORT_TYPE_SAMPLER, VisualShader::TYPE_FRAGMENT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("PointCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "point_coord"), "point_coord", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("ScreenPixelSize", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_pixel_size"), "screen_pixel_size", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("ScreenTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_texture"), "screen_texture", VisualShaderNode::PORT_TYPE_SAMPLER, VisualShader::TYPE_FRAGMENT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("ScreenUV", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "screen_uv"), "screen_uv", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Texture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "texture"), "texture", VisualShaderNode::PORT_TYPE_SAMPLER, VisualShader::TYPE_FRAGMENT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("FragCoord", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord"), "fragcoord", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_LIGHT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("LightAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_alpha"), "light_alpha", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_LIGHT, Shader::MODE_CANVAS_ITEM)); @@ -2533,6 +2586,7 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("PointCoord", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "point_coord"), "point_coord", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_LIGHT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("ScreenUV", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "screen_uv"), "screen_uv", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_LIGHT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("ShadowColor", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "shadow_color"), "shadow_color", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Texture", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "texture"), "texture", VisualShaderNode::PORT_TYPE_SAMPLER, VisualShader::TYPE_LIGHT, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("Extra", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "extra"), "extra", VisualShaderNode::PORT_TYPE_TRANSFORM, VisualShader::TYPE_VERTEX, Shader::MODE_CANVAS_ITEM)); add_options.push_back(AddOption("LightPass", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "light_pass"), "light_pass", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_VERTEX, Shader::MODE_CANVAS_ITEM)); @@ -2726,7 +2780,7 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Expression", "Special", "", "VisualShaderNodeExpression", TTR("Custom Godot Shader Language expression, with custom amount of input and output ports. This is a direct injection of code into the vertex/fragment/light function, do not use it to write the function declarations inside."))); add_options.push_back(AddOption("Fresnel", "Special", "", "VisualShaderNodeFresnel", TTR("Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it)."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("GlobalExpression", "Special", "", "VisualShaderNodeGlobalExpression", TTR("Custom Godot Shader Language expression, which placed on top of the resulted shader. You can place various function definitions inside and call it later in the Expressions. You can also declare varyings, uniforms and constants."))); + add_options.push_back(AddOption("GlobalExpression", "Special", "", "VisualShaderNodeGlobalExpression", TTR("Custom Godot Shader Language expression, which is placed on top of the resulted shader. You can place various function definitions inside and call it later in the Expressions. You can also declare varyings, uniforms and constants."))); add_options.push_back(AddOption("ScalarDerivativeFunc", "Special", "Common", "VisualShaderNodeScalarDerivativeFunc", TTR("(Fragment/Light mode only) Scalar derivative function."), -1, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true)); add_options.push_back(AddOption("VectorDerivativeFunc", "Special", "Common", "VisualShaderNodeVectorDerivativeFunc", TTR("(Fragment/Light mode only) Vector derivative function."), -1, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true)); @@ -2830,11 +2884,12 @@ public: void setup(const Ref<VisualShaderNodeInput> &p_input) { input = p_input; - Ref<Texture> type_icon[4] = { + Ref<Texture> type_icon[5] = { EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons"), EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons"), EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons"), EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons"), + EditorNode::get_singleton()->get_gui_base()->get_icon("ImageTexture", "EditorIcons"), }; add_item("[None]"); diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index 6f77641936..5197f8c77f 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -264,7 +264,7 @@ public: static VisualShaderEditor *get_singleton() { return singleton; } void clear_custom_types(); - void add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_sub_category); + void add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_subcategory); virtual Size2 get_minimum_size() const; void edit(VisualShader *p_visual_shader); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index d903e153a7..ab62a59be1 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1023,6 +1023,7 @@ public: ProjectList(); ~ProjectList(); + void update_dock_menu(); void load_projects(); void set_search_term(String p_search_term); void set_order_option(ProjectListFilter::FilterOption p_option); @@ -1210,7 +1211,6 @@ void ProjectList::load_projects() { _projects.clear(); _last_clicked = ""; _selected_project_keys.clear(); - OS::get_singleton()->global_menu_clear("_dock"); // Load data // TODO Would be nice to change how projects and favourites are stored... it complicates things a bit. @@ -1248,14 +1248,38 @@ void ProjectList::load_projects() { create_project_item_control(i); } - OS::get_singleton()->global_menu_add_separator("_dock"); - OS::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), GLOBAL_NEW_WINDOW, Variant()); - sort_projects(); set_v_scroll(0); update_icons_async(); + + update_dock_menu(); +} + +void ProjectList::update_dock_menu() { + OS::get_singleton()->global_menu_clear("_dock"); + + int favs_added = 0; + int total_added = 0; + for (int i = 0; i < _projects.size(); ++i) { + if (!_projects[i].grayed && !_projects[i].missing) { + if (_projects[i].favorite) { + favs_added++; + } else { + if (favs_added != 0) { + OS::get_singleton()->global_menu_add_separator("_dock"); + } + favs_added = 0; + } + OS::get_singleton()->global_menu_add_item("_dock", _projects[i].project_name + " ( " + _projects[i].path + " )", GLOBAL_OPEN_PROJECT, Variant(_projects[i].path.plus_file("project.godot"))); + total_added++; + } + } + if (total_added != 0) { + OS::get_singleton()->global_menu_add_separator("_dock"); + } + OS::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), GLOBAL_NEW_WINDOW, Variant()); } void ProjectList::create_project_item_control(int p_index) { @@ -1341,7 +1365,6 @@ void ProjectList::create_project_item_control(int p_index) { fpath->set_clip_text(true); _scroll_children->add_child(hb); - OS::get_singleton()->global_menu_add_item("_dock", item.project_name + " ( " + item.path + " )", GLOBAL_OPEN_PROJECT, Variant(item.path.plus_file("project.godot"))); item.control = hb; } @@ -1394,6 +1417,8 @@ void ProjectList::sort_projects() { // Rewind the coroutine because order of projects changed update_icons_async(); + + update_dock_menu(); } const Set<String> &ProjectList::get_selected_project_keys() const { @@ -1470,6 +1495,8 @@ void ProjectList::remove_project(int p_index, bool p_update_settings) { EditorSettings::get_singleton()->erase("favorite_projects/" + item.project_key); // Not actually saving the file, in case you are doing more changes to settings } + + update_dock_menu(); } bool ProjectList::is_any_project_missing() const { @@ -1568,6 +1595,7 @@ int ProjectList::refresh_project(const String &dir_path) { ensure_project_visible(i); } load_project_icon(i); + index = i; break; } @@ -1642,6 +1670,8 @@ void ProjectList::erase_selected_projects() { _selected_project_keys.clear(); _last_clicked = ""; + + update_dock_menu(); } // Draws selected project highlight @@ -1725,6 +1755,8 @@ void ProjectList::_favorite_pressed(Node *p_hb) { } } } + + update_dock_menu(); } void ProjectList::_show_project(const String &p_path) { @@ -1929,6 +1961,8 @@ void ProjectManager::_on_projects_updated() { if (index != -1) { _project_list->ensure_project_visible(index); } + + _project_list->update_dock_menu(); } void ProjectManager::_on_project_created(const String &dir) { @@ -1937,6 +1971,8 @@ void ProjectManager::_on_project_created(const String &dir) { _project_list->select_project(i); _project_list->ensure_project_visible(i); _open_selected_projects_ask(); + + _project_list->update_dock_menu(); } void ProjectManager::_confirm_update_settings() { diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 803c806028..9ac775e456 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -442,15 +442,7 @@ void ProjectSettingsEditor::_wait_for_key(const Ref<InputEvent> &p_event) { if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) { last_wait_for_key = p_event; - String str = keycode_get_string(k->get_scancode()).capitalize(); - if (k->get_metakey()) - str = vformat("%s+", find_keycode_name(KEY_META)) + str; - if (k->get_shift()) - str = TTR("Shift+") + str; - if (k->get_alt()) - str = TTR("Alt+") + str; - if (k->get_control()) - str = TTR("Control+") + str; + const String str = keycode_get_string(k->get_scancode_with_modifiers()); press_a_key_label->set_text(str); press_a_key->accept_event(); @@ -740,15 +732,7 @@ void ProjectSettingsEditor::_update_actions() { Ref<InputEventKey> k = event; if (k.is_valid()) { - String str = keycode_get_string(k->get_scancode()).capitalize(); - if (k->get_metakey()) - str = vformat("%s+", find_keycode_name(KEY_META)) + str; - if (k->get_shift()) - str = TTR("Shift+") + str; - if (k->get_alt()) - str = TTR("Alt+") + str; - if (k->get_control()) - str = TTR("Control+") + str; + const String str = keycode_get_string(k->get_scancode_with_modifiers()); action2->set_text(0, str); action2->set_icon(0, get_icon("Keyboard", "EditorIcons")); @@ -845,9 +829,10 @@ void ProjectSettingsEditor::_item_adds(String) { void ProjectSettingsEditor::_item_add() { - // Initialize the property with the default value for the given type + // Initialize the property with the default value for the given type. + // The type list starts at 1 (as we exclude Nil), so add 1 to the selected value. Variant::CallError ce; - const Variant value = Variant::construct(Variant::Type(type->get_selected()), NULL, 0, ce); + const Variant value = Variant::construct(Variant::Type(type->get_selected() + 1), NULL, 0, ce); String catname = category->get_text().strip_edges(); String propname = property->get_text().strip_edges(); @@ -1545,28 +1530,33 @@ void ProjectSettingsEditor::_update_translations() { Array l_filter = l_filter_all[1]; int s = names.size(); - if (!translation_locales_list_created) { + bool is_short_list_when_show_all_selected = filter_mode == SHOW_ALL_LOCALES && translation_filter_treeitems.size() < s; + bool is_full_list_when_show_only_selected = filter_mode == SHOW_ONLY_SELECTED_LOCALES && translation_filter_treeitems.size() == s; + bool should_recreate_locales_list = is_short_list_when_show_all_selected || is_full_list_when_show_only_selected; + + if (!translation_locales_list_created || should_recreate_locales_list) { translation_locales_list_created = true; translation_filter->clear(); root = translation_filter->create_item(NULL); translation_filter->set_hide_root(true); - translation_filter_treeitems.resize(s); - + translation_filter_treeitems.clear(); for (int i = 0; i < s; i++) { String n = names[i]; String l = langs[i]; + bool is_checked = l_filter.has(l); + if (filter_mode == SHOW_ONLY_SELECTED_LOCALES && !is_checked) continue; + TreeItem *t = translation_filter->create_item(root); t->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); t->set_text(0, n); t->set_editable(0, true); t->set_tooltip(0, l); - t->set_checked(0, l_filter.has(l)); - translation_filter_treeitems.write[i] = t; + t->set_checked(0, is_checked); + translation_filter_treeitems.push_back(t); } } else { - for (int i = 0; i < s; i++) { - + for (int i = 0; i < translation_filter_treeitems.size(); i++) { TreeItem *t = translation_filter_treeitems[i]; t->set_checked(0, l_filter.has(t->get_tooltip(0))); } @@ -1835,7 +1825,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { // Start at 1 to avoid adding "Nil" as an option for (int i = 1; i < Variant::VARIANT_MAX; i++) { - type->add_item(Variant::get_type_name(Variant::Type(i)), i); + type->add_item(Variant::get_type_name(Variant::Type(i))); } Button *add = memnew(Button); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index ecb272876d..ce82d44164 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -246,7 +246,13 @@ void CustomPropertyEditor::_menu_option(int p_which) { case OBJ_MENU_NEW_SCRIPT: { if (Object::cast_to<Node>(owner)) - EditorNode::get_singleton()->get_scene_tree_dock()->open_script_dialog(Object::cast_to<Node>(owner)); + EditorNode::get_singleton()->get_scene_tree_dock()->open_script_dialog(Object::cast_to<Node>(owner), false); + + } break; + case OBJ_MENU_EXTEND_SCRIPT: { + + if (Object::cast_to<Node>(owner)) + EditorNode::get_singleton()->get_scene_tree_dock()->open_script_dialog(Object::cast_to<Node>(owner), true); } break; case OBJ_MENU_SHOW_IN_FILE_SYSTEM: { diff --git a/editor/property_editor.h b/editor/property_editor.h index 029c2211d5..b1c61c5e25 100644 --- a/editor/property_editor.h +++ b/editor/property_editor.h @@ -77,7 +77,8 @@ class CustomPropertyEditor : public Popup { OBJ_MENU_COPY = 4, OBJ_MENU_PASTE = 5, OBJ_MENU_NEW_SCRIPT = 6, - OBJ_MENU_SHOW_IN_FILE_SYSTEM = 7, + OBJ_MENU_EXTEND_SCRIPT = 7, + OBJ_MENU_SHOW_IN_FILE_SYSTEM = 8, TYPE_BASE_ID = 100, CONVERT_BASE_ID = 1000 }; diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 98ab1bfb54..5c08482aa4 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -340,8 +340,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!profile_allow_editing) { break; } - Tree *tree = scene_tree->get_scene_tree(); - if (tree->is_anything_selected()) { + if (editor_selection->get_selected_node_list().size() > 1) { rename_dialog->popup_centered(); } } break; @@ -421,53 +420,11 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { create_dialog->popup_create(false, true, selected->get_class()); } break; + case TOOL_EXTEND_SCRIPT: { + attach_script_to_selected(true); + } break; case TOOL_ATTACH_SCRIPT: { - - if (!profile_allow_script_editing) { - break; - } - - List<Node *> selection = editor_selection->get_selected_node_list(); - if (selection.empty()) - break; - - Node *selected = scene_tree->get_selected(); - if (!selected) - selected = selection.front()->get(); - - Ref<Script> existing = selected->get_script(); - - String path = selected->get_filename(); - if (path == "") { - String root_path = editor_data->get_edited_scene_root()->get_filename(); - if (root_path == "") { - path = String("res://").plus_file(selected->get_name()); - } else { - path = root_path.get_base_dir().plus_file(selected->get_name()); - } - } - - String inherits = selected->get_class(); - if (existing.is_valid()) { - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - ScriptLanguage *l = ScriptServer::get_language(i); - if (l->get_type() == existing->get_class()) { - String name = l->get_global_class_name(existing->get_path()); - if (ScriptServer::is_global_class(name) && EDITOR_GET("interface/editors/derive_script_globals_by_name").operator bool()) { - inherits = name; - } else if (l->can_inherit_from_file()) { - inherits = "\"" + existing->get_path() + "\""; - } - break; - } - } - } - script_create_dialog->connect("script_created", this, "_script_created"); - script_create_dialog->connect("popup_hide", this, "_script_creation_closed"); - script_create_dialog->set_inheritance_base_type("Node"); - script_create_dialog->config(inherits, path); - script_create_dialog->popup_centered(); - + attach_script_to_selected(false); } break; case TOOL_CLEAR_SCRIPT: { @@ -1081,7 +1038,6 @@ void SceneTreeDock::_node_collapsed(Object *p_obj) { void SceneTreeDock::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_READY: { if (!first_enter) @@ -1142,8 +1098,7 @@ void SceneTreeDock::_notification(int p_what) { button_2d->set_text(TTR("2D Scene")); button_2d->set_icon(get_icon("Node2D", "EditorIcons")); button_2d->connect("pressed", this, "_tool_selected", make_binds(TOOL_CREATE_2D_SCENE, false)); - - Button *button_3d = memnew(Button); + button_3d = memnew(Button); beginner_node_shortcuts->add_child(button_3d); button_3d->set_text(TTR("3D Scene")); button_3d->set_icon(get_icon("Spatial", "EditorIcons")); @@ -2446,6 +2401,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { } List<Node *> selection = editor_selection->get_selected_node_list(); + List<Node *> full_selection = editor_selection->get_full_selected_node_list(); // Above method only returns nodes with common parent. if (selection.size() == 0) return; @@ -2480,22 +2436,40 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { } if (profile_allow_script_editing) { + bool add_separator = false; - if (selection.size() == 1) { - if (!existing_script.is_valid()) { - menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT); - } else { - menu->add_icon_shortcut(get_icon("ScriptExtend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_ATTACH_SCRIPT); + if (full_selection.size() == 1) { + add_separator = true; + menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT); + if (existing_script.is_valid()) { + menu->add_icon_shortcut(get_icon("ScriptExtend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_EXTEND_SCRIPT); } } - if (selection.size() > 1 || (existing_script.is_valid() && exisiting_script_removable)) { + if (existing_script.is_valid() && exisiting_script_removable) { + add_separator = true; menu->add_icon_shortcut(get_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT); + } else if (full_selection.size() > 1) { + bool script_exists = false; + for (List<Node *>::Element *E = full_selection.front(); E; E = E->next()) { + if (!E->get()->get_script().is_null()) { + script_exists = true; + break; + } + } + + if (script_exists) { + add_separator = true; + menu->add_icon_shortcut(get_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT); + } + } + + if (add_separator) { + menu->add_separator(); } - menu->add_separator(); } if (profile_allow_editing) { - if (selection.size() == 1) { + if (full_selection.size() == 1) { menu->add_icon_shortcut(get_icon("Rename", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/rename"), TOOL_RENAME); } menu->add_icon_shortcut(get_icon("Reload", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/change_node_type"), TOOL_REPLACE); @@ -2507,7 +2481,9 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->add_icon_shortcut(get_icon("Duplicate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/duplicate"), TOOL_DUPLICATE); menu->add_icon_shortcut(get_icon("Reparent", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/reparent"), TOOL_REPARENT); menu->add_icon_shortcut(get_icon("ReparentToNewNode", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/reparent_to_new_node"), TOOL_REPARENT_TO_NEW_NODE); - menu->add_icon_shortcut(get_icon("NewRoot", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/make_root"), TOOL_MAKE_ROOT); + if (selection.size() == 1) { + menu->add_icon_shortcut(get_icon("NewRoot", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/make_root"), TOOL_MAKE_ROOT); + } } } if (selection.size() == 1) { @@ -2516,9 +2492,11 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->add_separator(); menu->add_icon_shortcut(get_icon("Blend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/merge_from_scene"), TOOL_MERGE_FROM_SCENE); menu->add_icon_shortcut(get_icon("CreateNewSceneFrom", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/save_branch_as_scene"), TOOL_NEW_SCENE_FROM); + } + if (full_selection.size() == 1) { menu->add_separator(); + menu->add_icon_shortcut(get_icon("CopyNodePath", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/copy_node_path"), TOOL_COPY_NODE_PATH); } - menu->add_icon_shortcut(get_icon("CopyNodePath", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/copy_node_path"), TOOL_COPY_NODE_PATH); bool is_external = (selection[0]->get_filename() != ""); if (is_external) { @@ -2595,10 +2573,64 @@ void SceneTreeDock::_focus_node() { } } -void SceneTreeDock::open_script_dialog(Node *p_for_node) { +void SceneTreeDock::attach_script_to_selected(bool p_extend) { + if (!profile_allow_script_editing) { + return; + } + + List<Node *> selection = editor_selection->get_selected_node_list(); + if (selection.empty()) + return; + + Node *selected = scene_tree->get_selected(); + if (!selected) + selected = selection.front()->get(); + + Ref<Script> existing = selected->get_script(); + + String path = selected->get_filename(); + if (path == "") { + String root_path = editor_data->get_edited_scene_root()->get_filename(); + if (root_path == "") { + path = String("res://").plus_file(selected->get_name()); + } else { + path = root_path.get_base_dir().plus_file(selected->get_name()); + } + } + + String inherits = selected->get_class(); + + if (p_extend && existing.is_valid()) { + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + ScriptLanguage *l = ScriptServer::get_language(i); + if (l->get_type() == existing->get_class()) { + String name = l->get_global_class_name(existing->get_path()); + if (ScriptServer::is_global_class(name) && EDITOR_GET("interface/editors/derive_script_globals_by_name").operator bool()) { + inherits = name; + } else if (l->can_inherit_from_file()) { + inherits = "\"" + existing->get_path() + "\""; + } + break; + } + } + } + + script_create_dialog->connect("script_created", this, "_script_created"); + script_create_dialog->connect("popup_hide", this, "_script_creation_closed"); + script_create_dialog->set_inheritance_base_type("Node"); + script_create_dialog->config(inherits, path); + script_create_dialog->popup_centered(); +} + +void SceneTreeDock::open_script_dialog(Node *p_for_node, bool p_extend) { scene_tree->set_selected(p_for_node, false); - _tool_selected(TOOL_ATTACH_SCRIPT); + + if (p_extend) { + _tool_selected(TOOL_EXTEND_SCRIPT); + } else { + _tool_selected(TOOL_ATTACH_SCRIPT); + } } void SceneTreeDock::add_remote_tree_editor(Control *p_remote) { @@ -2718,12 +2750,15 @@ void SceneTreeDock::_feature_profile_changed() { profile_allow_editing = !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCENE_TREE); profile_allow_script_editing = !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCRIPT); + bool profile_allow_3d = !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D); + button_3d->set_visible(profile_allow_3d); button_add->set_visible(profile_allow_editing); button_instance->set_visible(profile_allow_editing); scene_tree->set_can_rename(profile_allow_editing); } else { + button_3d->set_visible(true); button_add->set_visible(true); button_instance->set_visible(true); scene_tree->set_can_rename(true); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 014ce58e88..56fbb86824 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -64,6 +64,7 @@ class SceneTreeDock : public VBoxContainer { TOOL_RENAME, TOOL_BATCH_RENAME, TOOL_REPLACE, + TOOL_EXTEND_SCRIPT, TOOL_ATTACH_SCRIPT, TOOL_CLEAR_SCRIPT, TOOL_MOVE_UP, @@ -111,6 +112,8 @@ class SceneTreeDock : public VBoxContainer { ToolButton *button_create_script; ToolButton *button_clear_script; + Button *button_3d; + HBoxContainer *button_hb; ToolButton *edit_local, *edit_remote; SceneTreeEditor *scene_tree; @@ -259,7 +262,8 @@ public: void replace_node(Node *p_node, Node *p_by_node, bool p_keep_properties = true, bool p_remove_old = true); - void open_script_dialog(Node *p_for_node); + void attach_script_to_selected(bool p_extend); + void open_script_dialog(Node *p_for_node, bool p_extend); ScriptCreateDialog *get_script_create_dialog() { return script_create_dialog; } diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 89d275a90b..afbd8832f2 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -33,6 +33,8 @@ #include "core/io/marshalls.h" #include "core/project_settings.h" #include "core/ustring.h" +#include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/plugins/spatial_editor_plugin.h" #include "editor_network_profiler.h" #include "editor_node.h" #include "editor_profiler.h" @@ -597,10 +599,30 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da if (var.is_zero()) { var = RES(); } else if (var.get_type() == Variant::STRING) { - var = ResourceLoader::load(var); - - if (pinfo.hint_string == "Script") - debugObj->set_script(var); + String path = var; + if (path.find("::") != -1) { + // built-in resource + String base_path = path.get_slice("::", 0); + if (ResourceLoader::get_resource_type(base_path) == "PackedScene") { + if (!EditorNode::get_singleton()->is_scene_open(base_path)) { + EditorNode::get_singleton()->load_scene(base_path); + } + } else { + EditorNode::get_singleton()->load_resource(base_path); + } + } + var = ResourceLoader::load(path); + + if (pinfo.hint_string == "Script") { + if (debugObj->get_script() != var) { + debugObj->set_script(RefPtr()); + Ref<Script> script(var); + if (!script.is_null()) { + ScriptInstance *script_instance = script->placeholder_instance_create(debugObj); + debugObj->set_script_and_instance(var, script_instance); + } + } + } } else if (var.get_type() == Variant::OBJECT) { if (((Object *)var)->is_class("EncodedObjectAsID")) { var = Object::cast_to<EncodedObjectAsID>(var)->get_object_id(); @@ -1212,6 +1234,42 @@ void ScriptEditorDebugger::_notification(int p_what) { } } } + + if (camera_override == OVERRIDE_2D) { + CanvasItemEditor *editor = CanvasItemEditor::get_singleton(); + + Dictionary state = editor->get_state(); + float zoom = state["zoom"]; + Point2 offset = state["ofs"]; + Transform2D transform; + + transform.scale_basis(Size2(zoom, zoom)); + transform.elements[2] = -offset * zoom; + + Array msg; + msg.push_back("override_camera_2D:transform"); + msg.push_back(transform); + ppeer->put_var(msg); + + } else if (camera_override >= OVERRIDE_3D_1) { + int viewport_idx = camera_override - OVERRIDE_3D_1; + SpatialEditorViewport *viewport = SpatialEditor::get_singleton()->get_editor_viewport(viewport_idx); + Camera *const cam = viewport->get_camera(); + + Array msg; + msg.push_back("override_camera_3D:transform"); + msg.push_back(cam->get_camera_transform()); + if (cam->get_projection() == Camera::PROJECTION_ORTHOGONAL) { + msg.push_back(false); + msg.push_back(cam->get_size()); + } else { + msg.push_back(true); + msg.push_back(cam->get_fov()); + } + msg.push_back(cam->get_znear()); + msg.push_back(cam->get_zfar()); + ppeer->put_var(msg); + } } if (error_count != last_error_count || warning_count != last_warning_count) { @@ -1426,6 +1484,7 @@ void ScriptEditorDebugger::start() { set_process(true); breaked = false; + camera_override = OVERRIDE_NONE; } void ScriptEditorDebugger::pause() { @@ -1870,6 +1929,45 @@ void ScriptEditorDebugger::live_debug_reparent_node(const NodePath &p_at, const } } +ScriptEditorDebugger::CameraOverride ScriptEditorDebugger::get_camera_override() const { + return camera_override; +} + +void ScriptEditorDebugger::set_camera_override(CameraOverride p_override) { + + if (p_override == OVERRIDE_2D && camera_override != OVERRIDE_2D) { + if (connection.is_valid()) { + Array msg; + msg.push_back("override_camera_2D:set"); + msg.push_back(true); + ppeer->put_var(msg); + } + } else if (p_override != OVERRIDE_2D && camera_override == OVERRIDE_2D) { + if (connection.is_valid()) { + Array msg; + msg.push_back("override_camera_2D:set"); + msg.push_back(false); + ppeer->put_var(msg); + } + } else if (p_override >= OVERRIDE_3D_1 && camera_override < OVERRIDE_3D_1) { + if (connection.is_valid()) { + Array msg; + msg.push_back("override_camera_3D:set"); + msg.push_back(true); + ppeer->put_var(msg); + } + } else if (p_override < OVERRIDE_3D_1 && camera_override >= OVERRIDE_3D_1) { + if (connection.is_valid()) { + Array msg; + msg.push_back("override_camera_3D:set"); + msg.push_back(false); + ppeer->put_var(msg); + } + } + + camera_override = p_override; +} + void ScriptEditorDebugger::set_breakpoint(const String &p_path, int p_line, bool p_enabled) { if (connection.is_valid()) { @@ -2404,6 +2502,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { info_message->set_valign(Label::VALIGN_CENTER); info_message->set_align(Label::ALIGN_CENTER); info_message->set_autowrap(true); + info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); info_message->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); perf_draw->add_child(info_message); } diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index cc284476c0..14b024d066 100644 --- a/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h @@ -35,6 +35,7 @@ #include "core/io/tcp_server.h" #include "editor/editor_inspector.h" #include "editor/property_editor.h" +#include "scene/3d/camera.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" @@ -58,6 +59,17 @@ class ScriptEditorDebugger : public Control { GDCLASS(ScriptEditorDebugger, Control); +public: + enum CameraOverride { + OVERRIDE_NONE, + OVERRIDE_2D, + OVERRIDE_3D_1, // 3D Viewport 1 + OVERRIDE_3D_2, // 3D Viewport 2 + OVERRIDE_3D_3, // 3D Viewport 3 + OVERRIDE_3D_4 // 3D Viewport 4 + }; + +private: enum MessageType { MESSAGE_ERROR, MESSAGE_WARNING, @@ -165,6 +177,8 @@ class ScriptEditorDebugger : public Control { bool live_debug; + CameraOverride camera_override; + void _performance_draw(); void _performance_select(); void _stack_dump_frame_selected(); @@ -250,6 +264,9 @@ public: void live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name); void live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos); + CameraOverride get_camera_override() const; + void set_camera_override(CameraOverride p_override); + void set_breakpoint(const String &p_path, int p_line, bool p_enabled); void update_live_edit_root(); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index f8425ebe22..a38c6b98cc 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -310,15 +310,7 @@ void EditorSettingsDialog::_wait_for_key(const Ref<InputEvent> &p_event) { if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) { last_wait_for_key = k; - String str = keycode_get_string(k->get_scancode()).capitalize(); - if (k->get_metakey()) - str = vformat("%s+", find_keycode_name(KEY_META)) + str; - if (k->get_shift()) - str = TTR("Shift+") + str; - if (k->get_alt()) - str = TTR("Alt+") + str; - if (k->get_control()) - str = TTR("Control+") + str; + const String str = keycode_get_string(k->get_scancode_with_modifiers()); press_a_key_label->set_text(str); press_a_key->accept_event(); diff --git a/editor/translations/af.po b/editor/translations/af.po index 0fa3736468..131ecd5c0d 100644 --- a/editor/translations/af.po +++ b/editor/translations/af.po @@ -376,6 +376,7 @@ msgstr "Skep %d NUWE bane en voeg sleutels by?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Skep" @@ -507,16 +508,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Dupliseer Seleksie" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -659,8 +650,9 @@ msgid "Scale Ratio:" msgstr "Skaal Verhouding:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "Stel Oorgange na:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -671,6 +663,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Dupliseer Seleksie" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1012,7 +1009,7 @@ msgid "Resource" msgstr "Hulpbron" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Pad" @@ -1493,7 +1490,8 @@ msgstr "Voeg AutoLaai By" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Pad:" @@ -1548,7 +1546,7 @@ msgstr "Skep Vouer" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Naam:" @@ -1960,6 +1958,7 @@ msgid "Class:" msgstr "Klas:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Erf:" @@ -2985,7 +2984,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3225,6 +3224,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3251,14 +3254,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Afhanklikheid Bewerker" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4074,7 +4069,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4216,6 +4211,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Afhanklikheid Bewerker" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4578,7 +4580,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4756,6 +4757,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4963,6 +4966,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Ek sien..." @@ -5255,20 +5262,23 @@ msgid "Ruler Mode" msgstr "Wissel Modus" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5359,8 +5369,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5629,6 +5638,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6268,6 +6281,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6324,6 +6341,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6432,6 +6450,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Eienskappe" @@ -6712,6 +6735,11 @@ msgstr "Skep" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6770,10 +6798,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Vind" @@ -7106,6 +7130,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7139,6 +7167,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7371,6 +7403,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8177,12 +8213,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "Afvoer:" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8197,6 +8230,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Gunstelinge:" @@ -9073,12 +9110,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10078,11 +10117,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10159,6 +10196,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Opnoemings" @@ -10177,10 +10222,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "Skep Nuwe" @@ -10418,24 +10459,18 @@ msgid "Will load an existing script file." msgstr "Laai 'n bestaande Bus Uitleg." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Klas:" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Afhanklikheid Bewerker" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11085,6 +11120,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Hernoem AutoLaai" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11093,6 +11133,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Gunstelinge:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Gunstelinge:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Hernoem AutoLaai" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Verwyder Seleksie" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11133,10 +11193,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11162,6 +11232,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Ontkoppel" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Koppel aan Nodus:" @@ -11195,6 +11270,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Skep Nuwe" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11219,15 +11315,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Lede:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -11252,6 +11344,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Maak Funksie" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Verfris" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Lede" @@ -11347,6 +11449,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11448,6 +11554,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11996,10 +12106,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" @@ -12157,9 +12263,6 @@ msgstr "" #~ msgid "Move Anim Track Down" #~ msgstr "Skuif Anim Baan Af" -#~ msgid "Set Transitions to:" -#~ msgstr "Stel Oorgange na:" - #~ msgid "Anim Track Rename" #~ msgstr "Anim Baan Hernoem" diff --git a/editor/translations/ar.po b/editor/translations/ar.po index 5d6e0bd606..a4133403a1 100644 --- a/editor/translations/ar.po +++ b/editor/translations/ar.po @@ -34,7 +34,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:51+0000\n" +"PO-Revision-Date: 2019-10-04 03:15+0000\n" "Last-Translator: Omar Aglan <omar.aglan91@yahoo.com>\n" "Language-Team: Arabic <https://hosted.weblate.org/projects/godot-engine/" "godot/ar/>\n" @@ -49,7 +49,7 @@ msgstr "" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." -msgstr "نوع برهان خاطئ خاص بconvert()ØŒ إستخدم ثوابت TYPE_*." +msgstr "نوع معامل خاطئ للدالة convert()ØŒ إستخدم ثوابت TYPE_*." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -59,72 +59,71 @@ msgstr "لا يوجد ما يكÙÙŠ من البايتات من أجل ÙÙƒ Ø§Ù„Ø #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "إدخال خاطيء i% (لم يتم تمريره) ÙÙŠ التصريØ" +msgstr "مدخلات خاطئة i% (لم يتم تمريره) ÙÙŠ التعبير" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" -msgstr "لا يمكن استخدام Ø§Ù„ØØ§Ù„Ø© لأن Ù„ØØ¸Ø© التشغيل عدم (لم بتم ارسالها)" +msgstr "لا يمكن إستخدامه Ù†ÙØ³Ù‡ لأن Ø§Ù„ØØ§Ù„Ø© ÙØ§Ø±ØºØ© (لم ÙŠÙمرر)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." -msgstr "معاملات غير ØµØ§Ù„ØØ© للتشغل s,%s% Ùˆ s%." +msgstr "معاملات غير ØµØ§Ù„ØØ© للمشغل sØŒ%s% Ùˆ s%." #: core/math/expression.cpp msgid "Invalid index of type %s for base type %s" -msgstr "الرمز غير Ù…ØªØ§Ø Ù„Ù„Ù†ÙˆØ¹ %s للنوع %s" +msgstr "Ùهرس غير صØÙŠØ للنوع %s التابع للنوع الأساسي %s" #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" -msgstr "أسم غير صØÙŠØ للÙهرس '%s' للنوع الأساسي %s" +msgstr "أسم Ùهرس غير صØÙŠØ '%s' للنوع الأساسي %s" #: core/math/expression.cpp msgid "Invalid arguments to construct '%s'" -msgstr "نقاش غير ØµØ§Ù„ØØ© للبناء '%s'" +msgstr "معامل غير ØµØ§Ù„Ø Ù„Ù„Ø¥Ù†Ø´Ø§Ø¡ '%s'" #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "عند الأستدعاء إلى '%s':" +msgstr "عند استدعاء '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "بايت" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "كيلوبايت" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "خلط" +msgstr "ميجابايت" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "جيجابايت" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "تيرابايت" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "بيتابايت" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "إكسابايت" #: editor/animation_bezier_editor.cpp msgid "Free" -msgstr "مجاني/ÙØ§Ø±Øº" +msgstr "ÙØ§Ø±Øº" #: editor/animation_bezier_editor.cpp msgid "Balanced" -msgstr "متوازن / متعادل" +msgstr "متعادل" #: editor/animation_bezier_editor.cpp msgid "Mirror" -msgstr "عكس / الإنعكاس" +msgstr "انعكاس" #: editor/animation_bezier_editor.cpp editor/editor_profiler.cpp msgid "Time:" @@ -136,23 +135,23 @@ msgstr "القيمة:" #: editor/animation_bezier_editor.cpp msgid "Insert Key Here" -msgstr "أدخل الرمز هنا" +msgstr "أدخل Ø§Ù„Ù…ÙØªØ§Ø هنا" #: editor/animation_bezier_editor.cpp msgid "Duplicate Selected Key(s)" -msgstr "تكرار Ø§Ù„Ù…ÙØ§ØªÙŠØ Ø§Ù„Ù…ØØ¯Ø¯(Ø©)" +msgstr "استنساخ Ø§Ù„Ù…ÙØ§ØªÙŠØ Ø§Ù„Ù…ØØ¯Ø¯(Ø©)" #: editor/animation_bezier_editor.cpp msgid "Delete Selected Key(s)" -msgstr "Ø¥Ù…Ø³Ø Ø§Ù„Ø²Ù…ÙˆØ² Ø§Ù„Ù…ØØ¯Ø¯(Ø©)" +msgstr "Ø¥Ù…Ø³Ø Ø§Ù„Ù…ÙØ§ØªÙŠØ Ø§Ù„Ù…ØØ¯Ø¯(Ø©)" #: editor/animation_bezier_editor.cpp msgid "Add Bezier Point" -msgstr "Ø¥Ø¶Ø§ÙØ© نقطة Bezier" +msgstr "Ø¥Ø¶Ø§ÙØ© نقطة بيزية" #: editor/animation_bezier_editor.cpp msgid "Move Bezier Points" -msgstr "ØªØØ±ÙŠÙƒ نقطة الBezier" +msgstr "ØªØØ±ÙŠÙƒ نقاط بيزية" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -168,7 +167,7 @@ msgstr "تغيير وقت الإطار الرئيسي Ù„Ù„ØØ±ÙƒØ©" #: editor/animation_track_editor.cpp msgid "Anim Change Transition" -msgstr "تغيير المقطع الإنتقالي" +msgstr "تغيير إنتقالية Ø§Ù„ØªØØ±ÙŠÙƒ" #: editor/animation_track_editor.cpp msgid "Anim Change Transform" @@ -383,6 +382,7 @@ msgstr "أنشئ %d مسارات جديدة Ùˆ أدخل Ù…ÙØ§ØªÙŠØØŸ" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "أنشئ" @@ -519,16 +519,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "ØªØØ¯ÙŠØ¯ الكل" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "ØªØØ¯ÙŠØ¯ الوضع" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -665,7 +655,8 @@ msgid "Scale Ratio:" msgstr "نسبة التكبير:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "ØØ¯Ø¯ مقاطع لنسخ:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -677,6 +668,11 @@ msgstr "ØØ¯Ø¯ مقاطع لنسخ:" msgid "Copy" msgstr "أنسخ" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "ØªØØ¯ÙŠØ¯ الوضع" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "أض٠مقطع صوت" @@ -1011,7 +1007,7 @@ msgid "Resource" msgstr "مورد" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "المسار" @@ -1482,7 +1478,8 @@ msgstr "Ø¥Ø¶Ø§ÙØ© للتØÙ…يل التلقائي" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "المسار:" @@ -1537,7 +1534,7 @@ msgstr "أنشئ مجلد" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "الأسم:" @@ -1960,6 +1957,7 @@ msgid "Class:" msgstr "صنÙ:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "يرث:" @@ -3048,7 +3046,7 @@ msgstr "Ù…ÙØ±Ø§Ù‚ب" msgid "Expand Bottom Panel" msgstr "توسيع الكل" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "الخرج" @@ -3291,6 +3289,11 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "ÙØªØ الكود" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3317,14 +3320,6 @@ msgstr "" msgid "Convert To %s" msgstr "تØÙˆÙŠÙ„ إلي %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "ÙØªØ Ø§Ù„Ù…ÙØ¹Ø¯Ù„ 2D" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4155,7 +4150,7 @@ msgstr "Ø¥Ø¶Ø§ÙØ§Øª" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4308,6 +4303,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "ÙØªØ Ø§Ù„Ù…ÙØ¹Ø¯Ù„ 2D" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4676,7 +4678,6 @@ msgstr "إسم Ø§Ù„ØØ±ÙƒØ©:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "خطأ!" @@ -4853,6 +4854,8 @@ msgid "Current:" msgstr "Ø§Ù„ØØ§Ù„ÙŠ:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "أض٠مدخله" @@ -5067,6 +5070,10 @@ msgid "All" msgstr "الكل" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "إستيراد" @@ -5372,23 +5379,28 @@ msgstr "ØªØØ¯ÙŠØ¯ الوضع" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "إلغاء/ØªÙØ¹ÙŠÙ„ الكبس" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "إستخدم الكبس" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "إعدادات الكبس" +msgid "Toggle grid snapping." +msgstr "إلغاء/ØªÙØ¹ÙŠÙ„ الكبس" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "الكبس إلي الشبكة" +msgid "Use Grid Snap" +msgstr "إستخدم الكبس" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "إعدادات الكبس" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5486,8 +5498,8 @@ msgid "View" msgstr "أظهر" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "إظهار الشبكة" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5675,7 +5687,7 @@ msgstr "التقط من البيكسل" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Emission Colors" -msgstr "الوان الانبعاث" +msgstr "الوان الإنبعاث" #: editor/plugins/cpu_particles_editor_plugin.cpp #, fuzzy @@ -5763,6 +5775,11 @@ msgstr "إلغاء/ØªÙØ¹ÙŠÙ„ مماس خط المنØÙ†ÙŠ" msgid "Hold Shift to edit tangents individually" msgstr "إبقي ضاغطاً علي Shift لتعديل المماس ÙØ±Ø¯ÙŠØ§Ù‹" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "إظغط: أض٠نقطة" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "طبخ مجس GI" @@ -6184,9 +6201,8 @@ msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp editor/plugins/theme_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp editor/project_export.cpp -#, fuzzy msgid "Options" -msgstr "الخيارات" +msgstr "الإعدادات" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp @@ -6416,6 +6432,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "إظهار الشبكة" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "تعديل اللقطة" @@ -6477,6 +6497,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6587,6 +6608,11 @@ msgid "Find Next" msgstr "Ø¨ØØ« عن التالي" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "خصائص العنصر." @@ -6869,6 +6895,11 @@ msgstr "Ù…Ø³Ø Ø§Ù„Ù†Ù‚Ø§Ø·" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "ØªØØ¯ÙŠØ¯ الكل" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6929,10 +6960,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Ùلتر Ø§Ù„Ù…Ù„ÙØ§Øª..." @@ -7268,6 +7295,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7302,6 +7333,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "إستخدم الكبس" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7539,6 +7574,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7769,7 +7808,6 @@ msgid "Disabled Button" msgstr "معطّل" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Item" msgstr "عنصر" @@ -7779,24 +7817,20 @@ msgid "Disabled Item" msgstr "معطّل" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Check Item" -msgstr "اختار العنصر" +msgstr "Ùَعل العنصر" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Checked Item" -msgstr "عنصر مَضْبÙوط" +msgstr "عنصر Ù…ÙÙØ¹Ù„" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Radio Item" -msgstr "عنصر انتقاء" +msgstr "عنصر Ø®Ùيار" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Checked Radio Item" -msgstr "عنصر انتقاء مَضْبÙوط" +msgstr "عنصر Ù…ÙÙØ¹Ù„ اختياري" #: editor/plugins/theme_editor_plugin.cpp msgid "Named Sep." @@ -8380,12 +8414,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "أض٠مدخله" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "أض٠مدخله" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8403,6 +8432,11 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "Sampler" +msgstr "عينات (صوتية)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Add input port" msgstr "أض٠مدخله" @@ -9289,12 +9323,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10304,11 +10340,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10388,6 +10422,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "ÙÙØªØ مؤخراً" @@ -10407,11 +10449,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "ÙØªØ الكود" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "إنشاء %s جديد" @@ -10658,24 +10695,19 @@ msgid "Will load an existing script file." msgstr "تØÙ…يل نسق بيوس موجود مسبقاً." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "إسم صنÙ" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Ù…Ø³Ø Ø§Ù„Ù‚Ø§Ù„Ø¨" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "ÙØªØ الكود" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11340,6 +11372,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Ù…Ø³Ø Ø§Ù„Ù†Ù‚Ø·Ø©" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11348,6 +11385,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "أض٠مدخله" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "أض٠مدخله" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Ù…Ø³Ø Ø§Ù„Ù†Ù‚Ø·Ø©" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Ù…Ø³Ø Ø§Ù„Ù†Ù‚Ø·Ø©" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11388,10 +11445,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11417,6 +11484,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "غير متصل" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "صلها بالعقدة:" @@ -11451,6 +11523,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "عمل اشتراك" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Ù…Ø³Ø Ø§Ù„Ù…Ù‡Ù…Ø©" @@ -11476,16 +11569,13 @@ msgid "Make Tool:" msgstr "أنشئ عظام" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "الأعضاء:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "الإعدادات:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11509,6 +11599,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Ù…Ø³Ø Ø§Ù„Ù…Ù‡Ù…Ø©" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "ØªØØ¯ÙŠØ«" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "الأعضاء" @@ -11604,6 +11704,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "اختار جهاز من القائمة" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11705,6 +11809,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "تشغيل ÙÙŠ Ø§Ù„Ù…ØªØµÙØ" @@ -12263,10 +12371,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "إدخال" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "مصدر غير ØµØ§Ù„Ø Ù„Ù„Ù…Ø¹Ø§ÙŠÙ†Ø©." @@ -12295,6 +12399,17 @@ msgstr "يمكن تعيين المتغيرات Ùقط ÙÙŠ الذروة ." msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "الكبس إلي الشبكة" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "أض٠مدخله" + +#~ msgid "Input" +#~ msgstr "إدخال" + #~ msgid "Properties:" #~ msgstr "خصائص:" @@ -12431,9 +12546,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "إذهب إلي المجلد السابق" -#~ msgid "Select device from the list" -#~ msgstr "اختار جهاز من القائمة" - #~ msgid "Open Scene(s)" #~ msgstr "ÙØªØ مشهد (مشاهد)" @@ -12772,9 +12884,6 @@ msgstr "" #~ msgid "Move Add Key" #~ msgstr "Ù…ÙØªØ§Ø Ø¥Ø¶Ø§ÙØ© Ø§Ù„ØØ±ÙƒØ©" -#~ msgid "Create Subscription" -#~ msgstr "عمل اشتراك" - #~ msgid "List:" #~ msgstr "القائمة:" @@ -12792,6 +12901,3 @@ msgstr "" #~ msgid "The quick brown fox jumps over the lazy dog." #~ msgstr "أبجد هوز ØØ·ÙŠ ÙƒÙ„Ù…Ù† ØµØ¹ÙØµ قرشت ثخذ ضظغ." - -#~ msgid "Samples" -#~ msgstr "عينات (صوتية)" diff --git a/editor/translations/bg.po b/editor/translations/bg.po index 56196b743f..880682ab7c 100644 --- a/editor/translations/bg.po +++ b/editor/translations/bg.po @@ -373,6 +373,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Създаване" @@ -504,16 +505,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Избиране на вÑичко" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Избиране на вÑичко" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -652,8 +643,9 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "Изберете ÑвойÑтво" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -664,6 +656,11 @@ msgstr "" msgid "Copy" msgstr "Копиране" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Избиране на вÑичко" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -993,7 +990,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1454,7 +1451,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Път:" @@ -1509,7 +1507,7 @@ msgstr "Създаване на папка" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Име:" @@ -1922,6 +1920,7 @@ msgid "Class:" msgstr "КлаÑ:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "ÐаÑледÑва:" @@ -2955,7 +2954,7 @@ msgstr "ИнÑпектор" msgid "Expand Bottom Panel" msgstr "Разшири Ð”Ð¾Ð»Ð½Ð¸Ñ ÐŸÐ°Ð½ÐµÐ»" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3196,6 +3195,11 @@ msgstr "" msgid "New Script" msgstr "Ðов Ñкрипт" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Ðова Ñцена" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3222,14 +3226,6 @@ msgstr "ПоÑтавÑне" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Ðова Ñцена" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4068,7 +4064,7 @@ msgstr "ПриÑтавки" msgid "Subfolder:" msgstr "Подпапка:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp #, fuzzy msgid "Language:" msgstr "ВнаÑÑне на езици:" @@ -4219,6 +4215,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Ðова Ñцена" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4582,7 +4585,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Грешка!" @@ -4761,6 +4763,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4970,6 +4974,10 @@ msgid "All" msgstr "Ð’Ñички" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Повторно внаÑÑне..." @@ -5271,20 +5279,25 @@ msgid "Ruler Mode" msgstr "Режим на Селектиране" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." -msgstr "" +#, fuzzy +msgid "Toggle smart snapping." +msgstr "Добави Breakpoint" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Добави Breakpoint" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5381,8 +5394,7 @@ msgid "View" msgstr "Изглед" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5650,6 +5662,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6295,6 +6311,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6351,6 +6371,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Тип:" @@ -6455,6 +6476,11 @@ msgid "Find Next" msgstr "Ðамери Ðапред" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "ПоÑтавÑне на възелите" @@ -6737,6 +6763,11 @@ msgstr "Създай точки." msgid "Cut" msgstr "ИзрÑзване" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Избиране на вÑичко" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Изтрий Ред" @@ -6796,10 +6827,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Ðамери във файлове" @@ -7136,6 +7163,11 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Свободен Изглед Отпред" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7169,6 +7201,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7402,6 +7438,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8234,12 +8274,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "Любими:" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8256,6 +8293,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Любими:" @@ -9135,12 +9176,14 @@ msgstr "РеÑурÑи за изнаÑÑне:" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10161,11 +10204,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10245,6 +10286,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Отвори документациÑта на Godot онлайн" @@ -10264,11 +10313,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Ðова Ñцена" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Създай нови възли." @@ -10513,24 +10557,19 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "КлаÑ:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Шаблони" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Ðова Ñцена" #: editor/script_create_dialog.cpp #, fuzzy @@ -11201,6 +11240,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "ЗатварÑне на вÑичко" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11209,6 +11253,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Любими:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Любими:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "ЗатварÑне на вÑичко" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "ВнаÑÑне на текÑтури" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11249,10 +11313,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11280,6 +11354,11 @@ msgstr "ИзрÑзване на възелите" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "ИзрÑзване на възелите" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "ИзрÑзване на възелите" @@ -11315,6 +11394,27 @@ msgid "Paste VisualScript Nodes" msgstr "ПоÑтавÑне на възелите" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Създай Очертание" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11339,15 +11439,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -11372,6 +11468,15 @@ msgstr "ИзрÑзване на възелите" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Отиди на Ред" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Файл:" @@ -11467,6 +11572,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11567,6 +11676,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12153,10 +12266,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/bn.po b/editor/translations/bn.po index 8e009dc63c..fa1842f3a2 100644 --- a/editor/translations/bn.po +++ b/editor/translations/bn.po @@ -393,6 +393,7 @@ msgstr "%d à¦à¦° জনà§à¦¯ নতà§à¦¨ টà§à¦°à§à¦¯à¦¾à¦•/পথ-সমà #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "তৈরি করà§à¦¨" @@ -527,15 +528,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "সবগà§à¦²à¦¿ বাছাই করà§à¦¨" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "কোনোটাই নিরà§à¦¬à¦¾à¦šà¦¨ করবেন না" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -679,8 +671,9 @@ msgid "Scale Ratio:" msgstr "সà§à¦•েল/মাপের অনà§à¦ªà¦¾à¦¤:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "গà§à¦£à¦¾à¦—à§à¦£/বৈশিষà§à¦Ÿà§à¦¯ বাছাই করà§à¦¨" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -691,6 +684,11 @@ msgstr "" msgid "Copy" msgstr "পà§à¦°à¦¤à¦¿à¦²à¦¿à¦ªà¦¿/কপি করà§à¦¨" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "কোনোটাই নিরà§à¦¬à¦¾à¦šà¦¨ করবেন না" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1037,7 +1035,7 @@ msgid "Resource" msgstr "রিসোরà§à¦¸" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "পথ" @@ -1521,7 +1519,8 @@ msgstr "AutoLoad সংযà§à¦•à§à¦¤ করà§à¦¨" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "পথ:" @@ -1577,7 +1576,7 @@ msgstr "ফোলà§à¦¡à¦¾à¦° তৈরি করà§à¦¨" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "নাম:" @@ -2007,6 +2006,7 @@ msgid "Class:" msgstr "কà§à¦²à¦¾à¦¸:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "গà§à¦°à¦¹à¦£ করে:" @@ -3140,7 +3140,7 @@ msgstr "পরিদরà§à¦¶à¦•/পরীকà§à¦·à¦•" msgid "Expand Bottom Panel" msgstr "ধারক/বাহক পরà§à¦¯à¦¨à§à¦¤ বিসà§à¦¤à§ƒà¦¤ করà§à¦¨" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "আউটপà§à¦Ÿ/ফলাফল" @@ -3398,6 +3398,11 @@ msgstr "à§§ টি Viewport" msgid "New Script" msgstr "নতà§à¦¨ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "পরবরà§à¦¤à§€ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3426,14 +3431,6 @@ msgstr "পà§à¦°à¦¤à¦¿à¦²à§‡à¦ªà¦¨/পেসà§à¦Ÿ করà§à¦¨" msgid "Convert To %s" msgstr "à¦à¦¤à§‡ রূপানà§à¦¤à¦° করà§à¦¨..." -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨" - #: editor/editor_properties.cpp editor/property_editor.cpp #, fuzzy msgid "Selected node is not a Viewport!" @@ -4319,7 +4316,7 @@ msgstr "পà§à¦²à¦¾à¦—ইন-সমূহ" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp #, fuzzy msgid "Language:" msgstr "à¦à¦¾à¦·à¦¾" @@ -4476,6 +4473,13 @@ msgstr "বিনà§à¦¦à§ সরান" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4853,7 +4857,6 @@ msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨à§‡à¦° নাম:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "à¦à§à¦²/সমসà§à¦¯à¦¾!" @@ -5032,6 +5035,8 @@ msgid "Current:" msgstr "বরà§à¦¤à¦®à¦¾à¦¨:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" @@ -5253,6 +5258,10 @@ msgid "All" msgstr "সকল" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "পà§à¦¨-ইমà§à¦ªà§‹à¦°à§à¦Ÿ..." @@ -5564,23 +5573,28 @@ msgstr "চালানোর মোড:" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "ছেদবিনà§à¦¦à§ অদলবদল করà§à¦¨ (টগল বà§à¦°à§‡à¦•পয়েনà§à¦Ÿ)" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨à§‡à¦° সিদà§à¦§à¦¾à¦¨à§à¦¤à¦¸à¦®à§‚হ" +msgid "Toggle grid snapping." +msgstr "ছেদবিনà§à¦¦à§ অদলবদল করà§à¦¨ (টগল বà§à¦°à§‡à¦•পয়েনà§à¦Ÿ)" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª মোড:" +msgid "Use Grid Snap" +msgstr "গà§à¦°à¦¿à¦¡ সà§à¦¨à§à¦¯à¦¾à¦ª" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨à§‡à¦° সিদà§à¦§à¦¾à¦¨à§à¦¤à¦¸à¦®à§‚হ" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5679,8 +5693,8 @@ msgid "View" msgstr "দৃশà§à¦¯/পরিদরà§à¦¶à¦¨" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "গà§à¦°à¦¿à¦¡ দেখান" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5972,6 +5986,11 @@ msgstr "বকà§à¦°à¦°à§‡à¦–ার লিনিয়ার টà§à¦¯à¦¾à¦¨à¦œà msgid "Hold Shift to edit tangents individually" msgstr "টà§à¦¯à¦¾à¦¨à¦œà§‡à¦¨à§à¦Ÿà¦—à§à¦²à¦¿ আলাদা আলাদা à¦à¦¾à¦¬à§‡ সমà§à¦ªà¦¾à¦¦à¦¨à¦¾ করার জনà§à¦¯ Shift ধরে রাখà§à¦¨à§" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "ডান কà§à¦²à¦¿à¦•: বিনà§à¦¦à§ অপসারণ করà§à¦¨" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "জি আই পà§à¦°à§‹à¦¬ বেক করà§à¦¨" @@ -6640,6 +6659,10 @@ msgid "Grid" msgstr "গà§à¦°à¦¿à¦¡" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "গà§à¦°à¦¿à¦¡ দেখান" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª কনফিগার করà§à¦¨" @@ -6702,6 +6725,7 @@ msgstr "ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "ধরণ:" @@ -6817,6 +6841,11 @@ msgid "Find Next" msgstr "পরবরà§à¦¤à§€ খà§à¦à¦œà§à¦¨" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "পূরà§à¦¬à§‡ খà§à¦à¦œà§à¦¨" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "ফিলà§à¦Ÿà¦¾à¦°à¦¸à¦®à§‚হ" @@ -7107,6 +7136,11 @@ msgstr "বিনà§à¦¦à§ অপসারণ করà§à¦¨" msgid "Cut" msgstr "করà§à¦¤à¦¨/কাট করà§à¦¨" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "সবগà§à¦²à¦¿ বাছাই করà§à¦¨" + #: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Delete Line" @@ -7169,10 +7203,6 @@ msgid "Auto Indent" msgstr "সà§à¦¬à§Ÿà¦‚কà§à¦°à¦¿à§Ÿà¦à¦¾à¦¬à§‡ মাতà§à¦°à¦¾ দিন" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "পূরà§à¦¬à§‡ খà§à¦à¦œà§à¦¨" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "দà§à¦°à§à¦¤ ফাইলসমূহ ফিলà§à¦Ÿà¦¾à¦° করà§à¦¨..." @@ -7529,6 +7559,11 @@ msgid "Freelook Speed Modifier" msgstr "ফà§à¦°à¦¿ লà§à¦• সà§à¦ªà¦¿à¦¡ মডিফায়ার" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "ফà§à¦°à¦¿ লà§à¦• সà§à¦ªà¦¿à¦¡ মডিফায়ার" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7566,6 +7601,10 @@ msgid "Use Local Space" msgstr "মাপের মোড করà§à¦¨ (R)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "নিমà§à¦¨ দরà§à¦¶à¦¨" @@ -7808,6 +7847,11 @@ msgstr "" #: editor/plugins/sprite_editor_plugin.cpp #, fuzzy +msgid "Shrink (Pixels): " +msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª (পিকà§à¦¸à§‡à¦²à¦¸à¦®à§‚হ):" + +#: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy msgid "Grow (Pixels): " msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª (পিকà§à¦¸à§‡à¦²à¦¸à¦®à§‚হ):" @@ -8671,12 +8715,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8695,6 +8734,11 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "Sampler" +msgstr "নমà§à¦¨à¦¾à¦¸à¦®à§‚হ" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Add input port" msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" @@ -9606,14 +9650,16 @@ msgstr "à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿà§‡à¦° জনà§à¦¯ রিসোরà§à¦¸:" #: editor/project_export.cpp #, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "রিসোরà§à¦¸-নয় à¦à¦®à¦¨ ফাইল à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ করার ফিলà§à¦Ÿà¦¾à¦°à¦¸à¦®à§‚হ (কমা-বিà¦à¦•à§à¦¤, যেমন: *.json, *.txt):" #: editor/project_export.cpp #, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ (export) হতে বরà§à¦œà¦¨à¦•ৃত ফিলà§à¦Ÿà¦¾à¦°à¦¸à¦®à§‚হ (filter) (কমা-বিà¦à¦•à§à¦¤, যেমন: *.json, *." "txt):" @@ -10687,12 +10733,10 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "সমà§à¦ªà¦¾à¦¦à¦¨à¦¯à§‹à¦—à§à¦¯ অংশীদারীসমূহ" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "পà§à¦²à§‡à¦¸à¦¹à§‹à¦²à§à¦¡à¦¾à¦° হিসেবে লোড করà§à¦¨" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10775,6 +10819,14 @@ msgid "Clear Inheritance" msgstr "উতà§à¦¤à¦°à¦¾à¦§à¦¿à¦•ারতà§à¦¬ পরিসà§à¦•ার করà§à¦¨" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "সমà§à¦ªà¦¾à¦¦à¦¨à¦¯à§‹à¦—à§à¦¯ অংশীদারীসমূহ" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "পà§à¦²à§‡à¦¸à¦¹à§‹à¦²à§à¦¡à¦¾à¦° হিসেবে লোড করà§à¦¨" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "রেফারেনà§à¦¸à§‡à¦° ডকà§à¦®à§‡à¦¨à§à¦Ÿà§‡à¦¶à¦¨à§‡ খà§à¦à¦œà§à¦¨à¥¤" @@ -10794,11 +10846,6 @@ msgstr "ধরণ পরিবরà§à¦¤à¦¨ করà§à¦¨" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "পরবরà§à¦¤à§€ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "নোডের নতà§à¦¨ অà¦à¦¿à¦à¦¾à¦¬à¦• দান করà§à¦¨" @@ -11073,27 +11120,18 @@ msgid "Will load an existing script file." msgstr "বিদà§à¦¯à¦®à¦¾à¦¨ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ লোড করà§à¦¨" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "à¦à¦¾à¦·à¦¾" - -#: editor/script_create_dialog.cpp -#, fuzzy -msgid "Inherits" -msgstr "গà§à¦°à¦¹à¦£ করে:" - -#: editor/script_create_dialog.cpp #, fuzzy -msgid "Class Name" +msgid "Class Name:" msgstr "কà§à¦²à¦¾à¦¸ নাম:" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" +msgid "Template:" msgstr "বসà§à¦¤à§ অপসারণ করà§à¦¨" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "পূরà§à¦¬à¦¨à¦¿à¦°à§à¦®à¦¿à¦¤ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ" #: editor/script_create_dialog.cpp @@ -11799,6 +11837,11 @@ msgid "Add Function" msgstr "ফাংশন সংযোজন করà§à¦¨" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "পথের বিনà§à¦¦à§ অপসারণ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "চলক/à¦à§‡à¦°à¦¿à§Ÿà§‡à¦¬à¦² সংযোজন করà§à¦¨" @@ -11807,6 +11850,26 @@ msgid "Add Signal" msgstr "সংকেত/সিগনà§à¦¯à¦¾à¦² সংযোজন করà§à¦¨" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "পথের বিনà§à¦¦à§ অপসারণ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "পথের বিনà§à¦¦à§ অপসারণ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "অà¦à¦¿à¦¬à§à¦¯à¦•à§à¦¤à¦¿ (Expression) পরিবরà§à¦¤à¦¨ করà§à¦¨" @@ -11859,10 +11922,20 @@ msgid "Add Preload Node" msgstr "পà§à¦°à¦¿à¦²à§‹à¦¡ নোড যà§à¦•à§à¦¤ করà§à¦¨" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "শাখা (tree) হতে নোড (সমূহ) যà§à¦•à§à¦¤ করà§à¦¨" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "গেটার (Getter) à¦à¦° বৈশিষà§à¦Ÿà§à¦¯à§‡ যà§à¦•à§à¦¤ করà§à¦¨" @@ -11892,6 +11965,11 @@ msgstr "নোডের সাথে সংযà§à¦•à§à¦¤ করà§à¦¨:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "গà§à¦°à¦¾à¦«à§‡à¦° নোডসমূহ বিচà§à¦›à¦¿à¦¨à§à¦¨ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "নোডের সাথে সংযà§à¦•à§à¦¤ করà§à¦¨:" @@ -11930,6 +12008,28 @@ msgid "Paste VisualScript Nodes" msgstr "নোড-সমূহ পà§à¦°à¦¤à¦¿à¦²à§‡à¦ªà¦¨/পেসà§à¦Ÿ করà§à¦¨" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "'..' তে পরিচালনা করা সমà§à¦à¦¬ নয়" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "ফাংশনের (Function) নতà§à¦¨ নামকরণ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "ফাংশন (Function) অপসারণ করà§à¦¨" @@ -11955,16 +12055,13 @@ msgid "Make Tool:" msgstr "সà§à¦¥à¦¾à¦¨à§€à§Ÿ করà§à¦¨" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "তলের ধরণ (Base Type):" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "সদসà§à¦¯à¦—ণ (Members):" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "উপসà§à¦¥à¦¿à¦¤ নোডসমূহ:" +#, fuzzy +msgid "function_name" +msgstr "ফাংশন:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11989,6 +12086,16 @@ msgstr "নোড-সমূহ করà§à¦¤à¦¨/কাট করà§à¦¨" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "ফাংশনের (Function) নতà§à¦¨ নামকরণ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "রিফà§à¦°à§‡à¦¸ করà§à¦¨" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "সদসà§à¦¯à¦—ণ (Members):" @@ -12086,6 +12193,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "লিসà§à¦Ÿ থেকে ডিà¦à¦¾à¦‡à¦¸ সিলেকà§à¦Ÿ করà§à¦¨" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -12188,6 +12299,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp #, fuzzy msgid "Run in Browser" msgstr "বà§à¦°à¦¾à¦‰à¦¸" @@ -12800,11 +12915,6 @@ msgstr "" "আকার ধারণ করতে পারে। অনà§à¦¯à¦¥à¦¾à§Ÿ, à¦à¦Ÿà¦¿à¦•ে à¦à¦•টি RenderTarget করà§à¦¨ à¦à¦¬à¦‚ à¦à¦° অà¦à§à¦¯à¦¨à§à¦¤à¦°à§€à¦£ " "দৃশà§à¦¯à¦¾à¦¬à¦²à¦¿à¦•ে (texture) দৃশà§à¦¯à¦®à¦¾à¦¨ করতে কোনো নোডে হসà§à¦¤à¦¾à¦¨à§à¦¤à¦° করà§à¦¨à¥¤" -#: scene/resources/visual_shader.cpp -#, fuzzy -msgid "Input" -msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12836,6 +12946,31 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª মোড:" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" + +#~ msgid "Language" +#~ msgstr "à¦à¦¾à¦·à¦¾" + +#, fuzzy +#~ msgid "Inherits" +#~ msgstr "গà§à¦°à¦¹à¦£ করে:" + +#~ msgid "Base Type:" +#~ msgstr "তলের ধরণ (Base Type):" + +#~ msgid "Available Nodes:" +#~ msgstr "উপসà§à¦¥à¦¿à¦¤ নোডসমূহ:" + +#, fuzzy +#~ msgid "Input" +#~ msgstr "ইনপà§à¦Ÿ যোগ করà§à¦¨" + #~ msgid "Properties:" #~ msgstr "পà§à¦°à§‹à¦ªà¦¾à¦°à§à¦Ÿà¦¿-সমূহ:" @@ -13058,9 +13193,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦à¦¬ হয়নি।" -#~ msgid "Select device from the list" -#~ msgstr "লিসà§à¦Ÿ থেকে ডিà¦à¦¾à¦‡à¦¸ সিলেকà§à¦Ÿ করà§à¦¨" - #, fuzzy #~ msgid "Open Scene(s)" #~ msgstr "দৃশà§à¦¯ খà§à¦²à§à¦¨" @@ -13314,9 +13446,6 @@ msgstr "" #~ msgid "Warning" #~ msgstr "সতরà§à¦•তা" -#~ msgid "Function:" -#~ msgstr "ফাংশন:" - #~ msgid "Variable" #~ msgstr "চলক/à¦à§‡à¦°à¦¿à§Ÿà§‡à¦¬à¦²" @@ -13381,9 +13510,6 @@ msgstr "" #~ msgid "Connect Graph Nodes" #~ msgstr "গà§à¦°à¦¾à¦«à§‡à¦° নোডসমূহ সংযà§à¦•à§à¦¤ করà§à¦¨" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "গà§à¦°à¦¾à¦«à§‡à¦° নোডসমূহ বিচà§à¦›à¦¿à¦¨à§à¦¨ করà§à¦¨" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Shader Graph Node অপসারণ করà§à¦¨" @@ -14509,9 +14635,6 @@ msgstr "" #~ msgid "Group" #~ msgstr "গà§à¦°à§à¦ª" -#~ msgid "Samples" -#~ msgstr "নমà§à¦¨à¦¾à¦¸à¦®à§‚হ" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "নমà§à¦¨à¦¾ রূপানà§à¦¤à¦° মোড: (.wav ফাইল):" diff --git a/editor/translations/ca.po b/editor/translations/ca.po index 36548b1f29..3c105cd75c 100644 --- a/editor/translations/ca.po +++ b/editor/translations/ca.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-11 03:10+0000\n" +"PO-Revision-Date: 2019-10-04 03:15+0000\n" "Last-Translator: roger <616steam@gmail.com>\n" "Language-Team: Catalan <https://hosted.weblate.org/projects/godot-engine/" "godot/ca/>\n" @@ -63,12 +63,13 @@ msgid "On call to '%s':" msgstr "En la crida a '%s':" #: core/ustring.cpp +#, fuzzy msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp #, fuzzy @@ -77,19 +78,19 @@ msgstr "Mesclar" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -360,6 +361,7 @@ msgstr "Voleu crear %d NOVES pistes i inserir-hi claus?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Crea" @@ -495,16 +497,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Advertiment: Edició d'animació importada" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Selecciona-ho Tot" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "No seleccionar-ne cap" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -641,7 +633,8 @@ msgid "Scale Ratio:" msgstr "Relació d'Escala:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Tria les Pistes per copiar:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -653,6 +646,11 @@ msgstr "Tria les Pistes per copiar:" msgid "Copy" msgstr "Copia" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "No seleccionar-ne cap" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Afegir Clip de Pista d'Àudio" @@ -980,7 +978,7 @@ msgid "Resource" msgstr "Recurs" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "CamÃ" @@ -1453,7 +1451,8 @@ msgstr "Afegeix AutoCà rrega" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "CamÃ:" @@ -1507,7 +1506,7 @@ msgstr "Crea un Directori" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nom:" @@ -1906,6 +1905,7 @@ msgid "Class:" msgstr "Classe:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Hereta:" @@ -2072,7 +2072,7 @@ msgstr "Inicia" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp #, fuzzy @@ -2081,27 +2081,31 @@ msgstr "Baixa" #: editor/editor_network_profiler.cpp msgid "Up" -msgstr "" +msgstr "Amunt" #: editor/editor_network_profiler.cpp editor/editor_node.cpp msgid "Node" msgstr "Node" #: editor/editor_network_profiler.cpp +#, fuzzy msgid "Incoming RPC" -msgstr "" +msgstr "RPC Entrant" #: editor/editor_network_profiler.cpp +#, fuzzy msgid "Incoming RSET" -msgstr "" +msgstr "RSET Entrant" #: editor/editor_network_profiler.cpp +#, fuzzy msgid "Outgoing RPC" -msgstr "" +msgstr "RPC Sortint" #: editor/editor_network_profiler.cpp +#, fuzzy msgid "Outgoing RSET" -msgstr "" +msgstr "RSET Sortint" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2701,12 +2705,14 @@ msgid "Version Control" msgstr "Versió:" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp +#, fuzzy msgid "Set Up Version Control" -msgstr "" +msgstr "Configurar Control de Versions" #: editor/editor_node.cpp +#, fuzzy msgid "Shut Down Version Control" -msgstr "" +msgstr "Desactivar el control de versions" #: editor/editor_node.cpp #, fuzzy @@ -2989,7 +2995,7 @@ msgstr "Inspector" msgid "Expand Bottom Panel" msgstr "Expandeix el Quadre inferior" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Sortida" @@ -3236,6 +3242,10 @@ msgstr "Selecciona una Vista" msgid "New Script" msgstr "Script Nou" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Estendre el script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nou %s" @@ -3262,13 +3272,6 @@ msgstr "Enganxa" msgid "Convert To %s" msgstr "Converteix a %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Obre l'Editor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "El Node seleccionat no és una Vista!" @@ -4065,7 +4068,7 @@ msgstr "Nom del Connector:" msgid "Subfolder:" msgstr "Subcarpeta:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Llengua:" @@ -4207,6 +4210,12 @@ msgstr "Punt" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Obre l'Editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Obre un Node d'Animació" @@ -4558,7 +4567,6 @@ msgstr "Nom de l'Animació:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Error !" @@ -4733,6 +4741,8 @@ msgid "Current:" msgstr "Actual:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Afegeix una Entrada" @@ -4942,6 +4952,10 @@ msgid "All" msgstr "Tot" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "ReImporta..." @@ -5251,21 +5265,28 @@ msgid "Ruler Mode" msgstr "Mode d'Execució:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Commutar Ajustament." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Utilitzar Ajustament" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opcions d'Ajustament" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Commutar Ajustament." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Ajustar a la QuadrÃcula" +#, fuzzy +msgid "Use Grid Snap" +msgstr "Ajustar a la quadrÃcula" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Opcions d'Ajustament" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5361,8 +5382,8 @@ msgid "View" msgstr "Vista" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Mostra la graella" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5637,6 +5658,11 @@ msgstr "Tangent Lineal" msgid "Hold Shift to edit tangents individually" msgstr "Prem Maj. per editar les tangents individualment" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Clic Dret: Elimina el Punt" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Precalcula la Sonda d'IG" @@ -6284,6 +6310,10 @@ msgid "Grid" msgstr "QuadrÃcula" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Mostra la graella" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Configurar QuadrÃcula:" @@ -6340,6 +6370,7 @@ msgstr "Instà ncia:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Tipus:" @@ -6441,6 +6472,11 @@ msgid "Find Next" msgstr "Cerca el Següent" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Cerca l'Anterior" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Filtra les propietats" @@ -6717,6 +6753,11 @@ msgstr "Crea punts." msgid "Cut" msgstr "Talla" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Selecciona-ho Tot" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Esborra la LÃnia" @@ -6775,10 +6816,6 @@ msgid "Auto Indent" msgstr "Sagnat Automà tic" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Cerca l'Anterior" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Cercar en Fitxers..." @@ -7113,6 +7150,11 @@ msgstr "Modificador de la Velocitat de la Vista Lliure" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Modificador de la Velocitat de la Vista Lliure" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7153,6 +7195,10 @@ msgid "Use Local Space" msgstr "Mode Espai Local (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Utilitzar Ajustament" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Vista Inferior" @@ -7392,6 +7438,10 @@ msgid "Simplification: " msgstr "Simplificació: " #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8225,12 +8275,7 @@ msgstr "(Només GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Afegeix una Entrada" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "Afegeix una Entrada" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8248,6 +8293,11 @@ msgstr "Booleà " #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "Sampler" +msgstr "Mostra d'Àudio" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Add input port" msgstr "Afegeix una Entrada" @@ -9194,15 +9244,19 @@ msgid "Resources to export:" msgstr "Recursos per exportar:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtres per a l'exportació fitxers no-recurs (separats per comes, ex: *." "json, *. txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtres per excloure fitxers del projecte (separats per comes, ex:*.json, *." "txt)" @@ -10272,12 +10326,13 @@ msgstr "" "node tornin al seu valor per defecte." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Fills Editables" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Carrega com a Contenidor Temporal" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Deshabilitar \"editable_instance\" provocarà que totes les propietats del " +"node tornin al seu valor per defecte." #: editor/scene_tree_dock.cpp #, fuzzy @@ -10354,6 +10409,14 @@ msgid "Clear Inheritance" msgstr "Elimina l'Herència" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Fills Editables" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Carrega com a Contenidor Temporal" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Obrir documentació" @@ -10371,10 +10434,6 @@ msgid "Change Type" msgstr "Modifica el Tipus" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Estendre el script" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "Torna a Parentar el Node" @@ -10624,23 +10683,18 @@ msgid "Will load an existing script file." msgstr "Es carregarà un fitxer de script existent." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Llengua" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Hereta" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Nom de Classe" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Plantilla" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Script Integrat" #: editor/script_create_dialog.cpp @@ -11314,6 +11368,11 @@ msgid "Add Function" msgstr "Afegeix una Funció" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Elimina el punt" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Afegeix una Variable" @@ -11322,6 +11381,26 @@ msgid "Add Signal" msgstr "Afegeix un Senyal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Afegeix una Entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Afegir port de sortida" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Elimina el punt" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Elimina el punt" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Canviar Expressió" @@ -11366,10 +11445,20 @@ msgid "Add Preload Node" msgstr "Afegeix un Node de Precà rrega" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Afegeix Nodes des d'Arbre" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Afegeix una Propietat d'Accés (Getter)" @@ -11395,6 +11484,11 @@ msgstr "Connecta els Nodes" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Desconnecta el Nodes de Graf" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Connecta els Nodes" @@ -11428,6 +11522,28 @@ msgid "Paste VisualScript Nodes" msgstr "Enganxa els Nodes de VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "No es pot copiar el node de funció." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Reanomena Funció" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Elimina la Funció" @@ -11453,16 +11569,13 @@ msgid "Make Tool:" msgstr "Fer Local" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Tipus Base:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Membres:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Nodes disponibles:" +#, fuzzy +msgid "function_name" +msgstr "Funció:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11486,6 +11599,16 @@ msgid "Cut Nodes" msgstr "Talla els Nodes" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Reanomena Funció" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Refresca" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Editar Membre" @@ -11589,6 +11712,10 @@ 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.cpp +msgid "Select device from the list" +msgstr "Selecciona un dispositiu de la llista" + +#: platform/android/export/export.cpp #, fuzzy msgid "ADB executable not configured in the Editor Settings." msgstr "L'executable ADB no està configurat a la configuració de l'editor." @@ -11716,6 +11843,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Executa-ho en el Navegador" @@ -12380,10 +12511,6 @@ msgstr "" "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/resources/visual_shader.cpp -msgid "Input" -msgstr "Entrada" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12414,6 +12541,28 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Les constants no es poden modificar." +#~ msgid "Snap to Grid" +#~ msgstr "Ajustar a la QuadrÃcula" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Afegeix una Entrada" + +#~ msgid "Language" +#~ msgstr "Llengua" + +#~ msgid "Inherits" +#~ msgstr "Hereta" + +#~ msgid "Base Type:" +#~ msgstr "Tipus Base:" + +#~ msgid "Available Nodes:" +#~ msgstr "Nodes disponibles:" + +#~ msgid "Input" +#~ msgstr "Entrada" + #~ msgid "Properties:" #~ msgstr "Propietats:" @@ -12659,9 +12808,6 @@ msgstr "Les constants no es poden modificar." #~ msgid "Go to parent folder" #~ msgstr "Vés al directori principal" -#~ msgid "Select device from the list" -#~ msgstr "Selecciona un dispositiu de la llista" - #~ msgid "Open Scene(s)" #~ msgstr "Obre Escenes" @@ -12907,9 +13053,6 @@ msgstr "Les constants no es poden modificar." #~ msgid "Warning" #~ msgstr "AvÃs" -#~ msgid "Function:" -#~ msgstr "Funció:" - #~ msgid "Variable" #~ msgstr "Variable" @@ -12973,9 +13116,6 @@ msgstr "Les constants no es poden modificar." #~ msgid "Connect Graph Nodes" #~ msgstr "Connecta els Nodes de Graf" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Desconnecta el Nodes de Graf" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Elimina el Node de Graf d'Ombreig" @@ -13498,9 +13638,6 @@ msgstr "Les constants no es poden modificar." #~ msgid "Source Sample(s):" #~ msgstr "Mostra/es d'Origen:" -#~ msgid "Audio Sample" -#~ msgstr "Mostra d'Àudio" - #~ msgid "New Clip" #~ msgstr "Nou Clip" diff --git a/editor/translations/cs.po b/editor/translations/cs.po index 3b805043f5..dc6e69bc0c 100644 --- a/editor/translations/cs.po +++ b/editor/translations/cs.po @@ -363,6 +363,7 @@ msgstr "VytvoÅ™it %d NOVÃCH stop a vložit klÃÄe?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "VytvoÅ™it" @@ -503,15 +504,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "UpozornÄ›nÃ: Upravuje se importovaná animace" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Vybrat vÅ¡e" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Nevybrat nic" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -647,7 +639,8 @@ msgid "Scale Ratio:" msgstr "PomÄ›r zvÄ›tÅ¡enÃ:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Zvolte stopy ke zkopÃrovánÃ:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -659,6 +652,11 @@ msgstr "Zvolte stopy ke zkopÃrovánÃ:" msgid "Copy" msgstr "KopÃrovat" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Nevybrat nic" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "PÅ™idat klip audio stopy" @@ -989,7 +987,7 @@ msgid "Resource" msgstr "Zdroj" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Cesta" @@ -1464,7 +1462,8 @@ msgstr "PÅ™idat AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Cesta:" @@ -1519,7 +1518,7 @@ msgstr "VytvoÅ™it složku" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Jméno:" @@ -1940,6 +1939,7 @@ msgid "Class:" msgstr "TÅ™Ãda:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "DÄ›dà z:" @@ -3015,7 +3015,7 @@ msgstr "Inspektor" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Výstup" @@ -3259,6 +3259,11 @@ msgstr "Vyberte Viewport" msgid "New Script" msgstr "Nový skript" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "OtevÅ™Ãt skript" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nový %s" @@ -3285,13 +3290,6 @@ msgstr "Vložit" msgid "Convert To %s" msgstr "Konvertovat na %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "OtevÅ™Ãt editor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Vybraný uzel nenà Viewport!" @@ -4097,7 +4095,7 @@ msgstr "Název pluginu:" msgid "Subfolder:" msgstr "Podsložka:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Jazyk:" @@ -4239,6 +4237,12 @@ msgstr "Bod" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "OtevÅ™Ãt editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "OtevÅ™Ãt uzel animace" @@ -4588,7 +4592,6 @@ msgstr "Jméno animace:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Chyba!" @@ -4758,6 +4761,8 @@ msgid "Current:" msgstr "AktuálnÃ:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "PÅ™idat vstup" @@ -4968,6 +4973,10 @@ msgid "All" msgstr "VÅ¡echny" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importovat" @@ -5267,22 +5276,28 @@ msgid "Ruler Mode" msgstr "Režim Å¡kálovánÃ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "PÅ™epnout pÅ™ichycovánÃ." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "PoužÃt pÅ™ichycovánÃ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Možnosti pÅ™ichytávánÃ" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "PÅ™epnout pÅ™ichycovánÃ." #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "PÅ™ichytit k mřÞce" +msgid "Use Grid Snap" +msgstr "PoužÃt pÅ™ichycovánÃ" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Možnosti pÅ™ichytávánÃ" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5379,8 +5394,8 @@ msgid "View" msgstr "ZobrazenÃ" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Zobrazit mřÞku" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5652,6 +5667,11 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Pravý klik: Smazat bod" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6295,6 +6315,10 @@ msgid "Grid" msgstr "MřÞka" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Zobrazit mřÞku" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Nastavit mřÞku:" @@ -6352,6 +6376,7 @@ msgstr "Instance:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Typ:" @@ -6453,6 +6478,11 @@ msgid "Find Next" msgstr "NajÃt dalÅ¡Ã" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "NajÃt pÅ™edchozÃ" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Filtrovat vlastnosti" @@ -6732,6 +6762,11 @@ msgstr "VytvoÅ™it body." msgid "Cut" msgstr "Vyjmout" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Vybrat vÅ¡e" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Odstranit řádek" @@ -6790,10 +6825,6 @@ msgid "Auto Indent" msgstr "Automatické odsazenÃ" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "NajÃt pÅ™edchozÃ" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "NajÃt v souborech..." @@ -7125,6 +7156,11 @@ msgid "Freelook Speed Modifier" msgstr "Rychlost volného pohledu" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Rychlost volného pohledu" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7163,6 +7199,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "PoužÃt pÅ™ichycovánÃ" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Pohled zdola" @@ -7401,6 +7441,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8233,12 +8277,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "PÅ™idat vstup" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "PÅ™idat vstup" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8256,6 +8295,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "PÅ™idat vstup" @@ -9158,12 +9201,14 @@ msgstr "Zdroje k exportu:" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10179,11 +10224,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10260,6 +10303,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "OtevÅ™Ãt dokumentaci" @@ -10279,11 +10330,6 @@ msgstr "ZmÄ›nit typ" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "OtevÅ™Ãt skript" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "PÅ™idat/VytvoÅ™it nový uzel" @@ -10534,23 +10580,18 @@ msgid "Will load an existing script file." msgstr "NaÄÃst existujÃcà soubor skriptu" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Jazyk" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "DÄ›dÃ" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Jméno tÅ™Ãdy" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Å ablona" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "VestavÄ›ný skript" #: editor/script_create_dialog.cpp @@ -11224,6 +11265,11 @@ msgid "Add Function" msgstr "PÅ™idat funkci" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Odstranit bod" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "PÅ™idat promÄ›nnou" @@ -11232,6 +11278,26 @@ msgid "Add Signal" msgstr "PÅ™idat signál" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "PÅ™idat vstup" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "PÅ™idat vstup" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Odstranit bod" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Odstranit bod" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "ZmÄ›nit výraz" @@ -11278,10 +11344,20 @@ msgid "Add Preload Node" msgstr "PÅ™idat pÅ™edem naÄtený uzel" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "PÅ™idat uzel(y) ze stromu" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "PÅ™idat vlastnost getter" @@ -11307,6 +11383,11 @@ msgstr "PÅ™ipojit uzly" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Odpojit uzly grafu" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "PÅ™ipojit uzly" @@ -11341,6 +11422,27 @@ msgid "Paste VisualScript Nodes" msgstr "Vložit VisualScript uzly" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "PÅ™ejmenovat funkci" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Odstranit funkci" @@ -11366,16 +11468,13 @@ msgid "Make Tool:" msgstr "MÃstnÃ" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Základnà typ:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "ÄŒlenové:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Dostupné uzly:" +#, fuzzy +msgid "function_name" +msgstr "Funkce:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11400,6 +11499,16 @@ msgstr "Vyjmout uzly" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "PÅ™ejmenovat funkci" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Obnovit" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "ÄŒlenové" @@ -11497,6 +11606,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Vyberte zaÅ™Ãzenà ze seznamu" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11599,6 +11712,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Spustit v prohlÞeÄi" @@ -12220,10 +12337,6 @@ msgstr "" "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/resources/visual_shader.cpp -msgid "Input" -msgstr "Vstup" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12254,6 +12367,29 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Konstanty nenà možné upravovat." +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "PÅ™ichytit k mřÞce" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "PÅ™idat vstup" + +#~ msgid "Language" +#~ msgstr "Jazyk" + +#~ msgid "Inherits" +#~ msgstr "DÄ›dÃ" + +#~ msgid "Base Type:" +#~ msgstr "Základnà typ:" + +#~ msgid "Available Nodes:" +#~ msgstr "Dostupné uzly:" + +#~ msgid "Input" +#~ msgstr "Vstup" + #~ msgid "Properties:" #~ msgstr "Vlastnosti:" @@ -12438,9 +12574,6 @@ msgstr "Konstanty nenà možné upravovat." #~ msgid "Go to parent folder" #~ msgstr "JÃt na nadÅ™azenou složku" -#~ msgid "Select device from the list" -#~ msgstr "Vyberte zaÅ™Ãzenà ze seznamu" - #~ msgid "Open Scene(s)" #~ msgstr "OtevÅ™Ãt scénu(y)" @@ -12640,9 +12773,6 @@ msgstr "Konstanty nenà možné upravovat." #~ msgid "Warning" #~ msgstr "VarovánÃ" -#~ msgid "Function:" -#~ msgstr "Funkce:" - #~ msgid "Variable" #~ msgstr "PromÄ›nná" @@ -12673,9 +12803,6 @@ msgstr "Konstanty nenà možné upravovat." #~ msgid "Connect Graph Nodes" #~ msgstr "Propojit uzly grafu" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Odpojit uzly grafu" - #~ msgid "Move Anim Track Up" #~ msgstr "Posun stopy animace nahoru" diff --git a/editor/translations/da.po b/editor/translations/da.po index 3dc3b082aa..b91eec6954 100644 --- a/editor/translations/da.po +++ b/editor/translations/da.po @@ -13,12 +13,13 @@ # Peter G. Laursen <GhostReven@gmail.com>, 2018. # Rémi Verschelde <akien@godotengine.org>, 2019. # Mads K. Bredager <mbredager@gmail.com>, 2019. +# Kristoffer Andersen <kjaa@google.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:51+0000\n" -"Last-Translator: Mads K. Bredager <mbredager@gmail.com>\n" +"PO-Revision-Date: 2019-10-04 09:55+0000\n" +"Last-Translator: Kristoffer Andersen <kjaa@google.com>\n" "Language-Team: Danish <https://hosted.weblate.org/projects/godot-engine/" "godot/da/>\n" "Language: da\n" @@ -49,7 +50,7 @@ msgstr "self kan ikke bruges fordi instansen er null (mislykket)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." -msgstr "Ugyldigt operandere til operator %s, %s og %s." +msgstr "Ugyldige operander til operator %s, %s og %s." #: core/math/expression.cpp msgid "Invalid index of type %s for base type %s" @@ -69,35 +70,35 @@ msgstr "Ved kald til '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp msgid "MiB" -msgstr "" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" -msgstr "Gratis" +msgstr "Fri" #: editor/animation_bezier_editor.cpp msgid "Balanced" @@ -372,6 +373,7 @@ msgstr "Opret %d NYE spor og indsæt nøgler?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Opret" @@ -520,16 +522,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Advarsel: Redigerer importeret animation" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Vælg alle" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Vælg Node" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -667,7 +659,8 @@ msgid "Scale Ratio:" msgstr "Skalaforhold:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Vælg spor til kopiering:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -679,6 +672,11 @@ msgstr "Vælg spor til kopiering:" msgid "Copy" msgstr "Kopier" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Vælg Node" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1016,7 +1014,7 @@ msgid "Resource" msgstr "Ressource" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Sti" @@ -1493,7 +1491,8 @@ msgstr "Tilføj AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Sti:" @@ -1548,7 +1547,7 @@ msgstr "Opret Mappe" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Navn:" @@ -1966,6 +1965,7 @@ msgid "Class:" msgstr "Klasse:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Arver:" @@ -3049,7 +3049,7 @@ msgstr "Inspektør" msgid "Expand Bottom Panel" msgstr "Udvid nederste panel" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Output" @@ -3290,6 +3290,11 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Ã…ben script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3316,13 +3321,6 @@ msgstr "Indsæt" msgid "Convert To %s" msgstr "Konverter Til %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Ã…bn redaktør" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4158,7 +4156,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4309,6 +4307,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Ã…bn redaktør" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4679,7 +4683,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4857,6 +4860,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -5070,6 +5075,10 @@ msgid "All" msgstr "Alle" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importer" @@ -5370,20 +5379,24 @@ msgstr "Skifter Modus" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "Skift snapping mode" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Skift snapping mode" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5478,8 +5491,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5749,6 +5761,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6400,6 +6416,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6456,6 +6476,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6565,6 +6586,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Filtrer noder" @@ -6848,6 +6874,11 @@ msgstr "Slet points" msgid "Cut" msgstr "Cut" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Vælg alle" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Fjern Line" @@ -6909,10 +6940,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Filtrer filer..." @@ -7248,6 +7275,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7281,6 +7312,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7515,6 +7550,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8345,12 +8384,8 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Tilføj punkt" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +msgid "Add Output" +msgstr "Output" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8366,6 +8401,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Tilføj punkt" @@ -9252,12 +9291,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10279,11 +10320,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10364,6 +10403,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Ã…ben Seneste" @@ -10383,11 +10430,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Ã…ben script" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Opret Ny %s" @@ -10636,24 +10678,19 @@ msgid "Will load an existing script file." msgstr "Indlæs et eksisterende Bus Layout." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Klasse:" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Skabelon" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Ã…ben script" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11321,6 +11358,11 @@ msgid "Add Function" msgstr "Tilføj Funktion" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Fjern punkt" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Tilføj variabel" @@ -11330,6 +11372,26 @@ msgstr "Tilføj Signal" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Add Input Port" +msgstr "Tilføj punkt" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Tilføj punkt" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Fjern punkt" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Fjern punkt" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Change Expression" msgstr "Skift udtryk" @@ -11370,10 +11432,20 @@ msgid "Add Preload Node" msgstr "Tilføj Preload Node" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Tilføj Node(r) fra Tree" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Tilføj Getter Egenskab" @@ -11399,6 +11471,11 @@ msgstr "Forbind Nodes" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Forbind Nodes" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Forbind Nodes" @@ -11432,6 +11509,27 @@ msgid "Paste VisualScript Nodes" msgstr "Indsæt VisualScript Nodes" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Omdøb Funktion" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Fjern Funktion" @@ -11456,16 +11554,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Basis Type:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Medlemmer:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Tilgængelige Noder:" +#, fuzzy +msgid "function_name" +msgstr "Funktioner:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11491,6 +11586,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Omdøb Funktion" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Opdater" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Medlemmer" @@ -11589,6 +11694,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Vælg enhed fra listen" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11691,6 +11800,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12304,10 +12417,6 @@ msgstr "" "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/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12339,6 +12448,16 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Konstanter kan ikke ændres." +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Tilføj punkt" + +#~ msgid "Base Type:" +#~ msgstr "Basis Type:" + +#~ msgid "Available Nodes:" +#~ msgstr "Tilgængelige Noder:" + #~ msgid "Methods:" #~ msgstr "Metoder:" @@ -12453,9 +12572,6 @@ msgstr "Konstanter kan ikke ændres." #~ msgid "Go to parent folder" #~ msgstr "GÃ¥ til overliggende mappe" -#~ msgid "Select device from the list" -#~ msgstr "Vælg enhed fra listen" - #, fuzzy #~ msgid "Open Scene(s)" #~ msgstr "Ã…bn Scene" diff --git a/editor/translations/de.po b/editor/translations/de.po index bab1cae627..8c4a29f571 100644 --- a/editor/translations/de.po +++ b/editor/translations/de.po @@ -50,7 +50,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:51+0000\n" +"PO-Revision-Date: 2019-10-04 03:14+0000\n" "Last-Translator: So Wieso <sowieso@dukun.de>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/" "godot/de/>\n" @@ -104,32 +104,31 @@ msgstr "Im Aufruf von ‚%s‘:" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Mischen" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -395,6 +394,7 @@ msgstr "%d NEUE Spuren erstellen und Schlüsselbilder hinzufügen?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Erstellen" @@ -538,21 +538,11 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Achtung: Es wird eine importierte Animation bearbeitet" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Alles auswählen" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Nichts auswählen" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" -"Es ist kein Pfad zu einem Animationsspieler mit Animationen festgelegt " -"worden." +"Ein AnimationPlayer-Node auswählen um Animationen zu erzeugen oder zu " +"bearbeiten." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -684,7 +674,8 @@ msgid "Scale Ratio:" msgstr "Skalierungsverhältnis:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Zu kopierende Spuren auswählen:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -696,6 +687,11 @@ msgstr "Zu kopierende Spuren auswählen:" msgid "Copy" msgstr "Kopieren" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Nichts auswählen" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Tonspurclip hinzufügen" @@ -1020,7 +1016,7 @@ msgid "Resource" msgstr "Ressource" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Pfad" @@ -1294,9 +1290,8 @@ msgid "Delete Bus Effect" msgstr "Audiobuseffekt löschen" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Audiobus, Drag & Drop zum Umsortieren." +msgstr "Mittels Drag&Drop umordnen." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1487,7 +1482,8 @@ msgstr "Autoload hinzufügen" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Pfad:" @@ -1541,7 +1537,7 @@ msgstr "Ordner erstellen" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Name:" @@ -1938,6 +1934,7 @@ msgid "Class:" msgstr "Klasse:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Erbt von:" @@ -1946,9 +1943,8 @@ msgid "Inherited by:" msgstr "Vererbt an:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Kurze Beschreibung:" +msgstr "Kurze Beschreibung" #: editor/editor_help.cpp msgid "Properties" @@ -1979,9 +1975,8 @@ msgid "Class Description" msgstr "Klassenbeschreibung" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Anleitungen im Netz:" +msgstr "Anleitungen im Netz" #: editor/editor_help.cpp msgid "" @@ -2104,7 +2099,7 @@ msgstr "Start" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2120,19 +2115,19 @@ msgstr "Node" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "Eingehender RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "Eingehender RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "Ausgehender RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "Ausgehender RSET" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2731,17 +2726,16 @@ msgid "Project Settings..." msgstr "Projekteinstellungen..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Version:" +msgstr "Versionsverwaltung" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Versionsverwaltung einrichten" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Versionsverwaltung beenden" #: editor/editor_node.cpp msgid "Export..." @@ -2806,7 +2800,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Visible Collision Shapes" -msgstr "Collision Shapes sichtbar" +msgstr "Collision-Shapes sichtbar" #: editor/editor_node.cpp msgid "" @@ -3016,7 +3010,7 @@ msgstr "Inspektor" msgid "Expand Bottom Panel" msgstr "Unteres Panel vergrößern" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Ausgabe" @@ -3043,19 +3037,25 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Hiermit wird der Projektordner für beliebige Android-Builds eingerichtet in " +"dem das Quell-Template nach „res://android/build“ installiert wird.\n" +"Danach können eigene Modifikationen vorgenommen und ein eigens APK " +"exportiert werden (Module hinzufügen, AndroidManifest.xml ändern, usw.).\n" +"Achtung: Um eigene Builds, statt den vorgefertigten zu generieren, muss die " +"„Use Custom Build“-Option in den Android-Export-Voreinstellungen aktiviert " +"sein." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" "Remove the \"res://android/build\" directory manually before attempting this " "operation again." msgstr "" -"Android-Build-Vorlage wurde bereits installiert und wird nicht " -"überschrieben.\n" -"Zur Ausführung dieses Befehls muss das „build“-Verzeichnis manuell gelöscht " -"werden." +"Die Android-Build-Vorlage wurde bereits für dieses Projekt installiert und " +"wird nicht überschrieben.\n" +"Zur Ausführung dieses Befehls muss das „res://android/build“-Verzeichnis " +"manuell gelöscht werden." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3118,9 +3118,8 @@ msgid "Open the previous Editor" msgstr "Vorigen Editor öffnen" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Keine Quelle für Oberfläche angegeben." +msgstr "Keine Unter-Ressourcen gefunden." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3131,9 +3130,8 @@ msgid "Thumbnail..." msgstr "Vorschau..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Offenes Skript:" +msgstr "Haupt-Skript:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3269,6 +3267,10 @@ msgstr "Viewport auswählen" msgid "New Script" msgstr "Neues Skript" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Skript erweitern" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Neues %s" @@ -3295,13 +3297,6 @@ msgstr "Einfügen" msgid "Convert To %s" msgstr "Umwandeln zu %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Editor öffnen" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Ausgewähltes Node ist kein Viewport!" @@ -3964,9 +3959,8 @@ msgid "Import As:" msgstr "Importiere als:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "Vorlagen" +msgstr "Vorlage" #: editor/import_dock.cpp msgid "Reimport" @@ -4095,7 +4089,7 @@ msgstr "Pluginname:" msgid "Subfolder:" msgstr "Unterverzeichnis:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Sprache:" @@ -4237,6 +4231,12 @@ msgstr "Punkt" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Editor öffnen" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Animations-Node öffnen" @@ -4584,7 +4584,6 @@ msgstr "Animationsname:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Fehler!" @@ -4757,6 +4756,8 @@ msgid "Current:" msgstr "Laufend:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Eingang hinzufügen" @@ -4961,6 +4962,10 @@ msgid "All" msgstr "Alle" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Importieren…" @@ -5254,26 +5259,32 @@ msgid "Pan Mode" msgstr "Schwenkmodus" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Ausführungsmodus:" +msgstr "Linealmodus" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Einrasten umschalten." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Einrasten aktivieren" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Einrasteinstellungen" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Einrasten umschalten." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Am Gitter einrasten" +#, fuzzy +msgid "Use Grid Snap" +msgstr "Gitter-Einrasten" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Einrasteinstellungen" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5363,8 +5374,8 @@ msgid "View" msgstr "Ansicht" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Raster anzeigen" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5631,6 +5642,11 @@ msgstr "Lineare Kurventangente umschalten" msgid "Hold Shift to edit tangents individually" msgstr "Umsch halten um Tangenten einzeln zu bearbeiten" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Rechtsklick: Punkt löschen" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "GI Sonde vorrendern" @@ -6271,6 +6287,10 @@ msgid "Grid" msgstr "Gitter" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Raster anzeigen" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Gitter einstellen:" @@ -6327,6 +6347,7 @@ msgstr "Instanz:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Typ:" @@ -6426,6 +6447,11 @@ msgid "Find Next" msgstr "Finde Nächstes" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Finde Vorheriges" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Skripte filtern" @@ -6695,6 +6721,11 @@ msgstr "Haltepunkte" msgid "Cut" msgstr "Ausschneiden" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Alles auswählen" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Zeile löschen" @@ -6752,10 +6783,6 @@ msgid "Auto Indent" msgstr "Automatische Einrückung" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Finde Vorheriges" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "In Dateien suchen..." @@ -7080,6 +7107,11 @@ msgid "Freelook Speed Modifier" msgstr "Freisicht Geschwindigkeitsregler" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Freisicht Geschwindigkeitsregler" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7120,6 +7152,10 @@ msgid "Use Local Space" msgstr "Lokalkoordinaten verwenden" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Einrasten aktivieren" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Sicht von unten" @@ -7348,6 +7384,11 @@ msgid "Simplification: " msgstr "Vereinfachung: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Wachsen (Pixel): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Wachsen (Pixel): " @@ -7396,9 +7437,8 @@ msgid "(empty)" msgstr "(leer)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Frame einfügen" +msgstr "Frame verschieben" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7715,13 +7755,13 @@ msgid "Enable Priority" msgstr "Priorität aktivieren" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Dateien filtern..." +msgstr "Kacheln filtern" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." msgstr "" +"Dieses TileMap benötigt eine TileSet-Ressource um benutzt werden zu können." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7860,6 +7900,8 @@ msgstr "Kachelnamen anzeigen (Alt-Taste halten)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Eine Textur in der rechten Leiste hinzufügen oder auswählen um die ihr " +"zugeordneten Kacheln zu bearbeiten." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -8035,92 +8077,80 @@ msgid "TileSet" msgstr "TileSet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Name des Eltern-Nodes, falls vorhanden" +msgstr "Keine Versionsverwaltungserweiterungen verfügbar." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Fehler" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "Kein Name angegeben" +msgstr "Es wurde keine Protokollnachricht angegeben" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "Es wurden keine Dateien zum protokollieren vorgemerkt" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Community (Gemeinschaft)" +msgstr "Speicherpunkt" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "Versionsverwaltungserweiterung ist nicht initialisiert" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "Versionsverwaltungssystem" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Kapitalisiere" +msgstr "Initialisieren" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "Speicherauswahlbereich" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Neues Rechteck erstellen." +msgstr "Neue Veränderungen beachten" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Ändern" +msgstr "Veränderungen" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Bearbeitet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Umbenennen" +msgstr "Umbenannt" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Löschen" +msgstr "Gelöscht" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Ändern" +msgstr "Dateitypänderung" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Ausgewähltes löschen" +msgstr "Ausgewähltes zum speichern vormerken" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Alle speichern" +msgstr "Alles zum speichern vormerken" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Protokollnachricht hinzufügen" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Skriptänderungen synchronisieren" +msgstr "Änderungen als Speicherpunkt sichern" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8130,26 +8160,24 @@ msgstr "Status" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" msgstr "" +"Dateiänderungen anzeigen bevor sie nach der aktuellsten Version gespeichert " +"werden" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No file diff is active" -msgstr "Keine Dateien ausgewählt!" +msgstr "Kein Dateiunterschied ist aktiv" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "Änderungen in Dateiänderung verfolgen" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(Nur GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Eingang hinzufügen +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Ausgang hinzufügen +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8165,6 +8193,11 @@ msgid "Boolean" msgstr "Boolean" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "Samples" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Eingangsschnittstelle hinzufügen" @@ -8381,12 +8414,11 @@ msgstr "" "oder falsch ist." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" -"Gibt einen geeigneten Vektor zurück je nach dem ob der übergebene Wert wahr " -"oder falsch ist." +"Gibt ein entsprechendes Skalar zurück je nach dem ob der übergebene Wert " +"wahr oder falsch ist." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the comparison between two parameters." @@ -9099,15 +9131,19 @@ msgid "Resources to export:" msgstr "Zu exportierende Ressourcen:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filter um Nicht-Ressourcendateien zu exportieren (durch Kommata getrennt, z." "B.: *.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filter um vom Export auszuschließen (durch Kommata getrennt, z.B.: *.json, *." "txt)" @@ -9708,9 +9744,8 @@ msgid "Settings saved OK." msgstr "Einstellungen gespeichert OK." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Eingabeaktionsereignis hinzufügen" +msgstr "Eingabeaktionsereignis verschoben" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -10080,9 +10115,8 @@ msgid "Instance Scene(s)" msgstr "Instanz-Szene(n)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Speichere Verzweigung als Szene" +msgstr "Mit verzweigter Szene ersetzen" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10127,23 +10161,20 @@ msgid "Make node as Root" msgstr "Node zur Szenenwurzel machen" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Nodes löschen" +msgstr "%d Nodes löschen?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "Entferne Shade-Graph-Node(s)" +msgstr "Das Wurzelnode „%s“ löschen?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "Node „%s“ und Unterobjekte löschen?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Nodes löschen" +msgstr "Node „%s“ löschen?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10166,12 +10197,13 @@ msgstr "" "dieses Nodes wieder in ihren Ausgangszustand zurückgesetzt." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "bearbeitbare Unterobjekte" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Als Platzhalter laden" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Wenn „Editierbare Instanz“ deaktiviert wird, werden alle Eigenschaften " +"dieses Nodes wieder in ihren Ausgangszustand zurückgesetzt." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10246,6 +10278,14 @@ msgid "Clear Inheritance" msgstr "Leere Vererbung" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "bearbeitbare Unterobjekte" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Als Platzhalter laden" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Dokumentation öffnen" @@ -10262,10 +10302,6 @@ msgid "Change Type" msgstr "Typ ändern" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Skript erweitern" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "Node unter neues Node hängen" @@ -10507,23 +10543,18 @@ msgid "Will load an existing script file." msgstr "Dies wird eine bestehende Skriptdatei laden." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Sprache" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Erbt von" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Klassenname" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Vorlage" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Eingebettetes Skript" #: editor/script_create_dialog.cpp @@ -10539,38 +10570,32 @@ msgid "Bytes:" msgstr "Bytes:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "Warnungen:" +msgstr "Warnung:" #: editor/script_editor_debugger.cpp msgid "Error:" msgstr "Fehler:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Fehlermeldung kopieren" +msgstr "C++-Fehler" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Fehler:" +msgstr "C++-Fehler:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Quelle" +msgstr "C++-Quellcode" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Quelle" +msgstr "Quelle:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Quelle" +msgstr "C++-Quellcode:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10581,18 +10606,16 @@ msgid "Errors" msgstr "Fehler" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Unterprozess verbunden" +msgstr "Unterprozess verbunden." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Fehlermeldung kopieren" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Haltepunkte" +msgstr "Haltepunkte auslassen" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10611,9 +10634,8 @@ msgid "Profiler" msgstr "Profiler" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Profil exportieren" +msgstr "Netzwerk-Profiler" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10837,7 +10859,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Zeichenkette der Länge 1 erwartet (ein Zeichen)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10994,13 +11016,12 @@ msgid "Pick Distance:" msgstr "Auswahlradius:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Methoden filtern" +msgstr "Meshes filtern" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." -msgstr "" +msgstr "GridMap zu MeshLibrary hinzufügen um ihre Meshes benutzen zu können." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11177,6 +11198,11 @@ msgid "Add Function" msgstr "Funktion hinzufügen" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Eingangsschnittstelle entfernen" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Variable hinzufügen" @@ -11185,6 +11211,26 @@ msgid "Add Signal" msgstr "Signal hinzufügen" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Eingangsschnittstelle hinzufügen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Ausgangsschnittstelle hinzufügen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Eingangsschnittstelle entfernen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Ausgangsschnittstelle entfernen" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Ausdruck ändern" @@ -11229,10 +11275,20 @@ msgid "Add Preload Node" msgstr "Preload-Node hinzufügen" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Node(s) aus Szenenbaum hinzufügen" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Getter-Eigenschaft hinzufügen" @@ -11257,6 +11313,11 @@ msgid "Connect Nodes" msgstr "Nodes verbinden" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Trenne Graph-Nodes" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Node-Daten verbinden" @@ -11289,6 +11350,28 @@ msgid "Paste VisualScript Nodes" msgstr "VisualScript-Nodes einfügen" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Das Function-Node kann nicht kopiert werden." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Funktion umbenennen" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Funktion entfernen" @@ -11309,21 +11392,17 @@ msgid "Editing Signal:" msgstr "bearbeite Signal:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "Lokal machen" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Basistyp:" +msgstr "Make-Werkzeug:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Mitglieder:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Verfügbare Nodes:" +#, fuzzy +msgid "function_name" +msgstr "Funktion:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11347,6 +11426,16 @@ msgid "Cut Nodes" msgstr "Nodes trennen" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Funktion umbenennen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Aktualisieren" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Mitglied bearbeiten" @@ -11446,6 +11535,10 @@ msgid "The package must have at least one '.' separator." msgstr "Das Paket muss mindestens einen Punkt-Unterteiler ‚.‘ haben." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Gerät aus Liste auswählen" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "Das ADB-Programm wurde nicht in den Editoreinstellungen konfiguriert." @@ -11470,13 +11563,12 @@ msgstr "" "Ungültiger Android-SDK-Pfad für eigene Builds in den Editoreinstellungen." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"Es ist kein Android-Projekt zum Kompilieren installiert worden. Es kann im " -"Editormenü installiert werden." +"Es wurde keine Android-Buildvorlage für dieses Projekt installiert. Es kann " +"im Projektmenü installiert werden." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11567,6 +11659,10 @@ msgid "Required icon is not specified in the preset." msgstr "Benötigtes Icon wurde nicht in der Vorlage festgelegt." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Im Browser ausführen" @@ -12253,10 +12349,6 @@ msgstr "" "Eigenschaft ‚Render Target‘ des Viewports aktiviert und seine Textur " "irgendeinem Node zum Anzeigen zugewiesen werden." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Eingang" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Ungültige Quelle für Vorschau." @@ -12285,6 +12377,27 @@ msgstr "Varyings können nur in Vertex-Funktion zugewiesen werden." msgid "Constants cannot be modified." msgstr "Konstanten können nicht verändert werden." +#~ msgid "Snap to Grid" +#~ msgstr "Am Gitter einrasten" + +#~ msgid "Add input +" +#~ msgstr "Eingang hinzufügen +" + +#~ msgid "Language" +#~ msgstr "Sprache" + +#~ msgid "Inherits" +#~ msgstr "Erbt von" + +#~ msgid "Base Type:" +#~ msgstr "Basistyp:" + +#~ msgid "Available Nodes:" +#~ msgstr "Verfügbare Nodes:" + +#~ msgid "Input" +#~ msgstr "Eingang" + #~ msgid "Properties:" #~ msgstr "Eigenschaften:" @@ -12677,9 +12790,6 @@ msgstr "Konstanten können nicht verändert werden." #~ msgid "Go to parent folder" #~ msgstr "Gehe zu übergeordnetem Ordner" -#~ msgid "Select device from the list" -#~ msgstr "Gerät aus Liste auswählen" - #~ msgid "Open Scene(s)" #~ msgstr "Szene(n) öffnen" @@ -12920,9 +13030,6 @@ msgstr "Konstanten können nicht verändert werden." #~ msgid "Warning" #~ msgstr "Warnung" -#~ msgid "Function:" -#~ msgstr "Funktion:" - #~ msgid "Variable" #~ msgstr "Variable" @@ -12989,9 +13096,6 @@ msgstr "Konstanten können nicht verändert werden." #~ msgid "Connect Graph Nodes" #~ msgstr "Verbinde Graph-Nodes" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Trenne Graph-Nodes" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Entferne Shader-Graph-Node" @@ -14130,9 +14234,6 @@ msgstr "Konstanten können nicht verändert werden." #~ msgid "Group" #~ msgstr "Gruppe" -#~ msgid "Samples" -#~ msgstr "Samples" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "Audio-Umwandlungs-Modus: (.wav-Dateien):" diff --git a/editor/translations/de_CH.po b/editor/translations/de_CH.po index e61cbeec84..8498847001 100644 --- a/editor/translations/de_CH.po +++ b/editor/translations/de_CH.po @@ -369,6 +369,7 @@ msgstr "Erstelle %d in neuer Ebene inklusiv Bild?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -500,16 +501,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Node(s) löschen" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -648,7 +639,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -660,6 +651,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Node(s) löschen" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -988,7 +984,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1453,7 +1449,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1507,7 +1504,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1913,6 +1910,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2939,7 +2937,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3184,6 +3182,11 @@ msgstr "" msgid "New Script" msgstr "Script hinzufügen" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Script hinzufügen" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3211,14 +3214,6 @@ msgstr "" msgid "Convert To %s" msgstr "Verbindung zu Node:" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Verzeichnis öffnen" - #: editor/editor_properties.cpp editor/property_editor.cpp #, fuzzy msgid "Selected node is not a Viewport!" @@ -4032,7 +4027,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4178,6 +4173,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Verzeichnis öffnen" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4547,7 +4549,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4725,6 +4726,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4932,6 +4935,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importierte Projekte" @@ -5230,20 +5237,23 @@ msgid "Ruler Mode" msgstr "TimeScale-Node" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5338,8 +5348,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5611,6 +5620,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6266,6 +6279,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6322,6 +6339,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6430,6 +6448,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Node erstellen" @@ -6704,6 +6727,11 @@ msgstr "Bild einfügen" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Delete Line" @@ -6766,10 +6794,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -7098,6 +7122,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7131,6 +7159,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7366,6 +7398,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8192,14 +8228,10 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" +msgid "Add Output" msgstr "Script hinzufügen" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" msgstr "" @@ -8212,6 +8244,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Script hinzufügen" @@ -9091,12 +9127,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10114,11 +10152,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10198,6 +10234,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -10215,11 +10259,6 @@ msgstr "Typ ändern" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Script hinzufügen" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Node erstellen" @@ -10460,25 +10499,18 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" +msgid "Template:" msgstr "Ungültige Bilder löschen" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Script hinzufügen" #: editor/script_create_dialog.cpp #, fuzzy @@ -11133,6 +11165,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Ungültige Bilder löschen" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11143,6 +11180,26 @@ msgstr "Script hinzufügen" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Add Input Port" +msgstr "Script hinzufügen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Script hinzufügen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Ungültige Bilder löschen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Ungültige Bilder löschen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Change Expression" msgstr "Typ ändern" @@ -11186,11 +11243,21 @@ msgid "Add Preload Node" msgstr "Node" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp #, fuzzy msgid "Add Node(s) From Tree" msgstr "Node von Szene" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11220,6 +11287,11 @@ msgstr "Verbindung zu Node:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Verbindung zu Node:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Verbindung zu Node:" @@ -11255,6 +11327,27 @@ msgid "Paste VisualScript Nodes" msgstr "Node erstellen" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Node erstellen" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11281,18 +11374,12 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy -msgid "Base Type:" -msgstr "Typ ändern" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy -msgid "Available Nodes:" -msgstr "TimeScale-Node" +msgid "function_name" +msgstr "" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11316,6 +11403,14 @@ msgid "Cut Nodes" msgstr "Node erstellen" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp #, fuzzy msgid "Edit Member" msgstr "Node Filter editieren" @@ -11412,6 +11507,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11512,6 +11611,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12084,10 +12187,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" @@ -12117,6 +12216,14 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Base Type:" +#~ msgstr "Typ ändern" + +#, fuzzy +#~ msgid "Available Nodes:" +#~ msgstr "TimeScale-Node" + +#, fuzzy #~ msgid "Theme Properties:" #~ msgstr "Node erstellen" diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot index ca6da01f4c..47ac024f4d 100644 --- a/editor/translations/editor.pot +++ b/editor/translations/editor.pot @@ -343,6 +343,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -468,15 +469,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -611,7 +603,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -623,6 +615,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -939,7 +935,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1394,7 +1390,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1448,7 +1445,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1832,6 +1829,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2822,7 +2820,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3058,6 +3056,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3084,13 +3086,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3863,7 +3858,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -3998,6 +3993,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4339,7 +4340,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4507,6 +4507,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4711,6 +4713,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -4989,20 +4995,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5092,8 +5101,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5353,6 +5361,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5982,6 +5994,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6038,6 +6054,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6136,6 +6153,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6401,6 +6423,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6458,10 +6485,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6781,6 +6804,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6814,6 +6841,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7040,6 +7071,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7801,11 +7836,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7821,6 +7852,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8677,12 +8712,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9664,11 +9701,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9742,6 +9777,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9758,10 +9801,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -9988,23 +10027,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10638,6 +10669,10 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Delete input port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10646,6 +10681,22 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Add Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10686,10 +10737,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10714,6 +10775,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10746,6 +10811,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10770,15 +10855,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10802,6 +10883,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10896,6 +10985,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -10995,6 +11088,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11532,10 +11629,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/el.po b/editor/translations/el.po index 9dbb9c49e6..451a24bb00 100644 --- a/editor/translations/el.po +++ b/editor/translations/el.po @@ -355,6 +355,7 @@ msgstr "ΔημιουÏγία %d νÎων κομματιών και εισαγωΠ#: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "ΔημιουÏγία" @@ -498,15 +499,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Î Ïοσοχή: ΕπεξεÏγασία εισαγμÎνης κίνησης" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Επιλογή όλων" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Αποεπιλογή Όλων" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -644,7 +636,8 @@ msgid "Scale Ratio:" msgstr "Λόγος μεγÎθυνσης:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Επιλογή κομματιών για αντιγÏαφή:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -656,6 +649,11 @@ msgstr "Επιλογή κομματιών για αντιγÏαφή:" msgid "Copy" msgstr "ΑντιγÏαφή" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Αποεπιλογή Όλων" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Î Ïοσθήκη αποσπάσματος ήχου" @@ -984,7 +982,7 @@ msgid "Resource" msgstr "Î ÏŒÏος" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "ΔιαδÏομή" @@ -1449,7 +1447,8 @@ msgstr "Î Ïοσθήκη AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "ΔιαδÏομή:" @@ -1503,7 +1502,7 @@ msgstr "ΔημιουÏγία φακÎλου" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Όνομα:" @@ -1899,6 +1898,7 @@ msgid "Class:" msgstr "Κλάση:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "ΚληÏονομεί:" @@ -2987,7 +2987,7 @@ msgstr "ΕπιθεωÏητής" msgid "Expand Bottom Panel" msgstr "Ανάπτυξη κάτω πλαισίου" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Έξοδος" @@ -3239,6 +3239,10 @@ msgstr "ΕπιλÎξτε Îνα Viewport" msgid "New Script" msgstr "ÎÎα ΔÎσμη ΕνεÏγειών" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "ΕπÎκταση ΔÎσμης ΕνεÏγειών" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "ÎÎο %s" @@ -3265,13 +3269,6 @@ msgstr "Επικόλληση" msgid "Convert To %s" msgstr "ΜετατÏοπή σε %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Άνοιγμα επεξεÏγαστή" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Ο επιλεγμÎνος κόμβος δεν είναι Viewport!" @@ -4075,7 +4072,7 @@ msgstr "Όνομα Ï€ÏοσθÎτου:" msgid "Subfolder:" msgstr "Υποφάκελος:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Γλώσσα:" @@ -4216,6 +4213,12 @@ msgstr "Σημείο" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Άνοιγμα επεξεÏγαστή" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Άνοιγμα κόμβου κίνησης" @@ -4565,7 +4568,6 @@ msgstr "Όνομα κίνησης:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Σφάλμα!" @@ -4738,6 +4740,8 @@ msgid "Current:" msgstr "ΤÏÎχων:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Î Ïοσθήκη εισόδου" @@ -4948,6 +4952,10 @@ msgid "All" msgstr "Όλα" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Εκ νÎου εισαγωγή..." @@ -5250,21 +5258,28 @@ msgid "Ruler Mode" msgstr "ΛειτουÏγία εκτÎλεσης:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Εναλλαγή κουμπώματος." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "ΧÏήση κουμπώματος" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "ΕπιλογÎÏ‚ κουμπώματος" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Εναλλαγή κουμπώματος." + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Use Grid Snap" +msgstr "ΚοÏμπωμα στο πλÎγμα" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "ΚοÏμπωμα στο ΠλÎγμα" +msgid "Snapping Options" +msgstr "ΕπιλογÎÏ‚ κουμπώματος" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5353,8 +5368,8 @@ msgid "View" msgstr "ΚάμεÏα" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Εμφάνιση πλÎγματος" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5621,6 +5636,11 @@ msgstr "Εναλλαγή γÏαμμικής εφαπτομÎνης καμπÏλΠmsgid "Hold Shift to edit tangents individually" msgstr "Πατήστε το Shift για να επεξεÏγαστείτε εφαπτομÎνες μεμονωμÎνα" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Δεξί κλικ: ΔιαγÏαφή σημείου" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Î Ïοετοιμασία διεÏεÏνησης GI" @@ -6267,6 +6287,10 @@ msgid "Grid" msgstr "ΠλÎγμα" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Εμφάνιση πλÎγματος" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Î ÏοσαÏμογή ΠλÎγματος:" @@ -6323,6 +6347,7 @@ msgstr "Στιγμιότυπο:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "ΤÏπος:" @@ -6423,6 +6448,11 @@ msgid "Find Next" msgstr "ΕÏÏεση επόμενου" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "ΈυÏεση Ï€ÏοηγοÏμενου" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "ΦιλτÏάÏισμα δεσμών ενεÏγειών" @@ -6694,6 +6724,11 @@ msgstr "Σημεία Διακοπής" msgid "Cut" msgstr "Αποκοπή" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Επιλογή όλων" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "ΔιαγÏαφή γÏαμμής" @@ -6752,10 +6787,6 @@ msgid "Auto Indent" msgstr "Αυτόματη στοιχειοθÎτηση" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "ΈυÏεση Ï€ÏοηγοÏμενου" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "ΕÏÏεση σε ΑÏχεία..." @@ -7081,6 +7112,11 @@ msgid "Freelook Speed Modifier" msgstr "ΤαχÏτητα ελεÏθεÏου κοιτάγματος" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "ΤαχÏτητα ελεÏθεÏου κοιτάγματος" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7121,6 +7157,10 @@ msgid "Use Local Space" msgstr "ΛειτουÏγία Ï„Î¿Ï€Î¹ÎºÎ¿Ï Ï‡ÏŽÏου (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "ΧÏήση κουμπώματος" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Κάτω όψη" @@ -7348,6 +7388,11 @@ msgid "Simplification: " msgstr "Απλοποίηση: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "ΑÏξηση (Εικονοστοιχεία): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "ΑÏξηση (Εικονοστοιχεία): " @@ -8146,11 +8191,8 @@ msgid "(GLES3 only)" msgstr "(Μόνο GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Î Ïοσθήκη εισόδου +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Î Ïοσθήκη εξόδου +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8166,6 +8208,11 @@ msgid "Boolean" msgstr "Λογική Τιμή" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "Î Ïοσθήκη δείγματος" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Î Ïοσθήκη θÏÏας εισόδου" @@ -9099,15 +9146,19 @@ msgid "Resources to export:" msgstr "Î ÏŒÏοι για εξαγωγή:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "ΦίλτÏα για εξαγωγή για αÏχεία που δεν είναι πόÏοι (χωÏισμÎνα με κόμμα Ï€.χ. *." "json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "ΦίλτÏα για την εξαίÏεση αÏχείων από το ÎÏγο (χωÏισμÎνα με κόμμα Ï€.χ. *.json, " "*.txt)" @@ -10166,12 +10217,13 @@ msgstr "" "του κόμβου στις Ï€ÏοεπιλογÎÏ‚ τους." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "ΕπεξεÏγάσιμα παιδιά" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "ΦόÏτωση ως μÎσο κÏάτησης θÎσης" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Η απενεÏγοποίηση του «editable_instance» θα επαναφÎÏει όλες τις ιδιότητες " +"του κόμβου στις Ï€ÏοεπιλογÎÏ‚ τους." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10249,6 +10301,14 @@ msgid "Clear Inheritance" msgstr "ΕκκαθάÏιση κληÏονομικότητας" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "ΕπεξεÏγάσιμα παιδιά" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "ΦόÏτωση ως μÎσο κÏάτησης θÎσης" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Άνοιγμα ΤεκμηÏίωσης" @@ -10265,10 +10325,6 @@ msgid "Change Type" msgstr "Αλλαγή Ï„Ïπου" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "ΕπÎκταση ΔÎσμης ΕνεÏγειών" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "ΕπαναπÏοσδιοÏισμός ΓονÎα" @@ -10513,23 +10569,18 @@ msgid "Will load an existing script file." msgstr "Θα φοÏτώσει υπαÏκτό αÏχείο δÎσμης ενεÏγειών." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Γλώσσα" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "ΚληÏονομεί" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Όνομα κλάσης" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Î Ïότυπο" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Ενσωμάτωση" #: editor/script_create_dialog.cpp @@ -11204,6 +11255,11 @@ msgid "Add Function" msgstr "Î Ïοσθήκη συνάÏτησης" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "ΑφαίÏεση θÏÏας εισόδου" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Î Ïοσθήκη μεταβλητής" @@ -11212,6 +11268,26 @@ msgid "Add Signal" msgstr "Î Ïοσθήκη σήματος" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Î Ïοσθήκη θÏÏας εισόδου" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Î Ïοσθήκη θÏÏας εξόδου" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "ΑφαίÏεση θÏÏας εισόδου" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "ΑφαίÏεση θÏÏας εξόδου" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Αλλαγή ÎκφÏασης" @@ -11258,10 +11334,20 @@ msgid "Add Preload Node" msgstr "Î ÏοσθÎστε Îναν κόμβο preload" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Î ÏοσθÎστε κόμβο/-ους από δÎντÏο" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Î ÏοσθÎστε ιδιότητα Getter" @@ -11287,6 +11373,11 @@ msgstr "ΣÏνδεση κόμβων" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "ΑποσÏνδεση κόμβων γÏαφήματος" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "ΣÏνδεση κόμβων" @@ -11321,6 +11412,28 @@ msgid "Paste VisualScript Nodes" msgstr "Επικόλληση κόμβων VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "ΑδÏνατη η αντιγÏαφή του κόμβου συνάÏτησης." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Μετονομασία συνάÏτησης" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "ΑφαίÏεση συνάÏτησης" @@ -11346,16 +11459,13 @@ msgid "Make Tool:" msgstr "Κάνε τοπικό" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "ΤÏπος βάσης:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "ΜÎλη:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "ΔιαθÎσιμοι κόμβοι:" +#, fuzzy +msgid "function_name" +msgstr "ΣυνάÏτηση:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11380,6 +11490,16 @@ msgstr "Αποκοπή κόμβων" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Μετονομασία συνάÏτησης" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Αναναίωση" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "ΜÎλη" @@ -11483,6 +11603,10 @@ msgid "The package must have at least one '.' separator." msgstr "Το πακÎτο Ï€ÏÎπει να Îχει τουλάχιστον Îναν '.' διαχωÏιστή." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "ΕπιλÎξτε συσκευή από την λίστα" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" "Το εκτελÎσιμο αÏχείο ADB δεν Îχει Ïυθμιστεί στις Ρυθμίσεις ΕπεξεÏγαστή." @@ -11612,6 +11736,10 @@ msgid "Required icon is not specified in the preset." msgstr "Το απαιτοÏμενο εικονίδιο δεν Îχει καθοÏιστεί στην Ï€Ïοεπιλογή." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "ΕκτÎλεση στον πεÏιηγητή" @@ -12289,10 +12417,6 @@ msgstr "" "μÎγεθος. Αλλιώς, κάντε το Îνα RenderTarget και οÏίστε το internal texture σε " "Îναν κόμβο για απεικόνιση." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Είσοδος" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12324,6 +12448,27 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Οι σταθεÏÎÏ‚ δεν μποÏοÏν να Ï„ÏοποποιηθοÏν." +#~ msgid "Snap to Grid" +#~ msgstr "ΚοÏμπωμα στο ΠλÎγμα" + +#~ msgid "Add input +" +#~ msgstr "Î Ïοσθήκη εισόδου +" + +#~ msgid "Language" +#~ msgstr "Γλώσσα" + +#~ msgid "Inherits" +#~ msgstr "ΚληÏονομεί" + +#~ msgid "Base Type:" +#~ msgstr "ΤÏπος βάσης:" + +#~ msgid "Available Nodes:" +#~ msgstr "ΔιαθÎσιμοι κόμβοι:" + +#~ msgid "Input" +#~ msgstr "Είσοδος" + #~ msgid "Properties:" #~ msgstr "Ιδιότητες:" @@ -12718,9 +12863,6 @@ msgstr "Οι σταθεÏÎÏ‚ δεν μποÏοÏν να Ï„ÏÎ¿Ï€Î¿Ï€Î¿Î¹Î·Î¸Î¿Ï #~ msgid "Go to parent folder" #~ msgstr "Πήγαινε στον γονικό φάκελο" -#~ msgid "Select device from the list" -#~ msgstr "ΕπιλÎξτε συσκευή από την λίστα" - #~ msgid "Open Scene(s)" #~ msgstr "Άνοιγμα σκηνής" @@ -12964,9 +13106,6 @@ msgstr "Οι σταθεÏÎÏ‚ δεν μποÏοÏν να Ï„ÏÎ¿Ï€Î¿Ï€Î¿Î¹Î·Î¸Î¿Ï #~ msgid "Warning" #~ msgstr "Î Ïοειδοποίηση" -#~ msgid "Function:" -#~ msgstr "ΣυνάÏτηση:" - #~ msgid "Variable" #~ msgstr "Μεταβλητή" @@ -13030,9 +13169,6 @@ msgstr "Οι σταθεÏÎÏ‚ δεν μποÏοÏν να Ï„ÏÎ¿Ï€Î¿Ï€Î¿Î¹Î·Î¸Î¿Ï #~ msgid "Connect Graph Nodes" #~ msgstr "ΣÏνδεση κόμβων γÏαφήματος" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "ΑποσÏνδεση κόμβων γÏαφήματος" - #~ msgid "Remove Shader Graph Node" #~ msgstr "ΑφαίÏεση κόμβου γÏαφήματος" @@ -13854,9 +13990,6 @@ msgstr "Οι σταθεÏÎÏ‚ δεν μποÏοÏν να Ï„ÏÎ¿Ï€Î¿Ï€Î¿Î¹Î·Î¸Î¿Ï #~ msgid "ERROR: Couldn't load sample!" #~ msgstr "ΣΦΑΛΜΑ: Δεν ήταν δυνατή η φόÏτωση δείγματος!" -#~ msgid "Add Sample" -#~ msgstr "Î Ïοσθήκη δείγματος" - #~ msgid "Rename Sample" #~ msgstr "Μετονομασία δείγματος" diff --git a/editor/translations/eo.po b/editor/translations/eo.po index a1906a2985..99654bd571 100644 --- a/editor/translations/eo.po +++ b/editor/translations/eo.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2019-09-15 20:01+0000\n" -"Last-Translator: Brandon Dyer <brandondyer64@gmail.com>\n" +"PO-Revision-Date: 2019-10-11 15:07+0000\n" +"Last-Translator: Teashrock <kajitsu22@gmail.com>\n" "Language-Team: Esperanto <https://hosted.weblate.org/projects/godot-engine/" "godot/eo/>\n" "Language: eo\n" @@ -355,6 +355,7 @@ msgstr "Fari %d NOVAJN vojetojn kaj enmeti Ålosilojn?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Krei" @@ -494,15 +495,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Averto: Redaktanti importis animadon" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Elektaro ĉiuj" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Elektaro nur" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -538,7 +530,7 @@ msgstr "FPS" #: editor/project_manager.cpp editor/project_settings_editor.cpp #: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp msgid "Edit" -msgstr "Editori" +msgstr "Editi" #: editor/animation_track_editor.cpp msgid "Animation properties." @@ -637,7 +629,8 @@ msgid "Scale Ratio:" msgstr "Skali RejÅo:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Elekti vojetojn por duplikati:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -649,6 +642,11 @@ msgstr "Elekti vojetojn por duplikati:" msgid "Copy" msgstr "Duplikati" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Elektaro nur" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Adici AÅdio-Vojeton Eltondaĵon" @@ -759,11 +757,11 @@ msgstr "" #: editor/connections_dialog.cpp msgid "Connect to Node:" -msgstr "Konektu al nodo:" +msgstr "Konekti al nodo:" #: editor/connections_dialog.cpp msgid "Connect to Script:" -msgstr "Konektu al skripto:" +msgstr "Konekti al skripto:" #: editor/connections_dialog.cpp msgid "From Signal:" @@ -777,7 +775,7 @@ msgstr "La sceno ne enhavas ajnan skriptojn." #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp msgid "Add" -msgstr "Aldonu" +msgstr "Aldoni" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/editor_feature_profile.cpp editor/groups_editor.cpp @@ -788,11 +786,11 @@ msgstr "Aldonu" #: editor/plugins/visual_shader_editor_plugin.cpp editor/project_manager.cpp #: editor/project_settings_editor.cpp msgid "Remove" -msgstr "Forigu" +msgstr "Forigi" #: editor/connections_dialog.cpp msgid "Add Extra Call Argument:" -msgstr "Aldonu alvoko argumento:" +msgstr "Aldoni alvoko argumento:" #: editor/connections_dialog.cpp msgid "Extra Call Arguments:" @@ -810,7 +808,8 @@ msgstr "Diferita" msgid "" "Defers the signal, storing it in a queue and only firing it at idle time." msgstr "" -"Prokrastas la signalon, memoras Äin en atendovico kaj nur pafas atende." +"Prokrastas la signalon, memoras Äin en atendovico kaj nur pafas Äin je " +"senokupa tempo." #: editor/connections_dialog.cpp msgid "Oneshot" @@ -837,7 +836,7 @@ msgstr "Ne povas konekti signalo" #: editor/run_settings_dialog.cpp editor/settings_config_dialog.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Close" -msgstr "FermiÄi" +msgstr "Fermi" #: editor/connections_dialog.cpp msgid "Connect" @@ -971,7 +970,7 @@ msgid "Resource" msgstr "Rimedo" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Vojo" @@ -1179,7 +1178,7 @@ msgstr "" #: editor/editor_asset_installer.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Success!" -msgstr "" +msgstr "Sukcesis!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp msgid "Install" @@ -1426,9 +1425,10 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" -msgstr "" +msgstr "Vojo:" #: editor/editor_autoload_settings.cpp msgid "Node Name:" @@ -1437,23 +1437,25 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp #: editor/editor_profiler.cpp editor/settings_config_dialog.cpp msgid "Name" -msgstr "" +msgstr "Nomo" #: editor/editor_autoload_settings.cpp msgid "Singleton" msgstr "" #: editor/editor_data.cpp +#, fuzzy msgid "Updating Scene" -msgstr "" +msgstr "Aktualas scenon" #: editor/editor_data.cpp msgid "Storing local changes..." msgstr "" #: editor/editor_data.cpp +#, fuzzy msgid "Updating scene..." -msgstr "" +msgstr "Aktualas scenon..." #: editor/editor_data.cpp editor/editor_properties.cpp msgid "[empty]" @@ -1475,19 +1477,19 @@ msgstr "" #: editor/filesystem_dock.cpp editor/project_manager.cpp #: scene/gui/file_dialog.cpp msgid "Create Folder" -msgstr "" +msgstr "Krei dosierujon" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" -msgstr "" +msgstr "Nomo:" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp msgid "Could not create folder." -msgstr "" +msgstr "Ne povis krei dosierujon." #: editor/editor_dir_dialog.cpp msgid "Choose" @@ -1529,33 +1531,37 @@ msgstr "" #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp msgid "Custom debug template not found." -msgstr "" +msgstr "Propra sencimiga Åablonon ne trovitis." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp msgid "Custom release template not found." -msgstr "" +msgstr "Propra eldona Åablono ne trovitis." #: editor/editor_export.cpp platform/javascript/export/export.cpp +#, fuzzy msgid "Template file not found:" -msgstr "" +msgstr "Åœablonan dosieron ne trovitis:" #: editor/editor_export.cpp +#, fuzzy msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"Sur 32-bita eksportoj la enigita PCK ne eblos esti pli granda ol 4 GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" -msgstr "" +msgstr "3D redaktilo" #: editor/editor_feature_profile.cpp msgid "Script Editor" -msgstr "" +msgstr "Skriptredaktilo" #: editor/editor_feature_profile.cpp +#, fuzzy msgid "Asset Library" -msgstr "" +msgstr "Biblioteko de aktivoj" #: editor/editor_feature_profile.cpp msgid "Scene Tree Editing" @@ -1563,7 +1569,7 @@ msgstr "" #: editor/editor_feature_profile.cpp msgid "Import Dock" -msgstr "" +msgstr "Enporti dokon" #: editor/editor_feature_profile.cpp msgid "Node Dock" @@ -1571,7 +1577,7 @@ msgstr "" #: editor/editor_feature_profile.cpp msgid "FileSystem and Import Docks" -msgstr "" +msgstr "Dosiersistema kaj enporta dokoj" #: editor/editor_feature_profile.cpp msgid "Erase profile '%s'? (no undo)" @@ -1618,8 +1624,9 @@ msgid "Enabled Classes:" msgstr "" #: editor/editor_feature_profile.cpp +#, fuzzy msgid "File '%s' format is invalid, import aborted." -msgstr "" +msgstr "Dosierformo de la '%s' estas malvalida, enporto ĉesiÄis." #: editor/editor_feature_profile.cpp msgid "" @@ -1640,23 +1647,24 @@ msgid "Current Profile:" msgstr "" #: editor/editor_feature_profile.cpp +#, fuzzy msgid "Make Current" -msgstr "" +msgstr "Nuntempigi" #: editor/editor_feature_profile.cpp #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/version_control_editor_plugin.cpp msgid "New" -msgstr "" +msgstr "Nova" #: editor/editor_feature_profile.cpp editor/editor_node.cpp #: editor/project_manager.cpp msgid "Import" -msgstr "" +msgstr "Enporti" #: editor/editor_feature_profile.cpp editor/project_export.cpp msgid "Export" -msgstr "" +msgstr "Eksporti" #: editor/editor_feature_profile.cpp msgid "Available Profiles:" @@ -1688,37 +1696,37 @@ msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select Current Folder" -msgstr "" +msgstr "Elekti aktualan dosierujon" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "File Exists, Overwrite?" -msgstr "" +msgstr "Dosiero ekzistas, superskribi?" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select This Folder" -msgstr "" +msgstr "Elekti ĉi tiun dosierujon" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "Copy Path" -msgstr "" +msgstr "Kopii vojo" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "Open in File Manager" -msgstr "" +msgstr "Malfermi en dosiermastrumilo" #: editor/editor_file_dialog.cpp editor/editor_node.cpp #: editor/filesystem_dock.cpp editor/project_manager.cpp msgid "Show in File Manager" -msgstr "" +msgstr "Montri en dosiermastrumilo" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "New Folder..." -msgstr "" +msgstr "Nova dosierujo..." #: editor/editor_file_dialog.cpp #: editor/plugins/version_control_editor_plugin.cpp msgid "Refresh" -msgstr "" +msgstr "Aktualigi" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "All Recognized" @@ -1726,34 +1734,34 @@ msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "All Files (*)" -msgstr "" +msgstr "Ĉiuj dosierojn (*)" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open a File" -msgstr "" +msgstr "Malfermi dosieron" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open File(s)" -msgstr "" +msgstr "Malfermi dosiero(j)n" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open a Directory" -msgstr "" +msgstr "Malfermi dosierujon" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open a File or Directory" -msgstr "" +msgstr "Malfermi dosieron aÅ dosierujon" #: editor/editor_file_dialog.cpp editor/editor_node.cpp #: editor/editor_properties.cpp editor/inspector_dock.cpp #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp scene/gui/file_dialog.cpp msgid "Save" -msgstr "" +msgstr "Konservi" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Save a File" -msgstr "" +msgstr "Konservi dosieron" #: editor/editor_file_dialog.cpp msgid "Go Back" @@ -1827,7 +1835,7 @@ msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" -msgstr "" +msgstr "Dosierujoj kaj dosieroj:" #: editor/editor_file_dialog.cpp editor/plugins/sprite_editor_plugin.cpp #: editor/plugins/style_box_editor_plugin.cpp @@ -1866,6 +1874,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -1922,25 +1931,31 @@ msgid "Property Descriptions" msgstr "" #: editor/editor_help.cpp +#, fuzzy msgid "" "There is currently no description for this property. Please help us by " "[color=$color][url=$url]contributing one[/url][/color]!" msgstr "" +"Tie aktuale ne estas priskribon por ĉi tiun eco. Bonvolu helpi nin per " +"[color=$color][url=$url]kontribui oni[/url][/color]!" #: editor/editor_help.cpp msgid "Method Descriptions" msgstr "" #: editor/editor_help.cpp +#, fuzzy msgid "" "There is currently no description for this method. Please help us by [color=" "$color][url=$url]contributing one[/url][/color]!" msgstr "" +"Tie aktuale ne estas priskribon por ĉi tiun metodo. Bonvolu helpi nin per " +"[color=$color][url=$url]kontribui oni[/url][/color]!" #: editor/editor_help_search.cpp editor/editor_node.cpp #: editor/plugins/script_editor_plugin.cpp msgid "Search Help" -msgstr "" +msgstr "Serĉi helpon" #: editor/editor_help_search.cpp msgid "Display All" @@ -2170,8 +2185,9 @@ msgid "Error trying to save layout!" msgstr "" #: editor/editor_node.cpp +#, fuzzy msgid "Default editor layout overridden." -msgstr "" +msgstr "Automatan aranÄon de editilo transpasis." #: editor/editor_node.cpp msgid "Layout name not found!" @@ -2237,23 +2253,23 @@ msgstr "" #: editor/editor_node.cpp msgid "Quick Open..." -msgstr "" +msgstr "Rapide malfermi..." #: editor/editor_node.cpp msgid "Quick Open Scene..." -msgstr "" +msgstr "Rapide malfermi scenon..." #: editor/editor_node.cpp msgid "Quick Open Script..." -msgstr "" +msgstr "Rapide malfermi skripton..." #: editor/editor_node.cpp msgid "Save & Close" -msgstr "" +msgstr "Konservi kaj fermi" #: editor/editor_node.cpp msgid "Save changes to '%s' before closing?" -msgstr "" +msgstr "Konservi ÅanÄojn al '%s' antaÅ fermo?" #: editor/editor_node.cpp msgid "Saved %s modified resource(s)." @@ -2261,79 +2277,84 @@ msgstr "" #: editor/editor_node.cpp msgid "A root node is required to save the scene." -msgstr "" +msgstr "Radika nodo estas necesita por konservi la scenon." #: editor/editor_node.cpp msgid "Save Scene As..." -msgstr "" +msgstr "Konservi sceno kiel..." #: editor/editor_node.cpp msgid "No" -msgstr "" +msgstr "Ne" #: editor/editor_node.cpp msgid "Yes" -msgstr "" +msgstr "Jes" #: editor/editor_node.cpp +#, fuzzy msgid "This scene has never been saved. Save before running?" -msgstr "" +msgstr "Ĉi tiu sceno konservis neniam. Konservi antaÅ ruli?" #: editor/editor_node.cpp editor/scene_tree_dock.cpp +#, fuzzy msgid "This operation can't be done without a scene." -msgstr "" +msgstr "Ĉi tiu funkciado ne povas fari sen sceno." #: editor/editor_node.cpp +#, fuzzy msgid "Export Mesh Library" -msgstr "" +msgstr "Eksporti maÅajn bibliotekon" #: editor/editor_node.cpp +#, fuzzy msgid "This operation can't be done without a root node." -msgstr "" +msgstr "Ĉi tiu funkciado ne povas fari sen radika nodo." #: editor/editor_node.cpp +#, fuzzy msgid "Export Tile Set" -msgstr "" +msgstr "Eksporti kahelaron" #: editor/editor_node.cpp msgid "This operation can't be done without a selected node." -msgstr "" +msgstr "Ĉi tiun operacion ne ebla fari sen elektita nodo." #: editor/editor_node.cpp msgid "Current scene not saved. Open anyway?" -msgstr "" +msgstr "Nuna sceno ne estas konservita. Malfermi ĉuikaze?" #: editor/editor_node.cpp msgid "Can't reload a scene that was never saved." -msgstr "" +msgstr "Ne povas reÅarÄi scenon, kiu konservis neniam." #: editor/editor_node.cpp msgid "Revert" -msgstr "" +msgstr "Malfari" #: editor/editor_node.cpp msgid "This action cannot be undone. Revert anyway?" -msgstr "" +msgstr "Tiun ĉi agon ne povos malfari. Certe daÅrigi?" #: editor/editor_node.cpp msgid "Quick Run Scene..." -msgstr "" +msgstr "Rapida Ruli scenon..." #: editor/editor_node.cpp msgid "Quit" -msgstr "" +msgstr "Foriri" #: editor/editor_node.cpp msgid "Exit the editor?" -msgstr "" +msgstr "Eliri la editilo?" #: editor/editor_node.cpp msgid "Open Project Manager?" -msgstr "" +msgstr "Malfermi projekton mastrumilon?" #: editor/editor_node.cpp msgid "Save & Quit" -msgstr "" +msgstr "Konservi kaj foriri" #: editor/editor_node.cpp msgid "Save changes to the following scene(s) before quitting?" @@ -2355,11 +2376,11 @@ msgstr "" #: editor/editor_node.cpp msgid "Close Scene" -msgstr "" +msgstr "Fermi scenon" #: editor/editor_node.cpp msgid "Reopen Closed Scene" -msgstr "" +msgstr "Remalfermi ferman scenon" #: editor/editor_node.cpp msgid "Unable to enable addon plugin at: '%s' parsing of config failed." @@ -2445,7 +2466,7 @@ msgstr "" #: editor/editor_node.cpp editor/editor_properties.cpp #: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp msgid "Show in FileSystem" -msgstr "" +msgstr "Montri en dosiersistemo" #: editor/editor_node.cpp msgid "Play This Scene" @@ -2456,8 +2477,9 @@ msgid "Close Tab" msgstr "" #: editor/editor_node.cpp +#, fuzzy msgid "Undo Close Tab" -msgstr "" +msgstr "Malfari fermi langeto" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Close Other Tabs" @@ -2534,35 +2556,36 @@ msgstr "" #: editor/editor_node.cpp msgid "New Scene" -msgstr "" +msgstr "Nova sceno" #: editor/editor_node.cpp msgid "New Inherited Scene..." -msgstr "" +msgstr "Nova heredita sceno..." #: editor/editor_node.cpp msgid "Open Scene..." -msgstr "" +msgstr "Malfermi scenon..." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Open Recent" -msgstr "" +msgstr "Malfermi lastaj" #: editor/editor_node.cpp msgid "Save Scene" -msgstr "" +msgstr "Konservi scenon" #: editor/editor_node.cpp msgid "Save All Scenes" -msgstr "" +msgstr "Konservi ĉiujn scenojn" #: editor/editor_node.cpp +#, fuzzy msgid "Convert To..." -msgstr "" +msgstr "Konverti al..." #: editor/editor_node.cpp msgid "MeshLibrary..." -msgstr "" +msgstr "MaÅo biblioteko..." #: editor/editor_node.cpp msgid "TileSet..." @@ -2571,84 +2594,90 @@ msgstr "" #: editor/editor_node.cpp editor/plugins/script_text_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp msgid "Undo" -msgstr "" +msgstr "Malfari" #: editor/editor_node.cpp editor/plugins/script_text_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp msgid "Redo" -msgstr "" +msgstr "Refari" #: editor/editor_node.cpp msgid "Revert Scene" -msgstr "" +msgstr "Malfari scenon" #: editor/editor_node.cpp +#, fuzzy msgid "Miscellaneous project or scene-wide tools." -msgstr "" +msgstr "Diversa projekto aÅ sceno-abundaj iloj." #: editor/editor_node.cpp editor/script_create_dialog.cpp msgid "Project" -msgstr "" +msgstr "Projekto" #: editor/editor_node.cpp msgid "Project Settings..." -msgstr "" +msgstr "Projekta agordoj..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp +#, fuzzy msgid "Version Control" -msgstr "" +msgstr "Versikontrolo" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp +#, fuzzy msgid "Set Up Version Control" -msgstr "" +msgstr "Altlevi versitenan sistemon" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Finigi versitenan sistemon" #: editor/editor_node.cpp -#, fuzzy msgid "Export..." -msgstr "Redaktu..." +msgstr "Eksporti..." #: editor/editor_node.cpp msgid "Install Android Build Template..." -msgstr "" +msgstr "Instali Androidan muntadan Åablonon..." #: editor/editor_node.cpp msgid "Open Project Data Folder" -msgstr "" +msgstr "Malfermi projektan datuman dosierujon" #: editor/editor_node.cpp editor/plugins/tile_set_editor_plugin.cpp msgid "Tools" -msgstr "" +msgstr "Iloj" #: editor/editor_node.cpp +#, fuzzy msgid "Orphan Resource Explorer..." -msgstr "" +msgstr "Eksplorilo da orfaj risurcoj..." #: editor/editor_node.cpp msgid "Quit to Project List" -msgstr "" +msgstr "Foriri al projekta listo" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: editor/project_export.cpp msgid "Debug" -msgstr "" +msgstr "Sencimigi" #: editor/editor_node.cpp msgid "Deploy with Remote Debug" -msgstr "" +msgstr "Malfaldi kun defora sencimigo" #: editor/editor_node.cpp msgid "" "When exporting or deploying, the resulting executable will attempt to " "connect to the IP of this computer in order to be debugged." msgstr "" +"Kiam eksportas aÅ malfaldas, la rezulta plenumebla provos konekti al la IP " +"de ĉi tiu komputilo por estos sencimigita." #: editor/editor_node.cpp +#, fuzzy msgid "Small Deploy with Network FS" -msgstr "" +msgstr "Malgranda malfaldo kun reta dosiersistemo" #: editor/editor_node.cpp msgid "" @@ -2659,30 +2688,39 @@ msgid "" "On Android, deploy will use the USB cable for faster performance. This " "option speeds up testing for games with a large footprint." msgstr "" +"Kiam ĉi tiun agordon estas Åaltita, eksporti aÅ malfaldi produktos minimuman " +"plenumeblan dosieron.\n" +"La dosiersistemon disponigas el la projekto fare de editilo per la reto.\n" +"En Android, malfaldo uzantos la USB-kablon por pli rapida rendimento. Ĉi tui " +"agordo rapidigas testadon por ludoj kun larÄa areo." #: editor/editor_node.cpp msgid "Visible Collision Shapes" -msgstr "" +msgstr "Videblaj koliziaj formoj" #: editor/editor_node.cpp msgid "" "Collision shapes and raycast nodes (for 2D and 3D) will be visible on the " "running game if this option is turned on." msgstr "" +"Koliziaj formoj kaj radĵetaj nodoj (por 2D kaj 3D) estos videblaj en la " +"rulas ludo, se ĉi tiu agordo estas Åaltita." #: editor/editor_node.cpp msgid "Visible Navigation" -msgstr "" +msgstr "Videbla navigacio" #: editor/editor_node.cpp msgid "" "Navigation meshes and polygons will be visible on the running game if this " "option is turned on." msgstr "" +"Navigaciaj maÅoj kaj poligonoj estos videblaj en la rulas ludo, se ĉi tiu " +"agordo estas Åaltita." #: editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "" +msgstr "Sinkronigi scenan ÅanÄojn" #: editor/editor_node.cpp msgid "" @@ -2691,10 +2729,13 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"Kiam tuin ĉi agordo estas Åaltita, iuj ÅanÄoj ke faris al la scenon en la " +"editilo replikos en la rulas ludo.\n" +"Kiam uzantis malproksime en aparato, estas pli efika kun reta dosiersistemo." #: editor/editor_node.cpp msgid "Sync Script Changes" -msgstr "" +msgstr "Sinkronigi skriptajn ÅanÄojn" #: editor/editor_node.cpp msgid "" @@ -2703,6 +2744,9 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"Kiam tuin ĉi agordo estas Åaltita, iun skripton ke konservita, estos " +"reÅarÄita en la rulas ludo.\n" +"Kiam uzantis malproksime en aparato, estas pli efika kun reta dosiersistemo." #: editor/editor_node.cpp editor/script_create_dialog.cpp msgid "Editor" @@ -2710,15 +2754,15 @@ msgstr "" #: editor/editor_node.cpp msgid "Editor Settings..." -msgstr "" +msgstr "Editila agordoj..." #: editor/editor_node.cpp msgid "Editor Layout" -msgstr "" +msgstr "AranÄon de editilo" #: editor/editor_node.cpp msgid "Take Screenshot" -msgstr "" +msgstr "Ekranfoti" #: editor/editor_node.cpp msgid "Screenshots are stored in the Editor Data/Settings Folder." @@ -2726,7 +2770,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Toggle Fullscreen" -msgstr "" +msgstr "Baskuli plenekranon" #: editor/editor_node.cpp msgid "Toggle System Console" @@ -2734,27 +2778,27 @@ msgstr "" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" -msgstr "" +msgstr "Malfermi dosierujon de editilan datumoj/agordoj" #: editor/editor_node.cpp msgid "Open Editor Data Folder" -msgstr "" +msgstr "Malfermi dosierujon de editila datumoj" #: editor/editor_node.cpp msgid "Open Editor Settings Folder" -msgstr "" +msgstr "Malfermi dosierujon de editila agordoj" #: editor/editor_node.cpp msgid "Manage Editor Features..." -msgstr "" +msgstr "Mastrumi editilan eblecoj..." #: editor/editor_node.cpp msgid "Manage Export Templates..." -msgstr "" +msgstr "Mastrumi eksportaj Åablonoj..." #: editor/editor_node.cpp editor/plugins/shader_editor_plugin.cpp msgid "Help" -msgstr "" +msgstr "Helpo" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp @@ -2763,12 +2807,13 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp editor/project_manager.cpp #: editor/project_settings_editor.cpp editor/rename_dialog.cpp msgid "Search" -msgstr "" +msgstr "Serĉo" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: editor/plugins/shader_editor_plugin.cpp +#, fuzzy msgid "Online Docs" -msgstr "" +msgstr "Enreta dokoj" #: editor/editor_node.cpp msgid "Q&A" @@ -2850,7 +2895,7 @@ msgstr "" #: editor/editor_node.cpp msgid "FileSystem" -msgstr "" +msgstr "Dosiersistemo" #: editor/editor_node.cpp msgid "Inspector" @@ -2860,7 +2905,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -2917,7 +2962,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Open & Run a Script" -msgstr "" +msgstr "Malfermi & ruli skripto" #: editor/editor_node.cpp msgid "New Inherited" @@ -3097,6 +3142,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3123,13 +3172,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3167,7 +3209,7 @@ msgstr "" #: editor/editor_run_script.cpp msgid "Write your logic in the _run() method." -msgstr "" +msgstr "Skribu vian logikon en la _run() metodo." #: editor/editor_run_script.cpp msgid "There is an edited scene already." @@ -3183,19 +3225,20 @@ msgstr "" #: editor/editor_run_script.cpp msgid "Couldn't run script:" -msgstr "" +msgstr "Ne povis ruli skripto:" #: editor/editor_run_script.cpp msgid "Did you forget the '_run' method?" -msgstr "" +msgstr "Ĉu vi forgesis la '_run' metodo?" #: editor/editor_sub_scene.cpp +#, fuzzy msgid "Select Node(s) to Import" -msgstr "" +msgstr "Selektu nodo(j)n por enporti" #: editor/editor_sub_scene.cpp editor/project_manager.cpp msgid "Browse" -msgstr "" +msgstr "Foliumi" #: editor/editor_sub_scene.cpp msgid "Scene Path:" @@ -3203,11 +3246,11 @@ msgstr "" #: editor/editor_sub_scene.cpp msgid "Import From Node:" -msgstr "" +msgstr "Enporti el nodo:" #: editor/export_template_manager.cpp msgid "Redownload" -msgstr "" +msgstr "ReelÅuti" #: editor/export_template_manager.cpp msgid "Uninstall" @@ -3220,7 +3263,7 @@ msgstr "" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Download" -msgstr "" +msgstr "ElÅuti" #: editor/export_template_manager.cpp msgid "Official export templates aren't available for development builds." @@ -3462,7 +3505,7 @@ msgstr "" #: editor/filesystem_dock.cpp msgid "New Inherited Scene" -msgstr "" +msgstr "Nova heredita sceno" #: editor/filesystem_dock.cpp msgid "Open Scenes" @@ -3502,7 +3545,7 @@ msgstr "" #: editor/filesystem_dock.cpp msgid "New Scene..." -msgstr "" +msgstr "Nova sceno..." #: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp msgid "New Script..." @@ -3527,7 +3570,7 @@ msgstr "" #: editor/project_manager.cpp editor/rename_dialog.cpp #: editor/scene_tree_dock.cpp msgid "Rename" -msgstr "" +msgstr "Renomi" #: editor/filesystem_dock.cpp msgid "Previous Folder/File" @@ -3539,7 +3582,7 @@ msgstr "" #: editor/filesystem_dock.cpp msgid "Re-Scan Filesystem" -msgstr "" +msgstr "Reesplori dosiersistemo" #: editor/filesystem_dock.cpp msgid "Toggle Split Mode" @@ -3547,7 +3590,7 @@ msgstr "" #: editor/filesystem_dock.cpp msgid "Search files" -msgstr "" +msgstr "Serĉi dosieroj" #: editor/filesystem_dock.cpp msgid "" @@ -3565,173 +3608,176 @@ msgstr "" #: editor/filesystem_dock.cpp msgid "Overwrite" -msgstr "" +msgstr "Superskribi" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Create Scene" -msgstr "Krei" +msgstr "Krei scenon" #: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp msgid "Create Script" -msgstr "" +msgstr "Krei skripton" #: editor/find_in_files.cpp editor/plugins/script_editor_plugin.cpp msgid "Find in Files" -msgstr "" +msgstr "Trovi en dosierojn" #: editor/find_in_files.cpp msgid "Find:" -msgstr "" +msgstr "Trovi:" #: editor/find_in_files.cpp msgid "Folder:" -msgstr "" +msgstr "Dosierujo:" #: editor/find_in_files.cpp msgid "Filters:" -msgstr "" +msgstr "Filtriloj:" #: editor/find_in_files.cpp msgid "" "Include the files with the following extensions. Add or remove them in " "ProjectSettings." msgstr "" +"Anigu la dosierojn kun la jenajn sufiksojn. Aldonu aÅ viÅi ilin en Projekto " +"agordoj." #: editor/find_in_files.cpp editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp msgid "Find..." -msgstr "" +msgstr "Trovi..." #: editor/find_in_files.cpp editor/plugins/script_text_editor.cpp msgid "Replace..." -msgstr "" +msgstr "AnstataÅigi..." #: editor/find_in_files.cpp editor/progress_dialog.cpp scene/gui/dialogs.cpp msgid "Cancel" -msgstr "" +msgstr "Rezigni" #: editor/find_in_files.cpp msgid "Find: " -msgstr "" +msgstr "Trovi: " #: editor/find_in_files.cpp msgid "Replace: " -msgstr "" +msgstr "AnstataÅigi: " #: editor/find_in_files.cpp msgid "Replace all (no undo)" -msgstr "" +msgstr "AnstataÅigi ciujn (senrevene)" #: editor/find_in_files.cpp msgid "Searching..." -msgstr "" +msgstr "Serĉas..." #: editor/find_in_files.cpp msgid "Search complete" -msgstr "" +msgstr "Serĉo finiÄis" #: editor/groups_editor.cpp msgid "Add to Group" -msgstr "" +msgstr "Aldoni al grupo" #: editor/groups_editor.cpp msgid "Remove from Group" -msgstr "" +msgstr "Forigi el grupo" #: editor/groups_editor.cpp msgid "Group name already exists." -msgstr "" +msgstr "Grupa nomo jam ekzistas." #: editor/groups_editor.cpp msgid "Invalid group name." -msgstr "" +msgstr "Nevalida grupa nomo." #: editor/groups_editor.cpp msgid "Rename Group" -msgstr "" +msgstr "Renomi grupon" #: editor/groups_editor.cpp msgid "Delete Group" -msgstr "" +msgstr "ViÅi grupon" #: editor/groups_editor.cpp editor/node_dock.cpp msgid "Groups" -msgstr "" +msgstr "Grupoj" #: editor/groups_editor.cpp +#, fuzzy msgid "Nodes Not in Group" -msgstr "" +msgstr "Nodoj ne en grupo" #: editor/groups_editor.cpp editor/scene_tree_dock.cpp #: editor/scene_tree_editor.cpp msgid "Filter nodes" -msgstr "" +msgstr "Filtri nodojn" #: editor/groups_editor.cpp msgid "Nodes in Group" -msgstr "" +msgstr "Nodoj en grupo" #: editor/groups_editor.cpp msgid "Empty groups will be automatically removed." -msgstr "" +msgstr "Malplenajn grupojn viÅos aÅtomate." #: editor/groups_editor.cpp msgid "Group Editor" -msgstr "" +msgstr "Grupredaktilo" #: editor/groups_editor.cpp +#, fuzzy msgid "Manage Groups" -msgstr "" +msgstr "Administri grupojn" #: editor/import/resource_importer_scene.cpp msgid "Import as Single Scene" -msgstr "" +msgstr "Enporti kiel unuopa sceno" #: editor/import/resource_importer_scene.cpp msgid "Import with Separate Animations" -msgstr "" +msgstr "Enporti kun aparta movbildoj" #: editor/import/resource_importer_scene.cpp msgid "Import with Separate Materials" -msgstr "" +msgstr "Enporti kun aparta materialoj" #: editor/import/resource_importer_scene.cpp msgid "Import with Separate Objects" -msgstr "" +msgstr "Enporti kun aparta objektoj" #: editor/import/resource_importer_scene.cpp msgid "Import with Separate Objects+Materials" -msgstr "" +msgstr "Enporti kun aparta objektoj+materialoj" #: editor/import/resource_importer_scene.cpp msgid "Import with Separate Objects+Animations" -msgstr "" +msgstr "Enporti kun aparta objektoj+movbildoj" #: editor/import/resource_importer_scene.cpp msgid "Import with Separate Materials+Animations" -msgstr "" +msgstr "Enporti kun aparta materialoj+movbildoj" #: editor/import/resource_importer_scene.cpp msgid "Import with Separate Objects+Materials+Animations" -msgstr "" +msgstr "Enporti kun aparta objektoj+materialoj+movbildoj" #: editor/import/resource_importer_scene.cpp msgid "Import as Multiple Scenes" -msgstr "" +msgstr "Enporti kiel multoblaj scenoj" #: editor/import/resource_importer_scene.cpp msgid "Import as Multiple Scenes+Materials" -msgstr "" +msgstr "Enporti kiel multoblaj scenoj+materialoj" #: editor/import/resource_importer_scene.cpp #: editor/plugins/mesh_library_editor_plugin.cpp msgid "Import Scene" -msgstr "" +msgstr "Enporti scenon" #: editor/import/resource_importer_scene.cpp msgid "Importing Scene..." -msgstr "" +msgstr "Enportas scenon..." #: editor/import/resource_importer_scene.cpp msgid "Generating Lightmaps" @@ -3742,8 +3788,9 @@ msgid "Generating for Mesh: " msgstr "" #: editor/import/resource_importer_scene.cpp +#, fuzzy msgid "Running Custom Script..." -msgstr "" +msgstr "Rulas propra skripto..." #: editor/import/resource_importer_scene.cpp msgid "Couldn't load post-import script:" @@ -3841,7 +3888,7 @@ msgstr "" #: editor/inspector_dock.cpp msgid "Open in Help" -msgstr "" +msgstr "Malfermi en helpo" #: editor/inspector_dock.cpp msgid "Create a new resource in memory and edit it." @@ -3903,7 +3950,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4038,6 +4085,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4223,8 +4276,9 @@ msgstr "" #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp +#, fuzzy msgid "Rename Animation" -msgstr "" +msgstr "Renomi animaĵon" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Blend Next Changed" @@ -4379,7 +4433,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4547,6 +4600,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4717,11 +4772,11 @@ msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Install..." -msgstr "" +msgstr "Instali..." #: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" -msgstr "" +msgstr "Reprovi" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Download Error" @@ -4752,6 +4807,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -4761,7 +4820,7 @@ msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp editor/project_manager.cpp msgid "Sort:" -msgstr "" +msgstr "Ordigi:" #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -5032,20 +5091,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5135,13 +5197,12 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Helpers" -msgstr "" +msgstr "Montri helpantoj" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Rulers" @@ -5396,6 +5457,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6026,6 +6091,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6058,8 +6127,9 @@ msgid "Add Resource" msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp +#, fuzzy msgid "Rename Resource" -msgstr "" +msgstr "Renomi risurcon" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -6082,6 +6152,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6180,6 +6251,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6274,7 +6350,7 @@ msgstr "" #: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp msgid "Run" -msgstr "" +msgstr "Ruli" #: editor/plugins/script_editor_plugin.cpp msgid "Toggle Scripts Panel" @@ -6314,12 +6390,14 @@ msgid "Request Docs" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#, fuzzy msgid "Help improve the Godot documentation by giving feedback." -msgstr "" +msgstr "Helpi plibonigi la Godotan dokumentadon per doni reagon." #: editor/plugins/script_editor_plugin.cpp +#, fuzzy msgid "Search the reference documentation." -msgstr "" +msgstr "Serĉi la referencan dokumentadon." #: editor/plugins/script_editor_plugin.cpp msgid "Go to previous edited document." @@ -6355,7 +6433,7 @@ msgstr "" #: editor/plugins/script_editor_plugin.cpp msgid "Search Results" -msgstr "" +msgstr "Rezultoj de serĉo" #: editor/plugins/script_editor_plugin.cpp msgid "Clear Recent Scripts" @@ -6396,7 +6474,7 @@ msgstr "" #: editor/plugins/script_text_editor.cpp msgid "Only resources from filesystem can be dropped." -msgstr "" +msgstr "Nur risurcoj el dosiersistemo povas esti forigita." #: editor/plugins/script_text_editor.cpp msgid "Lookup Symbol" @@ -6445,6 +6523,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Elektaro ĉiuj" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6503,16 +6586,12 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" #: editor/plugins/script_text_editor.cpp msgid "Contextual Help" -msgstr "" +msgstr "Kunteksta Helpo" #: editor/plugins/script_text_editor.cpp msgid "Toggle Bookmark" @@ -6826,6 +6905,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6859,6 +6942,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7085,6 +7172,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7795,7 +7886,7 @@ msgstr "ÅœanÄu" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Modifita" #: editor/plugins/version_control_editor_plugin.cpp msgid "Renamed" @@ -7852,11 +7943,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7872,6 +7959,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8728,12 +8819,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -8802,7 +8895,7 @@ msgstr "" #: editor/project_export.cpp msgid "Manage Export Templates" -msgstr "" +msgstr "Mastrumi eksportaj Åablonoj" #: editor/project_export.cpp msgid "Export With Debug" @@ -8818,7 +8911,7 @@ msgstr "" #: editor/project_manager.cpp msgid "Please choose an empty folder." -msgstr "" +msgstr "Bonvolu, elektu malplenan dosierujon." #: editor/project_manager.cpp msgid "Please choose a 'project.godot' or '.zip' file." @@ -8830,7 +8923,7 @@ msgstr "" #: editor/project_manager.cpp msgid "New Game Project" -msgstr "" +msgstr "Nova luda projekto" #: editor/project_manager.cpp msgid "Imported Project" @@ -8842,7 +8935,7 @@ msgstr "" #: editor/project_manager.cpp msgid "Couldn't create folder." -msgstr "" +msgstr "Ne povis krei dosierujon." #: editor/project_manager.cpp msgid "There is already a folder in this path with the specified name." @@ -8876,7 +8969,7 @@ msgstr "" #: editor/project_manager.cpp msgid "Rename Project" -msgstr "" +msgstr "Renomi projekton" #: editor/project_manager.cpp msgid "Import Existing Project" @@ -8888,59 +8981,70 @@ msgstr "" #: editor/project_manager.cpp msgid "Create New Project" -msgstr "" +msgstr "Krei novan projekton" #: editor/project_manager.cpp msgid "Create & Edit" -msgstr "" +msgstr "Krei kaj editi" #: editor/project_manager.cpp msgid "Install Project:" -msgstr "" +msgstr "Instali projekton:" #: editor/project_manager.cpp msgid "Install & Edit" -msgstr "" +msgstr "Instali kaj editi" #: editor/project_manager.cpp msgid "Project Name:" -msgstr "" +msgstr "Projekta nomo:" #: editor/project_manager.cpp msgid "Project Path:" -msgstr "" +msgstr "Projekta vojo:" #: editor/project_manager.cpp +#, fuzzy msgid "Project Installation Path:" -msgstr "" +msgstr "Projekta instala vojo:" #: editor/project_manager.cpp msgid "Renderer:" -msgstr "" +msgstr "Bildigilo:" #: editor/project_manager.cpp msgid "OpenGL ES 3.0" msgstr "" #: editor/project_manager.cpp +#, fuzzy msgid "" "Higher visual quality\n" "All features available\n" "Incompatible with older hardware\n" "Not recommended for web games" msgstr "" +"Pli alta vida kvalito\n" +"Ĉiuj ebloj disponeblaj\n" +"Nekongruas kun pli malnova aparataro\n" +"Nerekomendita por teksaĵaj ludoj" #: editor/project_manager.cpp msgid "OpenGL ES 2.0" msgstr "" #: editor/project_manager.cpp +#, fuzzy msgid "" "Lower visual quality\n" "Some features not available\n" "Works on most hardware\n" "Recommended for web games" msgstr "" +"Pli malalta vida kvalito\n" +"Iom ebloj ne disponeblaj\n" +"Laboras en plej multaj aparataroj\n" +"Rekomendita por teksaĵaj ludoj" #: editor/project_manager.cpp msgid "Renderer can be changed later, but scenes may need to be adjusted." @@ -8951,20 +9055,23 @@ msgid "Unnamed Project" msgstr "" #: editor/project_manager.cpp +#, fuzzy msgid "Missing Project" -msgstr "" +msgstr "Malkanta projekto" #: editor/project_manager.cpp +#, fuzzy msgid "Error: Project is missing on the filesystem." -msgstr "" +msgstr "Eraro: projekto estas manka en la dosiersistemo." #: editor/project_manager.cpp msgid "Can't open project at '%s'." -msgstr "" +msgstr "Ne povas malfermi projekto ĉe '%s'." #: editor/project_manager.cpp +#, fuzzy msgid "Are you sure to open more than one project?" -msgstr "" +msgstr "Ĉu vi certa en malfermaĵo pli ol unun projekton?" #: editor/project_manager.cpp msgid "" @@ -9050,19 +9157,19 @@ msgstr "" #: editor/project_manager.cpp msgid "Projects" -msgstr "" +msgstr "Projektoj" #: editor/project_manager.cpp msgid "Scan" -msgstr "" +msgstr "Esplori" #: editor/project_manager.cpp msgid "Select a Folder to Scan" -msgstr "" +msgstr "Elektu dosierujo por esploro" #: editor/project_manager.cpp msgid "New Project" -msgstr "" +msgstr "Nova projekto" #: editor/project_manager.cpp msgid "Remove Missing" @@ -9070,7 +9177,7 @@ msgstr "" #: editor/project_manager.cpp msgid "Templates" -msgstr "" +msgstr "Åœablonoj" #: editor/project_manager.cpp msgid "Restart Now" @@ -9708,7 +9815,7 @@ msgstr "" #: editor/scene_tree_dock.cpp msgid "Save New Scene As..." -msgstr "" +msgstr "Konservi novan scenon kiel..." #: editor/scene_tree_dock.cpp msgid "" @@ -9717,11 +9824,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9730,7 +9835,7 @@ msgstr "" #: editor/scene_tree_dock.cpp msgid "New Scene Root" -msgstr "" +msgstr "Nova radiko de sceno" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -9795,6 +9900,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9811,10 +9924,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -9938,7 +10047,7 @@ msgstr "" #: editor/scene_tree_editor.cpp msgid "Rename Node" -msgstr "" +msgstr "Renomi nodon" #: editor/scene_tree_editor.cpp msgid "Scene Tree (Nodes):" @@ -9986,7 +10095,7 @@ msgstr "" #: editor/script_create_dialog.cpp msgid "Error - Could not create script in filesystem." -msgstr "" +msgstr "Eraro - Ne povis krei skripton en dosiersistemo." #: editor/script_create_dialog.cpp msgid "Error loading script from %s" @@ -10041,24 +10150,19 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Nomo:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Åœablonoj" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Konektu al skripto:" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -10680,21 +10784,27 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Function" -msgstr "" +msgstr "Renomi funkcion" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Rename Variable" -msgstr "" +msgstr "Renomi variablon" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Signal" -msgstr "" +msgstr "Renomi signalon" #: modules/visual_script/visual_script_editor.cpp msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "ViÅi grupon" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10703,6 +10813,22 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Add Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10743,10 +10869,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10771,6 +10907,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Malkonekti" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10803,6 +10944,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Renomi funkcion" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10827,16 +10989,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "Funkcioj:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -10859,6 +11018,16 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Renomi funkcion" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Aktualigi" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10953,6 +11122,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11052,10 +11225,14 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp -msgid "Run in Browser" +msgid "Stop HTTP Server" msgstr "" #: platform/javascript/export/export.cpp +msgid "Run in Browser" +msgstr "Ruli en foliumilo" + +#: platform/javascript/export/export.cpp msgid "Run exported HTML in the system's default browser." msgstr "" @@ -11589,10 +11766,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Enigo" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -11623,6 +11796,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Input" +#~ msgstr "Enigo" + #~ msgid "No Matches" #~ msgstr "Ne Rezultoj" diff --git a/editor/translations/es.po b/editor/translations/es.po index 8479f11639..7966399033 100644 --- a/editor/translations/es.po +++ b/editor/translations/es.po @@ -40,11 +40,12 @@ # juan david julio <illus.kun@gmail.com>, 2019. # Patrick Zoch Alves <patrickzochalves@gmail.com>, 2019. # roger <616steam@gmail.com>, 2019. +# Dario <darlex259@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:51+0000\n" +"PO-Revision-Date: 2019-10-11 15:07+0000\n" "Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot/es/>\n" @@ -97,32 +98,31 @@ msgstr "En llamada a '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Mix" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -388,6 +388,7 @@ msgstr "¿Crear %d nuevas pistas e insertar claves?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Crear" @@ -534,20 +535,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Advertencia: Edición de animación importada" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Seleccionar Todo" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Deseleccionar todo" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "" -"No hay asignada una ruta a un nodo AnimationPlayer conteniendo animaciones." +msgstr "Selecciona un nodo AnimationPlayer para crear y editar animaciones." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -679,7 +669,8 @@ msgid "Scale Ratio:" msgstr "Ratio de Escala:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Elegir pistas a copiar:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -691,6 +682,11 @@ msgstr "Elegir pistas a copiar:" msgid "Copy" msgstr "Copiar" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Deseleccionar todo" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Añadir Clip de Pista de Audio" @@ -1017,7 +1013,7 @@ msgid "Resource" msgstr "Recursos" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Ruta" @@ -1288,9 +1284,8 @@ msgid "Delete Bus Effect" msgstr "Eliminar Efecto de Bus" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Bus de audio, arrastra y suelta para reordenar." +msgstr "Arrastrar y soltar para reordenar." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1481,7 +1476,8 @@ msgstr "Añadir AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Ruta:" @@ -1535,7 +1531,7 @@ msgstr "Crear Carpeta" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nombre:" @@ -1935,6 +1931,7 @@ msgid "Class:" msgstr "Clase:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Hereda:" @@ -1943,9 +1940,8 @@ msgid "Inherited by:" msgstr "Heredada por:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Descripción Breve:" +msgstr "Descripción Breve" #: editor/editor_help.cpp msgid "Properties" @@ -1976,9 +1972,8 @@ msgid "Class Description" msgstr "Descripción de la Clase" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Tutoriales en lÃnea:" +msgstr "Tutoriales en lÃnea" #: editor/editor_help.cpp msgid "" @@ -2104,7 +2099,7 @@ msgstr "Iniciar" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2120,19 +2115,19 @@ msgstr "Nodos" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "RPC Entrante" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "RSET Entrante" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "RPC Saliente" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "RSET Saliente" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2729,17 +2724,16 @@ msgid "Project Settings..." msgstr "Ajustes del Proyecto..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Versión:" +msgstr "Control de Versiones" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Configurar Control de Versiones" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Desactivar Control de Versiones" #: editor/editor_node.cpp msgid "Export..." @@ -3014,7 +3008,7 @@ msgstr "Inspector" msgid "Expand Bottom Panel" msgstr "Expandir Panel Inferior" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Salida" @@ -3042,9 +3036,14 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Una vez hecho ésto puedes aplicar modificaciones y generar tu propio APK " +"personalizado al exportar (agregar módulos, cambiar el AndroidManifest.xml, " +"etc.).\n" +"Ten en cuenta que para generar builds personalizados en vez de usar los APKs " +"pregenerados, la opción \"Usar Build Personalizado\" deberÃa estar activada " +"en el preset de exportación de Android." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" @@ -3053,8 +3052,8 @@ msgid "" msgstr "" "La plantilla de compilación de Android ya está instalada y no se " "sobrescribirá.\n" -"Elimina el directorio \"build\" manualmente antes de intentar esta operación " -"nuevamente." +"Elimina el directorio \"res://android/build\" manualmente antes de intentar " +"esta operación nuevamente." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3117,9 +3116,8 @@ msgid "Open the previous Editor" msgstr "Abrir Editor anterior" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Ningún origen para la superficie especificado." +msgstr "No se encontró ningún sub-recurso." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3130,9 +3128,8 @@ msgid "Thumbnail..." msgstr "Miniatura..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Abrir Script:" +msgstr "Script Principal:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3268,6 +3265,10 @@ msgstr "Selecciona un Viewport" msgid "New Script" msgstr "Nuevo Script" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Extender Script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nuevo %s" @@ -3294,13 +3295,6 @@ msgstr "Pegar" msgid "Convert To %s" msgstr "Convertir a %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Abrir Editor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "¡El nodo seleccionado no es un Viewport!" @@ -3965,9 +3959,8 @@ msgid "Import As:" msgstr "Importar como:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "Ajustes preestablecidos" +msgstr "Preset" #: editor/import_dock.cpp msgid "Reimport" @@ -4093,7 +4086,7 @@ msgstr "Nombre del Plugin:" msgid "Subfolder:" msgstr "Subcarpeta:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Lenguaje:" @@ -4235,6 +4228,12 @@ msgstr "Punto" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Abrir Editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Abrir Nodo de Animación" @@ -4586,7 +4585,6 @@ msgstr "Nombre de Animación:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "¡Error!" @@ -4759,6 +4757,8 @@ msgid "Current:" msgstr "Actual:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Añadir Entrada" @@ -4963,6 +4963,10 @@ msgid "All" msgstr "Todos" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Importar..." @@ -5255,26 +5259,32 @@ msgid "Pan Mode" msgstr "Modo desplazamiento lateral" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Modo de ejecución:" +msgstr "Modo Regla" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Act./Desact. alineado." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Usar Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opciones de Alineado" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Act./Desact. alineado." + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Use Grid Snap" +msgstr "Grid Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Ajustar en Grid" +msgid "Snapping Options" +msgstr "Opciones de Alineado" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5363,8 +5373,8 @@ msgid "View" msgstr "Ver" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Ver Grid" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5631,6 +5641,11 @@ msgstr "Act./Desact. Curva de Tangente Lineal" msgid "Hold Shift to edit tangents individually" msgstr "Mantén Shift para editar las tangentes individualmente" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Clic derecho: Eliminar Punto" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Bake GI Probe" @@ -6270,6 +6285,10 @@ msgid "Grid" msgstr "Grid" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Ver Grid" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Configurar Grid:" @@ -6326,6 +6345,7 @@ msgstr "Instancia:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Tipo:" @@ -6424,6 +6444,11 @@ msgid "Find Next" msgstr "Buscar Siguiente" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Buscar Anterior" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Filtrar scripts" @@ -6686,13 +6711,18 @@ msgstr "Marcadores" #: editor/plugins/script_text_editor.cpp msgid "Breakpoints" -msgstr "Puntos de interrupción" +msgstr "Breakpoints" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp msgid "Cut" msgstr "Cortar" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Seleccionar Todo" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Eliminar LÃnea" @@ -6750,10 +6780,6 @@ msgid "Auto Indent" msgstr "Autoindentar" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Buscar Anterior" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Buscar en Archivos..." @@ -6796,7 +6822,7 @@ msgstr "Eliminar Todos los Breakpoints" #: editor/plugins/script_text_editor.cpp msgid "Go to Next Breakpoint" -msgstr "Ir al Siguente Breakpoint" +msgstr "Ir al Siguiente Breakpoint" #: editor/plugins/script_text_editor.cpp msgid "Go to Previous Breakpoint" @@ -7075,6 +7101,11 @@ msgid "Freelook Speed Modifier" msgstr "Modificador de Velocidad de Vista Libre" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Modificador de Velocidad de Vista Libre" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7113,6 +7144,10 @@ msgid "Use Local Space" msgstr "Usar Espacio Local" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Usar Snap" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Vista Inferior" @@ -7339,6 +7374,11 @@ msgid "Simplification: " msgstr "Simplificación: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Crecer (Pixeles): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Crecer (Pixeles): " @@ -7387,9 +7427,8 @@ msgid "(empty)" msgstr "(vacÃo)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Pegar Frame" +msgstr "Mover Frame" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7706,13 +7745,12 @@ msgid "Enable Priority" msgstr "Activar Prioridad" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Filtrar Archivos..." +msgstr "Filtrar tiles" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "Asignar un recurso TileSet a este TileMap para usas sus tiles." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7850,6 +7888,8 @@ msgstr "Mostrar Nombres de Tiles (mantener Tecla Alt)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Agrega o selecciona una textura en el panel izquierdo para editar los tiles " +"asignados a él." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -8024,92 +8064,80 @@ msgid "TileSet" msgstr "TileSet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Nombre del padre del nodo, si está disponible" +msgstr "No hay addons de VCS disponibles." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Error" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "No se proporcionó un nombre" +msgstr "No se indicó ningún mensaje de confirmación" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "No se agregaron archivos al stage" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Comunidad" +msgstr "Confirmar" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "El Addon de VCS no está inicializado" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "Sistema de Control de Versiones" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Capitalizar" +msgstr "Inicializar" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "Ãrea de Staging" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Cree un nuevo rectángulo." +msgstr "Detectar nuevos cambios" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Cambiar" +msgstr "Cambios" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Modificado/s" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Renombrar" +msgstr "Renombrado/s" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Eliminar" +msgstr "Eliminado/s" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Cambiar" +msgstr "Cambio de Tipo" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Eliminar Seleccionados" +msgstr "Hacer Staging de Selección" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Guardar Todo" +msgstr "Hacer Staging de Todo" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Añadir un mensaje de confirmación" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Sincronizar Cambios en Scripts" +msgstr "Confirmar Cambios" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8119,26 +8147,23 @@ msgstr "Estado" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" msgstr "" +"Ver las diferencias de los archivos antes de confirmar la última versión" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No file diff is active" -msgstr "¡No has seleccionado ningún archivo!" +msgstr "No hay diferencias de archivo disponibles" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "Detectar diferencias entre los archivos" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(Sólo GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Añadir entrada +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Añadir salida +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8154,6 +8179,11 @@ msgid "Boolean" msgstr "Booleano" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "Sonidos" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Agregar puerto de entrada" @@ -8371,11 +8401,10 @@ msgstr "" "o falso." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" -"Devuelve un vector asociado si el valor booleano proporcionado es verdadero " +"Devuelve un escalar asociado si el valor booleano proporcionado es verdadero " "o falso." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9089,15 +9118,19 @@ msgid "Resources to export:" msgstr "Recursos a exportar:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtros para exportar archivos que no son recursos (separados por comas, ej: " "*.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtros para excluir de la exportación (separados por comas, ej: *.json, *." "txt)" @@ -9696,9 +9729,8 @@ msgid "Settings saved OK." msgstr "Los ajustes se han guardado correctamente." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Añadir Evento de Acción de Entrada" +msgstr "Evento de Acción de Entrada Movido" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -10065,9 +10097,8 @@ msgid "Instance Scene(s)" msgstr "Instanciar Escena(s)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Guardar Rama como Escena" +msgstr "Reemplazar con Escena de Rama" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10112,23 +10143,20 @@ msgid "Make node as Root" msgstr "Convertir nodo como RaÃz" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Eliminar Nodos" +msgstr "¿Eliminar %d nodos?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "Eliminar nodo(s) gráfico(s) del shader" +msgstr "¿Eliminar el nodo raiz \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "¿Eliminar el nodo \"%s\" y sus hijos?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Eliminar Nodos" +msgstr "¿Eliminar nodo \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10151,12 +10179,13 @@ msgstr "" "vuelvan a sus valores por defecto." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Hijos Editables" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Cargar como Placeholder" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Desactivar \"editable_instance\" causara que todas las propiedades del nodo " +"vuelvan a sus valores por defecto." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10231,6 +10260,14 @@ msgid "Clear Inheritance" msgstr "Limpiar Heredado" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Hijos Editables" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Cargar como Placeholder" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Abrir Documentación" @@ -10247,10 +10284,6 @@ msgid "Change Type" msgstr "Cambiar Tipo" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Extender Script" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "Reemparentar a Nuevo Nodo" @@ -10492,23 +10525,18 @@ msgid "Will load an existing script file." msgstr "Se cargará un archivo de script existente." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Lenguaje" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Hereda" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Nombre de clase" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Plantilla" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Script Integrado" #: editor/script_create_dialog.cpp @@ -10524,38 +10552,32 @@ msgid "Bytes:" msgstr "Bytes:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "Advertencias:" +msgstr "Advertencia:" #: editor/script_editor_debugger.cpp msgid "Error:" msgstr "Error:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Copiar Error" +msgstr "Error de C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Error:" +msgstr "Error de C++:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Fuente" +msgstr "Fuente C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Fuente" +msgstr "Fuente:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Fuente" +msgstr "Fuente C++:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10566,18 +10588,16 @@ msgid "Errors" msgstr "Errores" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Proceso Hijo Conectado" +msgstr "Proceso hijo conectado." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Copiar Error" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Puntos de interrupción" +msgstr "Saltar Breakpoints" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10596,9 +10616,8 @@ msgid "Profiler" msgstr "Profiler" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Exportar Perfil" +msgstr "Profiler de Red" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10822,7 +10841,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Se esperaba un string de longitud 1 (un carácter)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10981,13 +11000,12 @@ msgid "Pick Distance:" msgstr "Seleccionar Distancia:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Filtrar métodos" +msgstr "Filtrar meshes" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." -msgstr "" +msgstr "Asignar un recurso MeshLibrary a este GridMap para usar sus meshes." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11164,6 +11182,11 @@ msgid "Add Function" msgstr "Añadir Función" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Eliminar puerto de entrada" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Añadir Variable" @@ -11172,6 +11195,26 @@ msgid "Add Signal" msgstr "Añadir Señal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Agregar puerto de entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Añadir puerto de salida" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Eliminar puerto de entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Eliminar puerto de salida" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Cambiar Expresión" @@ -11216,10 +11259,20 @@ msgid "Add Preload Node" msgstr "Añadir Nodo Preload" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Añadir Nodo(s) Desde Ãrbol" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Añadir Propiedad Getter" @@ -11244,6 +11297,11 @@ msgid "Connect Nodes" msgstr "Conectar Nodos" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Desconectar nodos gráficos" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Conectar Datos de Nodos" @@ -11276,6 +11334,28 @@ msgid "Paste VisualScript Nodes" msgstr "Pegar nodos de VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "No se puede copiar el nodo de función." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Renombrar Función" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Eliminar Función" @@ -11296,21 +11376,17 @@ msgid "Editing Signal:" msgstr "Editando señal:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "Crear Local" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Tipo Base:" +msgstr "Convertir en Herramienta:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Miembros:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Nodos disponibles:" +#, fuzzy +msgid "function_name" +msgstr "Función:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11333,6 +11409,16 @@ msgid "Cut Nodes" msgstr "Cortar Nodos" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Renombrar Función" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Recargar" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Editar Miembros" @@ -11434,6 +11520,10 @@ msgid "The package must have at least one '.' separator." msgstr "El paquete debe tener al menos un '.' como separador." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Seleccionar dispositivo de la lista" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "Ejecutable ADB no configurado en Configuración del Editor." @@ -11459,13 +11549,12 @@ msgstr "" "Configuración del Editor." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"El proyecto Android no está instalado para la compilación. Instálalo desde " -"el menú Editor." +"La plantilla de exportación de Android no esta instalada en el proyecto. " +"Instalala desde el menú de Proyecto." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11556,6 +11645,10 @@ msgid "Required icon is not specified in the preset." msgstr "El icono requerido no está especificado en el preset." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Ejecutar en Navegador" @@ -12236,10 +12329,6 @@ msgstr "" "pueda obtener un tamaño. De lo contrario, conviértelo en un RenderTarget y " "asigna su textura interna a algún nodo para mostrarlo." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Entrada" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fuente inválida para la vista previa." @@ -12268,6 +12357,27 @@ msgstr "Solo se pueden asignar variaciones en funciones de vértice." msgid "Constants cannot be modified." msgstr "Las constantes no pueden modificarse." +#~ msgid "Snap to Grid" +#~ msgstr "Ajustar en Grid" + +#~ msgid "Add input +" +#~ msgstr "Añadir entrada +" + +#~ msgid "Language" +#~ msgstr "Lenguaje" + +#~ msgid "Inherits" +#~ msgstr "Hereda" + +#~ msgid "Base Type:" +#~ msgstr "Tipo Base:" + +#~ msgid "Available Nodes:" +#~ msgstr "Nodos disponibles:" + +#~ msgid "Input" +#~ msgstr "Entrada" + #~ msgid "Properties:" #~ msgstr "Propiedades:" @@ -12678,9 +12788,6 @@ msgstr "Las constantes no pueden modificarse." #~ msgid "Go to parent folder" #~ msgstr "Ir a la carpeta principal" -#~ msgid "Select device from the list" -#~ msgstr "Seleccionar dispositivo de la lista" - #~ msgid "Open Scene(s)" #~ msgstr "Abrir escena(s)" @@ -12921,9 +13028,6 @@ msgstr "Las constantes no pueden modificarse." #~ msgid "Warning" #~ msgstr "Advertencia" -#~ msgid "Function:" -#~ msgstr "Función:" - #~ msgid "Variable" #~ msgstr "Variable" @@ -12990,9 +13094,6 @@ msgstr "Las constantes no pueden modificarse." #~ msgid "Connect Graph Nodes" #~ msgstr "Conectar nodos gráficos" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Desconectar nodos gráficos" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Eliminar el nodo gráfico del shader" @@ -14171,9 +14272,6 @@ msgstr "Las constantes no pueden modificarse." #~ msgid "Group" #~ msgstr "Grupo" -#~ msgid "Samples" -#~ msgstr "Sonidos" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "Modo de conversión de muestreo: (archivos .wav):" diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po index d6f7409cbd..4369ea73ab 100644 --- a/editor/translations/es_AR.po +++ b/editor/translations/es_AR.po @@ -16,8 +16,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:52+0000\n" -"Last-Translator: Lisandro Lorea <lisandrolorea@gmail.com>\n" +"PO-Revision-Date: 2019-10-11 15:07+0000\n" +"Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n" "Language-Team: Spanish (Argentina) <https://hosted.weblate.org/projects/" "godot-engine/godot/es_AR/>\n" "Language: es_AR\n" @@ -30,7 +30,7 @@ msgstr "" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." -msgstr "El argumento para convert() no es correcto, utiliza constantes TYPE_*." +msgstr "Argumento de tipo incorrecto en convert(), utilizá constantes TYPE_*." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -69,32 +69,31 @@ msgstr "En la llamada a '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Mix" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -360,6 +359,7 @@ msgstr "Crear %d NUEVOS tracks e insertar claves?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Crear" @@ -496,7 +496,7 @@ msgstr "" "Para habilitar la capacidad de añadir pistas personalizadas, andá a la " "configuración de importación de la escena y establece\n" "\"Animation > Storage\" a \"Files\", activa \"Animation > Keep Custom Tracks" -"\", y luego reimporta.\n" +"\", y luego reimportá.\n" "También podés usar un preset de importación que importa animaciones a " "archivos separados." @@ -504,20 +504,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Advertencia: Se esta editando una animación importada" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Seleccionar Todo" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "No Seleccionar Ninguno" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "" -"No hay asignada una ruta a un nodo AnimationPlayer conteniendo animaciones." +msgstr "Seleccioná un nodo AnimationPlayer para crear y editar animaciones." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -649,7 +638,8 @@ msgid "Scale Ratio:" msgstr "Ratio de Escala:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Elegir pistas a copiar:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -661,6 +651,11 @@ msgstr "Elegir pistas a copiar:" msgid "Copy" msgstr "Copiar" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "No Seleccionar Ninguno" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Agregar Clip de Pista de Audio" @@ -986,7 +981,7 @@ msgid "Resource" msgstr "Recursos" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Ruta" @@ -1257,9 +1252,8 @@ msgid "Delete Bus Effect" msgstr "Eliminar Efecto de Bus" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Audio Bus, Arrastrar y Soltar para reordenar." +msgstr "Arrastrar y soltar para reordenar." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1450,7 +1444,8 @@ msgstr "Agregar AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Ruta:" @@ -1504,7 +1499,7 @@ msgstr "Crear Carpeta" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nombre:" @@ -1903,6 +1898,7 @@ msgid "Class:" msgstr "Clase:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Hereda:" @@ -1911,9 +1907,8 @@ msgid "Inherited by:" msgstr "Heredada por:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Descripción Breve:" +msgstr "Descripción Breve" #: editor/editor_help.cpp msgid "Properties" @@ -1944,9 +1939,8 @@ msgid "Class Description" msgstr "Descripción de Clase" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Tutoriales En Linea:" +msgstr "Tutoriales en lÃnea" #: editor/editor_help.cpp msgid "" @@ -2069,7 +2063,7 @@ msgstr "Iniciar" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2085,19 +2079,19 @@ msgstr "Nodo" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "RPC Entrante" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "RSET Entrante" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "RPC Saliente" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "RSET Saliente" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2694,17 +2688,16 @@ msgid "Project Settings..." msgstr "Ajustes del Proyecto..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Version:" +msgstr "Control de Versiones" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Inicializar Control de Versiones" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Desactivar Control de Versiones" #: editor/editor_node.cpp msgid "Export..." @@ -2978,7 +2971,7 @@ msgstr "Inspector" msgid "Expand Bottom Panel" msgstr "Expandir Panel Inferior" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Salida" @@ -3006,9 +2999,16 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Esto va a inicializar tu proyecto para builds de Android personalizados, " +"instalando la plantilla de origen en \"res://android/build\".\n" +"Una vez hecho ésto podés aplicar modificaciones y generar tu propio APK " +"personalizado al exportar (agregar módulos, cambiar el AndroidManifest.xml, " +"etc.).\n" +"Tené en cuenta que para generar builds personalizados en vez de usar los " +"APKs pregenerados, la opcion \"Usar Build Personalizado\" deberÃa estar " +"activada en el preset de exportación de Android." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" @@ -3017,8 +3017,8 @@ msgid "" msgstr "" "La plantilla de compilación de Android ya está instalada y no se " "sobrescribirá.\n" -"Eliminá el directorio \"build\" manualmente antes de intentar esta operación " -"nuevamente." +"Eliminá el directorio \"res://android/build\" manualmente antes de intentar " +"esta operación nuevamente." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3081,9 +3081,8 @@ msgid "Open the previous Editor" msgstr "Abrir el Editor anterior" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Ninguna superficie de origen especificada." +msgstr "No se encontró ningún sub-recurso." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3094,9 +3093,8 @@ msgid "Thumbnail..." msgstr "Miniatura..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Abrir Script:" +msgstr "Script Principal:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3231,6 +3229,10 @@ msgstr "Seleccionar un Viewport" msgid "New Script" msgstr "Nuevo Script" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Extender Script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nuevo %s" @@ -3257,13 +3259,6 @@ msgstr "Pegar" msgid "Convert To %s" msgstr "Convertir A %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Abrir Editor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "El nodo seleccionado no es un Viewport!" @@ -3927,9 +3922,8 @@ msgid "Import As:" msgstr "Importar Como:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "Presets" +msgstr "Preset" #: editor/import_dock.cpp msgid "Reimport" @@ -4057,7 +4051,7 @@ msgstr "Nombre del Plugin:" msgid "Subfolder:" msgstr "Subcarpeta:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Lenguaje:" @@ -4199,6 +4193,12 @@ msgstr "Punto" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Abrir Editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Abrir Nodo de Animación" @@ -4550,7 +4550,6 @@ msgstr "Nombre de Animación:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Error!" @@ -4723,6 +4722,8 @@ msgid "Current:" msgstr "Actual:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Agregar Entrada" @@ -4927,6 +4928,10 @@ msgid "All" msgstr "Todos" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Importar..." @@ -5218,26 +5223,32 @@ msgid "Pan Mode" msgstr "Modo Paneo" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Modo de Ejecución:" +msgstr "Modo Regla" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Act/Desact. alineado." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Usar Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opciones de Alineado" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Act/Desact. alineado." + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Use Grid Snap" +msgstr "Snap de Grilla" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Ajustar a la Grilla" +msgid "Snapping Options" +msgstr "Opciones de Alineado" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5326,8 +5337,8 @@ msgid "View" msgstr "Vista" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Mostrar la Grilla" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5594,6 +5605,11 @@ msgstr "Act./Desact. Tangente Lineal de Curva" msgid "Hold Shift to edit tangents individually" msgstr "Mantené Shift para editar tangentes individualmente" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Click Derecho: Eliminar Punto" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Bake GI Probe" @@ -6233,6 +6249,10 @@ msgid "Grid" msgstr "Grilla" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Mostrar la Grilla" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Configurar Grilla:" @@ -6289,6 +6309,7 @@ msgstr "Instancia:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Tipo:" @@ -6387,6 +6408,11 @@ msgid "Find Next" msgstr "Encontrar Siguiente" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Encontrar Anterior" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Filtrar scripts" @@ -6656,6 +6682,11 @@ msgstr "Puntos de interrupción" msgid "Cut" msgstr "Cortar" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Seleccionar Todo" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Eliminar LÃnea" @@ -6713,10 +6744,6 @@ msgid "Auto Indent" msgstr "Auto Indentar" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Encontrar Anterior" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Buscar en Archivos..." @@ -7038,6 +7065,11 @@ msgid "Freelook Speed Modifier" msgstr "Modificador de Velocidad de Vista Libre" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Modificador de Velocidad de Vista Libre" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7076,6 +7108,10 @@ msgid "Use Local Space" msgstr "Usar Espacio Local" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Usar Snap" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Vista Inferior" @@ -7302,6 +7338,11 @@ msgid "Simplification: " msgstr "Simplificación: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Crecer (Pixeles): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Crecer (Pixeles): " @@ -7350,9 +7391,8 @@ msgid "(empty)" msgstr "(vacÃo)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Pegar Frame" +msgstr "Mover Fotograma" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7669,13 +7709,12 @@ msgid "Enable Priority" msgstr "Activar Prioridad" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Filtrar Archivos..." +msgstr "Filtrar tiles" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "Asignale un recurso TileSet a este TileMap para usas sus tiles." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7813,6 +7852,8 @@ msgstr "Mostrar Nombres de Tiles (mantener Tecla Alt)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Agregá o seleccioná una textura en el panel izquierdo para editar los tiles " +"asignados a él." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -7986,92 +8027,80 @@ msgid "TileSet" msgstr "TileSet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Nombre del padre del nodo, si está disponible" +msgstr "No hay addons de VCS disponibles." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Error" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "No se indicó ningún nombre" +msgstr "No se indicó ningún mensaje de commit" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "No se agregaron archivos al stage" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Comunidad" +msgstr "Commit" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "El Addon de VCS no está inicializado" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "Sistema de Control de Versiones" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Capitalizar" +msgstr "Inicializar" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "Ãrea de Staging" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Crear un rectángulo nuevo." +msgstr "Detectar nuevos cambios" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Cambiar" +msgstr "Cambios" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Modificado/s" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Renombrar" +msgstr "Renombrado/s" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Eliminar" +msgstr "Eliminado/s" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Cambiar" +msgstr "Cambio de Tipo" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Eliminar Seleccionados" +msgstr "Hacer Staging de Selección" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Guardar Todo" +msgstr "Hacer Staging de Todo" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Agregar mensaje de commit" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Sincronizar Cambios en Scripts" +msgstr "Commitear Cambios" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8080,27 +8109,23 @@ msgstr "Estado" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" -msgstr "" +msgstr "Ver diferencias de archivos antes de commitearlos a la última versión" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No file diff is active" -msgstr "Ningún Archivo seleccionado!" +msgstr "No hay ningún diff de archivos activo" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "Detectar cambios en el diff de archivo" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(Sólo GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Añadir entrada +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Añadir salida +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8116,6 +8141,11 @@ msgid "Boolean" msgstr "Booleano" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "Muestras" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Agregar puerto de entrada" @@ -8333,11 +8363,10 @@ msgstr "" "o falso." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" -"Devuelve un vector asociado si el valor booleano proporcionado es verdadero " +"Devuelve un escalar asociado si el valor booleano proporcionado es verdadero " "o falso." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9052,15 +9081,19 @@ msgid "Resources to export:" msgstr "Recursos a exportar:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtros para exportar archivos que no son recursos (separados por comas, ej: " "*.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtros para excluir archivos del proyecto (separados por comas, ej: *.json, " "*.txt)" @@ -9660,9 +9693,8 @@ msgid "Settings saved OK." msgstr "Ajustes guardados satisfactoriamente." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Agregar Evento de Acción de Entrada" +msgstr "Evento de Acción de Entrada Movido" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -10029,9 +10061,8 @@ msgid "Instance Scene(s)" msgstr "Instanciar Escena(s)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Guardar Rama como Escena" +msgstr "Reemplazar con Escena de Rama" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10076,23 +10107,20 @@ msgid "Make node as Root" msgstr "Convertir nodo en RaÃz" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Eliminar Nodos" +msgstr "¿Eliminar %d nodos?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "Quitar Nodo(s) de Gráfico de Shaders" +msgstr "¿Eliminar el nodo raiz \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "¿Eliminar el nodo \"%s\" y sus hijos?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Eliminar Nodos" +msgstr "¿Eliminar nodo \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10115,12 +10143,13 @@ msgstr "" "vuelvan a sus valores por defecto." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Hijos Editables" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Cargar Como Placeholder" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Desactivar \"editable_instance\" causara que todas las propiedades del nodo " +"vuelvan a sus valores por defecto." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10196,6 +10225,14 @@ msgid "Clear Inheritance" msgstr "Limpiar Herencia" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Hijos Editables" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Cargar Como Placeholder" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Abrir Documentación" @@ -10212,10 +10249,6 @@ msgid "Change Type" msgstr "Cambiar Tipo" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Extender Script" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "Reemparentar a Nuevo Nodo" @@ -10457,23 +10490,18 @@ msgid "Will load an existing script file." msgstr "Se cargará un archivo de script existente." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Lenguaje" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Hereda" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Nombre de Clase" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Plantilla" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Script Integrado (Built-In)" #: editor/script_create_dialog.cpp @@ -10489,38 +10517,32 @@ msgid "Bytes:" msgstr "Bytes:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "Advertencias:" +msgstr "Advertencia:" #: editor/script_editor_debugger.cpp msgid "Error:" msgstr "Error:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Copiar Error" +msgstr "Error de C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Error:" +msgstr "Error de C++:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Fuente" +msgstr "Fuente C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Fuente" +msgstr "Fuente:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Fuente" +msgstr "Fuente C++:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10531,18 +10553,16 @@ msgid "Errors" msgstr "Errores" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Proceso Hijo Conectado" +msgstr "Proceso hijo conectado." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Copiar Error" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Puntos de interrupción" +msgstr "Saltear Breakpoints" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10561,9 +10581,8 @@ msgid "Profiler" msgstr "Profiler" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Exportar Perfil" +msgstr "Profiler de Red" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10787,7 +10806,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Se esperaba un string de longitud 1 (un carácter)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10945,13 +10964,12 @@ msgid "Pick Distance:" msgstr "Elegir Instancia:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Filtrar métodos" +msgstr "Filtrar meshes" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." -msgstr "" +msgstr "Asignar un recurso MeshLibrary a este GridMap para usar sus meshes." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11127,6 +11145,11 @@ msgid "Add Function" msgstr "Agregar Función" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Eliminar puerto de entrada" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Agregar Variable" @@ -11135,6 +11158,26 @@ msgid "Add Signal" msgstr "Agregar Señal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Agregar puerto de entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Añadir puerto de salida" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Eliminar puerto de entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Eliminar puerto de salida" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Cambiar Expresión" @@ -11179,10 +11222,20 @@ msgid "Add Preload Node" msgstr "Agregar Nodo Preload" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Agregar Nodo(s) Desde Arbol" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Agregar Propiedad Getter" @@ -11207,6 +11260,11 @@ msgid "Connect Nodes" msgstr "Conectar Nodos" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Desconectar Nodo de Gráfico" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Conectar Datos de Nodos" @@ -11239,6 +11297,28 @@ msgid "Paste VisualScript Nodes" msgstr "Pegar Nodos de VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "No se puede copiar el nodo de función." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Renombrar Función" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Quitar Función" @@ -11259,21 +11339,17 @@ msgid "Editing Signal:" msgstr "Editando Señal:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "Crear Local" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Tipo Base:" +msgstr "Convertir en Herramienta:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Miembros:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Nodos Disponibles:" +#, fuzzy +msgid "function_name" +msgstr "Funcion:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11296,6 +11372,16 @@ msgid "Cut Nodes" msgstr "Cortar Nodos" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Renombrar Función" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Refrescar" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Editar Miembros" @@ -11397,6 +11483,10 @@ msgid "The package must have at least one '.' separator." msgstr "El paquete debe tener al menos un '.' como separador." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Seleccionar dispositivo de la lista" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "Ejecutable ADB no configurado en Configuración del Editor." @@ -11422,13 +11512,12 @@ msgstr "" "Configuración del Editor." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"El proyecto Android no está instalado para la compilación. Instálalo desde " -"el menú Editor." +"La plantilla de exportación de Android no esta instalada en el proyecto. " +"Instalala desde el menú de Proyecto." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11519,6 +11608,10 @@ msgid "Required icon is not specified in the preset." msgstr "El icono requerido no esta especificado en el preset." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Ejecutar en el Navegador" @@ -12194,10 +12287,6 @@ msgstr "" "pueda obtener un tamaño. Alternativamente, haz un RenderTarget y asigna su " "textura interna a algún otro nodo para mostrar." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Entrada" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fuente inválida para la vista previa." @@ -12226,6 +12315,27 @@ msgstr "Solo se pueden asignar variaciones en funciones de vértice." msgid "Constants cannot be modified." msgstr "Las constantes no pueden modificarse." +#~ msgid "Snap to Grid" +#~ msgstr "Ajustar a la Grilla" + +#~ msgid "Add input +" +#~ msgstr "Añadir entrada +" + +#~ msgid "Language" +#~ msgstr "Lenguaje" + +#~ msgid "Inherits" +#~ msgstr "Hereda" + +#~ msgid "Base Type:" +#~ msgstr "Tipo Base:" + +#~ msgid "Available Nodes:" +#~ msgstr "Nodos Disponibles:" + +#~ msgid "Input" +#~ msgstr "Entrada" + #~ msgid "Properties:" #~ msgstr "Propiedades:" @@ -12450,9 +12560,6 @@ msgstr "Las constantes no pueden modificarse." #~ msgid "Go to parent folder" #~ msgstr "Ir a carpeta padre" -#~ msgid "Select device from the list" -#~ msgstr "Seleccionar dispositivo de la lista" - #~ msgid "Open Scene(s)" #~ msgstr "Abrir Escena(s)" @@ -12693,9 +12800,6 @@ msgstr "Las constantes no pueden modificarse." #~ msgid "Warning" #~ msgstr "Advertencia" -#~ msgid "Function:" -#~ msgstr "Funcion:" - #~ msgid "Variable" #~ msgstr "Variable" @@ -12762,9 +12866,6 @@ msgstr "Las constantes no pueden modificarse." #~ msgid "Connect Graph Nodes" #~ msgstr "Conectar Nodos de Gráfico" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Desconectar Nodo de Gráfico" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Quitar Nodo de Gráfico de Shaders" @@ -13912,9 +14013,6 @@ msgstr "Las constantes no pueden modificarse." #~ msgid "Group" #~ msgstr "Grupo" -#~ msgid "Samples" -#~ msgstr "Muestras" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "Modo de Conversión de Muestras: (archivos .wav):" diff --git a/editor/translations/et.po b/editor/translations/et.po index df0c1148a7..a7cb86a27f 100644 --- a/editor/translations/et.po +++ b/editor/translations/et.po @@ -349,6 +349,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Loo" @@ -475,15 +476,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Vali Kõik" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Tühista Valik" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -618,7 +610,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -630,6 +622,11 @@ msgstr "" msgid "Copy" msgstr "Kopeeri" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Tühista Valik" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -946,7 +943,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1401,7 +1398,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1455,7 +1453,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1841,6 +1839,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2832,7 +2831,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3068,6 +3067,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3094,13 +3097,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3874,7 +3870,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4009,6 +4005,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4350,7 +4352,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4518,6 +4519,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4723,6 +4726,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5003,20 +5010,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5106,8 +5116,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5367,6 +5376,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5996,6 +6009,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6052,6 +6069,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6150,6 +6168,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6415,6 +6438,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Vali Kõik" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6473,10 +6501,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6796,6 +6820,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6829,6 +6857,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7055,6 +7087,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7819,11 +7855,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7839,6 +7871,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8695,12 +8731,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9684,11 +9722,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9762,6 +9798,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9778,10 +9822,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -10008,23 +10048,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10659,6 +10691,10 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Delete input port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10667,6 +10703,22 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Add Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10707,10 +10759,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10735,6 +10797,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10767,6 +10833,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Loo" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10791,16 +10878,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "Funktsioonid:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -10823,6 +10907,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Funktsioonid:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10917,6 +11010,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11016,6 +11113,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11553,10 +11654,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/eu.po b/editor/translations/eu.po index 069836ce69..6c8834e504 100644 --- a/editor/translations/eu.po +++ b/editor/translations/eu.po @@ -348,6 +348,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -473,15 +474,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -616,7 +608,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -628,6 +620,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -944,7 +940,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1399,7 +1395,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1453,7 +1450,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1837,6 +1834,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2827,7 +2825,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3063,6 +3061,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3089,13 +3091,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3868,7 +3863,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4003,6 +3998,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4344,7 +4345,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4512,6 +4512,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4716,6 +4718,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -4994,20 +5000,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5097,8 +5106,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5358,6 +5366,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5987,6 +5999,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6043,6 +6059,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6141,6 +6158,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6406,6 +6428,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6463,10 +6490,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6786,6 +6809,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6819,6 +6846,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7045,6 +7076,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7806,11 +7841,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7826,6 +7857,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8682,12 +8717,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9669,11 +9706,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9747,6 +9782,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9763,10 +9806,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -9993,23 +10032,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10643,6 +10674,10 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Delete input port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10651,6 +10686,22 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Add Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10691,10 +10742,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10719,6 +10780,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10751,6 +10816,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10775,15 +10860,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10807,6 +10888,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10901,6 +10990,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11000,6 +11093,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11537,10 +11634,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/fa.po b/editor/translations/fa.po index f66805fbdd..fe614abe09 100644 --- a/editor/translations/fa.po +++ b/editor/translations/fa.po @@ -372,6 +372,7 @@ msgstr "ساختن تعداد d% ترک جدید، ودرج کلیدها؟" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "تولید" @@ -508,16 +509,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "انتخاب همه" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "گره انتخاب" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -660,8 +651,9 @@ msgid "Scale Ratio:" msgstr "نسبت تغییر مقیاس:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "دارایی Setter را اضاÙÙ‡ Ú©Ù†" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -672,6 +664,11 @@ msgstr "" msgid "Copy" msgstr "Ú©Ù¾ÛŒ کردن" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "گره انتخاب" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1012,7 +1009,7 @@ msgid "Resource" msgstr "منبع" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "مسیر" @@ -1483,7 +1480,8 @@ msgstr "بارگذاری خودکار (AutoLoad) را اضاÙÙ‡ Ú©Ù†" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "مسیر:" @@ -1538,7 +1536,7 @@ msgstr "ساختن پوشه" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "نام:" @@ -1956,6 +1954,7 @@ msgid "Class:" msgstr "کلاس:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "میراث:" @@ -2990,7 +2989,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "خروجی" @@ -3236,6 +3235,11 @@ msgstr "" msgid "New Script" msgstr "صØÙ†Ù‡ جدید" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "باز کردن Ùˆ اجرای یک اسکریپت" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3263,14 +3267,6 @@ msgstr "چسباندن" msgid "Convert To %s" msgstr "اتصال به گره:" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "گشودن در ویرایشگر" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4095,7 +4091,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4241,6 +4237,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "گشودن در ویرایشگر" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4609,7 +4612,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4787,6 +4789,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -5001,6 +5005,10 @@ msgid "All" msgstr "همه" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "وارد کردن" @@ -5301,20 +5309,24 @@ msgstr "انتخاب ØØ§Ù„ت" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "یک Breakpoint درج Ú©Ù†" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "یک Breakpoint درج Ú©Ù†" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5409,8 +5421,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5680,6 +5691,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6330,6 +6345,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6386,6 +6405,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6495,6 +6515,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "صاÙÛŒ کردن گره‌ها" @@ -6781,6 +6806,11 @@ msgstr "ØØ°Ù Ú©Ù†" msgid "Cut" msgstr "بریدن" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "انتخاب همه" + #: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Delete Line" @@ -6843,10 +6873,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "ÛŒØ§ÙØªÙ†" @@ -7187,6 +7213,11 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "غلطاندن به پایین." + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7221,6 +7252,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7456,6 +7491,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8291,12 +8330,8 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Ø§ÙØ²ÙˆØ¯Ù† نقطه" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +msgid "Add Output" +msgstr "خروجی" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8312,6 +8347,11 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "Sampler" +msgstr "نمونه ها" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Add input port" msgstr "Ø§ÙØ²ÙˆØ¯Ù† عمل ورودی" @@ -9200,12 +9240,14 @@ msgstr "منابع برای صدور:" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10234,12 +10276,10 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "ÙØ±Ø²Ù†Ø¯ قابل ویرایش" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "بارگیری به عنوان جانگهدار" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy @@ -10321,6 +10361,14 @@ msgid "Clear Inheritance" msgstr "پاک کردن ارث‌بری" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "ÙØ±Ø²Ù†Ø¯ قابل ویرایش" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "بارگیری به عنوان جانگهدار" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "شمارش ها" @@ -10340,11 +10388,6 @@ msgstr "تغییر نوع" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "باز کردن Ùˆ اجرای یک اسکریپت" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "گره تغییر والد" @@ -10591,27 +10634,19 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp #, fuzzy -msgid "Inherits" -msgstr "میراث:" - -#: editor/script_create_dialog.cpp -#, fuzzy -msgid "Class Name" +msgid "Class Name:" msgstr "کلاس:" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" +msgid "Template:" msgstr "برداشتن انتخاب شده" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "باز کردن Ùˆ اجرای یک اسکریپت" #: editor/script_create_dialog.cpp #, fuzzy @@ -11293,6 +11328,11 @@ msgid "Add Function" msgstr "Ø§ÙØ²ÙˆØ¯Ù† وظیÙÙ‡" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "برداشتن نقطه" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Ø§ÙØ²ÙˆØ¯Ù† متغیر" @@ -11302,6 +11342,26 @@ msgstr "Signal را اضاÙÙ‡ Ú©Ù†" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Add Input Port" +msgstr "Ø§ÙØ²ÙˆØ¯Ù† عمل ورودی" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Ø§ÙØ²ÙˆØ¯Ù† عمل ورودی" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "برداشتن نقطه" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "برداشتن نقطه" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Change Expression" msgstr "انتقال را در انیمیشن تغییر بده" @@ -11344,10 +11404,20 @@ msgid "Add Preload Node" msgstr "Ø§ÙØ²ÙˆØ¯Ù† گره" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "گره(ها) را از درخت اضاÙÙ‡ Ú©Ù†" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Ø§ÙØ²ÙˆØ¯Ù† ویژگی Ø¯Ø±ÛŒØ§ÙØªâ€ŒÚ©Ù†Ù†Ø¯Ù‡" @@ -11373,6 +11443,11 @@ msgstr "اتصال گره‌ها" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "اتصال گره‌ها" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "اتصال گره‌ها" @@ -11407,6 +11482,27 @@ msgid "Paste VisualScript Nodes" msgstr "مسیر به سمت گره:" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "تغییر نام نقش" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "برداشتن نقش" @@ -11432,16 +11528,13 @@ msgid "Make Tool:" msgstr "Ù…ØÙ„ÛŒ" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "نوع پایه:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "عضوها:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "گره های موجود:" +#, fuzzy +msgid "function_name" +msgstr "وظایÙ:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11467,6 +11560,15 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "تغییر نام نقش" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "عضوها" @@ -11567,6 +11669,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11669,6 +11775,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12287,10 +12397,6 @@ msgstr "" "تا بتواند یک اندازه بگیرد. در غیر اینصورت، آن را یک RenderTarget قرار دهید Ùˆ " "Ø¨Ø§ÙØª داخلی آن را برای نمایش به تعدادی گره تخصیص دهید." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12323,6 +12429,20 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Add input +" +#~ msgstr "Ø§ÙØ²ÙˆØ¯Ù† نقطه" + +#, fuzzy +#~ msgid "Inherits" +#~ msgstr "میراث:" + +#~ msgid "Base Type:" +#~ msgstr "نوع پایه:" + +#~ msgid "Available Nodes:" +#~ msgstr "گره های موجود:" + +#, fuzzy #~ msgid "Methods:" #~ msgstr "روش ها" @@ -12796,9 +12916,6 @@ msgstr "" #~ msgid "at least 6 characters" #~ msgstr "کاراکترهای معتبر:" -#~ msgid "Samples" -#~ msgstr "نمونه ها" - #~ msgid "BakedLightInstance does not contain a BakedLight resource." #~ msgstr "BakedLightInstance Ù…ØØªÙˆÛŒ یک منبع BakedLight نیست." diff --git a/editor/translations/fi.po b/editor/translations/fi.po index 429ff2b24d..cad94fd55c 100644 --- a/editor/translations/fi.po +++ b/editor/translations/fi.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-26 11:50+0000\n" +"PO-Revision-Date: 2019-10-04 03:15+0000\n" "Last-Translator: Tapani Niemi <tapani.niemi@kapsi.fi>\n" "Language-Team: Finnish <https://hosted.weblate.org/projects/godot-engine/" "godot/fi/>\n" @@ -66,32 +66,31 @@ msgstr "Kutsuttaessa funktiota '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Sekoita" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -357,6 +356,7 @@ msgstr "Luo %d uutta raitaa ja lisää avaimet?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Luo" @@ -494,19 +494,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Varoitus: muokataan tuotua animaatiota" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Valitse kaikki" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Tyhjennä valinta" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "Polku animaatiot sisältävään AnimationPlayer solmuun on asettamatta." +msgstr "Valitse AnimationPlayer solmu luodaksesi ja muokataksesi animaatioita." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -638,7 +628,8 @@ msgid "Scale Ratio:" msgstr "Skaalaussuhde:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Valitse kopioitavat raidat:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -650,6 +641,11 @@ msgstr "Valitse kopioitavat raidat:" msgid "Copy" msgstr "Kopioi" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Tyhjennä valinta" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Lisää ääniraidan leike" @@ -973,7 +969,7 @@ msgid "Resource" msgstr "Resurssi" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Polku" @@ -1243,9 +1239,8 @@ msgid "Delete Bus Effect" msgstr "Poista väylän efekti" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Ääniväylä, tartu ja vedä järjestelläksesi uudelleen." +msgstr "Vedä ja pudota järjestelläksesi uudelleen." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1439,7 +1434,8 @@ msgstr "Lisää automaattisesti ladattava" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Polku:" @@ -1493,7 +1489,7 @@ msgstr "Luo kansio" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nimi:" @@ -1890,6 +1886,7 @@ msgid "Class:" msgstr "Luokka:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Perii:" @@ -1898,9 +1895,8 @@ msgid "Inherited by:" msgstr "Perivät:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Lyhyt kuvaus:" +msgstr "Lyhyt kuvaus" #: editor/editor_help.cpp msgid "Properties" @@ -1931,9 +1927,8 @@ msgid "Class Description" msgstr "Luokan kuvaus" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Online-oppaat:" +msgstr "Online-oppaat" #: editor/editor_help.cpp msgid "" @@ -2056,7 +2051,7 @@ msgstr "Aloita" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2072,19 +2067,19 @@ msgstr "Solmu" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "Tuleva RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "Tuleva RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "Lähtevä RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "Lähtevä RSET" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2665,17 +2660,16 @@ msgid "Project Settings..." msgstr "Projektin asetukset..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Versio:" +msgstr "Versionhallinta" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Määritä versionhallinta" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Sammuta versionhallinta" #: editor/editor_node.cpp msgid "Export..." @@ -2947,7 +2941,7 @@ msgstr "Tarkastelu" msgid "Expand Bottom Panel" msgstr "Laajenna alapaneeli" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Tuloste" @@ -2973,18 +2967,25 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Tämä valmistelee projektisi mukautettuja Android-käännöksiä varten " +"asentamalla lähdemallin hakemistoon \"res://android/build\".\n" +"Voit sen jälkeen soveltaa muunnoksia ja kääntää oman räätälöidyn APK:n " +"vientiin (lisäten moduuleja, muuttaen AndroidManifest.xml tiedostoa, jne.)\n" +"Huomaa, että tehdäksesi mukautettuja käännöksiä esikäännetyn APK:n " +"käyttämisen sijaan, \"Use Custom Build\" valinnan tulee olla päällä Android-" +"viennin esiasetuksissa." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" "Remove the \"res://android/build\" directory manually before attempting this " "operation again." msgstr "" -"Androidin käännösmalli on jo asennettu, eikä sitä ylikirjoiteta.\n" -"Poista \"build\" hakemisto käsin ennen kuin yrität tätä toimenpidettä " -"uudelleen." +"Androidin käännösmalli on jo asennettu tähän projektiin, eikä sitä " +"ylikirjoiteta.\n" +"Poista \"res://android/build\" hakemisto käsin ennen kuin yrität tätä " +"toimenpidettä uudelleen." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3047,9 +3048,8 @@ msgid "Open the previous Editor" msgstr "Avaa edellinen editori" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Pinnan lähdettä ei ole määritelty." +msgstr "Aliresursseja ei löydetty." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3060,9 +3060,8 @@ msgid "Thumbnail..." msgstr "Pienoiskuva..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Avaa skripti:" +msgstr "Pääskripti:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3198,6 +3197,10 @@ msgstr "Valitse näyttöruutu" msgid "New Script" msgstr "Uusi skripti" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Laajenna skriptiä" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Uusi %s" @@ -3224,13 +3227,6 @@ msgstr "Liitä" msgid "Convert To %s" msgstr "Muunna muotoon %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Avaa editori" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Valittu solmu ei ole Viewport!" @@ -3890,7 +3886,6 @@ msgid "Import As:" msgstr "Tuo nimellä:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" msgstr "Esiasetukset" @@ -4020,7 +4015,7 @@ msgstr "Liitännäisen nimi:" msgid "Subfolder:" msgstr "Alikansio:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Kieli:" @@ -4162,6 +4157,12 @@ msgstr "Piste" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Avaa editori" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Avaa animaatiosolmu" @@ -4508,7 +4509,6 @@ msgstr "Animaation nimi:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Virhe!" @@ -4681,6 +4681,8 @@ msgid "Current:" msgstr "Nykyinen:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Lisää syöte" @@ -4886,6 +4888,10 @@ msgid "All" msgstr "Kaikki" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Tuo..." @@ -5177,28 +5183,34 @@ msgid "Pan Mode" msgstr "Panorointitila" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Käynnistystila:" +msgstr "Viivaintila" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Aseta tarttuminen." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Käytä tarttumista" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Tarttumisen asetukset" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Aseta tarttuminen." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +#, fuzzy +msgid "Use Grid Snap" msgstr "Tartu ruudukkoon" #: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Tarttumisen asetukset" + +#: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" msgstr "Tartu käännettäessä" @@ -5285,8 +5297,8 @@ msgid "View" msgstr "Näytä" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Näytä ruudukko" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5553,6 +5565,11 @@ msgstr "Aseta käyrälle lineaarinen tangentti" msgid "Hold Shift to edit tangents individually" msgstr "Pidä shift pohjassa muokataksesi tangentteja yksitellen" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Oikea painallus: poista piste" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Kehitä GI Probe" @@ -6192,6 +6209,10 @@ msgid "Grid" msgstr "Ruudukko" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Näytä ruudukko" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Määrittele ruudukko:" @@ -6248,6 +6269,7 @@ msgstr "Ilmentymä:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Tyyppi:" @@ -6346,6 +6368,11 @@ msgid "Find Next" msgstr "Etsi seuraava" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Etsi edellinen" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Suodata skriptejä" @@ -6614,6 +6641,11 @@ msgstr "Keskeytyskohdat" msgid "Cut" msgstr "Leikkaa" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Valitse kaikki" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Poista rivi" @@ -6671,10 +6703,6 @@ msgid "Auto Indent" msgstr "Automaattinen sisennys" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Etsi edellinen" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Etsi tiedostoista..." @@ -6996,6 +7024,11 @@ msgid "Freelook Speed Modifier" msgstr "Liikkumisen nopeussäädin" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Liikkumisen nopeussäädin" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7034,6 +7067,10 @@ msgid "Use Local Space" msgstr "Käytä paikallisavaruutta" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Käytä tarttumista" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Alanäkymä" @@ -7260,6 +7297,11 @@ msgid "Simplification: " msgstr "Yksinkertaistus: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Suurrennus (pikseleissä): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Suurrennus (pikseleissä): " @@ -7308,9 +7350,8 @@ msgid "(empty)" msgstr "(tyhjä)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Liitä ruutu" +msgstr "Siirrä ruutua" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7627,13 +7668,14 @@ msgid "Enable Priority" msgstr "Ota prioriteetti käyttöön" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Suodata tiedostot..." +msgstr "Suodata ruutuja" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." msgstr "" +"Anna tälle ruutukartalle (TileMap) ruutuvalikoimaresurssi (TileSet) " +"käyttääksesi sen ruutuja." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7771,6 +7813,8 @@ msgstr "Näytä ruutujen nimet (pidä Alt-näppäin pohjassa)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Lisää tai valitse tekstuuri vasemmasta paneelista muokataksesi siihen " +"sidottuja ruutuja." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -7944,92 +7988,80 @@ msgid "TileSet" msgstr "Ruutuvalikoima" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Solmun yläsolmun nimi, jos saatavilla" +msgstr "VCS-lisäosia ei ole saatavilla." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Virhe" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "Nimeä ei annettu" +msgstr "Muutosviestiä ei annettu" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "Tiedostoja ei ole lisätty valmisteluun" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Yhteisö" +msgstr "Vahvista muutos" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "VCS-lisäosaa ei ole alustettu" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "Versionhallintajärjestelmä" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Isot alkukirjaimet" +msgstr "Alusta" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "Valmistelualue" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Luo uusi suorakulmio." +msgstr "Havaitse uudet muutokset" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Muuta" +msgstr "Muutokset" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Muutettu" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Nimeä uudelleen" +msgstr "Nimetty uudelleen" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Poista" +msgstr "Poistettu" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Muuta" +msgstr "Tyyppimuunnos" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Poista valitut" +msgstr "Valmistele valitut" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Tallenna kaikki" +msgstr "Valmistele kaikki" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Lisää muutosviesti" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Synkronoi skriptin muutokset" +msgstr "Vahvista muutokset" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8039,26 +8071,24 @@ msgstr "Tila" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" msgstr "" +"Katso tiedostojen eroavaisuudet ennen niiden vahvistamista viimeisimpään " +"versioon" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No file diff is active" -msgstr "Ei valittuja tiedostoja!" +msgstr "Mitään tiedostovertailua ei ole aktiivisena" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "Havaitse muutokset tiedostovertailussa" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(Vain GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Lisää tulo +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Lisää lähtö +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8074,6 +8104,11 @@ msgid "Boolean" msgstr "Totuusarvo" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "Lisää Sample" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Lisää tuloportti" @@ -8285,11 +8320,10 @@ msgstr "" "Palauttaa liitetyn vektorin, jos annettu totuusarvo on tosi tai epätosi." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" -"Palauttaa liitetyn vektorin, jos annettu totuusarvo on tosi tai epätosi." +"Palauttaa liitetyn skalaarin, jos annettu totuusarvo on tosi tai epätosi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the comparison between two parameters." @@ -9002,15 +9036,19 @@ msgid "Resources to export:" msgstr "Vietävät resurssit:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Suodattimet tiedostojen viemiseen jotka eivät ole resursseja (esim. *.json, " "*.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Suodattimet tiedostoille jotka jätetään projektista pois (esim. *.json, *." "txt)" @@ -9606,9 +9644,8 @@ msgid "Settings saved OK." msgstr "Asetukset tallennettu onnistuneesti." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Lisää syötetoiminnon tapahtuma" +msgstr "Siirretty syötetoiminnon tapahtuma" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -9975,9 +10012,8 @@ msgid "Instance Scene(s)" msgstr "Luo ilmentymä skenestä tai skeneistä" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Tallenna haara skenenä" +msgstr "Korvaa skenehaaralla" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10024,23 +10060,20 @@ msgid "Make node as Root" msgstr "Tee solmusta juurisolmu" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Poista solmut" +msgstr "Poista %d solmua?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "Poista sävytingraafin solmuja" +msgstr "Poista juurisolmu \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "Poista solmu \"%s\" ja sen alisolmut?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Poista solmut" +msgstr "Poista solmu \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10063,12 +10096,13 @@ msgstr "" "solmun ominaisuudet oletusarvoihin." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Muokattavat alisolmut" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Lataa paikanpitäjäksi" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"\"editable_instance\" ominaisuuden poistaminen käytöstä palauttaa kaikki " +"solmun ominaisuudet oletusarvoihin." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10143,6 +10177,14 @@ msgid "Clear Inheritance" msgstr "Poista perintä" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Muokattavat alisolmut" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Lataa paikanpitäjäksi" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Avaa dokumentaatio" @@ -10159,10 +10201,6 @@ msgid "Change Type" msgstr "Muuta tyyppiä" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Laajenna skriptiä" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "Vaihda solmulle uusi isäntä" @@ -10403,23 +10441,18 @@ msgid "Will load an existing script file." msgstr "Lataa olemassaolevan skriptitiedoston." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Kieli" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Perii" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Luokan nimi" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Malli" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Sisäänrakennettu skripti" #: editor/script_create_dialog.cpp @@ -10435,38 +10468,32 @@ msgid "Bytes:" msgstr "Tavu(j)a:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "Varoitukset:" +msgstr "Varoitus:" #: editor/script_editor_debugger.cpp msgid "Error:" msgstr "Virhe:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Kopioi virhe" +msgstr "C++ virhe" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Virhe:" +msgstr "C++ virhe:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Lähde" +msgstr "C++ lähdekoodi" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Lähde" +msgstr "Lähdekoodi:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Lähde" +msgstr "C++ lähdekoodi:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10477,18 +10504,16 @@ msgid "Errors" msgstr "Virheet" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Aliprosessi yhdistetty" +msgstr "Aliprosessi yhdistetty." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Kopioi virhe" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Keskeytyskohdat" +msgstr "Sivuuta keskeytyskohdat" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10507,9 +10532,8 @@ msgid "Profiler" msgstr "Profiloija" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Vie profiili" +msgstr "Verkkoprofiloija" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10733,7 +10757,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Odotettiin yhden mittaista merkkijonoa (yhtä merkkiä)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10892,13 +10916,13 @@ msgid "Pick Distance:" msgstr "Poimintaetäisyys:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Suodata metodeja" +msgstr "Suodata meshejä" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." msgstr "" +"Anna MeshLibrary resurssi tälle GridMap solmulle käyttääksesi sen meshejä." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11073,6 +11097,11 @@ msgid "Add Function" msgstr "Lisää funktio" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Poista tuloportti" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Lisää muuttuja" @@ -11081,6 +11110,26 @@ msgid "Add Signal" msgstr "Lisää signaali" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Lisää tuloportti" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Lisää lähtöportti" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Poista tuloportti" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Poista lähtöportti" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Vaihda lauseketta" @@ -11126,10 +11175,20 @@ msgid "Add Preload Node" msgstr "Lisää esiladattu solmu" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Lisää solmut puusta" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Lisää palauttajaominaisuus" @@ -11154,6 +11213,11 @@ msgid "Connect Nodes" msgstr "Kytke solmut" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Erota graafin solmut" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Kytke solmun data" @@ -11186,6 +11250,28 @@ msgid "Paste VisualScript Nodes" msgstr "Liitä VisualScript solmut" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Ei voida kopioida funktiosolmua." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Nimeä funktio uudelleen" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Poista funktio" @@ -11206,21 +11292,17 @@ msgid "Editing Signal:" msgstr "Muokataan signaalia:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "Tee paikallinen" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Kantatyyppi:" +msgstr "Tee työkalu:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Jäsenet:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Saatavilla olevat solmut:" +#, fuzzy +msgid "function_name" +msgstr "Funktio:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11243,6 +11325,16 @@ msgid "Cut Nodes" msgstr "Leikkaa solmut" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Nimeä funktio uudelleen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Päivitä" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Muokkaa jäsentä" @@ -11340,6 +11432,10 @@ msgid "The package must have at least one '.' separator." msgstr "Paketilla on oltava ainakin yksi '.' erotinmerkki." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Valitse laite listasta" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "ADB käynnistystiedostoa ei ole määritetty editorin asetuksissa." @@ -11365,12 +11461,11 @@ msgstr "" "asetuksissa." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"Android-projektia ei ole asennettu kääntämistä varten. Asenna se Editori-" +"Android-käännösmallia ei ole asennettu projektiin. Asenna se Projekti-" "valikosta." #: platform/android/export/export.cpp @@ -11456,6 +11551,10 @@ msgid "Required icon is not specified in the preset." msgstr "Vaadittavaa ikonia ei ole määritetty esiasetuksissa." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Suorita selaimessa" @@ -12117,10 +12216,6 @@ msgstr "" "saada koon. Muutoin tee siitä RenderTarget ja aseta sen sisäinen tekstuuri " "johonkin solmuun näkyväksi." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Syöte" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Virheellinen lähde esikatselulle." @@ -12149,6 +12244,27 @@ msgstr "Varying tyypin voi sijoittaa vain vertex-funktiossa." msgid "Constants cannot be modified." msgstr "Vakioita ei voi muokata." +#~ msgid "Snap to Grid" +#~ msgstr "Tartu ruudukkoon" + +#~ msgid "Add input +" +#~ msgstr "Lisää tulo +" + +#~ msgid "Language" +#~ msgstr "Kieli" + +#~ msgid "Inherits" +#~ msgstr "Perii" + +#~ msgid "Base Type:" +#~ msgstr "Kantatyyppi:" + +#~ msgid "Available Nodes:" +#~ msgstr "Saatavilla olevat solmut:" + +#~ msgid "Input" +#~ msgstr "Syöte" + #~ msgid "Properties:" #~ msgstr "Ominaisuudet:" @@ -12427,9 +12543,6 @@ msgstr "Vakioita ei voi muokata." #~ msgid "Go to parent folder" #~ msgstr "Siirry yläkansioon" -#~ msgid "Select device from the list" -#~ msgstr "Valitse laite listasta" - #~ msgid "Open Scene(s)" #~ msgstr "Avaa skene tai skenejä" @@ -12666,9 +12779,6 @@ msgstr "Vakioita ei voi muokata." #~ msgid "Warning" #~ msgstr "Varoitus" -#~ msgid "Function:" -#~ msgstr "Funktio:" - #~ msgid "Variable" #~ msgstr "Muuttuja" @@ -12735,9 +12845,6 @@ msgstr "Vakioita ei voi muokata." #~ msgid "Connect Graph Nodes" #~ msgstr "Yhdistä graafin solmut" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Erota graafin solmut" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Poista sävytingraafin solmu" @@ -13368,9 +13475,6 @@ msgstr "Vakioita ei voi muokata." #~ msgid "ERROR: Couldn't load sample!" #~ msgstr "VIRHE: Samplea ei voitu ladata!" -#~ msgid "Add Sample" -#~ msgstr "Lisää Sample" - #~ msgid "Rename Sample" #~ msgstr "Nimeä Sample uudelleen" diff --git a/editor/translations/fil.po b/editor/translations/fil.po index fc6b4085a0..11a3f7c0a4 100644 --- a/editor/translations/fil.po +++ b/editor/translations/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2019-08-11 10:23+0000\n" +"PO-Revision-Date: 2019-10-11 15:07+0000\n" "Last-Translator: Marco Santos <enum.scima@gmail.com>\n" "Language-Team: Filipino <https://hosted.weblate.org/projects/godot-engine/" "godot/fil/>\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1 && n != 2 && n != 3 && (n % 10 == 4 " "|| n % 10 == 6 || n % 10 == 9);\n" -"X-Generator: Weblate 3.8-dev\n" +"X-Generator: Weblate 3.9-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -35,12 +35,12 @@ msgstr "" #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "Invalid na input %i (hindi pinasa) sa ekspresyon" +msgstr "Invalid na input %i (hindi ipinasa) sa expression" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" msgstr "" -"Hindi magagamit ang self dahil ang instance ay naka-null (hindi pinasa)" +"Hindi magagamit ang self dahil ang instance ay naka-null (hindi ipinasa)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." @@ -64,31 +64,31 @@ msgstr "On call sa '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp msgid "MiB" -msgstr "" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -112,7 +112,7 @@ msgstr "Halaga:" #: editor/animation_bezier_editor.cpp msgid "Insert Key Here" -msgstr "Mag-insert ng Key Rito" +msgstr "Mag-insert ng Key dito" #: editor/animation_bezier_editor.cpp msgid "Duplicate Selected Key(s)" @@ -144,15 +144,15 @@ msgstr "I-anim ang Oras ng Pagbago ng Keyframe" #: editor/animation_track_editor.cpp msgid "Anim Change Transition" -msgstr "I-anim ang Transisyon ng Pagbago" +msgstr "I-anim ang Transition ng Pagbago" #: editor/animation_track_editor.cpp msgid "Anim Change Transform" -msgstr "" +msgstr "I-anim ang Pagbabago sa Transform" #: editor/animation_track_editor.cpp msgid "Anim Change Keyframe Value" -msgstr "" +msgstr "I-anim ang Halaga ng Keyframe na Binago" #: editor/animation_track_editor.cpp msgid "Anim Change Call" @@ -354,6 +354,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -479,15 +480,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -622,7 +614,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -634,6 +626,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -950,7 +946,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1405,7 +1401,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1459,7 +1456,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1843,6 +1840,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2834,7 +2832,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3070,6 +3068,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3096,13 +3098,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3875,7 +3870,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4010,6 +4005,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4351,7 +4352,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4519,6 +4519,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4724,6 +4726,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5003,20 +5009,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5106,8 +5115,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5369,6 +5377,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5999,6 +6011,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6055,6 +6071,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6153,6 +6170,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6418,6 +6440,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6475,10 +6502,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6798,6 +6821,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6831,6 +6858,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7057,6 +7088,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7820,11 +7855,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7840,6 +7871,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8697,12 +8732,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9684,11 +9721,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9762,6 +9797,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9778,10 +9821,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -10008,23 +10047,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Inherits" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10659,6 +10690,10 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Delete input port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10667,6 +10702,25 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Idagdag Ang Bezier Point" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Ilipat Ang Mga Bezier Points" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Ilipat Ang Mga Bezier Points" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10707,10 +10761,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10735,6 +10799,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10767,6 +10835,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10791,15 +10879,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10823,6 +10907,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10917,6 +11009,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11016,6 +11112,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11553,10 +11653,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/fr.po b/editor/translations/fr.po index d2a4da4e25..cecaead406 100644 --- a/editor/translations/fr.po +++ b/editor/translations/fr.po @@ -71,7 +71,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-26 11:50+0000\n" +"PO-Revision-Date: 2019-10-06 08:48+0000\n" "Last-Translator: Sofiane <Sofiane-77@caramail.fr>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot/fr/>\n" @@ -120,36 +120,35 @@ msgstr "Arguments invalides pour construire '%s'" #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "Sur appel à '%s' :" +msgstr "Lors de l'appel à '%s' :" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "Octet" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "Kio" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Mixer" +msgstr "Mio" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "Gio" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "Tio" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "Pio" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "Eio" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -229,7 +228,7 @@ msgstr "Changer la transition de l'animation" #: editor/animation_track_editor.cpp msgid "Anim Multi Change Transform" -msgstr "Changer le Transform" +msgstr "Changer le Transform de l'animation" #: editor/animation_track_editor.cpp msgid "Anim Multi Change Keyframe Value" @@ -241,12 +240,12 @@ msgstr "Changer l'appel de l'animation" #: editor/animation_track_editor.cpp msgid "Change Animation Length" -msgstr "Modifier la longueur de l'animation" +msgstr "Modifier la durée de l'animation" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "Modifier la boucle d'animation" +msgstr "Changer la boucle d'animation" #: editor/animation_track_editor.cpp msgid "Property Track" @@ -373,7 +372,7 @@ msgstr "Envelopper l'interp. de la boucle" #: editor/animation_track_editor.cpp #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key" -msgstr "Insérer une clé" +msgstr "Insérer clés" #: editor/animation_track_editor.cpp msgid "Duplicate Key(s)" @@ -415,6 +414,7 @@ msgstr "Créer %d NOUVELLES pistes et insérer des clés ?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Créer" @@ -562,21 +562,10 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Avertissement : Édition d'une animation importée" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Tout sélectionner" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Tout désélectionner" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" -"Le chemin d'accès à un nÅ“ud AnimationPlayer contenant des animations n'est " -"pas défini." +"Sélectionnez un nÅ“ud AnimationPlayer pour créer et modifier des animations." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -627,7 +616,7 @@ msgstr "Mettre à l'échelle la sélection" #: editor/animation_track_editor.cpp msgid "Scale From Cursor" -msgstr "Mettre à l’échelle à partir du curseur" +msgstr "Agrandir/Rétrécir à partir du curseur" #: editor/animation_track_editor.cpp modules/gridmap/grid_map_editor_plugin.cpp msgid "Duplicate Selection" @@ -710,7 +699,8 @@ msgid "Scale Ratio:" msgstr "Ratio d'échelle :" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Sélectionner les pistes à copier :" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -722,6 +712,11 @@ msgstr "Sélectionner les pistes à copier :" msgid "Copy" msgstr "Copier" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Tout Désélectionner" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Ajouter un clip audio" @@ -1046,7 +1041,7 @@ msgid "Resource" msgstr "Ressource" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Chemin" @@ -1317,9 +1312,8 @@ msgid "Delete Bus Effect" msgstr "Supprimer l'effet de transport" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Bus audio, glisser-déposer pour réorganiser." +msgstr "Glisser-déposer pour réorganiser." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1456,7 +1450,7 @@ msgstr "" #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing built-in type name." msgstr "" -"Ne doit pas entrer en conflit avec un nom de type existant intégré au moteur." +"Ne doit pas être en conflit avec un nom de type existant intégré au moteur." #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing global constant name." @@ -1512,7 +1506,8 @@ msgstr "Ajouter le chargement automatique" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Chemin :" @@ -1566,7 +1561,7 @@ msgstr "Créer un dossier" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nom :" @@ -1963,6 +1958,7 @@ msgid "Class:" msgstr "Classe :" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Hérite de :" @@ -1971,9 +1967,8 @@ msgid "Inherited by:" msgstr "Héritée par :" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Brève description :" +msgstr "Brève description" #: editor/editor_help.cpp msgid "Properties" @@ -2004,9 +1999,8 @@ msgid "Class Description" msgstr "Description de la classe" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Tutoriels en ligne :" +msgstr "Tutoriels en ligne" #: editor/editor_help.cpp msgid "" @@ -2129,16 +2123,15 @@ msgstr "Démarrer" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp -#, fuzzy msgid "Down" -msgstr "Télécharger" +msgstr "Descendre" #: editor/editor_network_profiler.cpp msgid "Up" -msgstr "" +msgstr "Monter" #: editor/editor_network_profiler.cpp editor/editor_node.cpp msgid "Node" @@ -2146,19 +2139,19 @@ msgstr "NÅ“ud" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "Entrées RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "RSET entrant" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "RPC sortant" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "RSET sortant" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2500,7 +2493,7 @@ msgstr "Fermer la scène" #: editor/editor_node.cpp msgid "Reopen Closed Scene" -msgstr "Rouvrir la scène fermée" +msgstr "Réouvrir la scène fermée" #: editor/editor_node.cpp msgid "Unable to enable addon plugin at: '%s' parsing of config failed." @@ -2625,7 +2618,7 @@ msgstr "Fermer l'onglet" #: editor/editor_node.cpp msgid "Undo Close Tab" -msgstr "Rouvrir l'onglet fermé" +msgstr "Annuler \"fermer l'onglet\"" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Close Other Tabs" @@ -2762,17 +2755,16 @@ msgid "Project Settings..." msgstr "Paramètres du projet..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Version :" +msgstr "Contrôle de version" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Configurer le contrôle de version" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Arrêter le contrôle de version" #: editor/editor_node.cpp msgid "Export..." @@ -3048,7 +3040,7 @@ msgstr "Inspecteur" msgid "Expand Bottom Panel" msgstr "Développez le panneau inférieur" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Sortie" @@ -3076,9 +3068,16 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Ceci configurera votre projet pour des compilations Android personnalisées " +"en installant le modèle source dans \"res://android/build\".\n" +"Vous pouvez ensuite appliquer des modifications et créer votre propre APK " +"personnalisé à l'exportation (ajout de modules, modification du fichier " +"AndroidManifest.xml, etc.).\n" +"Notez que pour faire des compilations personnalisées au lieu d'utiliser des " +"APKs pré-construits, l'option \"Use Custom Build\" doit être activée dans le " +"Preset d'exportation Android." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" @@ -3086,8 +3085,8 @@ msgid "" "operation again." msgstr "" "Le modèle de build Android est déjà installé et ne va pas être remplacé.\n" -"Supprimez le répertoire « build » manuellement avant de retenter cette " -"opération." +"Supprimez le répertoire « res://android/build » manuellement avant de " +"retenter cette opération." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3150,9 +3149,8 @@ msgid "Open the previous Editor" msgstr "Ouvrir l'éditeur précédant" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Pas de surface source spécifiée." +msgstr "Aucune sous-ressource n'a été trouvée." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3163,9 +3161,8 @@ msgid "Thumbnail..." msgstr "Aperçu…" #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Ouvrir le script :" +msgstr "Script principal :" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3301,6 +3298,10 @@ msgstr "Choisissez un Viewport" msgid "New Script" msgstr "Nouveau script" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Hériter d'un script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nouveau %s" @@ -3327,13 +3328,6 @@ msgstr "Coller" msgid "Convert To %s" msgstr "Convertir en %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Ouvrir l'éditeur" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Le nÅ“ud sélectionné n'est pas un Viewport !" @@ -3972,8 +3966,7 @@ msgstr "Impossible de charger le script de post-importation :" #: editor/import/resource_importer_scene.cpp msgid "Invalid/broken script for post-import (check console):" -msgstr "" -"Script de post-importation invalide ou corrompu (vérifiez la console) :" +msgstr "Script de post-importation invalide ou cassé (vérifier la console) :" #: editor/import/resource_importer_scene.cpp msgid "Error running post-import script:" @@ -4000,9 +3993,8 @@ msgid "Import As:" msgstr "Importer comme :" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "Pré-réglages" +msgstr "Pré-réglage" #: editor/import_dock.cpp msgid "Reimport" @@ -4129,7 +4121,7 @@ msgstr "Nom du plugin :" msgid "Subfolder:" msgstr "Sous-dossier :" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Langage :" @@ -4273,6 +4265,12 @@ msgstr "Point" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Ouvrir l'éditeur" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Ouvrir le NÅ“ud Animation" @@ -4624,7 +4622,6 @@ msgstr "Nom de l'animation :" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Erreur !" @@ -4798,12 +4795,14 @@ msgid "Current:" msgstr "Actuel :" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Ajouter une entrée" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Clear Auto-Advance" -msgstr "Réinitialiser la progression automatique" +msgstr "Effacer l'avance automatique" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Set Auto-Advance" @@ -5002,6 +5001,10 @@ msgid "All" msgstr "Tout" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Importer..." @@ -5294,28 +5297,34 @@ msgid "Pan Mode" msgstr "Mode navigation" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Mode d'exécution :" +msgstr "Mode Règle" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Activer/Désactiver le magnétisme." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Aligner sur la grille" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Options de magnétisme" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Activer/Désactiver le magnétisme." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +#, fuzzy +msgid "Use Grid Snap" msgstr "Aimanter à la grille" #: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Options de magnétisme" + +#: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" msgstr "Rotation alignée" @@ -5368,7 +5377,7 @@ msgstr "Verrouiller l'objet sélectionné (il ne pourra plus être déplacé)." #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Unlock the selected object (can be moved)." -msgstr "Déverouiller l'objet sélectionné (il pourra être déplacé de nouveau)." +msgstr "Déverrouiller l'objet sélectionné (il pourra être déplacé de nouveau)." #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5402,8 +5411,8 @@ msgid "View" msgstr "Affichage" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Afficher la grille" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5477,7 +5486,7 @@ msgstr "Auto insertion de clé" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key (Existing Tracks)" -msgstr "Insérer une clé (pistes existantes)" +msgstr "Insérer clé (pistes existantes)" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Copy Pose" @@ -5670,6 +5679,11 @@ msgstr "Basculer vers tangente linéaire de courbe" msgid "Hold Shift to edit tangents individually" msgstr "Maintenez Maj. appuyée pour modifier les tangentes individuellement" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Clic droit : Supprimer un point" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Créer sonde IG (Illumination Globale)" @@ -5854,19 +5868,19 @@ msgstr "" #: editor/plugins/multimesh_editor_plugin.cpp msgid "No surface source specified." -msgstr "Pas de surface source spécifiée." +msgstr "Aucune source de surface spécifiée." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (invalid path)." -msgstr "La surface source est invalide (chemin non valide)." +msgstr "La source de surface est invalide (chemin non valide)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (no geometry)." -msgstr "La surface source est invalide (pas de géométrie)." +msgstr "La source de surface est invalide (pas de géométrie)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (no faces)." -msgstr "La surface source est invalide (pas de faces)." +msgstr "La source de surface est invalide (pas de faces)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Source Mesh:" @@ -5878,11 +5892,11 @@ msgstr "Sélectionnez une surface cible :" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Populate Surface" -msgstr "Peupler la surface" +msgstr "Remplir la surface" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Populate MultiMesh" -msgstr "Peupler la MultiMesh" +msgstr "Remplir la MultiMesh" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Target Surface:" @@ -5970,7 +5984,7 @@ msgstr "\"%s\" ne contient pas de géométrie." #: editor/plugins/particles_editor_plugin.cpp msgid "\"%s\" doesn't contain face geometry." -msgstr "Le maillage de \"%s\" ne contient aucunes faces." +msgstr "Le maillage \"%s\" ne contient aucunes faces." #: editor/plugins/particles_editor_plugin.cpp msgid "Create Emitter" @@ -6316,6 +6330,10 @@ msgid "Grid" msgstr "Grille" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Afficher la grille" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Configurer la grille :" @@ -6372,6 +6390,7 @@ msgstr "Instance :" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Type :" @@ -6470,6 +6489,11 @@ msgid "Find Next" msgstr "Correspondance suivante" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Correspondance précédente" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Filtrer les scripts" @@ -6739,6 +6763,11 @@ msgstr "Point d'arrêts" msgid "Cut" msgstr "Couper" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Tout sélectionner" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Supprimer ligne" @@ -6796,10 +6825,6 @@ msgid "Auto Indent" msgstr "Indentation automatique" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Correspondance précédente" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Rechercher dans les fichiers…" @@ -7123,6 +7148,11 @@ msgid "Freelook Speed Modifier" msgstr "Modificateur de vitesse de la vue libre" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Modificateur de vitesse de la vue libre" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7162,6 +7192,10 @@ msgid "Use Local Space" msgstr "Utiliser l'espace local" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Aligner sur la grille" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Vue de dessous" @@ -7228,7 +7262,7 @@ msgstr "2 vues" #: editor/plugins/spatial_editor_plugin.cpp msgid "2 Viewports (Alt)" -msgstr "2 vues (alt.)" +msgstr "2 vues (Alt)" #: editor/plugins/spatial_editor_plugin.cpp msgid "3 Viewports" @@ -7236,7 +7270,7 @@ msgstr "3 vues" #: editor/plugins/spatial_editor_plugin.cpp msgid "3 Viewports (Alt)" -msgstr "3 vues (alt.)" +msgstr "3 vues (Alt)" #: editor/plugins/spatial_editor_plugin.cpp msgid "4 Viewports" @@ -7390,6 +7424,11 @@ msgid "Simplification: " msgstr "Simplification : " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Croissance (Pixels) : " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Croissance (Pixels) : " @@ -7438,9 +7477,8 @@ msgid "(empty)" msgstr "(vide)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Coller une image" +msgstr "Déplacer le cadre" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7472,11 +7510,11 @@ msgstr "Ajouter des trames depuis une feuille de Sprite" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (Before)" -msgstr "Insérer vide (avant)" +msgstr "Insérer vide (Avant)" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (After)" -msgstr "Insérer vide (après)" +msgstr "Insérer vide (Après)" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Move (Before)" @@ -7757,13 +7795,12 @@ msgid "Enable Priority" msgstr "Activer la priorité" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Filtrer Fichiers..." +msgstr "Filtrer les tuiles" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "Donnez une ressource TileSet à cette TileMap pour utiliser ses tuiles." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7902,6 +7939,8 @@ msgstr "Afficher les noms des tuiles (maintenez Alt enfoncé)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Ajoutez ou sélectionnez une texture sur le panneau de gauche pour modifier " +"les tuiles qui lui sont liées." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -8076,9 +8115,8 @@ msgid "TileSet" msgstr "TileSet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Nom parent du nÅ“ud, si disponible" +msgstr "Aucun addon VCS n'est disponible." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" @@ -8086,81 +8124,71 @@ msgstr "Erreur" #: editor/plugins/version_control_editor_plugin.cpp msgid "No commit message was provided" -msgstr "" +msgstr "Aucun message de livraison n'a été fourni" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "Aucun fichier à ajouter" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Communauté" +msgstr "Enregistrer" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "VCS Addon n'est pas initialisé" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "Système de contrôle de version" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Majuscule à chaque mot" +msgstr "initialiser" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "Zone de transit" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Créer un nouveau rectangle." +msgstr "Détecter de nouveaux changements" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Changer" +msgstr "Changements" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Modifié" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Renommer" +msgstr "Renommé" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Supprimer" +msgstr "Supprimé" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Changer" +msgstr "Changement de type" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Supprimer la selection" +msgstr "Étape sélectionnée" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Tout enregistrer" +msgstr "Tout ajouter" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Ajouter un message de livraison" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Synchroniser les modifications des scripts" +msgstr "Commiter les changements" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8170,25 +8198,24 @@ msgstr "État" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" msgstr "" +"Vérifier les différences de fichier avant de les soumettre à la dernière " +"version" #: editor/plugins/version_control_editor_plugin.cpp msgid "No file diff is active" -msgstr "" +msgstr "Aucun fichier diff n'est actif" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "Détecter les changements dans le fichier diff" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(GLES3 seulement)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Ajouter une entrée +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Ajouter une sortie +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8204,6 +8231,10 @@ msgid "Boolean" msgstr "Booléen" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Ajouter un port d'entrée" @@ -8318,7 +8349,7 @@ msgstr "Fonction Sepia." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Burn operator." -msgstr "Opérateur de gravure." +msgstr "Opérateur de surexposition." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Darken operator." @@ -8419,11 +8450,11 @@ msgstr "" "Renvoi un vecteur associé si la valeur booléen fournie est vrai ou fausse." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" -"Renvoi un vecteur associé si la valeur booléen fournie est vrai ou fausse." +"Retourne un scalaire associé si la valeur booléenne fournie est vraie ou " +"fausse." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the comparison between two parameters." @@ -8971,7 +9002,6 @@ msgstr "" "déclarations de fonction à l'intérieur." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns falloff based on the dot product of surface normal and view " "direction of camera (pass associated inputs to it)." @@ -9142,15 +9172,19 @@ msgid "Resources to export:" msgstr "Ressources à exporter :" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtres d'export de fichiers non ressources (séparés par des virgules, par " "exemple : *.json, *.txt) :" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtres pour exclure des fichiers du projet (séparés par des virgules, par " "exemple: *.json, *.txt) :" @@ -9296,7 +9330,7 @@ msgstr "Impossible de créer le fichier project.godot dans le chemin du projet." #: editor/project_manager.cpp msgid "The following files failed extraction from package:" -msgstr "L'extraction des fichiers suivants a échoué depuis le paquetage :" +msgstr "L'extraction des fichiers suivants depuis le paquetage a échoué :" #: editor/project_manager.cpp msgid "Rename Project" @@ -9752,9 +9786,8 @@ msgid "Settings saved OK." msgstr "Paramètres enregistrés avec succès." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Ajouter un événement d'action d'entrée" +msgstr "Événement d'action d'entrée déplacé" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -9774,15 +9807,15 @@ msgstr "Ajouter un chemin remappé" #: editor/project_settings_editor.cpp msgid "Resource Remap Add Remap" -msgstr "Remap de ressources ajout de remap" +msgstr "Réaffectation des ressources ; Ajouter une réaffectation" #: editor/project_settings_editor.cpp msgid "Change Resource Remap Language" -msgstr "Modifier language de remap de ressource" +msgstr "Modifier le langage de réaffectation des ressources" #: editor/project_settings_editor.cpp msgid "Remove Resource Remap" -msgstr "Supprimer remap de ressource" +msgstr "Supprimer la réaffectation des ressources" #: editor/project_settings_editor.cpp msgid "Remove Resource Remap Option" @@ -10121,9 +10154,8 @@ msgid "Instance Scene(s)" msgstr "Instancier scène(s)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Sauvegarder la branche comme scène" +msgstr "Remplacer par une scène de branche" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10168,22 +10200,20 @@ msgid "Make node as Root" msgstr "Choisir le nÅ“ud comme racine de scène" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Supprimer des nÅ“uds" +msgstr "Supprimer %d nÅ“uds ?" #: editor/scene_tree_dock.cpp msgid "Delete the root node \"%s\"?" -msgstr "" +msgstr "Supprimer le nÅ“ud racine \"%s\" ?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "Supprimer le nÅ“ud \"%s\" et ses enfants ?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Supprimer des nÅ“uds" +msgstr "Supprimer le noeud \"%s\" ?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10206,12 +10236,13 @@ msgstr "" "propriétés du nÅ“ud." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Enfants modifiables" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Charger en tant qu'instance temporaire" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Désactiver \"editable_instance\" implique la remise à zéro de toutes les " +"propriétés du nÅ“ud." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10275,7 +10306,8 @@ msgstr "Erreur d'enregistrement de la scène." #: editor/scene_tree_dock.cpp msgid "Error duplicating scene to save it." -msgstr "Erreur de duplication de la scène afin de l'enregistrer." +msgstr "" +"Une erreur est survenue pendant la duplication de la scène à sauvegarder." #: editor/scene_tree_dock.cpp msgid "Sub-Resources" @@ -10286,6 +10318,14 @@ msgid "Clear Inheritance" msgstr "Effacer l'héritage" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Enfants modifiables" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Charger en tant qu'instance temporaire" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Ouvrir la documentation" @@ -10302,10 +10342,6 @@ msgid "Change Type" msgstr "Changer le type" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Hériter d'un script" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "Re-parenter le nÅ“ud" @@ -10343,8 +10379,7 @@ msgstr "" #: editor/scene_tree_dock.cpp msgid "Attach a new or existing script for the selected node." -msgstr "" -"Attacher un nouveau script ou un script existant pour le nÅ“ud sélectionné." +msgstr "Attacher un script (nouveau ou existant) pour le nÅ“ud sélectionné." #: editor/scene_tree_dock.cpp msgid "Clear a script for the selected node." @@ -10496,7 +10531,7 @@ msgstr "Erreur - Impossible de créer le script dans le système de fichiers." #: editor/script_create_dialog.cpp msgid "Error loading script from %s" -msgstr "Erreur de chargement de script depuis %s" +msgstr "Erreur de chargement du script depuis %s" #: editor/script_create_dialog.cpp msgid "Overrides" @@ -10547,23 +10582,18 @@ msgid "Will load an existing script file." msgstr "Va charger un fichier de script existant." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Langage" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Hérité de" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Nom de classe" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Modèle" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Script intégré" #: editor/script_create_dialog.cpp @@ -10579,39 +10609,32 @@ msgid "Bytes:" msgstr "Octets :" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "Avertissements :" +msgstr "Avertissement :" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Error:" -msgstr "Erreur" +msgstr "Erreur :" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Copier l'erreur" +msgstr "Erreur C ++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Copier l'erreur" +msgstr "Erreur C ++ :" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Source" +msgstr "Source C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Source" +msgstr "Source :" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Source" +msgstr "Source C++ :" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10622,18 +10645,16 @@ msgid "Errors" msgstr "Erreurs" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Processus enfant connecté" +msgstr "Processus enfant connecté." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Copier l'erreur" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Point d'arrêts" +msgstr "Passer les points d'arrêt" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10652,9 +10673,8 @@ msgid "Profiler" msgstr "Profileur" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Profil d'exportation" +msgstr "Profileur réseau" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10879,7 +10899,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Attendu une chaîne de longueur 1 (un caractère)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -11038,13 +11058,13 @@ msgid "Pick Distance:" msgstr "Choisissez distance :" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Méthodes de filtrage" +msgstr "Filtrer les mailles" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." msgstr "" +"Donnez une ressource MeshLibrary à cette GridMap pour utiliser ses maillages." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11221,6 +11241,11 @@ msgid "Add Function" msgstr "Ajouter une fonction" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Supprimer le port d'entrée" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Ajouter une variable" @@ -11229,6 +11254,26 @@ msgid "Add Signal" msgstr "Ajouter un signal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Ajouter un port d'entrée" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Ajouter un port de sortie" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Supprimer le port d'entrée" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Supprimer le port de sortie" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Changer l'expression" @@ -11273,10 +11318,20 @@ msgid "Add Preload Node" msgstr "Ajouter un nÅ“ud préchargé" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Ajouter un nÅ“ud à partir de l'arbre" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Ajouter une propriété accesseur" @@ -11301,6 +11356,11 @@ msgid "Connect Nodes" msgstr "Connecter nÅ“ud" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Connecter nÅ“ud" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Données de connexion du nÅ“ud" @@ -11333,6 +11393,28 @@ msgid "Paste VisualScript Nodes" msgstr "Coller les nÅ“uds VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Impossible de copier le nÅ“ud de fonction." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Renommer la fonction" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Supprimer la fonction" @@ -11353,21 +11435,17 @@ msgid "Editing Signal:" msgstr "Modification du signal :" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "Rendre local" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Type de base :" +msgstr "Fabriquer l'outil :" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Membres :" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "NÅ“uds disponibles :" +#, fuzzy +msgid "function_name" +msgstr "Fonctions :" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11390,6 +11468,16 @@ msgid "Cut Nodes" msgstr "Couper les nÅ“uds" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Renommer la fonction" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Rafraîchir" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Modifier le membre" @@ -11493,6 +11581,10 @@ msgid "The package must have at least one '.' separator." msgstr "Le paquet doit comporter au moins un séparateur « . »." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Sélectionner appareil depuis la liste" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "L'exécutable ADB n'est pas configuré dans les Paramètres de l'éditeur." @@ -11520,13 +11612,12 @@ msgstr "" "paramètres de l'éditeur." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"Le projet Android n'est pas installé et ne peut donc pas être compilé. " -"Installez-le depuis le menu Éditeur." +"Le modèle de compilation Android n'est pas installé dans le projet. " +"Installez-le à partir du menu Projet." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11617,6 +11708,10 @@ msgid "Required icon is not specified in the preset." msgstr "L'icône requise n'est pas spécifiée dans le préréglage." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Exécuter dans le navigateur" @@ -12303,10 +12398,6 @@ msgstr "" "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/resources/visual_shader.cpp -msgid "Input" -msgstr "Entrée" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Source invalide pour la prévisualisation." @@ -12335,6 +12426,27 @@ msgstr "Les variations ne peuvent être affectées que dans la fonction vertex." msgid "Constants cannot be modified." msgstr "Les constantes ne peuvent être modifiées." +#~ msgid "Snap to Grid" +#~ msgstr "Aimanter à la grille" + +#~ msgid "Add input +" +#~ msgstr "Ajouter une entrée +" + +#~ msgid "Language" +#~ msgstr "Langage" + +#~ msgid "Inherits" +#~ msgstr "Hérité de" + +#~ msgid "Base Type:" +#~ msgstr "Type de base :" + +#~ msgid "Available Nodes:" +#~ msgstr "NÅ“uds disponibles :" + +#~ msgid "Input" +#~ msgstr "Entrée" + #~ msgid "Properties:" #~ msgstr "Propriétés :" @@ -12553,9 +12665,6 @@ msgstr "Les constantes ne peuvent être modifiées." #~ msgid "Go to parent folder" #~ msgstr "Aller au dossier parent" -#~ msgid "Select device from the list" -#~ msgstr "Sélectionner appareil depuis la liste" - #~ msgid "Open Scene(s)" #~ msgstr "Ouvrir une(des) scène(s)" diff --git a/editor/translations/ga.po b/editor/translations/ga.po index c749cd35f8..ea55d235b7 100644 --- a/editor/translations/ga.po +++ b/editor/translations/ga.po @@ -349,6 +349,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Cruthaigh" @@ -474,15 +475,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -617,7 +609,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -629,6 +621,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -945,7 +941,7 @@ msgid "Resource" msgstr "Acmhainn" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Cosán" @@ -1400,7 +1396,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1454,7 +1451,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1838,6 +1835,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2829,7 +2827,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3065,6 +3063,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3091,13 +3093,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3872,7 +3867,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4007,6 +4002,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4348,7 +4349,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4516,6 +4516,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Cuir ionchur leis" @@ -4720,6 +4722,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -4998,20 +5004,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5101,8 +5110,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5362,6 +5370,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5991,6 +6003,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6047,6 +6063,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6145,6 +6162,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6410,6 +6432,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6467,10 +6494,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6790,6 +6813,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6823,6 +6850,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7049,6 +7080,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7813,12 +7848,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "Cuir ionchur leis" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -7833,6 +7865,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8689,12 +8725,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9676,11 +9714,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9754,6 +9790,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9770,10 +9814,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -10000,23 +10040,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10652,6 +10684,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Scrios ionchur" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10660,6 +10697,23 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Cuir ionchur leis" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10700,10 +10754,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10728,6 +10792,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10760,6 +10828,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Cruthaigh" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10784,15 +10873,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10816,6 +10901,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10910,6 +11003,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11009,6 +11106,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11546,10 +11647,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/he.po b/editor/translations/he.po index bb7ef89008..501c0c731e 100644 --- a/editor/translations/he.po +++ b/editor/translations/he.po @@ -382,6 +382,7 @@ msgstr "×”×× ×œ×™×¦×•×¨ %d רצועות חדשות ×•×œ×”×›× ×™×¡ מפתחות #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "יצירה" @@ -518,16 +519,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "לבחור הכול" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "בחירה" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -669,8 +660,9 @@ msgid "Scale Ratio:" msgstr "יחס מתיחה:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "הגדרת ×ž×¢×‘×¨×•× ×™× ×ל:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -681,6 +673,11 @@ msgstr "" msgid "Copy" msgstr "העתקה" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "בחירה" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1009,7 +1006,7 @@ msgid "Resource" msgstr "מש×ב" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "× ×ª×™×‘" @@ -1476,7 +1473,8 @@ msgstr "הוספת ×˜×¢×™× ×” ×וטומטית" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "× ×ª×™×‘:" @@ -1531,7 +1529,7 @@ msgstr "יצירת תיקייה" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "ש×:" @@ -1950,6 +1948,7 @@ msgid "Class:" msgstr "מחלקה:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "ירושה:" @@ -2994,7 +2993,7 @@ msgstr "חוקר" msgid "Expand Bottom Panel" msgstr "להרחיב הכול" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "פלט" @@ -3236,6 +3235,11 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "הרצת סקריפט" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3262,14 +3266,6 @@ msgstr "הדבקה" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "פתיחת עורך דו־ממד" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4091,7 +4087,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4238,6 +4234,13 @@ msgstr "הזזת × ×§×•×“×”" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "פתיחת עורך דו־ממד" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4603,7 +4606,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4780,6 +4782,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4993,6 +4997,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "ייבו×" @@ -5291,24 +5299,28 @@ msgstr "מצב ×©×™× ×•×™ ×§× ×” מידה (R)" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "החלפת מצב × ×§×•×“×ª עצירה" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "הגדרות הצמדה" +msgid "Toggle grid snapping." +msgstr "החלפת מצב × ×§×•×“×ª עצירה" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "הגדרות הצמדה" + +#: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" msgstr "" @@ -5400,8 +5412,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5672,6 +5683,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6316,6 +6331,10 @@ msgid "Grid" msgstr "רשת" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "הגדרת הצמדה…" @@ -6374,6 +6393,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6482,6 +6502,11 @@ msgid "Find Next" msgstr "×יתור הב×" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "×יתור הקוד×" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "מ××¤×™×™× ×™ פריט." @@ -6765,6 +6790,11 @@ msgstr "מחיקת × ×§×•×“×•×ª" msgid "Cut" msgstr "גזירה" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "לבחור הכול" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "מחיקת שורה" @@ -6825,10 +6855,6 @@ msgid "Auto Indent" msgstr "×”×–×—×” ×וטומטית" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "×יתור הקוד×" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "×יתור…" @@ -7169,6 +7195,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7207,6 +7237,10 @@ msgid "Use Local Space" msgstr "מצב מרחב מקומי (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "מבט תחתי" @@ -7442,6 +7476,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8270,12 +8308,8 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "הוספת ×ירוע" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +msgid "Add Output" +msgstr "פלט" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8291,6 +8325,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "מועדפי×:" @@ -9174,12 +9212,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10196,11 +10236,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10280,6 +10318,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "פתיחת התיעוד המקוון של Godot" @@ -10299,11 +10345,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "הרצת סקריפט" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "יצירת %s חדש" @@ -10550,24 +10591,19 @@ msgid "Will load an existing script file." msgstr "×˜×¢×™× ×ª פריסת ×פיקי שמע." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "מחלקה:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "×ª×‘× ×™×•×ª" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "הרצת סקריפט" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11219,6 +11255,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "הסרת × ×§×•×“×” ×‘× ×ª×™×‘" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11227,6 +11268,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "מועדפי×:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "מועדפי×:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "הסרת × ×§×•×“×” ×‘× ×ª×™×‘" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "הסרת × ×§×•×“×” ×‘× ×ª×™×‘" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11267,10 +11328,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11296,6 +11367,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "×ž× ×•×ª×§" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "התחברות למפרק:" @@ -11330,6 +11406,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "יצירת %s חדש" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11354,16 +11451,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "חברי×:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "×¤×•× ×§×¦×™×•×ª:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11387,6 +11481,16 @@ msgstr "גזירת מפרקי×" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "×¤×•× ×§×¦×™×•×ª:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "×¨×¢× ×•×Ÿ" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "חברי×" @@ -11482,6 +11586,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "× × ×œ×‘×—×•×¨ התקן מהרשימה" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11583,6 +11691,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "הפעלה בדפדפן" @@ -12133,10 +12245,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12169,6 +12277,10 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Add input +" +#~ msgstr "הוספת ×ירוע" + +#, fuzzy #~ msgid "Methods:" #~ msgstr "שיטות" @@ -12298,9 +12410,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "מעבר לתיקייה שמעל" -#~ msgid "Select device from the list" -#~ msgstr "× × ×œ×‘×—×•×¨ התקן מהרשימה" - #~ msgid "Open Scene(s)" #~ msgstr "פתיחת ×¡×¦× ×•×ª" @@ -12431,9 +12540,6 @@ msgstr "" #~ msgid "Error: Missing Input Connections" #~ msgstr "שגי××”: ×—×¡×¨×™× ×—×™×‘×•×¨×™ קלט" -#~ msgid "Set Transitions to:" -#~ msgstr "הגדרת ×ž×¢×‘×¨×•× ×™× ×ל:" - #~ msgid "In" #~ msgstr "×›× ×™×¡×”" diff --git a/editor/translations/hi.po b/editor/translations/hi.po index 053555ba11..cd3acd484e 100644 --- a/editor/translations/hi.po +++ b/editor/translations/hi.po @@ -6,12 +6,14 @@ # Suryansh5545 <suryanshpathak5545@gmail.com>, 2018. # Vikram1323 <vikram1323@gmail.com>, 2018. # vkubre <v@kubre.in>, 2019. +# Abhay Patel <abhay111patel@gmail.com>, 2019. +# Lakshmi-Jayakumar <lakshmi.jayakumar.tkm@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-05-04 13:48+0000\n" -"Last-Translator: vkubre <v@kubre.in>\n" +"PO-Revision-Date: 2019-10-17 04:52+0000\n" +"Last-Translator: Lakshmi-Jayakumar <lakshmi.jayakumar.tkm@gmail.com>\n" "Language-Team: Hindi <https://hosted.weblate.org/projects/godot-engine/godot/" "hi/>\n" "Language: hi\n" @@ -19,7 +21,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.7-dev\n" +"X-Generator: Weblate 3.9\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -62,31 +64,32 @@ msgstr "'%s ' को कॉल करने पर:" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp +#, fuzzy msgid "MiB" -msgstr "" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -102,7 +105,7 @@ msgstr "पà¥à¤°à¤¤à¤¿à¤®à¤¾" #: editor/animation_bezier_editor.cpp editor/editor_profiler.cpp msgid "Time:" -msgstr "" +msgstr "समय" #: editor/animation_bezier_editor.cpp msgid "Value:" @@ -371,6 +374,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -501,16 +505,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "डà¥à¤ªà¥à¤²à¤¿à¤•ेट चयन" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -647,7 +641,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -659,6 +653,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "डà¥à¤ªà¥à¤²à¤¿à¤•ेट चयन" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1006,7 +1005,7 @@ msgid "Resource" msgstr "संसाधन" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "पथ" @@ -1181,9 +1180,8 @@ msgid "Donors" msgstr "दाताओं" #: editor/editor_about.cpp -#, fuzzy msgid "License" -msgstr "License" +msgstr "लाइसेंस" #: editor/editor_about.cpp #, fuzzy @@ -1486,7 +1484,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1540,7 +1539,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1932,6 +1931,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2937,7 +2937,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3177,6 +3177,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3203,14 +3207,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "निरà¥à¤à¤°à¤¤à¤¾ संपादक" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4010,7 +4006,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4150,6 +4146,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "निरà¥à¤à¤°à¤¤à¤¾ संपादक" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4498,7 +4501,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4673,6 +4675,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4879,6 +4883,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5167,20 +5175,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5270,8 +5281,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5535,6 +5545,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6171,6 +6185,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6227,6 +6245,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6332,6 +6351,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6606,6 +6630,11 @@ msgstr "à¤à¤• नया बनाà¤à¤‚" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6664,10 +6693,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6988,6 +7013,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7021,6 +7050,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7253,6 +7286,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8046,12 +8083,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "पसंदीदा:" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8066,6 +8100,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "पसंदीदा:" @@ -8938,12 +8976,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9935,11 +9975,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10016,6 +10054,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -10032,10 +10078,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "à¤à¤• नया बनाà¤à¤‚" @@ -10270,24 +10312,17 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "निरà¥à¤à¤°à¤¤à¤¾ संपादक" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -10932,6 +10967,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "मिटाना" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10940,6 +10980,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "पसंदीदा:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "पसंदीदा:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "मिटाना" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "मिटाना" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10980,10 +11040,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11008,6 +11078,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "डिसà¥à¤•नेकà¥à¤Ÿ" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -11040,6 +11115,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "à¤à¤• नया बनाà¤à¤‚" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11064,16 +11160,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "कारà¥à¤¯à¥‹à¤‚:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11096,6 +11189,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "कारà¥à¤¯à¥‹à¤‚:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -11190,6 +11292,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11291,6 +11397,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11833,10 +11943,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/hr.po b/editor/translations/hr.po index 841272aed4..6322a85090 100644 --- a/editor/translations/hr.po +++ b/editor/translations/hr.po @@ -352,6 +352,7 @@ msgstr "Napravi %d NOVIH staza i umetni kljuÄeve?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Stvori" @@ -478,15 +479,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -621,7 +613,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -633,6 +625,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -956,7 +952,7 @@ msgid "Resource" msgstr "Resurs" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1414,7 +1410,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1468,7 +1465,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1852,6 +1849,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2844,7 +2842,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3081,6 +3079,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3107,13 +3109,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3887,7 +3882,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4022,6 +4017,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4363,7 +4364,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4531,6 +4531,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4735,6 +4737,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5015,20 +5021,23 @@ msgid "Ruler Mode" msgstr "NaÄin Interpolacije" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5118,8 +5127,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5383,6 +5391,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6013,6 +6025,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6069,6 +6085,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6167,6 +6184,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6432,6 +6454,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6489,10 +6516,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6812,6 +6835,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6845,6 +6872,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7071,6 +7102,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7843,11 +7878,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7863,6 +7894,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8720,12 +8755,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9709,11 +9746,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9787,6 +9822,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9803,10 +9846,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -10035,24 +10074,17 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Spoji sa skriptom:" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -10688,6 +10720,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Promijeni Korak Animacije" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10696,6 +10733,25 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Dodaj Bezier ToÄku" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Pomakni Bezier ToÄke" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Pomakni Bezier ToÄke" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10736,10 +10792,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10764,6 +10830,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Odspoji" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10796,6 +10867,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Stvori" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10820,16 +10912,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "Funkcije:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -10852,6 +10941,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Funkcije:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10946,6 +11044,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11045,6 +11147,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11582,10 +11688,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/hu.po b/editor/translations/hu.po index 2935d5cb92..bc1ab1bdd1 100644 --- a/editor/translations/hu.po +++ b/editor/translations/hu.po @@ -382,6 +382,7 @@ msgstr "Létrehoz %d ÚJ nyomvonalat és beilleszti a kulcsokat?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Létrehozás" @@ -515,16 +516,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Összes Kijelölése" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Kiválasztó Mód" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -669,8 +660,9 @@ msgid "Scale Ratio:" msgstr "Méretezési arány:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "Ãtmenet beállÃtása erre:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -681,6 +673,11 @@ msgstr "" msgid "Copy" msgstr "Másolás" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Kiválasztó Mód" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1022,7 +1019,7 @@ msgid "Resource" msgstr "Forrás" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Útvonal" @@ -1497,7 +1494,8 @@ msgstr "AutoLoad Hozzáadása" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Útvonal:" @@ -1552,7 +1550,7 @@ msgstr "Mappa Létrehozása" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Név:" @@ -1972,6 +1970,7 @@ msgid "Class:" msgstr "Osztály:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Örököl:" @@ -3091,7 +3090,7 @@ msgstr "MegfigyelÅ‘" msgid "Expand Bottom Panel" msgstr "Összes kibontása" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Kimenet" @@ -3334,6 +3333,11 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Szkript Futtatása" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3360,14 +3364,6 @@ msgstr "Beillesztés" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Megnyitás SzerkesztÅ‘ben" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4201,7 +4197,7 @@ msgstr "BÅ‘vÃtmények" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4355,6 +4351,13 @@ msgstr "Pont Mozgatása" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Megnyitás SzerkesztÅ‘ben" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4724,7 +4727,6 @@ msgstr "Animáció Neve:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Hiba!" @@ -4901,6 +4903,8 @@ msgid "Current:" msgstr "Jelenlegi:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Bemenet Hozzáadása" @@ -5117,6 +5121,10 @@ msgid "All" msgstr "Mind" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importálás" @@ -5435,23 +5443,28 @@ msgstr "Kiválasztó Mód" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "Illesztés be- és kikapcsolása" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Illesztés Használata" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "Illesztési beállÃtások" +msgid "Toggle grid snapping." +msgstr "Illesztés be- és kikapcsolása" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "Rácshoz illesztés" +msgid "Use Grid Snap" +msgstr "Illesztés Használata" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "Illesztési beállÃtások" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5549,8 +5562,8 @@ msgid "View" msgstr "Nézet" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Rács MegjelenÃtése" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5826,6 +5839,11 @@ msgstr "Görbe Lineáris ÉrintÅ‘jének Kapcsolása" msgid "Hold Shift to edit tangents individually" msgstr "Tartsa lenyomva a Shift gombot az érintÅ‘k egyenkénti szerkesztéséhez" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Jobb Kattintás: Pont Törlése" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "GI Szonda Besütése" @@ -6481,6 +6499,10 @@ msgid "Grid" msgstr "Rács" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Rács MegjelenÃtése" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "Illesztés BeállÃtása" @@ -6543,6 +6565,7 @@ msgstr "Példány:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "TÃpus:" @@ -6653,6 +6676,11 @@ msgid "Find Next" msgstr "KövetkezÅ‘ Keresése" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "ElÅ‘zÅ‘ Keresése" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Objektumtulajdonságok." @@ -6938,6 +6966,11 @@ msgstr "Pontok Törlése" msgid "Cut" msgstr "Kivágás" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Összes Kijelölése" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Sor Törlése" @@ -6998,10 +7031,6 @@ msgid "Auto Indent" msgstr "Automatikus Behúzás" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "ElÅ‘zÅ‘ Keresése" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Fájlok Szűrése..." @@ -7340,6 +7369,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7374,6 +7407,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Illesztés Használata" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7611,6 +7648,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8447,12 +8488,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Bemenet Hozzáadása" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "Bemenet Hozzáadása" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8470,6 +8506,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Bemenet Hozzáadása" @@ -9364,12 +9404,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10382,11 +10424,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10466,6 +10506,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Godot online dokumentáció megnyitása" @@ -10485,11 +10533,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Szkript Futtatása" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Új %s Létrehozása" @@ -10736,24 +10779,19 @@ msgid "Will load an existing script file." msgstr "MeglévÅ‘ Busz Elrendezés betöltése." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Osztály:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Sablon EltávolÃtása" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Szkript Futtatása" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11415,6 +11453,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Pont eltávolÃtása" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11423,6 +11466,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Bemenet Hozzáadása" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Bemenet Hozzáadása" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Pont eltávolÃtása" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Pont eltávolÃtása" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11463,10 +11526,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11492,6 +11565,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Kapcsolat bontva" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Csatlakoztatás Node-hoz:" @@ -11526,6 +11604,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Körvonal KészÃtése" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11551,16 +11650,13 @@ msgid "Make Tool:" msgstr "Csontok Létrehozása" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Tagok:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "Funkciók:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11584,6 +11680,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Funkciók:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "FrissÃtés" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Tagok" @@ -11679,6 +11785,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Válasszon készüléket a listából" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11780,6 +11890,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12332,11 +12446,6 @@ msgstr "" "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/resources/visual_shader.cpp -#, fuzzy -msgid "Input" -msgstr "Bemenet Hozzáadása" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12369,6 +12478,18 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "Rácshoz illesztés" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Bemenet Hozzáadása" + +#, fuzzy +#~ msgid "Input" +#~ msgstr "Bemenet Hozzáadása" + +#, fuzzy #~ msgid "Methods:" #~ msgstr "Metódusok" @@ -12482,9 +12603,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "Ugrás a szülÅ‘mappába" -#~ msgid "Select device from the list" -#~ msgstr "Válasszon készüléket a listából" - #~ msgid "Open Scene(s)" #~ msgstr "Scene(k) megnyitás" @@ -12683,9 +12801,6 @@ msgstr "" #~ msgid "Move Anim Track Down" #~ msgstr "Animáció nyomvonal lefelé mozgatás" -#~ msgid "Set Transitions to:" -#~ msgstr "Ãtmenet beállÃtása erre:" - #~ msgid "Anim Track Rename" #~ msgstr "Animáció nyomvonal átnevezés" diff --git a/editor/translations/id.po b/editor/translations/id.po index 36aeec932e..dc8e5c10d5 100644 --- a/editor/translations/id.po +++ b/editor/translations/id.po @@ -25,7 +25,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-13 16:50+0000\n" +"PO-Revision-Date: 2019-10-04 03:15+0000\n" "Last-Translator: Sofyan Sugianto <sofyanartem@gmail.com>\n" "Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/" "godot/id/>\n" @@ -79,32 +79,31 @@ msgstr "Pada pemanggilan '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Bercampur" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -370,6 +369,7 @@ msgstr "Buat track BARU %d dan masukkan tombol-tombol?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Buat" @@ -511,17 +511,7 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Peringatan: Menyunting animasi yang diimpor" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Pilih Semua" - #: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Pilih Tidak Ada" - -#: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" "Lokasi untuk node AnimationPlayer yang mengandung animasi belum diatur." @@ -656,7 +646,8 @@ msgid "Scale Ratio:" msgstr "Rasio Skala:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Pilih track untuk disalin:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -668,6 +659,11 @@ msgstr "Pilih track untuk disalin:" msgid "Copy" msgstr "Kopy" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Pilih Tidak Ada" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Tambah Clip Trek Audio" @@ -991,7 +987,7 @@ msgid "Resource" msgstr "Resource" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Path" @@ -1005,7 +1001,7 @@ msgstr "Perbaiki yang Rusak" #: editor/dependency_editor.cpp msgid "Dependency Editor" -msgstr "Penyunting Dependensi" +msgstr "Editor Dependensi" #: editor/dependency_editor.cpp msgid "Search Replacement Resource:" @@ -1261,9 +1257,8 @@ msgid "Delete Bus Effect" msgstr "Hapus Effect Bus" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Suara Bus, Geser dan Taruh untuk atur ulang." +msgstr "Seret dan Lepas untuk menyusun ulang." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1454,7 +1449,8 @@ msgstr "Tambahkan AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Path:" @@ -1508,7 +1504,7 @@ msgstr "Buat Folder" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nama:" @@ -1583,11 +1579,11 @@ msgstr "Pada ekspor 32-bit PCK yang ditanamkan tidak boleh lebih dari 4GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" -msgstr "Penyunting 3D" +msgstr "Editor 3D" #: editor/editor_feature_profile.cpp msgid "Script Editor" -msgstr "Penyunting Skrip" +msgstr "Editor Skrip" #: editor/editor_feature_profile.cpp msgid "Asset Library" @@ -1623,7 +1619,7 @@ msgstr "Sudah ada profil dengan nama seperti ini." #: editor/editor_feature_profile.cpp msgid "(Editor Disabled, Properties Disabled)" -msgstr "(Penyunting Dinonaktifkan, Properti Dinonaktifkan)" +msgstr "(Editor Dinonaktifkan, Properti Dinonaktifkan)" #: editor/editor_feature_profile.cpp msgid "(Properties Disabled)" @@ -1631,7 +1627,7 @@ msgstr "(Properti Dinonaktifkan)" #: editor/editor_feature_profile.cpp msgid "(Editor Disabled)" -msgstr "(Penyunting Dinonaktifkan)" +msgstr "(Editor Dinonaktifkan)" #: editor/editor_feature_profile.cpp msgid "Class Options:" @@ -1639,7 +1635,7 @@ msgstr "Opsi Kelas:" #: editor/editor_feature_profile.cpp msgid "Enable Contextual Editor" -msgstr "Aktifkan Penyunting Kontekstual" +msgstr "Aktifkan Editor Kontekstual" #: editor/editor_feature_profile.cpp msgid "Enabled Properties:" @@ -1722,7 +1718,7 @@ msgstr "Ekspor Profil" #: editor/editor_feature_profile.cpp msgid "Manage Editor Feature Profiles" -msgstr "Kelola Penyunting Fitur Profil" +msgstr "Kelola Editor Fitur Profil" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select Current Folder" @@ -1855,7 +1851,7 @@ msgstr "Beralih visibilitas berkas yang tersembunyi." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "View items as a grid of thumbnails." -msgstr "Tampilkan item sebagai grid thumbnail" +msgstr "Tampilkan item sebagai grid thumbnail." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "View items as a list." @@ -1904,6 +1900,7 @@ msgid "Class:" msgstr "Kelas:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Turunan:" @@ -1912,9 +1909,8 @@ msgid "Inherited by:" msgstr "Diturunkan oleh:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Deskripsi Singkat:" +msgstr "Deskripsi Singkat" #: editor/editor_help.cpp msgid "Properties" @@ -1945,9 +1941,8 @@ msgid "Class Description" msgstr "Deskripsi Kelas" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Tutorial Daring:" +msgstr "Tutorial Daring" #: editor/editor_help.cpp msgid "" @@ -2070,16 +2065,15 @@ msgstr "Mulai" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s / s" #: editor/editor_network_profiler.cpp -#, fuzzy msgid "Down" -msgstr "Unduh" +msgstr "Turunkan" #: editor/editor_network_profiler.cpp msgid "Up" -msgstr "" +msgstr "Naikkan" #: editor/editor_network_profiler.cpp editor/editor_node.cpp msgid "Node" @@ -2087,19 +2081,19 @@ msgstr "Node" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "RPC masuk" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "RSET masuk" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "RPC Keluar" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "RSET Keluar" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2688,17 +2682,16 @@ msgid "Project Settings..." msgstr "Pengaturan Proyek…" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Versi:" +msgstr "Kontrol Versi" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Atur Kontrol Versi" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Matikan Kontrol Versi" #: editor/editor_node.cpp msgid "Export..." @@ -2822,7 +2815,7 @@ msgstr "Editor" #: editor/editor_node.cpp msgid "Editor Settings..." -msgstr "Pengaturan Penyunting…" +msgstr "Pengaturan Editor…" #: editor/editor_node.cpp msgid "Editor Layout" @@ -2834,7 +2827,7 @@ msgstr "Ambil Tangkapan Layar" #: editor/editor_node.cpp msgid "Screenshots are stored in the Editor Data/Settings Folder." -msgstr "Screenshot disimpan di folder Editor Data/Settings" +msgstr "Tangkapan Layar disimpan di folder Data/Pengaturan Editor." #: editor/editor_node.cpp msgid "Toggle Fullscreen" @@ -2846,7 +2839,7 @@ msgstr "Jungkitkan Konsol Sistem" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" -msgstr "Buka Penyunting Direktori Data/Pengaturan" +msgstr "Buka Direktori Editor Data/Pengaturan" #: editor/editor_node.cpp msgid "Open Editor Data Folder" @@ -2854,11 +2847,11 @@ msgstr "Buka Folder Data Editor" #: editor/editor_node.cpp msgid "Open Editor Settings Folder" -msgstr "Buka Penyunting Direktori Pengaturan" +msgstr "Buka Direktori Editor Pengaturan" #: editor/editor_node.cpp msgid "Manage Editor Features..." -msgstr "Kelola Penyunting Fitur…" +msgstr "Kelola Editor Fitur…" #: editor/editor_node.cpp msgid "Manage Export Templates..." @@ -2945,7 +2938,7 @@ msgstr "Simpan & Mulai Ulang" #: editor/editor_node.cpp msgid "Spins when the editor window redraws." -msgstr "Putar ketika jendela penyunting digambar ulang." +msgstr "Putar ketika jendela editor digambar ulang." #: editor/editor_node.cpp msgid "Update Continuously" @@ -2971,7 +2964,7 @@ msgstr "Inspektur" msgid "Expand Bottom Panel" msgstr "Perluas Panel Bawah" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Luaran" @@ -2997,9 +2990,16 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Ini akan mengatur proyek Anda untuk build Android khusus dengan memasang " +"templat sumber ke \"res://android/build\".\n" +"Anda kemudian dapat menerapkan modifikasi dan membangun APK khusus Anda " +"sendiri pada saat ekspor (menambahkan modul, mengubah AndroidManifest.xml, " +"dll.).\n" +"Perhatikan bahwa untuk membuat build khusus alih-alih menggunakan APK yang " +"sudah dibuat sebelumnya, opsi \"Use Custom Build\" harus diaktifkan di " +"preset ekspor Android." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" @@ -3007,8 +3007,8 @@ msgid "" "operation again." msgstr "" "Templat build Android sudah terpasang sebelumnya dan tidak akan ditimpa.\n" -"Hapus direktori \"build\" secara manual sebelum menjalankan perintah ini " -"lagi." +"Hapus direktori \"res://android/build\" secara manual sebelum menjalankan " +"perintah ini lagi." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3048,15 +3048,15 @@ msgstr "Pilih" #: editor/editor_node.cpp msgid "Open 2D Editor" -msgstr "Buka Penyunting 2D" +msgstr "Buka Editor 2D" #: editor/editor_node.cpp msgid "Open 3D Editor" -msgstr "Buka Penyunting 3D" +msgstr "Buka Editor 3D" #: editor/editor_node.cpp msgid "Open Script Editor" -msgstr "Buka Penyunting Skrip" +msgstr "Buka Editor Skrip" #: editor/editor_node.cpp editor/project_manager.cpp msgid "Open Asset Library" @@ -3064,16 +3064,15 @@ msgstr "Buka Pustaka Aset" #: editor/editor_node.cpp msgid "Open the next Editor" -msgstr "Buka Penyunting Selanjutnya" +msgstr "Buka Editor Selanjutnya" #: editor/editor_node.cpp msgid "Open the previous Editor" -msgstr "Buka Penyunting Sebelumnya" +msgstr "Buka Editor Sebelumnya" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Sumber permukaan tidak ditentukan." +msgstr "Tidak ada sub-sumber yang ditemukan." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3084,9 +3083,8 @@ msgid "Thumbnail..." msgstr "Gambar Kecil..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Buka Cepat Script..." +msgstr "Skrip Utama:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3222,6 +3220,10 @@ msgstr "Pilih Viewport" msgid "New Script" msgstr "Skrip Baru" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Extend Skrip" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "%s baru" @@ -3248,13 +3250,6 @@ msgstr "Tempel" msgid "Convert To %s" msgstr "Konversikan ke %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Buka Penyunting" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Node yang terpilih bukanlah Viewport!" @@ -3814,7 +3809,7 @@ msgstr "Grup yang kosong akan dihapus secara otomatis." #: editor/groups_editor.cpp msgid "Group Editor" -msgstr "Penyunting Grup" +msgstr "Editor Grup" #: editor/groups_editor.cpp msgid "Manage Groups" @@ -3914,7 +3909,6 @@ msgid "Import As:" msgstr "Impor sebagai:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" msgstr "Prasetel" @@ -3928,7 +3922,7 @@ msgstr "Simpan skena, impor ulang, dan mulai ulang" #: editor/import_dock.cpp msgid "Changing the type of an imported file requires editor restart." -msgstr "Mengubah jenis berkas yang diimpor butuh menyalakan ulang penyunting." +msgstr "Mengubah jenis berkas yang diimpor, editor harus dimulai ulang." #: editor/import_dock.cpp msgid "" @@ -4040,9 +4034,9 @@ msgstr "Nama Plugin:" #: editor/plugin_config_dialog.cpp msgid "Subfolder:" -msgstr "Subfolder:" +msgstr "Subdirektori:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Bahasa:" @@ -4183,6 +4177,12 @@ msgstr "Titik" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Buka Editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Buka Node Animasi" @@ -4529,7 +4529,6 @@ msgstr "Nama Animasi:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Kesalahan!" @@ -4700,6 +4699,8 @@ msgid "Current:" msgstr "Saat ini:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Tambah Masukan" @@ -4905,6 +4906,10 @@ msgid "All" msgstr "Semua" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Impor…" @@ -4968,9 +4973,8 @@ msgid "Failed creating lightmap images, make sure path is writable." msgstr "Gagal membuat gambar lightmap, pastikan path dapat ditulis." #: editor/plugins/baked_lightmap_editor_plugin.cpp -#, fuzzy msgid "Bake Lightmaps" -msgstr "Ganti Radius Lampu" +msgstr "Panggang Lightmaps" #: editor/plugins/camera_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp editor/rename_dialog.cpp @@ -5194,26 +5198,32 @@ msgid "Pan Mode" msgstr "Mode Geser Pandangan" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Mode Menjalankan:" +msgstr "Mode Penggaris" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Jungkitkan Pengancingan." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Gunakan Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opsi-opsi Snap" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Jungkitkan Pengancingan." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Kancing ke Kisi" +#, fuzzy +msgid "Use Grid Snap" +msgstr "Pengancingan Kisi" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Opsi-opsi Snap" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5302,8 +5312,8 @@ msgid "View" msgstr "Pandangan" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Tampilkan Kotak-kotak" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5570,6 +5580,11 @@ msgstr "Beralih Kurva Linear Tangen" msgid "Hold Shift to edit tangents individually" msgstr "Tahan Shift untuk menyunting tangen kurva satu-persatu" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Klik Kanan: Hapus Titik" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Panggang GI Probe" @@ -5588,7 +5603,7 @@ msgstr "Item" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item List Editor" -msgstr "Penyunting Daftar Item" +msgstr "Editor Daftar Item" #: editor/plugins/light_occluder_2d_editor_plugin.cpp msgid "Create Occluder Polygon" @@ -6105,11 +6120,11 @@ msgstr "Gambar Pembobotan Tulang" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Open Polygon 2D UV editor." -msgstr "Buka Penyunting UV Poligon 2D." +msgstr "Buka Editor UV Poligon 2D." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Polygon 2D UV Editor" -msgstr "Penyunting UV Poligon 2D" +msgstr "Editor UV Poligon 2D" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "UV" @@ -6208,6 +6223,10 @@ msgid "Grid" msgstr "Kisi" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Tampilkan Kotak-kotak" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Konfigurasikan Kisi:" @@ -6264,13 +6283,14 @@ msgstr "Instansi:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Jenis:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/scene_tree_dock.cpp editor/scene_tree_editor.cpp msgid "Open in Editor" -msgstr "Buka dalam Penyunting" +msgstr "Buka dalam Editor" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "Load Resource" @@ -6362,6 +6382,11 @@ msgid "Find Next" msgstr "Pencarian Selanjutnya" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Cari Sebelumnya" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Penyaring Skrip" @@ -6485,7 +6510,7 @@ msgstr "Biarkan Pengawakutu Terbuka" #: editor/plugins/script_editor_plugin.cpp msgid "Debug with External Editor" -msgstr "Awakutu menggunakan Penyunting Eksternal" +msgstr "Awakutu menggunakan Editor Eksternal" #: editor/plugins/script_editor_plugin.cpp msgid "Open Godot online documentation." @@ -6631,6 +6656,11 @@ msgstr "Breakpoint" msgid "Cut" msgstr "Potong" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Pilih Semua" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Hapus Baris" @@ -6688,10 +6718,6 @@ msgid "Auto Indent" msgstr "Indentasi Otomatis" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Cari Sebelumnya" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Cari Dalam Berkas..." @@ -7014,11 +7040,16 @@ msgid "Freelook Speed Modifier" msgstr "Pengubah Kecepatan TampilanBebas" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Pengubah Kecepatan TampilanBebas" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" -"Catatan: Nilai FPS yang ditampilkan adalah framerate-nya penyunting.\n" +"Catatan: Nilai FPS yang ditampilkan adalah framerate-nya editor.\n" "Tidak bisa digunakan sebagai indikasi kinerja game yang dapat dihandalkan." #: editor/plugins/spatial_editor_plugin.cpp @@ -7053,6 +7084,10 @@ msgid "Use Local Space" msgstr "Gunakan Ruang Lokal" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Gunakan Snap" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Tampilan Bawah" @@ -7279,6 +7314,11 @@ msgid "Simplification: " msgstr "Penyederhanaan: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Pertumbuhan (Piksel): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Pertumbuhan (Piksel): " @@ -7327,9 +7367,8 @@ msgid "(empty)" msgstr "(kosong)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Rekat Frame" +msgstr "Geser Frame" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7482,11 +7521,11 @@ msgstr "Buat Templat Kosong" #: editor/plugins/theme_editor_plugin.cpp msgid "Create Empty Editor Template" -msgstr "Buat Templat Penyunting Kosong" +msgstr "Buat Templat Editor Kosong" #: editor/plugins/theme_editor_plugin.cpp msgid "Create From Current Editor Theme" -msgstr "Buat dari Tema Penyunting Saat Ini" +msgstr "Buat dari Tema Editor Saat Ini" #: editor/plugins/theme_editor_plugin.cpp msgid "Toggle Button" @@ -7646,13 +7685,12 @@ msgid "Enable Priority" msgstr "Aktifkan Prioritas" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Saring berkas..." +msgstr "Saring tile" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "Berikan sumber TileSet untuk TileMap ini untuk menggunakan Tile-nya." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7966,27 +8004,24 @@ msgid "TileSet" msgstr "TileSet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Nama node induk, jika tersedia" +msgstr "Tidak ada ekstensi VCS yang tersedia." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Galat" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "Nama masih kosong" +msgstr "Tidak ada pesan komit yang diberikan" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" msgstr "" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Komunitas" +msgstr "Komit" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" @@ -7997,61 +8032,52 @@ msgid "Version Control System" msgstr "" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Kapitalisasi" +msgstr "Inisialisasi" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" msgstr "" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Buat persegi panjang baru." +msgstr "Deteksi perubahan baru" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Ubah" +msgstr "Perubahan" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" msgstr "" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Ubah Nama" +msgstr "Berganti nama" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Hapus" +msgstr "Dihapus" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Ubah" +msgstr "Jenis perubahan" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Hapus yang Dipilih" +msgstr "Stage Hanya yang Dipilih" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Simpan Semua" +msgstr "Stage Semua" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" msgstr "" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Sinkronkan Perubahan Script" +msgstr "Komit Perubahan" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8075,11 +8101,8 @@ msgid "(GLES3 only)" msgstr "(Hanya GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Tambah masukan +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Tambah keluaran +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8095,6 +8118,10 @@ msgid "Boolean" msgstr "Boolean" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Tambah port masukan" @@ -8311,7 +8338,6 @@ msgstr "" "salah." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" @@ -9032,15 +9058,19 @@ msgid "Resources to export:" msgstr "Sumber daya yang akan diexpor:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Penyaringan untuk mengekspor berkas non-sumber (dipisahkan koma, contoh: *." "json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Penyaringan untuk mengecualikan berkas dalam proyek (dipisahkan koma, " "contoh: *.json, *.txt)" @@ -9387,7 +9417,7 @@ msgid "" "The interface will update after restarting the editor or project manager." msgstr "" "Bahasa diubah.\n" -"Antarmuka akan diperbarui setelah menjalankan ulang penyunting atau manajer " +"Antarmuka akan diperbarui setelah menjalankan ulang editor atau manajer " "proyek." #: editor/project_manager.cpp @@ -9635,9 +9665,8 @@ msgid "Settings saved OK." msgstr "OK, Pengaturan telah disimpan." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Tambah Input Action Event" +msgstr "Input Action Event Dipindahkan" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -9693,7 +9722,7 @@ msgstr "Timpa untuk..." #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp msgid "The editor must be restarted for changes to take effect." -msgstr "Penyunting harus dimulai ulang untuk menerapkan perubahan." +msgstr "Editor harus dimulai ulang untuk menerapkan perubahan." #: editor/project_settings_editor.cpp msgid "Input Map" @@ -9960,7 +9989,6 @@ msgid "Keep Global Transform" msgstr "Pertahankan Transformasi Global" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent" msgstr "Pengindukan Ulang" @@ -10051,9 +10079,8 @@ msgid "Make node as Root" msgstr "Jadikan node sebagai Dasar" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Hapus Node" +msgstr "Hapus %d node?" #: editor/scene_tree_dock.cpp msgid "Delete the root node \"%s\"?" @@ -10064,9 +10091,8 @@ msgid "Delete node \"%s\" and its children?" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Hapus Node" +msgstr "Hapus node \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10087,11 +10113,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10103,28 +10127,24 @@ msgid "New Scene Root" msgstr "Skena Dasar Baru" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Create Root Node:" -msgstr "Buat Folder" +msgstr "Buat Node Root:" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "2D Scene" -msgstr "Suasana" +msgstr "Skena 2D" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "3D Scene" -msgstr "Suasana" +msgstr "Skena 3D" #: editor/scene_tree_dock.cpp msgid "User Interface" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Other Node" -msgstr "Metode Publik:" +msgstr "Node Lainnya" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" @@ -10143,9 +10163,8 @@ msgid "Remove Node(s)" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Change type of node(s)" -msgstr "Ubah nama port keluaran" +msgstr "Ubah jenis node" #: editor/scene_tree_dock.cpp msgid "" @@ -10164,39 +10183,39 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy msgid "Sub-Resources" -msgstr "Resource" +msgstr "Sub-Sumber Daya" #: editor/scene_tree_dock.cpp msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" -msgstr "Buka baru-baru ini" +msgstr "Buka Dokumentasi" #: editor/scene_tree_dock.cpp msgid "Add Child Node" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Expand/Collapse All" -msgstr "Ciutkan Semua" +msgstr "Bentangkan/Ciutkan Semua" #: editor/scene_tree_dock.cpp msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy -msgid "Extend Script" -msgstr "Buka Cepat Script..." - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" -msgstr "Buat Baru %s" +msgstr "Pengindukan Ulang ke Node Baru" #: editor/scene_tree_dock.cpp msgid "Make Scene Root" @@ -10211,18 +10230,16 @@ msgid "Save Branch as Scene" msgstr "" #: editor/scene_tree_dock.cpp editor/script_editor_debugger.cpp -#, fuzzy msgid "Copy Node Path" -msgstr "Salin Resource" +msgstr "Salin Lokasi Node" #: editor/scene_tree_dock.cpp msgid "Delete (No Confirm)" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Add/Create a New Node." -msgstr "Buat Baru %s" +msgstr "Tambah / Buat Node Baru." #: editor/scene_tree_dock.cpp msgid "" @@ -10239,9 +10256,8 @@ msgid "Clear a script for the selected node." msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Remote" -msgstr "Hapus" +msgstr "Remot" #: editor/scene_tree_dock.cpp msgid "Local" @@ -10257,19 +10273,16 @@ msgid "Toggle Visible" msgstr "Beralih File Tersembunyi" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Unlock Node" -msgstr "Metode Publik:" +msgstr "Buka Kunci Node" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Button Group" -msgstr "Tambahkan ke Grup" +msgstr "Tombol Grup" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "(Connecting From)" -msgstr "Gangguan Koneksi" +msgstr "(Menghubungkan dari)" #: editor/scene_tree_editor.cpp msgid "Node configuration warning:" @@ -10294,9 +10307,8 @@ msgid "" msgstr "" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Open Script:" -msgstr "Buka Cepat Script..." +msgstr "Buka Skrip:" #: editor/scene_tree_editor.cpp msgid "" @@ -10341,92 +10353,76 @@ msgid "Select a Node" msgstr "" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is empty." -msgstr "Papan klip kosong" +msgstr "Lokasi kosong." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Filename is empty." -msgstr "Papan klip kosong" +msgstr "Nama berkas kosong." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is not local." -msgstr "Path tidak menunjukkan Node!" +msgstr "Lokasi bukan lokal." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid base path." -msgstr "Path Tidak Sah." +msgstr "Basis lokasinya tidak valid." #: editor/script_create_dialog.cpp -#, fuzzy msgid "A directory with the same name exists." -msgstr "Sudah ada nama berkas atau folder seperti itu." +msgstr "Sudah ada nama direktori seperti itu." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid extension." -msgstr "Harus menggunakan ekstensi yang sah." +msgstr "Ekstensi tidak valid." #: editor/script_create_dialog.cpp msgid "Wrong extension chosen." msgstr "" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Error loading template '%s'" -msgstr "Error memuat font." +msgstr "Galat saat memuat templat '%s'" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Error - Could not create script in filesystem." -msgstr "Tidak dapat membuat folder." +msgstr "Galat - Tidak dapat membuat skrip di berkas sistem." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Error loading script from %s" -msgstr "Error memuat font." +msgstr "Galat saat memuat skrip dari %s" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Overrides" -msgstr "Timpa" +msgstr "Menimpa" #: editor/script_create_dialog.cpp msgid "N/A" msgstr "" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Open Script / Choose Location" -msgstr "Buka Penyunting Skrip" +msgstr "Buka Skrip / Pilih Lokasi" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Open Script" -msgstr "Buka Cepat Script..." +msgstr "Buka Skrip" #: editor/script_create_dialog.cpp -#, fuzzy msgid "File exists, it will be reused." -msgstr "File telah ada, Overwrite?" +msgstr "Berkas sudah ada, itu akan digunakan kembali." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid class name." -msgstr "Nama tidak sah." +msgstr "Nama kelas tidak valid." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid inherited parent name or path." -msgstr "Nama properti index tidak sah." +msgstr "Nama atau lokasi parent yang diwariskan tidak valid." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script is valid." -msgstr "Pohon animasi valid." +msgstr "Skrip valid." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -10437,85 +10433,67 @@ msgid "Built-in script (into scene file)." msgstr "Skrip tanam (ke dalam berkas skena)." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will create a new script file." -msgstr "Buat Subskribsi" +msgstr "Akan membuat berkas skrip baru." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will load an existing script file." -msgstr "Muat Layout Bus yang ada." - -#: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" +msgstr "Akan memuat berkas skrip yang ada." #: editor/script_create_dialog.cpp #, fuzzy -msgid "Inherits" -msgstr "Turunan:" +msgid "Class Name:" +msgstr "Nama Kelas" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Class Name" -msgstr "Kelas:" +msgid "Template:" +msgstr "Templat" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" -msgstr "Hapus Pilihan" - -#: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +msgid "Built-in Script:" +msgstr "Skrip Utama:" #: editor/script_create_dialog.cpp msgid "Attach Node Script" msgstr "Lampirkan Skrip Node" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Remote " -msgstr "Hapus" +msgstr "Remot " #: editor/script_editor_debugger.cpp msgid "Bytes:" msgstr "" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" msgstr "Peringatan:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Error:" -msgstr "Galat" +msgstr "Galat:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Muat Galat" +msgstr "Galat C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Muat Galat" +msgstr "Galat C++ :" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Sumber" +msgstr "Kode Sumber C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Sumber" +msgstr "Sumber:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Sumber" +msgstr "Sumber C++ :" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10526,19 +10504,16 @@ msgid "Errors" msgstr "" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Node Terputus" +msgstr "Proses anak terhubung." #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Copy Error" -msgstr "Muat Galat" +msgstr "Salin Galat" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Breakpoint" +msgstr "Lewati Breakpoint" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10557,9 +10532,8 @@ msgid "Profiler" msgstr "" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Ekspor Profil" +msgstr "Profiler Jaringan" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10631,9 +10605,8 @@ msgid "Export measures as CSV" msgstr "" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Beri Skala Seleksi" +msgstr "Hapus Pintasan" #: editor/settings_config_dialog.cpp msgid "Restore Shortcut" @@ -10664,14 +10637,12 @@ msgid "Change AudioStreamPlayer3D Emission Angle" msgstr "" #: editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Camera FOV" -msgstr "Ganti FOV Kamera" +msgstr "Ubah FOV Kamera" #: editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Camera Size" -msgstr "Ganti Ukuran Kamera" +msgstr "Ubah Ukuran Kamera" #: editor/spatial_editor_gizmos.cpp msgid "Change Notifier AABB" @@ -10702,38 +10673,32 @@ msgid "Change Capsule Shape Height" msgstr "" #: editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Cylinder Shape Radius" -msgstr "Ganti Radius Bentuk Bola" +msgstr "Ubah Radius Bentuk Silinder" #: editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Cylinder Shape Height" -msgstr "Ganti Radius Bentuk Bola" +msgstr "Ubah Tinggi Bentuk Silinder" #: editor/spatial_editor_gizmos.cpp msgid "Change Ray Shape Length" msgstr "" #: modules/csg/csg_gizmos.cpp -#, fuzzy msgid "Change Cylinder Radius" -msgstr "Ganti Radius Lampu" +msgstr "Ubah Radius Silinder" #: modules/csg/csg_gizmos.cpp -#, fuzzy msgid "Change Cylinder Height" -msgstr "Ubah Waktu Blend" +msgstr "Ubah Tinggi Silinder" #: modules/csg/csg_gizmos.cpp -#, fuzzy msgid "Change Torus Inner Radius" -msgstr "Ganti Radius Bentuk Bola" +msgstr "Ubah Torus Radius Dalam" #: modules/csg/csg_gizmos.cpp -#, fuzzy msgid "Change Torus Outer Radius" -msgstr "Ganti Radius Lampu" +msgstr "Ubah Torus Radius Luar" #: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "Select the dynamic library for this entry" @@ -10744,9 +10709,8 @@ msgid "Select dependencies of the library for this entry" msgstr "" #: modules/gdnative/gdnative_library_editor_plugin.cpp -#, fuzzy msgid "Remove current entry" -msgstr "Hapus Sinyal" +msgstr "Hapus entri saat ini" #: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "Double click to create a new entry" @@ -10761,32 +10725,28 @@ msgid "Platform" msgstr "" #: modules/gdnative/gdnative_library_editor_plugin.cpp -#, fuzzy msgid "Dynamic Library" -msgstr "Ekspor Pustaka" +msgstr "Pustaka Dinamis" #: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "Add an architecture entry" msgstr "" #: modules/gdnative/gdnative_library_editor_plugin.cpp -#, fuzzy msgid "GDNativeLibrary" -msgstr "Ekspor Pustaka" +msgstr "Pustaka GDNative" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Enabled GDNative Singleton" msgstr "" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Disabled GDNative Singleton" -msgstr "Nonaktifkan Perbaruan Spinner" +msgstr "Dinonaktifkan Singleton GDNative" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Library" -msgstr "Ekspor Pustaka" +msgstr "Pustaka" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Libraries: " @@ -10801,9 +10761,8 @@ msgid "Expected a string of length 1 (a character)." msgstr "" #: modules/gdscript/gdscript_functions.cpp -#, fuzzy msgid "Step argument is zero!" -msgstr "Argumen langkah adalah nol!" +msgstr "Argumen step adalah nol!" #: modules/gdscript/gdscript_functions.cpp msgid "Not a script with an instance" @@ -11018,27 +10977,27 @@ msgstr "" #: modules/recast/navigation_mesh_generator.cpp msgid "Creating contours..." -msgstr "" +msgstr "Membuat kontur..." #: modules/recast/navigation_mesh_generator.cpp msgid "Creating polymesh..." -msgstr "" +msgstr "Membuat polymesh..." #: modules/recast/navigation_mesh_generator.cpp msgid "Converting to native navigation mesh..." -msgstr "" +msgstr "Mengkonversi ke mesh navigasi native..." #: modules/recast/navigation_mesh_generator.cpp msgid "Navigation Mesh Generator Setup:" -msgstr "" +msgstr "Pengaturan Generator Navigasi Mesh:" #: modules/recast/navigation_mesh_generator.cpp msgid "Parsing Geometry..." -msgstr "" +msgstr "Mengurai Geometri..." #: modules/recast/navigation_mesh_generator.cpp msgid "Done!" -msgstr "" +msgstr "Selesai!" #: modules/visual_script/visual_script.cpp msgid "" @@ -11079,28 +11038,24 @@ msgid "Stack overflow with stack depth: " msgstr "Tumpukan melimpah dengan kedalaman tumpukan: " #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Signal Arguments" -msgstr "Edit Argumen-argumen Sinyal:" +msgstr "Ubah Argumen Sinyal" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Argument Type" -msgstr "Ubah Tipe Nilai Array" +msgstr "Ubah Jenis Argumen" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Argument name" -msgstr "Ubah Nilai Array" +msgstr "Ubah Nama Argumen" #: modules/visual_script/visual_script_editor.cpp msgid "Set Variable Default Value" -msgstr "" +msgstr "Tetapkan Nilai Baku Variabel" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Set Variable Type" -msgstr "Edit Variabel:" +msgstr "Atur Jenis variabel" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11155,6 +11110,11 @@ msgid "Add Function" msgstr "Tambahkan Fungsi" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Hapus port masukan" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Tambahkan Variabel" @@ -11163,6 +11123,26 @@ msgid "Add Signal" msgstr "Tambahkan Sinyal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Tambah port masukan" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Tambah port keluaran" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Hapus port masukan" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Hapus port keluaran" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Ubah Pernyataan" @@ -11208,10 +11188,20 @@ msgid "Add Preload Node" msgstr "Tambahkan Node" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Tambahkan Node (Node-node) dari Tree" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Tambahkan Properti Getter" @@ -11241,6 +11231,11 @@ msgstr "Sambungkan Ke Node:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Sambungkan Ke Node:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Sambungkan Ke Node:" @@ -11277,6 +11272,27 @@ msgid "Paste VisualScript Nodes" msgstr "Path ke Node:" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Namai kembali Fungsi" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Hapus Fungsi" @@ -11301,16 +11317,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Tipe Dasar:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Member-member:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Node-node yang Tersedia:" +#, fuzzy +msgid "function_name" +msgstr "Fungsi-fungsi:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11337,6 +11350,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Namai kembali Fungsi" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Segarkan" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Anggota" @@ -11435,6 +11458,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Pilih perangkat pada daftar" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11538,6 +11565,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12063,7 +12094,6 @@ msgid "No root AnimationNode for the graph is set." msgstr "Akar AnimationNode untuk grafik belum diatur." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "Path to an AnimationPlayer node containing animations is not set." msgstr "" "Lokasi untuk node AnimationPlayer yang mengandung animasi belum diatur." @@ -12185,10 +12215,6 @@ msgstr "" "tidak, jadikan sebagai RenderTarget dan tetapkan tekstur internal nya ke " "beberapa node untuk ditampilkan." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Masukan" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12200,22 +12226,18 @@ msgid "Invalid source for shader." msgstr "Ukuran font tidak sah." #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid comparison function for that type." -msgstr "Ukuran font tidak sah." +msgstr "Fungsi perbandingan tidak valid untuk jenis tersebut." #: servers/visual/shader_language.cpp -#, fuzzy msgid "Assignment to function." msgstr "Penugasan ke fungsi." #: servers/visual/shader_language.cpp -#, fuzzy msgid "Assignment to uniform." -msgstr "Penugasan untuk menyeragamkan." +msgstr "Pemberian nilai untuk uniform." #: servers/visual/shader_language.cpp -#, fuzzy msgid "Varyings can only be assigned in vertex function." msgstr "Variasi hanya bisa ditetapkan dalam fungsi vertex." @@ -12223,6 +12245,24 @@ msgstr "Variasi hanya bisa ditetapkan dalam fungsi vertex." msgid "Constants cannot be modified." msgstr "Konstanta tidak dapat dimodifikasi." +#~ msgid "Snap to Grid" +#~ msgstr "Kancing ke Kisi" + +#~ msgid "Add input +" +#~ msgstr "Tambah masukan +" + +#~ msgid "Inherits" +#~ msgstr "Mewarisi" + +#~ msgid "Base Type:" +#~ msgstr "Tipe Dasar:" + +#~ msgid "Available Nodes:" +#~ msgstr "Node-node yang Tersedia:" + +#~ msgid "Input" +#~ msgstr "Masukan" + #~ msgid "Properties:" #~ msgstr "Properti:" @@ -12414,9 +12454,6 @@ msgstr "Konstanta tidak dapat dimodifikasi." #~ msgid "Go to parent folder" #~ msgstr "Pergi ke direktori induk" -#~ msgid "Select device from the list" -#~ msgstr "Pilih perangkat pada daftar" - #~ msgid "Open Scene(s)" #~ msgstr "Buka Scene" diff --git a/editor/translations/is.po b/editor/translations/is.po index 36fbcdd3e3..77ca21f932 100644 --- a/editor/translations/is.po +++ b/editor/translations/is.po @@ -370,6 +370,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -500,16 +501,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Afrita val" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -648,7 +639,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -660,6 +651,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Afrita val" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -978,7 +974,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1434,7 +1430,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1488,7 +1485,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1875,6 +1872,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2871,7 +2869,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3108,6 +3106,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3134,13 +3136,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3916,7 +3911,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4053,6 +4048,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4398,7 +4399,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4571,6 +4571,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4775,6 +4777,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5059,20 +5065,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5162,8 +5171,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5425,6 +5433,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6059,6 +6071,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6115,6 +6131,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6213,6 +6230,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6478,6 +6500,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6536,10 +6563,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6859,6 +6882,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6892,6 +6919,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7121,6 +7152,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7905,11 +7940,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7925,6 +7956,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8789,12 +8824,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9785,11 +9822,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9864,6 +9899,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9880,10 +9923,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -10111,23 +10150,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10765,6 +10796,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Fjarlægja val" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10773,6 +10809,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Stillið breyting á:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Fjarlægja val" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Fjarlægja val" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Fjarlægja val" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10813,10 +10869,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10841,6 +10907,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "TvÃteknir lyklar" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10873,6 +10944,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Val á kvarða" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10897,15 +10989,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10929,6 +11017,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Val á kvarða" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -11023,6 +11120,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11122,6 +11223,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11659,10 +11764,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/it.po b/editor/translations/it.po index e2fc3693f8..1341981a73 100644 --- a/editor/translations/it.po +++ b/editor/translations/it.po @@ -43,7 +43,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:51+0000\n" +"PO-Revision-Date: 2019-10-04 03:15+0000\n" "Last-Translator: Micila Micillotto <micillotto@gmail.com>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot/it/>\n" @@ -97,32 +97,31 @@ msgstr "Alla chiamata di '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Mischia" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -388,6 +387,7 @@ msgstr "Creare %d NUOVE tracce e inserire la chiave?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Crea" @@ -530,20 +530,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Attenzione: stai modificando un'animazione importata" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Seleziona tutti" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Seleziona Nulla" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "" -"Il Percorso di un nodo AnimationPlayer contenente animazioni non è impostato." +msgstr "Seleziona un nodo AnimationPlayer per creare e modificare animazioni." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -675,7 +664,8 @@ msgid "Scale Ratio:" msgstr "Fattore di scalatura:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Seleziona le tracce da copiare:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -687,6 +677,11 @@ msgstr "Seleziona le tracce da copiare:" msgid "Copy" msgstr "Copia" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Seleziona Nulla" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Aggiungi traccia clip audio" @@ -1011,7 +1006,7 @@ msgid "Resource" msgstr "Risorsa" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Percorso" @@ -1281,9 +1276,8 @@ msgid "Delete Bus Effect" msgstr "Cancella effetto bus" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Bus audio, trascina e rilascia per riordinare." +msgstr "Trascina e rilascia per riordinare." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1476,7 +1470,8 @@ msgstr "Aggiungi Autoload" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Percorso:" @@ -1530,7 +1525,7 @@ msgstr "Crea cartella" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nome:" @@ -1927,6 +1922,7 @@ msgid "Class:" msgstr "Classe:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Eredita:" @@ -1935,9 +1931,8 @@ msgid "Inherited by:" msgstr "Ereditato da:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Breve descrizione:" +msgstr "Breve descrizione" #: editor/editor_help.cpp msgid "Properties" @@ -1968,9 +1963,8 @@ msgid "Class Description" msgstr "Descrizione della classe" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Guide online:" +msgstr "Tutorial Online" #: editor/editor_help.cpp msgid "" @@ -2093,7 +2087,7 @@ msgstr "Inizia" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2109,19 +2103,19 @@ msgstr "Nodo" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "RPC in arrivo" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "RSET in arrivo" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "RPC in uscita" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "RSET in uscita" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2720,17 +2714,16 @@ msgid "Project Settings..." msgstr "Impostazioni Progetto…" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Versione:" +msgstr "Controllo Versione" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Imposta Controllo Versione" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Arresta Controllo Versione" #: editor/editor_node.cpp msgid "Export..." @@ -3006,7 +2999,7 @@ msgstr "Ispettore" msgid "Expand Bottom Panel" msgstr "Espandi pannello inferiore" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Output" @@ -3034,18 +3027,26 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Questo imposterà il tuo progetto per le build custom per Android, " +"installando i source templates in \"res://android/build\".\n" +"Puoi, allora, applicare le modifiche e costruire il tuo APK custom durante " +"l'esportazione (aggiungere moduli, cambiare il AndroidManifest.xml, ed " +"altro).\n" +"Nota che, in ordine per creare le build custom invece di usare gli APK pre-" +"costruiti, l'opzione \"Use Custom Build\" sarà abilitata nel preset " +"d'esportazione per Android." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" "Remove the \"res://android/build\" directory manually before attempting this " "operation again." msgstr "" -"Android build template è già installato e non sarà sovrascritto.\n" -"Rimuovi la cartella \"build\" manualmente prima di ritentare questa " -"operazione." +"Il template della build Android è già installato in questo progetto e non " +"sarà sovrascritto.\n" +"Rimuovi la cartella \"res://android/build\" manualmente prima di ritentare " +"questa operazione." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3108,9 +3109,8 @@ msgid "Open the previous Editor" msgstr "Apri l'Editor precedente" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Nessuna sorgente di superficie specificata." +msgstr "Nessuna sottorisorsa trovata." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3121,9 +3121,8 @@ msgid "Thumbnail..." msgstr "Miniatura..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Apri script:" +msgstr "Script Principale:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3258,6 +3257,10 @@ msgstr "Scegli una Vista" msgid "New Script" msgstr "Nuovo Script" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Estendi Script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nuovo %s" @@ -3284,13 +3287,6 @@ msgstr "Incolla" msgid "Convert To %s" msgstr "Converti In %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Apri Editor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Il nodo selezionato non è una Viewport!" @@ -3953,9 +3949,8 @@ msgid "Import As:" msgstr "Importa Come:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "Presets" +msgstr "Preimpostazione" #: editor/import_dock.cpp msgid "Reimport" @@ -4081,7 +4076,7 @@ msgstr "Nome Plugin:" msgid "Subfolder:" msgstr "Sottocartella:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Lingua:" @@ -4225,6 +4220,12 @@ msgstr "Punto" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Apri Editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Apri Nodo Animazione" @@ -4575,7 +4576,6 @@ msgstr "Nome Animazione:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Errore!" @@ -4748,6 +4748,8 @@ msgid "Current:" msgstr "Corrente:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Aggiungi Input" @@ -4952,6 +4954,10 @@ msgid "All" msgstr "Tutti" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Importa…" @@ -5244,26 +5250,32 @@ msgid "Pan Mode" msgstr "Modalità di Pan" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Modalità esecuzione:" +msgstr "Modalità Righello" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Abilita snapping." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Usa lo Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opzioni di Snapping" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Abilita snapping." + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Use Grid Snap" +msgstr "Snap Griglia" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Snap alla griglia" +msgid "Snapping Options" +msgstr "Opzioni di Snapping" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5352,8 +5364,8 @@ msgid "View" msgstr "Vista" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Mostra Griglia" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5620,6 +5632,11 @@ msgstr "Abilita Tangente di Curva Lineare" msgid "Hold Shift to edit tangents individually" msgstr "Tenere Premuto Shift per modificare le tangenti singolarmente" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Click Destro: Elimina Punto" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Preprocessa GI Probe" @@ -6262,6 +6279,10 @@ msgid "Grid" msgstr "Griglia" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Mostra Griglia" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Configura Griglia:" @@ -6318,6 +6339,7 @@ msgstr "Istanza:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Tipo:" @@ -6416,6 +6438,11 @@ msgid "Find Next" msgstr "Trova Successivo" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Trova Precedente" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Filtra script" @@ -6684,6 +6711,11 @@ msgstr "Punti di rottura" msgid "Cut" msgstr "Taglia" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Seleziona tutti" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Elimina Linea" @@ -6741,10 +6773,6 @@ msgid "Auto Indent" msgstr "Auto Indenta" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Trova Precedente" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Cerca nei File..." @@ -7066,6 +7094,11 @@ msgid "Freelook Speed Modifier" msgstr "Modificatore Velocità Vista Libera" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Modificatore Velocità Vista Libera" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7105,6 +7138,10 @@ msgid "Use Local Space" msgstr "Usa lo Spazio Locale" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Usa lo Snap" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Vista dal Basso" @@ -7333,6 +7370,11 @@ msgid "Simplification: " msgstr "Semplificazione: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Aumento (Pixels): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Aumento (Pixels): " @@ -7381,9 +7423,8 @@ msgid "(empty)" msgstr "(vuoto)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Incolla Frame" +msgstr "Sposta Frame" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7700,13 +7741,13 @@ msgid "Enable Priority" msgstr "Abilita Priorità Tile" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Filtra file..." +msgstr "Filtra tiles" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." msgstr "" +"Assegna una risorsa TileSet a questo TileMap per usare i suoi riquadri." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7844,6 +7885,8 @@ msgstr "Mostra i Nomi delle Tile (Tenere Premuto Tasto Alt)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Aggiungi o seleziona una texture nel pannello sulla sinistra per modificare " +"i suoi riquadri associati." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -8020,92 +8063,80 @@ msgid "TileSet" msgstr "TileSet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Nome del genitore del Nodo, se disponibile" +msgstr "Non sono disponibili addons VCS." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Errore" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "Nessun nome fornito" +msgstr "Non è stato inserito alcun messaggio di commit" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "Nessun file aggiunto allo stage" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Comunità " +msgstr "Commit" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "L'Addon VCS non è inizializzato" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "Sistema di Controllo delle Versioni" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Aggiungi maiuscola iniziale" +msgstr "Inizializza" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "Area di Staging" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Crea un nuovo rettangolo." +msgstr "Rileva nuove modifiche" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Cambia" +msgstr "Cambiamenti" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Modificato" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Rinomina" +msgstr "Rinominato" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Elimina" +msgstr "Eliminato" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Cambia" +msgstr "Cambio di tipo" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Elimina selezionati" +msgstr "Stage selezionato" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Salva Tutto" +msgstr "Stage Tutto" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Aggiungi un messaggio di commit" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Sincronizza cambiamenti script" +msgstr "Commit Cambiamenti" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8115,26 +8146,24 @@ msgstr "Stato" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" msgstr "" +"Visualizza i file diffs prima di eseguire il commit nella versione più " +"recente" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No file diff is active" -msgstr "Nessun File selezionato!" +msgstr "Nessun file diff è attivo" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "Individua cambiamenti nei file diff" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(Solo GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Aggiungi Input +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Aggiungi ouput +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8150,6 +8179,11 @@ msgid "Boolean" msgstr "Booleano" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "Samples" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Aggiungi porta di Input" @@ -8363,11 +8397,9 @@ msgstr "" "Ritorna un vettore associato se il valore booleano fornito è vero o falso." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." -msgstr "" -"Ritorna un vettore associato se il valore booleano fornito è vero o falso." +msgstr "Ritorna uno scalare associato se il booleano provvisto è vero o falso." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the comparison between two parameters." @@ -9083,15 +9115,19 @@ msgid "Resources to export:" msgstr "Risorse da esportare:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtri per esportare file che non son risorse (separati con virgola, es.: *." "json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtri per escludere dall'esportazione (separati con virgola, es.: *.json, *." "txt)" @@ -9690,9 +9726,8 @@ msgid "Settings saved OK." msgstr "Impostazioni salvate OK." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Aggiungi Evento di Azione Input" +msgstr "Evento d'Azione di Input Spostato" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -10059,9 +10094,8 @@ msgid "Instance Scene(s)" msgstr "Istanzia Scena(e)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Salva Ramo come Scena" +msgstr "Sostituisci con la Scena Branch" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10106,23 +10140,20 @@ msgid "Make node as Root" msgstr "Rendi il nodo come Radice" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Elimina Nodi" +msgstr "Elimina %d nodi?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "Elimina Nodo(i) Grafico di Shader" +msgstr "Elimina il nodo root \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "Elimina il nodo \"%s\" e tutti i suoi figli?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Elimina Nodi" +msgstr "Elimina il nodo \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10145,12 +10176,13 @@ msgstr "" "riportate al loro valore predefinito." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Figlio Modificabile" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Carica come placeholder" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Disabilitando \"editable_instance\" tutte le proprietà del nodo saranno " +"riportate al loro valore predefinito." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10225,6 +10257,14 @@ msgid "Clear Inheritance" msgstr "Liberare ereditarietà " #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Figlio Modificabile" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Carica come placeholder" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Apri la documentazione" @@ -10241,10 +10281,6 @@ msgid "Change Type" msgstr "Cambia Tipo" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Estendi Script" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "Reparent a Nuovo Nodo" @@ -10485,23 +10521,18 @@ msgid "Will load an existing script file." msgstr "Caricherà un file di script esistente." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Linguaggio" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Eredita" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Nome Classe" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Template" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Script Built-In" #: editor/script_create_dialog.cpp @@ -10517,38 +10548,32 @@ msgid "Bytes:" msgstr "Bytes:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "Avvertimento" +msgstr "Attenzione:" #: editor/script_editor_debugger.cpp msgid "Error:" msgstr "Errore:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Errore di Copia" +msgstr "Errore C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Errore:" +msgstr "Errore C++:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Sorgente" +msgstr "Sorgente C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Sorgente" +msgstr "Sorgente:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Sorgente" +msgstr "Sorgente C++:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10559,18 +10584,16 @@ msgid "Errors" msgstr "Errori" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Processo Figlio Connesso" +msgstr "Processo Figlio Connesso." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Errore di Copia" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Punti di rottura" +msgstr "Salta Punti di rottura" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10589,9 +10612,8 @@ msgid "Profiler" msgstr "Profiler" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Esporta profilo" +msgstr "Profiler di Rete" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10815,7 +10837,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Prevista una stringa di lunghezza 1 (singolo carattere)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10971,13 +10993,12 @@ msgid "Pick Distance:" msgstr "Scegli la Distanza:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Modalità di filtraggio" +msgstr "Filtra mesh" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." -msgstr "" +msgstr "Dai una risorsa MeshLibrary a questa GridMap per usare le sue mesh." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11152,6 +11173,11 @@ msgid "Add Function" msgstr "Aggiungi Funzione" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Rimuovi porta input" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Aggiungi Variabile" @@ -11160,6 +11186,26 @@ msgid "Add Signal" msgstr "Aggiungi Segnale" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Aggiungi porta di Input" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Aggiungi porta di Output" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Rimuovi porta input" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Rimuovi porta output" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Cambia Espressione" @@ -11204,10 +11250,20 @@ msgid "Add Preload Node" msgstr "Aggiungi Nodo Preload" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Aggiungi Nodo(i) Da Albero" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Aggiungi Proprietà Getter" @@ -11232,6 +11288,11 @@ msgid "Connect Nodes" msgstr "Connetti Nodi" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Disconnetti Nodi Grafico" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Connetti Dati del Nodo" @@ -11264,6 +11325,28 @@ msgid "Paste VisualScript Nodes" msgstr "Incolla Nodi VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Non è possibile copiare il nodo della funzione." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Rinomina Funzione" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Rimuovi Funzione" @@ -11284,21 +11367,17 @@ msgid "Editing Signal:" msgstr "Modifica Segnale:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "Rendi Locale" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Tipo Base:" +msgstr "Crea Tool:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Membri:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Nodi Disponibili:" +#, fuzzy +msgid "function_name" +msgstr "Funzione:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11321,6 +11400,16 @@ msgid "Cut Nodes" msgstr "Taglia Nodi" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Rinomina Funzione" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Aggiorna" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Modifica Membro" @@ -11424,6 +11513,10 @@ msgid "The package must have at least one '.' separator." msgstr "Il pacchetto deve avere almeno un '.' separatore." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Seleziona il dispositivo dall'elenco" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "Eseguibile ADB non configurato nelle Impostazioni dell'Editor." @@ -11449,13 +11542,12 @@ msgstr "" "dell'editor non è valido." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"Android Project non è installato per la compilazione. Installalo dal menu " -"Editor." +"Il template build di Android non è installato in questo progetto. Installalo " +"dal menu Progetto." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11547,6 +11639,10 @@ msgid "Required icon is not specified in the preset." msgstr "L'icona richiesta non è specificata nel preset." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Esegui nel Browser" @@ -12225,10 +12321,6 @@ msgstr "" "Control, in modo che possa ottenere una dimensione. Altrimenti, renderlo un " "RenderTarget e assegnare alla sua texture interna qualche nodo da mostrare." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Ingresso" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fonte non valida per l'anteprima." @@ -12257,6 +12349,27 @@ msgstr "Varyings può essere assegnato soltanto nella funzione del vertice." msgid "Constants cannot be modified." msgstr "Le constanti non possono essere modificate." +#~ msgid "Snap to Grid" +#~ msgstr "Snap alla griglia" + +#~ msgid "Add input +" +#~ msgstr "Aggiungi Input +" + +#~ msgid "Language" +#~ msgstr "Linguaggio" + +#~ msgid "Inherits" +#~ msgstr "Eredita" + +#~ msgid "Base Type:" +#~ msgstr "Tipo Base:" + +#~ msgid "Available Nodes:" +#~ msgstr "Nodi Disponibili:" + +#~ msgid "Input" +#~ msgstr "Ingresso" + #~ msgid "Properties:" #~ msgstr "Proprietà :" @@ -12477,9 +12590,6 @@ msgstr "Le constanti non possono essere modificate." #~ msgid "Go to parent folder" #~ msgstr "Va' alla cartella superiore" -#~ msgid "Select device from the list" -#~ msgstr "Seleziona il dispositivo dall'elenco" - #~ msgid "Open Scene(s)" #~ msgstr "Apri Scena/e" @@ -12719,9 +12829,6 @@ msgstr "Le constanti non possono essere modificate." #~ msgid "Warning" #~ msgstr "Avvertimento" -#~ msgid "Function:" -#~ msgstr "Funzione:" - #~ msgid "Variable" #~ msgstr "Valiabile" @@ -12789,9 +12896,6 @@ msgstr "Le constanti non possono essere modificate." #~ msgid "Connect Graph Nodes" #~ msgstr "Connetti Nodi Grafico" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Disconnetti Nodi Grafico" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Rimuovi Nodo Grafico di Shader" @@ -13934,9 +14038,6 @@ msgstr "Le constanti non possono essere modificate." #~ msgid "Group" #~ msgstr "Gruppo" -#~ msgid "Samples" -#~ msgstr "Samples" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "Modalità Conversione Sample (file .wav):" diff --git a/editor/translations/ja.po b/editor/translations/ja.po index 18e99b4730..319458d634 100644 --- a/editor/translations/ja.po +++ b/editor/translations/ja.po @@ -27,12 +27,13 @@ # Sodium11 <Sodium11.for.gitserver@gmail.com>, 2019. # leela <53352@protonmail.com>, 2019. # Tarou Yamada <mizuningyou@yahoo.co.jp>, 2019. +# kazuma kondo <kazmax7@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-26 11:50+0000\n" -"Last-Translator: Tarou Yamada <mizuningyou@yahoo.co.jp>\n" +"PO-Revision-Date: 2019-10-29 12:49+0000\n" +"Last-Translator: kazuma kondo <kazmax7@gmail.com>\n" "Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/" "godot/ja/>\n" "Language: ja\n" @@ -40,7 +41,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 3.9-dev\n" +"X-Generator: Weblate 3.9.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -83,32 +84,31 @@ msgstr "'%s' ã¸ã®å‘¼ã³å‡ºã—:" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "\\ B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "\\ KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "ミックス" +msgstr "\\ MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "\\ GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "\\ TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "\\ PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "\\ EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -179,29 +179,24 @@ msgid "Anim Change Call" msgstr "アニメーション呼出ã—ã®å¤‰æ›´" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Keyframe Time" -msgstr "アニメーションã‚ãƒ¼ãƒ•ãƒ¬ãƒ¼ãƒ ã®æ™‚間を変更" +msgstr "アニメーションã‚ãƒ¼ãƒ•ãƒ¬ãƒ¼ãƒ ã®æ™‚間を複数変更" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transition" -msgstr "アニメーションã®ãƒˆãƒ©ãƒ³ã‚¸ã‚·ãƒ§ãƒ³ã‚’変更" +msgstr "アニメーションã®ãƒˆãƒ©ãƒ³ã‚¸ã‚·ãƒ§ãƒ³ã‚’複数変更" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transform" -msgstr "アニメーションã®ãƒˆãƒ©ãƒ³ã‚¹ãƒ•ォームを変更" +msgstr "アニメーションã®ãƒˆãƒ©ãƒ³ã‚¹ãƒ•ォームを複数変更" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Keyframe Value" -msgstr "アニメーションã‚ーフレームã®å€¤ã‚’変更" +msgstr "アニメーションã‚ーフレームã®å€¤ã‚’複数変更" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Call" -msgstr "アニメーション呼出ã—ã®å¤‰æ›´" +msgstr "アニメーション呼出ã—を複数変更" #: editor/animation_track_editor.cpp msgid "Change Animation Length" @@ -356,9 +351,8 @@ msgid "Change Animation Interpolation Mode" msgstr "アニメーション補間モードã®å¤‰æ›´" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "アニメーションã®ãƒ«ãƒ¼ãƒ—を変更" +msgstr "アニメーションã®ãƒ«ãƒ¼ãƒ—モードを変更" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -380,6 +374,7 @@ msgstr "%d æ–°è¦ãƒˆãƒ©ãƒƒã‚¯ã‚’作æˆã—ã€ã‚ーを挿入ã—ã¾ã™ã‹ï¼Ÿ" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "作æˆ" @@ -406,14 +401,12 @@ msgid "Anim Insert Key" msgstr "アニメーションã‚ーを挿入" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "アニメーションã®FPSを変更" +msgstr "アニメーションã®ã‚¹ãƒ†ãƒƒãƒ—を変更" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "自動èªè¾¼ã¿ã®ä¸¦ã¹æ›¿ãˆ" +msgstr "トラックã®ä¸¦ã¹æ›¿ãˆ" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -526,20 +519,11 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "è¦å‘Š:インãƒãƒ¼ãƒˆã—ãŸã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’編集ã—ã¦ã„ã¾ã™" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "ã™ã¹ã¦é¸æŠž" - #: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "é¸æŠžè§£é™¤" - -#: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" -"アニメーションをå«ã‚“ã AnimationPlayer ノードã¸ã®ãƒ‘スãŒè¨å®šã•れã¦ã„ã¾ã›ã‚“。" +"アニメーションを作ã£ã¦ç·¨é›†ã™ã‚‹ãŸã‚ã« AnimationPlayer ノードã¸ã®ãƒ‘ã‚¹ã‚’é¸æŠžã—ã¦" +"下ã•ã„。" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -672,7 +656,8 @@ msgid "Scale Ratio:" msgstr "スケール比:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "コピーã™ã‚‹ãƒˆãƒ©ãƒƒã‚¯ã‚’é¸æŠž:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -684,6 +669,11 @@ msgstr "コピーã™ã‚‹ãƒˆãƒ©ãƒƒã‚¯ã‚’é¸æŠž:" msgid "Copy" msgstr "コピー" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "é¸æŠžè§£é™¤" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "オーディオトラッククリップã®è¿½åŠ " @@ -721,12 +711,10 @@ msgid "Replaced %d occurrence(s)." msgstr "%d 箇所を置æ›ã—ã¾ã—ãŸã€‚" #: editor/code_editor.cpp editor/editor_help.cpp -#, fuzzy msgid "%d match." msgstr "ï¼…dä»¶ã®ä¸€è‡´ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚" #: editor/code_editor.cpp editor/editor_help.cpp -#, fuzzy msgid "%d matches." msgstr "ï¼…dä»¶ã®ä¸€è‡´ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚" @@ -1008,7 +996,7 @@ msgid "Resource" msgstr "リソース" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "パス" @@ -1180,7 +1168,6 @@ msgid "License" msgstr "ライセンス" #: editor/editor_about.cpp -#, fuzzy msgid "Third-party Licenses" msgstr "サードパーティーライセンス" @@ -1210,9 +1197,8 @@ msgid "Licenses" msgstr "ライセンス" #: editor/editor_asset_installer.cpp editor/project_manager.cpp -#, fuzzy msgid "Error opening package file, not in ZIP format." -msgstr "パッケージファイルを開ã‘ã¾ã›ã‚“ã§ã—ãŸã€‚zip å½¢å¼ã§ã¯ã‚りã¾ã›ã‚“。" +msgstr "パッケージファイルを開ã‘ã¾ã›ã‚“ã§ã—ãŸã€zip å½¢å¼ã§ã¯ã‚りã¾ã›ã‚“。" #: editor/editor_asset_installer.cpp msgid "Uncompressing Assets" @@ -1473,7 +1459,8 @@ msgstr "自動èªè¾¼ã¿ã‚’è¿½åŠ " #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "パス:" @@ -1527,7 +1514,7 @@ msgstr "フォルダーを作æˆ" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "åå‰:" @@ -1550,7 +1537,7 @@ msgstr "エクスãƒãƒ¼ãƒˆ テンプレートãŒäºˆæƒ³ã•れãŸãƒ‘スã«è¦‹ã¤ã #: editor/editor_export.cpp msgid "Packing" -msgstr "パックã™ã‚‹" +msgstr "パックä¸" #: editor/editor_export.cpp msgid "" @@ -1924,6 +1911,7 @@ msgid "Class:" msgstr "クラス:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "継承元:" @@ -1965,9 +1953,8 @@ msgid "Class Description" msgstr "クラスã®èª¬æ˜Ž" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "オンラインãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«:" +msgstr "オンラインãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«" #: editor/editor_help.cpp msgid "" @@ -2090,7 +2077,7 @@ msgstr "é–‹å§‹" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2106,24 +2093,23 @@ msgstr "ノード" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "RPC入力" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "入力RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "出力RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "出力RSET" #: editor/editor_node.cpp editor/project_manager.cpp -#, fuzzy msgid "New Window" -msgstr "ウィンドウ" +msgstr "æ–°è¦ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦" #: editor/editor_node.cpp msgid "Project export failed with error code %d." @@ -2450,9 +2436,8 @@ msgid "Close Scene" msgstr "シーンを閉ã˜ã‚‹" #: editor/editor_node.cpp -#, fuzzy msgid "Reopen Closed Scene" -msgstr "シーンを閉ã˜ã‚‹" +msgstr "é–‰ã˜ãŸã‚·ãƒ¼ãƒ³ã‚’å†ã³é–‹ã" #: editor/editor_node.cpp msgid "Unable to enable addon plugin at: '%s' parsing of config failed." @@ -2569,9 +2554,8 @@ msgid "Close Tab" msgstr "タブを閉ã˜ã‚‹" #: editor/editor_node.cpp -#, fuzzy msgid "Undo Close Tab" -msgstr "タブを閉ã˜ã‚‹" +msgstr "é–‰ã˜ãŸã‚¿ãƒ–を戻ã™" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Close Other Tabs" @@ -2704,32 +2688,28 @@ msgid "Project" msgstr "プãƒã‚¸ã‚§ã‚¯ãƒˆ" #: editor/editor_node.cpp -#, fuzzy msgid "Project Settings..." -msgstr "プãƒã‚¸ã‚§ã‚¯ãƒˆè¨å®š" +msgstr "プãƒã‚¸ã‚§ã‚¯ãƒˆè¨å®š..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "ãƒãƒ¼ã‚¸ãƒ§ãƒ³:" +msgstr "ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚³ãƒ³ãƒˆãƒãƒ¼ãƒ«" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç®¡ç†ã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç®¡ç†ã®çµ‚了" #: editor/editor_node.cpp -#, fuzzy msgid "Export..." -msgstr "エクスãƒãƒ¼ãƒˆ" +msgstr "エクスãƒãƒ¼ãƒˆ..." #: editor/editor_node.cpp -#, fuzzy msgid "Install Android Build Template..." -msgstr "Androidビルドテンプレートã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«" +msgstr "Androidビルドテンプレートã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«..." #: editor/editor_node.cpp msgid "Open Project Data Folder" @@ -2844,9 +2824,8 @@ msgid "Editor" msgstr "エディタ" #: editor/editor_node.cpp -#, fuzzy msgid "Editor Settings..." -msgstr "エディタè¨å®š" +msgstr "エディタè¨å®š..." #: editor/editor_node.cpp msgid "Editor Layout" @@ -2881,14 +2860,12 @@ msgid "Open Editor Settings Folder" msgstr "エディタè¨å®šã®ãƒ•ォルダを開ã" #: editor/editor_node.cpp -#, fuzzy msgid "Manage Editor Features..." -msgstr "エディタ機能ã®ç®¡ç†" +msgstr "エディタ機能ã®ç®¡ç†..." #: editor/editor_node.cpp -#, fuzzy msgid "Manage Export Templates..." -msgstr "エクスãƒãƒ¼ãƒˆãƒ†ãƒ³ãƒ—レートã®ç®¡ç†" +msgstr "エクスãƒãƒ¼ãƒˆãƒ†ãƒ³ãƒ—レートã®ç®¡ç†..." #: editor/editor_node.cpp editor/plugins/shader_editor_plugin.cpp msgid "Help" @@ -2997,7 +2974,7 @@ msgstr "インスペクタ" msgid "Expand Bottom Panel" msgstr "下パãƒãƒ«ã‚’展開" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "出力" @@ -3025,9 +3002,15 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"ã“ã®æ“作㯠\"res://android/build\" ã«ã‚½ãƒ¼ã‚¹ãƒ†ãƒ³ãƒ—レートをインストールã—アンド" +"ãƒã‚¤ãƒ‰ã®ã‚«ã‚¹ã‚¿ãƒ ビルドをè¨å®šã—ã¾ã™ã€‚\n" +"後ã‹ã‚‰è¨å®šã«å¤‰æ›´ã‚’åŠ ãˆãŸã‚Šã€ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆæ™‚ã«ã‚«ã‚¹ã‚¿ãƒ APKをビルドã§ãã¾ã™ã€‚(モ" +"ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’è¿½åŠ ã™ã‚‹ã€AndroidManifest.xmlを変更ã™ã‚‹ç‰)\n" +"APKビルドã®åˆæœŸè¨å®šã®ä»£ã‚りã«ã‚«ã‚¹ã‚¿ãƒ ビルドè¨å®šã‚’使ã†ãŸã‚ã«ã¯ã€ã‚¢ãƒ³ãƒ‰ãƒã‚¤ãƒ‰ã®" +"エクスãƒãƒ¼ãƒˆè¨å®šã®ã€Œã‚«ã‚¹ã‚¿ãƒ ビルドを使用ã™ã‚‹ã€ã®ã‚ªãƒ—ã‚·ãƒ§ãƒ³ãŒæœ‰åŠ¹åŒ–ã•れã¦ã„ã‚‹" +"å¿…è¦ãŒã‚ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。" #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" @@ -3035,7 +3018,8 @@ msgid "" "operation again." msgstr "" "Androidビルドテンプレートã¯ã™ã§ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ãŠã‚Šã€ä¸Šæ›¸ãã•れã¾ã›ã‚“。\n" -"ã“ã®æ“作をå†è©¦è¡Œã™ã‚‹å‰ã«ã€ \"build\"ディレクトリを手動ã§å‰Šé™¤ã—ã¦ãã ã•ã„。" +"ã“ã®æ“作をå†è©¦è¡Œã™ã‚‹å‰ã«ã€ \"res://android/build\" ディレクトリを手動ã§å‰Šé™¤ã—" +"ã¦ãã ã•ã„。" #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3111,9 +3095,8 @@ msgid "Thumbnail..." msgstr "サムãƒã‚¤ãƒ«..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "スクリプトを開ã:" +msgstr "メインスクリプト:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3248,6 +3231,10 @@ msgstr "ビューãƒãƒ¼ãƒˆã‚’é¸ã¶" msgid "New Script" msgstr "æ–°è¦ã‚¹ã‚¯ãƒªãƒ—ト" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "スクリプトを拡張" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "æ–°è¦ %s" @@ -3274,13 +3261,6 @@ msgstr "貼り付ã‘" msgid "Convert To %s" msgstr "%s ã«å¤‰æ›" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "エディタã§é–‹ã" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "é¸æŠžã—ãŸãƒŽãƒ¼ãƒ‰ã¯ãƒ“ューãƒãƒ¼ãƒˆã§ã¯ã‚りã¾ã›ã‚“ï¼" @@ -3359,7 +3339,6 @@ msgid "Import From Node:" msgstr "ノードã‹ã‚‰ã‚¤ãƒ³ãƒãƒ¼ãƒˆ:" #: editor/export_template_manager.cpp -#, fuzzy msgid "Redownload" msgstr "å†ãƒ€ã‚¦ãƒ³ãƒãƒ¼ãƒ‰" @@ -3378,7 +3357,7 @@ msgstr "ダウンãƒãƒ¼ãƒ‰" #: editor/export_template_manager.cpp msgid "Official export templates aren't available for development builds." -msgstr "" +msgstr "å…¬å¼ã®æ›¸ã出ã—テンプレートã¯é–‹ç™ºç”¨ãƒ“ルドã®å ´åˆã¯ä½¿ç”¨ã§ãã¾ã›ã‚“。" #: editor/export_template_manager.cpp msgid "(Missing)" @@ -3461,9 +3440,8 @@ msgid "Download Complete." msgstr "ダウンãƒãƒ¼ãƒ‰ãŒå®Œäº†ã—ã¾ã—ãŸã€‚" #: editor/export_template_manager.cpp -#, fuzzy msgid "Cannot remove temporary file:" -msgstr "ファイルã«ãƒ†ãƒ¼ãƒžã‚’ä¿å˜ã§ãã¾ã›ã‚“:" +msgstr "一時ファイルを削除ã§ãã¾ã›ã‚“:" #: editor/export_template_manager.cpp #, fuzzy @@ -3475,9 +3453,8 @@ msgstr "" "'%s' ã«ã‚りã¾ã™ã€‚" #: editor/export_template_manager.cpp -#, fuzzy msgid "Error requesting URL:" -msgstr "URL リクエストã®ã‚¨ãƒ©ãƒ¼: " +msgstr "URL リクエストã®ã‚¨ãƒ©ãƒ¼:" #: editor/export_template_manager.cpp msgid "Connecting to Mirror..." @@ -3664,9 +3641,8 @@ msgid "Move To..." msgstr "移動..." #: editor/filesystem_dock.cpp -#, fuzzy msgid "New Scene..." -msgstr "æ–°è¦ã‚·ãƒ¼ãƒ³" +msgstr "æ–°è¦ã‚·ãƒ¼ãƒ³..." #: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp msgid "New Script..." @@ -3735,9 +3711,8 @@ msgid "Overwrite" msgstr "上書ã" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Create Scene" -msgstr "シーンã‹ã‚‰ç”Ÿæˆ" +msgstr "シーンを生æˆ" #: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp msgid "Create Script" @@ -3816,23 +3791,20 @@ msgid "Invalid group name." msgstr "無効ãªã‚°ãƒ«ãƒ¼ãƒ—åã§ã™ã€‚" #: editor/groups_editor.cpp -#, fuzzy msgid "Rename Group" -msgstr "グループã®ç®¡ç†" +msgstr "グループã®åå‰å¤‰æ›´" #: editor/groups_editor.cpp -#, fuzzy msgid "Delete Group" -msgstr "レイアウトã®å‰Šé™¤" +msgstr "グループã®å‰Šé™¤" #: editor/groups_editor.cpp editor/node_dock.cpp msgid "Groups" msgstr "グループ" #: editor/groups_editor.cpp -#, fuzzy msgid "Nodes Not in Group" -msgstr "グループã«ãªã„ノード" +msgstr "グループãŒãƒŽãƒ¼ãƒ‰ã‚りã¾ã›ã‚“" #: editor/groups_editor.cpp editor/scene_tree_dock.cpp #: editor/scene_tree_editor.cpp @@ -3845,12 +3817,11 @@ msgstr "グループ内ノード" #: editor/groups_editor.cpp msgid "Empty groups will be automatically removed." -msgstr "" +msgstr "空ã®ã‚°ãƒ«ãƒ¼ãƒ—ã¯è‡ªå‹•çš„ã«å‰Šé™¤ã•れã¾ã™ã€‚" #: editor/groups_editor.cpp -#, fuzzy msgid "Group Editor" -msgstr "スクリプトエディタ" +msgstr "グループエディタ" #: editor/groups_editor.cpp msgid "Manage Groups" @@ -4059,9 +4030,8 @@ msgid "MultiNode Set" msgstr "マルãƒãƒŽãƒ¼ãƒ‰ セット" #: editor/node_dock.cpp -#, fuzzy msgid "Select a single node to edit its signals and groups." -msgstr "シグナルã¨ã‚°ãƒ«ãƒ¼ãƒ—を編集ã™ã‚‹ãƒŽãƒ¼ãƒ‰ã‚’é¸æŠžã€‚" +msgstr "ノードを1ã¤é¸æŠžã—ã¦ã‚·ã‚°ãƒŠãƒ«ã¨ã‚°ãƒ«ãƒ¼ãƒ—を編集ã—ã¾ã™ã€‚" #: editor/plugin_config_dialog.cpp msgid "Edit a Plugin" @@ -4079,7 +4049,7 @@ msgstr "プラグインå:" msgid "Subfolder:" msgstr "サブフォルダ:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "言語:" @@ -4220,6 +4190,12 @@ msgstr "点" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "エディタã§é–‹ã" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "アニメーションノードを開ã" @@ -4297,9 +4273,8 @@ msgstr "BlendTreeã«ãƒŽãƒ¼ãƒ‰ã‚’è¿½åŠ " #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "è¿½åŠ ã—ãŸã‚ーを移動" +msgstr "ノードを移動" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Unable to connect, port may be in use or connection may be invalid." @@ -4307,15 +4282,13 @@ msgstr "接続ã§ãã¾ã›ã‚“。ãƒãƒ¼ãƒˆãŒä½¿ç”¨ä¸ã‹ã€æŽ¥ç¶šãŒç„¡åйã§ã‚ #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "接続ã—ã¾ã—ãŸ" +msgstr "ノードを接続ã—ã¾ã—ãŸ" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "切æ–ã•れã¾ã—ãŸ" +msgstr "ノードãŒåˆ‡æ–ã•れã¾ã—ãŸ" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Set Animation" @@ -4568,7 +4541,6 @@ msgstr "アニメーションå:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "エラーï¼" @@ -4741,6 +4713,8 @@ msgid "Current:" msgstr "ç¾åœ¨:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "å…¥åŠ›ã‚’è¿½åŠ " @@ -4841,7 +4815,6 @@ msgid "Request failed, return code:" msgstr "リクエスト失敗。リターンコード:" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Request failed." msgstr "リクエストã¯å¤±æ•—ã—ã¾ã—ãŸã€‚" @@ -4852,7 +4825,7 @@ msgstr "ファイルã«ãƒ†ãƒ¼ãƒžã‚’ä¿å˜ã§ãã¾ã›ã‚“:" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Write error." -msgstr "" +msgstr "エラーを書ã„ã¦ãã ã•ã„。" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Request failed, too many redirects" @@ -4864,14 +4837,12 @@ msgid "Redirect loop." msgstr "リダイレクトã®ãƒ«ãƒ¼ãƒ—。" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Request failed, timeout" -msgstr "リクエスト失敗。リターンコード:" +msgstr "ãƒªã‚¯ã‚¨ã‚¹ãƒˆå¤±æ•—ã€æ™‚間切れ" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Timeout." -msgstr "時間" +msgstr "時間切れ。" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Bad download hash, assuming file has been tampered with." @@ -4951,14 +4922,16 @@ msgid "All" msgstr "ã™ã¹ã¦" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." -msgstr "å†ã‚¤ãƒ³ãƒãƒ¼ãƒˆ..." +msgstr "インãƒãƒ¼ãƒˆ..." #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Plugins..." -msgstr "プラグイン" +msgstr "プラグイン..." #: editor/plugins/asset_library_editor_plugin.cpp editor/project_manager.cpp msgid "Sort:" @@ -4974,9 +4947,8 @@ msgid "Site:" msgstr "サイト:" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Support" -msgstr "サãƒãƒ¼ãƒˆ..." +msgstr "サãƒãƒ¼ãƒˆ" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Official" @@ -4987,9 +4959,8 @@ msgid "Testing" msgstr "テストä¸" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Loading..." -msgstr "èªã¿è¾¼ã‚€.." +msgstr "èªã¿è¾¼ã¿ä¸..." #: editor/plugins/asset_library_editor_plugin.cpp msgid "Assets ZIP File" @@ -5249,21 +5220,28 @@ msgid "Ruler Mode" msgstr "実行モード:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "スナッピングを切り替ãˆã‚‹ã€‚" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "スナップを使ã†" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "スナッピングオプション" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "スナッピングを切り替ãˆã‚‹ã€‚" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "グリッドã«ã‚¹ãƒŠãƒƒãƒ—" +#, fuzzy +msgid "Use Grid Snap" +msgstr "グリッドスナップ" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "スナッピングオプション" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5352,8 +5330,8 @@ msgid "View" msgstr "ビュー" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "グリッドを表示" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5501,7 +5479,6 @@ msgstr "ãƒãƒ³ãƒ‰ãƒ«ã‚’è¨å®šã™ã‚‹" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp -#, fuzzy msgid "Load Emission Mask" msgstr "発光(Emission)マスクをèªã¿è¾¼ã‚€" @@ -5514,7 +5491,6 @@ msgstr "å†èµ·å‹•" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp -#, fuzzy msgid "Clear Emission Mask" msgstr "発光(Emission)マスクをクリア" @@ -5625,6 +5601,11 @@ msgstr "直線曲線を切り替ãˆã‚‹" msgid "Hold Shift to edit tangents individually" msgstr "接線を個別ã«ç·¨é›†ã™ã‚‹ã«ã¯ã‚·ãƒ•トを押ã™" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "å³ã‚¯ãƒªãƒƒã‚¯: 点を削除" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "ã‚°ãƒãƒ¼ãƒãƒ«ã‚¤ãƒ«ãƒŸãƒãƒ¼ã‚·ãƒ§ãƒ³ã®äº‹å‰è¨ˆç®—" @@ -5655,7 +5636,7 @@ msgstr "メッシュãŒã‚りã¾ã›ã‚“!" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" -msgstr "スタティック(ä¸å¤‰ï¼‰ä¸‰è§’形メッシュ ボディを作æˆ" +msgstr "é™çš„三角形メッシュ ボディを作æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Convex Body" @@ -5666,9 +5647,8 @@ msgid "This doesn't work on scene root!" msgstr "シーンã®ãƒ«ãƒ¼ãƒˆã§ã¯ç„¡åйã§ã™!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Trimesh Static Shape" -msgstr "三角形メッシュ ã®ã‚·ã‚§ã‚¤ãƒ—を生æˆ" +msgstr "é™çš„三角形メッシュ シェイプを生æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Failed creating shapes!" @@ -5788,11 +5768,10 @@ msgstr "" "ん)。" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "No mesh source specified (and MultiMesh contains no Mesh)." msgstr "" -"メッシュã®ã‚½ãƒ¼ã‚¹ãŒæŒ‡å®šã•れã¦ã„ã¾ã›ã‚“(ãã—ã¦MultiMesh set内ã«ã¯ã¯ãƒ¡ãƒƒã‚·ãƒ¥ãŒå˜" -"在ã—ã¾ã›ã‚“)." +"メッシュã®ã‚½ãƒ¼ã‚¹ãŒæŒ‡å®šã•れã¦ã„ã¾ã›ã‚“(ãã—ã¦MultiMeshã«ã¯ãƒ¡ãƒƒã‚·ãƒ¥ãŒå«ã¾ã‚Œã¦ã„" +"ã¾ã›ã‚“)。" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (invalid path)." @@ -5831,9 +5810,8 @@ msgid "Select a Target Surface:" msgstr "ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã‚µãƒ¼ãƒ•ã‚§ã‚¹ã‚’é¸æŠž:" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Populate Surface" -msgstr "サーフェスã«åˆæœŸå€¤ã‚’è¨å®š" +msgstr "サーフェスを満ãŸã™" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Populate MultiMesh" @@ -5860,9 +5838,8 @@ msgid "Z-Axis" msgstr "Z軸" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Mesh Up Axis:" -msgstr "メッシュã®ã‚¢ãƒƒãƒ—軸:" +msgstr "メッシュã®ä¸Šè»¸:" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Random Rotation:" @@ -5877,9 +5854,8 @@ msgid "Random Scale:" msgstr "ランダムãªç¸®å°º:" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Populate" -msgstr "åˆæœŸå€¤ã‚’è¨å®š" +msgstr "ãƒ‡ãƒ¼ã‚¿ã®æŠ•å…¥" #: editor/plugins/navigation_polygon_editor_plugin.cpp #: editor/plugins/tile_set_editor_plugin.cpp @@ -5892,12 +5868,10 @@ msgid "Convert to CPUParticles" msgstr "CPUパーティクルã«å¤‰æ›" #: editor/plugins/particles_2d_editor_plugin.cpp -#, fuzzy msgid "Generating Visibility Rect" -msgstr "å¯è¦–性ã®çŸ©å½¢ã‚’生æˆ" +msgstr "矩形ã®å¯è¦–性を生æˆä¸" #: editor/plugins/particles_2d_editor_plugin.cpp -#, fuzzy msgid "Generate Visibility Rect" msgstr "å¯è¦–性ã®çŸ©å½¢ã‚’生æˆ" @@ -5912,7 +5886,7 @@ msgstr "ç”Ÿæˆæ™‚é–“ (ç§’):" #: editor/plugins/particles_editor_plugin.cpp msgid "The geometry's faces don't contain any area." -msgstr "" +msgstr "ジオメトリã®é¢ã¯é¢ç©ã‚’æŒã¡ã¾ã›ã‚“。" #: editor/plugins/particles_editor_plugin.cpp #, fuzzy @@ -5921,22 +5895,19 @@ msgstr "ノードã¯ã‚¸ã‚ªãƒ¡ãƒˆãƒªãƒ¼ (é¢) ã‚’å«ã‚“ã§ã„ã¾ã›ã‚“。" #: editor/plugins/particles_editor_plugin.cpp msgid "\"%s\" doesn't inherit from Spatial." -msgstr "" +msgstr "\"%s\" ã¯Spatialを継承ã—ã¦ã„ã¾ã›ã‚“。" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "\"%s\" doesn't contain geometry." -msgstr "ノードã¯ã‚¸ã‚ªãƒ¡ãƒˆãƒªãƒ¼ã‚’å«ã‚“ã§ã„ã¾ã›ã‚“。" +msgstr "\"%s\" ã¯ã‚¸ã‚ªãƒ¡ãƒˆãƒªãƒ¼ã‚’å«ã‚“ã§ã„ã¾ã›ã‚“。" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "\"%s\" doesn't contain face geometry." -msgstr "ノードã¯ã‚¸ã‚ªãƒ¡ãƒˆãƒªãƒ¼ã‚’å«ã‚“ã§ã„ã¾ã›ã‚“。" +msgstr "\"%s\" ã¯ãƒ•ェイスジオメトリーをå«ã‚“ã§ã„ã¾ã›ã‚“。" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Create Emitter" -msgstr "発光物を生æˆ" +msgstr "放出器を作æˆ" #: editor/plugins/particles_editor_plugin.cpp msgid "Emission Points:" @@ -5955,9 +5926,8 @@ msgid "Volume" msgstr "ボリューム" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Emission Source: " -msgstr "発光æº: " +msgstr "放出æº: " #: editor/plugins/particles_editor_plugin.cpp msgid "A processor material of type 'ParticlesMaterial' is required." @@ -5968,9 +5938,8 @@ msgid "Generating AABB" msgstr "AABBを生æˆä¸" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Generate Visibility AABB" -msgstr "å¯è¦–性ã®è»¸å¹³è¡Œå¢ƒç•Œãƒœãƒƒã‚¯ã‚¹ã‚’生æˆ" +msgstr "軸平行境界ボックスã®å¯è¦–性を生æˆã™ã‚‹" #: editor/plugins/particles_editor_plugin.cpp msgid "Generate AABB" @@ -6278,6 +6247,10 @@ msgid "Grid" msgstr "グリッド" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "グリッドを表示" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "グリッドã®è¨å®š:" @@ -6334,6 +6307,7 @@ msgstr "インスタンス:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "åž‹:" @@ -6371,9 +6345,8 @@ msgid "Error writing TextFile:" msgstr "テã‚ã‚¹ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã®æ›¸ãè¾¼ã¿ã‚¨ãƒ©ãƒ¼:" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Could not load file at:" -msgstr "タイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸ:" +msgstr "ファイルãŒèªã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸ:" #: editor/plugins/script_editor_plugin.cpp msgid "Error saving file!" @@ -6396,7 +6369,6 @@ msgid "Error Importing" msgstr "インãƒãƒ¼ãƒˆä¸ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "New Text File..." msgstr "æ–°è¦ãƒ†ã‚ストファイル..." @@ -6434,6 +6406,11 @@ msgid "Find Next" msgstr "次を検索" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "å‰ã‚’検索" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "フィルタスクリプト" @@ -6478,9 +6455,8 @@ msgid "Open..." msgstr "é–‹ã..." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Reopen Closed Script" -msgstr "スクリプトを開ã" +msgstr "é–‰ã˜ãŸã‚¹ã‚¯ãƒªãƒ—トをå†ã³é–‹ã" #: editor/plugins/script_editor_plugin.cpp msgid "Save All" @@ -6562,7 +6538,7 @@ msgstr "外部エディタã§ãƒ‡ãƒãƒƒã‚°" #: editor/plugins/script_editor_plugin.cpp msgid "Open Godot online documentation." -msgstr "Godotã®ã‚ªãƒ³ãƒ©ã‚¤ãƒ³ãƒ‰ã‚ュメントを開ã" +msgstr "Godotã®ã‚ªãƒ³ãƒ©ã‚¤ãƒ³ãƒ‰ã‚ュメントを開ã。" #: editor/plugins/script_editor_plugin.cpp msgid "Request Docs" @@ -6690,7 +6666,7 @@ msgstr "シンタックスãƒã‚¤ãƒ©ã‚¤ãƒˆ" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp msgid "Go To" -msgstr "" +msgstr "å‚ç…§" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6706,6 +6682,11 @@ msgstr "ブレークãƒã‚¤ãƒ³ãƒˆ" msgid "Cut" msgstr "切りå–り" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "ã™ã¹ã¦é¸æŠž" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "行を削除" @@ -6764,10 +6745,6 @@ msgid "Auto Indent" msgstr "自動インデント" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "å‰ã‚’検索" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "複数ファイル内を検索..." @@ -6901,9 +6878,8 @@ msgid "Scaling: " msgstr "縮尺: " #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Translating: " -msgstr "翻訳:" +msgstr "ä½ç½®ã®å¤‰æ›´: " #: editor/plugins/spatial_editor_plugin.cpp msgid "Rotating %s degrees." @@ -7003,11 +6979,11 @@ msgstr "回転をビューã«åˆã‚ã›ã‚‹" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." -msgstr "åインスタンスを生æˆã™ã‚‹ãŸã‚ã®è¦ªãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“" +msgstr "åインスタンスを生æˆã™ã‚‹ãŸã‚ã®è¦ªãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "This operation requires a single selected node." -msgstr "å˜ä¸€ã®é¸æŠžã•れãŸãƒŽãƒ¼ãƒ‰ãŒãªã„ã¨ã€ã“ã®æ“作ã¯è¡Œãˆã¾ã›ã‚“" +msgstr "å˜ä¸€ã®é¸æŠžã•れãŸãƒŽãƒ¼ãƒ‰ãŒãªã„ã¨ã€ã“ã®æ“作ã¯è¡Œãˆã¾ã›ã‚“。" #: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" @@ -7071,9 +7047,8 @@ msgid "Freelook Right" msgstr "フリールックå³" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Freelook Forward" -msgstr "ãƒ•ãƒªãƒ¼ãƒ«ãƒƒã‚¯å‰æ–¹" +msgstr "剿–¹ã‚’フリールックã§è¦‹ã‚‹" #: editor/plugins/spatial_editor_plugin.cpp msgid "Freelook Backwards" @@ -7092,6 +7067,11 @@ msgid "Freelook Speed Modifier" msgstr "フリールックã®é€Ÿåº¦ã‚’調整" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "フリールックã®é€Ÿåº¦ã‚’調整" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7109,13 +7089,12 @@ msgid "XForm Dialog" msgstr "Xformダイアãƒã‚°" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "Snapモード:" +msgstr "ノードを底é¢ã«ã‚¹ãƒŠãƒƒãƒ—ã•ã›ã‚‹" #: editor/plugins/spatial_editor_plugin.cpp msgid "Couldn't find a solid floor to snap the selection to." -msgstr "" +msgstr "é¸æŠžã‚’ã‚¹ãƒŠãƒƒãƒ—ã™ã‚‹å‰›ä½“ã®åºŠã‚’見ã¤ã‘れã¾ã›ã‚“。" #: editor/plugins/spatial_editor_plugin.cpp msgid "" @@ -7133,6 +7112,10 @@ msgid "Use Local Space" msgstr "ãƒãƒ¼ã‚«ãƒ«ç©ºé–“モード (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "スナップを使ã†" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "下é¢å›³" @@ -7182,7 +7165,6 @@ msgid "Transform" msgstr "変形" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Object to Floor" msgstr "オブジェクトを底é¢ã«ã‚¹ãƒŠãƒƒãƒ—" @@ -7228,9 +7210,8 @@ msgstr "ビューã®ã‚°ãƒªãƒƒãƒ‰" #: editor/plugins/spatial_editor_plugin.cpp #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Settings..." -msgstr "è¨å®š" +msgstr "è¨å®š..." #: editor/plugins/spatial_editor_plugin.cpp msgid "Snap Settings" @@ -7269,9 +7250,8 @@ msgid "Transform Change" msgstr "変æ›ã®å¤‰æ›´" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Translate:" -msgstr "移動(translate):" +msgstr "移動:" #: editor/plugins/spatial_editor_plugin.cpp msgid "Rotate (deg.):" @@ -7295,7 +7275,7 @@ msgstr "後" #: editor/plugins/spatial_editor_plugin.cpp msgid "Nameless gizmo" -msgstr "" +msgstr "ç„¡åã®ã‚®ã‚ºãƒ¢" #: editor/plugins/sprite_editor_plugin.cpp msgid "Create Mesh2D" @@ -7359,7 +7339,12 @@ msgstr "スプライト" #: editor/plugins/sprite_editor_plugin.cpp msgid "Simplification: " -msgstr "簡略化:" +msgstr "簡略化: " + +#: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "拡大(ピクセル): " #: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " @@ -7410,9 +7395,8 @@ msgid "(empty)" msgstr "(空)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "フレームを貼り付ã‘" +msgstr "フレームã®ç§»å‹•" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7467,9 +7451,8 @@ msgid "Horizontal:" msgstr "æ°´å¹³:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Vertical:" -msgstr "é ‚ç‚¹" +msgstr "垂直:" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Select/Clear All Frames" @@ -7502,12 +7485,11 @@ msgstr "None" #: editor/plugins/texture_region_editor_plugin.cpp msgid "Pixel Snap" -msgstr "ピクセルSnap" +msgstr "ピクセルスナップ" #: editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Grid Snap" -msgstr "グリッドSnap" +msgstr "グリッドスナップ" #: editor/plugins/texture_region_editor_plugin.cpp msgid "Auto Slice" @@ -7523,7 +7505,7 @@ msgstr "ステップ:" #: editor/plugins/texture_region_editor_plugin.cpp msgid "Sep.:" -msgstr "" +msgstr "分類:" #: editor/plugins/texture_region_editor_plugin.cpp msgid "TextureRegion" @@ -7609,29 +7591,27 @@ msgstr "ãƒã‚§ãƒƒã‚¯æ¸ˆã¿ã‚¢ã‚¤ãƒ†ãƒ " #: editor/plugins/theme_editor_plugin.cpp msgid "Named Sep." -msgstr "" +msgstr "åå‰ä»˜ã分類。" #: editor/plugins/theme_editor_plugin.cpp msgid "Submenu" msgstr "サブメニュー" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Subitem 1" -msgstr "アイテム1" +msgstr "サブアイテム1" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Subitem 2" -msgstr "アイテム2" +msgstr "サブアイテム2" #: editor/plugins/theme_editor_plugin.cpp msgid "Has" -msgstr "" +msgstr "å«ã‚“ã§ã„ã‚‹" #: editor/plugins/theme_editor_plugin.cpp msgid "Many" -msgstr "" +msgstr "多ãã®" #: editor/plugins/theme_editor_plugin.cpp msgid "Disabled LineEdit" @@ -7724,9 +7704,8 @@ msgid "Find Tile" msgstr "タイルを検索ã™ã‚‹" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Transpose" -msgstr "転置" +msgstr "行列(縦横)入れ替ãˆ" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" @@ -7737,26 +7716,26 @@ msgid "Enable Priority" msgstr "å„ªå…ˆé †ä½ã‚’有効化" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "ファイルを絞り込む..." +msgstr "タイルを絞り込む" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." msgstr "" +"タイルãƒãƒƒãƒ—を使ã†ã«ã¯ã“ã®ã‚¿ã‚¤ãƒ«ãƒžãƒƒãƒ—ã«ã‚¿ã‚¤ãƒ«ã‚»ãƒƒãƒˆãƒªã‚½ãƒ¼ã‚¹ã‚’è¨å®šã—ã¦ãã ã•" +"ã„。" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" msgstr "タイルを塗る" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "" "Shift+LMB: Line Draw\n" "Shift+Ctrl+LMB: Rectangle Paint" msgstr "" -"Shift+å³ãƒžã‚¦ã‚¹ãƒœã‚¿ãƒ³:ç·šã®æç”»\n" -"Shift+Ctrl+å³ãƒžã‚¦ã‚¹ãƒœã‚¿ãƒ³:矩形ペイント" +"Shift+左マウスボタン:ç·šã®æç”»\n" +"Shift+Ctrl+左マウスボタン:矩形ペイント" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Pick Tile" @@ -7784,11 +7763,11 @@ msgstr "変æ›ã‚’クリア" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Add Texture(s) to TileSet." -msgstr "テクスãƒãƒ£ã‚’タイルセットã«è¿½åŠ ã™ã‚‹" +msgstr "テクスãƒãƒ£ã‚’タイルセットã«è¿½åŠ ã™ã‚‹ã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected Texture from TileSet." -msgstr "é¸æŠžã—ãŸãƒ†ã‚¯ã‚¹ãƒãƒ£ã‚’タイルセットã‹ã‚‰å‰Šé™¤ã™ã‚‹" +msgstr "é¸æŠžã—ãŸãƒ†ã‚¯ã‚¹ãƒãƒ£ã‚’タイルセットã‹ã‚‰å‰Šé™¤ã™ã‚‹ã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create from Scene" @@ -7819,9 +7798,8 @@ msgid "Region Mode" msgstr "é ˜åŸŸãƒ¢ãƒ¼ãƒ‰" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Collision Mode" -msgstr "補間モード" +msgstr "コリジョンモード" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Occlusion Mode" @@ -7857,12 +7835,11 @@ msgstr "ビットマスクを貼り付ã‘。" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Erase bitmask." -msgstr "ビットマスクを消去" +msgstr "ビットマスクを消去。" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "æ–°è¦ãƒŽãƒ¼ãƒ‰ã‚’作æˆã€‚" +msgstr "æ–°è¦çŸ©å½¢ã‚’作æˆã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7884,6 +7861,8 @@ msgstr "タイルåを表示 (Altã‚ーを長押ã—)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"è¨å®šã•れãŸã‚¿ã‚¤ãƒ«ã‚’編集ã™ã‚‹ã«ã¯ã€å·¦ã®ãƒ‘ãƒãƒ«ã‹ã‚‰ãƒ†ã‚¯ã‚¹ãƒãƒ£ã‚’è¿½åŠ ã™ã‚‹ã‹ã€é¸æŠžã—" +"ã¦ãã ã•ã„。" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -8076,53 +8055,47 @@ msgstr "åå‰ãŒä»˜ã„ã¦ã„ã¾ã›ã‚“" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "ステージã«è¿½åŠ ã•れã¦ã„るファイルãŒã‚りã¾ã›ã‚“" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "コミュニティ" +msgstr "委託" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "VCSアドオンã¯åˆæœŸåŒ–ã•れã¦ã„ã¾ã›ã‚“" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç®¡ç†ã‚·ã‚¹ãƒ†ãƒ " #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "å˜èªžã®å…ˆé æ–‡å—を大文å—ã«" +msgstr "åˆæœŸåŒ–" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "ステージングエリア" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "æ–°è¦ãƒŽãƒ¼ãƒ‰ã‚’作æˆã€‚" +msgstr "æ–°ã—ã„変更点を検出" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "変更" +msgstr "変更点" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "変更ã•れãŸç®‡æ‰€" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "åå‰ã®å¤‰æ›´" +msgstr "åå‰ã®å¤‰æ›´ã•れãŸ" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "削除" +msgstr "削除ã•れãŸ" #: editor/plugins/version_control_editor_plugin.cpp #, fuzzy @@ -8130,18 +8103,16 @@ msgid "Typechange" msgstr "変更" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "é¸æŠžæ¸ˆã¿ã‚’削除" +msgstr "é¸æŠžã•れãŸã‚‚ã®ã‚’公開ã™ã‚‹" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "ã™ã¹ã¦ä¿å˜" +msgstr "ã™ã¹ã¦ã‚’公開ã™ã‚‹" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "ã‚³ãƒŸãƒƒãƒˆãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’è¿½åŠ ã™ã‚‹" #: editor/plugins/version_control_editor_plugin.cpp #, fuzzy @@ -8155,7 +8126,7 @@ msgstr "ステータス" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" -msgstr "" +msgstr "最新ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«ã‚³ãƒŸãƒƒãƒˆã™ã‚‹å‰ã«ãƒ•ァイルã®å·®åˆ†ã‚’見る" #: editor/plugins/version_control_editor_plugin.cpp #, fuzzy @@ -8164,18 +8135,15 @@ msgstr "ファイルãŒé¸æŠžã•れã¦ã„ã¾ã›ã‚“!" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "ファイルã®å·®åˆ†ã«å¤‰æ›´ã‚’確èª" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(GLES3ã®ã¿)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "å…¥åŠ›ã‚’è¿½åŠ +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "å‡ºåŠ›ã‚’è¿½åŠ +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8191,6 +8159,11 @@ msgid "Boolean" msgstr "ブール" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "ã‚µãƒ³ãƒ—ãƒ«ã‚’è¿½åŠ " + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "入力ãƒãƒ¼ãƒˆã®è¿½åŠ " @@ -8232,7 +8205,7 @@ msgstr "ビジュアルシェーダーノードã®ã‚µã‚¤ã‚ºã‚’変更ã™ã‚‹" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "統一åã‚’è¨å®š" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Input Default Port" @@ -8273,9 +8246,8 @@ msgid "Light" msgstr "å³å´é¢" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Show resulted shader code." -msgstr "シェーダーノードã®ä½œæˆ" +msgstr "シェーダーコードã®çµæžœã‚’表示。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Create Shader Node" @@ -8303,7 +8275,7 @@ msgstr "RGBベクトルをHSVベクトルã«å¤‰æ›ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Sepia function." -msgstr "セピア関数" +msgstr "セピア関数。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Burn operator." @@ -8331,7 +8303,7 @@ msgstr "Lighten演算å。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Overlay operator." -msgstr "" +msgstr "オーãƒãƒ¼ãƒ¬ã‚¤å‡¦ç†ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Screen operator." @@ -8405,11 +8377,10 @@ msgstr "" "指定ã•れãŸãƒ–ール値ãŒtrueã¾ãŸã¯falseã®å ´åˆã€é–¢é€£ä»˜ã‘られãŸãƒ™ã‚¯ãƒˆãƒ«ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" -"指定ã•れãŸãƒ–ール値ãŒtrueã¾ãŸã¯falseã®å ´åˆã€é–¢é€£ä»˜ã‘られãŸãƒ™ã‚¯ãƒˆãƒ«ã‚’è¿”ã—ã¾ã™ã€‚" +"指定ã•れãŸãƒ–ール値ãŒtrueã¾ãŸã¯falseã®å ´åˆã€é–¢é€£ä»˜ã‘られãŸã‚¹ã‚«ãƒ©ãƒ¼ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the comparison between two parameters." @@ -8427,7 +8398,7 @@ msgstr "ブール定数。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean uniform." -msgstr "" +msgstr "真å½å€¤ã®uniform変数。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for all shader modes." @@ -8440,6 +8411,7 @@ msgstr "入力パラメータ。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader modes." msgstr "" +"'%s' ã¯é ‚点シェーダーã¨ãƒ•ラグメントシェーダーã®ãŸã‚ã®ãƒ‘ラメータを入力ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for fragment and light shader modes." @@ -8460,6 +8432,7 @@ msgstr "é ‚ç‚¹ã‚·ã‚§ãƒ¼ãƒ€ãƒ¢ãƒ¼ãƒ‰ã® '%s' 入力パラメータ。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader mode." msgstr "" +"é ‚ç‚¹ã‚·ã‚§ãƒ¼ãƒ€ãƒ¼ãƒ¢ãƒ¼ãƒ‰ã€ãƒ•ラグメントシェーダーモード㮠'%s' 入力パラメータ。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar function." @@ -8844,9 +8817,8 @@ msgid "Linear interpolation between two vectors." msgstr "2ã¤ã®ãƒ™ã‚¯ãƒˆãƒ«é–“ã®ãƒªãƒ‹ã‚¢è£œé–“。" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Linear interpolation between two vectors using scalar." -msgstr "2ã¤ã®ãƒ™ã‚¯ãƒˆãƒ«é–“ã®ãƒªãƒ‹ã‚¢è£œé–“。" +msgstr "スカラーを使ã£ãŸã€2ã¤ã®ãƒ™ã‚¯ãƒˆãƒ«é–“ã®ãƒªãƒ‹ã‚¢è£œé–“。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the normalize product of vector." @@ -8971,11 +8943,15 @@ msgstr "" "è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Custom Godot Shader Language expression, which placed on top of the resulted " "shader. You can place various function definitions inside and call it later " "in the Expressions. You can also declare varyings, uniforms and constants." msgstr "" +"カスタムGodotシェーダー言語ã®è¡¨ç¾ã¯ã€ã‚·ã‚§ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°çµæžœã®æœ€å¾Œã«ä½ç½®ã—ã¾ã™ã€‚" +"様々ãªé–¢æ•°ã‚’ãã®ä¸ã§å®šç¾©ã—ã€è¡¨ç¾ã®ä¸ã§å‘¼ã³å‡ºã™ã“ã¨ãŒã§ãã¾ã™ã€‚ã¾ãŸvarying変" +"æ•°ã€uniform変数ã€å®šæ•°ã‚’宣言ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(Fragment/Light mode only) Scalar derivative function." @@ -9129,14 +9105,18 @@ msgid "Resources to export:" msgstr "エクスãƒãƒ¼ãƒˆã™ã‚‹ãƒªã‚½ãƒ¼ã‚¹:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "エクスãƒãƒ¼ãƒˆã™ã‚‹éžãƒªã‚½ãƒ¼ã‚¹ãƒ•ァイルã®ãƒ•ィルタ (コンマ区切り, 例*.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "プãƒã‚¸ã‚§ã‚¯ãƒˆã‹ã‚‰é™¤å¤–ã™ã‚‹ãƒ•ァイルã®ãƒ•ィルタ (コンマ区切り, 例*.json, *.txt)" @@ -9194,9 +9174,8 @@ msgid "Export PCK/Zip" msgstr "PCK/Zipã®ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆ" #: editor/project_export.cpp -#, fuzzy msgid "Export mode?" -msgstr "エクスãƒãƒ¼ãƒˆ モード?" +msgstr "エクスãƒãƒ¼ãƒˆ モード?" #: editor/project_export.cpp msgid "Export All" @@ -9376,7 +9355,7 @@ msgstr "æ—¢å˜ã®ãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆã‚’インãƒãƒ¼ãƒˆ" #: editor/project_manager.cpp msgid "Error: Project is missing on the filesystem." -msgstr "" +msgstr "エラー: プãƒã‚¸ã‚§ã‚¯ãƒˆã¯ãƒ•ァイルシステムを見ã¤ã‘られã¾ã›ã‚“。" #: editor/project_manager.cpp msgid "Can't open project at '%s'." @@ -9501,7 +9480,6 @@ msgid "Project Manager" msgstr "プãƒã‚¸ã‚§ã‚¯ãƒˆãƒžãƒãƒ¼ã‚¸ãƒ£ãƒ¼" #: editor/project_manager.cpp -#, fuzzy msgid "Projects" msgstr "プãƒã‚¸ã‚§ã‚¯ãƒˆ" @@ -9686,9 +9664,8 @@ msgid "Middle Button." msgstr "ä¸ã‚¯ãƒªãƒƒã‚¯" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Wheel Up." -msgstr "マウスホイールを上ã¸." +msgstr "マウスホイールを上." #: editor/project_settings_editor.cpp msgid "Wheel Down." @@ -9752,16 +9729,14 @@ msgid "Remove Translation" msgstr "翻訳を除去" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Add Remapped Path" -msgstr "リマップã•れãŸãƒ‘ã‚¹ã‚’è¿½åŠ " +msgstr "å†ãƒžãƒƒãƒ—ã•れãŸãƒ‘ã‚¹ã‚’è¿½åŠ " #: editor/project_settings_editor.cpp msgid "Resource Remap Add Remap" -msgstr "" +msgstr "リソースå†ãƒžãƒƒãƒ—ãŒå†ãƒžãƒƒãƒ—ã‚’è¿½åŠ " #: editor/project_settings_editor.cpp -#, fuzzy msgid "Change Resource Remap Language" msgstr "リソースリマップ言語を変更" @@ -9770,9 +9745,8 @@ msgid "Remove Resource Remap" msgstr "リソースã®ãƒªãƒžãƒƒãƒ—を削除" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Remove Resource Remap Option" -msgstr "リソースã®ãƒªãƒžãƒƒãƒ—オプションを除去" +msgstr "リソースå†ãƒžãƒƒãƒ—オプションを削除" #: editor/project_settings_editor.cpp msgid "Changed Locale Filter" @@ -9792,7 +9766,7 @@ msgstr "一般" #: editor/project_settings_editor.cpp msgid "Override For..." -msgstr "" +msgstr "上書ãã—ã¾ã™..." #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp msgid "The editor must be restarted for changes to take effect." @@ -10130,9 +10104,8 @@ msgid "Move Node In Parent" msgstr "ノードを親ã«ç§»å‹•" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Move Nodes In Parent" -msgstr "親ã®ãƒŽãƒ¼ãƒ‰ã‚’移動" +msgstr "複数ã®ãƒŽãƒ¼ãƒ‰ã‚’親ã«ç§»å‹•" #: editor/scene_tree_dock.cpp msgid "Duplicate Node(s)" @@ -10156,9 +10129,8 @@ msgid "Make node as Root" msgstr "ノードをルートã«ã™ã‚‹" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "ノードを削除" +msgstr "%d ノードを削除ã—ã¾ã™ã‹ï¼Ÿ" #: editor/scene_tree_dock.cpp #, fuzzy @@ -10167,12 +10139,11 @@ msgstr "シェーダーグラフノードを消去" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "\"%s\" ノードã¨ãã®åノードを削除ã—ã¾ã™ã‹ï¼Ÿ" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "ノードを削除" +msgstr "\"%s\" ノードを削除ã—ã¾ã™ã‹ï¼Ÿ" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10195,12 +10166,13 @@ msgstr "" "ã«æˆ»ã‚Šã¾ã™ã€‚" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "編集å¯èƒ½ãªå" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "プレースホルダーã¨ã—ã¦ãƒãƒ¼ãƒ‰" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"\"editable_instance\" を無効ã«ã™ã‚‹ã¨ã€ãƒŽãƒ¼ãƒ‰ã®ã™ã¹ã¦ã®ãƒ—ãƒãƒ‘ティãŒãƒ‡ãƒ•ォルト" +"ã«æˆ»ã‚Šã¾ã™ã€‚" #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10276,6 +10248,14 @@ msgid "Clear Inheritance" msgstr "継承をクリア" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "編集å¯èƒ½ãªå" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "プレースホルダーã¨ã—ã¦ãƒãƒ¼ãƒ‰" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "ドã‚ュメントを開ã" @@ -10292,10 +10272,6 @@ msgid "Change Type" msgstr "型を変更" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "スクリプトを拡張" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "親ノードを変更" @@ -10382,22 +10358,20 @@ msgstr "" "クリックã§ã‚·ã‚°ãƒŠãƒ« ドックを表示。" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "" "Node has %s connection(s).\n" "Click to show signals dock." msgstr "" -"ãƒŽãƒ¼ãƒ‰ã«æŽ¥ç¶šãŒã‚りã¾ã™ã€‚\n" +"ノード㫠%s 個接続ãŒã‚りã¾ã™ã€‚\n" "クリックã§ã‚·ã‚°ãƒŠãƒ« ドックを表示。" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "" "Node is in %s group(s).\n" "Click to show groups dock." msgstr "" -"ノードã¯ã‚°ãƒ«ãƒ¼ãƒ—ã«å±žã—ã¦ã„ã¾ã™ã€‚\n" -"クリックã—ã¦ã‚°ãƒ«ãƒ¼ãƒ—ドックを表示ã—ã¦ãã ã•ã„。" +"ノード㯠%s グループã«å±žã—ã¦ã„ã¾ã™ã€‚\n" +"クリックã—ã¦ã‚°ãƒ«ãƒ¼ãƒ—ドックを表示。" #: editor/scene_tree_editor.cpp msgid "Open Script:" @@ -10542,23 +10516,18 @@ msgid "Will load an existing script file." msgstr "æ—¢å˜ã®ã‚¹ã‚¯ãƒªãƒ—トファイルをèªã¿è¾¼ã‚€ã€‚" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "言語" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "継承" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "クラスå" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "テンプレート" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "組ã¿è¾¼ã¿ã‚¹ã‚¯ãƒªãƒ—ト" #: editor/script_create_dialog.cpp @@ -10574,7 +10543,6 @@ msgid "Bytes:" msgstr "ãƒã‚¤ãƒˆ:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" msgstr "è¦å‘Š:" @@ -10583,29 +10551,24 @@ msgid "Error:" msgstr "エラー:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "エラーをコピー" +msgstr "C++ エラー" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "エラー:" +msgstr "C++ エラー:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "ソース" +msgstr "C++ ソース" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "ソース" +msgstr "ソース:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "ソース" +msgstr "C++ ソース:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10616,18 +10579,16 @@ msgid "Errors" msgstr "エラー" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "åプãƒã‚»ã‚¹æŽ¥ç¶š" +msgstr "åプãƒã‚»ã‚¹ãŒæŽ¥ç¶šã•れãŸã€‚" #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "エラーをコピー" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "ブレークãƒã‚¤ãƒ³ãƒˆ" +msgstr "ブレークãƒã‚¤ãƒ³ãƒˆã‚’スã‚ップã™ã‚‹" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10646,9 +10607,8 @@ msgid "Profiler" msgstr "プãƒãƒ•ァイラー" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "プãƒãƒ•ァイルã®ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆ" +msgstr "ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ãƒ—ãƒãƒ•ァイラー" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10873,7 +10833,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "é•·ã•ãŒ1ã®æ–‡å—列(文å—)を予期ã—ã¾ã—ãŸã€‚" #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10912,14 +10872,12 @@ msgid "Object can't provide a length." msgstr "オブジェクトã«é•·ã•ãŒã‚りã¾ã›ã‚“." #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Next Plane" -msgstr "次ã®ã‚¿ãƒ–" +msgstr "次ã®å¹³é¢" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Previous Plane" -msgstr "以å‰ã®ã‚¿ãƒ–" +msgstr "å‰ã®å¹³é¢" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Plane:" @@ -11045,6 +11003,8 @@ msgstr "フィルタメソッド" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." msgstr "" +"メッシュを使ã†ã«ã¯ãƒ¡ãƒƒã‚·ãƒ¥ãƒ©ã‚¤ãƒ–ラリリソースをã“ã®ã‚°ãƒªãƒƒãƒ‰ãƒžãƒƒãƒ—ã«è¨å®šã—ã¦ã" +"ã ã•ã„。" #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11172,32 +11132,28 @@ msgid "Set Variable Type" msgstr "変数ã®åž‹ã‚’è¨å®š" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Override an existing built-in function." -msgstr "æ—¢å˜ã®çµ„è¾¼ã¿åž‹åã¨é‡è¤‡ã—ã¦ã¯ã„ã‘ã¾ã›ã‚“。" +msgstr "æ—¢å˜ã®çµ„è¾¼ã¿é–¢æ•°ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã€‚" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Create a new function." -msgstr "æ–°è¦ãƒŽãƒ¼ãƒ‰ã‚’作æˆã€‚" +msgstr "æ–°è¦é–¢æ•°ã‚’作æˆã€‚" #: modules/visual_script/visual_script_editor.cpp msgid "Variables:" msgstr "変数を作æˆ:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Create a new variable." -msgstr "æ–°è¦ãƒŽãƒ¼ãƒ‰ã‚’作æˆã€‚" +msgstr "æ–°è¦å¤‰æ•°ã‚’作æˆã€‚" #: modules/visual_script/visual_script_editor.cpp msgid "Signals:" msgstr "シグナル:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Create a new signal." -msgstr "æ–°è¦ãƒãƒªã‚´ãƒ³ã‚’生æˆã€‚" +msgstr "æ–°è¦ã‚·ã‚°ãƒŠãƒ«ã‚’生æˆã€‚" #: modules/visual_script/visual_script_editor.cpp msgid "Name is not a valid identifier:" @@ -11224,6 +11180,11 @@ msgid "Add Function" msgstr "é–¢æ•°ã‚’è¿½åŠ " #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "入力ãƒãƒ¼ãƒˆã®å‰Šé™¤" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "å¤‰æ•°ã‚’è¿½åŠ " @@ -11232,6 +11193,26 @@ msgid "Add Signal" msgstr "ã‚·ã‚°ãƒŠãƒ«ã‚’è¿½åŠ " #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "入力ãƒãƒ¼ãƒˆã®è¿½åŠ " + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "出力ãƒãƒ¼ãƒˆã‚’è¿½åŠ " + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "入力ãƒãƒ¼ãƒˆã®å‰Šé™¤" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "出力ãƒãƒ¼ãƒˆã®å‰Šé™¤" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "å¼ã‚’変更" @@ -11280,10 +11261,20 @@ msgid "Add Preload Node" msgstr "プリãƒãƒ¼ãƒ‰ãƒŽãƒ¼ãƒ‰ã‚’è¿½åŠ " #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "ツリーã‹ã‚‰ãƒŽãƒ¼ãƒ‰ã‚’è¿½åŠ " #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "ゲッタープãƒãƒ‘ティã®è¿½åŠ " @@ -11308,6 +11299,11 @@ msgid "Connect Nodes" msgstr "ãƒŽãƒ¼ãƒ‰ã«æŽ¥ç¶š" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "グラフノードを切æ–" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "ãƒŽãƒ¼ãƒ‰ãƒ‡ãƒ¼ã‚¿ã«æŽ¥ç¶š" @@ -11340,6 +11336,28 @@ msgid "Paste VisualScript Nodes" msgstr "VisualScriptノードを貼り付ã‘" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "ファンクションノードをコピーã§ãã¾ã›ã‚“。" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "関数åを変更" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "関数を除去" @@ -11365,16 +11383,13 @@ msgid "Make Tool:" msgstr "ãƒãƒ¼ã‚«ãƒ«ã«ã™ã‚‹" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "基本タイプ:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "メンãƒãƒ¼:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "利用å¯èƒ½ãªãƒŽãƒ¼ãƒ‰:" +#, fuzzy +msgid "function_name" +msgstr "関数:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11397,6 +11412,16 @@ msgid "Cut Nodes" msgstr "ノードを切りå–ã‚‹" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "関数åを変更" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "å†èªè¾¼" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "メンãƒãƒ¼ã‚’編集" @@ -11494,6 +11519,10 @@ msgid "The package must have at least one '.' separator." msgstr "パッケージã«ã¯ä¸€ã¤ä»¥ä¸Šã®åŒºåˆ‡ã‚Šæ–‡å— '.' ãŒå¿…è¦ã§ã™ã€‚" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "一覧ã‹ã‚‰ãƒ‡ãƒã‚¤ã‚¹ã‚’é¸æŠž" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "ADB実行å¯èƒ½ãƒ•ァイルãŒã‚¨ãƒ‡ã‚£ã‚¿è¨å®šã§è¨å®šã•れã¦ã„ã¾ã›ã‚“。" @@ -11566,7 +11595,7 @@ msgstr "" #: platform/android/export/export.cpp msgid "No build apk generated at: " -msgstr "ビルドAPKã¯ç”Ÿæˆã•れã¦ã„ã¾ã›ã‚“:" +msgstr "ビルドAPKã¯ç”Ÿæˆã•れã¦ã„ã¾ã›ã‚“: " #: platform/iphone/export/export.cpp msgid "Identifier is missing." @@ -11606,6 +11635,10 @@ msgid "Required icon is not specified in the preset." msgstr "å¿…é ˆã‚¢ã‚¤ã‚³ãƒ³ãŒãƒ—ãƒªã‚»ãƒƒãƒˆã«æŒ‡å®šã•れã¦ã„ã¾ã›ã‚“。" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "ブラウザã§å®Ÿè¡Œ" @@ -11659,34 +11692,29 @@ msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "䏿£ãªStoreãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸(縦横50x50ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)" #: platform/uwp/export/export.cpp -#, fuzzy msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "䏿£ãª44X44æ£æ–¹ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª44x44ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)" +msgstr "無効ãª44X44四角ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª44x44ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp -#, fuzzy msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "䏿£ãª71x71æ£æ–¹ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª71x71ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)" +msgstr "無効ãª71x71四角ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª71x71ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp -#, fuzzy msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "䏿£ãª150X150æ£æ–¹ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª150x150ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)" +msgstr "無効ãª150X150四角ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª150x150ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp -#, fuzzy msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "䏿£ãª310X310æ£æ–¹ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª310x310ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)" +msgstr "無効ãª310X310四角ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª310x310ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp -#, fuzzy msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "䏿£ãª310X150幅広ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª310x150ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)" +msgstr "無効ãª310X150ワイドãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª310x150ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp -#, fuzzy msgid "Invalid splash screen image dimensions (should be 620x300)." -msgstr "䏿£ãªã‚¹ãƒ—ラッシュスクリーンイメージ(縦横620x300ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)" +msgstr "" +"無効ãªã‚¹ãƒ—ラッシュスクリーンイメージ(縦横620x300ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: scene/2d/animated_sprite.cpp #, fuzzy @@ -11923,16 +11951,15 @@ msgstr "(Time Left: %d分%02dç§’)" #: scene/3d/baked_lightmap.cpp msgid "Plotting Meshes: " -msgstr "メッシュã®ãƒ—ãƒãƒƒãƒˆ: " +msgstr "メッシュをæç”»ä¸: " #: scene/3d/baked_lightmap.cpp -#, fuzzy msgid "Plotting Lights:" -msgstr "イメージをé…ç½®(Blit)" +msgstr "å…‰æºã‚’æç”»ä¸:" #: scene/3d/baked_lightmap.cpp scene/3d/gi_probe.cpp msgid "Finishing Plot" -msgstr "プãƒãƒƒãƒˆå®Œäº†" +msgstr "æç”»å®Œäº†" #: scene/3d/baked_lightmap.cpp msgid "Lighting Meshes: " @@ -12123,6 +12150,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"EnvironmentãŒå¯è¦–エフェクトをæŒã¤ãŸã‚ã«ã€WorldEnvironmentã®ã€ŒEnvironmentã€ãƒ—" +"ãƒãƒ‘ティãŒå¿…è¦ã§ã™ã€‚" #: scene/3d/world_environment.cpp msgid "" @@ -12189,7 +12218,7 @@ msgstr "スクリーンã‹ã‚‰è‰²ã‚’é¸æŠžã—ã¦ãã ã•ã„。" #: scene/gui/color_picker.cpp msgid "HSV" -msgstr "" +msgstr "HSV" #: scene/gui/color_picker.cpp msgid "Raw" @@ -12204,7 +12233,6 @@ msgid "Add current color as a preset." msgstr "ç¾åœ¨ã®è‰²ã‚’プリセットã¨ã—ã¦è¿½åŠ ã—ã¾ã™ã€‚" #: scene/gui/container.cpp -#, fuzzy msgid "" "Container by itself serves no purpose unless a script configures its " "children placement behavior.\n" @@ -12212,8 +12240,8 @@ msgid "" msgstr "" "コンテナ自体ã¯ã€ã‚¹ã‚¯ãƒªãƒ—トã§åã®é…置動作をè¨å®šã—ãªã„é™ã‚Šã€ä½•ã®å½¹å‰²ã‚‚æžœãŸã—ã¾" "ã›ã‚“。\n" -"ã‚¹ã‚¯ãƒªãƒ—ãƒˆã‚’è¿½åŠ ã—ãªã„å ´åˆã¯ã€ä»£ã‚りã«ãƒ—レーン「コントãƒãƒ¼ãƒ« ã€ãƒŽãƒ¼ãƒ‰ã‚’使用ã—" -"ã¦ãã ã•ã„。" +"ã‚¹ã‚¯ãƒªãƒ—ãƒˆã‚’è¿½åŠ ã—ãªã„å ´åˆã¯ã€ä»£ã‚ã‚Šã«æ™®é€šã®ã€Œã‚³ãƒ³ãƒˆãƒãƒ¼ãƒ« ã€ãƒŽãƒ¼ãƒ‰ã‚’使用ã—ã¦" +"ãã ã•ã„。" #: scene/gui/control.cpp msgid "" @@ -12282,10 +12310,6 @@ msgstr "" "ãりã¾ã™ã€‚ãれ以外ã®å ´åˆã€ãƒ¬ãƒ³ãƒ€ãƒ¼ ターゲットã—ã€ãã®å†…部ã®ãƒ†ã‚¯ã‚¹ãƒãƒ£è¡¨ç¤ºã®ã„" "ãã¤ã‹ã®ãƒŽãƒ¼ãƒ‰ã«å‰²ã‚Šå½“ã¦ã¾ã™ã€‚" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "入力" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "プレビューã®ã‚½ãƒ¼ã‚¹ãŒç„¡åйã§ã™ã€‚" @@ -12315,6 +12339,27 @@ msgstr "Varyingã¯é ‚点関数ã«ã®ã¿å‰²ã‚Šå½“ã¦ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚" msgid "Constants cannot be modified." msgstr "定数ã¯å¤‰æ›´ã§ãã¾ã›ã‚“。" +#~ msgid "Snap to Grid" +#~ msgstr "グリッドã«ã‚¹ãƒŠãƒƒãƒ—" + +#~ msgid "Add input +" +#~ msgstr "å…¥åŠ›ã‚’è¿½åŠ +" + +#~ msgid "Language" +#~ msgstr "言語" + +#~ msgid "Inherits" +#~ msgstr "継承" + +#~ msgid "Base Type:" +#~ msgstr "基本タイプ:" + +#~ msgid "Available Nodes:" +#~ msgstr "利用å¯èƒ½ãªãƒŽãƒ¼ãƒ‰:" + +#~ msgid "Input" +#~ msgstr "入力" + #~ msgid "Properties:" #~ msgstr "プãƒãƒ‘ティ:" @@ -12542,9 +12587,6 @@ msgstr "定数ã¯å¤‰æ›´ã§ãã¾ã›ã‚“。" #~ msgid "Go to parent folder" #~ msgstr "親フォルダã¸" -#~ msgid "Select device from the list" -#~ msgstr "一覧ã‹ã‚‰ãƒ‡ãƒã‚¤ã‚¹ã‚’é¸æŠž" - #~ msgid "Open Scene(s)" #~ msgstr "シーンを開ã" @@ -12789,9 +12831,6 @@ msgstr "定数ã¯å¤‰æ›´ã§ãã¾ã›ã‚“。" #~ msgid "Warning" #~ msgstr "è¦å‘Š" -#~ msgid "Function:" -#~ msgstr "関数:" - #~ msgid "Variable" #~ msgstr "変数" @@ -12868,10 +12907,6 @@ msgstr "定数ã¯å¤‰æ›´ã§ãã¾ã›ã‚“。" #~ msgstr "グラフノードを接続" #, fuzzy -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "グラフノードを切æ–" - -#, fuzzy #~ msgid "Remove Shader Graph Node" #~ msgstr "シェーダーグラフノードを除去" @@ -13815,9 +13850,6 @@ msgstr "定数ã¯å¤‰æ›´ã§ãã¾ã›ã‚“。" #~ msgid "ERROR: Couldn't load sample!" #~ msgstr "エラー:サンプルをèªã¿è¾¼ã‚ã¾ã›ã‚“!" -#~ msgid "Add Sample" -#~ msgstr "ã‚µãƒ³ãƒ—ãƒ«ã‚’è¿½åŠ " - #~ msgid "Rename Sample" #~ msgstr "サンプルã®åå‰ã‚’変ãˆã‚‹" diff --git a/editor/translations/ka.po b/editor/translations/ka.po index 7e9f4513aa..f703153803 100644 --- a/editor/translations/ka.po +++ b/editor/translations/ka.po @@ -379,6 +379,7 @@ msgstr "áƒáƒ®áƒáƒšáƒ˜ %d ჩáƒáƒœáƒáƒ¬áƒ”რების შექმნრ#: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "შექმნáƒ" @@ -516,16 +517,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "მáƒáƒœáƒ˜áƒ¨áƒ•ნის áƒáƒ¡áƒšáƒ˜áƒ¡ შექმნáƒ" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -665,8 +656,9 @@ msgid "Scale Ratio:" msgstr "მáƒáƒ¡áƒ¨áƒ¢áƒáƒ‘ის თáƒáƒœáƒáƒ¤áƒáƒ დáƒáƒ‘áƒ:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "დáƒáƒ§áƒ”ნდეს გáƒáƒ“áƒáƒ¡áƒ•ლები შემდეგზე:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -677,6 +669,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "მáƒáƒœáƒ˜áƒ¨áƒ•ნის áƒáƒ¡áƒšáƒ˜áƒ¡ შექმნáƒ" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1015,7 +1012,7 @@ msgid "Resource" msgstr "რესურსი" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "გზáƒ" @@ -1485,7 +1482,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1539,7 +1537,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1937,6 +1935,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2946,7 +2945,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3185,6 +3184,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3211,14 +3214,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "დáƒáƒ›áƒáƒ™áƒ˜áƒ“ებულებების შემსწáƒáƒ ებელი" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4012,7 +4007,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4152,6 +4147,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "დáƒáƒ›áƒáƒ™áƒ˜áƒ“ებულებების შემსწáƒáƒ ებელი" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4504,7 +4506,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4679,6 +4680,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4885,6 +4888,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5175,20 +5182,23 @@ msgid "Ruler Mode" msgstr "მáƒáƒ¡áƒ¨áƒ¢áƒáƒ‘ის თáƒáƒœáƒáƒ¤áƒáƒ დáƒáƒ‘áƒ:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5279,8 +5289,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5548,6 +5557,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6184,6 +6197,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6240,6 +6257,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6344,6 +6362,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6619,6 +6642,11 @@ msgstr "შექმნáƒ" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6677,10 +6705,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -7007,6 +7031,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7040,6 +7068,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7272,6 +7304,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8071,12 +8107,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "სáƒáƒ§áƒ•áƒáƒ ლები:" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8091,6 +8124,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "სáƒáƒ§áƒ•áƒáƒ ლები:" @@ -8967,12 +9004,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9964,11 +10003,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10044,6 +10081,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -10061,10 +10106,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "áƒáƒ®áƒáƒšáƒ˜ %s შექმნáƒ" @@ -10301,24 +10342,17 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "დáƒáƒ›áƒáƒ™áƒ˜áƒ“ებულებების შემსწáƒáƒ ებელი" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -10963,6 +10997,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "მáƒáƒœáƒ˜áƒ¨áƒ•ნის მáƒáƒ¨áƒáƒ ებáƒ" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10971,6 +11010,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "სáƒáƒ§áƒ•áƒáƒ ლები:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "სáƒáƒ§áƒ•áƒáƒ ლები:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "მáƒáƒœáƒ˜áƒ¨áƒ•ნის მáƒáƒ¨áƒáƒ ებáƒ" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "მáƒáƒœáƒ˜áƒ¨áƒ•ნის მáƒáƒ¨áƒáƒ ებáƒ" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11011,10 +11070,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11040,6 +11109,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "კáƒáƒ•შირის გáƒáƒ¬áƒ§áƒ•ეტáƒ" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "კვáƒáƒœáƒ«áƒ—áƒáƒœ დáƒáƒ™áƒáƒ•შირებáƒ:" @@ -11073,6 +11147,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "áƒáƒ®áƒáƒšáƒ˜ %s შექმნáƒ" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11097,16 +11192,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "ფუნქციები:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11129,6 +11221,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "ფუნქციები:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -11223,6 +11324,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11324,6 +11429,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11868,10 +11977,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -11959,9 +12064,6 @@ msgstr "" #~ msgid "Move Anim Track Down" #~ msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ თრექის ქვემáƒáƒ— გáƒáƒ“áƒáƒáƒ“გილებáƒ" -#~ msgid "Set Transitions to:" -#~ msgstr "დáƒáƒ§áƒ”ნდეს გáƒáƒ“áƒáƒ¡áƒ•ლები შემდეგზე:" - #~ msgid "Anim Track Rename" #~ msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ თრექის გáƒáƒ“áƒáƒ ქმევáƒ" diff --git a/editor/translations/ko.po b/editor/translations/ko.po index 77226cff26..d2e68e1d71 100644 --- a/editor/translations/ko.po +++ b/editor/translations/ko.po @@ -13,11 +13,12 @@ # JY <yimjisoo@mailfence.com>, 2018. # Ch. <ccwpc@hanmail.net>, 2018. # moolow <copyhyeon@gmail.com>, 2019. +# Jiyoon Kim <kimjiy@dickinson.edu>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-13 16:50+0000\n" +"PO-Revision-Date: 2019-10-29 12:49+0000\n" "Last-Translator: ì†¡íƒœì„ <xotjq237@gmail.com>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/" "godot/ko/>\n" @@ -26,13 +27,13 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 3.9-dev\n" +"X-Generator: Weblate 3.9.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "" -"convert()를 사용하기 위한 ì¸ìˆ˜ ìœ í˜•ì´ ìž˜ëª»ë˜ì—ˆì–´ìš”, TYPE_* ìƒìˆ˜ë¥¼ 사용하세요." +"conver() ë©”ì„œë“œì˜ ì¸ìˆ˜ íƒ€ìž…ì´ ìž˜ 못ë˜ì—ˆìŠµë‹ˆë‹¤, TYPE_* ìƒìˆ˜ë¥¼ 사용하세요." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -70,32 +71,31 @@ msgstr "'%s'ì„(를) 호출 시:" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "믹스" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -361,6 +361,7 @@ msgstr "%dê°œì˜ ìƒˆ íŠ¸ëž™ì„ ë§Œë“¤ê³ í‚¤ë¥¼ ì‚½ìž…í• ê¹Œìš”?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "만들기" @@ -501,20 +502,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "ê²½ê³ : ê°€ì ¸ì˜¨ ì• ë‹ˆë©”ì´ì…˜ì„ 편집 중" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "ëª¨ë‘ ì„ íƒí•˜ê¸°" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "ëª¨ë‘ ì„ íƒí•˜ì§€ 않기" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "" -"ì• ë‹ˆë©”ì´ì…˜ì„ ê°–ê³ ìžˆëŠ” AnimationPlayer ë…¸ë“œì˜ ê²½ë¡œë¥¼ ì„¤ì •í•˜ì§€ 않았어요." +msgstr "ì• ë‹ˆë©”ì´ì…˜ì„ ë§Œë“¤ê³ íŽ¸ì§‘í•˜ë ¤ë©´ AnimationPlayer노드를 ì„ íƒí•˜ì„¸ìš”." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -559,11 +549,11 @@ msgstr "트랙 복사하기" #: editor/animation_track_editor.cpp msgid "Scale Selection" -msgstr "ì„ íƒ í•목 í¬ê¸° ì¡°ì ˆí•˜ê¸°" +msgstr "ì„ íƒ í•목 ê¸¸ì´ ì¡°ì ˆí•˜ê¸°" #: editor/animation_track_editor.cpp msgid "Scale From Cursor" -msgstr "커서 위치ì—서 í¬ê¸° ì¡°ì ˆí•˜ê¸°" +msgstr "커서 위치ì—서 ê¸¸ì´ ì¡°ì ˆí•˜ê¸°" #: editor/animation_track_editor.cpp modules/gridmap/grid_map_editor_plugin.cpp msgid "Duplicate Selection" @@ -643,10 +633,11 @@ msgstr "ì—†ì• ê¸°" #: editor/animation_track_editor.cpp msgid "Scale Ratio:" -msgstr "규모 비율:" +msgstr "ê¸¸ì´ ë¹„ìœ¨:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "ë³µì‚¬í• íŠ¸ëž™ì„ ì„ íƒí•˜ì„¸ìš”:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -658,6 +649,11 @@ msgstr "ë³µì‚¬í• íŠ¸ëž™ì„ ì„ íƒí•˜ì„¸ìš”:" msgid "Copy" msgstr "복사하기" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "ëª¨ë‘ ì„ íƒí•˜ì§€ 않기" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "오디오 트랙 í´ë¦½ 추가하기" @@ -981,7 +977,7 @@ msgid "Resource" msgstr "리소스" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "경로" @@ -1249,9 +1245,8 @@ msgid "Delete Bus Effect" msgstr "버스 효과 ì‚ì œí•˜ê¸°" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "오디오 버스, 드래그 앤 드ë¡ìœ¼ë¡œ 다시 ì •ë ¬í•´ìš”." +msgstr "드래그 & 드ë¡ìœ¼ë¡œ 다시 ì •ë ¬í•´ìš”." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1284,7 +1279,7 @@ msgstr "효과 ì‚ì œí•˜ê¸°" #: editor/editor_audio_buses.cpp msgid "Audio" -msgstr "오디오" +msgstr "오디오(Audio)" #: editor/editor_audio_buses.cpp msgid "Add Audio Bus" @@ -1442,7 +1437,8 @@ msgstr "ì˜¤í† ë¡œë“œ 추가하기" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "경로:" @@ -1496,7 +1492,7 @@ msgstr "í´ë” 만들기" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "ì´ë¦„:" @@ -1672,7 +1668,7 @@ msgstr "í˜„ìž¬ì˜ ê²ƒìœ¼ë¡œ 만들기" #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/version_control_editor_plugin.cpp msgid "New" -msgstr "새 것" +msgstr "새로 만들기" #: editor/editor_feature_profile.cpp editor/editor_node.cpp #: editor/project_manager.cpp @@ -1889,6 +1885,7 @@ msgid "Class:" msgstr "í´ëž˜ìФ:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "ìƒì†:" @@ -1897,9 +1894,8 @@ msgid "Inherited by:" msgstr "ìƒì†í•œ í´ëž˜ìФ:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "간단한 설명:" +msgstr "간단한 설명" #: editor/editor_help.cpp msgid "Properties" @@ -1930,9 +1926,8 @@ msgid "Class Description" msgstr "í´ëž˜ìФ 설명" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "온ë¼ì¸ íŠœí† ë¦¬ì–¼:" +msgstr "온ë¼ì¸ íŠœí† ë¦¬ì–¼" #: editor/editor_help.cpp msgid "" @@ -2055,7 +2050,7 @@ msgstr "시작" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2071,19 +2066,19 @@ msgstr "노드" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "ìˆ˜ì‹ RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "ìˆ˜ì‹ RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "ë°œì‹ RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "ë°œì‹ RSET" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2179,8 +2174,7 @@ msgid "" "Couldn't save scene. Likely dependencies (instances or inheritance) couldn't " "be satisfied." msgstr "" -"ì”¬ì„ ì €ìž¥í• ìˆ˜ 없어요. ì¢…ì† ê´€ê³„ (ì¸ìŠ¤í„´ìŠ¤ ë˜ëŠ” ìƒì†)ê°€ 만족스럽지 않나 ë³´êµ°" -"ìš”." +"ì”¬ì„ ì €ìž¥í• ìˆ˜ 없어요. ì¢…ì† ê´€ê³„ (ì¸ìŠ¤í„´ìŠ¤ ë˜ëŠ” ìƒì†)ê°€ 만족스럽지 않나ë´ìš”." #: editor/editor_node.cpp editor/scene_tree_dock.cpp msgid "Can't overwrite scene that is still open!" @@ -2403,7 +2397,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Pick a Main Scene" -msgstr "기본 씬 ê³ ë¥´ê¸°" +msgstr "ë©”ì¸ ì”¬ì„ ê³ ë¥´ì„¸ìš”" #: editor/editor_node.cpp msgid "Close Scene" @@ -2477,7 +2471,7 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" -"기본 ì”¬ì„ ì§€ì •í•˜ì§€ 않았네요. 하나 ì •í• ê¹Œìš”?\n" +"ë©”ì¸ ì”¬ì„ ì§€ì •í•˜ì§€ 않았네요. 하나 ì •í• ê¹Œìš”?\n" "ì´ê±´ ë‚˜ì¤‘ì— \"프로ì 트 ì„¤ì •\"ì˜ 'application' ì¹´í…Œê³ ë¦¬ì—서 바꿀 수 있어요." #: editor/editor_node.cpp @@ -2663,17 +2657,16 @@ msgid "Project Settings..." msgstr "프로ì 트 ì„¤ì •..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "ë²„ì „:" +msgstr "ë²„ì „ 컨트롤" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "ë²„ì „ 컨트롤 설치하기" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "ë²„ì „ 컨트롤 종료하기" #: editor/editor_node.cpp msgid "Export..." @@ -2941,7 +2934,7 @@ msgstr "ì¸ìŠ¤íŽ™í„°" msgid "Expand Bottom Panel" msgstr "하단 íŒ¨ë„ íŽ¼ì¹˜ê¸°" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "ì¶œë ¥" @@ -2967,9 +2960,14 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"\"res://android/build\"ì— ì†ŒìŠ¤ í…œí”Œë¦¿ì„ ì„¤ì¹˜í•´ì„œ, 프로ì 트를 맞춤 안드로ì´ë“œ " +"ë¹Œë“œì— ë§žê²Œ ì„¤ì •í• ê±°ì—ìš”.\n" +"그런 ë‹¤ìŒ ìˆ˜ì • 사í•ì„ ì ìš©í•˜ê³ ë§žì¶¤ APK를 만들어 내보낼 수 있어요 (모듈 추가" +"하기, AndroidManifest.xml 바꾸기 등).\n" +"미리 ë¹Œë“œëœ APK를 사용하는 ëŒ€ì‹ ë§žì¶¤ 빌드를 ë§Œë“¤ë ¤ë©´, 안드로ì´ë“œ 내보내기 프" +"리셋ì—서 \"맞춤 빌드 사용하기\" ì„¤ì •ì„ ì¼œ 놓아야 í•´ìš”." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" @@ -2977,7 +2975,7 @@ msgid "" "operation again." msgstr "" "안드로ì´ë“œ 빌드 í…œí”Œë¦¿ì„ ì´ë¯¸ 설치한 ë°ë‹¤ê°€ ë®ì–´ 쓸 수 없네요.\n" -"ì´ ëª…ë ¹ì„ ë‹¤ì‹œ 실행하기 ì „ì— ìˆ˜ë™ìœ¼ë¡œ \"build\" ë””ë ‰í† ë¦¬ë¥¼ ì‚ì œí•˜ì„¸ìš”." +"ì´ ëª…ë ¹ì„ ë‹¤ì‹œ 실행하기 ì „ì— \"res://android/build\" ë””ë ‰í† ë¦¬ë¥¼ ì‚ì œí•˜ì„¸ìš”." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3040,9 +3038,8 @@ msgid "Open the previous Editor" msgstr "ì´ì „ 편집기 열기" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "표면 소스를 ì§€ì •í•˜ì§€ 않았네요." +msgstr "하위 리소스를 ì°¾ì„ ìˆ˜ 없어요." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3053,9 +3050,8 @@ msgid "Thumbnail..." msgstr "ì¸ë„¤ì¼..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "스í¬ë¦½íЏ 열기:" +msgstr "기본 스í¬ë¦½íЏ:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3188,13 +3184,17 @@ msgstr "ë·°í¬íЏ ì„ íƒí•˜ê¸°" msgid "New Script" msgstr "새 스í¬ë¦½íЏ" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "스í¬ë¦½íЏ 펼치기" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "새 %s" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Make Unique" -msgstr "ê³ ìœ í•˜ê²Œ 만들기" +msgstr "ìœ ì¼í•˜ê²Œ 만들기" #: editor/editor_properties.cpp #: editor/plugins/animation_blend_space_1d_editor.cpp @@ -3214,13 +3214,6 @@ msgstr "붙여넣기" msgid "Convert To %s" msgstr "%s(으)로 변환하기" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "편집기 열기" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "ì„ íƒëœ 노드는 ë·°í¬íŠ¸ê°€ 아닙니다!" @@ -3759,7 +3752,7 @@ msgstr "그룹 ì‚ì œí•˜ê¸°" #: editor/groups_editor.cpp editor/node_dock.cpp msgid "Groups" -msgstr "그룹" +msgstr "그룹(Group)" #: editor/groups_editor.cpp msgid "Nodes Not in Group" @@ -3880,7 +3873,6 @@ msgid "Import As:" msgstr "ë‹¤ìŒ í˜•ì‹ìœ¼ë¡œ ê°€ì ¸ì˜¤ê¸°:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" msgstr "프리셋" @@ -4008,7 +4000,7 @@ msgstr "í”ŒëŸ¬ê·¸ì¸ ì´ë¦„:" msgid "Subfolder:" msgstr "하위 í´ë”:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "언어:" @@ -4148,6 +4140,12 @@ msgstr "ì " #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "편집기 열기" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "ì• ë‹ˆë©”ì´ì…˜ 노드 열기" @@ -4401,7 +4399,7 @@ msgstr "ì• ë‹ˆë©”ì´ì…˜ 위치 (ì´ˆ)." #: editor/plugins/animation_player_editor_plugin.cpp msgid "Scale animation playback globally for the node." -msgstr "ë…¸ë“œì— ëŒ€í•œ ì• ë‹ˆë©”ì´ì…˜ ìž¬ìƒ ê·œëª¨ë¥¼ ì „ì²´ì 으로 ì¡°ì ˆí•˜ê¸°." +msgstr "ë…¸ë“œì˜ ì• ë‹ˆë©”ì´ì…˜ ìž¬ìƒ ê¸¸ì´ë¥¼ ì „ì²´ì 으로 ì¡°ì ˆí•˜ê¸°." #: editor/plugins/animation_player_editor_plugin.cpp msgid "Animation Tools" @@ -4410,7 +4408,7 @@ msgstr "ì• ë‹ˆë©”ì´ì…˜ ë„구" #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Animation" -msgstr "ì• ë‹ˆë©”ì´ì…˜" +msgstr "ì• ë‹ˆë©”ì´ì…˜(Animation)" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Edit Transitions..." @@ -4492,7 +4490,6 @@ msgstr "ì• ë‹ˆë©”ì´ì…˜ ì´ë¦„:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "오류!" @@ -4608,7 +4605,7 @@ msgstr "새 ì´ë¦„:" #: editor/plugins/animation_tree_player_editor_plugin.cpp #: editor/plugins/multimesh_editor_plugin.cpp msgid "Scale:" -msgstr "규모:" +msgstr "í¬ê¸°:" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Fade In (s):" @@ -4664,6 +4661,8 @@ msgid "Current:" msgstr "현재:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "ìž…ë ¥ 추가하기" @@ -4868,6 +4867,10 @@ msgid "All" msgstr "모ë‘" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "ê°€ì ¸ì˜¤ê¸°..." @@ -5087,7 +5090,7 @@ msgstr "IK ì²´ì¸ ì§€ìš°ê¸°" msgid "" "Warning: Children of a container get their position and size determined only " "by their parent." -msgstr "ê²½ê³ : 컨테ì´ë„ˆì˜ ìžì‹ 규모와 위치는 ë¶€ëª¨ì— ì˜í•´ ê²°ì •ë˜ìš”." +msgstr "ê²½ê³ : 컨테ì´ë„ˆì˜ ìžì‹ 규모와 위치는 ë¶€ëª¨ì— ì˜í•´ ê²°ì •ë˜ì–´ìš”." #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/texture_region_editor_plugin.cpp @@ -5129,7 +5132,7 @@ msgstr "íšŒì „ 모드" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Scale Mode" -msgstr "규모 모드" +msgstr "í¬ê¸° ì¡°ì ˆ 모드" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5149,26 +5152,32 @@ msgid "Pan Mode" msgstr "팬 모드" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "실행 모드:" +msgstr "ìž ëª¨ë“œ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "스냅 í† ê¸€." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "스냅 사용하기" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "스냅 ì„¤ì •" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "스냅 í† ê¸€." + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Use Grid Snap" +msgstr "ê²©ìž ìŠ¤ëƒ…" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "격ìžì— 스냅" +msgid "Snapping Options" +msgstr "스냅 ì„¤ì •" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5257,8 +5266,8 @@ msgid "View" msgstr "보기" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "ê²©ìž ë³´ê¸°" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5287,11 +5296,11 @@ msgstr "그룹과 ìž ê¸ˆ ì•„ì´ì½˜ ë³´ì´ê¸°" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Center Selection" -msgstr "ì„ íƒ í•목 화면 ì¤‘ì•™ì— í‘œì‹œí•˜ê¸°" +msgstr "ì„ íƒ í•목 중앙으로" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Frame Selection" -msgstr "ì„ íƒ í•목 화면 꽉 차게 표시하기" +msgstr "ì„ íƒ í•목 ì „ì²´ 화면으로" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Preview Canvas Scale" @@ -5307,7 +5316,7 @@ msgstr "키를 삽입하기 위한 íšŒì „ 마스í¬." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Scale mask for inserting keys." -msgstr "키를 삽입하기 위한 규모 마스í¬." +msgstr "키를 삽입하기 위한 í¬ê¸° ì¡°ì ˆ 마스í¬." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert keys (based on mask)." @@ -5524,6 +5533,11 @@ msgstr "커브 ì„ í˜• 탄ì 트 í† ê¸€" msgid "Hold Shift to edit tangents individually" msgstr "Shift키를 눌러서 탄ì 트를 개별ì 으로 편집하기" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "ìš°í´ë¦: ì ì‚ì œí•˜ê¸°" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "GI 프로브 굽기" @@ -6158,6 +6172,10 @@ msgid "Grid" msgstr "격ìž" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "ê²©ìž ë³´ê¸°" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "ê²©ìž ì„¤ì •:" @@ -6214,6 +6232,7 @@ msgstr "ì¸ìŠ¤í„´ìŠ¤:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "ìœ í˜•:" @@ -6312,6 +6331,11 @@ msgid "Find Next" msgstr "ë‹¤ìŒ ì°¾ê¸°" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "ì´ì „ 찾기" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "스í¬ë¦½íЏ í•„í„°" @@ -6581,6 +6605,11 @@ msgstr "중단ì " msgid "Cut" msgstr "잘ë¼ë‚´ê¸°" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "ëª¨ë‘ ì„ íƒí•˜ê¸°" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "í–‰ ì‚ì œí•˜ê¸°" @@ -6638,10 +6667,6 @@ msgid "Auto Indent" msgstr "ìžë™ 들여쓰기" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "ì´ì „ 찾기" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "파ì¼ì—서 찾기..." @@ -6963,6 +6988,11 @@ msgid "Freelook Speed Modifier" msgstr "ìžìœ 시ì ì†ë„ ìˆ˜ì •ìž" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "ìžìœ 시ì ì†ë„ ìˆ˜ì •ìž" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7001,6 +7031,10 @@ msgid "Use Local Space" msgstr "로컬 스페ì´ìФ 사용하기" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "스냅 사용하기" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "하단 ë·°" @@ -7227,6 +7261,11 @@ msgid "Simplification: " msgstr "단순화: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "성장 (픽셀): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "성장 (픽셀): " @@ -7275,9 +7314,8 @@ msgid "(empty)" msgstr "(비었ìŒ)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "í”„ë ˆìž„ 붙여넣기" +msgstr "í”„ë ˆìž„ ì´ë™í•˜ê¸°" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7594,13 +7632,12 @@ msgid "Enable Priority" msgstr "ìš°ì„ ìˆœìœ„ 편집" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "íŒŒì¼ í•„í„°..." +msgstr "íƒ€ì¼ í•„í„°" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "타ì¼ì„ ì‚¬ìš©í•˜ë ¤ë©´ ì´ TileMapì—게 TileSet 리소스를 주세요." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7738,6 +7775,7 @@ msgstr "íƒ€ì¼ ì´ë¦„ ë³´ì´ê¸° (Alt키를 누르세요)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"타ì¼ì„ ê²½ê³„ì— ë§žê²Œ íŽ¸ì§‘í•˜ë ¤ë©´ 왼쪽 패ë„ì—서 í…스처를 추가하거나 ì„ íƒí•˜ì„¸ìš”." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -7911,92 +7949,80 @@ msgid "TileSet" msgstr "타ì¼ì…‹" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "ë…¸ë“œì˜ ë¶€ëª¨ ì´ë¦„ (사용 가능한 경우)" +msgstr "ì´ìš©í• 수 있는 ë²„ì „ 관리 시스템(VCS)ì´ ì—†ì–´ìš”." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "오류" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "ì´ë¦„ì´ ì§€ì •ë˜ì§€ 않ìŒ" +msgstr "커밋 메시지를 ì œê³µí•˜ì§€ 않았어요" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "스테ì´ì§€ì— ì¶”ê°€ëœ íŒŒì¼ì´ 없어요" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "커뮤니티" +msgstr "커밋" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "ë²„ì „ 관리 시스템(VCS)ì´ ì´ˆê¸°í™”ë˜ì§€ 않았어요" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "ë²„ì „ 관리 시스템" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "대문ìžë¡œ 시작하기" +msgstr "초기화" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "스테ì´ì§• ì˜ì—" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "새로운 사ê°í˜• 만들기." +msgstr "새 변경 ì‚¬í• ê°ì§€" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "변경하기" +msgstr "변경 사í•" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "ìˆ˜ì •ë¨" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "ì´ë¦„ 바꾸기" +msgstr "ì´ë¦„ 변경ë¨" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "ì‚ì œí•˜ê¸°" +msgstr "ì‚ì œë¨" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "변경하기" +msgstr "타입체ì¸ì§€" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "ì„ íƒ í•목 ì‚ì œí•˜ê¸°" +msgstr "ì„ íƒ í•목 스테ì´ì§€ë¡œ 보내기" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "ëª¨ë‘ ì €ìž¥í•˜ê¸°" +msgstr "ëª¨ë‘ ìŠ¤í…Œì´ì§€ë¡œ 보내기" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "커밋 메시지 추가하기" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "스í¬ë¦½íЏ 변경 ì‚¬í• ë™ê¸°í™”하기" +msgstr "커밋 변경 사í•" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8005,27 +8031,23 @@ msgstr "ìƒíƒœ" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" -msgstr "" +msgstr "ìµœì‹ ë²„ì „ìœ¼ë¡œ 커밋하기 ì „ì— íŒŒì¼ diff 보기" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No file diff is active" -msgstr "파ì¼ì´ ì„ íƒë˜ì§€ 않았습니다!" +msgstr "íŒŒì¼ diffê°€ ì¼œì ¸ 있지 않아요" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "íŒŒì¼ diffì—서 ê°ì§€í•œ 변경 사í•" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(GLES3ë§Œ 가능)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "ìž…ë ¥ 추가하기 +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "ì¶œë ¥ 추가하기 +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8041,6 +8063,11 @@ msgid "Boolean" msgstr "불리언" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "샘플" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "ìž…ë ¥ í¬íЏ 추가하기" @@ -8250,10 +8277,9 @@ msgid "" msgstr "불리언 ê°’ì´ ì°¸ì´ê±°ë‚˜ ê±°ì§“ì´ë©´ ê´€ë ¨ 벡터를 반환해요." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." -msgstr "불리언 ê°’ì´ ì°¸ì´ê±°ë‚˜ ê±°ì§“ì´ë©´ ê´€ë ¨ 벡터를 반환해요." +msgstr "불리언 ê°’ì´ ì°¸ì´ê±°ë‚˜ ê±°ì§“ì´ë©´ ê´€ë ¨ 스칼ë¼ë¥¼ 반환해요." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the comparison between two parameters." @@ -8946,13 +8972,17 @@ msgid "Resources to export:" msgstr "내보낼 리소스:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "리소스가 아닌 íŒŒì¼ ë‚´ë³´ë‚´ê¸° í•„í„° (쉼표로 구분, 예: *.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "프로ì 트ì—서 ì œì™¸ì‹œí‚¬ íŒŒì¼ í•„í„° (쉼표로 구분, 예: *.json, *.txt)" #: editor/project_export.cpp @@ -9247,8 +9277,8 @@ msgid "" "Please edit the project and set the main scene in the Project Settings under " "the \"Application\" category." msgstr "" -"프로ì 트를 ì‹¤í–‰í• ìˆ˜ ì—†ìŒ: 기본 ì”¬ì„ ì •ì˜í•˜ì§€ 않았어요.\n" -"프로ì 트를 íŽ¸ì§‘í•˜ê³ í”„ë¡œì 트 ì„¤ì •ì˜ \"Application\" ì¹´í…Œê³ ë¦¬ì—서 기본 ì”¬ì„ ì„¤" +"프로ì 트를 ì‹¤í–‰í• ìˆ˜ ì—†ìŒ: ë©”ì¸ ì”¬ì„ ì •ì˜í•˜ì§€ 않았어요.\n" +"프로ì 트를 íŽ¸ì§‘í•˜ê³ í”„ë¡œì 트 ì„¤ì •ì˜ \"Application\" ì¹´í…Œê³ ë¦¬ì—서 ë©”ì¸ ì”¬ì„ ì„¤" "ì •í•´ì£¼ì„¸ìš”." #: editor/project_manager.cpp @@ -9476,7 +9506,7 @@ msgstr "ì´ë²¤íЏ 추가하기" #: editor/project_settings_editor.cpp msgid "Button" -msgstr "버튼" +msgstr "Button" #: editor/project_settings_editor.cpp msgid "Left Button." @@ -9538,9 +9568,8 @@ msgid "Settings saved OK." msgstr "ì„¤ì • ì €ìž¥ 완료." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "ìž…ë ¥ ì•¡ì…˜ ì´ë²¤íЏ 추가하기" +msgstr "ìž…ë ¥ ì•¡ì…˜ ì´ë²¤íЏ ì´ë™í•¨" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -9676,7 +9705,7 @@ msgstr "ì˜¤í† ë¡œë“œ" #: editor/project_settings_editor.cpp msgid "Plugins" -msgstr "플러그ì¸" +msgstr "플러그ì¸(Plugin)" #: editor/property_editor.cpp msgid "Preset..." @@ -9876,11 +9905,11 @@ msgstr "현재 씬" #: editor/run_settings_dialog.cpp msgid "Main Scene" -msgstr "기본 씬" +msgstr "ë©”ì¸ ì”¬" #: editor/run_settings_dialog.cpp msgid "Main Scene Arguments:" -msgstr "기본 씬 ì¸ìˆ˜:" +msgstr "ë©”ì¸ ì”¬ ì¸ìˆ˜:" #: editor/run_settings_dialog.cpp msgid "Scene Run Settings" @@ -9905,9 +9934,8 @@ msgid "Instance Scene(s)" msgstr "씬 ì¸ìŠ¤í„´ìŠ¤" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "분기를 다른 씬으로 ì €ìž¥" +msgstr "분기 씬으로 êµì²´í•˜ê¸°" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -9951,23 +9979,20 @@ msgid "Make node as Root" msgstr "노드를 루트로 만들기" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "노드 ì‚ì œí•˜ê¸°" +msgstr "%dê°œì˜ ë…¸ë“œë¥¼ ì‚ì œí• ê¹Œìš”?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "ì…°ì´ë” 그래프 노드 ì‚ì œ" +msgstr "루트 노드 \"%s\"ì„(를) ì‚ì œí• ê¹Œìš”?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "노드 \"%s\"와(ê³¼) ìžì‹ì„ ì‚ì œí• ê¹Œìš”?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "노드 ì‚ì œí•˜ê¸°" +msgstr "노드 \"%s\"ì„(를) ì‚ì œí• ê¹Œìš”?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -9989,12 +10014,12 @@ msgstr "" "\"editable_instance\"를 ë„게 ë˜ë©´ ë…¸ë“œì˜ ëª¨ë“ ì†ì„±ì´ 기본 값으로 ë˜ëŒì•„와요." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "ìžì‹ë…¸ë“œ 편집 가능" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "ìžë¦¬ 표시ìžë¡œ 불러오기" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"\"editable_instance\"를 ë„게 ë˜ë©´ ë…¸ë“œì˜ ëª¨ë“ ì†ì„±ì´ 기본 값으로 ë˜ëŒì•„와요." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10068,6 +10093,14 @@ msgid "Clear Inheritance" msgstr "ìƒì† 지우기" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "ìžì‹ë…¸ë“œ 편집 가능" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "ìžë¦¬ 표시ìžë¡œ 불러오기" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "문서 열기" @@ -10084,10 +10117,6 @@ msgid "Change Type" msgstr "ìœ í˜• 바꾸기" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "스í¬ë¦½íЏ 펼치기" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "새 ë…¸ë“œì— ë¶€ëª¨ 노드 다시 ì§€ì •í•˜ê¸°" @@ -10327,23 +10356,18 @@ msgid "Will load an existing script file." msgstr "기존 스í¬ë¦½íЏ 파ì¼ì„ 불러와요." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "언어" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "ìƒì†" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "í´ëž˜ìФ ì´ë¦„" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "템플릿" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "내장 스í¬ë¦½íЏ" #: editor/script_create_dialog.cpp @@ -10359,7 +10383,6 @@ msgid "Bytes:" msgstr "ë°”ì´íЏ:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" msgstr "ê²½ê³ :" @@ -10368,29 +10391,24 @@ msgid "Error:" msgstr "ì—러:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "복사하기 오류" +msgstr "C++ 오류" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "ì—러:" +msgstr "C++ 오류:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "소스" +msgstr "C++ 소스" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "소스" +msgstr "소스:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "소스" +msgstr "C++ 소스:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10401,18 +10419,16 @@ msgid "Errors" msgstr "오류" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "ìžì‹ 프로세스 ì—°ê²°ë¨" +msgstr "ìžì‹ 프로세스 ì—°ê²°ë¨." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "복사하기 오류" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "중단ì " +msgstr "중단ì 넘기기" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10431,9 +10447,8 @@ msgid "Profiler" msgstr "프로파ì¼ëŸ¬" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "프로필 내보내기" +msgstr "ë„¤íŠ¸ì›Œí¬ í”„ë¡œíŒŒì¼ëŸ¬" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10657,7 +10672,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "길ì´ê°€ 1ì¸ ë¬¸ìžì—´ (문ìž)ì´ í•„ìš”í•´ìš”." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10812,13 +10827,12 @@ msgid "Pick Distance:" msgstr "거리 ì„ íƒí•˜ê¸°:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "메서드 í•„í„°" +msgstr "메시 í•„í„°" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." -msgstr "" +msgstr "메시를 ì‚¬ìš©í•˜ë ¤ë©´ ì´ GridMapì— MeshLibrary 리소스를 주세요." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -10994,6 +11008,11 @@ msgid "Add Function" msgstr "함수 추가하기" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "ìž…ë ¥ í¬íЏ ì‚ì œí•˜ê¸°" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "변수 추가하기" @@ -11002,6 +11021,26 @@ msgid "Add Signal" msgstr "ì‹œê·¸ë„ ì¶”ê°€í•˜ê¸°" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "ìž…ë ¥ í¬íЏ 추가하기" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "ì¶œë ¥ í¬íЏ 추가하기" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "ìž…ë ¥ í¬íЏ ì‚ì œí•˜ê¸°" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "ì¶œë ¥ í¬íЏ ì‚ì œí•˜ê¸°" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "í‘œí˜„ì‹ ë°”ê¾¸ê¸°" @@ -11046,10 +11085,20 @@ msgid "Add Preload Node" msgstr "Preload 노드 추가하기" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "트리ì—서 노드 추가하기" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Getter ì†ì„± 추가하기" @@ -11074,6 +11123,11 @@ msgid "Connect Nodes" msgstr "노드 연결하기" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "그래프 노드 ì—°ê²° í•´ì œ" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "노드 ë°ì´í„° 연결하기" @@ -11106,6 +11160,28 @@ msgid "Paste VisualScript Nodes" msgstr "비주얼 스í¬ë¦½íЏ 노드 붙여넣기" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "함수 노드를 ë³µì‚¬í• ìˆ˜ 없어요." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "함수명 바꾸기" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "함수 ì‚ì œí•˜ê¸°" @@ -11126,21 +11202,17 @@ msgid "Editing Signal:" msgstr "ì‹œê·¸ë„ íŽ¸ì§‘í•˜ê¸°:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "로컬로 만들기" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "기본 ìœ í˜•:" +msgstr "ë„구 만들기:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "멤버:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "사용 가능한 노드:" +#, fuzzy +msgid "function_name" +msgstr "함수:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11163,6 +11235,16 @@ msgid "Cut Nodes" msgstr "노드 잘ë¼ë‚´ê¸°" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "함수명 바꾸기" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "ìƒˆë¡œê³ ì¹¨" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "멤버 편집하기" @@ -11259,6 +11341,10 @@ msgid "The package must have at least one '.' separator." msgstr "패키지는 ì ì–´ë„ í•˜ë‚˜ì˜ '.' 분리 기호가 있어야 í•´ìš”." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "목ë¡ì—서 기기를 ì„ íƒí•˜ì„¸ìš”" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "ADB 실행 파ì¼ì„ 편집기 ì„¤ì •ì—서 ì„¤ì •í•˜ì§€ 않았어요." @@ -11279,12 +11365,11 @@ msgid "Invalid Android SDK path for custom build in Editor Settings." msgstr "편집기 ì„¤ì •ì—서 맞춤 ë¹Œë“œì— ìž˜ëª»ëœ ì•ˆë“œë¡œì´ë“œ SDK 경로ì´ì—ìš”." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"컴파ì¼í•˜ê¸° 위한 안드로ì´ë“œ 프로ì 트를 설치하지 않았어요. 편집기 메뉴ì—서 설치" +"프로ì íŠ¸ì— ì•ˆë“œë¡œì´ë“œ 빌드 í…œí”Œë¦¿ì„ ì„¤ì¹˜í•˜ì§€ 않았네요. 프로ì 트 메뉴ì—서 설치" "하세요." #: platform/android/export/export.cpp @@ -11369,6 +11454,10 @@ msgid "Required icon is not specified in the preset." msgstr "요구하는 ì•„ì´ì½˜ì„ 프리셋ì—서 ì§€ì •í•˜ì§€ 않았어요." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "브ë¼ìš°ì €ì—서 실행하기" @@ -12006,10 +12095,6 @@ msgstr "" "ìš°, í™”ë©´ì— í‘œì‹œí•˜ê¸° 위해서는 RenderTarget으로 ì„¤ì •í•˜ê³ ë‚´ë¶€ì ì¸ í…스처를 다" "른 ë…¸ë“œì— ì§€ì •í•´ì•¼ í•´ìš”." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "ìž…ë ¥" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "미리 ë³´ê¸°ì— ìž˜ëª»ëœ ì†ŒìŠ¤." @@ -12038,6 +12123,27 @@ msgstr "Varyings는 ì˜¤ì§ ê¼ì§“ì 함수ì—서만 ì§€ì •í• ìˆ˜ 있어요." msgid "Constants cannot be modified." msgstr "ìƒìˆ˜ëŠ” ìˆ˜ì •í• ìˆ˜ 없어요." +#~ msgid "Snap to Grid" +#~ msgstr "격ìžì— 스냅" + +#~ msgid "Add input +" +#~ msgstr "ìž…ë ¥ 추가하기 +" + +#~ msgid "Language" +#~ msgstr "언어" + +#~ msgid "Inherits" +#~ msgstr "ìƒì†" + +#~ msgid "Base Type:" +#~ msgstr "기본 ìœ í˜•:" + +#~ msgid "Available Nodes:" +#~ msgstr "사용 가능한 노드:" + +#~ msgid "Input" +#~ msgstr "ìž…ë ¥" + #~ msgid "Properties:" #~ msgstr "ì†ì„±:" @@ -12423,9 +12529,6 @@ msgstr "ìƒìˆ˜ëŠ” ìˆ˜ì •í• ìˆ˜ 없어요." #~ msgid "Go to parent folder" #~ msgstr "부모 í´ë”로 ì´ë™" -#~ msgid "Select device from the list" -#~ msgstr "목ë¡ì—서 기기를 ì„ íƒí•˜ì„¸ìš”" - #~ msgid "Open Scene(s)" #~ msgstr "씬(들) 열기" @@ -12661,9 +12764,6 @@ msgstr "ìƒìˆ˜ëŠ” ìˆ˜ì •í• ìˆ˜ 없어요." #~ msgid "Warning" #~ msgstr "ê²½ê³ " -#~ msgid "Function:" -#~ msgstr "함수:" - #~ msgid "Variable" #~ msgstr "변수" @@ -12730,9 +12830,6 @@ msgstr "ìƒìˆ˜ëŠ” ìˆ˜ì •í• ìˆ˜ 없어요." #~ msgid "Connect Graph Nodes" #~ msgstr "그래프 노드 ì—°ê²°" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "그래프 노드 ì—°ê²° í•´ì œ" - #~ msgid "Remove Shader Graph Node" #~ msgstr "ì…°ì´ë” 그래프 노드 ì‚ì œ" @@ -13820,9 +13917,6 @@ msgstr "ìƒìˆ˜ëŠ” ìˆ˜ì •í• ìˆ˜ 없어요." #~ msgid "Group" #~ msgstr "그룹" -#~ msgid "Samples" -#~ msgstr "샘플" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "샘플 변환 모드: (.wav 파ì¼):" diff --git a/editor/translations/lt.po b/editor/translations/lt.po index 4a7551e5b2..3d9a7bdd68 100644 --- a/editor/translations/lt.po +++ b/editor/translations/lt.po @@ -372,6 +372,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Sukurti" @@ -501,16 +502,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Pasirinkite Nodus, kuriuos norite importuoti" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -651,7 +642,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -663,6 +654,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Pasirinkite Nodus, kuriuos norite importuoti" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -993,7 +989,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1449,7 +1445,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1503,7 +1500,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1905,6 +1902,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2913,7 +2911,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3155,6 +3153,11 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Atidaryti Skriptų Editorių" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3181,14 +3184,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Atidaryti 2D Editorių" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3990,7 +3985,7 @@ msgstr "Priedai" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4130,6 +4125,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Atidaryti 2D Editorių" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4483,7 +4485,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4661,6 +4662,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4870,6 +4873,10 @@ msgid "All" msgstr "Visi" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importuoti Animacijas..." @@ -5162,20 +5169,23 @@ msgid "Ruler Mode" msgstr "TimeScale Nodas" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5265,8 +5275,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5530,6 +5539,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6169,6 +6182,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6226,6 +6243,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6331,6 +6349,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Filtrai..." @@ -6606,6 +6629,11 @@ msgstr "Sukurti" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6664,10 +6692,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Filtrai..." @@ -6989,6 +7013,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7022,6 +7050,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7254,6 +7286,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8059,12 +8095,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "MÄ—gstamiausi:" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8080,6 +8113,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "MÄ—gstamiausi:" @@ -8953,12 +8990,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9955,11 +9994,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10035,6 +10072,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -10052,11 +10097,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Atidaryti Skriptų Editorių" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Sukurti NaujÄ…" @@ -10292,24 +10332,18 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Priedai" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Atidaryti Skriptų Editorių" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -10953,6 +10987,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Panaikinti pasirinkimÄ…" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10961,6 +11000,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "MÄ—gstamiausi:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "MÄ—gstamiausi:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Panaikinti pasirinkimÄ…" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Panaikinti pasirinkimÄ…" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11001,10 +11060,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11030,6 +11099,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Atsijungti" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Prijunkite prie Nodo:" @@ -11063,6 +11137,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Sukurti NaujÄ…" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11087,15 +11182,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -11120,6 +11211,15 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "(Esama)" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Redaguoti Filtrus" @@ -11214,6 +11314,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11315,6 +11419,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11862,10 +11970,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/lv.po b/editor/translations/lv.po index 2ffe68acc5..26a3d6d7d1 100644 --- a/editor/translations/lv.po +++ b/editor/translations/lv.po @@ -359,6 +359,7 @@ msgstr "Izveidot %d JAUNU celiņu un ievietot atslÄ“gievietni?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Izveidot" @@ -494,16 +495,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "DzÄ“st izvÄ“lÄ“tos" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -642,7 +633,7 @@ msgid "Scale Ratio:" msgstr "MÄ“roga AttiecÄ«ba:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -654,6 +645,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "DzÄ“st izvÄ“lÄ“tos" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -980,7 +976,7 @@ msgid "Resource" msgstr "Resurs" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1458,7 +1454,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1512,7 +1509,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1909,6 +1906,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2914,7 +2912,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3153,6 +3151,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3179,13 +3181,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3979,7 +3974,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4120,6 +4115,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4470,7 +4471,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4643,6 +4643,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4849,6 +4851,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5138,20 +5144,23 @@ msgid "Ruler Mode" msgstr "MÄ“roga AttiecÄ«ba:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5241,8 +5250,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5510,6 +5518,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6145,6 +6157,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6201,6 +6217,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6306,6 +6323,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6579,6 +6601,11 @@ msgstr "Izveidot" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6637,10 +6664,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6967,6 +6990,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7000,6 +7027,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7232,6 +7263,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8032,12 +8067,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "FavorÄ«ti:" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8052,6 +8084,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "FavorÄ«ti:" @@ -8924,12 +8960,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9918,11 +9956,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9998,6 +10034,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -10014,10 +10058,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "Izveidot Jaunu %s" @@ -10254,24 +10294,17 @@ msgid "Will load an existing script file." msgstr "IelÄdÄ“t eksistÄ“joÅ¡u Kopnes IzkÄrtojumu." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Savieno SignÄlu:" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -10919,6 +10952,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Noņemt IzvÄ“lÄ“to" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10927,6 +10965,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "FavorÄ«ti:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "FavorÄ«ti:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Noņemt IzvÄ“lÄ“to" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Noņemt IzvÄ“lÄ“to" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10967,10 +11025,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10995,6 +11063,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Savienot" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -11027,6 +11100,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Izveidot Jaunu %s" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11051,16 +11145,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "Funkcijas:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11083,6 +11174,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Funkcijas:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -11177,6 +11277,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11278,6 +11382,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11823,10 +11931,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/mi.po b/editor/translations/mi.po index 9b3110d3de..f78d6f5259 100644 --- a/editor/translations/mi.po +++ b/editor/translations/mi.po @@ -341,6 +341,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -466,15 +467,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -609,7 +601,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -621,6 +613,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -937,7 +933,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1392,7 +1388,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1446,7 +1443,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1830,6 +1827,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2820,7 +2818,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3056,6 +3054,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3082,13 +3084,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3861,7 +3856,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -3996,6 +3991,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4337,7 +4338,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4505,6 +4505,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4709,6 +4711,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -4987,20 +4993,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5090,8 +5099,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5351,6 +5359,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5980,6 +5992,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6036,6 +6052,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6134,6 +6151,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6399,6 +6421,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6456,10 +6483,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6779,6 +6802,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6812,6 +6839,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7038,6 +7069,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7799,11 +7834,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7819,6 +7850,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8675,12 +8710,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9662,11 +9699,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9740,6 +9775,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9756,10 +9799,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -9986,23 +10025,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10636,6 +10667,10 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Delete input port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10644,6 +10679,22 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Add Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10684,10 +10735,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10712,6 +10773,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10744,6 +10809,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10768,15 +10853,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10800,6 +10881,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10894,6 +10983,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -10993,6 +11086,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11530,10 +11627,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/ml.po b/editor/translations/ml.po index 842e96a160..d4b49c12cc 100644 --- a/editor/translations/ml.po +++ b/editor/translations/ml.po @@ -3,12 +3,13 @@ # Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) # This file is distributed under the same license as the Godot source code. # christy james <jkuttu@gmail.com>, 2018. +# Lakshmi-Jayakumar <lakshmi.jayakumar.tkm@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2018-12-13 14:41+0100\n" -"Last-Translator: christy james <jkuttu@gmail.com>\n" +"PO-Revision-Date: 2019-10-17 04:52+0000\n" +"Last-Translator: Lakshmi-Jayakumar <lakshmi.jayakumar.tkm@gmail.com>\n" "Language-Team: Malayalam <https://hosted.weblate.org/projects/godot-engine/" "godot/ml/>\n" "Language: ml\n" @@ -16,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Poedit 2.2\n" +"X-Generator: Weblate 3.9\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -43,7 +44,7 @@ msgstr "à´ªàµà´°à´µàµ¼à´¤àµà´¤à´•നൠചെയàµà´¯à´¾àµ» കൊടàµà´¤à #: core/math/expression.cpp msgid "Invalid index of type %s for base type %s" -msgstr "" +msgstr "à´…à´Ÿà´¿à´¸àµà´¥à´¾à´¨ തരം% sഇനൠഅസാധàµà´µà´¾à´¯ സൂചിക തരം" #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" @@ -349,6 +350,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -474,15 +476,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -617,7 +610,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -629,6 +622,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -945,7 +942,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1400,7 +1397,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1454,7 +1452,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1838,6 +1836,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2828,7 +2827,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3064,6 +3063,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3090,13 +3093,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3869,7 +3865,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4004,6 +4000,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4345,7 +4347,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4513,6 +4514,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4717,6 +4720,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -4995,20 +5002,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5098,8 +5108,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5359,6 +5368,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5988,6 +6001,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6044,6 +6061,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6142,6 +6160,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6407,6 +6430,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6464,10 +6492,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6787,6 +6811,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6820,6 +6848,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7046,6 +7078,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7807,11 +7843,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7827,6 +7859,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8683,12 +8719,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9670,11 +9708,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9748,6 +9784,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9764,10 +9808,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -9994,23 +10034,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10644,6 +10676,10 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Delete input port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10652,6 +10688,22 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Add Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10692,10 +10744,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10720,6 +10782,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10752,6 +10818,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10776,15 +10862,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10808,6 +10890,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10902,6 +10992,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11001,6 +11095,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11538,10 +11636,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/ms.po b/editor/translations/ms.po index 2f28b92d55..74ade07fc8 100644 --- a/editor/translations/ms.po +++ b/editor/translations/ms.po @@ -362,6 +362,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -491,16 +492,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Semua Pilihan" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -636,7 +627,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -648,6 +639,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Semua Pilihan" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -965,7 +961,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1420,7 +1416,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1474,7 +1471,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1859,6 +1856,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2852,7 +2850,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3088,6 +3086,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3114,13 +3116,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3894,7 +3889,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4030,6 +4025,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4375,7 +4376,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4546,6 +4546,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4750,6 +4752,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5033,20 +5039,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5136,8 +5145,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5399,6 +5407,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6028,6 +6040,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6084,6 +6100,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6182,6 +6199,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6447,6 +6469,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6505,10 +6532,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6828,6 +6851,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6861,6 +6888,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7088,6 +7119,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7861,11 +7896,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7881,6 +7912,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8742,12 +8777,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9733,11 +9770,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9812,6 +9847,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9828,10 +9871,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -10058,23 +10097,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10711,6 +10742,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Semua Pilihan" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10719,6 +10755,25 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Set Peralihan ke:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Buang Trek Anim" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Buang Trek Anim" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10759,10 +10814,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10787,6 +10852,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Anim Menduakan Kunci" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10819,6 +10889,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10843,15 +10933,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10875,6 +10961,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10969,6 +11063,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11068,6 +11166,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11605,10 +11707,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/nb.po b/editor/translations/nb.po index 3bc8192461..d7a63a7f8c 100644 --- a/editor/translations/nb.po +++ b/editor/translations/nb.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-29 19:21+0000\n" +"PO-Revision-Date: 2019-10-29 12:49+0000\n" "Last-Translator: Allan Nordhøy <epost@anotheragency.no>\n" "Language-Team: Norwegian BokmÃ¥l <https://hosted.weblate.org/projects/godot-" "engine/godot/nb_NO/>\n" @@ -28,7 +28,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.8-dev\n" +"X-Generator: Weblate 3.9.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -71,32 +71,31 @@ msgstr "NÃ¥r \"%s\" ble anropt:" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Bland" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -131,14 +130,12 @@ msgid "Delete Selected Key(s)" msgstr "Slett valgte nøkler/taster" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Legg til punkt" +msgstr "Legg til Bezier-punkt" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Flytt Punkt" +msgstr "Flytt Bezier-punkt" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -169,24 +166,20 @@ msgid "Anim Change Call" msgstr "Anim Forandre Kall" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Keyframe Time" -msgstr "Anim Endre Nøkkelbildetid" +msgstr "Anim Endre flere Nøkkelbildetider" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transition" -msgstr "Anim Forandre Overgang" +msgstr "Anim Forandre flere Overganger" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transform" -msgstr "Anim Forandre Omforming" +msgstr "Anim Forandre flere Omforminger" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Keyframe Value" -msgstr "Anim Endre Nøkkelbildeverdi" +msgstr "Anim Endre flere Nøkkelbildeverdier" #: editor/animation_track_editor.cpp #, fuzzy @@ -194,9 +187,8 @@ msgid "Anim Multi Change Call" msgstr "Anim Forandre Kall" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Endre Animasjonsnavn:" +msgstr "Endre Animasjonslengde" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -209,7 +201,6 @@ msgid "Property Track" msgstr "Egenskapsspor" #: editor/animation_track_editor.cpp -#, fuzzy msgid "3D Transform Track" msgstr "3D transformasjonsspor" @@ -234,19 +225,16 @@ msgid "Animation Playback Track" msgstr "Stopp avspilling av animasjon. (S)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (frames)" -msgstr "Animasjon lengde (i sekunder)." +msgstr "Animasjon lengde (i rammer)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (seconds)" -msgstr "Animasjon lengde (i sekunder)." +msgstr "Animasjonslengde (sekunder)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track" -msgstr "Anim Legg til Spor" +msgstr "Legg til Spor" #: editor/animation_track_editor.cpp #, fuzzy @@ -392,6 +380,7 @@ msgstr "Lag %d NYE spor og sett inn nøkler?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Lag" @@ -535,16 +524,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Velg Alle" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Kutt Noder" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -687,7 +666,8 @@ msgid "Scale Ratio:" msgstr "Skaler Størrelsesforhold:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Velg spor Ã¥ kopiere:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -699,6 +679,11 @@ msgstr "Velg spor Ã¥ kopiere:" msgid "Copy" msgstr "Lim inn" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Kutt Noder" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -737,8 +722,9 @@ msgid "Replaced %d occurrence(s)." msgstr "Erstattet %d forekomst(er)." #: editor/code_editor.cpp editor/editor_help.cpp +#, fuzzy msgid "%d match." -msgstr "" +msgstr "%d samsvar." #: editor/code_editor.cpp editor/editor_help.cpp #, fuzzy @@ -1041,7 +1027,7 @@ msgid "Resource" msgstr "Ressurs" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Bane" @@ -1395,7 +1381,7 @@ msgstr "Ã…pne Audio Bus oppsett" #: editor/editor_audio_buses.cpp msgid "There is no '%s' file." -msgstr "" +msgstr "Det finnes ingen «%s»-fil" #: editor/editor_audio_buses.cpp editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -1522,7 +1508,8 @@ msgstr "Legg til AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Bane:" @@ -1577,7 +1564,7 @@ msgstr "Lag mappe" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Navn:" @@ -1732,7 +1719,7 @@ msgstr "Egenskaper:" #: editor/editor_feature_profile.cpp msgid "Enabled Features:" -msgstr "" +msgstr "PÃ¥skrudde funksjoner:" #: editor/editor_feature_profile.cpp #, fuzzy @@ -2005,6 +1992,7 @@ msgid "Class:" msgstr "Klasse:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Arver:" @@ -2187,7 +2175,7 @@ msgstr "Start!" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp #, fuzzy @@ -2196,7 +2184,7 @@ msgstr "Last ned" #: editor/editor_network_profiler.cpp msgid "Up" -msgstr "" +msgstr "Oppover" #: editor/editor_network_profiler.cpp editor/editor_node.cpp msgid "Node" @@ -2220,7 +2208,7 @@ msgstr "" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" -msgstr "" +msgstr "Nytt vindu" #: editor/editor_node.cpp msgid "Project export failed with error code %d." @@ -2684,7 +2672,7 @@ msgstr "Lukk Andre Faner" #: editor/editor_node.cpp msgid "Close Tabs to the Right" -msgstr "" +msgstr "Lukk faner til høyre" #: editor/editor_node.cpp #, fuzzy @@ -3124,7 +3112,7 @@ msgstr "Inspektør" msgid "Expand Bottom Panel" msgstr "Utvid alle" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Output" @@ -3379,6 +3367,11 @@ msgstr "" msgid "New Script" msgstr "Nytt Skript" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Kjør Skript" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Ny %s" @@ -3405,14 +3398,6 @@ msgstr "Lim inn" msgid "Convert To %s" msgstr "Konverter Til %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Ã…pne i Redigeringsverktøy" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3482,7 +3467,7 @@ msgstr "Velg Node(r) for Importering" #: editor/editor_sub_scene.cpp editor/project_manager.cpp msgid "Browse" -msgstr "" +msgstr "Utforsk" #: editor/editor_sub_scene.cpp msgid "Scene Path:" @@ -4270,7 +4255,7 @@ msgstr "Plugins" msgid "Subfolder:" msgstr "Undermappe:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "SprÃ¥k:" @@ -4425,6 +4410,13 @@ msgstr "Flytt Punkt" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Ã…pne i Redigeringsverktøy" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4798,7 +4790,6 @@ msgstr "Animasjonsnavn:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Error!" @@ -4979,6 +4970,8 @@ msgid "Current:" msgstr "Gjeldende:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Legg til Input" @@ -5201,6 +5194,10 @@ msgid "All" msgstr "Alle" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importer" @@ -5511,23 +5508,28 @@ msgstr "Velg Modus" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "SlÃ¥ av/pÃ¥ snapping" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Bruk Snap" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "Snapping innstillinger" +msgid "Toggle grid snapping." +msgstr "SlÃ¥ av/pÃ¥ snapping" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "Snap til rutenett" +msgid "Use Grid Snap" +msgstr "Bruk Snap" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "Snapping innstillinger" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5625,8 +5627,8 @@ msgid "View" msgstr "Visning" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Vis Rutenett" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5906,6 +5908,11 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "Hold Shift for Ã¥ endre tangenter individuelt" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Høyreklikk: Fjern Punkt" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Bak GI Probe" @@ -6560,6 +6567,10 @@ msgid "Grid" msgstr "Rutenett" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Vis Rutenett" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "Konfigurer Snap" @@ -6622,6 +6633,7 @@ msgstr "Instans:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Type:" @@ -6736,6 +6748,11 @@ msgid "Find Next" msgstr "Finn neste" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Finn forrige" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Lim inn Noder" @@ -7018,6 +7035,11 @@ msgstr "Slett punkter" msgid "Cut" msgstr "Klipp ut" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Velg Alle" + #: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Delete Line" @@ -7080,10 +7102,6 @@ msgid "Auto Indent" msgstr "Automatisk innrykk" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Finn forrige" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Filtrer Filer..." @@ -7424,6 +7442,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7459,6 +7481,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Bruk Snap" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Bunnvisning" @@ -7694,6 +7720,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8539,12 +8569,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Legg til Input" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "Legg til Input" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8562,6 +8587,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Legg til Input" @@ -9450,12 +9479,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10491,11 +10522,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10577,6 +10606,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Ã…pne Godots nettbaserte dokumentasjon" @@ -10596,11 +10633,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Kjør Skript" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Lag ny %s" @@ -10851,24 +10883,19 @@ msgid "Will load an existing script file." msgstr "Last et eksisterende Bus oppsett." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Klasse:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Fjern Mal" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Kjør Skript" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11539,6 +11566,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Fjern punkt" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11547,6 +11579,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Legg til Input" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Legg til Input" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Fjern punkt" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Fjern punkt" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11592,10 +11644,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Legg til node(r) fra tre" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11623,6 +11685,11 @@ msgstr "Kutt Noder" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Kutt Noder" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Kutt Noder" @@ -11659,6 +11726,27 @@ msgid "Paste VisualScript Nodes" msgstr "Lim inn Noder" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Lag Abonnement" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Fjern Funksjon" @@ -11684,16 +11772,13 @@ msgid "Make Tool:" msgstr "Lag Ben" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Medlemmer:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Tilgjengelige Noder:" +#, fuzzy +msgid "function_name" +msgstr "Funksjoner:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11719,6 +11804,16 @@ msgstr "Kutt Noder" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Fjern Funksjon" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Oppdater" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Medlemmer" @@ -11814,6 +11909,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Velg enhet fra listen" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11916,6 +12015,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12466,11 +12569,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -#, fuzzy -msgid "Input" -msgstr "Legg til Input" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12482,9 +12580,8 @@ msgid "Invalid source for shader." msgstr "Ugyldig fontstørrelse." #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid comparison function for that type." -msgstr "Ugyldig fontstørrelse." +msgstr "Ugyldig sammenligningsfunksjon for den typen." #: servers/visual/shader_language.cpp msgid "Assignment to function." @@ -12502,6 +12599,21 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Konstanter kan ikke endres." +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "Snap til rutenett" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Legg til Input" + +#~ msgid "Available Nodes:" +#~ msgstr "Tilgjengelige Noder:" + +#, fuzzy +#~ msgid "Input" +#~ msgstr "Legg til Input" + #~ msgid "Properties:" #~ msgstr "Egenskaper:" @@ -12656,9 +12768,6 @@ msgstr "Konstanter kan ikke endres." #~ msgid "Go to parent folder" #~ msgstr "GÃ¥ til overnevnt mappe" -#~ msgid "Select device from the list" -#~ msgstr "Velg enhet fra listen" - #, fuzzy #~ msgid "Open Scene(s)" #~ msgstr "Ã…pne Scene" @@ -13045,9 +13154,6 @@ msgstr "Konstanter kan ikke endres." #~ msgid "Move Add Key" #~ msgstr "Flytt Legg-Til-Nøkkel" -#~ msgid "Create Subscription" -#~ msgstr "Lag Abonnement" - #~ msgid "List:" #~ msgstr "Liste:" diff --git a/editor/translations/nl.po b/editor/translations/nl.po index c100b343da..950e7f4573 100644 --- a/editor/translations/nl.po +++ b/editor/translations/nl.po @@ -36,12 +36,13 @@ # Bastiaan van der Plaat <bastiaan.v.d.plaat@gmail.com>, 2019. # Hector Peeters <hector.peeters@gmail.com>, 2019. # Shawn Gyina <gyina.shawn@gmail.com>, 2019. +# ebbe <ebbesteenhoudt@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-08-04 14:23+0000\n" -"Last-Translator: Shawn Gyina <gyina.shawn@gmail.com>\n" +"PO-Revision-Date: 2019-10-18 18:02+0000\n" +"Last-Translator: ebbe <ebbesteenhoudt@gmail.com>\n" "Language-Team: Dutch <https://hosted.weblate.org/projects/godot-engine/godot/" "nl/>\n" "Language: nl\n" @@ -49,7 +50,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.8-dev\n" +"X-Generator: Weblate 3.9.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -93,32 +94,31 @@ msgstr "Tijdens invocatie van '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Mengen" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -391,6 +391,7 @@ msgstr "Maak %d NIEUWE tracks aan en keys invoeren?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Maken" @@ -534,15 +535,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Waarschuwing: Geïmporteerde animatie bewerken" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Alles Selecteren" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Niets Selecteren" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -680,7 +672,8 @@ msgid "Scale Ratio:" msgstr "Schaal Ratio:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Selecteer sporen om te kopieren:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -692,6 +685,11 @@ msgstr "Selecteer sporen om te kopieren:" msgid "Copy" msgstr "Kopiëren" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Niets Selecteren" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Voeg audiospoor clip toe" @@ -867,9 +865,8 @@ msgid "Disconnects the signal after its first emission." msgstr "" #: editor/connections_dialog.cpp -#, fuzzy msgid "Cannot connect signal" -msgstr "Verbind met Signaal: " +msgstr "Kan signaal niet verbinden" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/export_template_manager.cpp editor/groups_editor.cpp @@ -891,9 +888,8 @@ msgid "Connect" msgstr "Verbinden" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Signalen:" +msgstr "Signaal:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -917,9 +913,8 @@ msgid "Disconnect" msgstr "Losmaken" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect a Signal to a Method" -msgstr "Verbind met Signaal: " +msgstr "Verbind een Signaal met een Methode" #: editor/connections_dialog.cpp #, fuzzy @@ -1029,7 +1024,7 @@ msgid "Resource" msgstr "Bron" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Pad" @@ -1507,7 +1502,8 @@ msgstr "AutoLoad Toevoegen" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Pad:" @@ -1562,7 +1558,7 @@ msgstr "Map Maken" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Naam:" @@ -1980,6 +1976,7 @@ msgid "Class:" msgstr "Klasse:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Erft:" @@ -3086,7 +3083,7 @@ msgstr "Inspecteur" msgid "Expand Bottom Panel" msgstr "Vergroot onderste paneel" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Output" @@ -3335,6 +3332,11 @@ msgstr "Kies een Aanzicht portaal" msgid "New Script" msgstr "Nieuw Script" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Omschrijving:" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nieuw %s" @@ -3361,13 +3363,6 @@ msgstr "Plakken" msgid "Convert To %s" msgstr "Omzetten naar %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Editor Openen" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Geselecteerde knoop is geen Viewport!" @@ -4180,7 +4175,7 @@ msgstr "Pluginnaam:" msgid "Subfolder:" msgstr "Submap:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Taal:" @@ -4328,6 +4323,12 @@ msgstr "Punt" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Editor Openen" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Animatieknoop openen" @@ -4696,7 +4697,6 @@ msgstr "Animatie Naam:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Foutmelding!" @@ -4875,6 +4875,8 @@ msgid "Current:" msgstr "Huidig:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Voeg invoer toe" @@ -5087,6 +5089,10 @@ msgid "All" msgstr "Alle" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importeren" @@ -5401,22 +5407,28 @@ msgid "Ruler Mode" msgstr "Uitvoermodus:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Automatisch schikken omschakelen." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Gebruik Uitlijnen" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opties voor automatisch schikken" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Automatisch schikken omschakelen." #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "Uitlijnen op raster" +msgid "Use Grid Snap" +msgstr "Rooster Snap" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Opties voor automatisch schikken" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5517,8 +5529,8 @@ msgid "View" msgstr "Weergeven" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Raster Weergeven" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5803,6 +5815,11 @@ msgstr "Schakel Curve Lineaire Raaklijn" msgid "Hold Shift to edit tangents individually" msgstr "Houd Shift ingedrukt om de raaklijnen individueel te bewerken" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Rechter Klik: Verwijder Punt" + #: editor/plugins/gi_probe_editor_plugin.cpp #, fuzzy msgid "Bake GI Probe" @@ -6471,6 +6488,10 @@ msgid "Grid" msgstr "Grid" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Raster Weergeven" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "Configureer Snap" @@ -6533,6 +6554,7 @@ msgstr "Instantie:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Type:" @@ -6643,6 +6665,11 @@ msgid "Find Next" msgstr "Vind Volgende" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Vind Vorige" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Filter eigenschappen" @@ -6930,6 +6957,11 @@ msgstr "Punten aanmaken." msgid "Cut" msgstr "Knippen" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Alles Selecteren" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Verwijder Regel" @@ -6990,10 +7022,6 @@ msgid "Auto Indent" msgstr "Auto Indentatie" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Vind Vorige" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Bestanden Filteren..." @@ -7339,6 +7367,11 @@ msgid "Freelook Speed Modifier" msgstr "Vrijekijk Snelheid Modificator" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Vrijekijk Snelheid Modificator" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7382,6 +7415,10 @@ msgid "Use Local Space" msgstr "Lokale Ruimtemodus (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Gebruik Uitlijnen" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Onderaanzicht" @@ -7626,6 +7663,11 @@ msgid "Simplification: " msgstr "Simplificatie: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Vergroot (Pixels): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Vergroot (Pixels): " @@ -8481,12 +8523,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Voeg invoer toe" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "Voeg invoer toe" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8504,6 +8541,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Voeg invoer toe" @@ -9412,15 +9453,19 @@ msgid "Resources to export:" msgstr "Bronnen te exporteren:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filters voor het exporteren van bestanden dat geen bron zijn (scheiden met " "een komma, bijv.: *.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filters voor het uitsluiten van bestanden van het project (scheiden met een " "komma, bijv.: *.json, *.txt)" @@ -10522,11 +10567,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10609,6 +10652,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Open Godot online documentatie" @@ -10629,11 +10680,6 @@ msgstr "Verander Type" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Omschrijving:" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Voeg nieuwe knooppunt aan" @@ -10890,23 +10936,18 @@ msgid "Will load an existing script file." msgstr "Laad bestaand script" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Taal" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Erft" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Klasse Naam" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Sjabloon" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Ingebouwd Script" #: editor/script_create_dialog.cpp @@ -11585,6 +11626,11 @@ msgid "Add Function" msgstr "Functie Toevoegen" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Punt verwijderen" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Variabele Toevoegen" @@ -11593,6 +11639,26 @@ msgid "Add Signal" msgstr "Signaal Toevoegen" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Voeg invoer toe" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Voeg invoer toe" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Punt verwijderen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Punt verwijderen" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Verander Expressie" @@ -11643,10 +11709,20 @@ msgid "Add Preload Node" msgstr "Preload Node Toevoegen" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Voeg Node(s) Toe Uit Tree" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Getter Property Toevoegen" @@ -11676,6 +11752,11 @@ msgstr "Verbind Aan Node:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Ontkoppel Graaf Knooppunten" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Verbind Aan Node:" @@ -11712,6 +11793,27 @@ msgid "Paste VisualScript Nodes" msgstr "Plak Nodes" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Hernoem Functie" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Verwijder Functie" @@ -11737,16 +11839,13 @@ msgid "Make Tool:" msgstr "Maak Botten" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Basis Type:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Leden:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Beschikbare Nodes:" +#, fuzzy +msgid "function_name" +msgstr "Functies:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11771,6 +11870,16 @@ msgstr "Knip Nodes" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Hernoem Functie" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Verversen" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Leden" @@ -11869,6 +11978,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Selecteer apparaat uit de lijst" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11971,6 +12084,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12601,10 +12718,6 @@ msgstr "" "hebt zijn inhoud direct op het scherm te weergeven. Anders, maak er een " "RenderTarget van en wijs zijn interne texture toe aan een node om te tonen." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Invoer" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12635,6 +12748,29 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "Uitlijnen op raster" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Voeg invoer toe" + +#~ msgid "Language" +#~ msgstr "Taal" + +#~ msgid "Inherits" +#~ msgstr "Erft" + +#~ msgid "Base Type:" +#~ msgstr "Basis Type:" + +#~ msgid "Available Nodes:" +#~ msgstr "Beschikbare Nodes:" + +#~ msgid "Input" +#~ msgstr "Invoer" + #~ msgid "Properties:" #~ msgstr "Eigenschappen:" @@ -12839,9 +12975,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "Ga naar bovenliggende folder" -#~ msgid "Select device from the list" -#~ msgstr "Selecteer apparaat uit de lijst" - #~ msgid "Open Scene(s)" #~ msgstr "Scene(s) Openen" @@ -13122,9 +13255,6 @@ msgstr "" #~ msgid "Connect Graph Nodes" #~ msgstr "Verbind Graaf Knooppunten" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Ontkoppel Graaf Knooppunten" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Verwijder Shader Graaf Knooppunten" diff --git a/editor/translations/or.po b/editor/translations/or.po index 1dc9df2f8d..19fbf71453 100644 --- a/editor/translations/or.po +++ b/editor/translations/or.po @@ -347,6 +347,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -472,15 +473,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -615,7 +607,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -627,6 +619,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -943,7 +939,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1398,7 +1394,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1452,7 +1449,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1836,6 +1833,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2826,7 +2824,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3062,6 +3060,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3088,13 +3090,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3867,7 +3862,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4002,6 +3997,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4343,7 +4344,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4511,6 +4511,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4715,6 +4717,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -4993,20 +4999,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5096,8 +5105,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5357,6 +5365,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5986,6 +5998,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6042,6 +6058,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6140,6 +6157,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6405,6 +6427,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6462,10 +6489,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6785,6 +6808,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6818,6 +6845,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7044,6 +7075,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7805,11 +7840,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7825,6 +7856,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8681,12 +8716,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9668,11 +9705,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9746,6 +9781,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9762,10 +9805,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -9992,23 +10031,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10642,6 +10673,10 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Delete input port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10650,6 +10685,22 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Add Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10690,10 +10741,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10718,6 +10779,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10750,6 +10815,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10774,15 +10859,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10806,6 +10887,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10900,6 +10989,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -10999,6 +11092,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11536,10 +11633,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/pl.po b/editor/translations/pl.po index da1b230208..cd7c033cb0 100644 --- a/editor/translations/pl.po +++ b/editor/translations/pl.po @@ -36,11 +36,12 @@ # Artur MaciÄ…g <arturmaciag@gmail.com>, 2019. # RafaÅ‚ Wyszomirski <rawyszo@gmail.com>, 2019. # Myver <igormakarowicz@gmail.com>, 2019. +# Maciej Chamera <chameramaciej@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-19 05:27+0000\n" +"PO-Revision-Date: 2019-10-29 12:49+0000\n" "Last-Translator: Tomek <kobewi4e@gmail.com>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/" "godot/pl/>\n" @@ -50,7 +51,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 3.9-dev\n" +"X-Generator: Weblate 3.9.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -95,32 +96,31 @@ msgstr "Przy wywoÅ‚aniu \"%s\":" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Miks" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -386,6 +386,7 @@ msgstr "Utworzyć %d NOWYCH Å›cieżek i wstawić klucze?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Utwórz" @@ -527,20 +528,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Ostrzeżenie: Edytowanie importowanej animacji" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Zaznacz wszystko" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Wybierz wÄ™zeÅ‚" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "" -"Åšcieżka do wÄ™zÅ‚a AnimationPlayer zawierajÄ…cego animacje nie jest ustawiona." +msgstr "Wybierz wÄ™zeÅ‚ AnimationPlayer, by tworzyć i edytować animacje." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -672,7 +662,8 @@ msgid "Scale Ratio:" msgstr "Współczynnik skali:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Wybierz Å›cieżki do skopiowania:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -684,6 +675,11 @@ msgstr "Wybierz Å›cieżki do skopiowania:" msgid "Copy" msgstr "Kopiuj" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Wybierz wÄ™zeÅ‚" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Dodaj klip Å›cieżki audio" @@ -1007,7 +1003,7 @@ msgid "Resource" msgstr "Zasoby" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Åšcieżka" @@ -1276,9 +1272,8 @@ msgid "Delete Bus Effect" msgstr "UsuÅ„ efekt magistrali" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Magistrala audio, przeciÄ…gnij i upuść by przemieÅ›cić." +msgstr "PrzeciÄ…gnij i upuść, by zmienić kolejność." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1469,7 +1464,8 @@ msgstr "Dodaj AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Åšcieżka:" @@ -1523,7 +1519,7 @@ msgstr "Utwórz katalog" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nazwa:" @@ -1916,6 +1912,7 @@ msgid "Class:" msgstr "Klasa:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Dziedziczy:" @@ -1924,9 +1921,8 @@ msgid "Inherited by:" msgstr "Dziedziczone przez:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Krótki opis:" +msgstr "Krótki opis" #: editor/editor_help.cpp msgid "Properties" @@ -1957,9 +1953,8 @@ msgid "Class Description" msgstr "Opis klasy" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Poradniki online:" +msgstr "Poradniki online" #: editor/editor_help.cpp msgid "" @@ -2082,7 +2077,7 @@ msgstr "Start" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2098,19 +2093,19 @@ msgstr "WÄ™zeÅ‚" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "PrzychodzÄ…ce RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "PrzychodzÄ…ce RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "WychodzÄ…ce RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "WychodzÄ…ce RSET" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2698,17 +2693,16 @@ msgid "Project Settings..." msgstr "Ustawienia projektu..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Wersja:" +msgstr "Kontrola wersji" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Ustaw kontrolÄ™ wersji" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Wyłącz kontrolÄ™ wersji" #: editor/editor_node.cpp msgid "Export..." @@ -2978,7 +2972,7 @@ msgstr "Inspektor" msgid "Expand Bottom Panel" msgstr "RozwiÅ„ panel dolny" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Konsola" @@ -3004,17 +2998,24 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Ta opcja przygotuje twój projekt dla wÅ‚asnych buildów Androida, instalujÄ…c " +"źródÅ‚owy szablon w \"res://android/build\".\n" +"Możesz wtedy dodać modyfikacje i zbudować podczas eksportu wÅ‚asny pakiet APK " +"(dodajÄ…c moduÅ‚y, zmieniajÄ…c AndroidManifest.xml itp.)\n" +"PamiÄ™taj, że aby stworzyć wÅ‚asny build zamiast używać gotowego APK, opcja " +"\"Use Custom Build\" powinna być włączona w profilu eksportu Androida." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" "Remove the \"res://android/build\" directory manually before attempting this " "operation again." msgstr "" -"Szablon budowania Androida jest już zainstalowany i nie bÄ™dzie nadpisany.\n" -"UsuÅ„ rÄ™cznie folder \"build\" przed spróbowaniem tej operacji ponownie." +"Szablon budowania Androida jest już zainstalowany w tym projekcie i nie " +"zostanie on nadpisany.\n" +"UsuÅ„ rÄ™cznie folder \"res://android/build\" przed spróbowaniem tej operacji " +"ponownie." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3077,9 +3078,8 @@ msgid "Open the previous Editor" msgstr "Otwórz poprzedni edytor" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Nie ustawiono źródÅ‚a pÅ‚aszczyzny." +msgstr "Nie znaleziono podzasobów." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3090,9 +3090,8 @@ msgid "Thumbnail..." msgstr "Miniatura..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Otwórz skrypt:" +msgstr "Skrypt główny:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3227,6 +3226,10 @@ msgstr "Wybierz Viewport" msgid "New Script" msgstr "Nowy skrypt" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Rozszerz skrypt" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nowy %s" @@ -3253,13 +3256,6 @@ msgstr "Wklej" msgid "Convert To %s" msgstr "Konwersja do %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Otwórz edytor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Wybrany wÄ™zeÅ‚ to nie Viewport!" @@ -3924,9 +3920,8 @@ msgid "Import As:" msgstr "Importuj jako:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "Profile eksportu" +msgstr "Profil" #: editor/import_dock.cpp msgid "Reimport" @@ -4052,7 +4047,7 @@ msgstr "Nazwa wtyczki:" msgid "Subfolder:" msgstr "Podfolder:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "JÄ™zyk:" @@ -4194,6 +4189,12 @@ msgstr "Punkt" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Otwórz edytor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Otwórz wÄ™zeÅ‚ animacji" @@ -4541,7 +4542,6 @@ msgstr "Nazwa animacji:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Błąd!" @@ -4714,6 +4714,8 @@ msgid "Current:" msgstr "Bieżący:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Dodaj WejÅ›cie" @@ -4920,6 +4922,10 @@ msgid "All" msgstr "Wszystko" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Importuj..." @@ -5212,28 +5218,34 @@ msgid "Pan Mode" msgstr "Tryb przesuwania" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Tryb uruchamiania:" +msgstr "Tryb linijki" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Przełącz przyciÄ…ganie." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Użyj przyciÄ…gania" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opcje przyciÄ…gania" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Przełącz przyciÄ…ganie." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +#, fuzzy +msgid "Use Grid Snap" msgstr "PrzyciÄ…gaj do siatki" #: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Opcje przyciÄ…gania" + +#: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" msgstr "Użyj kroków obrotu" @@ -5320,8 +5332,8 @@ msgid "View" msgstr "Widok" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Pokaż siatkÄ™" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5588,6 +5600,11 @@ msgstr "Przełącz stycznÄ… liniowÄ… krzywej" msgid "Hold Shift to edit tangents individually" msgstr "Przytrzymaj Shift aby edytować styczne indywidualnie" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Prawy Klik: UsuÅ„ Punkt" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Wypal sondÄ™ GI" @@ -6223,6 +6240,10 @@ msgid "Grid" msgstr "Siatka" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Pokaż siatkÄ™" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Konfiguruj siatkÄ™:" @@ -6279,6 +6300,7 @@ msgstr "Instancja:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Typ:" @@ -6377,6 +6399,11 @@ msgid "Find Next" msgstr "Znajdź nastÄ™pny" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Znajdź poprzedni" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Filtruj skrypty" @@ -6646,6 +6673,11 @@ msgstr "Punkty wstrzymania" msgid "Cut" msgstr "Wytnij" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Zaznacz wszystko" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "UsuÅ„ wiersz" @@ -6703,10 +6735,6 @@ msgid "Auto Indent" msgstr "Automatyczne wciÄ™cie" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Znajdź poprzedni" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Znajdź w plikach..." @@ -6841,7 +6869,7 @@ msgstr "Skalowanie: " #: editor/plugins/spatial_editor_plugin.cpp msgid "Translating: " -msgstr "TÅ‚umaczenie: " +msgstr "Przesuwanie: " #: editor/plugins/spatial_editor_plugin.cpp msgid "Rotating %s degrees." @@ -7028,6 +7056,11 @@ msgid "Freelook Speed Modifier" msgstr "Zmiennik prÄ™dkoÅ›ci \"Wolnego widoku\"" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Zmiennik prÄ™dkoÅ›ci \"Wolnego widoku\"" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7066,6 +7099,10 @@ msgid "Use Local Space" msgstr "Użyj przestrzeni lokalnej" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Użyj przyciÄ…gania" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Widok z doÅ‚u" @@ -7293,6 +7330,11 @@ msgid "Simplification: " msgstr "Uproszczenie: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Wzrost (piksele): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Wzrost (piksele): " @@ -7341,9 +7383,8 @@ msgid "(empty)" msgstr "(pusty)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Wklej klatkÄ™" +msgstr "PrzesuÅ„ klatkÄ™" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7660,13 +7701,13 @@ msgid "Enable Priority" msgstr "Włącz priorytety" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Filtrowanie plików..." +msgstr "Filtruj kafelki" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." msgstr "" +"Przypisz temu wÄ™zÅ‚owi TileMap zasób TileSet, aby korzystać z jego kafelków." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7804,6 +7845,8 @@ msgstr "Pokaż nazwy kafelków (przytrzymaj Alt)" msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Dodaj lub wybierz teksturÄ™ na lewym panelu, aby edytować przywiÄ…zane do niej " +"kafelki." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -7977,92 +8020,80 @@ msgid "TileSet" msgstr "TileSet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Nazwa rodzica wÄ™zÅ‚a, jeÅ›li dostÄ™pna" +msgstr "Brak dostÄ™pnych dodatków VCS." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Błąd" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "Nie podano nazwy" +msgstr "Nie podano wiadomoÅ›ci commitu" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "Brak plików dodanych do stage'a" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "SpoÅ‚eczność" +msgstr "Commit" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "Dodatek VCS nie jest zainicjowany" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "System Kontroli Wersji (VCS)" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Wielkie litery na poczÄ…tku słów" +msgstr "Inicjuj" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "Obszar stage'a" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Utwórz nowy prostokÄ…t." +msgstr "Wykryj nowe zmiany" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "ZmieÅ„" +msgstr "Zmiany" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Zmodyfikowany" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "ZmieÅ„ nazwÄ™" +msgstr "Przemianowany" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "UsuÅ„" +msgstr "UsuniÄ™ty" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "ZmieÅ„" +msgstr "Zmiana typu" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "UsuÅ„ zaznaczone" +msgstr "Stage'uj zaznaczone" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Zapisz wszystko" +msgstr "Stage'uj wszystko" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Dodaj wiadomość comittu" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Synchronizuj zmiany skryptów" +msgstr "Commituj zmiany" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8071,27 +8102,23 @@ msgstr "Status" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" -msgstr "" +msgstr "Zobacz różnice przed commitowaniem do najnowszej wersji" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No file diff is active" -msgstr "Nie wybrano pliku!" +msgstr "Brak aktywnego różnicowania plików (diff)" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "Wykryj zmiany w różnicach plików" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(Tylko GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Dodaj wejÅ›cie+" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Dodaj wyjÅ›cie+" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8107,6 +8134,11 @@ msgid "Boolean" msgstr "Prawda/faÅ‚sz" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "Sample" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Dodaj port wejÅ›ciowy" @@ -8318,11 +8350,10 @@ msgstr "" "faÅ‚szywa." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" -"Zwraca powiÄ…zany wektor, jeÅ›li podana wartość boolowska jest prawdziwa albo " +"Zwraca powiÄ…zany skalar, jeÅ›li podana wartość boolowska jest prawdziwa albo " "faÅ‚szywa." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9039,15 +9070,19 @@ msgid "Resources to export:" msgstr "Zasoby do eksportu:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtry do eksportowania plików nie bÄ™dÄ…cych zasobami (oddzielone " "przecinkami, np. *.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtry do wykluczenia plików z projektu (rozdzielone przecinkami, np. *." "json, *.txt)" @@ -9645,9 +9680,8 @@ msgid "Settings saved OK." msgstr "Ustawienia zapisane pomyÅ›lnie." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Dodaj zdarzenie akcji wejÅ›cia" +msgstr "PrzesuÅ„ zdarzenie akcji wejÅ›cia" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -10014,9 +10048,8 @@ msgid "Instance Scene(s)" msgstr "Dodaj instancjÄ™ sceny" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Zapisz gałąź jako scenÄ™" +msgstr "PodmieÅ„ na gałąź sceny" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10061,23 +10094,20 @@ msgid "Make node as Root" msgstr "ZmieÅ„ wÄ™zeÅ‚ na KorzeÅ„" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "UsuÅ„ wÄ™zÅ‚y" +msgstr "Usunąć %d wÄ™złów?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "UsuÅ„ wÄ™zeÅ‚(y) Shader Graph" +msgstr "Usunąć korzeÅ„ \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "Usunąć wÄ™zeÅ‚ \"%s\" oraz jego wÄ™zÅ‚y potomne?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "UsuÅ„ wÄ™zÅ‚y" +msgstr "Usunąć wÄ™zeÅ‚ \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10100,12 +10130,13 @@ msgstr "" "zostanÄ… przywrócone do domyÅ›lnych." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Edytowalne dzieci" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Wczytaj jako zastÄ™pczy" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Wyłączenie \"edytowalnej instancji\" sprawi, że wszystkie wÅ‚aÅ›ciwoÅ›ci wÄ™zÅ‚a " +"zostanÄ… przywrócone do domyÅ›lnych." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10180,6 +10211,14 @@ msgid "Clear Inheritance" msgstr "Wyczyść dziedziczenie" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Edytowalne dzieci" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Wczytaj jako zastÄ™pczy" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Otwórz dokumentacjÄ™" @@ -10196,10 +10235,6 @@ msgid "Change Type" msgstr "ZmieÅ„ typ" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Rozszerz skrypt" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "ZmieÅ„ nadrzÄ™dny wÄ™zeÅ‚" @@ -10440,23 +10475,18 @@ msgid "Will load an existing script file." msgstr "Wczytaj istniejÄ…cy plik skryptu." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "JÄ™zyk" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Dziedziczy" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Nazwa klasy" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Szablon" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Wbudowany skrypt" #: editor/script_create_dialog.cpp @@ -10472,38 +10502,32 @@ msgid "Bytes:" msgstr "Bajty:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "Ostrzeżenia:" +msgstr "Ostrzeżenie:" #: editor/script_editor_debugger.cpp msgid "Error:" msgstr "Błąd:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Kopiuj błąd" +msgstr "Błąd C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Błąd:" +msgstr "Błąd C++:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "ŹródÅ‚o" +msgstr "ŹródÅ‚o C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "ŹródÅ‚o" +msgstr "ŹródÅ‚o:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "ŹródÅ‚o" +msgstr "ŹródÅ‚o C++:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10514,18 +10538,16 @@ msgid "Errors" msgstr "Błędy" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Połączono z procesem potomnym" +msgstr "Połączono z procesem potomnym." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Kopiuj błąd" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Punkty wstrzymania" +msgstr "PomiÅ„ punkty wstrzymania" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10544,9 +10566,8 @@ msgid "Profiler" msgstr "Profiler" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Eksportuj profil" +msgstr "Profiler sieci" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10770,7 +10791,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Oczekiwano ciÄ…gu znaków o dÅ‚ugoÅ›ci 1 (znaku)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10926,13 +10947,13 @@ msgid "Pick Distance:" msgstr "Wybierz odlegÅ‚ość:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Filtruj metody" +msgstr "Filtruj siatki" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." msgstr "" +"Przypisz temu wÄ™zÅ‚owi GridMap zasób MeshLibrary, aby korzystać z jego siatek." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11107,6 +11128,11 @@ msgid "Add Function" msgstr "Dodaj funkcjÄ™" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "UsuÅ„ port wejÅ›ciowy" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Dodaj zmiennÄ…" @@ -11115,6 +11141,26 @@ msgid "Add Signal" msgstr "Dodaj sygnaÅ‚" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Dodaj port wejÅ›ciowy" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Dodaj port wyjÅ›ciowy" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "UsuÅ„ port wejÅ›ciowy" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "UsuÅ„ port wyjÅ›ciowy" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "ZmieÅ„ wyrażenie" @@ -11159,10 +11205,20 @@ msgid "Add Preload Node" msgstr "Dodaj wstÄ™pnie wczytany wÄ™zeÅ‚" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Dodaj wÄ™zeÅ‚(y) z drzewa" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Dodaj wÅ‚aÅ›ciwość Gettera" @@ -11187,6 +11243,11 @@ msgid "Connect Nodes" msgstr "Podłącz wÄ™zÅ‚y" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Odłącz wÄ™zÅ‚y grafu" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Połącz dane wÄ™zÅ‚a" @@ -11219,6 +11280,28 @@ msgid "Paste VisualScript Nodes" msgstr "Wklej wÄ™zeÅ‚ VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Nie można skopiować wÄ™zÅ‚a funkcji." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "ZmieÅ„ nazwÄ™ funkcji" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "UsuÅ„ funkcjÄ™" @@ -11239,21 +11322,17 @@ msgid "Editing Signal:" msgstr "Edytuj sygnaÅ‚:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "UczyÅ„ lokalnym" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Typ bazowy:" +msgstr "Aktywny w edytorze:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "CzÅ‚onkowie:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "DostÄ™pne wÄ™zÅ‚y:" +#, fuzzy +msgid "function_name" +msgstr "Funkcja:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11276,6 +11355,16 @@ msgid "Cut Nodes" msgstr "Wytnij WÄ™zÅ‚y" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "ZmieÅ„ nazwÄ™ funkcji" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "OdÅ›wież" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Edytuj czÅ‚onka" @@ -11373,6 +11462,10 @@ msgid "The package must have at least one '.' separator." msgstr "Paczka musi mieć co najmniej jednÄ… kropkÄ™ jako separator." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Wybierz urzÄ…dzenie z listy" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "Plik wykonywalny ADB nie skonfigurowany w Ustawieniach Edytora." @@ -11398,13 +11491,12 @@ msgstr "" "Edytora." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"Projekt Androida nie jest zainstalowany do kompilacji. Zainstaluj z menu " -"Edytor." +"Szablon budowania Androida nie jest zainstalowany dla projektu. Zainstaluj " +"go z menu Projekt." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11489,6 +11581,10 @@ msgid "Required icon is not specified in the preset." msgstr "Wymagana ikona nie jest podana w profilu eksportu." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Uruchom w przeglÄ…darce" @@ -12157,10 +12253,6 @@ msgstr "" "otrzymaÅ‚ jakiÅ› rozmiar. W przeciwnym wypadku ustawi opcjÄ™ RenderTarget i " "przyporzÄ…dkuj jego teksturÄ™ dla któregoÅ› wÄ™zÅ‚a." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "WejÅ›cie" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "NieprawidÅ‚owe źródÅ‚o do podglÄ…du." @@ -12189,6 +12281,27 @@ msgstr "Varying może być przypisane tylko w funkcji wierzchoÅ‚ków." msgid "Constants cannot be modified." msgstr "StaÅ‚e nie mogÄ… być modyfikowane." +#~ msgid "Snap to Grid" +#~ msgstr "PrzyciÄ…gaj do siatki" + +#~ msgid "Add input +" +#~ msgstr "Dodaj wejÅ›cie+" + +#~ msgid "Language" +#~ msgstr "JÄ™zyk" + +#~ msgid "Inherits" +#~ msgstr "Dziedziczy" + +#~ msgid "Base Type:" +#~ msgstr "Typ bazowy:" + +#~ msgid "Available Nodes:" +#~ msgstr "DostÄ™pne wÄ™zÅ‚y:" + +#~ msgid "Input" +#~ msgstr "WejÅ›cie" + #~ msgid "Properties:" #~ msgstr "WÅ‚aÅ›ciwoÅ›ci:" @@ -12443,9 +12556,6 @@ msgstr "StaÅ‚e nie mogÄ… być modyfikowane." #~ msgid "Go to parent folder" #~ msgstr "Przejdź folder wyżej" -#~ msgid "Select device from the list" -#~ msgstr "Wybierz urzÄ…dzenie z listy" - #~ msgid "Open Scene(s)" #~ msgstr "Otwórz scenÄ™/y" @@ -12687,9 +12797,6 @@ msgstr "StaÅ‚e nie mogÄ… być modyfikowane." #~ msgid "Warning" #~ msgstr "Ostrzeżenie" -#~ msgid "Function:" -#~ msgstr "Funkcja:" - #~ msgid "Variable" #~ msgstr "Zmienna" @@ -12744,9 +12851,6 @@ msgstr "StaÅ‚e nie mogÄ… być modyfikowane." #~ msgid "Connect Graph Nodes" #~ msgstr "Połącz wÄ™zÅ‚y grafu" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Odłącz wÄ™zÅ‚y grafu" - #~ msgid "Remove Shader Graph Node" #~ msgstr "UsuÅ„ wÄ™zeÅ‚ Shader Graph" @@ -13762,9 +13866,6 @@ msgstr "StaÅ‚e nie mogÄ… być modyfikowane." #~ msgid "Group" #~ msgstr "Grupa" -#~ msgid "Samples" -#~ msgstr "Sample" - #~ msgid "Compress (RAM - IMA-ADPCM)" #~ msgstr "Kompresja (RAM - IMA-ADPCM)" diff --git a/editor/translations/pr.po b/editor/translations/pr.po index bbfdbb9aba..7f3761e68d 100644 --- a/editor/translations/pr.po +++ b/editor/translations/pr.po @@ -374,6 +374,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -503,16 +504,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Slit th' Node" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -648,7 +639,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -660,6 +651,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Slit th' Node" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -985,7 +981,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1445,7 +1441,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1499,7 +1496,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1903,6 +1900,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2913,7 +2911,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3156,6 +3154,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3182,14 +3184,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Edit" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3991,7 +3985,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4134,6 +4128,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Edit" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4491,7 +4492,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4663,6 +4663,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4867,6 +4869,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5161,20 +5167,24 @@ msgstr "Slit th' Node" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "Toggle ye Breakpoint" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Toggle ye Breakpoint" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5266,8 +5276,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5533,6 +5542,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6174,6 +6187,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6230,6 +6247,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6333,6 +6351,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Paste yer Node" @@ -6608,6 +6631,11 @@ msgstr "Yar, Blow th' Selected Down!" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Delete Line" @@ -6668,10 +6696,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Find ye Node Type" @@ -7002,6 +7026,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7035,6 +7063,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7268,6 +7300,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8086,14 +8122,10 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" +msgid "Add Output" msgstr "Add Signal" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" msgstr "" @@ -8106,6 +8138,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Add Signal" @@ -8978,12 +9014,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9981,11 +10019,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10060,6 +10096,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Yer functions:" @@ -10077,10 +10121,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "Yar, Blow th' Selected Down!" @@ -10322,25 +10362,18 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" +msgid "Template:" msgstr "Discharge ye' Variable" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Edit" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11006,6 +11039,11 @@ msgid "Add Function" msgstr "Add Function" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Discharge ye' Signal" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Add Variable" @@ -11014,6 +11052,26 @@ msgid "Add Signal" msgstr "Add Signal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Add Signal" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Add Signal" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Discharge ye' Signal" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Discharge ye' Signal" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Swap yer Expression" @@ -11062,10 +11120,20 @@ msgid "Add Preload Node" msgstr "Add yer Preload Node" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Add Node(s) From yer Tree" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Add yer Getter Property" @@ -11095,6 +11163,11 @@ msgstr "Slit th' Node" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Slit th' Node" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Slit th' Node" @@ -11129,6 +11202,27 @@ msgid "Paste VisualScript Nodes" msgstr "Paste yer Node" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Rename Function" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Discharge ye' Function" @@ -11153,16 +11247,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "th' Base Type:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "th' Members:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "yer Nodes doing nothin':" +#, fuzzy +msgid "function_name" +msgstr "Yer functions:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11187,6 +11278,15 @@ msgstr "Slit th' Node" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Rename Function" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "th' Members:" @@ -11284,6 +11384,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11386,6 +11490,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11926,10 +12034,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -11961,6 +12065,12 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Base Type:" +#~ msgstr "th' Base Type:" + +#~ msgid "Available Nodes:" +#~ msgstr "yer Nodes doing nothin':" + #, fuzzy #~ msgid "Theme Properties:" #~ msgstr "Paste yer Node" diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po index 487cb8b4e8..ee6244fb84 100644 --- a/editor/translations/pt_BR.po +++ b/editor/translations/pt_BR.po @@ -69,12 +69,14 @@ # Fupi Brazil <fupicat@gmail.com>, 2019. # Julio Pinto Coelho <juliopcrj@gmail.com>, 2019. # Perrottacooking <perrottacooking@gmail.com>, 2019. +# Wow Bitch <hahaj@itmailr.com>, 2019. +# Alan Tavares <alan1tavares@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: 2016-05-30\n" -"PO-Revision-Date: 2019-09-26 11:50+0000\n" -"Last-Translator: Perrottacooking <perrottacooking@gmail.com>\n" +"PO-Revision-Date: 2019-10-11 15:07+0000\n" +"Last-Translator: Alan Tavares <alan1tavares@gmail.com>\n" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_BR/>\n" "Language: pt_BR\n" @@ -101,7 +103,7 @@ msgstr "Entrada inválida %i (não passou) na expressão" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" -msgstr "self não pode ser usado porque a instancia é nul0o (não passou)" +msgstr "self não pode ser usado porque a instancia é nula (não passou)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." @@ -125,32 +127,31 @@ msgstr "Na chamada para '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Misturar" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -418,6 +419,7 @@ msgstr "Criar %d NOVAS trilhas e inserir chaves?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Criar" @@ -560,20 +562,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Aviso: Editando animação importada" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Selecionar Tudo" - #: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Remover Seleção" - -#: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "" -"O caminho para um nó do AnimationPlayer contendo animações não está definido." +msgstr "Selecione um nó do tipo AnimationPlayer para criar e editar animações." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -705,7 +696,8 @@ msgid "Scale Ratio:" msgstr "Razão de Escala:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Selecionar trilhas para copiar:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -717,6 +709,11 @@ msgstr "Selecionar trilhas para copiar:" msgid "Copy" msgstr "Copiar" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Remover Seleção" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Adiciona Clipe de Trilha de Ãudio" @@ -1042,7 +1039,7 @@ msgid "Resource" msgstr "Recurso" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Caminho" @@ -1312,9 +1309,8 @@ msgid "Delete Bus Effect" msgstr "Excluir Efeito de Canal" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Pista de Ãudio, arraste e solte para reorganizar." +msgstr "Arrastar e soltar para reorganizar." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1505,7 +1501,8 @@ msgstr "Adicionar Autoload" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Caminho:" @@ -1559,7 +1556,7 @@ msgstr "Criar Pasta" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nome:" @@ -1954,6 +1951,7 @@ msgid "Class:" msgstr "Classe:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Herda de:" @@ -1962,9 +1960,8 @@ msgid "Inherited by:" msgstr "Herdado por:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Descrição breve:" +msgstr "Breve Descrição" #: editor/editor_help.cpp msgid "Properties" @@ -1995,9 +1992,8 @@ msgid "Class Description" msgstr "Descrição da Classe" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Tutoriais Online:" +msgstr "Tutoriais Online" #: editor/editor_help.cpp msgid "" @@ -2120,7 +2116,7 @@ msgstr "Iniciar" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2136,7 +2132,7 @@ msgstr "Nó" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "Incoming RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" @@ -2739,17 +2735,16 @@ msgid "Project Settings..." msgstr "Configurações do Projeto..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Versão:" +msgstr "Controle de Versão" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Configurar Controle de Versão" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Desativar Controle de Versão" #: editor/editor_node.cpp msgid "Export..." @@ -3022,7 +3017,7 @@ msgstr "Inspetor" msgid "Expand Bottom Panel" msgstr "Expandir Painel Inferior" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "SaÃda" @@ -3274,6 +3269,10 @@ msgstr "Escolha uma Viewport" msgid "New Script" msgstr "Novo Script" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Estender Script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Novo %s" @@ -3300,13 +3299,6 @@ msgstr "Colar" msgid "Convert To %s" msgstr "Converter Para %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Abrir Editor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "O nó selecionado não é uma Viewport!" @@ -4099,7 +4091,7 @@ msgstr "Nome do Plugin:" msgid "Subfolder:" msgstr "Subpasta:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Idioma:" @@ -4241,6 +4233,12 @@ msgstr "Ponto" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Abrir Editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Abrir Nó de Animação" @@ -4592,7 +4590,6 @@ msgstr "Nome da Animação:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Erro!" @@ -4765,6 +4762,8 @@ msgid "Current:" msgstr "Atual:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Adicionar Entrada" @@ -4969,6 +4968,10 @@ msgid "All" msgstr "Todos" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Importar..." @@ -5266,21 +5269,28 @@ msgid "Ruler Mode" msgstr "Modo de InÃcio:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Alternar o snap." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Usar Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opções de agarramento" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Alternar o snap." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Encaixar na grade" +#, fuzzy +msgid "Use Grid Snap" +msgstr "Snap de Grade" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Opções de agarramento" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5369,8 +5379,8 @@ msgid "View" msgstr "Visualizar" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Mostrar Grade" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5637,6 +5647,11 @@ msgstr "Alternar Curva Targente Linear" msgid "Hold Shift to edit tangents individually" msgstr "Segure Shift para editar tangentes individualmente" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Clique Direito: Excluir Ponto" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Cozinhar Sonda GI" @@ -6277,6 +6292,10 @@ msgid "Grid" msgstr "Grade" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Mostrar Grade" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Configurar a grade:" @@ -6333,6 +6352,7 @@ msgstr "Instância:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Tipo:" @@ -6431,6 +6451,11 @@ msgid "Find Next" msgstr "Localizar próximo" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Encontrar Anterior" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Filtrar scripts" @@ -6698,6 +6723,11 @@ msgstr "Pontos de interrupção(Breakpoints)" msgid "Cut" msgstr "Recortar" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Selecionar Tudo" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Excluir Linha" @@ -6755,10 +6785,6 @@ msgid "Auto Indent" msgstr "Auto Recuar" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Encontrar Anterior" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Procurar nos Arquivos..." @@ -7080,6 +7106,11 @@ msgid "Freelook Speed Modifier" msgstr "Modificador de velocidade da Visão Livre" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Modificador de velocidade da Visão Livre" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7118,6 +7149,10 @@ msgid "Use Local Space" msgstr "Usar Espaço Local" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Usar Snap" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Visão inferior" @@ -7345,6 +7380,11 @@ msgid "Simplification: " msgstr "Simplificação: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Produzir (Pixels): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Produzir (Pixels): " @@ -8138,11 +8178,8 @@ msgid "(GLES3 only)" msgstr "(Apenas GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Adicionar Entrada +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Adicionar saÃda +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8158,6 +8195,11 @@ msgid "Boolean" msgstr "Booleano" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "Amostras" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Adicionar porta de entrada" @@ -9108,15 +9150,19 @@ msgid "Resources to export:" msgstr "Recursos para exportar:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtros para exportar arquivos que não sejam recursos (separados por " "vÃrgula, e.g.: *.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtros para excluir arquivos do projeto (separados por vÃrgula, ex.: *." "json, *.txt)" @@ -10178,12 +10224,13 @@ msgstr "" "sejam revertidas para o padrão." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Filhos Editáveis" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Carregar como Substituto" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Desativar \"editable_instance\" fará com que todas as propriedades do nó " +"sejam revertidas para o padrão." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10260,6 +10307,14 @@ msgid "Clear Inheritance" msgstr "Limpar Herança" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Filhos Editáveis" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Carregar como Substituto" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Abrir a documentação" @@ -10278,10 +10333,6 @@ msgid "Change Type" msgstr "Mudar Tipo" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Estender Script" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "Reparentar Nó" @@ -10548,23 +10599,18 @@ msgid "Will load an existing script file." msgstr "Carregar arquivo de script existente" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Linguagem" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Herda de" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Nome da Classe" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Modelo" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Script Embutido" #: editor/script_create_dialog.cpp @@ -11223,6 +11269,11 @@ msgid "Add Function" msgstr "Adicionar Função" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Remover porta de entrada" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Adicionar Variável" @@ -11231,6 +11282,26 @@ msgid "Add Signal" msgstr "Adicionar Sinal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Adicionar porta de entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Adicionar porta de saÃda" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Remover porta de entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Remover porta de saÃda" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Alterar Expressão" @@ -11275,10 +11346,20 @@ msgid "Add Preload Node" msgstr "Adicionar Nó de Pré-carregamento" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Adicionar Nó(s) a Partir da Ãrvore" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Adicionar Getter de Propriedade" @@ -11303,6 +11384,11 @@ msgid "Connect Nodes" msgstr "Conectar Nodes" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Desconectar Nodes de Grafos" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Conectar dados do nó" @@ -11335,6 +11421,28 @@ msgid "Paste VisualScript Nodes" msgstr "Colar Nodes VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Não é possÃvel copiar o nó de função." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Renomear Função" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Remover Função" @@ -11360,16 +11468,13 @@ msgid "Make Tool:" msgstr "Tornar Local" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Tipo de Base:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Membros:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Nodes DisponÃveis:" +#, fuzzy +msgid "function_name" +msgstr "Função:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11393,6 +11498,16 @@ msgid "Cut Nodes" msgstr "Recortar Nodes" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Renomear Função" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Atualizar" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Editar Membro" @@ -11494,6 +11609,10 @@ msgid "The package must have at least one '.' separator." msgstr "O pacote deve ter pelo menos um separador '.'." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Selecione um dispositivo da lista" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "Executável ADB não configurado nas opções do Editor." @@ -11548,7 +11667,7 @@ msgstr "" #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" -msgstr "" +msgstr "Construindo Projeto Android (gradle)" #: platform/android/export/export.cpp msgid "" @@ -11602,6 +11721,10 @@ msgid "Required icon is not specified in the preset." msgstr "Ãcone necessário não especificado na predefinição." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Rodar no Navegador" @@ -12280,10 +12403,6 @@ msgstr "" "para que ele possa ter um tamanho. Caso contrário, defina-o como destino de " "render e atribua sua textura interna a algum nó para exibir." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Entrada" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12314,6 +12433,27 @@ msgstr "Variáveis só podem ser atribuÃdas na função de vértice." msgid "Constants cannot be modified." msgstr "Constantes não podem serem modificadas." +#~ msgid "Snap to Grid" +#~ msgstr "Encaixar na grade" + +#~ msgid "Add input +" +#~ msgstr "Adicionar Entrada +" + +#~ msgid "Language" +#~ msgstr "Linguagem" + +#~ msgid "Inherits" +#~ msgstr "Herda de" + +#~ msgid "Base Type:" +#~ msgstr "Tipo de Base:" + +#~ msgid "Available Nodes:" +#~ msgstr "Nodes DisponÃveis:" + +#~ msgid "Input" +#~ msgstr "Entrada" + #~ msgid "Properties:" #~ msgstr "Propriedades:" @@ -12532,9 +12672,6 @@ msgstr "Constantes não podem serem modificadas." #~ msgid "Go to parent folder" #~ msgstr "Ir para pasta pai" -#~ msgid "Select device from the list" -#~ msgstr "Selecione um dispositivo da lista" - #~ msgid "Open Scene(s)" #~ msgstr "Abrir Cena(s)" @@ -12776,9 +12913,6 @@ msgstr "Constantes não podem serem modificadas." #~ msgid "Warning" #~ msgstr "Aviso" -#~ msgid "Function:" -#~ msgstr "Função:" - #~ msgid "Variable" #~ msgstr "Variável" @@ -12845,9 +12979,6 @@ msgstr "Constantes não podem serem modificadas." #~ msgid "Connect Graph Nodes" #~ msgstr "Conectar Nodes de Grafos" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Desconectar Nodes de Grafos" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Remover Nó de Shader Graph" @@ -13976,9 +14107,6 @@ msgstr "Constantes não podem serem modificadas." #~ msgid "Group" #~ msgstr "Grupo" -#~ msgid "Samples" -#~ msgstr "Amostras" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "Modo de Conversão de Amostras (arquivos .wav):" diff --git a/editor/translations/pt_PT.po b/editor/translations/pt_PT.po index b92e719358..41de4d76bd 100644 --- a/editor/translations/pt_PT.po +++ b/editor/translations/pt_PT.po @@ -18,7 +18,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:52+0000\n" +"PO-Revision-Date: 2019-10-04 03:16+0000\n" "Last-Translator: João Lopes <linux-man@hotmail.com>\n" "Language-Team: Portuguese (Portugal) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_PT/>\n" @@ -71,32 +71,31 @@ msgstr "Em chamada para '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Combinar" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -108,7 +107,7 @@ msgstr "Equilibrado" #: editor/animation_bezier_editor.cpp msgid "Mirror" -msgstr "Espelhar" +msgstr "Espelho" #: editor/animation_bezier_editor.cpp editor/editor_profiler.cpp msgid "Time:" @@ -362,6 +361,7 @@ msgstr "Criar %d NOVAS pistas e inserir chaves?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Criar" @@ -505,20 +505,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Aviso: A editar animação importada" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Selecionar tudo" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Selecionar Nenhum" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "" -"Caminho para um nó AnimationPlayer contendo animações não está definido." +msgstr "Selecione um nó AnimationPlayer para criar e editar animações." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -650,7 +639,8 @@ msgid "Scale Ratio:" msgstr "Proporção de Escala:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Selecionar pistas a copiar:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -662,6 +652,11 @@ msgstr "Selecionar pistas a copiar:" msgid "Copy" msgstr "Copiar" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Selecionar Nenhum" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Adicionar Clip da Pista Ãudio" @@ -986,7 +981,7 @@ msgid "Resource" msgstr "Recurso" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Caminho" @@ -1256,9 +1251,8 @@ msgid "Delete Bus Effect" msgstr "Apagar Efeito de Barramento" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Barramento de áudio, arrastar e largar para reorganizar." +msgstr "Arrastar e largar para reorganizar." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1450,7 +1444,8 @@ msgstr "Adicionar Carregamento Automático" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Caminho:" @@ -1504,7 +1499,7 @@ msgstr "Criar Pasta" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nome:" @@ -1900,6 +1895,7 @@ msgid "Class:" msgstr "Classe:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Herdar:" @@ -1908,9 +1904,8 @@ msgid "Inherited by:" msgstr "Herdado por:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Breve Descrição:" +msgstr "Breve Descrição" #: editor/editor_help.cpp msgid "Properties" @@ -1941,9 +1936,8 @@ msgid "Class Description" msgstr "Descrição da Classe" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Tutoriais Online:" +msgstr "Tutoriais Online" #: editor/editor_help.cpp msgid "" @@ -2066,16 +2060,15 @@ msgstr "InÃcio" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp -#, fuzzy msgid "Down" -msgstr "Download" +msgstr "Para baixo" #: editor/editor_network_profiler.cpp msgid "Up" -msgstr "" +msgstr "Para cima" #: editor/editor_network_profiler.cpp editor/editor_node.cpp msgid "Node" @@ -2083,19 +2076,19 @@ msgstr "Nó" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "RPC recebido" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "RSET recebido" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "RPC enviado" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "RSET enviado" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2360,7 +2353,7 @@ msgstr "Esta operação não pode ser efetuada sem um Nó raiz." #: editor/editor_node.cpp msgid "Export Tile Set" -msgstr "Exportar conjunto de tiles" +msgstr "Exportar conjunto de Tiles" #: editor/editor_node.cpp msgid "This operation can't be done without a selected node." @@ -2685,17 +2678,16 @@ msgid "Project Settings..." msgstr "Configurações de Projeto..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Versão:" +msgstr "Controle de Versões" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Organizar Controle de Versões" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Desativar Controle de Versões" #: editor/editor_node.cpp msgid "Export..." @@ -2968,7 +2960,7 @@ msgstr "Inspetor" msgid "Expand Bottom Panel" msgstr "Expandir Painel do Fundo" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "SaÃda" @@ -2994,17 +2986,25 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"O projeto será preparado para compilações personalizadas Android com a " +"instalação do modelo fonte em \"res://android/build\".\n" +"Poderá depois aplicar modificações e compilar o seu APK personalizado a " +"exportar (com adição de módulos, alterando AndroidManifest.xml, etc.).\n" +"Repare que de forma a criar compilações personalizadas em vez de usar APKs " +"pré-compilados, a opção \"Usar Compilação Personalizada\" deve ser ativada " +"na predefinição da exportação Android." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" "Remove the \"res://android/build\" directory manually before attempting this " "operation again." msgstr "" -"O modelo de compilação Android está instalado e não será substituÃdo.\n" -"Remova manualmente a diretoria \"build\" antes de repetir esta operação." +"O modelo de compilação Android já está instalado neste projeto e não será " +"substituÃdo.\n" +"Remova manualmente a diretoria \"res://android/build\" antes de repetir esta " +"operação." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3067,9 +3067,8 @@ msgid "Open the previous Editor" msgstr "Abrir o Editor anterior" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Fonte de superfÃcie não especificada." +msgstr "Sub-recurso não encontrado." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3080,9 +3079,8 @@ msgid "Thumbnail..." msgstr "Miniatura..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Abrir Script:" +msgstr "Script principal:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3217,6 +3215,10 @@ msgstr "Escolha uma Vista" msgid "New Script" msgstr "Novo Script" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Estender Script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Novo %s" @@ -3243,13 +3245,6 @@ msgstr "Colar" msgid "Convert To %s" msgstr "Converter em %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Abrir Editor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Nó selecionado não é uma Vista!" @@ -3911,7 +3906,6 @@ msgid "Import As:" msgstr "Importar Como:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" msgstr "Predefinições" @@ -4039,7 +4033,7 @@ msgstr "Nome do Plugin:" msgid "Subfolder:" msgstr "Sub-pasta:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Linguagem:" @@ -4180,6 +4174,12 @@ msgstr "Ponto" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Abrir Editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Abrir Nó Animação" @@ -4528,7 +4528,6 @@ msgstr "Nome da Animação:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Erro!" @@ -4700,6 +4699,8 @@ msgid "Current:" msgstr "Atual:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Adicionar entrada" @@ -4904,6 +4905,10 @@ msgid "All" msgstr "Todos" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Importar..." @@ -5192,26 +5197,32 @@ msgid "Pan Mode" msgstr "Modo deslocamento" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Modo Execução:" +msgstr "Modo Régua" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Alternar Ajuste." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Usar Ajuste" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Opções de Ajuste" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Alternar Ajuste." + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Use Grid Snap" +msgstr "Ajuste de grelha" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Ajustar à Grelha" +msgid "Snapping Options" +msgstr "Opções de Ajuste" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5300,8 +5311,8 @@ msgid "View" msgstr "Vista" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Mostrar grelha" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5568,6 +5579,11 @@ msgstr "Alternar tangente linear da curva" msgid "Hold Shift to edit tangents individually" msgstr "Pressione Shift para editar tangentes individualmente" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Clique direito: Apagar Ponto" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Consolidar Sonda GI" @@ -6203,6 +6219,10 @@ msgid "Grid" msgstr "Grelha" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Mostrar grelha" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "Configurar Grelha:" @@ -6259,6 +6279,7 @@ msgstr "Instância:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Tipo:" @@ -6357,6 +6378,11 @@ msgid "Find Next" msgstr "Localizar Seguinte" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Localizar Anterior" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Scripts de filtro" @@ -6624,6 +6650,11 @@ msgstr "Pontos de paragem" msgid "Cut" msgstr "Cortar" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Selecionar tudo" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Apagar linha" @@ -6681,10 +6712,6 @@ msgid "Auto Indent" msgstr "Indentação automática" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Localizar Anterior" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Localizar em Ficheiros..." @@ -7006,6 +7033,11 @@ msgid "Freelook Speed Modifier" msgstr "Modificador de velocidade Freelook" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Modificador de velocidade Freelook" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7044,6 +7076,10 @@ msgid "Use Local Space" msgstr "Usar Espaço Local" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Usar Ajuste" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Vista de fundo" @@ -7270,6 +7306,11 @@ msgid "Simplification: " msgstr "Simplificação: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "Crescer (Pixeis): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "Crescer (Pixeis): " @@ -7318,9 +7359,8 @@ msgid "(empty)" msgstr "(vazio)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Colar Frame" +msgstr "Mover Frame" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7637,13 +7677,12 @@ msgid "Enable Priority" msgstr "Ativar Prioridade" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Filtrar Ficheiro..." +msgstr "Filtrar Tiles" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "Dê um recurso TileSet a este TileMap para usar os seus Tiles." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7775,17 +7814,19 @@ msgstr "Ativar o snap and show grid (configurável através do Inspector)." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Display Tile Names (Hold Alt Key)" -msgstr "Exibir nome dos tiles (segure tecla Alt)" +msgstr "Exibir nome dos Tiles (segure tecla Alt)" #: editor/plugins/tile_set_editor_plugin.cpp msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Adicione ou selecione uma textura no painel esquerdo para editar os Tiles " +"vinculados." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." msgstr "" -"Remover textura selecionada? Todos os tiles que a usam serão removidos." +"Remover textura selecionada? Todos os Tiles que a usam serão removidos." #: editor/plugins/tile_set_editor_plugin.cpp msgid "You haven't selected a texture to remove." @@ -7793,7 +7834,7 @@ msgstr "Não selecionou uma textura para remover." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create from scene? This will overwrite all current tiles." -msgstr "Criar a partir de cena? Irá substituir todos os tiles atuais." +msgstr "Criar a partir de cena? Irá substituir todos os Tiles atuais." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Merge from scene?" @@ -7954,92 +7995,80 @@ msgid "TileSet" msgstr "TileSet" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Nome do parente do Nó, se disponÃvel" +msgstr "Não existem addons VCS disponÃveis." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Erro" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "Nenhum nome foi fornecido" +msgstr "Nenhuma mensagem de gravação foi fornecida" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "Nenhum ficheiro adicionado ao palco" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Comunidade" +msgstr "Gravar" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "Addon VCS não foi inicializado" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "Sistema de Controlo de Versões" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "Capitalizar" +msgstr "Inicializar" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "Ãrea de Palco" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Criar novo retângulo." +msgstr "Detetar novas alterações" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Mudar" +msgstr "Alterações" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Modificado" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Renomear" +msgstr "Renomeado" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Apagar" +msgstr "Apagado" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Mudar" +msgstr "Mudança de tipo" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Apagar Selecionados" +msgstr "Palco Selecionado" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Guardar tudo" +msgstr "Tudo no Palco" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Adicionar mensagem de gravação" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Sincronizar Alterações de Script" +msgstr "Gravar Alterações" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8048,26 +8077,23 @@ msgstr "Status" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" -msgstr "" +msgstr "Ver diffs dos ficheiros antes de atualizá-los para a última versão" #: editor/plugins/version_control_editor_plugin.cpp msgid "No file diff is active" -msgstr "" +msgstr "Nenhum ficheiro diff está ativo" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "Detetar alterações em ficheiro diff" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(Apenas GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Adicionar entrada +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Adicionar saÃda +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8083,6 +8109,10 @@ msgid "Boolean" msgstr "Lógico" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Adicionar porta de entrada" @@ -8296,11 +8326,10 @@ msgstr "" "falso." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" -"Devolve um vetor associado se o valor lógico fornecido for verdadeiro ou " +"Devolve um escalar associado se o valor lógico fornecido for verdadeiro ou " "falso." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9009,15 +9038,19 @@ msgid "Resources to export:" msgstr "Recursos a exportar:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtros para exportar Ficheiros não-recursos (separados por vÃrgula, ex: *." "json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Filtros para excluir Ficheiros do Projeto (separados por vÃrgula, ex: *." "json, *.txt)" @@ -9615,9 +9648,8 @@ msgid "Settings saved OK." msgstr "Configuração guardada." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Adicionar evento ação de entrada" +msgstr "Evento Ação de Entrada movido" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -9984,9 +10016,8 @@ msgid "Instance Scene(s)" msgstr "Cena(s) da Instância" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Guardar ramo como Cena" +msgstr "Substituir com Cena-Ramo" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10029,23 +10060,20 @@ msgid "Make node as Root" msgstr "Tornar Nó Raiz" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Apagar Nós" +msgstr "Apagar %d Nós?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "Apagar Nó(s) Gráfico(s) Shader" +msgstr "Apagar Nó raiz \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "Apagar Nó \"%s\" e filhos?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Apagar Nós" +msgstr "Apagar Nó \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10068,12 +10096,13 @@ msgstr "" "para os seus valores padrão." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Filhos editáveis" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Carregar como marcador de posição" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Desativar \"editable_instance\" irá reverter todas as propriedades do Nó " +"para os seus valores padrão." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10148,6 +10177,14 @@ msgid "Clear Inheritance" msgstr "Limpar herança" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Filhos editáveis" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Carregar como marcador de posição" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Abrir documentação" @@ -10164,10 +10201,6 @@ msgid "Change Type" msgstr "Mudar tipo" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Estender Script" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "Recolocar o Novo Nó" @@ -10408,23 +10441,18 @@ msgid "Will load an existing script file." msgstr "Vai carregar ficheiro de script existente." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Linguagem" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Herdar" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Nome de classe" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Modelo" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Script incorporado" #: editor/script_create_dialog.cpp @@ -10440,38 +10468,32 @@ msgid "Bytes:" msgstr "Bytes:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "Avisos:" +msgstr "Aviso:" #: editor/script_editor_debugger.cpp msgid "Error:" msgstr "Erro:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Copiar Erro" +msgstr "Erro C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Erro:" +msgstr "Erro C++:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Fonte" +msgstr "Código-fonte C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Fonte" +msgstr "Código-fonte:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Fonte" +msgstr "Código-fonte C++:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10482,18 +10504,16 @@ msgid "Errors" msgstr "Erros" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "Processo filho conectado" +msgstr "Processo filho conectado." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Copiar Erro" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Pontos de paragem" +msgstr "Saltar Pontos de Paragem" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10512,9 +10532,8 @@ msgid "Profiler" msgstr "Profiler" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Exportar Perfil" +msgstr "Traçador de Rede" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10738,7 +10757,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Esperado um string de comprimento 1 (um caráter)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10895,13 +10914,12 @@ msgid "Pick Distance:" msgstr "Distância de escolha:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Métodos de filtro" +msgstr "Meshes de filtro" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." -msgstr "" +msgstr "Dá um recurso MeshLibrary a este GridMap para usar os seus meshes." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11076,6 +11094,11 @@ msgid "Add Function" msgstr "Adicionar Função" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Remover porta de entrada" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Adicionar Variável" @@ -11084,6 +11107,26 @@ msgid "Add Signal" msgstr "Adicionar Sinal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Adicionar porta de entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Adicionar porta de saÃda" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Remover porta de entrada" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Remover porta de saÃda" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Mudar Expressão" @@ -11128,10 +11171,20 @@ msgid "Add Preload Node" msgstr "Adicionar Nó de Pré-carregamento" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Adicionar Nó da Ãrvore" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Adicionar Propriedade Getter" @@ -11156,6 +11209,11 @@ msgid "Connect Nodes" msgstr "Conectar Nós" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Desconectar Nós do gráfico" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Conectar Dados de Nó" @@ -11188,6 +11246,28 @@ msgid "Paste VisualScript Nodes" msgstr "Colar Nós VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "ImpossÃvel copiar o Nó Função." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Mudar nome da Função" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Remover Função" @@ -11208,21 +11288,17 @@ msgid "Editing Signal:" msgstr "A editar Sinal:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "Tornar Local" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Tipo de Base:" +msgstr "Ferramenta Fazer:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Membros:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Nós DisponÃveis:" +#, fuzzy +msgid "function_name" +msgstr "Função:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11245,6 +11321,16 @@ msgid "Cut Nodes" msgstr "Cortar Nós" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Mudar nome da Função" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Atualizar" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Editar Membros" @@ -11342,6 +11428,10 @@ msgid "The package must have at least one '.' separator." msgstr "O pacote deve ter pelo menos um separador '.'." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Selecionar dispositivo da lista" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "O executável ADB não está configurado nas Configurações do Editor." @@ -11363,16 +11453,17 @@ msgstr "" #: platform/android/export/export.cpp msgid "Invalid Android SDK path for custom build in Editor Settings." -msgstr "Caminho inválido para Android SDK no Editor de Configurações." +msgstr "" +"Caminho inválido de Android SDK para compilação personalizada no Editor de " +"Configurações." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"Projeto Android não está instalado para compilação. Instale-o no menu do " -"Editor." +"Modelo de compilação Android não está instalado neste projeto. Instale-o no " +"menu Projeto." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11462,6 +11553,10 @@ msgid "Required icon is not specified in the preset." msgstr "O Ãcone obrigatório não está especificado na predefinição." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Executar no Navegador" @@ -12124,10 +12219,6 @@ msgstr "" "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/resources/visual_shader.cpp -msgid "Input" -msgstr "Entrada" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fonte inválida para previsualização." @@ -12156,6 +12247,27 @@ msgstr "Variações só podem ser atribuÃdas na função vértice." msgid "Constants cannot be modified." msgstr "Constantes não podem ser modificadas." +#~ msgid "Snap to Grid" +#~ msgstr "Ajustar à Grelha" + +#~ msgid "Add input +" +#~ msgstr "Adicionar entrada +" + +#~ msgid "Language" +#~ msgstr "Linguagem" + +#~ msgid "Inherits" +#~ msgstr "Herdar" + +#~ msgid "Base Type:" +#~ msgstr "Tipo de Base:" + +#~ msgid "Available Nodes:" +#~ msgstr "Nós DisponÃveis:" + +#~ msgid "Input" +#~ msgstr "Entrada" + #~ msgid "Properties:" #~ msgstr "Propriedades:" @@ -12554,9 +12666,6 @@ msgstr "Constantes não podem ser modificadas." #~ msgid "Go to parent folder" #~ msgstr "Ir para a pasta acima" -#~ msgid "Select device from the list" -#~ msgstr "Selecionar dispositivo da lista" - #~ msgid "Open Scene(s)" #~ msgstr "Abrir Cena(s)" @@ -12791,9 +12900,6 @@ msgstr "Constantes não podem ser modificadas." #~ msgid "Warning" #~ msgstr "Aviso" -#~ msgid "Function:" -#~ msgstr "Função:" - #~ msgid "Variable" #~ msgstr "Variável" @@ -12860,9 +12966,6 @@ msgstr "Constantes não podem ser modificadas." #~ msgid "Connect Graph Nodes" #~ msgstr "Conectar Nós do gráfico" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Desconectar Nós do gráfico" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Remover Nó Gráfico Shader" diff --git a/editor/translations/ro.po b/editor/translations/ro.po index 8204df8633..e3f53a56f3 100644 --- a/editor/translations/ro.po +++ b/editor/translations/ro.po @@ -7,12 +7,13 @@ # Nitroretro <nitroretro@protonmail.com>, 2018. # TigerxWood <TigerxWood@gmail.com>, 2018. # Grigore Antoniuc <grisa181@gmail.com>, 2018. +# Boby Ilea <boby.ilea@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2018-12-13 14:42+0100\n" -"Last-Translator: Nitroretro <nitroretro@protonmail.com>\n" +"PO-Revision-Date: 2019-10-26 03:53+0000\n" +"Last-Translator: Boby Ilea <boby.ilea@gmail.com>\n" "Language-Team: Romanian <https://hosted.weblate.org/projects/godot-engine/" "godot/ro/>\n" "Language: ro\n" @@ -21,7 +22,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2;\n" -"X-Generator: Poedit 2.2\n" +"X-Generator: Weblate 3.9.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -32,72 +33,71 @@ msgstr "" #: modules/mono/glue/gd_glue.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "" +msgstr "Bytes insuficienti pentru decodare bytes, sau format invalid" #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "" +msgstr "Intrare invalida %i in expresie" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" -msgstr "" +msgstr "self nu poate fi folosit deoarece instanÈ›a este nulă (nefurnizat)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." -msgstr "" +msgstr "Operanzi invalizi la operatorii %s, %s È™i %s" #: core/math/expression.cpp msgid "Invalid index of type %s for base type %s" -msgstr "" +msgstr "Indice invalid de tip %s pentru tipul de bază %s" #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" -msgstr "" +msgstr "Indice numit '%s' invalid pentru tipul de bază %s" #: core/math/expression.cpp msgid "Invalid arguments to construct '%s'" -msgstr "" +msgstr "Argumente invalide pentru a construi '%s'" #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "" +msgstr "ÃŽn apelarea lui '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Amestecare" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" -msgstr "Gratuit" +msgstr "Gratis" #: editor/animation_bezier_editor.cpp msgid "Balanced" -msgstr "" +msgstr "Echilibrat" #: editor/animation_bezier_editor.cpp msgid "Mirror" @@ -108,9 +108,8 @@ msgid "Time:" msgstr "Timp:" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Value:" -msgstr "Nume nou:" +msgstr "Valoare:" #: editor/animation_bezier_editor.cpp msgid "Insert Key Here" @@ -125,14 +124,12 @@ msgid "Delete Selected Key(s)" msgstr "ÅžtergeÈ›i Cheile Selectate" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Adaugă punct" +msgstr "Adaugă Punct Bezier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Deplasare punct" +msgstr "Mută Punct Bezier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -382,6 +379,7 @@ msgstr "CreaÈ›i %d piste NOI È™i inseraÈ›i cheie?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "CreaÈ›i" @@ -515,16 +513,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Mod Selectare" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -667,8 +655,9 @@ msgid "Scale Ratio:" msgstr "ProporÈ›ie Scalare:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "Setează TranziÈ›ii la:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -679,6 +668,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Mod Selectare" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1021,7 +1015,7 @@ msgid "Resource" msgstr "Resursă" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Cale" @@ -1501,7 +1495,8 @@ msgstr "AdaugaÈ›i AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Cale:" @@ -1556,7 +1551,7 @@ msgstr "CreaÈ›i Director" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Nume:" @@ -1977,6 +1972,7 @@ msgid "Class:" msgstr "Clasă:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "MoÈ™teneÈ™te:" @@ -3088,7 +3084,7 @@ msgstr "Inspector" msgid "Expand Bottom Panel" msgstr "Extinde toate" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "IeÈ™ire" @@ -3331,6 +3327,11 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Execută Scriptul" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3357,14 +3358,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Deschidere în Editor" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4199,7 +4192,7 @@ msgstr "Plugin-uri" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4353,6 +4346,13 @@ msgstr "Deplasare punct" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Deschidere în Editor" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4721,7 +4721,6 @@ msgstr "Nume AnimaÈ›ie:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Eroare!" @@ -4898,6 +4897,8 @@ msgid "Current:" msgstr "Curent:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Adaugă Intrare(Input)" @@ -5113,6 +5114,10 @@ msgid "All" msgstr "Toate" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importă" @@ -5429,23 +5434,28 @@ msgstr "Modul de ExecuÈ›ie:" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "Comutare snapping" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Utilizează Snap" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "OpÈ›iuni Snapping" +msgid "Toggle grid snapping." +msgstr "Comutare snapping" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "Snap pe grilă" +msgid "Use Grid Snap" +msgstr "Snap Grilă" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "OpÈ›iuni Snapping" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5543,8 +5553,8 @@ msgid "View" msgstr "Perspectivă" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Arată Grila" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5820,6 +5830,11 @@ msgstr "Comută Tangenta Liniară a Curbei" msgid "Hold Shift to edit tangents individually" msgstr "Èšine apăsat Shift pentru a edita individual tangentele" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Click Drept: Ștergere punct" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Procesează Sonda GI" @@ -6474,6 +6489,10 @@ msgid "Grid" msgstr "Grilă" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Arată Grila" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "Configurare Snap" @@ -6536,6 +6555,7 @@ msgstr "Instanță :" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6645,6 +6665,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Proprietățile obiectului." @@ -6927,6 +6952,11 @@ msgstr "Șterge puncte" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6985,10 +7015,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Filtrează fiÈ™ierele..." @@ -7325,6 +7351,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7360,6 +7390,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Utilizează Snap" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7597,6 +7631,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8430,12 +8468,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Adaugă Intrare(Input)" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "Adaugă Intrare(Input)" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8453,6 +8486,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Adaugă Intrare(Input)" @@ -9338,12 +9375,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10361,11 +10400,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10446,6 +10483,14 @@ msgid "Clear Inheritance" msgstr "Curăță Derivarea" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Deschide Recente" @@ -10465,11 +10510,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Execută Scriptul" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "CreaÈ›i %s Nou" @@ -10715,24 +10755,19 @@ msgid "Will load an existing script file." msgstr "ÃŽncărcaÅ£i o Schemă de Pistă Audio existentă." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Clasă:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Elimină Șablon" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Execută Scriptul" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11390,6 +11425,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Elimină punct" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11398,6 +11438,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Adaugă Intrare(Input)" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Adaugă Intrare(Input)" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Elimină punct" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Elimină punct" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11438,10 +11498,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11467,6 +11537,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Deconectat" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "ConectaÈ›i la Nod:" @@ -11501,6 +11576,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Creează Contur" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11526,15 +11622,11 @@ msgid "Make Tool:" msgstr "Creează Oase" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Membri:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -11559,6 +11651,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "FaceÈ›i FuncÈ›ia" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "ReîmprospătaÈ›i" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Membri" @@ -11654,6 +11756,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Selectează un dispozitiv din listă" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11755,6 +11861,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Execută în Browser" @@ -12301,11 +12411,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -#, fuzzy -msgid "Input" -msgstr "Adaugă Intrare(Input)" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" @@ -12335,6 +12440,18 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "Snap pe grilă" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Adaugă Intrare(Input)" + +#, fuzzy +#~ msgid "Input" +#~ msgstr "Adaugă Intrare(Input)" + +#, fuzzy #~ msgid "Methods:" #~ msgstr "Metode" @@ -12446,9 +12563,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "AccesaÈ›i Directorul Părinte" -#~ msgid "Select device from the list" -#~ msgstr "Selectează un dispozitiv din listă" - #~ msgid "Open Scene(s)" #~ msgstr "Deschide Scena(ele)" @@ -12606,9 +12720,6 @@ msgstr "" #~ msgid "Move Anim Track Down" #~ msgstr "Mută Pista Anim Jos" -#~ msgid "Set Transitions to:" -#~ msgstr "Setează TranziÈ›ii la:" - #~ msgid "Anim Track Rename" #~ msgstr "RedenumeÈ™te Pista Anim" diff --git a/editor/translations/ru.po b/editor/translations/ru.po index f6620b5aef..4e6bd592b3 100644 --- a/editor/translations/ru.po +++ b/editor/translations/ru.po @@ -56,12 +56,13 @@ # КонÑтантин Рин <email.to.rean@gmail.com>, 2019. # Maxim Samburskiy <alpacones@outlook.com>, 2019. # Dima Koshel <form.eater@gmail.com>, 2019. +# Danil Alexeev <danil@alexeev.xyz>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-19 05:27+0000\n" -"Last-Translator: ÐлекÑандр <ol-vin@mail.ru>\n" +"PO-Revision-Date: 2019-10-22 02:53+0000\n" +"Last-Translator: Danil Alexeev <danil@alexeev.xyz>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot/ru/>\n" "Language: ru\n" @@ -70,7 +71,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 3.9-dev\n" +"X-Generator: Weblate 3.9.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -90,7 +91,7 @@ msgstr "Ðеправильный ввод %i (не был передан) в Ð²Ñ #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" msgstr "" -"self не может быть иÑпользован, потому что ÑкземплÑÑ€ равен null (не прошел)" +"self не может быть иÑпользован, потому что ÑкземплÑÑ€ равен null (не передан)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." @@ -114,32 +115,31 @@ msgstr "Ðа вызове '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "Б" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "КиБ" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Сочетание" +msgstr "МиБ" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "ГиБ" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "ТиБ" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "ПиБ" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "ÐиБ" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -373,11 +373,11 @@ msgstr "Ð’Ñтавить ключ" #: editor/animation_track_editor.cpp msgid "Duplicate Key(s)" -msgstr "Дублировать ключ(ключи)" +msgstr "Дублировать ключ(и)" #: editor/animation_track_editor.cpp msgid "Delete Key(s)" -msgstr "Удалить ключ(ключи)" +msgstr "Удалить ключ(и)" #: editor/animation_track_editor.cpp msgid "Change Animation Update Mode" @@ -411,6 +411,7 @@ msgstr "Создать %d новые дорожки и вÑтавить ключ #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Создать" @@ -553,15 +554,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Предупреждение: Редактирование импортированной анимации" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Выбрать вÑе" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "СброÑить выделение" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -697,7 +689,8 @@ msgid "Scale Ratio:" msgstr "КоÑффициент маÑштабированиÑ:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Выбрать треки Ð´Ð»Ñ ÐºÐ¾Ð¿Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -709,6 +702,11 @@ msgstr "Выбрать треки Ð´Ð»Ñ ÐºÐ¾Ð¿Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ:" msgid "Copy" msgstr "Копировать" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "СброÑить выделение" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Добавить звуковую дорожку" @@ -1037,7 +1035,7 @@ msgid "Resource" msgstr "РеÑурÑ" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Путь" @@ -1502,7 +1500,8 @@ msgstr "Добавить в автозагрузку" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Путь:" @@ -1556,7 +1555,7 @@ msgstr "Создать папку" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "ИмÑ:" @@ -1638,9 +1637,8 @@ msgid "Script Editor" msgstr "Редактор Ñкриптов" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Asset Library" -msgstr "Открыть библиотеку шаблонов" +msgstr "Библиотека реÑурÑов" #: editor/editor_feature_profile.cpp #, fuzzy @@ -1971,6 +1969,7 @@ msgid "Class:" msgstr "КлаÑÑ:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "ÐаÑледует:" @@ -2137,7 +2136,7 @@ msgstr "ЗапуÑтить" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/Ñ" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2153,19 +2152,19 @@ msgstr "Узел" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "ВходÑщий RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "ВходÑщий RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "ИÑходÑщий RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "ИÑходÑщий RSET" #: editor/editor_node.cpp editor/project_manager.cpp #, fuzzy @@ -2765,12 +2764,14 @@ msgid "Version Control" msgstr "ВерÑиÑ:" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp +#, fuzzy msgid "Set Up Version Control" -msgstr "" +msgstr "ÐаÑтроить управление верÑиÑми" #: editor/editor_node.cpp +#, fuzzy msgid "Shut Down Version Control" -msgstr "" +msgstr "Выключить управление верÑиÑми" #: editor/editor_node.cpp msgid "Export..." @@ -3051,7 +3052,7 @@ msgstr "ИнÑпектор" msgid "Expand Bottom Panel" msgstr "Развернуть нижнюю панель" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Вывод" @@ -3080,6 +3081,14 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Ðто наÑтроит ваш проект Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÑŒÑких Ñборок Android путём уÑтановки " +"иÑходного шаблона в «res://android/build».\n" +"Затем вы можете модифицировать его (добавить модули, изменить " +"AndroidManifest.xml и Ñ‚. д.) и Ñоздать Ñвой ÑобÑтвенный пользовательÑкий APK " +"Ð´Ð»Ñ ÑкÑпорта.\n" +"Обратите внимание, что Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÑŒÑких Ñборок вмеÑто " +"иÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð³Ð¾Ñ‚Ð¾Ð²Ñ‹Ñ… APK-файлов при ÑкÑпорте на Android должна быть " +"включена Ð¾Ð¿Ñ†Ð¸Ñ Â«Ð˜Ñпользовать пользовательÑкую Ñборку»." #: editor/editor_node.cpp #, fuzzy @@ -3304,6 +3313,10 @@ msgstr "Выберите Viewport" msgid "New Script" msgstr "Ðовый Ñкрипт" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "РаÑширить Ñкрипт" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Ðовый %s" @@ -3330,13 +3343,6 @@ msgstr "Ð’Ñтавить" msgid "Convert To %s" msgstr "Преобразовать в %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Открыть редактор" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Выбранный узел не Viewport!" @@ -4135,7 +4141,7 @@ msgstr "Ð˜Ð¼Ñ Ð”Ð¾Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ:" msgid "Subfolder:" msgstr "Подпапка:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Язык:" @@ -4277,6 +4283,12 @@ msgstr "Точка" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Открыть редактор" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Открыть Узел Ðнимации" @@ -4626,7 +4638,6 @@ msgstr "Ðазвание анимации:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Ошибка!" @@ -4799,6 +4810,8 @@ msgid "Current:" msgstr "Выбранный:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Добавить вход" @@ -5008,6 +5021,10 @@ msgid "All" msgstr "Ð’Ñе" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Переимпортировать..." @@ -5169,10 +5186,13 @@ msgid "Presets for the anchors and margins values of a Control node." msgstr "ПредуÑтановки Ð´Ð»Ñ Ñкорей и Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¾Ñ‚Ñтупов контрольного узла." #: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy msgid "" "When active, moving Control nodes changes their anchors instead of their " "margins." msgstr "" +"ЕÑли активно, при перемещении узлов Control будут изменÑтьÑÑ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ñкорей " +"вмеÑто отÑтупов." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchors only" @@ -5308,21 +5328,28 @@ msgid "Ruler Mode" msgstr "Режим запуÑка:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Переключить привÑзки." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "ИÑпользовать привÑзку" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Параметры ПривÑзки" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Переключить привÑзки." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "ПривÑзка к Ñетке" +#, fuzzy +msgid "Use Grid Snap" +msgstr "ПривÑзка по Ñетке" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Параметры ПривÑзки" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5415,8 +5442,8 @@ msgid "View" msgstr "Обзор" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Показать Ñетку" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5454,7 +5481,7 @@ msgstr "Кадрировать выбранное" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy msgid "Preview Canvas Scale" -msgstr "ПредпроÑмотр атлаÑа" +msgstr "ПредпроÑмотр маÑштаба холÑта" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5697,6 +5724,11 @@ msgstr "Переключить кривую линейный тангенÑ" msgid "Hold Shift to edit tangents individually" msgstr "Удерживайте Shift, чтобы изменить каÑательные индивидуально" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "ПКМ: Удалить точку" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Запечь GI пробу" @@ -5973,8 +6005,9 @@ msgid "Generation Time (sec):" msgstr "Ð’Ñ€ÐµÐ¼Ñ Ð³ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ð¸ (Ñек):" #: editor/plugins/particles_editor_plugin.cpp +#, fuzzy msgid "The geometry's faces don't contain any area." -msgstr "" +msgstr "Грани данной геометрии не Ñодержат никакой облаÑти." #: editor/plugins/particles_editor_plugin.cpp #, fuzzy @@ -5983,7 +6016,7 @@ msgstr "Узел не Ñодержит геометрии (грани)." #: editor/plugins/particles_editor_plugin.cpp msgid "\"%s\" doesn't inherit from Spatial." -msgstr "" +msgstr "\"%s\" не наÑледуетÑÑ Ð¾Ñ‚ Spatial." #: editor/plugins/particles_editor_plugin.cpp msgid "\"%s\" doesn't contain geometry." @@ -6337,6 +6370,10 @@ msgid "Grid" msgstr "Сетка" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Показать Ñетку" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "ÐаÑтройки Ñетки:" @@ -6393,6 +6430,7 @@ msgstr "ÐкземплÑÑ€:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Тип:" @@ -6494,6 +6532,11 @@ msgid "Find Next" msgstr "Ðайти Ñледующее" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Ðайти предыдущее" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "СвойÑтва фильтра" @@ -6629,7 +6672,7 @@ msgstr "Открыть онлайн документацию Godot" #: editor/plugins/script_editor_plugin.cpp msgid "Request Docs" -msgstr "Запрашиваемые Документы" +msgstr "Проблема" #: editor/plugins/script_editor_plugin.cpp #, fuzzy @@ -6769,6 +6812,11 @@ msgstr "Точки оÑтанова" msgid "Cut" msgstr "Вырезать" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Выбрать вÑе" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Удалить Ñтроку" @@ -6827,10 +6875,6 @@ msgid "Auto Indent" msgstr "ÐвтоотÑтуп" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Ðайти предыдущее" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Ðайти в файлах..." @@ -7159,6 +7203,11 @@ msgid "Freelook Speed Modifier" msgstr "Обзор модификатор ÑкороÑти" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Обзор модификатор ÑкороÑти" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7181,8 +7230,9 @@ msgid "Snap Nodes To Floor" msgstr "ПодравнÑть Узел Ñ ÐŸÐ¾Ð»Ð¾Ð¼" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy msgid "Couldn't find a solid floor to snap the selection to." -msgstr "" +msgstr "Ðе удалоÑÑŒ найти Ñплошной пол, к которому можно привÑзать выделение." #: editor/plugins/spatial_editor_plugin.cpp msgid "" @@ -7200,6 +7250,10 @@ msgid "Use Local Space" msgstr "Режим локального проÑтранÑтва (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "ИÑпользовать привÑзку" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Вид Снизу" @@ -7435,6 +7489,11 @@ msgid "Simplification: " msgstr "Упрощение: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "РоÑÑ‚ (пикÑели): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "РоÑÑ‚ (пикÑели): " @@ -7688,7 +7747,7 @@ msgstr "Отмеченный переключатель" #: editor/plugins/theme_editor_plugin.cpp msgid "Named Sep." -msgstr "" +msgstr "Имен. раздел." #: editor/plugins/theme_editor_plugin.cpp msgid "Submenu" @@ -7824,7 +7883,7 @@ msgstr "ОтÑортировать файлы..." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "Задайте TileSet реÑÑƒÑ€Ñ Ñтому Tilemap чтобы иÑпользовать его тайлы." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7976,6 +8035,8 @@ msgstr "Отобразить имена плиток (удерживать наРmsgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Добавьте или выберите текÑтуру на левой панели, чтобы редактировать тайлы, " +"привÑзанные к ней." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -8158,59 +8219,54 @@ msgid "Error" msgstr "Ошибка" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "Ðе указано имÑ" +msgstr "Ðе указано Ñообщение коммита" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "Ðе добавлены файлы Ð´Ð»Ñ ÐºÐ¾Ð¼Ð¼Ð¸Ñ‚Ð°" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "СообщеÑтво" +msgstr "Коммит" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "Плагин VCS не инициализирован" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "СиÑтема ÑƒÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð²ÐµÑ€ÑиÑми" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "ПропиÑные" +msgstr "Инициализировать" #: editor/plugins/version_control_editor_plugin.cpp +#, fuzzy msgid "Staging area" -msgstr "" +msgstr "ОблаÑть коммита" #: editor/plugins/version_control_editor_plugin.cpp #, fuzzy msgid "Detect new changes" -msgstr "Создать новый прÑмоугольник." +msgstr "Обнаружить новые изменениÑ" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Изменить" +msgstr "ИзменениÑ" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Изменено" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Переименовать" +msgstr "Переименовано" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Удалить" +msgstr "Удалено" #: editor/plugins/version_control_editor_plugin.cpp #, fuzzy @@ -8229,12 +8285,12 @@ msgstr "Сохранить вÑÑ‘" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Добавьте Ñообщение коммита" #: editor/plugins/version_control_editor_plugin.cpp #, fuzzy msgid "Commit Changes" -msgstr "Ð¡Ð¸Ð½Ñ…Ñ€Ð¾Ð½Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹ в Ñкриптах" +msgstr "Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÐºÐ¾Ð¼Ð¼Ð¸Ñ‚Ð°" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8242,8 +8298,9 @@ msgid "Status" msgstr "СтатуÑ" #: editor/plugins/version_control_editor_plugin.cpp +#, fuzzy msgid "View file diffs before committing them to the latest version" -msgstr "" +msgstr "ПроÑмотр различий в файлах перед коммитом" #: editor/plugins/version_control_editor_plugin.cpp #, fuzzy @@ -8260,13 +8317,8 @@ msgstr "(только GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Добавить вход" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" -msgstr "Добавить вход" +msgid "Add Output" +msgstr "Добавить выход +" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8278,7 +8330,12 @@ msgstr "Вектор" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" -msgstr "" +msgstr "ЛогичеÑкое" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "СÑмплы" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" @@ -8331,9 +8388,8 @@ msgid "Set Uniform Name" msgstr "Задать единообразное имÑ" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "Задать Порт по умолчанию Ð´Ð»Ñ Ð’Ð²Ð¾Ð´Ð°" +msgstr "Задать входной порт по умолчанию" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add Node to Visual Shader" @@ -8384,7 +8440,7 @@ msgstr "Ð¤ÑƒÐ½ÐºÑ†Ð¸Ñ Ñ†Ð²ÐµÑ‚Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color operator." -msgstr "" +msgstr "Оператор цвета." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8405,85 +8461,96 @@ msgid "Sepia function." msgstr "Переименовать функцию" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Burn operator." -msgstr "" +msgstr "Оператор выгораниÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Darken operator." -msgstr "" +msgstr "Оператор затемнениÑ." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Difference operator." -msgstr "Только разница" +msgstr "Оператор разницы." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Dodge operator." -msgstr "" +msgstr "Оператор выцветаниÑ." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "HardLight operator" -msgstr "" +msgstr "Оператор жёÑткого Ñвета." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Lighten operator." -msgstr "" +msgstr "Оператор оÑветлениÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Overlay operator." -msgstr "" +msgstr "Оператор наложениÑ." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Screen operator." -msgstr "" +msgstr "Оператор Ñкрана." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "SoftLight operator." -msgstr "" +msgstr "Оператор мÑгкого Ñвета." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Color constant." -msgstr "ПоÑтоÑнный" +msgstr "Ð¦Ð²ÐµÑ‚Ð¾Ð²Ð°Ñ ÐºÐ¾Ð½Ñтанта." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Color uniform." -msgstr "ОчиÑтить преобразование" +msgstr "Ð¦Ð²ÐµÑ‚Ð¾Ð²Ð°Ñ uniform." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the %s comparison between two parameters." -msgstr "" +msgstr "Возвращает логичеÑкий результат ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ %s между Ð´Ð²ÑƒÐ¼Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°Ð¼Ð¸." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Equal (==)" -msgstr "" +msgstr "Равно (==)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Greater Than (>)" -msgstr "" +msgstr "Больше (>)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Greater Than or Equal (>=)" -msgstr "" +msgstr "Больше или равно (>=)" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." msgstr "" +"Возвращает ÑвÑзанный вектор, еÑли предоÑтавленные ÑкалÑры равны, больше или " +"меньше." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Returns the boolean result of the comparison between INF and a scalar " "parameter." -msgstr "" +msgstr "Возвращает логичеÑкий результат ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ INF и ÑкалÑрного параметра." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Returns the boolean result of the comparison between NaN and a scalar " "parameter." -msgstr "" +msgstr "Возвращает логичеÑкий результат ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ NaN и ÑкалÑрного параметра." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Less Than (<)" @@ -8491,44 +8558,55 @@ msgstr "Меньше, чем (<)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Less Than or Equal (<=)" -msgstr "" +msgstr "Меньше или равно (<=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Not Equal (!=)" -msgstr "" +msgstr "Ðе равно (!=)" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" +"Возвращает ÑвÑзанный вектор, еÑли предоÑтавленное логичеÑкое значение равно " +"true или false." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" +"Возвращает ÑвÑзанный ÑкалÑÑ€, еÑли предоÑтавленное логичеÑкое значение равно " +"true или false." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Returns the boolean result of the comparison between two parameters." -msgstr "" +msgstr "Возвращает логичеÑкий результат ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ Ð´Ð²ÑƒÑ… параметров." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Returns the boolean result of the comparison between INF (or NaN) and a " "scalar parameter." msgstr "" +"Возвращает логичеÑкий результат ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ INF (или NaN) и ÑкалÑрного " +"параметра." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." -msgstr "Изменить векторную конÑтанту" +msgstr "ЛогичеÑÐºÐ°Ñ ÐºÐ¾Ð½Ñтанта." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Boolean uniform." -msgstr "" +msgstr "ЛогичеÑÐºÐ°Ñ uniform." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for all shader modes." -msgstr "" +msgstr "Входной параметр «%s» Ð´Ð»Ñ Ð²Ñех режимов шейдера." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8537,27 +8615,29 @@ msgstr "ПривÑзка к родителю" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader modes." -msgstr "" +msgstr "Входной параметр «%s» Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð¾Ð² вершинного и фрагментного шейдеров." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "'%s' input parameter for fragment and light shader modes." msgstr "" +"Входной параметр «%s» Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð¾Ð² фрагментного шейдера и шейдера оÑвещениÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for fragment shader mode." -msgstr "" +msgstr "Входной параметр «%s» Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð° фрагментного шейдера." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for light shader mode." -msgstr "" +msgstr "Входной параметр «%s» Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð° шейдера оÑвещениÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex shader mode." -msgstr "" +msgstr "Входной параметр «%s» Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð° вершинного шейдера." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader mode." -msgstr "" +msgstr "Входной параметр «%s» Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð° вершинного и фрагментного шейдеров." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar function." @@ -8570,66 +8650,67 @@ msgstr "СкалÑрный оператор." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "E constant (2.718282). Represents the base of the natural logarithm." msgstr "" +"ЧиÑло e (2,718282). ПредÑтавлÑет Ñобой оÑнование натурального логарифма." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Epsilon constant (0.00001). Smallest possible scalar number." -msgstr "" +msgstr "ÐпÑилон-конÑтанта (0,00001). Ðаименьшее возможное ÑкалÑрное чиÑло." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Phi constant (1.618034). Golden ratio." -msgstr "" +msgstr "КонÑтанта Фи (1,618034). Золотое Ñечение." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/4 constant (0.785398) or 45 degrees." -msgstr "" +msgstr "КонÑтанта Пи/4 (0,785398) или 45 градуÑов." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/2 constant (1.570796) or 90 degrees." -msgstr "" +msgstr "КонÑтанта Пи/2 (1,570796) или 90 градуÑов." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi constant (3.141593) or 180 degrees." -msgstr "" +msgstr "КонÑтанта Пи (3,141593) или 180 градуÑов." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Tau constant (6.283185) or 360 degrees." -msgstr "" +msgstr "КонÑтанта Тау (6,283185) или 360 градуÑов." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Sqrt2 constant (1.414214). Square root of 2." -msgstr "" +msgstr "КонÑтанта Sqrt2 (1,414214). Квадратный корень из 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the absolute value of the parameter." -msgstr "" +msgstr "Возвращает абÑолютное значение параметра." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-cosine of the parameter." -msgstr "" +msgstr "Возвращает арккоÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse hyperbolic cosine of the parameter." -msgstr "" +msgstr "Возвращает обратный гиперболичеÑкий коÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." -msgstr "" +msgstr "Возвращает аркÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse hyperbolic sine of the parameter." -msgstr "" +msgstr "Возвращает обратный гиперболичеÑкий ÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." -msgstr "" +msgstr "Возвращает Ð°Ñ€ÐºÑ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameters." -msgstr "" +msgstr "Возвращает Ð°Ñ€ÐºÑ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð²." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse hyperbolic tangent of the parameter." -msgstr "" +msgstr "Возвращает обратный гиперболичеÑкий Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8637,8 +8718,9 @@ msgid "" msgstr "ВычиÑлÑет ближайшее целое чиÑло, большее или равное аргументу." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Constrains a value to lie between two further values." -msgstr "" +msgstr "Ограничивает значение лежать между Ð´Ð²ÑƒÐ¼Ñ Ð´Ñ€ÑƒÐ³Ð¸Ð¼Ð¸ значениÑми." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the cosine of the parameter." @@ -8654,11 +8736,11 @@ msgstr "Переводит значение из радиан в градуÑÑ‹. #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-e Exponential." -msgstr "" +msgstr "ÐкÑпонента Ñ Ð¾Ñнованием e." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-2 Exponential." -msgstr "" +msgstr "ÐкÑпонента Ñ Ð¾Ñнованием 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Finds the nearest integer less than or equal to the parameter." @@ -8694,16 +8776,16 @@ msgstr "Ð›Ð¸Ð½ÐµÐ¹Ð½Ð°Ñ Ð¸Ð½Ñ‚ÐµÑ€Ð¿Ð¾Ð»ÑÑ†Ð¸Ñ Ð¼ÐµÐ¶Ð´Ñƒ Ð´Ð²ÑƒÐ¼Ñ Ñкал #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the opposite value of the parameter." -msgstr "" +msgstr "Возвращает значение, противоположное параметру." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - scalar" -msgstr "" +msgstr "1.0 - ÑкалÑÑ€" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns the value of the first parameter raised to the power of the second." -msgstr "" +msgstr "Возвращает значение первого параметра, возведенное в Ñтепень второго." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in degrees to radians." @@ -8711,7 +8793,7 @@ msgstr "Переводит значение из градуÑов в радиаР#: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / scalar" -msgstr "" +msgstr "1.0 / ÑкалÑÑ€" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Finds the nearest integer to the parameter." @@ -8727,19 +8809,19 @@ msgstr "Ограничивает значение в пределах от 0.0 Ð #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Extracts the sign of the parameter." -msgstr "" +msgstr "Извлекает знак параметра." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the sine of the parameter." -msgstr "" +msgstr "Возвращает ÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the hyperbolic sine of the parameter." -msgstr "" +msgstr "Возвращает гиперболичеÑкий ÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." -msgstr "" +msgstr "Возвращает квадратный корень из параметра." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8751,27 +8833,32 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Step function( scalar(edge), scalar(x) ).\n" "\n" "Returns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0." msgstr "" +"Ð¤ÑƒÐ½ÐºÑ†Ð¸Ñ Ð¨Ð°Ð³( ÑкалÑÑ€(граница), ÑкалÑÑ€(Ñ…) ).\n" +"\n" +"Возвращает 0.0, еÑли x меньше чем граница, иначе — 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the tangent of the parameter." -msgstr "" +msgstr "Возвращает Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the hyperbolic tangent of the parameter." -msgstr "" +msgstr "Возвращает гиперболичеÑкий Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Finds the truncated value of the parameter." -msgstr "" +msgstr "Ðаходит уÑечённое до целого значение параметра." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." -msgstr "" +msgstr "ДобавлÑет ÑкалÑÑ€ к ÑкалÑру." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides scalar by scalar." @@ -8782,12 +8869,13 @@ msgid "Multiplies scalar by scalar." msgstr "Умножает ÑкалÑÑ€ на ÑкалÑÑ€." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Returns the remainder of the two scalars." -msgstr "" +msgstr "Возвращает оÑтаток от двух ÑкалÑров." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts scalar from scalar." -msgstr "" +msgstr "Вычитает ÑкалÑÑ€ из ÑкалÑра." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8800,12 +8888,14 @@ msgid "Scalar uniform." msgstr "Изменить чиÑловую единицу" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Perform the cubic texture lookup." -msgstr "" +msgstr "ВыполнÑет поиÑк кубичеÑкой текÑтуры." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Perform the texture lookup." -msgstr "" +msgstr "ВыполнÑет поиÑк текÑтуры." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8837,18 +8927,28 @@ msgid "" "whose number of rows is the number of components in 'c' and whose number of " "columns is the number of components in 'r'." msgstr "" +"ВычиÑлÑет внешнее произведение пары векторов.\n" +"\n" +"Внешнее произведение раÑÑматривает первый параметр «c» как вектор-Ñтолбец " +"(матрица, ÑоÑтоÑÑ‰Ð°Ñ Ð¸Ð· одного Ñтолбца), а второй параметр «r» — как вектор-" +"Ñтроку (матрица, ÑоÑтоÑÑ‰Ð°Ñ Ð¸Ð· одной Ñтроки) и оÑущеÑтвлÑет линейно-" +"алгебраичеÑкое умножение «c * r», в результате чего образуетÑÑ Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†Ð°, " +"количеÑтво Ñтрок которой равно количеÑтву компонентов в «c», а количеÑтво " +"Ñтолбцов — количеÑтву компонентов в «r»." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Composes transform from four vectors." -msgstr "" +msgstr "СоÑтавлÑет преобразование из четырёх векторов." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Decomposes transform to four vectors." -msgstr "" +msgstr "РаÑкладывает преобразование на четыре вектора." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the determinant of a transform." -msgstr "" +msgstr "ВычиÑлÑет детерминант Ð¿Ñ€ÐµÐ¾Ð±Ñ€Ð°Ð·Ð¾Ð²Ð°Ð½Ð¸Ñ (матрицы транÑформации)." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the inverse of a transform." @@ -8856,15 +8956,15 @@ msgstr "ВычиÑлÑет обратную транÑформацию." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the transpose of a transform." -msgstr "" +msgstr "ВычиÑлÑет транÑпонирование преобразованиÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." -msgstr "" +msgstr "Умножает преобразование на преобразование." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by transform." -msgstr "" +msgstr "Умножает вектор на преобразование." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8913,6 +9013,10 @@ msgid "" "incident vector, and Nref, the reference vector. If the dot product of I and " "Nref is smaller than zero the return value is N. Otherwise -N is returned." msgstr "" +"Возвращает вектор, который указывает в том же направлении, что и Ñталонный " +"вектор. Ð¤ÑƒÐ½ÐºÑ†Ð¸Ñ Ð¸Ð¼ÐµÐµÑ‚ три векторных параметра: N, вектор Ð´Ð»Ñ Ð¾Ñ€Ð¸ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ð¸, I, " +"вектор инцидента и Nref, Ñталонный вектор. ЕÑли ÑкалÑрное произведение I и " +"Nref меньше нулÑ, возвращаетÑÑ N. Ð’ противном Ñлучае возвращаетÑÑ -N." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." @@ -8929,25 +9033,27 @@ msgstr "Ð›Ð¸Ð½ÐµÐ¹Ð½Ð°Ñ Ð¸Ð½Ñ‚ÐµÑ€Ð¿Ð¾Ð»ÑÑ†Ð¸Ñ Ð¼ÐµÐ¶Ð´Ñƒ Ð´Ð²ÑƒÐ¼Ñ Ð²ÐµÐºÑ‚ #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the normalize product of vector." -msgstr "" +msgstr "ВычиÑлÑет нормализованное произведение векторов." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - vector" -msgstr "" +msgstr "1.0 - вектор" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / vector" -msgstr "" +msgstr "1.0 / вектор" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" +"Возвращает вектор, который указывает в направлении Ð¾Ñ‚Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ ( a : вектор " +"падениÑ, b : нормальный вектор )." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the vector that points in the direction of refraction." -msgstr "" +msgstr "Возвращает вектор, который указывает в направлении преломлениÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8995,11 +9101,11 @@ msgstr "Умножает вектор на вектор." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two vectors." -msgstr "" +msgstr "Возвращает оÑтаток от двух векторов." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts vector from vector." -msgstr "" +msgstr "Вычитает вектор из вектора." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9017,6 +9123,9 @@ msgid "" "output ports. This is a direct injection of code into the vertex/fragment/" "light function, do not use it to write the function declarations inside." msgstr "" +"ПользовательÑкое выражение Ñзыка шейдеров Godot Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÑŒÑким " +"количеÑтвом входных и выходных портов. Ðто прÑмое внедрение кода в функцию " +"вершины/фрагмента/Ñвета, не иÑпользуйте его Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñи объÑÐ²Ð»ÐµÐ½Ð¸Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ð¹." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9030,6 +9139,10 @@ msgid "" "shader. You can place various function definitions inside and call it later " "in the Expressions. You can also declare varyings, uniforms and constants." msgstr "" +"ПользовательÑкое выражение Ñзыка шейдеров Godot, которое помещаетÑÑ Ð² " +"верхней чаÑти шейдера. Ð’Ñ‹ можете размеÑтить внутри различные объÑÐ²Ð»ÐµÐ½Ð¸Ñ " +"функций и вызвать их позже в ВыражениÑÑ…. Ð’Ñ‹ также можете объÑвить varyings, " +"uniforms и конÑтанты." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(Fragment/Light mode only) Scalar derivative function." @@ -9040,40 +9153,58 @@ msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "(Fragment/Light mode only) (Vector) Derivative in 'x' using local " "differencing." msgstr "" +"(Только в режиме Фрагмент/Свет) (Вектор) ÐŸÑ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð½Ð°Ñ Ð¿Ð¾ «x» Ñ Ð¸Ñпользованием " +"локального дифференцированиÑ." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " "differencing." msgstr "" +"(Только в режиме Фрагмент/Свет) (СкалÑÑ€) ÐŸÑ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð½Ð°Ñ Ð¿Ð¾ «x» Ñ Ð¸Ñпользованием " +"локального дифференцированиÑ." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "(Fragment/Light mode only) (Vector) Derivative in 'y' using local " "differencing." msgstr "" +"(Только в режиме Фрагмент/Свет) (Вектор) ÐŸÑ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð½Ð°Ñ Ð¿Ð¾ «y» Ñ Ð¸Ñпользованием " +"локального дифференцированиÑ." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " "differencing." msgstr "" +"(Только в режиме Фрагмент/Свет) (СкалÑÑ€) ÐŸÑ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð½Ð°Ñ Ð¿Ð¾ «y» Ñ Ð¸Ñпользованием " +"локального дифференцированиÑ." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " "'y'." msgstr "" +"(Только в режиме Фрагмент/Свет) (Вектор) Сумма абÑолютных значений " +"производных по «x» и «y»." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " "'y'." msgstr "" +"(Только в режиме Фрагмент/Свет) (СкалÑÑ€) Сумма абÑолютных значений " +"производных по «x» и «y»." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -9173,15 +9304,19 @@ msgid "Resources to export:" msgstr "РеÑурÑÑ‹ Ð´Ð»Ñ ÑкÑпорта:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Фильтр Ð´Ð»Ñ ÑкÑпорта не реÑурÑных файлов (через запÑтую, например: *.json, *." "txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "Фильтр Ð´Ð»Ñ Ð¸ÑÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ (через запÑтую, например: *.json, *.txt)" #: editor/project_export.cpp @@ -9419,7 +9554,7 @@ msgstr "Импортировать ÑущеÑтвующий проект" #: editor/project_manager.cpp msgid "Error: Project is missing on the filesystem." -msgstr "" +msgstr "Ошибка: Проект отÑутÑтвует в файловой ÑиÑтеме." #: editor/project_manager.cpp msgid "Can't open project at '%s'." @@ -10212,7 +10347,7 @@ msgstr "Удалить узел(Ñ‹) графа шейдера" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "Удалить узел «%s» и его дочерние Ñлементы?" #: editor/scene_tree_dock.cpp #, fuzzy @@ -10240,12 +10375,13 @@ msgstr "" "узла будут возвращены к значениÑм по умолчанию." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Редактируемые потомки" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Загрузить как заполнитель" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Отключение параметра \"editable_instance\" приведет к тому, что вÑе ÑвойÑтва " +"узла будут возвращены к значениÑм по умолчанию." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10322,6 +10458,14 @@ msgid "Clear Inheritance" msgstr "ОчиÑтить наÑледование" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Редактируемые потомки" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Загрузить как заполнитель" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Открыть документацию" @@ -10338,10 +10482,6 @@ msgid "Change Type" msgstr "Изменить тип" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "РаÑширить Ñкрипт" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "Переподчинить узел" @@ -10608,23 +10748,18 @@ msgid "Will load an existing script file." msgstr "Загрузить ÑущеÑтвующий Ñкрипт" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Язык" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "ÐаÑледует" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Ð˜Ð¼Ñ ÐšÐ»Ð°ÑÑа" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Шаблон" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Ð’Ñтроенный Скрипт" #: editor/script_create_dialog.cpp @@ -10783,7 +10918,7 @@ msgstr "УÑтановить из дерева" #: editor/script_editor_debugger.cpp msgid "Export measures as CSV" -msgstr "" +msgstr "ÐкÑпорт измерений в CSV" #: editor/settings_config_dialog.cpp msgid "Erase Shortcut" @@ -10919,12 +11054,11 @@ msgstr "GDNative библиотека" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Enabled GDNative Singleton" -msgstr "" +msgstr "Включён GDNative Ñинглтон" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Disabled GDNative Singleton" -msgstr "Отключить Ñчётчик обновлений" +msgstr "Выключен GDNative Ñинглтон" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Library" @@ -10940,7 +11074,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "ОжидалаÑÑŒ Ñтрока длиной 1 (Ñимвол)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -11104,6 +11238,7 @@ msgstr "Режим фильтра:" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." msgstr "" +"ПредоÑтавьте реÑÑƒÑ€Ñ MeshLibrary Ñтой GridMap, чтобы иÑпользовать его Ñетки." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11282,6 +11417,11 @@ msgid "Add Function" msgstr "Добавить функцию" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Удалить входной порт" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Добавить переменную" @@ -11290,6 +11430,26 @@ msgid "Add Signal" msgstr "Добавить Ñигнал" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Добавить входной порт" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Добавить выходной порт" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Удалить входной порт" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Удалить выходной порт" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Изменить выражение" @@ -11334,10 +11494,20 @@ msgid "Add Preload Node" msgstr "Добавить предзагрузочный узел" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Добавить узел(узлы) из дерева" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Добавить получающее ÑвойÑтво" @@ -11362,6 +11532,11 @@ msgid "Connect Nodes" msgstr "ПриÑоединить узлы" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Разъединить узлы графа" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "ПриÑоединить данные узла" @@ -11394,6 +11569,28 @@ msgid "Paste VisualScript Nodes" msgstr "Ð’Ñтавить узлы VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Ðе удаётÑÑ Ñкопировать узел функцию." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Переименовать функцию" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Удалить функцию" @@ -11419,16 +11616,13 @@ msgid "Make Tool:" msgstr "Сделать локальным" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Базовый тип:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "СвойÑтва:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "ДоÑтупные узлы:" +#, fuzzy +msgid "function_name" +msgstr "ФункциÑ:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11452,6 +11646,16 @@ msgid "Cut Nodes" msgstr "Вырезать узлы" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Переименовать функцию" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Обновить" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Редактировать Ñлемент" @@ -11549,6 +11753,10 @@ msgid "The package must have at least one '.' separator." msgstr "Пакет должен иметь Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один '.' разделитель." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Выберите уÑтройÑтво из ÑпиÑка" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "ИÑполнÑемый файл ADB не Ñконфигурирован в наÑтройках редактора." @@ -11565,10 +11773,14 @@ msgstr "" #: platform/android/export/export.cpp msgid "Custom build requires a valid Android SDK path in Editor Settings." msgstr "" +"ПользовательÑÐºÐ°Ñ Ñборка требует Ð½Ð°Ð»Ð¸Ñ‡Ð¸Ñ Ð¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð¾Ð³Ð¾ пути к Android SDK в " +"наÑтройках редактора." #: platform/android/export/export.cpp msgid "Invalid Android SDK path for custom build in Editor Settings." msgstr "" +"Ðеправильный путь к Android SDK Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÑŒÑкой Ñборки в наÑтройках " +"редактора." #: platform/android/export/export.cpp #, fuzzy @@ -11592,6 +11804,8 @@ msgid "" "Trying to build from a custom built template, but no version info for it " "exists. Please reinstall from the 'Project' menu." msgstr "" +"Попытка Ñборки из пользовательÑкого шаблона, но информации о верÑии Ð´Ð»Ñ Ð½ÐµÐ³Ð¾ " +"не ÑущеÑтвует. ПожалуйÑта, переуÑтановите из меню «Проект»." #: platform/android/export/export.cpp msgid "" @@ -11600,20 +11814,28 @@ msgid "" " Godot Version: %s\n" "Please reinstall Android build template from 'Project' menu." msgstr "" +"ÐеÑоответÑтвие верÑии Ñборки Android:\n" +" УÑтановлен шаблон: %s\n" +" ВерÑÐ¸Ñ Godot: %s\n" +"ПожалуйÑта, переуÑтановите шаблон Ñборки Android из меню «Проект»." #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" -msgstr "" +msgstr "Сборка проекта Android (gradle)" #: platform/android/export/export.cpp msgid "" "Building of Android project failed, check output for the error.\n" "Alternatively visit docs.godotengine.org for Android build documentation." msgstr "" +"Сборка проекта Android не удалаÑÑŒ, проверьте вывод на ошибки.\n" +"Также поÑетите docs.godotengine.org Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ð¸ по Ñборке " +"Android." #: platform/android/export/export.cpp +#, fuzzy msgid "No build apk generated at: " -msgstr "" +msgstr "Ðет Ñборки apk в: " #: platform/iphone/export/export.cpp msgid "Identifier is missing." @@ -11653,6 +11875,10 @@ msgid "Required icon is not specified in the preset." msgstr "Требуемый значок не указан в предуÑтановке." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "ЗапуÑтить в браузере" @@ -12175,6 +12401,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"WorldEnvironment требует, чтобы ее ÑвойÑтво \"Environment\" Ñодержало " +"Environment, чтобы иметь видимый Ñффект." #: scene/3d/world_environment.cpp msgid "" @@ -12270,6 +12498,9 @@ msgid "" "The Hint Tooltip won't be displayed as the control's Mouse Filter is set to " "\"Ignore\". To solve this, set the Mouse Filter to \"Stop\" or \"Pass\"." msgstr "" +"ПодÑказка не будет отображатьÑÑ, еÑли Ð´Ð»Ñ Ñ„Ð¸Ð»ÑŒÑ‚Ñ€Ð° мыши Ñлемента ÑƒÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ " +"уÑтановлено значение «Ignore». Чтобы Ñто иÑправить, уÑтановите MouseFilter в " +"положение «Stop» или «Pass»." #: scene/gui/dialogs.cpp msgid "Alert!" @@ -12333,10 +12564,6 @@ msgstr "" "Ñделайте её целью рендеринга и назначьте её внутреннюю текÑтуру какому-либо " "узлу Ð´Ð»Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Вход" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Ðеверный иÑточник Ð´Ð»Ñ Ð¿Ñ€ÐµÐ´Ð¿Ñ€Ð¾Ñмотра." @@ -12365,6 +12592,27 @@ msgstr "Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð³ÑƒÑ‚ быть назначены только Ð msgid "Constants cannot be modified." msgstr "КонÑтанты не могут быть изменены." +#~ msgid "Snap to Grid" +#~ msgstr "ПривÑзка к Ñетке" + +#~ msgid "Add input +" +#~ msgstr "Добавить вход +" + +#~ msgid "Language" +#~ msgstr "Язык" + +#~ msgid "Inherits" +#~ msgstr "ÐаÑледует" + +#~ msgid "Base Type:" +#~ msgstr "Базовый тип:" + +#~ msgid "Available Nodes:" +#~ msgstr "ДоÑтупные узлы:" + +#~ msgid "Input" +#~ msgstr "Вход" + #~ msgid "Properties:" #~ msgstr "СвойÑтва:" @@ -12588,9 +12836,6 @@ msgstr "КонÑтанты не могут быть изменены." #~ msgid "Go to parent folder" #~ msgstr "Перейти к родительÑкой папке" -#~ msgid "Select device from the list" -#~ msgstr "Выберите уÑтройÑтво из ÑпиÑка" - #~ msgid "Open Scene(s)" #~ msgstr "Открыть Ñцену(ны)" @@ -12828,9 +13073,6 @@ msgstr "КонÑтанты не могут быть изменены." #~ msgid "Warning" #~ msgstr "Предупреждение" -#~ msgid "Function:" -#~ msgstr "ФункциÑ:" - #~ msgid "Variable" #~ msgstr "ПеременнаÑ" @@ -12897,9 +13139,6 @@ msgstr "КонÑтанты не могут быть изменены." #~ msgid "Connect Graph Nodes" #~ msgstr "Соединить узлы графа" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Разъединить узлы графа" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Удалить узел графа шейдера" @@ -14040,9 +14279,6 @@ msgstr "КонÑтанты не могут быть изменены." #~ msgid "Group" #~ msgstr "Группа" -#~ msgid "Samples" -#~ msgstr "СÑмплы" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "Режим Ð¿Ñ€ÐµÐ¾Ð±Ñ€Ð°Ð·Ð¾Ð²Ð°Ð½Ð¸Ñ ÑÑмплов (.wav файлы):" diff --git a/editor/translations/si.po b/editor/translations/si.po index fbea8d1c7d..a5775be438 100644 --- a/editor/translations/si.po +++ b/editor/translations/si.po @@ -359,6 +359,7 @@ msgstr "%d සදහ෠ලුහුබදින්නන් à·ƒà·à¶¯à· යච#: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "à·ƒà·à¶¯à¶±à·Šà¶±" @@ -493,15 +494,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -636,7 +628,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -648,6 +640,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -966,7 +962,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1421,7 +1417,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1475,7 +1472,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1859,6 +1856,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2850,7 +2848,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3086,6 +3084,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3112,13 +3114,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3893,7 +3888,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4029,6 +4024,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4374,7 +4375,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4543,6 +4543,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4747,6 +4749,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5030,20 +5036,23 @@ msgid "Ruler Mode" msgstr "නිවේà·à¶± මà·à¶¯à·’ලිය" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5133,8 +5142,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5399,6 +5407,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6028,6 +6040,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6084,6 +6100,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6182,6 +6199,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6448,6 +6470,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6505,10 +6532,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6828,6 +6851,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6861,6 +6888,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7089,6 +7120,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7860,11 +7895,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7880,6 +7911,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8744,12 +8779,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9733,11 +9770,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9812,6 +9847,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9828,10 +9871,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -10058,23 +10097,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10711,6 +10742,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "යà¶à·”රු මක෠දමන්න" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10719,6 +10755,25 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "සජීවීකරණ පුනරà·à·€à¶»à·Šà¶®à¶±à¶º" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "මෙම ලුහුබදින්න෠ඉවà¶à·Š කරන්න." + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "මෙම ලුහුබදින්න෠ඉවà¶à·Š කරන්න." + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10759,10 +10814,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10787,6 +10852,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "යà¶à·”රු à¶´à·’à¶§à¶´à¶à·Š කරන්න" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10819,6 +10889,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "à·à·Šâ€à¶»à·’à¶:" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10843,16 +10934,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "à·à·Šâ€à¶»à·’à¶:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -10875,6 +10963,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "à·à·Šâ€à¶»à·’à¶:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10969,6 +11066,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11068,6 +11169,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11605,10 +11710,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/sk.po b/editor/translations/sk.po index 348dd044e6..88eddf57db 100644 --- a/editor/translations/sk.po +++ b/editor/translations/sk.po @@ -366,6 +366,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "VytvoriÅ¥" @@ -498,16 +499,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "VÅ¡etky vybrané" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -645,8 +636,9 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "NastaviÅ¥ prechody na:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -657,6 +649,11 @@ msgstr "" msgid "Copy" msgstr "KopÃrovaÅ¥" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "VÅ¡etky vybrané" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -988,7 +985,7 @@ msgid "Resource" msgstr "Prostriedok" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Cesta" @@ -1454,7 +1451,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Cesta:" @@ -1508,7 +1506,7 @@ msgstr "VytvoriÅ¥ adresár" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Meno:" @@ -1909,6 +1907,7 @@ msgid "Class:" msgstr "Trieda:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2923,7 +2922,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3168,6 +3167,11 @@ msgstr "" msgid "New Script" msgstr "Popis:" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Popis:" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3194,14 +3198,6 @@ msgstr "VložiÅ¥" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Otvorit prieÄinok" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4001,7 +3997,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4145,6 +4141,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Otvorit prieÄinok" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4496,7 +4499,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4670,6 +4672,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4879,6 +4883,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5172,20 +5180,23 @@ msgid "Ruler Mode" msgstr "Režim Interpolácie" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5277,8 +5288,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5548,6 +5558,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6194,6 +6208,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6250,6 +6268,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6352,6 +6371,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Filter:" @@ -6630,6 +6654,11 @@ msgstr "VÅ¡etky vybrané" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6688,10 +6717,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -7021,6 +7046,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7054,6 +7083,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7287,6 +7320,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8106,14 +8143,10 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" +msgid "Add Output" msgstr "Signály:" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" msgstr "" @@ -8126,6 +8159,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Signály:" @@ -9002,12 +9039,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10008,11 +10047,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10089,6 +10126,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Popis:" @@ -10107,11 +10152,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Popis:" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "VytvoriÅ¥ adresár" @@ -10350,26 +10390,19 @@ msgid "Will load an existing script file." msgstr "Popis:" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp #, fuzzy -msgid "Class Name" +msgid "Class Name:" msgstr "Trieda:" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" +msgid "Template:" msgstr "VÅ¡etky vybrané" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Popis:" #: editor/script_create_dialog.cpp #, fuzzy @@ -11023,6 +11056,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "VÅ¡etky vybrané" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11032,6 +11070,26 @@ msgid "Add Signal" msgstr "Signály:" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Signály:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Signály:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "VÅ¡etky vybrané" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "VÅ¡etky vybrané" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11072,10 +11130,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11101,6 +11169,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "OdpojiÅ¥" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -11134,6 +11207,27 @@ msgid "Paste VisualScript Nodes" msgstr "VložiÅ¥" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "VÅ¡etky vybrané" + +#: modules/visual_script/visual_script_editor.cpp #, fuzzy msgid "Remove Function" msgstr "VÅ¡etky vybrané" @@ -11161,16 +11255,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "Funkcie:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11194,6 +11285,15 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "VÅ¡etky vybrané" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Súbor:" @@ -11289,6 +11389,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11390,6 +11494,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11947,10 +12055,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12068,9 +12172,6 @@ msgstr "" #~ msgid "Show current scene file." #~ msgstr "VytvoriÅ¥ adresár" -#~ msgid "Set Transitions to:" -#~ msgstr "NastaviÅ¥ prechody na:" - #~ msgid "In" #~ msgstr "V" diff --git a/editor/translations/sl.po b/editor/translations/sl.po index 9d36fee05d..8b9ed3f61a 100644 --- a/editor/translations/sl.po +++ b/editor/translations/sl.po @@ -9,12 +9,14 @@ # Yahara Octanis <yaharao55@gmail.com>, 2018. # Tine Jozelj <tine@tjo.space>, 2018. # Andrej Poženel <andrej.pozenel@outlook.com>, 2019. +# Arnold Marko <arnold.marko@gmail.com>, 2019. +# Alex <alexrixhardson@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-08-29 13:35+0000\n" -"Last-Translator: Andrej Poženel <andrej.pozenel@outlook.com>\n" +"PO-Revision-Date: 2019-10-26 03:53+0000\n" +"Last-Translator: Alex <alexrixhardson@gmail.com>\n" "Language-Team: Slovenian <https://hosted.weblate.org/projects/godot-engine/" "godot/sl/>\n" "Language: sl\n" @@ -23,7 +25,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" "%100==4 ? 2 : 3;\n" -"X-Generator: Weblate 3.9-dev\n" +"X-Generator: Weblate 3.9.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -34,8 +36,7 @@ msgstr "Neveljavna vrsta argumenta za convert(), uporabite TYPE_* konstanto." #: modules/mono/glue/gd_glue.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "" -"Ni dovolj pomnilnika za dekodiranje bajtov, ali pa je neveljaven format." +msgstr "Ni dovolj bajtov za dekodiranje, ali pa format ni ustrezen." #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" @@ -50,13 +51,12 @@ msgid "Invalid operands to operator %s, %s and %s." msgstr "Neveljaven operand za operator %s, %s ter %s." #: core/math/expression.cpp -#, fuzzy msgid "Invalid index of type %s for base type %s" -msgstr "Neveljaven indeks lastnosti imena '%s' v vozliÅ¡Äu %s." +msgstr "Neveljaven indeks tipa '%s' za temeljni tip %s" #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" -msgstr "" +msgstr "NapaÄno poimenovan indeks '%s' za temeljni tip %s" #: core/math/expression.cpp msgid "Invalid arguments to construct '%s'" @@ -68,32 +68,31 @@ msgstr "Na klic '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "MeÅ¡aj" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -316,7 +315,7 @@ msgstr "Prihodnost" #: editor/animation_track_editor.cpp msgid "Nearest" -msgstr "" +msgstr "Najbližji" #: editor/animation_track_editor.cpp editor/plugins/curve_editor_plugin.cpp #: editor/property_editor.cpp @@ -385,6 +384,7 @@ msgstr "Ustvarim %d NOVO sled in vstavim kljuÄe?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Ustvari" @@ -429,6 +429,10 @@ msgid "" "-AudioStreamPlayer2D\n" "-AudioStreamPlayer3D" msgstr "" +"ZvoÄne steze lahko kažejo le na vozliÅ¡Äa tipa:\n" +"- AudioStreamPlayer\n" +"-AudioStreamPlayer2D\n" +"-AudioStreamPlayer3D" #: editor/animation_track_editor.cpp msgid "Animation tracks can only point to AnimationPlayer nodes." @@ -453,7 +457,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Track is not of type Spatial, can't insert key" -msgstr "" +msgstr "Steza ni tipa Prostorska, zato ne morem vstaviti kljuÄa" #: editor/animation_track_editor.cpp #, fuzzy @@ -518,16 +522,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Izberi Gradnik" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -671,8 +665,9 @@ msgid "Scale Ratio:" msgstr "Razmerje Obsega:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "Izberi Lastnost" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -683,6 +678,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Izberi Gradnik" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1023,7 +1023,7 @@ msgid "Resource" msgstr "Viri" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Pot" @@ -1499,7 +1499,8 @@ msgstr "Dodaj SamodejnoNalaganje" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Pot:" @@ -1554,7 +1555,7 @@ msgstr "Ustvarite Mapo" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Ime:" @@ -1974,6 +1975,7 @@ msgid "Class:" msgstr "Razred:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Dedovanja:" @@ -3074,7 +3076,7 @@ msgstr "Nadzornik" msgid "Expand Bottom Panel" msgstr "RazÅ¡iri vse" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Izhod" @@ -3316,6 +3318,11 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Zaženi Skripto" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3342,14 +3349,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Odpri 2D Urejevalnik" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4181,7 +4180,7 @@ msgstr "VtiÄniki" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4335,6 +4334,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Odpri 2D Urejevalnik" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4706,7 +4712,6 @@ msgstr "Ime Animacije:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Napaka!" @@ -4883,6 +4888,8 @@ msgid "Current:" msgstr "Trenutno:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Dodaj Vnos" @@ -5098,6 +5105,10 @@ msgid "All" msgstr "Vse" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Uvozi" @@ -5414,23 +5425,28 @@ msgstr "NaÄin Obsega (R)" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "Preklopi pripenjanje" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Uporabi Pripenjanje" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "Možnosti pripenjanja" +msgid "Toggle grid snapping." +msgstr "Preklopi pripenjanje" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "Pripni na mrežo" +msgid "Use Grid Snap" +msgstr "Uporabi Pripenjanje" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "Možnosti pripenjanja" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5528,8 +5544,7 @@ msgid "View" msgstr "Pogled" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5800,6 +5815,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6444,6 +6463,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "Nastavi Zaskok" @@ -6505,6 +6528,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6614,6 +6638,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Lastnosti objekta." @@ -6896,6 +6925,11 @@ msgstr "IzbriÅ¡i toÄke" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "IzbriÅ¡i Vrstico" @@ -6954,10 +6988,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Filtriraj datoteke..." @@ -7292,6 +7322,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7330,6 +7364,10 @@ msgid "Use Local Space" msgstr "Lokalno prostorski naÄin (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Uporabi Pripenjanje" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7566,6 +7604,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8399,12 +8441,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Dodaj Vnos" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "Dodaj Vnos" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8422,6 +8459,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Dodaj Vnos" @@ -9307,12 +9348,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10326,11 +10369,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10409,6 +10450,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Odpri Nedavne" @@ -10428,11 +10477,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Zaženi Skripto" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Ustvari Nov %s" @@ -10680,24 +10724,19 @@ msgid "Will load an existing script file." msgstr "Naloži obstojeÄo Postavitev Vodila." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Razred:" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Predloga" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Zaženi Skripto" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11362,6 +11401,11 @@ msgid "Add Function" msgstr "Dodaj Funkcijo" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Odstrani toÄko" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Dodaj Spremenljivko" @@ -11370,6 +11414,26 @@ msgid "Add Signal" msgstr "Dodaj Signal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Dodaj Vnos" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Dodaj Vnos" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Odstrani toÄko" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Odstrani toÄko" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11410,10 +11474,20 @@ msgid "Add Preload Node" msgstr "Dodaj prednaloženo vozliÅ¡Äe" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Dodaj Gradnik(e) iz Drevesa" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Dodaj Getter Lastnost" @@ -11439,6 +11513,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Nepovezano" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Poveži se z Gradnikom:" @@ -11473,6 +11552,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Preimenuj Funkcijo" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Odstrani Funkcijo" @@ -11497,16 +11597,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Osnovni Tip:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "ÄŒlani:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Na voljo Nodes:" +#, fuzzy +msgid "function_name" +msgstr "Funkcije:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11531,6 +11628,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Preimenuj Funkcijo" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Osveži" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "ÄŒlani" @@ -11628,6 +11735,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Izberite napravo s seznama" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11730,6 +11841,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12303,11 +12418,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -#, fuzzy -msgid "Input" -msgstr "Dodaj Vnos" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12336,7 +12446,25 @@ msgstr "" #: servers/visual/shader_language.cpp msgid "Constants cannot be modified." -msgstr "" +msgstr "Konstante ni možno spreminjati." + +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "Pripni na mrežo" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Dodaj Vnos" + +#~ msgid "Base Type:" +#~ msgstr "Osnovni Tip:" + +#~ msgid "Available Nodes:" +#~ msgstr "Na voljo Nodes:" + +#, fuzzy +#~ msgid "Input" +#~ msgstr "Dodaj Vnos" #, fuzzy #~ msgid "Methods:" @@ -12460,9 +12588,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "Pojdi v nadrejeno mapo" -#~ msgid "Select device from the list" -#~ msgstr "Izberite napravo s seznama" - #~ msgid "Open Scene(s)" #~ msgstr "Odpri Prizor(e)" diff --git a/editor/translations/sq.po b/editor/translations/sq.po index 2de6fb6772..dbea1057fc 100644 --- a/editor/translations/sq.po +++ b/editor/translations/sq.po @@ -354,6 +354,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Krijo" @@ -479,16 +480,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Zgjidh" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -623,7 +614,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -635,6 +626,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Zgjidh" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Shto Klip Audio" @@ -966,7 +962,7 @@ msgid "Resource" msgstr "Resursi" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Rrugë" @@ -1440,7 +1436,8 @@ msgstr "Shto Autoload" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Rruga:" @@ -1495,7 +1492,7 @@ msgstr "Krijo një Folder" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Emri:" @@ -1912,6 +1909,7 @@ msgid "Class:" msgstr "Klasa:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Trashëgon:" @@ -3000,7 +2998,7 @@ msgstr "Inspektori" msgid "Expand Bottom Panel" msgstr "Zgjero Panelin Fundor" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Përfundimi" @@ -3248,6 +3246,10 @@ msgstr "Zgjidh një 'Viewport'" msgid "New Script" msgstr "Shkrim i Ri" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "%s i Ri" @@ -3274,13 +3276,6 @@ msgstr "Ngjit" msgid "Convert To %s" msgstr "Konverto në %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Hap Editorin" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Nyja e zgjedhur nuk është një 'Viewport'!" @@ -4092,7 +4087,7 @@ msgstr "Emri i Shtojcës:" msgid "Subfolder:" msgstr "Subfolderi:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Gjuha:" @@ -4227,6 +4222,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Hap Editorin" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4569,7 +4570,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4737,6 +4737,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4947,6 +4949,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importo" @@ -5237,20 +5243,23 @@ msgid "Ruler Mode" msgstr "Ndrysho Mënyrën" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5340,8 +5349,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5608,6 +5616,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6239,6 +6251,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6295,6 +6311,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6395,6 +6412,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Filtro vetitë." @@ -6668,6 +6690,11 @@ msgstr "Krijo pika." msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6726,10 +6753,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -7054,6 +7077,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7087,6 +7114,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7320,6 +7351,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8097,12 +8132,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "Përfundimi" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8118,6 +8150,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Shto te të preferuarat" @@ -8985,12 +9021,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9982,11 +10020,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10061,6 +10097,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Hap të Fundit" @@ -10079,10 +10123,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "Krijo një Folder" @@ -10322,24 +10362,19 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Klasa:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Hiq Shabllonin" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Hap Editorin e Shkrimit" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -10987,6 +11022,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Hiq Autoload-in" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10995,6 +11035,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Shto te të preferuarat" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Shto te të preferuarat" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Hiq Autoload-in" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Hiq nga të preferuarat" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11035,10 +11095,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11063,6 +11133,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "U Shkëput" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -11095,6 +11170,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Krijo një Shtojcë" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11119,16 +11215,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "Funksionet:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11151,6 +11244,16 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Funksionet:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Rifresko" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -11245,6 +11348,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Zgjidh paisjen nga lista" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11344,6 +11451,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11881,10 +11992,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" @@ -11968,9 +12075,6 @@ msgstr "" #~ msgid "Delete selected files?" #~ msgstr "Fshi skedarët e zgjedhur?" -#~ msgid "Select device from the list" -#~ msgstr "Zgjidh paisjen nga lista" - #~ msgid "Open Scene(s)" #~ msgstr "Hap Skenat" diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po index 748f8a860b..fd8f5d95b3 100644 --- a/editor/translations/sr_Cyrl.po +++ b/editor/translations/sr_Cyrl.po @@ -385,6 +385,7 @@ msgstr "Ðаправите %d нових трака и убаците кључе #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Ðаправи" @@ -518,16 +519,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Одабери Ñве" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Одабери режим" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -670,8 +661,9 @@ msgid "Scale Ratio:" msgstr "Размера Ñкале:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "ПоÑтави прелаз на:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -682,6 +674,11 @@ msgstr "" msgid "Copy" msgstr "Копирај" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Одабери режим" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1026,7 +1023,7 @@ msgid "Resource" msgstr "РеÑурÑ" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Пут" @@ -1503,7 +1500,8 @@ msgstr "Додај аутоматÑко учитавање" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Пут:" @@ -1559,7 +1557,7 @@ msgstr "Ðаправи директоријум" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Име:" @@ -1981,6 +1979,7 @@ msgid "Class:" msgstr "КлаÑа:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "ÐаÑлеђује:" @@ -3086,7 +3085,7 @@ msgstr "ИнÑпектор" msgid "Expand Bottom Panel" msgstr "Прошири Ñве" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Излаз" @@ -3332,6 +3331,11 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Покрени Ñкриптицу" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3358,14 +3362,6 @@ msgstr "Ðалепи" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Отвори 2Д уредник" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4212,7 +4208,7 @@ msgstr "Прикључци" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4366,6 +4362,13 @@ msgstr "Помери тачку" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Отвори 2Д уредник" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4734,7 +4737,6 @@ msgstr "Име анимације:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Грешка!" @@ -4912,6 +4914,8 @@ msgid "Current:" msgstr "Тренутно:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Додај улаз" @@ -5126,6 +5130,10 @@ msgid "All" msgstr "Ñви" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Увоз" @@ -5435,23 +5443,28 @@ msgstr "Режим Ñкалирања (R)" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "Укљ./ИÑкљ. лепљења" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "КориÑти лепљење" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "ПоÑтавке залепљавања" +msgid "Toggle grid snapping." +msgstr "Укљ./ИÑкљ. лепљења" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "Залепи за мрежу" +msgid "Use Grid Snap" +msgstr "Лепљење по мрежи" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "ПоÑтавке залепљавања" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5549,8 +5562,8 @@ msgid "View" msgstr "Поглед" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Покажи мрежу" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5828,6 +5841,11 @@ msgstr "Линеарна тангента криве" msgid "Hold Shift to edit tangents individually" msgstr "Држи Shift за уређивање појединачних тангенти" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "ДеÑни клик: обриши тачку" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "ИÑпечи Ñонде глобалног оÑветљења (GI)" @@ -6483,6 +6501,10 @@ msgid "Grid" msgstr "Мрежа" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Покажи мрежу" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "Конфигурација лепљења" @@ -6545,6 +6567,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Тип:" @@ -6659,6 +6682,11 @@ msgid "Find Next" msgstr "Тражи Ñледећи" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Ðађи претходни" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "ПоÑтавке објекта." @@ -6948,6 +6976,11 @@ msgstr "Обриши тачке" msgid "Cut" msgstr "ИÑеци" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Одабери Ñве" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Обриши линију" @@ -7009,10 +7042,6 @@ msgid "Auto Indent" msgstr "ÐутоматÑко увлачење" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Ðађи претходни" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Филтрирај датотеке..." @@ -7355,6 +7384,11 @@ msgid "Freelook Speed Modifier" msgstr "Брзина Ñлободног погледа" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Брзина Ñлободног погледа" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7394,6 +7428,10 @@ msgid "Use Local Space" msgstr "Режим Ñкалирања (R)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "КориÑти лепљење" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Поглед одоздо" @@ -7634,6 +7672,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8489,12 +8531,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Додај улаз" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "Додај улаз" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8512,6 +8549,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Додај улаз" @@ -9416,13 +9457,16 @@ msgstr "РеÑурÑи за извоз:" #: editor/project_export.cpp #, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Филтери за извоз нереÑурÑких датотека (зарез за одвајање, пр. *.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Филтери за иÑкључивање датотека из пројекта (зарез за одвајање, пр. *.json, " "*.txt)" @@ -10445,11 +10489,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10531,6 +10573,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Отвори Godot онлајн документацију" @@ -10550,11 +10600,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Покрени Ñкриптицу" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Ðаправи нов" @@ -10801,24 +10846,19 @@ msgid "Will load an existing script file." msgstr "Учитај поÑтојећи Ð±Ð°Ñ Ñ€Ð°Ñпоред." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "КлаÑа:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Обриши шаблон" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Покрени Ñкриптицу" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11485,6 +11525,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Обриши тачку" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11493,6 +11538,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Додај улаз" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Додај улаз" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Обриши тачку" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Обриши тачку" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11533,10 +11598,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11562,6 +11637,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "ИÑкључи чворове графа" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Повежи Ñа чвором:" @@ -11596,6 +11676,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Ðаправи претплату" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11621,15 +11722,11 @@ msgid "Make Tool:" msgstr "Ðаправи коÑти" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Чланови:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -11654,6 +11751,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Промени векторÑку функцију" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "ОÑвежи" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Чланови" @@ -11749,6 +11856,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Одабери уређај Ñа лиÑте" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11850,6 +11961,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12402,11 +12517,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -#, fuzzy -msgid "Input" -msgstr "Додај улаз" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12439,6 +12549,18 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "Залепи за мрежу" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Додај улаз" + +#, fuzzy +#~ msgid "Input" +#~ msgstr "Додај улаз" + +#, fuzzy #~ msgid "Methods:" #~ msgstr "Методе" @@ -12605,9 +12727,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "Иди у родитељÑки директоријум" -#~ msgid "Select device from the list" -#~ msgstr "Одабери уређај Ñа лиÑте" - #, fuzzy #~ msgid "Open Scene(s)" #~ msgstr "Отвори Ñцену" @@ -12816,9 +12935,6 @@ msgstr "" #~ msgid "Toggle Rot Only" #~ msgstr "Само ротација" -#~ msgid "Change Vec Function" -#~ msgstr "Промени векторÑку функцију" - #~ msgid "Change RGB Uniform" #~ msgstr "Промени RGB униформу (uniform)" @@ -12849,9 +12965,6 @@ msgstr "" #~ msgid "Connect Graph Nodes" #~ msgstr "Повежи чворове графа" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "ИÑкључи чворове графа" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Обриши чвор графа шејдера" @@ -12873,9 +12986,6 @@ msgstr "" #~ msgid "Move Anim Track Down" #~ msgstr "Помери траку доле" -#~ msgid "Set Transitions to:" -#~ msgstr "ПоÑтави прелаз на:" - #~ msgid "Anim Track Rename" #~ msgstr "Измени име анимације" @@ -13067,9 +13177,6 @@ msgstr "" #~ msgid "Move Add Key" #~ msgstr "Помери кључ" -#~ msgid "Create Subscription" -#~ msgstr "Ðаправи претплату" - #~ msgid "List:" #~ msgstr "ЛиÑта:" diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po index 6ba0aef967..5a1d545141 100644 --- a/editor/translations/sr_Latn.po +++ b/editor/translations/sr_Latn.po @@ -368,6 +368,7 @@ msgstr "Napravi %d novih kanala i dodaj kljuÄeve?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Napravi" @@ -497,16 +498,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Uduplaj Selekciju" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -644,8 +635,9 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "Postavi tranzicije na:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -656,6 +648,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Uduplaj Selekciju" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -974,7 +971,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1429,7 +1426,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1483,7 +1481,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1870,6 +1868,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2865,7 +2864,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3102,6 +3101,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3128,13 +3131,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3909,7 +3905,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4048,6 +4044,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4394,7 +4396,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4566,6 +4567,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4771,6 +4774,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5056,20 +5063,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5159,8 +5169,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5427,6 +5436,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6062,6 +6075,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6118,6 +6135,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6216,6 +6234,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6483,6 +6506,11 @@ msgstr "Napravi" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6541,10 +6569,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6868,6 +6892,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6901,6 +6929,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7133,6 +7165,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7926,11 +7962,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7946,6 +7978,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8814,12 +8850,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9807,11 +9845,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9886,6 +9922,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9902,10 +9946,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp #, fuzzy msgid "Reparent to New Node" msgstr "Napravi" @@ -10135,23 +10175,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Inherits" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10793,6 +10825,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "ObriÅ¡i Selekciju" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10801,6 +10838,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Optimizuj Animaciju" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "ObriÅ¡i Selekciju" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "ObriÅ¡i Selekciju" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "ObriÅ¡i Selekciju" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10841,10 +10898,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10869,6 +10936,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Animacija Uduplaj KljuÄeve" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10901,6 +10973,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Napravi" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10925,16 +11018,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "Funkcije:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -10957,6 +11047,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Funkcije:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -11051,6 +11150,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11150,6 +11253,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11687,10 +11794,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" @@ -11725,9 +11828,6 @@ msgstr "" #~ msgid "Move Anim Track Down" #~ msgstr "Pomjeri Kanal Animacije Dole" -#~ msgid "Set Transitions to:" -#~ msgstr "Postavi tranzicije na:" - #~ msgid "Anim Track Change Interpolation" #~ msgstr "Animacija Promjeni Interpolaciju Kanala" diff --git a/editor/translations/sv.po b/editor/translations/sv.po index e59576d365..e62eadd859 100644 --- a/editor/translations/sv.po +++ b/editor/translations/sv.po @@ -11,12 +11,13 @@ # Daniel K <danielkimblad@hotmail.com>, 2018. # Toiya <elviraa98@gmail.com>, 2019. # Fredrik Welin <figgemail@gmail.com>, 2019. +# Mattias Münster <mattiasmun@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:51+0000\n" -"Last-Translator: Fredrik Welin <figgemail@gmail.com>\n" +"PO-Revision-Date: 2019-10-22 02:53+0000\n" +"Last-Translator: Mattias Münster <mattiasmun@gmail.com>\n" "Language-Team: Swedish <https://hosted.weblate.org/projects/godot-engine/" "godot/sv/>\n" "Language: sv\n" @@ -24,7 +25,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.9-dev\n" +"X-Generator: Weblate 3.9.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -297,9 +298,8 @@ msgid "Discrete" msgstr "Diskret" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Trigger" -msgstr "Trigger" +msgstr "Utlös" #: editor/animation_track_editor.cpp msgid "Capture" @@ -340,7 +340,6 @@ msgid "Delete Key(s)" msgstr "Ta bort Nycklar" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" msgstr "Ändra Animationens Uppdateringsläge" @@ -374,6 +373,7 @@ msgstr "Skapa %d NYA spÃ¥r och infoga nycklar?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Skapa" @@ -508,17 +508,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -#, fuzzy -msgid "Select All" -msgstr "Välj Alla" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "Välj Node" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -582,7 +571,6 @@ msgid "Duplicate Selection" msgstr "Duplicera urval" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Duplicate Transposed" msgstr "Duplicera Transponerade" @@ -606,7 +594,6 @@ msgid "Optimize Animation" msgstr "Optimera Animation" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Clean-Up Animation" msgstr "Städa upp Animation" @@ -623,17 +610,14 @@ msgid "Anim. Optimizer" msgstr "Anim. Optimerare" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Max. Linear Error:" msgstr "Max. Linjärt fel:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Max. Angular Error:" msgstr "Max. Vinkel-fel:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Max Optimizable Angle:" msgstr "Max Optimerbar vinkel:" @@ -646,33 +630,29 @@ msgid "Remove invalid keys" msgstr "Ta bort ogiltiga nycklar" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Remove unresolved and empty tracks" msgstr "Ta bort olösta och tomma spÃ¥r" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Clean-up all animations" msgstr "Städa upp alla animationer" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Clean-Up Animation(s) (NO UNDO!)" msgstr "Städa upp Animation(er) (GÃ…R INTE Ã…NGRA!)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Clean-Up" msgstr "Städa upp" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Scale Ratio:" msgstr "Skalnings förhÃ¥llande:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "Ange övergÃ¥ngar:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -683,6 +663,11 @@ msgstr "" msgid "Copy" msgstr "Kopiera" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Välj Node" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -697,17 +682,14 @@ msgid "Change Audio Track Clip End Offset" msgstr "" #: editor/array_property_edit.cpp -#, fuzzy msgid "Resize Array" msgstr "Ändra storlek pÃ¥ Array" #: editor/array_property_edit.cpp -#, fuzzy msgid "Change Array Value Type" msgstr "Ändra Arrays Värdetyp" #: editor/array_property_edit.cpp -#, fuzzy msgid "Change Array Value" msgstr "Ändra Arrays Värde" @@ -733,7 +715,6 @@ msgid "%d matches." msgstr "Inga matchningar" #: editor/code_editor.cpp editor/find_in_files.cpp -#, fuzzy msgid "Match Case" msgstr "Matcha gemener/versaler" @@ -750,7 +731,6 @@ msgid "Replace All" msgstr "Ersätt Alla" #: editor/code_editor.cpp -#, fuzzy msgid "Selection Only" msgstr "Endast Urval" @@ -835,12 +815,10 @@ msgid "Remove" msgstr "Ta bort" #: editor/connections_dialog.cpp -#, fuzzy msgid "Add Extra Call Argument:" msgstr "Lägg till extra Call Argument:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Extra Call Arguments:" msgstr "Extra Call Argument:" @@ -859,7 +837,6 @@ msgid "" msgstr "" #: editor/connections_dialog.cpp -#, fuzzy msgid "Oneshot" msgstr "Oneshot" @@ -934,7 +911,6 @@ msgid "Are you sure you want to remove all connections from the \"%s\" signal?" msgstr "" #: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp -#, fuzzy msgid "Signals" msgstr "Signaler" @@ -963,7 +939,6 @@ msgid "Change %s Type" msgstr "Ändra Typ" #: editor/create_dialog.cpp editor/project_settings_editor.cpp -#, fuzzy msgid "Change" msgstr "Ändra" @@ -978,7 +953,6 @@ msgid "Favorites:" msgstr "Favoriter:" #: editor/create_dialog.cpp editor/editor_file_dialog.cpp -#, fuzzy msgid "Recent:" msgstr "Senaste:" @@ -991,7 +965,6 @@ msgstr "Sök:" #: editor/create_dialog.cpp editor/plugins/script_editor_plugin.cpp #: editor/property_selector.cpp editor/quick_open.cpp #: modules/visual_script/visual_script_property_selector.cpp -#, fuzzy msgid "Matches:" msgstr "Matchar:" @@ -1008,7 +981,6 @@ msgid "Search Replacement For:" msgstr "Sök Ersättning För:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Dependencies For:" msgstr "Beroenden För:" @@ -1032,7 +1004,6 @@ msgstr "" #: editor/dependency_editor.cpp #: modules/gdnative/gdnative_library_editor_plugin.cpp -#, fuzzy msgid "Dependencies" msgstr "Beroenden" @@ -1041,28 +1012,23 @@ msgid "Resource" msgstr "Resurs" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp -#, fuzzy +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Sökväg" #: editor/dependency_editor.cpp -#, fuzzy msgid "Dependencies:" msgstr "Beroenden:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Fix Broken" msgstr "Fixa Trasig" #: editor/dependency_editor.cpp -#, fuzzy msgid "Dependency Editor" msgstr "Beroende-Redigerare" #: editor/dependency_editor.cpp -#, fuzzy msgid "Search Replacement Resource:" msgstr "Sök Ersättningsresurs:" @@ -1073,12 +1039,10 @@ msgstr "Sök Ersättningsresurs:" #: editor/script_create_dialog.cpp #: modules/visual_script/visual_script_property_selector.cpp #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open" msgstr "Öppen" #: editor/dependency_editor.cpp -#, fuzzy msgid "Owners Of:" msgstr "Ägare av:" @@ -1088,7 +1052,6 @@ msgid "Remove selected files from the project? (Can't be restored)" msgstr "Ta bort valda filer frÃ¥n projektet? (gÃ¥r inte Ã¥ngra)" #: editor/dependency_editor.cpp -#, fuzzy msgid "" "The files being removed are required by other resources in order for them to " "work.\n" @@ -1103,7 +1066,6 @@ msgid "Cannot remove:" msgstr "Kan inte ta bort:\n" #: editor/dependency_editor.cpp -#, fuzzy msgid "Error loading:" msgstr "Fel vid laddning:" @@ -1113,27 +1075,22 @@ msgid "Load failed due to missing dependencies:" msgstr "Scenen misslyckades att ladda pÃ¥ grund av att beroenden saknas:" #: editor/dependency_editor.cpp editor/editor_node.cpp -#, fuzzy msgid "Open Anyway" msgstr "Öppna ÄndÃ¥" #: editor/dependency_editor.cpp -#, fuzzy msgid "Which action should be taken?" msgstr "Vilken Ã¥tgärd bör vidtas?" #: editor/dependency_editor.cpp -#, fuzzy msgid "Fix Dependencies" msgstr "Fixa Beroenden" #: editor/dependency_editor.cpp -#, fuzzy msgid "Errors loading!" msgstr "Fel vid laddning!" #: editor/dependency_editor.cpp -#, fuzzy msgid "Permanently delete %d item(s)? (No undo!)" msgstr "Ta bort %d sak(er) permanent? (GÃ¥r inte Ã¥ngra!)" @@ -1155,42 +1112,34 @@ msgid "Delete" msgstr "Ta bort" #: editor/dependency_editor.cpp -#, fuzzy msgid "Owns" msgstr "Äger" #: editor/dependency_editor.cpp -#, fuzzy msgid "Resources Without Explicit Ownership:" msgstr "Resurser Utan Explicit Ägande:" #: editor/dictionary_property_edit.cpp -#, fuzzy msgid "Change Dictionary Key" msgstr "Ändra Ordboksnyckel" #: editor/dictionary_property_edit.cpp -#, fuzzy msgid "Change Dictionary Value" msgstr "Ändra Ordboksvärde" #: editor/editor_about.cpp -#, fuzzy msgid "Thanks from the Godot community!" msgstr "Tack frÃ¥n Godot-gemenskapen!" #: editor/editor_about.cpp -#, fuzzy msgid "Godot Engine contributors" msgstr "Godot Engine bidragare" #: editor/editor_about.cpp -#, fuzzy msgid "Project Founders" msgstr "Projektgrundare" #: editor/editor_about.cpp -#, fuzzy msgid "Lead Developer" msgstr "Lead Developer" @@ -1204,37 +1153,30 @@ msgid "Developers" msgstr "Utvecklare" #: editor/editor_about.cpp -#, fuzzy msgid "Authors" msgstr "Författare" #: editor/editor_about.cpp -#, fuzzy msgid "Platinum Sponsors" msgstr "Platinumsponsorer" #: editor/editor_about.cpp -#, fuzzy msgid "Gold Sponsors" msgstr "Guldsponsorer" #: editor/editor_about.cpp -#, fuzzy msgid "Mini Sponsors" msgstr "Minisponsorer" #: editor/editor_about.cpp -#, fuzzy msgid "Gold Donors" msgstr "Gulddonatorer" #: editor/editor_about.cpp -#, fuzzy msgid "Silver Donors" msgstr "Silverdonatorer" #: editor/editor_about.cpp -#, fuzzy msgid "Bronze Donors" msgstr "Bronsdonatorer" @@ -1265,12 +1207,10 @@ msgstr "" "respektive upphovsrätts uttalanden och licensvillkor." #: editor/editor_about.cpp -#, fuzzy msgid "All Components" msgstr "Alla Komponenter" #: editor/editor_about.cpp -#, fuzzy msgid "Components" msgstr "Komponenter" @@ -1284,7 +1224,6 @@ msgid "Error opening package file, not in ZIP format." msgstr "Fel vid öppning av paketetfil, inte i zip-format." #: editor/editor_asset_installer.cpp -#, fuzzy msgid "Uncompressing Assets" msgstr "Dekomprimerar TillgÃ¥ngar" @@ -1295,7 +1234,6 @@ msgstr "Paketet installerades!" #: editor/editor_asset_installer.cpp #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Success!" msgstr "Klart!" @@ -1316,7 +1254,6 @@ msgid "Add Effect" msgstr "Lägg till Effekt" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Rename Audio Bus" msgstr "Byt namn pÃ¥ Ljud-Buss" @@ -1326,37 +1263,30 @@ msgid "Change Audio Bus Volume" msgstr "Växla Ljud-Buss Solo" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Toggle Audio Bus Solo" msgstr "Växla Ljud-Buss Solo" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Toggle Audio Bus Mute" msgstr "Växla Ljud-Buss Dämpning" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Toggle Audio Bus Bypass Effects" msgstr "Växla Ljud-Buss Bypass Effekter" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Select Audio Bus Send" msgstr "Välj Ljud-Buss Send" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Add Audio Bus Effect" msgstr "Lägg till Ljud-Buss Effekt" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Move Bus Effect" msgstr "Flytta Buss-Effekt" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Delete Bus Effect" msgstr "Ta bort Buss-Effekt" @@ -1366,22 +1296,18 @@ msgid "Drag & drop to rearrange." msgstr "Ljud-Buss, dra och släpp för att ändra ordning." #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Solo" msgstr "Solo" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Mute" msgstr "Dämpa" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Bypass" msgstr "Bypass" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Bus options" msgstr "Buss-alternativ" @@ -1391,7 +1317,6 @@ msgid "Duplicate" msgstr "Duplicera" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Reset Volume" msgstr "Ã…terställ Volym" @@ -1404,32 +1329,26 @@ msgid "Audio" msgstr "Ljud" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Add Audio Bus" msgstr "Lägg till Ljud-Buss" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Master bus can't be deleted!" msgstr "Master-Buss kan inte raderas!" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Delete Audio Bus" msgstr "Ta bort Ljud-Buss" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Duplicate Audio Bus" msgstr "Duplicera Ljud-Buss" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Reset Bus Volume" msgstr "Ã…terställ Buss-Volym" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Move Audio Bus" msgstr "Flytta Ljud-Buss" @@ -1444,7 +1363,6 @@ msgid "Location for New Layout..." msgstr "Plats för Ny Layout..." #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Open Audio Bus Layout" msgstr "Öppna Ljud-Buss Layout" @@ -1457,12 +1375,10 @@ msgid "Layout" msgstr "Layout" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Invalid file, not an audio bus layout." msgstr "Ogiltig fil, inte en Ljud-Buss Layout." #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Add Bus" msgstr "Lägg till Buss" @@ -1474,12 +1390,10 @@ msgstr "Spara Ljud-Buss Layout Som..." #: editor/editor_audio_buses.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp #: editor/script_create_dialog.cpp -#, fuzzy msgid "Load" msgstr "Ladda" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Load an existing Bus Layout." msgstr "Ladda en befintlig Buss-Layout." @@ -1488,32 +1402,26 @@ msgid "Save As" msgstr "Spara Som" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Save this Bus Layout to a file." msgstr "Spara Buss-Layouten till en fil." #: editor/editor_audio_buses.cpp editor/import_dock.cpp -#, fuzzy msgid "Load Default" msgstr "Ladda Standard" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Load the default Bus Layout." msgstr "Ladda standard Buss-Layouten." #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Create a new Bus Layout." msgstr "Skapa en ny Buss-Layout." #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Invalid name." msgstr "Ogiltigt namn." #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Valid characters:" msgstr "Giltiga tecken:" @@ -1539,27 +1447,22 @@ msgid "Keyword cannot be used as an autoload name." msgstr "" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Autoload '%s' already exists!" msgstr "Autoload '%s' finns redan!" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Rename Autoload" msgstr "Byt namn pÃ¥ Autload" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Toggle AutoLoad Globals" msgstr "Växla AutoLoad Globals" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Move Autoload" msgstr "Flytta Autoload" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Remove Autoload" msgstr "Ta bort Autoload" @@ -1568,7 +1471,6 @@ msgid "Enable" msgstr "Aktivera" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Rearrange Autoloads" msgstr "Ändra ordning pÃ¥ Autoloads" @@ -1582,24 +1484,21 @@ msgid "File does not exist." msgstr "Fil existerar inte." #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Not in resource path." msgstr "Inte i resursens sökväg." #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Add AutoLoad" msgstr "Lägg till AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp -#, fuzzy +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Sökväg:" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Node Name:" msgstr "Node Namn:" @@ -1609,7 +1508,6 @@ msgid "Name" msgstr "Namn" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Singleton" msgstr "Singleton" @@ -1641,7 +1539,6 @@ msgid "Please select a base directory first." msgstr "Vänligen välj en baskatalog först" #: editor/editor_dir_dialog.cpp -#, fuzzy msgid "Choose a Directory" msgstr "Välj en Katalog" @@ -1654,7 +1551,7 @@ msgstr "Skapa Mapp" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Namn:" @@ -1668,7 +1565,6 @@ msgid "Choose" msgstr "Välj" #: editor/editor_export.cpp -#, fuzzy msgid "Storing File:" msgstr "Lagrar Fil:" @@ -1677,7 +1573,6 @@ msgid "No export template found at the expected path:" msgstr "" #: editor/editor_export.cpp -#, fuzzy msgid "Packing" msgstr "Packar" @@ -1734,9 +1629,8 @@ msgid "Script Editor" msgstr "Öppna Skript-Redigerare" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Asset Library" -msgstr "Bibliotek" +msgstr "TillgÃ¥ngsbibliotek" #: editor/editor_feature_profile.cpp #, fuzzy @@ -1892,7 +1786,6 @@ msgid "Select Current Folder" msgstr "Skapa Mapp" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "File Exists, Overwrite?" msgstr "Filen finns redan, skriv över?" @@ -1902,7 +1795,6 @@ msgid "Select This Folder" msgstr "Välj en Node" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp -#, fuzzy msgid "Copy Path" msgstr "Kopiera Sökvägen" @@ -1943,12 +1835,10 @@ msgid "Open File(s)" msgstr "Öppna Fil(er)" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Open a Directory" msgstr "Öppna en Katalog" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Open a File or Directory" msgstr "Öppna en Fil eller Katalog" @@ -1976,17 +1866,14 @@ msgid "Go Up" msgstr "GÃ¥ Upp" #: editor/editor_file_dialog.cpp -#, fuzzy msgid "Toggle Hidden Files" msgstr "Växla Dolda Filer" #: editor/editor_file_dialog.cpp -#, fuzzy msgid "Toggle Favorite" msgstr "Växla Favorit" #: editor/editor_file_dialog.cpp -#, fuzzy msgid "Toggle Mode" msgstr "Växla Läge" @@ -2041,7 +1928,6 @@ msgid "View items as a list." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Directories & Files:" msgstr "Kataloger & Filer:" @@ -2056,12 +1942,10 @@ msgid "File:" msgstr "Fil:" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Must use a valid extension." msgstr "MÃ¥ste använda en giltigt filändelse." #: editor/editor_file_system.cpp -#, fuzzy msgid "ScanSources" msgstr "ScanSources" @@ -2072,7 +1956,6 @@ msgid "" msgstr "" #: editor/editor_file_system.cpp -#, fuzzy msgid "(Re)Importing Assets" msgstr "(Om)Importerar TillgÃ¥ngar" @@ -2081,17 +1964,15 @@ msgid "Top" msgstr "Topp" #: editor/editor_help.cpp -#, fuzzy msgid "Class:" msgstr "Klass:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp -#, fuzzy +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Ärver:" #: editor/editor_help.cpp -#, fuzzy msgid "Inherited by:" msgstr "Ärvd av:" @@ -2101,12 +1982,10 @@ msgid "Brief Description" msgstr "Kort Beskrivning:" #: editor/editor_help.cpp -#, fuzzy msgid "Properties" msgstr "Egenskaper" #: editor/editor_help.cpp -#, fuzzy msgid "Methods" msgstr "Metoder" @@ -2120,12 +1999,10 @@ msgid "Enumerations" msgstr "Enumerations" #: editor/editor_help.cpp -#, fuzzy msgid "enum " msgstr "enum " #: editor/editor_help.cpp -#, fuzzy msgid "Constants" msgstr "Konstanter" @@ -2155,7 +2032,6 @@ msgid "Property Descriptions" msgstr "Egenskapsbeskrivning:" #: editor/editor_help.cpp -#, fuzzy msgid "" "There is currently no description for this property. Please help us by " "[color=$color][url=$url]contributing one[/url][/color]!" @@ -2169,7 +2045,6 @@ msgid "Method Descriptions" msgstr "Metodbeskrivning:" #: editor/editor_help.cpp -#, fuzzy msgid "" "There is currently no description for this method. Please help us by [color=" "$color][url=$url]contributing one[/url][/color]!" @@ -2223,9 +2098,8 @@ msgid "Member Type" msgstr "Medlemmar" #: editor/editor_help_search.cpp -#, fuzzy msgid "Class" -msgstr "Klass:" +msgstr "Klass" #: editor/editor_inspector.cpp editor/project_settings_editor.cpp msgid "Property:" @@ -2240,7 +2114,6 @@ msgid "Set Multiple:" msgstr "" #: editor/editor_log.cpp -#, fuzzy msgid "Output:" msgstr "Output:" @@ -2256,7 +2129,6 @@ msgstr "Ta bort Urval" #: editor/script_editor_debugger.cpp #: modules/gdnative/gdnative_library_editor_plugin.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp -#, fuzzy msgid "Clear" msgstr "Rensa" @@ -2267,7 +2139,6 @@ msgstr "Output:" #: editor/editor_network_profiler.cpp editor/editor_node.cpp #: editor/editor_profiler.cpp -#, fuzzy msgid "Stop" msgstr "Stanna" @@ -2327,7 +2198,6 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Error saving resource!" msgstr "Fel vid sparande av resurs!" @@ -2342,17 +2212,14 @@ msgid "Save Resource As..." msgstr "Spara Resurs Som..." #: editor/editor_node.cpp -#, fuzzy msgid "Can't open file for writing:" msgstr "Kan inte öppna fil för skrivande:" #: editor/editor_node.cpp -#, fuzzy msgid "Requested file format unknown:" msgstr "EfterfrÃ¥gade filformat okänt:" #: editor/editor_node.cpp -#, fuzzy msgid "Error while saving." msgstr "Fel vid sparande." @@ -2361,22 +2228,18 @@ msgid "Can't open '%s'. The file could have been moved or deleted." msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Error while parsing '%s'." msgstr "Fel vid parsning '%s'." #: editor/editor_node.cpp -#, fuzzy msgid "Unexpected end of file '%s'." msgstr "Oväntat filslut '%s'." #: editor/editor_node.cpp -#, fuzzy msgid "Missing '%s' or its dependencies." msgstr "Saknar '%s' eller dess beroenden." #: editor/editor_node.cpp -#, fuzzy msgid "Error while loading '%s'." msgstr "Fel vid laddning av '%s'." @@ -2389,12 +2252,10 @@ msgid "Analyzing" msgstr "Analyserar" #: editor/editor_node.cpp -#, fuzzy msgid "Creating Thumbnail" msgstr "Skapar Miniatyr" #: editor/editor_node.cpp -#, fuzzy msgid "This operation can't be done without a tree root." msgstr "Ã…tgärden kan inte göras utan en trädrot." @@ -2418,27 +2279,22 @@ msgid "Can't overwrite scene that is still open!" msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Can't load MeshLibrary for merging!" msgstr "Kan inte ladda MeshLibrary för sammanslagning!" #: editor/editor_node.cpp -#, fuzzy msgid "Error saving MeshLibrary!" msgstr "Fel vid sparande av MeshLibrary!" #: editor/editor_node.cpp -#, fuzzy msgid "Can't load TileSet for merging!" msgstr "Kan inte ladda TileSet för sammanslagning!" #: editor/editor_node.cpp -#, fuzzy msgid "Error saving TileSet!" msgstr "Fel vid sparande av TileSet!" #: editor/editor_node.cpp -#, fuzzy msgid "Error trying to save layout!" msgstr "Fel vid försök att spara layout!" @@ -2447,7 +2303,6 @@ msgid "Default editor layout overridden." msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Layout name not found!" msgstr "Layoutnamn hittades inte!" @@ -2456,7 +2311,6 @@ msgid "Restored default layout to base settings." msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "" "This resource belongs to a scene that was imported, so it's not editable.\n" "Please read the documentation relevant to importing scenes to better " @@ -2476,7 +2330,6 @@ msgstr "" "Ändringar pÃ¥ den kommer inte att sparas när du sparar den nuvarande scenen." #: editor/editor_node.cpp -#, fuzzy msgid "" "This resource was imported, so it's not editable. Change its settings in the " "import panel and then re-import." @@ -2517,7 +2370,6 @@ msgid "Current scene was never saved, please save it prior to running." msgstr "Nuvarande scen har aldrig sparats, vänligen spara den innan körning." #: editor/editor_node.cpp -#, fuzzy msgid "Could not start subprocess!" msgstr "Kunde inte starta underprocess!" @@ -2526,7 +2378,6 @@ msgid "Open Scene" msgstr "Öppna Scen" #: editor/editor_node.cpp -#, fuzzy msgid "Open Base Scene" msgstr "Öppna Bas-Scen" @@ -2550,7 +2401,6 @@ msgid "Save & Close" msgstr "Spara & Stäng" #: editor/editor_node.cpp -#, fuzzy msgid "Save changes to '%s' before closing?" msgstr "Spara ändringar i '%s' innan stängning?" @@ -2576,32 +2426,26 @@ msgid "Yes" msgstr "Ja" #: editor/editor_node.cpp -#, fuzzy msgid "This scene has never been saved. Save before running?" msgstr "Denna scenen har aldrig sparats. Spara innan körning?" #: editor/editor_node.cpp editor/scene_tree_dock.cpp -#, fuzzy msgid "This operation can't be done without a scene." msgstr "Ã…tgärden kan inte göras utan en scen." #: editor/editor_node.cpp -#, fuzzy msgid "Export Mesh Library" msgstr "Exportera Mesh Library" #: editor/editor_node.cpp -#, fuzzy msgid "This operation can't be done without a root node." msgstr "Ã…tgärden kan inte göras utan en Rot-Node." #: editor/editor_node.cpp -#, fuzzy msgid "Export Tile Set" msgstr "Exportera Tile Set" #: editor/editor_node.cpp -#, fuzzy msgid "This operation can't be done without a selected node." msgstr "Ã…tgärden kan inte göras utan en vald Node." @@ -2610,17 +2454,14 @@ msgid "Current scene not saved. Open anyway?" msgstr "Nuvarande scen inte sparad. Öppna ändÃ¥?" #: editor/editor_node.cpp -#, fuzzy msgid "Can't reload a scene that was never saved." msgstr "Kan inte ladda om en scen som aldrig har sparats." #: editor/editor_node.cpp -#, fuzzy msgid "Revert" msgstr "Ã…terställ" #: editor/editor_node.cpp -#, fuzzy msgid "This action cannot be undone. Revert anyway?" msgstr "Ã…tgärden kan inte Ã¥ngras. Ã…terställ ändÃ¥?" @@ -2634,12 +2475,10 @@ msgid "Quit" msgstr "Avsluta" #: editor/editor_node.cpp -#, fuzzy msgid "Exit the editor?" msgstr "Stäng redigeraren?" #: editor/editor_node.cpp -#, fuzzy msgid "Open Project Manager?" msgstr "Öppna Projekthanteraren?" @@ -2648,18 +2487,15 @@ msgid "Save & Quit" msgstr "Spara & Avsluta" #: editor/editor_node.cpp -#, fuzzy msgid "Save changes to the following scene(s) before quitting?" msgstr "Spara ändringar av följande scen(er) innan du avslutar?" #: editor/editor_node.cpp -#, fuzzy msgid "Save changes the following scene(s) before opening Project Manager?" msgstr "" "Spara ändringar av följande scen(er) innan du öppnar Projekthanteraren?" #: editor/editor_node.cpp -#, fuzzy msgid "" "This option is deprecated. Situations where refresh must be forced are now " "considered a bug. Please report." @@ -2668,7 +2504,6 @@ msgstr "" "anses nu vara en bugg. Vänligen rapportera." #: editor/editor_node.cpp -#, fuzzy msgid "Pick a Main Scene" msgstr "Välj en Huvudscen" @@ -2682,18 +2517,15 @@ msgid "Reopen Closed Scene" msgstr "Stäng Scen" #: editor/editor_node.cpp -#, fuzzy msgid "Unable to enable addon plugin at: '%s' parsing of config failed." msgstr "" "Kunde inte aktivera addon plugin vid: '%s' parsning av config misslyckades." #: editor/editor_node.cpp -#, fuzzy msgid "Unable to find script field for addon plugin at: 'res://addons/%s'." msgstr "Kan inte hitta skriptfältet för addon plugin vid: 'res://addons/%s'." #: editor/editor_node.cpp -#, fuzzy msgid "Unable to load addon script from path: '%s'." msgstr "Kunde inte ladda addon script frÃ¥n sökväg: '%s'" @@ -2707,21 +2539,18 @@ msgstr "" "verktygsläge." #: editor/editor_node.cpp -#, fuzzy msgid "" "Unable to load addon script from path: '%s' Base type is not EditorPlugin." msgstr "" "Kunde inte ladda addon script frÃ¥n sökväg: '%s' Bastyp är inte EditorPlugin." #: editor/editor_node.cpp -#, fuzzy msgid "Unable to load addon script from path: '%s' Script is not in tool mode." msgstr "" "Kunde inte ladda addon script frÃ¥n sökväg: '%s' Skript är inte i " "verktygsläge." #: editor/editor_node.cpp -#, fuzzy msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." @@ -2730,7 +2559,6 @@ msgstr "" "För att kunna göra ändringar till den sÃ¥ kan en ärvd scen skapas." #: editor/editor_node.cpp -#, fuzzy msgid "" "Error loading scene, it must be inside the project path. Use 'Import' to " "open the scene, then save it inside the project path." @@ -2739,17 +2567,14 @@ msgstr "" "'Importera' för att öppna scenen, spara den sen inom projektsökvägen." #: editor/editor_node.cpp -#, fuzzy msgid "Scene '%s' has broken dependencies:" msgstr "Scen '%s' har trasiga beroenden:" #: editor/editor_node.cpp -#, fuzzy msgid "Clear Recent Scenes" msgstr "Rensa Senaste Scener" #: editor/editor_node.cpp -#, fuzzy msgid "" "No main scene has ever been defined, select one?\n" "You can change it later in \"Project Settings\" under the 'application' " @@ -2760,7 +2585,6 @@ msgstr "" "kategorin." #: editor/editor_node.cpp -#, fuzzy msgid "" "Selected scene '%s' does not exist, select a valid one?\n" "You can change it later in \"Project Settings\" under the 'application' " @@ -2771,7 +2595,6 @@ msgstr "" "kategorin." #: editor/editor_node.cpp -#, fuzzy msgid "" "Selected scene '%s' is not a scene file, select a valid one?\n" "You can change it later in \"Project Settings\" under the 'application' " @@ -2791,7 +2614,6 @@ msgstr "Ta bort Layout" #: editor/editor_node.cpp editor/import_dock.cpp #: editor/script_create_dialog.cpp -#, fuzzy msgid "Default" msgstr "Standard" @@ -2817,7 +2639,6 @@ msgid "Undo Close Tab" msgstr "Stänga Övriga Flikar" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close Other Tabs" msgstr "Stänga Övriga Flikar" @@ -2831,7 +2652,6 @@ msgid "Close All Tabs" msgstr "Stäng Alla" #: editor/editor_node.cpp -#, fuzzy msgid "Switch Scene Tab" msgstr "Byt Scen-flik" @@ -2852,12 +2672,10 @@ msgid "Dock Position" msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Distraction Free Mode" msgstr "Distraktionsfritt Läge" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle distraction-free mode." msgstr "Växla distraktionsfritt läge." @@ -2870,7 +2688,6 @@ msgid "Scene" msgstr "Scen" #: editor/editor_node.cpp -#, fuzzy msgid "Go to previously opened scene." msgstr "GÃ¥ till föregÃ¥ende öppna scen." @@ -2892,7 +2709,6 @@ msgid "Filter Files..." msgstr "Filtrera Filer..." #: editor/editor_node.cpp -#, fuzzy msgid "Operations with scene files." msgstr "Ã…tgärder med scenfiler." @@ -2910,7 +2726,6 @@ msgid "Open Scene..." msgstr "Öppna Scen..." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Open Recent" msgstr "Öppna Senaste" @@ -2944,12 +2759,10 @@ msgstr "Ã…ngra" #: editor/editor_node.cpp editor/plugins/script_text_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -#, fuzzy msgid "Redo" msgstr "Ã…ngra" #: editor/editor_node.cpp -#, fuzzy msgid "Revert Scene" msgstr "Ã…terställ Scen" @@ -3003,13 +2816,11 @@ msgid "Orphan Resource Explorer..." msgstr "Föräldralös Resursutforskare" #: editor/editor_node.cpp -#, fuzzy msgid "Quit to Project List" msgstr "Avsluta till Projektlistan" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: editor/project_export.cpp -#, fuzzy msgid "Debug" msgstr "Debugga" @@ -3058,9 +2869,8 @@ msgid "" msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Sync Scene Changes" -msgstr "Synkronisera Scenändringar" +msgstr "Synkronisera scenändringar" #: editor/editor_node.cpp msgid "" @@ -3071,9 +2881,8 @@ msgid "" msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Sync Script Changes" -msgstr "Synkronisera Skript-ändringar" +msgstr "Synkronisera skriptändringar" #: editor/editor_node.cpp msgid "" @@ -3150,12 +2959,10 @@ msgstr "Sök" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: editor/plugins/shader_editor_plugin.cpp -#, fuzzy msgid "Online Docs" msgstr "Dokumentation Online" #: editor/editor_node.cpp -#, fuzzy msgid "Q&A" msgstr "FrÃ¥gor och svar" @@ -3165,7 +2972,7 @@ msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" -msgstr "Community" +msgstr "Gemenskap" #: editor/editor_node.cpp msgid "About" @@ -3192,7 +2999,6 @@ msgid "Stop the scene." msgstr "Stanna scenen." #: editor/editor_node.cpp -#, fuzzy msgid "Play the edited scene." msgstr "Spela den redigerade scenen." @@ -3241,7 +3047,6 @@ msgid "FileSystem" msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Inspector" msgstr "Inspektör" @@ -3250,7 +3055,7 @@ msgstr "Inspektör" msgid "Expand Bottom Panel" msgstr "Expandera alla" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3307,7 +3112,6 @@ msgid "Password:" msgstr "Lösenord:" #: editor/editor_node.cpp -#, fuzzy msgid "Open & Run a Script" msgstr "Öppna & Kör ett Skript" @@ -3320,7 +3124,6 @@ msgid "Load Errors" msgstr "" #: editor/editor_node.cpp editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Select" msgstr "Välj" @@ -3333,7 +3136,6 @@ msgid "Open 3D Editor" msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Open Script Editor" msgstr "Öppna Skript-Redigerare" @@ -3446,7 +3248,6 @@ msgid "Edit Text:" msgstr "Redigera tema..." #: editor/editor_properties.cpp editor/script_create_dialog.cpp -#, fuzzy msgid "On" msgstr "PÃ¥" @@ -3497,10 +3298,14 @@ msgid "Pick a Viewport" msgstr "" #: editor/editor_properties.cpp editor/property_editor.cpp -#, fuzzy msgid "New Script" msgstr "Nytt Skript" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Öppna Skript" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3527,14 +3332,6 @@ msgstr "Klistra in" msgid "Convert To %s" msgstr "Konvertera till %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "Öppna Skript-Redigerare" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3577,12 +3374,10 @@ msgid "Write your logic in the _run() method." msgstr "" #: editor/editor_run_script.cpp -#, fuzzy msgid "There is an edited scene already." msgstr "Det finns en redigerad scen redan." #: editor/editor_run_script.cpp -#, fuzzy msgid "Couldn't instance script:" msgstr "Kunde inte insansiera Skript:" @@ -3591,7 +3386,6 @@ msgid "Did you forget the 'tool' keyword?" msgstr "" #: editor/editor_run_script.cpp -#, fuzzy msgid "Couldn't run script:" msgstr "Kunde inte köra Skript:" @@ -3600,7 +3394,6 @@ msgid "Did you forget the '_run' method?" msgstr "" #: editor/editor_sub_scene.cpp -#, fuzzy msgid "Select Node(s) to Import" msgstr "Välj Nod(er) att Importera" @@ -3613,7 +3406,6 @@ msgid "Scene Path:" msgstr "" #: editor/editor_sub_scene.cpp -#, fuzzy msgid "Import From Node:" msgstr "Importera FrÃ¥n Node:" @@ -3627,7 +3419,6 @@ msgid "Uninstall" msgstr "Avinstallera" #: editor/export_template_manager.cpp -#, fuzzy msgid "(Installed)" msgstr "(Installerad)" @@ -3645,7 +3436,6 @@ msgid "(Missing)" msgstr "(Saknas)" #: editor/export_template_manager.cpp -#, fuzzy msgid "(Current)" msgstr "(Nuvarande)" @@ -3654,7 +3444,6 @@ msgid "Retrieving mirrors, please wait..." msgstr "" #: editor/export_template_manager.cpp -#, fuzzy msgid "Remove template version '%s'?" msgstr "Ta bort mallversionen '%s'?" @@ -3680,7 +3469,6 @@ msgid "Extracting Export Templates" msgstr "" #: editor/export_template_manager.cpp -#, fuzzy msgid "Importing:" msgstr "Importerar:" @@ -3697,7 +3485,6 @@ msgstr "" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Can't connect." msgstr "Kan inte ansluta." @@ -3720,7 +3507,6 @@ msgid "Failed:" msgstr "" #: editor/export_template_manager.cpp -#, fuzzy msgid "Download Complete." msgstr "Nedladdning Klar." @@ -3745,7 +3531,6 @@ msgid "Connecting to Mirror..." msgstr "" #: editor/export_template_manager.cpp -#, fuzzy msgid "Disconnected" msgstr "FrÃ¥nkopplad" @@ -3769,7 +3554,6 @@ msgid "Can't Connect" msgstr "Kan inte Ansluta" #: editor/export_template_manager.cpp -#, fuzzy msgid "Connected" msgstr "Ansluten" @@ -3779,12 +3563,10 @@ msgid "Requesting..." msgstr "" #: editor/export_template_manager.cpp -#, fuzzy msgid "Downloading" msgstr "Laddar ner" #: editor/export_template_manager.cpp -#, fuzzy msgid "Connection Error" msgstr "Anslutningsfel" @@ -3798,22 +3580,18 @@ msgid "Uncompressing Android Build Sources" msgstr "Dekomprimerar TillgÃ¥ngar" #: editor/export_template_manager.cpp -#, fuzzy msgid "Current Version:" msgstr "Nuvarande Version:" #: editor/export_template_manager.cpp -#, fuzzy msgid "Installed Versions:" msgstr "Installerade Versioner:" #: editor/export_template_manager.cpp -#, fuzzy msgid "Install From File" msgstr "Installera FrÃ¥n Fil" #: editor/export_template_manager.cpp -#, fuzzy msgid "Remove Template" msgstr "Ta Bort Mall" @@ -3827,7 +3605,6 @@ msgid "Export Template Manager" msgstr "" #: editor/export_template_manager.cpp -#, fuzzy msgid "Download Templates" msgstr "Ladda Ner Mallar" @@ -3876,7 +3653,6 @@ msgid "Provided name contains invalid characters." msgstr "" #: editor/filesystem_dock.cpp -#, fuzzy msgid "A file or folder with this name already exists." msgstr "En fil eller mapp med detta namn finns redan." @@ -3885,12 +3661,10 @@ msgid "Name contains invalid characters." msgstr "" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Renaming file:" msgstr "Byter namn pÃ¥ filen:" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Renaming folder:" msgstr "Byter namn pÃ¥ mappen:" @@ -3915,7 +3689,6 @@ msgid "Open Scenes" msgstr "Öppna Scen" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Instance" msgstr "Instans" @@ -4077,7 +3850,6 @@ msgid "Replace..." msgstr "Ersätt..." #: editor/find_in_files.cpp editor/progress_dialog.cpp scene/gui/dialogs.cpp -#, fuzzy msgid "Cancel" msgstr "Avbryt" @@ -4172,12 +3944,10 @@ msgid "Import as Single Scene" msgstr "" #: editor/import/resource_importer_scene.cpp -#, fuzzy msgid "Import with Separate Animations" msgstr "Importera med Separata Animationer" #: editor/import/resource_importer_scene.cpp -#, fuzzy msgid "Import with Separate Materials" msgstr "Importera med Separata Material" @@ -4194,7 +3964,6 @@ msgid "Import with Separate Objects+Animations" msgstr "" #: editor/import/resource_importer_scene.cpp -#, fuzzy msgid "Import with Separate Materials+Animations" msgstr "Importera med Separata Material+Animationer" @@ -4261,7 +4030,6 @@ msgid " Files" msgstr "" #: editor/import_dock.cpp -#, fuzzy msgid "Import As:" msgstr "Importera Som:" @@ -4307,12 +4075,10 @@ msgid "Save As..." msgstr "Spara Som..." #: editor/inspector_dock.cpp -#, fuzzy msgid "Copy Params" msgstr "Kopiera Params" #: editor/inspector_dock.cpp -#, fuzzy msgid "Paste Params" msgstr "Klistra in Params" @@ -4326,12 +4092,10 @@ msgid "Copy Resource" msgstr "Kopiera Resurs" #: editor/inspector_dock.cpp -#, fuzzy msgid "Make Built-In" msgstr "Gör Inbyggd" #: editor/inspector_dock.cpp -#, fuzzy msgid "Make Sub-Resources Unique" msgstr "Gör Under-resurser Unika" @@ -4365,7 +4129,6 @@ msgid "History of recently edited objects." msgstr "" #: editor/inspector_dock.cpp -#, fuzzy msgid "Object properties." msgstr "Objektegenskaper." @@ -4379,7 +4142,6 @@ msgid "Changes may be lost!" msgstr "" #: editor/multi_node_edit.cpp -#, fuzzy msgid "MultiNode Set" msgstr "MultiNode Ange" @@ -4406,7 +4168,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp #, fuzzy msgid "Language:" msgstr "SprÃ¥k" @@ -4554,6 +4316,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "Öppna Skript-Redigerare" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4624,7 +4393,6 @@ msgstr "Uppdatera Ändringar" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "Edit Filters" msgstr "Redigera Filter" @@ -4671,7 +4439,6 @@ msgstr "Ta bort Nod(er)" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete Node(s)" msgstr "Ta bort Nod(er)" @@ -4791,12 +4558,10 @@ msgid "No animation resource on clipboard!" msgstr "Inte i resursens sökväg." #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Pasted Animation" msgstr "Inklistrad Animation" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Paste Animation" msgstr "Klistra in Animation" @@ -4834,14 +4599,13 @@ msgid "Scale animation playback globally for the node." msgstr "" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Animation Tools" msgstr "Animeringsverktyg" #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Animation" -msgstr "Animation" +msgstr "Animering" #: editor/plugins/animation_player_editor_plugin.cpp #, fuzzy @@ -4918,7 +4682,6 @@ msgid "Pin AnimationPlayer" msgstr "Klistra in Animation" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Create New Animation" msgstr "Skapa Ny Animation" @@ -4930,8 +4693,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp -#, fuzzy msgid "Error!" msgstr "Fel!" @@ -4959,7 +4720,6 @@ msgstr "Lägg Till Översättning" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Node" msgstr "Lägg Till Node" @@ -5043,18 +4803,15 @@ msgstr "ÖvergÃ¥ng" #: editor/plugins/animation_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "AnimationTree" -msgstr "Animation" +msgstr "Animationsträd" #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "New name:" msgstr "Nytt namn:" #: editor/plugins/animation_tree_player_editor_plugin.cpp #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Scale:" msgstr "Skala:" @@ -5108,11 +4865,12 @@ msgid "X-Fade Time (s):" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "Current:" msgstr "Nuvarande:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -5137,7 +4895,6 @@ msgid "Animation tree is invalid." msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "Animation Node" msgstr "Animations-Node" @@ -5146,7 +4903,6 @@ msgid "OneShot Node" msgstr "OneShot-Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "Mix Node" msgstr "Mix-Node" @@ -5180,7 +4936,6 @@ msgid "Import Animations..." msgstr "Importera Animationer..." #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "Edit Node Filters" msgstr "Redigera Node-Filter" @@ -5190,7 +4945,6 @@ msgid "Filters..." msgstr "Filter..." #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Contents:" msgstr "InnehÃ¥ll:" @@ -5296,7 +5050,6 @@ msgid "Install..." msgstr "Installera" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Retry" msgstr "Försök igen" @@ -5330,6 +5083,10 @@ msgid "All" msgstr "Alla" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Importera" @@ -5348,7 +5105,6 @@ msgid "Category:" msgstr "Kategori:" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Site:" msgstr "Webbplats:" @@ -5397,7 +5153,6 @@ msgstr "" #: editor/plugins/camera_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp editor/rename_dialog.cpp -#, fuzzy msgid "Preview" msgstr "Förhandsgranska" @@ -5628,24 +5383,27 @@ msgid "Ruler Mode" msgstr "Växla Läge" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy -msgid "Snapping Options" -msgstr "Alternativ" +msgid "Toggle grid snapping." +msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "Alternativ" + +#: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" msgstr "" @@ -5703,13 +5461,11 @@ msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Makes sure the object's children are not selectable." msgstr "Ser till att objektets barn inte är valbara." #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Restores the object's children's ability to be selected." msgstr "Ã…terställer objektets barns egenskap att väljas." @@ -5736,8 +5492,7 @@ msgid "View" msgstr "Visa" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5845,7 +5600,6 @@ msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp -#, fuzzy msgid "Create Node" msgstr "Skapa Node" @@ -5860,7 +5614,6 @@ msgid "Change Default Type" msgstr "Ändra Typ" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "" "Drag & drop + Shift : Add node as sibling\n" "Drag & drop + Alt : Change node type" @@ -5906,7 +5659,6 @@ msgstr "" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Particles" msgstr "Partiklar" @@ -6011,10 +5763,13 @@ msgid "Toggle Curve Linear Tangent" msgstr "" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Hold Shift to edit tangents individually" msgstr "HÃ¥ll Skift för att redigera tangenter individuellt" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6166,12 +5921,10 @@ msgid "Remove Selected Item" msgstr "" #: editor/plugins/mesh_library_editor_plugin.cpp -#, fuzzy msgid "Import from Scene" msgstr "Importera frÃ¥n Scen" #: editor/plugins/mesh_library_editor_plugin.cpp -#, fuzzy msgid "Update from Scene" msgstr "Uppdatera frÃ¥n scen" @@ -6236,17 +5989,14 @@ msgid "Source Mesh:" msgstr "" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "X-Axis" msgstr "X-Axel" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Y-Axis" msgstr "Y-Axel" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Z-Axis" msgstr "Z-Axel" @@ -6255,7 +6005,6 @@ msgid "Mesh Up Axis:" msgstr "" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Random Rotation:" msgstr "Slumpmässig Rotation:" @@ -6264,7 +6013,6 @@ msgid "Random Tilt:" msgstr "" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Random Scale:" msgstr "Slumpmässig Skala:" @@ -6337,7 +6085,6 @@ msgid "Surface Points+Normal (Directed)" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Volume" msgstr "Volym" @@ -6441,7 +6188,6 @@ msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp editor/plugins/theme_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp editor/project_export.cpp -#, fuzzy msgid "Options" msgstr "Alternativ" @@ -6667,6 +6413,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6717,14 +6467,13 @@ msgstr "Klistra in Resurs" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Instance:" msgstr "Instans:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp -#, fuzzy +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Typ:" @@ -6812,7 +6561,6 @@ msgid "Save File As..." msgstr "Spara Som..." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Import Theme" msgstr "Importera Tema" @@ -6821,7 +6569,6 @@ msgid "Error while saving theme" msgstr "" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error saving" msgstr "Fel vid sparande" @@ -6836,11 +6583,15 @@ msgstr "" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Find Next" msgstr "Hitta Nästa" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Filtrera noder" @@ -6855,31 +6606,26 @@ msgid "Filter methods" msgstr "Filtrera noder" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Sort" msgstr "Sortera" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp #: modules/gdnative/gdnative_library_editor_plugin.cpp -#, fuzzy msgid "Move Up" msgstr "Flytta Upp" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp #: modules/gdnative/gdnative_library_editor_plugin.cpp -#, fuzzy msgid "Move Down" msgstr "Flytta Ner" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Next script" msgstr "Nästa Skript" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Previous script" msgstr "FöregÃ¥ende Skript" @@ -6921,9 +6667,8 @@ msgstr "" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "Spara Tema" +msgstr "Tema" #: editor/plugins/script_editor_plugin.cpp #, fuzzy @@ -6931,12 +6676,10 @@ msgid "Import Theme..." msgstr "Importera Tema" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Reload Theme" msgstr "Ladda om Tema" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Save Theme" msgstr "Spara Tema" @@ -7007,7 +6750,6 @@ msgid "Go to next edited document." msgstr "" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Discard" msgstr "Kasta" @@ -7019,13 +6761,11 @@ msgstr "" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/shader_editor_plugin.cpp -#, fuzzy msgid "Reload" msgstr "Ladda om" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/shader_editor_plugin.cpp -#, fuzzy msgid "Resave" msgstr "Spara om" @@ -7091,22 +6831,18 @@ msgid "Lookup Symbol" msgstr "" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Pick Color" msgstr "Välj Färg" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp -#, fuzzy msgid "Convert Case" msgstr "Konvertera gemener/versaler" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp -#, fuzzy msgid "Uppercase" msgstr "Versaler" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp -#, fuzzy msgid "Lowercase" msgstr "Gemener" @@ -7135,12 +6871,15 @@ msgstr "Radera punkter" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp -#, fuzzy msgid "Cut" msgstr "Klipp" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Välj Alla" + #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Delete Line" msgstr "Ta bort rad" @@ -7196,15 +6935,10 @@ msgid "Convert Indent to Tabs" msgstr "Konvertera till %s" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Auto Indent" msgstr "Automatisk Indentering" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Filtrera Filer..." @@ -7303,9 +7037,8 @@ msgid "Create physical bones" msgstr "" #: editor/plugins/skeleton_editor_plugin.cpp -#, fuzzy msgid "Skeleton" -msgstr "Singleton" +msgstr "Skelett" #: editor/plugins/skeleton_editor_plugin.cpp #, fuzzy @@ -7322,7 +7055,6 @@ msgid "Orthogonal" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Perspective" msgstr "Perspektiv" @@ -7331,17 +7063,14 @@ msgid "Transform Aborted." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "X-Axis Transform." msgstr "X-Axel Transformering." #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Y-Axis Transform." msgstr "Y-Axel Transformering." #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Z-Axis Transform." msgstr "Z-Axel Transformering." @@ -7350,7 +7079,6 @@ msgid "View Plane Transform." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Scaling: " msgstr "Skalning: " @@ -7359,7 +7087,6 @@ msgid "Translating: " msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Rotating %s degrees." msgstr "Roterar %s grader." @@ -7405,57 +7132,46 @@ msgid "Vertices" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Top View." msgstr "Vy OvanifrÃ¥n." #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Bottom View." msgstr "Vy UnderifrÃ¥n" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Bottom" msgstr "Botten" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Left View." msgstr "Vy frÃ¥n vänster." #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Left" msgstr "Vänster" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Right View." msgstr "Vy frÃ¥n höger." #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Right" msgstr "Höger" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Front View." msgstr "Vy FramifrÃ¥n." #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Front" msgstr "Framsida" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Rear View." msgstr "Vy BakifrÃ¥n." #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Rear" msgstr "Baksida" @@ -7470,12 +7186,10 @@ msgid "Align Rotation with View" msgstr "Vy frÃ¥n höger" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp -#, fuzzy msgid "No parent to instance a child at." msgstr "Ingen förälder att instansiera ett barn till." #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp -#, fuzzy msgid "This operation requires a single selected node." msgstr "Ã…tgärden kräver en enstaka vald Node." @@ -7509,7 +7223,6 @@ msgid "View Gizmos" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "View Information" msgstr "Visa Information" @@ -7522,7 +7235,6 @@ msgid "Half Resolution" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Audio Listener" msgstr "Ljud-Lyssnare" @@ -7564,6 +7276,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7598,32 +7314,30 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Vy underifrÃ¥n" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Top View" msgstr "Vy ovanifrÃ¥n" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Rear View" msgstr "Vy bakifrÃ¥n" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Front View" msgstr "Vy framifrÃ¥n" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Left View" msgstr "Vy frÃ¥n vänster" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Right View" msgstr "Vy frÃ¥n höger" @@ -7649,7 +7363,6 @@ msgstr "" #: editor/plugins/spatial_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform" msgstr "Transformera" @@ -7840,6 +7553,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7887,7 +7604,6 @@ msgid "Change Animation FPS" msgstr "" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "(empty)" msgstr "(tom)" @@ -7911,7 +7627,6 @@ msgid "Speed (FPS):" msgstr "" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Loop" msgstr "Loop" @@ -7938,12 +7653,10 @@ msgid "Insert Empty (After)" msgstr "" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move (Before)" msgstr "Flytta (före)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move (After)" msgstr "Flytta (efter)" @@ -8024,7 +7737,6 @@ msgid "Add All Items" msgstr "" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Add All" msgstr "Lägg till Alla" @@ -8033,7 +7745,6 @@ msgid "Remove All Items" msgstr "" #: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp -#, fuzzy msgid "Remove All" msgstr "Ta bort Alla" @@ -8055,7 +7766,6 @@ msgid "Remove Class Items" msgstr "" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Create Empty Template" msgstr "Skapa tom mall" @@ -8158,7 +7868,6 @@ msgid "Has,Many,Options" msgstr "Alternativ" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Data Type:" msgstr "Datatyp:" @@ -8167,12 +7876,10 @@ msgid "Icon" msgstr "Ikon" #: editor/plugins/theme_editor_plugin.cpp editor/rename_dialog.cpp -#, fuzzy msgid "Style" msgstr "Stil" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Font" msgstr "Font" @@ -8578,7 +8285,6 @@ msgid "No VCS addons are available." msgstr "" #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp -#, fuzzy msgid "Error" msgstr "Fel" @@ -8682,12 +8388,8 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Lägg till Signal" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +msgid "Add Output" +msgstr "Output:" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8695,15 +8397,18 @@ msgid "Scalar" msgstr "Skala:" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector" -msgstr "Inspektör" +msgstr "Vektor" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Favoriter:" @@ -8768,7 +8473,6 @@ msgstr "Duplicera Nod(er)" #: editor/plugins/visual_shader_editor_plugin.cpp #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Paste Nodes" msgstr "Klistra in Noder" @@ -9587,21 +9291,21 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp -#, fuzzy msgid "Patches" msgstr "Patchar" #: editor/project_export.cpp -#, fuzzy msgid "Make Patch" msgstr "Gör Patch" @@ -9648,7 +9352,6 @@ msgid "Script Encryption Key (256-bits as hex):" msgstr "" #: editor/project_export.cpp -#, fuzzy msgid "Export PCK/Zip" msgstr "Exportera PCK/Zip" @@ -9675,7 +9378,6 @@ msgid "Export With Debug" msgstr "" #: editor/project_manager.cpp -#, fuzzy msgid "The path does not exist." msgstr "Sökvägen finns inte." @@ -9696,7 +9398,6 @@ msgid "Directory already contains a Godot project." msgstr "" #: editor/project_manager.cpp -#, fuzzy msgid "New Game Project" msgstr "Nytt Spelprojekt" @@ -9719,7 +9420,6 @@ msgid "There is already a folder in this path with the specified name." msgstr "" #: editor/project_manager.cpp -#, fuzzy msgid "It would be a good idea to name your project." msgstr "Det vore en bra idé att namnge ditt projekt." @@ -9746,12 +9446,10 @@ msgid "The following files failed extraction from package:" msgstr "" #: editor/project_manager.cpp -#, fuzzy msgid "Rename Project" msgstr "Byt namn pÃ¥ Projekt" #: editor/project_manager.cpp -#, fuzzy msgid "Import Existing Project" msgstr "Importera Befintligt Projekt" @@ -9761,7 +9459,6 @@ msgid "Import & Edit" msgstr "Importera" #: editor/project_manager.cpp -#, fuzzy msgid "Create New Project" msgstr "Skapa Nytt Projekt" @@ -9771,7 +9468,6 @@ msgid "Create & Edit" msgstr "Skapa Skript" #: editor/project_manager.cpp -#, fuzzy msgid "Install Project:" msgstr "Installera Projekt:" @@ -9781,12 +9477,10 @@ msgid "Install & Edit" msgstr "Installera" #: editor/project_manager.cpp -#, fuzzy msgid "Project Name:" msgstr "Projektnamn:" #: editor/project_manager.cpp -#, fuzzy msgid "Project Path:" msgstr "Sökväg till projektet:" @@ -9828,7 +9522,6 @@ msgid "Renderer can be changed later, but scenes may need to be adjusted." msgstr "" #: editor/project_manager.cpp -#, fuzzy msgid "Unnamed Project" msgstr "Namnlöst Projekt" @@ -9933,7 +9626,6 @@ msgid "" msgstr "" #: editor/project_manager.cpp -#, fuzzy msgid "Project Manager" msgstr "Projektledare" @@ -9943,17 +9635,14 @@ msgid "Projects" msgstr "Projekt" #: editor/project_manager.cpp -#, fuzzy msgid "Scan" msgstr "Skanna" #: editor/project_manager.cpp -#, fuzzy msgid "Select a Folder to Scan" msgstr "Välj en mapp att skanna" #: editor/project_manager.cpp -#, fuzzy msgid "New Project" msgstr "Nytt Projekt" @@ -9963,17 +9652,14 @@ msgid "Remove Missing" msgstr "Ta bort Animation" #: editor/project_manager.cpp -#, fuzzy msgid "Templates" msgstr "Mallar" #: editor/project_manager.cpp -#, fuzzy msgid "Restart Now" msgstr "Starta om nu" #: editor/project_manager.cpp -#, fuzzy msgid "Can't run project" msgstr "Kan inte köra projektet" @@ -9984,7 +9670,6 @@ msgid "" msgstr "" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Key " msgstr "Nyckel " @@ -9997,7 +9682,6 @@ msgid "Joy Axis" msgstr "" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Mouse Button" msgstr "Musknapp" @@ -10031,7 +9715,6 @@ msgid "All Devices" msgstr "Enhet" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Device" msgstr "Enhet" @@ -10099,7 +9782,6 @@ msgid "Joypad Axis Index:" msgstr "" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Axis" msgstr "Axel" @@ -10190,12 +9872,10 @@ msgid "Override for Feature" msgstr "" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Add Translation" msgstr "Lägg Till Översättning" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Remove Translation" msgstr "Ta bort Översättning" @@ -10252,16 +9932,14 @@ msgid "Action:" msgstr "" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Action" -msgstr "Funktion:" +msgstr "Ã…tgärd" #: editor/project_settings_editor.cpp msgid "Deadzone" -msgstr "" +msgstr "Dödzon" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Device:" msgstr "Enhet:" @@ -10270,17 +9948,14 @@ msgid "Index:" msgstr "" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Localization" msgstr "Lokalisering" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Translations" msgstr "Översättningar" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Translations:" msgstr "Översättningar:" @@ -10334,7 +10009,6 @@ msgid "Preset..." msgstr "" #: editor/property_editor.cpp -#, fuzzy msgid "Zero" msgstr "Noll" @@ -10355,12 +10029,10 @@ msgid "Dir..." msgstr "" #: editor/property_editor.cpp -#, fuzzy msgid "Assign" msgstr "Tilldela" #: editor/property_editor.cpp -#, fuzzy msgid "Select Node" msgstr "Välj Node" @@ -10369,7 +10041,6 @@ msgid "Error loading file: Not a resource!" msgstr "" #: editor/property_editor.cpp -#, fuzzy msgid "Pick a Node" msgstr "Välj en Node" @@ -10512,7 +10183,6 @@ msgid "Reset" msgstr "Ã…terställ Zoom" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent Node" msgstr "Byt Förälder-Node" @@ -10533,7 +10203,6 @@ msgid "Run Mode:" msgstr "" #: editor/run_settings_dialog.cpp -#, fuzzy msgid "Current Scene" msgstr "Nuvarande Scen" @@ -10554,7 +10223,6 @@ msgid "No parent to instance the scenes at." msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Error loading scene from %s" msgstr "Fel vid laddning av scen frÃ¥n %s" @@ -10573,7 +10241,6 @@ msgid "Replace with Branch Scene" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Instance Child Scene" msgstr "Instansiera Barn-Scen" @@ -10582,22 +10249,18 @@ msgid "Clear Script" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "This operation can't be done on the tree root." msgstr "Ã…tgärden kan inte göras pÃ¥ trädroten." #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Move Node In Parent" msgstr "Flytta Node i Förälder" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Move Nodes In Parent" msgstr "Flytta Noder i Förälder" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Duplicate Node(s)" msgstr "Duplicera Nod(er)" @@ -10656,12 +10319,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy -msgid "Editable Children" -msgstr "Redigerbara Barn" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10707,12 +10367,10 @@ msgid "Can't operate on nodes the current scene inherits from!" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Attach Script" msgstr "Fäst Skript" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Remove Node(s)" msgstr "Ta bort Nod(er)" @@ -10728,7 +10386,6 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Error saving scene." msgstr "Fel vid sparande av scenen." @@ -10746,12 +10403,19 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Redigerbara Barn" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Öppna Senaste" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Add Child Node" msgstr "Lägg till Barn-Node" @@ -10761,17 +10425,11 @@ msgid "Expand/Collapse All" msgstr "Stäng Alla" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Change Type" msgstr "Ändra Typ" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Öppna Skript" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Byt Förälder-Node" @@ -10789,7 +10447,6 @@ msgid "Save Branch as Scene" msgstr "" #: editor/scene_tree_dock.cpp editor/script_editor_debugger.cpp -#, fuzzy msgid "Copy Node Path" msgstr "Kopiera Node-Sökväg" @@ -10809,7 +10466,6 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Attach a new or existing script for the selected node." msgstr "Koppla pÃ¥ ett nytt eller befintligt Skript till vald Node." @@ -10906,12 +10562,10 @@ msgid "Invalid node name, the following characters are not allowed:" msgstr "" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Rename Node" msgstr "Byt namn pÃ¥ Node" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Scene Tree (Nodes):" msgstr "Scenträd (Noder):" @@ -10920,7 +10574,6 @@ msgid "Node Configuration Warning!" msgstr "" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Select a Node" msgstr "Välj en Node" @@ -10958,7 +10611,6 @@ msgid "Wrong extension chosen." msgstr "" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Error loading template '%s'" msgstr "Fel vid laddning av mall '%s'" @@ -10967,7 +10619,6 @@ msgid "Error - Could not create script in filesystem." msgstr "Fel - Kunde inte skapa Skript i filsystemet." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Error loading script from %s" msgstr "Fel vid laddning av Skript frÃ¥n %s" @@ -11028,27 +10679,19 @@ msgid "Will load an existing script file." msgstr "Ladda in befintlig Skript-fil" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "SprÃ¥k" - -#: editor/script_create_dialog.cpp #, fuzzy -msgid "Inherits" -msgstr "Ärver" - -#: editor/script_create_dialog.cpp -#, fuzzy -msgid "Class Name" +msgid "Class Name:" msgstr "Klassnamn" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" +msgid "Template:" msgstr "Mall" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Öppna Skript" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11101,7 +10744,6 @@ msgid "Stack Trace" msgstr "" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Errors" msgstr "Fel" @@ -11146,7 +10788,6 @@ msgid "Monitor" msgstr "" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Value" msgstr "Värde" @@ -11163,7 +10804,6 @@ msgid "List of Video Memory Usage by Resource:" msgstr "" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Total:" msgstr "Totalt:" @@ -11184,12 +10824,10 @@ msgid "Format" msgstr "" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Usage" msgstr "Användning" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Misc" msgstr "Övrigt" @@ -11233,7 +10871,6 @@ msgid "Editor Settings" msgstr "" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Shortcuts" msgstr "Genvägar" @@ -11361,12 +10998,10 @@ msgid "Disabled GDNative Singleton" msgstr "" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Library" msgstr "Bibliotek" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Libraries: " msgstr "Bibliotek: " @@ -11383,17 +11018,14 @@ msgid "Step argument is zero!" msgstr "" #: modules/gdscript/gdscript_functions.cpp -#, fuzzy msgid "Not a script with an instance" msgstr "Inte ett Skript med en instans" #: modules/gdscript/gdscript_functions.cpp -#, fuzzy msgid "Not based on a script" msgstr "Inte baserad pÃ¥ ett Skript" #: modules/gdscript/gdscript_functions.cpp -#, fuzzy msgid "Not based on a resource file" msgstr "Inte baserad pÃ¥ en resursfil" @@ -11482,17 +11114,14 @@ msgid "Clip Below" msgstr "" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Edit X Axis" msgstr "Redigera X-Axel" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Edit Y Axis" msgstr "Redigera Y-Axel" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Edit Z Axis" msgstr "Redigera Z-Axel" @@ -11525,7 +11154,6 @@ msgid "Cursor Clear Rotation" msgstr "" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Clear Selection" msgstr "Rensa Urval" @@ -11592,12 +11220,10 @@ msgid "Eroding walkable area..." msgstr "" #: modules/recast/navigation_mesh_generator.cpp -#, fuzzy msgid "Partitioning..." msgstr "Partitionerar..." #: modules/recast/navigation_mesh_generator.cpp -#, fuzzy msgid "Creating contours..." msgstr "Skapar konturer..." @@ -11691,7 +11317,6 @@ msgid "Create a new variable." msgstr "Skapa Ny" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Signals:" msgstr "Signaler:" @@ -11709,36 +11334,55 @@ msgid "Name already in use by another func/var/signal:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Rename Function" msgstr "Byt namn pÃ¥ funktion" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Rename Variable" msgstr "Byt namn pÃ¥ variabel" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Rename Signal" msgstr "Byt namn pÃ¥ Signal" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Function" msgstr "Lägg till Funktion" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Delete input port" +msgstr "Ta bort Autoload" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Lägg till Variabel" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Signal" msgstr "Lägg till Signal" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Favoriter:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Favoriter:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Ta bort Autoload" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Ta Bort Mall" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11779,10 +11423,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11795,7 +11449,6 @@ msgid "Change Base Type" msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Move Node(s)" msgstr "Flytta Nod(er)" @@ -11804,12 +11457,16 @@ msgid "Remove VisualScript Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Connect Nodes" msgstr "Anslut Noder" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Anslut Noder" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Anslut Noder" @@ -11819,7 +11476,6 @@ msgid "Connect Node Sequence" msgstr "Anslut Noder" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Script already has function '%s'" msgstr "Skript har redan funktionen '%s'" @@ -11845,17 +11501,35 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Create Function" +msgstr "Byt namn pÃ¥ funktion" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Ta bort Funktion" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Remove Variable" msgstr "Ta bort Variabeln" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Editing Variable:" msgstr "Redigerar Variabel:" @@ -11873,18 +11547,13 @@ msgid "Make Tool:" msgstr "Gör Patch" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Members:" msgstr "Medlemmar:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy -msgid "Available Nodes:" -msgstr "Tillgängliga Noder:" +msgid "function_name" +msgstr "Funktioner:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11903,12 +11572,21 @@ msgid "Copy Nodes" msgstr "Kopiera Noder" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Cut Nodes" msgstr "Klipp ut Noder" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "Byt namn pÃ¥ funktion" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Uppdatera" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Medlemmar" @@ -11949,12 +11627,10 @@ msgid ": Invalid arguments: " msgstr "" #: modules/visual_script/visual_script_nodes.cpp -#, fuzzy msgid "VariableGet not found in script: " msgstr "VariableGet hittades inte i Skript: " #: modules/visual_script/visual_script_nodes.cpp -#, fuzzy msgid "VariableSet not found in script: " msgstr "VariableSet hittades inte i Skript: " @@ -12006,6 +11682,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +#, fuzzy +msgid "Select device from the list" +msgstr "Välj enhet frÃ¥n listan" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -12107,11 +11788,14 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Kör i Webbläsare" #: platform/javascript/export/export.cpp -#, fuzzy msgid "Run exported HTML in the system's default browser." msgstr "Kör exporterad HTML i systemets standardwebbläsare." @@ -12210,7 +11894,6 @@ msgid "" msgstr "" #: scene/2d/collision_polygon_2d.cpp -#, fuzzy msgid "" "CollisionPolygon2D only serves to provide a collision shape to a " "CollisionObject2D derived node. Please only use it as a child of Area2D, " @@ -12221,12 +11904,10 @@ msgstr "" "StaticBody2D, RigidBody2D, KinematicBody2D, etc. för att ge dem en form." #: scene/2d/collision_polygon_2d.cpp -#, fuzzy msgid "An empty CollisionPolygon2D has no effect on collision." msgstr "En tom CollisionPolygon2D har ingen effekt pÃ¥ kollision." #: scene/2d/collision_shape_2d.cpp -#, fuzzy msgid "" "CollisionShape2D only serves to provide a collision shape to a " "CollisionObject2D derived node. Please only use it as a child of Area2D, " @@ -12270,7 +11951,6 @@ msgid "" msgstr "" #: scene/2d/navigation_polygon.cpp -#, fuzzy msgid "" "NavigationPolygonInstance must be a child or grandchild to a Navigation2D " "node. It only provides navigation data." @@ -12279,7 +11959,6 @@ msgstr "" "Navigation2D-Node. Den ger bara navigationsdata." #: scene/2d/parallax_layer.cpp -#, fuzzy msgid "" "ParallaxLayer node only works when set as child of a ParallaxBackground node." msgstr "" @@ -12306,7 +11985,6 @@ msgid "" msgstr "" #: scene/2d/path_2d.cpp -#, fuzzy msgid "PathFollow2D only works when set as a child of a Path2D node." msgstr "" "PathFollow2D fungerar bara när den är satt som ett barn till en Path2D-Node." @@ -12319,7 +11997,6 @@ msgid "" msgstr "" #: scene/2d/remote_transform_2d.cpp -#, fuzzy msgid "Path property must point to a valid Node2D node to work." msgstr "" "Sökvägs-egenskapen mÃ¥ste peka pÃ¥ en giltigt Node2D Node för att fungera." @@ -12415,7 +12092,6 @@ msgid "" msgstr "" #: scene/3d/collision_polygon.cpp -#, fuzzy msgid "" "CollisionPolygon only serves to provide a collision shape to a " "CollisionObject derived node. Please only use it as a child of Area, " @@ -12426,12 +12102,10 @@ msgstr "" "StaticBody, RigidBody, KinematicBody, etc. för att ge dem en form." #: scene/3d/collision_polygon.cpp -#, fuzzy msgid "An empty CollisionPolygon has no effect on collision." msgstr "En tom CollisionPolygon har ingen effekt pÃ¥ kollision." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " "derived node. Please only use it as a child of Area, StaticBody, RigidBody, " @@ -12651,12 +12325,10 @@ msgid "" msgstr "" #: scene/gui/dialogs.cpp -#, fuzzy msgid "Alert!" msgstr "Varning!" #: scene/gui/dialogs.cpp -#, fuzzy msgid "Please Confirm..." msgstr "Vänligen Bekräfta..." @@ -12696,10 +12368,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12732,6 +12400,19 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Add input +" +#~ msgstr "Lägg till Signal" + +#~ msgid "Language" +#~ msgstr "SprÃ¥k" + +#~ msgid "Inherits" +#~ msgstr "Ärver" + +#~ msgid "Available Nodes:" +#~ msgstr "Tillgängliga Noder:" + +#, fuzzy #~ msgid "Methods:" #~ msgstr "Metoder" @@ -12868,10 +12549,6 @@ msgstr "" #~ msgstr "GÃ¥ till överordnad mapp" #, fuzzy -#~ msgid "Select device from the list" -#~ msgstr "Välj enhet frÃ¥n listan" - -#, fuzzy #~ msgid "Open Scene(s)" #~ msgstr "Öppna Scen" @@ -13042,9 +12719,6 @@ msgstr "" #~ msgid "Move Anim Track Down" #~ msgstr "Flytta Anim SpÃ¥r NerÃ¥t" -#~ msgid "Set Transitions to:" -#~ msgstr "Ange övergÃ¥ngar:" - #~ msgid "Anim Track Rename" #~ msgstr "Anim Byt Namn PÃ¥ SpÃ¥r" diff --git a/editor/translations/ta.po b/editor/translations/ta.po index 227ba424b2..08faf73931 100644 --- a/editor/translations/ta.po +++ b/editor/translations/ta.po @@ -363,6 +363,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -492,16 +493,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "அனைதà¯à®¤à¯ தேரà¯à®µà¯à®•ளà¯" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -637,7 +628,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -649,6 +640,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "அனைதà¯à®¤à¯ தேரà¯à®µà¯à®•ளà¯" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -967,7 +963,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1422,7 +1418,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1476,7 +1473,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1861,6 +1858,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2854,7 +2852,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3091,6 +3089,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3117,13 +3119,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3898,7 +3893,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4034,6 +4029,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4379,7 +4380,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4551,6 +4551,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4755,6 +4757,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -5038,20 +5044,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5141,8 +5150,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5404,6 +5412,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6035,6 +6047,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6091,6 +6107,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6189,6 +6206,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6454,6 +6476,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6512,10 +6539,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6835,6 +6858,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6868,6 +6895,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7095,6 +7126,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7868,11 +7903,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7888,6 +7919,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8749,12 +8784,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9740,11 +9777,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9819,6 +9854,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9835,10 +9878,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -10066,23 +10105,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10719,6 +10750,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "அனைதà¯à®¤à¯ தேரà¯à®µà¯à®•ளà¯" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10727,6 +10763,25 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "மாறà¯à®±à®™à¯à®•ளை இதறà¯à®•௠அமை:" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "அசைவூடà¯à®Ÿà¯ பாதையை நீகà¯à®•à¯" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "அசைவூடà¯à®Ÿà¯ பாதையை நீகà¯à®•à¯" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10767,10 +10822,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10795,6 +10860,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "அசைவூடà¯à®Ÿà¯ போலிபசà¯à®šà®¾à®µà®¿à®•ளà¯" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10827,6 +10897,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10851,15 +10941,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10883,6 +10969,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10977,6 +11071,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11076,6 +11174,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11613,10 +11715,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/te.po b/editor/translations/te.po index d56e46777d..617809b62d 100644 --- a/editor/translations/te.po +++ b/editor/translations/te.po @@ -349,6 +349,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -474,15 +475,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -617,7 +609,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -629,6 +621,10 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +msgid "Select All/None" +msgstr "" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -945,7 +941,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1400,7 +1396,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1454,7 +1451,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1838,6 +1835,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2828,7 +2826,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3064,6 +3062,10 @@ msgstr "" msgid "New Script" msgstr "" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3090,13 +3092,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3869,7 +3864,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4004,6 +3999,12 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4345,7 +4346,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4513,6 +4513,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4717,6 +4719,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "" @@ -4995,20 +5001,23 @@ msgid "Ruler Mode" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5098,8 +5107,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5359,6 +5367,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -5988,6 +6000,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6044,6 +6060,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6142,6 +6159,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "" @@ -6407,6 +6429,11 @@ msgstr "" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6464,10 +6491,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6787,6 +6810,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6820,6 +6847,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7046,6 +7077,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -7808,11 +7843,7 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +msgid "Add Output" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7828,6 +7859,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8684,12 +8719,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9671,11 +9708,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9749,6 +9784,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9765,10 +9808,6 @@ msgid "Change Type" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "" @@ -9995,23 +10034,15 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Template" +msgid "Template:" msgstr "" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "" #: editor/script_create_dialog.cpp @@ -10645,6 +10676,10 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Delete input port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10653,6 +10688,22 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Add Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Add Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Input Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Remove Output Port" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10693,10 +10744,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10721,6 +10782,10 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Disconnect Nodes" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -10753,6 +10818,26 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Create Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -10777,15 +10862,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -10809,6 +10890,14 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Make Function" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -10903,6 +10992,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11002,6 +11095,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11539,10 +11636,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/th.po b/editor/translations/th.po index b61dca3f4a..2bd671a4f4 100644 --- a/editor/translations/th.po +++ b/editor/translations/th.po @@ -390,6 +390,7 @@ msgstr "เพิ่ม %d à¹à¸—ร็à¸à¹ƒà¸«à¸¡à¹ˆà¹à¸¥à¸°à¹€à¸žà¸´à¹ˆà¸¡à¸ #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "สร้าง" @@ -524,15 +525,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "เลืà¸à¸à¸—ั้งหมด" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "ไม่เลืà¸à¸" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -675,8 +667,9 @@ msgid "Scale Ratio:" msgstr "à¸à¸±à¸•ราส่วนเวลา:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "เลืà¸à¸à¸„ุณสมบัติ" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -687,6 +680,11 @@ msgstr "" msgid "Copy" msgstr "คัดลà¸à¸" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "ไม่เลืà¸à¸" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1027,7 +1025,7 @@ msgid "Resource" msgstr "รีซà¸à¸£à¹Œà¸ª" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡" @@ -1500,7 +1498,8 @@ msgstr "เพิ่มà¸à¸à¹‚ต้โหลด" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡:" @@ -1555,7 +1554,7 @@ msgstr "สร้างโฟลเดà¸à¸£à¹Œ" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "ชื่à¸:" @@ -1981,6 +1980,7 @@ msgid "Class:" msgstr "คลาส:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "สืบทà¸à¸”จาà¸:" @@ -3051,7 +3051,7 @@ msgstr "คุณสมบัติ" msgid "Expand Bottom Panel" msgstr "ขยายโฟลเดà¸à¸£à¹Œ" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "ข้à¸à¸„วาม" @@ -3296,6 +3296,11 @@ msgstr "เลืà¸à¸ Viewport" msgid "New Script" msgstr "สคริปต์ใหม่" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "เปิดสคริปต์" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "%s ใหม่" @@ -3322,14 +3327,6 @@ msgstr "วาง" msgid "Convert To %s" msgstr "à¹à¸›à¸¥à¸‡à¹€à¸›à¹‡à¸™ %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "เปิดในโปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ข" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "โหนดที่เลืà¸à¸à¹„ม่ใช่ Viewport!" @@ -4159,7 +4156,7 @@ msgstr "ปลั๊à¸à¸à¸´à¸™" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp #, fuzzy msgid "Language:" msgstr "ภาษา" @@ -4315,6 +4312,13 @@ msgstr "ย้ายจุด" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "เปิดในโปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ข" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4687,7 +4691,6 @@ msgstr "ชื่à¸à¹à¸à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "ผิดพลาด!" @@ -4865,6 +4868,8 @@ msgid "Current:" msgstr "ปัจจุบัน:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" @@ -5079,6 +5084,10 @@ msgid "All" msgstr "ทั้งหมด" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "นำเข้าà¸à¸µà¸à¸„รั้ง..." @@ -5390,25 +5399,30 @@ msgstr "โหมดà¸à¸²à¸£à¸—ำงาน:" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "เปิด/ปิด à¸à¸²à¸£à¸ˆà¸³à¸à¸±à¸”" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "จำà¸à¸±à¸”à¸à¸²à¸£à¹€à¸„ลื่à¸à¸™à¸¢à¹‰à¸²à¸¢" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "ตัวเลืà¸à¸à¸à¸²à¸£à¸ˆà¸³à¸à¸±à¸”" +msgid "Toggle grid snapping." +msgstr "เปิด/ปิด à¸à¸²à¸£à¸ˆà¸³à¸à¸±à¸”" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" +msgid "Use Grid Snap" msgstr "จำà¸à¸±à¸”ด้วยเส้นตาราง" #: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "ตัวเลืà¸à¸à¸à¸²à¸£à¸ˆà¸³à¸à¸±à¸”" + +#: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" msgstr "จำà¸à¸±à¸”à¸à¸²à¸£à¸«à¸¡à¸¸à¸™" @@ -5504,8 +5518,8 @@ msgid "View" msgstr "มุมมà¸à¸‡" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "à¹à¸ªà¸”งเส้นตาราง" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5784,6 +5798,11 @@ msgstr "เปิด/ปิดเส้นสัมผัสà¹à¸™à¸§à¹‚ค้ภmsgid "Hold Shift to edit tangents individually" msgstr "à¸à¸” Shift ค้างเพื่à¸à¸›à¸£à¸±à¸šà¹€à¸ªà¹‰à¸™à¸ªà¸±à¸¡à¸œà¸±à¸ªà¹à¸¢à¸à¸à¸±à¸™" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "คลิà¸à¸‚วา: ลบจุด" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "สร้าง GI Probe" @@ -6437,6 +6456,10 @@ msgid "Grid" msgstr "เส้นตาราง" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "à¹à¸ªà¸”งเส้นตาราง" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "ตั้งค่าà¸à¸²à¸£à¸ˆà¸³à¸à¸±à¸”" @@ -6499,6 +6522,7 @@ msgstr "à¸à¸´à¸™à¸ªà¹à¸•นซ์:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "ประเภท:" @@ -6609,6 +6633,11 @@ msgid "Find Next" msgstr "ค้นหาต่à¸à¹„ป" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "ค้นหาà¸à¹ˆà¸à¸™à¸«à¸™à¹‰à¸²" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "ตัวà¸à¸£à¸à¸‡" @@ -6895,6 +6924,11 @@ msgstr "ลบจุด" msgid "Cut" msgstr "ตัด" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "เลืà¸à¸à¸—ั้งหมด" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "ลบบรรทัด" @@ -6955,10 +6989,6 @@ msgid "Auto Indent" msgstr "ย่à¸à¸«à¸™à¹‰à¸²à¸à¸±à¸•โนมัติ" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "ค้นหาà¸à¹ˆà¸à¸™à¸«à¸™à¹‰à¸²" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "คัดà¸à¸£à¸à¸‡à¹„ฟล์..." @@ -7301,6 +7331,11 @@ msgid "Freelook Speed Modifier" msgstr "ปรับความเร็วมุมมà¸à¸‡à¸à¸´à¸ªà¸£à¸°" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "ปรับความเร็วมุมมà¸à¸‡à¸à¸´à¸ªà¸£à¸°" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7340,6 +7375,10 @@ msgid "Use Local Space" msgstr "โหมดพิà¸à¸±à¸”ภายใน (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "จำà¸à¸±à¸”à¸à¸²à¸£à¹€à¸„ลื่à¸à¸™à¸¢à¹‰à¸²à¸¢" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "มุมล่าง" @@ -7581,6 +7620,11 @@ msgstr "" #: editor/plugins/sprite_editor_plugin.cpp #, fuzzy +msgid "Shrink (Pixels): " +msgstr "Snap (พิà¸à¹€à¸‹à¸¥):" + +#: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy msgid "Grow (Pixels): " msgstr "Snap (พิà¸à¹€à¸‹à¸¥):" @@ -8436,12 +8480,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8460,6 +8499,11 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "Sampler" +msgstr "ไฟล์เสียง" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Add input port" msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" @@ -9361,13 +9405,17 @@ msgid "Resources to export:" msgstr "รีซà¸à¸£à¹Œà¸ªà¸—ี่จะส่งà¸à¸à¸:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "ตัวà¸à¸£à¸à¸‡à¹„ฟล์ที่จะส่งà¸à¸à¸à¹€à¸žà¸´à¹ˆà¸¡à¹€à¸•ิม (คั่นด้วยจุลภาค ตัวà¸à¸¢à¹ˆà¸²à¸‡à¹€à¸Šà¹ˆà¸™: *.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "ตัวà¸à¸£à¸à¸‡à¹„ฟล์ที่จะไม่ส่งà¸à¸à¸ (คั่นด้วยจุลภาค ตัวà¸à¸¢à¹ˆà¸²à¸‡à¹€à¸Šà¹ˆà¸™: *.json, *.txt)" #: editor/project_export.cpp @@ -10405,12 +10453,10 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "à¹à¸à¹‰à¹„ขโหนดลูà¸à¹„ด้" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "โหลดเป็นตัวà¹à¸—น" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy @@ -10491,6 +10537,14 @@ msgid "Clear Inheritance" msgstr "ลบà¸à¸²à¸£à¸ªà¸·à¸šà¸—à¸à¸”" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "à¹à¸à¹‰à¹„ขโหนดลูà¸à¹„ด้" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "โหลดเป็นตัวà¹à¸—น" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "เปิดคู่มืà¸" @@ -10510,11 +10564,6 @@ msgstr "เปลี่ยนประเภท" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "เปิดสคริปต์" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "หาโหนดà¹à¸¡à¹ˆà¹ƒà¸«à¸¡à¹ˆ" @@ -10781,23 +10830,18 @@ msgid "Will load an existing script file." msgstr "โหลดสคริปต์จาà¸à¸”ิสà¸à¹Œ" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "ภาษา" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "สืบทà¸à¸”จาà¸" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "ชื่à¸à¸„ลาส" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "à¹à¸¡à¹ˆà¹à¸šà¸š" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "à¸à¸±à¸‡à¸ªà¸„ริปต์" #: editor/script_create_dialog.cpp @@ -11462,6 +11506,11 @@ msgid "Add Function" msgstr "เพิ่มฟังà¸à¹Œà¸Šà¸±à¸™" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "ลบจุด" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "เพิ่มตัวà¹à¸›à¸£" @@ -11470,6 +11519,26 @@ msgid "Add Signal" msgstr "เพิ่มสัà¸à¸à¸²à¸“" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "ลบจุด" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "ลบจุด" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "à¹à¸à¹‰à¹„ขสมà¸à¸²à¸£" @@ -11510,10 +11579,20 @@ msgid "Add Preload Node" msgstr "เพิ่มโหนด Preload" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "เพิ่มโหนดจาà¸à¸œà¸±à¸‡" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "เพิ่มตัวรับคุณสมบัติ" @@ -11539,6 +11618,11 @@ msgstr "เชื่à¸à¸¡à¹‚หนด" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "ตัดà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸à¸¡à¸•่à¸à¹‚หนด" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "เชื่à¸à¸¡à¹‚หนด" @@ -11573,6 +11657,28 @@ msgid "Paste VisualScript Nodes" msgstr "วางโหนด" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "คัดลà¸à¸à¹‚หนดฟังà¸à¹Œà¸Šà¸±à¸™à¹„ม่ได้" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "เปลี่ยนชื่à¸à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "ลบฟังà¸à¹Œà¸Šà¸±à¸™" @@ -11598,16 +11704,13 @@ msgid "Make Tool:" msgstr "ระยะใà¸à¸¥à¹‰" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "ชนิด:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "ตัวà¹à¸›à¸£:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "โหนดที่มีให้ใช้:" +#, fuzzy +msgid "function_name" +msgstr "ฟังà¸à¹Œà¸Šà¸±à¸™:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11632,6 +11735,16 @@ msgstr "ตัดโหนด" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "เปลี่ยนชื่à¸à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "รีเฟรช" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "ตัวà¹à¸›à¸£" @@ -11727,6 +11840,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "เลืà¸à¸à¸à¸¸à¸›à¸à¸£à¸“์จาà¸à¸£à¸²à¸¢à¸Šà¸·à¹ˆà¸" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11829,6 +11946,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "รันในเบราเซà¸à¸£à¹Œ" @@ -12434,11 +12555,6 @@ msgstr "" "ให้à¹à¸à¹‰à¹„ขโหนดนี้ให้เป็นโหนดลูà¸à¸‚à¸à¸‡ Control à¹à¸•่ถ้าไม่ ให้ปรับเป็น render target à¹à¸¥à¸°à¸™à¸³à¹„ปใช้เป็น " "texture ขà¸à¸‡à¹‚หนดà¸à¸·à¹ˆà¸™" -#: scene/resources/visual_shader.cpp -#, fuzzy -msgid "Input" -msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12470,6 +12586,30 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "จำà¸à¸±à¸”ด้วยเส้นตาราง" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" + +#~ msgid "Language" +#~ msgstr "ภาษา" + +#~ msgid "Inherits" +#~ msgstr "สืบทà¸à¸”จาà¸" + +#~ msgid "Base Type:" +#~ msgstr "ชนิด:" + +#~ msgid "Available Nodes:" +#~ msgstr "โหนดที่มีให้ใช้:" + +#, fuzzy +#~ msgid "Input" +#~ msgstr "เพิ่มà¸à¸´à¸™à¸žà¸¸à¸•" + #~ msgid "Properties:" #~ msgstr "คุณสมบัติ:" @@ -12682,9 +12822,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "ไปยังโฟลเดà¸à¸£à¹Œà¸«à¸¥à¸±à¸" -#~ msgid "Select device from the list" -#~ msgstr "เลืà¸à¸à¸à¸¸à¸›à¸à¸£à¸“์จาà¸à¸£à¸²à¸¢à¸Šà¸·à¹ˆà¸" - #~ msgid "Open Scene(s)" #~ msgstr "เปิดไฟล์ฉาà¸" @@ -12927,9 +13064,6 @@ msgstr "" #~ msgid "Warning" #~ msgstr "คำเตืà¸à¸™" -#~ msgid "Function:" -#~ msgstr "ฟังà¸à¹Œà¸Šà¸±à¸™:" - #~ msgid "Variable" #~ msgstr "ตัวà¹à¸›à¸£" @@ -12993,9 +13127,6 @@ msgstr "" #~ msgid "Connect Graph Nodes" #~ msgstr "เชื่à¸à¸¡à¸•่à¸à¹‚หนด" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "ตัดà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸à¸¡à¸•่à¸à¹‚หนด" - #~ msgid "Remove Shader Graph Node" #~ msgstr "ลบโหนด" @@ -14059,9 +14190,6 @@ msgstr "" #~ msgid "Shrink By:" #~ msgstr "ลดไป:" -#~ msgid "Samples" -#~ msgstr "ไฟล์เสียง" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "à¸à¸²à¸£à¹à¸›à¸¥à¸‡à¹„ฟล์เสียง: (ไฟล์ .wav):" diff --git a/editor/translations/tr.po b/editor/translations/tr.po index 5f87d558a8..2673676cb8 100644 --- a/editor/translations/tr.po +++ b/editor/translations/tr.po @@ -9,7 +9,7 @@ # Enescan Yerlikaya <enescanyerlikaya@gmail.com>, 2017. # Fatih Mert DoÄŸancan <fatihmertdogancan@hotmail.com>, 2017. # hubbyist <hub@legrud.net>, 2017. -# H.Hüseyin CİHANGİR <hashusfb@gmail.com>, 2018. +# H.Hüseyin CİHANGİR <hashusfb@gmail.com>, 2018, 2019. # Kaan Gül <qaantum@hotmail.com>, 2018. # M. Yavuz Uzun <myavuzuzun@yandex.com>, 2016. # monolifed <monolifed@gmail.com>, 2018. @@ -34,12 +34,16 @@ # rayray61 <laladodo000@gmail.com>, 2019. # enesygt <enesyigittt@gmail.com>, 2019. # Mustafa Turhan <odunluzikkim@gmail.com>, 2019. +# Ullima <nacej@my6mail.com>, 2019. +# Bera Koklu <bkoklu001@student.hampton.k12.va.us>, 2019. +# Mehmet AKDEMİR <mamoo81@gmail.com>, 2019. +# Oguz Ersen <oguzersen@protonmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-26 11:50+0000\n" -"Last-Translator: Mustafa Turhan <odunluzikkim@gmail.com>\n" +"PO-Revision-Date: 2019-10-27 07:47+0000\n" +"Last-Translator: Oguz Ersen <oguzersen@protonmail.com>\n" "Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/" "godot/tr/>\n" "Language: tr\n" @@ -47,7 +51,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.9-dev\n" +"X-Generator: Weblate 3.9.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -92,32 +96,31 @@ msgstr "'%s' çaÄŸrıldığında:" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "Çırp" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -383,6 +386,7 @@ msgstr "%d YENİ izler oluÅŸtur ve anahtarlar gir?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "OluÅŸtur" @@ -525,15 +529,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Uyarı: İçe aktarılan animasyonu düzenleme" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Hepsini seç" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Hiçbir Åžey Seçilmedi" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -671,7 +666,8 @@ msgid "Scale Ratio:" msgstr "Ölçek Oranı:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Kopyalanacak izleri seç:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -683,6 +679,11 @@ msgstr "Kopyalanacak izleri seç:" msgid "Copy" msgstr "Tıpkıla" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Hiçbir Åžey Seçilmedi" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Ses İz Klipsi Ekle" @@ -1006,7 +1007,7 @@ msgid "Resource" msgstr "Kaynak" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "Yol" @@ -1276,9 +1277,8 @@ msgid "Delete Bus Effect" msgstr "Bus Efekti Sil" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Audio Bus, düzenlemek için Sürükle-Bırak." +msgstr "Düzenlemek için Sürükle-Bırak." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1351,7 +1351,7 @@ msgstr "Audio Bus YerleÅŸim Düzenini Aç" #: editor/editor_audio_buses.cpp msgid "There is no '%s' file." -msgstr "'%s' dosyası bulunamadı" +msgstr "'%s' dosyası bulunamadı." #: editor/editor_audio_buses.cpp editor/plugins/canvas_item_editor_plugin.cpp msgid "Layout" @@ -1469,7 +1469,8 @@ msgstr "KendindenYüklenme Ekle" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "Dosya yolu:" @@ -1480,7 +1481,7 @@ msgstr "Düğüm adı:" #: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp #: editor/editor_profiler.cpp editor/settings_config_dialog.cpp msgid "Name" -msgstr "Ad" +msgstr "İsim" #: editor/editor_autoload_settings.cpp msgid "Singleton" @@ -1523,7 +1524,7 @@ msgstr "Klasör OluÅŸtur" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "İsim:" @@ -1614,14 +1615,12 @@ msgid "Scene Tree Editing" msgstr "Sahne AÄŸacı (Düğümler):" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Import Dock" -msgstr "İçe Aktar" +msgstr "Dock İçe Aktar" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Node Dock" -msgstr "Biçimi Taşı" +msgstr "Dock Nod" #: editor/editor_feature_profile.cpp msgid "FileSystem and Import Docks" @@ -1636,23 +1635,20 @@ msgid "Profile must be a valid filename and must not contain '.'" msgstr "Profil geçerli bir dosya adı olmalı ve '.' içermemelidir" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Profile with this name already exists." -msgstr "Bu isimde zaten bir dosya ve ya klasör mevcut." +msgstr "Bu isimde zaten bir profil mevcut." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "(Editor Disabled, Properties Disabled)" -msgstr "(Editör Devre Dışı, Özellikler Devre Dışı)" +msgstr "(Editör Pasif, Özellikler Pasif)" #: editor/editor_feature_profile.cpp msgid "(Properties Disabled)" msgstr "(Özellikler Devre Dışı)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "(Editor Disabled)" -msgstr "Klip Devre dışı" +msgstr "Editör Devre dışı" #: editor/editor_feature_profile.cpp msgid "Class Options:" @@ -1663,26 +1659,22 @@ msgid "Enable Contextual Editor" msgstr "İçeriksel Düzenleyiciyi EtkinleÅŸtir" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Properties:" -msgstr "Özellikler:" +msgstr "Etkin Özellikler:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Features:" -msgstr "Özellikler" +msgstr "Aktif Özellikler:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Classes:" -msgstr "Sınıfları Ara" +msgstr "Aktif Sınıflar:" #: editor/editor_feature_profile.cpp msgid "File '%s' format is invalid, import aborted." msgstr "'%s' dosyası geçersiz, içe aktarma iptal edildi." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." @@ -1690,24 +1682,20 @@ msgstr "" "'%s' profili zaten var. İçe aktarmadan önce silin, içe aktarma iptal edildi." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Error saving profile to path: '%s'." -msgstr "Åžablon '%s' yüklenirken hata" +msgstr "Profil yolu kaydetme hatası: '%s'." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Unset" -msgstr "Ayarını kaldır" +msgstr "Ayarı kaldır" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Current Profile:" -msgstr "Åžu Anki Sürüm:" +msgstr "Åžu Anki Profil:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Make Current" -msgstr "Geçerli:" +msgstr "Geçerli Yap" #: editor/editor_feature_profile.cpp #: editor/plugins/animation_player_editor_plugin.cpp @@ -1725,37 +1713,30 @@ msgid "Export" msgstr "Dışa Aktar" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Available Profiles:" -msgstr "Kullanılabilir Düğümler:" +msgstr "Kullanılabilir Profiller:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Class Options" -msgstr "Sınıf Açıklaması" +msgstr "Sınıf Seçenekleri" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "New profile name:" -msgstr "Yeni alan adı:" +msgstr "Yeni profil ismi:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Erase Profile" -msgstr "Alanı Sil" +msgstr "Profili Sil" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Import Profile(s)" -msgstr "İçe Aktarılan Proje(ler)" +msgstr "Profil(leri) İçe Aktar" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Export Profile" -msgstr "Projeyi Dışa Aktar" +msgstr "Profil Dışa Aktar" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Manage Editor Feature Profiles" msgstr "Dışa Aktarım Åžablonlarını Yönet" @@ -1807,7 +1788,7 @@ msgstr "Bir Dosya Aç" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open File(s)" -msgstr "Dosya(leri) Aç" +msgstr "Dosya(ları) Aç" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open a Directory" @@ -1865,19 +1846,16 @@ msgid "Move Favorite Down" msgstr "BeÄŸenileni AÅŸağı Taşı" #: editor/editor_file_dialog.cpp -#, fuzzy msgid "Go to previous folder." -msgstr "Önceki klasöre git" +msgstr "Önceki klasöre git." #: editor/editor_file_dialog.cpp -#, fuzzy msgid "Go to next folder." -msgstr "Sonraki klasöre git" +msgstr "Sonraki klasöre git." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Go to parent folder." -msgstr "Asıl klasöre git" +msgstr "Üst klasöre git." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh files." @@ -1888,14 +1866,12 @@ msgid "(Un)favorite current folder." msgstr "Bu klasörü favorilerden çıkar/favorilere ekle." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Toggle the visibility of hidden files." -msgstr "Gizli Dosyalari Aç / Kapat" +msgstr "Gizli Dosyaları Aç / Kapat." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp -#, fuzzy msgid "View items as a grid of thumbnails." -msgstr "Öğeleri küçük resim ızgarası ÅŸeklinde göster" +msgstr "Öğeleri küçük resim ızgarası ÅŸeklinde göster." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "View items as a list." @@ -1945,6 +1921,7 @@ msgid "Class:" msgstr "Sınıf:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Kalıtçılar:" @@ -1953,9 +1930,8 @@ msgid "Inherited by:" msgstr "Åžundan miras alındı:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "Kısa Açıklama:" +msgstr "Kısa Açıklama" #: editor/editor_help.cpp msgid "Properties" @@ -1986,9 +1962,8 @@ msgid "Class Description" msgstr "Sınıf Açıklaması" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Çevrimiçi Rehberler:" +msgstr "Çevrimiçi Rehberler" #: editor/editor_help.cpp msgid "" @@ -2111,7 +2086,7 @@ msgstr "BaÅŸlat" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2127,19 +2102,19 @@ msgstr "Düğüm" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "Gelen RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "Gelen RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "Giden RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "Giden RSET" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2163,7 +2138,6 @@ msgid "Error saving resource!" msgstr "Kaynak kaydedilirken hata!" #: editor/editor_node.cpp -#, fuzzy msgid "" "This resource can't be saved because it does not belong to the edited scene. " "Make it unique first." @@ -2727,17 +2701,16 @@ msgid "Project Settings..." msgstr "Proje Ayarları..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "Sürüm:" +msgstr "Sürüm Kontrol" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "Sürüm Kontrolü Kur" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Sürüm Kontrolü Kapat" #: editor/editor_node.cpp msgid "Export..." @@ -2757,9 +2730,8 @@ msgid "Tools" msgstr "Araçlar" #: editor/editor_node.cpp -#, fuzzy msgid "Orphan Resource Explorer..." -msgstr "Orphan Kaynak AraÅŸtırıcı" +msgstr "Orphan Kaynak Göstericisi..." #: editor/editor_node.cpp msgid "Quit to Project List" @@ -2784,7 +2756,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Small Deploy with Network FS" -msgstr "AÄŸ DS'li Küçük Dağıtım" +msgstr "AÄŸ DS ile Küçük Dağıtım" #: editor/editor_node.cpp msgid "" @@ -2862,9 +2834,8 @@ msgid "Editor" msgstr "Düzenleyici" #: editor/editor_node.cpp -#, fuzzy msgid "Editor Settings..." -msgstr "Düzenleyici Ayarları" +msgstr "Düzenleyici Ayarları..." #: editor/editor_node.cpp msgid "Editor Layout" @@ -2883,9 +2854,8 @@ msgid "Toggle Fullscreen" msgstr "Tam Ekran Aç / Kapat" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle System Console" -msgstr "CanvasItem'ı Görünür Duruma Getir" +msgstr "Sistem Terminalini Aç / Kapat" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -2900,14 +2870,12 @@ msgid "Open Editor Settings Folder" msgstr "Düzenleyici Ayarları Klasörünü Aç" #: editor/editor_node.cpp -#, fuzzy msgid "Manage Editor Features..." -msgstr "Düzenleyici Åžablonlarını Yönet..." +msgstr "Düzenleyici Özelliklerini Yönet..." #: editor/editor_node.cpp -#, fuzzy msgid "Manage Export Templates..." -msgstr "Dışa Aktarım Åžablonlarını Yönet" +msgstr "Dışa Aktarım Åžablonlarını Yönet..." #: editor/editor_node.cpp editor/plugins/shader_editor_plugin.cpp msgid "Help" @@ -2928,7 +2896,6 @@ msgid "Online Docs" msgstr "Çevrimiçi Belgeler" #: editor/editor_node.cpp -#, fuzzy msgid "Q&A" msgstr "S&C" @@ -2995,19 +2962,16 @@ msgid "Spins when the editor window redraws." msgstr "Düzenleyici penceresi yeniden boyandığında döner." #: editor/editor_node.cpp -#, fuzzy msgid "Update Continuously" -msgstr "Kesintisiz Güncelle" +msgstr "Sürekli Güncelle" #: editor/editor_node.cpp -#, fuzzy msgid "Update When Changed" -msgstr "DeÄŸiÅŸtirildiÄŸinde güncelle" +msgstr "DeÄŸiÅŸiklik OlduÄŸunda Güncelle" #: editor/editor_node.cpp -#, fuzzy msgid "Hide Update Spinner" -msgstr "Güncelleme Topacını Devre Dışı Bırak" +msgstr "Güncelleme Topacını Gizle" #: editor/editor_node.cpp msgid "FileSystem" @@ -3021,7 +2985,7 @@ msgstr "Denetçi" msgid "Expand Bottom Panel" msgstr "Alt Panoyu GeniÅŸlet" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Çıktı" @@ -3030,14 +2994,12 @@ msgid "Don't Save" msgstr "Kaydetme" #: editor/editor_node.cpp -#, fuzzy msgid "Android build template is missing, please install relevant templates." -msgstr "Android yapı ÅŸablonu eksik, lütfen ilgili ÅŸablonları yükleyin." +msgstr "Android yapı ÅŸablonu eksik, lütfen uygun ÅŸablonları yükleyin." #: editor/editor_node.cpp -#, fuzzy msgid "Manage Templates" -msgstr "Dışa Aktarım Åžablonlarını Yönet" +msgstr "Åžablonlarını Yönet" #: editor/editor_node.cpp msgid "" @@ -3111,7 +3073,7 @@ msgstr "Betik Düzenleyiciyi Aç" #: editor/editor_node.cpp editor/project_manager.cpp msgid "Open Asset Library" -msgstr "Malvarlığı Kütüphanesini Aç" +msgstr "Projeler Kütüphanesini Aç" #: editor/editor_node.cpp msgid "Open the next Editor" @@ -3122,9 +3084,8 @@ msgid "Open the previous Editor" msgstr "Önceki Düzenleyiciyi Aç" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Yüzey kaynağı belirtilmedi." +msgstr "Alt kaynağı bulunamadı." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3135,9 +3096,8 @@ msgid "Thumbnail..." msgstr "Küçük Resim..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Betik Aç" +msgstr "Ana Betik:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3209,9 +3169,8 @@ msgid "Calls" msgstr "ÇaÄŸrılar" #: editor/editor_properties.cpp -#, fuzzy msgid "Edit Text:" -msgstr "Tema düzenle..." +msgstr "Metin Düzenle:" #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" @@ -3247,7 +3206,6 @@ msgstr "" "uyuÅŸmuyor." #: editor/editor_properties.cpp -#, fuzzy msgid "" "Can't create a ViewportTexture on resources saved as a file.\n" "Resource needs to belong to a scene." @@ -3257,7 +3215,6 @@ msgstr "" "Kaynak bir sahneye ait olmalı." #: editor/editor_properties.cpp -#, fuzzy msgid "" "Can't create a ViewportTexture on this resource because it's not set as " "local to scene.\n" @@ -3277,6 +3234,11 @@ msgstr "Bir Görüntükapısı Seçin" msgid "New Script" msgstr "Yeni Betik" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Betik Aç" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Yeni %s" @@ -3303,13 +3265,6 @@ msgstr "Yapıştır" msgid "Convert To %s" msgstr "Åžuna Dönüştür %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Düzenleyiciyi Aç" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Seçili düğüm bir Viewport deÄŸil!" @@ -3492,9 +3447,8 @@ msgid "Download Complete." msgstr "İndirme Tamamlandı." #: editor/export_template_manager.cpp -#, fuzzy msgid "Cannot remove temporary file:" -msgstr "Tema dosyaya kaydedilemiyor:" +msgstr "Geçici dosya kaldırılamıyor:" #: editor/export_template_manager.cpp #, fuzzy @@ -3506,9 +3460,8 @@ msgstr "" "'%s'." #: editor/export_template_manager.cpp -#, fuzzy msgid "Error requesting URL:" -msgstr "Url isteÄŸi hatası: " +msgstr "URL isteÄŸi hatası:" #: editor/export_template_manager.cpp msgid "Connecting to Mirror..." @@ -3557,9 +3510,8 @@ msgid "SSL Handshake Error" msgstr "SSL El Sıkışma Hatası" #: editor/export_template_manager.cpp -#, fuzzy msgid "Uncompressing Android Build Sources" -msgstr "Varlıklar Çıkartılıyor" +msgstr "Android İnÅŸa Kaynakları Çıkartılıyor" #: editor/export_template_manager.cpp msgid "Current Version:" @@ -3578,9 +3530,8 @@ msgid "Remove Template" msgstr "Åžablonu Kaldır" #: editor/export_template_manager.cpp -#, fuzzy msgid "Select Template File" -msgstr "Åžablon dosyası seç" +msgstr "Åžablon Dosyası Seç" #: editor/export_template_manager.cpp msgid "Export Template Manager" @@ -3658,14 +3609,12 @@ msgid "Duplicating folder:" msgstr "Klasör çoÄŸaltılıyor:" #: editor/filesystem_dock.cpp -#, fuzzy msgid "New Inherited Scene" -msgstr "Yeni Miras Alınmış Sahne ..." +msgstr "Yeni Miras Alınmış Sahne" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Open Scenes" -msgstr "Sahneyi Aç" +msgstr "Sahneleri Aç" #: editor/filesystem_dock.cpp msgid "Instance" @@ -3732,14 +3681,12 @@ msgid "Rename" msgstr "Yeniden Adlandır" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Previous Folder/File" -msgstr "Önceki Klasör" +msgstr "Önceki Klasör/Dosya" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Next Folder/File" -msgstr "Sonraki Klasör" +msgstr "Sonraki Klasör/Dosya" #: editor/filesystem_dock.cpp msgid "Re-Scan Filesystem" @@ -3775,9 +3722,8 @@ msgid "Overwrite" msgstr "Üzerine Yaz" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Create Scene" -msgstr "Sahneden OluÅŸtur" +msgstr "Sahne OluÅŸtur" #: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp msgid "Create Script" @@ -3863,9 +3809,8 @@ msgid "Rename Group" msgstr "Grupları Düzenle" #: editor/groups_editor.cpp -#, fuzzy msgid "Delete Group" -msgstr "Bediz ÖbeÄŸini Sil" +msgstr "Grup Sil" #: editor/groups_editor.cpp editor/node_dock.cpp msgid "Groups" @@ -3890,9 +3835,8 @@ msgid "Empty groups will be automatically removed." msgstr "BoÅŸ gruplar otomatik olarak silinecektir." #: editor/groups_editor.cpp -#, fuzzy msgid "Group Editor" -msgstr "Betik Düzenleyiciyi Aç" +msgstr "Grup Düzenleyici" #: editor/groups_editor.cpp msgid "Manage Groups" @@ -3994,9 +3938,8 @@ msgid "Import As:" msgstr "Åžu Åžekilde İçe Aktar:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "Önayarlar" +msgstr "Önayar" #: editor/import_dock.cpp msgid "Reimport" @@ -4125,7 +4068,7 @@ msgstr "Eklentinin Adı:" msgid "Subfolder:" msgstr "Alt Klasör:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Dil:" @@ -4200,14 +4143,12 @@ msgid "Move Node Point" msgstr "Düğüm Noktasını Taşı" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "BlendSpace1D'nin Sınırlarını DeÄŸiÅŸtir" +msgstr "BlendSpace1D Sınırlarını DeÄŸiÅŸtir" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "BlendSpace1D'nin Etiketlerini DeÄŸiÅŸtir" +msgstr "BlendSpace1D Etiketlerini DeÄŸiÅŸtir" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -4248,7 +4189,6 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Set the blending position within the space" msgstr "Harmanlama konumunu uzay içinde ayarla" @@ -4270,6 +4210,12 @@ msgstr "Nokta" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Düzenleyiciyi Aç" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Animasyon Düğümünü Aç" @@ -4284,7 +4230,6 @@ msgid "Add Triangle" msgstr "Üçgen Ekle" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" msgstr "BlendSpace2D Sınırlarını DeÄŸiÅŸtir" @@ -4294,12 +4239,10 @@ msgid "Change BlendSpace2D Labels" msgstr "BlendSpace2D Etiketlerini DeÄŸiÅŸtir" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" msgstr "BlendSpace2D Noktasını Kaldır" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" msgstr "BlendSpace2D Üçgenini Kaldır" @@ -4308,9 +4251,8 @@ msgid "BlendSpace2D does not belong to an AnimationTree node." msgstr "BlendSpace2D bir AnimationTree düğümüne ait deÄŸil." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "No triangles exist, so no blending can take place." -msgstr "Herhangi bir üçgen bulunmuyor, harmanlama iÅŸlemi yapılamaz." +msgstr "Herhangi bir üçgen bulunmuyor, burada harmanlama iÅŸlemi yapılamaz." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Toggle Auto Triangles" @@ -4321,13 +4263,12 @@ msgid "Create triangles by connecting points." msgstr "BaÄŸlantı noktalarından üçgen yarat." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Erase points and triangles." -msgstr "%d Üçgenlerini Ayrıştırma:" +msgstr "Noktaları ve üçgenleri sil." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Generate blend triangles automatically (instead of manually)" -msgstr "" +msgstr "Otomatik üçgen harmanlayıcı oluÅŸtur (el ile)" #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -4335,9 +4276,8 @@ msgid "Blend:" msgstr "Karışma:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Materyal DeÄŸiÅŸiklikleri" +msgstr "Parametre DeÄŸiÅŸti" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -4362,48 +4302,43 @@ msgstr "Biçimi Taşı" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Unable to connect, port may be in use or connection may be invalid." msgstr "" +"BaÄŸlanılamıyor, port kullanımda olabilir veya baÄŸlantı geçersiz olabilir." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "BaÄŸlı" +msgstr "Düğümler BaÄŸlandı" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "BaÄŸlantı kesildi" +msgstr "Düğümlerin BaÄŸlantısı Kesildi" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Animasyon" +msgstr "Animasyon Ata" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Düğümleri Sil" +msgstr "Düğüm Sil" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/scene_tree_dock.cpp msgid "Delete Node(s)" -msgstr "Düğümleri Sil" +msgstr "Düğüm(leri) Sil" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Dikkat-Dağıtmayan Kipine geç." +msgstr "Süzgeç Aç/Kapat" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "DeÄŸiÅŸtirilen Yerel Süzgeç" +msgstr "Süzgeç DeÄŸiÅŸtir" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." -msgstr "" +msgstr "Animasyon oynatıcısı atanmadı, parça isimleri alınamıyor." #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Player path set is invalid, so unable to retrieve track names." @@ -4418,34 +4353,30 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Düğüm adı:" +msgstr "Düğüm Yeniden Adlandırıldı" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node..." -msgstr "Düğüm Ekle" +msgstr "Düğüm Ekle..." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/root_motion_editor_plugin.cpp -#, fuzzy msgid "Edit Filtered Tracks:" -msgstr "Süzgeçleri Düzenle" +msgstr "SüzgeçlenmiÅŸ Parçaları Düzenle:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Enable Filtering" -msgstr "Düzenlenebilir Çocuklar" +msgstr "Süzgeçlemeyi Aç" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Toggle Autoplay" -msgstr "KendindenOynatmayı Aç/Kapat" +msgstr "Otomatik Oynatmayı Aç/Kapat" #: editor/plugins/animation_player_editor_plugin.cpp msgid "New Animation Name:" -msgstr "Yeni Animasyon Adı:" +msgstr "Yeni Animasyon İsmi:" #: editor/plugins/animation_player_editor_plugin.cpp msgid "New Anim" @@ -4453,7 +4384,7 @@ msgstr "Yeni Animasyon" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Change Animation Name:" -msgstr "Animasyonun Adını DeÄŸiÅŸtir:" +msgstr "Animasyon İsmini DeÄŸiÅŸtir:" #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -4466,14 +4397,12 @@ msgid "Remove Animation" msgstr "Animasyonu Kaldır" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Invalid animation name!" -msgstr "HATA: Geçersiz animasyon adı!" +msgstr "Geçersiz animasyon ismi!" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Animation name already exists!" -msgstr "HATA: Bu animasyon adı zaten var!" +msgstr "Animasyon ismi zaten var!" #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -4640,7 +4569,6 @@ msgstr "Animasyon Adı:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Hata!" @@ -4678,19 +4606,19 @@ msgstr "Son(lar)" #: editor/plugins/animation_state_machine_editor.cpp msgid "Immediate" -msgstr "" +msgstr "Hemen" #: editor/plugins/animation_state_machine_editor.cpp msgid "Sync" -msgstr "" +msgstr "EÅŸitle" #: editor/plugins/animation_state_machine_editor.cpp msgid "At End" -msgstr "" +msgstr "Sonunda" #: editor/plugins/animation_state_machine_editor.cpp msgid "Travel" -msgstr "" +msgstr "Seyahat" #: editor/plugins/animation_state_machine_editor.cpp msgid "Start and end nodes are needed for a sub-transition." @@ -4713,7 +4641,7 @@ msgstr "GeçiÅŸ Düğümü" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "BaÅŸlangıç Düğümünü Ayarla (Otomatik Oynat)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4721,6 +4649,9 @@ msgid "" "RMB to add new nodes.\n" "Shift+LMB to create connections." msgstr "" +"Düğümleri seç ve taşı.\n" +"Yeni düğümler eklemek için RMB.\n" +"Yeni baÄŸlantılar için Shift+LMB." #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy @@ -4818,6 +4749,8 @@ msgid "Current:" msgstr "Geçerli:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "GiriÅŸ Ekle" @@ -4929,7 +4862,7 @@ msgstr "Tema dosyaya kaydedilemiyor:" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Write error." -msgstr "" +msgstr "Yazma hatası." #: editor/plugins/asset_library_editor_plugin.cpp msgid "Request failed, too many redirects" @@ -5025,13 +4958,17 @@ msgstr "Sonraki" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Last" -msgstr "" +msgstr "Son" #: editor/plugins/asset_library_editor_plugin.cpp msgid "All" msgstr "Hepsi" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Yeniden İçe Aktar..." @@ -5349,23 +5286,28 @@ msgstr "Çalışma Kipi:" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "Yapılmayı aç/kapat" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Yapışma Kullan" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snapping Options" -msgstr "Yapışma ayarları" +msgid "Toggle grid snapping." +msgstr "Yapılmayı aç/kapat" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "Izgaraya yapış" +msgid "Use Grid Snap" +msgstr "Izgara Yapışması" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "Yapışma ayarları" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5463,8 +5405,8 @@ msgid "View" msgstr "Görüş" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Izgarayı Göster" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5741,6 +5683,11 @@ msgstr "EÄŸri DoÄŸrusal Tanjantını Aç/Kapa" msgid "Hold Shift to edit tangents individually" msgstr "Tanjantları tek tek düzenlemek için Shift'e basılı tut" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "SaÄŸ tıkla: Nokta Sil" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "GI Prob PiÅŸir" @@ -5838,7 +5785,7 @@ msgstr "Anahat OluÅŸtur" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh" -msgstr "Örüntü" +msgstr "Örgü" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Static Body" @@ -6394,6 +6341,10 @@ msgid "Grid" msgstr "Izgara" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Izgarayı Göster" + +#: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy msgid "Configure Grid:" msgstr "Yapışmayı Yapılandır" @@ -6456,6 +6407,7 @@ msgstr "Örnek:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Tür:" @@ -6566,6 +6518,11 @@ msgid "Find Next" msgstr "Sonraki Bul" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Öncekini Bul" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Özellikleri süz" @@ -6641,12 +6598,11 @@ msgstr "Sonraki GeçmiÅŸ" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp msgid "Theme" -msgstr "Kalıp" +msgstr "Tema" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Import Theme..." -msgstr "Kalıbı İçe Aktar" +msgstr "Tema İçe Aktar..." #: editor/plugins/script_editor_plugin.cpp msgid "Reload Theme" @@ -6776,7 +6732,7 @@ msgstr "Sinyaller" #: editor/plugins/script_text_editor.cpp msgid "Target" -msgstr "Amaç" +msgstr "Hedef" #: editor/plugins/script_text_editor.cpp #, fuzzy @@ -6851,6 +6807,11 @@ msgstr "Noktalar oluÅŸtur." msgid "Cut" msgstr "Kes" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Hepsini seç" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Satırı Sil" @@ -6911,10 +6872,6 @@ msgid "Auto Indent" msgstr "Kendinden Girintili" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Öncekini Bul" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Dosyaları Süz..." @@ -7017,9 +6974,8 @@ msgid "Create physical bones" msgstr "Yönlendirici Örüntüsü OluÅŸtur" #: editor/plugins/skeleton_editor_plugin.cpp -#, fuzzy msgid "Skeleton" -msgstr "İskelet..." +msgstr "İskelet" #: editor/plugins/skeleton_editor_plugin.cpp #, fuzzy @@ -7257,6 +7213,11 @@ msgid "Freelook Speed Modifier" msgstr "Serbestbakış Hız DeÄŸiÅŸtirici" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Serbestbakış Hız DeÄŸiÅŸtirici" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7296,6 +7257,10 @@ msgid "Use Local Space" msgstr "Yerel Uzay Kipi (%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Yapışma Kullan" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "Alttan Görünüm" @@ -7537,6 +7502,11 @@ msgstr "" #: editor/plugins/sprite_editor_plugin.cpp #, fuzzy +msgid "Shrink (Pixels): " +msgstr "Yapış (Noktalara):" + +#: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy msgid "Grow (Pixels): " msgstr "Yapış (Noktalara):" @@ -8391,12 +8361,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "GiriÅŸ Ekle" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "GiriÅŸ Ekle" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8405,9 +8370,8 @@ msgid "Scalar" msgstr "Ölçekle:" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector" -msgstr "Denetçi" +msgstr "Vektör" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" @@ -8415,6 +8379,11 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "Sampler" +msgstr "Örnekler" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Add input port" msgstr "GiriÅŸ Ekle" @@ -9315,15 +9284,19 @@ msgid "Resources to export:" msgstr "Dışa aktarılacak kaynaklar:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Kaynak olmayan dosyaları dışa aktarmak için kullanılan süzgeçler (virgülle " "ayrılmış, ör. * .json, * .txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Dışa aktarma iÅŸleminden hariç tutulacak süzgeçler (virgülle ayrılmış, ör. * ." "json, * .txt)" @@ -10370,12 +10343,10 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Düzenlenebilir Çocuklar" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Yer Tutucu Olarak Yükle" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10456,6 +10427,14 @@ msgid "Clear Inheritance" msgstr "Kalıtı Temizle" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Düzenlenebilir Çocuklar" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Yer Tutucu Olarak Yükle" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "Çevrimiçi Godot dökümanlarını aç" @@ -10475,11 +10454,6 @@ msgstr "Türü DeÄŸiÅŸtir" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Betik Aç" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Düğümün EbeveynliÄŸini DeÄŸiÅŸtir" @@ -10748,23 +10722,18 @@ msgid "Will load an existing script file." msgstr "Mevcut betik dosyasını yükle" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Dil" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "Miras Alınmışlar" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Sınıf İsmi" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Åžablon" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Gömme Betik" #: editor/script_create_dialog.cpp @@ -11435,6 +11404,11 @@ msgid "Add Function" msgstr "Fonksiyon Ekle" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Noktayı kaldır" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "DeÄŸiÅŸken Ekle" @@ -11443,6 +11417,26 @@ msgid "Add Signal" msgstr "Sinyal Ekle" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "GiriÅŸ Ekle" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "GiriÅŸ Ekle" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Noktayı kaldır" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Noktayı kaldır" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "İfadeyi DeÄŸiÅŸtir" @@ -11487,10 +11481,20 @@ msgid "Add Preload Node" msgstr "Önyüklenen Düğüm Ekle" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "AÄŸaçtan Düğüm(ler) Ekle" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Alıcı Özellik Ekle" @@ -11516,6 +11520,11 @@ msgstr "Düğümleri BaÄŸla" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Çizge Düğümlerinin BaÄŸlantılarını Kes" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Düğümleri BaÄŸla" @@ -11550,6 +11559,28 @@ msgid "Paste VisualScript Nodes" msgstr "GörselBetik Düğümleri Yapıştır" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Fonksiyon düğümü kopyalanamıyor." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "İşlevi Yeniden Adlandır" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "İşlevi Kaldır" @@ -11575,16 +11606,13 @@ msgid "Make Tool:" msgstr "YerelleÅŸtir" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Taban Türü:" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Üyeler:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Kullanılabilir Düğümler:" +#, fuzzy +msgid "function_name" +msgstr "Fonksiyon:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -11609,6 +11637,16 @@ msgstr "Düğümleri Kes" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "İşlevi Yeniden Adlandır" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Yenile" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "Üyeler" @@ -11706,6 +11744,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Listeden aygıt seç" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11809,6 +11851,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Tarayıcıda Çalıştır" @@ -12465,11 +12511,6 @@ msgstr "" "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/resources/visual_shader.cpp -#, fuzzy -msgid "Input" -msgstr "GiriÅŸ Ekle" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Önizleme için geçersiz kaynak." @@ -12501,6 +12542,29 @@ msgstr "DeÄŸiÅŸkenler yalnızca tepe iÅŸlevinde atanabilir." msgid "Constants cannot be modified." msgstr "Sabit deÄŸerler deÄŸiÅŸtirilemez." +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "Izgaraya yapış" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "GiriÅŸ Ekle" + +#~ msgid "Language" +#~ msgstr "Dil" + +#~ msgid "Inherits" +#~ msgstr "Miras Alınmışlar" + +#~ msgid "Base Type:" +#~ msgstr "Taban Türü:" + +#~ msgid "Available Nodes:" +#~ msgstr "Kullanılabilir Düğümler:" + +#~ msgid "Input" +#~ msgstr "GiriÅŸ" + #~ msgid "Properties:" #~ msgstr "Özellikler:" @@ -12721,9 +12785,6 @@ msgstr "Sabit deÄŸerler deÄŸiÅŸtirilemez." #~ msgid "Go to parent folder" #~ msgstr "Üst klasöre git" -#~ msgid "Select device from the list" -#~ msgstr "Listeden aygıt seç" - #~ msgid "Open Scene(s)" #~ msgstr "Sahne(ler) Aç" @@ -12971,9 +13032,6 @@ msgstr "Sabit deÄŸerler deÄŸiÅŸtirilemez." #~ msgid "Warning" #~ msgstr "Uyarı" -#~ msgid "Function:" -#~ msgstr "Fonksiyon:" - #~ msgid "Variable" #~ msgstr "DeÄŸiÅŸken" @@ -13037,9 +13095,6 @@ msgstr "Sabit deÄŸerler deÄŸiÅŸtirilemez." #~ msgid "Connect Graph Nodes" #~ msgstr "Çizge Düğümlerini BaÄŸla" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Çizge Düğümlerinin BaÄŸlantılarını Kes" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Gölgelendirici Çizge Düğümünü Kaldır" @@ -14155,9 +14210,6 @@ msgstr "Sabit deÄŸerler deÄŸiÅŸtirilemez." #~ msgid "Group" #~ msgstr "Öbek" -#~ msgid "Samples" -#~ msgstr "Örnekler" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "Örnek Dönüşüm Biçimi: (.wav dizeçleri):" diff --git a/editor/translations/uk.po b/editor/translations/uk.po index bee2015a88..8b99271a09 100644 --- a/editor/translations/uk.po +++ b/editor/translations/uk.po @@ -11,12 +11,13 @@ # ОлекÑандр Пилипчук <pilipchukap@rambler.ru>, 2018. # Kirill Omelchenko <kirill.omelchenko@gmail.com>, 2018. # ÐлекÑандр <ol-vin@mail.ru>, 2018. +# Богдан Матвіїв <bomtvv@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Ukrainian (Godot Engine)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:51+0000\n" -"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" +"PO-Revision-Date: 2019-10-11 15:07+0000\n" +"Last-Translator: Богдан Матвіїв <bomtvv@gmail.com>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/" "godot/uk/>\n" "Language: uk\n" @@ -31,7 +32,8 @@ msgstr "" #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "" -"Ðекоректний аргумент типу у convert(), Ñлід викориÑтовувати Ñталі TYPE_*." +"Ðекоректний тип аргументу Ð´Ð»Ñ convert(), Ñлід викориÑтовувати конÑтанту " +"TYPE_*." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -70,32 +72,31 @@ msgstr "При виклику «%s»:" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "Б" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "КіБ" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "ПоєднаннÑ" +msgstr "МіБ" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "ГіБ" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "ТіБ" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "ПіБ" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "ЕіБ" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -361,6 +362,7 @@ msgstr "Створити %d нові доріжки Ñ– вÑтавити ключ #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Створити" @@ -504,19 +506,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "ПопередженнÑ: Редагуємо імпортовану анімацію" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Виділити вÑе" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "СкаÑувати позначеннÑ" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "ШлÑÑ… до вузла AnimationPlayer, де міÑÑ‚ÑтьÑÑ Ð°Ð½Ñ–Ð¼Ð°Ñ†Ñ–Ñ—, не вÑтановлено." +msgstr "Виберіть вузол AnimationPlayer Ð´Ð»Ñ ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ– Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð°Ð½Ñ–Ð¼Ð°Ñ†Ñ–Ð¹." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -649,7 +641,8 @@ msgid "Scale Ratio:" msgstr "Ð¡Ð¿Ñ–Ð²Ð²Ñ–Ð´Ð½Ð¾ÑˆÐµÐ½Ð½Ñ Ð¼Ð°Ñштабу:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Виберіть доріжки Ð´Ð»Ñ ÐºÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -661,6 +654,11 @@ msgstr "Виберіть доріжки Ð´Ð»Ñ ÐºÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ:" msgid "Copy" msgstr "Копіювати" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "СкаÑувати позначеннÑ" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Додати кліп звукової доріжки" @@ -985,7 +983,7 @@ msgid "Resource" msgstr "РеÑурÑ" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "ШлÑÑ…" @@ -1256,9 +1254,8 @@ msgid "Delete Bus Effect" msgstr "Вилучити ефект шини" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Ðудіо шина, перетÑгнути, щоб змінити." +msgstr "ПорÑдок можна змінити перетÑгуваннÑм зі ÑкиданнÑм." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1449,7 +1446,8 @@ msgstr "Додати автозавантаженнÑ" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "ШлÑÑ…:" @@ -1460,7 +1458,7 @@ msgstr "Ім'Ñ Ð’ÑƒÐ·Ð»Ð°:" #: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp #: editor/editor_profiler.cpp editor/settings_config_dialog.cpp msgid "Name" -msgstr "Ім'Ñ" +msgstr "Ðазва" #: editor/editor_autoload_settings.cpp msgid "Singleton" @@ -1503,7 +1501,7 @@ msgstr "Створити Теку" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Ім'Ñ:" @@ -1900,6 +1898,7 @@ msgid "Class:" msgstr "КлаÑ:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "УÑпадковує:" @@ -1908,9 +1907,8 @@ msgid "Inherited by:" msgstr "УÑпадковано:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "СтиÑлий опиÑ:" +msgstr "СтиÑлий опиÑ" #: editor/editor_help.cpp msgid "Properties" @@ -1941,9 +1939,8 @@ msgid "Class Description" msgstr "ÐžÐ¿Ð¸Ñ ÐºÐ»Ð°Ñу" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "Підручники в інтернеті:" +msgstr "Підручники в інтернеті" #: editor/editor_help.cpp msgid "" @@ -2066,16 +2063,15 @@ msgstr "Початок" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/Ñ" #: editor/editor_network_profiler.cpp -#, fuzzy msgid "Down" -msgstr "Завантажити" +msgstr "ОтриманнÑ" #: editor/editor_network_profiler.cpp msgid "Up" -msgstr "" +msgstr "ВивантаженнÑ" #: editor/editor_network_profiler.cpp editor/editor_node.cpp msgid "Node" @@ -2083,19 +2079,19 @@ msgstr "Вузол" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "Вхідний RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "Вхідний RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "Вихідний RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "Вихідний RSET" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2685,17 +2681,16 @@ msgid "Project Settings..." msgstr "Параметри проєкту…" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "ВерÑÑ–Ñ:" +msgstr "ÐšÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð²ÐµÑ€ÑÑ–Ñми" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð²ÐµÑ€ÑÑ–Ñми" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "Ð’Ð¸Ð¼Ð¸ÐºÐ°Ð½Ð½Ñ ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð²ÐµÑ€ÑÑ–Ñми" #: editor/editor_node.cpp msgid "Export..." @@ -2968,7 +2963,7 @@ msgstr "ІнÑпектор" msgid "Expand Bottom Panel" msgstr "Розгорнути нижню панель" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Результат" @@ -2996,9 +2991,15 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"Це налаштує ваш проєкт на викориÑÑ‚Ð°Ð½Ð½Ñ Ð½ÐµÑ‚Ð¸Ð¿Ð¾Ð²Ð¸Ñ… збірок Android шлÑхом " +"вÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ ÑˆÐ°Ð±Ð»Ð¾Ð½Ð° джерела до «res://android/build».\n" +"Далі, ви можете внеÑти зміни Ñ– зібрати влаÑний нетиповий APK при " +"екÑпортуванні (додаючи модулі, змінюючи AndroidManifest.xml тощо).\n" +"Зауважте, що з метою ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð½ÐµÑ‚Ð¸Ð¿Ð¾Ð²Ð¸Ñ… збірок, заміÑть викориÑÑ‚Ð°Ð½Ð½Ñ " +"попередньо зібраних APK, Ñлід позначити пункт «СкориÑтатиÑÑ Ð½ÐµÑ‚Ð¸Ð¿Ð¾Ð²Ð¾ÑŽ " +"збіркою» у шаблоні екÑÐ¿Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Android." #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" @@ -3006,7 +3007,8 @@ msgid "" "operation again." msgstr "" "Шаблон Ð·Ð±Ð¸Ñ€Ð°Ð½Ð½Ñ Ð´Ð»Ñ Android вже вÑтановлено. Його не буде перезапиÑано.\n" -"Вилучіть каталог «build» вручну, перш ніж намагатиÑÑ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð¸Ñ‚Ð¸ цю дію." +"Вилучіть каталог «res://android/build» вручну, перш ніж намагатиÑÑ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð¸Ñ‚Ð¸ " +"цю дію." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3069,9 +3071,8 @@ msgid "Open the previous Editor" msgstr "Відкрити попередній редактор" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "Ðе задано джерело поверхні." +msgstr "Підлеглих реÑурÑів не знайдено." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3082,9 +3083,8 @@ msgid "Thumbnail..." msgstr "Мініатюра..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "Відкрити Ñкрипт:" +msgstr "ОÑновний Ñкрипт:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3220,6 +3220,10 @@ msgstr "Виберіть панель переглÑду" msgid "New Script" msgstr "Ðовий Ñкрипт" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "Розширити Ñкрипт" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Ðовий %s" @@ -3246,13 +3250,6 @@ msgstr "Ð’Ñтавити" msgid "Convert To %s" msgstr "Перетворити на %s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "Відкрити вікно редактора" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "Позначений вузол не Ñ” панеллю переглÑду!" @@ -3912,9 +3909,8 @@ msgid "Import As:" msgstr "Імпортувати Ñк:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "Ðабори" +msgstr "Ðабір" #: editor/import_dock.cpp msgid "Reimport" @@ -4040,7 +4036,7 @@ msgstr "Ðазва додатка:" msgid "Subfolder:" msgstr "Підтека:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Мова:" @@ -4185,6 +4181,12 @@ msgstr "Точка" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "Відкрити вікно редактора" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Відкрити вузол анімації" @@ -4534,7 +4536,6 @@ msgstr "Ðазва анімації:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Помилка!" @@ -4707,6 +4708,8 @@ msgid "Current:" msgstr "Поточний:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Додати вхід" @@ -4911,6 +4914,10 @@ msgid "All" msgstr "Ð’Ñе" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "Імпортувати…" @@ -5202,26 +5209,32 @@ msgid "Pan Mode" msgstr "Режим панорамуваннÑ" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "Режим виконаннÑ:" +msgstr "Режим вимірюваннÑ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "Увімкнути або вимкнути прив'ÑзуваннÑ." #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "За допомогою функції прив'Ñзки" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "Параметри прив'Ñзки" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "Увімкнути або вимкнути прив'ÑзуваннÑ." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "ÐŸÑ€Ð¸Ð»Ð¸Ð¿Ð°Ð½Ð½Ñ Ð´Ð¾ Ñітки" +#, fuzzy +msgid "Use Grid Snap" +msgstr "ÐŸÑ€Ð¸Ð»Ð¸Ð¿Ð°Ð½Ð½Ñ Ð´Ð¾ ґратки" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "Параметри прив'Ñзки" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5310,8 +5323,8 @@ msgid "View" msgstr "ПереглÑд" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Показати Ñітку" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5579,6 +5592,11 @@ msgstr "Перемкнути дотичну до кривої" msgid "Hold Shift to edit tangents individually" msgstr "Утримуйте Shift, щоб змінити дотичні окремо" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Клацніть правою кнопкою миші: видалити точку" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "Запекти пробу GI" @@ -6140,7 +6158,7 @@ msgstr "ПереміÑтити точки" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Ctrl: Rotate" -msgstr "Ctrl: повернути" +msgstr "Ctrl: Повернути" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Shift: Move All" @@ -6216,6 +6234,10 @@ msgid "Grid" msgstr "Сітка" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Показати Ñітку" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "ÐÐ°Ð»Ð°ÑˆÑ‚Ð¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ Ñітки:" @@ -6272,6 +6294,7 @@ msgstr "ЕкземплÑÑ€:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "Тип:" @@ -6370,6 +6393,11 @@ msgid "Find Next" msgstr "Знайти наÑтупне" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "Знайти попереднє" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "Фільтрувати Ñкрипти" @@ -6639,6 +6667,11 @@ msgstr "Точки зупину" msgid "Cut" msgstr "Вирізати" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Виділити вÑе" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "Видалити Ñ€Ñдок" @@ -6696,10 +6729,6 @@ msgid "Auto Indent" msgstr "ÐвтовідÑтуп" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "Знайти попереднє" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "Знайти у файлах…" @@ -7021,6 +7050,11 @@ msgid "Freelook Speed Modifier" msgstr "Коефіцієнт швидкоÑті оглÑду" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "Коефіцієнт швидкоÑті оглÑду" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7060,6 +7094,10 @@ msgid "Use Local Space" msgstr "ВикориÑтати локальний проÑтір" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "За допомогою функції прив'Ñзки" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "ВиглÑд знизу" @@ -7288,6 +7326,11 @@ msgid "Simplification: " msgstr "СпрощеннÑ: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "ЗроÑÑ‚Ð°Ð½Ð½Ñ (пікÑелі): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "ЗроÑÑ‚Ð°Ð½Ð½Ñ (пікÑелі): " @@ -7336,9 +7379,8 @@ msgid "(empty)" msgstr "(порожньо)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "Ð’Ñтавити кадр" +msgstr "ПереÑунути кадр" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7447,7 +7489,7 @@ msgstr "Крок:" #: editor/plugins/texture_region_editor_plugin.cpp msgid "Sep.:" -msgstr "Інт.:" +msgstr "Роздільник:" #: editor/plugins/texture_region_editor_plugin.cpp msgid "TextureRegion" @@ -7655,13 +7697,12 @@ msgid "Enable Priority" msgstr "Увімкнути пріоритетніÑть" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "Фільтрувати файли..." +msgstr "Фільтрувати плитки" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "Додати реÑÑƒÑ€Ñ TileSet до цієї TileMap Ð´Ð»Ñ Ð²Ð¸ÐºÐ¾Ñ€Ð¸ÑÑ‚Ð°Ð½Ð½Ñ Ð¹Ð¾Ð³Ð¾ плиток." #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7801,6 +7842,8 @@ msgstr "Показати назви плиток (Ñкщо затиÑнути к msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." msgstr "" +"Додайте або виберіть текÑтуру на лівій панелі Ð´Ð»Ñ Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð»Ð¸Ñ‚Ð¾Ðº, " +"пов'Ñзаних із нею." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -7976,92 +8019,80 @@ msgid "TileSet" msgstr "Ðабір плиток" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "Ðазва батьківÑького запиÑу вузла, Ñкщо такий Ñ”" +msgstr "Ðемає доÑтупних доданків ÑиÑтем ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð²ÐµÑ€ÑÑ–Ñми." #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "Помилка" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "Ім'Ñ Ð½Ðµ вказано" +msgstr "Ðе було вказано Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ внеÑку" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "Ðе додано жодних файлів Ð´Ð»Ñ Ð²Ð½ÐµÑку" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "Спільнота" +msgstr "ВнеÑок" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "Додаток ÑиÑтеми ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð²ÐµÑ€ÑÑ–Ñми не ініціалізовано" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "СиÑтема ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð²ÐµÑ€ÑÑ–Ñми" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "З Великої" +msgstr "Ініціалізувати" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "ОблаÑть внеÑку" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "Створити прÑмокутник." +msgstr "ВиÑвити зміни" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "Змінити" +msgstr "Зміни" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "Змінено" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "Перейменувати" +msgstr "Перейменовано" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "Вилучити" +msgstr "Вилучено" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "Змінити" +msgstr "Зміна типу" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "Вилучити вибране" +msgstr "Вибрано Ð´Ð»Ñ Ð²Ð½ÐµÑку" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "Зберегти вÑе" +msgstr "ВнеÑти вÑе" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "Додати Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ внеÑку" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "Синхронізувати зміни в Ñкрипті" +msgstr "ВнеÑти зміни" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -8071,25 +8102,23 @@ msgstr "СтатуÑ" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" msgstr "" +"ПереглÑнути відмінноÑті у файлах, перш ніж внеÑти Ñ—Ñ… до найÑвіжішої верÑÑ–Ñ—" #: editor/plugins/version_control_editor_plugin.cpp msgid "No file diff is active" -msgstr "" +msgstr "Ðемає активних відмінноÑтей між файлами" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "ВиÑвити зміни у відмінноÑÑ‚ÑÑ… між файлами" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "(лише GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "Додати вхід +" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "Додати вихід +" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8105,6 +8134,10 @@ msgid "Boolean" msgstr "Булеве" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "Додати вхідний порт" @@ -8316,7 +8349,6 @@ msgstr "" "Повертає пов'Ñзаний вектор за заданим булевим значеннÑм «true» або «false»." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "" @@ -9038,15 +9070,19 @@ msgid "Resources to export:" msgstr "ЕкÑпортовані реÑурÑи:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Фільтри екÑÐ¿Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð², Ñкі не міÑÑ‚Ñть реÑурÑів (з відокремленнÑм " "комами, приклад: *.json, *.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" "Фільтри Ð²Ð¸ÐºÐ»ÑŽÑ‡ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð² з проєкту (з відокремленнÑм комами, приклад: *." "json, *.txt)" @@ -9643,9 +9679,8 @@ msgid "Settings saved OK." msgstr "Параметри уÑпішно збережено." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "Додати подію за вхідною дією" +msgstr "ПереÑунуто подію дії із Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ…" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -10014,9 +10049,8 @@ msgid "Instance Scene(s)" msgstr "Сцени екземплÑра" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "Зберегти гілку Ñк Ñцену" +msgstr "Замінити гілкою Ñцени" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10061,23 +10095,20 @@ msgid "Make node as Root" msgstr "Зробити вузол кореневим" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "Вилучити вузли" +msgstr "Вилучити %d вузлів?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "Вилучити взули графу шейдера" +msgstr "Вилучити кореневий вузол «%s»?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "Вилучити вузол «%s» Ñ– його дочірні запиÑи?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "Вилучити вузли" +msgstr "Вилучити вузол «%s»?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -10100,12 +10131,13 @@ msgstr "" "уÑÑ–Ñ… влаÑтивоÑтей вузла." #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "Редагований дочірній елемент" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "Завантажити Ñк заповнювач" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "" +"Ð’Ð¸Ð¼Ð¸ÐºÐ°Ð½Ð½Ñ Â«editable_instance» призведе до Ð¿Ð¾Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ Ñ‚Ð¸Ð¿Ð¾Ð²Ð¸Ñ… значень Ð´Ð»Ñ " +"уÑÑ–Ñ… влаÑтивоÑтей вузла." #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10180,6 +10212,14 @@ msgid "Clear Inheritance" msgstr "УÑунути уÑпадкуваннÑ" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "Редагований дочірній елемент" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "Завантажити Ñк заповнювач" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "Відкрити документацію" @@ -10196,10 +10236,6 @@ msgid "Change Type" msgstr "Змінити тип" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "Розширити Ñкрипт" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "Змінити батьківÑький вузол на новий" @@ -10440,23 +10476,18 @@ msgid "Will load an existing script file." msgstr "Завантажити наÑвний файл Ñкрипту." #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "Мова" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "УÑпадковує" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "Ðазва клаÑу" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "Шаблон" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "Вбудований Ñкрипт" #: editor/script_create_dialog.cpp @@ -10472,7 +10503,6 @@ msgid "Bytes:" msgstr "Байтів:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" msgstr "ПопередженнÑ:" @@ -10481,29 +10511,24 @@ msgid "Error:" msgstr "Помилка:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "Помилка копіюваннÑ" +msgstr "Помилка C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "Помилка:" +msgstr "Помилка C++:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "Джерело" +msgstr "Код C++" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "Джерело" +msgstr "Код:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "Джерело" +msgstr "Код C++:" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10514,18 +10539,16 @@ msgid "Errors" msgstr "Помилки" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "З'єднано дочірній процеÑ" +msgstr "З'єднано дочірній процеÑ." #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "Помилка копіюваннÑ" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "Точки зупину" +msgstr "ПропуÑтити точки зупину" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10544,9 +10567,8 @@ msgid "Profiler" msgstr "ЗаÑіб профілюваннÑ" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "ЕкÑпорт профілю" +msgstr "ЗаÑіб Ð¿Ñ€Ð¾Ñ„Ñ–Ð»ÑŽÐ²Ð°Ð½Ð½Ñ Ð¼ÐµÑ€ÐµÐ¶Ñ–" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10770,7 +10792,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Мало бути вказано Ñ€Ñдок довжини 1 (Ñимвол)." #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10927,13 +10949,13 @@ msgid "Pick Distance:" msgstr "ВідÑтань вибору:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "Фільтрувати методи" +msgstr "Фільтрувати Ñітки" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." msgstr "" +"Додайте реÑÑƒÑ€Ñ MeshLibrary до цього GridMap, щоб ÑкориÑтатиÑÑ Ð¹Ð¾Ð³Ð¾ Ñітками." #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -11108,6 +11130,11 @@ msgid "Add Function" msgstr "Додати функцію" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Вилучити вхідний порт" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Додати змінну" @@ -11116,6 +11143,26 @@ msgid "Add Signal" msgstr "Додати Ñигнал" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Додати вхідний порт" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Додати вихідний порт" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Вилучити вхідний порт" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Вилучити вихідний порт" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "Змінити вираз" @@ -11160,10 +11207,20 @@ msgid "Add Preload Node" msgstr "Додати попередньо завантажений вузол" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "Додати вузли з дерева" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "Додати влаÑтивіÑть отримувача" @@ -11188,6 +11245,11 @@ msgid "Connect Nodes" msgstr "Приєднати вузли" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "Роз'єднати вузли графу" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "Приєднати дані вузла" @@ -11220,6 +11282,28 @@ msgid "Paste VisualScript Nodes" msgstr "Ð’Ñтавити вузли (Візуального Ñкриптингу) VisualScript" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "Ðеможливо Ñкопіювати вузол функції." + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Перейменувати функцію" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Вилучити функцію" @@ -11240,21 +11324,17 @@ msgid "Editing Signal:" msgstr "Ð ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ñигналу:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "Зробити локальним" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "Базовий тип:" +msgstr "ІнÑтрумент збираннÑ:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Члени:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "ДоÑтупні вузли:" +#, fuzzy +msgid "function_name" +msgstr "ФункціÑ:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11277,6 +11357,16 @@ msgid "Cut Nodes" msgstr "Вирізати вузли" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Перейменувати функцію" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Оновити" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "Редагувати член" @@ -11375,6 +11465,10 @@ msgid "The package must have at least one '.' separator." msgstr "У назві пакунка має бути принаймні один роздільник «.»." #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "Вибрати приÑтрій зі ÑпиÑку" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "У параметрах редактора не налаштовано виконуваного файла ADB." @@ -11401,13 +11495,12 @@ msgstr "" "редактора." #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." msgstr "" -"Ð”Ð»Ñ Ð·Ð±Ð¸Ñ€Ð°Ð½Ð½Ñ Ð½Ðµ вÑтановлено проєкт Android. Ð’Ñтановіть його за допомогою " -"меню редактора." +"У проєкті не вÑтановлено шаблон Ð·Ð±Ð¸Ñ€Ð°Ð½Ð½Ñ Android. Ð’Ñтановіть його за " +"допомогою меню «Проєкт»." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11499,6 +11592,10 @@ msgid "Required icon is not specified in the preset." msgstr "У шаблоні не вказано потрібної піктограми." #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "ЗапуÑтити в браузері" @@ -12171,10 +12268,6 @@ msgstr "" "Control, щоб у неї був розмір. Крім того, можна зробити Ñ—Ñ— RenderTarget Ñ– " "пов'Ñзати Ñ—Ñ— внутрішню текÑтуру з одним із вузлів Ð´Ð»Ñ Ð¿Ð¾ÐºÐ°Ð·Ñƒ." -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Вхідні дані" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Ðекоректне джерело Ð´Ð»Ñ Ð¿Ð¾Ð¿ÐµÑ€ÐµÐ´Ð½ÑŒÐ¾Ð³Ð¾ переглÑду." @@ -12203,6 +12296,27 @@ msgstr "Змінні величини можна пов'Ñзувати лише msgid "Constants cannot be modified." msgstr "Сталі не можна змінювати." +#~ msgid "Snap to Grid" +#~ msgstr "ÐŸÑ€Ð¸Ð»Ð¸Ð¿Ð°Ð½Ð½Ñ Ð´Ð¾ Ñітки" + +#~ msgid "Add input +" +#~ msgstr "Додати вхід +" + +#~ msgid "Language" +#~ msgstr "Мова" + +#~ msgid "Inherits" +#~ msgstr "УÑпадковує" + +#~ msgid "Base Type:" +#~ msgstr "Базовий тип:" + +#~ msgid "Available Nodes:" +#~ msgstr "ДоÑтупні вузли:" + +#~ msgid "Input" +#~ msgstr "Вхідні дані" + #~ msgid "Properties:" #~ msgstr "ВлаÑтивоÑті:" @@ -12598,9 +12712,6 @@ msgstr "Сталі не можна змінювати." #~ msgid "Go to parent folder" #~ msgstr "Перейти до батьківÑької теки" -#~ msgid "Select device from the list" -#~ msgstr "Вибрати приÑтрій зі ÑпиÑку" - #~ msgid "Open Scene(s)" #~ msgstr "Відкрити Ñцену(и)" @@ -12832,9 +12943,6 @@ msgstr "Сталі не можна змінювати." #~ msgid "Warning" #~ msgstr "ПопередженнÑ" -#~ msgid "Function:" -#~ msgstr "ФункціÑ:" - #~ msgid "Variable" #~ msgstr "Змінна" @@ -12901,9 +13009,6 @@ msgstr "Сталі не можна змінювати." #~ msgid "Connect Graph Nodes" #~ msgstr "З'єднати вузли графу" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "Роз'єднати вузли графу" - #~ msgid "Remove Shader Graph Node" #~ msgstr "Вилучити вузол графу шейдера" diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po index 5102a4b463..c68843bd77 100644 --- a/editor/translations/ur_PK.po +++ b/editor/translations/ur_PK.po @@ -357,6 +357,7 @@ msgstr "" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "" @@ -482,16 +483,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr ".تمام کا انتخاب" - #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" @@ -627,7 +618,7 @@ msgid "Scale Ratio:" msgstr "" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +msgid "Select Tracks to Copy" msgstr "" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -639,6 +630,11 @@ msgstr "" msgid "Copy" msgstr "" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr ".تمام کا انتخاب" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "" @@ -963,7 +959,7 @@ msgid "Resource" msgstr "" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "" @@ -1423,7 +1419,8 @@ msgstr "" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "" @@ -1477,7 +1474,7 @@ msgstr "" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "" @@ -1876,6 +1873,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -2879,7 +2877,7 @@ msgstr "" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3120,6 +3118,11 @@ msgstr "" msgid "New Script" msgstr "سب سکریپشن بنائیں" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "سب سکریپشن بنائیں" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3146,14 +3149,6 @@ msgstr "" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "سب سکریپشن بنائیں" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3941,7 +3936,7 @@ msgstr "" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "" @@ -4084,6 +4079,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "سب سکریپشن بنائیں" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "" @@ -4432,7 +4434,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "" @@ -4604,6 +4605,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -4808,6 +4811,10 @@ msgid "All" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr ".سپورٹ" @@ -5106,20 +5113,23 @@ msgid "Ruler Mode" msgstr "ایکشن منتقل کریں" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" +msgstr "" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5210,8 +5220,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5476,6 +5485,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6119,6 +6132,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6175,6 +6192,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6275,6 +6293,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "سب سکریپشن بنائیں" @@ -6548,6 +6571,11 @@ msgstr ".تمام کا انتخاب" msgid "Cut" msgstr "" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6606,10 +6634,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "" @@ -6935,6 +6959,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6968,6 +6996,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7201,6 +7233,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8003,12 +8039,9 @@ msgid "(GLES3 only)" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" +#, fuzzy +msgid "Add Output" +msgstr "سب سکریپشن بنائیں" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" @@ -8023,6 +8056,11 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "نمونے" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "" @@ -8890,12 +8928,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9891,11 +9931,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -9972,6 +10010,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -9989,11 +10035,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "سب سکریپشن بنائیں" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "سب سکریپشن بنائیں" @@ -10228,25 +10269,18 @@ msgid "Will load an existing script file." msgstr "سب سکریپشن بنائیں" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +msgid "Class Name:" msgstr "" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" +msgid "Template:" msgstr ".تمام کا انتخاب" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "سب سکریپشن بنائیں" #: editor/script_create_dialog.cpp #, fuzzy @@ -10898,6 +10932,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr ".تمام کا انتخاب" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -10906,6 +10945,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr ".تمام کا انتخاب" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr ".تمام کا انتخاب" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr ".تمام کا انتخاب" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr ".تمام کا انتخاب" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -10946,10 +11005,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -10975,6 +11044,11 @@ msgid "Connect Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "سب سکریپشن بنائیں" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "" @@ -11007,6 +11081,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr ".تمام کا انتخاب" + +#: modules/visual_script/visual_script_editor.cpp #, fuzzy msgid "Remove Function" msgstr ".تمام کا انتخاب" @@ -11033,15 +11128,11 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" +msgid "function_name" msgstr "" #: modules/visual_script/visual_script_editor.cpp @@ -11065,6 +11156,15 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr ".تمام کا انتخاب" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Refresh Graph" +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -11160,6 +11260,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11259,6 +11363,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -11797,10 +11905,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" @@ -11864,6 +11968,3 @@ msgstr "" #, fuzzy #~ msgid "Can't write file." #~ msgstr "سب سکریپشن بنائیں" - -#~ msgid "Samples" -#~ msgstr "نمونے" diff --git a/editor/translations/vi.po b/editor/translations/vi.po index 060209311d..f3570ad0ff 100644 --- a/editor/translations/vi.po +++ b/editor/translations/vi.po @@ -11,12 +11,13 @@ # TyTYct Hihi <tytyct@gmail.com>, 2019. # Steve Dang <itsnguu@outlook.com>, 2019. # Peter Anh <peteranh3105@gmail.com>, 2019. +# DÅ©ng Äinh <dqdthanhthanh@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-07 13:51+0000\n" -"Last-Translator: Peter Anh <peteranh3105@gmail.com>\n" +"PO-Revision-Date: 2019-10-04 03:15+0000\n" +"Last-Translator: DÅ©ng Äinh <dqdthanhthanh@gmail.com>\n" "Language-Team: Vietnamese <https://hosted.weblate.org/projects/godot-engine/" "godot/vi/>\n" "Language: vi\n" @@ -367,6 +368,7 @@ msgstr "Tạo %d track má»›i và chèn key?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "Tạo" @@ -497,15 +499,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "Cảnh bảo: Chỉnh sá»a hoạt ảnh đã nháºp" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "Chá»n Toà n Bá»™" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "Chá»n Không có" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -641,7 +634,8 @@ msgid "Scale Ratio:" msgstr "Tỉ lệ Scale:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "Chá»n các Track để sao chép:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -653,6 +647,11 @@ msgstr "Chá»n các Track để sao chép:" msgid "Copy" msgstr "Sao chép" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "Chá»n Không có" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "Thêm Track Âm thanh" @@ -885,7 +884,7 @@ msgstr "Bạn muốn xoá tất cả kết nối từ tÃn hiệu \"%s\"?" #: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp msgid "Signals" -msgstr "TÃn hiệu" +msgstr "TÃn hiệu (Signal)" #: editor/connections_dialog.cpp msgid "Are you sure you want to remove all connections from this signal?" @@ -979,7 +978,7 @@ msgid "Resource" msgstr "Tà i nguyên" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "ÄÆ°á»ng dẫn" @@ -1443,7 +1442,8 @@ msgstr "Thêm AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "ÄÆ°á»ng dẫn:" @@ -1497,7 +1497,7 @@ msgstr "Tạo thư mục" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "Tên:" @@ -1889,6 +1889,7 @@ msgid "Class:" msgstr "Lá»›p:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "Thừa kế:" @@ -2771,7 +2772,7 @@ msgstr "" #: editor/editor_node.cpp editor/script_create_dialog.cpp msgid "Editor" -msgstr "Trình biên táºp" +msgstr "Editor (trình biên táºp)" #: editor/editor_node.cpp #, fuzzy @@ -2931,7 +2932,7 @@ msgstr "Quản lý đối tượng" msgid "Expand Bottom Panel" msgstr "Mở rá»™ng bảng Ä‘iá»u khiển phÃa dưới" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "Äầu ra" @@ -3170,6 +3171,11 @@ msgstr "" msgid "New Script" msgstr "Mã lệnh má»›i" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "Tạo Script" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Má»›i %s" @@ -3196,13 +3202,6 @@ msgstr "Dán" msgid "Convert To %s" msgstr "" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -3742,7 +3741,7 @@ msgstr "Xoá bố cục" #: editor/groups_editor.cpp editor/node_dock.cpp msgid "Groups" -msgstr "Nhóm" +msgstr "Nhóm (Groups)" #: editor/groups_editor.cpp #, fuzzy @@ -3992,7 +3991,7 @@ msgstr "" msgid "Subfolder:" msgstr "Thư mục phụ:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "Ngôn ngữ:" @@ -4132,6 +4131,12 @@ msgstr "Äiểm" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "Mở nút Hoạt ảnh" @@ -4480,7 +4485,6 @@ msgstr "Tên Hoạt ảnh:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "Lá»—i!" @@ -4653,6 +4657,8 @@ msgid "Current:" msgstr "Hiện tại:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "Thêm Input" @@ -4864,6 +4870,10 @@ msgid "All" msgstr "Tất cả" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "Nháºp và o" @@ -5157,21 +5167,26 @@ msgid "Ruler Mode" msgstr "Chế độ Tỉ lệ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "Sá» dụng Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" +msgid "Toggle grid snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "Snap dạng lưới" +#, fuzzy +msgid "Use Grid Snap" +msgstr "Sá» dụng Snap" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5260,8 +5275,8 @@ msgid "View" msgstr "Hiện thị" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "Hiện lưới" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5526,6 +5541,11 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "Nhấp chuá»™t phải: Xóa Point" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6166,6 +6186,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "Hiện lưới" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6222,6 +6246,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6329,6 +6354,11 @@ msgid "Find Next" msgstr "Tìm tiếp theo" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "Lá»c các thuá»™c tÃnh" @@ -6607,6 +6637,11 @@ msgstr "Tạo các Ä‘iểm." msgid "Cut" msgstr "Cắt" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "Chá»n Toà n Bá»™" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "" @@ -6665,10 +6700,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "Tìm..." @@ -6999,6 +7030,10 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Freelook Slow Modifier" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7032,6 +7067,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "Sá» dụng Snap" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7265,6 +7304,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8081,12 +8124,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "Thêm Input" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "Thêm Input" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8103,6 +8141,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "Thêm Input" @@ -8982,12 +9024,14 @@ msgstr "" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -9482,7 +9526,7 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "Button" -msgstr "" +msgstr "Button (nút, phÃm)" #: editor/project_settings_editor.cpp msgid "Left Button." @@ -9992,11 +10036,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10072,6 +10114,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "" @@ -10090,11 +10140,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "Tạo Script" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "Tạo các nút má»›i." @@ -10335,24 +10380,19 @@ msgid "Will load an existing script file." msgstr "" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Lá»›p:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "Khung project" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "Tạo Script" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11004,6 +11044,11 @@ msgid "Add Function" msgstr "Thêm Hà m" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "Xoá Function" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "Thêm Biến" @@ -11012,6 +11057,26 @@ msgid "Add Signal" msgstr "Thêm TÃn hiệu" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "Thêm Input" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "Thêm Input" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "Xoá Function" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "Xóa Template" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11052,10 +11117,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11081,6 +11156,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "Äứt kết nối" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "Kết nối đến Node:" @@ -11114,6 +11194,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "Äổi tên Hà m" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "Xoá Function" @@ -11138,16 +11239,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "Những Thà nh viên:" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "Nodes khả dụng:" +#, fuzzy +msgid "function_name" +msgstr "Hà m:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11170,6 +11268,16 @@ msgid "Cut Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "Äổi tên Hà m" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "Là m má»›i" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "" @@ -11264,6 +11372,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11365,6 +11477,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "Chạy trong Trình duyệt web" @@ -11912,14 +12028,9 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "Nháºp" - #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "nguồn vô hiệu cho shader." +msgstr "nguồn vô hiệu cho xem trước" #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." @@ -11946,6 +12057,19 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Không thể chỉnh sá»a hằng số." +#~ msgid "Snap to Grid" +#~ msgstr "Snap dạng lưới" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "Thêm Input" + +#~ msgid "Available Nodes:" +#~ msgstr "Nodes khả dụng:" + +#~ msgid "Input" +#~ msgstr "Nháºp" + #~ msgid "Properties:" #~ msgstr "Thuá»™c tÃnh:" diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po index 5c8029a727..86aa897888 100644 --- a/editor/translations/zh_CN.po +++ b/editor/translations/zh_CN.po @@ -57,11 +57,12 @@ # Morge Tolbert <pygyme@gmail.com>, 2019. # idleman <1524328475@qq.com>, 2019. # king <wangding1992@126.com>, 2019. +# silentbird <silentbird520@outlook.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Chinese (Simplified) (Godot Engine)\n" "POT-Creation-Date: 2018-01-20 12:15+0200\n" -"PO-Revision-Date: 2019-09-26 11:51+0000\n" +"PO-Revision-Date: 2019-10-22 02:53+0000\n" "Last-Translator: idleman <1524328475@qq.com>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot/zh_Hans/>\n" @@ -70,7 +71,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 3.9-dev\n" +"X-Generator: Weblate 3.9.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -113,32 +114,31 @@ msgstr "对'%s'的调用 :" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KB" #: core/ustring.cpp -#, fuzzy msgid "MiB" -msgstr "æ··åˆ" +msgstr "MB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -404,6 +404,7 @@ msgstr "创建%d个新轨é“å¹¶æ’入关键帧?" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "创建" @@ -538,19 +539,9 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "è¦å‘Š: æ£åœ¨ç¼–辑导入的动画" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "全选" - -#: editor/animation_track_editor.cpp -msgid "Select None" -msgstr "å–æ¶ˆé€‰æ‹©" - #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "包å«åŠ¨ç”»çš„ AnimationPlayer 节点没有设置路径。" +msgstr "选择一个AnimationPlayer节点以创建和编辑动画。" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -574,7 +565,7 @@ msgstr "ç§’" #: editor/animation_track_editor.cpp msgid "FPS" -msgstr "帧数" +msgstr ":abbr:`FPS(Frames Per Second,æ¯ç§’ä¼ è¾“å¸§æ•°)`" #: editor/animation_track_editor.cpp editor/editor_properties.cpp #: editor/plugins/polygon_2d_editor_plugin.cpp @@ -682,7 +673,8 @@ msgid "Scale Ratio:" msgstr "缩放比率:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "选择è¦å¤åˆ¶çš„轨é“:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -694,6 +686,11 @@ msgstr "选择è¦å¤åˆ¶çš„轨é“:" msgid "Copy" msgstr "å¤åˆ¶" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "å–æ¶ˆé€‰æ‹©" + #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" msgstr "æ·»åŠ éŸ³é¢‘è½¨é“剪辑" @@ -1012,7 +1009,7 @@ msgid "Resource" msgstr "资æº" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "路径" @@ -1277,9 +1274,8 @@ msgid "Delete Bus Effect" msgstr "åˆ é™¤éŸ³é¢‘æ€»çº¿æ•ˆæžœ" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "éŸ³é¢‘æ€»çº¿ï¼Œæ‹–æ”¾é‡æ–°æŽ’列。" +msgstr "æ‹–æ”¾ä»¥é‡æ–°æŽ’列。" #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1470,7 +1466,8 @@ msgstr "æ·»åŠ è‡ªåŠ¨åŠ è½½" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "路径:" @@ -1524,7 +1521,7 @@ msgstr "新建目录" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "åç§°:" @@ -1910,6 +1907,7 @@ msgid "Class:" msgstr "ç±»:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "基类:" @@ -1918,9 +1916,8 @@ msgid "Inherited by:" msgstr "派生类:" #: editor/editor_help.cpp -#, fuzzy msgid "Brief Description" -msgstr "简介:" +msgstr "简述" #: editor/editor_help.cpp msgid "Properties" @@ -1951,9 +1948,8 @@ msgid "Class Description" msgstr "类说明" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "在线教程:" +msgstr "在线教程" #: editor/editor_help.cpp msgid "" @@ -2075,7 +2071,7 @@ msgstr "开始" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2091,19 +2087,19 @@ msgstr "节点" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "ä¼ å…¥RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "ä¼ å…¥RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "ä¼ å‡ºRPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "ä¼ å‡ºRSET" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" @@ -2666,17 +2662,16 @@ msgid "Project Settings..." msgstr "项目设置..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "版本:" +msgstr "版本控制" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "设置版本控制" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "å…³é—版本控制" #: editor/editor_node.cpp msgid "Export..." @@ -2939,7 +2934,7 @@ msgstr "å±žæ€§é¢æ¿" msgid "Expand Bottom Panel" msgstr "å±•å¼€åº•éƒ¨é¢æ¿" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "日志" @@ -2965,17 +2960,20 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"é€šè¿‡å°†æºæ¨¡æ¿å®‰è£…到“ res:// android / buildâ€ï¼Œå°†ä¸ºè‡ªå®šä¹‰Android构建设置项" +"目。 ç„¶åŽï¼Œæ‚¨å¯ä»¥åº”用修改并在导出时构建自己的自定义APKï¼ˆæ·»åŠ æ¨¡å—,更改" +"AndroidManifest.xmlç‰ï¼‰ã€‚ 请注æ„ï¼Œä¸ºäº†è¿›è¡Œè‡ªå®šä¹‰æž„å»ºè€Œä¸æ˜¯ä½¿ç”¨é¢„先构建的APK," +"应在Android导出预设ä¸å¯ç”¨â€œä½¿ç”¨è‡ªå®šä¹‰æž„建â€é€‰é¡¹ã€‚" #: editor/editor_node.cpp -#, fuzzy msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" "Remove the \"res://android/build\" directory manually before attempting this " "operation again." msgstr "" -"Android 构建模æ¿å·²ç»å®‰è£…且ä¸ä¼šè¢«è¦†ç›–。\n" -"请先移除“buildâ€ç›®å½•å†é‡æ–°å°è¯•æ¤æ“作。" +"Android构建模æ¿å·²å®‰è£…在æ¤é¡¹ç›®ä¸ï¼Œå¹¶ä¸”ä¸ä¼šè¢«è¦†ç›–。 冿¬¡å°è¯•æ‰§è¡Œæ¤æ“作之å‰ï¼Œè¯·" +"æ‰‹åŠ¨åˆ é™¤â€œ res:// android / buildâ€ç›®å½•。" #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3038,9 +3036,8 @@ msgid "Open the previous Editor" msgstr "打开上一个编辑器" #: editor/editor_path.cpp -#, fuzzy msgid "No sub-resources found." -msgstr "æ²¡æœ‰æŒ‡å®šçš„è¡¨é¢æºã€‚" +msgstr "找ä¸åˆ°å资æºã€‚" #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3051,9 +3048,8 @@ msgid "Thumbnail..." msgstr "缩略图..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "打开脚本:" +msgstr "主脚本:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" @@ -3184,6 +3180,10 @@ msgstr "选择1个视å£" msgid "New Script" msgstr "新建脚本" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +msgid "Extend Script" +msgstr "打开脚本" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "新建%s" @@ -3210,13 +3210,6 @@ msgstr "粘贴" msgid "Convert To %s" msgstr "转æ¢ä¸º%s" -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -msgid "Open Editor" -msgstr "打开编辑器" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "é€‰å®šçš„èŠ‚ç‚¹ä¸æ˜¯ä¸€ä¸ªViewport节点ï¼" @@ -3747,7 +3740,7 @@ msgstr "åˆ é™¤åˆ†ç»„" #: editor/groups_editor.cpp editor/node_dock.cpp msgid "Groups" -msgstr "分组" +msgstr "编组" #: editor/groups_editor.cpp msgid "Nodes Not in Group" @@ -3868,9 +3861,8 @@ msgid "Import As:" msgstr "导入为:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "预设" +msgstr "预置" #: editor/import_dock.cpp msgid "Reimport" @@ -3994,7 +3986,7 @@ msgstr "æ’ä»¶å:" msgid "Subfolder:" msgstr "åæ–‡ä»¶å¤¹ï¼š" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "è¯è¨€ï¼š" @@ -4134,6 +4126,12 @@ msgstr "点" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +msgid "Open Editor" +msgstr "打开编辑器" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" msgstr "打开动画节点" @@ -4475,7 +4473,6 @@ msgstr "动画åç§°:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "错误ï¼" @@ -4646,6 +4643,8 @@ msgid "Current:" msgstr "当å‰:" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "æ·»åŠ è¾“å…¥äº‹ä»¶" @@ -4850,6 +4849,10 @@ msgid "All" msgstr "全部" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." msgstr "导入…" @@ -5127,71 +5130,77 @@ msgid "Pan Mode" msgstr "平移模å¼" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "è¿è¡Œæ¨¡å¼:" +msgstr "æ ‡å°ºæ¨¡å¼" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "开关å¸é™„。" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" -msgstr "使用对é½" +#, fuzzy +msgid "Use Smart Snap" +msgstr "使用å¸é™„" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "对é½é€‰é¡¹" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "开关å¸é™„。" + +#: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Use Grid Snap" +msgstr "ç½‘æ ¼å¸é™„" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" -msgstr "对é½ç½‘æ ¼" +msgid "Snapping Options" +msgstr "å¸é™„选项" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" -msgstr "使用旋转对é½" +msgstr "使用旋转å¸é™„" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap Relative" -msgstr "相对对é½" +msgstr "相对å¸é™„" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Pixel Snap" -msgstr "使用åƒç´ 对é½" +msgstr "使用åƒç´ å¸é™„" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Smart Snapping" -msgstr "智能对é½" +msgstr "智能å¸é™„" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Configure Snap..." -msgstr "设置对é½..." +msgstr "设置å¸é™„..." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to Parent" -msgstr "对é½åˆ°çˆ¶çº§" +msgstr "å¸é™„到父级" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to Node Anchor" -msgstr "对é½åˆ°èŠ‚ç‚¹é”šç‚¹" +msgstr "å¸é™„到节点锚点" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to Node Sides" -msgstr "对é½åˆ°èŠ‚ç‚¹ä¾§" +msgstr "å¸é™„到节点侧" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to Node Center" -msgstr "对é½åˆ°èŠ‚ç‚¹ä¸å¿ƒä½ç½®" +msgstr "å¸é™„到节点ä¸å¿ƒä½ç½®" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to Other Nodes" -msgstr "对é½åˆ°å…¶ä»–node节点" +msgstr "å¸é™„到其他node节点" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to Guides" -msgstr "对é½åˆ°å‚考线" +msgstr "å¸é™„到å‚考线" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5235,8 +5244,8 @@ msgid "View" msgstr "视图" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "æ˜¾ç¤ºç½‘æ ¼" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5501,6 +5510,11 @@ msgstr "åˆ‡æ¢æ›²çº¿çº¿æ€§Tangent" msgid "Hold Shift to edit tangents individually" msgstr "æŒ‰ä½ Shift å¯å•独编辑切线" +#: editor/plugins/curve_editor_plugin.cpp +#, fuzzy +msgid "Right click to add point" +msgstr "é¼ æ ‡å³é”®:åˆ é™¤ç‚¹" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "渲染GI Probe" @@ -5596,7 +5610,7 @@ msgstr "创建轮廓(outlines)" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh" -msgstr "网 æ ¼" +msgstr "网络" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Static Body" @@ -6130,6 +6144,10 @@ msgid "Grid" msgstr "ç½‘æ ¼" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "æ˜¾ç¤ºç½‘æ ¼" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "é…ç½®ç½‘æ ¼ï¼š" @@ -6186,6 +6204,7 @@ msgstr "实例:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "类型:" @@ -6284,6 +6303,11 @@ msgid "Find Next" msgstr "查找下一项" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "查找上一项" + +#: editor/plugins/script_editor_plugin.cpp msgid "Filter scripts" msgstr "过滤脚本" @@ -6551,6 +6575,11 @@ msgstr "æ–点" msgid "Cut" msgstr "剪切" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "全选" + #: editor/plugins/script_text_editor.cpp msgid "Delete Line" msgstr "åˆ é™¤çº¿" @@ -6608,10 +6637,6 @@ msgid "Auto Indent" msgstr "自动缩进" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "查找上一项" - -#: editor/plugins/script_text_editor.cpp msgid "Find in Files..." msgstr "åœ¨æ–‡ä»¶ä¸æŸ¥æ‰¾..." @@ -6933,6 +6958,11 @@ msgid "Freelook Speed Modifier" msgstr "自由视图速度调整" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "自由视图速度调整" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -6971,6 +7001,10 @@ msgid "Use Local Space" msgstr "使用本地空间" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "使用å¸é™„" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "底部视图" @@ -7021,7 +7055,7 @@ msgstr "å˜æ¢" #: editor/plugins/spatial_editor_plugin.cpp msgid "Snap Object to Floor" -msgstr "将对象对é½åˆ°åœ°æ¿" +msgstr "将对象å¸é™„到地æ¿" #: editor/plugins/spatial_editor_plugin.cpp msgid "Transform Dialog..." @@ -7074,7 +7108,7 @@ msgstr "å¸é™„设置" #: editor/plugins/spatial_editor_plugin.cpp msgid "Translate Snap:" -msgstr "移动å¸é™„:" +msgstr "转化å¸é™„:" #: editor/plugins/spatial_editor_plugin.cpp msgid "Rotate Snap (deg.):" @@ -7197,6 +7231,11 @@ msgid "Simplification: " msgstr "简å•化: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "扩展(åƒç´ ): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "扩展(åƒç´ ): " @@ -7245,9 +7284,8 @@ msgid "(empty)" msgstr "(空)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "粘贴帧" +msgstr "移动帧" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations:" @@ -7564,13 +7602,12 @@ msgid "Enable Priority" msgstr "å¯ç”¨ä¼˜å…ˆçº§" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "ç›é€‰æ–‡ä»¶..." +msgstr "过滤tiles" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." -msgstr "" +msgstr "为æ¤tilemapæä¾›tileset资æºä»¥ä½¿ç”¨å…¶tile。" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7709,7 +7746,7 @@ msgstr "显示ç£è´´çš„åå—ï¼ˆæŒ‰ä½ Alt 键)" #: editor/plugins/tile_set_editor_plugin.cpp msgid "" "Add or select a texture on the left panel to edit the tiles bound to it." -msgstr "" +msgstr "åœ¨å·¦ä¾§é¢æ¿ä¸Šæ·»åŠ æˆ–é€‰æ‹©çº¹ç†ä»¥ç¼–辑与其绑定的图å—。" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove selected texture? This will remove all tiles which use it." @@ -7881,92 +7918,80 @@ msgid "TileSet" msgstr "ç –å—集" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No VCS addons are available." -msgstr "父节点的å称,如果有的è¯" +msgstr "没有å¯ç”¨çš„VCSæ’件。" #: editor/plugins/version_control_editor_plugin.cpp editor/rename_dialog.cpp msgid "Error" msgstr "错误" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No commit message was provided" -msgstr "未æä¾›åç§°" +msgstr "没有æä¾›æäº¤æ¶ˆæ¯" #: editor/plugins/version_control_editor_plugin.cpp msgid "No files added to stage" -msgstr "" +msgstr "æ²¡æœ‰æ–‡ä»¶æ·»åŠ åˆ°èˆžå°" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit" -msgstr "社区" +msgstr "æäº¤" #: editor/plugins/version_control_editor_plugin.cpp msgid "VCS Addon is not initialized" -msgstr "" +msgstr "VCSæ’件未åˆå§‹åŒ–" #: editor/plugins/version_control_editor_plugin.cpp msgid "Version Control System" -msgstr "" +msgstr "版本控制系统" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "首嗿¯å¤§å†™" +msgstr "åˆå§‹åŒ–" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" -msgstr "" +msgstr "æš‚å˜åŒºåŸŸ" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Detect new changes" -msgstr "新建一个四边形。" +msgstr "检测新å˜åŒ–" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" -msgstr "更改" +msgstr "修改" #: editor/plugins/version_control_editor_plugin.cpp msgid "Modified" -msgstr "" +msgstr "已修改" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "é‡å‘½å" +msgstr "æ›´å" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "åˆ é™¤" +msgstr "å·²åˆ é™¤" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Typechange" -msgstr "更改" +msgstr "类型更改" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage Selected" -msgstr "åˆ é™¤å·²é€‰ä¸" +msgstr "舞å°é€‰å®š" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Stage All" -msgstr "全部ä¿å˜" +msgstr "所有舞å°" #: editor/plugins/version_control_editor_plugin.cpp msgid "Add a commit message" -msgstr "" +msgstr "æ·»åŠ æäº¤æ¶ˆæ¯" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Commit Changes" -msgstr "åŒæ¥è„šæœ¬å˜æ›´" +msgstr "æäº¤å˜æ›´" #: editor/plugins/version_control_editor_plugin.cpp #: modules/gdnative/gdnative_library_singleton_editor.cpp @@ -7975,27 +8000,23 @@ msgstr "状æ€" #: editor/plugins/version_control_editor_plugin.cpp msgid "View file diffs before committing them to the latest version" -msgstr "" +msgstr "在æäº¤åˆ°æœ€æ–°ç‰ˆæœ¬ä¹‹å‰æŸ¥çœ‹æ–‡ä»¶å·®å¼‚" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "No file diff is active" -msgstr "没有选ä¸ä»»ä½•文件ï¼" +msgstr "没有文件差异处于活动状æ€" #: editor/plugins/version_control_editor_plugin.cpp msgid "Detect changes in file diff" -msgstr "" +msgstr "检测文件差异的å˜åŒ–" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" msgstr "åªä½¿ç”¨GLES3" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add input +" -msgstr "æ·»åŠ è¾“å…¥+" - -#: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" +#, fuzzy +msgid "Add Output" msgstr "æ·»åŠ è¾“å‡º+" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8004,13 +8025,18 @@ msgstr "æ ‡é‡" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vector" -msgstr "å‘é‡" +msgstr "Vector" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" msgstr "布尔值" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Sampler" +msgstr "音效" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" msgstr "æ·»åŠ è¾“å…¥ç«¯å£" @@ -8219,7 +8245,6 @@ msgid "" msgstr "如果æä¾›çš„布尔值是true或false,则返回关è”çš„å‘é‡ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Returns an associated scalar if the provided boolean value is true or false." msgstr "如果æä¾›çš„布尔值是true或false,则返回关è”çš„å‘é‡ã€‚" @@ -8736,7 +8761,7 @@ msgstr "å‘é‡å¸¸æ•°ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vector uniform." -msgstr "å‘é‡ä¸€è‡´" +msgstr "å‘é‡ä¸€è‡´ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8900,13 +8925,17 @@ msgid "Resources to export:" msgstr "导出的资æº:" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "ç›é€‰å¯¼å‡ºéžèµ„æºæ–‡ä»¶ï¼ˆä½¿ç”¨è‹±æ–‡é€—å·åˆ†éš”,如:*.json,*.txt)" #: editor/project_export.cpp +#, fuzzy msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "è¿‡æ»¤ä»Žé¡¹ç›®ä¸æŽ’é™¤æ–‡ä»¶ï¼ˆä»¥é€—å·åˆ†éš”,例如:*。json,*。txt)" #: editor/project_export.cpp @@ -9473,9 +9502,8 @@ msgid "Settings saved OK." msgstr "ä¿å˜è®¾ç½®æˆåŠŸã€‚" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "æ·»åŠ è¾“å…¥äº‹ä»¶" +msgstr "输入动作事件" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -9543,7 +9571,7 @@ msgstr "动作:" #: editor/project_settings_editor.cpp msgid "Action" -msgstr "动作" +msgstr "动作(``Action``)" #: editor/project_settings_editor.cpp msgid "Deadzone" @@ -9575,7 +9603,7 @@ msgstr "é‡å®šå‘" #: editor/project_settings_editor.cpp msgid "Resources:" -msgstr "资æº:" +msgstr "资æºï¼š" #: editor/project_settings_editor.cpp msgid "Remaps by Locale:" @@ -9607,7 +9635,7 @@ msgstr "区域:" #: editor/project_settings_editor.cpp msgid "AutoLoad" -msgstr "è‡ªåŠ¨åŠ è½½(AutoLoad)" +msgstr "è‡ªåŠ¨åŠ è½½" #: editor/project_settings_editor.cpp msgid "Plugins" @@ -9840,9 +9868,8 @@ msgid "Instance Scene(s)" msgstr "实例化场景" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "将分支ä¿å˜ä¸ºåœºæ™¯" +msgstr "替æ¢ä¸ºåˆ†æ”¯åœºæ™¯" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -9885,23 +9912,20 @@ msgid "Make node as Root" msgstr "å°†èŠ‚ç‚¹è®¾ç½®ä¸ºæ ¹èŠ‚ç‚¹" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "åˆ é™¤èŠ‚ç‚¹" +msgstr "åˆ é™¤ï¼…d个节点?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "åˆ é™¤Graph Node节点" +msgstr "åˆ é™¤æ ¹èŠ‚ç‚¹â€œï¼…sâ€ï¼Ÿ" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "åˆ é™¤èŠ‚ç‚¹â€œï¼…sâ€åŠå…¶å节点?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "åˆ é™¤èŠ‚ç‚¹" +msgstr "åˆ é™¤èŠ‚ç‚¹â€œï¼…sâ€ï¼Ÿ" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." @@ -9922,12 +9946,11 @@ msgid "" msgstr "ç¦ç”¨â€œå¯ç¼–辑实例â€å°†å¯¼è‡´èŠ‚ç‚¹çš„æ‰€æœ‰å±žæ€§æ¢å¤ä¸ºå…¶é»˜è®¤å€¼ã€‚" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "å…许编辑åå™èŠ‚ç‚¹" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" -msgstr "åŠ è½½ä¸ºå ä½ç¬¦" +#, fuzzy +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." +msgstr "ç¦ç”¨â€œå¯ç¼–辑实例â€å°†å¯¼è‡´èŠ‚ç‚¹çš„æ‰€æœ‰å±žæ€§æ¢å¤ä¸ºå…¶é»˜è®¤å€¼ã€‚" #: editor/scene_tree_dock.cpp msgid "Make Local" @@ -10000,6 +10023,14 @@ msgid "Clear Inheritance" msgstr "清除继承" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "å…许编辑åå™èŠ‚ç‚¹" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "åŠ è½½ä¸ºå ä½ç¬¦" + +#: editor/scene_tree_dock.cpp msgid "Open Documentation" msgstr "打开文档" @@ -10016,10 +10047,6 @@ msgid "Change Type" msgstr "更改类型" #: editor/scene_tree_dock.cpp -msgid "Extend Script" -msgstr "打开脚本" - -#: editor/scene_tree_dock.cpp msgid "Reparent to New Node" msgstr "釿–°åˆ†é…到新节点" @@ -10252,23 +10279,18 @@ msgid "Will load an existing script file." msgstr "å°†åŠ è½½çŽ°æœ‰çš„è„šæœ¬æ–‡ä»¶ã€‚" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "è¯è¨€" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "继承自" - -#: editor/script_create_dialog.cpp -msgid "Class Name" +#, fuzzy +msgid "Class Name:" msgstr "ç±»å" #: editor/script_create_dialog.cpp -msgid "Template" +#, fuzzy +msgid "Template:" msgstr "模æ¿" #: editor/script_create_dialog.cpp -msgid "Built-in Script" +#, fuzzy +msgid "Built-in Script:" msgstr "内置脚本" #: editor/script_create_dialog.cpp @@ -10284,7 +10306,6 @@ msgid "Bytes:" msgstr "å—节:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" msgstr "è¦å‘Šï¼š" @@ -10293,29 +10314,24 @@ msgid "Error:" msgstr "错误:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "å¤åˆ¶é”™è¯¯ä¿¡æ¯" +msgstr "C ++错误" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "错误:" +msgstr "C++错误:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "æº" +msgstr "C++æºç¨‹åº" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" -msgstr "æº" +msgstr "æºæ–‡ä»¶:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "æº" +msgstr "C++æºç¨‹åºï¼š" #: editor/script_editor_debugger.cpp msgid "Stack Trace" @@ -10326,18 +10342,16 @@ msgid "Errors" msgstr "错误" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Child process connected." -msgstr "å进程已连接" +msgstr "å进程已连接。" #: editor/script_editor_debugger.cpp msgid "Copy Error" msgstr "å¤åˆ¶é”™è¯¯ä¿¡æ¯" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "æ–点" +msgstr "跳过æ–点" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -10356,9 +10370,8 @@ msgid "Profiler" msgstr "性能分æž" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "导出é…置文件" +msgstr "网络é…ç½®" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -10582,7 +10595,7 @@ msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "预期为长度为1çš„å—符串(一个å—符)。" #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -10737,13 +10750,12 @@ msgid "Pick Distance:" msgstr "拾å–è·ç¦»:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "过滤方å¼" +msgstr "è¿‡æ»¤ç½‘æ ¼" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." -msgstr "" +msgstr "呿¤GridMapæä¾›MeshLibrary资æºä»¥ä½¿ç”¨å…¶ç½‘æ ¼ã€‚" #: modules/mono/csharp_script.cpp msgid "Class name can't be a reserved keyword" @@ -10913,6 +10925,11 @@ msgid "Add Function" msgstr "æ·»åŠ å‡½æ•°" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "移除输入端å£" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "æ·»åŠ å˜é‡" @@ -10921,6 +10938,26 @@ msgid "Add Signal" msgstr "æ·»åŠ ä¿¡å·" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "æ·»åŠ è¾“å…¥ç«¯å£" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "å¢žåŠ è¾“å‡ºç«¯å£" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "移除输入端å£" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "移除输出端å£" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "更改表达å¼" @@ -10961,10 +10998,20 @@ msgid "Add Preload Node" msgstr "æ·»åŠ Preload节点" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "ä»Žæ ‘ä¸æ·»åŠ èŠ‚ç‚¹" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "æ·»åŠ å±žæ€§Getter" @@ -10989,6 +11036,11 @@ msgid "Connect Nodes" msgstr "连接节点" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Disconnect Nodes" +msgstr "æ–å¼€Graph Node连接" + +#: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" msgstr "连接节点数æ®" @@ -11021,6 +11073,28 @@ msgid "Paste VisualScript Nodes" msgstr "粘贴 VisualScript 节点" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Can't create function with a function node." +msgstr "æ— æ³•å¤åˆ¶å‡½æ•°èŠ‚ç‚¹ã€‚" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "é‡å‘½å函数" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "åˆ é™¤å‡½æ•°" @@ -11041,21 +11115,17 @@ msgid "Editing Signal:" msgstr "编辑信å·:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "使用本地" - -#: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "基础类型:" +msgstr "制作工具:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "æˆå‘˜ï¼š" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "有效节点:" +#, fuzzy +msgid "function_name" +msgstr "函数:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11078,6 +11148,16 @@ msgid "Cut Nodes" msgstr "剪切节点" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Make Function" +msgstr "é‡å‘½å函数" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "刷新" + +#: modules/visual_script/visual_script_editor.cpp msgid "Edit Member" msgstr "编辑æˆå‘˜" @@ -11172,6 +11252,10 @@ msgid "The package must have at least one '.' separator." msgstr "包必须至少有一个“.â€åˆ†éš”符。" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "从列表ä¸é€‰æ‹©è®¾å¤‡" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "未在编辑器设置ä¸é…ç½®ADB坿‰§è¡Œæ–‡ä»¶ã€‚" @@ -11192,11 +11276,10 @@ msgid "Invalid Android SDK path for custom build in Editor Settings." msgstr "用于“编辑器设置â€ä¸è‡ªå®šä¹‰æž„建的Android SDKè·¯å¾„æ˜¯æ— æ•ˆçš„ã€‚" #: platform/android/export/export.cpp -#, fuzzy msgid "" "Android build template not installed in the project. Install it from the " "Project menu." -msgstr "未安装Android项目进行编译。从编辑器èœå•安装。" +msgstr "未在项目ä¸å®‰è£…Android构建模æ¿ã€‚从项目èœå•安装它。" #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11279,6 +11362,10 @@ msgid "Required icon is not specified in the preset." msgstr "é¢„è®¾ä¸æœªæŒ‡å®šå¿…éœ€çš„å›¾æ ‡ã€‚" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "在æµè§ˆå™¨ä¸è¿è¡Œ" @@ -11876,10 +11963,6 @@ msgstr "" "示其内容,使其æˆä¸ºå控件的所以它å¯ä»¥æœ‰ä¸€ä¸ªå°ºå¯¸å¤§å°å€¼ã€‚å¦åˆ™è¯·è®¾ç½®ä¸ºRender " "target,并将其内部纹ç†åˆ†é…给一些节点以显示。" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "输入" - #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "预览的æºèµ„æºæ— 效。" @@ -11908,6 +11991,27 @@ msgstr "å˜é‡åªèƒ½åœ¨é¡¶ç‚¹å‡½æ•°ä¸æŒ‡å®šã€‚" msgid "Constants cannot be modified." msgstr "ä¸å…许修改常é‡ã€‚" +#~ msgid "Snap to Grid" +#~ msgstr "å¸é™„åˆ°ç½‘æ ¼" + +#~ msgid "Add input +" +#~ msgstr "æ·»åŠ è¾“å…¥+" + +#~ msgid "Language" +#~ msgstr "è¯è¨€" + +#~ msgid "Inherits" +#~ msgstr "继承自" + +#~ msgid "Base Type:" +#~ msgstr "基础类型:" + +#~ msgid "Available Nodes:" +#~ msgstr "有效节点:" + +#~ msgid "Input" +#~ msgstr "输入" + #~ msgid "Properties:" #~ msgstr "属性:" @@ -12123,9 +12227,6 @@ msgstr "ä¸å…许修改常é‡ã€‚" #~ msgid "Go to parent folder" #~ msgstr "转到上层文件夹" -#~ msgid "Select device from the list" -#~ msgstr "从列表ä¸é€‰æ‹©è®¾å¤‡" - #~ msgid "Open Scene(s)" #~ msgstr "打开场景" @@ -12362,9 +12463,6 @@ msgstr "ä¸å…许修改常é‡ã€‚" #~ msgid "Warning" #~ msgstr "è¦å‘Š" -#~ msgid "Function:" -#~ msgstr "函数:" - #~ msgid "Variable" #~ msgstr "å˜é‡" @@ -12431,9 +12529,6 @@ msgstr "ä¸å…许修改常é‡ã€‚" #~ msgid "Connect Graph Nodes" #~ msgstr "连接Graph Node" -#~ msgid "Disconnect Graph Nodes" -#~ msgstr "æ–å¼€Graph Node连接" - #~ msgid "Remove Shader Graph Node" #~ msgstr "移除Graph Node节点" @@ -13569,9 +13664,6 @@ msgstr "ä¸å…许修改常é‡ã€‚" #~ msgid "Group" #~ msgstr "分组" -#~ msgid "Samples" -#~ msgstr "音效" - #~ msgid "Sample Conversion Mode: (.wav files):" #~ msgstr "éŸ³æ•ˆè½¬æ¢æ–¹å¼ï¼ˆ.wav文件):" diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po index fef45a44f4..2a343a6590 100644 --- a/editor/translations/zh_HK.po +++ b/editor/translations/zh_HK.po @@ -382,6 +382,7 @@ msgstr "新增 %d 個新軌跡並æ’入關éµå¹€ï¼Ÿ" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp #, fuzzy msgid "Create" msgstr "新增" @@ -520,16 +521,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "å…¨é¸" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "ä¸é¸" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -682,8 +673,9 @@ msgid "Scale Ratio:" msgstr "縮放比例:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" -msgstr "" +#, fuzzy +msgid "Select Tracks to Copy" +msgstr "鏿“‡æ¨¡å¼" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -694,6 +686,11 @@ msgstr "" msgid "Copy" msgstr "複製" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "ä¸é¸" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1029,7 +1026,7 @@ msgid "Resource" msgstr "資æº" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "路徑" @@ -1525,7 +1522,8 @@ msgstr "新增AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "路徑:" @@ -1580,7 +1578,7 @@ msgstr "新增資料夾" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "å稱:" @@ -2004,6 +2002,7 @@ msgid "Class:" msgstr "" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "" @@ -3077,7 +3076,7 @@ msgstr "監視器" msgid "Expand Bottom Panel" msgstr "" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "" @@ -3329,6 +3328,11 @@ msgstr "" msgid "New Script" msgstr "下一個腳本" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "下一個腳本" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "" @@ -3356,14 +3360,6 @@ msgstr "貼上" msgid "Convert To %s" msgstr "轉為..." -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "開啟資料夾" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "" @@ -4213,7 +4209,7 @@ msgstr "æ’件列表:" msgid "Subfolder:" msgstr "" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp #, fuzzy msgid "Language:" msgstr "語言" @@ -4361,6 +4357,13 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "開啟資料夾" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4734,7 +4737,6 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "錯誤!" @@ -4912,6 +4914,8 @@ msgid "Current:" msgstr "" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "" @@ -5128,6 +5132,10 @@ msgid "All" msgstr "全部" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "å°Žå…¥" @@ -5429,24 +5437,27 @@ msgid "Ruler Mode" msgstr "鏿“‡æ¨¡å¼" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +msgid "Toggle smart snapping." msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +msgid "Use Smart Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy -msgid "Snapping Options" -msgstr "é¸é …" +msgid "Toggle grid snapping." +msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snap to Grid" +msgid "Use Grid Snap" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Snapping Options" +msgstr "é¸é …" + +#: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" msgstr "" @@ -5538,8 +5549,7 @@ msgid "View" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +msgid "Always Show Grid" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5810,6 +5820,10 @@ msgstr "" msgid "Hold Shift to edit tangents individually" msgstr "" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "" @@ -6459,6 +6473,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6515,6 +6533,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6625,6 +6644,11 @@ msgid "Find Next" msgstr "" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "篩é¸:" @@ -6913,6 +6937,11 @@ msgstr "刪除" msgid "Cut" msgstr "剪下" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "å…¨é¸" + #: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Delete Line" @@ -6975,10 +7004,6 @@ msgid "Auto Indent" msgstr "" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "ç¯©é¸æª”案..." @@ -7319,6 +7344,11 @@ msgid "Freelook Speed Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "下滾" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7353,6 +7383,10 @@ msgid "Use Local Space" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "" @@ -7590,6 +7624,10 @@ msgid "Simplification: " msgstr "" #: editor/plugins/sprite_editor_plugin.cpp +msgid "Shrink (Pixels): " +msgstr "" + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "" @@ -8425,14 +8463,10 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" +msgid "Add Output" msgstr "新增訊號" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Add output +" -msgstr "" - -#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" msgstr "" @@ -8446,6 +8480,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "新增訊號" @@ -9332,12 +9370,14 @@ msgstr "資æº" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10371,11 +10411,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10457,6 +10495,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "開啓最近的" @@ -10476,11 +10522,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "下一個腳本" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "新增" @@ -10729,25 +10770,18 @@ msgid "Will load an existing script file." msgstr "下一個腳本" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "語言" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "å稱:" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Template" +msgid "Template:" msgstr "移除é¸é …" #: editor/script_create_dialog.cpp #, fuzzy -msgid "Built-in Script" +msgid "Built-in Script:" msgstr "é‹è¡Œè…³æœ¬" #: editor/script_create_dialog.cpp @@ -11416,6 +11450,11 @@ msgid "Add Function" msgstr "行為" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "åªé™é¸ä¸" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11424,6 +11463,26 @@ msgid "Add Signal" msgstr "新增訊號" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "新增訊號" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "新增訊號" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "åªé™é¸ä¸" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "åªé™é¸ä¸" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11465,10 +11524,20 @@ msgid "Add Preload Node" msgstr "新增節點" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "由主幹新增節點" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11496,6 +11565,11 @@ msgstr "連到:" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "連到:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "連到:" @@ -11532,6 +11606,27 @@ msgid "Paste VisualScript Nodes" msgstr "貼上" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "åªé™é¸ä¸" + +#: modules/visual_script/visual_script_editor.cpp #, fuzzy msgid "Remove Function" msgstr "åªé™é¸ä¸" @@ -11559,16 +11654,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "行為" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11592,6 +11684,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "åªé™é¸ä¸" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "釿–°æ•´ç†" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "檔案" @@ -11687,6 +11789,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "從列表é¸å–è¨å‚™" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11788,6 +11894,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp #, fuzzy msgid "Run in Browser" msgstr "ç€è¦½" @@ -12340,10 +12450,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12375,6 +12481,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Language" +#~ msgstr "語言" + #, fuzzy #~ msgid "Methods:" #~ msgstr "鏿“‡æ¨¡å¼" @@ -12476,9 +12585,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "無法新增資料夾" -#~ msgid "Select device from the list" -#~ msgstr "從列表é¸å–è¨å‚™" - #, fuzzy #~ msgid "Open Scene(s)" #~ msgstr "é–‹å•“å ´æ™¯" diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po index dbc8432108..e2d7adf9e7 100644 --- a/editor/translations/zh_TW.po +++ b/editor/translations/zh_TW.po @@ -383,6 +383,7 @@ msgstr "新增 %d 個動畫軌並æ’å…¥ç•«æ ¼ï¼Ÿ" #: editor/plugins/particles_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Create" msgstr "新增" @@ -527,16 +528,6 @@ msgstr "" msgid "Warning: Editing imported animation" msgstr "è¦å‘Šï¼šæ£åœ¨ç·¨è¼¯åŒ¯å…¥çš„å‹•ç•«" -#: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp -#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp -msgid "Select All" -msgstr "鏿“‡å…¨éƒ¨" - -#: editor/animation_track_editor.cpp -#, fuzzy -msgid "Select None" -msgstr "鏿“‡æ¨¡å¼" - #: editor/animation_track_editor.cpp #, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." @@ -681,7 +672,8 @@ msgid "Scale Ratio:" msgstr "縮放比例:" #: editor/animation_track_editor.cpp -msgid "Select tracks to copy:" +#, fuzzy +msgid "Select Tracks to Copy" msgstr "鏿“‡è¦è¤‡è£½çš„軌é“:" #: editor/animation_track_editor.cpp editor/editor_log.cpp @@ -693,6 +685,11 @@ msgstr "鏿“‡è¦è¤‡è£½çš„軌é“:" msgid "Copy" msgstr "複製" +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Select All/None" +msgstr "鏿“‡æ¨¡å¼" + #: editor/animation_track_editor_plugins.cpp #, fuzzy msgid "Add Audio Track Clip" @@ -1025,7 +1022,7 @@ msgid "Resource" msgstr "資æº" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp -#: editor/project_settings_editor.cpp editor/script_create_dialog.cpp +#: editor/project_settings_editor.cpp msgid "Path" msgstr "路徑" @@ -1516,7 +1513,8 @@ msgstr "新增 AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp -#: editor/plugins/animation_tree_editor_plugin.cpp scene/gui/file_dialog.cpp +#: editor/plugins/animation_tree_editor_plugin.cpp +#: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" msgstr "路徑:" @@ -1572,7 +1570,7 @@ msgstr "新增資料夾" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp -#: scene/gui/file_dialog.cpp +#: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" msgstr "å稱:" @@ -2003,6 +2001,7 @@ msgid "Class:" msgstr "Class:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp +#: editor/script_create_dialog.cpp msgid "Inherits:" msgstr "繼承:" @@ -3072,7 +3071,7 @@ msgstr "å±¬æ€§é¢æ¿" msgid "Expand Bottom Panel" msgstr "å±•é–‹åº•éƒ¨é¢æ¿" -#: editor/editor_node.cpp scene/resources/visual_shader.cpp +#: editor/editor_node.cpp msgid "Output" msgstr "輸出(output)" @@ -3313,6 +3312,11 @@ msgstr "鏿“‡ä¸€å€‹è¦–å£" msgid "New Script" msgstr "新建腳本" +#: editor/editor_properties.cpp editor/scene_tree_dock.cpp +#, fuzzy +msgid "Extend Script" +msgstr "開啟最近å˜å–" + #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "新建 %s" @@ -3340,14 +3344,6 @@ msgstr "粘貼" msgid "Convert To %s" msgstr "è½‰æ›æˆ..." -#: editor/editor_properties.cpp -#: editor/plugins/animation_blend_space_1d_editor.cpp -#: editor/plugins/animation_blend_space_2d_editor.cpp -#: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy -msgid "Open Editor" -msgstr "ç›¸ä¾æ€§ç·¨è¼¯å™¨" - #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" msgstr "é¸å®šçš„ç¯€é»žä¸æ˜¯è¦–å£!" @@ -4182,7 +4178,7 @@ msgstr "挿件å稱:" msgid "Subfolder:" msgstr "å資料夾:" -#: editor/plugin_config_dialog.cpp +#: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" msgstr "語言:" @@ -4329,6 +4325,13 @@ msgstr "點" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp +#, fuzzy +msgid "Open Editor" +msgstr "ç›¸ä¾æ€§ç·¨è¼¯å™¨" + +#: editor/plugins/animation_blend_space_1d_editor.cpp +#: editor/plugins/animation_blend_space_2d_editor.cpp +#: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy msgid "Open Animation Node" @@ -4695,7 +4698,6 @@ msgstr "å‹•ç•«å稱:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp -#: editor/script_create_dialog.cpp msgid "Error!" msgstr "錯誤ï¼" @@ -4871,6 +4873,8 @@ msgid "Current:" msgstr "ç•¶å‰ï¼š" #: editor/plugins/animation_tree_player_editor_plugin.cpp +#: editor/plugins/visual_shader_editor_plugin.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Add Input" msgstr "æ·»åŠ è¼¸å…¥" @@ -5084,6 +5088,10 @@ msgid "All" msgstr "全部" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "No results for \"%s\"." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy msgid "Import..." msgstr "å°Žå…¥" @@ -5384,22 +5392,28 @@ msgid "Ruler Mode" msgstr "縮放模å¼" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Toggle snapping." +#, fuzzy +msgid "Toggle smart snapping." msgstr "切æ›å¸é™„。" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/spatial_editor_plugin.cpp -msgid "Use Snap" +#, fuzzy +msgid "Use Smart Snap" msgstr "使用å¸é™„" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Snapping Options" -msgstr "å¸é™„é¸é …" +#, fuzzy +msgid "Toggle grid snapping." +msgstr "切æ›å¸é™„。" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Snap to Grid" -msgstr "å¸é™„åˆ°ç¶²æ ¼" +msgid "Use Grid Snap" +msgstr "ç¶²æ ¼å¸é™„" + +#: editor/plugins/canvas_item_editor_plugin.cpp +msgid "Snapping Options" +msgstr "å¸é™„é¸é …" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5501,8 +5515,8 @@ msgid "View" msgstr "視圖" #: editor/plugins/canvas_item_editor_plugin.cpp -#: editor/plugins/polygon_2d_editor_plugin.cpp -msgid "Show Grid" +#, fuzzy +msgid "Always Show Grid" msgstr "é¡¯ç¤ºç¶²æ ¼" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5775,6 +5789,10 @@ msgstr "åˆ‡æ›æ›²ç·šç›´ç·šåˆ‡ç·š" msgid "Hold Shift to edit tangents individually" msgstr "æŒ‰ä½ Shift éµå¯å–®ç¨ç·¨è¼¯åˆ‡ç·š" +#: editor/plugins/curve_editor_plugin.cpp +msgid "Right click to add point" +msgstr "" + #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" msgstr "渲染 GI Probe" @@ -6425,6 +6443,10 @@ msgid "Grid" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp +msgid "Show Grid" +msgstr "é¡¯ç¤ºç¶²æ ¼" + +#: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Configure Grid:" msgstr "" @@ -6481,6 +6503,7 @@ msgstr "" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp +#: modules/visual_script/visual_script_editor.cpp msgid "Type:" msgstr "" @@ -6591,6 +6614,11 @@ msgid "Find Next" msgstr "查找下一個" #: editor/plugins/script_editor_plugin.cpp +#: editor/plugins/script_text_editor.cpp +msgid "Find Previous" +msgstr "查找上一個" + +#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Filter scripts" msgstr "éŽæ¿¾æª”案..." @@ -6876,6 +6904,11 @@ msgstr "刪除" msgid "Cut" msgstr "剪切" +#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp +#: scene/gui/text_edit.cpp +msgid "Select All" +msgstr "鏿“‡å…¨éƒ¨" + #: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Delete Line" @@ -6938,10 +6971,6 @@ msgid "Auto Indent" msgstr "自動縮進" #: editor/plugins/script_text_editor.cpp -msgid "Find Previous" -msgstr "查找上一個" - -#: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Find in Files..." msgstr "åœ¨æª”ä¸æŸ¥æ‰¾..。" @@ -7275,6 +7304,11 @@ msgid "Freelook Speed Modifier" msgstr "自由視圖速度調節" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Freelook Slow Modifier" +msgstr "自由視圖速度調節" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7309,6 +7343,10 @@ msgid "Use Local Space" msgstr "本地空間模å¼ï¼ˆ%s)" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Use Snap" +msgstr "使用å¸é™„" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" msgstr "底部視圖" @@ -7549,6 +7587,11 @@ msgid "Simplification: " msgstr "簡化: " #: editor/plugins/sprite_editor_plugin.cpp +#, fuzzy +msgid "Shrink (Pixels): " +msgstr "擴展(åƒç´ ): " + +#: editor/plugins/sprite_editor_plugin.cpp msgid "Grow (Pixels): " msgstr "擴展(åƒç´ ): " @@ -8379,12 +8422,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Add input +" -msgstr "æ·»åŠ è¼¸å…¥" - -#: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Add output +" +msgid "Add Output" msgstr "æ·»åŠ è¼¸å…¥" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8402,6 +8440,10 @@ msgid "Boolean" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Sampler" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Add input port" msgstr "æ·»åŠ è¼¸å…¥" @@ -9285,12 +9327,14 @@ msgstr "è¦è¼¸å‡ºçš„資æº:" #: editor/project_export.cpp msgid "" -"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)" +"Filters to export non-resource files/folders\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp msgid "" -"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)" +"Filters to exclude files/folders from project\n" +"(comma-separated, e.g: *.json, *.txt, docs/*)" msgstr "" #: editor/project_export.cpp @@ -10324,11 +10368,9 @@ msgid "" msgstr "" #: editor/scene_tree_dock.cpp -msgid "Editable Children" -msgstr "" - -#: editor/scene_tree_dock.cpp -msgid "Load As Placeholder" +msgid "" +"Enabling \"Load As Placeholder\" will disable \"Editable Children\" and " +"cause all properties of the node to be reverted to their default." msgstr "" #: editor/scene_tree_dock.cpp @@ -10408,6 +10450,14 @@ msgid "Clear Inheritance" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Editable Children" +msgstr "" + +#: editor/scene_tree_dock.cpp +msgid "Load As Placeholder" +msgstr "" + +#: editor/scene_tree_dock.cpp #, fuzzy msgid "Open Documentation" msgstr "開啟最近å˜å–" @@ -10427,11 +10477,6 @@ msgstr "" #: editor/scene_tree_dock.cpp #, fuzzy -msgid "Extend Script" -msgstr "開啟最近å˜å–" - -#: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "新增 %s" @@ -10681,24 +10726,19 @@ msgid "Will load an existing script file." msgstr "讀å–ç¾å˜çš„ Bus é…置。" #: editor/script_create_dialog.cpp -msgid "Language" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Inherits" -msgstr "" - -#: editor/script_create_dialog.cpp -msgid "Class Name" -msgstr "" +#, fuzzy +msgid "Class Name:" +msgstr "Class:" #: editor/script_create_dialog.cpp -msgid "Template" -msgstr "" +#, fuzzy +msgid "Template:" +msgstr "移除範本" #: editor/script_create_dialog.cpp -msgid "Built-in Script" -msgstr "" +#, fuzzy +msgid "Built-in Script:" +msgstr "開啟最近å˜å–" #: editor/script_create_dialog.cpp msgid "Attach Node Script" @@ -11384,6 +11424,11 @@ msgid "Add Function" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Delete input port" +msgstr "刪除點" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" msgstr "" @@ -11392,6 +11437,26 @@ msgid "Add Signal" msgstr "" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Input Port" +msgstr "æ·»åŠ è¼¸å…¥" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Add Output Port" +msgstr "æ·»åŠ è¼¸å…¥" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Input Port" +msgstr "刪除點" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Remove Output Port" +msgstr "刪除點" + +#: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" msgstr "" @@ -11432,10 +11497,20 @@ msgid "Add Preload Node" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't drop nodes because script '%s' is not used in this scene." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "" +"Can't drop properties because script '%s' is not used in this scene.\n" +"Drop holding 'Shift' to just copy the signature." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" msgstr "" @@ -11463,6 +11538,11 @@ msgstr "連接..." #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Disconnect Nodes" +msgstr "連接..." + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Connect Node Data" msgstr "連接..." @@ -11496,6 +11576,27 @@ msgid "Paste VisualScript Nodes" msgstr "" #: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function with a function node." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Can't create function of nodes from nodes of multiple functions." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Select atleast one node with sequence port." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +msgid "Try to only have one sequence input in selection." +msgstr "" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Create Function" +msgstr "創建輪廓" + +#: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" msgstr "" @@ -11520,16 +11621,13 @@ msgid "Make Tool:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Base Type:" -msgstr "" - -#: modules/visual_script/visual_script_editor.cpp msgid "Members:" msgstr "" #: modules/visual_script/visual_script_editor.cpp -msgid "Available Nodes:" -msgstr "" +#, fuzzy +msgid "function_name" +msgstr "函數:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit its graph." @@ -11553,6 +11651,16 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp #, fuzzy +msgid "Make Function" +msgstr "函數:" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy +msgid "Refresh Graph" +msgstr "釿–°æ•´ç†" + +#: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Edit Member" msgstr "éŽæ¿¾æª”案..." @@ -11648,6 +11756,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export.cpp +msgid "Select device from the list" +msgstr "從清單ä¸é¸æ“‡è¨å‚™" + +#: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." msgstr "" @@ -11749,6 +11861,10 @@ msgid "Required icon is not specified in the preset." msgstr "" #: platform/javascript/export/export.cpp +msgid "Stop HTTP Server" +msgstr "" + +#: platform/javascript/export/export.cpp msgid "Run in Browser" msgstr "" @@ -12318,10 +12434,6 @@ msgid "" "texture to some node for display." msgstr "" -#: scene/resources/visual_shader.cpp -msgid "Input" -msgstr "" - #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12353,6 +12465,14 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Snap to Grid" +#~ msgstr "å¸é™„åˆ°ç¶²æ ¼" + +#, fuzzy +#~ msgid "Add input +" +#~ msgstr "æ·»åŠ è¼¸å…¥" + #~ msgid "Properties:" #~ msgstr "效能:" @@ -12508,9 +12628,6 @@ msgstr "" #~ msgid "Go to parent folder" #~ msgstr "無法新增資料夾" -#~ msgid "Select device from the list" -#~ msgstr "從清單ä¸é¸æ“‡è¨å‚™" - #, fuzzy #~ msgid "Open Scene(s)" #~ msgstr "é–‹å•Ÿå ´æ™¯" diff --git a/main/main.cpp b/main/main.cpp index fe0f5a0215..c34d3da618 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -44,7 +44,6 @@ #include "core/project_settings.h" #include "core/register_core_types.h" #include "core/script_debugger_local.h" -#include "core/script_debugger_remote.h" #include "core/script_language.h" #include "core/translation.h" #include "core/version.h" @@ -59,6 +58,7 @@ #include "main/tests/test_main.h" #include "modules/register_module_types.h" #include "platform/register_platform_apis.h" +#include "scene/debugger/script_debugger_remote.h" #include "scene/main/scene_tree.h" #include "scene/main/viewport.h" #include "scene/register_scene_types.h" @@ -1348,8 +1348,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) { ClassDB::set_current_api(ClassDB::API_NONE); //no more api is registered at this point - print_verbose("CORE API HASH: " + itos(ClassDB::get_api_hash(ClassDB::API_CORE))); - print_verbose("EDITOR API HASH: " + itos(ClassDB::get_api_hash(ClassDB::API_EDITOR))); + print_verbose("CORE API HASH: " + uitos(ClassDB::get_api_hash(ClassDB::API_CORE))); + print_verbose("EDITOR API HASH: " + uitos(ClassDB::get_api_hash(ClassDB::API_EDITOR))); MAIN_PRINT("Main: Done"); return OK; @@ -1423,8 +1423,6 @@ bool Main::start() { } } - GLOBAL_DEF("editor/active", editor); - String main_loop_type; #ifdef TOOLS_ENABLED if (doc_tool != "") { @@ -1583,6 +1581,12 @@ bool Main::start() { if (!project_manager && !editor) { // game if (game_path != "" || script != "") { + if (script_debugger && script_debugger->is_remote()) { + ScriptDebuggerRemote *remote_debugger = static_cast<ScriptDebuggerRemote *>(script_debugger); + + remote_debugger->set_scene_tree(sml); + } + //autoload List<PropertyInfo> props; ProjectSettings::get_singleton()->get_property_list(&props); @@ -2160,6 +2164,5 @@ void Main::cleanup() { unregister_core_driver_types(); unregister_core_types(); - OS::get_singleton()->clear_last_error(); OS::get_singleton()->finalize_core(); } diff --git a/main/splash_editor.png b/main/splash_editor.png Binary files differindex 2967d8dd3e..8c605f0eed 100644 --- a/main/splash_editor.png +++ b/main/splash_editor.png diff --git a/main/tests/test_astar.cpp b/main/tests/test_astar.cpp index d34ff0d95e..4b60a3e94a 100644 --- a/main/tests/test_astar.cpp +++ b/main/tests/test_astar.cpp @@ -31,8 +31,10 @@ #include "test_astar.h" #include "core/math/a_star.h" +#include "core/math/math_funcs.h" #include "core/os/os.h" +#include <math.h> #include <stdio.h> namespace TestAStar { @@ -87,11 +89,268 @@ bool test_abcx() { return ok; } +bool test_add_remove() { + AStar a; + bool ok = true; + + // Manual tests + a.add_point(1, Vector3(0, 0, 0)); + a.add_point(2, Vector3(0, 1, 0)); + a.add_point(3, Vector3(1, 1, 0)); + a.add_point(4, Vector3(2, 0, 0)); + a.connect_points(1, 2, true); + a.connect_points(1, 3, true); + a.connect_points(1, 4, false); + + ok = ok && (a.are_points_connected(2, 1) == true); + ok = ok && (a.are_points_connected(4, 1) == true); + ok = ok && (a.are_points_connected(2, 1, false) == true); + ok = ok && (a.are_points_connected(4, 1, false) == false); + + a.disconnect_points(1, 2, true); + ok = ok && (a.get_point_connections(1).size() == 2); // 3, 4 + ok = ok && (a.get_point_connections(2).size() == 0); + + a.disconnect_points(4, 1, false); + ok = ok && (a.get_point_connections(1).size() == 2); // 3, 4 + ok = ok && (a.get_point_connections(4).size() == 0); + + a.disconnect_points(4, 1, true); + ok = ok && (a.get_point_connections(1).size() == 1); // 3 + ok = ok && (a.get_point_connections(4).size() == 0); + + a.connect_points(2, 3, false); + ok = ok && (a.get_point_connections(2).size() == 1); // 3 + ok = ok && (a.get_point_connections(3).size() == 1); // 1 + + a.connect_points(2, 3, true); + ok = ok && (a.get_point_connections(2).size() == 1); // 3 + ok = ok && (a.get_point_connections(3).size() == 2); // 1, 2 + + a.disconnect_points(2, 3, false); + ok = ok && (a.get_point_connections(2).size() == 0); + ok = ok && (a.get_point_connections(3).size() == 2); // 1, 2 + + a.connect_points(4, 3, true); + ok = ok && (a.get_point_connections(3).size() == 3); // 1, 2, 4 + ok = ok && (a.get_point_connections(4).size() == 1); // 3 + + a.disconnect_points(3, 4, false); + ok = ok && (a.get_point_connections(3).size() == 2); // 1, 2 + ok = ok && (a.get_point_connections(4).size() == 1); // 3 + + a.remove_point(3); + ok = ok && (a.get_point_connections(1).size() == 0); + ok = ok && (a.get_point_connections(2).size() == 0); + ok = ok && (a.get_point_connections(4).size() == 0); + + a.add_point(0, Vector3(0, -1, 0)); + a.add_point(3, Vector3(2, 1, 0)); + // 0: (0, -1) + // 1: (0, 0) + // 2: (0, 1) + // 3: (2, 1) + // 4: (2, 0) + + // Tests for get_closest_position_in_segment + a.connect_points(2, 3); + ok = ok && (a.get_closest_position_in_segment(Vector3(0.5, 0.5, 0)) == Vector3(0.5, 1, 0)); + + a.connect_points(3, 4); + a.connect_points(0, 3); + a.connect_points(1, 4); + a.disconnect_points(1, 4, false); + a.disconnect_points(4, 3, false); + a.disconnect_points(3, 4, false); + // Remaining edges: <2, 3>, <0, 3>, <1, 4> (directed) + ok = ok && (a.get_closest_position_in_segment(Vector3(2, 0.5, 0)) == Vector3(1.75, 0.75, 0)); + ok = ok && (a.get_closest_position_in_segment(Vector3(-1, 0.2, 0)) == Vector3(0, 0, 0)); + ok = ok && (a.get_closest_position_in_segment(Vector3(3, 2, 0)) == Vector3(2, 1, 0)); + + Math::seed(0); + + // Random tests for connectivity checks + for (int i = 0; i < 20000; i++) { + int u = Math::rand() % 5; + int v = Math::rand() % 4; + if (u == v) v = 4; + if (Math::rand() % 2 == 1) { + // Add a (possibly existing) directed edge and confirm connectivity + a.connect_points(u, v, false); + ok = ok && (a.are_points_connected(u, v, false) == true); + } else { + // Remove a (possibly nonexistent) directed edge and confirm disconnectivity + a.disconnect_points(u, v, false); + ok = ok && (a.are_points_connected(u, v, false) == false); + } + } + + // Random tests for point removal + for (int i = 0; i < 20000; i++) { + a.clear(); + for (int j = 0; j < 5; j++) + a.add_point(j, Vector3(0, 0, 0)); + + // Add or remove random edges + for (int j = 0; j < 10; j++) { + int u = Math::rand() % 5; + int v = Math::rand() % 4; + if (u == v) v = 4; + if (Math::rand() % 2 == 1) + a.connect_points(u, v, false); + else + a.disconnect_points(u, v, false); + } + + // Remove point 0 + a.remove_point(0); + // White box: this will check all edges remaining in the segments set + for (int j = 1; j < 5; j++) { + ok = ok && (a.are_points_connected(0, j, true) == false); + } + } + + // It's been great work, cheers \(^ ^)/ + return ok; +} + +bool test_solutions() { + // Random stress tests with Floyd-Warshall + + const int N = 30; + Math::seed(0); + + for (int test = 0; test < 1000; test++) { + AStar a; + Vector3 p[N]; + bool adj[N][N] = { { false } }; + + // Assign initial coordinates + for (int u = 0; u < N; u++) { + p[u].x = Math::rand() % 100; + p[u].y = Math::rand() % 100; + p[u].z = Math::rand() % 100; + a.add_point(u, p[u]); + } + + // Generate a random sequence of operations + for (int i = 0; i < 1000; i++) { + // Pick two different vertices + int u, v; + u = Math::rand() % N; + v = Math::rand() % (N - 1); + if (u == v) v = N - 1; + + // Pick a random operation + int op = Math::rand(); + switch (op % 9) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + // Add edge (u, v); possibly bidirectional + a.connect_points(u, v, op % 2); + adj[u][v] = true; + if (op % 2) adj[v][u] = true; + break; + case 6: + case 7: + // Remove edge (u, v); possibly bidirectional + a.disconnect_points(u, v, op % 2); + adj[u][v] = false; + if (op % 2) adj[v][u] = false; + break; + case 8: + // Remove point u and add it back; clears adjacent edges and changes coordinates + a.remove_point(u); + p[u].x = Math::rand() % 100; + p[u].y = Math::rand() % 100; + p[u].z = Math::rand() % 100; + a.add_point(u, p[u]); + for (v = 0; v < N; v++) + adj[u][v] = adj[v][u] = false; + break; + } + } + + // Floyd-Warshall + float d[N][N]; + for (int u = 0; u < N; u++) + for (int v = 0; v < N; v++) + d[u][v] = (u == v || adj[u][v]) ? p[u].distance_to(p[v]) : INFINITY; + + for (int w = 0; w < N; w++) + for (int u = 0; u < N; u++) + for (int v = 0; v < N; v++) + if (d[u][v] > d[u][w] + d[w][v]) + d[u][v] = d[u][w] + d[w][v]; + + // Display statistics + int count = 0; + for (int u = 0; u < N; u++) + for (int v = 0; v < N; v++) + if (adj[u][v]) count++; + printf("Test #%4d: %3d edges, ", test + 1, count); + count = 0; + for (int u = 0; u < N; u++) + for (int v = 0; v < N; v++) + if (!Math::is_inf(d[u][v])) count++; + printf("%3d/%d pairs of reachable points\n", count - N, N * (N - 1)); + + // Check A*'s output + bool match = true; + for (int u = 0; u < N; u++) + for (int v = 0; v < N; v++) + if (u != v) { + PoolVector<int> route = a.get_id_path(u, v); + if (!Math::is_inf(d[u][v])) { + // Reachable + if (route.size() == 0) { + printf("From %d to %d: A* did not find a path\n", u, v); + match = false; + goto exit; + } + float astar_dist = 0; + for (int i = 1; i < route.size(); i++) { + if (!adj[route[i - 1]][route[i]]) { + printf("From %d to %d: edge (%d, %d) does not exist\n", + u, v, route[i - 1], route[i]); + match = false; + goto exit; + } + astar_dist += p[route[i - 1]].distance_to(p[route[i]]); + } + if (!Math::is_equal_approx(astar_dist, d[u][v])) { + printf("From %d to %d: Floyd-Warshall gives %.6f, A* gives %.6f\n", + u, v, d[u][v], astar_dist); + match = false; + goto exit; + } + } else { + // Unreachable + if (route.size() > 0) { + printf("From %d to %d: A* somehow found a nonexistent path\n", u, v); + match = false; + goto exit; + } + } + } + + exit: + if (!match) return false; + } + return true; +} + typedef bool (*TestFunc)(void); TestFunc test_funcs[] = { test_abc, test_abcx, + test_add_remove, + test_solutions, NULL }; diff --git a/misc/travis/android-tools-linux.sh b/misc/travis/android-tools-linux.sh index fb6e2f0f9b..d0c123ee6c 100755 --- a/misc/travis/android-tools-linux.sh +++ b/misc/travis/android-tools-linux.sh @@ -24,12 +24,12 @@ ANDROID_SDK_URL=$ANDROID_BASE_URL/$ANDROID_SDK_FILENAME ANDROID_SDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_SDK_DIR ANDROID_SDK_SHA256=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9 -ANDROID_NDK_RELEASE=r18 +ANDROID_NDK_RELEASE=r20 ANDROID_NDK_DIR=android-ndk ANDROID_NDK_FILENAME=android-ndk-$ANDROID_NDK_RELEASE-linux-x86_64.zip ANDROID_NDK_URL=$ANDROID_BASE_URL/$ANDROID_NDK_FILENAME ANDROID_NDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_NDK_DIR -ANDROID_NDK_SHA1=2ac2e8e1ef73ed551cac3a1479bb28bd49369212 +ANDROID_NDK_SHA1=8665fc84a1b1f0d6ab3b5fdd1e30200cc7b9adff echo echo "Download and install Android development tools ..." @@ -70,12 +70,13 @@ if [ ! -d $ANDROID_NDK_DIR ]; then echo fi -echo "Installing: Android Tools ..." mkdir -p ~/.android && echo "count=0" > ~/.android/repositories.cfg +echo "Installing: Accepting Licenses ..." yes | $ANDROID_SDK_DIR/tools/bin/sdkmanager --licenses > /dev/null +echo "Installing: Android Build and Platform Tools ..." yes | $ANDROID_SDK_DIR/tools/bin/sdkmanager 'tools' > /dev/null yes | $ANDROID_SDK_DIR/tools/bin/sdkmanager 'platform-tools' > /dev/null -yes | $ANDROID_SDK_DIR/tools/bin/sdkmanager 'build-tools;28.0.1' > /dev/null +yes | $ANDROID_SDK_DIR/tools/bin/sdkmanager 'build-tools;28.0.3' > /dev/null echo EXPORT_VAL="export ANDROID_HOME=$ANDROID_SDK_PATH" diff --git a/misc/travis/android-tools-osx.sh b/misc/travis/android-tools-osx.sh deleted file mode 100755 index 96125a3a3f..0000000000 --- a/misc/travis/android-tools-osx.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash - -# SDK -# https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip -# SHA-256 4a81754a760fce88cba74d69c364b05b31c53d57b26f9f82355c61d5fe4b9df9 -# latest version available here: https://developer.android.com/studio/index.html - -# NDK -# https://dl.google.com/android/repository/android-ndk-r15c-darwin-x86_64.zip -# SHA-1 ea4b5d76475db84745aa8828000d009625fc1f98 -# latest version available here: https://developer.android.com/ndk/downloads/index.html - -BASH_RC=~/.bashrc -GODOT_BUILD_TOOLS_PATH=./godot-dev/build-tools -mkdir -p $GODOT_BUILD_TOOLS_PATH -cd $GODOT_BUILD_TOOLS_PATH - -ANDROID_BASE_URL=http://dl.google.com/android/repository - -ANDROID_SDK_RELEASE=3859397 -ANDROID_SDK_DIR=android-sdk -ANDROID_SDK_FILENAME=sdk-tools-darwin-$ANDROID_SDK_RELEASE.zip -ANDROID_SDK_URL=$ANDROID_BASE_URL/$ANDROID_SDK_FILENAME -ANDROID_SDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_SDK_DIR -ANDROID_SDK_SHA256=4a81754a760fce88cba74d69c364b05b31c53d57b26f9f82355c61d5fe4b9df9 - -ANDROID_NDK_RELEASE=r15c -ANDROID_NDK_DIR=android-ndk -ANDROID_NDK_FILENAME=android-ndk-$ANDROID_NDK_RELEASE-darwin-x86_64.zip -ANDROID_NDK_URL=$ANDROID_BASE_URL/$ANDROID_NDK_FILENAME -ANDROID_NDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_NDK_DIR -ANDROID_NDK_SHA1=ea4b5d76475db84745aa8828000d009625fc1f98 - -echo -echo "Download and install Android development tools ..." -echo - -if [ ! -e $ANDROID_SDK_FILENAME ]; then - echo "Downloading: Android SDK ..." - curl -L -O $ANDROID_SDK_URL -else - echo $ANDROID_SDK_SHA1 $ANDROID_SDK_FILENAME > $ANDROID_SDK_FILENAME.sha1 - if [ $(shasum -a 256 < $ANDROID_SDK_FILENAME | awk '{print $1;}') != $ANDROID_SDK_SHA1 ]; then - echo "Downloading: Android SDK ..." - curl -L -O $ANDROID_SDK_URL - fi -fi - -if [ ! -d $ANDROID_SDK_DIR ]; then - echo "Extracting: Android SDK ..." - mkdir -p $ANDROID_SDK_DIR && tar -xf $ANDROID_SDK_FILENAME -C $ANDROID_SDK_DIR - echo -fi - -if [ ! -e $ANDROID_NDK_FILENAME ]; then - echo "Downloading: Android NDK ..." - curl -L -O $ANDROID_NDK_URL -else - echo $ANDROID_NDK_MD5 $ANDROID_NDK_FILENAME > $ANDROID_NDK_FILENAME.md5 - if [ $(shasum -a 1 < $ANDROID_NDK_FILENAME | awk '{print $1;}') != $ANDROID_NDK_SHA1 ]; then - echo "Downloading: Android NDK ..." - curl -L -O $ANDROID_NDK_URL - fi -fi - -if [ ! -d $ANDROID_NDK_DIR ]; then - echo "Extracting: Android NDK ..." - tar -xf $ANDROID_NDK_FILENAME - mv android-ndk-$ANDROID_NDK_RELEASE $ANDROID_NDK_DIR - echo -fi - -echo "Installing: Android Tools ..." -#$ANDROID_SDK_DIR/tools/bin/sdkmanager --all -yes | $ANDROID_SDK_DIR/tools/bin/sdkmanager --licenses > /dev/null -$ANDROID_SDK_DIR/tools/bin/sdkmanager 'tools' > /dev/null -$ANDROID_SDK_DIR/tools/bin/sdkmanager 'platform-tools' > /dev/null -$ANDROID_SDK_DIR/tools/bin/sdkmanager 'build-tools;26.0.2' > /dev/null -echo - -EXPORT_VAL="export ANDROID_HOME=$ANDROID_SDK_PATH" -if ! grep -q "^$EXPORT_VAL" $BASH_RC; then - echo $EXPORT_VAL >> $BASH_RC -fi -#eval $EXPORT_VAL - -EXPORT_VAL="export ANDROID_NDK_ROOT=$ANDROID_NDK_PATH" -if ! grep -q "^$EXPORT_VAL" $BASH_RC; then - echo $EXPORT_VAL >> $BASH_RC -fi -#eval $EXPORT_VAL - -EXPORT_VAL="export PATH=$PATH:$ANDROID_SDK_PATH/tools" -if ! grep -q "^export PATH=.*$ANDROID_SDK_PATH/tools.*" $BASH_RC; then - echo $EXPORT_VAL >> $BASH_RC -fi -#eval $EXPORT_VAL - -EXPORT_VAL="export PATH=$PATH:$ANDROID_SDK_PATH/tools/bin" -if ! grep -q "^export PATH=.*$ANDROID_SDK_PATH/tools/bin.*" $BASH_RC; then - echo $EXPORT_VAL >> $BASH_RC -fi -#eval $EXPORT_VAL - -echo -echo "Done!" -echo diff --git a/modules/assimp/SCsub b/modules/assimp/SCsub index 275f1ff5e9..5e66b50de3 100644 --- a/modules/assimp/SCsub +++ b/modules/assimp/SCsub @@ -72,6 +72,9 @@ env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_X3D_IMPORTER']) env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF_IMPORTER']) env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF2_IMPORTER']) env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_SINGLETHREADED']) +env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_M3D_IMPORTER']) +env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MMD_IMPORTER']) + if(env['platform'] == 'windows'): env_assimp.Append(CPPDEFINES=['PLATFORM_WINDOWS']) diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index 1ea9399c02..3172d1e592 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -29,35 +29,42 @@ /*************************************************************************/ #include "editor_scene_importer_assimp.h" - -#include "core/bind/core_bind.h" #include "core/io/image_loader.h" -#include "editor/editor_file_system.h" -#include "editor/editor_settings.h" #include "editor/import/resource_importer_scene.h" #include "import_utils.h" #include "scene/3d/camera.h" #include "scene/3d/light.h" #include "scene/3d/mesh_instance.h" -#include "scene/animation/animation_player.h" #include "scene/main/node.h" #include "scene/resources/material.h" #include "scene/resources/surface_tool.h" -#include <assimp/SceneCombiner.h> -#include <assimp/cexport.h> -#include <assimp/cimport.h> #include <assimp/matrix4x4.h> -#include <assimp/pbrmaterial.h> #include <assimp/postprocess.h> #include <assimp/scene.h> -#include <zutil.h> -#include <assimp/DefaultLogger.hpp> #include <assimp/Importer.hpp> #include <assimp/LogStream.hpp> -#include <assimp/Logger.hpp> #include <string> +// move into assimp +aiBone *get_bone_by_name(const aiScene *scene, aiString bone_name) { + for (unsigned int mesh_id = 0; mesh_id < scene->mNumMeshes; ++mesh_id) { + aiMesh *mesh = scene->mMeshes[mesh_id]; + + // iterate over all the bones on the mesh for this node only! + for (unsigned int boneIndex = 0; boneIndex < mesh->mNumBones; boneIndex++) { + + aiBone *bone = mesh->mBones[boneIndex]; + if (bone->mName == bone_name) { + printf("matched bone by name: %s\n", bone->mName.C_Str()); + return bone; + } + } + } + + return NULL; +} + void EditorSceneImporterAssimp::get_extensions(List<String> *r_extensions) const { const String import_setting_string = "filesystem/import/open_asset_import/"; @@ -69,18 +76,15 @@ void EditorSceneImporterAssimp::get_extensions(List<String> *r_extensions) const ImportFormat import = { exts, true }; import_format.insert("fbx", import); } - { - Vector<String> exts; - exts.push_back("pmx"); - ImportFormat import = { exts, true }; - import_format.insert("mmd", import); - } for (Map<String, ImportFormat>::Element *E = import_format.front(); E; E = E->next()) { - _register_project_setting_import(E->key(), import_setting_string, E->get().extensions, r_extensions, E->get().is_default); + _register_project_setting_import(E->key(), import_setting_string, E->get().extensions, r_extensions, + E->get().is_default); } } -void EditorSceneImporterAssimp::_register_project_setting_import(const String generic, const String import_setting_string, const Vector<String> &exts, List<String> *r_extensions, const bool p_enabled) const { +void EditorSceneImporterAssimp::_register_project_setting_import(const String generic, const String import_setting_string, + const Vector<String> &exts, List<String> *r_extensions, + const bool p_enabled) const { const String use_generic = "use_" + generic; _GLOBAL_DEF(import_setting_string + use_generic, p_enabled, true); if (ProjectSettings::get_singleton()->get(import_setting_string + use_generic)) { @@ -97,7 +101,8 @@ uint32_t EditorSceneImporterAssimp::get_import_flags() const { void EditorSceneImporterAssimp::_bind_methods() { } -Node *EditorSceneImporterAssimp::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err) { +Node *EditorSceneImporterAssimp::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, + List<String> *r_missing_deps, Error *r_err) { Assimp::Importer importer; std::wstring w_path = ProjectSettings::get_singleton()->globalize_path(p_path).c_str(); std::string s_path(w_path.begin(), w_path.end()); @@ -115,9 +120,11 @@ Node *EditorSceneImporterAssimp::import_scene(const String &p_path, uint32_t p_f //importer.SetPropertyFloat(AI_CONFIG_PP_DB_THRESHOLD, 1.0f); int32_t post_process_Steps = aiProcess_CalcTangentSpace | - aiProcess_GlobalScale | // imports models and listens to their file scale for CM to M conversions + aiProcess_GlobalScale | + // imports models and listens to their file scale for CM to M conversions //aiProcess_FlipUVs | - aiProcess_FlipWindingOrder | // very important for culling so that it is done in the correct order. + aiProcess_FlipWindingOrder | + // very important for culling so that it is done in the correct order. //aiProcess_DropNormals | //aiProcess_GenSmoothNormals | //aiProcess_JoinIdenticalVertices | @@ -132,16 +139,18 @@ Node *EditorSceneImporterAssimp::import_scene(const String &p_path, uint32_t p_f aiProcess_TransformUVCoords | aiProcess_FindInstances | //aiProcess_FixInfacingNormals | - aiProcess_ValidateDataStructure | + //aiProcess_ValidateDataStructure | aiProcess_OptimizeMeshes | + aiProcess_PopulateArmatureData | //aiProcess_OptimizeGraph | //aiProcess_Debone | // aiProcess_EmbedTextures | //aiProcess_SplitByBoneCount | 0; aiScene *scene = (aiScene *)importer.ReadFile(s_path.c_str(), post_process_Steps); - ERR_EXPLAIN(String("Open Asset Import failed to open: ") + String(importer.GetErrorString())); - ERR_FAIL_COND_V(scene == NULL, NULL); + + ERR_FAIL_COND_V_MSG(scene == NULL, NULL, String("Open Asset Import failed to open: ") + String(importer.GetErrorString())); + return _generate_scene(p_path, scene, p_flags, p_bake_fps, max_bone_weights); } @@ -158,7 +167,8 @@ struct EditorSceneImporterAssetImportInterpolate { float t2 = t * t; float t3 = t2 * t; - return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3); + return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 + + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3); } T bezier(T start, T control_1, T control_2, T end, float t) { @@ -200,7 +210,8 @@ struct EditorSceneImporterAssetImportInterpolate<Quat> { }; template <class T> -T EditorSceneImporterAssimp::_interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, float p_time, AssetImportAnimation::Interpolation p_interp) { +T EditorSceneImporterAssimp::_interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, float p_time, + AssetImportAnimation::Interpolation p_interp) { //could use binary search, worth it? int idx = -1; for (int i = 0; i < p_times.size(); i++) { @@ -272,48 +283,257 @@ T EditorSceneImporterAssimp::_interpolate_track(const Vector<float> &p_times, co ERR_FAIL_V(p_values[0]); } -Spatial *EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScene *scene, const uint32_t p_flags, int p_bake_fps, const int32_t p_max_bone_weights) { +aiBone *EditorSceneImporterAssimp::get_bone_from_stack(ImportState &state, aiString name) { + List<aiBone *>::Element *iter; + aiBone *bone = NULL; + for (iter = state.bone_stack.front(); iter; iter = iter->next()) { + bone = (aiBone *)iter->get(); + + if (bone && bone->mName == name) { + state.bone_stack.erase(bone); + return bone; + } + } + + return NULL; +} + +Spatial * +EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScene *scene, const uint32_t p_flags, int p_bake_fps, + const int32_t p_max_bone_weights) { ERR_FAIL_COND_V(scene == NULL, NULL); ImportState state; state.path = p_path; state.assimp_scene = scene; state.max_bone_weights = p_max_bone_weights; - state.root = memnew(Spatial); - state.fbx = false; state.animation_player = NULL; - //fill light map cache - for (size_t l = 0; l < scene->mNumLights; l++) { + // populate light map + for (unsigned int l = 0; l < scene->mNumLights; l++) { aiLight *ai_light = scene->mLights[l]; ERR_CONTINUE(ai_light == NULL); state.light_cache[AssimpUtils::get_assimp_string(ai_light->mName)] = l; } - //fill camera cache - for (size_t c = 0; c < scene->mNumCameras; c++) { + // fill camera cache + for (unsigned int c = 0; c < scene->mNumCameras; c++) { aiCamera *ai_camera = scene->mCameras[c]; ERR_CONTINUE(ai_camera == NULL); state.camera_cache[AssimpUtils::get_assimp_string(ai_camera->mName)] = c; } if (scene->mRootNode) { + state.nodes.push_back(scene->mRootNode); - //generate nodes - for (uint32_t i = 0; i < scene->mRootNode->mNumChildren; i++) { - _generate_node(state, NULL, scene->mRootNode->mChildren[i], state.root); + // make flat node tree - in order to make processing deterministic + for (unsigned int i = 0; i < scene->mRootNode->mNumChildren; i++) { + _generate_node(state, scene->mRootNode->mChildren[i]); } - // finalize skeleton - for (Map<Skeleton *, const Spatial *>::Element *key_value_pair = state.armature_skeletons.front(); key_value_pair; key_value_pair = key_value_pair->next()) { - Skeleton *skeleton = key_value_pair->key(); - // convert world to local for skeleton bone rests - skeleton->localize_rests(); + RegenerateBoneStack(state); + + Node *last_valid_parent = NULL; + + List<const aiNode *>::Element *iter; + for (iter = state.nodes.front(); iter; iter = iter->next()) { + const aiNode *element_assimp_node = iter->get(); + const aiNode *parent_assimp_node = element_assimp_node->mParent; + + String node_name = AssimpUtils::get_assimp_string(element_assimp_node->mName); + //print_verbose("node: " + node_name); + + Spatial *spatial = NULL; + Transform transform = AssimpUtils::assimp_matrix_transform(element_assimp_node->mTransformation); + + // retrieve this node bone + aiBone *bone = get_bone_from_stack(state, element_assimp_node->mName); + + if (state.light_cache.has(node_name)) { + spatial = create_light(state, node_name, transform); + } else if (state.camera_cache.has(node_name)) { + spatial = create_camera(state, node_name, transform); + } else if (state.armature_nodes.find(element_assimp_node)) { + // create skeleton + print_verbose("Making skeleton: " + node_name); + Skeleton *skeleton = memnew(Skeleton); + spatial = skeleton; + if (!state.armature_skeletons.has(element_assimp_node)) { + state.armature_skeletons.insert(element_assimp_node, skeleton); + } + } else if (bone != NULL) { + continue; + } else if (element_assimp_node->mNumMeshes > 0) { + spatial = memnew(Spatial); + } else { + spatial = memnew(Spatial); + } + + ERR_CONTINUE_MSG(spatial == NULL, "FBX Import - are we out of ram?"); + // we on purpose set the transform and name after creating the node. + + spatial->set_name(node_name); + spatial->set_global_transform(transform); + + // first element is root + if (iter == state.nodes.front()) { + state.root = spatial; + } + + // flat node map parent lookup tool + state.flat_node_map.insert(element_assimp_node, spatial); + + Map<const aiNode *, Spatial *>::Element *parent_lookup = state.flat_node_map.find(parent_assimp_node); + + // note: this always fails on the root node :) keep that in mind this is by design + if (parent_lookup) { + Spatial *parent_node = parent_lookup->value(); + + ERR_FAIL_COND_V_MSG(parent_node == NULL, state.root, + "Parent node invalid even though lookup successful, out of ram?") + + if (parent_node && spatial != state.root) { + parent_node->add_child(spatial); + spatial->set_owner(state.root); + } else if (spatial == state.root) { + // required - think about it root never has a parent yet is valid, anything else without a parent is not valid. + } else // Safety for instances + { + WARN_PRINT( + "Failed to find parent node instance after lookup, serious warning report to godot with model"); + memdelete(spatial); // this node is broken + } + } else if (spatial != state.root) { + // if the ainode is not in the tree + // parent it to the last good parent found + if (last_valid_parent) { + last_valid_parent->add_child(spatial); + spatial->set_owner(state.root); + } else { + // this is a serious error? + memdelete(spatial); + } + } + + // update last valid parent + last_valid_parent = spatial; + } + print_verbose("node counts: " + itos(state.nodes.size())); + + // make clean bone stack + RegenerateBoneStack(state); + + print_verbose("generating godot bone data"); + + print_verbose("Godot bone stack count: " + itos(state.bone_stack.size())); + + // This is a list of bones, duplicates are from other meshes and must be dealt with properly + for (List<aiBone *>::Element *element = state.bone_stack.front(); element; element = element->next()) { + aiBone *bone = element->get(); + + ERR_CONTINUE_MSG(!bone, "invalid bone read from assimp?"); + + // Utilities for armature lookup - for now only FBX makes these + aiNode *armature_for_bone = bone->mArmature; + + // Utilities for bone node lookup - for now only FBX makes these + aiNode *bone_node = bone->mNode; + aiNode *parent_node = bone_node->mParent; + + String bone_name = AssimpUtils::get_anim_string_from_assimp(bone->mName); + ERR_CONTINUE_MSG(armature_for_bone == NULL, "Armature for bone invalid: " + bone_name); + Skeleton *skeleton = state.armature_skeletons[armature_for_bone]; + + state.skeleton_bone_map[bone] = skeleton; + + if (bone_name.empty()) { + bone_name = "untitled_bone_name"; + WARN_PRINT("Untitled bone name detected... report with file please"); + } + + // todo: this is where skin support goes + if (skeleton && skeleton->find_bone(bone_name) == -1) { + print_verbose("[Godot Glue] Imported bone" + bone_name); + int boneIdx = skeleton->get_bone_count(); + + Transform pform = AssimpUtils::assimp_matrix_transform(bone->mNode->mTransformation); + skeleton->add_bone(bone_name); + skeleton->set_bone_rest(boneIdx, pform); + skeleton->set_bone_pose(boneIdx, pform); + + if (parent_node != NULL) { + int parent_bone_id = skeleton->find_bone(AssimpUtils::get_anim_string_from_assimp(parent_node->mName)); + int current_bone_id = boneIdx; + skeleton->set_bone_parent(current_bone_id, parent_bone_id); + } + } } print_verbose("generating mesh phase from skeletal mesh"); - generate_mesh_phase_from_skeletal_mesh(state); + + List<Spatial *> cleanup_template_nodes; + + for (Map<const aiNode *, Spatial *>::Element *key_value_pair = state.flat_node_map.front(); key_value_pair; key_value_pair = key_value_pair->next()) { + const aiNode *assimp_node = key_value_pair->key(); + Spatial *mesh_template = key_value_pair->value(); + Node *parent_node = mesh_template->get_parent(); + + ERR_CONTINUE(assimp_node == NULL); + ERR_CONTINUE(mesh_template == NULL); + + if (mesh_template == state.root) { + continue; + } + + if (parent_node == NULL) { + print_error("Found invalid parent node!"); + continue; // root node + } + + String node_name = AssimpUtils::get_assimp_string(assimp_node->mName); + Transform node_transform = AssimpUtils::assimp_matrix_transform(assimp_node->mTransformation); + + if (assimp_node->mNumMeshes > 0) { + MeshInstance *mesh = create_mesh(state, assimp_node, node_name, parent_node, node_transform); + if (mesh) { + + parent_node->remove_child(mesh_template); + + // re-parent children + List<Node *> children; + // re-parent all children to new node + // note: since get_child_count will change during execution we must build a list first to be safe. + for (int childId = 0; childId < mesh_template->get_child_count(); childId++) { + // get child + Node *child = mesh_template->get_child(childId); + children.push_back(child); + } + + for (List<Node *>::Element *element = children.front(); element; element = element->next()) { + // reparent the children to the real mesh node. + mesh_template->remove_child(element->get()); + mesh->add_child(element->get()); + element->get()->set_owner(state.root); + } + + // update mesh in list so that each mesh node is available + // this makes the template unavailable which is the desired behaviour + state.flat_node_map[assimp_node] = mesh; + + cleanup_template_nodes.push_back(mesh_template); + + // clean up this list we don't need it + children.clear(); + } + } + } + + for (List<Spatial *>::Element *element = cleanup_template_nodes.front(); element; element = element->next()) { + if (element->get()) { + memdelete(element->get()); + } + } } if (p_flags & IMPORT_ANIMATION && scene->mNumAnimations) { @@ -327,29 +547,39 @@ Spatial *EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScen } } + // + // Cleanup operations + // + + state.mesh_cache.clear(); + state.material_cache.clear(); + state.light_cache.clear(); + state.camera_cache.clear(); + state.assimp_node_map.clear(); + state.path_to_image_cache.clear(); + state.nodes.clear(); + state.flat_node_map.clear(); + state.armature_skeletons.clear(); + state.bone_stack.clear(); return state.root; } -void EditorSceneImporterAssimp::_insert_animation_track(ImportState &scene, const aiAnimation *assimp_anim, int p_track, int p_bake_fps, Ref<Animation> animation, float ticks_per_second, Skeleton *p_skeleton, const NodePath &p_path, const String &p_name) { - - const aiNodeAnim *assimp_track = assimp_anim->mChannels[p_track]; +void EditorSceneImporterAssimp::_insert_animation_track(ImportState &scene, const aiAnimation *assimp_anim, int track_id, + int anim_fps, Ref<Animation> animation, float ticks_per_second, + Skeleton *skeleton, const NodePath &node_path, + const String &node_name, aiBone *track_bone) { + const aiNodeAnim *assimp_track = assimp_anim->mChannels[track_id]; //make transform track int track_idx = animation->get_track_count(); animation->add_track(Animation::TYPE_TRANSFORM); - animation->track_set_path(track_idx, p_path); + animation->track_set_path(track_idx, node_path); //first determine animation length - float increment = 1.0 / float(p_bake_fps); + float increment = 1.0 / float(anim_fps); float time = 0.0; bool last = false; - int skeleton_bone = -1; - - if (p_skeleton) { - skeleton_bone = p_skeleton->find_bone(p_name); - } - Vector<Vector3> pos_values; Vector<float> pos_times; Vector<Vector3> scale_values; @@ -374,6 +604,7 @@ void EditorSceneImporterAssimp::_insert_animation_track(ImportState &scene, cons scale_values.push_back(Vector3(scale.x, scale.y, scale.z)); scale_times.push_back(assimp_track->mScalingKeys[sc].mTime / ticks_per_second); } + while (true) { Vector3 pos; Quat rot; @@ -384,26 +615,34 @@ void EditorSceneImporterAssimp::_insert_animation_track(ImportState &scene, cons } if (rot_values.size()) { - rot = _interpolate_track<Quat>(rot_times, rot_values, time, AssetImportAnimation::INTERP_LINEAR).normalized(); + rot = _interpolate_track<Quat>(rot_times, rot_values, time, + AssetImportAnimation::INTERP_LINEAR) + .normalized(); } if (scale_values.size()) { scale = _interpolate_track<Vector3>(scale_times, scale_values, time, AssetImportAnimation::INTERP_LINEAR); } - if (skeleton_bone >= 0) { - Transform xform; - xform.basis.set_quat_scale(rot, scale); - xform.origin = pos; + if (skeleton) { + int skeleton_bone = skeleton->find_bone(node_name); - Transform rest_xform = p_skeleton->get_bone_rest(skeleton_bone); - xform = rest_xform.affine_inverse() * xform; - rot = xform.basis.get_rotation_quat(); - scale = xform.basis.get_scale(); - pos = xform.origin; - } + if (skeleton_bone >= 0 && track_bone) { + + Transform xform; + xform.basis.set_quat_scale(rot, scale); + xform.origin = pos; + + xform = skeleton->get_bone_pose(skeleton_bone).inverse() * xform; - rot.normalize(); + rot = xform.basis.get_rotation_quat(); + rot.normalize(); + scale = xform.basis.get_scale(); + pos = xform.origin; + } else { + ERR_FAIL_MSG("Skeleton bone lookup failed for skeleton: " + skeleton->get_name()); + } + } animation->track_set_interpolation_type(track_idx, Animation::INTERPOLATION_LINEAR); animation->transform_track_insert_key(track_idx, time, pos, rot, scale); @@ -418,6 +657,53 @@ void EditorSceneImporterAssimp::_insert_animation_track(ImportState &scene, cons } } +// I really do not like this but need to figure out a better way of removing it later. +Node *EditorSceneImporterAssimp::get_node_by_name(ImportState &state, String name) { + for (Map<const aiNode *, Spatial *>::Element *key_value_pair = state.flat_node_map.front(); key_value_pair; key_value_pair = key_value_pair->next()) { + const aiNode *assimp_node = key_value_pair->key(); + Spatial *node = key_value_pair->value(); + + String node_name = AssimpUtils::get_assimp_string(assimp_node->mName); + if (name == node_name && node) { + return node; + } + } + return NULL; +} + +/* Bone stack is a fifo handler for multiple armatures since armatures aren't a thing in assimp (yet) */ +void EditorSceneImporterAssimp::RegenerateBoneStack(ImportState &state) { + + state.bone_stack.clear(); + // build bone stack list + for (unsigned int mesh_id = 0; mesh_id < state.assimp_scene->mNumMeshes; ++mesh_id) { + aiMesh *mesh = state.assimp_scene->mMeshes[mesh_id]; + + // iterate over all the bones on the mesh for this node only! + for (unsigned int boneIndex = 0; boneIndex < mesh->mNumBones; boneIndex++) { + aiBone *bone = mesh->mBones[boneIndex]; + + // doubtful this is required right now but best to check + if (!state.bone_stack.find(bone)) { + //print_verbose("[assimp] bone stack added: " + String(bone->mName.C_Str()) ); + state.bone_stack.push_back(bone); + } + } + } +} + +/* Bone stack is a fifo handler for multiple armatures since armatures aren't a thing in assimp (yet) */ +void EditorSceneImporterAssimp::RegenerateBoneStack(ImportState &state, aiMesh *mesh) { + state.bone_stack.clear(); + // iterate over all the bones on the mesh for this node only! + for (unsigned int boneIndex = 0; boneIndex < mesh->mNumBones; boneIndex++) { + aiBone *bone = mesh->mBones[boneIndex]; + if (state.bone_stack.find(bone) == NULL) { + state.bone_stack.push_back(bone); + } + } +} + // animation tracks are per bone void EditorSceneImporterAssimp::_import_animation(ImportState &state, int p_animation_index, int p_bake_fps) { @@ -429,7 +715,7 @@ void EditorSceneImporterAssimp::_import_animation(ImportState &state, int p_anim if (name == String()) { name = "Animation " + itos(p_animation_index + 1); } - + print_verbose("import animation: " + name); float ticks_per_second = anim->mTicksPerSecond; if (state.assimp_scene->mMetaData != NULL && Math::is_equal_approx(ticks_per_second, 0.0f)) { @@ -452,34 +738,60 @@ void EditorSceneImporterAssimp::_import_animation(ImportState &state, int p_anim animation->set_name(name); animation->set_length(anim->mDuration / ticks_per_second); - //regular tracks + // generate bone stack for animation import + RegenerateBoneStack(state); + //regular tracks for (size_t i = 0; i < anim->mNumChannels; i++) { const aiNodeAnim *track = anim->mChannels[i]; String node_name = AssimpUtils::get_assimp_string(track->mNodeName); - + print_verbose("track name import: " + node_name); if (track->mNumRotationKeys == 0 && track->mNumPositionKeys == 0 && track->mNumScalingKeys == 0) { continue; //do not bother } - for (Map<Skeleton *, const Spatial *>::Element *key_value_pair = state.armature_skeletons.front(); key_value_pair; key_value_pair = key_value_pair->next()) { - Skeleton *skeleton = key_value_pair->key(); - - bool is_bone = skeleton->find_bone(node_name) != -1; - //print_verbose("Bone " + node_name + " is bone? " + (is_bone ? "Yes" : "No")); - NodePath node_path; + Skeleton *skeleton = NULL; + NodePath node_path; + aiBone *bone = NULL; - if (is_bone) { - String path = state.root->get_path_to(skeleton); - path += ":" + node_name; - node_path = path; - } else { - ERR_CONTINUE(!state.node_map.has(node_name)); - Node *node = state.node_map[node_name]; - node_path = state.root->get_path_to(node); + // Import skeleton bone animation for this track + // Any bone will do, no point in processing more than just what is in the skeleton + { + bone = get_bone_from_stack(state, track->mNodeName); + + if (bone) { + // get skeleton by bone + skeleton = state.armature_skeletons[bone->mArmature]; + + if (skeleton) { + String path = state.root->get_path_to(skeleton); + path += ":" + node_name; + node_path = path; + + if (node_path != NodePath()) { + _insert_animation_track(state, anim, i, p_bake_fps, animation, ticks_per_second, skeleton, + node_path, node_name, bone); + } else { + print_error("Failed to find valid node path for animation"); + } + } } + } - _insert_animation_track(state, anim, i, p_bake_fps, animation, ticks_per_second, skeleton, node_path, node_name); + // not a bone + // note this is flaky it uses node names which is unreliable + Node *allocated_node = get_node_by_name(state, node_name); + // todo: implement skeleton grabbing for node based animations too :) + // check if node exists, if it does then also apply animation track for node and bones above are all handled. + // this is now inclusive animation handling so that + // we import all the data and do not miss anything. + if (allocated_node) { + node_path = state.root->get_path_to(allocated_node); + + if (node_path != NodePath()) { + _insert_animation_track(state, anim, i, p_bake_fps, animation, ticks_per_second, skeleton, + node_path, node_name, nullptr); + } } } @@ -494,10 +806,9 @@ void EditorSceneImporterAssimp::_import_animation(ImportState &state, int p_anim ERR_CONTINUE(prop_name.split("*").size() != 2); - ERR_CONTINUE(!state.node_map.has(mesh_name)); - - const MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(state.node_map[mesh_name]); - + Node *item = get_node_by_name(state, mesh_name); + ERR_CONTINUE_MSG(!item, "failed to look up node by name"); + const MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(item); ERR_CONTINUE(mesh_instance == NULL); String base_path = state.root->get_path_to(mesh_instance); @@ -528,15 +839,13 @@ void EditorSceneImporterAssimp::_import_animation(ImportState &state, int p_anim state.animation_player->add_animation(name, animation); } } - // // Mesh Generation from indices ? why do we need so much mesh code // [debt needs looked into] -Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( - ImportState &state, - const Vector<int> &p_surface_indices, - const aiNode *assimp_node, - Skeleton *p_skeleton) { +Ref<Mesh> +EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &state, const Vector<int> &p_surface_indices, + const aiNode *assimp_node, Ref<Skin> &skin, + Skeleton *&skeleton_assigned) { Ref<ArrayMesh> mesh; mesh.instance(); @@ -548,7 +857,6 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( const unsigned int mesh_idx = p_surface_indices[0]; const aiMesh *ai_mesh = state.assimp_scene->mMeshes[mesh_idx]; for (size_t j = 0; j < ai_mesh->mNumAnimMeshes; j++) { - String ai_anim_mesh_name = AssimpUtils::get_assimp_string(ai_mesh->mAnimMeshes[j]->mName); if (!morph_mesh_string_lookup.has(ai_anim_mesh_name)) { morph_mesh_string_lookup.insert(ai_anim_mesh_name, j); @@ -560,7 +868,6 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( } } } - // // Process Vertex Weights // @@ -570,19 +877,30 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( Map<uint32_t, Vector<BoneInfo> > vertex_weights; - if (p_skeleton) { + if (ai_mesh->mNumBones > 0) { for (size_t b = 0; b < ai_mesh->mNumBones; b++) { aiBone *bone = ai_mesh->mBones[b]; - String bone_name = AssimpUtils::get_assimp_string(bone->mName); - int bone_index = p_skeleton->find_bone(bone_name); - ERR_CONTINUE(bone_index == -1); //bone refers to an unexisting index, wtf. + if (!skeleton_assigned) { + print_verbose("Assigned mesh skeleton during mesh creation"); + skeleton_assigned = state.skeleton_bone_map[bone]; + + if (!skin.is_valid()) { + print_verbose("Configured new skin"); + skin.instance(); + } else { + print_verbose("Reusing existing skin!"); + } + } + // skeleton_assigned = + String bone_name = AssimpUtils::get_assimp_string(bone->mName); + int bone_index = skeleton_assigned->find_bone(bone_name); + ERR_CONTINUE(bone_index == -1); for (size_t w = 0; w < bone->mNumWeights; w++) { aiVertexWeight ai_weights = bone->mWeights[w]; BoneInfo bi; - uint32_t vertex_index = ai_weights.mVertexId; bi.bone = bone_index; bi.weight = ai_weights.mWeight; @@ -619,7 +937,8 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( // Assign vertex colors if (ai_mesh->HasVertexColors(0)) { - Color color = Color(ai_mesh->mColors[0]->r, ai_mesh->mColors[0]->g, ai_mesh->mColors[0]->b, ai_mesh->mColors[0]->a); + Color color = Color(ai_mesh->mColors[0]->r, ai_mesh->mColors[0]->g, ai_mesh->mColors[0]->b, + ai_mesh->mColors[0]->a); st->add_color(color); } @@ -685,6 +1004,8 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( if (AI_SUCCESS == ai_material->Get(AI_MATKEY_TWOSIDED, mat_two_sided)) { if (mat_two_sided > 0) { mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); + } else { + mat->set_cull_mode(SpatialMaterial::CULL_BACK); } } @@ -697,7 +1018,7 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( // Culling handling for meshes // cull all back faces - mat->set_cull_mode(SpatialMaterial::CULL_BACK); + mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); // Now process materials aiTextureType base_color = aiTextureType_BASE_COLOR; @@ -712,7 +1033,8 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( if (image_data.raw_image->detect_alpha() != Image::ALPHA_NONE) { mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); mat->set_depth_draw_mode(SpatialMaterial::DepthDrawMode::DEPTH_DRAW_ALPHA_OPAQUE_PREPASS); - mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); // since you can see both sides in transparent mode + mat->set_cull_mode( + SpatialMaterial::CULL_DISABLED); // since you can see both sides in transparent mode } mat->set_texture(SpatialMaterial::TEXTURE_ALBEDO, image_data.texture); @@ -731,7 +1053,8 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( if (image_data.raw_image->detect_alpha() != Image::ALPHA_NONE) { mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); mat->set_depth_draw_mode(SpatialMaterial::DepthDrawMode::DEPTH_DRAW_ALPHA_OPAQUE_PREPASS); - mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); // since you can see both sides in transparent mode + mat->set_cull_mode( + SpatialMaterial::CULL_DISABLED); // since you can see both sides in transparent mode } mat->set_texture(SpatialMaterial::TEXTURE_ALBEDO, image_data.texture); @@ -742,7 +1065,8 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( if (Math::is_equal_approx(clr_diffuse.a, 1.0f) == false) { mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); mat->set_depth_draw_mode(SpatialMaterial::DepthDrawMode::DEPTH_DRAW_ALPHA_OPAQUE_PREPASS); - mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); // since you can see both sides in transparent mode + mat->set_cull_mode( + SpatialMaterial::CULL_DISABLED); // since you can see both sides in transparent mode } mat->set_albedo(Color(clr_diffuse.r, clr_diffuse.g, clr_diffuse.b, clr_diffuse.a)); } @@ -838,7 +1162,8 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( } else { // Process emission textures aiString texture_emissive_path; - if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_EMISSION_TEXTURE, AI_PROPERTIES, texture_emissive_path)) { + if (AI_SUCCESS == + ai_material->Get(AI_MATKEY_FBX_MAYA_EMISSION_TEXTURE, AI_PROPERTIES, texture_emissive_path)) { if (AssimpUtils::CreateAssimpTexture(state, texture_emissive_path, filename, path, image_data)) { mat->set_feature(SpatialMaterial::FEATURE_EMISSION, true); mat->set_texture(SpatialMaterial::TEXTURE_EMISSION, image_data.texture); @@ -981,62 +1306,27 @@ Ref<Mesh> EditorSceneImporterAssimp::_generate_mesh_from_surface_indices( return mesh; } -/* to be moved into assimp */ -aiBone *get_bone_by_name(const aiScene *scene, aiString bone_name) { - for (unsigned int mesh_id = 0; mesh_id < scene->mNumMeshes; ++mesh_id) { - aiMesh *mesh = scene->mMeshes[mesh_id]; - - // iterate over all the bones on the mesh for this node only! - for (unsigned int boneIndex = 0; boneIndex < mesh->mNumBones; boneIndex++) { - - aiBone *bone = mesh->mBones[boneIndex]; - if (bone->mName == bone_name) { - printf("matched bone by name: %s\n", bone->mName.C_Str()); - return bone; - } - } - } - - return NULL; -} - /** * Create a new mesh for the node supplied */ -void EditorSceneImporterAssimp::create_mesh(ImportState &state, const aiNode *assimp_node, const String &node_name, Node *current_node, Node *parent_node, Transform node_transform) { +MeshInstance * +EditorSceneImporterAssimp::create_mesh(ImportState &state, const aiNode *assimp_node, const String &node_name, Node *active_node, Transform node_transform) { /* MESH NODE */ Ref<Mesh> mesh; - Skeleton *skeleton = NULL; + Ref<Skin> skin; // see if we have mesh cache for this. Vector<int> surface_indices; - for (uint32_t i = 0; i < assimp_node->mNumMeshes; i++) { - int mesh_index = assimp_node->mMeshes[i]; - aiMesh *ai_mesh = state.assimp_scene->mMeshes[assimp_node->mMeshes[i]]; - - // Map<aiBone*, Skeleton*> // this is what we need - if (ai_mesh->mNumBones > 0) { - // we only need the first bone to retrieve the skeleton - const aiBone *first = ai_mesh->mBones[0]; - - ERR_FAIL_COND(first == NULL); - Map<const aiBone *, Skeleton *>::Element *match = state.bone_to_skeleton_lookup.find(first); - if (match != NULL) { - skeleton = match->value(); + RegenerateBoneStack(state); - if (skeleton == NULL) { - print_error("failed to find bone skeleton for bone: " + AssimpUtils::get_assimp_string(first->mName)); - } else { - print_verbose("successfully found skeleton for first bone on mesh, can properly handle animations now!"); - } - // I really need the skeleton and bone to be known as this is something flaky in model exporters. - ERR_FAIL_COND(skeleton == NULL); // should not happen if bone was successfully created in previous step. - } - } + // Configure indicies + for (uint32_t i = 0; i < assimp_node->mNumMeshes; i++) { + int mesh_index = assimp_node->mMeshes[i]; + // create list of mesh indexes surface_indices.push_back(mesh_index); } - surface_indices.sort(); + //surface_indices.sort(); String mesh_key; for (int i = 0; i < surface_indices.size(); i++) { if (i > 0) { @@ -1045,262 +1335,154 @@ void EditorSceneImporterAssimp::create_mesh(ImportState &state, const aiNode *as mesh_key += itos(surface_indices[i]); } + Skeleton *skeleton = NULL; + aiNode *armature = NULL; + if (!state.mesh_cache.has(mesh_key)) { - mesh = _generate_mesh_from_surface_indices(state, surface_indices, assimp_node, skeleton); + mesh = _generate_mesh_from_surface_indices(state, surface_indices, assimp_node, skin, skeleton); state.mesh_cache[mesh_key] = mesh; } - //Transform transform = recursive_state.node_transform; - - // we must unfortunately overwrite mesh and skeleton transform with armature data - if (skeleton != NULL) { - print_verbose("Applying mesh and skeleton to armature"); - // required for blender, maya etc - Map<Skeleton *, const Spatial *>::Element *match = state.armature_skeletons.find(skeleton); - node_transform = match->value()->get_transform(); - } - MeshInstance *mesh_node = memnew(MeshInstance); mesh = state.mesh_cache[mesh_key]; mesh_node->set_mesh(mesh); - attach_new_node(state, - mesh_node, - assimp_node, - parent_node, - node_name, - node_transform); - - // set this once and for all - if (skeleton != NULL) { - // root must be informed of its new child - parent_node->add_child(skeleton); + // if we have a valid skeleton set it up + if (skin.is_valid()) { + for (uint32_t i = 0; i < assimp_node->mNumMeshes; i++) { + unsigned int mesh_index = assimp_node->mMeshes[i]; + const aiMesh *ai_mesh = state.assimp_scene->mMeshes[mesh_index]; + + // please remember bone id relative to the skin is NOT the mesh relative index. + // it is the index relative to the skeleton that is why + // we have state.bone_id_map, it allows for duplicate bone id's too :) + // hope this makes sense + + int bind_count = 0; + for (unsigned int boneId = 0; boneId < ai_mesh->mNumBones; ++boneId) { + aiBone *iterBone = ai_mesh->mBones[boneId]; + + // used to reparent mesh to the correct armature later on if assigned. + if (!armature) { + print_verbose("Configured mesh armature, will reparent later to armature"); + armature = iterBone->mArmature; + } - // owner must be set after adding to tree - skeleton->set_owner(state.root); + if (skeleton) { + int id = skeleton->find_bone(AssimpUtils::get_assimp_string(iterBone->mName)); + if (id != -1) { + print_verbose("Set bind bone: mesh: " + itos(mesh_index) + " bone index: " + itos(id)); + Transform t = AssimpUtils::assimp_matrix_transform(iterBone->mOffsetMatrix); - skeleton->set_transform(node_transform); + skin->add_bind(bind_count, t); + skin->set_bind_bone(bind_count, id); + bind_count++; + } + } + } + } - // must be done after added to tree - mesh_node->set_skeleton_path(mesh_node->get_path_to(skeleton)); + print_verbose("Finished configuring bind pose for skin mesh"); } -} - -/** generate_mesh_phase_from_skeletal_mesh - * This must be executed after generate_nodes because the skeleton doesn't exist until that has completed the first pass - */ -void EditorSceneImporterAssimp::generate_mesh_phase_from_skeletal_mesh(ImportState &state) { - // prevent more than one skeleton existing per mesh - // * multiple root bones have this - // * this simply filters the node out if it has already been added then references the skeleton so we know the actual skeleton for this node - for (Map<const aiNode *, const Node *>::Element *key_value_pair = state.assimp_node_map.front(); key_value_pair; key_value_pair = key_value_pair->next()) { - const aiNode *assimp_node = key_value_pair->key(); - Node *current_node = (Node *)key_value_pair->value(); - Node *parent_node = current_node->get_parent(); - - ERR_CONTINUE(assimp_node == NULL); - ERR_CONTINUE(parent_node == NULL); - String node_name = AssimpUtils::get_assimp_string(assimp_node->mName); - Transform node_transform = AssimpUtils::assimp_matrix_transform(assimp_node->mTransformation); + // this code parents all meshes with bones to the armature they are for + // GLTF2 specification relies on this and we are enforcing it for FBX. + if (armature && state.flat_node_map[armature]) { + Node *armature_parent = state.flat_node_map[armature]; + print_verbose("Parented mesh " + node_name + " to armature " + armature_parent->get_name()); + // static mesh handling + armature_parent->add_child(mesh_node); + // transform must be identity + mesh_node->set_global_transform(Transform()); + mesh_node->set_name(node_name); + mesh_node->set_owner(state.root); + } else { + // static mesh handling + active_node->add_child(mesh_node); + mesh_node->set_global_transform(node_transform); + mesh_node->set_name(node_name); + mesh_node->set_owner(state.root); + } - if (assimp_node->mNumMeshes > 0) { - create_mesh(state, assimp_node, node_name, current_node, parent_node, node_transform); - } + if (skeleton) { + print_verbose("Attempted to set skeleton path!"); + mesh_node->set_skeleton_path(mesh_node->get_path_to(skeleton)); + mesh_node->set_skin(skin); } -} -/** - * attach_new_node - * configures node, assigns parent node -**/ -void EditorSceneImporterAssimp::attach_new_node(ImportState &state, Spatial *new_node, const aiNode *node, Node *parent_node, String Name, Transform &transform) { - ERR_FAIL_COND(new_node == NULL); - ERR_FAIL_COND(node == NULL); - ERR_FAIL_COND(parent_node == NULL); - ERR_FAIL_COND(state.root == NULL); - - // assign properties to new godot note - new_node->set_name(Name); - new_node->set_transform(transform); - - // add element as child to parent - parent_node->add_child(new_node); - - // owner must be set after - new_node->set_owner(state.root); - - // cache node mapping results by name and then by aiNode* - state.node_map[Name] = new_node; - state.assimp_node_map[node] = new_node; + return mesh_node; } /** * Create a light for the scene * Automatically caches lights for lookup later */ -void EditorSceneImporterAssimp::create_light(ImportState &state, RecursiveState &recursive_state) { +Spatial *EditorSceneImporterAssimp::create_light( + ImportState &state, + const String &node_name, + Transform &look_at_transform) { Light *light = NULL; - aiLight *ai_light = state.assimp_scene->mLights[state.light_cache[recursive_state.node_name]]; - ERR_FAIL_COND(!ai_light); + aiLight *assimp_light = state.assimp_scene->mLights[state.light_cache[node_name]]; + ERR_FAIL_COND_V(!assimp_light, NULL); - if (ai_light->mType == aiLightSource_DIRECTIONAL) { + if (assimp_light->mType == aiLightSource_DIRECTIONAL) { light = memnew(DirectionalLight); - Vector3 dir = Vector3(ai_light->mDirection.y, ai_light->mDirection.x, ai_light->mDirection.z); - dir.normalize(); - Vector3 pos = Vector3(ai_light->mPosition.x, ai_light->mPosition.y, ai_light->mPosition.z); - Vector3 up = Vector3(ai_light->mUp.x, ai_light->mUp.y, ai_light->mUp.z); - up.normalize(); - - Transform light_transform; - light_transform.set_look_at(pos, pos + dir, up); - - recursive_state.node_transform *= light_transform; - - } else if (ai_light->mType == aiLightSource_POINT) { + } else if (assimp_light->mType == aiLightSource_POINT) { light = memnew(OmniLight); - Vector3 pos = Vector3(ai_light->mPosition.x, ai_light->mPosition.y, ai_light->mPosition.z); - Transform xform; - xform.origin = pos; - - recursive_state.node_transform *= xform; - - light->set_transform(xform); - - //light->set_param(Light::PARAM_ATTENUATION, 1); - } else if (ai_light->mType == aiLightSource_SPOT) { + } else if (assimp_light->mType == aiLightSource_SPOT) { light = memnew(SpotLight); - - Vector3 dir = Vector3(ai_light->mDirection.y, ai_light->mDirection.x, ai_light->mDirection.z); - dir.normalize(); - Vector3 pos = Vector3(ai_light->mPosition.x, ai_light->mPosition.y, ai_light->mPosition.z); - Vector3 up = Vector3(ai_light->mUp.x, ai_light->mUp.y, ai_light->mUp.z); - up.normalize(); - - Transform light_transform; - light_transform.set_look_at(pos, pos + dir, up); - recursive_state.node_transform *= light_transform; - - //light->set_param(Light::PARAM_ATTENUATION, 0.0f); } - ERR_FAIL_COND(light == NULL); + ERR_FAIL_COND_V(light == NULL, NULL); + + if (assimp_light->mType != aiLightSource_POINT) { + Vector3 pos = Vector3( + assimp_light->mPosition.x, + assimp_light->mPosition.y, + assimp_light->mPosition.z); + Vector3 look_at = Vector3( + assimp_light->mDirection.y, + assimp_light->mDirection.x, + assimp_light->mDirection.z) + .normalized(); + Vector3 up = Vector3( + assimp_light->mUp.x, + assimp_light->mUp.y, + assimp_light->mUp.z); + + look_at_transform.set_look_at(pos, look_at, up); + } + // properties for light variables should be put here. + // not really hugely important yet but we will need them in the future - light->set_color(Color(ai_light->mColorDiffuse.r, ai_light->mColorDiffuse.g, ai_light->mColorDiffuse.b)); - recursive_state.new_node = light; + light->set_color( + Color(assimp_light->mColorDiffuse.r, assimp_light->mColorDiffuse.g, assimp_light->mColorDiffuse.b)); - attach_new_node(state, - recursive_state.new_node, - recursive_state.assimp_node, - recursive_state.parent_node, - recursive_state.node_name, - recursive_state.node_transform); + return light; } /** * Create camera for the scene */ -void EditorSceneImporterAssimp::create_camera(ImportState &state, RecursiveState &recursive_state) { - aiCamera *ai_camera = state.assimp_scene->mCameras[state.camera_cache[recursive_state.node_name]]; - ERR_FAIL_COND(!ai_camera); - - Camera *camera = memnew(Camera); - - float near = ai_camera->mClipPlaneNear; +Spatial *EditorSceneImporterAssimp::create_camera( + ImportState &state, + const String &node_name, + Transform &look_at_transform) { + aiCamera *camera = state.assimp_scene->mCameras[state.camera_cache[node_name]]; + ERR_FAIL_COND_V(!camera, NULL); + + Camera *camera_node = memnew(Camera); + ERR_FAIL_COND_V(!camera_node, NULL); + float near = camera->mClipPlaneNear; if (Math::is_equal_approx(near, 0.0f)) { near = 0.1f; } - camera->set_perspective(Math::rad2deg(ai_camera->mHorizontalFOV) * 2.0f, near, ai_camera->mClipPlaneFar); + camera_node->set_perspective(Math::rad2deg(camera->mHorizontalFOV) * 2.0f, near, camera->mClipPlaneFar); + Vector3 pos = Vector3(camera->mPosition.x, camera->mPosition.y, camera->mPosition.z); + Vector3 look_at = Vector3(camera->mLookAt.y, camera->mLookAt.x, camera->mLookAt.z).normalized(); + Vector3 up = Vector3(camera->mUp.x, camera->mUp.y, camera->mUp.z); - Vector3 pos = Vector3(ai_camera->mPosition.x, ai_camera->mPosition.y, ai_camera->mPosition.z); - Vector3 look_at = Vector3(ai_camera->mLookAt.y, ai_camera->mLookAt.x, ai_camera->mLookAt.z).normalized(); - Vector3 up = Vector3(ai_camera->mUp.x, ai_camera->mUp.y, ai_camera->mUp.z); - - Transform xform; - xform.set_look_at(pos, look_at, up); - - recursive_state.new_node = camera; - - attach_new_node(state, - recursive_state.new_node, - recursive_state.assimp_node, - recursive_state.parent_node, - recursive_state.node_name, - recursive_state.node_transform); -} - -/** - * Create Bone - * Create a bone in the scene - */ -void EditorSceneImporterAssimp::create_bone(ImportState &state, RecursiveState &recursive_state) { - // for each armature node we must make a new skeleton but ensure it - // has a bone in the child to ensure we don't make too many - // the reason you must do this is because a skeleton exists per mesh? - // and duplicate bone names are very bad for determining what is going on. - aiBone *parent_bone_assimp = get_bone_by_name(state.assimp_scene, recursive_state.assimp_node->mParent->mName); - - // set to true when you want to use skeleton reference from cache. - bool do_not_create_armature = false; - - // prevent more than one skeleton existing per mesh - // * multiple root bones have this - // * this simply filters the node out if it has already been added then references the skeleton so we know the actual skeleton for this node - for (Map<Skeleton *, const Spatial *>::Element *key_value_pair = state.armature_skeletons.front(); key_value_pair; key_value_pair = key_value_pair->next()) { - if (key_value_pair->value() == recursive_state.parent_node) { - // apply the skeleton for this mesh - recursive_state.skeleton = key_value_pair->key(); - - // force this off - do_not_create_armature = true; - } - } - - // check if parent was a bone - // if parent was not a bone this is the first bone. - // therefore parent is the 'armature'? - // also for multi root bone support make sure we don't already have the skeleton cached. - // if we do we must merge them - as this is all godot supports right now. - if (!parent_bone_assimp && recursive_state.skeleton == NULL && !do_not_create_armature) { - // create new skeleton on the root. - recursive_state.skeleton = memnew(Skeleton); - - ERR_FAIL_COND(state.root == NULL); - ERR_FAIL_COND(recursive_state.skeleton == NULL); - - print_verbose("Parent armature node is called " + recursive_state.parent_node->get_name()); - // store root node for this skeleton / used in animation playback and bone detection. - - state.armature_skeletons.insert(recursive_state.skeleton, Object::cast_to<Spatial>(recursive_state.parent_node)); - - //skeleton->set_use_bones_in_world_transform(true); - print_verbose("Created new FBX skeleton for armature node"); - } - - ERR_FAIL_COND_MSG(recursive_state.skeleton == NULL, "Mesh has invalid armature detection - report this"); - - // this transform is a bone - recursive_state.skeleton->add_bone(recursive_state.node_name); - - //ERR_FAIL_COND(recursive_state.skeleton->get_name() == ""); - print_verbose("Bone added to lookup: " + AssimpUtils::get_assimp_string(recursive_state.bone->mName)); - print_verbose("Skeleton attached to: " + recursive_state.skeleton->get_name()); - // make sure to write the bone lookup inverse so we can retrieve the mesh for this bone later - state.bone_to_skeleton_lookup.insert(recursive_state.bone, recursive_state.skeleton); - - Transform xform = AssimpUtils::assimp_matrix_transform(recursive_state.bone->mOffsetMatrix); - recursive_state.skeleton->set_bone_rest(recursive_state.skeleton->get_bone_count() - 1, xform.affine_inverse()); - - // get parent node of assimp node - const aiNode *parent_node_assimp = recursive_state.assimp_node->mParent; - - // ensure we have a parent - if (parent_node_assimp != NULL) { - int parent_bone_id = recursive_state.skeleton->find_bone(AssimpUtils::get_assimp_string(parent_node_assimp->mName)); - int current_bone_id = recursive_state.skeleton->find_bone(recursive_state.node_name); - print_verbose("Parent bone id " + itos(parent_bone_id) + " current bone id" + itos(current_bone_id)); - print_verbose("Bone debug: " + AssimpUtils::get_assimp_string(parent_node_assimp->mName)); - recursive_state.skeleton->set_bone_parent(current_bone_id, parent_bone_id); - } + look_at_transform.set_look_at(pos + look_at_transform.origin, look_at, up); + return camera_node; } /** @@ -1309,46 +1491,30 @@ void EditorSceneImporterAssimp::create_bone(ImportState &state, RecursiveState & */ void EditorSceneImporterAssimp::_generate_node( ImportState &state, - Skeleton *skeleton, - const aiNode *assimp_node, Node *parent_node) { + const aiNode *assimp_node) { - // sanity check - ERR_FAIL_COND(state.root == NULL); - ERR_FAIL_COND(state.assimp_scene == NULL); ERR_FAIL_COND(assimp_node == NULL); - ERR_FAIL_COND(parent_node == NULL); - - Spatial *new_node = NULL; + state.nodes.push_back(assimp_node); String node_name = AssimpUtils::get_assimp_string(assimp_node->mName); - Transform node_transform = AssimpUtils::assimp_matrix_transform(assimp_node->mTransformation); - - // can safely return null - is this node a bone? - aiBone *bone = get_bone_by_name(state.assimp_scene, assimp_node->mName); - - // out arguments helper - for pushing state down into creation functions - RecursiveState recursive_state(node_transform, skeleton, new_node, node_name, assimp_node, parent_node, bone); - - // Creation code - if (state.light_cache.has(node_name)) { - create_light(state, recursive_state); - } else if (state.camera_cache.has(node_name)) { - create_camera(state, recursive_state); - } else if (bone != NULL) { - create_bone(state, recursive_state); - } else { - //generic node - recursive_state.new_node = memnew(Spatial); - attach_new_node(state, - recursive_state.new_node, - recursive_state.assimp_node, - recursive_state.parent_node, - recursive_state.node_name, - recursive_state.node_transform); + String parent_name = AssimpUtils::get_assimp_string(assimp_node->mParent->mName); + + // please note + // duplicate bone names exist + // this is why we only check if the bone exists + // so everything else is useless but the name + // please do not copy any other values from get_bone_by_name. + aiBone *parent_bone = get_bone_by_name(state.assimp_scene, assimp_node->mParent->mName); + aiBone *current_bone = get_bone_by_name(state.assimp_scene, assimp_node->mName); + + // is this an armature + // parent null + // and this is the first bone :) + if (parent_bone == NULL && current_bone) { + state.armature_nodes.push_back(assimp_node->mParent); + print_verbose("found valid armature: " + parent_name); } - // recurse into all child elements - for (size_t i = 0; i < recursive_state.assimp_node->mNumChildren; i++) { - _generate_node(state, recursive_state.skeleton, recursive_state.assimp_node->mChildren[i], - recursive_state.new_node != NULL ? recursive_state.new_node : recursive_state.parent_node); + for (size_t i = 0; i < assimp_node->mNumChildren; i++) { + _generate_node(state, assimp_node->mChildren[i]); } } diff --git a/modules/assimp/editor_scene_importer_assimp.h b/modules/assimp/editor_scene_importer_assimp.h index 787376c9af..a47d7ac46e 100644 --- a/modules/assimp/editor_scene_importer_assimp.h +++ b/modules/assimp/editor_scene_importer_assimp.h @@ -50,6 +50,7 @@ #include <assimp/DefaultLogger.hpp> #include <assimp/LogStream.hpp> #include <assimp/Logger.hpp> +#include <map> #include "import_state.h" #include "import_utils.h" @@ -72,7 +73,6 @@ public: class EditorSceneImporterAssimp : public EditorSceneImporter { private: GDCLASS(EditorSceneImporterAssimp, EditorSceneImporter); - const String ASSIMP_FBX_KEY = "_$AssimpFbx$"; struct AssetImportAnimation { enum Interpolation { @@ -88,40 +88,32 @@ private: float weight; }; - struct SkeletonHole { //nodes may be part of the skeleton by used by vertex - String name; - String parent; - Transform pose; - const aiNode *node; - }; - - void _calc_tangent_from_mesh(const aiMesh *ai_mesh, int i, int tri_index, int index, PoolColorArray::Write &w); - void _set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<Texture> texture); + Ref<Mesh> _generate_mesh_from_surface_indices(ImportState &state, const Vector<int> &p_surface_indices, + const aiNode *assimp_node, Ref<Skin> &skin, + Skeleton *&skeleton_assigned); - Ref<Mesh> _generate_mesh_from_surface_indices(ImportState &state, const Vector<int> &p_surface_indices, const aiNode *assimp_node, Skeleton *p_skeleton = NULL); - - // utility for node creation - void attach_new_node(ImportState &state, Spatial *new_node, const aiNode *node, Node *parent_node, String Name, Transform &transform); // simple object creation functions - void create_light(ImportState &state, RecursiveState &recursive_state); - void create_camera(ImportState &state, RecursiveState &recursive_state); - void create_bone(ImportState &state, RecursiveState &recursive_state); + Spatial *create_light(ImportState &state, + const String &node_name, + Transform &look_at_transform); + Spatial *create_camera( + ImportState &state, + const String &node_name, + Transform &look_at_transform); // non recursive - linear so must not use recursive arguments - void create_mesh(ImportState &state, const aiNode *assimp_node, const String &node_name, Node *current_node, Node *parent_node, Transform node_transform); - + MeshInstance *create_mesh(ImportState &state, const aiNode *assimp_node, const String &node_name, Node *active_node, Transform node_transform); // recursive node generator - void _generate_node(ImportState &state, Skeleton *skeleton, const aiNode *assimp_node, Node *parent_node); - // runs after _generate_node as it must then use pre-created godot skeleton. - void generate_mesh_phase_from_skeletal_mesh(ImportState &state); - void _insert_animation_track(ImportState &scene, const aiAnimation *assimp_anim, int p_track, int p_bake_fps, Ref<Animation> animation, float ticks_per_second, Skeleton *p_skeleton, const NodePath &p_path, const String &p_name); + void _generate_node(ImportState &state, const aiNode *assimp_node); + void _insert_animation_track(ImportState &scene, const aiAnimation *assimp_anim, int track_id, + int anim_fps, Ref<Animation> animation, float ticks_per_second, + Skeleton *skeleton, const NodePath &node_path, + const String &node_name, aiBone *track_bone); void _import_animation(ImportState &state, int p_animation_index, int p_bake_fps); - + Node *get_node_by_name(ImportState &state, String name); + aiBone *get_bone_from_stack(ImportState &state, aiString name); Spatial *_generate_scene(const String &p_path, aiScene *scene, const uint32_t p_flags, int p_bake_fps, const int32_t p_max_bone_weights); - String _assimp_anim_string_to_string(const aiString &p_string) const; - String _assimp_raw_string_to_string(const aiString &p_string) const; - float _get_fbx_fps(int32_t time_mode, const aiScene *p_scene); template <class T> T _interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, float p_time, AssetImportAnimation::Interpolation p_interp); void _register_project_setting_import(const String generic, const String import_setting_string, const Vector<String> &exts, List<String> *r_extensions, const bool p_enabled) const; @@ -148,6 +140,10 @@ public: virtual uint32_t get_import_flags() const; virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = NULL); Ref<Image> load_image(ImportState &state, const aiScene *p_scene, String p_path); + + static void RegenerateBoneStack(ImportState &state); + + void RegenerateBoneStack(ImportState &state, aiMesh *mesh); }; #endif #endif diff --git a/modules/assimp/import_state.h b/modules/assimp/import_state.h index 56d89ffea7..9859a88c1c 100644 --- a/modules/assimp/import_state.h +++ b/modules/assimp/import_state.h @@ -52,28 +52,42 @@ namespace AssimpImporter { /** Import state is for global scene import data - * This makes the code simpler and contains useful lookups. - */ + * This makes the code simpler and contains useful lookups. + */ struct ImportState { String path; + Spatial *root; const aiScene *assimp_scene; uint32_t max_bone_weights; - Spatial *root; Map<String, Ref<Mesh> > mesh_cache; Map<int, Ref<Material> > material_cache; Map<String, int> light_cache; Map<String, int> camera_cache; - //Vector<Skeleton *> skeletons; - Map<Skeleton *, const Spatial *> armature_skeletons; // maps skeletons based on their armature nodes. - Map<const aiBone *, Skeleton *> bone_to_skeleton_lookup; // maps bones back into their skeleton + // very useful for when you need to ask assimp for the bone mesh - Map<String, Node *> node_map; - Map<const aiNode *, const Node *> assimp_node_map; + + Map<const aiNode *, Node *> assimp_node_map; Map<String, Ref<Image> > path_to_image_cache; - bool fbx; //for some reason assimp does some things different for FBX + + // Generation 3 - determinisitic iteration + // to lower potential recursion errors + List<const aiNode *> nodes; + Map<const aiNode *, Spatial *> flat_node_map; AnimationPlayer *animation_player; + + // Generation 3 - deterministic armatures + // list of armature nodes - flat and simple to parse + // assimp node, node in godot + List<aiNode *> armature_nodes; + Map<const aiNode *, Skeleton *> armature_skeletons; + Map<aiBone *, Skeleton *> skeleton_bone_map; + // Generation 3 - deterministic bone handling + // bones from the stack are popped when found + // this means we can detect + // what bones are for other armatures + List<aiBone *> bone_stack; }; struct AssimpImageData { @@ -86,14 +100,15 @@ struct AssimpImageData { * This makes the code easier to handle too and add extra arguments without breaking things */ struct RecursiveState { + RecursiveState() {} // do not construct :) RecursiveState( Transform &_node_transform, Skeleton *_skeleton, Spatial *_new_node, - const String &_node_name, - const aiNode *_assimp_node, + String &_node_name, + aiNode *_assimp_node, Node *_parent_node, - const aiBone *_bone) : + aiBone *_bone) : node_transform(_node_transform), skeleton(_skeleton), new_node(_new_node), @@ -102,13 +117,13 @@ struct RecursiveState { parent_node(_parent_node), bone(_bone) {} - Transform &node_transform; - Skeleton *skeleton; - Spatial *new_node; - const String &node_name; - const aiNode *assimp_node; - Node *parent_node; - const aiBone *bone; + Transform node_transform; + Skeleton *skeleton = NULL; + Spatial *new_node = NULL; + String node_name; + aiNode *assimp_node = NULL; + Node *parent_node = NULL; + aiBone *bone = NULL; }; } // namespace AssimpImporter diff --git a/modules/assimp/import_utils.h b/modules/assimp/import_utils.h index 4be76ade0f..7b14804ddc 100644 --- a/modules/assimp/import_utils.h +++ b/modules/assimp/import_utils.h @@ -369,8 +369,7 @@ public: state.path_to_image_cache.insert(p_path, img); return img; } else if (tex->CheckFormat("dds")) { - ERR_EXPLAIN("Open Asset Import: Embedded dds not implemented"); - ERR_FAIL_COND_V(true, Ref<Image>()); + ERR_FAIL_COND_V_MSG(true, Ref<Image>(), "Open Asset Import: Embedded dds not implemented"); } } else { Ref<Image> img; diff --git a/modules/bullet/btRayShape.h b/modules/bullet/btRayShape.h index 7f3229b3e8..09c1f6c241 100644 --- a/modules/bullet/btRayShape.h +++ b/modules/bullet/btRayShape.h @@ -62,7 +62,7 @@ public: virtual void setMargin(btScalar margin); - void setSlipsOnSlope(bool p_slipOnSlope); + void setSlipsOnSlope(bool p_slipsOnSlope); bool getSlipsOnSlope() const { return slipsOnSlope; } const btTransform &getSupportPoint() const { return m_cacheSupportPoint; } diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index f29c4cb9ca..d611810bfa 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -126,16 +126,16 @@ void BulletPhysicsDirectBodyState::add_torque(const Vector3 &p_torque) { body->apply_torque(p_torque); } -void BulletPhysicsDirectBodyState::apply_central_impulse(const Vector3 &p_j) { - body->apply_central_impulse(p_j); +void BulletPhysicsDirectBodyState::apply_central_impulse(const Vector3 &p_impulse) { + body->apply_central_impulse(p_impulse); } -void BulletPhysicsDirectBodyState::apply_impulse(const Vector3 &p_pos, const Vector3 &p_j) { - body->apply_impulse(p_pos, p_j); +void BulletPhysicsDirectBodyState::apply_impulse(const Vector3 &p_pos, const Vector3 &p_impulse) { + body->apply_impulse(p_pos, p_impulse); } -void BulletPhysicsDirectBodyState::apply_torque_impulse(const Vector3 &p_j) { - body->apply_torque_impulse(p_j); +void BulletPhysicsDirectBodyState::apply_torque_impulse(const Vector3 &p_impulse) { + body->apply_torque_impulse(p_impulse); } void BulletPhysicsDirectBodyState::set_sleep_state(bool p_enable) { @@ -920,7 +920,7 @@ void RigidBodyBullet::reload_space_override_modificator() { currentArea = areasWhereIam[i]; - if (PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED == currentArea->get_spOv_mode()) { + if (!currentArea || PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED == currentArea->get_spOv_mode()) { continue; } diff --git a/modules/bullet/rigid_body_bullet.h b/modules/bullet/rigid_body_bullet.h index f63148092f..0b6dc997db 100644 --- a/modules/bullet/rigid_body_bullet.h +++ b/modules/bullet/rigid_body_bullet.h @@ -114,8 +114,8 @@ public: virtual void add_force(const Vector3 &p_force, const Vector3 &p_pos); virtual void add_torque(const Vector3 &p_torque); virtual void apply_central_impulse(const Vector3 &p_impulse); - virtual void apply_impulse(const Vector3 &p_pos, const Vector3 &p_j); - virtual void apply_torque_impulse(const Vector3 &p_j); + virtual void apply_impulse(const Vector3 &p_pos, const Vector3 &p_impulse); + virtual void apply_torque_impulse(const Vector3 &p_impulse); virtual void set_sleep_state(bool p_enable); virtual bool is_sleeping() const; diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index 5a76f32977..925fff0cc8 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -242,7 +242,7 @@ void CSGBrushOperation::BuildPoly::_clip_segment(const CSGBrush *p_brush, int p_ //check if edge and poly share a vertex, of so, assign it to segment_idx for (int i = 0; i < points.size(); i++) { for (int j = 0; j < 2; j++) { - if (segment[j] == points[i].point) { + if (segment[j].is_equal_approx(points[i].point)) { segment_idx[j] = i; inserted_points.push_back(i); break; @@ -310,7 +310,7 @@ void CSGBrushOperation::BuildPoly::_clip_segment(const CSGBrush *p_brush, int p_ Vector2 edgeseg[2] = { points[edges[i].points[0]].point, points[edges[i].points[1]].point }; Vector2 closest = Geometry::get_closest_point_to_segment_2d(segment[j], edgeseg); - if (closest == segment[j]) { + if (closest.is_equal_approx(segment[j])) { //point rest of this edge res = closest; found = true; @@ -439,7 +439,7 @@ void CSGBrushOperation::BuildPoly::clip(const CSGBrush *p_brush, int p_face, Mes //transform A points to 2D - if (segment[0] == segment[1]) + if (segment[0].is_equal_approx(segment[1])) return; //too small _clip_segment(p_brush, p_face, segment, mesh_merge, p_for_B); @@ -461,10 +461,10 @@ void CSGBrushOperation::_collision_callback(const CSGBrush *A, int p_face_a, Map { //check if either is a degenerate - if (va[0] == va[1] || va[0] == va[2] || va[1] == va[2]) + if (va[0].is_equal_approx(va[1]) || va[0].is_equal_approx(va[2]) || va[1].is_equal_approx(va[2])) return; - if (vb[0] == vb[1] || vb[0] == vb[2] || vb[1] == vb[2]) + if (vb[0].is_equal_approx(vb[1]) || vb[0].is_equal_approx(vb[2]) || vb[1].is_equal_approx(vb[2])) return; } diff --git a/modules/etc/image_etc.cpp b/modules/etc/image_etc.cpp index 6f54436bf9..f0cbf6ae28 100644 --- a/modules/etc/image_etc.cpp +++ b/modules/etc/image_etc.cpp @@ -168,6 +168,7 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f } PoolVector<uint8_t>::Read r = img->get_data().read(); + ERR_FAIL_COND(!r.ptr()); unsigned int target_size = Image::get_image_data_size(imgw, imgh, etc_format, p_img->has_mipmaps()); int mmc = 1 + (p_img->has_mipmaps() ? Image::get_image_required_mipmaps(imgw, imgh, etc_format) : 0); diff --git a/modules/etc/texture_loader_pkm.cpp b/modules/etc/texture_loader_pkm.cpp index 4d8af6883f..da6da74025 100644 --- a/modules/etc/texture_loader_pkm.cpp +++ b/modules/etc/texture_loader_pkm.cpp @@ -91,6 +91,8 @@ RES ResourceFormatPKM::load(const String &p_path, const String &p_original_path, if (r_error) *r_error = OK; + f->close(); + memdelete(f); return texture; } diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index b47377cbc4..8f4a8de895 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -66,7 +66,7 @@ if env['builtin_freetype']: env.Prepend(CPPPATH=[thirdparty_dir + "/include"]) env_freetype.Append(CPPDEFINES=['FT2_BUILD_LIBRARY', 'FT_CONFIG_OPTION_USE_PNG']) - if (env['target'] != 'release'): + if (env['target'] == 'debug'): env_freetype.Append(CPPDEFINES=['ZLIB_DEBUG']) # Also requires libpng headers diff --git a/modules/gdnative/gdnative/pool_arrays.cpp b/modules/gdnative/gdnative/pool_arrays.cpp index 74c540ca14..23791af67e 100644 --- a/modules/gdnative/gdnative/pool_arrays.cpp +++ b/modules/gdnative/gdnative/pool_arrays.cpp @@ -129,6 +129,11 @@ godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self) return self->size(); } +godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self) { + const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self) { ((PoolVector<uint8_t> *)p_self)->~PoolVector(); } @@ -218,6 +223,11 @@ godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self) { return self->size(); } +godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self) { + const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self) { ((PoolVector<godot_int> *)p_self)->~PoolVector(); } @@ -307,6 +317,11 @@ godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self) return self->size(); } +godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self) { + const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self) { ((PoolVector<godot_real> *)p_self)->~PoolVector(); } @@ -404,6 +419,11 @@ godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_se return self->size(); } +godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self) { + const PoolVector<String> *self = (const PoolVector<String> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self) { ((PoolVector<String> *)p_self)->~PoolVector(); } @@ -500,6 +520,11 @@ godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_ return self->size(); } +godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self) { + const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self) { ((PoolVector<Vector2> *)p_self)->~PoolVector(); } @@ -596,6 +621,11 @@ godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_ return self->size(); } +godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self) { + const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self) { ((PoolVector<Vector3> *)p_self)->~PoolVector(); } @@ -692,6 +722,11 @@ godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self return self->size(); } +godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self) { + const PoolVector<Color> *self = (const PoolVector<Color> *)p_self; + return self->empty(); +} + void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self) { ((PoolVector<Color> *)p_self)->~PoolVector(); } diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 55ba4ecc1e..9e5295a936 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -91,6 +91,55 @@ ["const godot_int", "p_step"], ["const godot_bool", "p_deep"] ] + }, + { + "name": "godot_pool_byte_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_byte_array *", "p_self"] + ] + }, + { + "name": "godot_pool_int_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_int_array *", "p_self"] + ] + }, + { + "name": "godot_pool_real_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_real_array *", "p_self"] + ] + }, + { + "name": "godot_pool_string_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_string_array *", "p_self"] + ] + }, + { + "name": "godot_pool_vector2_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_vector2_array *", "p_self"] + ] + }, + { + "name": "godot_pool_vector3_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_vector3_array *", "p_self"] + ] + }, + { + "name": "godot_pool_color_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_pool_color_array *", "p_self"] + ] } ] }, diff --git a/modules/gdnative/include/gdnative/array.h b/modules/gdnative/include/gdnative/array.h index 2e3ce58033..a27626325e 100644 --- a/modules/gdnative/include/gdnative/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -132,7 +132,7 @@ void GDAPI godot_array_destroy(godot_array *p_self); godot_array GDAPI godot_array_duplicate(const godot_array *p_self, const godot_bool p_deep); -godot_array GDAPI godot_array_slice(const godot_array *p_self, const godot_int p_begin, const godot_int p_end, const godot_int p_delta, const godot_bool p_deep); +godot_array GDAPI godot_array_slice(const godot_array *p_self, const godot_int p_begin, const godot_int p_end, const godot_int p_step, const godot_bool p_deep); godot_variant GDAPI godot_array_max(const godot_array *p_self); diff --git a/modules/gdnative/include/gdnative/pool_arrays.h b/modules/gdnative/include/gdnative/pool_arrays.h index 96730ab085..63e8267f0e 100644 --- a/modules/gdnative/include/gdnative/pool_arrays.h +++ b/modules/gdnative/include/gdnative/pool_arrays.h @@ -191,6 +191,8 @@ uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, con godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self); +godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self); + void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self); // int @@ -222,6 +224,8 @@ godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, con godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self); +godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self); + void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self); // real @@ -253,6 +257,8 @@ godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self, godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self); +godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self); + void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self); // string @@ -284,6 +290,8 @@ godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_ godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_self); +godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self); + void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self); // vector2 @@ -315,6 +323,8 @@ godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_self); +godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self); + void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self); // vector3 @@ -346,6 +356,8 @@ godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_self); +godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self); + void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self); // color @@ -377,6 +389,8 @@ godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_sel godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self); +godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self); + void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self); // diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 0194199133..fa59c704d5 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -158,7 +158,7 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty String additional_code = "extern void register_dynamic_symbol(char *name, void *address);\n" "extern void add_ios_init_callback(void (*cb)());\n"; String linker_flags = ""; - for (unsigned int i = 0; i < sizeof(expected_symbols) / sizeof(expected_symbols[0]); ++i) { + for (unsigned long i = 0; i < sizeof(expected_symbols) / sizeof(expected_symbols[0]); ++i) { String full_name = lib->get_symbol_prefix() + expected_symbols[i].name; String code = declare_pattern.replace("$name", full_name); code = code.replace("$weak", expected_symbols[i].is_required ? "" : " __attribute__((weak))"); @@ -174,7 +174,7 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty additional_code += String("void $prefixinit() {\n").replace("$prefix", lib->get_symbol_prefix()); String register_pattern = " if (&$name) register_dynamic_symbol((char *)\"$name\", (void *)$name);\n"; - for (unsigned int i = 0; i < sizeof(expected_symbols) / sizeof(expected_symbols[0]); ++i) { + for (unsigned long i = 0; i < sizeof(expected_symbols) / sizeof(expected_symbols[0]); ++i) { String full_name = lib->get_symbol_prefix() + expected_symbols[i].name; additional_code += register_pattern.replace("$name", full_name); } diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index f3c34fd5e0..14b7f9a2ef 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -279,7 +279,7 @@ void VideoStreamPlaybackGDNative::set_paused(bool p_paused) { paused = p_paused; } -Ref<Texture> VideoStreamPlaybackGDNative::get_texture() { +Ref<Texture> VideoStreamPlaybackGDNative::get_texture() const { return texture; } diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.h b/modules/gdnative/videodecoder/video_stream_gdnative.h index 9aed1fd2a0..5ff7acb616 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.h +++ b/modules/gdnative/videodecoder/video_stream_gdnative.h @@ -168,7 +168,7 @@ public: //virtual int mix(int16_t* p_buffer,int p_frames)=0; - virtual Ref<Texture> get_texture(); + virtual Ref<Texture> get_texture() const; virtual void update(float p_delta); virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata); diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 1d0567dd8d..840971dcf8 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -21,7 +21,7 @@ <argument index="3" name="a8" type="int" default="255"> </argument> <description> - Returns a 32 bit color with red, green, blue and alpha channels. Each channel has 8 bits of information ranging from 0 to 255. + Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255. [code]r8[/code] red channel [code]g8[/code] green channel [code]b8[/code] blue channel @@ -839,6 +839,7 @@ printraw("B") # Prints AB [/codeblock] + [b]Note:[/b] Due to limitations with Godot's built-in console, this only prints to the terminal. If you need to print in the editor, use another method, such as [method print]. </description> </method> <method name="prints" qualifiers="vararg"> diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index db7f8d22e6..b90fab8221 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -199,7 +199,7 @@ StringName GDScript::get_instance_base_type() const { if (native.is_valid()) return native->get_name(); - if (base.is_valid()) + if (base.is_valid() && base->is_valid()) return base->get_instance_base_type(); return StringName(); } @@ -486,7 +486,7 @@ bool GDScript::_update_exports() { placeholder_fallback_enabled = false; - if (base_cache.is_valid()) { + if (base_cache.is_valid() && base_cache->is_valid()) { if (base_cache->_update_exports()) { changed = true; } @@ -2141,6 +2141,7 @@ GDScriptLanguage::GDScriptLanguage() { #ifdef DEBUG_ENABLED GLOBAL_DEF("debug/gdscript/warnings/enable", true); GLOBAL_DEF("debug/gdscript/warnings/treat_warnings_as_errors", false); + GLOBAL_DEF("debug/gdscript/warnings/exclude_addons", true); GLOBAL_DEF("debug/gdscript/completion/autocomplete_setters_and_getters", false); for (int i = 0; i < (int)GDScriptWarning::WARNING_MAX; i++) { String warning = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)i).to_lower(); diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 9b3bf8ad5b..1d82735328 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1944,11 +1944,10 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context ScriptCodeCompletionOption option(E->get().name, ScriptCodeCompletionOption::KIND_MEMBER); r_result.insert(option.display, option); } - } else { - for (const Set<StringName>::Element *E = script->get_members().front(); E; E = E->next()) { - ScriptCodeCompletionOption option(E->get().operator String(), ScriptCodeCompletionOption::KIND_MEMBER); - r_result.insert(option.display, option); - } + } + for (const Set<StringName>::Element *E = script->get_members().front(); E; E = E->next()) { + ScriptCodeCompletionOption option(E->get().operator String(), ScriptCodeCompletionOption::KIND_MEMBER); + r_result.insert(option.display, option); } } if (!p_only_functions) { diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 83d02e4977..0a01321851 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -397,8 +397,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a if (unlikely(m_cond)) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Breaking..:"); \ OPCODE_BREAK; \ - } else \ - _err_error_exists = false; \ + } \ } #define CHECK_SPACE(m_space) \ @@ -1561,14 +1560,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a //error // function, file, line, error, explanation String err_file; - if (p_instance && p_instance->script->is_valid() && p_instance->script->path != "") + if (p_instance && ObjectDB::instance_validate(p_instance->owner) && p_instance->script->is_valid() && p_instance->script->path != "") err_file = p_instance->script->path; else if (script) err_file = script->path; if (err_file == "") err_file = "<built-in>"; String err_func = name; - if (p_instance && p_instance->script->is_valid() && p_instance->script->name != "") + if (p_instance && ObjectDB::instance_validate(p_instance->owner) && p_instance->script->is_valid() && p_instance->script->name != "") err_func = p_instance->script->name + "." + err_func; int err_line = line; if (err_text == "") { diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index d9535d0f1f..bbafef68ed 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -589,7 +589,8 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ r_ret = wref; } } else if (p_args[0]->get_type() == Variant::NIL) { - r_ret = memnew(WeakRef); + Ref<WeakRef> wref = memnew(WeakRef); + r_ret = wref; } else { r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; @@ -1125,7 +1126,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Dictionary d; d["@subpath"] = cp; - d["@path"] = p->path; + d["@path"] = p->get_path(); p = base.ptr(); @@ -1273,6 +1274,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (err != OK) { r_ret = Variant(); + ERR_PRINTS(vformat("Error parsing JSON at line %s: %s", errl, errs)); } } break; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 282bb45c3f..74b9440b3a 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -89,8 +89,8 @@ bool GDScriptParser::_enter_indent_block(BlockNode *p_block) { if (tokenizer->get_token() != GDScriptTokenizer::TK_NEWLINE) { // be more python-like - int current = tab_level.back()->get(); - tab_level.push_back(current); + IndentLevel current_level = indent_level.back()->get(); + indent_level.push_back(current_level); return true; //_set_error("newline expected after ':'."); //return false; @@ -105,12 +105,19 @@ bool GDScriptParser::_enter_indent_block(BlockNode *p_block) { } else if (tokenizer->get_token(1) != GDScriptTokenizer::TK_NEWLINE) { int indent = tokenizer->get_token_line_indent(); - int current = tab_level.back()->get(); - if (indent <= current) { + int tabs = tokenizer->get_token_line_tab_indent(); + IndentLevel current_level = indent_level.back()->get(); + IndentLevel new_indent(indent, tabs); + if (new_indent.is_mixed(current_level)) { + _set_error("Mixed tabs and spaces in indentation."); return false; } - tab_level.push_back(indent); + if (indent <= current_level.indent) { + return false; + } + + indent_level.push_back(new_indent); tokenizer->advance(); return true; @@ -858,11 +865,23 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s if (current_function) { int arg_idx = current_function->arguments.find(identifier); if (arg_idx != -1) { - if (tokenizer->get_token() == GDScriptTokenizer::TK_OP_ASSIGN) { - // Assignment is not really usage - current_function->arguments_usage.write[arg_idx] = current_function->arguments_usage[arg_idx] - 1; - } else { - current_function->arguments_usage.write[arg_idx] = current_function->arguments_usage[arg_idx] + 1; + switch (tokenizer->get_token()) { + case GDScriptTokenizer::TK_OP_ASSIGN_ADD: + case GDScriptTokenizer::TK_OP_ASSIGN_BIT_AND: + case GDScriptTokenizer::TK_OP_ASSIGN_BIT_OR: + case GDScriptTokenizer::TK_OP_ASSIGN_BIT_XOR: + case GDScriptTokenizer::TK_OP_ASSIGN_DIV: + case GDScriptTokenizer::TK_OP_ASSIGN_MOD: + case GDScriptTokenizer::TK_OP_ASSIGN_MUL: + case GDScriptTokenizer::TK_OP_ASSIGN_SHIFT_LEFT: + case GDScriptTokenizer::TK_OP_ASSIGN_SHIFT_RIGHT: + case GDScriptTokenizer::TK_OP_ASSIGN_SUB: + case GDScriptTokenizer::TK_OP_ASSIGN: { + // Assignment is not really usage + } break; + default: { + current_function->arguments_usage.write[arg_idx] = current_function->arguments_usage[arg_idx] + 1; + } } } } @@ -2213,7 +2232,7 @@ GDScriptParser::PatternNode *GDScriptParser::_parse_pattern(bool p_static) { } void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBranchNode *> &p_branches, bool p_static) { - int indent_level = tab_level.back()->get(); + IndentLevel current_level = indent_level.back()->get(); p_block->has_return = true; @@ -2228,7 +2247,7 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran if (error_set) return; - if (indent_level > tab_level.back()->get()) { + if (current_level.indent > indent_level.back()->get().indent) { break; // go back a level } @@ -2683,7 +2702,7 @@ void GDScriptParser::_transform_match_statment(MatchNode *p_match_statement) { void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { - int indent_level = tab_level.back()->get(); + IndentLevel current_level = indent_level.back()->get(); #ifdef DEBUG_ENABLED @@ -2696,9 +2715,13 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { bool is_first_line = true; while (true) { - if (!is_first_line && tab_level.back()->prev() && tab_level.back()->prev()->get() == indent_level) { + if (!is_first_line && indent_level.back()->prev() && indent_level.back()->prev()->get().indent == current_level.indent) { + if (indent_level.back()->prev()->get().is_mixed(current_level)) { + _set_error("Mixed tabs and spaces in indentation."); + return; + } // pythonic single-line expression, don't parse future lines - tab_level.pop_back(); + indent_level.pop_back(); p_block->end_line = tokenizer->get_token_line(); return; } @@ -2708,7 +2731,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { if (error_set) return; - if (indent_level > tab_level.back()->get()) { + if (current_level.indent > indent_level.back()->get().indent) { p_block->end_line = tokenizer->get_token_line(); return; //go back a level } @@ -2912,14 +2935,14 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { while (tokenizer->get_token() == GDScriptTokenizer::TK_NEWLINE && _parse_newline()) ; - if (tab_level.back()->get() < indent_level) { //not at current indent level + if (indent_level.back()->get().indent < current_level.indent) { //not at current indent level p_block->end_line = tokenizer->get_token_line(); return; } if (tokenizer->get_token() == GDScriptTokenizer::TK_CF_ELIF) { - if (tab_level.back()->get() > indent_level) { + if (indent_level.back()->get().indent > current_level.indent) { _set_error("Invalid indentation."); return; @@ -2967,7 +2990,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { } else if (tokenizer->get_token() == GDScriptTokenizer::TK_CF_ELSE) { - if (tab_level.back()->get() > indent_level) { + if (indent_level.back()->get().indent > current_level.indent) { _set_error("Invalid indentation."); return; } @@ -3339,32 +3362,45 @@ bool GDScriptParser::_parse_newline() { if (tokenizer->get_token(1) != GDScriptTokenizer::TK_EOF && tokenizer->get_token(1) != GDScriptTokenizer::TK_NEWLINE) { + IndentLevel current_level = indent_level.back()->get(); int indent = tokenizer->get_token_line_indent(); - int current_indent = tab_level.back()->get(); + int tabs = tokenizer->get_token_line_tab_indent(); + IndentLevel new_level(indent, tabs); - if (indent > current_indent) { + if (new_level.is_mixed(current_level)) { + _set_error("Mixed tabs and spaces in indentation."); + return false; + } + + if (indent > current_level.indent) { _set_error("Unexpected indentation."); return false; } - if (indent < current_indent) { + if (indent < current_level.indent) { - while (indent < current_indent) { + while (indent < current_level.indent) { //exit block - if (tab_level.size() == 1) { + if (indent_level.size() == 1) { _set_error("Invalid indentation. Bug?"); return false; } - tab_level.pop_back(); + indent_level.pop_back(); - if (tab_level.back()->get() < indent) { + if (indent_level.back()->get().indent < indent) { _set_error("Unindent does not match any outer indentation level."); return false; } - current_indent = tab_level.back()->get(); + + if (indent_level.back()->get().is_mixed(current_level)) { + _set_error("Mixed tabs and spaces in indentation."); + return false; + } + + current_level = indent_level.back()->get(); } tokenizer->advance(); @@ -3462,7 +3498,7 @@ void GDScriptParser::_parse_extends(ClassNode *p_class) { void GDScriptParser::_parse_class(ClassNode *p_class) { - int indent_level = tab_level.back()->get(); + IndentLevel current_level = indent_level.back()->get(); while (true) { @@ -3470,7 +3506,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { if (error_set) return; - if (indent_level > tab_level.back()->get()) { + if (current_level.indent > indent_level.back()->get().indent) { p_class->end_line = tokenizer->get_token_line(); return; //go back a level } @@ -8337,6 +8373,9 @@ void GDScriptParser::_add_warning(int p_code, int p_line, const String &p_symbol } void GDScriptParser::_add_warning(int p_code, int p_line, const Vector<String> &p_symbols) { + if (GLOBAL_GET("debug/gdscript/warnings/exclude_addons").booleanize() && base_path.begins_with("res://addons/")) { + return; + } if (tokenizer->is_ignoring_warnings() || !GLOBAL_GET("debug/gdscript/warnings/enable").booleanize()) { return; } @@ -8550,8 +8589,8 @@ void GDScriptParser::clear() { validating = false; for_completion = false; error_set = false; - tab_level.clear(); - tab_level.push_back(0); + indent_level.clear(); + indent_level.push_back(IndentLevel(0, 0)); error_line = 0; error_column = 0; pending_newline = -1; diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 04ce9cf4c6..93557d745d 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -552,7 +552,27 @@ private: int pending_newline; - List<int> tab_level; + struct IndentLevel { + int indent; + int tabs; + + bool is_mixed(IndentLevel other) { + return ( + (indent == other.indent && tabs != other.tabs) || + (indent > other.indent && tabs < other.tabs) || + (indent < other.indent && tabs > other.tabs)); + } + + IndentLevel() : + indent(0), + tabs(0) {} + + IndentLevel(int p_indent, int p_tabs) : + indent(p_indent), + tabs(p_tabs) {} + }; + + List<IndentLevel> indent_level; String base_path; String self_path; diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 8b20b0ff48..23a86f8d2b 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -450,11 +450,11 @@ void GDScriptTokenizerText::_make_error(const String &p_error) { tk_rb_pos = (tk_rb_pos + 1) % TK_RB_SIZE; } -void GDScriptTokenizerText::_make_newline(int p_spaces) { +void GDScriptTokenizerText::_make_newline(int p_indentation, int p_tabs) { TokenData &tk = tk_rb[tk_rb_pos]; tk.type = TK_NEWLINE; - tk.constant = p_spaces; + tk.constant = Vector2(p_indentation, p_tabs); tk.line = line; tk.col = column; tk_rb_pos = (tk_rb_pos + 1) % TK_RB_SIZE; @@ -511,33 +511,6 @@ void GDScriptTokenizerText::_advance() { case ' ': INCPOS(1); continue; - case '\n': { - line++; - INCPOS(1); - column = 1; - int i = 0; - while (true) { - if (GETCHAR(i) == ' ') { - if (file_indent_type == INDENT_NONE) file_indent_type = INDENT_SPACES; - if (file_indent_type != INDENT_SPACES) { - _make_error("Spaces used for indentation in tab-indented file!"); - return; - } - } else if (GETCHAR(i) == '\t') { - if (file_indent_type == INDENT_NONE) file_indent_type = INDENT_TABS; - if (file_indent_type != INDENT_TABS) { - _make_error("Tabs used for indentation in space-indented file!"); - return; - } - } else { - break; // not indentation anymore - } - i++; - } - - _make_newline(i); - return; - } case '#': { // line comment skip #ifdef DEBUG_ENABLED String comment; @@ -565,33 +538,34 @@ void GDScriptTokenizerText::_advance() { ignore_warnings = true; } #endif // DEBUG_ENABLED + FALLTHROUGH; + } + case '\n': { + line++; INCPOS(1); + bool used_spaces = false; + int tabs = 0; column = 1; - line++; int i = 0; while (true) { if (GETCHAR(i) == ' ') { - if (file_indent_type == INDENT_NONE) file_indent_type = INDENT_SPACES; - if (file_indent_type != INDENT_SPACES) { - _make_error("Spaces used for indentation in tab-indented file!"); - return; - } + i++; + used_spaces = true; } else if (GETCHAR(i) == '\t') { - if (file_indent_type == INDENT_NONE) file_indent_type = INDENT_TABS; - if (file_indent_type != INDENT_TABS) { - _make_error("Tabs used for indentation in space-indented file!"); + if (used_spaces) { + _make_error("Spaces used before tabs on a line"); return; } + i++; + tabs++; } else { break; // not indentation anymore } - i++; } - _make_newline(i); + _make_newline(i, tabs); return; - - } break; + } case '/': { switch (GETCHAR(1)) { @@ -849,12 +823,8 @@ void GDScriptTokenizerText::_advance() { _make_error("Unterminated String"); return; } - if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))) { - _make_error("Malformed hex constant in string"); - return; - } - CharType v; + CharType v = 0; if (c >= '0' && c <= '9') { v = c - '0'; } else if (c >= 'a' && c <= 'f') { @@ -864,8 +834,8 @@ void GDScriptTokenizerText::_advance() { v = c - 'A'; v += 10; } else { - ERR_PRINT("BUG"); - v = 0; + _make_error("Malformed hex constant in string"); + return; } res <<= 4; @@ -1112,7 +1082,6 @@ void GDScriptTokenizerText::set_code(const String &p_code) { ignore_warnings = false; #endif // DEBUG_ENABLED last_error = ""; - file_indent_type = INDENT_NONE; for (int i = 0; i < MAX_LOOKAHEAD + 1; i++) _advance(); } @@ -1187,7 +1156,17 @@ int GDScriptTokenizerText::get_token_line_indent(int p_offset) const { int ofs = (TK_RB_SIZE + tk_rb_pos + p_offset - MAX_LOOKAHEAD - 1) % TK_RB_SIZE; ERR_FAIL_COND_V(tk_rb[ofs].type != TK_NEWLINE, 0); - return tk_rb[ofs].constant; + return tk_rb[ofs].constant.operator Vector2().x; +} + +int GDScriptTokenizerText::get_token_line_tab_indent(int p_offset) const { + + ERR_FAIL_COND_V(p_offset <= -MAX_LOOKAHEAD, 0); + ERR_FAIL_COND_V(p_offset >= MAX_LOOKAHEAD, 0); + + int ofs = (TK_RB_SIZE + tk_rb_pos + p_offset - MAX_LOOKAHEAD - 1) % TK_RB_SIZE; + ERR_FAIL_COND_V(tk_rb[ofs].type != TK_NEWLINE, 0); + return tk_rb[ofs].constant.operator Vector2().y; } String GDScriptTokenizerText::get_token_error(int p_offset) const { diff --git a/modules/gdscript/gdscript_tokenizer.h b/modules/gdscript/gdscript_tokenizer.h index 89d586b912..58749012b7 100644 --- a/modules/gdscript/gdscript_tokenizer.h +++ b/modules/gdscript/gdscript_tokenizer.h @@ -168,6 +168,7 @@ public: virtual int get_token_line(int p_offset = 0) const = 0; virtual int get_token_column(int p_offset = 0) const = 0; virtual int get_token_line_indent(int p_offset = 0) const = 0; + virtual int get_token_line_tab_indent(int p_offset = 0) const = 0; virtual String get_token_error(int p_offset = 0) const = 0; virtual void advance(int p_amount = 1) = 0; #ifdef DEBUG_ENABLED @@ -205,7 +206,7 @@ class GDScriptTokenizerText : public GDScriptTokenizer { }; void _make_token(Token p_type); - void _make_newline(int p_spaces = 0); + void _make_newline(int p_indentation = 0, int p_tabs = 0); void _make_identifier(const StringName &p_identifier); void _make_built_in_func(GDScriptFunctions::Function p_func); void _make_constant(const Variant &p_constant); @@ -222,11 +223,6 @@ class GDScriptTokenizerText : public GDScriptTokenizer { int tk_rb_pos; String last_error; bool error_flag; - enum { - INDENT_NONE, - INDENT_SPACES, - INDENT_TABS, - } file_indent_type; #ifdef DEBUG_ENABLED Vector<Pair<int, String> > warning_skips; @@ -245,6 +241,7 @@ public: virtual int get_token_line(int p_offset = 0) const; virtual int get_token_column(int p_offset = 0) const; virtual int get_token_line_indent(int p_offset = 0) const; + virtual int get_token_line_tab_indent(int p_offset = 0) const; virtual const Variant &get_token_constant(int p_offset = 0) const; virtual String get_token_error(int p_offset = 0) const; virtual void advance(int p_amount = 1); @@ -283,6 +280,7 @@ public: virtual int get_token_line(int p_offset = 0) const; virtual int get_token_column(int p_offset = 0) const; virtual int get_token_line_indent(int p_offset = 0) const; + virtual int get_token_line_tab_indent(int p_offset = 0) const { return 0; } virtual const Variant &get_token_constant(int p_offset = 0) const; virtual String get_token_error(int p_offset = 0) const; virtual void advance(int p_amount = 1); diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index c289ff6c07..f2c0e7035b 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -117,8 +117,7 @@ void GDScriptWorkspace::reload_all_workspace_scripts() { if (S) { err_msg += "\n" + S->get()->get_error(); } - ERR_EXPLAIN(err_msg); - ERR_CONTINUE(err != OK); + ERR_CONTINUE_MSG(err != OK, err_msg); } } } diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index 1bd3d72066..b762868f2c 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -217,6 +217,14 @@ Deprecated, use [member mesh_library] instead. </member> </members> + <signals> + <signal name="cell_size_changed"> + <argument index="0" name="cell_size" type="Vector3"> + </argument> + <description> + </description> + </signal> + </signals> <constants> <constant name="INVALID_CELL_ITEM" value="-1"> Invalid cell item that can be used in [method set_cell_item] to clear cells (or represent an empty cell in [method get_cell_item]). diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index b36afd4386..47ac0de7f9 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -227,10 +227,10 @@ Ref<MeshLibrary> GridMap::get_mesh_library() const { } void GridMap::set_cell_size(const Vector3 &p_size) { - ERR_FAIL_COND(p_size.x < 0.001 || p_size.y < 0.001 || p_size.z < 0.001); cell_size = p_size; _recreate_octant_data(); + emit_signal("cell_size_changed", cell_size); } Vector3 GridMap::get_cell_size() const { @@ -902,6 +902,8 @@ void GridMap::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); BIND_CONSTANT(INVALID_CELL_ITEM); + + ADD_SIGNAL(MethodInfo("cell_size_changed", PropertyInfo(Variant::VECTOR3, "cell_size"))); } void GridMap::set_clip(bool p_enabled, bool p_clip_above, int p_floor, Vector3::Axis p_axis) { diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index c97524a54d..1bd570c55f 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -40,11 +40,8 @@ void GridMapEditor::_node_removed(Node *p_node) { - if (p_node == node) { + if (p_node == node) node = NULL; - hide(); - mesh_library_palette->hide(); - } } void GridMapEditor::_configure() { @@ -279,6 +276,7 @@ void GridMapEditor::_update_cursor_transform() { cursor_transform = Transform(); cursor_transform.origin = cursor_origin; cursor_transform.basis.set_orthogonal_index(cursor_rot); + cursor_transform.basis *= node->get_cell_scale(); cursor_transform = node->get_global_transform() * cursor_transform; if (cursor_instance.is_valid()) { @@ -301,7 +299,7 @@ void GridMapEditor::_update_selection_transform() { } Transform xf; - xf.scale(Vector3(1, 1, 1) * (Vector3(1, 1, 1) + (selection.end - selection.begin)) * node->get_cell_size()); + xf.scale((Vector3(1, 1, 1) + (selection.end - selection.begin)) * node->get_cell_size()); xf.origin = selection.begin * node->get_cell_size(); VisualServer::get_singleton()->instance_set_transform(selection_instance, node->get_global_transform() * xf); @@ -353,7 +351,14 @@ void GridMapEditor::_set_selection(bool p_active, const Vector3 &p_begin, const selection.click = p_begin; selection.current = p_end; - _update_selection_transform(); + if (is_visible_in_tree()) { + _update_selection_transform(); + } + + options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_CLEAR), !selection.active); + options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_CUT), !selection.active); + options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_DUPLICATE), !selection.active); + options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_FILL), !selection.active); } bool GridMapEditor::do_input_action(Camera *p_camera, const Point2 &p_point, bool p_click) { @@ -591,7 +596,7 @@ void GridMapEditor::_update_paste_indicator() { Basis item_rot; item_rot.set_orthogonal_index(item.orientation); - xf.basis = item_rot * xf.basis; + xf.basis = item_rot * xf.basis * node->get_cell_scale(); VisualServer::get_singleton()->instance_set_transform(item.instance, node->get_global_transform() * xf); } @@ -929,9 +934,10 @@ void GridMapEditor::update_palette() { } void GridMapEditor::edit(GridMap *p_gridmap) { + if (!p_gridmap && node) + node->disconnect("cell_size_changed", this, "_draw_grids"); node = p_gridmap; - VS *vs = VS::get_singleton(); input_action = INPUT_NONE; selection.active = false; @@ -957,75 +963,13 @@ void GridMapEditor::edit(GridMap *p_gridmap) { set_process(true); - Vector3 edited_floor = p_gridmap->has_meta("_editor_floor_") ? p_gridmap->get_meta("_editor_floor_") : Variant(); clip_mode = p_gridmap->has_meta("_editor_clip_") ? ClipMode(p_gridmap->get_meta("_editor_clip_").operator int()) : CLIP_DISABLED; - for (int i = 0; i < 3; i++) { - if (vs->mesh_get_surface_count(grid[i]) > 0) - vs->mesh_remove_surface(grid[i], 0); - edit_floor[i] = edited_floor[i]; - } - - { - - // Update grids. - indicator_mat.instance(); - indicator_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - indicator_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); - indicator_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); - indicator_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); - indicator_mat->set_albedo(Color(0.8, 0.5, 0.1)); - - Vector<Vector3> grid_points[3]; - Vector<Color> grid_colors[3]; - - float cell_size[3] = { p_gridmap->get_cell_size().x, p_gridmap->get_cell_size().y, p_gridmap->get_cell_size().z }; - - for (int i = 0; i < 3; i++) { - - Vector3 axis; - axis[i] = 1; - Vector3 axis_n1; - axis_n1[(i + 1) % 3] = cell_size[(i + 1) % 3]; - Vector3 axis_n2; - axis_n2[(i + 2) % 3] = cell_size[(i + 2) % 3]; - - for (int j = -GRID_CURSOR_SIZE; j <= GRID_CURSOR_SIZE; j++) { - - for (int k = -GRID_CURSOR_SIZE; k <= GRID_CURSOR_SIZE; k++) { - - Vector3 p = axis_n1 * j + axis_n2 * k; - float trans = Math::pow(MAX(0, 1.0 - (Vector2(j, k).length() / GRID_CURSOR_SIZE)), 2); - - Vector3 pj = axis_n1 * (j + 1) + axis_n2 * k; - float transj = Math::pow(MAX(0, 1.0 - (Vector2(j + 1, k).length() / GRID_CURSOR_SIZE)), 2); - - Vector3 pk = axis_n1 * j + axis_n2 * (k + 1); - float transk = Math::pow(MAX(0, 1.0 - (Vector2(j, k + 1).length() / GRID_CURSOR_SIZE)), 2); - - grid_points[i].push_back(p); - grid_points[i].push_back(pk); - grid_colors[i].push_back(Color(1, 1, 1, trans)); - grid_colors[i].push_back(Color(1, 1, 1, transk)); - - grid_points[i].push_back(p); - grid_points[i].push_back(pj); - grid_colors[i].push_back(Color(1, 1, 1, trans)); - grid_colors[i].push_back(Color(1, 1, 1, transj)); - } - } - - Array d; - d.resize(VS::ARRAY_MAX); - d[VS::ARRAY_VERTEX] = grid_points[i]; - d[VS::ARRAY_COLOR] = grid_colors[i]; - VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], VisualServer::PRIMITIVE_LINES, d); - VisualServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid()); - } - } - + _draw_grids(node->get_cell_size()); update_grid(); _update_clip(); + + node->connect("cell_size_changed", this, "_draw_grids"); } void GridMapEditor::_update_clip() { @@ -1055,6 +999,61 @@ void GridMapEditor::update_grid() { updating = false; } +void GridMapEditor::_draw_grids(const Vector3 &cell_size) { + Vector3 edited_floor = node->has_meta("_editor_floor_") ? node->get_meta("_editor_floor_") : Variant(); + + for (int i = 0; i < 3; i++) { + if (VS::get_singleton()->mesh_get_surface_count(grid[i]) > 0) + VS::get_singleton()->mesh_remove_surface(grid[i], 0); + edit_floor[i] = edited_floor[i]; + } + + Vector<Vector3> grid_points[3]; + Vector<Color> grid_colors[3]; + + for (int i = 0; i < 3; i++) { + + Vector3 axis; + axis[i] = 1; + Vector3 axis_n1; + axis_n1[(i + 1) % 3] = cell_size[(i + 1) % 3]; + Vector3 axis_n2; + axis_n2[(i + 2) % 3] = cell_size[(i + 2) % 3]; + + for (int j = -GRID_CURSOR_SIZE; j <= GRID_CURSOR_SIZE; j++) { + + for (int k = -GRID_CURSOR_SIZE; k <= GRID_CURSOR_SIZE; k++) { + + Vector3 p = axis_n1 * j + axis_n2 * k; + float trans = Math::pow(MAX(0, 1.0 - (Vector2(j, k).length() / GRID_CURSOR_SIZE)), 2); + + Vector3 pj = axis_n1 * (j + 1) + axis_n2 * k; + float transj = Math::pow(MAX(0, 1.0 - (Vector2(j + 1, k).length() / GRID_CURSOR_SIZE)), 2); + + Vector3 pk = axis_n1 * j + axis_n2 * (k + 1); + float transk = Math::pow(MAX(0, 1.0 - (Vector2(j, k + 1).length() / GRID_CURSOR_SIZE)), 2); + + grid_points[i].push_back(p); + grid_points[i].push_back(pk); + grid_colors[i].push_back(Color(1, 1, 1, trans)); + grid_colors[i].push_back(Color(1, 1, 1, transk)); + + grid_points[i].push_back(p); + grid_points[i].push_back(pj); + grid_colors[i].push_back(Color(1, 1, 1, trans)); + grid_colors[i].push_back(Color(1, 1, 1, transj)); + } + } + + Array d; + d.resize(VS::ARRAY_MAX); + d[VS::ARRAY_VERTEX] = grid_points[i]; + d[VS::ARRAY_COLOR] = grid_colors[i]; + VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], VisualServer::PRIMITIVE_LINES, d); + VisualServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid()); + } +} + void GridMapEditor::_notification(int p_what) { switch (p_what) { @@ -1193,6 +1192,7 @@ void GridMapEditor::_bind_methods() { ClassDB::bind_method("_node_removed", &GridMapEditor::_node_removed); ClassDB::bind_method(D_METHOD("_set_display_mode", "mode"), &GridMapEditor::_set_display_mode); + ClassDB::bind_method("_draw_grids", &GridMapEditor::_draw_grids); } GridMapEditor::GridMapEditor(EditorNode *p_editor) { @@ -1330,6 +1330,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { info_message->set_valign(Label::VALIGN_CENTER); info_message->set_align(Label::ALIGN_CENTER); info_message->set_autowrap(true); + info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); info_message->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); mesh_library_palette->add_child(info_message); @@ -1465,9 +1466,16 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { } } - selection.active = false; + _set_selection(false); updating = false; accumulated_floor_delta = 0.0; + + indicator_mat.instance(); + indicator_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); + indicator_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + indicator_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + indicator_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + indicator_mat->set_albedo(Color(0.8, 0.5, 0.1)); } GridMapEditor::~GridMapEditor() { diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index 48a07e9c7f..42e62f2842 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -201,7 +201,8 @@ class GridMapEditor : public VBoxContainer { EditorNode *editor; - void update_grid(); + void update_grid(); // Change which and where the grid is displayed + void _draw_grids(const Vector3 &cell_size); void _configure(); void _menu_option(int); void update_palette(); diff --git a/modules/mono/glue/Managed/Files/AABB.cs b/modules/mono/glue/Managed/Files/AABB.cs index 98a73382f4..6a4f785551 100644 --- a/modules/mono/glue/Managed/Files/AABB.cs +++ b/modules/mono/glue/Managed/Files/AABB.cs @@ -458,6 +458,11 @@ namespace Godot return _position == other._position && _size == other._size; } + public bool IsEqualApprox(AABB other) + { + return _position.IsEqualApprox(other._position) && _size.IsEqualApprox(other._size); + } + public override int GetHashCode() { return _position.GetHashCode() ^ _size.GetHashCode(); diff --git a/modules/mono/glue/Managed/Files/Basis.cs b/modules/mono/glue/Managed/Files/Basis.cs index 0eb76e9c63..c5e62b77c8 100644 --- a/modules/mono/glue/Managed/Files/Basis.cs +++ b/modules/mono/glue/Managed/Files/Basis.cs @@ -654,6 +654,11 @@ namespace Godot return Row0.Equals(other.Row0) && Row1.Equals(other.Row1) && Row2.Equals(other.Row2); } + public bool IsEqualApprox(Basis other) + { + return Row0.IsEqualApprox(other.Row0) && Row1.IsEqualApprox(other.Row1) && Row2.IsEqualApprox(other.Row2); + } + public override int GetHashCode() { return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode(); diff --git a/modules/mono/glue/Managed/Files/Color.cs b/modules/mono/glue/Managed/Files/Color.cs index 3a52a1a13b..df817e47e9 100644 --- a/modules/mono/glue/Managed/Files/Color.cs +++ b/modules/mono/glue/Managed/Files/Color.cs @@ -661,6 +661,11 @@ namespace Godot public bool Equals(Color other) { + return r == other.r && g == other.g && b == other.b && a == other.a; + } + + public bool IsEqualApprox(Color other) + { return Mathf.IsEqualApprox(r, other.r) && Mathf.IsEqualApprox(g, other.g) && Mathf.IsEqualApprox(b, other.b) && Mathf.IsEqualApprox(a, other.a); } diff --git a/modules/mono/glue/Managed/Files/Mathf.cs b/modules/mono/glue/Managed/Files/Mathf.cs index ce34cd6a99..54821fe790 100644 --- a/modules/mono/glue/Managed/Files/Mathf.cs +++ b/modules/mono/glue/Managed/Files/Mathf.cs @@ -19,12 +19,12 @@ namespace Godot private const real_t Deg2RadConst = (real_t) 0.0174532925199432957692369077M; // 0.0174532924f and 0.0174532925199433 private const real_t Rad2DegConst = (real_t) 57.295779513082320876798154814M; // 57.29578f and 57.2957795130823 - public static real_t Abs(real_t s) + public static int Abs(int s) { return Math.Abs(s); } - public static int Abs(int s) + public static real_t Abs(real_t s) { return Math.Abs(s); } @@ -79,29 +79,6 @@ namespace Godot return (real_t)Math.Cosh(s); } - public static int StepDecimals(real_t step) - { - double[] sd = new double[] { - 0.9999, - 0.09999, - 0.009999, - 0.0009999, - 0.00009999, - 0.000009999, - 0.0000009999, - 0.00000009999, - 0.000000009999, - }; - double abs = Mathf.Abs(step); - double decs = abs - (int)abs; // Strip away integer part - for (int i = 0; i < sd.Length; i++) { - if (decs >= sd[i]) { - return i; - } - } - return 0; - } - public static real_t Deg2Rad(real_t deg) { return deg * Deg2RadConst; @@ -159,12 +136,14 @@ namespace Godot public static bool IsEqualApprox(real_t a, real_t b) { // Check for exact equality first, required to handle "infinity" values. - if (a == b) { + if (a == b) + { return true; } // Then check for approximate equality. real_t tolerance = Epsilon * Abs(a); - if (tolerance < Epsilon) { + if (tolerance < Epsilon) + { tolerance = Epsilon; } return Abs(a - b) < tolerance; @@ -190,7 +169,8 @@ namespace Godot return from + (to - from) * weight; } - public static real_t LerpAngle(real_t from, real_t to, real_t weight) { + public static real_t LerpAngle(real_t from, real_t to, real_t weight) + { real_t difference = (to - from) % Mathf.Tau; real_t distance = ((2 * difference) % Mathf.Tau) - difference; return from + distance * weight; @@ -246,9 +226,9 @@ namespace Godot /// <summary> /// Performs a canonical Modulus operation, where the output is on the range [0, b). /// </summary> - public static real_t PosMod(real_t a, real_t b) + public static int PosMod(int a, int b) { - real_t c = a % b; + int c = a % b; if ((c < 0 && b > 0) || (c > 0 && b < 0)) { c += b; @@ -259,9 +239,9 @@ namespace Godot /// <summary> /// Performs a canonical Modulus operation, where the output is on the range [0, b). /// </summary> - public static int PosMod(int a, int b) + public static real_t PosMod(real_t a, real_t b) { - int c = a % b; + real_t c = a % b; if ((c < 0 && b > 0) || (c > 0 && b < 0)) { c += b; @@ -319,6 +299,31 @@ namespace Godot return (real_t)Math.Sqrt(s); } + public static int StepDecimals(real_t step) + { + double[] sd = new double[] { + 0.9999, + 0.09999, + 0.009999, + 0.0009999, + 0.00009999, + 0.000009999, + 0.0000009999, + 0.00000009999, + 0.000000009999, + }; + double abs = Mathf.Abs(step); + double decs = abs - (int)abs; // Strip away integer part + for (int i = 0; i < sd.Length; i++) + { + if (decs >= sd[i]) + { + return i; + } + } + return 0; + } + public static real_t Stepify(real_t s, real_t step) { if (step != 0f) diff --git a/modules/mono/glue/Managed/Files/MathfEx.cs b/modules/mono/glue/Managed/Files/MathfEx.cs index 6cffc7f01d..1b7fd4906f 100644 --- a/modules/mono/glue/Managed/Files/MathfEx.cs +++ b/modules/mono/glue/Managed/Files/MathfEx.cs @@ -49,7 +49,8 @@ namespace Godot public static bool IsEqualApprox(real_t a, real_t b, real_t tolerance) { // Check for exact equality first, required to handle "infinity" values. - if (a == b) { + if (a == b) + { return true; } // Then check for approximate equality. diff --git a/modules/mono/glue/Managed/Files/Plane.cs b/modules/mono/glue/Managed/Files/Plane.cs index a13161d2e6..885845e3a4 100644 --- a/modules/mono/glue/Managed/Files/Plane.cs +++ b/modules/mono/glue/Managed/Files/Plane.cs @@ -82,12 +82,12 @@ namespace Godot return Mathf.Abs(dist) <= epsilon; } - public Vector3 Intersect3(Plane b, Plane c) + public Vector3? Intersect3(Plane b, Plane c) { real_t denom = _normal.Cross(b._normal).Dot(c._normal); - if (Mathf.Abs(denom) <= Mathf.Epsilon) - return new Vector3(); + if (Mathf.IsZeroApprox(denom)) + return null; Vector3 result = b._normal.Cross(c._normal) * D + c._normal.Cross(_normal) * b.D + @@ -96,34 +96,35 @@ namespace Godot return result / denom; } - public Vector3 IntersectRay(Vector3 from, Vector3 dir) + public Vector3? IntersectRay(Vector3 from, Vector3 dir) { real_t den = _normal.Dot(dir); - if (Mathf.Abs(den) <= Mathf.Epsilon) - return new Vector3(); + if (Mathf.IsZeroApprox(den)) + return null; real_t dist = (_normal.Dot(from) - D) / den; // This is a ray, before the emitting pos (from) does not exist if (dist > Mathf.Epsilon) - return new Vector3(); + return null; return from + dir * -dist; } - public Vector3 IntersectSegment(Vector3 begin, Vector3 end) + public Vector3? IntersectSegment(Vector3 begin, Vector3 end) { Vector3 segment = begin - end; real_t den = _normal.Dot(segment); - if (Mathf.Abs(den) <= Mathf.Epsilon) - return new Vector3(); + if (Mathf.IsZeroApprox(den)) + return null; real_t dist = (_normal.Dot(begin) - D) / den; + // Only allow dist to be in the range of 0 to 1, with tolerance. if (dist < -Mathf.Epsilon || dist > 1.0f + Mathf.Epsilon) - return new Vector3(); + return null; return begin + segment * -dist; } @@ -203,7 +204,12 @@ namespace Godot public bool Equals(Plane other) { - return _normal == other._normal && Mathf.IsEqualApprox(D, other.D); + return _normal == other._normal && D == other.D; + } + + public bool IsEqualApprox(Plane other) + { + return _normal.IsEqualApprox(other._normal) && Mathf.IsEqualApprox(D, other.D); } public override int GetHashCode() diff --git a/modules/mono/glue/Managed/Files/Quat.cs b/modules/mono/glue/Managed/Files/Quat.cs index 845c7c730e..8f60867ac3 100644 --- a/modules/mono/glue/Managed/Files/Quat.cs +++ b/modules/mono/glue/Managed/Files/Quat.cs @@ -363,6 +363,11 @@ namespace Godot public bool Equals(Quat other) { + return x == other.x && y == other.y && z == other.z && w == other.w; + } + + public bool IsEqualApprox(Quat other) + { return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y) && Mathf.IsEqualApprox(z, other.z) && Mathf.IsEqualApprox(w, other.w); } diff --git a/modules/mono/glue/Managed/Files/Rect2.cs b/modules/mono/glue/Managed/Files/Rect2.cs index 99542d0c0a..91e614dc7b 100644 --- a/modules/mono/glue/Managed/Files/Rect2.cs +++ b/modules/mono/glue/Managed/Files/Rect2.cs @@ -231,6 +231,11 @@ namespace Godot return _position.Equals(other._position) && _size.Equals(other._size); } + public bool IsEqualApprox(Rect2 other) + { + return _position.IsEqualApprox(other._position) && _size.IsEqualApprox(other.Size); + } + public override int GetHashCode() { return _position.GetHashCode() ^ _size.GetHashCode(); diff --git a/modules/mono/glue/Managed/Files/Transform.cs b/modules/mono/glue/Managed/Files/Transform.cs index cc4d26158d..0b84050f07 100644 --- a/modules/mono/glue/Managed/Files/Transform.cs +++ b/modules/mono/glue/Managed/Files/Transform.cs @@ -185,6 +185,11 @@ namespace Godot return basis.Equals(other.basis) && origin.Equals(other.origin); } + public bool IsEqualApprox(Transform other) + { + return basis.IsEqualApprox(other.basis) && origin.IsEqualApprox(other.origin); + } + public override int GetHashCode() { return basis.GetHashCode() ^ origin.GetHashCode(); diff --git a/modules/mono/glue/Managed/Files/Transform2D.cs b/modules/mono/glue/Managed/Files/Transform2D.cs index 814332dc07..77ea3e5830 100644 --- a/modules/mono/glue/Managed/Files/Transform2D.cs +++ b/modules/mono/glue/Managed/Files/Transform2D.cs @@ -357,6 +357,11 @@ namespace Godot return x.Equals(other.x) && y.Equals(other.y) && origin.Equals(other.origin); } + public bool IsEqualApprox(Transform2D other) + { + return x.IsEqualApprox(other.x) && y.IsEqualApprox(other.y) && origin.IsEqualApprox(other.origin); + } + public override int GetHashCode() { return x.GetHashCode() ^ y.GetHashCode() ^ origin.GetHashCode(); diff --git a/modules/mono/glue/Managed/Files/Vector2.cs b/modules/mono/glue/Managed/Files/Vector2.cs index 0daa94057e..f92453f546 100644 --- a/modules/mono/glue/Managed/Files/Vector2.cs +++ b/modules/mono/glue/Managed/Files/Vector2.cs @@ -455,6 +455,11 @@ namespace Godot public bool Equals(Vector2 other) { + return x == other.x && y == other.y; + } + + public bool IsEqualApprox(Vector2 other) + { return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y); } diff --git a/modules/mono/glue/Managed/Files/Vector3.cs b/modules/mono/glue/Managed/Files/Vector3.cs index 9076dbd3b0..025b09199f 100644 --- a/modules/mono/glue/Managed/Files/Vector3.cs +++ b/modules/mono/glue/Managed/Files/Vector3.cs @@ -513,6 +513,11 @@ namespace Godot public bool Equals(Vector3 other) { + return x == other.x && y == other.y && z == other.z; + } + + public bool IsEqualApprox(Vector3 other) + { return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y) && Mathf.IsEqualApprox(z, other.z); } diff --git a/modules/opus/SCsub b/modules/opus/SCsub index 1db5b0987e..8af4f16a26 100644 --- a/modules/opus/SCsub +++ b/modules/opus/SCsub @@ -20,6 +20,9 @@ if env['builtin_opus']: "opus_multistream.c", "opus_multistream_encoder.c", "opus_multistream_decoder.c", + "opus_projection_encoder.c", + "opus_projection_decoder.c", + "mapping_matrix.c", "repacketizer.c", "analysis.c", @@ -53,9 +56,10 @@ if env['builtin_opus']: "celt/vq.c", #"celt/arm/arm_celt_map.c", #"celt/arm/armcpu.c", - #"celt/arm/celt_ne10_fft.c", - #"celt/arm/celt_ne10_mdct.c", + #"celt/arm/celt_fft_ne10.c", + #"celt/arm/celt_mdct_ne10.c", #"celt/arm/celt_neon_intr.c", + #"celt/arm/pitch_neon_intr.c", # Sync with silk_sources.mk "silk/CNG.c", @@ -113,6 +117,7 @@ if env['builtin_opus']: "silk/lin2log.c", "silk/log2lin.c", "silk/LPC_analysis_filter.c", + "silk/LPC_fit.c", "silk/LPC_inv_pred_gain.c", "silk/table_LSF_cos.c", "silk/NLSF2A.c", @@ -150,12 +155,10 @@ if env['builtin_opus']: "silk/fixed/find_pitch_lags_FIX.c", "silk/fixed/find_pred_coefs_FIX.c", "silk/fixed/noise_shape_analysis_FIX.c", - "silk/fixed/prefilter_FIX.c", "silk/fixed/process_gains_FIX.c", "silk/fixed/regularize_correlations_FIX.c", "silk/fixed/residual_energy16_FIX.c", "silk/fixed/residual_energy_FIX.c", - "silk/fixed/solve_LS_FIX.c", "silk/fixed/warped_autocorrelation_FIX.c", "silk/fixed/apply_sine_window_FIX.c", "silk/fixed/autocorr_FIX.c", @@ -180,11 +183,9 @@ if env['builtin_opus']: "silk/float/LTP_analysis_filter_FLP.c", "silk/float/LTP_scale_ctrl_FLP.c", "silk/float/noise_shape_analysis_FLP.c", - "silk/float/prefilter_FLP.c", "silk/float/process_gains_FLP.c", "silk/float/regularize_correlations_FLP.c", "silk/float/residual_energy_FLP.c", - "silk/float/solve_LS_FLP.c", "silk/float/warped_autocorrelation_FLP.c", "silk/float/wrappers_FLP.c", "silk/float/autocorrelation_FLP.c", @@ -193,7 +194,6 @@ if env['builtin_opus']: "silk/float/energy_FLP.c", "silk/float/inner_product_FLP.c", "silk/float/k2a_FLP.c", - "silk/float/levinsondurbin_FLP.c", "silk/float/LPC_inv_pred_gain_FLP.c", "silk/float/pitch_analysis_core_FLP.c", "silk/float/scale_copy_vector_FLP.c", diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 0922471500..10097316ec 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -266,8 +266,8 @@ void AudioStreamOGGVorbis::_bind_methods() { ClassDB::bind_method(D_METHOD("get_loop_offset"), &AudioStreamOGGVorbis::get_loop_offset); ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_data", "get_data"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_loop", "has_loop"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "loop_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_loop_offset", "get_loop_offset"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "loop_offset"), "set_loop_offset", "get_loop_offset"); } AudioStreamOGGVorbis::AudioStreamOGGVorbis() { diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 28a8b77283..12f07aa773 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -368,7 +368,7 @@ float VideoStreamPlaybackTheora::get_time() const { return time - AudioServer::get_singleton()->get_output_latency() - delay_compensation; //-((get_total())/(float)vi.rate); }; -Ref<Texture> VideoStreamPlaybackTheora::get_texture() { +Ref<Texture> VideoStreamPlaybackTheora::get_texture() const { return texture; } @@ -741,6 +741,8 @@ RES ResourceFormatLoaderTheora::load(const String &p_path, const String &p_origi *r_error = OK; } + f->close(); + memdelete(f); return ogv_stream; } diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index 0c37d33358..b241722cd1 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -147,7 +147,7 @@ public: void set_file(const String &p_file); - virtual Ref<Texture> get_texture(); + virtual Ref<Texture> get_texture() const; virtual void update(float p_delta); virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 0cacd0f0b5..bb8612af6f 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1361,6 +1361,7 @@ void VisualScript::_bind_methods() { VisualScript::VisualScript() { base_type = "Object"; + is_tool_script = false; } StringName VisualScript::get_default_func() const { diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index c1a4c58620..6aae2fd15b 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -2163,7 +2163,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da Node *sn = _find_script_node(get_tree()->get_edited_scene_root(), get_tree()->get_edited_scene_root(), script); if (!sn) { - EditorNode::get_singleton()->show_warning(TTR("Can't drop nodes because script '" + get_name() + "' is not used in this scene.")); + EditorNode::get_singleton()->show_warning(vformat(TTR("Can't drop nodes because script '%s' is not used in this scene."), get_name())); return; } @@ -2233,7 +2233,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da Node *sn = _find_script_node(get_tree()->get_edited_scene_root(), get_tree()->get_edited_scene_root(), script); if (!sn && !Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { - EditorNode::get_singleton()->show_warning(TTR("Can't drop properties because script '" + get_name() + "' is not used in this scene.\nDrop holding 'Shift' to just copy the signature.")); + EditorNode::get_singleton()->show_warning(vformat(TTR("Can't drop properties because script '%s' is not used in this scene.\nDrop holding 'Shift' to just copy the signature."), get_name())); return; } @@ -3515,6 +3515,7 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri } Ref<VisualScriptNode> vnode; + Ref<VisualScriptPropertySet> script_prop_set; if (p_category == String("method")) { @@ -3525,8 +3526,8 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri Ref<VisualScriptPropertySet> n; n.instance(); - n->set_property(p_text); vnode = n; + script_prop_set = n; } else if (p_category == String("get")) { Ref<VisualScriptPropertyGet> n; @@ -3578,6 +3579,9 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri undo_redo->add_undo_method(this, "_update_graph", new_id); undo_redo->commit_action(); + if (script_prop_set.is_valid()) + script_prop_set->set_property(p_text); + port_action_new_node = new_id; Ref<VisualScriptNode> vsn = script->get_node(func, port_action_new_node); @@ -4221,7 +4225,7 @@ void VisualScriptEditor::_menu_option(int p_what) { if (nd.is_valid() && nd->has_input_sequence_port()) start_node = nodes.front()->key(); else { - EditorNode::get_singleton()->show_warning(TTR("Select atleast one node with sequence port.")); + EditorNode::get_singleton()->show_warning(TTR("Select at least one node with sequence port.")); return; } } else { @@ -4252,7 +4256,7 @@ void VisualScriptEditor::_menu_option(int p_what) { if (nd.is_valid() && nd->has_input_sequence_port()) start_node = top_nd; else { - EditorNode::get_singleton()->show_warning(TTR("Select atleast one node with sequence port.")); + EditorNode::get_singleton()->show_warning(TTR("Select at least one node with sequence port.")); return; } } else { diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index fa3602ad27..54b284f939 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -230,7 +230,7 @@ void VideoStreamPlaybackWebm::set_audio_track(int p_idx) { audio_track = p_idx; } -Ref<Texture> VideoStreamPlaybackWebm::get_texture() { +Ref<Texture> VideoStreamPlaybackWebm::get_texture() const { return texture; } @@ -484,6 +484,8 @@ RES ResourceFormatLoaderWebm::load(const String &p_path, const String &p_origina *r_error = OK; } + f->close(); + memdelete(f); return webm_stream; } diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h index ddcbb1eb08..4f79d46cce 100644 --- a/modules/webm/video_stream_webm.h +++ b/modules/webm/video_stream_webm.h @@ -90,7 +90,7 @@ public: virtual void set_audio_track(int p_idx); - virtual Ref<Texture> get_texture(); + virtual Ref<Texture> get_texture() const; virtual void update(float p_delta); virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata); diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp index 65b3cf08f5..2fc554fe7a 100644 --- a/modules/xatlas_unwrap/register_types.cpp +++ b/modules/xatlas_unwrap/register_types.cpp @@ -65,8 +65,7 @@ bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver xatlas::Atlas *atlas = xatlas::Create(); printf("Adding mesh..\n"); xatlas::AddMeshError::Enum err = xatlas::AddMesh(atlas, input_mesh, 1); - ERR_EXPLAINC(xatlas::StringForEnum(err)); - ERR_FAIL_COND_V(err != xatlas::AddMeshError::Enum::Success, false); + ERR_FAIL_COND_V_MSG(err != xatlas::AddMeshError::Enum::Success, false, xatlas::StringForEnum(err)); printf("Generate..\n"); xatlas::Generate(atlas, chart_options, NULL, pack_options); diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index a43f195b84..6d021ad33a 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1345,7 +1345,7 @@ public: return logo; } - virtual bool poll_devices() { + virtual bool poll_export() { bool dc = devices_changed; if (dc) { @@ -1355,7 +1355,7 @@ public: return dc; } - virtual int get_device_count() const { + virtual int get_options_count() const { device_lock->lock(); int dc = devices.size(); @@ -1364,20 +1364,31 @@ public: return dc; } - virtual String get_device_name(int p_device) const { + virtual String get_options_tooltip() const { - ERR_FAIL_INDEX_V(p_device, devices.size(), ""); + return TTR("Select device from the list"); + } + + virtual String get_option_label(int p_index) const { + + ERR_FAIL_INDEX_V(p_index, devices.size(), ""); device_lock->lock(); - String s = devices[p_device].name; + String s = devices[p_index].name; device_lock->unlock(); return s; } - virtual String get_device_info(int p_device) const { + virtual String get_option_tooltip(int p_index) const { - ERR_FAIL_INDEX_V(p_device, devices.size(), ""); + ERR_FAIL_INDEX_V(p_index, devices.size(), ""); device_lock->lock(); - String s = devices[p_device].description; + String s = devices[p_index].description; + if (devices.size() == 1) { + // Tooltip will be: + // Name + // Description + s = devices[p_index].name + "\n\n" + s; + } device_lock->unlock(); return s; } 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 739aa285bf..4dae2dcc53 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java @@ -30,7 +30,6 @@ package org.godotengine.godot; -import android.Manifest; import android.annotation.SuppressLint; import android.app.Activity; import android.app.ActivityManager; @@ -56,12 +55,14 @@ import android.hardware.SensorManager; import android.os.Build; import android.os.Bundle; import android.os.Environment; +import android.os.Handler; +import android.os.Looper; import android.os.Messenger; import android.os.VibrationEffect; import android.os.Vibrator; import android.provider.Settings.Secure; import android.support.annotation.Keep; -import android.support.v4.content.ContextCompat; +import android.support.annotation.Nullable; import android.view.Display; import android.view.KeyEvent; import android.view.MotionEvent; @@ -95,14 +96,12 @@ import java.util.Locale; import javax.microedition.khronos.opengles.GL10; import org.godotengine.godot.input.GodotEditText; import org.godotengine.godot.payments.PaymentsManager; +import org.godotengine.godot.utils.PermissionsUtil; import org.godotengine.godot.xr.XRMode; public abstract class Godot extends Activity implements SensorEventListener, IDownloaderClient { static final int MAX_SINGLETONS = 64; - static final int REQUEST_RECORD_AUDIO_PERMISSION = 1; - static final int REQUEST_CAMERA_PERMISSION = 2; - static final int REQUEST_VIBRATE_PERMISSION = 3; private IStub mDownloaderClientStub; private TextView mStatusText; private TextView mProgressFraction; @@ -126,6 +125,9 @@ public abstract class Godot extends Activity implements SensorEventListener, IDo private boolean activityResumed; private int mState; + // Used to dispatch events to the main thread. + private final Handler mainThreadHandler = new Handler(Looper.getMainLooper()); + static private Intent mCurrentIntent; @Override @@ -187,6 +189,20 @@ public abstract class Godot extends Activity implements SensorEventListener, IDo Godot.singletons[Godot.singleton_count++] = this; } + /** + * Invoked once during the Godot Android initialization process after creation of the + * {@link GodotView} view. + * <p> + * This method should be overridden by descendants of this class that would like to add + * their view/layout to the Godot view hierarchy. + * + * @return the view to be included; null if no views should be included. + */ + @Nullable + protected View onMainCreateView(Activity activity) { + return null; + } + protected void onMainActivityResult(int requestCode, int resultCode, Intent data) { } @@ -306,6 +322,20 @@ public abstract class Godot extends Activity implements SensorEventListener, IDo public void run() { GodotLib.setup(current_command_line); setKeepScreenOn("True".equals(GodotLib.getGlobal("display/window/energy_saving/keep_screen_on"))); + + // The Godot Android plugins are setup on completion of GodotLib.setup + mainThreadHandler.post(new Runnable() { + @Override + public void run() { + // Include the non-null views returned in the Godot view hierarchy. + for (int i = 0; i < singleton_count; i++) { + View view = singletons[i].onMainCreateView(Godot.this); + if (view != null) { + layout.addView(view); + } + } + } + }); } }); } @@ -973,32 +1003,15 @@ public abstract class Godot extends Activity implements SensorEventListener, IDo } public boolean requestPermission(String p_name) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { - // Not necessary, asked on install already - return true; - } - - if (p_name.equals("RECORD_AUDIO")) { - if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) { - requestPermissions(new String[] { Manifest.permission.RECORD_AUDIO }, REQUEST_RECORD_AUDIO_PERMISSION); - return false; - } - } + return PermissionsUtil.requestPermission(p_name, this); + } - if (p_name.equals("CAMERA")) { - if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { - requestPermissions(new String[] { Manifest.permission.CAMERA }, REQUEST_CAMERA_PERMISSION); - return false; - } - } + public boolean requestPermissions() { + return PermissionsUtil.requestManifestPermissions(this); + } - if (p_name.equals("VIBRATE")) { - if (ContextCompat.checkSelfPermission(this, Manifest.permission.VIBRATE) != PackageManager.PERMISSION_GRANTED) { - requestPermissions(new String[] { Manifest.permission.VIBRATE }, REQUEST_VIBRATE_PERMISSION); - return false; - } - } - return true; + public String[] getGrantedPermissions() { + return PermissionsUtil.getGrantedPermissions(this); } /** 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 new file mode 100644 index 0000000000..2c4a444e5a --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java @@ -0,0 +1,157 @@ +package org.godotengine.godot.utils; + +import android.Manifest; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.pm.PermissionInfo; +import android.os.Build; +import android.support.v4.content.ContextCompat; +import java.util.ArrayList; +import java.util.List; +import org.godotengine.godot.Godot; + +/** + * This class includes utility functions for Android permissions related operations. + * @author Cagdas Caglak <cagdascaglak@gmail.com> + */ +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; + + private PermissionsUtil() { + } + + /** + * Request a dangerous permission. name must be specified in <a href="https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/res/AndroidManifest.xml">this</a> + * @param name the name of the requested permission. + * @param activity the caller activity for this method. + * @return true/false. "true" if permission was granted otherwise returns "false". + */ + public static boolean requestPermission(String name, Godot activity) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + // Not necessary, asked on install already + return true; + } + + if (name.equals("RECORD_AUDIO") && ContextCompat.checkSelfPermission(activity, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) { + activity.requestPermissions(new String[] { Manifest.permission.RECORD_AUDIO }, REQUEST_RECORD_AUDIO_PERMISSION); + return false; + } + + if (name.equals("CAMERA") && ContextCompat.checkSelfPermission(activity, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { + activity.requestPermissions(new String[] { Manifest.permission.CAMERA }, REQUEST_CAMERA_PERMISSION); + return false; + } + + if (name.equals("VIBRATE") && ContextCompat.checkSelfPermission(activity, Manifest.permission.VIBRATE) != PackageManager.PERMISSION_GRANTED) { + activity.requestPermissions(new String[] { Manifest.permission.VIBRATE }, REQUEST_VIBRATE_PERMISSION); + return false; + } + return true; + } + + /** + * Request dangerous permissions which are defined in the Android manifest file from the user. + * @param activity the caller activity for this method. + * @return true/false. "true" if all permissions were granted otherwise returns "false". + */ + public static boolean requestManifestPermissions(Godot activity) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + return true; + } + + String[] manifestPermissions; + try { + manifestPermissions = getManifestPermissions(activity); + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + return false; + } + + if (manifestPermissions == null || manifestPermissions.length == 0) + return true; + + List<String> dangerousPermissions = 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); + } + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + return false; + } + } + + if (dangerousPermissions.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); + return false; + } + + /** + * With this function you can get the list of dangerous permissions that have been granted to the Android application. + * @param activity the caller activity for this method. + * @return granted permissions list + */ + public static String[] getGrantedPermissions(Godot activity) { + String[] manifestPermissions; + try { + manifestPermissions = getManifestPermissions(activity); + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + return new String[0]; + } + if (manifestPermissions == null || manifestPermissions.length == 0) + return new String[0]; + + List<String> dangerousPermissions = 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); + } + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + return new String[0]; + } + } + + return dangerousPermissions.toArray(new String[0]); + } + + /** + * Returns the permissions defined in the AndroidManifest.xml file. + * @param activity the caller activity for this method. + * @return manifest permissions list + * @throws PackageManager.NameNotFoundException the exception is thrown when a given package, application, or component name cannot be found. + */ + private static String[] getManifestPermissions(Godot activity) throws PackageManager.NameNotFoundException { + PackageManager packageManager = activity.getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(activity.getPackageName(), PackageManager.GET_PERMISSIONS); + return packageInfo.requestedPermissions; + } + + /** + * Returns the information of the desired permission. + * @param activity the caller activity for this method. + * @param permission the name of the permission. + * @return permission info object + * @throws PackageManager.NameNotFoundException the exception is thrown when a given package, application, or component name cannot be found. + */ + private static PermissionInfo getPermissionInfo(Godot activity, String permission) throws PackageManager.NameNotFoundException { + PackageManager packageManager = activity.getPackageManager(); + return packageManager.getPermissionInfo(permission, 0); + } +} diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index 7daea19961..a14e0a1960 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -1393,6 +1393,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResu if (permission == "android.permission.RECORD_AUDIO" && p_result) { AudioDriver::get_singleton()->capture_start(); } + + if (os_android->get_main_loop()) { + os_android->get_main_loop()->emit_signal("on_request_permissions_result", permission, p_result == JNI_TRUE); + } } JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererResumed(JNIEnv *env, jclass clazz) { diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index 8194ee6ecf..e3e613d30b 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -59,6 +59,8 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_godot_instance) { _get_clipboard = p_env->GetMethodID(cls, "getClipboard", "()Ljava/lang/String;"); _set_clipboard = p_env->GetMethodID(cls, "setClipboard", "(Ljava/lang/String;)V"); _request_permission = p_env->GetMethodID(cls, "requestPermission", "(Ljava/lang/String;)Z"); + _request_permissions = p_env->GetMethodID(cls, "requestPermissions", "()Z"); + _get_granted_permissions = p_env->GetMethodID(cls, "getGrantedPermissions", "()[Ljava/lang/String;"); _init_input_devices = p_env->GetMethodID(cls, "initInputDevices", "()V"); _get_surface = p_env->GetMethodID(cls, "getSurface", "()Landroid/view/Surface;"); _is_activity_resumed = p_env->GetMethodID(cls, "isActivityResumed", "()Z"); @@ -199,6 +201,34 @@ bool GodotJavaWrapper::request_permission(const String &p_name) { } } +bool GodotJavaWrapper::request_permissions() { + if (_request_permissions) { + JNIEnv *env = ThreadAndroid::get_env(); + return env->CallBooleanMethod(godot_instance, _request_permissions); + } else { + return false; + } +} + +Vector<String> GodotJavaWrapper::get_granted_permissions() const { + Vector<String> permissions_list; + if (_get_granted_permissions) { + JNIEnv *env = ThreadAndroid::get_env(); + jobject permissions_object = env->CallObjectMethod(godot_instance, _get_granted_permissions); + jobjectArray *arr = reinterpret_cast<jobjectArray *>(&permissions_object); + + int i = 0; + jsize len = env->GetArrayLength(*arr); + for (i = 0; i < len; i++) { + jstring jstr = (jstring)env->GetObjectArrayElement(*arr, i); + String str = jstring_to_string(jstr, env); + permissions_list.push_back(str); + env->DeleteLocalRef(jstr); + } + } + return permissions_list; +} + void GodotJavaWrapper::init_input_devices() { if (_init_input_devices) { JNIEnv *env = ThreadAndroid::get_env(); diff --git a/platform/android/java_godot_wrapper.h b/platform/android/java_godot_wrapper.h index b1bd9b7f48..d23ff273cb 100644 --- a/platform/android/java_godot_wrapper.h +++ b/platform/android/java_godot_wrapper.h @@ -54,6 +54,8 @@ private: jmethodID _get_clipboard = 0; jmethodID _set_clipboard = 0; jmethodID _request_permission = 0; + jmethodID _request_permissions = 0; + jmethodID _get_granted_permissions = 0; jmethodID _init_input_devices = 0; jmethodID _get_surface = 0; jmethodID _is_activity_resumed = 0; @@ -81,6 +83,8 @@ public: bool has_set_clipboard(); void set_clipboard(const String &p_text); bool request_permission(const String &p_name); + bool request_permissions(); + Vector<String> get_granted_permissions() const; void init_input_devices(); jobject get_surface(); bool is_activity_resumed(); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 91bd6cbdd2..9156181bbe 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -49,6 +49,9 @@ #include "java_godot_io_wrapper.h" #include "java_godot_wrapper.h" +#define PAN_GESTURE_MIN_DELTA 5 // only advertise PanGesture event with dx and dy greater than this +#define MAGNIFY_GESTURE_MIN_FACTOR 0.1 // only advertise MagnifyGesture event with a factor difference from 1.0 greater than this + class AndroidLogger : public Logger { public: virtual void logv(const char *p_format, va_list p_list, bool p_err) { @@ -220,6 +223,16 @@ bool OS_Android::request_permission(const String &p_name) { return godot_java->request_permission(p_name); } +bool OS_Android::request_permissions() { + + return godot_java->request_permissions(); +} + +Vector<String> OS_Android::get_granted_permissions() const { + + return godot_java->get_granted_permissions(); +} + Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW); ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ", error: " + dlerror() + "."); @@ -396,6 +409,35 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ERR_FAIL_COND(touch.size() != p_points.size()); + if (touch.size() == 1) { + Point2 d = (p_points[0].pos - touch.write[0].pos); + if (fabs(d.x) > PAN_GESTURE_MIN_DELTA || fabs(d.y) > PAN_GESTURE_MIN_DELTA) { + Ref<InputEventPanGesture> ev; + ev.instance(); + ev->set_position(p_points[0].pos); + ev->set_delta(d); + input->parse_input_event(ev); + touch.write[0].pos = p_points[0].pos; + } + } else if (touch.size() == 2) { + Point2 v0 = touch[1].pos - touch[0].pos; + float l0 = (v0.x * v0.x) + (v0.y * v0.y); + if (l0 != 0.0) { + Point2 v1 = p_points[1].pos - p_points[0].pos; + float l1 = (v1.x * v1.x) + (v1.y * v1.y); + float f = (l1 / l0); + if (fabs(f - 1.0) > MAGNIFY_GESTURE_MIN_FACTOR) { + Ref<InputEventMagnifyGesture> ev; + ev.instance(); + ev->set_position(p_points[0].pos + v1 / 2); + ev->set_factor(sqrt(f)); + input->parse_input_event(ev); + touch.write[0].pos = p_points[0].pos; + touch.write[1].pos = p_points[1].pos; + } + } + } + for (int i = 0; i < touch.size(); i++) { int idx = -1; @@ -410,7 +452,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ERR_CONTINUE(idx == -1); if (touch[i].pos == p_points[idx].pos) - continue; //no move unncesearily + continue; //no unnecessary move Ref<InputEventScreenDrag> ev; ev.instance(); diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 9bad9b2e01..a290c0cedd 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -125,6 +125,8 @@ public: virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); virtual bool request_permission(const String &p_name); + virtual bool request_permissions(); + virtual Vector<String> get_granted_permissions() const; virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false); diff --git a/platform/iphone/gl_view.h b/platform/iphone/gl_view.h index 4fb721f159..e3c9d212f0 100644 --- a/platform/iphone/gl_view.h +++ b/platform/iphone/gl_view.h @@ -79,8 +79,6 @@ @property(strong, nonatomic) AVPlayer *avPlayer; @property(strong, nonatomic) AVPlayerLayer *avPlayerLayer; -// Old videoplayer properties -@property(strong, nonatomic) MPMoviePlayerController *moviePlayerController; @property(strong, nonatomic) UIWindow *backgroundWindow; @property(nonatomic) UITextAutocorrectionType autocorrectionType; diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index dfca2e3dd7..4e6b8e1ada 100644 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -340,6 +340,7 @@ static void clear_touches() { [EAGLContext setCurrentContext:context]; [self destroyFramebuffer]; [self createFramebuffer]; + [self drawView]; } - (BOOL)createFramebuffer { @@ -455,23 +456,23 @@ static void clear_touches() { // Updates the OpenGL view when the timer fires - (void)drawView { + + if (!active) { + printf("draw view not active!\n"); + return; + }; if (useCADisplayLink) { // Pause the CADisplayLink to avoid recursion [displayLink setPaused:YES]; // Process all input events - while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource) + while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, TRUE) == kCFRunLoopRunHandledSource) ; // We are good to go, resume the CADisplayLink [displayLink setPaused:NO]; } - if (!active) { - printf("draw view not active!\n"); - return; - }; - // Make sure that you are drawing to the current context [EAGLContext setCurrentContext:context]; @@ -729,40 +730,4 @@ static void clear_touches() { _stop_video(); } -/* -- (void)moviePlayBackDidFinish:(NSNotification*)notification { - - - NSNumber* reason = [[notification userInfo] objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey]; - switch ([reason intValue]) { - case MPMovieFinishReasonPlaybackEnded: - //NSLog(@"Playback Ended"); - break; - case MPMovieFinishReasonPlaybackError: - //NSLog(@"Playback Error"); - video_found_error = true; - break; - case MPMovieFinishReasonUserExited: - //NSLog(@"User Exited"); - video_found_error = true; - break; - default: - //NSLog(@"Unsupported reason!"); - break; - } - - MPMoviePlayerController *player = [notification object]; - - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:MPMoviePlayerPlaybackDidFinishNotification - object:player]; - - [_instance.moviePlayerController stop]; - [_instance.moviePlayerController.view removeFromSuperview]; - - video_playing = false; -} -*/ - @end diff --git a/platform/iphone/godot_iphone.cpp b/platform/iphone/godot_iphone.cpp index db93db5021..992da2818b 100644 --- a/platform/iphone/godot_iphone.cpp +++ b/platform/iphone/godot_iphone.cpp @@ -47,7 +47,7 @@ int iphone_main(int, int, int, char **, String); int iphone_main(int width, int height, int argc, char **argv, String data_dir) { - int len = strlen(argv[0]); + size_t len = strlen(argv[0]); while (len--) { if (argv[0][len] == '/') break; diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index 490e84c571..8eef430621 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -92,7 +92,7 @@ void InAppStore::_bind_methods() { PoolStringArray localized_prices; PoolStringArray currency_codes; - for (int i = 0; i < [products count]; i++) { + for (NSUInteger i = 0; i < [products count]; i++) { SKProduct *product = [products objectAtIndex:i]; diff --git a/platform/iphone/ios.h b/platform/iphone/ios.h index 91c4725b35..ef45fc7ac3 100644 --- a/platform/iphone/ios.h +++ b/platform/iphone/ios.h @@ -42,6 +42,7 @@ class iOS : public Object { public: static void alert(const char *p_alert, const char *p_title); + String get_model() const; String get_rate_url(int p_app_id) const; iOS(); diff --git a/platform/iphone/ios.mm b/platform/iphone/ios.mm index 686422ceb2..6e986df493 100644 --- a/platform/iphone/ios.mm +++ b/platform/iphone/ios.mm @@ -29,6 +29,7 @@ /*************************************************************************/ #include "ios.h" +#include <sys/sysctl.h> #import <UIKit/UIKit.h> @@ -42,6 +43,21 @@ void iOS::alert(const char *p_alert, const char *p_title) { [alert show]; } +String iOS::get_model() const { + // [[UIDevice currentDevice] model] only returns "iPad" or "iPhone". + size_t size; + sysctlbyname("hw.machine", NULL, &size, NULL, 0); + char *model = (char *)malloc(size); + if (model == NULL) { + return ""; + } + sysctlbyname("hw.machine", model, &size, NULL, 0); + NSString *platform = [NSString stringWithCString:model encoding:NSUTF8StringEncoding]; + free(model); + const char *str = [platform UTF8String]; + return String(str != NULL ? str : ""); +} + String iOS::get_rate_url(int p_app_id) const { String templ = "itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID"; String templ_iOS7 = "itms-apps://itunes.apple.com/app/idAPP_ID"; diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 353078c51c..83b0660ef7 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -47,8 +47,6 @@ #include "semaphore_iphone.h" -#include "ios.h" - #include <dlfcn.h> int OSIPhone::get_video_driver_count() const { @@ -184,7 +182,8 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p Engine::get_singleton()->add_singleton(Engine::Singleton("ICloud", icloud)); //icloud->connect(); #endif - Engine::get_singleton()->add_singleton(Engine::Singleton("iOS", memnew(iOS))); + ios = memnew(iOS); + Engine::get_singleton()->add_singleton(Engine::Singleton("iOS", ios)); return OK; }; @@ -507,6 +506,15 @@ String OSIPhone::get_name() const { return "iOS"; }; +String OSIPhone::get_model_name() const { + + String model = ios->get_model(); + if (model != "") + return model; + + return OS_Unix::get_model_name(); +} + Size2 OSIPhone::get_window_size() const { return Vector2(video_mode.width, video_mode.height); diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index 804ba0b1af..63799bbae8 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -41,6 +41,7 @@ #include "game_center.h" #include "icloud.h" #include "in_app_store.h" +#include "ios.h" #include "main/input_default.h" #include "servers/audio_server.h" #include "servers/visual/rasterizer.h" @@ -72,6 +73,7 @@ private: #ifdef ICLOUD_ENABLED ICloud *icloud; #endif + iOS *ios; MainLoop *main_loop; @@ -178,6 +180,7 @@ public: void set_data_dir(String p_dir); virtual String get_name() const; + virtual String get_model_name() const; Error shell_open(String p_uri); diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 4de98f7039..f3e8d6911a 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#include "core/io/tcp_server.h" #include "core/io/zip_io.h" #include "editor/editor_export.h" #include "editor/editor_node.h" @@ -38,16 +39,153 @@ #define EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE "webassembly_release.zip" #define EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG "webassembly_debug.zip" +class EditorHTTPServer : public Reference { + +private: + Ref<TCP_Server> server; + Ref<StreamPeerTCP> connection; + uint64_t time; + uint8_t req_buf[4096]; + int req_pos; + + void _clear_client() { + connection = Ref<StreamPeerTCP>(); + memset(req_buf, 0, sizeof(req_buf)); + time = 0; + req_pos = 0; + } + +public: + EditorHTTPServer() { + server.instance(); + stop(); + } + + void stop() { + server->stop(); + _clear_client(); + } + + Error listen(int p_port, IP_Address p_address) { + return server->listen(p_port, p_address); + } + + bool is_listening() const { + return server->is_listening(); + } + + void _send_response() { + Vector<String> psa = String((char *)req_buf).split("\r\n"); + int len = psa.size(); + ERR_FAIL_COND_MSG(len < 4, "Not enough response headers, got: " + itos(len) + ", expected >= 4."); + + Vector<String> req = psa[0].split(" ", false); + ERR_FAIL_COND_MSG(req.size() < 2, "Invalid protocol or status code."); + + // Wrong protocol + ERR_FAIL_COND_MSG(req[0] != "GET" || req[2] != "HTTP/1.1", "Invalid method or HTTP version."); + + String filepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_js_export"); + String basereq = "/tmp_js_export"; + if (req[1] == basereq + ".html") { + filepath += ".html"; + } else if (req[1] == basereq + ".js") { + filepath += ".js"; + } else if (req[1] == basereq + ".pck") { + filepath += ".pck"; + } else if (req[1] == basereq + ".png") { + filepath += ".png"; + } else if (req[1] == basereq + ".wasm") { + filepath += ".wasm"; + } else { + String s = "HTTP/1.1 404 Not Found\r\n"; + s += "Connection: Close\r\n"; + s += "\r\n"; + CharString cs = s.utf8(); + connection->put_data((const uint8_t *)cs.get_data(), cs.size() - 1); + return; + } + FileAccess *f = FileAccess::open(filepath, FileAccess::READ); + ERR_FAIL_COND(!f); + String s = "HTTP/1.1 200 OK\r\n"; + s += "Connection: Close\r\n"; + s += "\r\n"; + CharString cs = s.utf8(); + Error err = connection->put_data((const uint8_t *)cs.get_data(), cs.size() - 1); + ERR_FAIL_COND(err != OK); + + while (true) { + uint8_t bytes[4096]; + int read = f->get_buffer(bytes, 4096); + if (read < 1) { + break; + } + err = connection->put_data(bytes, read); + ERR_FAIL_COND(err != OK); + } + } + + void poll() { + if (!server->is_listening()) + return; + if (connection.is_null()) { + if (!server->is_connection_available()) + return; + connection = server->take_connection(); + time = OS::get_singleton()->get_ticks_usec(); + } + if (OS::get_singleton()->get_ticks_usec() - time > 1000000) { + _clear_client(); + return; + } + if (connection->get_status() != StreamPeerTCP::STATUS_CONNECTED) + return; + + while (true) { + + char *r = (char *)req_buf; + int l = req_pos - 1; + if (l > 3 && r[l] == '\n' && r[l - 1] == '\r' && r[l - 2] == '\n' && r[l - 3] == '\r') { + _send_response(); + _clear_client(); + return; + } + + int read = 0; + ERR_FAIL_COND(req_pos >= 4096); + Error err = connection->get_partial_data(&req_buf[req_pos], 1, read); + if (err != OK) { + // Got an error + _clear_client(); + return; + } else if (read != 1) { + // Busy, wait next poll + return; + } + req_pos += read; + } + } +}; + class EditorExportPlatformJavaScript : public EditorExportPlatform { GDCLASS(EditorExportPlatformJavaScript, EditorExportPlatform); Ref<ImageTexture> logo; Ref<ImageTexture> run_icon; - bool runnable_when_last_polled; + Ref<ImageTexture> stop_icon; + int menu_options; void _fix_html(Vector<uint8_t> &p_html, const Ref<EditorExportPreset> &p_preset, const String &p_name, bool p_debug); +private: + Ref<EditorHTTPServer> server; + bool server_quit; + Mutex *server_lock; + Thread *server_thread; + + static void _server_thread_poll(void *data); + public: virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features); @@ -61,11 +199,12 @@ public: virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const; virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0); - virtual bool poll_devices(); - virtual int get_device_count() const; - virtual String get_device_name(int p_device) const { return TTR("Run in Browser"); } - virtual String get_device_info(int p_device) const { return TTR("Run exported HTML in the system's default browser."); } - virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags); + virtual bool poll_export(); + virtual int get_options_count() const; + virtual String get_option_label(int p_index) const { return p_index ? TTR("Stop HTTP Server") : TTR("Run in Browser"); } + virtual String get_option_tooltip(int p_index) const { return p_index ? TTR("Stop HTTP Server") : TTR("Run exported HTML in the system's default browser."); } + virtual Ref<ImageTexture> get_option_icon(int p_index) const; + virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_option, int p_debug_flags); virtual Ref<Texture> get_run_icon() const; virtual void get_platform_features(List<String> *r_features) { @@ -78,6 +217,7 @@ public: } EditorExportPlatformJavaScript(); + ~EditorExportPlatformJavaScript(); }; void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t> &p_html, const Ref<EditorExportPreset> &p_preset, const String &p_name, bool p_debug) { @@ -337,7 +477,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese return OK; } -bool EditorExportPlatformJavaScript::poll_devices() { +bool EditorExportPlatformJavaScript::poll_export() { Ref<EditorExportPreset> preset; @@ -350,17 +490,37 @@ bool EditorExportPlatformJavaScript::poll_devices() { } } - bool prev = runnable_when_last_polled; - runnable_when_last_polled = preset.is_valid(); - return runnable_when_last_polled != prev; + int prev = menu_options; + menu_options = preset.is_valid(); + if (server->is_listening()) { + if (menu_options == 0) { + server_lock->lock(); + server->stop(); + server_lock->unlock(); + } else { + menu_options += 1; + } + } + return menu_options != prev; +} + +Ref<ImageTexture> EditorExportPlatformJavaScript::get_option_icon(int p_index) const { + return p_index == 1 ? stop_icon : EditorExportPlatform::get_option_icon(p_index); } -int EditorExportPlatformJavaScript::get_device_count() const { +int EditorExportPlatformJavaScript::get_options_count() const { - return runnable_when_last_polled; + return menu_options; } -Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) { +Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_option, int p_debug_flags) { + + if (p_option == 1) { + server_lock->lock(); + server->stop(); + server_lock->unlock(); + return OK; + } String basepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_js_export"); String path = basepath + ".html"; @@ -374,7 +534,26 @@ Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_prese DirAccess::remove_file_or_error(basepath + ".wasm"); return err; } - OS::get_singleton()->shell_open(String("file://") + path); + + IP_Address bind_ip; + uint16_t bind_port = EDITOR_GET("export/web/http_port"); + // Resolve host if needed. + String bind_host = EDITOR_GET("export/web/http_host"); + if (bind_host.is_valid_ip_address()) { + bind_ip = bind_host; + } else { + bind_ip = IP::get_singleton()->resolve_hostname(bind_host); + } + ERR_FAIL_COND_V_MSG(!bind_ip.is_valid(), ERR_INVALID_PARAMETER, "Invalid editor setting 'export/web/http_host': '" + bind_host + "'. Try using '127.0.0.1'."); + + // Restart server. + server_lock->lock(); + server->stop(); + err = server->listen(bind_port, bind_ip); + server_lock->unlock(); + ERR_FAIL_COND_V_MSG(err != OK, err, "Unable to start HTTP server."); + + OS::get_singleton()->shell_open(String("http://" + bind_host + ":" + itos(bind_port) + "/tmp_js_export.html")); // FIXME: Find out how to clean up export files after running the successfully // exported game. Might not be trivial. return OK; @@ -385,8 +564,23 @@ Ref<Texture> EditorExportPlatformJavaScript::get_run_icon() const { return run_icon; } +void EditorExportPlatformJavaScript::_server_thread_poll(void *data) { + EditorExportPlatformJavaScript *ej = (EditorExportPlatformJavaScript *)data; + while (!ej->server_quit) { + OS::get_singleton()->delay_usec(1000); + ej->server_lock->lock(); + ej->server->poll(); + ej->server_lock->unlock(); + } +} + EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() { + server.instance(); + server_quit = false; + server_lock = Mutex::create(); + server_thread = Thread::create(_server_thread_poll, this); + Ref<Image> img = memnew(Image(_javascript_logo)); logo.instance(); logo->create_from_image(img); @@ -395,11 +589,29 @@ EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() { run_icon.instance(); run_icon->create_from_image(img); - runnable_when_last_polled = false; + Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme(); + if (theme.is_valid()) + stop_icon = theme->get_icon("Stop", "EditorIcons"); + else + stop_icon.instance(); + + menu_options = 0; +} + +EditorExportPlatformJavaScript::~EditorExportPlatformJavaScript() { + server->stop(); + server_quit = true; + Thread::wait_to_finish(server_thread); + memdelete(server_lock); + memdelete(server_thread); } void register_javascript_exporter() { + EDITOR_DEF("export/web/http_host", "localhost"); + EDITOR_DEF("export/web/http_port", 8060); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "export/web/http_port", PROPERTY_HINT_RANGE, "1,65535,1")); + Ref<EditorExportPlatformJavaScript> platform; platform.instance(); EditorExport::get_singleton()->add_export_platform(platform); diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index b0661cb4dd..652f6a1ce1 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -837,7 +837,7 @@ void OS_JavaScript::set_clipboard(const String &p_text) { var text = UTF8ToString($0); if (!navigator.clipboard || !navigator.clipboard.writeText) return 1; - navigator.clipboard.writeText(text).catch(e => { + navigator.clipboard.writeText(text).catch(function(e) { // Setting OS clipboard is only possible from an input callback. console.error("Setting OS clipboard is only possible from an input callback for the HTML5 plafrom. Exception:", e); }); diff --git a/platform/osx/camera_osx.mm b/platform/osx/camera_osx.mm index f13cf76beb..af09eec2eb 100644 --- a/platform/osx/camera_osx.mm +++ b/platform/osx/camera_osx.mm @@ -150,8 +150,8 @@ { // do Y - int new_width = CVPixelBufferGetWidthOfPlane(pixelBuffer, 0); - int new_height = CVPixelBufferGetHeightOfPlane(pixelBuffer, 0); + size_t new_width = CVPixelBufferGetWidthOfPlane(pixelBuffer, 0); + size_t new_height = CVPixelBufferGetHeightOfPlane(pixelBuffer, 0); if ((width[0] != new_width) || (height[0] != new_height)) { width[0] = new_width; @@ -168,8 +168,8 @@ { // do CbCr - int new_width = CVPixelBufferGetWidthOfPlane(pixelBuffer, 1); - int new_height = CVPixelBufferGetHeightOfPlane(pixelBuffer, 1); + size_t new_width = CVPixelBufferGetWidthOfPlane(pixelBuffer, 1); + size_t new_height = CVPixelBufferGetHeightOfPlane(pixelBuffer, 1); if ((width[1] != new_width) || (height[1] != new_height)) { width[1] = new_width; diff --git a/platform/osx/crash_handler_osx.mm b/platform/osx/crash_handler_osx.mm index e19fdf1b9f..015859b3c0 100644 --- a/platform/osx/crash_handler_osx.mm +++ b/platform/osx/crash_handler_osx.mm @@ -95,7 +95,7 @@ static void handle_crash(int sig) { if (strings) { void *load_addr = (void *)load_address(); - for (int i = 1; i < size; i++) { + for (size_t i = 1; i < size; i++) { char fname[1024]; Dl_info info; @@ -142,7 +142,7 @@ static void handle_crash(int sig) { } } - fprintf(stderr, "[%d] %ls\n", i, output.c_str()); + fprintf(stderr, "[%zu] %ls\n", i, output.c_str()); } free(strings); diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 881ed05025..7882253e7a 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -91,6 +91,9 @@ def configure(env): env['RANLIB'] = mpprefix + "/libexec/llvm-" + mpclangver + "/bin/llvm-ranlib" env['AS'] = mpprefix + "/libexec/llvm-" + mpclangver + "/bin/llvm-as" env.Append(CPPDEFINES=['__MACPORTS__']) #hack to fix libvpx MM256_BROADCASTSI128_SI256 define + else: + env['CC'] = 'clang' + env['CXX'] = 'clang++' detect_darwin_sdk_path('osx', env) env.Append(CCFLAGS=['-isysroot', '$MACOS_SDK_PATH']) diff --git a/platform/osx/dir_access_osx.mm b/platform/osx/dir_access_osx.mm index ada142005b..75f50aaa28 100644 --- a/platform/osx/dir_access_osx.mm +++ b/platform/osx/dir_access_osx.mm @@ -48,18 +48,25 @@ String DirAccessOSX::fix_unicode_name(const char *p_name) const { } int DirAccessOSX::get_drive_count() { - NSArray *vols = [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths]; + NSArray *res_keys = [NSArray arrayWithObjects:NSURLVolumeURLKey, NSURLIsSystemImmutableKey, nil]; + NSArray *vols = [[NSFileManager defaultManager] mountedVolumeURLsIncludingResourceValuesForKeys:res_keys options:NSVolumeEnumerationSkipHiddenVolumes]; + return [vols count]; } String DirAccessOSX::get_drive(int p_drive) { - NSArray *vols = [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths]; + NSArray *res_keys = [NSArray arrayWithObjects:NSURLVolumeURLKey, NSURLIsSystemImmutableKey, nil]; + NSArray *vols = [[NSFileManager defaultManager] mountedVolumeURLsIncludingResourceValuesForKeys:res_keys options:NSVolumeEnumerationSkipHiddenVolumes]; int count = [vols count]; ERR_FAIL_INDEX_V(p_drive, count, ""); - NSString *path = vols[p_drive]; - return String([path UTF8String]); + String volname; + NSString *path = [vols[p_drive] path]; + + volname.parse_utf8([path UTF8String]); + + return volname; } #endif //posix_enabled diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp index fa124dac11..4edf347f61 100644 --- a/platform/osx/joypad_osx.cpp +++ b/platform/osx/joypad_osx.cpp @@ -578,7 +578,7 @@ JoypadOSX::JoypadOSX() { const size_t n_elements = sizeof(vals) / sizeof(vals[0]); CFArrayRef array = okay ? CFArrayCreate(kCFAllocatorDefault, vals, n_elements, &kCFTypeArrayCallBacks) : NULL; - for (int i = 0; i < n_elements; i++) { + for (size_t i = 0; i < n_elements; i++) { if (vals[i]) { CFRelease((CFTypeRef)vals[i]); } diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index f1f37e24d2..09a871f26c 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -31,6 +31,8 @@ #ifndef OS_OSX_H #define OS_OSX_H +#define BitMap _QDBitMap // Suppress deprecated QuickDraw definition. + #include "camera_osx.h" #include "core/os/input.h" #include "crash_handler_osx.h" @@ -50,6 +52,7 @@ #include <ApplicationServices/ApplicationServices.h> #include <CoreVideo/CoreVideo.h> +#undef BitMap #undef CursorShape class OS_OSX : public OS_Unix { diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 51ae264cf7..ba3ac9862e 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -620,7 +620,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType]; Vector<String> files; - for (int i = 0; i < filenames.count; i++) { + for (NSUInteger i = 0; i < filenames.count; i++) { NSString *ns = [filenames objectAtIndex:i]; char *utfs = strdup([ns UTF8String]); String ret; @@ -709,6 +709,11 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { const CGFloat backingScaleFactor = [[event window] backingScaleFactor]; const Vector2 pos = get_mouse_pos([event locationInWindow], backingScaleFactor); mm->set_position(pos); + mm->set_pressure([event pressure]); + if ([event subtype] == NSTabletPointEventSubtype) { + const NSPoint p = [event tilt]; + mm->set_tilt(Vector2(p.x, p.y)); + } mm->set_global_position(pos); mm->set_speed(OS_OSX::singleton->input->get_last_mouse_speed()); Vector2 relativeMotion = Vector2(); @@ -1502,7 +1507,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a [window_object setContentView:window_view]; [window_object setDelegate:window_delegate]; [window_object setAcceptsMouseMovedEvents:YES]; - [window_object center]; + [(NSWindow *)window_object center]; [window_object setRestorable:NO]; @@ -2338,12 +2343,12 @@ void OS_OSX::set_current_screen(int p_screen) { }; Point2 OS_OSX::get_native_screen_position(int p_screen) const { - if (p_screen == -1) { + if (p_screen < 0) { p_screen = get_current_screen(); } NSArray *screenArray = [NSScreen screens]; - if (p_screen < [screenArray count]) { + if ((NSUInteger)p_screen < [screenArray count]) { float display_scale = _display_scale([screenArray objectAtIndex:p_screen]); NSRect nsrect = [[screenArray objectAtIndex:p_screen] frame]; // Return the top-left corner of the screen, for OS X the y starts at the bottom @@ -2362,12 +2367,12 @@ Point2 OS_OSX::get_screen_position(int p_screen) const { } int OS_OSX::get_screen_dpi(int p_screen) const { - if (p_screen == -1) { + if (p_screen < 0) { p_screen = get_current_screen(); } NSArray *screenArray = [NSScreen screens]; - if (p_screen < [screenArray count]) { + if ((NSUInteger)p_screen < [screenArray count]) { float displayScale = _display_scale([screenArray objectAtIndex:p_screen]); NSDictionary *description = [[screenArray objectAtIndex:p_screen] deviceDescription]; NSSize displayPixelSize = [[description objectForKey:NSDeviceSize] sizeValue]; @@ -2381,12 +2386,12 @@ int OS_OSX::get_screen_dpi(int p_screen) const { } Size2 OS_OSX::get_screen_size(int p_screen) const { - if (p_screen == -1) { + if (p_screen < 0) { p_screen = get_current_screen(); } NSArray *screenArray = [NSScreen screens]; - if (p_screen < [screenArray count]) { + if ((NSUInteger)p_screen < [screenArray count]) { float displayScale = _display_scale([screenArray objectAtIndex:p_screen]); // Note: Use frame to get the whole screen size NSRect nsrect = [[screenArray objectAtIndex:p_screen] frame]; diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index fefad3584b..557699cf37 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1144,11 +1144,21 @@ public: return valid; } + if (!_valid_resource_name(p_preset->get("package/short_name"))) { + valid = false; + err += TTR("Invalid package short name.") + "\n"; + } + if (!_valid_resource_name(p_preset->get("package/unique_name"))) { valid = false; err += TTR("Invalid package unique name.") + "\n"; } + if (!_valid_resource_name(p_preset->get("package/publisher_display_name"))) { + valid = false; + err += TTR("Invalid package publisher display name.") + "\n"; + } + if (!_valid_guid(p_preset->get("identity/product_guid"))) { valid = false; err += TTR("Invalid product GUID.") + "\n"; diff --git a/platform/windows/detect.py b/platform/windows/detect.py index cc9ba720a8..9a2b2bcb98 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -65,6 +65,8 @@ def get_opts(): BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False), ('msvc_version', 'MSVC version to use. Ignored if VCINSTALLDIR is set in shell env.', None), BoolVariable('use_mingw', 'Use the Mingw compiler, even if MSVC is installed. Only used on Windows.', False), + BoolVariable('use_llvm', 'Use the LLVM compiler', False), + BoolVariable('use_thinlto', 'Use ThinLTO', False), ] @@ -312,17 +314,33 @@ def configure_mingw(env): env.Append(LINKFLAGS=['-static']) mingw_prefix = env["mingw_prefix_64"] - env["CC"] = mingw_prefix + "gcc" - env['AS'] = mingw_prefix + "as" - env['CXX'] = mingw_prefix + "g++" - env['AR'] = mingw_prefix + "gcc-ar" - env['RANLIB'] = mingw_prefix + "gcc-ranlib" - env['LINK'] = mingw_prefix + "g++" + if env['use_llvm']: + env["CC"] = mingw_prefix + "clang" + env['AS'] = mingw_prefix + "as" + env["CXX"] = mingw_prefix + "clang++" + env['AR'] = mingw_prefix + "ar" + env['RANLIB'] = mingw_prefix + "ranlib" + env["LINK"] = mingw_prefix + "clang++" + else: + env["CC"] = mingw_prefix + "gcc" + env['AS'] = mingw_prefix + "as" + env['CXX'] = mingw_prefix + "g++" + env['AR'] = mingw_prefix + "gcc-ar" + env['RANLIB'] = mingw_prefix + "gcc-ranlib" + env['LINK'] = mingw_prefix + "g++" env["x86_libtheora_opt_gcc"] = True if env['use_lto']: - env.Append(CCFLAGS=['-flto']) - env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))]) + if not env['use_llvm'] and env.GetOption("num_jobs") > 1: + env.Append(CCFLAGS=['-flto']) + env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))]) + else: + if env['use_thinlto']: + env.Append(CCFLAGS=['-flto=thin']) + env.Append(LINKFLAGS=['-flto=thin']) + else: + env.Append(CCFLAGS=['-flto']) + env.Append(LINKFLAGS=['-flto']) ## Compile flags @@ -332,7 +350,7 @@ def configure_mingw(env): env.Append(CPPDEFINES=[('WINVER', env['target_win_version']), ('_WIN32_WINNT', env['target_win_version'])]) env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt', 'avrt', 'uuid']) - env.Append(CPPDEFINES=['MINGW_ENABLED']) + env.Append(CPPDEFINES=['MINGW_ENABLED', ('MINGW_HAS_SECURE_API', 1)]) # resrc env.Append(BUILDERS={'RES': env.Builder(action=build_res_file, suffix='.o', src_suffix='.rc')}) diff --git a/platform/windows/godot.natvis b/platform/windows/godot.natvis index 55c83c3f3c..593557cc69 100644 --- a/platform/windows/godot.natvis +++ b/platform/windows/godot.natvis @@ -143,4 +143,12 @@ <Item Name="alpha">a</Item> </Expand> </Type> + + <Type Name="Node" Inheritable="false"> + <Expand> + <Item Name="Object">(Object*)this</Item> + <Item Name="class_name">(StringName*)(((char*)this) + sizeof(Object))</Item> + <Item Name="data">(Node::Data*)(((char*)this) + sizeof(Object) + sizeof(StringName))</Item> + </Expand> + </Type> </AutoVisualizer> diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 81b8d08b3d..429657f332 100644..100755 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -70,6 +70,10 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; #define WM_TOUCH 576 #endif +#ifndef WM_POINTERUPDATE +#define WM_POINTERUPDATE 0x0245 +#endif + typedef struct { int count; int screen; @@ -192,6 +196,9 @@ BOOL WINAPI HandlerRoutine(_In_ DWORD dwCtrlType) { } } +GetPointerTypePtr OS_Windows::win8p_GetPointerType = NULL; +GetPointerPenInfoPtr OS_Windows::win8p_GetPointerPenInfo = NULL; + void OS_Windows::initialize_debugging() { SetConsoleCtrlHandler(HandlerRoutine, TRUE); @@ -288,15 +295,16 @@ void OS_Windows::_drag_event(float p_x, float p_y, int idx) { if (curr->get() == Vector2(p_x, p_y)) return; - curr->get() = Vector2(p_x, p_y); - Ref<InputEventScreenDrag> event; event.instance(); event->set_index(idx); event->set_position(Vector2(p_x, p_y)); + event->set_relative(Vector2(p_x, p_y) - curr->get()); if (main_loop) input->accumulate_input_event(event); + + curr->get() = Vector2(p_x, p_y); }; LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -480,6 +488,119 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } delete[] lpb; } break; + case WM_POINTERUPDATE: { + if (mouse_mode == MOUSE_MODE_CAPTURED && use_raw_input) { + break; + } + + if (!win8p_GetPointerType || !win8p_GetPointerPenInfo) { + break; + } + + uint32_t pointer_id = LOWORD(wParam); + POINTER_INPUT_TYPE pointer_type = PT_POINTER; + if (!win8p_GetPointerType(pointer_id, &pointer_type)) { + break; + } + + if (pointer_type != PT_PEN) { + break; + } + + POINTER_PEN_INFO pen_info; + if (!win8p_GetPointerPenInfo(pointer_id, &pen_info)) { + break; + } + + if (input->is_emulating_mouse_from_touch()) { + // Universal translation enabled; ignore OS translation + LPARAM extra = GetMessageExtraInfo(); + if (IsTouchEvent(extra)) { + break; + } + } + + if (outside) { + //mouse enter + + if (main_loop && mouse_mode != MOUSE_MODE_CAPTURED) + main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER); + + CursorShape c = cursor_shape; + cursor_shape = CURSOR_MAX; + set_cursor_shape(c); + outside = false; + + //Once-Off notification, must call again.... + TRACKMOUSEEVENT tme; + tme.cbSize = sizeof(TRACKMOUSEEVENT); + tme.dwFlags = TME_LEAVE; + tme.hwndTrack = hWnd; + tme.dwHoverTime = HOVER_DEFAULT; + TrackMouseEvent(&tme); + } + + // Don't calculate relative mouse movement if we don't have focus in CAPTURED mode. + if (!window_has_focus && mouse_mode == MOUSE_MODE_CAPTURED) + break; + + Ref<InputEventMouseMotion> mm; + mm.instance(); + + mm->set_pressure(pen_info.pressure ? (float)pen_info.pressure / 1024 : 0); + mm->set_tilt(Vector2(pen_info.tiltX ? (float)pen_info.tiltX / 90 : 0, pen_info.tiltY ? (float)pen_info.tiltY / 90 : 0)); + + mm->set_control((wParam & MK_CONTROL) != 0); + mm->set_shift((wParam & MK_SHIFT) != 0); + mm->set_alt(alt_mem); + + mm->set_button_mask(last_button_state); + + POINT coords; //client coords + coords.x = GET_X_LPARAM(lParam); + coords.y = GET_Y_LPARAM(lParam); + + ScreenToClient(hWnd, &coords); + + mm->set_position(Vector2(coords.x, coords.y)); + mm->set_global_position(Vector2(coords.x, coords.y)); + + if (mouse_mode == MOUSE_MODE_CAPTURED) { + + Point2i c(video_mode.width / 2, video_mode.height / 2); + old_x = c.x; + old_y = c.y; + + if (mm->get_position() == c) { + center = c; + return 0; + } + + Point2i ncenter = mm->get_position(); + center = ncenter; + POINT pos = { (int)c.x, (int)c.y }; + ClientToScreen(hWnd, &pos); + SetCursorPos(pos.x, pos.y); + } + + input->set_mouse_position(mm->get_position()); + mm->set_speed(input->get_last_mouse_speed()); + + if (old_invalid) { + + old_x = mm->get_position().x; + old_y = mm->get_position().y; + old_invalid = false; + } + + mm->set_relative(Vector2(mm->get_position() - Vector2(old_x, old_y))); + old_x = mm->get_position().x; + old_y = mm->get_position().y; + if (window_has_focus && main_loop) + input->parse_input_event(mm); + + return 0; //Pointer event handled return 0 to avoid duplicate WM_MOUSEMOVE event + } break; case WM_MOUSEMOVE: { if (mouse_mode == MOUSE_MODE_CAPTURED && use_raw_input) { break; @@ -1875,6 +1996,8 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) { if (p_enabled) { + was_maximized = maximized; + if (pre_fs_valid) { GetWindowRect(hWnd, &pre_fs_rect); } @@ -1904,7 +2027,7 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) { rect.bottom = video_mode.height; } - _update_window_style(false); + _update_window_style(false, was_maximized); MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); @@ -2086,12 +2209,16 @@ bool OS_Windows::get_borderless_window() { return video_mode.borderless_window; } -void OS_Windows::_update_window_style(bool repaint) { +void OS_Windows::_update_window_style(bool p_repaint, bool p_maximized) { if (video_mode.fullscreen || video_mode.borderless_window) { SetWindowLongPtr(hWnd, GWL_STYLE, WS_SYSMENU | WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE); } else { if (video_mode.resizable) { - SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); + if (p_maximized) { + SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_MAXIMIZE); + } else { + SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); + } } else { SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_VISIBLE); } @@ -2099,7 +2226,7 @@ void OS_Windows::_update_window_style(bool repaint) { SetWindowPos(hWnd, video_mode.always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE); - if (repaint) { + if (p_repaint) { RECT rect; GetWindowRect(hWnd, &rect); MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); @@ -2861,7 +2988,7 @@ void OS_Windows::move_window_to_foreground() { Error OS_Windows::shell_open(String p_uri) { - ShellExecuteW(NULL, L"open", p_uri.c_str(), NULL, NULL, SW_SHOWNORMAL); + ShellExecuteW(NULL, NULL, p_uri.c_str(), NULL, NULL, SW_SHOWNORMAL); return OK; } @@ -3246,8 +3373,16 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) { control_mem = false; meta_mem = false; minimized = false; + was_maximized = false; console_visible = IsWindowVisible(GetConsoleWindow()); + //Note: Functions for pen input, available on Windows 8+ + HMODULE user32_lib = LoadLibraryW(L"user32.dll"); + if (user32_lib) { + win8p_GetPointerType = (GetPointerTypePtr)GetProcAddress(user32_lib, "GetPointerType"); + win8p_GetPointerPenInfo = (GetPointerPenInfoPtr)GetProcAddress(user32_lib, "GetPointerPenInfo"); + } + hInstance = _hInstance; pressrc = 0; old_invalid = true; diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 915d025e3b..ce279fb033 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -56,6 +56,71 @@ #include <windows.h> #include <windowsx.h> +#ifndef POINTER_STRUCTURES + +#define POINTER_STRUCTURES + +typedef DWORD POINTER_INPUT_TYPE; +typedef UINT32 POINTER_FLAGS; +typedef UINT32 PEN_FLAGS; +typedef UINT32 PEN_MASK; + +enum tagPOINTER_INPUT_TYPE { + PT_POINTER = 0x00000001, + PT_TOUCH = 0x00000002, + PT_PEN = 0x00000003, + PT_MOUSE = 0x00000004, + PT_TOUCHPAD = 0x00000005 +}; + +typedef enum tagPOINTER_BUTTON_CHANGE_TYPE { + POINTER_CHANGE_NONE, + POINTER_CHANGE_FIRSTBUTTON_DOWN, + POINTER_CHANGE_FIRSTBUTTON_UP, + POINTER_CHANGE_SECONDBUTTON_DOWN, + POINTER_CHANGE_SECONDBUTTON_UP, + POINTER_CHANGE_THIRDBUTTON_DOWN, + POINTER_CHANGE_THIRDBUTTON_UP, + POINTER_CHANGE_FOURTHBUTTON_DOWN, + POINTER_CHANGE_FOURTHBUTTON_UP, + POINTER_CHANGE_FIFTHBUTTON_DOWN, + POINTER_CHANGE_FIFTHBUTTON_UP, +} POINTER_BUTTON_CHANGE_TYPE; + +typedef struct tagPOINTER_INFO { + POINTER_INPUT_TYPE pointerType; + UINT32 pointerId; + UINT32 frameId; + POINTER_FLAGS pointerFlags; + HANDLE sourceDevice; + HWND hwndTarget; + POINT ptPixelLocation; + POINT ptHimetricLocation; + POINT ptPixelLocationRaw; + POINT ptHimetricLocationRaw; + DWORD dwTime; + UINT32 historyCount; + INT32 InputData; + DWORD dwKeyStates; + UINT64 PerformanceCount; + POINTER_BUTTON_CHANGE_TYPE ButtonChangeType; +} POINTER_INFO; + +typedef struct tagPOINTER_PEN_INFO { + POINTER_INFO pointerInfo; + PEN_FLAGS penFlags; + PEN_MASK penMask; + UINT32 pressure; + UINT32 rotation; + INT32 tiltX; + INT32 tiltY; +} POINTER_PEN_INFO; + +#endif + +typedef BOOL(WINAPI *GetPointerTypePtr)(uint32_t p_id, POINTER_INPUT_TYPE *p_type); +typedef BOOL(WINAPI *GetPointerPenInfoPtr)(uint32_t p_id, POINTER_PEN_INFO *p_pen_info); + typedef struct { BYTE bWidth; // Width, in pixels, of the image BYTE bHeight; // Height, in pixels, of the image @@ -77,11 +142,16 @@ typedef struct { class JoypadWindows; class OS_Windows : public OS { + static GetPointerTypePtr win8p_GetPointerType; + static GetPointerPenInfoPtr win8p_GetPointerPenInfo; + enum { KEY_EVENT_BUFFER_SIZE = 512 }; +#ifdef STDOUT_FILE FILE *stdo; +#endif struct KeyEvent { @@ -107,7 +177,6 @@ class OS_Windows : public OS { VisualServer *visual_server; CameraWindows *camera_server; int pressrc; - HDC hDC; // Private GDI Device Context HINSTANCE hInstance; // Holds The Instance Of The Application HWND hWnd; Point2 last_pos; @@ -175,7 +244,7 @@ class OS_Windows : public OS { void _drag_event(float p_x, float p_y, int idx); void _touch_event(bool p_pressed, float p_x, float p_y, int idx); - void _update_window_style(bool repaint = true); + void _update_window_style(bool p_repaint = true, bool p_maximized = false); void _set_mouse_mode_impl(MouseMode p_mode); @@ -208,6 +277,7 @@ protected: bool minimized; bool borderless; bool console_visible; + bool was_maximized; public: LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 694aea7462..54d3759cc5 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -83,6 +83,12 @@ #define XINPUT_CLIENT_VERSION_MAJOR 2 #define XINPUT_CLIENT_VERSION_MINOR 2 +#define VALUATOR_ABSX 0 +#define VALUATOR_ABSY 1 +#define VALUATOR_PRESSURE 2 +#define VALUATOR_TILTX 3 +#define VALUATOR_TILTY 4 + static const double abs_resolution_mult = 10000.0; static const double abs_resolution_range_mult = 10.0; @@ -665,6 +671,15 @@ bool OS_X11::refresh_device_info() { int range_min_y = 0; int range_max_x = 0; int range_max_y = 0; + int pressure_resolution = 0; + int pressure_min = 0; + int pressure_max = 0; + int tilt_resolution_x = 0; + int tilt_resolution_y = 0; + int tilt_range_min_x = 0; + int tilt_range_min_y = 0; + int tilt_range_max_x = 0; + int tilt_range_max_y = 0; for (int j = 0; j < dev->num_classes; j++) { #ifdef TOUCH_ENABLED if (dev->classes[j]->type == XITouchClass && ((XITouchClassInfo *)dev->classes[j])->mode == XIDirectTouch) { @@ -674,16 +689,28 @@ bool OS_X11::refresh_device_info() { if (dev->classes[j]->type == XIValuatorClass) { XIValuatorClassInfo *class_info = (XIValuatorClassInfo *)dev->classes[j]; - if (class_info->number == 0 && class_info->mode == XIModeAbsolute) { + if (class_info->number == VALUATOR_ABSX && class_info->mode == XIModeAbsolute) { resolution_x = class_info->resolution; range_min_x = class_info->min; range_max_x = class_info->max; absolute_mode = true; - } else if (class_info->number == 1 && class_info->mode == XIModeAbsolute) { + } else if (class_info->number == VALUATOR_ABSY && class_info->mode == XIModeAbsolute) { resolution_y = class_info->resolution; range_min_y = class_info->min; range_max_y = class_info->max; absolute_mode = true; + } else if (class_info->number == VALUATOR_PRESSURE && class_info->mode == XIModeAbsolute) { + pressure_resolution = class_info->resolution; + pressure_min = class_info->min; + pressure_max = class_info->max; + } else if (class_info->number == VALUATOR_TILTX && class_info->mode == XIModeAbsolute) { + tilt_resolution_x = class_info->resolution; + tilt_range_min_x = class_info->min; + tilt_range_max_x = class_info->max; + } else if (class_info->number == VALUATOR_TILTY && class_info->mode == XIModeAbsolute) { + tilt_resolution_y = class_info->resolution; + tilt_range_min_y = class_info->min; + tilt_range_max_y = class_info->max; } } } @@ -703,6 +730,18 @@ bool OS_X11::refresh_device_info() { xi.absolute_devices[dev->deviceid] = Vector2(abs_resolution_mult / resolution_x, abs_resolution_mult / resolution_y); print_verbose("XInput: Absolute pointing device: " + String(dev->name)); } + + if (pressure_resolution <= 0) { + pressure_resolution = (pressure_max - pressure_min); + } + if (tilt_resolution_x <= 0) { + tilt_resolution_x = (tilt_range_max_x - tilt_range_min_x); + } + if (tilt_resolution_y <= 0) { + tilt_resolution_y = (tilt_range_max_y - tilt_range_min_y); + } + xi.pressure = 0; + xi.pen_devices[dev->deviceid] = Vector3(pressure_resolution, tilt_resolution_x, tilt_resolution_y); } XIFreeDeviceInfo(info); @@ -1827,6 +1866,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { input->accumulate_input_event(k); } + memfree(utf8string); return; } memfree(utf8string); @@ -2095,14 +2135,39 @@ void OS_X11::process_xevents() { double rel_x = 0.0; double rel_y = 0.0; + double pressure = 0.0; + double tilt_x = 0.0; + double tilt_y = 0.0; - if (XIMaskIsSet(raw_event->valuators.mask, 0)) { + if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_ABSX)) { rel_x = *values; values++; } - if (XIMaskIsSet(raw_event->valuators.mask, 1)) { + if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_ABSY)) { rel_y = *values; + values++; + } + + if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_PRESSURE)) { + pressure = *values; + values++; + } + + if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_TILTX)) { + tilt_x = *values; + values++; + } + + if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_TILTY)) { + tilt_y = *values; + } + + Map<int, Vector3>::Element *pen_info = xi.pen_devices.find(device_id); + if (pen_info) { + Vector3 mult = pen_info->value(); + if (mult.x != 0.0) xi.pressure = pressure / mult.x; + if ((mult.y != 0.0) && (mult.z != 0.0)) xi.tilt = Vector2(tilt_x / mult.y, tilt_y / mult.z); } // https://bugs.freedesktop.org/show_bug.cgi?id=71609 @@ -2417,6 +2482,9 @@ void OS_X11::process_xevents() { Ref<InputEventMouseMotion> mm; mm.instance(); + mm->set_pressure(xi.pressure); + mm->set_tilt(xi.tilt); + // Make the absolute position integral so it doesn't look _too_ weird :) Point2i posi(pos); diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index e6c2effacf..a5576f4402 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -131,9 +131,12 @@ class OS_X11 : public OS_Unix { int opcode; Vector<int> touch_devices; Map<int, Vector2> absolute_devices; + Map<int, Vector3> pen_devices; XIEventMask all_event_mask; XIEventMask all_master_event_mask; Map<int, Vector2> state; + double pressure; + Vector2 tilt; Vector2 mouse_pos_to_filter; Vector2 relative_motion; Vector2 raw_pos; diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 20ec06f033..9d02408641 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -604,10 +604,14 @@ bool AnimatedSprite::_is_playing() const { void AnimatedSprite::play(const StringName &p_animation, const bool p_backwards) { - if (p_animation) + backwards = p_backwards; + + if (p_animation) { set_animation(p_animation); + if (backwards && get_frame() == 0) + set_frame(frames->get_frame_count(p_animation) - 1); + } - backwards = p_backwards; _set_playing(true); } diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index b38fbfe981..fa23e3fd39 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -360,6 +360,10 @@ bool CanvasItem::_edit_is_selected_on_click(const Point2 &p_point, double p_tole } } +Transform2D CanvasItem::_edit_get_transform() const { + return Transform2D(_edit_get_rotation(), _edit_get_position() + _edit_get_pivot()); +} + bool CanvasItem::is_visible_in_tree() const { if (!is_inside_tree()) @@ -735,6 +739,19 @@ void CanvasItem::draw_polyline_colors(const Vector<Point2> &p_points, const Vect VisualServer::get_singleton()->canvas_item_add_polyline(canvas_item, p_points, p_colors, p_width, p_antialiased); } +void CanvasItem::draw_arc(const Vector2 &p_center, float p_radius, float p_start_angle, float p_end_angle, int p_point_count, const Color &p_color, float p_width, bool p_antialiased) { + + Vector<Point2> points; + points.resize(p_point_count); + const float delta_angle = p_end_angle - p_start_angle; + for (int i = 0; i < p_point_count; i++) { + float theta = (i / (p_point_count - 1.0f)) * delta_angle + p_start_angle; + points.set(i, p_center + Vector2(Math::cos(theta), Math::sin(theta)) * p_radius); + } + + draw_polyline(points, p_color, p_width, p_antialiased); +} + void CanvasItem::draw_multiline(const Vector<Point2> &p_points, const Color &p_color, float p_width, bool p_antialiased) { ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); @@ -777,29 +794,29 @@ void CanvasItem::draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_fil VisualServer::get_singleton()->canvas_item_add_line( canvas_item, - p_rect.position + Point2(-offset, 0), + p_rect.position + Size2(-offset, 0), p_rect.position + Size2(p_rect.size.width + offset, 0), p_color, p_width, p_antialiased); VisualServer::get_singleton()->canvas_item_add_line( canvas_item, - p_rect.position + Point2(0, offset), - p_rect.position + Size2(0, p_rect.size.height - offset), + p_rect.position + Size2(p_rect.size.width, offset), + p_rect.position + Size2(p_rect.size.width, p_rect.size.height - offset), p_color, p_width, p_antialiased); VisualServer::get_singleton()->canvas_item_add_line( canvas_item, - p_rect.position + Point2(-offset, p_rect.size.height), p_rect.position + Size2(p_rect.size.width + offset, p_rect.size.height), + p_rect.position + Size2(-offset, p_rect.size.height), p_color, p_width, p_antialiased); VisualServer::get_singleton()->canvas_item_add_line( canvas_item, - p_rect.position + Point2(p_rect.size.width, offset), - p_rect.position + Size2(p_rect.size.width, p_rect.size.height - offset), + p_rect.position + Size2(0, p_rect.size.height - offset), + p_rect.position + Size2(0, offset), p_color, p_width, p_antialiased); @@ -1120,6 +1137,7 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("_edit_set_pivot", "pivot"), &CanvasItem::_edit_set_pivot); ClassDB::bind_method(D_METHOD("_edit_get_pivot"), &CanvasItem::_edit_get_pivot); ClassDB::bind_method(D_METHOD("_edit_use_pivot"), &CanvasItem::_edit_use_pivot); + ClassDB::bind_method(D_METHOD("_edit_get_transform"), &CanvasItem::_edit_get_transform); ClassDB::bind_method(D_METHOD("get_canvas_item"), &CanvasItem::get_canvas_item); @@ -1152,6 +1170,7 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("draw_line", "from", "to", "color", "width", "antialiased"), &CanvasItem::draw_line, DEFVAL(1.0), DEFVAL(false)); ClassDB::bind_method(D_METHOD("draw_polyline", "points", "color", "width", "antialiased"), &CanvasItem::draw_polyline, DEFVAL(1.0), DEFVAL(false)); ClassDB::bind_method(D_METHOD("draw_polyline_colors", "points", "colors", "width", "antialiased"), &CanvasItem::draw_polyline_colors, DEFVAL(1.0), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("draw_arc", "center", "radius", "start_angle", "end_angle", "point_count", "color", "width", "antialiased"), &CanvasItem::draw_arc, DEFVAL(1.0), DEFVAL(false)); ClassDB::bind_method(D_METHOD("draw_multiline", "points", "color", "width", "antialiased"), &CanvasItem::draw_multiline, DEFVAL(1.0), DEFVAL(false)); ClassDB::bind_method(D_METHOD("draw_multiline_colors", "points", "colors", "width", "antialiased"), &CanvasItem::draw_multiline_colors, DEFVAL(1.0), DEFVAL(false)); ClassDB::bind_method(D_METHOD("draw_rect", "rect", "color", "filled", "width", "antialiased"), &CanvasItem::draw_rect, DEFVAL(true), DEFVAL(1.0), DEFVAL(false)); diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index 9c6799a441..e51ee601e2 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -281,6 +281,8 @@ public: virtual void _edit_set_pivot(const Point2 &p_pivot){}; virtual Point2 _edit_get_pivot() const { return Point2(); }; + virtual Transform2D _edit_get_transform() const; + /* VISIBILITY */ void set_visible(bool p_visible); @@ -305,6 +307,7 @@ public: void draw_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width = 1.0, bool p_antialiased = false); void draw_polyline(const Vector<Point2> &p_points, const Color &p_color, float p_width = 1.0, bool p_antialiased = false); void draw_polyline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width = 1.0, bool p_antialiased = false); + void draw_arc(const Vector2 &p_center, float p_radius, float p_start_angle, float p_end_angle, int p_point_count, const Color &p_color, float p_width = 1.0, bool p_antialiased = false); void draw_multiline(const Vector<Point2> &p_points, const Color &p_color, float p_width = 1.0, bool p_antialiased = false); void draw_multiline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width = 1.0, bool p_antialiased = false); void draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_filled = true, float p_width = 1.0, bool p_antialiased = false); diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 85c423964b..372d8f614b 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -37,6 +37,9 @@ void CPUParticles2D::set_emitting(bool p_emitting) { + if (emitting == p_emitting) + return; + emitting = p_emitting; if (emitting) set_process_internal(true); @@ -257,8 +260,7 @@ void CPUParticles2D::restart() { inactive_time = 0; frame_remainder = 0; cycle = 0; - - set_emitting(true); + emitting = false; { int pc = particles.size(); @@ -268,6 +270,8 @@ void CPUParticles2D::restart() { w[i].active = false; } } + + set_emitting(true); } void CPUParticles2D::set_direction(Vector2 p_direction) { @@ -535,6 +539,74 @@ static float rand_from_seed(uint32_t &seed) { return float(seed % uint32_t(65536)) / 65535.0; } +void CPUParticles2D::_update_internal() { + + if (particles.size() == 0 || !is_visible_in_tree()) { + _set_redraw(false); + return; + } + + float delta = get_process_delta_time(); + if (emitting) { + inactive_time = 0; + } else { + inactive_time += delta; + if (inactive_time > lifetime * 1.2) { + set_process_internal(false); + _set_redraw(false); + + //reset variables + time = 0; + inactive_time = 0; + frame_remainder = 0; + cycle = 0; + return; + } + } + _set_redraw(true); + + if (time == 0 && pre_process_time > 0.0) { + + float frame_time; + if (fixed_fps > 0) + frame_time = 1.0 / fixed_fps; + else + frame_time = 1.0 / 30.0; + + float todo = pre_process_time; + + while (todo >= 0) { + _particles_process(frame_time); + todo -= frame_time; + } + } + + if (fixed_fps > 0) { + float frame_time = 1.0 / fixed_fps; + float decr = frame_time; + + float ldelta = delta; + if (ldelta > 0.1) { //avoid recursive stalls if fps goes below 10 + ldelta = 0.1; + } else if (ldelta <= 0.0) { //unlikely but.. + ldelta = 0.001; + } + float todo = frame_remainder + ldelta; + + while (todo >= frame_time) { + _particles_process(frame_time); + todo -= decr; + } + + frame_remainder = todo; + + } else { + _particles_process(delta); + } + + _update_particle_data_buffer(); +} + void CPUParticles2D::_particles_process(float p_delta) { p_delta *= speed_scale; @@ -965,7 +1037,9 @@ void CPUParticles2D::_set_redraw(bool p_redraw) { VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1); } else { - VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); + if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_update_render_thread")) { + VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); + } VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false); VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0); @@ -1000,6 +1074,10 @@ void CPUParticles2D::_notification(int p_what) { } if (p_what == NOTIFICATION_DRAW) { + // first update before rendering to avoid one frame delay after emitting starts + if (emitting && (time == 0)) + _update_internal(); + if (!redraw) return; // don't add to render list @@ -1017,71 +1095,7 @@ void CPUParticles2D::_notification(int p_what) { } if (p_what == NOTIFICATION_INTERNAL_PROCESS) { - - if (particles.size() == 0 || !is_visible_in_tree()) { - _set_redraw(false); - return; - } - - float delta = get_process_delta_time(); - if (emitting) { - inactive_time = 0; - } else { - inactive_time += delta; - if (inactive_time > lifetime * 1.2) { - set_process_internal(false); - _set_redraw(false); - - //reset variables - time = 0; - inactive_time = 0; - frame_remainder = 0; - cycle = 0; - return; - } - } - _set_redraw(true); - - if (time == 0 && pre_process_time > 0.0) { - - float frame_time; - if (fixed_fps > 0) - frame_time = 1.0 / fixed_fps; - else - frame_time = 1.0 / 30.0; - - float todo = pre_process_time; - - while (todo >= 0) { - _particles_process(frame_time); - todo -= frame_time; - } - } - - if (fixed_fps > 0) { - float frame_time = 1.0 / fixed_fps; - float decr = frame_time; - - float ldelta = delta; - if (ldelta > 0.1) { //avoid recursive stalls if fps goes below 10 - ldelta = 0.1; - } else if (ldelta <= 0.0) { //unlikely but.. - ldelta = 0.001; - } - float todo = frame_remainder + ldelta; - - while (todo >= frame_time) { - _particles_process(frame_time); - todo -= decr; - } - - frame_remainder = todo; - - } else { - _particles_process(delta); - } - - _update_particle_data_buffer(); + _update_internal(); } if (p_what == NOTIFICATION_TRANSFORM_CHANGED) { @@ -1411,6 +1425,7 @@ CPUParticles2D::CPUParticles2D() { frame_remainder = 0; cycle = 0; redraw = false; + emitting = false; mesh = VisualServer::get_singleton()->mesh_create(); multimesh = VisualServer::get_singleton()->multimesh_create(); diff --git a/scene/2d/cpu_particles_2d.h b/scene/2d/cpu_particles_2d.h index da668664b9..47b4568dd4 100644 --- a/scene/2d/cpu_particles_2d.h +++ b/scene/2d/cpu_particles_2d.h @@ -174,6 +174,7 @@ private: Vector2 gravity; + void _update_internal(); void _particles_process(float p_delta); void _update_particle_data_buffer(); diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 12fb18cedc..847d08b025 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -37,8 +37,8 @@ void Joint2D::_update_joint(bool p_only_free) { if (joint.is_valid()) { - if (ba.is_valid() && bb.is_valid()) - Physics2DServer::get_singleton()->body_remove_collision_exception(ba, bb); + if (ba.is_valid() && bb.is_valid() && exclude_from_collision) + Physics2DServer::get_singleton()->joint_disable_collisions_between_bodies(joint, false); Physics2DServer::get_singleton()->free(joint); joint = RID(); @@ -131,6 +131,8 @@ void Joint2D::set_exclude_nodes_from_collision(bool p_enable) { if (exclude_from_collision == p_enable) return; + + _update_joint(true); exclude_from_collision = p_enable; _update_joint(); } diff --git a/scene/2d/navigation_2d.cpp b/scene/2d/navigation_2d.cpp index 5cf28d6c89..c7d2dabbae 100644 --- a/scene/2d/navigation_2d.cpp +++ b/scene/2d/navigation_2d.cpp @@ -541,7 +541,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect if (CLOCK_TANGENT(apex_point, portal_left, left) >= 0) { //process - if (Math::is_zero_approx(portal_left.distance_squared_to(apex_point)) || CLOCK_TANGENT(apex_point, left, portal_right) > 0) { + if (portal_left.is_equal_approx(apex_point) || CLOCK_TANGENT(apex_point, left, portal_right) > 0) { left_poly = p; portal_left = left; } else { @@ -551,7 +551,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect left_poly = p; portal_left = apex_point; portal_right = apex_point; - if (!path.size() || path[path.size() - 1] != apex_point) + if (!path.size() || !path[path.size() - 1].is_equal_approx(apex_point)) path.push_back(apex_point); skip = true; } @@ -559,7 +559,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect if (!skip && CLOCK_TANGENT(apex_point, portal_right, right) <= 0) { //process - if (Math::is_zero_approx(portal_right.distance_squared_to(apex_point)) || CLOCK_TANGENT(apex_point, right, portal_left) < 0) { + if (portal_right.is_equal_approx(apex_point) || CLOCK_TANGENT(apex_point, right, portal_left) < 0) { right_poly = p; portal_right = right; } else { @@ -569,7 +569,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect right_poly = p; portal_right = apex_point; portal_left = apex_point; - if (!path.size() || path[path.size() - 1] != apex_point) + if (!path.size() || !path[path.size() - 1].is_equal_approx(apex_point)) path.push_back(apex_point); } } @@ -595,7 +595,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect } } - if (!path.size() || !Math::is_zero_approx(path[path.size() - 1].distance_squared_to(begin_point))) { + if (!path.size() || !path[path.size() - 1].is_equal_approx(begin_point)) { path.push_back(begin_point); // Add the begin point } else { path.write[path.size() - 1] = begin_point; // Replace first midpoint by the exact begin point @@ -603,7 +603,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect path.invert(); - if (path.size() <= 1 || !Math::is_zero_approx(path[path.size() - 1].distance_squared_to(end_point))) { + if (path.size() <= 1 || !path[path.size() - 1].is_equal_approx(end_point)) { path.push_back(end_point); // Add the end point } else { path.write[path.size() - 1] = end_point; // Replace last midpoint by the exact end point diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index d2e1e494e3..8cdfceea52 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -387,6 +387,10 @@ void Sprite::_validate_property(PropertyInfo &property) const { property.hint_string = "0," + itos(vframes * hframes - 1) + ",1"; property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } + + if (property.name == "frame_coords") { + property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; + } } void Sprite::_texture_changed() { diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h index 8e735f7110..b647df70aa 100644 --- a/scene/3d/arvr_nodes.h +++ b/scene/3d/arvr_nodes.h @@ -55,7 +55,7 @@ public: virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const; virtual Point2 unproject_position(const Vector3 &p_pos) const; - virtual Vector3 project_position(const Point2 &p_point, float p_z_depth = 0) const; + virtual Vector3 project_position(const Point2 &p_point, float p_z_depth) const; virtual Vector<Plane> get_frustum() const; ARVRCamera(); diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 9797b5f3ab..4d9bb69778 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -486,7 +486,7 @@ void Camera::_bind_methods() { ClassDB::bind_method(D_METHOD("project_ray_origin", "screen_point"), &Camera::project_ray_origin); ClassDB::bind_method(D_METHOD("unproject_position", "world_point"), &Camera::unproject_position); ClassDB::bind_method(D_METHOD("is_position_behind", "world_point"), &Camera::is_position_behind); - ClassDB::bind_method(D_METHOD("project_position", "screen_point", "z_depth"), &Camera::project_position, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("project_position", "screen_point", "z_depth"), &Camera::project_position); ClassDB::bind_method(D_METHOD("set_perspective", "fov", "z_near", "z_far"), &Camera::set_perspective); ClassDB::bind_method(D_METHOD("set_orthogonal", "size", "z_near", "z_far"), &Camera::set_orthogonal); ClassDB::bind_method(D_METHOD("set_frustum", "size", "offset", "z_near", "z_far"), &Camera::set_frustum); diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 22223880c1..d81e097fc5 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -142,7 +142,7 @@ public: virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const; virtual Point2 unproject_position(const Vector3 &p_pos) const; bool is_position_behind(const Vector3 &p_pos) const; - virtual Vector3 project_position(const Point2 &p_point, float p_z_depth = 0) const; + virtual Vector3 project_position(const Point2 &p_point, float p_z_depth) const; Vector<Vector3> get_near_plane_points() const; diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index 93ff60bc4e..86daabefd2 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -46,9 +46,17 @@ PoolVector<Face3> CPUParticles::get_faces(uint32_t p_usage_flags) const { void CPUParticles::set_emitting(bool p_emitting) { + if (emitting == p_emitting) + return; + emitting = p_emitting; - if (emitting) + if (emitting) { set_process_internal(true); + + // first update before rendering to avoid one frame delay after emitting starts + if (time == 0) + _update_internal(); + } } void CPUParticles::set_amount(int p_amount) { @@ -232,8 +240,7 @@ void CPUParticles::restart() { inactive_time = 0; frame_remainder = 0; cycle = 0; - - set_emitting(true); + emitting = false; { int pc = particles.size(); @@ -243,6 +250,8 @@ void CPUParticles::restart() { w[i].active = false; } } + + set_emitting(true); } void CPUParticles::set_direction(Vector3 p_direction) { @@ -508,6 +517,81 @@ static float rand_from_seed(uint32_t &seed) { return float(seed % uint32_t(65536)) / 65535.0; } +void CPUParticles::_update_internal() { + + if (particles.size() == 0 || !is_visible_in_tree()) { + _set_redraw(false); + return; + } + + float delta = get_process_delta_time(); + if (emitting) { + inactive_time = 0; + } else { + inactive_time += delta; + if (inactive_time > lifetime * 1.2) { + set_process_internal(false); + _set_redraw(false); + + //reset variables + time = 0; + inactive_time = 0; + frame_remainder = 0; + cycle = 0; + return; + } + } + _set_redraw(true); + + bool processed = false; + + if (time == 0 && pre_process_time > 0.0) { + + float frame_time; + if (fixed_fps > 0) + frame_time = 1.0 / fixed_fps; + else + frame_time = 1.0 / 30.0; + + float todo = pre_process_time; + + while (todo >= 0) { + _particles_process(frame_time); + processed = true; + todo -= frame_time; + } + } + + if (fixed_fps > 0) { + float frame_time = 1.0 / fixed_fps; + float decr = frame_time; + + float ldelta = delta; + if (ldelta > 0.1) { //avoid recursive stalls if fps goes below 10 + ldelta = 0.1; + } else if (ldelta <= 0.0) { //unlikely but.. + ldelta = 0.001; + } + float todo = frame_remainder + ldelta; + + while (todo >= frame_time) { + _particles_process(frame_time); + processed = true; + todo -= decr; + } + + frame_remainder = todo; + + } else { + _particles_process(delta); + processed = true; + } + + if (processed) { + _update_particle_data_buffer(); + } +} + void CPUParticles::_particles_process(float p_delta) { p_delta *= speed_scale; @@ -1040,7 +1124,9 @@ void CPUParticles::_set_redraw(bool p_redraw) { VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true); VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1); } else { - VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); + if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_update_render_thread")) { + VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); + } VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false); VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0); } @@ -1068,85 +1154,24 @@ void CPUParticles::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { set_process_internal(emitting); + + // first update before rendering to avoid one frame delay after emitting starts + if (emitting && (time == 0)) + _update_internal(); } if (p_what == NOTIFICATION_EXIT_TREE) { _set_redraw(false); } - if (p_what == NOTIFICATION_INTERNAL_PROCESS) { - - if (particles.size() == 0 || !is_visible_in_tree()) { - _set_redraw(false); - return; - } - - float delta = get_process_delta_time(); - if (emitting) { - inactive_time = 0; - } else { - inactive_time += delta; - if (inactive_time > lifetime * 1.2) { - set_process_internal(false); - _set_redraw(false); - - //reset variables - time = 0; - inactive_time = 0; - frame_remainder = 0; - cycle = 0; - return; - } - } - _set_redraw(true); - - bool processed = false; - - if (time == 0 && pre_process_time > 0.0) { - - float frame_time; - if (fixed_fps > 0) - frame_time = 1.0 / fixed_fps; - else - frame_time = 1.0 / 30.0; - - float todo = pre_process_time; - - while (todo >= 0) { - _particles_process(frame_time); - processed = true; - todo -= frame_time; - } - } - - if (fixed_fps > 0) { - float frame_time = 1.0 / fixed_fps; - float decr = frame_time; - - float ldelta = delta; - if (ldelta > 0.1) { //avoid recursive stalls if fps goes below 10 - ldelta = 0.1; - } else if (ldelta <= 0.0) { //unlikely but.. - ldelta = 0.001; - } - float todo = frame_remainder + ldelta; - - while (todo >= frame_time) { - _particles_process(frame_time); - processed = true; - todo -= decr; - } - - frame_remainder = todo; - - } else { - _particles_process(delta); - processed = true; - } + if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + // first update before rendering to avoid one frame delay after emitting starts + if (emitting && (time == 0)) + _update_internal(); + } - if (processed) { - _update_particle_data_buffer(); - } + if (p_what == NOTIFICATION_INTERNAL_PROCESS) { + _update_internal(); } if (p_what == NOTIFICATION_TRANSFORM_CHANGED) { @@ -1472,6 +1497,7 @@ CPUParticles::CPUParticles() { frame_remainder = 0; cycle = 0; redraw = false; + emitting = false; set_notify_transform(true); diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h index 66b37f359a..635265be7f 100644 --- a/scene/3d/cpu_particles.h +++ b/scene/3d/cpu_particles.h @@ -173,6 +173,7 @@ private: Vector3 gravity; + void _update_internal(); void _particles_process(float p_delta); void _update_particle_data_buffer(); diff --git a/scene/3d/navigation_mesh.h b/scene/3d/navigation_mesh.h index 8467f80f0e..d5de653e40 100644 --- a/scene/3d/navigation_mesh.h +++ b/scene/3d/navigation_mesh.h @@ -124,7 +124,7 @@ public: void set_collision_mask_bit(int p_bit, bool p_value); bool get_collision_mask_bit(int p_bit) const; - void set_source_geometry_mode(int p_source_mode); + void set_source_geometry_mode(int p_geometry_mode); int get_source_geometry_mode() const; void set_source_group_name(StringName p_group_name); diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 241eb7d1ca..06b5613eb8 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -331,6 +331,13 @@ void Particles::_notification(int p_what) { set_process_internal(false); } } + + if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + // make sure particles are updated before rendering occurs if they were active before + if (is_visible_in_tree() && !VS::get_singleton()->particles_is_inactive(particles)) { + VS::get_singleton()->particles_request_process(particles); + } + } } void Particles::_bind_methods() { diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index a02cc4bee6..a107c3bf7a 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -1201,7 +1201,7 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve if (p_stop_on_slope) { if ((lv_n + p_floor_direction).length() < 0.01 && collision.travel.length() < 1) { Transform gt = get_global_transform(); - gt.origin -= collision.travel; + gt.origin -= collision.travel.slide(p_floor_direction); set_global_transform(gt); return Vector3(); } @@ -1265,7 +1265,7 @@ Vector3 KinematicBody::move_and_slide_with_snap(const Vector3 &p_linear_velocity if (p_stop_on_slope) { // move and collide may stray the object a bit because of pre un-stucking, // so only ensure that motion happens on floor direction in this case. - col.travel = p_floor_direction * p_floor_direction.dot(col.travel); + col.travel = col.travel.project(p_floor_direction); } } else { apply = false; //snapped with floor direction, but did not snap to a floor, do not snap. diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp index 6c3949a0a8..6883da7f6d 100644 --- a/scene/3d/soft_body.cpp +++ b/scene/3d/soft_body.cpp @@ -115,7 +115,7 @@ SoftBody::PinnedPoint SoftBody::PinnedPoint::operator=(const PinnedPoint &obj) { void SoftBody::_update_pickable() { if (!is_inside_tree()) return; - bool pickable = ray_pickable && is_inside_tree() && is_visible_in_tree(); + bool pickable = ray_pickable && is_visible_in_tree(); PhysicsServer::get_singleton()->soft_body_set_ray_pickable(physics_rid, pickable); } @@ -395,6 +395,8 @@ void SoftBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_damping_coefficient", "get_damping_coefficient"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "drag_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_coefficient", "get_drag_coefficient"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "pose_matching_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_pose_matching_coefficient", "get_pose_matching_coefficient"); + + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ray_pickable"), "set_ray_pickable", "is_ray_pickable"); } String SoftBody::get_configuration_warning() const { @@ -460,7 +462,9 @@ void SoftBody::update_physics_server() { } else { PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, NULL); - VS::get_singleton()->disconnect("frame_pre_draw", this, "_draw_soft_mesh"); + if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_draw_soft_mesh")) { + VS::get_singleton()->disconnect("frame_pre_draw", this, "_draw_soft_mesh"); + } } } @@ -698,7 +702,8 @@ SoftBody::SoftBody() : collision_mask(1), collision_layer(1), simulation_started(false), - pinned_points_cache_dirty(true) { + pinned_points_cache_dirty(true), + ray_pickable(true) { PhysicsServer::get_singleton()->body_attach_object_instance_id(physics_rid, get_instance_id()); //set_notify_transform(true); diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index a8d2f4d415..adcd80b0ab 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -662,6 +662,10 @@ void Sprite3D::_validate_property(PropertyInfo &property) const { property.hint_string = "0," + itos(vframes * hframes - 1) + ",1"; property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } + + if (property.name == "frame_coords") { + property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; + } } void Sprite3D::_bind_methods() { diff --git a/scene/SCsub b/scene/SCsub index d8839ce3a8..1c5b87b87a 100644 --- a/scene/SCsub +++ b/scene/SCsub @@ -30,6 +30,7 @@ SConscript('2d/SCsub') SConscript('animation/SCsub') SConscript('audio/SCsub') SConscript('resources/SCsub') +SConscript('debugger/SCsub') # Build it all as a library diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp index 416a291da1..7fe544eaab 100644 --- a/scene/animation/animation_blend_space_1d.cpp +++ b/scene/animation/animation_blend_space_1d.cpp @@ -157,6 +157,7 @@ Ref<AnimationRootNode> AnimationNodeBlendSpace1D::get_blend_point_node(int p_poi void AnimationNodeBlendSpace1D::remove_blend_point(int p_point) { ERR_FAIL_INDEX(p_point, blend_points_used); + ERR_FAIL_COND(blend_points[p_point].node.is_null()); blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed"); for (int i = p_point; i < blend_points_used - 1; i++) { diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index 75031f0149..b04eefbe31 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -113,6 +113,7 @@ Ref<AnimationRootNode> AnimationNodeBlendSpace2D::get_blend_point_node(int p_poi void AnimationNodeBlendSpace2D::remove_blend_point(int p_point) { ERR_FAIL_INDEX(p_point, blend_points_used); + ERR_FAIL_COND(blend_points[p_point].node.is_null()); blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed"); for (int i = 0; i < triangles.size(); i++) { diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 1f9793190d..a7d936fcd3 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -281,7 +281,7 @@ void Tween::_bind_methods() { BIND_ENUM_CONSTANT(EASE_OUT_IN); } -Variant &Tween::_get_initial_val(InterpolateData &p_data) { +Variant Tween::_get_initial_val(const InterpolateData &p_data) const { // What type of data are we interpolating? switch (p_data.type) { @@ -299,7 +299,7 @@ Variant &Tween::_get_initial_val(InterpolateData &p_data) { ERR_FAIL_COND_V(object == NULL, p_data.initial_val); // Are we targeting a property or a method? - static Variant initial_val; + Variant initial_val; if (p_data.type == TARGETING_PROPERTY) { // Get the property from the target object bool valid = false; @@ -322,6 +322,41 @@ Variant &Tween::_get_initial_val(InterpolateData &p_data) { return p_data.delta_val; } +Variant Tween::_get_final_val(const InterpolateData &p_data) const { + switch (p_data.type) { + case FOLLOW_PROPERTY: + case FOLLOW_METHOD: { + // Get the object that is being followed + Object *target = ObjectDB::get_instance(p_data.target_id); + ERR_FAIL_COND_V(target == NULL, p_data.initial_val); + + // We want to figure out the final value + Variant final_val; + if (p_data.type == FOLLOW_PROPERTY) { + // Read the property as-is + bool valid = false; + final_val = target->get_indexed(p_data.target_key, &valid); + ERR_FAIL_COND_V(!valid, p_data.initial_val); + } else { + // We're looking at a method. Call the method on the target object + Variant::CallError error; + final_val = target->call(p_data.target_key[0], NULL, 0, error); + ERR_FAIL_COND_V(error.error != Variant::CallError::CALL_OK, p_data.initial_val); + } + + // If we're looking at an INT value, instead convert it to a REAL + // This is better for interpolation + if (final_val.get_type() == Variant::INT) final_val = final_val.operator real_t(); + + return final_val; + } + default: { + // If we're not following a final value/method, use the final value from the data + return p_data.final_val; + } + } +} + Variant &Tween::_get_delta_val(InterpolateData &p_data) { // What kind of data are we interpolating? @@ -384,7 +419,7 @@ Variant &Tween::_get_delta_val(InterpolateData &p_data) { Variant Tween::_run_equation(InterpolateData &p_data) { // Get the initial and delta values from the data - Variant &initial_val = _get_initial_val(p_data); + Variant initial_val = _get_initial_val(p_data); Variant &delta_val = _get_delta_val(p_data); Variant result; @@ -718,7 +753,8 @@ void Tween::_tween_process(float p_delta) { // Is the tween now finished? if (data.finish) { // Set it to the final value directly - _apply_tween_value(data, data.final_val); + Variant final_val = _get_final_val(data); + _apply_tween_value(data, final_val); // Mark the tween as completed and emit the signal data.elapsed = 0; diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 64ce099ecd..574238f5c9 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -127,7 +127,8 @@ private: real_t _run_equation(TransitionType p_trans_type, EaseType p_ease_type, real_t t, real_t b, real_t c, real_t d); Variant &_get_delta_val(InterpolateData &p_data); - Variant &_get_initial_val(InterpolateData &p_data); + Variant _get_initial_val(const InterpolateData &p_data) const; + Variant _get_final_val(const InterpolateData &p_data) const; Variant _run_equation(InterpolateData &p_data); bool _calc_delta_val(const Variant &p_initial_val, const Variant &p_final_val, Variant &p_delta_val); bool _apply_tween_value(InterpolateData &p_data, Variant &value); diff --git a/scene/debugger/SCsub b/scene/debugger/SCsub new file mode 100644 index 0000000000..b01e2fd54d --- /dev/null +++ b/scene/debugger/SCsub @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +Import('env') + +env.add_source_files(env.scene_sources, "*.cpp") diff --git a/core/script_debugger_remote.cpp b/scene/debugger/script_debugger_remote.cpp index 65ef2a0978..c3c6a088cb 100644 --- a/core/script_debugger_remote.cpp +++ b/scene/debugger/script_debugger_remote.cpp @@ -37,7 +37,10 @@ #include "core/os/os.h" #include "core/project_settings.h" #include "scene/main/node.h" +#include "scene/main/scene_tree.h" +#include "scene/main/viewport.h" #include "scene/resources/packed_scene.h" +#include "servers/visual_server.h" void ScriptDebuggerRemote::_send_video_memory() { @@ -150,7 +153,10 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue, if (mouse_mode != Input::MOUSE_MODE_VISIBLE) Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); + uint64_t loop_begin_usec = 0; + uint64_t loop_time_sec = 0; while (true) { + loop_begin_usec = OS::get_singleton()->get_ticks_usec(); _get_output(); @@ -279,9 +285,10 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue, break; } else if (command == "request_scene_tree") { - if (request_scene_tree) - request_scene_tree(request_scene_tree_ud); - +#ifdef DEBUG_ENABLED + if (scene_tree) + scene_tree->_debugger_request_tree(); +#endif } else if (command == "request_video_mem") { _send_video_memory(); @@ -293,6 +300,40 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue, _set_object_property(cmd[1], cmd[2], cmd[3]); + } else if (command == "override_camera_2D:set") { + bool enforce = cmd[1]; + + if (scene_tree) { + scene_tree->get_root()->enable_canvas_transform_override(enforce); + } + } else if (command == "override_camera_2D:transform") { + Transform2D transform = cmd[1]; + + if (scene_tree) { + scene_tree->get_root()->set_canvas_transform_override(transform); + } + } else if (command == "override_camera_3D:set") { + bool enable = cmd[1]; + + if (scene_tree) { + scene_tree->get_root()->enable_camera_override(enable); + } + } else if (command == "override_camera_3D:transform") { + Transform transform = cmd[1]; + bool is_perspective = cmd[2]; + float size_or_fov = cmd[3]; + float near = cmd[4]; + float far = cmd[5]; + + if (scene_tree) { + if (is_perspective) { + scene_tree->get_root()->set_camera_override_perspective(size_or_fov, near, far); + } else { + scene_tree->get_root()->set_camera_override_orthogonal(size_or_fov, near, far); + } + scene_tree->get_root()->set_camera_override_transform(transform); + } + } else if (command == "reload_scripts") { reload_all_scripts = true; } else if (command == "breakpoint") { @@ -315,6 +356,13 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue, OS::get_singleton()->delay_usec(10000); OS::get_singleton()->process_and_drop_events(); } + + // This is for the camera override to stay live even when the game is paused from the editor + loop_time_sec = (OS::get_singleton()->get_ticks_usec() - loop_begin_usec) / 1000000.0f; + VisualServer::get_singleton()->sync(); + if (VisualServer::get_singleton()->has_changed()) { + VisualServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale()); + } } packet_peer_stream->put_var("debug_exit"); @@ -446,93 +494,75 @@ void ScriptDebuggerRemote::_err_handler(void *ud, const char *p_func, const char bool ScriptDebuggerRemote::_parse_live_edit(const Array &p_command) { +#ifdef DEBUG_ENABLED + String cmdstr = p_command[0]; - if (!live_edit_funcs || !cmdstr.begins_with("live_")) + if (!scene_tree || !cmdstr.begins_with("live_")) return false; - //print_line(Variant(cmd).get_construct_string()); if (cmdstr == "live_set_root") { - if (!live_edit_funcs->root_func) - return true; - //print_line("root: "+Variant(cmd).get_construct_string()); - live_edit_funcs->root_func(live_edit_funcs->udata, p_command[1], p_command[2]); + scene_tree->_live_edit_root_func(p_command[1], p_command[2]); } else if (cmdstr == "live_node_path") { - if (!live_edit_funcs->node_path_func) - return true; - //print_line("path: "+Variant(cmd).get_construct_string()); - - live_edit_funcs->node_path_func(live_edit_funcs->udata, p_command[1], p_command[2]); + scene_tree->_live_edit_node_path_func(p_command[1], p_command[2]); } else if (cmdstr == "live_res_path") { - if (!live_edit_funcs->res_path_func) - return true; - live_edit_funcs->res_path_func(live_edit_funcs->udata, p_command[1], p_command[2]); + scene_tree->_live_edit_res_path_func(p_command[1], p_command[2]); } else if (cmdstr == "live_node_prop_res") { - if (!live_edit_funcs->node_set_res_func) - return true; - live_edit_funcs->node_set_res_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]); + scene_tree->_live_edit_node_set_res_func(p_command[1], p_command[2], p_command[3]); } else if (cmdstr == "live_node_prop") { - if (!live_edit_funcs->node_set_func) - return true; - live_edit_funcs->node_set_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]); + scene_tree->_live_edit_node_set_func(p_command[1], p_command[2], p_command[3]); } else if (cmdstr == "live_res_prop_res") { - if (!live_edit_funcs->res_set_res_func) - return true; - live_edit_funcs->res_set_res_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]); + scene_tree->_live_edit_res_set_res_func(p_command[1], p_command[2], p_command[3]); } else if (cmdstr == "live_res_prop") { - if (!live_edit_funcs->res_set_func) - return true; - live_edit_funcs->res_set_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]); + scene_tree->_live_edit_res_set_func(p_command[1], p_command[2], p_command[3]); } else if (cmdstr == "live_node_call") { - if (!live_edit_funcs->node_call_func) - return true; - live_edit_funcs->node_call_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3], p_command[4], p_command[5], p_command[6], p_command[7]); + scene_tree->_live_edit_node_call_func(p_command[1], p_command[2], p_command[3], p_command[4], p_command[5], p_command[6], p_command[7]); } else if (cmdstr == "live_res_call") { - if (!live_edit_funcs->res_call_func) - return true; - live_edit_funcs->res_call_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3], p_command[4], p_command[5], p_command[6], p_command[7]); + scene_tree->_live_edit_res_call_func(p_command[1], p_command[2], p_command[3], p_command[4], p_command[5], p_command[6], p_command[7]); } else if (cmdstr == "live_create_node") { - live_edit_funcs->tree_create_node_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]); + scene_tree->_live_edit_create_node_func(p_command[1], p_command[2], p_command[3]); } else if (cmdstr == "live_instance_node") { - live_edit_funcs->tree_instance_node_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]); + scene_tree->_live_edit_instance_node_func(p_command[1], p_command[2], p_command[3]); } else if (cmdstr == "live_remove_node") { - live_edit_funcs->tree_remove_node_func(live_edit_funcs->udata, p_command[1]); + scene_tree->_live_edit_remove_node_func(p_command[1]); } else if (cmdstr == "live_remove_and_keep_node") { - live_edit_funcs->tree_remove_and_keep_node_func(live_edit_funcs->udata, p_command[1], p_command[2]); + scene_tree->_live_edit_remove_and_keep_node_func(p_command[1], p_command[2]); + } else if (cmdstr == "live_restore_node") { - live_edit_funcs->tree_restore_node_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3]); + scene_tree->_live_edit_restore_node_func(p_command[1], p_command[2], p_command[3]); } else if (cmdstr == "live_duplicate_node") { - live_edit_funcs->tree_duplicate_node_func(live_edit_funcs->udata, p_command[1], p_command[2]); + scene_tree->_live_edit_duplicate_node_func(p_command[1], p_command[2]); + } else if (cmdstr == "live_reparent_node") { - live_edit_funcs->tree_reparent_node_func(live_edit_funcs->udata, p_command[1], p_command[2], p_command[3], p_command[4]); + scene_tree->_live_edit_reparent_node_func(p_command[1], p_command[2], p_command[3], p_command[4]); } else { @@ -540,6 +570,10 @@ bool ScriptDebuggerRemote::_parse_live_edit(const Array &p_command) { } return true; +#else + + return false; +#endif } void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) { @@ -732,8 +766,10 @@ void ScriptDebuggerRemote::_poll_events() { debug(get_break_language()); } else if (command == "request_scene_tree") { - if (request_scene_tree) - request_scene_tree(request_scene_tree_ud); +#ifdef DEBUG_ENABLED + if (scene_tree) + scene_tree->_debugger_request_tree(); +#endif } else if (command == "request_video_mem") { _send_video_memory(); @@ -777,6 +813,40 @@ void ScriptDebuggerRemote::_poll_events() { multiplayer->profiling_end(); profiling_network = false; + } else if (command == "override_camera_2D:set") { + bool enforce = cmd[1]; + + if (scene_tree) { + scene_tree->get_root()->enable_canvas_transform_override(enforce); + } + } else if (command == "override_camera_2D:transform") { + Transform2D transform = cmd[1]; + + if (scene_tree) { + scene_tree->get_root()->set_canvas_transform_override(transform); + } + } else if (command == "override_camera_3D:set") { + bool enable = cmd[1]; + + if (scene_tree) { + scene_tree->get_root()->enable_camera_override(enable); + } + } else if (command == "override_camera_3D:transform") { + Transform transform = cmd[1]; + bool is_perspective = cmd[2]; + float size_or_fov = cmd[3]; + float near = cmd[4]; + float far = cmd[5]; + + if (scene_tree) { + if (is_perspective) { + scene_tree->get_root()->set_camera_override_perspective(size_or_fov, near, far); + } else { + scene_tree->get_root()->set_camera_override_orthogonal(size_or_fov, near, far); + } + scene_tree->get_root()->set_camera_override_transform(transform); + } + } else if (command == "reload_scripts") { reload_all_scripts = true; } else if (command == "breakpoint") { @@ -1106,17 +1176,6 @@ void ScriptDebuggerRemote::request_quit() { requested_quit = true; } -void ScriptDebuggerRemote::set_request_scene_tree_message_func(RequestSceneTreeMessageFunc p_func, void *p_udata) { - - request_scene_tree = p_func; - request_scene_tree_ud = p_udata; -} - -void ScriptDebuggerRemote::set_live_edit_funcs(LiveEditFuncs *p_funcs) { - - live_edit_funcs = p_funcs; -} - void ScriptDebuggerRemote::set_multiplayer(Ref<MultiplayerAPI> p_multiplayer) { multiplayer = p_multiplayer; } @@ -1195,8 +1254,7 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() : msec_count(0), locking(false), poll_every(0), - request_scene_tree(NULL), - live_edit_funcs(NULL) { + scene_tree(NULL) { packet_peer_stream->set_stream_peer(tcp_client); packet_peer_stream->set_output_buffer_max_size(1024 * 1024 * 8); //8mb should be way more than enough diff --git a/core/script_debugger_remote.h b/scene/debugger/script_debugger_remote.h index b6dd925181..13ad7ddbe3 100644 --- a/core/script_debugger_remote.h +++ b/scene/debugger/script_debugger_remote.h @@ -37,6 +37,8 @@ #include "core/os/os.h" #include "core/script_language.h" +class SceneTree; + class ScriptDebuggerRemote : public ScriptDebugger { struct Message { @@ -116,16 +118,14 @@ class ScriptDebuggerRemote : public ScriptDebugger { void _poll_events(); uint32_t poll_every; - bool _parse_live_edit(const Array &p_command); + SceneTree *scene_tree; - RequestSceneTreeMessageFunc request_scene_tree; - void *request_scene_tree_ud; + bool _parse_live_edit(const Array &p_command); void _set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value); void _send_object_id(ObjectID p_id); void _send_video_memory(); - LiveEditFuncs *live_edit_funcs; Ref<MultiplayerAPI> multiplayer; @@ -176,8 +176,6 @@ public: virtual void send_message(const String &p_message, const Array &p_args); virtual void send_error(const String &p_func, const String &p_file, int p_line, const String &p_err, const String &p_descr, ErrorHandlerType p_type, const Vector<ScriptLanguage::StackInfo> &p_stack_info); - virtual void set_request_scene_tree_message_func(RequestSceneTreeMessageFunc p_func, void *p_udata); - virtual void set_live_edit_funcs(LiveEditFuncs *p_funcs); virtual void set_multiplayer(Ref<MultiplayerAPI> p_multiplayer); virtual bool is_profiling() const; @@ -189,6 +187,8 @@ public: virtual void set_skip_breakpoints(bool p_skip_breakpoints); + void set_scene_tree(SceneTree *p_scene_tree) { scene_tree = p_scene_tree; }; + ScriptDebuggerRemote(); ~ScriptDebuggerRemote(); }; diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 6b3e89af6c..ca4c255855 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -174,17 +174,17 @@ void Button::_notification(int p_what) { _size.width -= get_constant("hseparation") + icon_ofs_region; if (!clip_text) _size.width -= get_font("font")->get_string_size(xl_text).width; - float icon_width = icon->get_width() * _size.height / icon->get_height(); + float icon_width = _icon->get_width() * _size.height / _icon->get_height(); float icon_height = _size.height; if (icon_width > _size.width) { icon_width = _size.width; - icon_height = icon->get_height() * icon_width / icon->get_width(); + icon_height = _icon->get_height() * icon_width / _icon->get_width(); } icon_region = Rect2(style->get_offset() + Point2(icon_ofs_region, (_size.height - icon_height) / 2), Size2(icon_width, icon_height)); } else { - icon_region = Rect2(style->get_offset() + Point2(icon_ofs_region, Math::floor((valign - _icon->get_height()) / 2.0)), icon->get_size()); + icon_region = Rect2(style->get_offset() + Point2(icon_ofs_region, Math::floor((valign - _icon->get_height()) / 2.0)), _icon->get_size()); } } @@ -221,7 +221,7 @@ void Button::_notification(int p_what) { font->draw(ci, text_ofs.floor(), xl_text, color, clip_text ? text_clip : -1); if (!_icon.is_null() && icon_region.size.width > 0) { - draw_texture_rect_region(_icon, icon_region, Rect2(Point2(), icon->get_size()), color_icon); + draw_texture_rect_region(_icon, icon_region, Rect2(Point2(), _icon->get_size()), color_icon); } } break; } diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index fafbcf0c55..8b4d5d4980 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2221,9 +2221,11 @@ void Control::_modal_stack_remove() { if (!data.MI) return; - get_viewport()->_gui_remove_from_modal_stack(data.MI, data.modal_prev_focus_owner); - + List<Control *>::Element *element = data.MI; data.MI = NULL; + + get_viewport()->_gui_remove_from_modal_stack(element, data.modal_prev_focus_owner); + data.modal_prev_focus_owner = 0; } diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 31551d6257..a1b584bad6 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -239,12 +239,14 @@ void WindowDialog::_notification(int p_what) { #ifdef TOOLS_ENABLED case NOTIFICATION_POST_POPUP: { - if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton()) + if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton()) { + was_editor_dimmed = EditorNode::get_singleton()->is_editor_dimmed(); EditorNode::get_singleton()->dim_editor(true); + } } break; case NOTIFICATION_POPUP_HIDE: { - if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton() && !get_viewport()->gui_has_modal_stack()) + if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton() && !was_editor_dimmed) EditorNode::get_singleton()->dim_editor(false); } break; #endif @@ -345,6 +347,10 @@ WindowDialog::WindowDialog() { close_button = memnew(TextureButton); add_child(close_button); close_button->connect("pressed", this, "_closed"); + +#ifdef TOOLS_ENABLED + was_editor_dimmed = false; +#endif } WindowDialog::~WindowDialog() { @@ -356,7 +362,7 @@ void PopupDialog::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { RID ci = get_canvas_item(); - get_stylebox("panel", "PopupMenu")->draw(ci, Rect2(Point2(), get_size())); + get_stylebox("panel")->draw(ci, Rect2(Point2(), get_size())); } } diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index afd1173f28..2eb0978e9b 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -59,6 +59,10 @@ class WindowDialog : public Popup { Point2 drag_offset_far; bool resizable; +#ifdef TOOLS_ENABLED + bool was_editor_dimmed; +#endif + void _gui_input(const Ref<InputEvent> &p_event); void _closed(); int _drag_hit_test(const Point2 &pos) const; @@ -106,7 +110,6 @@ class AcceptDialog : public WindowDialog { HBoxContainer *hbc; Label *label; Button *ok; - //Button *cancel; no more cancel (there is X on that titlebar) bool hide_on_ok; void _custom_action(const String &p_action); diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 5cb4bcc64f..6400061309 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -178,8 +178,12 @@ void FileDialog::_post_popup() { set_process_unhandled_input(true); // For open dir mode, deselect all items on file dialog open. - if (mode == MODE_OPEN_DIR) + if (mode == MODE_OPEN_DIR) { deselect_items(); + file_box->set_visible(false); + } else { + file_box->set_visible(true); + } } void FileDialog::_action_pressed() { @@ -413,6 +417,10 @@ void FileDialog::update_file_name() { void FileDialog::update_file_list() { tree->clear(); + + // Scroll back to the top after opening a directory + tree->get_vscroll_bar()->set_value(0); + dir_access->list_dir_begin(); TreeItem *root = tree->create_item(); @@ -894,6 +902,10 @@ FileDialog::FileDialog() { hbc->add_child(dir_up); dir_up->connect("pressed", this, "_go_up"); + drives = memnew(OptionButton); + hbc->add_child(drives); + drives->connect("item_selected", this, "_select_drive"); + hbc->add_child(memnew(Label(RTR("Path:")))); dir = memnew(LineEdit); hbc->add_child(dir); @@ -911,10 +923,6 @@ FileDialog::FileDialog() { show_hidden->connect("toggled", this, "set_show_hidden_files"); hbc->add_child(show_hidden); - drives = memnew(OptionButton); - hbc->add_child(drives); - drives->connect("item_selected", this, "_select_drive"); - makedir = memnew(Button); makedir->set_text(RTR("Create Folder")); makedir->connect("pressed", this, "_make_dir"); @@ -925,18 +933,18 @@ FileDialog::FileDialog() { tree->set_hide_root(true); vbc->add_margin_child(RTR("Directories & Files:"), tree, true); - hbc = memnew(HBoxContainer); - hbc->add_child(memnew(Label(RTR("File:")))); + file_box = memnew(HBoxContainer); + file_box->add_child(memnew(Label(RTR("File:")))); file = memnew(LineEdit); file->set_stretch_ratio(4); file->set_h_size_flags(SIZE_EXPAND_FILL); - hbc->add_child(file); + file_box->add_child(file); filter = memnew(OptionButton); filter->set_stretch_ratio(3); filter->set_h_size_flags(SIZE_EXPAND_FILL); filter->set_clip_text(true); // too many extensions overflows it - hbc->add_child(filter); - vbc->add_child(hbc); + file_box->add_child(filter); + vbc->add_child(file_box); dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES); access = ACCESS_RESOURCES; diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h index 4fd6d0d13c..687ebc8036 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -78,10 +78,11 @@ private: LineEdit *dir; OptionButton *drives; Tree *tree; + HBoxContainer *file_box; LineEdit *file; + OptionButton *filter; AcceptDialog *mkdirerr; AcceptDialog *exterr; - OptionButton *filter; DirAccess *dir_access; ConfirmationDialog *confirm_save; diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 1a0539effa..1406586361 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -411,6 +411,7 @@ void ItemList::set_max_columns(int p_amount) { ERR_FAIL_COND(p_amount < 0); max_columns = p_amount; update(); + shape_changed = true; } int ItemList::get_max_columns() const { diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 510f1b18ad..9e2cd9e941 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -296,8 +296,9 @@ Size2 Label::get_minimum_size() const { Size2 min_style = get_stylebox("normal")->get_minimum_size(); // don't want to mutable everything - if (word_cache_dirty) + if (word_cache_dirty) { const_cast<Label *>(this)->regenerate_word_cache(); + } if (autowrap) return Size2(1, clip ? 1 : minsize.height) + min_style; @@ -377,8 +378,14 @@ void Label::regenerate_word_cache() { memdelete(current); } - Ref<StyleBox> style = get_stylebox("normal"); - int width = autowrap ? (get_size().width - style->get_minimum_size().width) : get_longest_line_width(); + int width; + if (autowrap) { + Ref<StyleBox> style = get_stylebox("normal"); + width = MAX(get_size().width, get_custom_minimum_size().width) - style->get_minimum_size().width; + } else { + width = get_longest_line_width(); + } + Ref<Font> font = get_font("font"); int current_word_size = 0; @@ -452,6 +459,11 @@ void Label::regenerate_word_cache() { current_word_size += char_width; line_width += char_width; total_char_cache++; + + // allow autowrap to cut words when they exceed line width + if (autowrap && (current_word_size > width)) { + separatable = true; + } } if ((autowrap && (line_width >= width) && ((last && last->char_pos >= 0) || separatable)) || insert_newline) { diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index ed5dd77f53..9c016b5a50 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -213,6 +213,7 @@ void Range::unshare() { nshared->val = shared->val; nshared->step = shared->step; nshared->page = shared->page; + nshared->exp_ratio = shared->exp_ratio; nshared->allow_greater = shared->allow_greater; nshared->allow_lesser = shared->allow_lesser; _unref_shared(); diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 42cb89b2d6..0331046492 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -555,12 +555,12 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & if (p_font_color_shadow.a > 0) { float x_ofs_shadow = align_ofs + pofs; float y_ofs_shadow = y + lh - line_descent; - font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + shadow_ofs, fx_char, c[i + 1], p_font_color_shadow); + font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + shadow_ofs + fx_offset, fx_char, c[i + 1], p_font_color_shadow); if (p_shadow_as_outline) { - font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(-shadow_ofs.x, shadow_ofs.y), fx_char, c[i + 1], p_font_color_shadow); - font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(shadow_ofs.x, -shadow_ofs.y), fx_char, c[i + 1], p_font_color_shadow); - font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(-shadow_ofs.x, -shadow_ofs.y), fx_char, c[i + 1], p_font_color_shadow); + font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(-shadow_ofs.x, shadow_ofs.y) + fx_offset, fx_char, c[i + 1], p_font_color_shadow); + font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(shadow_ofs.x, -shadow_ofs.y) + fx_offset, fx_char, c[i + 1], p_font_color_shadow); + font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(-shadow_ofs.x, -shadow_ofs.y) + fx_offset, fx_char, c[i + 1], p_font_color_shadow); } } @@ -624,19 +624,19 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & if (p_mode == PROCESS_POINTER && r_click_char) *r_click_char = 0; - ENSURE_WIDTH(img->image->get_width()); + ENSURE_WIDTH(img->size.width); - bool visible = visible_characters < 0 || (p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - font->get_descent() - img->image->get_height(), img->image->get_height())); + bool visible = visible_characters < 0 || (p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - font->get_descent() - img->size.height, img->size.height)); if (visible) line_is_blank = false; if (p_mode == PROCESS_DRAW && visible) { - img->image->draw(ci, p_ofs + Point2(align_ofs + wofs, y + lh - font->get_descent() - img->image->get_height())); + img->image->draw_rect(ci, Rect2(p_ofs + Point2(align_ofs + wofs, y + lh - font->get_descent() - img->size.height), img->size)); } p_char_count++; - ADVANCE(img->image->get_width()); - CHECK_HEIGHT((img->image->get_height() + font->get_descent())); + ADVANCE(img->size.width); + CHECK_HEIGHT((img->size.height + font->get_descent())); } break; case ITEM_NEWLINE: { @@ -859,7 +859,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & void RichTextLabel::_scroll_changed(double) { - if (updating_scroll) + if (updating_scroll || !scroll_active) return; if (scroll_follow && vscroll->get_value() >= (vscroll->get_max() - vscroll->get_page())) @@ -1634,7 +1634,7 @@ void RichTextLabel::_remove_item(Item *p_item, const int p_line, const int p_sub } } -void RichTextLabel::add_image(const Ref<Texture> &p_image) { +void RichTextLabel::add_image(const Ref<Texture> &p_image, const int p_width, const int p_height) { if (current->type == ITEM_TABLE) return; @@ -1643,6 +1643,30 @@ void RichTextLabel::add_image(const Ref<Texture> &p_image) { ItemImage *item = memnew(ItemImage); item->image = p_image; + + if (p_width > 0) { + // custom width + item->size.width = p_width; + if (p_height > 0) { + // custom height + item->size.height = p_height; + } else { + // calculate height to keep aspect ratio + item->size.height = p_image->get_height() * p_width / p_image->get_width(); + } + } else { + if (p_height > 0) { + // custom height + item->size.height = p_height; + // calculate width to keep aspect ratio + item->size.width = p_image->get_width() * p_height / p_image->get_height(); + } else { + // keep original width and height + item->size.height = p_image->get_height(); + item->size.width = p_image->get_width(); + } + } + _add_item(item, false); } @@ -1697,6 +1721,41 @@ void RichTextLabel::push_font(const Ref<Font> &p_font) { _add_item(item, true); } +void RichTextLabel::push_normal() { + Ref<Font> normal_font = get_font("normal_font"); + ERR_FAIL_COND(normal_font.is_null()); + + push_font(normal_font); +} + +void RichTextLabel::push_bold() { + Ref<Font> bold_font = get_font("bold_font"); + ERR_FAIL_COND(bold_font.is_null()); + + push_font(bold_font); +} + +void RichTextLabel::push_bold_italics() { + Ref<Font> bold_italics_font = get_font("bold_italics_font"); + ERR_FAIL_COND(bold_italics_font.is_null()); + + push_font(bold_italics_font); +} + +void RichTextLabel::push_italics() { + Ref<Font> italics_font = get_font("italics_font"); + ERR_FAIL_COND(italics_font.is_null()); + + push_font(italics_font); +} + +void RichTextLabel::push_mono() { + Ref<Font> mono_font = get_font("mono_font"); + ERR_FAIL_COND(mono_font.is_null()); + + push_font(mono_font); +} + void RichTextLabel::push_color(const Color &p_color) { ERR_FAIL_COND(current->type == ITEM_TABLE); @@ -2125,6 +2184,7 @@ Error RichTextLabel::append_bbcode(const String &p_bbcode) { int end = p_bbcode.find("[", brk_end); if (end == -1) end = p_bbcode.length(); + String image = p_bbcode.substr(brk_end + 1, end - brk_end - 1); Ref<Texture> texture = ResourceLoader::load(image, "Texture"); @@ -2133,6 +2193,32 @@ Error RichTextLabel::append_bbcode(const String &p_bbcode) { pos = end; tag_stack.push_front(tag); + } else if (tag.begins_with("img=")) { + + int width = 0; + int height = 0; + + String params = tag.substr(4, tag.length()); + int sep = params.find("x"); + if (sep == -1) { + width = params.to_int(); + } else { + width = params.substr(0, sep).to_int(); + height = params.substr(sep + 1, params.length()).to_int(); + } + + int end = p_bbcode.find("[", brk_end); + if (end == -1) + end = p_bbcode.length(); + + String image = p_bbcode.substr(brk_end + 1, end - brk_end - 1); + + Ref<Texture> texture = ResourceLoader::load(image, "Texture"); + if (texture.is_valid()) + add_image(texture, width, height); + + pos = end; + tag_stack.push_front("img"); } else if (tag.begins_with("color=")) { String col = tag.substr(6, tag.length()); @@ -2581,10 +2667,15 @@ void RichTextLabel::_bind_methods() { ClassDB::bind_method(D_METHOD("get_text"), &RichTextLabel::get_text); ClassDB::bind_method(D_METHOD("add_text", "text"), &RichTextLabel::add_text); ClassDB::bind_method(D_METHOD("set_text", "text"), &RichTextLabel::set_text); - ClassDB::bind_method(D_METHOD("add_image", "image"), &RichTextLabel::add_image); + ClassDB::bind_method(D_METHOD("add_image", "image", "width", "height"), &RichTextLabel::add_image, DEFVAL(0), DEFVAL(0)); ClassDB::bind_method(D_METHOD("newline"), &RichTextLabel::add_newline); ClassDB::bind_method(D_METHOD("remove_line", "line"), &RichTextLabel::remove_line); ClassDB::bind_method(D_METHOD("push_font", "font"), &RichTextLabel::push_font); + ClassDB::bind_method(D_METHOD("push_normal"), &RichTextLabel::push_normal); + ClassDB::bind_method(D_METHOD("push_bold"), &RichTextLabel::push_bold); + ClassDB::bind_method(D_METHOD("push_bold_italics"), &RichTextLabel::push_bold_italics); + ClassDB::bind_method(D_METHOD("push_italics"), &RichTextLabel::push_italics); + ClassDB::bind_method(D_METHOD("push_mono"), &RichTextLabel::push_mono); ClassDB::bind_method(D_METHOD("push_color", "color"), &RichTextLabel::push_color); ClassDB::bind_method(D_METHOD("push_align", "align"), &RichTextLabel::push_align); ClassDB::bind_method(D_METHOD("push_indent", "level"), &RichTextLabel::push_indent); diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 1c90d974e4..b9837fdfcc 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -148,6 +148,7 @@ private: struct ItemImage : public Item { Ref<Texture> image; + Size2 size; ItemImage() { type = ITEM_IMAGE; } }; @@ -406,10 +407,15 @@ protected: public: String get_text(); void add_text(const String &p_text); - void add_image(const Ref<Texture> &p_image); + void add_image(const Ref<Texture> &p_image, const int p_width = 0, const int p_height = 0); void add_newline(); bool remove_line(const int p_line); void push_font(const Ref<Font> &p_font); + void push_normal(); + void push_bold(); + void push_bold_italics(); + void push_italics(); + void push_mono(); void push_color(const Color &p_color); void push_underline(); void push_strikethrough(); diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 9f853cf0c8..ba57be1686 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -101,26 +101,26 @@ void Slider::_gui_input(Ref<InputEvent> p_event) { if (!mm.is_valid() && !mb.is_valid()) { - if (p_event->is_action("ui_left") && p_event->is_pressed()) { + if (p_event->is_action_pressed("ui_left", true)) { if (orientation != HORIZONTAL) return; set_value(get_value() - (custom_step >= 0 ? custom_step : get_step())); accept_event(); - } else if (p_event->is_action("ui_right") && p_event->is_pressed()) { + } else if (p_event->is_action_pressed("ui_right", true)) { if (orientation != HORIZONTAL) return; set_value(get_value() + (custom_step >= 0 ? custom_step : get_step())); accept_event(); - } else if (p_event->is_action("ui_up") && p_event->is_pressed()) { + } else if (p_event->is_action_pressed("ui_up", true)) { if (orientation != VERTICAL) return; set_value(get_value() + (custom_step >= 0 ? custom_step : get_step())); accept_event(); - } else if (p_event->is_action("ui_down") && p_event->is_pressed()) { + } else if (p_event->is_action_pressed("ui_down", true)) { if (orientation != VERTICAL) return; diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 172c366c41..bf067898e6 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -108,21 +108,21 @@ void SpinBox::_gui_input(const Ref<InputEvent> &p_event) { case BUTTON_LEFT: { + line_edit->grab_focus(); + set_value(get_value() + (up ? get_step() : -get_step())); range_click_timer->set_wait_time(0.6); range_click_timer->set_one_shot(true); range_click_timer->start(); - line_edit->grab_focus(); - drag.allowed = true; drag.capture_pos = mb->get_position(); } break; case BUTTON_RIGHT: { - set_value((up ? get_max() : get_min())); line_edit->grab_focus(); + set_value((up ? get_max() : get_min())); } break; case BUTTON_WHEEL_UP: { if (line_edit->has_focus()) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 69d076c41b..8ddc31745e 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -161,57 +161,58 @@ void TextEdit::Text::_update_line_cache(int p_line) const { /* BEGIN */ int lr = cr.begin_key.length(); - if (lr == 0 || lr > left) - continue; + const CharType *kc; + bool match; - const CharType *kc = cr.begin_key.c_str(); + if (lr != 0 && lr <= left) { + kc = cr.begin_key.c_str(); - bool match = true; + match = true; - for (int k = 0; k < lr; k++) { - if (kc[k] != str[i + k]) { - match = false; - break; + for (int k = 0; k < lr; k++) { + if (kc[k] != str[i + k]) { + match = false; + break; + } } - } - if (match) { + if (match) { - ColorRegionInfo cri; - cri.end = false; - cri.region = j; - text.write[p_line].region_info[i] = cri; - i += lr - 1; + ColorRegionInfo cri; + cri.end = false; + cri.region = j; + text.write[p_line].region_info[i] = cri; + i += lr - 1; - break; + break; + } } /* END */ lr = cr.end_key.length(); - if (lr == 0 || lr > left) - continue; - - kc = cr.end_key.c_str(); + if (lr != 0 && lr <= left) { + kc = cr.end_key.c_str(); - match = true; + match = true; - for (int k = 0; k < lr; k++) { - if (kc[k] != str[i + k]) { - match = false; - break; + for (int k = 0; k < lr; k++) { + if (kc[k] != str[i + k]) { + match = false; + break; + } } - } - if (match) { + if (match) { - ColorRegionInfo cri; - cri.end = true; - cri.region = j; - text.write[p_line].region_info[i] = cri; - i += lr - 1; + ColorRegionInfo cri; + cri.end = true; + cri.region = j; + text.write[p_line].region_info[i] = cri; + i += lr - 1; - break; + break; + } } } } @@ -268,6 +269,12 @@ void TextEdit::Text::clear_wrap_cache() { } } +void TextEdit::Text::clear_info_icons() { + for (int i = 0; i < text.size(); i++) { + text.write[i].has_info = false; + } +} + void TextEdit::Text::clear() { text.clear(); @@ -302,6 +309,7 @@ void TextEdit::Text::insert(int p_at, const String &p_text) { line.breakpoint = false; line.bookmark = false; line.hidden = false; + line.has_info = false; line.width_cache = -1; line.wrap_amount_cache = -1; line.data = p_text; @@ -957,6 +965,10 @@ void TextEdit::_notification(int p_what) { } } + if (minimap_line < 0 || minimap_line >= (int)text.size()) { + break; + } + Map<int, HighlighterInfo> color_map; if (syntax_coloring) { color_map = _get_line_syntax_highlighting(minimap_line); @@ -1723,7 +1735,9 @@ void TextEdit::_notification(int p_what) { end = font->get_string_size(l.substr(0, l.rfind(String::chr(0xFFFF)))).x; } - draw_string(font, hint_ofs + sb->get_offset() + Vector2(0, font->get_ascent() + font->get_height() * i + spacing), l.replace(String::chr(0xFFFF), ""), font_color); + Point2 round_ofs = hint_ofs + sb->get_offset() + Vector2(0, font->get_ascent() + font->get_height() * i + spacing); + round_ofs = round_ofs.round(); + draw_string(font, round_ofs, l.replace(String::chr(0xFFFF), ""), font_color); if (end > 0) { Vector2 b = hint_ofs + sb->get_offset() + Vector2(begin, font->get_height() + font->get_height() * i + spacing - 1); draw_line(b, b + Vector2(end - begin, 0), font_color); @@ -2843,19 +2857,51 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { // No need to indent if we are going upwards. if (auto_indent && !(k->get_command() && k->get_shift())) { - // Indent once again if previous line will end with ':' or '{' and the line is not a comment + // Indent once again if previous line will end with ':','{','[','(' and the line is not a comment // (i.e. colon/brace precedes current cursor position). - if (cursor.column > 0 && (text[cursor.line][cursor.column - 1] == ':' || text[cursor.line][cursor.column - 1] == '{') && !is_line_comment(cursor.line)) { - if (indent_using_spaces) { - ins += space_indent; - } else { - ins += "\t"; + if (cursor.column > 0) { + const Map<int, Text::ColorRegionInfo> &cri_map = text.get_color_region_info(cursor.line); + bool indent_char_found = false; + bool should_indent = false; + char indent_char = ':'; + char c = text[cursor.line][cursor.column]; + + for (int i = 0; i < cursor.column; i++) { + c = text[cursor.line][i]; + switch (c) { + case ':': + case '{': + case '[': + case '(': + indent_char_found = true; + should_indent = true; + indent_char = c; + continue; + } + + if (indent_char_found && cri_map.has(i) && (color_regions[cri_map[i].region].begin_key == "#" || color_regions[cri_map[i].region].begin_key == "//")) { + + should_indent = true; + break; + } else if (indent_char_found && !_is_whitespace(c)) { + should_indent = false; + indent_char_found = false; + } } - // No need to move the brace below if we are not taking the text with us. - if (text[cursor.line][cursor.column] == '}' && !k->get_command()) { - brace_indent = true; - ins += "\n" + ins.substr(1, ins.length() - 2); + if (!is_line_comment(cursor.line) && should_indent) { + if (indent_using_spaces) { + ins += space_indent; + } else { + ins += "\t"; + } + + // No need to move the brace below if we are not taking the text with us. + char closing_char = _get_right_pair_symbol(indent_char); + if ((closing_char != 0) && (closing_char == text[cursor.line][cursor.column]) && !k->get_command()) { + brace_indent = true; + ins += "\n" + ins.substr(1, ins.length() - 2); + } } } } @@ -3882,7 +3928,9 @@ void TextEdit::_base_insert_text(int p_line, int p_char, const String &p_text, i if (shift_first_line) { text.set_breakpoint(p_line + 1, text.is_breakpoint(p_line)); text.set_hidden(p_line + 1, text.is_hidden(p_line)); - text.set_info_icon(p_line + 1, text.get_info_icon(p_line), text.get_info(p_line)); + if (text.has_info_icon(p_line)) { + text.set_info_icon(p_line + 1, text.get_info_icon(p_line), text.get_info(p_line)); + } text.set_breakpoint(p_line, false); text.set_hidden(p_line, false); @@ -4537,7 +4585,7 @@ void TextEdit::_scroll_moved(double p_to_val) { int v_scroll_i = floor(get_v_scroll()); int sc = 0; int n_line; - for (n_line = 0; n_line < text.size() - 1; n_line++) { + for (n_line = 0; n_line < text.size(); n_line++) { if (!is_line_hidden(n_line)) { sc++; sc += times_line_wraps(n_line); @@ -4751,6 +4799,9 @@ void TextEdit::set_text(String p_text) { selection.active = false; } + cursor_set_line(0); + cursor_set_column(0); + update(); setting_text = false; }; @@ -5052,15 +5103,18 @@ Map<int, TextEdit::Text::ColorRegionInfo> TextEdit::_get_line_color_region_info( void TextEdit::clear_colors() { keywords.clear(); + member_keywords.clear(); color_regions.clear(); color_region_cache.clear(); syntax_highlighting_cache.clear(); text.clear_width_cache(); + update(); } void TextEdit::add_keyword_color(const String &p_keyword, const Color &p_color) { keywords[p_keyword] = p_color; + syntax_highlighting_cache.clear(); update(); } @@ -5077,12 +5131,14 @@ Color TextEdit::get_keyword_color(String p_keyword) const { void TextEdit::add_color_region(const String &p_begin_key, const String &p_end_key, const Color &p_color, bool p_line_only) { color_regions.push_back(ColorRegion(p_begin_key, p_end_key, p_color, p_line_only)); + syntax_highlighting_cache.clear(); text.clear_width_cache(); update(); } void TextEdit::add_member_keyword(const String &p_keyword, const Color &p_color) { member_keywords[p_keyword] = p_color; + syntax_highlighting_cache.clear(); update(); } @@ -5096,6 +5152,7 @@ Color TextEdit::get_member_color(String p_member) const { void TextEdit::clear_member_keywords() { member_keywords.clear(); + syntax_highlighting_cache.clear(); update(); } @@ -5388,11 +5445,11 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc PoolVector<int> TextEdit::_search_bind(const String &p_key, uint32_t p_search_flags, int p_from_line, int p_from_column) const { int col, line; - if (search(p_key, p_search_flags, p_from_line, p_from_column, col, line)) { + if (search(p_key, p_search_flags, p_from_line, p_from_column, line, col)) { PoolVector<int> result; result.resize(2); - result.set(0, line); - result.set(1, col); + result.set(SEARCH_RESULT_COLUMN, col); + result.set(SEARCH_RESULT_LINE, line); return result; } else { @@ -5636,9 +5693,7 @@ void TextEdit::set_line_info_icon(int p_line, Ref<Texture> p_icon, String p_info } void TextEdit::clear_info_icons() { - for (int i = 0; i < text.size(); i++) { - text.set_info_icon(i, NULL, ""); - } + text.clear_info_icons(); update(); } @@ -6020,6 +6075,7 @@ void TextEdit::undo() { } } + _update_scrollbars(); if (undo_stack_pos->get().type == TextOperation::TYPE_REMOVE) { cursor_set_line(undo_stack_pos->get().to_line); cursor_set_column(undo_stack_pos->get().to_column); @@ -6055,6 +6111,8 @@ void TextEdit::redo() { break; } } + + _update_scrollbars(); cursor_set_line(undo_stack_pos->get().to_line); cursor_set_column(undo_stack_pos->get().to_column); undo_stack_pos = undo_stack_pos->next(); @@ -6330,8 +6388,9 @@ void TextEdit::_confirm_completion() { String line = text[cursor.line]; CharType next_char = line[cursor.column]; CharType last_completion_char = completion_current.insert_text[completion_current.insert_text.length() - 1]; + CharType last_completion_char_display = completion_current.display[completion_current.display.length() - 1]; - if ((last_completion_char == '"' || last_completion_char == '\'') && last_completion_char == next_char) { + if ((last_completion_char == '"' || last_completion_char == '\'') && (last_completion_char == next_char || last_completion_char_display == next_char)) { _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); } @@ -6478,6 +6537,7 @@ void TextEdit::_update_completion_candidates() { if (inquote && restore_quotes == 1 && !option.display.is_quoted()) { String quote = single_quote ? "'" : "\""; option.display = option.display.quote(quote); + option.insert_text = option.insert_text.quote(quote); } if (option.display.begins_with(s)) { @@ -6903,6 +6963,9 @@ void TextEdit::_bind_methods() { BIND_ENUM_CONSTANT(SEARCH_WHOLE_WORDS); BIND_ENUM_CONSTANT(SEARCH_BACKWARDS); + BIND_ENUM_CONSTANT(SEARCH_RESULT_COLUMN); + BIND_ENUM_CONSTANT(SEARCH_RESULT_LINE); + /* ClassDB::bind_method(D_METHOD("delete_char"),&TextEdit::delete_char); ClassDB::bind_method(D_METHOD("delete_line"),&TextEdit::delete_line); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index e5d9b006fe..594366de7d 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -78,6 +78,7 @@ public: bool bookmark : 1; bool hidden : 1; bool safe : 1; + bool has_info : 1; int wrap_amount_cache : 24; Map<int, ColorRegionInfo> region_info; Ref<Texture> info_icon; @@ -115,10 +116,15 @@ public: void set_safe(int p_line, bool p_safe) { text.write[p_line].safe = p_safe; } bool is_safe(int p_line) const { return text[p_line].safe; } void set_info_icon(int p_line, Ref<Texture> p_icon, String p_info) { + if (p_icon.is_null()) { + text.write[p_line].has_info = false; + return; + } text.write[p_line].info_icon = p_icon; text.write[p_line].info = p_info; + text.write[p_line].has_info = true; } - bool has_info_icon(int p_line) const { return text[p_line].info_icon.is_valid(); } + bool has_info_icon(int p_line) const { return text[p_line].has_info; } const Ref<Texture> &get_info_icon(int p_line) const { return text[p_line].info_icon; } const String &get_info(int p_line) const { return text[p_line].info; } void insert(int p_at, const String &p_text); @@ -127,6 +133,7 @@ public: void clear(); void clear_width_cache(); void clear_wrap_cache(); + void clear_info_icons(); _FORCE_INLINE_ const String &operator[](int p_line) const { return text[p_line].data; } Text() { indent_size = 4; } }; @@ -497,12 +504,16 @@ public: }; enum SearchFlags { - SEARCH_MATCH_CASE = 1, SEARCH_WHOLE_WORDS = 2, SEARCH_BACKWARDS = 4 }; + enum SearchResult { + SEARCH_RESULT_COLUMN, + SEARCH_RESULT_LINE, + }; + virtual CursorShape get_cursor_shape(const Point2 &p_pos = Point2i()) const; void _get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) const; @@ -761,6 +772,7 @@ public: VARIANT_ENUM_CAST(TextEdit::MenuItems); VARIANT_ENUM_CAST(TextEdit::SearchFlags); +VARIANT_ENUM_CAST(TextEdit::SearchResult); class SyntaxHighlighter { protected: diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index c9d1295557..d479a1636a 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1234,7 +1234,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 } } - if (select_mode != SELECT_ROW && (p_item->cells[i].selected || selected_item == p_item)) { + if ((select_mode == SELECT_ROW && selected_item == p_item) || p_item->cells[i].selected) { Rect2i r(cell_rect.position, cell_rect.size); if (p_item->cells[i].text.size() > 0) { @@ -2224,8 +2224,9 @@ void Tree::_go_down() { TreeItem *next = NULL; if (!selected_item) { - next = hide_root ? root->get_next_visible() : root; - selected_item = 0; + if (root) { + next = hide_root ? root->get_next_visible() : root; + } } else { next = selected_item->get_next_visible(); @@ -2765,7 +2766,6 @@ bool Tree::edit_selected() { return false; Rect2 rect = s->get_meta("__focus_rect"); - popup_edited_item = s; popup_edited_item_col = col; @@ -4050,6 +4050,7 @@ Tree::Tree() { drop_mode_section = 0; single_select_defer = NULL; + scrolling = false; allow_rmb_select = false; force_edit_checkbox_only_on_checkbox = false; diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 5768f58977..fd2d4a1a11 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -36,6 +36,10 @@ int VideoPlayer::sp_get_channel_count() const { + if (playback.is_null()) { + return 0; + } + return playback->get_channels(); } @@ -56,6 +60,9 @@ bool VideoPlayer::mix(AudioFrame *p_buffer, int p_frames) { // Called from main thread (eg VideoStreamPlaybackWebm::update) int VideoPlayer::_audio_mix_callback(void *p_udata, const float *p_data, int p_frames) { + ERR_FAIL_NULL_V(p_udata, 0); + ERR_FAIL_NULL_V(p_data, 0); + VideoPlayer *vp = (VideoPlayer *)p_udata; int todo = MIN(vp->resampler.get_writer_space(), p_frames); @@ -71,6 +78,12 @@ int VideoPlayer::_audio_mix_callback(void *p_udata, const float *p_data, int p_f return todo; } +void VideoPlayer::_mix_audios(void *p_self) { + + ERR_FAIL_NULL(p_self); + reinterpret_cast<VideoPlayer *>(p_self)->_mix_audio(); +} + // Called from audio thread void VideoPlayer::_mix_audio() { @@ -143,7 +156,7 @@ void VideoPlayer::_notification(int p_notification) { bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus); - if (stream.is_null() || paused || !playback->is_playing()) + if (stream.is_null() || paused || playback.is_null() || !playback->is_playing()) return; double audio_time = USEC_TO_SEC(OS::get_singleton()->get_ticks_usec()); @@ -358,7 +371,7 @@ void VideoPlayer::set_stream_position(float p_position) { playback->seek(p_position); } -Ref<Texture> VideoPlayer::get_video_texture() { +Ref<Texture> VideoPlayer::get_video_texture() const { if (playback.is_valid()) return playback->get_texture(); @@ -394,9 +407,9 @@ StringName VideoPlayer::get_bus() const { return "Master"; } -void VideoPlayer::_validate_property(PropertyInfo &property) const { +void VideoPlayer::_validate_property(PropertyInfo &p_property) const { - if (property.name == "bus") { + if (p_property.name == "bus") { String options; for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { @@ -406,7 +419,7 @@ void VideoPlayer::_validate_property(PropertyInfo &property) const { options += name; } - property.hint_string = options; + p_property.hint_string = options; } } diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index 62fb7838b6..7d2821427e 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -55,7 +55,6 @@ class VideoPlayer : public Control { RID stream_rid; Ref<ImageTexture> texture; - Ref<Image> last_frame; AudioRBResampler resampler; Vector<AudioFrame> mix_buffer; @@ -75,19 +74,19 @@ class VideoPlayer : public Control { void _mix_audio(); static int _audio_mix_callback(void *p_udata, const float *p_data, int p_frames); - static void _mix_audios(void *self) { reinterpret_cast<VideoPlayer *>(self)->_mix_audio(); } + static void _mix_audios(void *p_self); protected: static void _bind_methods(); void _notification(int p_notification); - void _validate_property(PropertyInfo &property) const; + void _validate_property(PropertyInfo &p_property) const; public: Size2 get_minimum_size() const; void set_expand(bool p_expand); bool has_expand() const; - Ref<Texture> get_video_texture(); + Ref<Texture> get_video_texture() const; void set_stream(const Ref<VideoStream> &p_stream); Ref<VideoStream> get_stream() const; diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 7b6c90766f..217dacfbfe 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2832,6 +2832,8 @@ void Node::_bind_methods() { ClassDB::bind_method(D_METHOD("rset_unreliable", "property", "value"), &Node::rset_unreliable); ClassDB::bind_method(D_METHOD("rset_unreliable_id", "peer_id", "property", "value"), &Node::rset_unreliable_id); + ClassDB::bind_method(D_METHOD("update_configuration_warning"), &Node::update_configuration_warning); + BIND_CONSTANT(NOTIFICATION_ENTER_TREE); BIND_CONSTANT(NOTIFICATION_EXIT_TREE); BIND_CONSTANT(NOTIFICATION_MOVED_IN_PARENT); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 830d314245..78ceccfca2 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -40,6 +40,7 @@ #include "core/project_settings.h" #include "main/input_default.h" #include "node.h" +#include "scene/debugger/script_debugger_remote.h" #include "scene/resources/dynamic_font.h" #include "scene/resources/material.h" #include "scene/resources/mesh.h" @@ -78,6 +79,17 @@ bool SceneTreeTimer::is_pause_mode_process() { return process_pause; } +void SceneTreeTimer::release_connections() { + + List<Connection> connections; + get_all_signal_connections(&connections); + + for (List<Connection>::Element *E = connections.front(); E; E = E->next()) { + Connection const &connection = E->get(); + disconnect(connection.signal, connection.target, connection.method); + } +} + SceneTreeTimer::SceneTreeTimer() { time_left = 0; process_pause = true; @@ -611,6 +623,12 @@ void SceneTree::finish() { memdelete(root); //delete root root = NULL; } + + // cleanup timers + for (List<Ref<SceneTreeTimer> >::Element *E = timers.front(); E; E = E->next()) { + E->get()->release_connections(); + } + timers.clear(); } void SceneTree::quit() { @@ -1077,27 +1095,6 @@ void SceneTree::get_nodes_in_group(const StringName &p_group, List<Node *> *p_li } } -static void _fill_array(Node *p_node, Array &array, int p_level) { - - array.push_back(p_node->get_child_count()); - array.push_back(p_node->get_name()); - array.push_back(p_node->get_class()); - array.push_back(p_node->get_instance_id()); - for (int i = 0; i < p_node->get_child_count(); i++) { - - _fill_array(p_node->get_child(i), array, p_level + 1); - } -} - -void SceneTree::_debugger_request_tree(void *self) { - - SceneTree *sml = (SceneTree *)self; - - Array arr; - _fill_array(sml->root, arr, 0); - ScriptDebugger::get_singleton()->send_message("scene_tree", arr); -} - void SceneTree::_flush_delete_queue() { _THREAD_SAFE_METHOD_ @@ -1320,6 +1317,25 @@ void SceneTree::add_current_scene(Node *p_current) { } #ifdef DEBUG_ENABLED +static void _fill_array(Node *p_node, Array &array, int p_level) { + + array.push_back(p_node->get_child_count()); + array.push_back(p_node->get_name()); + array.push_back(p_node->get_class()); + array.push_back(p_node->get_instance_id()); + for (int i = 0; i < p_node->get_child_count(); i++) { + + _fill_array(p_node->get_child(i), array, p_level + 1); + } +} + +void SceneTree::_debugger_request_tree() { + + Array arr; + _fill_array(root, arr, 0); + ScriptDebugger::get_singleton()->send_message("scene_tree", arr); +} + void SceneTree::_live_edit_node_path_func(const NodePath &p_path, int p_id) { live_edit_node_path_cache[p_id] = p_path; @@ -2050,7 +2066,7 @@ SceneTree::SceneTree() { int ref_atlas_subdiv = GLOBAL_DEF("rendering/quality/reflections/atlas_subdiv", 8); ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/reflections/atlas_subdiv", PropertyInfo(Variant::INT, "rendering/quality/reflections/atlas_subdiv", PROPERTY_HINT_RANGE, "0,32,or_greater")); //next_power_of_2 will return a 0 as min value int msaa_mode = GLOBAL_DEF("rendering/quality/filters/msaa", 0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x")); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x,External 2x,External 4x")); root->set_msaa(Viewport::MSAA(msaa_mode)); GLOBAL_DEF("rendering/quality/depth/hdr", true); @@ -2100,7 +2116,11 @@ SceneTree::SceneTree() { _update_root_rect(); if (ScriptDebugger::get_singleton()) { - ScriptDebugger::get_singleton()->set_request_scene_tree_message_func(_debugger_request_tree, this); + if (ScriptDebugger::get_singleton()->is_remote()) { + ScriptDebuggerRemote *remote_debugger = static_cast<ScriptDebuggerRemote *>(ScriptDebugger::get_singleton()); + + remote_debugger->set_scene_tree(this); + } ScriptDebugger::get_singleton()->set_multiplayer(multiplayer); } @@ -2112,29 +2132,6 @@ SceneTree::SceneTree() { #ifdef DEBUG_ENABLED - live_edit_funcs.udata = this; - live_edit_funcs.node_path_func = _live_edit_node_path_funcs; - live_edit_funcs.res_path_func = _live_edit_res_path_funcs; - live_edit_funcs.node_set_func = _live_edit_node_set_funcs; - live_edit_funcs.node_set_res_func = _live_edit_node_set_res_funcs; - live_edit_funcs.node_call_func = _live_edit_node_call_funcs; - live_edit_funcs.res_set_func = _live_edit_res_set_funcs; - live_edit_funcs.res_set_res_func = _live_edit_res_set_res_funcs; - live_edit_funcs.res_call_func = _live_edit_res_call_funcs; - live_edit_funcs.root_func = _live_edit_root_funcs; - - live_edit_funcs.tree_create_node_func = _live_edit_create_node_funcs; - live_edit_funcs.tree_instance_node_func = _live_edit_instance_node_funcs; - live_edit_funcs.tree_remove_node_func = _live_edit_remove_node_funcs; - live_edit_funcs.tree_remove_and_keep_node_func = _live_edit_remove_and_keep_node_funcs; - live_edit_funcs.tree_restore_node_func = _live_edit_restore_node_funcs; - live_edit_funcs.tree_duplicate_node_func = _live_edit_duplicate_node_funcs; - live_edit_funcs.tree_reparent_node_func = _live_edit_reparent_node_funcs; - - if (ScriptDebugger::get_singleton()) { - ScriptDebugger::get_singleton()->set_live_edit_funcs(&live_edit_funcs); - } - live_edit_root = NodePath("/root"); #endif diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index d387886d61..2cf6a117e7 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -61,6 +61,8 @@ public: void set_pause_mode_process(bool p_pause_mode_process); bool is_pause_mode_process(); + void release_connections(); + SceneTreeTimer(); }; @@ -209,7 +211,6 @@ private: Variant _call_group_flags(const Variant **p_args, int p_argcount, Variant::CallError &r_error); Variant _call_group(const Variant **p_args, int p_argcount, Variant::CallError &r_error); - static void _debugger_request_tree(void *self); void _flush_delete_queue(); //optimization friend class CanvasItem; @@ -218,6 +219,7 @@ private: SelfList<Node>::List xform_change_list; + friend class ScriptDebuggerRemote; #ifdef DEBUG_ENABLED Map<int, NodePath> live_edit_node_path_cache; @@ -229,7 +231,7 @@ private: Map<String, Set<Node *> > live_scene_edit_cache; Map<Node *, Map<ObjectID, Node *> > live_edit_remove_list; - ScriptDebugger::LiveEditFuncs live_edit_funcs; + void _debugger_request_tree(); void _live_edit_node_path_func(const NodePath &p_path, int p_id); void _live_edit_res_path_func(const String &p_path, int p_id); @@ -250,25 +252,6 @@ private: void _live_edit_duplicate_node_func(const NodePath &p_at, const String &p_new_name); void _live_edit_reparent_node_func(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos); - static void _live_edit_node_path_funcs(void *self, const NodePath &p_path, int p_id) { reinterpret_cast<SceneTree *>(self)->_live_edit_node_path_func(p_path, p_id); } - static void _live_edit_res_path_funcs(void *self, const String &p_path, int p_id) { reinterpret_cast<SceneTree *>(self)->_live_edit_res_path_func(p_path, p_id); } - - static void _live_edit_node_set_funcs(void *self, int p_id, const StringName &p_prop, const Variant &p_value) { reinterpret_cast<SceneTree *>(self)->_live_edit_node_set_func(p_id, p_prop, p_value); } - static void _live_edit_node_set_res_funcs(void *self, int p_id, const StringName &p_prop, const String &p_value) { reinterpret_cast<SceneTree *>(self)->_live_edit_node_set_res_func(p_id, p_prop, p_value); } - static void _live_edit_node_call_funcs(void *self, int p_id, const StringName &p_method, VARIANT_ARG_DECLARE) { reinterpret_cast<SceneTree *>(self)->_live_edit_node_call_func(p_id, p_method, VARIANT_ARG_PASS); } - static void _live_edit_res_set_funcs(void *self, int p_id, const StringName &p_prop, const Variant &p_value) { reinterpret_cast<SceneTree *>(self)->_live_edit_res_set_func(p_id, p_prop, p_value); } - static void _live_edit_res_set_res_funcs(void *self, int p_id, const StringName &p_prop, const String &p_value) { reinterpret_cast<SceneTree *>(self)->_live_edit_res_set_res_func(p_id, p_prop, p_value); } - static void _live_edit_res_call_funcs(void *self, int p_id, const StringName &p_method, VARIANT_ARG_DECLARE) { reinterpret_cast<SceneTree *>(self)->_live_edit_res_call_func(p_id, p_method, VARIANT_ARG_PASS); } - static void _live_edit_root_funcs(void *self, const NodePath &p_scene_path, const String &p_scene_from) { reinterpret_cast<SceneTree *>(self)->_live_edit_root_func(p_scene_path, p_scene_from); } - - static void _live_edit_create_node_funcs(void *self, const NodePath &p_parent, const String &p_type, const String &p_name) { reinterpret_cast<SceneTree *>(self)->_live_edit_create_node_func(p_parent, p_type, p_name); } - static void _live_edit_instance_node_funcs(void *self, const NodePath &p_parent, const String &p_path, const String &p_name) { reinterpret_cast<SceneTree *>(self)->_live_edit_instance_node_func(p_parent, p_path, p_name); } - static void _live_edit_remove_node_funcs(void *self, const NodePath &p_at) { reinterpret_cast<SceneTree *>(self)->_live_edit_remove_node_func(p_at); } - static void _live_edit_remove_and_keep_node_funcs(void *self, const NodePath &p_at, ObjectID p_keep_id) { reinterpret_cast<SceneTree *>(self)->_live_edit_remove_and_keep_node_func(p_at, p_keep_id); } - static void _live_edit_restore_node_funcs(void *self, ObjectID p_id, const NodePath &p_at, int p_at_pos) { reinterpret_cast<SceneTree *>(self)->_live_edit_restore_node_func(p_id, p_at, p_at_pos); } - static void _live_edit_duplicate_node_funcs(void *self, const NodePath &p_at, const String &p_new_name) { reinterpret_cast<SceneTree *>(self)->_live_edit_duplicate_node_func(p_at, p_new_name); } - static void _live_edit_reparent_node_funcs(void *self, const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) { reinterpret_cast<SceneTree *>(self)->_live_edit_reparent_node_func(p_at, p_new_place, p_new_name, p_at_pos); } - #endif enum { diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 52ef225364..563fcb9961 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -779,10 +779,45 @@ bool Viewport::is_audio_listener_2d() const { return audio_listener_2d; } +void Viewport::enable_canvas_transform_override(bool p_enable) { + if (override_canvas_transform == p_enable) { + return; + } + + override_canvas_transform = p_enable; + if (p_enable) { + VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform_override); + } else { + VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform); + } +} + +bool Viewport::is_canvas_transform_override_enbled() const { + return override_canvas_transform; +} + +void Viewport::set_canvas_transform_override(const Transform2D &p_transform) { + if (canvas_transform_override == p_transform) { + return; + } + + canvas_transform_override = p_transform; + if (override_canvas_transform) { + VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform_override); + } +} + +Transform2D Viewport::get_canvas_transform_override() const { + return canvas_transform_override; +} + void Viewport::set_canvas_transform(const Transform2D &p_transform) { canvas_transform = p_transform; - VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform); + + if (!override_canvas_transform) { + VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform); + } } Transform2D Viewport::get_canvas_transform() const { @@ -890,10 +925,12 @@ void Viewport::_camera_set(Camera *p_camera) { camera->notification(Camera::NOTIFICATION_LOST_CURRENT); } camera = p_camera; - if (camera) - VisualServer::get_singleton()->viewport_attach_camera(viewport, camera->get_camera()); - else - VisualServer::get_singleton()->viewport_attach_camera(viewport, RID()); + if (!camera_override) { + if (camera) + VisualServer::get_singleton()->viewport_attach_camera(viewport, camera->get_camera()); + else + VisualServer::get_singleton()->viewport_attach_camera(viewport, RID()); + } if (camera) { camera->notification(Camera::NOTIFICATION_BECAME_CURRENT); @@ -1108,10 +1145,82 @@ Listener *Viewport::get_listener() const { } Camera *Viewport::get_camera() const { - return camera; } +void Viewport::enable_camera_override(bool p_enable) { + +#ifndef _3D_DISABLED + if (p_enable == camera_override) { + return; + } + + if (p_enable) { + camera_override.rid = VisualServer::get_singleton()->camera_create(); + } else { + VisualServer::get_singleton()->free(camera_override.rid); + camera_override.rid = RID(); + } + + if (p_enable) { + VisualServer::get_singleton()->viewport_attach_camera(viewport, camera_override.rid); + } else if (camera) { + VisualServer::get_singleton()->viewport_attach_camera(viewport, camera->get_camera()); + } else { + VisualServer::get_singleton()->viewport_attach_camera(viewport, RID()); + } +#endif +} + +bool Viewport::is_camera_override_enabled() const { + return camera_override; +} + +void Viewport::set_camera_override_transform(const Transform &p_transform) { + if (camera_override) { + camera_override.transform = p_transform; + VisualServer::get_singleton()->camera_set_transform(camera_override.rid, p_transform); + } +} + +Transform Viewport::get_camera_override_transform() const { + if (camera_override) { + return camera_override.transform; + } + + return Transform(); +} + +void Viewport::set_camera_override_perspective(float p_fovy_degrees, float p_z_near, float p_z_far) { + if (camera_override) { + if (camera_override.fov == p_fovy_degrees && camera_override.z_near == p_z_near && + camera_override.z_far == p_z_far && camera_override.projection == CameraOverrideData::PROJECTION_PERSPECTIVE) + return; + + camera_override.fov = p_fovy_degrees; + camera_override.z_near = p_z_near; + camera_override.z_far = p_z_far; + camera_override.projection = CameraOverrideData::PROJECTION_PERSPECTIVE; + + VisualServer::get_singleton()->camera_set_perspective(camera_override.rid, camera_override.fov, camera_override.z_near, camera_override.z_far); + } +} + +void Viewport::set_camera_override_orthogonal(float p_size, float p_z_near, float p_z_far) { + if (camera_override) { + if (camera_override.size == p_size && camera_override.z_near == p_z_near && + camera_override.z_far == p_z_far && camera_override.projection == CameraOverrideData::PROJECTION_ORTHOGONAL) + return; + + camera_override.size = p_size; + camera_override.z_near = p_z_near; + camera_override.z_far = p_z_far; + camera_override.projection = CameraOverrideData::PROJECTION_ORTHOGONAL; + + VisualServer::get_singleton()->camera_set_orthogonal(camera_override.rid, camera_override.size, camera_override.z_near, camera_override.z_far); + } +} + Transform2D Viewport::get_final_transform() const { return stretch_transform * global_canvas_transform; @@ -2298,12 +2407,12 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { Input *input = Input::get_singleton(); - if (p_event->is_action_pressed("ui_focus_next") && input->is_action_just_pressed("ui_focus_next")) { + if (!mods && p_event->is_action_pressed("ui_focus_next") && input->is_action_just_pressed("ui_focus_next")) { next = from->find_next_valid_focus(); } - if (p_event->is_action_pressed("ui_focus_prev") && input->is_action_just_pressed("ui_focus_prev")) { + if (!mods && p_event->is_action_pressed("ui_focus_prev") && input->is_action_just_pressed("ui_focus_prev")) { next = from->find_prev_valid_focus(); } @@ -2374,7 +2483,6 @@ void Viewport::_gui_remove_from_modal_stack(List<Control *>::Element *MI, Object List<Control *>::Element *next = MI->next(); gui.modal_stack.erase(MI); - MI = NULL; if (p_prev_focus_owner) { @@ -2847,7 +2955,7 @@ int Viewport::gui_get_canvas_sort_index() { void Viewport::set_msaa(MSAA p_msaa) { - ERR_FAIL_INDEX(p_msaa, 5); + ERR_FAIL_INDEX(p_msaa, 7); if (msaa == p_msaa) return; msaa = p_msaa; @@ -2914,6 +3022,7 @@ bool Viewport::gui_is_dragging() const { } void Viewport::set_input_as_handled() { + _drop_physics_mouseover(); if (handle_input_locally) { local_input_handled = true; } else { @@ -3078,7 +3187,7 @@ void Viewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "transparent_bg"), "set_transparent_background", "has_transparent_background"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "handle_input_locally"), "set_handle_input_locally", "is_handling_input_locally"); ADD_GROUP("Rendering", ""); - ADD_PROPERTY(PropertyInfo(Variant::INT, "msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x"), "set_msaa", "get_msaa"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x,External 2x,External 4x"), "set_msaa", "get_msaa"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hdr"), "set_hdr", "get_hdr"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_3d"), "set_disable_3d", "is_3d_disabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keep_3d_linear"), "set_keep_3d_linear", "get_keep_3d_linear"); @@ -3181,6 +3290,7 @@ Viewport::Viewport() { parent = NULL; listener = NULL; camera = NULL; + override_canvas_transform = false; canvas_layers.insert(NULL); // This eases picking code (interpreted as the canvas of the Viewport) arvr = false; size_override = false; diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 6393785b22..3c3b436ca1 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -160,6 +160,24 @@ private: bool arvr; + struct CameraOverrideData { + Transform transform; + enum Projection { + PROJECTION_PERSPECTIVE, + PROJECTION_ORTHOGONAL + }; + Projection projection; + float fov; + float size; + float z_near; + float z_far; + RID rid; + + operator bool() const { + return rid != RID(); + } + } camera_override; + Camera *camera; Set<Camera *> cameras; Set<CanvasLayer *> canvas_layers; @@ -173,6 +191,9 @@ private: bool audio_listener_2d; RID internal_listener_2d; + bool override_canvas_transform; + + Transform2D canvas_transform_override; Transform2D canvas_transform; Transform2D global_canvas_transform; Transform2D stretch_transform; @@ -394,6 +415,15 @@ public: Listener *get_listener() const; Camera *get_camera() const; + void enable_camera_override(bool p_enable); + bool is_camera_override_enabled() const; + + void set_camera_override_transform(const Transform &p_transform); + Transform get_camera_override_transform() const; + + void set_camera_override_perspective(float p_fovy_degrees, float p_z_near, float p_z_far); + void set_camera_override_orthogonal(float p_size, float p_z_near, float p_z_far); + void set_use_arvr(bool p_use_arvr); bool use_arvr(); @@ -418,6 +448,12 @@ public: Ref<World2D> get_world_2d() const; Ref<World2D> find_world_2d() const; + void enable_canvas_transform_override(bool p_enable); + bool is_canvas_transform_override_enbled() const; + + void set_canvas_transform_override(const Transform2D &p_transform); + Transform2D get_canvas_transform_override() const; + void set_canvas_transform(const Transform2D &p_transform); Transform2D get_canvas_transform() const; diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 985b38f913..f4ac277d00 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -2741,77 +2741,77 @@ void Animation::copy_track(int p_track, Ref<Animation> p_to_animation) { void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("add_track", "type", "at_position"), &Animation::add_track, DEFVAL(-1)); - ClassDB::bind_method(D_METHOD("remove_track", "idx"), &Animation::remove_track); + ClassDB::bind_method(D_METHOD("remove_track", "track_idx"), &Animation::remove_track); ClassDB::bind_method(D_METHOD("get_track_count"), &Animation::get_track_count); - ClassDB::bind_method(D_METHOD("track_get_type", "idx"), &Animation::track_get_type); - ClassDB::bind_method(D_METHOD("track_get_path", "idx"), &Animation::track_get_path); - ClassDB::bind_method(D_METHOD("track_set_path", "idx", "path"), &Animation::track_set_path); + ClassDB::bind_method(D_METHOD("track_get_type", "track_idx"), &Animation::track_get_type); + ClassDB::bind_method(D_METHOD("track_get_path", "track_idx"), &Animation::track_get_path); + ClassDB::bind_method(D_METHOD("track_set_path", "track_idx", "path"), &Animation::track_set_path); ClassDB::bind_method(D_METHOD("find_track", "path"), &Animation::find_track); - ClassDB::bind_method(D_METHOD("track_move_up", "idx"), &Animation::track_move_up); - ClassDB::bind_method(D_METHOD("track_move_down", "idx"), &Animation::track_move_down); - ClassDB::bind_method(D_METHOD("track_move_to", "idx", "to_idx"), &Animation::track_move_to); - ClassDB::bind_method(D_METHOD("track_swap", "idx", "with_idx"), &Animation::track_swap); + ClassDB::bind_method(D_METHOD("track_move_up", "track_idx"), &Animation::track_move_up); + ClassDB::bind_method(D_METHOD("track_move_down", "track_idx"), &Animation::track_move_down); + ClassDB::bind_method(D_METHOD("track_move_to", "track_idx", "to_idx"), &Animation::track_move_to); + ClassDB::bind_method(D_METHOD("track_swap", "track_idx", "with_idx"), &Animation::track_swap); - ClassDB::bind_method(D_METHOD("track_set_imported", "idx", "imported"), &Animation::track_set_imported); - ClassDB::bind_method(D_METHOD("track_is_imported", "idx"), &Animation::track_is_imported); + ClassDB::bind_method(D_METHOD("track_set_imported", "track_idx", "imported"), &Animation::track_set_imported); + ClassDB::bind_method(D_METHOD("track_is_imported", "track_idx"), &Animation::track_is_imported); - ClassDB::bind_method(D_METHOD("track_set_enabled", "idx", "enabled"), &Animation::track_set_enabled); - ClassDB::bind_method(D_METHOD("track_is_enabled", "idx"), &Animation::track_is_enabled); + ClassDB::bind_method(D_METHOD("track_set_enabled", "track_idx", "enabled"), &Animation::track_set_enabled); + ClassDB::bind_method(D_METHOD("track_is_enabled", "track_idx"), &Animation::track_is_enabled); - ClassDB::bind_method(D_METHOD("transform_track_insert_key", "idx", "time", "location", "rotation", "scale"), &Animation::transform_track_insert_key); - ClassDB::bind_method(D_METHOD("track_insert_key", "idx", "time", "key", "transition"), &Animation::track_insert_key, DEFVAL(1)); - ClassDB::bind_method(D_METHOD("track_remove_key", "idx", "key_idx"), &Animation::track_remove_key); - ClassDB::bind_method(D_METHOD("track_remove_key_at_position", "idx", "position"), &Animation::track_remove_key_at_position); - ClassDB::bind_method(D_METHOD("track_set_key_value", "idx", "key", "value"), &Animation::track_set_key_value); - ClassDB::bind_method(D_METHOD("track_set_key_transition", "idx", "key_idx", "transition"), &Animation::track_set_key_transition); - ClassDB::bind_method(D_METHOD("track_set_key_time", "idx", "key_idx", "time"), &Animation::track_set_key_time); - ClassDB::bind_method(D_METHOD("track_get_key_transition", "idx", "key_idx"), &Animation::track_get_key_transition); + ClassDB::bind_method(D_METHOD("transform_track_insert_key", "track_idx", "time", "location", "rotation", "scale"), &Animation::transform_track_insert_key); + ClassDB::bind_method(D_METHOD("track_insert_key", "track_idx", "time", "key", "transition"), &Animation::track_insert_key, DEFVAL(1)); + ClassDB::bind_method(D_METHOD("track_remove_key", "track_idx", "key_idx"), &Animation::track_remove_key); + ClassDB::bind_method(D_METHOD("track_remove_key_at_position", "track_idx", "position"), &Animation::track_remove_key_at_position); + ClassDB::bind_method(D_METHOD("track_set_key_value", "track_idx", "key", "value"), &Animation::track_set_key_value); + ClassDB::bind_method(D_METHOD("track_set_key_transition", "track_idx", "key_idx", "transition"), &Animation::track_set_key_transition); + ClassDB::bind_method(D_METHOD("track_set_key_time", "track_idx", "key_idx", "time"), &Animation::track_set_key_time); + ClassDB::bind_method(D_METHOD("track_get_key_transition", "track_idx", "key_idx"), &Animation::track_get_key_transition); - ClassDB::bind_method(D_METHOD("track_get_key_count", "idx"), &Animation::track_get_key_count); - ClassDB::bind_method(D_METHOD("track_get_key_value", "idx", "key_idx"), &Animation::track_get_key_value); - ClassDB::bind_method(D_METHOD("track_get_key_time", "idx", "key_idx"), &Animation::track_get_key_time); - ClassDB::bind_method(D_METHOD("track_find_key", "idx", "time", "exact"), &Animation::track_find_key, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("track_get_key_count", "track_idx"), &Animation::track_get_key_count); + ClassDB::bind_method(D_METHOD("track_get_key_value", "track_idx", "key_idx"), &Animation::track_get_key_value); + ClassDB::bind_method(D_METHOD("track_get_key_time", "track_idx", "key_idx"), &Animation::track_get_key_time); + ClassDB::bind_method(D_METHOD("track_find_key", "track_idx", "time", "exact"), &Animation::track_find_key, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("track_set_interpolation_type", "idx", "interpolation"), &Animation::track_set_interpolation_type); - ClassDB::bind_method(D_METHOD("track_get_interpolation_type", "idx"), &Animation::track_get_interpolation_type); + ClassDB::bind_method(D_METHOD("track_set_interpolation_type", "track_idx", "interpolation"), &Animation::track_set_interpolation_type); + ClassDB::bind_method(D_METHOD("track_get_interpolation_type", "track_idx"), &Animation::track_get_interpolation_type); - ClassDB::bind_method(D_METHOD("track_set_interpolation_loop_wrap", "idx", "interpolation"), &Animation::track_set_interpolation_loop_wrap); - ClassDB::bind_method(D_METHOD("track_get_interpolation_loop_wrap", "idx"), &Animation::track_get_interpolation_loop_wrap); + ClassDB::bind_method(D_METHOD("track_set_interpolation_loop_wrap", "track_idx", "interpolation"), &Animation::track_set_interpolation_loop_wrap); + ClassDB::bind_method(D_METHOD("track_get_interpolation_loop_wrap", "track_idx"), &Animation::track_get_interpolation_loop_wrap); - ClassDB::bind_method(D_METHOD("transform_track_interpolate", "idx", "time_sec"), &Animation::_transform_track_interpolate); - ClassDB::bind_method(D_METHOD("value_track_set_update_mode", "idx", "mode"), &Animation::value_track_set_update_mode); - ClassDB::bind_method(D_METHOD("value_track_get_update_mode", "idx"), &Animation::value_track_get_update_mode); + ClassDB::bind_method(D_METHOD("transform_track_interpolate", "track_idx", "time_sec"), &Animation::_transform_track_interpolate); + ClassDB::bind_method(D_METHOD("value_track_set_update_mode", "track_idx", "mode"), &Animation::value_track_set_update_mode); + ClassDB::bind_method(D_METHOD("value_track_get_update_mode", "track_idx"), &Animation::value_track_get_update_mode); - ClassDB::bind_method(D_METHOD("value_track_get_key_indices", "idx", "time_sec", "delta"), &Animation::_value_track_get_key_indices); + ClassDB::bind_method(D_METHOD("value_track_get_key_indices", "track_idx", "time_sec", "delta"), &Animation::_value_track_get_key_indices); - ClassDB::bind_method(D_METHOD("method_track_get_key_indices", "idx", "time_sec", "delta"), &Animation::_method_track_get_key_indices); - ClassDB::bind_method(D_METHOD("method_track_get_name", "idx", "key_idx"), &Animation::method_track_get_name); - ClassDB::bind_method(D_METHOD("method_track_get_params", "idx", "key_idx"), &Animation::method_track_get_params); + ClassDB::bind_method(D_METHOD("method_track_get_key_indices", "track_idx", "time_sec", "delta"), &Animation::_method_track_get_key_indices); + ClassDB::bind_method(D_METHOD("method_track_get_name", "track_idx", "key_idx"), &Animation::method_track_get_name); + ClassDB::bind_method(D_METHOD("method_track_get_params", "track_idx", "key_idx"), &Animation::method_track_get_params); - ClassDB::bind_method(D_METHOD("bezier_track_insert_key", "track", "time", "value", "in_handle", "out_handle"), &Animation::bezier_track_insert_key, DEFVAL(Vector2()), DEFVAL(Vector2())); + ClassDB::bind_method(D_METHOD("bezier_track_insert_key", "track_idx", "time", "value", "in_handle", "out_handle"), &Animation::bezier_track_insert_key, DEFVAL(Vector2()), DEFVAL(Vector2())); - ClassDB::bind_method(D_METHOD("bezier_track_set_key_value", "idx", "key_idx", "value"), &Animation::bezier_track_set_key_value); - ClassDB::bind_method(D_METHOD("bezier_track_set_key_in_handle", "idx", "key_idx", "in_handle"), &Animation::bezier_track_set_key_in_handle); - ClassDB::bind_method(D_METHOD("bezier_track_set_key_out_handle", "idx", "key_idx", "out_handle"), &Animation::bezier_track_set_key_out_handle); + ClassDB::bind_method(D_METHOD("bezier_track_set_key_value", "track_idx", "key_idx", "value"), &Animation::bezier_track_set_key_value); + ClassDB::bind_method(D_METHOD("bezier_track_set_key_in_handle", "track_idx", "key_idx", "in_handle"), &Animation::bezier_track_set_key_in_handle); + ClassDB::bind_method(D_METHOD("bezier_track_set_key_out_handle", "track_idx", "key_idx", "out_handle"), &Animation::bezier_track_set_key_out_handle); - ClassDB::bind_method(D_METHOD("bezier_track_get_key_value", "idx", "key_idx"), &Animation::bezier_track_get_key_value); - ClassDB::bind_method(D_METHOD("bezier_track_get_key_in_handle", "idx", "key_idx"), &Animation::bezier_track_get_key_in_handle); - ClassDB::bind_method(D_METHOD("bezier_track_get_key_out_handle", "idx", "key_idx"), &Animation::bezier_track_get_key_out_handle); + ClassDB::bind_method(D_METHOD("bezier_track_get_key_value", "track_idx", "key_idx"), &Animation::bezier_track_get_key_value); + ClassDB::bind_method(D_METHOD("bezier_track_get_key_in_handle", "track_idx", "key_idx"), &Animation::bezier_track_get_key_in_handle); + ClassDB::bind_method(D_METHOD("bezier_track_get_key_out_handle", "track_idx", "key_idx"), &Animation::bezier_track_get_key_out_handle); - ClassDB::bind_method(D_METHOD("bezier_track_interpolate", "track", "time"), &Animation::bezier_track_interpolate); + ClassDB::bind_method(D_METHOD("bezier_track_interpolate", "track_idx", "time"), &Animation::bezier_track_interpolate); - ClassDB::bind_method(D_METHOD("audio_track_insert_key", "track", "time", "stream", "start_offset", "end_offset"), &Animation::audio_track_insert_key, DEFVAL(0), DEFVAL(0)); - ClassDB::bind_method(D_METHOD("audio_track_set_key_stream", "idx", "key_idx", "stream"), &Animation::audio_track_set_key_stream); - ClassDB::bind_method(D_METHOD("audio_track_set_key_start_offset", "idx", "key_idx", "offset"), &Animation::audio_track_set_key_start_offset); - ClassDB::bind_method(D_METHOD("audio_track_set_key_end_offset", "idx", "key_idx", "offset"), &Animation::audio_track_set_key_end_offset); - ClassDB::bind_method(D_METHOD("audio_track_get_key_stream", "idx", "key_idx"), &Animation::audio_track_get_key_stream); - ClassDB::bind_method(D_METHOD("audio_track_get_key_start_offset", "idx", "key_idx"), &Animation::audio_track_get_key_start_offset); - ClassDB::bind_method(D_METHOD("audio_track_get_key_end_offset", "idx", "key_idx"), &Animation::audio_track_get_key_end_offset); + ClassDB::bind_method(D_METHOD("audio_track_insert_key", "track_idx", "time", "stream", "start_offset", "end_offset"), &Animation::audio_track_insert_key, DEFVAL(0), DEFVAL(0)); + ClassDB::bind_method(D_METHOD("audio_track_set_key_stream", "track_idx", "key_idx", "stream"), &Animation::audio_track_set_key_stream); + ClassDB::bind_method(D_METHOD("audio_track_set_key_start_offset", "track_idx", "key_idx", "offset"), &Animation::audio_track_set_key_start_offset); + ClassDB::bind_method(D_METHOD("audio_track_set_key_end_offset", "track_idx", "key_idx", "offset"), &Animation::audio_track_set_key_end_offset); + ClassDB::bind_method(D_METHOD("audio_track_get_key_stream", "track_idx", "key_idx"), &Animation::audio_track_get_key_stream); + ClassDB::bind_method(D_METHOD("audio_track_get_key_start_offset", "track_idx", "key_idx"), &Animation::audio_track_get_key_start_offset); + ClassDB::bind_method(D_METHOD("audio_track_get_key_end_offset", "track_idx", "key_idx"), &Animation::audio_track_get_key_end_offset); - ClassDB::bind_method(D_METHOD("animation_track_insert_key", "track", "time", "animation"), &Animation::animation_track_insert_key); - ClassDB::bind_method(D_METHOD("animation_track_set_key_animation", "idx", "key_idx", "animation"), &Animation::animation_track_set_key_animation); - ClassDB::bind_method(D_METHOD("animation_track_get_key_animation", "idx", "key_idx"), &Animation::animation_track_get_key_animation); + ClassDB::bind_method(D_METHOD("animation_track_insert_key", "track_idx", "time", "animation"), &Animation::animation_track_insert_key); + ClassDB::bind_method(D_METHOD("animation_track_set_key_animation", "track_idx", "key_idx", "animation"), &Animation::animation_track_set_key_animation); + ClassDB::bind_method(D_METHOD("animation_track_get_key_animation", "track_idx", "key_idx"), &Animation::animation_track_get_key_animation); ClassDB::bind_method(D_METHOD("set_length", "time_sec"), &Animation::set_length); ClassDB::bind_method(D_METHOD("get_length"), &Animation::get_length); @@ -2823,7 +2823,7 @@ void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("get_step"), &Animation::get_step); ClassDB::bind_method(D_METHOD("clear"), &Animation::clear); - ClassDB::bind_method(D_METHOD("copy_track", "track", "to_animation"), &Animation::copy_track); + ClassDB::bind_method(D_METHOD("copy_track", "track_idx", "to_animation"), &Animation::copy_track); ADD_PROPERTY(PropertyInfo(Variant::REAL, "length", PROPERTY_HINT_RANGE, "0.001,99999,0.001"), "set_length", "get_length"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop"); @@ -2870,9 +2870,9 @@ bool Animation::_transform_track_optimize_key(const TKey<TransformKey> &t0, cons const Vector3 &v1 = t1.value.loc; const Vector3 &v2 = t2.value.loc; - if (v0 == v2) { + if (v0.is_equal_approx(v2)) { //0 and 2 are close, let's see if 1 is close - if (v0 != v1) { + if (!v0.is_equal_approx(v1)) { //not close, not optimizable return false; } @@ -2909,9 +2909,9 @@ bool Animation::_transform_track_optimize_key(const TKey<TransformKey> &t0, cons //localize both to rotation from q0 - if (Math::is_zero_approx((q0 - q2).length())) { + if (q0.is_equal_approx(q2)) { - if (!Math::is_zero_approx((q0 - q1).length())) + if (!q0.is_equal_approx(q1)) return false; } else { @@ -2959,9 +2959,9 @@ bool Animation::_transform_track_optimize_key(const TKey<TransformKey> &t0, cons const Vector3 &v1 = t1.value.scale; const Vector3 &v2 = t2.value.scale; - if (v0 == v2) { + if (v0.is_equal_approx(v2)) { //0 and 2 are close, let's see if 1 is close - if (v0 != v1) { + if (!v0.is_equal_approx(v1)) { //not close, not optimizable return false; } diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 0dcc184a1d..e82819f270 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -432,7 +432,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_font("font", "TextEdit", default_font); - theme->set_color("background_color", "TextEdit", Color(0, 0, 0)); + theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0)); theme->set_color("completion_background_color", "TextEdit", Color(0.17, 0.16, 0.2)); theme->set_color("completion_selected_color", "TextEdit", Color(0.26, 0.26, 0.27)); theme->set_color("completion_existing_color", "TextEdit", Color(0.87, 0.87, 0.87, 0.13)); @@ -558,9 +558,14 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("panel", "PopupPanel", style_pp); + // PopupDialog + + Ref<StyleBoxTexture> style_pd = make_stylebox(popup_bg_png, 4, 4, 4, 4, 10, 10, 10, 10); + theme->set_stylebox("panel", "PopupDialog", style_pd); + // PopupMenu - theme->set_stylebox("panel", "PopupMenu", make_stylebox(popup_bg_png, 4, 4, 4, 4, 10, 10, 10, 10)); + theme->set_stylebox("panel", "PopupMenu", style_pd); theme->set_stylebox("panel_disabled", "PopupMenu", make_stylebox(popup_bg_disabled_png, 4, 4, 4, 4)); theme->set_stylebox("hover", "PopupMenu", selected); theme->set_stylebox("separator", "PopupMenu", make_stylebox(vseparator_png, 3, 3, 3, 3)); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 0de462d616..fab0aace14 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -496,10 +496,16 @@ void SpatialMaterial::_update_shader() { } code += "uniform float roughness : hint_range(0,1);\n"; code += "uniform float point_size : hint_range(0,128);\n"; - code += "uniform sampler2D texture_metallic : hint_white;\n"; - code += "uniform vec4 metallic_texture_channel;\n"; - code += "uniform sampler2D texture_roughness : hint_white;\n"; - code += "uniform vec4 roughness_texture_channel;\n"; + + if (textures[TEXTURE_METALLIC] != NULL) { + code += "uniform sampler2D texture_metallic : hint_white;\n"; + code += "uniform vec4 metallic_texture_channel;\n"; + } + + if (textures[TEXTURE_ROUGHNESS] != NULL) { + code += "uniform sampler2D texture_roughness : hint_white;\n"; + code += "uniform vec4 roughness_texture_channel;\n"; + } if (billboard_mode == BILLBOARD_PARTICLES) { code += "uniform int particles_anim_h_frames;\n"; code += "uniform int particles_anim_v_frames;\n"; @@ -790,20 +796,30 @@ void SpatialMaterial::_update_shader() { if (flags[FLAG_ALBEDO_FROM_VERTEX_COLOR]) { code += "\talbedo_tex *= COLOR;\n"; } - code += "\tALBEDO = albedo.rgb * albedo_tex.rgb;\n"; - if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tfloat metallic_tex = dot(triplanar_texture(texture_metallic,uv1_power_normal,uv1_triplanar_pos),metallic_texture_channel);\n"; + + if (textures[TEXTURE_METALLIC] != NULL) { + if (flags[FLAG_UV1_USE_TRIPLANAR]) { + code += "\tfloat metallic_tex = dot(triplanar_texture(texture_metallic,uv1_power_normal,uv1_triplanar_pos),metallic_texture_channel);\n"; + } else { + code += "\tfloat metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);\n"; + } + code += "\tMETALLIC = metallic_tex * metallic;\n"; } else { - code += "\tfloat metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);\n"; + code += "\tMETALLIC = metallic;\n"; } - code += "\tMETALLIC = metallic_tex * metallic;\n"; - if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tfloat roughness_tex = dot(triplanar_texture(texture_roughness,uv1_power_normal,uv1_triplanar_pos),roughness_texture_channel);\n"; + + if (textures[TEXTURE_ROUGHNESS] != NULL) { + if (flags[FLAG_UV1_USE_TRIPLANAR]) { + code += "\tfloat roughness_tex = dot(triplanar_texture(texture_roughness,uv1_power_normal,uv1_triplanar_pos),roughness_texture_channel);\n"; + } else { + code += "\tfloat roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);\n"; + } + code += "\tROUGHNESS = roughness_tex * roughness;\n"; } else { - code += "\tfloat roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);\n"; + code += "\tROUGHNESS = roughness;\n"; } - code += "\tROUGHNESS = roughness_tex * roughness;\n"; + code += "\tSPECULAR = specular;\n"; if (features[FEATURE_NORMAL_MAPPING]) { @@ -1389,6 +1405,8 @@ void SpatialMaterial::set_texture(TextureParam p_param, const Ref<Texture> &p_te textures[p_param] = p_texture; RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); VS::get_singleton()->material_set_param(_get_material(), shader_names->texture_names[p_param], rid); + _queue_shader_change(); + _change_notify(); } Ref<Texture> SpatialMaterial::get_texture(TextureParam p_param) const { @@ -1754,6 +1772,7 @@ SpatialMaterial::TextureChannel SpatialMaterial::get_roughness_texture_channel() void SpatialMaterial::set_ao_texture_channel(TextureChannel p_channel) { + ERR_FAIL_INDEX(p_channel, 5); ao_texture_channel = p_channel; VS::get_singleton()->material_set_param(_get_material(), shader_names->ao_texture_channel, _get_texture_mask(p_channel)); } @@ -1764,6 +1783,7 @@ SpatialMaterial::TextureChannel SpatialMaterial::get_ao_texture_channel() const void SpatialMaterial::set_refraction_texture_channel(TextureChannel p_channel) { + ERR_FAIL_INDEX(p_channel, 5); refraction_texture_channel = p_channel; VS::get_singleton()->material_set_param(_get_material(), shader_names->refraction_texture_channel, _get_texture_mask(p_channel)); } @@ -1804,10 +1824,9 @@ RID SpatialMaterial::get_material_rid_for_2d(bool p_shaded, bool p_transparent, material->set_flag(FLAG_SRGB_VERTEX_COLOR, true); material->set_flag(FLAG_ALBEDO_FROM_VERTEX_COLOR, true); material->set_flag(FLAG_USE_ALPHA_SCISSOR, p_cut_alpha); - if (p_billboard) { - material->set_billboard_mode(BILLBOARD_ENABLED); - } else if (p_billboard_y) { - material->set_billboard_mode(BILLBOARD_FIXED_Y); + if (p_billboard || p_billboard_y) { + material->set_flag(FLAG_BILLBOARD_KEEP_SCALE, true); + material->set_billboard_mode(p_billboard_y ? BILLBOARD_FIXED_Y : BILLBOARD_ENABLED); } materials_for_2d[version] = material; diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp index 969743f78c..c5956d9bc2 100644 --- a/scene/resources/particles_material.cpp +++ b/scene/resources/particles_material.cpp @@ -332,7 +332,7 @@ void ParticlesMaterial::_update_shader() { code += " float base_angle = (initial_angle + tex_angle) * mix(1.0, angle_rand, initial_angle_random);\n"; code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle code += " CUSTOM.y = 0.0;\n"; // phase - code += " CUSTOM.w = LIFETIME * (1.0 - lifetime_randomness * rand_from_seed(alt_seed));\n"; + code += " CUSTOM.w = (1.0 - lifetime_randomness * rand_from_seed(alt_seed));\n"; code += " CUSTOM.z = (anim_offset + tex_anim_offset) * mix(1.0, anim_offset_rand, anim_offset_random);\n"; // animation offset (0-1) switch (emission_shape) { diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index 5a696aee23..f185263a36 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -90,6 +90,12 @@ void RayShape::_bind_methods() { RayShape::RayShape() : Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_RAY)) { - set_length(1.0); - set_slips_on_slope(false); + length = 1.0; + slips_on_slope = false; + + /* Code copied from setters to prevent the use of uninitialized variables */ + _update_shape(); + notify_change_to_owners(); + _change_notify("length"); + _change_notify("slips_on_slope"); } diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index c2e2f85723..593c399f62 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -2369,16 +2369,20 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String if (header[0] == 'G' && header[1] == 'D' && header[2] == '3' && header[3] == 'T') { if (tex3d.is_null()) { + f->close(); memdelete(f); ERR_FAIL_COND_V(tex3d.is_null(), RES()) } } else if (header[0] == 'G' && header[1] == 'D' && header[2] == 'A' && header[3] == 'T') { if (texarr.is_null()) { + f->close(); memdelete(f); ERR_FAIL_COND_V(texarr.is_null(), RES()) } } else { + f->close(); + memdelete(f); ERR_FAIL_V_MSG(RES(), "Unrecognized layered texture file format '" + String((const char *)header) + "'."); } @@ -2418,6 +2422,7 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String if (r_error) { *r_error = ERR_FILE_CORRUPT; } + f->close(); memdelete(f); ERR_FAIL_V(RES()); } @@ -2453,6 +2458,7 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String if (r_error) { *r_error = ERR_FILE_CORRUPT; } + f->close(); memdelete(f); ERR_FAIL_V(RES()); } @@ -2473,8 +2479,9 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String if (bytes != total_size) { if (r_error) { *r_error = ERR_FILE_CORRUPT; - memdelete(f); } + f->close(); + memdelete(f); ERR_FAIL_V(RES()); } } diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index ae18be1695..c897365b21 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -37,6 +37,118 @@ void Theme::_emit_theme_changed() { emit_changed(); } +PoolVector<String> Theme::_get_icon_list(const String &p_type) const { + + PoolVector<String> ilret; + List<StringName> il; + + get_icon_list(p_type, &il); + ilret.resize(il.size()); + + int i = 0; + PoolVector<String>::Write w = ilret.write(); + for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) { + w[i] = E->get(); + } + return ilret; +} + +PoolVector<String> Theme::_get_stylebox_list(const String &p_type) const { + + PoolVector<String> ilret; + List<StringName> il; + + get_stylebox_list(p_type, &il); + ilret.resize(il.size()); + + int i = 0; + PoolVector<String>::Write w = ilret.write(); + for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) { + w[i] = E->get(); + } + return ilret; +} + +PoolVector<String> Theme::_get_stylebox_types(void) const { + + PoolVector<String> ilret; + List<StringName> il; + + get_stylebox_types(&il); + ilret.resize(il.size()); + + int i = 0; + PoolVector<String>::Write w = ilret.write(); + for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) { + w[i] = E->get(); + } + return ilret; +} + +PoolVector<String> Theme::_get_font_list(const String &p_type) const { + + PoolVector<String> ilret; + List<StringName> il; + + get_font_list(p_type, &il); + ilret.resize(il.size()); + + int i = 0; + PoolVector<String>::Write w = ilret.write(); + for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) { + w[i] = E->get(); + } + return ilret; +} + +PoolVector<String> Theme::_get_color_list(const String &p_type) const { + + PoolVector<String> ilret; + List<StringName> il; + + get_color_list(p_type, &il); + ilret.resize(il.size()); + + int i = 0; + PoolVector<String>::Write w = ilret.write(); + for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) { + w[i] = E->get(); + } + return ilret; +} + +PoolVector<String> Theme::_get_constant_list(const String &p_type) const { + + PoolVector<String> ilret; + List<StringName> il; + + get_constant_list(p_type, &il); + ilret.resize(il.size()); + + int i = 0; + PoolVector<String>::Write w = ilret.write(); + for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) { + w[i] = E->get(); + } + return ilret; +} + +PoolVector<String> Theme::_get_type_list(const String &p_type) const { + + PoolVector<String> ilret; + List<StringName> il; + + get_type_list(&il); + ilret.resize(il.size()); + + int i = 0; + PoolVector<String>::Write w = ilret.write(); + for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) { + w[i] = E->get(); + } + return ilret; +} + bool Theme::_set(const StringName &p_name, const Variant &p_value) { String sname = p_name; @@ -300,6 +412,8 @@ void Theme::clear_icon(const StringName &p_name, const StringName &p_type) { void Theme::get_icon_list(StringName p_type, List<StringName> *p_list) const { + ERR_FAIL_NULL(p_list); + if (!icon_map.has(p_type)) return; @@ -344,6 +458,9 @@ void Theme::clear_shader(const StringName &p_name, const StringName &p_type) { } void Theme::get_shader_list(const StringName &p_type, List<StringName> *p_list) const { + + ERR_FAIL_NULL(p_list); + if (!shader_map.has(p_type)) return; @@ -408,6 +525,8 @@ void Theme::clear_stylebox(const StringName &p_name, const StringName &p_type) { void Theme::get_stylebox_list(StringName p_type, List<StringName> *p_list) const { + ERR_FAIL_NULL(p_list); + if (!style_map.has(p_type)) return; @@ -420,6 +539,8 @@ void Theme::get_stylebox_list(StringName p_type, List<StringName> *p_list) const } void Theme::get_stylebox_types(List<StringName> *p_list) const { + ERR_FAIL_NULL(p_list); + const StringName *key = NULL; while ((key = style_map.next(key))) { p_list->push_back(*key); @@ -478,6 +599,8 @@ void Theme::clear_font(const StringName &p_name, const StringName &p_type) { void Theme::get_font_list(StringName p_type, List<StringName> *p_list) const { + ERR_FAIL_NULL(p_list); + if (!font_map.has(p_type)) return; @@ -526,6 +649,8 @@ void Theme::clear_color(const StringName &p_name, const StringName &p_type) { void Theme::get_color_list(StringName p_type, List<StringName> *p_list) const { + ERR_FAIL_NULL(p_list); + if (!color_map.has(p_type)) return; @@ -574,6 +699,8 @@ void Theme::clear_constant(const StringName &p_name, const StringName &p_type) { void Theme::get_constant_list(StringName p_type, List<StringName> *p_list) const { + ERR_FAIL_NULL(p_list); + if (!constant_map.has(p_type)) return; @@ -637,6 +764,12 @@ void Theme::copy_default_theme() { void Theme::copy_theme(const Ref<Theme> &p_other) { + if (p_other.is_null()) { + clear(); + + return; + } + //these need reconnecting, so add normally { const StringName *K = NULL; @@ -680,8 +813,9 @@ void Theme::copy_theme(const Ref<Theme> &p_other) { void Theme::get_type_list(List<StringName> *p_list) const { - Set<StringName> types; + ERR_FAIL_NULL(p_list); + Set<StringName> types; const StringName *key = NULL; while ((key = icon_map.next(key))) { diff --git a/scene/resources/theme.h b/scene/resources/theme.h index 187694de65..471e5b1a51 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -52,6 +52,14 @@ class Theme : public Resource { HashMap<StringName, HashMap<StringName, Color> > color_map; HashMap<StringName, HashMap<StringName, int> > constant_map; + PoolVector<String> _get_icon_list(const String &p_type) const; + PoolVector<String> _get_stylebox_list(const String &p_type) const; + PoolVector<String> _get_stylebox_types(void) const; + PoolVector<String> _get_font_list(const String &p_type) const; + PoolVector<String> _get_color_list(const String &p_type) const; + PoolVector<String> _get_constant_list(const String &p_type) const; + PoolVector<String> _get_type_list(const String &p_type) const; + protected: bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; @@ -65,70 +73,6 @@ protected: Ref<Font> default_theme_font; - PoolVector<String> _get_icon_list(const String &p_type) const { - PoolVector<String> ilret; - List<StringName> il; - get_icon_list(p_type, &il); - for (List<StringName>::Element *E = il.front(); E; E = E->next()) { - ilret.push_back(E->get()); - } - return ilret; - } - PoolVector<String> _get_stylebox_list(const String &p_type) const { - PoolVector<String> ilret; - List<StringName> il; - get_stylebox_list(p_type, &il); - for (List<StringName>::Element *E = il.front(); E; E = E->next()) { - ilret.push_back(E->get()); - } - return ilret; - } - PoolVector<String> _get_stylebox_types(void) const { - PoolVector<String> ilret; - List<StringName> il; - get_stylebox_types(&il); - for (List<StringName>::Element *E = il.front(); E; E = E->next()) { - ilret.push_back(E->get()); - } - return ilret; - } - PoolVector<String> _get_font_list(const String &p_type) const { - PoolVector<String> ilret; - List<StringName> il; - get_font_list(p_type, &il); - for (List<StringName>::Element *E = il.front(); E; E = E->next()) { - ilret.push_back(E->get()); - } - return ilret; - } - PoolVector<String> _get_color_list(const String &p_type) const { - PoolVector<String> ilret; - List<StringName> il; - get_color_list(p_type, &il); - for (List<StringName>::Element *E = il.front(); E; E = E->next()) { - ilret.push_back(E->get()); - } - return ilret; - } - PoolVector<String> _get_constant_list(const String &p_type) const { - PoolVector<String> ilret; - List<StringName> il; - get_constant_list(p_type, &il); - for (List<StringName>::Element *E = il.front(); E; E = E->next()) { - ilret.push_back(E->get()); - } - return ilret; - } - PoolVector<String> _get_type_list(const String &p_type) const { - PoolVector<String> ilret; - List<StringName> il; - get_type_list(&il); - for (List<StringName>::Element *E = il.front(); E; E = E->next()) { - ilret.push_back(E->get()); - } - return ilret; - } - static void _bind_methods(); public: diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 24122a8d99..16a95e65a8 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -148,20 +148,45 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) { } } } else if (what == "shape") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape(id, i, p_value); + } + } else { + tile_set_shape(id, 0, p_value); + } else if (what == "shape_offset") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape_offset(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape_offset(id, i, p_value); + } + } else { + tile_set_shape_offset(id, 0, p_value); + } else if (what == "shape_transform") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape_transform(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape_transform(id, i, p_value); + } + } else { + tile_set_shape_transform(id, 0, p_value); + } else if (what == "shape_one_way") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape_one_way(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape_one_way(id, i, p_value); + } + } else { + tile_set_shape_one_way(id, 0, p_value); + } else if (what == "shape_one_way_margin") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape_one_way_margin(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape_one_way_margin(id, i, p_value); + } + } else { + tile_set_shape_one_way_margin(id, 0, p_value); + } else if (what == "shapes") _tile_set_shapes(id, p_value); else if (what == "occluder") diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index eb3bf6770f..81c7b062cc 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -63,7 +63,7 @@ public: //virtual int mix(int16_t* p_buffer,int p_frames)=0; - virtual Ref<Texture> get_texture() = 0; + virtual Ref<Texture> get_texture() const = 0; virtual void update(float p_delta) = 0; virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata) = 0; diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index bd6835f816..9f99732714 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -1064,10 +1064,11 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui String src_var = "n_out" + itos(from_node) + "p" + itos(from_port); if (in_type == VisualShaderNode::PORT_TYPE_SAMPLER && out_type == VisualShaderNode::PORT_TYPE_SAMPLER) { - - VisualShaderNodeUniform *uniform = (VisualShaderNodeUniform *)graph[type].nodes[from_node].node.ptr(); - if (uniform) { - inputs[i] = uniform->get_uniform_name(); + VisualShaderNode *ptr = const_cast<VisualShaderNode *>(graph[type].nodes[from_node].node.ptr()); + if (ptr->has_method("get_input_real_name")) { + inputs[i] = ptr->call("get_input_real_name"); + } else if (ptr->has_method("get_uniform_name")) { + inputs[i] = ptr->call("get_uniform_name"); } else { inputs[i] = ""; } @@ -1442,6 +1443,8 @@ const VisualShaderNodeInput::Port VisualShaderNodeInput::ports[] = { { Shader::MODE_SPATIAL, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_VECTOR, "viewport_size", "vec3(VIEWPORT_SIZE, 0.0)" }, { Shader::MODE_SPATIAL, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_BOOLEAN, "output_is_srgb", "OUTPUT_IS_SRGB" }, { Shader::MODE_SPATIAL, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_BOOLEAN, "front_facing", "FRONT_FACING" }, + { Shader::MODE_SPATIAL, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_SAMPLER, "screen_texture", "SCREEN_TEXTURE" }, + { Shader::MODE_SPATIAL, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_SAMPLER, "depth_texture", "DEPTH_TEXTURE" }, // Spatial, Light { Shader::MODE_SPATIAL, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR, "fragcoord", "FRAGCOORD.xyz" }, @@ -1488,6 +1491,9 @@ const VisualShaderNodeInput::Port VisualShaderNodeInput::ports[] = { { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_VECTOR, "point_coord", "vec3(POINT_COORD,0.0)" }, { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_SCALAR, "time", "TIME" }, { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_SCALAR, "light_pass", "float(AT_LIGHT_PASS ? 1.0 : 0.0)" }, + { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_SAMPLER, "texture", "TEXTURE" }, + { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_SAMPLER, "normal_texture", "NORMAL_TEXTURE" }, + { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_SAMPLER, "screen_texture", "SCREEN_TEXTURE" }, // Canvas Item, Light { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR, "fragcoord", "FRAGCOORD.xyz" }, { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR, "uv", "vec3(UV,0.0)" }, @@ -1504,6 +1510,7 @@ const VisualShaderNodeInput::Port VisualShaderNodeInput::ports[] = { { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR, "texture_pixel_size", "vec3(TEXTURE_PIXEL_SIZE, 1.0)" }, { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR, "point_coord", "vec3(POINT_COORD,0.0)" }, { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_SCALAR, "time", "TIME" }, + { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_SAMPLER, "texture", "TEXTURE" }, // Particles, Vertex { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_VECTOR, "color", "COLOR.rgb" }, @@ -1599,11 +1606,15 @@ String VisualShaderNodeInput::get_output_port_name(int p_port) const { } String VisualShaderNodeInput::get_caption() const { - return TTR("Input"); + return "Input"; } String VisualShaderNodeInput::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { + if (get_output_port_type(0) == PORT_TYPE_SAMPLER) { + return ""; + } + if (p_for_preview) { int idx = 0; @@ -1672,6 +1683,20 @@ String VisualShaderNodeInput::get_input_name() const { return input_name; } +String VisualShaderNodeInput::get_input_real_name() const { + + int idx = 0; + + while (ports[idx].mode != Shader::MODE_MAX) { + if (ports[idx].mode == shader_mode && ports[idx].shader_type == shader_type && ports[idx].name == input_name) { + return String(ports[idx].string); + } + idx++; + } + + return ""; +} + VisualShaderNodeInput::PortType VisualShaderNodeInput::get_input_type_by_name(String p_name) const { int idx = 0; @@ -1768,6 +1793,7 @@ void VisualShaderNodeInput::_bind_methods() { ClassDB::bind_method(D_METHOD("set_input_name", "name"), &VisualShaderNodeInput::set_input_name); ClassDB::bind_method(D_METHOD("get_input_name"), &VisualShaderNodeInput::get_input_name); + ClassDB::bind_method(D_METHOD("get_input_real_name"), &VisualShaderNodeInput::get_input_real_name); ADD_PROPERTY(PropertyInfo(Variant::STRING, "input_name", PROPERTY_HINT_ENUM, ""), "set_input_name", "get_input_name"); ADD_SIGNAL(MethodInfo("input_type_changed")); @@ -1921,7 +1947,7 @@ bool VisualShaderNodeOutput::is_port_separator(int p_index) const { } String VisualShaderNodeOutput::get_caption() const { - return TTR("Output"); + return "Output"; } String VisualShaderNodeOutput::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index 4f73316404..09222c8d81 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -299,6 +299,7 @@ public: void set_input_name(String p_name); String get_input_name() const; + String get_input_real_name() const; int get_input_index_count() const; PortType get_input_index_type(int p_index) const; diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp index a7df736c78..a94fdd9d7b 100644 --- a/scene/resources/visual_shader_nodes.cpp +++ b/scene/resources/visual_shader_nodes.cpp @@ -475,27 +475,29 @@ String VisualShaderNodeTexture::generate_code(Shader::Mode p_mode, VisualShader: String id = p_input_vars[2]; String code; + code += "\t{\n"; if (id == String()) { - code += "\tvec4 " + id + "_tex_read = vec4(0.0);\n"; + code += "\t\tvec4 " + id + "_tex_read = vec4(0.0);\n"; } else { if (p_input_vars[0] == String()) { // Use UV by default. if (p_input_vars[1] == String()) { - code += "\tvec4 " + id + "_tex_read = texture( " + id + " , UV.xy );\n"; + code += "\t\tvec4 " + id + "_tex_read = texture( " + id + " , UV.xy );\n"; } else { - code += "\tvec4 " + id + "_tex_read = textureLod( " + id + " , UV.xy , " + p_input_vars[1] + " );\n"; + code += "\t\tvec4 " + id + "_tex_read = textureLod( " + id + " , UV.xy , " + p_input_vars[1] + " );\n"; } } else if (p_input_vars[1] == String()) { //no lod - code += "\tvec4 " + id + "_tex_read = texture( " + id + " , " + p_input_vars[0] + ".xy );\n"; + code += "\t\tvec4 " + id + "_tex_read = texture( " + id + " , " + p_input_vars[0] + ".xy );\n"; } else { - code += "\tvec4 " + id + "_tex_read = textureLod( " + id + " , " + p_input_vars[0] + ".xy , " + p_input_vars[1] + " );\n"; + code += "\t\tvec4 " + id + "_tex_read = textureLod( " + id + " , " + p_input_vars[0] + ".xy , " + p_input_vars[1] + " );\n"; } - code += "\t" + p_output_vars[0] + " = " + id + "_tex_read.rgb;\n"; - code += "\t" + p_output_vars[1] + " = " + id + "_tex_read.a;\n"; + code += "\t\t" + p_output_vars[0] + " = " + id + "_tex_read.rgb;\n"; + code += "\t\t" + p_output_vars[1] + " = " + id + "_tex_read.a;\n"; } + code += "\t}\n"; return code; } @@ -905,6 +907,7 @@ void VisualShaderNodeCubeMap::_bind_methods() { VisualShaderNodeCubeMap::VisualShaderNodeCubeMap() { texture_type = TYPE_DATA; + source = SOURCE_TEXTURE; } ////////////// Scalar Op diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp index 1390ab55c4..83d78daff4 100644 --- a/servers/audio/effects/audio_effect_record.cpp +++ b/servers/audio/effects/audio_effect_record.cpp @@ -297,4 +297,5 @@ void AudioEffectRecord::_bind_methods() { AudioEffectRecord::AudioEffectRecord() { format = AudioStreamSample::FORMAT_16_BITS; + recording_active = false; } diff --git a/servers/audio/effects/eq.cpp b/servers/audio/effects/eq.cpp index e8f247d3bc..a9b576b1d9 100644 --- a/servers/audio/effects/eq.cpp +++ b/servers/audio/effects/eq.cpp @@ -103,7 +103,9 @@ void EQ::recalculate_band_coefficients() { //printf("band %i, precoefs = %f,%f,%f\n",i,c2a,c2b,c2c); - double r1, r2; //roots + // Default initializing to silence compiler warning about potential uninitialized use. + // Both variables are properly set in _solve_quadratic before use, or we continue if roots == 0. + double r1 = 0, r2 = 0; //roots int roots = solve_quadratic(c2a, c2b, c2c, &r1, &r2); ERR_CONTINUE(roots == 0); diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index 7d575c57ae..ba98e14d2e 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -260,12 +260,14 @@ void BodySW::set_mode(PhysicsServer::BodyMode p_mode) { _inv_mass = mass > 0 ? (1.0 / mass) : 0; _set_static(false); + set_active(true); } break; case PhysicsServer::BODY_MODE_CHARACTER: { _inv_mass = mass > 0 ? (1.0 / mass) : 0; _set_static(false); + set_active(true); angular_velocity = Vector3(); } break; } diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index f9939e3843..de1dfc9ee7 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -238,6 +238,7 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) { _inv_mass = mass > 0 ? (1.0 / mass) : 0; _inv_inertia = inertia > 0 ? (1.0 / inertia) : 0; _set_static(false); + set_active(true); } break; case Physics2DServer::BODY_MODE_CHARACTER: { @@ -245,6 +246,7 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) { _inv_mass = mass > 0 ? (1.0 / mass) : 0; _inv_inertia = 0; _set_static(false); + set_active(true); angular_velocity = 0; } break; } diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index c698290fd9..9fc15d9660 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -139,6 +139,7 @@ void Physics2DServerWrapMT::finish() { segment_shape_free_cached_ids(); circle_shape_free_cached_ids(); rectangle_shape_free_cached_ids(); + capsule_shape_free_cached_ids(); convex_polygon_shape_free_cached_ids(); concave_polygon_shape_free_cached_ids(); diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index f7cec6a378..c944e7016e 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -56,12 +56,12 @@ #include "audio_server.h" #include "camera/camera_feed.h" #include "camera_server.h" -#include "core/script_debugger_remote.h" #include "physics/physics_server_sw.h" #include "physics_2d/physics_2d_server_sw.h" #include "physics_2d/physics_2d_server_wrap_mt.h" #include "physics_2d_server.h" #include "physics_server.h" +#include "scene/debugger/script_debugger_remote.h" #include "visual/shader_types.h" #include "visual_server.h" diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 5b5ba56ebe..9babc99349 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -31,6 +31,8 @@ #include "shader_language.h" #include "core/os/os.h" #include "core/print_string.h" +#include "servers/visual_server.h" + static bool _is_text_char(CharType c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_'; @@ -1350,730 +1352,711 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { //constructors - { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec3", TYPE_BVEC3, { TYPE_BVEC2, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC2, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC3, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - - { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec3", TYPE_VEC3, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - - { "int", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec3", TYPE_IVEC3, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - - { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec3", TYPE_UVEC3, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - - { "mat2", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "mat3", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "mat4", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "mat2", TYPE_MAT2, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mat3", TYPE_MAT3, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mat4", TYPE_MAT4, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec3", TYPE_BVEC3, { TYPE_BVEC2, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC2, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_BVEC3, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + + { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec3", TYPE_VEC3, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + + { "int", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec3", TYPE_IVEC3, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + + { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec3", TYPE_UVEC3, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + + { "mat2", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat3", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat4", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "mat2", TYPE_MAT2, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat3", TYPE_MAT3, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat4", TYPE_MAT4, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, //conversion scalars - { "int", TYPE_INT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "int", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "int", TYPE_INT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "int", TYPE_INT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "int", TYPE_INT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "int", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "int", TYPE_INT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "int", TYPE_INT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, - { "float", TYPE_FLOAT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "float", TYPE_FLOAT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "float", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "float", TYPE_FLOAT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "float", TYPE_FLOAT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "float", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uint", TYPE_UINT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "uint", TYPE_UINT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "uint", TYPE_UINT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "uint", TYPE_UINT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, - { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, - { "bool", TYPE_BOOL, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "bool", TYPE_BOOL, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "bool", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, + { "bool", TYPE_BOOL, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "bool", TYPE_BOOL, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "bool", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, //conversion vectors - { "ivec2", TYPE_IVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "ivec2", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "ivec2", TYPE_IVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "ivec2", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - - { "vec2", TYPE_VEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "vec2", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "vec2", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "vec2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - - { "uvec2", TYPE_UVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "uvec2", TYPE_UVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "uvec2", TYPE_UVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "uvec2", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - - { "bvec2", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "bvec2", TYPE_BVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "bvec2", TYPE_BVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "bvec2", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - - { "ivec3", TYPE_IVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "ivec3", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "ivec3", TYPE_IVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "ivec3", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - - { "vec3", TYPE_VEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "vec3", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "vec3", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "vec3", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - - { "uvec3", TYPE_UVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "uvec3", TYPE_UVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "uvec3", TYPE_UVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "uvec3", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - - { "bvec3", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "bvec3", TYPE_BVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "bvec3", TYPE_BVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "bvec3", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - - { "ivec4", TYPE_IVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "ivec4", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "vec4", TYPE_VEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "vec4", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "uvec4", TYPE_UVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "uvec4", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "bvec4", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "bvec4", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "ivec2", TYPE_IVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec2", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec2", TYPE_IVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec2", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + + { "vec2", TYPE_VEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec2", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec2", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + + { "uvec2", TYPE_UVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec2", TYPE_UVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec2", TYPE_UVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec2", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + + { "bvec2", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec2", TYPE_BVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec2", TYPE_BVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec2", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + + { "ivec3", TYPE_IVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec3", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec3", TYPE_IVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec3", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + + { "vec3", TYPE_VEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec3", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec3", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec3", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + + { "uvec3", TYPE_UVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec3", TYPE_UVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec3", TYPE_UVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec3", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + + { "bvec3", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec3", TYPE_BVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec3", TYPE_BVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec3", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + + { "ivec4", TYPE_IVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "vec4", TYPE_VEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "uvec4", TYPE_UVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "bvec4", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, //conversion between matrixes - { "mat2", TYPE_MAT2, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, - { "mat2", TYPE_MAT2, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, - { "mat3", TYPE_MAT3, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, - { "mat3", TYPE_MAT3, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, - { "mat4", TYPE_MAT4, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, - { "mat4", TYPE_MAT4, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, + { "mat2", TYPE_MAT2, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat2", TYPE_MAT2, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat3", TYPE_MAT3, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat3", TYPE_MAT3, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat4", TYPE_MAT4, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL, false }, + { "mat4", TYPE_MAT4, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL, false }, //builtins - trigonometry - { "radians", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "radians", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "radians", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "radians", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "degrees", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "degrees", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "degrees", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "degrees", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "sin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "sin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "sin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "sin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "cos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "cos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "cos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "cos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "tan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "tan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "tan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "tan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "asin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "asin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "asin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "asin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "acos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "acos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "acos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "acos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "sinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "sinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "sinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "sinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "cosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "cosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "cosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "cosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "tanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "tanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "tanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "tanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "asinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "asinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "asinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "asinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "acosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "acosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "acosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "acosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "atanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "atanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "atanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "atanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "radians", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "radians", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "radians", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "radians", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "degrees", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "degrees", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "degrees", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "degrees", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "sin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "sin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "sin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "sin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "cos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "cos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "cos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "cos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "tan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "tan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "tan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "tan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "asin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "asin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "asin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "asin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "acos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "acos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "acos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "acos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "sinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "sinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "sinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "sinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "cosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "cosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "cosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "cosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "tanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "tanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "tanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "tanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "asinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "asinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "asinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "asinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "acosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "acosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "acosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "acosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "atanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "atanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "atanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "atanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, //builtins - exponential - { "pow", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "pow", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "pow", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "pow", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "exp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "exp", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "exp", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "exp", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "log", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "log", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "log", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "log", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "exp2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "exp2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "exp2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "exp2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "log2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "log2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "log2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "log2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "sqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "sqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "sqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "sqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "inversesqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "inversesqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "inversesqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "inversesqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "pow", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "pow", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "pow", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "pow", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "exp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "exp", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "exp", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "exp", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "log", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "log", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "log", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "log", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "exp2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "exp2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "exp2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "exp2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "log2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "log2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "log2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "log2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "sqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "sqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "sqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "sqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "inversesqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "inversesqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "inversesqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "inversesqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, //builtins - common - { "abs", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "abs", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "abs", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "abs", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "abs", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "abs", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "abs", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "abs", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "sign", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "sign", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "sign", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "sign", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "sign", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "sign", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "sign", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "sign", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "floor", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "floor", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "floor", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "floor", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "trunc", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "trunc", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "trunc", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "trunc", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "round", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "round", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "round", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "round", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "roundEven", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "roundEven", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "roundEven", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "roundEven", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "ceil", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "ceil", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "ceil", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "ceil", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "fract", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "fract", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "fract", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "fract", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "mod", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "modf", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "modf", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "modf", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "modf", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "min", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "min", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - - { "min", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - - { "max", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "max", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - - { "max", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - - { "clamp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "clamp", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - - { "clamp", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - - { "mix", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "step", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "step", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "step", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "step", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "step", TYPE_VEC2, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "step", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "step", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "smoothstep", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "smoothstep", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "smoothstep", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "smoothstep", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "smoothstep", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "smoothstep", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "smoothstep", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "isnan", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "isnan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "isnan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "isnan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "isinf", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "isinf", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "isinf", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "isinf", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "floatBitsToInt", TYPE_INT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "floatBitsToInt", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "floatBitsToInt", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "floatBitsToInt", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "floatBitsToUint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "floatBitsToUint", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "floatBitsToUint", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "floatBitsToUint", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "intBitsToFloat", TYPE_FLOAT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "intBitsToFloat", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "intBitsToFloat", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "intBitsToFloat", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "uintBitsToFloat", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, - { "uintBitsToFloat", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "uintBitsToFloat", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "uintBitsToFloat", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "abs", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "abs", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "abs", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "abs", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "abs", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "abs", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "abs", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "abs", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "sign", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "sign", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "sign", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "sign", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "sign", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "sign", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "sign", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "sign", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "floor", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "floor", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "floor", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "floor", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "trunc", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "trunc", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "trunc", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "trunc", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "round", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "round", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "round", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "round", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "roundEven", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "roundEven", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "roundEven", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "roundEven", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "ceil", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "ceil", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "ceil", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "ceil", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "fract", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "fract", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "fract", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "fract", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "mod", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "modf", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "modf", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "modf", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "modf", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + + { "min", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "min", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "min", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "max", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "max", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "max", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "clamp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "clamp", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "clamp", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "mix", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "step", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "step", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "step", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "step", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "step", TYPE_VEC2, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "step", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "step", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "smoothstep", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "smoothstep", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "smoothstep", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "smoothstep", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "smoothstep", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "smoothstep", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "smoothstep", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "isnan", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "isnan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "isnan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "isnan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "isinf", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "isinf", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "isinf", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "isinf", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "floatBitsToInt", TYPE_INT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "floatBitsToInt", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "floatBitsToInt", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "floatBitsToInt", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + + { "floatBitsToUint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "floatBitsToUint", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "floatBitsToUint", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "floatBitsToUint", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + + { "intBitsToFloat", TYPE_FLOAT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "intBitsToFloat", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "intBitsToFloat", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "intBitsToFloat", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, true }, + + { "uintBitsToFloat", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uintBitsToFloat", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "uintBitsToFloat", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "uintBitsToFloat", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, //builtins - geometric - { "length", TYPE_FLOAT, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "length", TYPE_FLOAT, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "length", TYPE_FLOAT, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "distance", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "distance", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "distance", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "dot", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "dot", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "dot", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "cross", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "normalize", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "normalize", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "normalize", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "reflect", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "refract", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "faceforward", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "faceforward", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "faceforward", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "matrixCompMult", TYPE_MAT2, { TYPE_MAT2, TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, - { "matrixCompMult", TYPE_MAT3, { TYPE_MAT3, TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, - { "matrixCompMult", TYPE_MAT4, { TYPE_MAT4, TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, - - { "outerProduct", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "outerProduct", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "outerProduct", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "transpose", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, - { "transpose", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, - { "transpose", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, - - { "determinant", TYPE_FLOAT, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, - { "determinant", TYPE_FLOAT, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, - { "determinant", TYPE_FLOAT, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, - - { "inverse", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, - { "inverse", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, - { "inverse", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, - - { "lessThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "lessThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "lessThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "lessThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "lessThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "lessThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "lessThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "lessThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "lessThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "greaterThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "greaterThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "greaterThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "equal", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "equal", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "equal", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "equal", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "equal", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "equal", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "equal", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "equal", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "equal", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "equal", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "equal", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "equal", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "notEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "notEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "length", TYPE_FLOAT, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "length", TYPE_FLOAT, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "length", TYPE_FLOAT, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "distance", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "distance", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "distance", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "dot", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "dot", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "dot", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "cross", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "normalize", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "normalize", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "normalize", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "reflect", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "refract", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "faceforward", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "faceforward", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "faceforward", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "matrixCompMult", TYPE_MAT2, { TYPE_MAT2, TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL, false }, + { "matrixCompMult", TYPE_MAT3, { TYPE_MAT3, TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL, false }, + { "matrixCompMult", TYPE_MAT4, { TYPE_MAT4, TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "outerProduct", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "outerProduct", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "outerProduct", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "transpose", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL, false }, + { "transpose", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL, false }, + { "transpose", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "determinant", TYPE_FLOAT, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL, false }, + { "determinant", TYPE_FLOAT, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL, false }, + { "determinant", TYPE_FLOAT, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "inverse", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL, false }, + { "inverse", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL, false }, + { "inverse", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "lessThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "lessThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "lessThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "greaterThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "greaterThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "greaterThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "lessThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "lessThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "lessThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "greaterThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "greaterThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "greaterThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "equal", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "equal", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "equal", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "equal", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "notEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + + { "notEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "notEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "notEqual", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "any", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "any", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "any", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "any", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "any", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "any", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "all", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "all", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "all", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "all", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "all", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "all", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "not", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, - { "not", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, - { "not", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "not", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "not", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "not", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, //builtins - texture - { "textureSize", TYPE_IVEC2, { TYPE_SAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC2, { TYPE_ISAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC2, { TYPE_USAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "textureSize", TYPE_IVEC2, { TYPE_SAMPLERCUBE, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - - { "dFdx", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "dFdx", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "dFdx", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "dFdx", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "dFdy", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "dFdy", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "dFdy", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "dFdy", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - - { "fwidth", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "fwidth", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, - { "fwidth", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, - { "fwidth", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC2, { TYPE_SAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC2, { TYPE_ISAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC2, { TYPE_USAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureSize", TYPE_IVEC2, { TYPE_SAMPLERCUBE, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + + { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + + { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureLod", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureLod", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + + { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + + { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + + { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "textureGrad", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + + { "dFdx", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "dFdx", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "dFdx", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "dFdx", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + + { "dFdy", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "dFdy", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "dFdy", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "dFdy", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, + + { "fwidth", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, + { "fwidth", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "fwidth", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "fwidth", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, //sub-functions //array - { "length", TYPE_INT, { TYPE_VOID }, TAG_ARRAY }, + { "length", TYPE_INT, { TYPE_VOID }, TAG_ARRAY, false }, - { NULL, TYPE_VOID, { TYPE_VOID }, TAG_GLOBAL } + { NULL, TYPE_VOID, { TYPE_VOID }, TAG_GLOBAL, false } }; @@ -2100,6 +2083,8 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p int argcount = args.size(); bool failed_builtin = false; + bool unsupported_builtin = false; + int builtin_idx = 0; if (argcount <= 4) { // test builtins @@ -2126,6 +2111,16 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p } } + if (!fail) { + if (VisualServer::get_singleton()->is_low_end()) { + if (builtin_func_defs[idx].high_end) { + fail = true; + unsupported_builtin = true; + builtin_idx = idx; + } + } + } + if (!fail && argcount < 4 && builtin_func_defs[idx].args[argcount] != TYPE_VOID) fail = true; //make sure the number of arguments matches @@ -2195,6 +2190,21 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p } } + if (unsupported_builtin) { + + String arglist = ""; + for (int i = 0; i < argcount; i++) { + if (i > 0) { + arglist += ", "; + } + arglist += get_datatype_name(builtin_func_defs[builtin_idx].args[i]); + } + + String err = "Built-in function \"" + String(name) + "(" + arglist + ")\" is supported only on high-end platform!"; + _set_error(err); + return false; + } + if (failed_builtin) { String err = "Invalid arguments for built-in function: " + String(name) + "("; for (int i = 0; i < argcount; i++) { @@ -4143,6 +4153,11 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui if (!n) return ERR_PARSE_ERROR; + if (n->get_datatype() != TYPE_BOOL) { + _set_error("Expected boolean expression"); + return ERR_PARSE_ERROR; + } + tk = _get_token(); if (tk.type != TK_PARENTHESIS_CLOSE) { _set_error("Expected ')' after expression"); @@ -4172,6 +4187,12 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui _set_tkpos(pos); //rollback } } else if (tk.type == TK_CF_SWITCH) { + + if (VisualServer::get_singleton()->is_low_end()) { + _set_error("\"switch\" operator is supported only on high-end platform!"); + return ERR_PARSE_ERROR; + } + // switch() {} tk = _get_token(); if (tk.type != TK_PARENTHESIS_OPEN) { @@ -4610,19 +4631,75 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui return OK; } +String ShaderLanguage::_get_shader_type_list(const Set<String> &p_shader_types) const { + + // Return a list of shader types as an human-readable string + String valid_types; + for (const Set<String>::Element *E = p_shader_types.front(); E; E = E->next()) { + if (valid_types != String()) { + valid_types += ", "; + } + + valid_types += "'" + E->get() + "'"; + } + + return valid_types; +} + +Error ShaderLanguage::_validate_datatype(DataType p_type) { + if (VisualServer::get_singleton()->is_low_end()) { + bool invalid_type = false; + + switch (p_type) { + case TYPE_ISAMPLER2D: + invalid_type = true; + break; + case TYPE_USAMPLER2D: + invalid_type = true; + break; + case TYPE_SAMPLER3D: + invalid_type = true; + break; + case TYPE_ISAMPLER3D: + invalid_type = true; + break; + case TYPE_USAMPLER3D: + invalid_type = true; + break; + case TYPE_SAMPLER2DARRAY: + invalid_type = true; + break; + case TYPE_USAMPLER2DARRAY: + invalid_type = true; + break; + case TYPE_ISAMPLER2DARRAY: + invalid_type = true; + break; + default: + break; + } + + if (invalid_type) { + _set_error(vformat("\"%s\" type is supported only on high-end platform!", get_datatype_name(p_type))); + return ERR_UNAVAILABLE; + } + } + return OK; +} + Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_functions, const Vector<StringName> &p_render_modes, const Set<String> &p_shader_types) { Token tk = _get_token(); if (tk.type != TK_SHADER_TYPE) { - _set_error("Expected 'shader_type' at the beginning of shader."); + _set_error("Expected 'shader_type' at the beginning of shader. Valid types are: " + _get_shader_type_list(p_shader_types)); return ERR_PARSE_ERROR; } tk = _get_token(); if (tk.type != TK_IDENTIFIER) { - _set_error("Expected identifier after 'shader_type', indicating type of shader."); + _set_error("Expected identifier after 'shader_type', indicating type of shader. Valid types are: " + _get_shader_type_list(p_shader_types)); return ERR_PARSE_ERROR; } @@ -4631,15 +4708,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct shader_type_identifier = tk.text; if (!p_shader_types.has(shader_type_identifier)) { - - String valid; - for (Set<String>::Element *E = p_shader_types.front(); E; E = E->next()) { - if (valid != String()) { - valid += ", "; - } - valid += "'" + E->get() + "'"; - } - _set_error("Invalid shader type, valid types are: " + valid); + _set_error("Invalid shader type. Valid types are: " + _get_shader_type_list(p_shader_types)); return ERR_PARSE_ERROR; } @@ -4742,6 +4811,11 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct return ERR_PARSE_ERROR; } + if (has_builtin(p_functions, name)) { + _set_error("Redefinition of '" + String(name) + "'"); + return ERR_PARSE_ERROR; + } + if (uniform) { ShaderNode::Uniform uniform2; @@ -4749,6 +4823,9 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct if (is_sampler_type(type)) { uniform2.texture_order = texture_uniforms++; uniform2.order = -1; + if (_validate_datatype(type) != OK) { + return ERR_PARSE_ERROR; + } } else { uniform2.texture_order = -1; uniform2.order = uniforms++; @@ -4990,6 +5067,11 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct return ERR_PARSE_ERROR; } + if (has_builtin(p_functions, name)) { + _set_error("Redefinition of '" + String(name) + "'"); + return ERR_PARSE_ERROR; + } + tk = _get_token(); if (tk.type != TK_PARENTHESIS_OPEN) { if (type == TYPE_VOID) { @@ -5048,6 +5130,11 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct return ERR_PARSE_ERROR; } + if (has_builtin(p_functions, name)) { + _set_error("Redefinition of '" + String(name) + "'"); + return ERR_PARSE_ERROR; + } + tk = _get_token(); } else if (tk.type == TK_SEMICOLON) { @@ -5124,6 +5211,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct ptype = get_token_datatype(tk.type); + if (_validate_datatype(ptype) != OK) { + return ERR_PARSE_ERROR; + } + if (ptype == TYPE_VOID) { _set_error("void not allowed in argument"); return ERR_PARSE_ERROR; @@ -5149,6 +5240,12 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct return ERR_PARSE_ERROR; } } + + if (has_builtin(p_functions, pname)) { + _set_error("Redefinition of '" + String(pname) + "'"); + return ERR_PARSE_ERROR; + } + FunctionNode::Argument arg; arg.type = ptype; arg.name = pname; @@ -5215,6 +5312,26 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct return OK; } +bool ShaderLanguage::has_builtin(const Map<StringName, ShaderLanguage::FunctionInfo> &p_functions, const StringName &p_name) { + + if (p_functions.has("vertex")) { + if (p_functions["vertex"].built_ins.has(p_name)) { + return true; + } + } + if (p_functions.has("fragment")) { + if (p_functions["fragment"].built_ins.has(p_name)) { + return true; + } + } + if (p_functions.has("light")) { + if (p_functions["light"].built_ins.has(p_name)) { + return true; + } + } + return false; +} + Error ShaderLanguage::_find_last_flow_op_in_op(ControlFlowNode *p_flow, FlowOperation p_op) { bool found = false; diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h index 3a5630ef42..0b0947da0c 100644 --- a/servers/visual/shader_language.h +++ b/servers/visual/shader_language.h @@ -645,6 +645,7 @@ public: Map<StringName, BuiltInInfo> built_ins; bool can_discard; }; + static bool has_builtin(const Map<StringName, ShaderLanguage::FunctionInfo> &p_functions, const StringName &p_name); private: struct KeyWord { @@ -714,7 +715,7 @@ private: enum SubClassTag { TAG_GLOBAL, - TAG_ARRAY + TAG_ARRAY, }; struct BuiltinFuncDef { @@ -723,6 +724,7 @@ private: DataType rettype; const DataType args[MAX_ARGS]; SubClassTag tag; + bool high_end; }; struct BuiltinFuncOutArgs { //arguments used as out in built in functions @@ -742,6 +744,8 @@ private: static const BuiltinFuncDef builtin_func_defs[]; static const BuiltinFuncOutArgs builtin_func_out_args[]; + Error _validate_datatype(DataType p_type); + bool _validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type); bool _parse_function_arguments(BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, OperatorNode *p_func, int *r_complete_arg = NULL); @@ -750,6 +754,8 @@ private: Node *_parse_and_reduce_expression(BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types); Error _parse_block(BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, bool p_just_one = false, bool p_can_break = false, bool p_can_continue = false); + String _get_shader_type_list(const Set<String> &p_shader_types) const; + Error _parse_shader(const Map<StringName, FunctionInfo> &p_functions, const Vector<StringName> &p_render_modes, const Set<String> &p_shader_types); Error _find_last_flow_op_in_block(BlockNode *p_block, FlowOperation p_op); diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 0df228457e..06096781fe 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -409,6 +409,8 @@ public: BIND2(particles_set_process_material, RID, RID) BIND2(particles_set_fixed_fps, RID, int) BIND2(particles_set_fractional_delta, RID, bool) + BIND1R(bool, particles_is_inactive, RID) + BIND1(particles_request_process, RID) BIND1(particles_restart, RID) BIND2(particles_set_draw_order, RID, VS::ParticlesDrawOrder) diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index f515af4d91..ae1f3712b0 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -184,7 +184,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E for (Map<RID, Viewport::CanvasData>::Element *E = p_viewport->canvas_map.front(); E; E = E->next()) { VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas *>(E->get().canvas); - Transform2D xf = p_viewport->global_transform * E->get().transform; + Transform2D xf = _canvas_get_transform(p_viewport, canvas, &E->get(), clip_rect.size); for (Set<RasterizerCanvas::LightOccluderInstance *>::Element *F = canvas->occluders.front(); F; F = F->next()) { diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 273cf728c1..59df51ff19 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -343,6 +343,8 @@ public: FUNC2(particles_set_process_material, RID, RID) FUNC2(particles_set_fixed_fps, RID, int) FUNC2(particles_set_fractional_delta, RID, bool) + FUNC1R(bool, particles_is_inactive, RID) + FUNC1(particles_request_process, RID) FUNC1(particles_restart, RID) FUNC2(particles_set_draw_order, RID, VS::ParticlesDrawOrder) diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 2e1f524362..a1ba946d8c 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -508,12 +508,11 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_ if (p_format & ARRAY_COMPRESS_TANGENT) { for (int i = 0; i < p_vertex_array_len; i++) { - - uint8_t xyzw[4] = { - (uint8_t)CLAMP(src[i * 4 + 0] * 127, -128, 127), - (uint8_t)CLAMP(src[i * 4 + 1] * 127, -128, 127), - (uint8_t)CLAMP(src[i * 4 + 2] * 127, -128, 127), - (uint8_t)CLAMP(src[i * 4 + 3] * 127, -128, 127) + int8_t xyzw[4] = { + (int8_t)CLAMP(src[i * 4 + 0] * 127, -128, 127), + (int8_t)CLAMP(src[i * 4 + 1] * 127, -128, 127), + (int8_t)CLAMP(src[i * 4 + 2] * 127, -128, 127), + (int8_t)CLAMP(src[i * 4 + 3] * 127, -128, 127) }; copymem(&vw[p_offsets[ai] + i * p_stride], xyzw, 4); @@ -1845,6 +1844,8 @@ void VisualServer::_bind_methods() { ClassDB::bind_method(D_METHOD("particles_set_process_material", "particles", "material"), &VisualServer::particles_set_process_material); ClassDB::bind_method(D_METHOD("particles_set_fixed_fps", "particles", "fps"), &VisualServer::particles_set_fixed_fps); ClassDB::bind_method(D_METHOD("particles_set_fractional_delta", "particles", "enable"), &VisualServer::particles_set_fractional_delta); + ClassDB::bind_method(D_METHOD("particles_is_inactive", "particles"), &VisualServer::particles_is_inactive); + ClassDB::bind_method(D_METHOD("particles_request_process", "particles"), &VisualServer::particles_request_process); ClassDB::bind_method(D_METHOD("particles_restart", "particles"), &VisualServer::particles_restart); ClassDB::bind_method(D_METHOD("particles_set_draw_order", "particles", "order"), &VisualServer::particles_set_draw_order); ClassDB::bind_method(D_METHOD("particles_set_draw_passes", "particles", "count"), &VisualServer::particles_set_draw_passes); @@ -2170,6 +2171,8 @@ void VisualServer::_bind_methods() { BIND_ENUM_CONSTANT(VIEWPORT_MSAA_4X); BIND_ENUM_CONSTANT(VIEWPORT_MSAA_8X); BIND_ENUM_CONSTANT(VIEWPORT_MSAA_16X); + BIND_ENUM_CONSTANT(VIEWPORT_MSAA_EXT_2X); + BIND_ENUM_CONSTANT(VIEWPORT_MSAA_EXT_4X); BIND_ENUM_CONSTANT(VIEWPORT_USAGE_2D); BIND_ENUM_CONSTANT(VIEWPORT_USAGE_2D_NO_SAMPLING); diff --git a/servers/visual_server.h b/servers/visual_server.h index 5e6c4d9b1e..b1daf87e56 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -560,6 +560,8 @@ public: virtual void particles_set_process_material(RID p_particles, RID p_material) = 0; virtual void particles_set_fixed_fps(RID p_particles, int p_fps) = 0; virtual void particles_set_fractional_delta(RID p_particles, bool p_enable) = 0; + virtual bool particles_is_inactive(RID p_particles) = 0; + virtual void particles_request_process(RID p_particles) = 0; virtual void particles_restart(RID p_particles) = 0; enum ParticlesDrawOrder { @@ -656,6 +658,8 @@ public: VIEWPORT_MSAA_4X, VIEWPORT_MSAA_8X, VIEWPORT_MSAA_16X, + VIEWPORT_MSAA_EXT_2X, + VIEWPORT_MSAA_EXT_4X, }; virtual void viewport_set_msaa(RID p_viewport, ViewportMSAA p_msaa) = 0; diff --git a/thirdparty/README.md b/thirdparty/README.md index 7c7f331657..27cfe41238 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -4,7 +4,7 @@ ## assimp - Upstream: http://github.com/assimp/assimp -- Version: git (1d565b0aab5a2ee00462f18c5b8a81f6a5454a48) +- Version: git (308db73d0b3c2d1870cd3e465eaa283692a4cf23) - License: BSD-3-Clause @@ -135,7 +135,7 @@ Files extracted from upstream source: ## glad - Upstream: https://github.com/Dav1dde/glad -- Version: 0.1.31 +- Version: 0.1.33 - License: MIT The files we package are automatically generated. @@ -157,12 +157,12 @@ Files extracted from upstream source: ## libogg - Upstream: https://www.xiph.org/ogg -- Version: 1.3.3 +- Version: git (c8fca6b, 2019) - License: BSD-3-Clause Files extracted from upstream source: -- `src/*.c` +- `src/*.{c,h}` - `include/ogg/*.h` in ogg/ - COPYING @@ -250,7 +250,7 @@ from the Android NDK r18. ## libwebp - Upstream: https://chromium.googlesource.com/webm/libwebp/ -- Version: 1.0.2 +- Version: 1.0.3 - License: BSD-3-Clause Files extracted from upstream source: @@ -266,15 +266,16 @@ changes are marked with `// -- GODOT --` comments. ## mbedtls - Upstream: https://tls.mbed.org/ -- Version: 2.16.2 +- Version: 2.16.3 - License: Apache 2.0 File extracted from upstream release tarball (`-apache.tgz` variant): - All `*.h` from `include/mbedtls/` to `thirdparty/mbedtls/include/mbedtls/` - All `*.c` from `library/` to `thirdparty/mbedtls/library/` -- Applied the patch in `thirdparty/mbedtls/1453.diff` (PR 1453). +- LICENSE and apache-2.0.txt files +- Applied the patch in `thirdparty/mbedtls/patches/1453.diff` (PR 1453). Soon to be merged upstream. Check it out at next update. -- Applied the patch in `thirdparty/mbedtls/padlock.diff`. This disables VIA +- Applied the patch in `thirdparty/mbedtls/patches/padlock.diff`. This disables VIA padlock support which defines a symbol `unsupported` which clashes with a symbol in libwebsockets. - Added 2 files `godot_core_mbedtls_platform.{c,h}` providing configuration @@ -284,12 +285,13 @@ File extracted from upstream release tarball (`-apache.tgz` variant): ## miniupnpc - Upstream: https://github.com/miniupnp/miniupnp/tree/master/miniupnpc -- Version: git (3cf6efa, 2019) +- Version: git (0ab1d67, 2019) - License: BSD-3-Clause -Extract only the `miniupnpc` folder inside `thirdparty/miniupnpc`. -Exclude all non `.c` and `.h` files, plus all files beginning with `test` -`minihttptestserver.c` and `wingenminiupnpcstrings.c`. +Files extracted from upstream source: + +- All `*.c` and `*.h` files from `miniupnpc` to `thirdparty/miniupnpc/miniupnpc` +- Remove `test*`, `minihttptestserver.c` and `wingenminiupnpcstrings.c` The only modified file is miniupnpcstrings.h, which was created for Godot (it is usually autogenerated by cmake). @@ -376,14 +378,14 @@ Collection of single-file libraries used in Godot components. * License: zlib - `stb_vorbis.c` * Upstream: https://github.com/nothings/stb - * Version: 1.16 + * Version: 1.17 * License: Public Domain (Unlicense) or MIT ## nanosvg - Upstream: https://github.com/memononen/nanosvg -- Version: git (c1f6e20, 2018) +- Version: git (25241c5, 2019) - License: zlib Files extracted from the upstream source: @@ -395,17 +397,19 @@ Files extracted from the upstream source: ## opus - Upstream: https://opus-codec.org -- Version: 1.1.5 (opus) and 0.8 (opusfile) +- Version: 1.3.1 (opus) and 0.11 (opusfile) - License: BSD-3-Clause Files extracted from upstream source: +- Run `opus/configure` and copy/sync changes to `config.h` + (note that this file may have Godot-specific options enabled) - all .c and .h files in src/ (both opus and opusfile) - all .h files in include/ (both opus and opusfile) as opus/ - remove unused `opus_demo.c`, - remove `http.c`, `wincerts.c` and `winerrno.h` (part of unused libopusurl) -- celt/ and silk/ subfolders +- celt/ and silk/ subfolders (minus tests folders) - COPYING @@ -468,7 +472,7 @@ comments and a patch is provided in the squish/ folder. ## tinyexr - Upstream: https://github.com/syoyo/tinyexr -- Version: git (65f9859, 2018) +- Version: git (656bb61, 2019) - License: BSD-3-Clause Files extracted from upstream source: @@ -479,7 +483,7 @@ Files extracted from upstream source: ## vhacd - Upstream: https://github.com/kmammou/v-hacd -- Version: git (2297aa1, 2018) +- Version: git (b07958e, 2019) - License: BSD-3-Clause Files extracted from upstream source: @@ -534,7 +538,7 @@ Files extracted from upstream source: ## zstd - Upstream: https://github.com/facebook/zstd -- Version: 1.4.1 +- Version: 1.4.4 - License: BSD-3-Clause Files extracted from upstream source: diff --git a/thirdparty/assimp/code/Common/BaseImporter.cpp b/thirdparty/assimp/code/Common/BaseImporter.cpp index de5018a250..5c1e605549 100644 --- a/thirdparty/assimp/code/Common/BaseImporter.cpp +++ b/thirdparty/assimp/code/Common/BaseImporter.cpp @@ -67,7 +67,20 @@ using namespace Assimp; // Constructor to be privately used by Importer BaseImporter::BaseImporter() AI_NO_EXCEPT : m_progress() { - // nothing to do here + /** + * Assimp Importer + * unit conversions available + * if you need another measurment unit add it below. + * it's currently defined in assimp that we prefer meters. + * + * NOTE: Initialised here rather than in the header file + * to workaround a VS2013 bug with brace initialisers + * */ + importerUnits[ImporterUnits::M] = 1.0; + importerUnits[ImporterUnits::CM] = 0.01; + importerUnits[ImporterUnits::MM] = 0.001; + importerUnits[ImporterUnits::INCHES] = 0.0254; + importerUnits[ImporterUnits::FEET] = 0.3048; } // ------------------------------------------------------------------------------------------------ @@ -85,7 +98,7 @@ void BaseImporter::UpdateImporterScale( Importer* pImp ) double activeScale = importerScale * fileScale; // Set active scaling - pImp->SetPropertyFloat( AI_CONFIG_APP_SCALE_KEY, activeScale); + pImp->SetPropertyFloat( AI_CONFIG_APP_SCALE_KEY, static_cast<float>( activeScale) ); ASSIMP_LOG_DEBUG_F("UpdateImporterScale scale set: %f", activeScale ); } diff --git a/thirdparty/assimp/code/Common/DefaultIOSystem.cpp b/thirdparty/assimp/code/Common/DefaultIOSystem.cpp index d40b67de32..6fdc24dd80 100644 --- a/thirdparty/assimp/code/Common/DefaultIOSystem.cpp +++ b/thirdparty/assimp/code/Common/DefaultIOSystem.cpp @@ -61,83 +61,66 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; -// maximum path length -// XXX http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html -#ifdef PATH_MAX -# define PATHLIMIT PATH_MAX -#else -# define PATHLIMIT 4096 +#ifdef _WIN32 +static std::wstring Utf8ToWide(const char* in) +{ + int size = MultiByteToWideChar(CP_UTF8, 0, in, -1, nullptr, 0); + // size includes terminating null; std::wstring adds null automatically + std::wstring out(static_cast<size_t>(size) - 1, L'\0'); + MultiByteToWideChar(CP_UTF8, 0, in, -1, &out[0], size); + return out; +} + +static std::string WideToUtf8(const wchar_t* in) +{ + int size = WideCharToMultiByte(CP_UTF8, 0, in, -1, nullptr, 0, nullptr, nullptr); + // size includes terminating null; std::string adds null automatically + std::string out(static_cast<size_t>(size) - 1, '\0'); + WideCharToMultiByte(CP_UTF8, 0, in, -1, &out[0], size, nullptr, nullptr); + return out; +} #endif // ------------------------------------------------------------------------------------------------ // Tests for the existence of a file at the given path. -bool DefaultIOSystem::Exists( const char* pFile) const +bool DefaultIOSystem::Exists(const char* pFile) const { #ifdef _WIN32 - wchar_t fileName16[PATHLIMIT]; - -#ifndef WindowsStore - bool isUnicode = IsTextUnicode(pFile, static_cast<int>(strlen(pFile)), NULL) != 0; - if (isUnicode) { - - MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, pFile, -1, fileName16, PATHLIMIT); - struct __stat64 filestat; - if (0 != _wstat64(fileName16, &filestat)) { - return false; - } - } else { -#endif - FILE* file = ::fopen(pFile, "rb"); - if (!file) - return false; - - ::fclose(file); -#ifndef WindowsStore + struct __stat64 filestat; + if (_wstat64(Utf8ToWide(pFile).c_str(), &filestat) != 0) { + return false; } -#endif #else - FILE* file = ::fopen( pFile, "rb"); - if( !file) + FILE* file = ::fopen(pFile, "rb"); + if (!file) return false; - ::fclose( file); + ::fclose(file); #endif return true; } // ------------------------------------------------------------------------------------------------ // Open a new file with a given path. -IOStream* DefaultIOSystem::Open( const char* strFile, const char* strMode) +IOStream* DefaultIOSystem::Open(const char* strFile, const char* strMode) { - ai_assert(NULL != strFile); - ai_assert(NULL != strMode); + ai_assert(strFile != nullptr); + ai_assert(strMode != nullptr); FILE* file; #ifdef _WIN32 - wchar_t fileName16[PATHLIMIT]; -#ifndef WindowsStore - bool isUnicode = IsTextUnicode(strFile, static_cast<int>(strlen(strFile)), NULL) != 0; - if (isUnicode) { - MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, strFile, -1, fileName16, PATHLIMIT); - std::string mode8(strMode); - file = ::_wfopen(fileName16, std::wstring(mode8.begin(), mode8.end()).c_str()); - } else { -#endif - file = ::fopen(strFile, strMode); -#ifndef WindowsStore - } -#endif + file = ::_wfopen(Utf8ToWide(strFile).c_str(), Utf8ToWide(strMode).c_str()); #else file = ::fopen(strFile, strMode); #endif - if (nullptr == file) + if (!file) return nullptr; - return new DefaultIOStream(file, (std::string) strFile); + return new DefaultIOStream(file, strFile); } // ------------------------------------------------------------------------------------------------ // Closes the given file and releases all resources associated with it. -void DefaultIOSystem::Close( IOStream* pFile) +void DefaultIOSystem::Close(IOStream* pFile) { delete pFile; } @@ -155,78 +138,56 @@ char DefaultIOSystem::getOsSeparator() const // ------------------------------------------------------------------------------------------------ // IOSystem default implementation (ComparePaths isn't a pure virtual function) -bool IOSystem::ComparePaths (const char* one, const char* second) const +bool IOSystem::ComparePaths(const char* one, const char* second) const { - return !ASSIMP_stricmp(one,second); + return !ASSIMP_stricmp(one, second); } // ------------------------------------------------------------------------------------------------ // Convert a relative path into an absolute path -inline static void MakeAbsolutePath (const char* in, char* _out) +inline static std::string MakeAbsolutePath(const char* in) { - ai_assert(in && _out); -#if defined( _MSC_VER ) || defined( __MINGW32__ ) -#ifndef WindowsStore - bool isUnicode = IsTextUnicode(in, static_cast<int>(strlen(in)), NULL) != 0; - if (isUnicode) { - wchar_t out16[PATHLIMIT]; - wchar_t in16[PATHLIMIT]; - MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, in, -1, out16, PATHLIMIT); - wchar_t* ret = ::_wfullpath(out16, in16, PATHLIMIT); - if (ret) { - WideCharToMultiByte(CP_UTF8, MB_PRECOMPOSED, out16, -1, _out, PATHLIMIT, nullptr, nullptr); - } - if (!ret) { - // preserve the input path, maybe someone else is able to fix - // the path before it is accessed (e.g. our file system filter) - ASSIMP_LOG_WARN_F("Invalid path: ", std::string(in)); - strcpy(_out, in); - } - - } else { -#endif - char* ret = :: _fullpath(_out, in, PATHLIMIT); - if (!ret) { - // preserve the input path, maybe someone else is able to fix - // the path before it is accessed (e.g. our file system filter) - ASSIMP_LOG_WARN_F("Invalid path: ", std::string(in)); - strcpy(_out, in); - } -#ifndef WindowsStore + ai_assert(in); + std::string out; +#ifdef _WIN32 + wchar_t* ret = ::_wfullpath(nullptr, Utf8ToWide(in).c_str(), 0); + if (ret) { + out = WideToUtf8(ret); + free(ret); } -#endif #else - // use realpath - char* ret = realpath(in, _out); - if(!ret) { + char* ret = realpath(in, nullptr); + if (ret) { + out = ret; + free(ret); + } +#endif + if (!ret) { // preserve the input path, maybe someone else is able to fix // the path before it is accessed (e.g. our file system filter) ASSIMP_LOG_WARN_F("Invalid path: ", std::string(in)); - strcpy(_out,in); + out = in; } -#endif + return out; } // ------------------------------------------------------------------------------------------------ // DefaultIOSystem's more specialized implementation -bool DefaultIOSystem::ComparePaths (const char* one, const char* second) const +bool DefaultIOSystem::ComparePaths(const char* one, const char* second) const { // chances are quite good both paths are formatted identically, // so we can hopefully return here already - if( !ASSIMP_stricmp(one,second) ) + if (!ASSIMP_stricmp(one, second)) return true; - char temp1[PATHLIMIT]; - char temp2[PATHLIMIT]; - - MakeAbsolutePath (one, temp1); - MakeAbsolutePath (second, temp2); + std::string temp1 = MakeAbsolutePath(one); + std::string temp2 = MakeAbsolutePath(second); - return !ASSIMP_stricmp(temp1,temp2); + return !ASSIMP_stricmp(temp1, temp2); } // ------------------------------------------------------------------------------------------------ -std::string DefaultIOSystem::fileName( const std::string &path ) +std::string DefaultIOSystem::fileName(const std::string& path) { std::string ret = path; std::size_t last = ret.find_last_of("\\/"); @@ -235,16 +196,16 @@ std::string DefaultIOSystem::fileName( const std::string &path ) } // ------------------------------------------------------------------------------------------------ -std::string DefaultIOSystem::completeBaseName( const std::string &path ) +std::string DefaultIOSystem::completeBaseName(const std::string& path) { std::string ret = fileName(path); std::size_t pos = ret.find_last_of('.'); - if(pos != ret.npos) ret = ret.substr(0, pos); + if (pos != std::string::npos) ret = ret.substr(0, pos); return ret; } // ------------------------------------------------------------------------------------------------ -std::string DefaultIOSystem::absolutePath( const std::string &path ) +std::string DefaultIOSystem::absolutePath(const std::string& path) { std::string ret = path; std::size_t last = ret.find_last_of("\\/"); @@ -253,5 +214,3 @@ std::string DefaultIOSystem::absolutePath( const std::string &path ) } // ------------------------------------------------------------------------------------------------ - -#undef PATHLIMIT diff --git a/thirdparty/assimp/code/Common/Exporter.cpp b/thirdparty/assimp/code/Common/Exporter.cpp index 090b561ae0..4ce1a2bd80 100644 --- a/thirdparty/assimp/code/Common/Exporter.cpp +++ b/thirdparty/assimp/code/Common/Exporter.cpp @@ -102,6 +102,8 @@ void ExportSceneX3D(const char*, IOSystem*, const aiScene*, const ExportProperti void ExportSceneFBX(const char*, IOSystem*, const aiScene*, const ExportProperties*); void ExportSceneFBXA(const char*, IOSystem*, const aiScene*, const ExportProperties*); void ExportScene3MF( const char*, IOSystem*, const aiScene*, const ExportProperties* ); +void ExportSceneM3D(const char*, IOSystem*, const aiScene*, const ExportProperties*); +void ExportSceneA3D(const char*, IOSystem*, const aiScene*, const ExportProperties*); void ExportAssimp2Json(const char* , IOSystem*, const aiScene* , const Assimp::ExportProperties*); // ------------------------------------------------------------------------------------------------ @@ -179,6 +181,11 @@ Exporter::ExportFormatEntry gExporters[] = Exporter::ExportFormatEntry( "fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0 ), #endif +#ifndef ASSIMP_BUILD_NO_M3D_EXPORTER + Exporter::ExportFormatEntry( "m3d", "Model 3D (binary)", "m3d", &ExportSceneM3D, 0 ), + Exporter::ExportFormatEntry( "a3d", "Model 3D (ascii)", "m3d", &ExportSceneA3D, 0 ), +#endif + #ifndef ASSIMP_BUILD_NO_3MF_EXPORTER Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 ), #endif @@ -316,34 +323,6 @@ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const cha } // ------------------------------------------------------------------------------------------------ -bool IsVerboseFormat(const aiMesh* mesh) { - // avoid slow vector<bool> specialization - std::vector<unsigned int> seen(mesh->mNumVertices,0); - for(unsigned int i = 0; i < mesh->mNumFaces; ++i) { - const aiFace& f = mesh->mFaces[i]; - for(unsigned int j = 0; j < f.mNumIndices; ++j) { - if(++seen[f.mIndices[j]] == 2) { - // found a duplicate index - return false; - } - } - } - - return true; -} - -// ------------------------------------------------------------------------------------------------ -bool IsVerboseFormat(const aiScene* pScene) { - for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) { - if(!IsVerboseFormat(pScene->mMeshes[i])) { - return false; - } - } - - return true; -} - -// ------------------------------------------------------------------------------------------------ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const char* pPath, unsigned int pPreprocessing, const ExportProperties* pProperties) { ASSIMP_BEGIN_EXCEPTION_REGION(); @@ -352,7 +331,7 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c // format. They will likely not be aware that there is a flag in the scene to indicate // this, however. To avoid surprises and bug reports, we check for duplicates in // meshes upfront. - const bool is_verbose_format = !(pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) || IsVerboseFormat(pScene); + const bool is_verbose_format = !(pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) || MakeVerboseFormatProcess::IsVerboseFormat(pScene); pimpl->mProgressHandler->UpdateFileWrite(0, 4); @@ -472,7 +451,10 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c } ExportProperties emptyProperties; // Never pass NULL ExportProperties so Exporters don't have to worry. - exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProperties ? pProperties : &emptyProperties); + ExportProperties* pProp = pProperties ? (ExportProperties*)pProperties : &emptyProperties; + pProp->SetPropertyBool("bJoinIdenticalVertices", must_join_again); + exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProp); + exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProp); pimpl->mProgressHandler->UpdateFileWrite(4, 4); } catch (DeadlyExportError& err) { diff --git a/thirdparty/assimp/code/Common/ImporterRegistry.cpp b/thirdparty/assimp/code/Common/ImporterRegistry.cpp index 32ac3b4168..b9f28f0356 100644 --- a/thirdparty/assimp/code/Common/ImporterRegistry.cpp +++ b/thirdparty/assimp/code/Common/ImporterRegistry.cpp @@ -197,6 +197,9 @@ corresponding preprocessor flag to selectively disable formats. #ifndef ASSIMP_BUILD_NO_MMD_IMPORTER # include "MMD/MMDImporter.h" #endif +#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER +# include "M3D/M3DImporter.h" +#endif #ifndef ASSIMP_BUILD_NO_STEP_IMPORTER # include "Importer/StepFile/StepFileImporter.h" #endif @@ -223,6 +226,9 @@ void GetImporterInstanceList(std::vector< BaseImporter* >& out) #if (!defined ASSIMP_BUILD_NO_3DS_IMPORTER) out.push_back( new Discreet3DSImporter()); #endif +#if (!defined ASSIMP_BUILD_NO_M3D_IMPORTER) + out.push_back( new M3DImporter()); +#endif #if (!defined ASSIMP_BUILD_NO_MD3_IMPORTER) out.push_back( new MD3Importer()); #endif diff --git a/thirdparty/assimp/code/Common/PostStepRegistry.cpp b/thirdparty/assimp/code/Common/PostStepRegistry.cpp index ef58f8ddfd..8ff4af0400 100644 --- a/thirdparty/assimp/code/Common/PostStepRegistry.cpp +++ b/thirdparty/assimp/code/Common/PostStepRegistry.cpp @@ -131,11 +131,15 @@ corresponding preprocessor flag to selectively disable steps. #if (!defined ASSIMP_BUILD_NO_GLOBALSCALE_PROCESS) # include "PostProcessing/ScaleProcess.h" #endif +#if (!defined ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS) +# include "PostProcessing/ArmaturePopulate.h" +#endif #if (!defined ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS) # include "PostProcessing/GenBoundingBoxesProcess.h" #endif + namespace Assimp { // ------------------------------------------------------------------------------------------------ @@ -180,6 +184,9 @@ void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out) #if (!defined ASSIMP_BUILD_NO_GLOBALSCALE_PROCESS) out.push_back( new ScaleProcess()); #endif +#if (!defined ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS) + out.push_back( new ArmaturePopulate()); +#endif #if (!defined ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS) out.push_back( new PretransformVertices()); #endif diff --git a/thirdparty/assimp/code/Common/SceneCombiner.cpp b/thirdparty/assimp/code/Common/SceneCombiner.cpp index e445bd7434..f7b13cc951 100644 --- a/thirdparty/assimp/code/Common/SceneCombiner.cpp +++ b/thirdparty/assimp/code/Common/SceneCombiner.cpp @@ -1091,6 +1091,35 @@ void SceneCombiner::Copy( aiMesh** _dest, const aiMesh* src ) { aiFace& f = dest->mFaces[i]; GetArrayCopy(f.mIndices,f.mNumIndices); } + + // make a deep copy of all blend shapes + CopyPtrArray(dest->mAnimMeshes, dest->mAnimMeshes, dest->mNumAnimMeshes); +} + +// ------------------------------------------------------------------------------------------------ +void SceneCombiner::Copy(aiAnimMesh** _dest, const aiAnimMesh* src) { + if (nullptr == _dest || nullptr == src) { + return; + } + + aiAnimMesh* dest = *_dest = new aiAnimMesh(); + + // get a flat copy + ::memcpy(dest, src, sizeof(aiAnimMesh)); + + // and reallocate all arrays + GetArrayCopy(dest->mVertices, dest->mNumVertices); + GetArrayCopy(dest->mNormals, dest->mNumVertices); + GetArrayCopy(dest->mTangents, dest->mNumVertices); + GetArrayCopy(dest->mBitangents, dest->mNumVertices); + + unsigned int n = 0; + while (dest->HasTextureCoords(n)) + GetArrayCopy(dest->mTextureCoords[n++], dest->mNumVertices); + + n = 0; + while (dest->HasVertexColors(n)) + GetArrayCopy(dest->mColors[n++], dest->mNumVertices); } // ------------------------------------------------------------------------------------------------ @@ -1167,6 +1196,7 @@ void SceneCombiner::Copy( aiAnimation** _dest, const aiAnimation* src ) { // and reallocate all arrays CopyPtrArray( dest->mChannels, src->mChannels, dest->mNumChannels ); + CopyPtrArray( dest->mMorphMeshChannels, src->mMorphMeshChannels, dest->mNumMorphMeshChannels ); } // ------------------------------------------------------------------------------------------------ @@ -1186,6 +1216,26 @@ void SceneCombiner::Copy(aiNodeAnim** _dest, const aiNodeAnim* src) { GetArrayCopy( dest->mRotationKeys, dest->mNumRotationKeys ); } +void SceneCombiner::Copy(aiMeshMorphAnim** _dest, const aiMeshMorphAnim* src) { + if ( nullptr == _dest || nullptr == src ) { + return; + } + + aiMeshMorphAnim* dest = *_dest = new aiMeshMorphAnim(); + + // get a flat copy + ::memcpy(dest,src,sizeof(aiMeshMorphAnim)); + + // and reallocate all arrays + GetArrayCopy( dest->mKeys, dest->mNumKeys ); + for (ai_uint i = 0; i < dest->mNumKeys;++i) { + dest->mKeys[i].mValues = new unsigned int[dest->mKeys[i].mNumValuesAndWeights]; + dest->mKeys[i].mWeights = new double[dest->mKeys[i].mNumValuesAndWeights]; + ::memcpy(dest->mKeys[i].mValues, src->mKeys[i].mValues, dest->mKeys[i].mNumValuesAndWeights * sizeof(unsigned int)); + ::memcpy(dest->mKeys[i].mWeights, src->mKeys[i].mWeights, dest->mKeys[i].mNumValuesAndWeights * sizeof(double)); + } +} + // ------------------------------------------------------------------------------------------------ void SceneCombiner::Copy( aiCamera** _dest,const aiCamera* src) { if ( nullptr == _dest || nullptr == src ) { diff --git a/thirdparty/assimp/code/Common/Version.cpp b/thirdparty/assimp/code/Common/Version.cpp index cc94340ac8..cf1da7d5ba 100644 --- a/thirdparty/assimp/code/Common/Version.cpp +++ b/thirdparty/assimp/code/Common/Version.cpp @@ -46,8 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assimp/scene.h> #include "ScenePrivate.h" -static const unsigned int MajorVersion = 4; -static const unsigned int MinorVersion = 1; +#include "revision.h" // -------------------------------------------------------------------------------- // Legal information string - don't remove this. @@ -56,9 +55,9 @@ static const char* LEGAL_INFORMATION = "Open Asset Import Library (Assimp).\n" "A free C/C++ library to import various 3D file formats into applications\n\n" -"(c) 2008-2017, assimp team\n" +"(c) 2006-2019, assimp team\n" "License under the terms and conditions of the 3-clause BSD license\n" -"http://assimp.sourceforge.net\n" +"http://assimp.org\n" ; // ------------------------------------------------------------------------------------------------ @@ -70,13 +69,13 @@ ASSIMP_API const char* aiGetLegalString () { // ------------------------------------------------------------------------------------------------ // Get Assimp minor version ASSIMP_API unsigned int aiGetVersionMinor () { - return MinorVersion; + return VER_MINOR; } // ------------------------------------------------------------------------------------------------ // Get Assimp major version ASSIMP_API unsigned int aiGetVersionMajor () { - return MajorVersion; + return VER_MAJOR; } // ------------------------------------------------------------------------------------------------ @@ -104,9 +103,6 @@ ASSIMP_API unsigned int aiGetCompileFlags () { return flags; } -// include current build revision, which is even updated from time to time -- :-) -#include "revision.h" - // ------------------------------------------------------------------------------------------------ ASSIMP_API unsigned int aiGetVersionRevision() { return GitVersion; diff --git a/thirdparty/assimp/code/Common/scene.cpp b/thirdparty/assimp/code/Common/scene.cpp index 2acb348d81..d15619acff 100644 --- a/thirdparty/assimp/code/Common/scene.cpp +++ b/thirdparty/assimp/code/Common/scene.cpp @@ -44,23 +44,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. aiNode::aiNode() : mName("") -, mParent(NULL) +, mParent(nullptr) , mNumChildren(0) -, mChildren(NULL) +, mChildren(nullptr) , mNumMeshes(0) -, mMeshes(NULL) -, mMetaData(NULL) { +, mMeshes(nullptr) +, mMetaData(nullptr) { // empty } aiNode::aiNode(const std::string& name) : mName(name) -, mParent(NULL) +, mParent(nullptr) , mNumChildren(0) -, mChildren(NULL) +, mChildren(nullptr) , mNumMeshes(0) -, mMeshes(NULL) -, mMetaData(NULL) { +, mMeshes(nullptr) +, mMetaData(nullptr) { // empty } @@ -68,7 +68,7 @@ aiNode::aiNode(const std::string& name) aiNode::~aiNode() { // delete all children recursively // to make sure we won't crash if the data is invalid ... - if (mChildren && mNumChildren) + if (mNumChildren && mChildren) { for (unsigned int a = 0; a < mNumChildren; a++) delete mChildren[a]; diff --git a/thirdparty/assimp/code/FBX/FBXCompileConfig.h b/thirdparty/assimp/code/FBX/FBXCompileConfig.h index 3a3841fa5b..03536a1823 100644 --- a/thirdparty/assimp/code/FBX/FBXCompileConfig.h +++ b/thirdparty/assimp/code/FBX/FBXCompileConfig.h @@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_FBX_COMPILECONFIG_H #include <map> +#include <set> // #if _MSC_VER > 1500 || (defined __GNUC___) @@ -54,16 +55,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # else # define fbx_unordered_map map # define fbx_unordered_multimap multimap +# define fbx_unordered_set set +# define fbx_unordered_multiset multiset #endif #ifdef ASSIMP_FBX_USE_UNORDERED_MULTIMAP # include <unordered_map> +# include <unordered_set> # if _MSC_VER > 1600 # define fbx_unordered_map unordered_map # define fbx_unordered_multimap unordered_multimap +# define fbx_unordered_set unordered_set +# define fbx_unordered_multiset unordered_multiset # else # define fbx_unordered_map tr1::unordered_map # define fbx_unordered_multimap tr1::unordered_multimap +# define fbx_unordered_set tr1::unordered_set +# define fbx_unordered_multiset tr1::unordered_multiset # endif #endif diff --git a/thirdparty/assimp/code/FBX/FBXConverter.cpp b/thirdparty/assimp/code/FBX/FBXConverter.cpp index 3f64016ea4..d8a22d9f74 100644 --- a/thirdparty/assimp/code/FBX/FBXConverter.cpp +++ b/thirdparty/assimp/code/FBX/FBXConverter.cpp @@ -55,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXImporter.h" #include <assimp/StringComparison.h> +#include <assimp/MathFunctions.h> #include <assimp/scene.h> @@ -67,7 +68,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <sstream> #include <iomanip> #include <cstdint> - +#include <iostream> +#include <stdlib.h> namespace Assimp { namespace FBX { @@ -76,7 +78,7 @@ namespace Assimp { #define MAGIC_NODE_TAG "_$AssimpFbx$" -#define CONVERT_FBX_TIME(time) static_cast<double>(time) / 46186158000L +#define CONVERT_FBX_TIME(time) static_cast<double>(time) / 46186158000LL FBXConverter::FBXConverter(aiScene* out, const Document& doc, bool removeEmptyBones ) : defaultMaterialIndex() @@ -95,6 +97,14 @@ namespace Assimp { // populate the node_anim_chain_bits map, which is needed // to determine which nodes need to be generated. ConvertAnimations(); + // Embedded textures in FBX could be connected to nothing but to itself, + // for instance Texture -> Video connection only but not to the main graph, + // The idea here is to traverse all objects to find these Textures and convert them, + // so later during material conversion it will find converted texture in the textures_converted array. + if (doc.Settings().readTextures) + { + ConvertOrphantEmbeddedTextures(); + } ConvertRootNode(); if (doc.Settings().readAllMaterials) { @@ -144,7 +154,7 @@ namespace Assimp { out->mRootNode->mName.Set(unique_name); // root has ID 0 - ConvertNodes(0L, *out->mRootNode); + ConvertNodes(0L, out->mRootNode, out->mRootNode); } static std::string getAncestorBaseName(const aiNode* node) @@ -178,8 +188,11 @@ namespace Assimp { GetUniqueName(original_name, unique_name); return unique_name; } - - void FBXConverter::ConvertNodes(uint64_t id, aiNode& parent, const aiMatrix4x4& parent_transform) { + /// todo: pre-build node hierarchy + /// todo: get bone from stack + /// todo: make map of aiBone* to aiNode* + /// then update convert clusters to the new format + void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node) { const std::vector<const Connection*>& conns = doc.GetConnectionsByDestinationSequenced(id, "Model"); std::vector<aiNode*> nodes; @@ -190,62 +203,69 @@ namespace Assimp { try { for (const Connection* con : conns) { - // ignore object-property links if (con->PropertyName().length()) { - continue; + // really important we document why this is ignored. + FBXImporter::LogInfo("ignoring property link - no docs on why this is ignored"); + continue; //? } + // convert connection source object into Object base class const Object* const object = con->SourceObject(); if (nullptr == object) { - FBXImporter::LogWarn("failed to convert source object for Model link"); + FBXImporter::LogError("failed to convert source object for Model link"); continue; } + // FBX Model::Cube, Model::Bone001, etc elements + // This detects if we can cast the object into this model structure. const Model* const model = dynamic_cast<const Model*>(object); if (nullptr != model) { nodes_chain.clear(); post_nodes_chain.clear(); - aiMatrix4x4 new_abs_transform = parent_transform; - - std::string unique_name = MakeUniqueNodeName(model, parent); - + aiMatrix4x4 new_abs_transform = parent->mTransformation; + std::string node_name = FixNodeName(model->Name()); // even though there is only a single input node, the design of // assimp (or rather: the complicated transformation chain that // is employed by fbx) means that we may need multiple aiNode's // to represent a fbx node's transformation. - const bool need_additional_node = GenerateTransformationNodeChain(*model, unique_name, nodes_chain, post_nodes_chain); + + // generate node transforms - this includes pivot data + // if need_additional_node is true then you t + const bool need_additional_node = GenerateTransformationNodeChain(*model, node_name, nodes_chain, post_nodes_chain); + + // assert that for the current node we must have at least a single transform ai_assert(nodes_chain.size()); if (need_additional_node) { - nodes_chain.push_back(new aiNode(unique_name)); + nodes_chain.push_back(new aiNode(node_name)); } //setup metadata on newest node SetupNodeMetadata(*model, *nodes_chain.back()); // link all nodes in a row - aiNode* last_parent = &parent; - for (aiNode* prenode : nodes_chain) { - ai_assert(prenode); + aiNode* last_parent = parent; + for (aiNode* child : nodes_chain) { + ai_assert(child); - if (last_parent != &parent) { + if (last_parent != parent) { last_parent->mNumChildren = 1; last_parent->mChildren = new aiNode*[1]; - last_parent->mChildren[0] = prenode; + last_parent->mChildren[0] = child; } - prenode->mParent = last_parent; - last_parent = prenode; + child->mParent = last_parent; + last_parent = child; - new_abs_transform *= prenode->mTransformation; + new_abs_transform *= child->mTransformation; } // attach geometry - ConvertModel(*model, *nodes_chain.back(), new_abs_transform); + ConvertModel(*model, nodes_chain.back(), root_node, new_abs_transform); // check if there will be any child nodes const std::vector<const Connection*>& child_conns @@ -257,7 +277,7 @@ namespace Assimp { for (aiNode* postnode : post_nodes_chain) { ai_assert(postnode); - if (last_parent != &parent) { + if (last_parent != parent) { last_parent->mNumChildren = 1; last_parent->mChildren = new aiNode*[1]; last_parent->mChildren[0] = postnode; @@ -279,15 +299,15 @@ namespace Assimp { ); } - // attach sub-nodes (if any) - ConvertNodes(model->ID(), *last_parent, new_abs_transform); + // recursion call - child nodes + ConvertNodes(model->ID(), last_parent, root_node); if (doc.Settings().readLights) { - ConvertLights(*model, unique_name); + ConvertLights(*model, node_name); } if (doc.Settings().readCameras) { - ConvertCameras(*model, unique_name); + ConvertCameras(*model, node_name); } nodes.push_back(nodes_chain.front()); @@ -296,11 +316,17 @@ namespace Assimp { } if (nodes.size()) { - parent.mChildren = new aiNode*[nodes.size()](); - parent.mNumChildren = static_cast<unsigned int>(nodes.size()); + parent->mChildren = new aiNode*[nodes.size()](); + parent->mNumChildren = static_cast<unsigned int>(nodes.size()); - std::swap_ranges(nodes.begin(), nodes.end(), parent.mChildren); + std::swap_ranges(nodes.begin(), nodes.end(), parent->mChildren); } + else + { + parent->mNumChildren = 0; + parent->mChildren = nullptr; + } + } catch (std::exception&) { Util::delete_fun<aiNode> deleter; @@ -553,7 +579,7 @@ namespace Assimp { return; } - const float angle_epsilon = 1e-6f; + const float angle_epsilon = Math::getEpsilon<float>(); out = aiMatrix4x4(); @@ -694,7 +720,7 @@ namespace Assimp { std::fill_n(chain, static_cast<unsigned int>(TransformationComp_MAXIMUM), aiMatrix4x4()); // generate transformation matrices for all the different transformation components - const float zero_epsilon = 1e-6f; + const float zero_epsilon = Math::getEpsilon<float>(); const aiVector3D all_ones(1.0f, 1.0f, 1.0f); const aiVector3D& PreRotation = PropertyGet<aiVector3D>(props, "PreRotation", ok); @@ -802,7 +828,7 @@ namespace Assimp { // is_complex needs to be consistent with NeedsComplexTransformationChain() // or the interplay between this code and the animation converter would // not be guaranteed. - ai_assert(NeedsComplexTransformationChain(model) == ((chainBits & chainMaskComplex) != 0)); + //ai_assert(NeedsComplexTransformationChain(model) == ((chainBits & chainMaskComplex) != 0)); // now, if we have more than just Translation, Scaling and Rotation, // we need to generate a full node chain to accommodate for assimp's @@ -904,7 +930,8 @@ namespace Assimp { } } - void FBXConverter::ConvertModel(const Model& model, aiNode& nd, const aiMatrix4x4& node_global_transform) + void FBXConverter::ConvertModel(const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform) { const std::vector<const Geometry*>& geos = model.GetGeometry(); @@ -916,11 +943,12 @@ namespace Assimp { const MeshGeometry* const mesh = dynamic_cast<const MeshGeometry*>(geo); const LineGeometry* const line = dynamic_cast<const LineGeometry*>(geo); if (mesh) { - const std::vector<unsigned int>& indices = ConvertMesh(*mesh, model, node_global_transform, nd); + const std::vector<unsigned int>& indices = ConvertMesh(*mesh, model, parent, root_node, + absolute_transform); std::copy(indices.begin(), indices.end(), std::back_inserter(meshes)); } else if (line) { - const std::vector<unsigned int>& indices = ConvertLine(*line, model, node_global_transform, nd); + const std::vector<unsigned int>& indices = ConvertLine(*line, model, parent, root_node); std::copy(indices.begin(), indices.end(), std::back_inserter(meshes)); } else { @@ -929,15 +957,16 @@ namespace Assimp { } if (meshes.size()) { - nd.mMeshes = new unsigned int[meshes.size()](); - nd.mNumMeshes = static_cast<unsigned int>(meshes.size()); + parent->mMeshes = new unsigned int[meshes.size()](); + parent->mNumMeshes = static_cast<unsigned int>(meshes.size()); - std::swap_ranges(meshes.begin(), meshes.end(), nd.mMeshes); + std::swap_ranges(meshes.begin(), meshes.end(), parent->mMeshes); } } - std::vector<unsigned int> FBXConverter::ConvertMesh(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) + std::vector<unsigned int> + FBXConverter::ConvertMesh(const MeshGeometry &mesh, const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform) { std::vector<unsigned int> temp; @@ -961,18 +990,18 @@ namespace Assimp { const MatIndexArray::value_type base = mindices[0]; for (MatIndexArray::value_type index : mindices) { if (index != base) { - return ConvertMeshMultiMaterial(mesh, model, node_global_transform, nd); + return ConvertMeshMultiMaterial(mesh, model, parent, root_node, absolute_transform); } } } // faster code-path, just copy the data - temp.push_back(ConvertMeshSingleMaterial(mesh, model, node_global_transform, nd)); + temp.push_back(ConvertMeshSingleMaterial(mesh, model, absolute_transform, parent, root_node)); return temp; } std::vector<unsigned int> FBXConverter::ConvertLine(const LineGeometry& line, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) + aiNode *parent, aiNode *root_node) { std::vector<unsigned int> temp; @@ -983,7 +1012,7 @@ namespace Assimp { return temp; } - aiMesh* const out_mesh = SetupEmptyMesh(line, nd); + aiMesh* const out_mesh = SetupEmptyMesh(line, root_node); out_mesh->mPrimitiveTypes |= aiPrimitiveType_LINE; // copy vertices @@ -1018,7 +1047,7 @@ namespace Assimp { return temp; } - aiMesh* FBXConverter::SetupEmptyMesh(const Geometry& mesh, aiNode& nd) + aiMesh* FBXConverter::SetupEmptyMesh(const Geometry& mesh, aiNode *parent) { aiMesh* const out_mesh = new aiMesh(); meshes.push_back(out_mesh); @@ -1035,17 +1064,18 @@ namespace Assimp { } else { - out_mesh->mName = nd.mName; + out_mesh->mName = parent->mName; } return out_mesh; } - unsigned int FBXConverter::ConvertMeshSingleMaterial(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) + unsigned int FBXConverter::ConvertMeshSingleMaterial(const MeshGeometry &mesh, const Model &model, + const aiMatrix4x4 &absolute_transform, aiNode *parent, + aiNode *root_node) { const MatIndexArray& mindices = mesh.GetMaterialIndices(); - aiMesh* const out_mesh = SetupEmptyMesh(mesh, nd); + aiMesh* const out_mesh = SetupEmptyMesh(mesh, parent); const std::vector<aiVector3D>& vertices = mesh.GetVertices(); const std::vector<unsigned int>& faces = mesh.GetFaceIndexCounts(); @@ -1112,7 +1142,7 @@ namespace Assimp { binormals = &tempBinormals; } else { - binormals = NULL; + binormals = nullptr; } } @@ -1162,8 +1192,9 @@ namespace Assimp { ConvertMaterialForMesh(out_mesh, model, mesh, mindices[0]); } - if (doc.Settings().readWeights && mesh.DeformerSkin() != NULL) { - ConvertWeights(out_mesh, model, mesh, node_global_transform, NO_MATERIAL_SEPARATION); + if (doc.Settings().readWeights && mesh.DeformerSkin() != nullptr) { + ConvertWeights(out_mesh, model, mesh, absolute_transform, parent, root_node, NO_MATERIAL_SEPARATION, + nullptr); } std::vector<aiAnimMesh*> animMeshes; @@ -1208,8 +1239,10 @@ namespace Assimp { return static_cast<unsigned int>(meshes.size() - 1); } - std::vector<unsigned int> FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) + std::vector<unsigned int> + FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry &mesh, const Model &model, aiNode *parent, + aiNode *root_node, + const aiMatrix4x4 &absolute_transform) { const MatIndexArray& mindices = mesh.GetMaterialIndices(); ai_assert(mindices.size()); @@ -1220,7 +1253,7 @@ namespace Assimp { for (MatIndexArray::value_type index : mindices) { if (had.find(index) == had.end()) { - indices.push_back(ConvertMeshMultiMaterial(mesh, model, index, node_global_transform, nd)); + indices.push_back(ConvertMeshMultiMaterial(mesh, model, index, parent, root_node, absolute_transform)); had.insert(index); } } @@ -1228,18 +1261,18 @@ namespace Assimp { return indices; } - unsigned int FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, - MatIndexArray::value_type index, - const aiMatrix4x4& node_global_transform, - aiNode& nd) + unsigned int FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry &mesh, const Model &model, + MatIndexArray::value_type index, + aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform) { - aiMesh* const out_mesh = SetupEmptyMesh(mesh, nd); + aiMesh* const out_mesh = SetupEmptyMesh(mesh, parent); const MatIndexArray& mindices = mesh.GetMaterialIndices(); const std::vector<aiVector3D>& vertices = mesh.GetVertices(); const std::vector<unsigned int>& faces = mesh.GetFaceIndexCounts(); - const bool process_weights = doc.Settings().readWeights && mesh.DeformerSkin() != NULL; + const bool process_weights = doc.Settings().readWeights && mesh.DeformerSkin() != nullptr; unsigned int count_faces = 0; unsigned int count_vertices = 0; @@ -1299,7 +1332,7 @@ namespace Assimp { binormals = &tempBinormals; } else { - binormals = NULL; + binormals = nullptr; } } @@ -1398,7 +1431,7 @@ namespace Assimp { ConvertMaterialForMesh(out_mesh, model, mesh, index); if (process_weights) { - ConvertWeights(out_mesh, model, mesh, node_global_transform, index, &reverseMapping); + ConvertWeights(out_mesh, model, mesh, absolute_transform, parent, root_node, index, &reverseMapping); } std::vector<aiAnimMesh*> animMeshes; @@ -1448,10 +1481,10 @@ namespace Assimp { return static_cast<unsigned int>(meshes.size() - 1); } - void FBXConverter::ConvertWeights(aiMesh* out, const Model& model, const MeshGeometry& geo, - const aiMatrix4x4& node_global_transform, - unsigned int materialIndex, - std::vector<unsigned int>* outputVertStartIndices) + void FBXConverter::ConvertWeights(aiMesh *out, const Model &model, const MeshGeometry &geo, + const aiMatrix4x4 &absolute_transform, + aiNode *parent, aiNode *root_node, unsigned int materialIndex, + std::vector<unsigned int> *outputVertStartIndices) { ai_assert(geo.DeformerSkin()); @@ -1462,13 +1495,12 @@ namespace Assimp { const Skin& sk = *geo.DeformerSkin(); std::vector<aiBone*> bones; - bones.reserve(sk.Clusters().size()); const bool no_mat_check = materialIndex == NO_MATERIAL_SEPARATION; ai_assert(no_mat_check || outputVertStartIndices); try { - + // iterate over the sub deformers for (const Cluster* cluster : sk.Clusters()) { ai_assert(cluster); @@ -1482,15 +1514,16 @@ namespace Assimp { index_out_indices.clear(); out_indices.clear(); + // now check if *any* of these weights is contained in the output mesh, // taking notes so we don't need to do it twice. for (WeightIndexArray::value_type index : indices) { unsigned int count = 0; const unsigned int* const out_idx = geo.ToOutputVertexIndex(index, count); - // ToOutputVertexIndex only returns NULL if index is out of bounds + // ToOutputVertexIndex only returns nullptr if index is out of bounds // which should never happen - ai_assert(out_idx != NULL); + ai_assert(out_idx != nullptr); index_out_indices.push_back(no_index_sentinel); count_out_indices.push_back(0); @@ -1519,68 +1552,107 @@ namespace Assimp { } } } - + // if we found at least one, generate the output bones // XXX this could be heavily simplified by collecting the bone // data in a single step. - ConvertCluster(bones, model, *cluster, out_indices, index_out_indices, - count_out_indices, node_global_transform); + ConvertCluster(bones, cluster, out_indices, index_out_indices, + count_out_indices, absolute_transform, parent, root_node); } + + bone_map.clear(); } - catch (std::exception&) { + catch (std::exception&e) { std::for_each(bones.begin(), bones.end(), Util::delete_fun<aiBone>()); throw; } if (bones.empty()) { + out->mBones = nullptr; + out->mNumBones = 0; return; - } - - out->mBones = new aiBone*[bones.size()](); - out->mNumBones = static_cast<unsigned int>(bones.size()); + } else { + out->mBones = new aiBone *[bones.size()](); + out->mNumBones = static_cast<unsigned int>(bones.size()); - std::swap_ranges(bones.begin(), bones.end(), out->mBones); + std::swap_ranges(bones.begin(), bones.end(), out->mBones); + } } - void FBXConverter::ConvertCluster(std::vector<aiBone*>& bones, const Model& /*model*/, const Cluster& cl, - std::vector<size_t>& out_indices, - std::vector<size_t>& index_out_indices, - std::vector<size_t>& count_out_indices, - const aiMatrix4x4& node_global_transform) + const aiNode* FBXConverter::GetNodeByName( const aiString& name, aiNode *current_node ) { + aiNode * iter = current_node; + //printf("Child count: %d", iter->mNumChildren); + return iter; + } - aiBone* const bone = new aiBone(); - bones.push_back(bone); + void FBXConverter::ConvertCluster(std::vector<aiBone *> &local_mesh_bones, const Cluster *cl, + std::vector<size_t> &out_indices, std::vector<size_t> &index_out_indices, + std::vector<size_t> &count_out_indices, const aiMatrix4x4 &absolute_transform, + aiNode *parent, aiNode *root_node) { + ai_assert(cl); // make sure cluster valid + std::string deformer_name = cl->TargetNode()->Name(); + aiString bone_name = aiString(FixNodeName(deformer_name)); - bone->mName = FixNodeName(cl.TargetNode()->Name()); + aiBone *bone = nullptr; - bone->mOffsetMatrix = cl.TransformLink(); - bone->mOffsetMatrix.Inverse(); + if (bone_map.count(deformer_name)) { + std::cout << "retrieved bone from lookup " << bone_name.C_Str() << ". Deformer: " << deformer_name + << std::endl; + bone = bone_map[deformer_name]; + } else { + std::cout << "created new bone " << bone_name.C_Str() << ". Deformer: " << deformer_name << std::endl; + bone = new aiBone(); + bone->mName = bone_name; - bone->mOffsetMatrix = bone->mOffsetMatrix * node_global_transform; + // store local transform link for post processing + bone->mOffsetMatrix = cl->TransformLink(); + bone->mOffsetMatrix.Inverse(); - bone->mNumWeights = static_cast<unsigned int>(out_indices.size()); - aiVertexWeight* cursor = bone->mWeights = new aiVertexWeight[out_indices.size()]; + aiMatrix4x4 matrix = (aiMatrix4x4)absolute_transform; - const size_t no_index_sentinel = std::numeric_limits<size_t>::max(); - const WeightArray& weights = cl.GetWeights(); + bone->mOffsetMatrix = bone->mOffsetMatrix * matrix; // * mesh_offset - const size_t c = index_out_indices.size(); - for (size_t i = 0; i < c; ++i) { - const size_t index_index = index_out_indices[i]; - if (index_index == no_index_sentinel) { - continue; - } + // + // Now calculate the aiVertexWeights + // + + aiVertexWeight *cursor = nullptr; + + bone->mNumWeights = static_cast<unsigned int>(out_indices.size()); + cursor = bone->mWeights = new aiVertexWeight[out_indices.size()]; - const size_t cc = count_out_indices[i]; - for (size_t j = 0; j < cc; ++j) { - aiVertexWeight& out_weight = *cursor++; + const size_t no_index_sentinel = std::numeric_limits<size_t>::max(); + const WeightArray& weights = cl->GetWeights(); - out_weight.mVertexId = static_cast<unsigned int>(out_indices[index_index + j]); - out_weight.mWeight = weights[i]; + const size_t c = index_out_indices.size(); + for (size_t i = 0; i < c; ++i) { + const size_t index_index = index_out_indices[i]; + + if (index_index == no_index_sentinel) { + continue; + } + + const size_t cc = count_out_indices[i]; + for (size_t j = 0; j < cc; ++j) { + // cursor runs from first element relative to the start + // or relative to the start of the next indexes. + aiVertexWeight& out_weight = *cursor++; + + out_weight.mVertexId = static_cast<unsigned int>(out_indices[index_index + j]); + out_weight.mWeight = weights[i]; + } } + + bone_map.insert(std::pair<const std::string, aiBone *>(deformer_name, bone)); } + + std::cout << "bone research: Indicies size: " << out_indices.size() << std::endl; + + // lookup must be populated in case something goes wrong + // this also allocates bones to mesh instance outside + local_mesh_bones.push_back(bone); } void FBXConverter::ConvertMaterialForMesh(aiMesh* out, const Model& model, const MeshGeometry& geo, @@ -1710,7 +1782,7 @@ namespace Assimp { bool textureReady = false; //tells if our texture is ready (if it was loaded or if it was found) unsigned int index; - VideoMap::const_iterator it = textures_converted.find(media); + VideoMap::const_iterator it = textures_converted.find(*media); if (it != textures_converted.end()) { index = (*it).second; textureReady = true; @@ -1718,7 +1790,7 @@ namespace Assimp { else { if (media->ContentLength() > 0) { index = ConvertVideo(*media); - textures_converted[media] = index; + textures_converted[*media] = index; textureReady = true; } } @@ -2242,13 +2314,13 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa if (media != nullptr && media->ContentLength() > 0) { unsigned int index; - VideoMap::const_iterator it = textures_converted.find(media); + VideoMap::const_iterator it = textures_converted.find(*media); if (it != textures_converted.end()) { index = (*it).second; } else { index = ConvertVideo(*media); - textures_converted[media] = index; + textures_converted[*media] = index; } // setup texture reference string (copied from ColladaLoader::FindFilenameForEffectTexture) @@ -2676,7 +2748,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa // sanity check whether the input is ok static void validateAnimCurveNodes(const std::vector<const AnimationCurveNode*>& curves, bool strictMode) { - const Object* target(NULL); + const Object* target(nullptr); for (const AnimationCurveNode* node : curves) { if (!target) { target = node->Target(); @@ -2707,7 +2779,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa #ifdef ASSIMP_BUILD_DEBUG validateAnimCurveNodes(curves, doc.Settings().strictMode); #endif - const AnimationCurveNode* curve_node = NULL; + const AnimationCurveNode* curve_node = nullptr; for (const AnimationCurveNode* node : curves) { ai_assert(node); @@ -2967,7 +3039,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa TransformationCompDefaultValue(comp) ); - const float epsilon = 1e-6f; + const float epsilon = Math::getEpsilon<float>(); return (dyn_val - static_val).SquareLength() < epsilon; } @@ -3555,7 +3627,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa ai_assert(!out->mMeshes); ai_assert(!out->mNumMeshes); - // note: the trailing () ensures initialization with NULL - not + // note: the trailing () ensures initialization with nullptr - not // many C++ users seem to know this, so pointing it out to avoid // confusion why this code works. @@ -3602,6 +3674,47 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa } } + void FBXConverter::ConvertOrphantEmbeddedTextures() + { + // in C++14 it could be: + // for (auto&& [id, object] : objects) + for (auto&& id_and_object : doc.Objects()) + { + auto&& id = std::get<0>(id_and_object); + auto&& object = std::get<1>(id_and_object); + // If an object doesn't have parent + if (doc.ConnectionsBySource().count(id) == 0) + { + const Texture* realTexture = nullptr; + try + { + const auto& element = object->GetElement(); + const Token& key = element.KeyToken(); + const char* obtype = key.begin(); + const size_t length = static_cast<size_t>(key.end() - key.begin()); + if (strncmp(obtype, "Texture", length) == 0) + { + const Texture* texture = static_cast<const Texture*>(object->Get()); + if (texture->Media() && texture->Media()->ContentLength() > 0) + { + realTexture = texture; + } + } + } + catch (...) + { + // do nothing + } + if (realTexture) + { + const Video* media = realTexture->Media(); + unsigned int index = ConvertVideo(*media); + textures_converted[*media] = index; + } + } + } + } + // ------------------------------------------------------------------------------------------------ void ConvertToAssimpScene(aiScene* out, const Document& doc, bool removeEmptyBones) { diff --git a/thirdparty/assimp/code/FBX/FBXConverter.h b/thirdparty/assimp/code/FBX/FBXConverter.h index ab610058a4..46693bdca6 100644 --- a/thirdparty/assimp/code/FBX/FBXConverter.h +++ b/thirdparty/assimp/code/FBX/FBXConverter.h @@ -76,16 +76,6 @@ namespace Assimp { namespace FBX { class Document; - -enum class FbxUnit { - cm = 0, - m, - km, - NumUnits, - - Undefined -}; - /** * Convert a FBX #Document to #aiScene * @param out Empty scene to be populated @@ -133,7 +123,7 @@ private: // ------------------------------------------------------------------------------------------------ // collect and assign child nodes - void ConvertNodes(uint64_t id, aiNode& parent, const aiMatrix4x4& parent_transform = aiMatrix4x4()); + void ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node); // ------------------------------------------------------------------------------------------------ void ConvertLights(const Model& model, const std::string &orig_name ); @@ -189,32 +179,35 @@ private: void SetupNodeMetadata(const Model& model, aiNode& nd); // ------------------------------------------------------------------------------------------------ - void ConvertModel(const Model& model, aiNode& nd, const aiMatrix4x4& node_global_transform); + void ConvertModel(const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform); // ------------------------------------------------------------------------------------------------ // MeshGeometry -> aiMesh, return mesh index + 1 or 0 if the conversion failed - std::vector<unsigned int> ConvertMesh(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd); + std::vector<unsigned int> + ConvertMesh(const MeshGeometry &mesh, const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform); // ------------------------------------------------------------------------------------------------ std::vector<unsigned int> ConvertLine(const LineGeometry& line, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd); + aiNode *parent, aiNode *root_node); // ------------------------------------------------------------------------------------------------ - aiMesh* SetupEmptyMesh(const Geometry& mesh, aiNode& nd); + aiMesh* SetupEmptyMesh(const Geometry& mesh, aiNode *parent); // ------------------------------------------------------------------------------------------------ - unsigned int ConvertMeshSingleMaterial(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd); + unsigned int ConvertMeshSingleMaterial(const MeshGeometry &mesh, const Model &model, + const aiMatrix4x4 &absolute_transform, aiNode *parent, + aiNode *root_node); // ------------------------------------------------------------------------------------------------ - std::vector<unsigned int> ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd); + std::vector<unsigned int> + ConvertMeshMultiMaterial(const MeshGeometry &mesh, const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform); // ------------------------------------------------------------------------------------------------ - unsigned int ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, - MatIndexArray::value_type index, - const aiMatrix4x4& node_global_transform, aiNode& nd); + unsigned int ConvertMeshMultiMaterial(const MeshGeometry &mesh, const Model &model, MatIndexArray::value_type index, + aiNode *parent, aiNode *root_node, const aiMatrix4x4 &absolute_transform); // ------------------------------------------------------------------------------------------------ static const unsigned int NO_MATERIAL_SEPARATION = /* std::numeric_limits<unsigned int>::max() */ @@ -227,17 +220,17 @@ private: * - outputVertStartIndices is only used when a material index is specified, it gives for * each output vertex the DOM index it maps to. */ - void ConvertWeights(aiMesh* out, const Model& model, const MeshGeometry& geo, - const aiMatrix4x4& node_global_transform = aiMatrix4x4(), - unsigned int materialIndex = NO_MATERIAL_SEPARATION, - std::vector<unsigned int>* outputVertStartIndices = NULL); - + void ConvertWeights(aiMesh *out, const Model &model, const MeshGeometry &geo, const aiMatrix4x4 &absolute_transform, + aiNode *parent = NULL, aiNode *root_node = NULL, + unsigned int materialIndex = NO_MATERIAL_SEPARATION, + std::vector<unsigned int> *outputVertStartIndices = NULL); + // lookup + static const aiNode* GetNodeByName( const aiString& name, aiNode *current_node ); // ------------------------------------------------------------------------------------------------ - void ConvertCluster(std::vector<aiBone*>& bones, const Model& /*model*/, const Cluster& cl, - std::vector<size_t>& out_indices, - std::vector<size_t>& index_out_indices, - std::vector<size_t>& count_out_indices, - const aiMatrix4x4& node_global_transform); + void ConvertCluster(std::vector<aiBone *> &local_mesh_bones, const Cluster *cl, + std::vector<size_t> &out_indices, std::vector<size_t> &index_out_indices, + std::vector<size_t> &count_out_indices, const aiMatrix4x4 &absolute_transform, + aiNode *parent, aiNode *root_node); // ------------------------------------------------------------------------------------------------ void ConvertMaterialForMesh(aiMesh* out, const Model& model, const MeshGeometry& geo, @@ -434,6 +427,10 @@ private: // copy generated meshes, animations, lights, cameras and textures to the output scene void TransferDataToScene(); + // ------------------------------------------------------------------------------------------------ + // FBX file could have embedded textures not connected to anything + void ConvertOrphantEmbeddedTextures(); + private: // 0: not assigned yet, others: index is value - 1 unsigned int defaultMaterialIndex; @@ -445,28 +442,47 @@ private: std::vector<aiCamera*> cameras; std::vector<aiTexture*> textures; - using MaterialMap = std::map<const Material*, unsigned int>; + using MaterialMap = std::fbx_unordered_map<const Material*, unsigned int>; MaterialMap materials_converted; - using VideoMap = std::map<const Video*, unsigned int>; + using VideoMap = std::fbx_unordered_map<const Video, unsigned int>; VideoMap textures_converted; - using MeshMap = std::map<const Geometry*, std::vector<unsigned int> >; + using MeshMap = std::fbx_unordered_map<const Geometry*, std::vector<unsigned int> >; MeshMap meshes_converted; // fixed node name -> which trafo chain components have animations? - using NodeAnimBitMap = std::map<std::string, unsigned int> ; + using NodeAnimBitMap = std::fbx_unordered_map<std::string, unsigned int> ; NodeAnimBitMap node_anim_chain_bits; // number of nodes with the same name - using NodeNameCache = std::unordered_map<std::string, unsigned int>; + using NodeNameCache = std::fbx_unordered_map<std::string, unsigned int>; NodeNameCache mNodeNames; + // Deformer name is not the same as a bone name - it does contain the bone name though :) + // Deformer names in FBX are always unique in an FBX file. + std::map<const std::string, aiBone *> bone_map; + double anim_fps; aiScene* const out; const FBX::Document& doc; - FbxUnit mCurrentUnit; + + static void BuildBoneList(aiNode *current_node, const aiNode *root_node, const aiScene *scene, + std::vector<aiBone*>& bones); + + void BuildBoneStack(aiNode *current_node, const aiNode *root_node, const aiScene *scene, + const std::vector<aiBone *> &bones, + std::map<aiBone *, aiNode *> &bone_stack, + std::vector<aiNode*> &node_stack ); + + static void BuildNodeList(aiNode *current_node, std::vector<aiNode *> &nodes); + + static aiNode *GetNodeFromStack(const aiString &node_name, std::vector<aiNode *> &nodes); + + static aiNode *GetArmatureRoot(aiNode *bone_node, std::vector<aiBone*> &bone_list); + + static bool IsBoneNode(const aiString &bone_name, std::vector<aiBone *> &bones); }; } diff --git a/thirdparty/assimp/code/FBX/FBXDocument.h b/thirdparty/assimp/code/FBX/FBXDocument.h index 18e5c38f13..a60d7d9efa 100644 --- a/thirdparty/assimp/code/FBX/FBXDocument.h +++ b/thirdparty/assimp/code/FBX/FBXDocument.h @@ -637,6 +637,20 @@ public: return ptr; } + bool operator==(const Video& other) const + { + return ( + type == other.type + && relativeFileName == other.relativeFileName + && fileName == other.fileName + ); + } + + bool operator<(const Video& other) const + { + return std::tie(type, relativeFileName, fileName) < std::tie(other.type, other.relativeFileName, other.fileName); + } + private: std::string type; std::string relativeFileName; @@ -1005,10 +1019,10 @@ public: // during their entire lifetime (Document). FBX files have // up to many thousands of objects (most of which we never use), // so the memory overhead for them should be kept at a minimum. -typedef std::map<uint64_t, LazyObject*> ObjectMap; +typedef std::fbx_unordered_map<uint64_t, LazyObject*> ObjectMap; typedef std::fbx_unordered_map<std::string, std::shared_ptr<const PropertyTable> > PropertyTemplateMap; -typedef std::multimap<uint64_t, const Connection*> ConnectionMap; +typedef std::fbx_unordered_multimap<uint64_t, const Connection*> ConnectionMap; /** DOM class for global document settings, a single instance per document can * be accessed via Document.Globals(). */ @@ -1177,4 +1191,25 @@ private: } // Namespace FBX } // Namespace Assimp +namespace std +{ + template <> + struct hash<const Assimp::FBX::Video> + { + std::size_t operator()(const Assimp::FBX::Video& video) const + { + using std::size_t; + using std::hash; + using std::string; + + size_t res = 17; + res = res * 31 + hash<string>()(video.Name()); + res = res * 31 + hash<string>()(video.RelativeFilename()); + res = res * 31 + hash<string>()(video.Type()); + + return res; + } + }; +} + #endif // INCLUDED_AI_FBX_DOCUMENT_H diff --git a/thirdparty/assimp/code/FBX/FBXExportProperty.cpp b/thirdparty/assimp/code/FBX/FBXExportProperty.cpp index f8593e6295..f2a63b72b9 100644 --- a/thirdparty/assimp/code/FBX/FBXExportProperty.cpp +++ b/thirdparty/assimp/code/FBX/FBXExportProperty.cpp @@ -59,11 +59,7 @@ namespace FBX { FBXExportProperty::FBXExportProperty(bool v) : type('C') -, data(1) { - data = { - uint8_t(v) - }; -} +, data(1, uint8_t(v)) {} FBXExportProperty::FBXExportProperty(int16_t v) : type('Y') diff --git a/thirdparty/assimp/code/FBX/FBXExporter.cpp b/thirdparty/assimp/code/FBX/FBXExporter.cpp index 8ebc8555a2..9316dc4f02 100644 --- a/thirdparty/assimp/code/FBX/FBXExporter.cpp +++ b/thirdparty/assimp/code/FBX/FBXExporter.cpp @@ -67,6 +67,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <vector> #include <array> #include <unordered_set> +#include <numeric> // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ @@ -1005,6 +1006,9 @@ void FBXExporter::WriteObjects () object_node.EndProperties(outstream, binary, indent); object_node.BeginChildren(outstream, binary, indent); + bool bJoinIdenticalVertices = mProperties->GetPropertyBool("bJoinIdenticalVertices", true); + std::vector<std::vector<int32_t>> vVertexIndice;//save vertex_indices as it is needed later + // geometry (aiMesh) mesh_uids.clear(); indent = 1; @@ -1031,21 +1035,35 @@ void FBXExporter::WriteObjects () std::vector<int32_t> vertex_indices; // map of vertex value to its index in the data vector std::map<aiVector3D,size_t> index_by_vertex_value; - int32_t index = 0; - for (size_t vi = 0; vi < m->mNumVertices; ++vi) { - aiVector3D vtx = m->mVertices[vi]; - auto elem = index_by_vertex_value.find(vtx); - if (elem == index_by_vertex_value.end()) { - vertex_indices.push_back(index); - index_by_vertex_value[vtx] = index; - flattened_vertices.push_back(vtx[0]); - flattened_vertices.push_back(vtx[1]); - flattened_vertices.push_back(vtx[2]); - ++index; - } else { - vertex_indices.push_back(int32_t(elem->second)); + if(bJoinIdenticalVertices){ + int32_t index = 0; + for (size_t vi = 0; vi < m->mNumVertices; ++vi) { + aiVector3D vtx = m->mVertices[vi]; + auto elem = index_by_vertex_value.find(vtx); + if (elem == index_by_vertex_value.end()) { + vertex_indices.push_back(index); + index_by_vertex_value[vtx] = index; + flattened_vertices.push_back(vtx[0]); + flattened_vertices.push_back(vtx[1]); + flattened_vertices.push_back(vtx[2]); + ++index; + } else { + vertex_indices.push_back(int32_t(elem->second)); + } + } + } + else { // do not join vertex, respect the export flag + vertex_indices.resize(m->mNumVertices); + std::iota(vertex_indices.begin(), vertex_indices.end(), 0); + for(unsigned int v = 0; v < m->mNumVertices; ++ v) { + aiVector3D vtx = m->mVertices[v]; + flattened_vertices.push_back(vtx.x); + flattened_vertices.push_back(vtx.y); + flattened_vertices.push_back(vtx.z); } } + vVertexIndice.push_back(vertex_indices); + FBX::Node::WritePropertyNode( "Vertices", flattened_vertices, outstream, binary, indent ); @@ -1116,6 +1134,51 @@ void FBXExporter::WriteObjects () normals.End(outstream, binary, indent, true); } + // colors, if any + // TODO only one color channel currently + const int32_t colorChannelIndex = 0; + if (m->HasVertexColors(colorChannelIndex)) { + FBX::Node vertexcolors("LayerElementColor", int32_t(colorChannelIndex)); + vertexcolors.Begin(outstream, binary, indent); + vertexcolors.DumpProperties(outstream, binary, indent); + vertexcolors.EndProperties(outstream, binary, indent); + vertexcolors.BeginChildren(outstream, binary, indent); + indent = 3; + FBX::Node::WritePropertyNode( + "Version", int32_t(101), outstream, binary, indent + ); + char layerName[8]; + sprintf(layerName, "COLOR_%d", colorChannelIndex); + FBX::Node::WritePropertyNode( + "Name", (const char*)layerName, outstream, binary, indent + ); + FBX::Node::WritePropertyNode( + "MappingInformationType", "ByPolygonVertex", + outstream, binary, indent + ); + FBX::Node::WritePropertyNode( + "ReferenceInformationType", "Direct", + outstream, binary, indent + ); + std::vector<double> color_data; + color_data.reserve(4 * polygon_data.size()); + for (size_t fi = 0; fi < m->mNumFaces; ++fi) { + const aiFace &f = m->mFaces[fi]; + for (size_t pvi = 0; pvi < f.mNumIndices; ++pvi) { + const aiColor4D &c = m->mColors[colorChannelIndex][f.mIndices[pvi]]; + color_data.push_back(c.r); + color_data.push_back(c.g); + color_data.push_back(c.b); + color_data.push_back(c.a); + } + } + FBX::Node::WritePropertyNode( + "Colors", color_data, outstream, binary, indent + ); + indent = 2; + vertexcolors.End(outstream, binary, indent, true); + } + // uvs, if any for (size_t uvi = 0; uvi < m->GetNumUVChannels(); ++uvi) { if (m->mNumUVComponents[uvi] > 2) { @@ -1209,6 +1272,11 @@ void FBXExporter::WriteObjects () le.AddChild("Type", "LayerElementNormal"); le.AddChild("TypedIndex", int32_t(0)); layer.AddChild(le); + // TODO only 1 color channel currently + le = FBX::Node("LayerElement"); + le.AddChild("Type", "LayerElementColor"); + le.AddChild("TypedIndex", int32_t(0)); + layer.AddChild(le); le = FBX::Node("LayerElement"); le.AddChild("Type", "LayerElementMaterial"); le.AddChild("TypedIndex", int32_t(0)); @@ -1221,7 +1289,7 @@ void FBXExporter::WriteObjects () for(unsigned int lr = 1; lr < m->GetNumUVChannels(); ++ lr) { - FBX::Node layerExtra("Layer", int32_t(1)); + FBX::Node layerExtra("Layer", int32_t(lr)); layerExtra.AddChild("Version", int32_t(100)); FBX::Node leExtra("LayerElement"); leExtra.AddChild("Type", "LayerElementUV"); @@ -1748,28 +1816,8 @@ void FBXExporter::WriteObjects () // connect it connections.emplace_back("C", "OO", deformer_uid, mesh_uids[mi]); - // we will be indexing by vertex... - // but there might be a different number of "vertices" - // between assimp and our output FBX. - // this code is cut-and-pasted from the geometry section above... - // ideally this should not be so. - // --- - // index of original vertex in vertex data vector - std::vector<int32_t> vertex_indices; - // map of vertex value to its index in the data vector - std::map<aiVector3D,size_t> index_by_vertex_value; - int32_t index = 0; - for (size_t vi = 0; vi < m->mNumVertices; ++vi) { - aiVector3D vtx = m->mVertices[vi]; - auto elem = index_by_vertex_value.find(vtx); - if (elem == index_by_vertex_value.end()) { - vertex_indices.push_back(index); - index_by_vertex_value[vtx] = index; - ++index; - } else { - vertex_indices.push_back(int32_t(elem->second)); - } - } + //computed before + std::vector<int32_t>& vertex_indices = vVertexIndice[mi]; // TODO, FIXME: this won't work if anything is not in the bind pose. // for now if such a situation is detected, we throw an exception. @@ -2435,7 +2483,7 @@ void FBXExporter::WriteModelNodes( void FBXExporter::WriteAnimationCurveNode( StreamWriterLE& outstream, int64_t uid, - std::string name, // "T", "R", or "S" + const std::string& name, // "T", "R", or "S" aiVector3D default_value, std::string property_name, // "Lcl Translation" etc int64_t layer_uid, diff --git a/thirdparty/assimp/code/FBX/FBXExporter.h b/thirdparty/assimp/code/FBX/FBXExporter.h index 71fb55c57f..1ae727eda9 100644 --- a/thirdparty/assimp/code/FBX/FBXExporter.h +++ b/thirdparty/assimp/code/FBX/FBXExporter.h @@ -156,7 +156,7 @@ namespace Assimp void WriteAnimationCurveNode( StreamWriterLE& outstream, int64_t uid, - std::string name, // "T", "R", or "S" + const std::string& name, // "T", "R", or "S" aiVector3D default_value, std::string property_name, // "Lcl Translation" etc int64_t animation_layer_uid, diff --git a/thirdparty/assimp/code/FBX/FBXImporter.cpp b/thirdparty/assimp/code/FBX/FBXImporter.cpp index 271935a568..afcc1ddc78 100644 --- a/thirdparty/assimp/code/FBX/FBXImporter.cpp +++ b/thirdparty/assimp/code/FBX/FBXImporter.cpp @@ -48,26 +48,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXImporter.h" -#include "FBXTokenizer.h" +#include "FBXConverter.h" +#include "FBXDocument.h" #include "FBXParser.h" +#include "FBXTokenizer.h" #include "FBXUtil.h" -#include "FBXDocument.h" -#include "FBXConverter.h" -#include <assimp/StreamReader.h> #include <assimp/MemoryIOWrapper.h> -#include <assimp/Importer.hpp> +#include <assimp/StreamReader.h> #include <assimp/importerdesc.h> +#include <assimp/Importer.hpp> namespace Assimp { -template<> -const char* LogFunctions<FBXImporter>::Prefix() { - static auto prefix = "FBX: "; - return prefix; +template <> +const char *LogFunctions<FBXImporter>::Prefix() { + static auto prefix = "FBX: "; + return prefix; } -} +} // namespace Assimp using namespace Assimp; using namespace Assimp::Formatter; @@ -76,136 +76,123 @@ using namespace Assimp::FBX; namespace { static const aiImporterDesc desc = { - "Autodesk FBX Importer", - "", - "", - "", - aiImporterFlags_SupportTextFlavour, - 0, - 0, - 0, - 0, - "fbx" + "Autodesk FBX Importer", + "", + "", + "", + aiImporterFlags_SupportTextFlavour, + 0, + 0, + 0, + 0, + "fbx" }; } // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by #Importer -FBXImporter::FBXImporter() -{ +FBXImporter::FBXImporter() { } // ------------------------------------------------------------------------------------------------ // Destructor, private as well -FBXImporter::~FBXImporter() -{ +FBXImporter::~FBXImporter() { } // ------------------------------------------------------------------------------------------------ // Returns whether the class can handle the format of the given file. -bool FBXImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const -{ - const std::string& extension = GetExtension(pFile); - if (extension == std::string( desc.mFileExtensions ) ) { - return true; - } - - else if ((!extension.length() || checkSig) && pIOHandler) { - // at least ASCII-FBX files usually have a 'FBX' somewhere in their head - const char* tokens[] = {"fbx"}; - return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1); - } - return false; +bool FBXImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const { + const std::string &extension = GetExtension(pFile); + if (extension == std::string(desc.mFileExtensions)) { + return true; + } + + else if ((!extension.length() || checkSig) && pIOHandler) { + // at least ASCII-FBX files usually have a 'FBX' somewhere in their head + const char *tokens[] = { "fbx" }; + return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1); + } + return false; } // ------------------------------------------------------------------------------------------------ // List all extensions handled by this loader -const aiImporterDesc* FBXImporter::GetInfo () const -{ - return &desc; +const aiImporterDesc *FBXImporter::GetInfo() const { + return &desc; } // ------------------------------------------------------------------------------------------------ // Setup configuration properties for the loader -void FBXImporter::SetupProperties(const Importer* pImp) -{ - settings.readAllLayers = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS, true); - settings.readAllMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_MATERIALS, false); - settings.readMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_MATERIALS, true); - settings.readTextures = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_TEXTURES, true); - settings.readCameras = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_CAMERAS, true); - settings.readLights = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_LIGHTS, true); - settings.readAnimations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ANIMATIONS, true); - settings.strictMode = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_STRICT_MODE, false); - settings.preservePivots = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, true); - settings.optimizeEmptyAnimationCurves = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES, true); - settings.useLegacyEmbeddedTextureNaming = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING, false); - settings.removeEmptyBones = pImp->GetPropertyBool(AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES, true); - settings.convertToMeters = pImp->GetPropertyBool(AI_CONFIG_FBX_CONVERT_TO_M, false); +void FBXImporter::SetupProperties(const Importer *pImp) { + settings.readAllLayers = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS, true); + settings.readAllMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_MATERIALS, false); + settings.readMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_MATERIALS, true); + settings.readTextures = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_TEXTURES, true); + settings.readCameras = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_CAMERAS, true); + settings.readLights = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_LIGHTS, true); + settings.readAnimations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ANIMATIONS, true); + settings.strictMode = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_STRICT_MODE, false); + settings.preservePivots = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, true); + settings.optimizeEmptyAnimationCurves = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES, true); + settings.useLegacyEmbeddedTextureNaming = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING, false); + settings.removeEmptyBones = pImp->GetPropertyBool(AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES, true); + settings.convertToMeters = pImp->GetPropertyBool(AI_CONFIG_FBX_CONVERT_TO_M, false); } // ------------------------------------------------------------------------------------------------ // Imports the given file into the given scene structure. -void FBXImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) -{ - std::unique_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb")); - if (!stream) { - ThrowException("Could not open file for reading"); - } - - // read entire file into memory - no streaming for this, fbx - // files can grow large, but the assimp output data structure - // then becomes very large, too. Assimp doesn't support - // streaming for its output data structures so the net win with - // streaming input data would be very low. - std::vector<char> contents; - contents.resize(stream->FileSize()+1); - stream->Read( &*contents.begin(), 1, contents.size()-1 ); - contents[ contents.size() - 1 ] = 0; - const char* const begin = &*contents.begin(); - - // broadphase tokenizing pass in which we identify the core - // syntax elements of FBX (brackets, commas, key:value mappings) - TokenList tokens; - try { - - bool is_binary = false; - if (!strncmp(begin,"Kaydara FBX Binary",18)) { - is_binary = true; - TokenizeBinary(tokens,begin,contents.size()); - } - else { - Tokenize(tokens,begin); - } - - // use this information to construct a very rudimentary - // parse-tree representing the FBX scope structure - Parser parser(tokens, is_binary); - - // take the raw parse-tree and convert it to a FBX DOM - Document doc(parser,settings); - - FbxUnit unit(FbxUnit::cm); - if (settings.convertToMeters) { - unit = FbxUnit::m; - } - - // convert the FBX DOM to aiScene - ConvertToAssimpScene(pScene, doc, settings.removeEmptyBones); - - // size relative to cm - float size_relative_to_cm = doc.GlobalSettings().UnitScaleFactor(); - - // Set FBX file scale is relative to CM must be converted to M for - // assimp universal format (M) - SetFileScale( size_relative_to_cm * 0.01f); - - std::for_each(tokens.begin(),tokens.end(),Util::delete_fun<Token>()); - } - catch(std::exception&) { - std::for_each(tokens.begin(),tokens.end(),Util::delete_fun<Token>()); - throw; - } +void FBXImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) { + std::unique_ptr<IOStream> stream(pIOHandler->Open(pFile, "rb")); + if (!stream) { + ThrowException("Could not open file for reading"); + } + + // read entire file into memory - no streaming for this, fbx + // files can grow large, but the assimp output data structure + // then becomes very large, too. Assimp doesn't support + // streaming for its output data structures so the net win with + // streaming input data would be very low. + std::vector<char> contents; + contents.resize(stream->FileSize() + 1); + stream->Read(&*contents.begin(), 1, contents.size() - 1); + contents[contents.size() - 1] = 0; + const char *const begin = &*contents.begin(); + + // broadphase tokenizing pass in which we identify the core + // syntax elements of FBX (brackets, commas, key:value mappings) + TokenList tokens; + try { + + bool is_binary = false; + if (!strncmp(begin, "Kaydara FBX Binary", 18)) { + is_binary = true; + TokenizeBinary(tokens, begin, contents.size()); + } else { + Tokenize(tokens, begin); + } + + // use this information to construct a very rudimentary + // parse-tree representing the FBX scope structure + Parser parser(tokens, is_binary); + + // take the raw parse-tree and convert it to a FBX DOM + Document doc(parser, settings); + + // convert the FBX DOM to aiScene + ConvertToAssimpScene(pScene, doc, settings.removeEmptyBones); + + // size relative to cm + float size_relative_to_cm = doc.GlobalSettings().UnitScaleFactor(); + + // Set FBX file scale is relative to CM must be converted to M for + // assimp universal format (M) + SetFileScale(size_relative_to_cm * 0.01f); + + std::for_each(tokens.begin(), tokens.end(), Util::delete_fun<Token>()); + } catch (std::exception &) { + std::for_each(tokens.begin(), tokens.end(), Util::delete_fun<Token>()); + throw; + } } #endif // !ASSIMP_BUILD_NO_FBX_IMPORTER diff --git a/thirdparty/assimp/code/FBX/FBXMeshGeometry.cpp b/thirdparty/assimp/code/FBX/FBXMeshGeometry.cpp index 5c9a0e309d..1386e2383c 100644 --- a/thirdparty/assimp/code/FBX/FBXMeshGeometry.cpp +++ b/thirdparty/assimp/code/FBX/FBXMeshGeometry.cpp @@ -610,11 +610,11 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons const std::string& ReferenceInformationType) { const size_t face_count = m_faces.size(); - if(face_count <= 0) + if( 0 == face_count ) { return; } - + // materials are handled separately. First of all, they are assigned per-face // and not per polyvert. Secondly, ReferenceInformationType=IndexToDirect // has a slightly different meaning for materials. @@ -625,16 +625,14 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons if (materials_out.empty()) { FBXImporter::LogError(Formatter::format("expected material index, ignoring")); return; - } - else if (materials_out.size() > 1) { + } else if (materials_out.size() > 1) { FBXImporter::LogWarn(Formatter::format("expected only a single material index, ignoring all except the first one")); materials_out.clear(); } materials_out.resize(m_vertices.size()); std::fill(materials_out.begin(), materials_out.end(), materials_out.at(0)); - } - else if (MappingInformationType == "ByPolygon" && ReferenceInformationType == "IndexToDirect") { + } else if (MappingInformationType == "ByPolygon" && ReferenceInformationType == "IndexToDirect") { materials_out.resize(face_count); if(materials_out.size() != face_count) { @@ -643,18 +641,16 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons ); return; } - } - else { + } else { FBXImporter::LogError(Formatter::format("ignoring material assignments, access type not implemented: ") << MappingInformationType << "," << ReferenceInformationType); } } // ------------------------------------------------------------------------------------------------ ShapeGeometry::ShapeGeometry(uint64_t id, const Element& element, const std::string& name, const Document& doc) - : Geometry(id, element, name, doc) -{ - const Scope* sc = element.Compound(); - if (!sc) { +: Geometry(id, element, name, doc) { + const Scope *sc = element.Compound(); + if (nullptr == sc) { DOMError("failed to read Geometry object (class: Shape), no data scope found"); } const Element& Indexes = GetRequiredElement(*sc, "Indexes", &element); diff --git a/thirdparty/assimp/code/MMD/MMDCpp14.h b/thirdparty/assimp/code/MMD/MMDCpp14.h deleted file mode 100644 index 638b0bfd2f..0000000000 --- a/thirdparty/assimp/code/MMD/MMDCpp14.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above -copyright notice, this list of conditions and the -following disclaimer. - -* Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other -materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its -contributors may be used to endorse or promote products -derived from this software without specific prior -written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ -#pragma once - -#ifndef MMD_CPP14_H -#define MMD_CPP14_H - -#include <cstddef> -#include <memory> -#include <type_traits> -#include <utility> - -namespace mmd { - template<class T> struct _Unique_if { - typedef std::unique_ptr<T> _Single_object; - }; - - template<class T> struct _Unique_if<T[]> { - typedef std::unique_ptr<T[]> _Unknown_bound; - }; - - template<class T, size_t N> struct _Unique_if<T[N]> { - typedef void _Known_bound; - }; - - template<class T, class... Args> - typename _Unique_if<T>::_Single_object - make_unique(Args&&... args) { - return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); - } - - template<class T> - typename _Unique_if<T>::_Unknown_bound - make_unique(size_t n) { - typedef typename std::remove_extent<T>::type U; - return std::unique_ptr<T>(new U[n]()); - } - - template<class T, class... Args> - typename _Unique_if<T>::_Known_bound - make_unique(Args&&...) = delete; -} - -#endif diff --git a/thirdparty/assimp/code/MMD/MMDImporter.cpp b/thirdparty/assimp/code/MMD/MMDImporter.cpp deleted file mode 100644 index e7744e4cd0..0000000000 --- a/thirdparty/assimp/code/MMD/MMDImporter.cpp +++ /dev/null @@ -1,372 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2016, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following -conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------------- -*/ - -#ifndef ASSIMP_BUILD_NO_MMD_IMPORTER - -#include "MMD/MMDImporter.h" -#include "MMD/MMDPmdParser.h" -#include "MMD/MMDPmxParser.h" -#include "MMD/MMDVmdParser.h" -#include "PostProcessing/ConvertToLHProcess.h" - -#include <assimp/DefaultIOSystem.h> -#include <assimp/Importer.hpp> -#include <assimp/ai_assert.h> -#include <assimp/scene.h> - -#include <fstream> -#include <iomanip> -#include <memory> - -static const aiImporterDesc desc = {"MMD Importer", - "", - "", - "surfaces supported?", - aiImporterFlags_SupportTextFlavour, - 0, - 0, - 0, - 0, - "pmx"}; - -namespace Assimp { - -using namespace std; - -// ------------------------------------------------------------------------------------------------ -// Default constructor -MMDImporter::MMDImporter() -: m_Buffer() -, m_strAbsPath("") { - DefaultIOSystem io; - m_strAbsPath = io.getOsSeparator(); -} - -// ------------------------------------------------------------------------------------------------ -// Destructor. -MMDImporter::~MMDImporter() { - // empty -} - -// ------------------------------------------------------------------------------------------------ -// Returns true, if file is an pmx file. -bool MMDImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, - bool checkSig) const { - if (!checkSig) // Check File Extension - { - return SimpleExtensionCheck(pFile, "pmx"); - } else // Check file Header - { - static const char *pTokens[] = {"PMX "}; - return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 1); - } -} - -// ------------------------------------------------------------------------------------------------ -const aiImporterDesc *MMDImporter::GetInfo() const { return &desc; } - -// ------------------------------------------------------------------------------------------------ -// MMD import implementation -void MMDImporter::InternReadFile(const std::string &file, aiScene *pScene, - IOSystem * /*pIOHandler*/) { - // Read file by istream - std::filebuf fb; - if (!fb.open(file, std::ios::in | std::ios::binary)) { - throw DeadlyImportError("Failed to open file " + file + "."); - } - - std::istream fileStream(&fb); - - // Get the file-size and validate it, throwing an exception when fails - fileStream.seekg(0, fileStream.end); - size_t fileSize = static_cast<size_t>(fileStream.tellg()); - fileStream.seekg(0, fileStream.beg); - - if (fileSize < sizeof(pmx::PmxModel)) { - throw DeadlyImportError(file + " is too small."); - } - - pmx::PmxModel model; - model.Read(&fileStream); - - CreateDataFromImport(&model, pScene); -} - -// ------------------------------------------------------------------------------------------------ -void MMDImporter::CreateDataFromImport(const pmx::PmxModel *pModel, - aiScene *pScene) { - if (pModel == NULL) { - return; - } - - aiNode *pNode = new aiNode; - if (!pModel->model_name.empty()) { - pNode->mName.Set(pModel->model_name); - } - - pScene->mRootNode = pNode; - - pNode = new aiNode; - pScene->mRootNode->addChildren(1, &pNode); - pNode->mName.Set(string(pModel->model_name) + string("_mesh")); - - // split mesh by materials - pNode->mNumMeshes = pModel->material_count; - pNode->mMeshes = new unsigned int[pNode->mNumMeshes]; - for (unsigned int index = 0; index < pNode->mNumMeshes; index++) { - pNode->mMeshes[index] = index; - } - - pScene->mNumMeshes = pModel->material_count; - pScene->mMeshes = new aiMesh *[pScene->mNumMeshes]; - for (unsigned int i = 0, indexStart = 0; i < pScene->mNumMeshes; i++) { - const int indexCount = pModel->materials[i].index_count; - - pScene->mMeshes[i] = CreateMesh(pModel, indexStart, indexCount); - pScene->mMeshes[i]->mName = pModel->materials[i].material_name; - pScene->mMeshes[i]->mMaterialIndex = i; - indexStart += indexCount; - } - - // create node hierarchy for bone position - std::unique_ptr<aiNode *[]> ppNode(new aiNode *[pModel->bone_count]); - for (auto i = 0; i < pModel->bone_count; i++) { - ppNode[i] = new aiNode(pModel->bones[i].bone_name); - } - - for (auto i = 0; i < pModel->bone_count; i++) { - const pmx::PmxBone &bone = pModel->bones[i]; - - if (bone.parent_index < 0) { - pScene->mRootNode->addChildren(1, ppNode.get() + i); - } else { - ppNode[bone.parent_index]->addChildren(1, ppNode.get() + i); - - aiVector3D v3 = aiVector3D( - bone.position[0] - pModel->bones[bone.parent_index].position[0], - bone.position[1] - pModel->bones[bone.parent_index].position[1], - bone.position[2] - pModel->bones[bone.parent_index].position[2]); - aiMatrix4x4::Translation(v3, ppNode[i]->mTransformation); - } - } - - // create materials - pScene->mNumMaterials = pModel->material_count; - pScene->mMaterials = new aiMaterial *[pScene->mNumMaterials]; - for (unsigned int i = 0; i < pScene->mNumMaterials; i++) { - pScene->mMaterials[i] = CreateMaterial(&pModel->materials[i], pModel); - } - - // Convert everything to OpenGL space - MakeLeftHandedProcess convertProcess; - convertProcess.Execute(pScene); - - FlipUVsProcess uvFlipper; - uvFlipper.Execute(pScene); - - FlipWindingOrderProcess windingFlipper; - windingFlipper.Execute(pScene); -} - -// ------------------------------------------------------------------------------------------------ -aiMesh *MMDImporter::CreateMesh(const pmx::PmxModel *pModel, - const int indexStart, const int indexCount) { - aiMesh *pMesh = new aiMesh; - - pMesh->mNumVertices = indexCount; - - pMesh->mNumFaces = indexCount / 3; - pMesh->mFaces = new aiFace[pMesh->mNumFaces]; - - const int numIndices = 3; // triangular face - for (unsigned int index = 0; index < pMesh->mNumFaces; index++) { - pMesh->mFaces[index].mNumIndices = numIndices; - unsigned int *indices = new unsigned int[numIndices]; - indices[0] = numIndices * index; - indices[1] = numIndices * index + 1; - indices[2] = numIndices * index + 2; - pMesh->mFaces[index].mIndices = indices; - } - - pMesh->mVertices = new aiVector3D[pMesh->mNumVertices]; - pMesh->mNormals = new aiVector3D[pMesh->mNumVertices]; - pMesh->mTextureCoords[0] = new aiVector3D[pMesh->mNumVertices]; - pMesh->mNumUVComponents[0] = 2; - - // additional UVs - for (int i = 1; i <= pModel->setting.uv; i++) { - pMesh->mTextureCoords[i] = new aiVector3D[pMesh->mNumVertices]; - pMesh->mNumUVComponents[i] = 4; - } - - map<int, vector<aiVertexWeight>> bone_vertex_map; - - // fill in contents and create bones - for (int index = 0; index < indexCount; index++) { - const pmx::PmxVertex *v = - &pModel->vertices[pModel->indices[indexStart + index]]; - const float *position = v->position; - pMesh->mVertices[index].Set(position[0], position[1], position[2]); - const float *normal = v->normal; - - pMesh->mNormals[index].Set(normal[0], normal[1], normal[2]); - pMesh->mTextureCoords[0][index].x = v->uv[0]; - pMesh->mTextureCoords[0][index].y = v->uv[1]; - - for (int i = 1; i <= pModel->setting.uv; i++) { - // TODO: wrong here? use quaternion transform? - pMesh->mTextureCoords[i][index].x = v->uva[i][0]; - pMesh->mTextureCoords[i][index].y = v->uva[i][1]; - } - - // handle bone map - const auto vsBDEF1_ptr = - dynamic_cast<pmx::PmxVertexSkinningBDEF1 *>(v->skinning.get()); - const auto vsBDEF2_ptr = - dynamic_cast<pmx::PmxVertexSkinningBDEF2 *>(v->skinning.get()); - const auto vsBDEF4_ptr = - dynamic_cast<pmx::PmxVertexSkinningBDEF4 *>(v->skinning.get()); - const auto vsSDEF_ptr = - dynamic_cast<pmx::PmxVertexSkinningSDEF *>(v->skinning.get()); - switch (v->skinning_type) { - case pmx::PmxVertexSkinningType::BDEF1: - bone_vertex_map[vsBDEF1_ptr->bone_index].push_back( - aiVertexWeight(index, 1.0)); - break; - case pmx::PmxVertexSkinningType::BDEF2: - bone_vertex_map[vsBDEF2_ptr->bone_index1].push_back( - aiVertexWeight(index, vsBDEF2_ptr->bone_weight)); - bone_vertex_map[vsBDEF2_ptr->bone_index2].push_back( - aiVertexWeight(index, 1.0f - vsBDEF2_ptr->bone_weight)); - break; - case pmx::PmxVertexSkinningType::BDEF4: - bone_vertex_map[vsBDEF4_ptr->bone_index1].push_back( - aiVertexWeight(index, vsBDEF4_ptr->bone_weight1)); - bone_vertex_map[vsBDEF4_ptr->bone_index2].push_back( - aiVertexWeight(index, vsBDEF4_ptr->bone_weight2)); - bone_vertex_map[vsBDEF4_ptr->bone_index3].push_back( - aiVertexWeight(index, vsBDEF4_ptr->bone_weight3)); - bone_vertex_map[vsBDEF4_ptr->bone_index4].push_back( - aiVertexWeight(index, vsBDEF4_ptr->bone_weight4)); - break; - case pmx::PmxVertexSkinningType::SDEF: // TODO: how to use sdef_c, sdef_r0, - // sdef_r1? - bone_vertex_map[vsSDEF_ptr->bone_index1].push_back( - aiVertexWeight(index, vsSDEF_ptr->bone_weight)); - bone_vertex_map[vsSDEF_ptr->bone_index2].push_back( - aiVertexWeight(index, 1.0f - vsSDEF_ptr->bone_weight)); - break; - case pmx::PmxVertexSkinningType::QDEF: - const auto vsQDEF_ptr = - dynamic_cast<pmx::PmxVertexSkinningQDEF *>(v->skinning.get()); - bone_vertex_map[vsQDEF_ptr->bone_index1].push_back( - aiVertexWeight(index, vsQDEF_ptr->bone_weight1)); - bone_vertex_map[vsQDEF_ptr->bone_index2].push_back( - aiVertexWeight(index, vsQDEF_ptr->bone_weight2)); - bone_vertex_map[vsQDEF_ptr->bone_index3].push_back( - aiVertexWeight(index, vsQDEF_ptr->bone_weight3)); - bone_vertex_map[vsQDEF_ptr->bone_index4].push_back( - aiVertexWeight(index, vsQDEF_ptr->bone_weight4)); - break; - } - } - - // make all bones for each mesh - // assign bone weights to skinned bones (otherwise just initialize) - auto bone_ptr_ptr = new aiBone *[pModel->bone_count]; - pMesh->mNumBones = pModel->bone_count; - pMesh->mBones = bone_ptr_ptr; - for (auto ii = 0; ii < pModel->bone_count; ++ii) { - auto pBone = new aiBone; - const auto &pmxBone = pModel->bones[ii]; - pBone->mName = pmxBone.bone_name; - aiVector3D pos(pmxBone.position[0], pmxBone.position[1], pmxBone.position[2]); - aiMatrix4x4::Translation(-pos, pBone->mOffsetMatrix); - auto it = bone_vertex_map.find(ii); - if (it != bone_vertex_map.end()) { - pBone->mNumWeights = static_cast<unsigned int>(it->second.size()); - pBone->mWeights = new aiVertexWeight[pBone->mNumWeights]; - for (unsigned int j = 0; j < pBone->mNumWeights; j++) { - pBone->mWeights[j] = it->second[j]; - } - } - bone_ptr_ptr[ii] = pBone; - } - - return pMesh; -} - -// ------------------------------------------------------------------------------------------------ -aiMaterial *MMDImporter::CreateMaterial(const pmx::PmxMaterial *pMat, - const pmx::PmxModel *pModel) { - aiMaterial *mat = new aiMaterial(); - aiString name(pMat->material_english_name); - mat->AddProperty(&name, AI_MATKEY_NAME); - - aiColor3D diffuse(pMat->diffuse[0], pMat->diffuse[1], pMat->diffuse[2]); - mat->AddProperty(&diffuse, 1, AI_MATKEY_COLOR_DIFFUSE); - aiColor3D specular(pMat->specular[0], pMat->specular[1], pMat->specular[2]); - mat->AddProperty(&specular, 1, AI_MATKEY_COLOR_SPECULAR); - aiColor3D ambient(pMat->ambient[0], pMat->ambient[1], pMat->ambient[2]); - mat->AddProperty(&ambient, 1, AI_MATKEY_COLOR_AMBIENT); - - float opacity = pMat->diffuse[3]; - mat->AddProperty(&opacity, 1, AI_MATKEY_OPACITY); - float shininess = pMat->specularlity; - mat->AddProperty(&shininess, 1, AI_MATKEY_SHININESS_STRENGTH); - - if(pMat->diffuse_texture_index >= 0) { - aiString texture_path(pModel->textures[pMat->diffuse_texture_index]); - mat->AddProperty(&texture_path, AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE, 0)); - } - - int mapping_uvwsrc = 0; - mat->AddProperty(&mapping_uvwsrc, 1, - AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE, 0)); - - return mat; -} - -// ------------------------------------------------------------------------------------------------ - -} // Namespace Assimp - -#endif // !! ASSIMP_BUILD_NO_MMD_IMPORTER diff --git a/thirdparty/assimp/code/MMD/MMDImporter.h b/thirdparty/assimp/code/MMD/MMDImporter.h deleted file mode 100644 index 4ee94eeb00..0000000000 --- a/thirdparty/assimp/code/MMD/MMDImporter.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2016, assimp team -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ -#ifndef MMD_FILE_IMPORTER_H_INC -#define MMD_FILE_IMPORTER_H_INC - -#include <assimp/BaseImporter.h> -#include "MMDPmxParser.h" -#include <assimp/material.h> -#include <vector> - -struct aiMesh; - -namespace Assimp { - -// ------------------------------------------------------------------------------------------------ -/// \class MMDImporter -/// \brief Imports MMD a pmx/pmd/vmd file -// ------------------------------------------------------------------------------------------------ -class MMDImporter : public BaseImporter { -public: - /// \brief Default constructor - MMDImporter(); - - /// \brief Destructor - ~MMDImporter(); - -public: - /// \brief Returns whether the class can handle the format of the given file. - /// \remark See BaseImporter::CanRead() for details. - bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const; - -private: - //! \brief Appends the supported extension. - const aiImporterDesc* GetInfo () const; - - //! \brief File import implementation. - void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler); - - //! \brief Create the data from imported content. - void CreateDataFromImport(const pmx::PmxModel* pModel, aiScene* pScene); - - //! \brief Create the mesh - aiMesh* CreateMesh(const pmx::PmxModel* pModel, const int indexStart, const int indexCount); - - //! \brief Create the material - aiMaterial* CreateMaterial(const pmx::PmxMaterial* pMat, const pmx::PmxModel* pModel); - -private: - //! Data buffer - std::vector<char> m_Buffer; - //! Absolute pathname of model in file system - std::string m_strAbsPath; -}; - -// ------------------------------------------------------------------------------------------------ - -} // Namespace Assimp - -#endif
\ No newline at end of file diff --git a/thirdparty/assimp/code/MMD/MMDPmdParser.h b/thirdparty/assimp/code/MMD/MMDPmdParser.h deleted file mode 100644 index d2f2224aa1..0000000000 --- a/thirdparty/assimp/code/MMD/MMDPmdParser.h +++ /dev/null @@ -1,597 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above -copyright notice, this list of conditions and the -following disclaimer. - -* Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other -materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its -contributors may be used to endorse or promote products -derived from this software without specific prior -written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ -#pragma once - -#include <vector> -#include <string> -#include <memory> -#include <iostream> -#include <fstream> -#include "MMDCpp14.h" - -namespace pmd -{ - class PmdHeader - { - public: - std::string name; - std::string name_english; - std::string comment; - std::string comment_english; - - bool Read(std::ifstream* stream) - { - char buffer[256]; - stream->read(buffer, 20); - name = std::string(buffer); - stream->read(buffer, 256); - comment = std::string(buffer); - return true; - } - - bool ReadExtension(std::ifstream* stream) - { - char buffer[256]; - stream->read(buffer, 20); - name_english = std::string(buffer); - stream->read(buffer, 256); - comment_english = std::string(buffer); - return true; - } - }; - - class PmdVertex - { - public: - float position[3]; - - float normal[3]; - - float uv[2]; - - uint16_t bone_index[2]; - - uint8_t bone_weight; - - bool edge_invisible; - - bool Read(std::ifstream* stream) - { - stream->read((char*) position, sizeof(float) * 3); - stream->read((char*) normal, sizeof(float) * 3); - stream->read((char*) uv, sizeof(float) * 2); - stream->read((char*) bone_index, sizeof(uint16_t) * 2); - stream->read((char*) &bone_weight, sizeof(uint8_t)); - stream->read((char*) &edge_invisible, sizeof(uint8_t)); - return true; - } - }; - - class PmdMaterial - { - public: - float diffuse[4]; - float power; - float specular[3]; - float ambient[3]; - uint8_t toon_index; - uint8_t edge_flag; - uint32_t index_count; - std::string texture_filename; - std::string sphere_filename; - - bool Read(std::ifstream* stream) - { - char buffer[20]; - stream->read((char*) &diffuse, sizeof(float) * 4); - stream->read((char*) &power, sizeof(float)); - stream->read((char*) &specular, sizeof(float) * 3); - stream->read((char*) &ambient, sizeof(float) * 3); - stream->read((char*) &toon_index, sizeof(uint8_t)); - stream->read((char*) &edge_flag, sizeof(uint8_t)); - stream->read((char*) &index_count, sizeof(uint32_t)); - stream->read((char*) &buffer, sizeof(char) * 20); - char* pstar = strchr(buffer, '*'); - if (NULL == pstar) - { - texture_filename = std::string(buffer); - sphere_filename.clear(); - } - else { - *pstar = 0; - texture_filename = std::string(buffer); - sphere_filename = std::string(pstar+1); - } - return true; - } - }; - - enum class BoneType : uint8_t - { - Rotation, - RotationAndMove, - IkEffector, - Unknown, - IkEffectable, - RotationEffectable, - IkTarget, - Invisible, - Twist, - RotationMovement - }; - - class PmdBone - { - public: - std::string name; - std::string name_english; - uint16_t parent_bone_index; - uint16_t tail_pos_bone_index; - BoneType bone_type; - uint16_t ik_parent_bone_index; - float bone_head_pos[3]; - - void Read(std::istream *stream) - { - char buffer[20]; - stream->read(buffer, 20); - name = std::string(buffer); - stream->read((char*) &parent_bone_index, sizeof(uint16_t)); - stream->read((char*) &tail_pos_bone_index, sizeof(uint16_t)); - stream->read((char*) &bone_type, sizeof(uint8_t)); - stream->read((char*) &ik_parent_bone_index, sizeof(uint16_t)); - stream->read((char*) &bone_head_pos, sizeof(float) * 3); - } - - void ReadExpantion(std::istream *stream) - { - char buffer[20]; - stream->read(buffer, 20); - name_english = std::string(buffer); - } - }; - - class PmdIk - { - public: - uint16_t ik_bone_index; - uint16_t target_bone_index; - uint16_t interations; - float angle_limit; - std::vector<uint16_t> ik_child_bone_index; - - void Read(std::istream *stream) - { - stream->read((char *) &ik_bone_index, sizeof(uint16_t)); - stream->read((char *) &target_bone_index, sizeof(uint16_t)); - uint8_t ik_chain_length; - stream->read((char*) &ik_chain_length, sizeof(uint8_t)); - stream->read((char *) &interations, sizeof(uint16_t)); - stream->read((char *) &angle_limit, sizeof(float)); - ik_child_bone_index.resize(ik_chain_length); - for (int i = 0; i < ik_chain_length; i++) - { - stream->read((char *) &ik_child_bone_index[i], sizeof(uint16_t)); - } - } - }; - - class PmdFaceVertex - { - public: - int vertex_index; - float position[3]; - - void Read(std::istream *stream) - { - stream->read((char *) &vertex_index, sizeof(int)); - stream->read((char *) position, sizeof(float) * 3); - } - }; - - enum class FaceCategory : uint8_t - { - Base, - Eyebrow, - Eye, - Mouth, - Other - }; - - class PmdFace - { - public: - std::string name; - FaceCategory type; - std::vector<PmdFaceVertex> vertices; - std::string name_english; - - void Read(std::istream *stream) - { - char buffer[20]; - stream->read(buffer, 20); - name = std::string(buffer); - int vertex_count; - stream->read((char*) &vertex_count, sizeof(int)); - stream->read((char*) &type, sizeof(uint8_t)); - vertices.resize(vertex_count); - for (int i = 0; i < vertex_count; i++) - { - vertices[i].Read(stream); - } - } - - void ReadExpantion(std::istream *stream) - { - char buffer[20]; - stream->read(buffer, 20); - name_english = std::string(buffer); - } - }; - - class PmdBoneDispName - { - public: - std::string bone_disp_name; - std::string bone_disp_name_english; - - void Read(std::istream *stream) - { - char buffer[50]; - stream->read(buffer, 50); - bone_disp_name = std::string(buffer); - bone_disp_name_english.clear(); - } - void ReadExpantion(std::istream *stream) - { - char buffer[50]; - stream->read(buffer, 50); - bone_disp_name_english = std::string(buffer); - } - }; - - class PmdBoneDisp - { - public: - uint16_t bone_index; - uint8_t bone_disp_index; - - void Read(std::istream *stream) - { - stream->read((char*) &bone_index, sizeof(uint16_t)); - stream->read((char*) &bone_disp_index, sizeof(uint8_t)); - } - }; - - enum class RigidBodyShape : uint8_t - { - Sphere = 0, - Box = 1, - Cpusel = 2 - }; - - enum class RigidBodyType : uint8_t - { - BoneConnected = 0, - Physics = 1, - ConnectedPhysics = 2 - }; - - class PmdRigidBody - { - public: - std::string name; - uint16_t related_bone_index; - uint8_t group_index; - uint16_t mask; - RigidBodyShape shape; - float size[3]; - float position[3]; - float orientation[3]; - float weight; - float linear_damping; - float anglar_damping; - float restitution; - float friction; - RigidBodyType rigid_type; - - void Read(std::istream *stream) - { - char buffer[20]; - stream->read(buffer, sizeof(char) * 20); - name = (std::string(buffer)); - stream->read((char*) &related_bone_index, sizeof(uint16_t)); - stream->read((char*) &group_index, sizeof(uint8_t)); - stream->read((char*) &mask, sizeof(uint16_t)); - stream->read((char*) &shape, sizeof(uint8_t)); - stream->read((char*) size, sizeof(float) * 3); - stream->read((char*) position, sizeof(float) * 3); - stream->read((char*) orientation, sizeof(float) * 3); - stream->read((char*) &weight, sizeof(float)); - stream->read((char*) &linear_damping, sizeof(float)); - stream->read((char*) &anglar_damping, sizeof(float)); - stream->read((char*) &restitution, sizeof(float)); - stream->read((char*) &friction, sizeof(float)); - stream->read((char*) &rigid_type, sizeof(char)); - } - }; - - class PmdConstraint - { - public: - std::string name; - uint32_t rigid_body_index_a; - uint32_t rigid_body_index_b; - float position[3]; - float orientation[3]; - float linear_lower_limit[3]; - float linear_upper_limit[3]; - float angular_lower_limit[3]; - float angular_upper_limit[3]; - float linear_stiffness[3]; - float angular_stiffness[3]; - - void Read(std::istream *stream) - { - char buffer[20]; - stream->read(buffer, 20); - name = std::string(buffer); - stream->read((char *) &rigid_body_index_a, sizeof(uint32_t)); - stream->read((char *) &rigid_body_index_b, sizeof(uint32_t)); - stream->read((char *) position, sizeof(float) * 3); - stream->read((char *) orientation, sizeof(float) * 3); - stream->read((char *) linear_lower_limit, sizeof(float) * 3); - stream->read((char *) linear_upper_limit, sizeof(float) * 3); - stream->read((char *) angular_lower_limit, sizeof(float) * 3); - stream->read((char *) angular_upper_limit, sizeof(float) * 3); - stream->read((char *) linear_stiffness, sizeof(float) * 3); - stream->read((char *) angular_stiffness, sizeof(float) * 3); - } - }; - - class PmdModel - { - public: - float version; - PmdHeader header; - std::vector<PmdVertex> vertices; - std::vector<uint16_t> indices; - std::vector<PmdMaterial> materials; - std::vector<PmdBone> bones; - std::vector<PmdIk> iks; - std::vector<PmdFace> faces; - std::vector<uint16_t> faces_indices; - std::vector<PmdBoneDispName> bone_disp_name; - std::vector<PmdBoneDisp> bone_disp; - std::vector<std::string> toon_filenames; - std::vector<PmdRigidBody> rigid_bodies; - std::vector<PmdConstraint> constraints; - - static std::unique_ptr<PmdModel> LoadFromFile(const char *filename) - { - std::ifstream stream(filename, std::ios::binary); - if (stream.fail()) - { - std::cerr << "could not open \"" << filename << "\"" << std::endl; - return nullptr; - } - auto result = LoadFromStream(&stream); - stream.close(); - return result; - } - - static std::unique_ptr<PmdModel> LoadFromStream(std::ifstream *stream) - { - auto result = mmd::make_unique<PmdModel>(); - char buffer[100]; - - // magic - char magic[3]; - stream->read(magic, 3); - if (magic[0] != 'P' || magic[1] != 'm' || magic[2] != 'd') - { - std::cerr << "invalid file" << std::endl; - return nullptr; - } - - // version - stream->read((char*) &(result->version), sizeof(float)); - if (result ->version != 1.0f) - { - std::cerr << "invalid version" << std::endl; - return nullptr; - } - - // header - result->header.Read(stream); - - // vertices - uint32_t vertex_num; - stream->read((char*) &vertex_num, sizeof(uint32_t)); - result->vertices.resize(vertex_num); - for (uint32_t i = 0; i < vertex_num; i++) - { - result->vertices[i].Read(stream); - } - - // indices - uint32_t index_num; - stream->read((char*) &index_num, sizeof(uint32_t)); - result->indices.resize(index_num); - for (uint32_t i = 0; i < index_num; i++) - { - stream->read((char*) &result->indices[i], sizeof(uint16_t)); - } - - // materials - uint32_t material_num; - stream->read((char*) &material_num, sizeof(uint32_t)); - result->materials.resize(material_num); - for (uint32_t i = 0; i < material_num; i++) - { - result->materials[i].Read(stream); - } - - // bones - uint16_t bone_num; - stream->read((char*) &bone_num, sizeof(uint16_t)); - result->bones.resize(bone_num); - for (uint32_t i = 0; i < bone_num; i++) - { - result->bones[i].Read(stream); - } - - // iks - uint16_t ik_num; - stream->read((char*) &ik_num, sizeof(uint16_t)); - result->iks.resize(ik_num); - for (uint32_t i = 0; i < ik_num; i++) - { - result->iks[i].Read(stream); - } - - // faces - uint16_t face_num; - stream->read((char*) &face_num, sizeof(uint16_t)); - result->faces.resize(face_num); - for (uint32_t i = 0; i < face_num; i++) - { - result->faces[i].Read(stream); - } - - // face frames - uint8_t face_frame_num; - stream->read((char*) &face_frame_num, sizeof(uint8_t)); - result->faces_indices.resize(face_frame_num); - for (uint32_t i = 0; i < face_frame_num; i++) - { - stream->read((char*) &result->faces_indices[i], sizeof(uint16_t)); - } - - // bone names - uint8_t bone_disp_num; - stream->read((char*) &bone_disp_num, sizeof(uint8_t)); - result->bone_disp_name.resize(bone_disp_num); - for (uint32_t i = 0; i < bone_disp_num; i++) - { - result->bone_disp_name[i].Read(stream); - } - - // bone frame - uint32_t bone_frame_num; - stream->read((char*) &bone_frame_num, sizeof(uint32_t)); - result->bone_disp.resize(bone_frame_num); - for (uint32_t i = 0; i < bone_frame_num; i++) - { - result->bone_disp[i].Read(stream); - } - - // english name - bool english; - stream->read((char*) &english, sizeof(char)); - if (english) - { - result->header.ReadExtension(stream); - for (uint32_t i = 0; i < bone_num; i++) - { - result->bones[i].ReadExpantion(stream); - } - for (uint32_t i = 0; i < face_num; i++) - { - if (result->faces[i].type == pmd::FaceCategory::Base) - { - continue; - } - result->faces[i].ReadExpantion(stream); - } - for (uint32_t i = 0; i < result->bone_disp_name.size(); i++) - { - result->bone_disp_name[i].ReadExpantion(stream); - } - } - - // toon textures - if (stream->peek() == std::ios::traits_type::eof()) - { - result->toon_filenames.clear(); - } - else { - result->toon_filenames.resize(10); - for (uint32_t i = 0; i < 10; i++) - { - stream->read(buffer, 100); - result->toon_filenames[i] = std::string(buffer); - } - } - - // physics - if (stream->peek() == std::ios::traits_type::eof()) - { - result->rigid_bodies.clear(); - result->constraints.clear(); - } - else { - uint32_t rigid_body_num; - stream->read((char*) &rigid_body_num, sizeof(uint32_t)); - result->rigid_bodies.resize(rigid_body_num); - for (uint32_t i = 0; i < rigid_body_num; i++) - { - result->rigid_bodies[i].Read(stream); - } - uint32_t constraint_num; - stream->read((char*) &constraint_num, sizeof(uint32_t)); - result->constraints.resize(constraint_num); - for (uint32_t i = 0; i < constraint_num; i++) - { - result->constraints[i].Read(stream); - } - } - - if (stream->peek() != std::ios::traits_type::eof()) - { - std::cerr << "there is unknown data" << std::endl; - } - - return result; - } - }; -} diff --git a/thirdparty/assimp/code/MMD/MMDPmxParser.cpp b/thirdparty/assimp/code/MMD/MMDPmxParser.cpp deleted file mode 100644 index 80f0986dd7..0000000000 --- a/thirdparty/assimp/code/MMD/MMDPmxParser.cpp +++ /dev/null @@ -1,608 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above -copyright notice, this list of conditions and the -following disclaimer. - -* Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other -materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its -contributors may be used to endorse or promote products -derived from this software without specific prior -written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ -#include <utility> -#include "MMDPmxParser.h" -#include <assimp/StringUtils.h> -#ifdef ASSIMP_USE_HUNTER -# include <utf8/utf8.h> -#else -# include "../contrib/utf8cpp/source/utf8.h" -#endif -#include <assimp/Exceptional.h> - -namespace pmx -{ - int ReadIndex(std::istream *stream, int size) - { - switch (size) - { - case 1: - uint8_t tmp8; - stream->read((char*) &tmp8, sizeof(uint8_t)); - if (255 == tmp8) - { - return -1; - } - else { - return (int) tmp8; - } - case 2: - uint16_t tmp16; - stream->read((char*) &tmp16, sizeof(uint16_t)); - if (65535 == tmp16) - { - return -1; - } - else { - return (int) tmp16; - } - case 4: - int tmp32; - stream->read((char*) &tmp32, sizeof(int)); - return tmp32; - default: - return -1; - } - } - - std::string ReadString(std::istream *stream, uint8_t encoding) - { - int size; - stream->read((char*) &size, sizeof(int)); - std::vector<char> buffer; - if (size == 0) - { - return std::string(""); - } - buffer.reserve(size); - stream->read((char*) buffer.data(), size); - if (encoding == 0) - { - // UTF16 to UTF8 - const uint16_t* sourceStart = (uint16_t*)buffer.data(); - const unsigned int targetSize = size * 3; // enough to encode - char *targetStart = new char[targetSize]; - std::memset(targetStart, 0, targetSize * sizeof(char)); - - utf8::utf16to8( sourceStart, sourceStart + size/2, targetStart ); - - std::string result(targetStart); - delete [] targetStart; - return result; - } - else - { - // the name is already UTF8 - return std::string((const char*)buffer.data(), size); - } - } - - void PmxSetting::Read(std::istream *stream) - { - uint8_t count; - stream->read((char*) &count, sizeof(uint8_t)); - if (count < 8) - { - throw DeadlyImportError("MMD: invalid size"); - } - stream->read((char*) &encoding, sizeof(uint8_t)); - stream->read((char*) &uv, sizeof(uint8_t)); - stream->read((char*) &vertex_index_size, sizeof(uint8_t)); - stream->read((char*) &texture_index_size, sizeof(uint8_t)); - stream->read((char*) &material_index_size, sizeof(uint8_t)); - stream->read((char*) &bone_index_size, sizeof(uint8_t)); - stream->read((char*) &morph_index_size, sizeof(uint8_t)); - stream->read((char*) &rigidbody_index_size, sizeof(uint8_t)); - uint8_t temp; - for (int i = 8; i < count; i++) - { - stream->read((char*)&temp, sizeof(uint8_t)); - } - } - - void PmxVertexSkinningBDEF1::Read(std::istream *stream, PmxSetting *setting) - { - this->bone_index = ReadIndex(stream, setting->bone_index_size); - } - - void PmxVertexSkinningBDEF2::Read(std::istream *stream, PmxSetting *setting) - { - this->bone_index1 = ReadIndex(stream, setting->bone_index_size); - this->bone_index2 = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &this->bone_weight, sizeof(float)); - } - - void PmxVertexSkinningBDEF4::Read(std::istream *stream, PmxSetting *setting) - { - this->bone_index1 = ReadIndex(stream, setting->bone_index_size); - this->bone_index2 = ReadIndex(stream, setting->bone_index_size); - this->bone_index3 = ReadIndex(stream, setting->bone_index_size); - this->bone_index4 = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &this->bone_weight1, sizeof(float)); - stream->read((char*) &this->bone_weight2, sizeof(float)); - stream->read((char*) &this->bone_weight3, sizeof(float)); - stream->read((char*) &this->bone_weight4, sizeof(float)); - } - - void PmxVertexSkinningSDEF::Read(std::istream *stream, PmxSetting *setting) - { - this->bone_index1 = ReadIndex(stream, setting->bone_index_size); - this->bone_index2 = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &this->bone_weight, sizeof(float)); - stream->read((char*) this->sdef_c, sizeof(float) * 3); - stream->read((char*) this->sdef_r0, sizeof(float) * 3); - stream->read((char*) this->sdef_r1, sizeof(float) * 3); - } - - void PmxVertexSkinningQDEF::Read(std::istream *stream, PmxSetting *setting) - { - this->bone_index1 = ReadIndex(stream, setting->bone_index_size); - this->bone_index2 = ReadIndex(stream, setting->bone_index_size); - this->bone_index3 = ReadIndex(stream, setting->bone_index_size); - this->bone_index4 = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &this->bone_weight1, sizeof(float)); - stream->read((char*) &this->bone_weight2, sizeof(float)); - stream->read((char*) &this->bone_weight3, sizeof(float)); - stream->read((char*) &this->bone_weight4, sizeof(float)); - } - - void PmxVertex::Read(std::istream *stream, PmxSetting *setting) - { - stream->read((char*) this->position, sizeof(float) * 3); - stream->read((char*) this->normal, sizeof(float) * 3); - stream->read((char*) this->uv, sizeof(float) * 2); - for (int i = 0; i < setting->uv; ++i) - { - stream->read((char*) this->uva[i], sizeof(float) * 4); - } - stream->read((char*) &this->skinning_type, sizeof(PmxVertexSkinningType)); - switch (this->skinning_type) - { - case PmxVertexSkinningType::BDEF1: - this->skinning = mmd::make_unique<PmxVertexSkinningBDEF1>(); - break; - case PmxVertexSkinningType::BDEF2: - this->skinning = mmd::make_unique<PmxVertexSkinningBDEF2>(); - break; - case PmxVertexSkinningType::BDEF4: - this->skinning = mmd::make_unique<PmxVertexSkinningBDEF4>(); - break; - case PmxVertexSkinningType::SDEF: - this->skinning = mmd::make_unique<PmxVertexSkinningSDEF>(); - break; - case PmxVertexSkinningType::QDEF: - this->skinning = mmd::make_unique<PmxVertexSkinningQDEF>(); - break; - default: - throw "invalid skinning type"; - } - this->skinning->Read(stream, setting); - stream->read((char*) &this->edge, sizeof(float)); - } - - void PmxMaterial::Read(std::istream *stream, PmxSetting *setting) - { - this->material_name = ReadString(stream, setting->encoding); - this->material_english_name = ReadString(stream, setting->encoding); - stream->read((char*) this->diffuse, sizeof(float) * 4); - stream->read((char*) this->specular, sizeof(float) * 3); - stream->read((char*) &this->specularlity, sizeof(float)); - stream->read((char*) this->ambient, sizeof(float) * 3); - stream->read((char*) &this->flag, sizeof(uint8_t)); - stream->read((char*) this->edge_color, sizeof(float) * 4); - stream->read((char*) &this->edge_size, sizeof(float)); - this->diffuse_texture_index = ReadIndex(stream, setting->texture_index_size); - this->sphere_texture_index = ReadIndex(stream, setting->texture_index_size); - stream->read((char*) &this->sphere_op_mode, sizeof(uint8_t)); - stream->read((char*) &this->common_toon_flag, sizeof(uint8_t)); - if (this->common_toon_flag) - { - stream->read((char*) &this->toon_texture_index, sizeof(uint8_t)); - } - else { - this->toon_texture_index = ReadIndex(stream, setting->texture_index_size); - } - this->memo = ReadString(stream, setting->encoding); - stream->read((char*) &this->index_count, sizeof(int)); - } - - void PmxIkLink::Read(std::istream *stream, PmxSetting *setting) - { - this->link_target = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &this->angle_lock, sizeof(uint8_t)); - if (angle_lock == 1) - { - stream->read((char*) this->max_radian, sizeof(float) * 3); - stream->read((char*) this->min_radian, sizeof(float) * 3); - } - } - - void PmxBone::Read(std::istream *stream, PmxSetting *setting) - { - this->bone_name = ReadString(stream, setting->encoding); - this->bone_english_name = ReadString(stream, setting->encoding); - stream->read((char*) this->position, sizeof(float) * 3); - this->parent_index = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &this->level, sizeof(int)); - stream->read((char*) &this->bone_flag, sizeof(uint16_t)); - if (this->bone_flag & 0x0001) { - this->target_index = ReadIndex(stream, setting->bone_index_size); - } - else { - stream->read((char*)this->offset, sizeof(float) * 3); - } - if (this->bone_flag & (0x0100 | 0x0200)) { - this->grant_parent_index = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &this->grant_weight, sizeof(float)); - } - if (this->bone_flag & 0x0400) { - stream->read((char*)this->lock_axis_orientation, sizeof(float) * 3); - } - if (this->bone_flag & 0x0800) { - stream->read((char*)this->local_axis_x_orientation, sizeof(float) * 3); - stream->read((char*)this->local_axis_y_orientation, sizeof(float) * 3); - } - if (this->bone_flag & 0x2000) { - stream->read((char*) &this->key, sizeof(int)); - } - if (this->bone_flag & 0x0020) { - this->ik_target_bone_index = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &ik_loop, sizeof(int)); - stream->read((char*) &ik_loop_angle_limit, sizeof(float)); - stream->read((char*) &ik_link_count, sizeof(int)); - this->ik_links = mmd::make_unique<PmxIkLink []>(ik_link_count); - for (int i = 0; i < ik_link_count; i++) { - ik_links[i].Read(stream, setting); - } - } - } - - void PmxMorphVertexOffset::Read(std::istream *stream, PmxSetting *setting) - { - this->vertex_index = ReadIndex(stream, setting->vertex_index_size); - stream->read((char*)this->position_offset, sizeof(float) * 3); - } - - void PmxMorphUVOffset::Read(std::istream *stream, PmxSetting *setting) - { - this->vertex_index = ReadIndex(stream, setting->vertex_index_size); - stream->read((char*)this->uv_offset, sizeof(float) * 4); - } - - void PmxMorphBoneOffset::Read(std::istream *stream, PmxSetting *setting) - { - this->bone_index = ReadIndex(stream, setting->bone_index_size); - stream->read((char*)this->translation, sizeof(float) * 3); - stream->read((char*)this->rotation, sizeof(float) * 4); - } - - void PmxMorphMaterialOffset::Read(std::istream *stream, PmxSetting *setting) - { - this->material_index = ReadIndex(stream, setting->material_index_size); - stream->read((char*) &this->offset_operation, sizeof(uint8_t)); - stream->read((char*)this->diffuse, sizeof(float) * 4); - stream->read((char*)this->specular, sizeof(float) * 3); - stream->read((char*) &this->specularity, sizeof(float)); - stream->read((char*)this->ambient, sizeof(float) * 3); - stream->read((char*)this->edge_color, sizeof(float) * 4); - stream->read((char*) &this->edge_size, sizeof(float)); - stream->read((char*)this->texture_argb, sizeof(float) * 4); - stream->read((char*)this->sphere_texture_argb, sizeof(float) * 4); - stream->read((char*)this->toon_texture_argb, sizeof(float) * 4); - } - - void PmxMorphGroupOffset::Read(std::istream *stream, PmxSetting *setting) - { - this->morph_index = ReadIndex(stream, setting->morph_index_size); - stream->read((char*) &this->morph_weight, sizeof(float)); - } - - void PmxMorphFlipOffset::Read(std::istream *stream, PmxSetting *setting) - { - this->morph_index = ReadIndex(stream, setting->morph_index_size); - stream->read((char*) &this->morph_value, sizeof(float)); - } - - void PmxMorphImplusOffset::Read(std::istream *stream, PmxSetting *setting) - { - this->rigid_body_index = ReadIndex(stream, setting->rigidbody_index_size); - stream->read((char*) &this->is_local, sizeof(uint8_t)); - stream->read((char*)this->velocity, sizeof(float) * 3); - stream->read((char*)this->angular_torque, sizeof(float) * 3); - } - - void PmxMorph::Read(std::istream *stream, PmxSetting *setting) - { - this->morph_name = ReadString(stream, setting->encoding); - this->morph_english_name = ReadString(stream, setting->encoding); - stream->read((char*) &category, sizeof(MorphCategory)); - stream->read((char*) &morph_type, sizeof(MorphType)); - stream->read((char*) &this->offset_count, sizeof(int)); - switch (this->morph_type) - { - case MorphType::Group: - group_offsets = mmd::make_unique<PmxMorphGroupOffset []>(this->offset_count); - for (int i = 0; i < offset_count; i++) - { - group_offsets[i].Read(stream, setting); - } - break; - case MorphType::Vertex: - vertex_offsets = mmd::make_unique<PmxMorphVertexOffset []>(this->offset_count); - for (int i = 0; i < offset_count; i++) - { - vertex_offsets[i].Read(stream, setting); - } - break; - case MorphType::Bone: - bone_offsets = mmd::make_unique<PmxMorphBoneOffset []>(this->offset_count); - for (int i = 0; i < offset_count; i++) - { - bone_offsets[i].Read(stream, setting); - } - break; - case MorphType::Matrial: - material_offsets = mmd::make_unique<PmxMorphMaterialOffset []>(this->offset_count); - for (int i = 0; i < offset_count; i++) - { - material_offsets[i].Read(stream, setting); - } - break; - case MorphType::UV: - case MorphType::AdditionalUV1: - case MorphType::AdditionalUV2: - case MorphType::AdditionalUV3: - case MorphType::AdditionalUV4: - uv_offsets = mmd::make_unique<PmxMorphUVOffset []>(this->offset_count); - for (int i = 0; i < offset_count; i++) - { - uv_offsets[i].Read(stream, setting); - } - break; - default: - throw DeadlyImportError("MMD: unknown morth type"); - } - } - - void PmxFrameElement::Read(std::istream *stream, PmxSetting *setting) - { - stream->read((char*) &this->element_target, sizeof(uint8_t)); - if (this->element_target == 0x00) - { - this->index = ReadIndex(stream, setting->bone_index_size); - } - else { - this->index = ReadIndex(stream, setting->morph_index_size); - } - } - - void PmxFrame::Read(std::istream *stream, PmxSetting *setting) - { - this->frame_name = ReadString(stream, setting->encoding); - this->frame_english_name = ReadString(stream, setting->encoding); - stream->read((char*) &this->frame_flag, sizeof(uint8_t)); - stream->read((char*) &this->element_count, sizeof(int)); - this->elements = mmd::make_unique<PmxFrameElement []>(this->element_count); - for (int i = 0; i < this->element_count; i++) - { - this->elements[i].Read(stream, setting); - } - } - - void PmxRigidBody::Read(std::istream *stream, PmxSetting *setting) - { - this->girid_body_name = ReadString(stream, setting->encoding); - this->girid_body_english_name = ReadString(stream, setting->encoding); - this->target_bone = ReadIndex(stream, setting->bone_index_size); - stream->read((char*) &this->group, sizeof(uint8_t)); - stream->read((char*) &this->mask, sizeof(uint16_t)); - stream->read((char*) &this->shape, sizeof(uint8_t)); - stream->read((char*) this->size, sizeof(float) * 3); - stream->read((char*) this->position, sizeof(float) * 3); - stream->read((char*) this->orientation, sizeof(float) * 3); - stream->read((char*) &this->mass, sizeof(float)); - stream->read((char*) &this->move_attenuation, sizeof(float)); - stream->read((char*) &this->rotation_attenuation, sizeof(float)); - stream->read((char*) &this->repulsion, sizeof(float)); - stream->read((char*) &this->friction, sizeof(float)); - stream->read((char*) &this->physics_calc_type, sizeof(uint8_t)); - } - - void PmxJointParam::Read(std::istream *stream, PmxSetting *setting) - { - this->rigid_body1 = ReadIndex(stream, setting->rigidbody_index_size); - this->rigid_body2 = ReadIndex(stream, setting->rigidbody_index_size); - stream->read((char*) this->position, sizeof(float) * 3); - stream->read((char*) this->orientaiton, sizeof(float) * 3); - stream->read((char*) this->move_limitation_min, sizeof(float) * 3); - stream->read((char*) this->move_limitation_max, sizeof(float) * 3); - stream->read((char*) this->rotation_limitation_min, sizeof(float) * 3); - stream->read((char*) this->rotation_limitation_max, sizeof(float) * 3); - stream->read((char*) this->spring_move_coefficient, sizeof(float) * 3); - stream->read((char*) this->spring_rotation_coefficient, sizeof(float) * 3); - } - - void PmxJoint::Read(std::istream *stream, PmxSetting *setting) - { - this->joint_name = ReadString(stream, setting->encoding); - this->joint_english_name = ReadString(stream, setting->encoding); - stream->read((char*) &this->joint_type, sizeof(uint8_t)); - this->param.Read(stream, setting); - } - - void PmxAncherRigidBody::Read(std::istream *stream, PmxSetting *setting) - { - this->related_rigid_body = ReadIndex(stream, setting->rigidbody_index_size); - this->related_vertex = ReadIndex(stream, setting->vertex_index_size); - stream->read((char*) &this->is_near, sizeof(uint8_t)); - } - - void PmxSoftBody::Read(std::istream * /*stream*/, PmxSetting * /*setting*/) - { - std::cerr << "Not Implemented Exception" << std::endl; - throw DeadlyImportError("MMD: Not Implemented Exception"); - } - - void PmxModel::Init() - { - this->version = 0.0f; - this->model_name.clear(); - this->model_english_name.clear(); - this->model_comment.clear(); - this->model_english_comment.clear(); - this->vertex_count = 0; - this->vertices = nullptr; - this->index_count = 0; - this->indices = nullptr; - this->texture_count = 0; - this->textures = nullptr; - this->material_count = 0; - this->materials = nullptr; - this->bone_count = 0; - this->bones = nullptr; - this->morph_count = 0; - this->morphs = nullptr; - this->frame_count = 0; - this->frames = nullptr; - this->rigid_body_count = 0; - this->rigid_bodies = nullptr; - this->joint_count = 0; - this->joints = nullptr; - this->soft_body_count = 0; - this->soft_bodies = nullptr; - } - - void PmxModel::Read(std::istream *stream) - { - char magic[4]; - stream->read((char*) magic, sizeof(char) * 4); - if (magic[0] != 0x50 || magic[1] != 0x4d || magic[2] != 0x58 || magic[3] != 0x20) - { - std::cerr << "invalid magic number." << std::endl; - throw DeadlyImportError("MMD: invalid magic number."); - } - stream->read((char*) &version, sizeof(float)); - if (version != 2.0f && version != 2.1f) - { - std::cerr << "this is not ver2.0 or ver2.1 but " << version << "." << std::endl; - throw DeadlyImportError("MMD: this is not ver2.0 or ver2.1 but " + to_string(version)); - } - this->setting.Read(stream); - - this->model_name = ReadString(stream, setting.encoding); - this->model_english_name = ReadString(stream, setting.encoding); - this->model_comment = ReadString(stream, setting.encoding); - this->model_english_comment = ReadString(stream, setting.encoding); - - // read vertices - stream->read((char*) &vertex_count, sizeof(int)); - this->vertices = mmd::make_unique<PmxVertex []>(vertex_count); - for (int i = 0; i < vertex_count; i++) - { - vertices[i].Read(stream, &setting); - } - - // read indices - stream->read((char*) &index_count, sizeof(int)); - this->indices = mmd::make_unique<int []>(index_count); - for (int i = 0; i < index_count; i++) - { - this->indices[i] = ReadIndex(stream, setting.vertex_index_size); - } - - // read texture names - stream->read((char*) &texture_count, sizeof(int)); - this->textures = mmd::make_unique<std::string []>(texture_count); - for (int i = 0; i < texture_count; i++) - { - this->textures[i] = ReadString(stream, setting.encoding); - } - - // read materials - stream->read((char*) &material_count, sizeof(int)); - this->materials = mmd::make_unique<PmxMaterial []>(material_count); - for (int i = 0; i < material_count; i++) - { - this->materials[i].Read(stream, &setting); - } - - // read bones - stream->read((char*) &this->bone_count, sizeof(int)); - this->bones = mmd::make_unique<PmxBone []>(this->bone_count); - for (int i = 0; i < this->bone_count; i++) - { - this->bones[i].Read(stream, &setting); - } - - // read morphs - stream->read((char*) &this->morph_count, sizeof(int)); - this->morphs = mmd::make_unique<PmxMorph []>(this->morph_count); - for (int i = 0; i < this->morph_count; i++) - { - this->morphs[i].Read(stream, &setting); - } - - // read display frames - stream->read((char*) &this->frame_count, sizeof(int)); - this->frames = mmd::make_unique<PmxFrame []>(this->frame_count); - for (int i = 0; i < this->frame_count; i++) - { - this->frames[i].Read(stream, &setting); - } - - // read rigid bodies - stream->read((char*) &this->rigid_body_count, sizeof(int)); - this->rigid_bodies = mmd::make_unique<PmxRigidBody []>(this->rigid_body_count); - for (int i = 0; i < this->rigid_body_count; i++) - { - this->rigid_bodies[i].Read(stream, &setting); - } - - // read joints - stream->read((char*) &this->joint_count, sizeof(int)); - this->joints = mmd::make_unique<PmxJoint []>(this->joint_count); - for (int i = 0; i < this->joint_count; i++) - { - this->joints[i].Read(stream, &setting); - } - } -} diff --git a/thirdparty/assimp/code/MMD/MMDPmxParser.h b/thirdparty/assimp/code/MMD/MMDPmxParser.h deleted file mode 100644 index cf523a1298..0000000000 --- a/thirdparty/assimp/code/MMD/MMDPmxParser.h +++ /dev/null @@ -1,782 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above -copyright notice, this list of conditions and the -following disclaimer. - -* Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other -materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its -contributors may be used to endorse or promote products -derived from this software without specific prior -written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ -#pragma once - -#include <vector> -#include <string> -#include <iostream> -#include <fstream> -#include <memory> -#include "MMDCpp14.h" - -namespace pmx -{ - class PmxSetting - { - public: - PmxSetting() - : encoding(0) - , uv(0) - , vertex_index_size(0) - , texture_index_size(0) - , material_index_size(0) - , bone_index_size(0) - , morph_index_size(0) - , rigidbody_index_size(0) - {} - - uint8_t encoding; - uint8_t uv; - uint8_t vertex_index_size; - uint8_t texture_index_size; - uint8_t material_index_size; - uint8_t bone_index_size; - uint8_t morph_index_size; - uint8_t rigidbody_index_size; - void Read(std::istream *stream); - }; - - enum class PmxVertexSkinningType : uint8_t - { - BDEF1 = 0, - BDEF2 = 1, - BDEF4 = 2, - SDEF = 3, - QDEF = 4, - }; - - class PmxVertexSkinning - { - public: - virtual void Read(std::istream *stream, PmxSetting *setting) = 0; - virtual ~PmxVertexSkinning() {} - }; - - class PmxVertexSkinningBDEF1 : public PmxVertexSkinning - { - public: - PmxVertexSkinningBDEF1() - : bone_index(0) - {} - - int bone_index; - void Read(std::istream *stresam, PmxSetting *setting); - }; - - class PmxVertexSkinningBDEF2 : public PmxVertexSkinning - { - public: - PmxVertexSkinningBDEF2() - : bone_index1(0) - , bone_index2(0) - , bone_weight(0.0f) - {} - - int bone_index1; - int bone_index2; - float bone_weight; - void Read(std::istream *stresam, PmxSetting *setting); - }; - - class PmxVertexSkinningBDEF4 : public PmxVertexSkinning - { - public: - PmxVertexSkinningBDEF4() - : bone_index1(0) - , bone_index2(0) - , bone_index3(0) - , bone_index4(0) - , bone_weight1(0.0f) - , bone_weight2(0.0f) - , bone_weight3(0.0f) - , bone_weight4(0.0f) - {} - - int bone_index1; - int bone_index2; - int bone_index3; - int bone_index4; - float bone_weight1; - float bone_weight2; - float bone_weight3; - float bone_weight4; - void Read(std::istream *stresam, PmxSetting *setting); - }; - - class PmxVertexSkinningSDEF : public PmxVertexSkinning - { - public: - PmxVertexSkinningSDEF() - : bone_index1(0) - , bone_index2(0) - , bone_weight(0.0f) - { - for (int i = 0; i < 3; ++i) { - sdef_c[i] = 0.0f; - sdef_r0[i] = 0.0f; - sdef_r1[i] = 0.0f; - } - } - - int bone_index1; - int bone_index2; - float bone_weight; - float sdef_c[3]; - float sdef_r0[3]; - float sdef_r1[3]; - void Read(std::istream *stresam, PmxSetting *setting); - }; - - class PmxVertexSkinningQDEF : public PmxVertexSkinning - { - public: - PmxVertexSkinningQDEF() - : bone_index1(0) - , bone_index2(0) - , bone_index3(0) - , bone_index4(0) - , bone_weight1(0.0f) - , bone_weight2(0.0f) - , bone_weight3(0.0f) - , bone_weight4(0.0f) - {} - - int bone_index1; - int bone_index2; - int bone_index3; - int bone_index4; - float bone_weight1; - float bone_weight2; - float bone_weight3; - float bone_weight4; - void Read(std::istream *stresam, PmxSetting *setting); - }; - - class PmxVertex - { - public: - PmxVertex() - : edge(0.0f) - { - uv[0] = uv[1] = 0.0f; - for (int i = 0; i < 3; ++i) { - position[i] = 0.0f; - normal[i] = 0.0f; - } - for (int i = 0; i < 4; ++i) { - for (int k = 0; k < 4; ++k) { - uva[i][k] = 0.0f; - } - } - } - - float position[3]; - float normal[3]; - float uv[2]; - float uva[4][4]; - PmxVertexSkinningType skinning_type; - std::unique_ptr<PmxVertexSkinning> skinning; - float edge; - void Read(std::istream *stream, PmxSetting *setting); - }; - - class PmxMaterial - { - public: - PmxMaterial() - : specularlity(0.0f) - , flag(0) - , edge_size(0.0f) - , diffuse_texture_index(0) - , sphere_texture_index(0) - , sphere_op_mode(0) - , common_toon_flag(0) - , toon_texture_index(0) - , index_count(0) - { - for (int i = 0; i < 3; ++i) { - specular[i] = 0.0f; - ambient[i] = 0.0f; - edge_color[i] = 0.0f; - } - for (int i = 0; i < 4; ++i) { - diffuse[i] = 0.0f; - } - } - - std::string material_name; - std::string material_english_name; - float diffuse[4]; - float specular[3]; - float specularlity; - float ambient[3]; - uint8_t flag; - float edge_color[4]; - float edge_size; - int diffuse_texture_index; - int sphere_texture_index; - uint8_t sphere_op_mode; - uint8_t common_toon_flag; - int toon_texture_index; - std::string memo; - int index_count; - void Read(std::istream *stream, PmxSetting *setting); - }; - - class PmxIkLink - { - public: - PmxIkLink() - : link_target(0) - , angle_lock(0) - { - for (int i = 0; i < 3; ++i) { - max_radian[i] = 0.0f; - min_radian[i] = 0.0f; - } - } - - int link_target; - uint8_t angle_lock; - float max_radian[3]; - float min_radian[3]; - void Read(std::istream *stream, PmxSetting *settingn); - }; - - class PmxBone - { - public: - PmxBone() - : parent_index(0) - , level(0) - , bone_flag(0) - , target_index(0) - , grant_parent_index(0) - , grant_weight(0.0f) - , key(0) - , ik_target_bone_index(0) - , ik_loop(0) - , ik_loop_angle_limit(0.0f) - , ik_link_count(0) - { - for (int i = 0; i < 3; ++i) { - position[i] = 0.0f; - offset[i] = 0.0f; - lock_axis_orientation[i] = 0.0f; - local_axis_x_orientation[i] = 0.0f; - local_axis_y_orientation[i] = 0.0f; - } - } - - std::string bone_name; - std::string bone_english_name; - float position[3]; - int parent_index; - int level; - uint16_t bone_flag; - float offset[3]; - int target_index; - int grant_parent_index; - float grant_weight; - float lock_axis_orientation[3]; - float local_axis_x_orientation[3]; - float local_axis_y_orientation[3]; - int key; - int ik_target_bone_index; - int ik_loop; - float ik_loop_angle_limit; - int ik_link_count; - std::unique_ptr<PmxIkLink []> ik_links; - void Read(std::istream *stream, PmxSetting *setting); - }; - - enum class MorphType : uint8_t - { - Group = 0, - Vertex = 1, - Bone = 2, - UV = 3, - AdditionalUV1 = 4, - AdditionalUV2 = 5, - AdditionalUV3 = 6, - AdditionalUV4 = 7, - Matrial = 8, - Flip = 9, - Implus = 10, - }; - - enum class MorphCategory : uint8_t - { - ReservedCategory = 0, - Eyebrow = 1, - Eye = 2, - Mouth = 3, - Other = 4, - }; - - class PmxMorphOffset - { - public: - void virtual Read(std::istream *stream, PmxSetting *setting) = 0; - }; - - class PmxMorphVertexOffset : public PmxMorphOffset - { - public: - PmxMorphVertexOffset() - : vertex_index(0) - { - for (int i = 0; i < 3; ++i) { - position_offset[i] = 0.0f; - } - } - int vertex_index; - float position_offset[3]; - void Read(std::istream *stream, PmxSetting *setting); //override; - }; - - class PmxMorphUVOffset : public PmxMorphOffset - { - public: - PmxMorphUVOffset() - : vertex_index(0) - { - for (int i = 0; i < 4; ++i) { - uv_offset[i] = 0.0f; - } - } - int vertex_index; - float uv_offset[4]; - void Read(std::istream *stream, PmxSetting *setting); //override; - }; - - class PmxMorphBoneOffset : public PmxMorphOffset - { - public: - PmxMorphBoneOffset() - : bone_index(0) - { - for (int i = 0; i < 3; ++i) { - translation[i] = 0.0f; - } - for (int i = 0; i < 4; ++i) { - rotation[i] = 0.0f; - } - } - int bone_index; - float translation[3]; - float rotation[4]; - void Read(std::istream *stream, PmxSetting *setting); //override; - }; - - class PmxMorphMaterialOffset : public PmxMorphOffset - { - public: - PmxMorphMaterialOffset() - : specularity(0.0f) - , edge_size(0.0f) - { - for (int i = 0; i < 3; ++i) { - specular[i] = 0.0f; - ambient[i] = 0.0f; - } - for (int i = 0; i < 4; ++i) { - diffuse[i] = 0.0f; - edge_color[i] = 0.0f; - texture_argb[i] = 0.0f; - sphere_texture_argb[i] = 0.0f; - toon_texture_argb[i] = 0.0f; - } - } - int material_index; - uint8_t offset_operation; - float diffuse[4]; - float specular[3]; - float specularity; - float ambient[3]; - float edge_color[4]; - float edge_size; - float texture_argb[4]; - float sphere_texture_argb[4]; - float toon_texture_argb[4]; - void Read(std::istream *stream, PmxSetting *setting); //override; - }; - - class PmxMorphGroupOffset : public PmxMorphOffset - { - public: - PmxMorphGroupOffset() - : morph_index(0) - , morph_weight(0.0f) - {} - int morph_index; - float morph_weight; - void Read(std::istream *stream, PmxSetting *setting); //override; - }; - - class PmxMorphFlipOffset : public PmxMorphOffset - { - public: - PmxMorphFlipOffset() - : morph_index(0) - , morph_value(0.0f) - {} - int morph_index; - float morph_value; - void Read(std::istream *stream, PmxSetting *setting); //override; - }; - - class PmxMorphImplusOffset : public PmxMorphOffset - { - public: - PmxMorphImplusOffset() - : rigid_body_index(0) - , is_local(0) - { - for (int i = 0; i < 3; ++i) { - velocity[i] = 0.0f; - angular_torque[i] = 0.0f; - } - } - int rigid_body_index; - uint8_t is_local; - float velocity[3]; - float angular_torque[3]; - void Read(std::istream *stream, PmxSetting *setting); //override; - }; - - class PmxMorph - { - public: - PmxMorph() - : offset_count(0) - { - } - std::string morph_name; - std::string morph_english_name; - MorphCategory category; - MorphType morph_type; - int offset_count; - std::unique_ptr<PmxMorphVertexOffset []> vertex_offsets; - std::unique_ptr<PmxMorphUVOffset []> uv_offsets; - std::unique_ptr<PmxMorphBoneOffset []> bone_offsets; - std::unique_ptr<PmxMorphMaterialOffset []> material_offsets; - std::unique_ptr<PmxMorphGroupOffset []> group_offsets; - std::unique_ptr<PmxMorphFlipOffset []> flip_offsets; - std::unique_ptr<PmxMorphImplusOffset []> implus_offsets; - void Read(std::istream *stream, PmxSetting *setting); - }; - - class PmxFrameElement - { - public: - PmxFrameElement() - : element_target(0) - , index(0) - { - } - uint8_t element_target; - int index; - void Read(std::istream *stream, PmxSetting *setting); - }; - - class PmxFrame - { - public: - PmxFrame() - : frame_flag(0) - , element_count(0) - { - } - std::string frame_name; - std::string frame_english_name; - uint8_t frame_flag; - int element_count; - std::unique_ptr<PmxFrameElement []> elements; - void Read(std::istream *stream, PmxSetting *setting); - }; - - class PmxRigidBody - { - public: - PmxRigidBody() - : target_bone(0) - , group(0) - , mask(0) - , shape(0) - , mass(0.0f) - , move_attenuation(0.0f) - , rotation_attenuation(0.0f) - , repulsion(0.0f) - , friction(0.0f) - , physics_calc_type(0) - { - for (int i = 0; i < 3; ++i) { - size[i] = 0.0f; - position[i] = 0.0f; - orientation[i] = 0.0f; - } - } - std::string girid_body_name; - std::string girid_body_english_name; - int target_bone; - uint8_t group; - uint16_t mask; - uint8_t shape; - float size[3]; - float position[3]; - float orientation[3]; - float mass; - float move_attenuation; - float rotation_attenuation; - float repulsion; - float friction; - uint8_t physics_calc_type; - void Read(std::istream *stream, PmxSetting *setting); - }; - - enum class PmxJointType : uint8_t - { - Generic6DofSpring = 0, - Generic6Dof = 1, - Point2Point = 2, - ConeTwist = 3, - Slider = 5, - Hinge = 6 - }; - - class PmxJointParam - { - public: - PmxJointParam() - : rigid_body1(0) - , rigid_body2(0) - { - for (int i = 0; i < 3; ++i) { - position[i] = 0.0f; - orientaiton[i] = 0.0f; - move_limitation_min[i] = 0.0f; - move_limitation_max[i] = 0.0f; - rotation_limitation_min[i] = 0.0f; - rotation_limitation_max[i] = 0.0f; - spring_move_coefficient[i] = 0.0f; - spring_rotation_coefficient[i] = 0.0f; - } - } - int rigid_body1; - int rigid_body2; - float position[3]; - float orientaiton[3]; - float move_limitation_min[3]; - float move_limitation_max[3]; - float rotation_limitation_min[3]; - float rotation_limitation_max[3]; - float spring_move_coefficient[3]; - float spring_rotation_coefficient[3]; - void Read(std::istream *stream, PmxSetting *setting); - }; - - class PmxJoint - { - public: - std::string joint_name; - std::string joint_english_name; - PmxJointType joint_type; - PmxJointParam param; - void Read(std::istream *stream, PmxSetting *setting); - }; - - enum PmxSoftBodyFlag : uint8_t - { - BLink = 0x01, - Cluster = 0x02, - Link = 0x04 - }; - - class PmxAncherRigidBody - { - public: - PmxAncherRigidBody() - : related_rigid_body(0) - , related_vertex(0) - , is_near(false) - {} - int related_rigid_body; - int related_vertex; - bool is_near; - void Read(std::istream *stream, PmxSetting *setting); - }; - - class PmxSoftBody - { - public: - PmxSoftBody() - : shape(0) - , target_material(0) - , group(0) - , mask(0) - , blink_distance(0) - , cluster_count(0) - , mass(0.0) - , collisioni_margin(0.0) - , aero_model(0) - , VCF(0.0f) - , DP(0.0f) - , DG(0.0f) - , LF(0.0f) - , PR(0.0f) - , VC(0.0f) - , DF(0.0f) - , MT(0.0f) - , CHR(0.0f) - , KHR(0.0f) - , SHR(0.0f) - , AHR(0.0f) - , SRHR_CL(0.0f) - , SKHR_CL(0.0f) - , SSHR_CL(0.0f) - , SR_SPLT_CL(0.0f) - , SK_SPLT_CL(0.0f) - , SS_SPLT_CL(0.0f) - , V_IT(0) - , P_IT(0) - , D_IT(0) - , C_IT(0) - , LST(0.0f) - , AST(0.0f) - , VST(0.0f) - , anchor_count(0) - , pin_vertex_count(0) - {} - std::string soft_body_name; - std::string soft_body_english_name; - uint8_t shape; - int target_material; - uint8_t group; - uint16_t mask; - PmxSoftBodyFlag flag; - int blink_distance; - int cluster_count; - float mass; - float collisioni_margin; - int aero_model; - float VCF; - float DP; - float DG; - float LF; - float PR; - float VC; - float DF; - float MT; - float CHR; - float KHR; - float SHR; - float AHR; - float SRHR_CL; - float SKHR_CL; - float SSHR_CL; - float SR_SPLT_CL; - float SK_SPLT_CL; - float SS_SPLT_CL; - int V_IT; - int P_IT; - int D_IT; - int C_IT; - float LST; - float AST; - float VST; - int anchor_count; - std::unique_ptr<PmxAncherRigidBody []> anchers; - int pin_vertex_count; - std::unique_ptr<int []> pin_vertices; - void Read(std::istream *stream, PmxSetting *setting); - }; - - class PmxModel - { - public: - PmxModel() - : version(0.0f) - , vertex_count(0) - , index_count(0) - , texture_count(0) - , material_count(0) - , bone_count(0) - , morph_count(0) - , frame_count(0) - , rigid_body_count(0) - , joint_count(0) - , soft_body_count(0) - {} - - float version; - PmxSetting setting; - std::string model_name; - std::string model_english_name; - std::string model_comment; - std::string model_english_comment; - int vertex_count; - std::unique_ptr<PmxVertex []> vertices; - int index_count; - std::unique_ptr<int []> indices; - int texture_count; - std::unique_ptr< std::string []> textures; - int material_count; - std::unique_ptr<PmxMaterial []> materials; - int bone_count; - std::unique_ptr<PmxBone []> bones; - int morph_count; - std::unique_ptr<PmxMorph []> morphs; - int frame_count; - std::unique_ptr<PmxFrame [] > frames; - int rigid_body_count; - std::unique_ptr<PmxRigidBody []> rigid_bodies; - int joint_count; - std::unique_ptr<PmxJoint []> joints; - int soft_body_count; - std::unique_ptr<PmxSoftBody []> soft_bodies; - void Init(); - void Read(std::istream *stream); - //static std::unique_ptr<PmxModel> ReadFromFile(const char *filename); - //static std::unique_ptr<PmxModel> ReadFromStream(std::istream *stream); - }; -} diff --git a/thirdparty/assimp/code/MMD/MMDVmdParser.h b/thirdparty/assimp/code/MMD/MMDVmdParser.h deleted file mode 100644 index 947c3a2422..0000000000 --- a/thirdparty/assimp/code/MMD/MMDVmdParser.h +++ /dev/null @@ -1,376 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above -copyright notice, this list of conditions and the -following disclaimer. - -* Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other -materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its -contributors may be used to endorse or promote products -derived from this software without specific prior -written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ -#pragma once - -#include <vector> -#include <string> -#include <memory> -#include <iostream> -#include <fstream> -#include <ostream> -#include "MMDCpp14.h" - -namespace vmd -{ - class VmdBoneFrame - { - public: - std::string name; - int frame; - float position[3]; - float orientation[4]; - char interpolation[4][4][4]; - - void Read(std::istream* stream) - { - char buffer[15]; - stream->read((char*) buffer, sizeof(char)*15); - name = std::string(buffer); - stream->read((char*) &frame, sizeof(int)); - stream->read((char*) position, sizeof(float)*3); - stream->read((char*) orientation, sizeof(float)*4); - stream->read((char*) interpolation, sizeof(char) * 4 * 4 * 4); - } - - void Write(std::ostream* stream) - { - stream->write((char*)name.c_str(), sizeof(char) * 15); - stream->write((char*)&frame, sizeof(int)); - stream->write((char*)position, sizeof(float) * 3); - stream->write((char*)orientation, sizeof(float) * 4); - stream->write((char*)interpolation, sizeof(char) * 4 * 4 * 4); - } - }; - - class VmdFaceFrame - { - public: - std::string face_name; - float weight; - uint32_t frame; - - void Read(std::istream* stream) - { - char buffer[15]; - stream->read((char*) &buffer, sizeof(char) * 15); - face_name = std::string(buffer); - stream->read((char*) &frame, sizeof(int)); - stream->read((char*) &weight, sizeof(float)); - } - - void Write(std::ostream* stream) - { - stream->write((char*)face_name.c_str(), sizeof(char) * 15); - stream->write((char*)&frame, sizeof(int)); - stream->write((char*)&weight, sizeof(float)); - } - }; - - class VmdCameraFrame - { - public: - int frame; - float distance; - float position[3]; - float orientation[3]; - char interpolation[6][4]; - float angle; - char unknown[3]; - - void Read(std::istream *stream) - { - stream->read((char*) &frame, sizeof(int)); - stream->read((char*) &distance, sizeof(float)); - stream->read((char*) position, sizeof(float) * 3); - stream->read((char*) orientation, sizeof(float) * 3); - stream->read((char*) interpolation, sizeof(char) * 24); - stream->read((char*) &angle, sizeof(float)); - stream->read((char*) unknown, sizeof(char) * 3); - } - - void Write(std::ostream *stream) - { - stream->write((char*)&frame, sizeof(int)); - stream->write((char*)&distance, sizeof(float)); - stream->write((char*)position, sizeof(float) * 3); - stream->write((char*)orientation, sizeof(float) * 3); - stream->write((char*)interpolation, sizeof(char) * 24); - stream->write((char*)&angle, sizeof(float)); - stream->write((char*)unknown, sizeof(char) * 3); - } - }; - - class VmdLightFrame - { - public: - int frame; - float color[3]; - float position[3]; - - void Read(std::istream* stream) - { - stream->read((char*) &frame, sizeof(int)); - stream->read((char*) color, sizeof(float) * 3); - stream->read((char*) position, sizeof(float) * 3); - } - - void Write(std::ostream* stream) - { - stream->write((char*)&frame, sizeof(int)); - stream->write((char*)color, sizeof(float) * 3); - stream->write((char*)position, sizeof(float) * 3); - } - }; - - class VmdIkEnable - { - public: - std::string ik_name; - bool enable; - }; - - class VmdIkFrame - { - public: - int frame; - bool display; - std::vector<VmdIkEnable> ik_enable; - - void Read(std::istream *stream) - { - char buffer[20]; - stream->read((char*) &frame, sizeof(int)); - stream->read((char*) &display, sizeof(uint8_t)); - int ik_count; - stream->read((char*) &ik_count, sizeof(int)); - ik_enable.resize(ik_count); - for (int i = 0; i < ik_count; i++) - { - stream->read(buffer, 20); - ik_enable[i].ik_name = std::string(buffer); - stream->read((char*) &ik_enable[i].enable, sizeof(uint8_t)); - } - } - - void Write(std::ostream *stream) - { - stream->write((char*)&frame, sizeof(int)); - stream->write((char*)&display, sizeof(uint8_t)); - int ik_count = static_cast<int>(ik_enable.size()); - stream->write((char*)&ik_count, sizeof(int)); - for (int i = 0; i < ik_count; i++) - { - const VmdIkEnable& ik_enable = this->ik_enable.at(i); - stream->write(ik_enable.ik_name.c_str(), 20); - stream->write((char*)&ik_enable.enable, sizeof(uint8_t)); - } - } - }; - - class VmdMotion - { - public: - std::string model_name; - int version; - std::vector<VmdBoneFrame> bone_frames; - std::vector<VmdFaceFrame> face_frames; - std::vector<VmdCameraFrame> camera_frames; - std::vector<VmdLightFrame> light_frames; - std::vector<VmdIkFrame> ik_frames; - - static std::unique_ptr<VmdMotion> LoadFromFile(char const *filename) - { - std::ifstream stream(filename, std::ios::binary); - auto result = LoadFromStream(&stream); - stream.close(); - return result; - } - - static std::unique_ptr<VmdMotion> LoadFromStream(std::ifstream *stream) - { - - char buffer[30]; - auto result = mmd::make_unique<VmdMotion>(); - - // magic and version - stream->read((char*) buffer, 30); - if (strncmp(buffer, "Vocaloid Motion Data", 20)) - { - std::cerr << "invalid vmd file." << std::endl; - return nullptr; - } - result->version = std::atoi(buffer + 20); - - // name - stream->read(buffer, 20); - result->model_name = std::string(buffer); - - // bone frames - int bone_frame_num; - stream->read((char*) &bone_frame_num, sizeof(int)); - result->bone_frames.resize(bone_frame_num); - for (int i = 0; i < bone_frame_num; i++) - { - result->bone_frames[i].Read(stream); - } - - // face frames - int face_frame_num; - stream->read((char*) &face_frame_num, sizeof(int)); - result->face_frames.resize(face_frame_num); - for (int i = 0; i < face_frame_num; i++) - { - result->face_frames[i].Read(stream); - } - - // camera frames - int camera_frame_num; - stream->read((char*) &camera_frame_num, sizeof(int)); - result->camera_frames.resize(camera_frame_num); - for (int i = 0; i < camera_frame_num; i++) - { - result->camera_frames[i].Read(stream); - } - - // light frames - int light_frame_num; - stream->read((char*) &light_frame_num, sizeof(int)); - result->light_frames.resize(light_frame_num); - for (int i = 0; i < light_frame_num; i++) - { - result->light_frames[i].Read(stream); - } - - // unknown2 - stream->read(buffer, 4); - - // ik frames - if (stream->peek() != std::ios::traits_type::eof()) - { - int ik_num; - stream->read((char*) &ik_num, sizeof(int)); - result->ik_frames.resize(ik_num); - for (int i = 0; i < ik_num; i++) - { - result->ik_frames[i].Read(stream); - } - } - - if (stream->peek() != std::ios::traits_type::eof()) - { - std::cerr << "vmd stream has unknown data." << std::endl; - } - - return result; - } - - bool SaveToFile(const std::u16string& /*filename*/) - { - // TODO: How to adapt u16string to string? - /* - std::ofstream stream(filename.c_str(), std::ios::binary); - auto result = SaveToStream(&stream); - stream.close(); - return result; - */ - return false; - } - - bool SaveToStream(std::ofstream *stream) - { - std::string magic = "Vocaloid Motion Data 0002\0"; - magic.resize(30); - - // magic and version - stream->write(magic.c_str(), 30); - - // name - stream->write(model_name.c_str(), 20); - - // bone frames - const int bone_frame_num = static_cast<int>(bone_frames.size()); - stream->write(reinterpret_cast<const char*>(&bone_frame_num), sizeof(int)); - for (int i = 0; i < bone_frame_num; i++) - { - bone_frames[i].Write(stream); - } - - // face frames - const int face_frame_num = static_cast<int>(face_frames.size()); - stream->write(reinterpret_cast<const char*>(&face_frame_num), sizeof(int)); - for (int i = 0; i < face_frame_num; i++) - { - face_frames[i].Write(stream); - } - - // camera frames - const int camera_frame_num = static_cast<int>(camera_frames.size()); - stream->write(reinterpret_cast<const char*>(&camera_frame_num), sizeof(int)); - for (int i = 0; i < camera_frame_num; i++) - { - camera_frames[i].Write(stream); - } - - // light frames - const int light_frame_num = static_cast<int>(light_frames.size()); - stream->write(reinterpret_cast<const char*>(&light_frame_num), sizeof(int)); - for (int i = 0; i < light_frame_num; i++) - { - light_frames[i].Write(stream); - } - - // self shadow datas - const int self_shadow_num = 0; - stream->write(reinterpret_cast<const char*>(&self_shadow_num), sizeof(int)); - - // ik frames - const int ik_num = static_cast<int>(ik_frames.size()); - stream->write(reinterpret_cast<const char*>(&ik_num), sizeof(int)); - for (int i = 0; i < ik_num; i++) - { - ik_frames[i].Write(stream); - } - - return true; - } - }; -} diff --git a/thirdparty/assimp/code/Material/MaterialSystem.cpp b/thirdparty/assimp/code/Material/MaterialSystem.cpp index d0b39093b6..0be6e9f7bb 100644 --- a/thirdparty/assimp/code/Material/MaterialSystem.cpp +++ b/thirdparty/assimp/code/Material/MaterialSystem.cpp @@ -51,7 +51,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assimp/types.h> #include <assimp/material.h> #include <assimp/DefaultLogger.hpp> -#include <assimp/Macros.h> using namespace Assimp; @@ -545,23 +544,7 @@ aiReturn aiMaterial::AddProperty (const aiString* pInput, unsigned int type, unsigned int index) { - // We don't want to add the whole buffer .. write a 32 bit length - // prefix followed by the zero-terminated UTF8 string. - // (HACK) I don't want to break the ABI now, but we definitely - // ought to change aiString::mLength to uint32_t one day. - if (sizeof(size_t) == 8) { - aiString copy = *pInput; - uint32_t* s = reinterpret_cast<uint32_t*>(©.length); - s[1] = static_cast<uint32_t>(pInput->length); - - return AddBinaryProperty(s+1, - static_cast<unsigned int>(pInput->length+1+4), - pKey, - type, - index, - aiPTI_String); - } - ai_assert(sizeof(size_t)==4); + ai_assert(sizeof(ai_uint32)==4); return AddBinaryProperty(pInput, static_cast<unsigned int>(pInput->length+1+4), pKey, diff --git a/thirdparty/assimp/code/PostProcessing/ArmaturePopulate.cpp b/thirdparty/assimp/code/PostProcessing/ArmaturePopulate.cpp new file mode 100644 index 0000000000..75daeb6b59 --- /dev/null +++ b/thirdparty/assimp/code/PostProcessing/ArmaturePopulate.cpp @@ -0,0 +1,268 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, assimp team + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +#include "ArmaturePopulate.h" + +#include <assimp/BaseImporter.h> +#include <assimp/DefaultLogger.hpp> +#include <assimp/postprocess.h> +#include <assimp/scene.h> +#include <iostream> + +namespace Assimp { + +/// The default class constructor. +ArmaturePopulate::ArmaturePopulate() : BaseProcess() +{} + +/// The class destructor. +ArmaturePopulate::~ArmaturePopulate() +{} + +bool ArmaturePopulate::IsActive(unsigned int pFlags) const { + return (pFlags & aiProcess_PopulateArmatureData) != 0; +} + +void ArmaturePopulate::SetupProperties(const Importer *pImp) { + // do nothing +} + +void ArmaturePopulate::Execute(aiScene *out) { + + // Now convert all bone positions to the correct mOffsetMatrix + std::vector<aiBone *> bones; + std::vector<aiNode *> nodes; + std::map<aiBone *, aiNode *> bone_stack; + BuildBoneList(out->mRootNode, out->mRootNode, out, bones); + BuildNodeList(out->mRootNode, nodes); + + BuildBoneStack(out->mRootNode, out->mRootNode, out, bones, bone_stack, nodes); + + ASSIMP_LOG_DEBUG_F("Bone stack size: ", bone_stack.size()); + + for (std::pair<aiBone *, aiNode *> kvp : bone_stack) { + aiBone *bone = kvp.first; + aiNode *bone_node = kvp.second; + ASSIMP_LOG_DEBUG_F("active node lookup: ", bone->mName.C_Str()); + // lcl transform grab - done in generate_nodes :) + + // bone->mOffsetMatrix = bone_node->mTransformation; + aiNode *armature = GetArmatureRoot(bone_node, bones); + + ai_assert(armature); + + // set up bone armature id + bone->mArmature = armature; + + // set this bone node to be referenced properly + ai_assert(bone_node); + bone->mNode = bone_node; + } +} + + +/* Reprocess all nodes to calculate bone transforms properly based on the REAL + * mOffsetMatrix not the local. */ +/* Before this would use mesh transforms which is wrong for bone transforms */ +/* Before this would work for simple character skeletons but not complex meshes + * with multiple origins */ +/* Source: sketch fab log cutter fbx */ +void ArmaturePopulate::BuildBoneList(aiNode *current_node, + const aiNode *root_node, + const aiScene *scene, + std::vector<aiBone *> &bones) { + ai_assert(scene); + for (unsigned int nodeId = 0; nodeId < current_node->mNumChildren; ++nodeId) { + aiNode *child = current_node->mChildren[nodeId]; + ai_assert(child); + + // check for bones + for (unsigned int meshId = 0; meshId < child->mNumMeshes; ++meshId) { + ai_assert(child->mMeshes); + unsigned int mesh_index = child->mMeshes[meshId]; + aiMesh *mesh = scene->mMeshes[mesh_index]; + ai_assert(mesh); + + for (unsigned int boneId = 0; boneId < mesh->mNumBones; ++boneId) { + aiBone *bone = mesh->mBones[boneId]; + ai_assert(bone); + + // duplicate meshes exist with the same bones sometimes :) + // so this must be detected + if (std::find(bones.begin(), bones.end(), bone) == bones.end()) { + // add the element once + bones.push_back(bone); + } + } + + // find mesh and get bones + // then do recursive lookup for bones in root node hierarchy + } + + BuildBoneList(child, root_node, scene, bones); + } +} + +/* Prepare flat node list which can be used for non recursive lookups later */ +void ArmaturePopulate::BuildNodeList(const aiNode *current_node, + std::vector<aiNode *> &nodes) { + ai_assert(current_node); + + for (unsigned int nodeId = 0; nodeId < current_node->mNumChildren; ++nodeId) { + aiNode *child = current_node->mChildren[nodeId]; + ai_assert(child); + + nodes.push_back(child); + + BuildNodeList(child, nodes); + } +} + +/* A bone stack allows us to have multiple armatures, with the same bone names + * A bone stack allows us also to retrieve bones true transform even with + * duplicate names :) + */ +void ArmaturePopulate::BuildBoneStack(aiNode *current_node, + const aiNode *root_node, + const aiScene *scene, + const std::vector<aiBone *> &bones, + std::map<aiBone *, aiNode *> &bone_stack, + std::vector<aiNode *> &node_stack) { + ai_assert(scene); + ai_assert(root_node); + ai_assert(!node_stack.empty()); + + for (aiBone *bone : bones) { + ai_assert(bone); + aiNode *node = GetNodeFromStack(bone->mName, node_stack); + if (node == nullptr) { + node_stack.clear(); + BuildNodeList(root_node, node_stack); + ASSIMP_LOG_DEBUG_F("Resetting bone stack: nullptr element ", bone->mName.C_Str()); + + node = GetNodeFromStack(bone->mName, node_stack); + + if (!node) { + ASSIMP_LOG_ERROR("serious import issue node for bone was not detected"); + continue; + } + } + + ASSIMP_LOG_DEBUG_F("Successfully added bone[", bone->mName.C_Str(), "] to stack and bone node is: ", node->mName.C_Str()); + + bone_stack.insert(std::pair<aiBone *, aiNode *>(bone, node)); + } +} + + +/* Returns the armature root node */ +/* This is required to be detected for a bone initially, it will recurse up + * until it cannot find another bone and return the node No known failure + * points. (yet) + */ +aiNode *ArmaturePopulate::GetArmatureRoot(aiNode *bone_node, + std::vector<aiBone *> &bone_list) { + while (bone_node) { + if (!IsBoneNode(bone_node->mName, bone_list)) { + ASSIMP_LOG_DEBUG_F("GetArmatureRoot() Found valid armature: ", bone_node->mName.C_Str()); + return bone_node; + } + + bone_node = bone_node->mParent; + } + + ASSIMP_LOG_ERROR("GetArmatureRoot() can't find armature!"); + + return nullptr; +} + + + +/* Simple IsBoneNode check if this could be a bone */ +bool ArmaturePopulate::IsBoneNode(const aiString &bone_name, + std::vector<aiBone *> &bones) { + for (aiBone *bone : bones) { + if (bone->mName == bone_name) { + return true; + } + } + + return false; +} + +/* Pop this node by name from the stack if found */ +/* Used in multiple armature situations with duplicate node / bone names */ +/* Known flaw: cannot have nodes with bone names, will be fixed in later release + */ +/* (serious to be fixed) Known flaw: nodes which have more than one bone could + * be prematurely dropped from stack */ +aiNode *ArmaturePopulate::GetNodeFromStack(const aiString &node_name, + std::vector<aiNode *> &nodes) { + std::vector<aiNode *>::iterator iter; + aiNode *found = nullptr; + for (iter = nodes.begin(); iter < nodes.end(); ++iter) { + aiNode *element = *iter; + ai_assert(element); + // node valid and node name matches + if (element->mName == node_name) { + found = element; + break; + } + } + + if (found != nullptr) { + ASSIMP_LOG_INFO_F("Removed node from stack: ", found->mName.C_Str()); + // now pop the element from the node list + nodes.erase(iter); + + return found; + } + + // unique names can cause this problem + ASSIMP_LOG_ERROR("[Serious] GetNodeFromStack() can't find node from stack!"); + + return nullptr; +} + + + + +} // Namespace Assimp diff --git a/thirdparty/assimp/code/PostProcessing/ArmaturePopulate.h b/thirdparty/assimp/code/PostProcessing/ArmaturePopulate.h new file mode 100644 index 0000000000..aa1ad7c80c --- /dev/null +++ b/thirdparty/assimp/code/PostProcessing/ArmaturePopulate.h @@ -0,0 +1,112 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, assimp team + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +#ifndef ARMATURE_POPULATE_H_ +#define ARMATURE_POPULATE_H_ + +#include "Common/BaseProcess.h" +#include <assimp/BaseImporter.h> +#include <vector> +#include <map> + + +struct aiNode; +struct aiBone; + +namespace Assimp { + +// --------------------------------------------------------------------------- +/** Armature Populate: This is a post process designed + * To save you time when importing models into your game engines + * This was originally designed only for fbx but will work with other formats + * it is intended to auto populate aiBone data with armature and the aiNode + * This is very useful when dealing with skinned meshes + * or when dealing with many different skeletons + * It's off by default but recommend that you try it and use it + * It should reduce down any glue code you have in your + * importers + * You can contact RevoluPowered <gordon@gordonite.tech> + * For more info about this +*/ +class ASSIMP_API ArmaturePopulate : public BaseProcess { +public: + /// The default class constructor. + ArmaturePopulate(); + + /// The class destructor. + virtual ~ArmaturePopulate(); + + /// Overwritten, @see BaseProcess + virtual bool IsActive( unsigned int pFlags ) const; + + /// Overwritten, @see BaseProcess + virtual void SetupProperties( const Importer* pImp ); + + /// Overwritten, @see BaseProcess + virtual void Execute( aiScene* pScene ); + + static aiNode *GetArmatureRoot(aiNode *bone_node, + std::vector<aiBone *> &bone_list); + + static bool IsBoneNode(const aiString &bone_name, + std::vector<aiBone *> &bones); + + static aiNode *GetNodeFromStack(const aiString &node_name, + std::vector<aiNode *> &nodes); + + static void BuildNodeList(const aiNode *current_node, + std::vector<aiNode *> &nodes); + + static void BuildBoneList(aiNode *current_node, const aiNode *root_node, + const aiScene *scene, + std::vector<aiBone *> &bones); + + static void BuildBoneStack(aiNode *current_node, const aiNode *root_node, + const aiScene *scene, + const std::vector<aiBone *> &bones, + std::map<aiBone *, aiNode *> &bone_stack, + std::vector<aiNode *> &node_stack); +}; + +} // Namespace Assimp + + +#endif // SCALE_PROCESS_H_
\ No newline at end of file diff --git a/thirdparty/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp b/thirdparty/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp index bb571a551b..df4d44337d 100644 --- a/thirdparty/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp @@ -354,12 +354,12 @@ void ComputeUVMappingProcess::ComputePlaneMapping(aiMesh* mesh,const aiVector3D& } else if (axis * base_axis_z >= angle_epsilon) { FindMeshCenter(mesh, center, min, max); - diffu = max.y - min.y; - diffv = max.z - min.z; + diffu = max.x - min.x; + diffv = max.y - min.y; for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) { const aiVector3D& pos = mesh->mVertices[pnt]; - out[pnt].Set((pos.y - min.y) / diffu,(pos.x - min.x) / diffv,0.0); + out[pnt].Set((pos.x - min.x) / diffu,(pos.y - min.y) / diffv,0.0); } } // slower code path in case the mapping axis is not one of the coordinate system axes diff --git a/thirdparty/assimp/code/PostProcessing/FindInvalidDataProcess.cpp b/thirdparty/assimp/code/PostProcessing/FindInvalidDataProcess.cpp index 433f042448..016884c6e7 100644 --- a/thirdparty/assimp/code/PostProcessing/FindInvalidDataProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/FindInvalidDataProcess.cpp @@ -52,7 +52,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FindInvalidDataProcess.h" #include "ProcessHelper.h" -#include <assimp/Macros.h> #include <assimp/Exceptional.h> #include <assimp/qnan.h> diff --git a/thirdparty/assimp/code/PostProcessing/JoinVerticesProcess.cpp b/thirdparty/assimp/code/PostProcessing/JoinVerticesProcess.cpp index 914ec05b46..f121fc60d3 100644 --- a/thirdparty/assimp/code/PostProcessing/JoinVerticesProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/JoinVerticesProcess.cpp @@ -431,31 +431,6 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) bone->mWeights = new aiVertexWeight[bone->mNumWeights]; memcpy( bone->mWeights, &newWeights[0], bone->mNumWeights * sizeof( aiVertexWeight)); } - else { - - /* NOTE: - * - * In the algorithm above we're assuming that there are no vertices - * with a different bone weight setup at the same position. That wouldn't - * make sense, but it is not absolutely impossible. SkeletonMeshBuilder - * for example generates such input data if two skeleton points - * share the same position. Again this doesn't make sense but is - * reality for some model formats (MD5 for example uses these special - * nodes as attachment tags for its weapons). - * - * Then it is possible that a bone has no weights anymore .... as a quick - * workaround, we're just removing these bones. If they're animated, - * model geometry might be modified but at least there's no risk of a crash. - */ - delete bone; - --pMesh->mNumBones; - for (unsigned int n = a; n < pMesh->mNumBones; ++n) { - pMesh->mBones[n] = pMesh->mBones[n+1]; - } - - --a; - ASSIMP_LOG_WARN("Removing bone -> no weights remaining"); - } } return pMesh->mNumVertices; } diff --git a/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.cpp b/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.cpp index 50ff5ed93d..41f50a5ba5 100644 --- a/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.cpp +++ b/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.cpp @@ -224,3 +224,32 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh) } return (pcMesh->mNumVertices != iOldNumVertices); } + + +// ------------------------------------------------------------------------------------------------ +bool IsMeshInVerboseFormat(const aiMesh* mesh) { + // avoid slow vector<bool> specialization + std::vector<unsigned int> seen(mesh->mNumVertices,0); + for(unsigned int i = 0; i < mesh->mNumFaces; ++i) { + const aiFace& f = mesh->mFaces[i]; + for(unsigned int j = 0; j < f.mNumIndices; ++j) { + if(++seen[f.mIndices[j]] == 2) { + // found a duplicate index + return false; + } + } + } + + return true; +} + +// ------------------------------------------------------------------------------------------------ +bool MakeVerboseFormatProcess::IsVerboseFormat(const aiScene* pScene) { + for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) { + if(!IsMeshInVerboseFormat(pScene->mMeshes[i])) { + return false; + } + } + + return true; +} diff --git a/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.h b/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.h index 1adf8e2f69..8565d5933a 100644 --- a/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.h +++ b/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.h @@ -94,6 +94,13 @@ public: * @param pScene The imported data to work at. */ void Execute( aiScene* pScene); +public: + + // ------------------------------------------------------------------- + /** Checks whether the scene is already in verbose format. + * @param pScene The data to check. + * @return true if the scene is already in verbose format. */ + static bool IsVerboseFormat(const aiScene* pScene); private: diff --git a/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp index 712fd6943d..75d1b6ef78 100644 --- a/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp +++ b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp @@ -538,13 +538,17 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation) { Validate(&pAnimation->mName); - // validate all materials - if (pAnimation->mNumChannels) + // validate all animations + if (pAnimation->mNumChannels || pAnimation->mNumMorphMeshChannels) { - if (!pAnimation->mChannels) { + if (!pAnimation->mChannels && pAnimation->mNumChannels) { ReportError("aiAnimation::mChannels is NULL (aiAnimation::mNumChannels is %i)", pAnimation->mNumChannels); } + if (!pAnimation->mMorphMeshChannels && pAnimation->mNumMorphMeshChannels) { + ReportError("aiAnimation::mMorphMeshChannels is NULL (aiAnimation::mNumMorphMeshChannels is %i)", + pAnimation->mNumMorphMeshChannels); + } for (unsigned int i = 0; i < pAnimation->mNumChannels;++i) { if (!pAnimation->mChannels[i]) @@ -554,6 +558,15 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation) } Validate(pAnimation, pAnimation->mChannels[i]); } + for (unsigned int i = 0; i < pAnimation->mNumMorphMeshChannels;++i) + { + if (!pAnimation->mMorphMeshChannels[i]) + { + ReportError("aiAnimation::mMorphMeshChannels[%i] is NULL (aiAnimation::mNumMorphMeshChannels is %i)", + i, pAnimation->mNumMorphMeshChannels); + } + Validate(pAnimation, pAnimation->mMorphMeshChannels[i]); + } } else { ReportError("aiAnimation::mNumChannels is 0. At least one node animation channel must be there."); @@ -903,6 +916,48 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation, } } +void ValidateDSProcess::Validate( const aiAnimation* pAnimation, + const aiMeshMorphAnim* pMeshMorphAnim) +{ + Validate(&pMeshMorphAnim->mName); + + if (!pMeshMorphAnim->mNumKeys) { + ReportError("Empty mesh morph animation channel"); + } + + // otherwise check whether one of the keys exceeds the total duration of the animation + if (pMeshMorphAnim->mNumKeys) + { + if (!pMeshMorphAnim->mKeys) + { + ReportError("aiMeshMorphAnim::mKeys is NULL (aiMeshMorphAnim::mNumKeys is %i)", + pMeshMorphAnim->mNumKeys); + } + double dLast = -10e10; + for (unsigned int i = 0; i < pMeshMorphAnim->mNumKeys;++i) + { + // ScenePreprocessor will compute the duration if still the default value + // (Aramis) Add small epsilon, comparison tended to fail if max_time == duration, + // seems to be due the compilers register usage/width. + if (pAnimation->mDuration > 0. && pMeshMorphAnim->mKeys[i].mTime > pAnimation->mDuration+0.001) + { + ReportError("aiMeshMorphAnim::mKeys[%i].mTime (%.5f) is larger " + "than aiAnimation::mDuration (which is %.5f)",i, + (float)pMeshMorphAnim->mKeys[i].mTime, + (float)pAnimation->mDuration); + } + if (i && pMeshMorphAnim->mKeys[i].mTime <= dLast) + { + ReportWarning("aiMeshMorphAnim::mKeys[%i].mTime (%.5f) is smaller " + "than aiMeshMorphAnim::mKeys[%i] (which is %.5f)",i, + (float)pMeshMorphAnim->mKeys[i].mTime, + i-1, (float)dLast); + } + dLast = pMeshMorphAnim->mKeys[i].mTime; + } + } +} + // ------------------------------------------------------------------------------------------------ void ValidateDSProcess::Validate( const aiNode* pNode) { @@ -958,7 +1013,7 @@ void ValidateDSProcess::Validate( const aiString* pString) { if (pString->length > MAXLEN) { - ReportError("aiString::length is too large (%lu, maximum is %lu)", + ReportError("aiString::length is too large (%u, maximum is %lu)", pString->length,MAXLEN); } const char* sz = pString->data; diff --git a/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.h b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.h index 0b891ef414..7b309c9251 100644 --- a/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.h +++ b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.h @@ -55,6 +55,7 @@ struct aiBone; struct aiMesh; struct aiAnimation; struct aiNodeAnim; +struct aiMeshMorphAnim; struct aiTexture; struct aiMaterial; struct aiNode; @@ -150,6 +151,13 @@ protected: void Validate( const aiAnimation* pAnimation, const aiNodeAnim* pBoneAnim); + /** Validates a mesh morph animation channel. + * @param pAnimation Input animation. + * @param pMeshMorphAnim Mesh morph animation channel. + * */ + void Validate( const aiAnimation* pAnimation, + const aiMeshMorphAnim* pMeshMorphAnim); + // ------------------------------------------------------------------- /** Validates a node and all of its subnodes * @param Node Input node*/ diff --git a/thirdparty/assimp/code/revision.h b/thirdparty/assimp/code/revision.h index 88872aef22..66eb875303 100644 --- a/thirdparty/assimp/code/revision.h +++ b/thirdparty/assimp/code/revision.h @@ -1,7 +1,28 @@ #ifndef ASSIMP_REVISION_H_INC #define ASSIMP_REVISION_H_INC -#define GitVersion 0x00000000 +#define GitVersion 0x308db73d #define GitBranch "master" +#define VER_MAJOR 5 +#define VER_MINOR 0 +#define VER_PATCH 0 +#define VER_BUILD 0 + +#define STR_HELP(x) #x +#define STR(x) STR_HELP(x) + +#define VER_FILEVERSION VER_MAJOR,VER_MINOR,VER_PATCH,VER_BUILD +#if (GitVersion == 0) +#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD) +#else +#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD) " (Commit 308db73d)" +#endif + +#ifdef NDEBUG +#define VER_ORIGINAL_FILENAME_STR "assimp.dll" +#else +#define VER_ORIGINAL_FILENAME_STR "assimp.dll" +#endif // NDEBUG + #endif // ASSIMP_REVISION_H_INC diff --git a/thirdparty/assimp/include/assimp/.editorconfig b/thirdparty/assimp/include/assimp/.editorconfig new file mode 100644 index 0000000000..9ea66423ad --- /dev/null +++ b/thirdparty/assimp/include/assimp/.editorconfig @@ -0,0 +1,8 @@ +# See <http://EditorConfig.org> for details + +[*.{h,hpp,inl}] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_size = 4 +indent_style = space diff --git a/thirdparty/assimp/include/assimp/BaseImporter.h b/thirdparty/assimp/include/assimp/BaseImporter.h index 55f7fe3754..ad8a3dafd8 100644 --- a/thirdparty/assimp/include/assimp/BaseImporter.h +++ b/thirdparty/assimp/include/assimp/BaseImporter.h @@ -41,9 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file Definition of the base class for all importer worker classes. */ +#pragma once #ifndef INCLUDED_AI_BASEIMPORTER_H #define INCLUDED_AI_BASEIMPORTER_H +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include "Exceptional.h" #include <vector> @@ -191,16 +196,13 @@ public: /** * Assimp Importer * unit conversions available - * if you need another measurment unit add it below. - * it's currently defined in assimp that we prefer meters. + * NOTE: Valid options are initialised in the + * constructor in the implementation file to + * work around a VS2013 compiler bug if support + * for that compiler is dropped in the future + * initialisation can be moved back here * */ - std::map<ImporterUnits, double> importerUnits = { - {ImporterUnits::M, 1}, - {ImporterUnits::CM, 0.01}, - {ImporterUnits::MM, 0.001}, - {ImporterUnits::INCHES, 0.0254}, - {ImporterUnits::FEET, 0.3048} - }; + std::map<ImporterUnits, double> importerUnits; virtual void SetApplicationUnits( const ImporterUnits& unit ) { diff --git a/thirdparty/assimp/include/assimp/Bitmap.h b/thirdparty/assimp/include/assimp/Bitmap.h index e6b5fb1327..4c3f5a437b 100644 --- a/thirdparty/assimp/include/assimp/Bitmap.h +++ b/thirdparty/assimp/include/assimp/Bitmap.h @@ -46,10 +46,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Used for file formats which embed their textures into the model file. */ - +#pragma once #ifndef AI_BITMAP_H_INC #define AI_BITMAP_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include "defs.h" #include <stdint.h> #include <cstddef> diff --git a/thirdparty/assimp/include/assimp/ByteSwapper.h b/thirdparty/assimp/include/assimp/ByteSwapper.h index 20a2463fb8..3f14c471a8 100644 --- a/thirdparty/assimp/include/assimp/ByteSwapper.h +++ b/thirdparty/assimp/include/assimp/ByteSwapper.h @@ -42,9 +42,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Helper class tp perform various byte oder swappings (e.g. little to big endian) */ +#pragma once #ifndef AI_BYTESWAPPER_H_INC #define AI_BYTESWAPPER_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/ai_assert.h> #include <assimp/types.h> #include <stdint.h> diff --git a/thirdparty/assimp/include/assimp/CreateAnimMesh.h b/thirdparty/assimp/include/assimp/CreateAnimMesh.h index a60173588f..1266d1de11 100644 --- a/thirdparty/assimp/include/assimp/CreateAnimMesh.h +++ b/thirdparty/assimp/include/assimp/CreateAnimMesh.h @@ -43,16 +43,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file CreateAnimMesh.h * Create AnimMesh from Mesh */ +#pragma once #ifndef INCLUDED_AI_CREATE_ANIM_MESH_H #define INCLUDED_AI_CREATE_ANIM_MESH_H +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/mesh.h> -namespace Assimp { +namespace Assimp { -/** Create aiAnimMesh from aiMesh. */ +/** + * Create aiAnimMesh from aiMesh. + * @param mesh The input mesh to create an animated mesh from. + * @return The new created animated mesh. + */ ASSIMP_API aiAnimMesh *aiCreateAnimMesh(const aiMesh *mesh); } // end of namespace Assimp + #endif // INCLUDED_AI_CREATE_ANIM_MESH_H diff --git a/thirdparty/assimp/include/assimp/DefaultIOStream.h b/thirdparty/assimp/include/assimp/DefaultIOStream.h index 994d728ff5..c6d382c1b5 100644 --- a/thirdparty/assimp/include/assimp/DefaultIOStream.h +++ b/thirdparty/assimp/include/assimp/DefaultIOStream.h @@ -41,15 +41,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file Default file I/O using fXXX()-family of functions */ +#pragma once #ifndef AI_DEFAULTIOSTREAM_H_INC #define AI_DEFAULTIOSTREAM_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <stdio.h> #include <assimp/IOStream.hpp> #include <assimp/importerdesc.h> #include <assimp/Defines.h> -namespace Assimp { +namespace Assimp { // ---------------------------------------------------------------------------------- //! @class DefaultIOStream @@ -57,8 +62,7 @@ namespace Assimp { //! @note An instance of this class can exist without a valid file handle //! attached to it. All calls fail, but the instance can nevertheless be //! used with no restrictions. -class ASSIMP_API DefaultIOStream : public IOStream -{ +class ASSIMP_API DefaultIOStream : public IOStream { friend class DefaultIOSystem; #if __ANDROID__ # if __ANDROID_API__ > 9 @@ -82,7 +86,6 @@ public: size_t pSize, size_t pCount); - // ------------------------------------------------------------------- /// Write to stream size_t Write(const void* pvBuffer, @@ -107,16 +110,13 @@ public: void Flush(); private: - // File data-structure, using clib FILE* mFile; - // Filename std::string mFilename; - // Cached file size mutable size_t mCachedSize; }; // ---------------------------------------------------------------------------------- -inline +AI_FORCE_INLINE DefaultIOStream::DefaultIOStream() AI_NO_EXCEPT : mFile(nullptr) , mFilename("") @@ -125,7 +125,7 @@ DefaultIOStream::DefaultIOStream() AI_NO_EXCEPT } // ---------------------------------------------------------------------------------- -inline +AI_FORCE_INLINE DefaultIOStream::DefaultIOStream (FILE* pFile, const std::string &strFilename) : mFile(pFile) , mFilename(strFilename) @@ -137,4 +137,3 @@ DefaultIOStream::DefaultIOStream (FILE* pFile, const std::string &strFilename) } // ns assimp #endif //!!AI_DEFAULTIOSTREAM_H_INC - diff --git a/thirdparty/assimp/include/assimp/DefaultIOSystem.h b/thirdparty/assimp/include/assimp/DefaultIOSystem.h index 2dd5c801b5..46f6d447c5 100644 --- a/thirdparty/assimp/include/assimp/DefaultIOSystem.h +++ b/thirdparty/assimp/include/assimp/DefaultIOSystem.h @@ -41,9 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file Default implementation of IOSystem using the standard C file functions */ +#pragma once #ifndef AI_DEFAULTIOSYSTEM_H_INC #define AI_DEFAULTIOSYSTEM_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/IOSystem.hpp> namespace Assimp { diff --git a/thirdparty/assimp/include/assimp/Defines.h b/thirdparty/assimp/include/assimp/Defines.h index 15e1d83c26..be3e2fafd6 100644 --- a/thirdparty/assimp/include/assimp/Defines.h +++ b/thirdparty/assimp/include/assimp/Defines.h @@ -38,6 +38,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ +#pragma once +#ifndef AI_DEFINES_H_INC +#define AI_DEFINES_H_INC + +#ifdef __GNUC__ +# pragma GCC system_header +#endif + // We need those constants, workaround for any platforms where nobody defined them yet #if (!defined SIZE_MAX) # define SIZE_MAX (~((size_t)0)) @@ -47,3 +55,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # define UINT_MAX (~((unsigned int)0)) #endif +#endif // AI_DEINES_H_INC diff --git a/thirdparty/assimp/include/assimp/Exceptional.h b/thirdparty/assimp/include/assimp/Exceptional.h index 5109b8f077..6bb6ce1e39 100644 --- a/thirdparty/assimp/include/assimp/Exceptional.h +++ b/thirdparty/assimp/include/assimp/Exceptional.h @@ -38,11 +38,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -#ifndef INCLUDED_EXCEPTIONAL_H -#define INCLUDED_EXCEPTIONAL_H +#pragma once +#ifndef AI_INCLUDED_EXCEPTIONAL_H +#define AI_INCLUDED_EXCEPTIONAL_H + +#ifdef __GNUC__ +# pragma GCC system_header +#endif #include <stdexcept> #include <assimp/DefaultIOStream.h> + using std::runtime_error; #ifdef _MSC_VER @@ -53,17 +59,14 @@ using std::runtime_error; /** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an * unrecoverable error occurs while importing. Loading APIs return * NULL instead of a valid aiScene then. */ -class DeadlyImportError - : public runtime_error -{ +class DeadlyImportError : public runtime_error { public: /** Constructor with arguments */ explicit DeadlyImportError( const std::string& errorText) - : runtime_error(errorText) - { + : runtime_error(errorText) { + // empty } -private: }; typedef DeadlyImportError DeadlyExportError; @@ -84,7 +87,7 @@ struct ExceptionSwallower { template <typename T> struct ExceptionSwallower<T*> { T* operator ()() const { - return NULL; + return nullptr; } }; @@ -122,4 +125,4 @@ struct ExceptionSwallower<void> { }\ } -#endif // INCLUDED_EXCEPTIONAL_H +#endif // AI_INCLUDED_EXCEPTIONAL_H diff --git a/thirdparty/assimp/include/assimp/Exporter.hpp b/thirdparty/assimp/include/assimp/Exporter.hpp index ea0303e804..2612e1f9d2 100644 --- a/thirdparty/assimp/include/assimp/Exporter.hpp +++ b/thirdparty/assimp/include/assimp/Exporter.hpp @@ -48,6 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_EXPORT_HPP_INC #define AI_EXPORT_HPP_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifndef ASSIMP_BUILD_NO_EXPORT #include "cexport.h" diff --git a/thirdparty/assimp/include/assimp/GenericProperty.h b/thirdparty/assimp/include/assimp/GenericProperty.h index 183ecd5197..7796d595b8 100644 --- a/thirdparty/assimp/include/assimp/GenericProperty.h +++ b/thirdparty/assimp/include/assimp/GenericProperty.h @@ -40,12 +40,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ +#pragma once #ifndef AI_GENERIC_PROPERTY_H_INCLUDED #define AI_GENERIC_PROPERTY_H_INCLUDED +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/Importer.hpp> #include <assimp/ai_assert.h> -#include "Hash.h" +#include <assimp/Hash.h> #include <map> diff --git a/thirdparty/assimp/include/assimp/Hash.h b/thirdparty/assimp/include/assimp/Hash.h index 30657be198..9056440789 100644 --- a/thirdparty/assimp/include/assimp/Hash.h +++ b/thirdparty/assimp/include/assimp/Hash.h @@ -39,10 +39,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ - +#pragma once #ifndef AI_HASH_H_INCLUDED #define AI_HASH_H_INCLUDED +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <stdint.h> #include <string.h> diff --git a/thirdparty/assimp/include/assimp/IOStream.hpp b/thirdparty/assimp/include/assimp/IOStream.hpp index 0623d0f70b..39932cd949 100644 --- a/thirdparty/assimp/include/assimp/IOStream.hpp +++ b/thirdparty/assimp/include/assimp/IOStream.hpp @@ -48,14 +48,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_IOSTREAM_H_INC #define AI_IOSTREAM_H_INC -#include "types.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/types.h> #ifndef __cplusplus # error This header requires C++ to be used. aiFileIO.h is the \ corresponding C interface. #endif -namespace Assimp { +namespace Assimp { // ---------------------------------------------------------------------------------- /** @brief CPP-API: Class to handle file I/O for C++ @@ -125,13 +129,13 @@ public: }; //! class IOStream // ---------------------------------------------------------------------------------- -inline +AI_FORCE_INLINE IOStream::IOStream() AI_NO_EXCEPT { // empty } // ---------------------------------------------------------------------------------- -inline +AI_FORCE_INLINE IOStream::~IOStream() { // empty } diff --git a/thirdparty/assimp/include/assimp/IOStreamBuffer.h b/thirdparty/assimp/include/assimp/IOStreamBuffer.h index 58abd97a02..97c84b23e2 100644 --- a/thirdparty/assimp/include/assimp/IOStreamBuffer.h +++ b/thirdparty/assimp/include/assimp/IOStreamBuffer.h @@ -1,5 +1,3 @@ -#pragma once - /* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -42,10 +40,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ +#pragma once +#ifndef AI_IOSTREAMBUFFER_H_INC +#define AI_IOSTREAMBUFFER_H_INC + +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/types.h> #include <assimp/IOStream.hpp> - -#include "ParsingUtils.h" +#include <assimp/ParsingUtils.h> #include <vector> @@ -124,7 +129,7 @@ private: }; template<class T> -inline +AI_FORCE_INLINE IOStreamBuffer<T>::IOStreamBuffer( size_t cache ) : m_stream( nullptr ) , m_filesize( 0 ) @@ -138,13 +143,13 @@ IOStreamBuffer<T>::IOStreamBuffer( size_t cache ) } template<class T> -inline +AI_FORCE_INLINE IOStreamBuffer<T>::~IOStreamBuffer() { // empty } template<class T> -inline +AI_FORCE_INLINE bool IOStreamBuffer<T>::open( IOStream *stream ) { // file still opened! if ( nullptr != m_stream ) { @@ -174,7 +179,7 @@ bool IOStreamBuffer<T>::open( IOStream *stream ) { } template<class T> -inline +AI_FORCE_INLINE bool IOStreamBuffer<T>::close() { if ( nullptr == m_stream ) { return false; @@ -192,19 +197,19 @@ bool IOStreamBuffer<T>::close() { } template<class T> -inline +AI_FORCE_INLINE size_t IOStreamBuffer<T>::size() const { return m_filesize; } template<class T> -inline +AI_FORCE_INLINE size_t IOStreamBuffer<T>::cacheSize() const { return m_cacheSize; } template<class T> -inline +AI_FORCE_INLINE bool IOStreamBuffer<T>::readNextBlock() { m_stream->Seek( m_filePos, aiOrigin_SET ); size_t readLen = m_stream->Read( &m_cache[ 0 ], sizeof( T ), m_cacheSize ); @@ -222,25 +227,25 @@ bool IOStreamBuffer<T>::readNextBlock() { } template<class T> -inline +AI_FORCE_INLINE size_t IOStreamBuffer<T>::getNumBlocks() const { return m_numBlocks; } template<class T> -inline +AI_FORCE_INLINE size_t IOStreamBuffer<T>::getCurrentBlockIndex() const { return m_blockIdx; } template<class T> -inline +AI_FORCE_INLINE size_t IOStreamBuffer<T>::getFilePos() const { return m_filePos; } template<class T> -inline +AI_FORCE_INLINE bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationToken ) { buffer.resize( m_cacheSize ); if ( m_cachePos >= m_cacheSize || 0 == m_filePos ) { @@ -289,13 +294,13 @@ bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationT return true; } -static inline +static AI_FORCE_INLINE bool isEndOfCache( size_t pos, size_t cacheSize ) { return ( pos == cacheSize ); } template<class T> -inline +AI_FORCE_INLINE bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) { buffer.resize(m_cacheSize); if ( isEndOfCache( m_cachePos, m_cacheSize ) || 0 == m_filePos) { @@ -335,7 +340,7 @@ bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) { } template<class T> -inline +AI_FORCE_INLINE bool IOStreamBuffer<T>::getNextBlock( std::vector<T> &buffer) { // Return the last block-value if getNextLine was used before if ( 0 != m_cachePos ) { @@ -353,3 +358,5 @@ bool IOStreamBuffer<T>::getNextBlock( std::vector<T> &buffer) { } } // !ns Assimp + +#endif // AI_IOSTREAMBUFFER_H_INC diff --git a/thirdparty/assimp/include/assimp/IOSystem.hpp b/thirdparty/assimp/include/assimp/IOSystem.hpp index 78139c2839..f1fb3b0c27 100644 --- a/thirdparty/assimp/include/assimp/IOSystem.hpp +++ b/thirdparty/assimp/include/assimp/IOSystem.hpp @@ -50,6 +50,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_IOSYSTEM_H_INC #define AI_IOSYSTEM_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifndef __cplusplus # error This header requires C++ to be used. aiFileIO.h is the \ corresponding C interface. diff --git a/thirdparty/assimp/include/assimp/Importer.hpp b/thirdparty/assimp/include/assimp/Importer.hpp index 4941df4122..bf449a9a25 100644 --- a/thirdparty/assimp/include/assimp/Importer.hpp +++ b/thirdparty/assimp/include/assimp/Importer.hpp @@ -48,6 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_ASSIMP_HPP_INC #define AI_ASSIMP_HPP_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifndef __cplusplus # error This header requires C++ to be used. Use assimp.h for plain C. #endif // __cplusplus diff --git a/thirdparty/assimp/include/assimp/LineSplitter.h b/thirdparty/assimp/include/assimp/LineSplitter.h index 4afe45b92a..6c1097bb6d 100644 --- a/thirdparty/assimp/include/assimp/LineSplitter.h +++ b/thirdparty/assimp/include/assimp/LineSplitter.h @@ -48,9 +48,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INCLUDED_LINE_SPLITTER_H #define INCLUDED_LINE_SPLITTER_H +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <stdexcept> -#include "StreamReader.h" -#include "ParsingUtils.h" +#include <assimp/StreamReader.h> +#include <assimp/ParsingUtils.h> namespace Assimp { @@ -140,7 +144,7 @@ private: bool mSwallow, mSkip_empty_lines, mTrim; }; -inline +AI_FORCE_INLINE LineSplitter::LineSplitter(StreamReaderLE& stream, bool skip_empty_lines, bool trim ) : mIdx(0) , mCur() @@ -153,12 +157,12 @@ LineSplitter::LineSplitter(StreamReaderLE& stream, bool skip_empty_lines, bool t mIdx = 0; } -inline +AI_FORCE_INLINE LineSplitter::~LineSplitter() { // empty } -inline +AI_FORCE_INLINE LineSplitter& LineSplitter::operator++() { if (mSwallow) { mSwallow = false; @@ -199,12 +203,12 @@ LineSplitter& LineSplitter::operator++() { return *this; } -inline +AI_FORCE_INLINE LineSplitter &LineSplitter::operator++(int) { return ++(*this); } -inline +AI_FORCE_INLINE const char *LineSplitter::operator[] (size_t idx) const { const char* s = operator->()->c_str(); @@ -222,7 +226,7 @@ const char *LineSplitter::operator[] (size_t idx) const { } template <size_t N> -inline +AI_FORCE_INLINE void LineSplitter::get_tokens(const char* (&tokens)[N]) const { const char* s = operator->()->c_str(); @@ -238,44 +242,44 @@ void LineSplitter::get_tokens(const char* (&tokens)[N]) const { } } -inline +AI_FORCE_INLINE const std::string* LineSplitter::operator -> () const { return &mCur; } -inline +AI_FORCE_INLINE std::string LineSplitter::operator* () const { return mCur; } -inline +AI_FORCE_INLINE LineSplitter::operator bool() const { return mStream.GetRemainingSize() > 0; } -inline +AI_FORCE_INLINE LineSplitter::operator line_idx() const { return mIdx; } -inline +AI_FORCE_INLINE LineSplitter::line_idx LineSplitter::get_index() const { return mIdx; } -inline +AI_FORCE_INLINE StreamReaderLE &LineSplitter::get_stream() { return mStream; } -inline +AI_FORCE_INLINE bool LineSplitter::match_start(const char* check) { const size_t len = ::strlen(check); return len <= mCur.length() && std::equal(check, check + len, mCur.begin()); } -inline +AI_FORCE_INLINE void LineSplitter::swallow_next_increment() { mSwallow = true; } diff --git a/thirdparty/assimp/include/assimp/LogAux.h b/thirdparty/assimp/include/assimp/LogAux.h index 558485272e..bcead78dd3 100644 --- a/thirdparty/assimp/include/assimp/LogAux.h +++ b/thirdparty/assimp/include/assimp/LogAux.h @@ -43,9 +43,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file LogAux.h * @brief Common logging usage patterns for importer implementations */ +#pragma once #ifndef INCLUDED_AI_LOGAUX_H #define INCLUDED_AI_LOGAUX_H +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/TinyFormatter.h> #include <assimp/Exceptional.h> #include <assimp/DefaultLogger.hpp> diff --git a/thirdparty/assimp/include/assimp/Macros.h b/thirdparty/assimp/include/assimp/Macros.h deleted file mode 100644 index 6515303372..0000000000 --- a/thirdparty/assimp/include/assimp/Macros.h +++ /dev/null @@ -1,49 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2019, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following -conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------------- -*/ - -/* Helper macro to set a pointer to NULL in debug builds - */ -#if (defined ASSIMP_BUILD_DEBUG) -# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL; -#else -# define AI_DEBUG_INVALIDATE_PTR(x) -#endif - diff --git a/thirdparty/assimp/include/assimp/MathFunctions.h b/thirdparty/assimp/include/assimp/MathFunctions.h index cb3b696076..b6c5872a72 100644 --- a/thirdparty/assimp/include/assimp/MathFunctions.h +++ b/thirdparty/assimp/include/assimp/MathFunctions.h @@ -39,22 +39,28 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ +#pragma once + +#ifdef __GNUC__ +# pragma GCC system_header +#endif + /** @file MathFunctions.h - * @brief Implementation of the math functions (gcd and lcm) +* @brief Implementation of math utility functions. * - * Copied from BoostWorkaround/math - */ +*/ + +#include <limits> namespace Assimp { namespace Math { // TODO: use binary GCD for unsigned integers .... template < typename IntegerType > -IntegerType gcd( IntegerType a, IntegerType b ) -{ +inline +IntegerType gcd( IntegerType a, IntegerType b ) { const IntegerType zero = (IntegerType)0; - while ( true ) - { + while ( true ) { if ( a == zero ) return b; b %= a; @@ -66,12 +72,19 @@ IntegerType gcd( IntegerType a, IntegerType b ) } template < typename IntegerType > -IntegerType lcm( IntegerType a, IntegerType b ) -{ +inline +IntegerType lcm( IntegerType a, IntegerType b ) { const IntegerType t = gcd (a,b); - if (!t)return t; + if (!t) + return t; return a / t * b; } +template<class T> +inline +T getEpsilon() { + return std::numeric_limits<T>::epsilon(); +} + } } diff --git a/thirdparty/assimp/include/assimp/MemoryIOWrapper.h b/thirdparty/assimp/include/assimp/MemoryIOWrapper.h index c522787184..5598d4fc5f 100644 --- a/thirdparty/assimp/include/assimp/MemoryIOWrapper.h +++ b/thirdparty/assimp/include/assimp/MemoryIOWrapper.h @@ -42,12 +42,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file MemoryIOWrapper.h * Handy IOStream/IOSystem implemetation to read directly from a memory buffer */ +#pragma once #ifndef AI_MEMORYIOSTREAM_H_INC #define AI_MEMORYIOSTREAM_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/IOStream.hpp> #include <assimp/IOSystem.hpp> #include <assimp/ai_assert.h> + #include <stdint.h> namespace Assimp { diff --git a/thirdparty/assimp/include/assimp/ParsingUtils.h b/thirdparty/assimp/include/assimp/ParsingUtils.h index 6b9574fc67..3025601246 100644 --- a/thirdparty/assimp/include/assimp/ParsingUtils.h +++ b/thirdparty/assimp/include/assimp/ParsingUtils.h @@ -44,11 +44,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file ParsingUtils.h * @brief Defines helper functions for text parsing */ +#pragma once #ifndef AI_PARSING_UTILS_H_INC #define AI_PARSING_UTILS_H_INC -#include "StringComparison.h" -#include "StringUtils.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/StringComparison.h> +#include <assimp/StringUtils.h> #include <assimp/defs.h> namespace Assimp { diff --git a/thirdparty/assimp/include/assimp/Profiler.h b/thirdparty/assimp/include/assimp/Profiler.h index 6ff9d41c0a..624029be99 100644 --- a/thirdparty/assimp/include/assimp/Profiler.h +++ b/thirdparty/assimp/include/assimp/Profiler.h @@ -43,12 +43,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Profiler.h * @brief Utility to measure the respective runtime of each import step */ -#ifndef INCLUDED_PROFILER_H -#define INCLUDED_PROFILER_H +#pragma once +#ifndef AI_INCLUDED_PROFILER_H +#define AI_INCLUDED_PROFILER_H + +#ifdef __GNUC__ +# pragma GCC system_header +#endif #include <chrono> #include <assimp/DefaultLogger.hpp> -#include "TinyFormatter.h" +#include <assimp/TinyFormatter.h> #include <map> @@ -67,7 +72,6 @@ public: // empty } -public: /** Start a named timer */ void BeginRegion(const std::string& region) { @@ -95,5 +99,5 @@ private: } } -#endif +#endif // AI_INCLUDED_PROFILER_H diff --git a/thirdparty/assimp/include/assimp/ProgressHandler.hpp b/thirdparty/assimp/include/assimp/ProgressHandler.hpp index 4e47f1d0a6..8991a64618 100644 --- a/thirdparty/assimp/include/assimp/ProgressHandler.hpp +++ b/thirdparty/assimp/include/assimp/ProgressHandler.hpp @@ -47,9 +47,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_PROGRESSHANDLER_H_INC #define AI_PROGRESSHANDLER_H_INC -#include "types.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/types.h> -namespace Assimp { +namespace Assimp { // ------------------------------------------------------------------------------------ /** @brief CPP-API: Abstract interface for custom progress report receivers. diff --git a/thirdparty/assimp/include/assimp/RemoveComments.h b/thirdparty/assimp/include/assimp/RemoveComments.h index 404b496719..f129420535 100644 --- a/thirdparty/assimp/include/assimp/RemoveComments.h +++ b/thirdparty/assimp/include/assimp/RemoveComments.h @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -43,9 +42,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Declares a helper class, "CommentRemover", which can be * used to remove comments (single and multi line) from a text file. */ +#pragma once #ifndef AI_REMOVE_COMMENTS_H_INC #define AI_REMOVE_COMMENTS_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif #include <assimp/defs.h> @@ -58,8 +61,7 @@ namespace Assimp { * to those in C or C++ so this code has been moved to a separate * module. */ -class ASSIMP_API CommentRemover -{ +class ASSIMP_API CommentRemover { // class cannot be instanced CommentRemover() {} diff --git a/thirdparty/assimp/include/assimp/SGSpatialSort.h b/thirdparty/assimp/include/assimp/SGSpatialSort.h index 5b4f3f41f2..fdb5ce8174 100644 --- a/thirdparty/assimp/include/assimp/SGSpatialSort.h +++ b/thirdparty/assimp/include/assimp/SGSpatialSort.h @@ -42,9 +42,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** Small helper classes to optimize finding vertices close to a given location */ +#pragma once #ifndef AI_D3DSSPATIALSORT_H_INC #define AI_D3DSSPATIALSORT_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/types.h> #include <vector> #include <stdint.h> diff --git a/thirdparty/assimp/include/assimp/SceneCombiner.h b/thirdparty/assimp/include/assimp/SceneCombiner.h index 679a2acea4..0683c1e052 100644 --- a/thirdparty/assimp/include/assimp/SceneCombiner.h +++ b/thirdparty/assimp/include/assimp/SceneCombiner.h @@ -43,17 +43,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Declares a helper class, "SceneCombiner" providing various * utilities to merge scenes. */ +#pragma once #ifndef AI_SCENE_COMBINER_H_INC #define AI_SCENE_COMBINER_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/ai_assert.h> #include <assimp/types.h> #include <assimp/Defines.h> + #include <stddef.h> #include <set> #include <list> #include <stdint.h> - #include <vector> struct aiScene; @@ -65,8 +70,10 @@ struct aiLight; struct aiMetadata; struct aiBone; struct aiMesh; +struct aiAnimMesh; struct aiAnimation; struct aiNodeAnim; +struct aiMeshMorphAnim; namespace Assimp { @@ -363,6 +370,7 @@ public: static void Copy (aiMesh** dest, const aiMesh* src); // similar to Copy(): + static void Copy (aiAnimMesh** dest, const aiAnimMesh* src); static void Copy (aiMaterial** dest, const aiMaterial* src); static void Copy (aiTexture** dest, const aiTexture* src); static void Copy (aiAnimation** dest, const aiAnimation* src); @@ -370,6 +378,7 @@ public: static void Copy (aiBone** dest, const aiBone* src); static void Copy (aiLight** dest, const aiLight* src); static void Copy (aiNodeAnim** dest, const aiNodeAnim* src); + static void Copy (aiMeshMorphAnim** dest, const aiMeshMorphAnim* src); static void Copy (aiMetadata** dest, const aiMetadata* src); // recursive, of course diff --git a/thirdparty/assimp/include/assimp/SkeletonMeshBuilder.h b/thirdparty/assimp/include/assimp/SkeletonMeshBuilder.h index f9b8d9f55c..ad979a33fa 100644 --- a/thirdparty/assimp/include/assimp/SkeletonMeshBuilder.h +++ b/thirdparty/assimp/include/assimp/SkeletonMeshBuilder.h @@ -47,9 +47,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * for animation skeletons. */ +#pragma once #ifndef AI_SKELETONMESHBUILDER_H_INC #define AI_SKELETONMESHBUILDER_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <vector> #include <assimp/mesh.h> diff --git a/thirdparty/assimp/include/assimp/SmoothingGroups.h b/thirdparty/assimp/include/assimp/SmoothingGroups.h index 92d65cea02..c1a93947f1 100644 --- a/thirdparty/assimp/include/assimp/SmoothingGroups.h +++ b/thirdparty/assimp/include/assimp/SmoothingGroups.h @@ -43,10 +43,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Defines the helper data structures for importing 3DS files. http://www.jalix.org/ressources/graphics/3DS/_unofficials/3ds-unofficial.txt */ +#pragma once #ifndef AI_SMOOTHINGGROUPS_H_INC #define AI_SMOOTHINGGROUPS_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/vector3.h> + #include <stdint.h> #include <vector> diff --git a/thirdparty/assimp/include/assimp/SmoothingGroups.inl b/thirdparty/assimp/include/assimp/SmoothingGroups.inl index 84ea4a1b00..37ea083dbe 100644 --- a/thirdparty/assimp/include/assimp/SmoothingGroups.inl +++ b/thirdparty/assimp/include/assimp/SmoothingGroups.inl @@ -41,13 +41,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Generation of normal vectors basing on smoothing groups */ +#pragma once #ifndef AI_SMOOTHINGGROUPS_INL_INCLUDED #define AI_SMOOTHINGGROUPS_INL_INCLUDED -// internal headers +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/SGSpatialSort.h> -// CRT header #include <algorithm> using namespace Assimp; diff --git a/thirdparty/assimp/include/assimp/SpatialSort.h b/thirdparty/assimp/include/assimp/SpatialSort.h index 61b345bcbf..9f93543150 100644 --- a/thirdparty/assimp/include/assimp/SpatialSort.h +++ b/thirdparty/assimp/include/assimp/SpatialSort.h @@ -41,9 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** Small helper classes to optimise finding vertizes close to a given location */ +#pragma once #ifndef AI_SPATIALSORT_H_INC #define AI_SPATIALSORT_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <vector> #include <assimp/types.h> diff --git a/thirdparty/assimp/include/assimp/StandardShapes.h b/thirdparty/assimp/include/assimp/StandardShapes.h index 3791569b83..c594cb63f4 100644 --- a/thirdparty/assimp/include/assimp/StandardShapes.h +++ b/thirdparty/assimp/include/assimp/StandardShapes.h @@ -41,11 +41,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file Declares a helper class, "StandardShapes" which generates - * vertices for standard shapes, such as cylnders, cones, spheres .. + * vertices for standard shapes, such as cylinders, cones, spheres .. */ +#pragma once #ifndef AI_STANDARD_SHAPES_H_INC #define AI_STANDARD_SHAPES_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/vector3.h> #include <vector> diff --git a/thirdparty/assimp/include/assimp/StreamReader.h b/thirdparty/assimp/include/assimp/StreamReader.h index 9116c14261..cb24f1595b 100644 --- a/thirdparty/assimp/include/assimp/StreamReader.h +++ b/thirdparty/assimp/include/assimp/StreamReader.h @@ -44,15 +44,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Defines the StreamReader class which reads data from * a binary stream with a well-defined endianness. */ - +#pragma once #ifndef AI_STREAMREADER_H_INCLUDED #define AI_STREAMREADER_H_INCLUDED +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/IOStream.hpp> #include <assimp/Defines.h> +#include <assimp/ByteSwapper.h> +#include <assimp/Exceptional.h> -#include "ByteSwapper.h" -#include "Exceptional.h" #include <memory> namespace Assimp { diff --git a/thirdparty/assimp/include/assimp/StreamWriter.h b/thirdparty/assimp/include/assimp/StreamWriter.h index c7cf6c0d74..489e8adfe3 100644 --- a/thirdparty/assimp/include/assimp/StreamWriter.h +++ b/thirdparty/assimp/include/assimp/StreamWriter.h @@ -43,11 +43,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Defines the StreamWriter class which writes data to * a binary stream with a well-defined endianness. */ - +#pragma once #ifndef AI_STREAMWRITER_H_INCLUDED #define AI_STREAMWRITER_H_INCLUDED -#include "ByteSwapper.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/ByteSwapper.h> #include <assimp/IOStream.hpp> #include <memory> diff --git a/thirdparty/assimp/include/assimp/StringComparison.h b/thirdparty/assimp/include/assimp/StringComparison.h index 8acef277b9..d3ca3e9714 100644 --- a/thirdparty/assimp/include/assimp/StringComparison.h +++ b/thirdparty/assimp/include/assimp/StringComparison.h @@ -49,12 +49,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. These functions are not consistently available on all platforms, or the provided implementations behave too differently. */ +#pragma once #ifndef INCLUDED_AI_STRING_WORKERS_H #define INCLUDED_AI_STRING_WORKERS_H +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/ai_assert.h> #include <assimp/defs.h> -#include "StringComparison.h" +#include <assimp/StringComparison.h> #include <string.h> #include <stdint.h> diff --git a/thirdparty/assimp/include/assimp/StringUtils.h b/thirdparty/assimp/include/assimp/StringUtils.h index d68b7fa479..af481f819e 100644 --- a/thirdparty/assimp/include/assimp/StringUtils.h +++ b/thirdparty/assimp/include/assimp/StringUtils.h @@ -39,9 +39,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ +#pragma once #ifndef INCLUDED_AI_STRINGUTILS_H #define INCLUDED_AI_STRINGUTILS_H +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/defs.h> #include <sstream> diff --git a/thirdparty/assimp/include/assimp/Subdivision.h b/thirdparty/assimp/include/assimp/Subdivision.h index 43feb73b30..e9450267ec 100644 --- a/thirdparty/assimp/include/assimp/Subdivision.h +++ b/thirdparty/assimp/include/assimp/Subdivision.h @@ -45,7 +45,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_SUBDISIVION_H_INC #define AI_SUBDISIVION_H_INC -#include <cstddef> +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/types.h> struct aiMesh; diff --git a/thirdparty/assimp/include/assimp/TinyFormatter.h b/thirdparty/assimp/include/assimp/TinyFormatter.h index 1226b482e6..6227e42c52 100644 --- a/thirdparty/assimp/include/assimp/TinyFormatter.h +++ b/thirdparty/assimp/include/assimp/TinyFormatter.h @@ -45,9 +45,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * to get rid of the boost::format dependency. Much slinker, * basically just extends stringstream. */ +#pragma once #ifndef INCLUDED_TINY_FORMATTER_H #define INCLUDED_TINY_FORMATTER_H +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <sstream> namespace Assimp { @@ -65,24 +70,15 @@ namespace Formatter { * @endcode */ template < typename T, typename CharTraits = std::char_traits<T>, - typename Allocator = std::allocator<T> -> -class basic_formatter -{ - -public: - - typedef class std::basic_string< - T,CharTraits,Allocator - > string; - - typedef class std::basic_ostringstream< - T,CharTraits,Allocator - > stringstream; - + typename Allocator = std::allocator<T> > +class basic_formatter { public: + typedef class std::basic_string<T,CharTraits,Allocator> string; + typedef class std::basic_ostringstream<T,CharTraits,Allocator> stringstream; - basic_formatter() {} + basic_formatter() { + // empty + } /* Allow basic_formatter<T>'s to be used almost interchangeably * with std::(w)string or const (w)char* arguments because the @@ -104,14 +100,10 @@ public: } #endif - -public: - operator string () const { return underlying.str(); } - /* note - this is declared const because binding temporaries does only * work for const references, so many function prototypes will * include const basic_formatter<T>& s but might still want to diff --git a/thirdparty/assimp/include/assimp/Vertex.h b/thirdparty/assimp/include/assimp/Vertex.h index 2a7f0256ad..5e63db5fe4 100644 --- a/thirdparty/assimp/include/assimp/Vertex.h +++ b/thirdparty/assimp/include/assimp/Vertex.h @@ -47,12 +47,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. that are not currently well-defined (and would cause compile errors due to missing operators in the math library), are commented. */ +#pragma once #ifndef AI_VERTEX_H_INC #define AI_VERTEX_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/vector3.h> #include <assimp/mesh.h> #include <assimp/ai_assert.h> + #include <functional> namespace Assimp { @@ -91,23 +97,14 @@ namespace Assimp { * to *all* vertex components equally. This is useful for stuff like interpolation * or subdivision, but won't work if special handling is required for some vertex components. */ // ------------------------------------------------------------------------------------------------ -class Vertex -{ +class Vertex { friend Vertex operator + (const Vertex&,const Vertex&); friend Vertex operator - (const Vertex&,const Vertex&); - -// friend Vertex operator + (const Vertex&,ai_real); -// friend Vertex operator - (const Vertex&,ai_real); friend Vertex operator * (const Vertex&,ai_real); friend Vertex operator / (const Vertex&,ai_real); - -// friend Vertex operator + (ai_real, const Vertex&); -// friend Vertex operator - (ai_real, const Vertex&); friend Vertex operator * (ai_real, const Vertex&); -// friend Vertex operator / (ai_real, const Vertex&); public: - Vertex() {} // ---------------------------------------------------------------------------- @@ -158,8 +155,6 @@ public: } } -public: - Vertex& operator += (const Vertex& v) { *this = *this+v; return *this; @@ -170,18 +165,6 @@ public: return *this; } - -/* - Vertex& operator += (ai_real v) { - *this = *this+v; - return *this; - } - - Vertex& operator -= (ai_real v) { - *this = *this-v; - return *this; - } -*/ Vertex& operator *= (ai_real v) { *this = *this*v; return *this; @@ -192,12 +175,9 @@ public: return *this; } -public: - // ---------------------------------------------------------------------------- /** Convert back to non-interleaved storage */ void SortBack(aiMesh* out, unsigned int idx) const { - ai_assert(idx<out->mNumVertices); out->mVertices[idx] = position; @@ -291,8 +271,6 @@ public: aiColor4D colors[AI_MAX_NUMBER_OF_COLOR_SETS]; }; - - // ------------------------------------------------------------------------------------------------ AI_FORCE_INLINE Vertex operator + (const Vertex& v0,const Vertex& v1) { return Vertex::BinaryOp<std::plus>(v0,v1); @@ -302,19 +280,6 @@ AI_FORCE_INLINE Vertex operator - (const Vertex& v0,const Vertex& v1) { return Vertex::BinaryOp<std::minus>(v0,v1); } - -// ------------------------------------------------------------------------------------------------ -/* -AI_FORCE_INLINE Vertex operator + (const Vertex& v0,ai_real f) { - return Vertex::BinaryOp<Intern::plus>(v0,f); -} - -AI_FORCE_INLINE Vertex operator - (const Vertex& v0,ai_real f) { - return Vertex::BinaryOp<Intern::minus>(v0,f); -} - -*/ - AI_FORCE_INLINE Vertex operator * (const Vertex& v0,ai_real f) { return Vertex::BinaryOp<Intern::multiplies>(v0,f); } @@ -323,26 +288,10 @@ AI_FORCE_INLINE Vertex operator / (const Vertex& v0,ai_real f) { return Vertex::BinaryOp<Intern::multiplies>(v0,1.f/f); } -// ------------------------------------------------------------------------------------------------ -/* -AI_FORCE_INLINE Vertex operator + (ai_real f,const Vertex& v0) { - return Vertex::BinaryOp<Intern::plus>(f,v0); -} - -AI_FORCE_INLINE Vertex operator - (ai_real f,const Vertex& v0) { - return Vertex::BinaryOp<Intern::minus>(f,v0); -} -*/ - AI_FORCE_INLINE Vertex operator * (ai_real f,const Vertex& v0) { return Vertex::BinaryOp<Intern::multiplies>(f,v0); } -/* -AI_FORCE_INLINE Vertex operator / (ai_real f,const Vertex& v0) { - return Vertex::BinaryOp<Intern::divides>(f,v0); } -*/ -} -#endif +#endif // AI_VERTEX_H_INC diff --git a/thirdparty/assimp/include/assimp/XMLTools.h b/thirdparty/assimp/include/assimp/XMLTools.h index b0d3276873..95f12cdebf 100644 --- a/thirdparty/assimp/include/assimp/XMLTools.h +++ b/thirdparty/assimp/include/assimp/XMLTools.h @@ -40,9 +40,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ +#pragma once #ifndef INCLUDED_ASSIMP_XML_TOOLS_H #define INCLUDED_ASSIMP_XML_TOOLS_H +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <string> namespace Assimp { diff --git a/thirdparty/assimp/include/assimp/aabb.h b/thirdparty/assimp/include/assimp/aabb.h index a20f317424..83bb62256b 100644 --- a/thirdparty/assimp/include/assimp/aabb.h +++ b/thirdparty/assimp/include/assimp/aabb.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -45,6 +43,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_AABB_H_INC #define AI_AABB_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/vector3.h> struct aiAABB { @@ -69,8 +71,9 @@ struct aiAABB { // empty } -#endif +#endif // __cplusplus + }; -#endif +#endif // AI_AABB_H_INC diff --git a/thirdparty/assimp/include/assimp/ai_assert.h b/thirdparty/assimp/include/assimp/ai_assert.h index e5de5d3f36..2b32b01d3e 100644 --- a/thirdparty/assimp/include/assimp/ai_assert.h +++ b/thirdparty/assimp/include/assimp/ai_assert.h @@ -44,6 +44,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_ASSERT_H_INC #define AI_ASSERT_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifdef ASSIMP_BUILD_DEBUG # include <assert.h> # define ai_assert(expression) assert( expression ) diff --git a/thirdparty/assimp/include/assimp/anim.h b/thirdparty/assimp/include/assimp/anim.h index 02e92739ec..e208b11adb 100644 --- a/thirdparty/assimp/include/assimp/anim.h +++ b/thirdparty/assimp/include/assimp/anim.h @@ -50,6 +50,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_ANIM_H_INC #define AI_ANIM_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/types.h> #include <assimp/quaternion.h> diff --git a/thirdparty/assimp/include/assimp/camera.h b/thirdparty/assimp/include/assimp/camera.h index e573eea5d1..adb749ff59 100644 --- a/thirdparty/assimp/include/assimp/camera.h +++ b/thirdparty/assimp/include/assimp/camera.h @@ -47,6 +47,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_CAMERA_H_INC #define AI_CAMERA_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include "types.h" #ifdef __cplusplus @@ -113,7 +117,6 @@ struct aiCamera */ C_STRUCT aiVector3D mPosition; - /** 'Up' - vector of the camera coordinate system relative to * the coordinate space defined by the corresponding node. * @@ -134,7 +137,6 @@ struct aiCamera */ C_STRUCT aiVector3D mLookAt; - /** Half horizontal field of view angle, in radians. * * The field of view angle is the angle between the center diff --git a/thirdparty/assimp/include/assimp/cexport.h b/thirdparty/assimp/include/assimp/cexport.h index 1d62dc26b3..cbc0253d50 100644 --- a/thirdparty/assimp/include/assimp/cexport.h +++ b/thirdparty/assimp/include/assimp/cexport.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2011, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -46,6 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_EXPORT_H_INC #define AI_EXPORT_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifndef ASSIMP_BUILD_NO_EXPORT // Public ASSIMP data structures diff --git a/thirdparty/assimp/include/assimp/cfileio.h b/thirdparty/assimp/include/assimp/cfileio.h index 8f7ca45469..be90999d87 100644 --- a/thirdparty/assimp/include/assimp/cfileio.h +++ b/thirdparty/assimp/include/assimp/cfileio.h @@ -48,10 +48,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FILEIO_H_INC #define AI_FILEIO_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/types.h> + #ifdef __cplusplus extern "C" { #endif + struct aiFileIO; struct aiFile; diff --git a/thirdparty/assimp/include/assimp/cimport.h b/thirdparty/assimp/include/assimp/cimport.h index dbd10f1370..66b1c9a174 100644 --- a/thirdparty/assimp/include/assimp/cimport.h +++ b/thirdparty/assimp/include/assimp/cimport.h @@ -48,8 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_ASSIMP_H_INC #define AI_ASSIMP_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/types.h> -#include "importerdesc.h" +#include <assimp/importerdesc.h> #ifdef __cplusplus extern "C" { diff --git a/thirdparty/assimp/include/assimp/color4.h b/thirdparty/assimp/include/assimp/color4.h index 3c97c8eda2..fa86128f4f 100644 --- a/thirdparty/assimp/include/assimp/color4.h +++ b/thirdparty/assimp/include/assimp/color4.h @@ -47,7 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COLOR4D_H_INC #define AI_COLOR4D_H_INC -#include "defs.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/defs.h> #ifdef __cplusplus @@ -56,8 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * alpha component. Color values range from 0 to 1. */ // ---------------------------------------------------------------------------------- template <typename TReal> -class aiColor4t -{ +class aiColor4t { public: aiColor4t() AI_NO_EXCEPT : r(), g(), b(), a() {} aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a) @@ -65,14 +68,12 @@ public: explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {} aiColor4t (const aiColor4t& o) = default; -public: // combined operators const aiColor4t& operator += (const aiColor4t& o); const aiColor4t& operator -= (const aiColor4t& o); const aiColor4t& operator *= (TReal f); const aiColor4t& operator /= (TReal f); -public: // comparison bool operator == (const aiColor4t& other) const; bool operator != (const aiColor4t& other) const; @@ -85,8 +86,6 @@ public: /** check whether a color is (close to) black */ inline bool IsBlack() const; -public: - // Red, green, blue and alpha color values TReal r, g, b, a; }; // !struct aiColor4D diff --git a/thirdparty/assimp/include/assimp/color4.inl b/thirdparty/assimp/include/assimp/color4.inl index afa53dcb5b..d4a2a98109 100644 --- a/thirdparty/assimp/include/assimp/color4.inl +++ b/thirdparty/assimp/include/assimp/color4.inl @@ -48,36 +48,61 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COLOR4D_INL_INC #define AI_COLOR4D_INL_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifdef __cplusplus -#include "color4.h" +#include <assimp/color4.h> // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator += (const aiColor4t<TReal>& o) { - r += o.r; g += o.g; b += o.b; a += o.a; +AI_FORCE_INLINE +const aiColor4t<TReal>& aiColor4t<TReal>::operator += (const aiColor4t<TReal>& o) { + r += o.r; + g += o.g; + b += o.b; + a += o.a; + return *this; } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator -= (const aiColor4t<TReal>& o) { - r -= o.r; g -= o.g; b -= o.b; a -= o.a; +AI_FORCE_INLINE +const aiColor4t<TReal>& aiColor4t<TReal>::operator -= (const aiColor4t<TReal>& o) { + r -= o.r; + g -= o.g; + b -= o.b; + a -= o.a; + return *this; } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator *= (TReal f) { - r *= f; g *= f; b *= f; a *= f; +AI_FORCE_INLINE +const aiColor4t<TReal>& aiColor4t<TReal>::operator *= (TReal f) { + r *= f; + g *= f; + b *= f; + a *= f; + return *this; } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE const aiColor4t<TReal>& aiColor4t<TReal>::operator /= (TReal f) { - r /= f; g /= f; b /= f; a /= f; +AI_FORCE_INLINE +const aiColor4t<TReal>& aiColor4t<TReal>::operator /= (TReal f) { + r /= f; + g /= f; + b /= f; + a /= f; + return *this; } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE TReal aiColor4t<TReal>::operator[](unsigned int i) const { +AI_FORCE_INLINE +TReal aiColor4t<TReal>::operator[](unsigned int i) const { switch ( i ) { case 0: return r; @@ -94,7 +119,8 @@ AI_FORCE_INLINE TReal aiColor4t<TReal>::operator[](unsigned int i) const { } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE TReal& aiColor4t<TReal>::operator[](unsigned int i) { +AI_FORCE_INLINE +TReal& aiColor4t<TReal>::operator[](unsigned int i) { switch ( i ) { case 0: return r; @@ -111,17 +137,20 @@ AI_FORCE_INLINE TReal& aiColor4t<TReal>::operator[](unsigned int i) { } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE bool aiColor4t<TReal>::operator== (const aiColor4t<TReal>& other) const { +AI_FORCE_INLINE +bool aiColor4t<TReal>::operator== (const aiColor4t<TReal>& other) const { return r == other.r && g == other.g && b == other.b && a == other.a; } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE bool aiColor4t<TReal>::operator!= (const aiColor4t<TReal>& other) const { +AI_FORCE_INLINE +bool aiColor4t<TReal>::operator!= (const aiColor4t<TReal>& other) const { return r != other.r || g != other.g || b != other.b || a != other.a; } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE bool aiColor4t<TReal>::operator< (const aiColor4t<TReal>& other) const { +AI_FORCE_INLINE +bool aiColor4t<TReal>::operator< (const aiColor4t<TReal>& other) const { return r < other.r || ( r == other.r && ( g < other.g || ( @@ -136,14 +165,17 @@ AI_FORCE_INLINE bool aiColor4t<TReal>::operator< (const aiColor4t<TReal>& other) ) ); } + // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator + (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) { +AI_FORCE_INLINE +aiColor4t<TReal> operator + (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) { return aiColor4t<TReal>( v1.r + v2.r, v1.g + v2.g, v1.b + v2.b, v1.a + v2.a); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator - (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) { +AI_FORCE_INLINE +aiColor4t<TReal> operator - (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) { return aiColor4t<TReal>( v1.r - v2.r, v1.g - v2.g, v1.b - v2.b, v1.a - v2.a); } // ------------------------------------------------------------------------------------------------ @@ -153,53 +185,63 @@ AI_FORCE_INLINE aiColor4t<TReal> operator * (const aiColor4t<TReal>& v1, const a } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator / (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) { +AI_FORCE_INLINE +aiColor4t<TReal> operator / (const aiColor4t<TReal>& v1, const aiColor4t<TReal>& v2) { return aiColor4t<TReal>( v1.r / v2.r, v1.g / v2.g, v1.b / v2.b, v1.a / v2.a); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator * ( TReal f, const aiColor4t<TReal>& v) { +AI_FORCE_INLINE +aiColor4t<TReal> operator * ( TReal f, const aiColor4t<TReal>& v) { return aiColor4t<TReal>( f*v.r, f*v.g, f*v.b, f*v.a); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator * ( const aiColor4t<TReal>& v, TReal f) { +AI_FORCE_INLINE +aiColor4t<TReal> operator * ( const aiColor4t<TReal>& v, TReal f) { return aiColor4t<TReal>( f*v.r, f*v.g, f*v.b, f*v.a); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator / ( const aiColor4t<TReal>& v, TReal f) { +AI_FORCE_INLINE +aiColor4t<TReal> operator / ( const aiColor4t<TReal>& v, TReal f) { return v * (1/f); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator / ( TReal f,const aiColor4t<TReal>& v) { +AI_FORCE_INLINE +aiColor4t<TReal> operator / ( TReal f,const aiColor4t<TReal>& v) { return aiColor4t<TReal>(f,f,f,f)/v; } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator + ( const aiColor4t<TReal>& v, TReal f) { +AI_FORCE_INLINE +aiColor4t<TReal> operator + ( const aiColor4t<TReal>& v, TReal f) { return aiColor4t<TReal>( f+v.r, f+v.g, f+v.b, f+v.a); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator - ( const aiColor4t<TReal>& v, TReal f) { +AI_FORCE_INLINE +aiColor4t<TReal> operator - ( const aiColor4t<TReal>& v, TReal f) { return aiColor4t<TReal>( v.r-f, v.g-f, v.b-f, v.a-f); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator + ( TReal f, const aiColor4t<TReal>& v) { +AI_FORCE_INLINE +aiColor4t<TReal> operator + ( TReal f, const aiColor4t<TReal>& v) { return aiColor4t<TReal>( f+v.r, f+v.g, f+v.b, f+v.a); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -AI_FORCE_INLINE aiColor4t<TReal> operator - ( TReal f, const aiColor4t<TReal>& v) { +AI_FORCE_INLINE +aiColor4t<TReal> operator - ( TReal f, const aiColor4t<TReal>& v) { return aiColor4t<TReal>( f-v.r, f-v.g, f-v.b, f-v.a); } // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline bool aiColor4t<TReal> :: IsBlack() const { +AI_FORCE_INLINE +bool aiColor4t<TReal>::IsBlack() const { // The alpha component doesn't care here. black is black. static const TReal epsilon = 10e-3f; return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) < epsilon; diff --git a/thirdparty/assimp/include/assimp/defs.h b/thirdparty/assimp/include/assimp/defs.h index 05a5e3fd4b..6f2f8ae88b 100644 --- a/thirdparty/assimp/include/assimp/defs.h +++ b/thirdparty/assimp/include/assimp/defs.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -50,6 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_DEFINES_H_INC #define AI_DEFINES_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/config.h> ////////////////////////////////////////////////////////////////////////// @@ -126,16 +128,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * GENBOUNDINGBOXES */ ////////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER +#ifdef _WIN32 # undef ASSIMP_API - ////////////////////////////////////////////////////////////////////////// /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */ ////////////////////////////////////////////////////////////////////////// # ifdef ASSIMP_BUILD_DLL_EXPORT # define ASSIMP_API __declspec(dllexport) # define ASSIMP_API_WINONLY __declspec(dllexport) -# pragma warning (disable : 4251) ////////////////////////////////////////////////////////////////////////// /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in @@ -148,7 +148,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # define ASSIMP_API # define ASSIMP_API_WINONLY # endif +#elif defined(SWIG) + + /* Do nothing, the relevant defines are all in AssimpSwigPort.i */ +#else +# define ASSIMP_API __attribute__ ((visibility("default"))) +# define ASSIMP_API_WINONLY +#endif + +#ifdef _MSC_VER +# ifdef ASSIMP_BUILD_DLL_EXPORT +# pragma warning (disable : 4251) +# endif /* Force the compiler to inline a function, if possible */ # define AI_FORCE_INLINE __forceinline @@ -156,17 +168,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Tells the compiler that a function never returns. Used in code analysis * to skip dead paths (e.g. after an assertion evaluated to false). */ # define AI_WONT_RETURN __declspec(noreturn) - #elif defined(SWIG) /* Do nothing, the relevant defines are all in AssimpSwigPort.i */ #else - # define AI_WONT_RETURN - -# define ASSIMP_API __attribute__ ((visibility("default"))) -# define ASSIMP_API_WINONLY # define AI_FORCE_INLINE inline #endif // (defined _MSC_VER) @@ -291,9 +298,10 @@ static const ai_real ai_epsilon = (ai_real) 0.00001; #endif -/* To avoid running out of memory - * This can be adjusted for specific use cases - * It's NOT a total limit, just a limit for individual allocations +/** + * To avoid running out of memory + * This can be adjusted for specific use cases + * It's NOT a total limit, just a limit for individual allocations */ #define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type)) @@ -307,4 +315,13 @@ static const ai_real ai_epsilon = (ai_real) 0.00001; # endif #endif // _MSC_VER +/** + * Helper macro to set a pointer to NULL in debug builds + */ +#if (defined ASSIMP_BUILD_DEBUG) +# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL; +#else +# define AI_DEBUG_INVALIDATE_PTR(x) +#endif + #endif // !! AI_DEFINES_H_INC diff --git a/thirdparty/assimp/include/assimp/fast_atof.h b/thirdparty/assimp/include/assimp/fast_atof.h index 62ea969e97..6e9a1bba7a 100644 --- a/thirdparty/assimp/include/assimp/fast_atof.h +++ b/thirdparty/assimp/include/assimp/fast_atof.h @@ -13,10 +13,14 @@ // to ensure long numbers are handled correctly // ------------------------------------------------------------------------------------ - +#pragma once #ifndef FAST_A_TO_F_H_INCLUDED #define FAST_A_TO_F_H_INCLUDED +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <cmath> #include <limits> #include <stdint.h> diff --git a/thirdparty/assimp/include/assimp/importerdesc.h b/thirdparty/assimp/include/assimp/importerdesc.h index 36e387f011..0a6919c1ae 100644 --- a/thirdparty/assimp/include/assimp/importerdesc.h +++ b/thirdparty/assimp/include/assimp/importerdesc.h @@ -48,11 +48,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_IMPORTER_DESC_H_INC #define AI_IMPORTER_DESC_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + /** Mixed set of flags for #aiImporterDesc, indicating some features * common to many importers*/ -enum aiImporterFlags -{ +enum aiImporterFlags { /** Indicates that there is a textual encoding of the * file format; and that it is supported.*/ aiImporterFlags_SupportTextFlavour = 0x1, @@ -87,8 +90,7 @@ enum aiImporterFlags * as importers/exporters are added to Assimp, so it might be useful * to have a common mechanism to query some rough importer * characteristics. */ -struct aiImporterDesc -{ +struct aiImporterDesc { /** Full name of the importer (i.e. Blender3D importer)*/ const char* mName; diff --git a/thirdparty/assimp/include/assimp/light.h b/thirdparty/assimp/include/assimp/light.h index 1667cfb8c1..bdb2368c4f 100644 --- a/thirdparty/assimp/include/assimp/light.h +++ b/thirdparty/assimp/include/assimp/light.h @@ -49,7 +49,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_LIGHT_H_INC #define AI_LIGHT_H_INC -#include "types.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/types.h> #ifdef __cplusplus extern "C" { diff --git a/thirdparty/assimp/include/assimp/material.h b/thirdparty/assimp/include/assimp/material.h index 206eb2a2b0..19a7c69709 100644 --- a/thirdparty/assimp/include/assimp/material.h +++ b/thirdparty/assimp/include/assimp/material.h @@ -48,7 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MATERIAL_H_INC #define AI_MATERIAL_H_INC -#include "types.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/types.h> #ifdef __cplusplus extern "C" { diff --git a/thirdparty/assimp/include/assimp/material.inl b/thirdparty/assimp/include/assimp/material.inl index b05d6af6c3..8ae6b88d3e 100644 --- a/thirdparty/assimp/include/assimp/material.inl +++ b/thirdparty/assimp/include/assimp/material.inl @@ -49,14 +49,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MATERIAL_INL_INC #define AI_MATERIAL_INL_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + // --------------------------------------------------------------------------- -inline aiPropertyTypeInfo ai_real_to_property_type_info(float) -{ +AI_FORCE_INLINE +aiPropertyTypeInfo ai_real_to_property_type_info(float) { return aiPTI_Float; } -inline aiPropertyTypeInfo ai_real_to_property_type_info(double) -{ +AI_FORCE_INLINE +aiPropertyTypeInfo ai_real_to_property_type_info(double) { return aiPTI_Double; } // --------------------------------------------------------------------------- @@ -64,30 +68,30 @@ inline aiPropertyTypeInfo ai_real_to_property_type_info(double) //! @cond never // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::GetTexture( aiTextureType type, - unsigned int index, - C_STRUCT aiString* path, - aiTextureMapping* mapping /*= NULL*/, - unsigned int* uvindex /*= NULL*/, - ai_real* blend /*= NULL*/, - aiTextureOp* op /*= NULL*/, - aiTextureMapMode* mapmode /*= NULL*/) const -{ +AI_FORCE_INLINE +aiReturn aiMaterial::GetTexture( aiTextureType type, + unsigned int index, + C_STRUCT aiString* path, + aiTextureMapping* mapping /*= NULL*/, + unsigned int* uvindex /*= NULL*/, + ai_real* blend /*= NULL*/, + aiTextureOp* op /*= NULL*/, + aiTextureMapMode* mapmode /*= NULL*/) const { return ::aiGetMaterialTexture(this,type,index,path,mapping,uvindex,blend,op,mapmode); } // --------------------------------------------------------------------------- -inline unsigned int aiMaterial::GetTextureCount(aiTextureType type) const -{ +AI_FORCE_INLINE +unsigned int aiMaterial::GetTextureCount(aiTextureType type) const { return ::aiGetMaterialTextureCount(this,type); } // --------------------------------------------------------------------------- template <typename Type> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx, Type* pOut, - unsigned int* pMax) const -{ +AI_FORCE_INLINE +aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx, Type* pOut, + unsigned int* pMax) const { unsigned int iNum = pMax ? *pMax : 1; const aiMaterialProperty* prop; @@ -114,9 +118,9 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, // --------------------------------------------------------------------------- template <typename Type> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,Type& pOut) const -{ +AI_FORCE_INLINE +aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,Type& pOut) const { const aiMaterialProperty* prop; const aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx, (const aiMaterialProperty**)&prop); @@ -136,60 +140,56 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,ai_real* pOut, - unsigned int* pMax) const -{ +AI_FORCE_INLINE +aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,ai_real* pOut, + unsigned int* pMax) const { return ::aiGetMaterialFloatArray(this,pKey,type,idx,pOut,pMax); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,int* pOut, - unsigned int* pMax) const -{ +AI_FORCE_INLINE +aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,int* pOut, + unsigned int* pMax) const { return ::aiGetMaterialIntegerArray(this,pKey,type,idx,pOut,pMax); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,ai_real& pOut) const -{ +AI_FORCE_INLINE +aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,ai_real& pOut) const { return aiGetMaterialFloat(this,pKey,type,idx,&pOut); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,int& pOut) const -{ +AI_FORCE_INLINE +aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,int& pOut) const { return aiGetMaterialInteger(this,pKey,type,idx,&pOut); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,aiColor4D& pOut) const -{ +AI_FORCE_INLINE +aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,aiColor4D& pOut) const { return aiGetMaterialColor(this,pKey,type,idx,&pOut); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,aiColor3D& pOut) const -{ +AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,aiColor3D& pOut) const { aiColor4D c; const aiReturn ret = aiGetMaterialColor(this,pKey,type,idx,&c); pOut = aiColor3D(c.r,c.g,c.b); return ret; } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,aiString& pOut) const -{ +AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,aiString& pOut) const { return aiGetMaterialString(this,pKey,type,idx,&pOut); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,aiUVTransform& pOut) const -{ +AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,aiUVTransform& pOut) const { return aiGetMaterialUVTransform(this,pKey,type,idx,&pOut); } - // --------------------------------------------------------------------------- template<class TYPE> aiReturn aiMaterial::AddProperty (const TYPE* pInput, @@ -204,84 +204,83 @@ aiReturn aiMaterial::AddProperty (const TYPE* pInput, } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::AddProperty(const float* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const float* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(float), pKey,type,index,aiPTI_Float); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::AddProperty(const double* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty(const double* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(double), pKey,type,index,aiPTI_Double); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(aiUVTransform), pKey,type,index,ai_real_to_property_type_info(pInput->mRotation)); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(aiColor4D), pKey,type,index,ai_real_to_property_type_info(pInput->a)); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(aiColor3D), pKey,type,index,ai_real_to_property_type_info(pInput->b)); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(aiVector3D), pKey,type,index,ai_real_to_property_type_info(pInput->x)); } // --------------------------------------------------------------------------- -inline aiReturn aiMaterial::AddProperty(const int* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty(const int* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(int), pKey,type,index,aiPTI_Integer); @@ -296,12 +295,12 @@ inline aiReturn aiMaterial::AddProperty(const int* pInput, // --------------------------------------------------------------------------- template<> -inline aiReturn aiMaterial::AddProperty<float>(const float* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty<float>(const float* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(float), pKey,type,index,aiPTI_Float); @@ -309,12 +308,12 @@ inline aiReturn aiMaterial::AddProperty<float>(const float* pInput, // --------------------------------------------------------------------------- template<> -inline aiReturn aiMaterial::AddProperty<double>(const double* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty<double>(const double* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(double), pKey,type,index,aiPTI_Double); @@ -322,12 +321,12 @@ inline aiReturn aiMaterial::AddProperty<double>(const double* pInput, // --------------------------------------------------------------------------- template<> -inline aiReturn aiMaterial::AddProperty<aiUVTransform>(const aiUVTransform* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty<aiUVTransform>(const aiUVTransform* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(aiUVTransform), pKey,type,index,aiPTI_Float); @@ -335,12 +334,12 @@ inline aiReturn aiMaterial::AddProperty<aiUVTransform>(const aiUVTransform* pInp // --------------------------------------------------------------------------- template<> -inline aiReturn aiMaterial::AddProperty<aiColor4D>(const aiColor4D* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty<aiColor4D>(const aiColor4D* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(aiColor4D), pKey,type,index,aiPTI_Float); @@ -348,12 +347,12 @@ inline aiReturn aiMaterial::AddProperty<aiColor4D>(const aiColor4D* pInput, // --------------------------------------------------------------------------- template<> -inline aiReturn aiMaterial::AddProperty<aiColor3D>(const aiColor3D* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty<aiColor3D>(const aiColor3D* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(aiColor3D), pKey,type,index,aiPTI_Float); @@ -361,12 +360,12 @@ inline aiReturn aiMaterial::AddProperty<aiColor3D>(const aiColor3D* pInput, // --------------------------------------------------------------------------- template<> -inline aiReturn aiMaterial::AddProperty<aiVector3D>(const aiVector3D* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty<aiVector3D>(const aiVector3D* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(aiVector3D), pKey,type,index,aiPTI_Float); @@ -374,12 +373,12 @@ inline aiReturn aiMaterial::AddProperty<aiVector3D>(const aiVector3D* pInput, // --------------------------------------------------------------------------- template<> -inline aiReturn aiMaterial::AddProperty<int>(const int* pInput, - const unsigned int pNumValues, - const char* pKey, - unsigned int type, - unsigned int index) -{ +AI_FORCE_INLINE +aiReturn aiMaterial::AddProperty<int>(const int* pInput, + const unsigned int pNumValues, + const char* pKey, + unsigned int type, + unsigned int index) { return AddBinaryProperty((const void*)pInput, pNumValues * sizeof(int), pKey,type,index,aiPTI_Integer); diff --git a/thirdparty/assimp/include/assimp/matrix3x3.h b/thirdparty/assimp/include/assimp/matrix3x3.h index 22b69561ff..2c26cf92bb 100644 --- a/thirdparty/assimp/include/assimp/matrix3x3.h +++ b/thirdparty/assimp/include/assimp/matrix3x3.h @@ -48,7 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MATRIX3X3_H_INC #define AI_MATRIX3X3_H_INC -#include "defs.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/defs.h> #ifdef __cplusplus @@ -65,10 +69,8 @@ template <typename T> class aiVector2t; * defined thereby. */ template <typename TReal> -class aiMatrix3x3t -{ +class aiMatrix3x3t { public: - aiMatrix3x3t() AI_NO_EXCEPT : a1(static_cast<TReal>(1.0f)), a2(), a3(), b1(), b2(static_cast<TReal>(1.0f)), b3(), @@ -82,8 +84,6 @@ public: c1(_c1), c2(_c2), c3(_c3) {} -public: - // matrix multiplication. aiMatrix3x3t& operator *= (const aiMatrix3x3t& m); aiMatrix3x3t operator * (const aiMatrix3x3t& m) const; @@ -101,8 +101,6 @@ public: template <typename TOther> operator aiMatrix3x3t<TOther> () const; -public: - // ------------------------------------------------------------------- /** @brief Construction from a 4x4 matrix. The remaining parts * of the matrix are ignored. @@ -122,7 +120,6 @@ public: aiMatrix3x3t& Inverse(); TReal Determinant() const; -public: // ------------------------------------------------------------------- /** @brief Returns a rotation matrix for a rotation around z * @param a Rotation angle, in radians diff --git a/thirdparty/assimp/include/assimp/matrix3x3.inl b/thirdparty/assimp/include/assimp/matrix3x3.inl index d9d45a3e92..1ce8c9691c 100644 --- a/thirdparty/assimp/include/assimp/matrix3x3.inl +++ b/thirdparty/assimp/include/assimp/matrix3x3.inl @@ -48,10 +48,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MATRIX3X3_INL_INC #define AI_MATRIX3X3_INL_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifdef __cplusplus -#include "matrix3x3.h" +#include <assimp/matrix3x3.h> +#include <assimp/matrix4x4.h> -#include "matrix4x4.h" #include <algorithm> #include <cmath> #include <limits> @@ -59,8 +63,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ------------------------------------------------------------------------------------------------ // Construction from a 4x4 matrix. The remaining parts of the matrix are ignored. template <typename TReal> -inline aiMatrix3x3t<TReal>::aiMatrix3x3t( const aiMatrix4x4t<TReal>& pMatrix) -{ +AI_FORCE_INLINE +aiMatrix3x3t<TReal>::aiMatrix3x3t( const aiMatrix4x4t<TReal>& pMatrix) { a1 = pMatrix.a1; a2 = pMatrix.a2; a3 = pMatrix.a3; b1 = pMatrix.b1; b2 = pMatrix.b2; b3 = pMatrix.b3; c1 = pMatrix.c1; c2 = pMatrix.c2; c3 = pMatrix.c3; @@ -68,8 +72,8 @@ inline aiMatrix3x3t<TReal>::aiMatrix3x3t( const aiMatrix4x4t<TReal>& pMatrix) // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::operator *= (const aiMatrix3x3t<TReal>& m) -{ +AI_FORCE_INLINE +aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::operator *= (const aiMatrix3x3t<TReal>& m) { *this = aiMatrix3x3t<TReal>(m.a1 * a1 + m.b1 * a2 + m.c1 * a3, m.a2 * a1 + m.b2 * a2 + m.c2 * a3, m.a3 * a1 + m.b3 * a2 + m.c3 * a3, @@ -85,8 +89,7 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::operator *= (const aiMatrix3x3t // ------------------------------------------------------------------------------------------------ template <typename TReal> template <typename TOther> -aiMatrix3x3t<TReal>::operator aiMatrix3x3t<TOther> () const -{ +aiMatrix3x3t<TReal>::operator aiMatrix3x3t<TOther> () const { return aiMatrix3x3t<TOther>(static_cast<TOther>(a1),static_cast<TOther>(a2),static_cast<TOther>(a3), static_cast<TOther>(b1),static_cast<TOther>(b2),static_cast<TOther>(b3), static_cast<TOther>(c1),static_cast<TOther>(c2),static_cast<TOther>(c3)); @@ -94,8 +97,8 @@ aiMatrix3x3t<TReal>::operator aiMatrix3x3t<TOther> () const // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline aiMatrix3x3t<TReal> aiMatrix3x3t<TReal>::operator* (const aiMatrix3x3t<TReal>& m) const -{ +AI_FORCE_INLINE +aiMatrix3x3t<TReal> aiMatrix3x3t<TReal>::operator* (const aiMatrix3x3t<TReal>& m) const { aiMatrix3x3t<TReal> temp( *this); temp *= m; return temp; @@ -103,7 +106,8 @@ inline aiMatrix3x3t<TReal> aiMatrix3x3t<TReal>::operator* (const aiMatrix3x3t<TR // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) { +AI_FORCE_INLINE +TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) { switch ( p_iIndex ) { case 0: return &a1; @@ -119,7 +123,8 @@ inline TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) { // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline const TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) const { +AI_FORCE_INLINE +const TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) const { switch ( p_iIndex ) { case 0: return &a1; @@ -135,8 +140,8 @@ inline const TReal* aiMatrix3x3t<TReal>::operator[] (unsigned int p_iIndex) cons // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline bool aiMatrix3x3t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const -{ +AI_FORCE_INLINE +bool aiMatrix3x3t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const { return a1 == m.a1 && a2 == m.a2 && a3 == m.a3 && b1 == m.b1 && b2 == m.b2 && b3 == m.b3 && c1 == m.c1 && c2 == m.c2 && c3 == m.c3; @@ -144,14 +149,15 @@ inline bool aiMatrix3x3t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline bool aiMatrix3x3t<TReal>::operator!= (const aiMatrix4x4t<TReal>& m) const -{ +AI_FORCE_INLINE +bool aiMatrix3x3t<TReal>::operator!= (const aiMatrix4x4t<TReal>& m) const { return !(*this == m); } // --------------------------------------------------------------------------- template<typename TReal> -inline bool aiMatrix3x3t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) const { +AI_FORCE_INLINE +bool aiMatrix3x3t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) const { return std::abs(a1 - m.a1) <= epsilon && std::abs(a2 - m.a2) <= epsilon && @@ -166,8 +172,8 @@ inline bool aiMatrix3x3t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsil // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Transpose() -{ +AI_FORCE_INLINE +aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Transpose() { // (TReal&) don't remove, GCC complains cause of packed fields std::swap( (TReal&)a2, (TReal&)b1); std::swap( (TReal&)a3, (TReal&)c1); @@ -177,15 +183,15 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Transpose() // ---------------------------------------------------------------------------------------- template <typename TReal> -inline TReal aiMatrix3x3t<TReal>::Determinant() const -{ +AI_FORCE_INLINE +TReal aiMatrix3x3t<TReal>::Determinant() const { return a1*b2*c3 - a1*b3*c2 + a2*b3*c1 - a2*b1*c3 + a3*b1*c2 - a3*b2*c1; } // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Inverse() -{ +AI_FORCE_INLINE +aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Inverse() { // Compute the reciprocal determinant TReal det = Determinant(); if(det == static_cast<TReal>(0.0)) @@ -219,8 +225,8 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Inverse() // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t<TReal>& out) -{ +AI_FORCE_INLINE +aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t<TReal>& out) { out.a1 = out.b2 = std::cos(a); out.b1 = std::sin(a); out.a2 = - out.b1; @@ -234,8 +240,8 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t // ------------------------------------------------------------------------------------------------ // Returns a rotation matrix for a rotation around an arbitrary axis. template <typename TReal> -inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix3x3t<TReal>& out) -{ +AI_FORCE_INLINE +aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix3x3t<TReal>& out) { TReal c = std::cos( a), s = std::sin( a), t = 1 - c; TReal x = axis.x, y = axis.y, z = axis.z; @@ -249,8 +255,8 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Rotation( TReal a, const aiVect // ------------------------------------------------------------------------------------------------ template <typename TReal> -inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Translation( const aiVector2t<TReal>& v, aiMatrix3x3t<TReal>& out) -{ +AI_FORCE_INLINE +aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Translation( const aiVector2t<TReal>& v, aiMatrix3x3t<TReal>& out) { out = aiMatrix3x3t<TReal>(); out.a3 = v.x; out.b3 = v.y; @@ -268,9 +274,8 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Translation( const aiVector2t<T */ // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::FromToMatrix(const aiVector3t<TReal>& from, - const aiVector3t<TReal>& to, aiMatrix3x3t<TReal>& mtx) -{ +AI_FORCE_INLINE aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::FromToMatrix(const aiVector3t<TReal>& from, + const aiVector3t<TReal>& to, aiMatrix3x3t<TReal>& mtx) { const TReal e = from * to; const TReal f = (e < 0)? -e:e; @@ -352,6 +357,5 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::FromToMatrix(const aiVector3t<T return mtx; } - #endif // __cplusplus #endif // AI_MATRIX3X3_INL_INC diff --git a/thirdparty/assimp/include/assimp/matrix4x4.h b/thirdparty/assimp/include/assimp/matrix4x4.h index 046bb535f2..8fc216f669 100644 --- a/thirdparty/assimp/include/assimp/matrix4x4.h +++ b/thirdparty/assimp/include/assimp/matrix4x4.h @@ -47,8 +47,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MATRIX4X4_H_INC #define AI_MATRIX4X4_H_INC -#include "vector3.h" -#include "defs.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/vector3.h> +#include <assimp/defs.h> #ifdef __cplusplus @@ -66,8 +70,7 @@ template<typename TReal> class aiQuaterniont; * defined thereby. */ template<typename TReal> -class aiMatrix4x4t -{ +class aiMatrix4x4t { public: /** set to identity */ @@ -91,8 +94,6 @@ public: aiMatrix4x4t(const aiVector3t<TReal>& scaling, const aiQuaterniont<TReal>& rotation, const aiVector3t<TReal>& position); -public: - // array access operators /** @fn TReal* operator[] (unsigned int p_iIndex) * @param [in] p_iIndex - index of the row. @@ -120,8 +121,6 @@ public: template <typename TOther> operator aiMatrix4x4t<TOther> () const; -public: - // ------------------------------------------------------------------- /** @brief Transpose the matrix */ aiMatrix4x4t& Transpose(); @@ -182,7 +181,6 @@ public: void DecomposeNoScaling (aiQuaterniont<TReal>& rotation, aiVector3t<TReal>& position) const; - // ------------------------------------------------------------------- /** @brief Creates a trafo matrix from a set of euler angles * @param x Rotation angle for the x-axis, in radians @@ -192,7 +190,6 @@ public: aiMatrix4x4t& FromEulerAnglesXYZ(TReal x, TReal y, TReal z); aiMatrix4x4t& FromEulerAnglesXYZ(const aiVector3t<TReal>& blubb); -public: // ------------------------------------------------------------------- /** @brief Returns a rotation matrix for a rotation around the x axis * @param a Rotation angle, in radians @@ -256,7 +253,6 @@ public: static aiMatrix4x4t& FromToMatrix(const aiVector3t<TReal>& from, const aiVector3t<TReal>& to, aiMatrix4x4t& out); -public: TReal a1, a2, a3, a4; TReal b1, b2, b3, b4; TReal c1, c2, c3, c4; diff --git a/thirdparty/assimp/include/assimp/matrix4x4.inl b/thirdparty/assimp/include/assimp/matrix4x4.inl index ebc67a06ec..84079974f7 100644 --- a/thirdparty/assimp/include/assimp/matrix4x4.inl +++ b/thirdparty/assimp/include/assimp/matrix4x4.inl @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -53,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "matrix4x4.h" #include "matrix3x3.h" #include "quaternion.h" +#include "MathFunctions.h" #include <algorithm> #include <limits> @@ -61,12 +60,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ---------------------------------------------------------------------------------------- template <typename TReal> aiMatrix4x4t<TReal>::aiMatrix4x4t() AI_NO_EXCEPT : - a1(1.0f), a2(), a3(), a4(), - b1(), b2(1.0f), b3(), b4(), - c1(), c2(), c3(1.0f), c4(), - d1(), d2(), d3(), d4(1.0f) -{ - + a1(1.0f), a2(), a3(), a4(), + b1(), b2(1.0f), b3(), b4(), + c1(), c2(), c3(1.0f), c4(), + d1(), d2(), d3(), d4(1.0f) { + // empty } // ---------------------------------------------------------------------------------------- @@ -75,19 +73,17 @@ aiMatrix4x4t<TReal>::aiMatrix4x4t (TReal _a1, TReal _a2, TReal _a3, TReal _a4, TReal _b1, TReal _b2, TReal _b3, TReal _b4, TReal _c1, TReal _c2, TReal _c3, TReal _c4, TReal _d1, TReal _d2, TReal _d3, TReal _d4) : - a1(_a1), a2(_a2), a3(_a3), a4(_a4), - b1(_b1), b2(_b2), b3(_b3), b4(_b4), - c1(_c1), c2(_c2), c3(_c3), c4(_c4), - d1(_d1), d2(_d2), d3(_d3), d4(_d4) -{ - + a1(_a1), a2(_a2), a3(_a3), a4(_a4), + b1(_b1), b2(_b2), b3(_b3), b4(_b4), + c1(_c1), c2(_c2), c3(_c3), c4(_c4), + d1(_d1), d2(_d2), d3(_d3), d4(_d4) { + // empty } // ------------------------------------------------------------------------------------------------ template <typename TReal> template <typename TOther> -aiMatrix4x4t<TReal>::operator aiMatrix4x4t<TOther> () const -{ +aiMatrix4x4t<TReal>::operator aiMatrix4x4t<TOther> () const { return aiMatrix4x4t<TOther>(static_cast<TOther>(a1),static_cast<TOther>(a2),static_cast<TOther>(a3),static_cast<TOther>(a4), static_cast<TOther>(b1),static_cast<TOther>(b2),static_cast<TOther>(b3),static_cast<TOther>(b4), static_cast<TOther>(c1),static_cast<TOther>(c2),static_cast<TOther>(c3),static_cast<TOther>(c4), @@ -97,8 +93,8 @@ aiMatrix4x4t<TReal>::operator aiMatrix4x4t<TOther> () const // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiMatrix3x3t<TReal>& m) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiMatrix3x3t<TReal>& m) { a1 = m.a1; a2 = m.a2; a3 = m.a3; a4 = static_cast<TReal>(0.0); b1 = m.b1; b2 = m.b2; b3 = m.b3; b4 = static_cast<TReal>(0.0); c1 = m.c1; c2 = m.c2; c3 = m.c3; c4 = static_cast<TReal>(0.0); @@ -107,8 +103,8 @@ inline aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiMatrix3x3t<TReal>& m) // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiVector3t<TReal>& scaling, const aiQuaterniont<TReal>& rotation, const aiVector3t<TReal>& position) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiVector3t<TReal>& scaling, const aiQuaterniont<TReal>& rotation, const aiVector3t<TReal>& position) { // build a 3x3 rotation matrix aiMatrix3x3t<TReal> m = rotation.GetMatrix(); @@ -135,8 +131,8 @@ inline aiMatrix4x4t<TReal>::aiMatrix4x4t (const aiVector3t<TReal>& scaling, cons // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::operator *= (const aiMatrix4x4t<TReal>& m) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::operator *= (const aiMatrix4x4t<TReal>& m) { *this = aiMatrix4x4t<TReal>( m.a1 * a1 + m.b1 * a2 + m.c1 * a3 + m.d1 * a4, m.a2 * a1 + m.b2 * a2 + m.c2 * a3 + m.d2 * a4, @@ -159,8 +155,7 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::operator *= (const aiMatrix4x4t // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const TReal& aFloat) const -{ +AI_FORCE_INLINE aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const TReal& aFloat) const { aiMatrix4x4t<TReal> temp( a1 * aFloat, a2 * aFloat, @@ -183,8 +178,8 @@ inline aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const TReal& aFloat) // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator+ (const aiMatrix4x4t<TReal>& m) const -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator+ (const aiMatrix4x4t<TReal>& m) const { aiMatrix4x4t<TReal> temp( m.a1 + a1, m.a2 + a2, @@ -207,18 +202,16 @@ inline aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator+ (const aiMatrix4x4t<TR // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const aiMatrix4x4t<TReal>& m) const -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal> aiMatrix4x4t<TReal>::operator* (const aiMatrix4x4t<TReal>& m) const { aiMatrix4x4t<TReal> temp( *this); temp *= m; return temp; } - // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Transpose() -{ +AI_FORCE_INLINE aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Transpose() { // (TReal&) don't remove, GCC complains cause of packed fields std::swap( (TReal&)b1, (TReal&)a2); std::swap( (TReal&)c1, (TReal&)a3); @@ -229,11 +222,10 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Transpose() return *this; } - // ---------------------------------------------------------------------------------------- template <typename TReal> -inline TReal aiMatrix4x4t<TReal>::Determinant() const -{ +AI_FORCE_INLINE +TReal aiMatrix4x4t<TReal>::Determinant() const { return a1*b2*c3*d4 - a1*b2*c4*d3 + a1*b3*c4*d2 - a1*b3*c2*d4 + a1*b4*c2*d3 - a1*b4*c3*d2 - a2*b3*c4*d1 + a2*b3*c1*d4 - a2*b4*c1*d3 + a2*b4*c3*d1 - a2*b1*c3*d4 + a2*b1*c4*d3 @@ -244,8 +236,8 @@ inline TReal aiMatrix4x4t<TReal>::Determinant() const // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Inverse() -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Inverse() { // Compute the reciprocal determinant const TReal det = Determinant(); if(det == static_cast<TReal>(0.0)) @@ -289,9 +281,10 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Inverse() // ---------------------------------------------------------------------------------------- template <typename TReal> -inline TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) { +AI_FORCE_INLINE +TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) { if (p_iIndex > 3) { - return NULL; + return nullptr; } switch ( p_iIndex ) { case 0: @@ -310,9 +303,10 @@ inline TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) { // ---------------------------------------------------------------------------------------- template <typename TReal> -inline const TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) const { +AI_FORCE_INLINE +const TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) const { if (p_iIndex > 3) { - return NULL; + return nullptr; } switch ( p_iIndex ) { @@ -332,8 +326,8 @@ inline const TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) const // ---------------------------------------------------------------------------------------- template <typename TReal> -inline bool aiMatrix4x4t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const -{ +AI_FORCE_INLINE +bool aiMatrix4x4t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const { return (a1 == m.a1 && a2 == m.a2 && a3 == m.a3 && a4 == m.a4 && b1 == m.b1 && b2 == m.b2 && b3 == m.b3 && b4 == m.b4 && c1 == m.c1 && c2 == m.c2 && c3 == m.c3 && c4 == m.c4 && @@ -342,14 +336,15 @@ inline bool aiMatrix4x4t<TReal>::operator== (const aiMatrix4x4t<TReal>& m) const // ---------------------------------------------------------------------------------------- template <typename TReal> -inline bool aiMatrix4x4t<TReal>::operator!= (const aiMatrix4x4t<TReal>& m) const -{ +AI_FORCE_INLINE +bool aiMatrix4x4t<TReal>::operator!= (const aiMatrix4x4t<TReal>& m) const { return !(*this == m); } // --------------------------------------------------------------------------- template<typename TReal> -inline bool aiMatrix4x4t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) const { +AI_FORCE_INLINE +bool aiMatrix4x4t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsilon) const { return std::abs(a1 - m.a1) <= epsilon && std::abs(a2 - m.a2) <= epsilon && @@ -401,13 +396,10 @@ inline bool aiMatrix4x4t<TReal>::Equal(const aiMatrix4x4t<TReal>& m, TReal epsil \ do {} while(false) - - - template <typename TReal> -inline void aiMatrix4x4t<TReal>::Decompose (aiVector3t<TReal>& pScaling, aiQuaterniont<TReal>& pRotation, - aiVector3t<TReal>& pPosition) const -{ +AI_FORCE_INLINE +void aiMatrix4x4t<TReal>::Decompose (aiVector3t<TReal>& pScaling, aiQuaterniont<TReal>& pRotation, + aiVector3t<TReal>& pPosition) const { ASSIMP_MATRIX4_4_DECOMPOSE_PART; // build a 3x3 rotation matrix @@ -420,8 +412,8 @@ inline void aiMatrix4x4t<TReal>::Decompose (aiVector3t<TReal>& pScaling, aiQuate } template <typename TReal> -inline void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TReal>& pRotation, aiVector3t<TReal>& pPosition) const -{ +AI_FORCE_INLINE +void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TReal>& pRotation, aiVector3t<TReal>& pPosition) const { ASSIMP_MATRIX4_4_DECOMPOSE_PART; /* @@ -442,7 +434,7 @@ inline void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector */ // Use a small epsilon to solve floating-point inaccuracies - const TReal epsilon = 10e-3f; + const TReal epsilon = Assimp::Math::getEpsilon<TReal>(); pRotation.y = std::asin(-vCols[0].z);// D. Angle around oY. @@ -475,10 +467,10 @@ inline void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector #undef ASSIMP_MATRIX4_4_DECOMPOSE_PART template <typename TReal> -inline void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TReal>& pRotationAxis, TReal& pRotationAngle, - aiVector3t<TReal>& pPosition) const -{ -aiQuaterniont<TReal> pRotation; +AI_FORCE_INLINE +void aiMatrix4x4t<TReal>::Decompose(aiVector3t<TReal>& pScaling, aiVector3t<TReal>& pRotationAxis, TReal& pRotationAngle, + aiVector3t<TReal>& pPosition) const { + aiQuaterniont<TReal> pRotation; Decompose(pScaling, pRotation, pPosition); pRotation.Normalize(); @@ -500,9 +492,9 @@ aiQuaterniont<TReal> pRotation; // ---------------------------------------------------------------------------------------- template <typename TReal> -inline void aiMatrix4x4t<TReal>::DecomposeNoScaling (aiQuaterniont<TReal>& rotation, - aiVector3t<TReal>& position) const -{ +AI_FORCE_INLINE +void aiMatrix4x4t<TReal>::DecomposeNoScaling (aiQuaterniont<TReal>& rotation, + aiVector3t<TReal>& position) const { const aiMatrix4x4t<TReal>& _this = *this; // extract translation @@ -516,15 +508,15 @@ inline void aiMatrix4x4t<TReal>::DecomposeNoScaling (aiQuaterniont<TReal>& rotat // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(const aiVector3t<TReal>& blubb) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(const aiVector3t<TReal>& blubb) { return FromEulerAnglesXYZ(blubb.x,blubb.y,blubb.z); } // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(TReal x, TReal y, TReal z) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(TReal x, TReal y, TReal z) { aiMatrix4x4t<TReal>& _this = *this; TReal cx = std::cos(x); @@ -552,8 +544,8 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(TReal x, TRe // ---------------------------------------------------------------------------------------- template <typename TReal> -inline bool aiMatrix4x4t<TReal>::IsIdentity() const -{ +AI_FORCE_INLINE +bool aiMatrix4x4t<TReal>::IsIdentity() const { // Use a small epsilon to solve floating-point inaccuracies const static TReal epsilon = 10e-3f; @@ -577,8 +569,8 @@ inline bool aiMatrix4x4t<TReal>::IsIdentity() const // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationX(TReal a, aiMatrix4x4t<TReal>& out) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationX(TReal a, aiMatrix4x4t<TReal>& out) { /* | 1 0 0 0 | M = | 0 cos(A) -sin(A) 0 | @@ -592,8 +584,8 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationX(TReal a, aiMatrix4x4t // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationY(TReal a, aiMatrix4x4t<TReal>& out) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationY(TReal a, aiMatrix4x4t<TReal>& out) { /* | cos(A) 0 sin(A) 0 | M = | 0 1 0 0 | @@ -608,8 +600,8 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationY(TReal a, aiMatrix4x4t // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationZ(TReal a, aiMatrix4x4t<TReal>& out) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationZ(TReal a, aiMatrix4x4t<TReal>& out) { /* | cos(A) -sin(A) 0 0 | M = | sin(A) cos(A) 0 0 | @@ -624,26 +616,25 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationZ(TReal a, aiMatrix4x4t // ---------------------------------------------------------------------------------------- // Returns a rotation matrix for a rotation around an arbitrary axis. template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix4x4t<TReal>& out) -{ - TReal c = std::cos( a), s = std::sin( a), t = 1 - c; - TReal x = axis.x, y = axis.y, z = axis.z; - - // Many thanks to MathWorld and Wikipedia - out.a1 = t*x*x + c; out.a2 = t*x*y - s*z; out.a3 = t*x*z + s*y; - out.b1 = t*x*y + s*z; out.b2 = t*y*y + c; out.b3 = t*y*z - s*x; - out.c1 = t*x*z - s*y; out.c2 = t*y*z + s*x; out.c3 = t*z*z + c; - out.a4 = out.b4 = out.c4 = static_cast<TReal>(0.0); - out.d1 = out.d2 = out.d3 = static_cast<TReal>(0.0); - out.d4 = static_cast<TReal>(1.0); - - return out; +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix4x4t<TReal>& out) { + TReal c = std::cos( a), s = std::sin( a), t = 1 - c; + TReal x = axis.x, y = axis.y, z = axis.z; + + // Many thanks to MathWorld and Wikipedia + out.a1 = t*x*x + c; out.a2 = t*x*y - s*z; out.a3 = t*x*z + s*y; + out.b1 = t*x*y + s*z; out.b2 = t*y*y + c; out.b3 = t*y*z - s*x; + out.c1 = t*x*z - s*y; out.c2 = t*y*z + s*x; out.c3 = t*z*z + c; + out.a4 = out.b4 = out.c4 = static_cast<TReal>(0.0); + out.d1 = out.d2 = out.d3 = static_cast<TReal>(0.0); + out.d4 = static_cast<TReal>(1.0); + + return out; } // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Translation( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out) -{ +AI_FORCE_INLINE aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Translation( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out) { out = aiMatrix4x4t<TReal>(); out.a4 = v.x; out.b4 = v.y; @@ -653,8 +644,8 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Translation( const aiVector3t<T // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Scaling( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Scaling( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out) { out = aiMatrix4x4t<TReal>(); out.a1 = v.x; out.b2 = v.y; @@ -673,9 +664,9 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Scaling( const aiVector3t<TReal */ // ---------------------------------------------------------------------------------------- template <typename TReal> -inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromToMatrix(const aiVector3t<TReal>& from, - const aiVector3t<TReal>& to, aiMatrix4x4t<TReal>& mtx) -{ +AI_FORCE_INLINE +aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromToMatrix(const aiVector3t<TReal>& from, + const aiVector3t<TReal>& to, aiMatrix4x4t<TReal>& mtx) { aiMatrix3x3t<TReal> m3; aiMatrix3x3t<TReal>::FromToMatrix(from,to,m3); mtx = aiMatrix4x4t<TReal>(m3); diff --git a/thirdparty/assimp/include/assimp/mesh.h b/thirdparty/assimp/include/assimp/mesh.h index f1628f1f54..fbf2a857ad 100644 --- a/thirdparty/assimp/include/assimp/mesh.h +++ b/thirdparty/assimp/include/assimp/mesh.h @@ -48,6 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MESH_H_INC #define AI_MESH_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/types.h> #include <assimp/aabb.h> @@ -248,6 +252,9 @@ struct aiVertexWeight { }; +// Forward declare aiNode (pointer use only) +struct aiNode; + // --------------------------------------------------------------------------- /** @brief A single bone of a mesh. * @@ -264,6 +271,16 @@ struct aiBone { //! The maximum value for this member is #AI_MAX_BONE_WEIGHTS. unsigned int mNumWeights; +#ifndef ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS + // The bone armature node - used for skeleton conversion + // you must enable aiProcess_PopulateArmatureData to populate this + C_STRUCT aiNode* mArmature; + + // The bone node in the scene - used for skeleton conversion + // you must enable aiProcess_PopulateArmatureData to populate this + C_STRUCT aiNode* mNode; + +#endif //! The influence weights of this bone, by vertex index. C_STRUCT aiVertexWeight* mWeights; @@ -418,11 +435,11 @@ struct aiAnimMesh /**Anim Mesh name */ C_STRUCT aiString mName; - /** Replacement for aiMesh::mVertices. If this array is non-NULL, + /** Replacement for aiMesh::mVertices. If this array is non-nullptr, * it *must* contain mNumVertices entries. The corresponding - * array in the host mesh must be non-NULL as well - animation + * array in the host mesh must be non-nullptr as well - animation * meshes may neither add or nor remove vertex components (if - * a replacement array is NULL and the corresponding source + * a replacement array is nullptr and the corresponding source * array is not, the source data is taken instead)*/ C_STRUCT aiVector3D* mVertices; @@ -596,7 +613,7 @@ struct aiMesh C_STRUCT aiVector3D* mVertices; /** Vertex normals. - * The array contains normalized vectors, NULL if not present. + * The array contains normalized vectors, nullptr if not present. * The array is mNumVertices in size. Normals are undefined for * point and line primitives. A mesh consisting of points and * lines only may not have normal vectors. Meshes with mixed @@ -619,7 +636,7 @@ struct aiMesh /** Vertex tangents. * The tangent of a vertex points in the direction of the positive - * X texture axis. The array contains normalized vectors, NULL if + * X texture axis. The array contains normalized vectors, nullptr if * not present. The array is mNumVertices in size. A mesh consisting * of points and lines only may not have normal vectors. Meshes with * mixed primitive types (i.e. lines and triangles) may have @@ -633,7 +650,7 @@ struct aiMesh /** Vertex bitangents. * The bitangent of a vertex points in the direction of the positive - * Y texture axis. The array contains normalized vectors, NULL if not + * Y texture axis. The array contains normalized vectors, nullptr if not * present. The array is mNumVertices in size. * @note If the mesh contains tangents, it automatically also contains * bitangents. @@ -642,14 +659,14 @@ struct aiMesh /** Vertex color sets. * A mesh may contain 0 to #AI_MAX_NUMBER_OF_COLOR_SETS vertex - * colors per vertex. NULL if not present. Each array is + * colors per vertex. nullptr if not present. Each array is * mNumVertices in size if present. */ C_STRUCT aiColor4D* mColors[AI_MAX_NUMBER_OF_COLOR_SETS]; /** Vertex texture coords, also known as UV channels. * A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per - * vertex. NULL if not present. The array is mNumVertices in size. + * vertex. nullptr if not present. The array is mNumVertices in size. */ C_STRUCT aiVector3D* mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS]; @@ -671,7 +688,7 @@ struct aiMesh C_STRUCT aiFace* mFaces; /** The number of bones this mesh contains. - * Can be 0, in which case the mBones array is NULL. + * Can be 0, in which case the mBones array is nullptr. */ unsigned int mNumBones; @@ -769,7 +786,10 @@ struct aiMesh // DO NOT REMOVE THIS ADDITIONAL CHECK if (mNumBones && mBones) { for( unsigned int a = 0; a < mNumBones; a++) { - delete mBones[a]; + if(mBones[a]) + { + delete mBones[a]; + } } delete [] mBones; } diff --git a/thirdparty/assimp/include/assimp/metadata.h b/thirdparty/assimp/include/assimp/metadata.h index 3a1dd1442a..849d90f485 100644 --- a/thirdparty/assimp/include/assimp/metadata.h +++ b/thirdparty/assimp/include/assimp/metadata.h @@ -48,6 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_METADATA_H_INC #define AI_METADATA_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #if defined(_MSC_VER) && (_MSC_VER <= 1500) # include "Compiler/pstdint.h" #else diff --git a/thirdparty/assimp/include/assimp/pbrmaterial.h b/thirdparty/assimp/include/assimp/pbrmaterial.h index ce5f822173..892a6347f7 100644 --- a/thirdparty/assimp/include/assimp/pbrmaterial.h +++ b/thirdparty/assimp/include/assimp/pbrmaterial.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -44,9 +42,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file pbrmaterial.h * @brief Defines the material system of the library */ +#pragma once #ifndef AI_PBRMATERIAL_H_INC #define AI_PBRMATERIAL_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_FACTOR "$mat.gltf.pbrMetallicRoughness.baseColorFactor", 0, 0 #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR "$mat.gltf.pbrMetallicRoughness.metallicFactor", 0, 0 #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR "$mat.gltf.pbrMetallicRoughness.roughnessFactor", 0, 0 diff --git a/thirdparty/assimp/include/assimp/postprocess.h b/thirdparty/assimp/include/assimp/postprocess.h index 2a74414216..4b6732e80a 100644 --- a/thirdparty/assimp/include/assimp/postprocess.h +++ b/thirdparty/assimp/include/assimp/postprocess.h @@ -47,7 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_POSTPROCESS_H_INC #define AI_POSTPROCESS_H_INC -#include "types.h" +#include <assimp/types.h> + +#ifdef __GNUC__ +# pragma GCC system_header +#endif #ifdef __cplusplus extern "C" { @@ -316,6 +320,19 @@ enum aiPostProcessSteps */ aiProcess_FixInfacingNormals = 0x2000, + + + // ------------------------------------------------------------------------- + /** + * This step generically populates aiBone->mArmature and aiBone->mNode generically + * The point of these is it saves you later having to calculate these elements + * This is useful when handling rest information or skin information + * If you have multiple armatures on your models we strongly recommend enabling this + * Instead of writing your own multi-root, multi-armature lookups we have done the + * hard work for you :) + */ + aiProcess_PopulateArmatureData = 0x4000, + // ------------------------------------------------------------------------- /** <hr>This step splits meshes with more than one primitive type in * homogeneous sub-meshes. @@ -533,6 +550,8 @@ enum aiPostProcessSteps */ aiProcess_Debone = 0x4000000, + + // ------------------------------------------------------------------------- /** <hr>This step will perform a global scale of the model. * diff --git a/thirdparty/assimp/include/assimp/qnan.h b/thirdparty/assimp/include/assimp/qnan.h index 0918bde5e7..06780da5b8 100644 --- a/thirdparty/assimp/include/assimp/qnan.h +++ b/thirdparty/assimp/include/assimp/qnan.h @@ -50,19 +50,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * but last time I checked compiler coverage was so bad that I decided * to reinvent the wheel. */ - +#pragma once #ifndef AI_QNAN_H_INCLUDED #define AI_QNAN_H_INCLUDED +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #include <assimp/defs.h> + #include <limits> #include <stdint.h> // --------------------------------------------------------------------------- /** Data structure to represent the bit pattern of a 32 Bit * IEEE 754 floating-point number. */ -union _IEEESingle -{ +union _IEEESingle { float Float; struct { @@ -75,8 +79,7 @@ union _IEEESingle // --------------------------------------------------------------------------- /** Data structure to represent the bit pattern of a 64 Bit * IEEE 754 floating-point number. */ -union _IEEEDouble -{ +union _IEEEDouble { double Double; struct { @@ -89,8 +92,7 @@ union _IEEEDouble // --------------------------------------------------------------------------- /** Check whether a given float is qNaN. * @param in Input value */ -AI_FORCE_INLINE bool is_qnan(float in) -{ +AI_FORCE_INLINE bool is_qnan(float in) { // the straightforward solution does not work: // return (in != in); // compiler generates code like this @@ -107,8 +109,7 @@ AI_FORCE_INLINE bool is_qnan(float in) // --------------------------------------------------------------------------- /** Check whether a given double is qNaN. * @param in Input value */ -AI_FORCE_INLINE bool is_qnan(double in) -{ +AI_FORCE_INLINE bool is_qnan(double in) { // the straightforward solution does not work: // return (in != in); // compiler generates code like this @@ -127,8 +128,7 @@ AI_FORCE_INLINE bool is_qnan(double in) * * Denorms return false, they're treated like normal values. * @param in Input value */ -AI_FORCE_INLINE bool is_special_float(float in) -{ +AI_FORCE_INLINE bool is_special_float(float in) { _IEEESingle temp; memcpy(&temp, &in, sizeof(float)); return (temp.IEEE.Exp == (1u << 8)-1); @@ -139,8 +139,7 @@ AI_FORCE_INLINE bool is_special_float(float in) * * Denorms return false, they're treated like normal values. * @param in Input value */ -AI_FORCE_INLINE bool is_special_float(double in) -{ +AI_FORCE_INLINE bool is_special_float(double in) { _IEEESingle temp; memcpy(&temp, &in, sizeof(float)); return (temp.IEEE.Exp == (1u << 11)-1); @@ -150,15 +149,13 @@ AI_FORCE_INLINE bool is_special_float(double in) /** Check whether a float is NOT qNaN. * @param in Input value */ template<class TReal> -AI_FORCE_INLINE bool is_not_qnan(TReal in) -{ +AI_FORCE_INLINE bool is_not_qnan(TReal in) { return !is_qnan(in); } // --------------------------------------------------------------------------- /** @brief Get a fresh qnan. */ -AI_FORCE_INLINE ai_real get_qnan() -{ +AI_FORCE_INLINE ai_real get_qnan() { return std::numeric_limits<ai_real>::quiet_NaN(); } diff --git a/thirdparty/assimp/include/assimp/quaternion.h b/thirdparty/assimp/include/assimp/quaternion.h index 96574d24b9..ae45959b41 100644 --- a/thirdparty/assimp/include/assimp/quaternion.h +++ b/thirdparty/assimp/include/assimp/quaternion.h @@ -49,7 +49,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifdef __cplusplus -#include "defs.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/defs.h> template <typename TReal> class aiVector3t; template <typename TReal> class aiMatrix3x3t; diff --git a/thirdparty/assimp/include/assimp/quaternion.inl b/thirdparty/assimp/include/assimp/quaternion.inl index c26648215e..3ce514d1bb 100644 --- a/thirdparty/assimp/include/assimp/quaternion.inl +++ b/thirdparty/assimp/include/assimp/quaternion.inl @@ -48,8 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_QUATERNION_INL_INC #define AI_QUATERNION_INL_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifdef __cplusplus -#include "quaternion.h" +#include <assimp/quaternion.h> #include <cmath> diff --git a/thirdparty/assimp/include/assimp/scene.h b/thirdparty/assimp/include/assimp/scene.h index 2667db85b3..b76709eb15 100644 --- a/thirdparty/assimp/include/assimp/scene.h +++ b/thirdparty/assimp/include/assimp/scene.h @@ -48,14 +48,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_SCENE_H_INC #define AI_SCENE_H_INC -#include "types.h" -#include "texture.h" -#include "mesh.h" -#include "light.h" -#include "camera.h" -#include "material.h" -#include "anim.h" -#include "metadata.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/types.h> +#include <assimp/texture.h> +#include <assimp/mesh.h> +#include <assimp/light.h> +#include <assimp/camera.h> +#include <assimp/material.h> +#include <assimp/anim.h> +#include <assimp/metadata.h> #ifdef __cplusplus # include <cstdlib> @@ -106,13 +110,13 @@ struct ASSIMP_API aiNode /** The transformation relative to the node's parent. */ C_STRUCT aiMatrix4x4 mTransformation; - /** Parent node. NULL if this node is the root node. */ + /** Parent node. nullptr if this node is the root node. */ C_STRUCT aiNode* mParent; /** The number of child nodes of this node. */ unsigned int mNumChildren; - /** The child nodes of this node. NULL if mNumChildren is 0. */ + /** The child nodes of this node. nullptr if mNumChildren is 0. */ C_STRUCT aiNode** mChildren; /** The number of meshes of this node. */ @@ -123,7 +127,7 @@ struct ASSIMP_API aiNode */ unsigned int* mMeshes; - /** Metadata associated with this node or NULL if there is no metadata. + /** Metadata associated with this node or nullptr if there is no metadata. * Whether any metadata is generated depends on the source file format. See the * @link importer_notes @endlink page for more information on every source file * format. Importers that don't document any metadata don't write any. @@ -145,7 +149,7 @@ struct ASSIMP_API aiNode * of the scene. * * @param name Name to search for - * @return NULL or a valid Node if the search was successful. + * @return nullptr or a valid Node if the search was successful. */ inline const aiNode* FindNode(const aiString& name) const { @@ -340,7 +344,7 @@ struct aiScene #ifdef __cplusplus - //! Default constructor - set everything to 0/NULL + //! Default constructor - set everything to 0/nullptr ASSIMP_API aiScene(); //! Destructor @@ -349,33 +353,33 @@ struct aiScene //! Check whether the scene contains meshes //! Unless no special scene flags are set this will always be true. inline bool HasMeshes() const { - return mMeshes != NULL && mNumMeshes > 0; + return mMeshes != nullptr && mNumMeshes > 0; } //! Check whether the scene contains materials //! Unless no special scene flags are set this will always be true. inline bool HasMaterials() const { - return mMaterials != NULL && mNumMaterials > 0; + return mMaterials != nullptr && mNumMaterials > 0; } //! Check whether the scene contains lights inline bool HasLights() const { - return mLights != NULL && mNumLights > 0; + return mLights != nullptr && mNumLights > 0; } //! Check whether the scene contains textures inline bool HasTextures() const { - return mTextures != NULL && mNumTextures > 0; + return mTextures != nullptr && mNumTextures > 0; } //! Check whether the scene contains cameras inline bool HasCameras() const { - return mCameras != NULL && mNumCameras > 0; + return mCameras != nullptr && mNumCameras > 0; } //! Check whether the scene contains animations inline bool HasAnimations() const { - return mAnimations != NULL && mNumAnimations > 0; + return mAnimations != nullptr && mNumAnimations > 0; } //! Returns a short filename from a full path diff --git a/thirdparty/assimp/include/assimp/texture.h b/thirdparty/assimp/include/assimp/texture.h index dc6cbef65c..0867659f46 100644 --- a/thirdparty/assimp/include/assimp/texture.h +++ b/thirdparty/assimp/include/assimp/texture.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -53,13 +51,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_TEXTURE_H_INC #define AI_TEXTURE_H_INC -#include "types.h" +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include <assimp/types.h> #ifdef __cplusplus extern "C" { #endif - // -------------------------------------------------------------------------------- /** \def AI_EMBEDDED_TEXNAME_PREFIX @@ -79,7 +80,6 @@ extern "C" { # define AI_MAKE_EMBEDDED_TEXNAME(_n_) AI_EMBEDDED_TEXNAME_PREFIX # _n_ #endif - #include "./Compiler/pushpack1.h" // -------------------------------------------------------------------------------- @@ -87,8 +87,7 @@ extern "C" { * * Used by aiTexture. */ -struct aiTexel -{ +struct aiTexel { unsigned char b,g,r,a; #ifdef __cplusplus diff --git a/thirdparty/assimp/include/assimp/types.h b/thirdparty/assimp/include/assimp/types.h index 331b8cd03f..e32cae331c 100644 --- a/thirdparty/assimp/include/assimp/types.h +++ b/thirdparty/assimp/include/assimp/types.h @@ -48,22 +48,30 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_TYPES_H_INC #define AI_TYPES_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + // Some runtime headers #include <sys/types.h> #include <stddef.h> #include <string.h> #include <limits.h> +#include <stdint.h> // Our compile configuration -#include "defs.h" +#include <assimp/defs.h> // Some types moved to separate header due to size of operators -#include "vector3.h" -#include "vector2.h" -#include "color4.h" -#include "matrix3x3.h" -#include "matrix4x4.h" -#include "quaternion.h" +#include <assimp/vector3.h> +#include <assimp/vector2.h> +#include <assimp/color4.h> +#include <assimp/matrix3x3.h> +#include <assimp/matrix4x4.h> +#include <assimp/quaternion.h> + +typedef int32_t ai_int32; +typedef uint32_t ai_uint32 ; #ifdef __cplusplus #include <cstring> @@ -71,7 +79,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <string> // for aiString::Set(const std::string&) namespace Assimp { - //! @cond never +//! @cond never namespace Intern { // -------------------------------------------------------------------- /** @brief Internal helper class to utilize our internal new/delete @@ -269,8 +277,8 @@ struct aiString } /** Copy constructor */ - aiString(const aiString& rOther) : - length(rOther.length) + aiString(const aiString& rOther) + : length(rOther.length) { // Crop the string to the maximum length length = length>=MAXLEN?MAXLEN-1:length; @@ -280,7 +288,7 @@ struct aiString /** Constructor from std::string */ explicit aiString(const std::string& pString) : - length(pString.length()) + length( (ai_uint32) pString.length()) { length = length>=MAXLEN?MAXLEN-1:length; memcpy( data, pString.c_str(), length); @@ -292,15 +300,15 @@ struct aiString if( pString.length() > MAXLEN - 1) { return; } - length = pString.length(); + length = (ai_uint32)pString.length(); memcpy( data, pString.c_str(), length); data[length] = 0; } /** Copy a const char* to the aiString */ void Set( const char* sz) { - const size_t len = ::strlen(sz); - if( len > MAXLEN - 1) { + const ai_int32 len = (ai_uint32) ::strlen(sz); + if( len > (ai_int32)MAXLEN - 1) { return; } length = len; @@ -346,7 +354,7 @@ struct aiString /** Append a string to the string */ void Append (const char* app) { - const size_t len = ::strlen(app); + const ai_uint32 len = (ai_uint32) ::strlen(app); if (!len) { return; } @@ -379,7 +387,7 @@ struct aiString /** Binary length of the string excluding the terminal 0. This is NOT the * logical length of strings containing UTF-8 multi-byte sequences! It's * the number of bytes from the beginning of the string to its end.*/ - size_t length; + ai_uint32 length; /** String buffer. Size limit is MAXLEN */ char data[MAXLEN]; diff --git a/thirdparty/assimp/include/assimp/vector2.h b/thirdparty/assimp/include/assimp/vector2.h index d5ef001542..c8b1ebbbc2 100644 --- a/thirdparty/assimp/include/assimp/vector2.h +++ b/thirdparty/assimp/include/assimp/vector2.h @@ -47,6 +47,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_VECTOR2D_H_INC #define AI_VECTOR2D_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifdef __cplusplus # include <cmath> #else diff --git a/thirdparty/assimp/include/assimp/vector2.inl b/thirdparty/assimp/include/assimp/vector2.inl index 3b7a7beabb..4bbf432ff8 100644 --- a/thirdparty/assimp/include/assimp/vector2.inl +++ b/thirdparty/assimp/include/assimp/vector2.inl @@ -48,8 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_VECTOR2D_INL_INC #define AI_VECTOR2D_INL_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifdef __cplusplus -#include "vector2.h" +#include <assimp/vector2.h> #include <cmath> diff --git a/thirdparty/assimp/include/assimp/vector3.h b/thirdparty/assimp/include/assimp/vector3.h index 7ff25cf0ad..fffeb12ad7 100644 --- a/thirdparty/assimp/include/assimp/vector3.h +++ b/thirdparty/assimp/include/assimp/vector3.h @@ -47,13 +47,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_VECTOR3D_H_INC #define AI_VECTOR3D_H_INC +#ifdef __GNUC__ +# pragma GCC system_header +#endif + #ifdef __cplusplus # include <cmath> #else # include <math.h> #endif -#include "defs.h" +#include <assimp/defs.h> #ifdef __cplusplus @@ -63,16 +67,13 @@ template<typename TReal> class aiMatrix4x4t; // --------------------------------------------------------------------------- /** Represents a three-dimensional vector. */ template <typename TReal> -class aiVector3t -{ +class aiVector3t { public: aiVector3t() AI_NO_EXCEPT : x(), y(), z() {} aiVector3t(TReal _x, TReal _y, TReal _z) : x(_x), y(_y), z(_z) {} explicit aiVector3t (TReal _xyz ) : x(_xyz), y(_xyz), z(_xyz) {} aiVector3t( const aiVector3t& o ) = default; -public: - // combined operators const aiVector3t& operator += (const aiVector3t& o); const aiVector3t& operator -= (const aiVector3t& o); @@ -97,7 +98,6 @@ public: template <typename TOther> operator aiVector3t<TOther> () const; -public: /** @brief Set the components of a vector * @param pX X component * @param pY Y component diff --git a/thirdparty/assimp/include/assimp/vector3.inl b/thirdparty/assimp/include/assimp/vector3.inl index 2fce6eddee..6682d3b32c 100644 --- a/thirdparty/assimp/include/assimp/vector3.inl +++ b/thirdparty/assimp/include/assimp/vector3.inl @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_VECTOR3D_INL_INC #ifdef __cplusplus -#include "vector3.h" +#include <assimp/vector3.h> #include <cmath> diff --git a/thirdparty/assimp/include/assimp/version.h b/thirdparty/assimp/include/assimp/version.h index c62a40e118..2fdd37a43c 100644 --- a/thirdparty/assimp/include/assimp/version.h +++ b/thirdparty/assimp/include/assimp/version.h @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_VERSION_H_INC #define AI_VERSION_H_INC -#include "defs.h" +#include <assimp/defs.h> #ifdef __cplusplus extern "C" { diff --git a/thirdparty/glad/glad.c b/thirdparty/glad/glad.c index 08c9c7e228..a1fe4d25ef 100644 --- a/thirdparty/glad/glad.c +++ b/thirdparty/glad/glad.c @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.31 on Thu Jul 11 10:09:18 2019. + OpenGL loader generated by glad 0.1.33 on Tue Nov 12 08:44:22 2019. Language/Generator: C/C++ Specification: gl @@ -31,6 +31,9 @@ static void* get_proc(const char *namez); #if defined(_WIN32) || defined(__CYGWIN__) +#ifndef _WINDOWS_ +#undef APIENTRY +#endif #include <windows.h> static HMODULE libGL; diff --git a/thirdparty/glad/glad/glad.h b/thirdparty/glad/glad/glad.h index acf96d8cd9..fae71a865e 100644 --- a/thirdparty/glad/glad/glad.h +++ b/thirdparty/glad/glad/glad.h @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.31 on Thu Jul 11 10:09:18 2019. + OpenGL loader generated by glad 0.1.33 on Tue Nov 12 08:44:22 2019. Language/Generator: C/C++ Specification: gl @@ -3404,7 +3404,7 @@ GLAPI PFNGLWAITSYNCPROC glad_glWaitSync; typedef void (APIENTRYP PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 *data); GLAPI PFNGLGETINTEGER64VPROC glad_glGetInteger64v; #define glGetInteger64v glad_glGetInteger64v -typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); GLAPI PFNGLGETSYNCIVPROC glad_glGetSynciv; #define glGetSynciv glad_glGetSynciv typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 *data); diff --git a/thirdparty/libogg/bitwise.c b/thirdparty/libogg/bitwise.c index fa2b572029..f5ef79122e 100644 --- a/thirdparty/libogg/bitwise.c +++ b/thirdparty/libogg/bitwise.c @@ -11,7 +11,6 @@ ******************************************************************** function: packing variable sized words into an octet stream - last mod: $Id$ ********************************************************************/ @@ -890,7 +889,7 @@ int main(void){ for(i=0;i<test2size;i++){ if(oggpack_look(&r,32)==-1)report("out of data. failed!"); if(oggpack_look(&r,32)!=large[i]){ - fprintf(stderr,"%ld != %ld (%lx!=%lx):",oggpack_look(&r,32),large[i], + fprintf(stderr,"%ld != %lu (%lx!=%lx):",oggpack_look(&r,32),large[i], oggpack_look(&r,32),large[i]); report("read incorrect value!\n"); } @@ -1000,7 +999,7 @@ int main(void){ for(i=0;i<test2size;i++){ if(oggpackB_look(&r,32)==-1)report("out of data. failed!"); if(oggpackB_look(&r,32)!=large[i]){ - fprintf(stderr,"%ld != %ld (%lx!=%lx):",oggpackB_look(&r,32),large[i], + fprintf(stderr,"%ld != %lu (%lx!=%lx):",oggpackB_look(&r,32),large[i], oggpackB_look(&r,32),large[i]); report("read incorrect value!\n"); } diff --git a/thirdparty/libogg/crctable.h b/thirdparty/libogg/crctable.h new file mode 100644 index 0000000000..dcc378b309 --- /dev/null +++ b/thirdparty/libogg/crctable.h @@ -0,0 +1,278 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2018 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ********************************************************************/ + +#include <ogg/os_types.h> + +static const ogg_uint32_t crc_lookup[8][256]={ +{0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9,0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005, + 0x2608edb8,0x22c9f00f,0x2f8ad6d6,0x2b4bcb61,0x350c9b64,0x31cd86d3,0x3c8ea00a,0x384fbdbd, + 0x4c11db70,0x48d0c6c7,0x4593e01e,0x4152fda9,0x5f15adac,0x5bd4b01b,0x569796c2,0x52568b75, + 0x6a1936c8,0x6ed82b7f,0x639b0da6,0x675a1011,0x791d4014,0x7ddc5da3,0x709f7b7a,0x745e66cd, + 0x9823b6e0,0x9ce2ab57,0x91a18d8e,0x95609039,0x8b27c03c,0x8fe6dd8b,0x82a5fb52,0x8664e6e5, + 0xbe2b5b58,0xbaea46ef,0xb7a96036,0xb3687d81,0xad2f2d84,0xa9ee3033,0xa4ad16ea,0xa06c0b5d, + 0xd4326d90,0xd0f37027,0xddb056fe,0xd9714b49,0xc7361b4c,0xc3f706fb,0xceb42022,0xca753d95, + 0xf23a8028,0xf6fb9d9f,0xfbb8bb46,0xff79a6f1,0xe13ef6f4,0xe5ffeb43,0xe8bccd9a,0xec7dd02d, + 0x34867077,0x30476dc0,0x3d044b19,0x39c556ae,0x278206ab,0x23431b1c,0x2e003dc5,0x2ac12072, + 0x128e9dcf,0x164f8078,0x1b0ca6a1,0x1fcdbb16,0x018aeb13,0x054bf6a4,0x0808d07d,0x0cc9cdca, + 0x7897ab07,0x7c56b6b0,0x71159069,0x75d48dde,0x6b93dddb,0x6f52c06c,0x6211e6b5,0x66d0fb02, + 0x5e9f46bf,0x5a5e5b08,0x571d7dd1,0x53dc6066,0x4d9b3063,0x495a2dd4,0x44190b0d,0x40d816ba, + 0xaca5c697,0xa864db20,0xa527fdf9,0xa1e6e04e,0xbfa1b04b,0xbb60adfc,0xb6238b25,0xb2e29692, + 0x8aad2b2f,0x8e6c3698,0x832f1041,0x87ee0df6,0x99a95df3,0x9d684044,0x902b669d,0x94ea7b2a, + 0xe0b41de7,0xe4750050,0xe9362689,0xedf73b3e,0xf3b06b3b,0xf771768c,0xfa325055,0xfef34de2, + 0xc6bcf05f,0xc27dede8,0xcf3ecb31,0xcbffd686,0xd5b88683,0xd1799b34,0xdc3abded,0xd8fba05a, + 0x690ce0ee,0x6dcdfd59,0x608edb80,0x644fc637,0x7a089632,0x7ec98b85,0x738aad5c,0x774bb0eb, + 0x4f040d56,0x4bc510e1,0x46863638,0x42472b8f,0x5c007b8a,0x58c1663d,0x558240e4,0x51435d53, + 0x251d3b9e,0x21dc2629,0x2c9f00f0,0x285e1d47,0x36194d42,0x32d850f5,0x3f9b762c,0x3b5a6b9b, + 0x0315d626,0x07d4cb91,0x0a97ed48,0x0e56f0ff,0x1011a0fa,0x14d0bd4d,0x19939b94,0x1d528623, + 0xf12f560e,0xf5ee4bb9,0xf8ad6d60,0xfc6c70d7,0xe22b20d2,0xe6ea3d65,0xeba91bbc,0xef68060b, + 0xd727bbb6,0xd3e6a601,0xdea580d8,0xda649d6f,0xc423cd6a,0xc0e2d0dd,0xcda1f604,0xc960ebb3, + 0xbd3e8d7e,0xb9ff90c9,0xb4bcb610,0xb07daba7,0xae3afba2,0xaafbe615,0xa7b8c0cc,0xa379dd7b, + 0x9b3660c6,0x9ff77d71,0x92b45ba8,0x9675461f,0x8832161a,0x8cf30bad,0x81b02d74,0x857130c3, + 0x5d8a9099,0x594b8d2e,0x5408abf7,0x50c9b640,0x4e8ee645,0x4a4ffbf2,0x470cdd2b,0x43cdc09c, + 0x7b827d21,0x7f436096,0x7200464f,0x76c15bf8,0x68860bfd,0x6c47164a,0x61043093,0x65c52d24, + 0x119b4be9,0x155a565e,0x18197087,0x1cd86d30,0x029f3d35,0x065e2082,0x0b1d065b,0x0fdc1bec, + 0x3793a651,0x3352bbe6,0x3e119d3f,0x3ad08088,0x2497d08d,0x2056cd3a,0x2d15ebe3,0x29d4f654, + 0xc5a92679,0xc1683bce,0xcc2b1d17,0xc8ea00a0,0xd6ad50a5,0xd26c4d12,0xdf2f6bcb,0xdbee767c, + 0xe3a1cbc1,0xe760d676,0xea23f0af,0xeee2ed18,0xf0a5bd1d,0xf464a0aa,0xf9278673,0xfde69bc4, + 0x89b8fd09,0x8d79e0be,0x803ac667,0x84fbdbd0,0x9abc8bd5,0x9e7d9662,0x933eb0bb,0x97ffad0c, + 0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4}, + +{0x00000000,0xd219c1dc,0xa0f29e0f,0x72eb5fd3,0x452421a9,0x973de075,0xe5d6bfa6,0x37cf7e7a, + 0x8a484352,0x5851828e,0x2abadd5d,0xf8a31c81,0xcf6c62fb,0x1d75a327,0x6f9efcf4,0xbd873d28, + 0x10519b13,0xc2485acf,0xb0a3051c,0x62bac4c0,0x5575baba,0x876c7b66,0xf58724b5,0x279ee569, + 0x9a19d841,0x4800199d,0x3aeb464e,0xe8f28792,0xdf3df9e8,0x0d243834,0x7fcf67e7,0xadd6a63b, + 0x20a33626,0xf2baf7fa,0x8051a829,0x524869f5,0x6587178f,0xb79ed653,0xc5758980,0x176c485c, + 0xaaeb7574,0x78f2b4a8,0x0a19eb7b,0xd8002aa7,0xefcf54dd,0x3dd69501,0x4f3dcad2,0x9d240b0e, + 0x30f2ad35,0xe2eb6ce9,0x9000333a,0x4219f2e6,0x75d68c9c,0xa7cf4d40,0xd5241293,0x073dd34f, + 0xbabaee67,0x68a32fbb,0x1a487068,0xc851b1b4,0xff9ecfce,0x2d870e12,0x5f6c51c1,0x8d75901d, + 0x41466c4c,0x935fad90,0xe1b4f243,0x33ad339f,0x04624de5,0xd67b8c39,0xa490d3ea,0x76891236, + 0xcb0e2f1e,0x1917eec2,0x6bfcb111,0xb9e570cd,0x8e2a0eb7,0x5c33cf6b,0x2ed890b8,0xfcc15164, + 0x5117f75f,0x830e3683,0xf1e56950,0x23fca88c,0x1433d6f6,0xc62a172a,0xb4c148f9,0x66d88925, + 0xdb5fb40d,0x094675d1,0x7bad2a02,0xa9b4ebde,0x9e7b95a4,0x4c625478,0x3e890bab,0xec90ca77, + 0x61e55a6a,0xb3fc9bb6,0xc117c465,0x130e05b9,0x24c17bc3,0xf6d8ba1f,0x8433e5cc,0x562a2410, + 0xebad1938,0x39b4d8e4,0x4b5f8737,0x994646eb,0xae893891,0x7c90f94d,0x0e7ba69e,0xdc626742, + 0x71b4c179,0xa3ad00a5,0xd1465f76,0x035f9eaa,0x3490e0d0,0xe689210c,0x94627edf,0x467bbf03, + 0xfbfc822b,0x29e543f7,0x5b0e1c24,0x8917ddf8,0xbed8a382,0x6cc1625e,0x1e2a3d8d,0xcc33fc51, + 0x828cd898,0x50951944,0x227e4697,0xf067874b,0xc7a8f931,0x15b138ed,0x675a673e,0xb543a6e2, + 0x08c49bca,0xdadd5a16,0xa83605c5,0x7a2fc419,0x4de0ba63,0x9ff97bbf,0xed12246c,0x3f0be5b0, + 0x92dd438b,0x40c48257,0x322fdd84,0xe0361c58,0xd7f96222,0x05e0a3fe,0x770bfc2d,0xa5123df1, + 0x189500d9,0xca8cc105,0xb8679ed6,0x6a7e5f0a,0x5db12170,0x8fa8e0ac,0xfd43bf7f,0x2f5a7ea3, + 0xa22feebe,0x70362f62,0x02dd70b1,0xd0c4b16d,0xe70bcf17,0x35120ecb,0x47f95118,0x95e090c4, + 0x2867adec,0xfa7e6c30,0x889533e3,0x5a8cf23f,0x6d438c45,0xbf5a4d99,0xcdb1124a,0x1fa8d396, + 0xb27e75ad,0x6067b471,0x128ceba2,0xc0952a7e,0xf75a5404,0x254395d8,0x57a8ca0b,0x85b10bd7, + 0x383636ff,0xea2ff723,0x98c4a8f0,0x4add692c,0x7d121756,0xaf0bd68a,0xdde08959,0x0ff94885, + 0xc3cab4d4,0x11d37508,0x63382adb,0xb121eb07,0x86ee957d,0x54f754a1,0x261c0b72,0xf405caae, + 0x4982f786,0x9b9b365a,0xe9706989,0x3b69a855,0x0ca6d62f,0xdebf17f3,0xac544820,0x7e4d89fc, + 0xd39b2fc7,0x0182ee1b,0x7369b1c8,0xa1707014,0x96bf0e6e,0x44a6cfb2,0x364d9061,0xe45451bd, + 0x59d36c95,0x8bcaad49,0xf921f29a,0x2b383346,0x1cf74d3c,0xceee8ce0,0xbc05d333,0x6e1c12ef, + 0xe36982f2,0x3170432e,0x439b1cfd,0x9182dd21,0xa64da35b,0x74546287,0x06bf3d54,0xd4a6fc88, + 0x6921c1a0,0xbb38007c,0xc9d35faf,0x1bca9e73,0x2c05e009,0xfe1c21d5,0x8cf77e06,0x5eeebfda, + 0xf33819e1,0x2121d83d,0x53ca87ee,0x81d34632,0xb61c3848,0x6405f994,0x16eea647,0xc4f7679b, + 0x79705ab3,0xab699b6f,0xd982c4bc,0x0b9b0560,0x3c547b1a,0xee4dbac6,0x9ca6e515,0x4ebf24c9}, + +{0x00000000,0x01d8ac87,0x03b1590e,0x0269f589,0x0762b21c,0x06ba1e9b,0x04d3eb12,0x050b4795, + 0x0ec56438,0x0f1dc8bf,0x0d743d36,0x0cac91b1,0x09a7d624,0x087f7aa3,0x0a168f2a,0x0bce23ad, + 0x1d8ac870,0x1c5264f7,0x1e3b917e,0x1fe33df9,0x1ae87a6c,0x1b30d6eb,0x19592362,0x18818fe5, + 0x134fac48,0x129700cf,0x10fef546,0x112659c1,0x142d1e54,0x15f5b2d3,0x179c475a,0x1644ebdd, + 0x3b1590e0,0x3acd3c67,0x38a4c9ee,0x397c6569,0x3c7722fc,0x3daf8e7b,0x3fc67bf2,0x3e1ed775, + 0x35d0f4d8,0x3408585f,0x3661add6,0x37b90151,0x32b246c4,0x336aea43,0x31031fca,0x30dbb34d, + 0x269f5890,0x2747f417,0x252e019e,0x24f6ad19,0x21fdea8c,0x2025460b,0x224cb382,0x23941f05, + 0x285a3ca8,0x2982902f,0x2beb65a6,0x2a33c921,0x2f388eb4,0x2ee02233,0x2c89d7ba,0x2d517b3d, + 0x762b21c0,0x77f38d47,0x759a78ce,0x7442d449,0x714993dc,0x70913f5b,0x72f8cad2,0x73206655, + 0x78ee45f8,0x7936e97f,0x7b5f1cf6,0x7a87b071,0x7f8cf7e4,0x7e545b63,0x7c3daeea,0x7de5026d, + 0x6ba1e9b0,0x6a794537,0x6810b0be,0x69c81c39,0x6cc35bac,0x6d1bf72b,0x6f7202a2,0x6eaaae25, + 0x65648d88,0x64bc210f,0x66d5d486,0x670d7801,0x62063f94,0x63de9313,0x61b7669a,0x606fca1d, + 0x4d3eb120,0x4ce61da7,0x4e8fe82e,0x4f5744a9,0x4a5c033c,0x4b84afbb,0x49ed5a32,0x4835f6b5, + 0x43fbd518,0x4223799f,0x404a8c16,0x41922091,0x44996704,0x4541cb83,0x47283e0a,0x46f0928d, + 0x50b47950,0x516cd5d7,0x5305205e,0x52dd8cd9,0x57d6cb4c,0x560e67cb,0x54679242,0x55bf3ec5, + 0x5e711d68,0x5fa9b1ef,0x5dc04466,0x5c18e8e1,0x5913af74,0x58cb03f3,0x5aa2f67a,0x5b7a5afd, + 0xec564380,0xed8eef07,0xefe71a8e,0xee3fb609,0xeb34f19c,0xeaec5d1b,0xe885a892,0xe95d0415, + 0xe29327b8,0xe34b8b3f,0xe1227eb6,0xe0fad231,0xe5f195a4,0xe4293923,0xe640ccaa,0xe798602d, + 0xf1dc8bf0,0xf0042777,0xf26dd2fe,0xf3b57e79,0xf6be39ec,0xf766956b,0xf50f60e2,0xf4d7cc65, + 0xff19efc8,0xfec1434f,0xfca8b6c6,0xfd701a41,0xf87b5dd4,0xf9a3f153,0xfbca04da,0xfa12a85d, + 0xd743d360,0xd69b7fe7,0xd4f28a6e,0xd52a26e9,0xd021617c,0xd1f9cdfb,0xd3903872,0xd24894f5, + 0xd986b758,0xd85e1bdf,0xda37ee56,0xdbef42d1,0xdee40544,0xdf3ca9c3,0xdd555c4a,0xdc8df0cd, + 0xcac91b10,0xcb11b797,0xc978421e,0xc8a0ee99,0xcdaba90c,0xcc73058b,0xce1af002,0xcfc25c85, + 0xc40c7f28,0xc5d4d3af,0xc7bd2626,0xc6658aa1,0xc36ecd34,0xc2b661b3,0xc0df943a,0xc10738bd, + 0x9a7d6240,0x9ba5cec7,0x99cc3b4e,0x981497c9,0x9d1fd05c,0x9cc77cdb,0x9eae8952,0x9f7625d5, + 0x94b80678,0x9560aaff,0x97095f76,0x96d1f3f1,0x93dab464,0x920218e3,0x906bed6a,0x91b341ed, + 0x87f7aa30,0x862f06b7,0x8446f33e,0x859e5fb9,0x8095182c,0x814db4ab,0x83244122,0x82fceda5, + 0x8932ce08,0x88ea628f,0x8a839706,0x8b5b3b81,0x8e507c14,0x8f88d093,0x8de1251a,0x8c39899d, + 0xa168f2a0,0xa0b05e27,0xa2d9abae,0xa3010729,0xa60a40bc,0xa7d2ec3b,0xa5bb19b2,0xa463b535, + 0xafad9698,0xae753a1f,0xac1ccf96,0xadc46311,0xa8cf2484,0xa9178803,0xab7e7d8a,0xaaa6d10d, + 0xbce23ad0,0xbd3a9657,0xbf5363de,0xbe8bcf59,0xbb8088cc,0xba58244b,0xb831d1c2,0xb9e97d45, + 0xb2275ee8,0xb3fff26f,0xb19607e6,0xb04eab61,0xb545ecf4,0xb49d4073,0xb6f4b5fa,0xb72c197d}, + +{0x00000000,0xdc6d9ab7,0xbc1a28d9,0x6077b26e,0x7cf54c05,0xa098d6b2,0xc0ef64dc,0x1c82fe6b, + 0xf9ea980a,0x258702bd,0x45f0b0d3,0x999d2a64,0x851fd40f,0x59724eb8,0x3905fcd6,0xe5686661, + 0xf7142da3,0x2b79b714,0x4b0e057a,0x97639fcd,0x8be161a6,0x578cfb11,0x37fb497f,0xeb96d3c8, + 0x0efeb5a9,0xd2932f1e,0xb2e49d70,0x6e8907c7,0x720bf9ac,0xae66631b,0xce11d175,0x127c4bc2, + 0xeae946f1,0x3684dc46,0x56f36e28,0x8a9ef49f,0x961c0af4,0x4a719043,0x2a06222d,0xf66bb89a, + 0x1303defb,0xcf6e444c,0xaf19f622,0x73746c95,0x6ff692fe,0xb39b0849,0xd3ecba27,0x0f812090, + 0x1dfd6b52,0xc190f1e5,0xa1e7438b,0x7d8ad93c,0x61082757,0xbd65bde0,0xdd120f8e,0x017f9539, + 0xe417f358,0x387a69ef,0x580ddb81,0x84604136,0x98e2bf5d,0x448f25ea,0x24f89784,0xf8950d33, + 0xd1139055,0x0d7e0ae2,0x6d09b88c,0xb164223b,0xade6dc50,0x718b46e7,0x11fcf489,0xcd916e3e, + 0x28f9085f,0xf49492e8,0x94e32086,0x488eba31,0x540c445a,0x8861deed,0xe8166c83,0x347bf634, + 0x2607bdf6,0xfa6a2741,0x9a1d952f,0x46700f98,0x5af2f1f3,0x869f6b44,0xe6e8d92a,0x3a85439d, + 0xdfed25fc,0x0380bf4b,0x63f70d25,0xbf9a9792,0xa31869f9,0x7f75f34e,0x1f024120,0xc36fdb97, + 0x3bfad6a4,0xe7974c13,0x87e0fe7d,0x5b8d64ca,0x470f9aa1,0x9b620016,0xfb15b278,0x277828cf, + 0xc2104eae,0x1e7dd419,0x7e0a6677,0xa267fcc0,0xbee502ab,0x6288981c,0x02ff2a72,0xde92b0c5, + 0xcceefb07,0x108361b0,0x70f4d3de,0xac994969,0xb01bb702,0x6c762db5,0x0c019fdb,0xd06c056c, + 0x3504630d,0xe969f9ba,0x891e4bd4,0x5573d163,0x49f12f08,0x959cb5bf,0xf5eb07d1,0x29869d66, + 0xa6e63d1d,0x7a8ba7aa,0x1afc15c4,0xc6918f73,0xda137118,0x067eebaf,0x660959c1,0xba64c376, + 0x5f0ca517,0x83613fa0,0xe3168dce,0x3f7b1779,0x23f9e912,0xff9473a5,0x9fe3c1cb,0x438e5b7c, + 0x51f210be,0x8d9f8a09,0xede83867,0x3185a2d0,0x2d075cbb,0xf16ac60c,0x911d7462,0x4d70eed5, + 0xa81888b4,0x74751203,0x1402a06d,0xc86f3ada,0xd4edc4b1,0x08805e06,0x68f7ec68,0xb49a76df, + 0x4c0f7bec,0x9062e15b,0xf0155335,0x2c78c982,0x30fa37e9,0xec97ad5e,0x8ce01f30,0x508d8587, + 0xb5e5e3e6,0x69887951,0x09ffcb3f,0xd5925188,0xc910afe3,0x157d3554,0x750a873a,0xa9671d8d, + 0xbb1b564f,0x6776ccf8,0x07017e96,0xdb6ce421,0xc7ee1a4a,0x1b8380fd,0x7bf43293,0xa799a824, + 0x42f1ce45,0x9e9c54f2,0xfeebe69c,0x22867c2b,0x3e048240,0xe26918f7,0x821eaa99,0x5e73302e, + 0x77f5ad48,0xab9837ff,0xcbef8591,0x17821f26,0x0b00e14d,0xd76d7bfa,0xb71ac994,0x6b775323, + 0x8e1f3542,0x5272aff5,0x32051d9b,0xee68872c,0xf2ea7947,0x2e87e3f0,0x4ef0519e,0x929dcb29, + 0x80e180eb,0x5c8c1a5c,0x3cfba832,0xe0963285,0xfc14ccee,0x20795659,0x400ee437,0x9c637e80, + 0x790b18e1,0xa5668256,0xc5113038,0x197caa8f,0x05fe54e4,0xd993ce53,0xb9e47c3d,0x6589e68a, + 0x9d1cebb9,0x4171710e,0x2106c360,0xfd6b59d7,0xe1e9a7bc,0x3d843d0b,0x5df38f65,0x819e15d2, + 0x64f673b3,0xb89be904,0xd8ec5b6a,0x0481c1dd,0x18033fb6,0xc46ea501,0xa419176f,0x78748dd8, + 0x6a08c61a,0xb6655cad,0xd612eec3,0x0a7f7474,0x16fd8a1f,0xca9010a8,0xaae7a2c6,0x768a3871, + 0x93e25e10,0x4f8fc4a7,0x2ff876c9,0xf395ec7e,0xef171215,0x337a88a2,0x530d3acc,0x8f60a07b}, + +{0x00000000,0x490d678d,0x921acf1a,0xdb17a897,0x20f48383,0x69f9e40e,0xb2ee4c99,0xfbe32b14, + 0x41e90706,0x08e4608b,0xd3f3c81c,0x9afeaf91,0x611d8485,0x2810e308,0xf3074b9f,0xba0a2c12, + 0x83d20e0c,0xcadf6981,0x11c8c116,0x58c5a69b,0xa3268d8f,0xea2bea02,0x313c4295,0x78312518, + 0xc23b090a,0x8b366e87,0x5021c610,0x192ca19d,0xe2cf8a89,0xabc2ed04,0x70d54593,0x39d8221e, + 0x036501af,0x4a686622,0x917fceb5,0xd872a938,0x2391822c,0x6a9ce5a1,0xb18b4d36,0xf8862abb, + 0x428c06a9,0x0b816124,0xd096c9b3,0x999bae3e,0x6278852a,0x2b75e2a7,0xf0624a30,0xb96f2dbd, + 0x80b70fa3,0xc9ba682e,0x12adc0b9,0x5ba0a734,0xa0438c20,0xe94eebad,0x3259433a,0x7b5424b7, + 0xc15e08a5,0x88536f28,0x5344c7bf,0x1a49a032,0xe1aa8b26,0xa8a7ecab,0x73b0443c,0x3abd23b1, + 0x06ca035e,0x4fc764d3,0x94d0cc44,0xddddabc9,0x263e80dd,0x6f33e750,0xb4244fc7,0xfd29284a, + 0x47230458,0x0e2e63d5,0xd539cb42,0x9c34accf,0x67d787db,0x2edae056,0xf5cd48c1,0xbcc02f4c, + 0x85180d52,0xcc156adf,0x1702c248,0x5e0fa5c5,0xa5ec8ed1,0xece1e95c,0x37f641cb,0x7efb2646, + 0xc4f10a54,0x8dfc6dd9,0x56ebc54e,0x1fe6a2c3,0xe40589d7,0xad08ee5a,0x761f46cd,0x3f122140, + 0x05af02f1,0x4ca2657c,0x97b5cdeb,0xdeb8aa66,0x255b8172,0x6c56e6ff,0xb7414e68,0xfe4c29e5, + 0x444605f7,0x0d4b627a,0xd65ccaed,0x9f51ad60,0x64b28674,0x2dbfe1f9,0xf6a8496e,0xbfa52ee3, + 0x867d0cfd,0xcf706b70,0x1467c3e7,0x5d6aa46a,0xa6898f7e,0xef84e8f3,0x34934064,0x7d9e27e9, + 0xc7940bfb,0x8e996c76,0x558ec4e1,0x1c83a36c,0xe7608878,0xae6deff5,0x757a4762,0x3c7720ef, + 0x0d9406bc,0x44996131,0x9f8ec9a6,0xd683ae2b,0x2d60853f,0x646de2b2,0xbf7a4a25,0xf6772da8, + 0x4c7d01ba,0x05706637,0xde67cea0,0x976aa92d,0x6c898239,0x2584e5b4,0xfe934d23,0xb79e2aae, + 0x8e4608b0,0xc74b6f3d,0x1c5cc7aa,0x5551a027,0xaeb28b33,0xe7bfecbe,0x3ca84429,0x75a523a4, + 0xcfaf0fb6,0x86a2683b,0x5db5c0ac,0x14b8a721,0xef5b8c35,0xa656ebb8,0x7d41432f,0x344c24a2, + 0x0ef10713,0x47fc609e,0x9cebc809,0xd5e6af84,0x2e058490,0x6708e31d,0xbc1f4b8a,0xf5122c07, + 0x4f180015,0x06156798,0xdd02cf0f,0x940fa882,0x6fec8396,0x26e1e41b,0xfdf64c8c,0xb4fb2b01, + 0x8d23091f,0xc42e6e92,0x1f39c605,0x5634a188,0xadd78a9c,0xe4daed11,0x3fcd4586,0x76c0220b, + 0xccca0e19,0x85c76994,0x5ed0c103,0x17dda68e,0xec3e8d9a,0xa533ea17,0x7e244280,0x3729250d, + 0x0b5e05e2,0x4253626f,0x9944caf8,0xd049ad75,0x2baa8661,0x62a7e1ec,0xb9b0497b,0xf0bd2ef6, + 0x4ab702e4,0x03ba6569,0xd8adcdfe,0x91a0aa73,0x6a438167,0x234ee6ea,0xf8594e7d,0xb15429f0, + 0x888c0bee,0xc1816c63,0x1a96c4f4,0x539ba379,0xa878886d,0xe175efe0,0x3a624777,0x736f20fa, + 0xc9650ce8,0x80686b65,0x5b7fc3f2,0x1272a47f,0xe9918f6b,0xa09ce8e6,0x7b8b4071,0x328627fc, + 0x083b044d,0x413663c0,0x9a21cb57,0xd32cacda,0x28cf87ce,0x61c2e043,0xbad548d4,0xf3d82f59, + 0x49d2034b,0x00df64c6,0xdbc8cc51,0x92c5abdc,0x692680c8,0x202be745,0xfb3c4fd2,0xb231285f, + 0x8be90a41,0xc2e46dcc,0x19f3c55b,0x50fea2d6,0xab1d89c2,0xe210ee4f,0x390746d8,0x700a2155, + 0xca000d47,0x830d6aca,0x581ac25d,0x1117a5d0,0xeaf48ec4,0xa3f9e949,0x78ee41de,0x31e32653}, + +{0x00000000,0x1b280d78,0x36501af0,0x2d781788,0x6ca035e0,0x77883898,0x5af02f10,0x41d82268, + 0xd9406bc0,0xc26866b8,0xef107130,0xf4387c48,0xb5e05e20,0xaec85358,0x83b044d0,0x989849a8, + 0xb641ca37,0xad69c74f,0x8011d0c7,0x9b39ddbf,0xdae1ffd7,0xc1c9f2af,0xecb1e527,0xf799e85f, + 0x6f01a1f7,0x7429ac8f,0x5951bb07,0x4279b67f,0x03a19417,0x1889996f,0x35f18ee7,0x2ed9839f, + 0x684289d9,0x736a84a1,0x5e129329,0x453a9e51,0x04e2bc39,0x1fcab141,0x32b2a6c9,0x299aabb1, + 0xb102e219,0xaa2aef61,0x8752f8e9,0x9c7af591,0xdda2d7f9,0xc68ada81,0xebf2cd09,0xf0dac071, + 0xde0343ee,0xc52b4e96,0xe853591e,0xf37b5466,0xb2a3760e,0xa98b7b76,0x84f36cfe,0x9fdb6186, + 0x0743282e,0x1c6b2556,0x311332de,0x2a3b3fa6,0x6be31dce,0x70cb10b6,0x5db3073e,0x469b0a46, + 0xd08513b2,0xcbad1eca,0xe6d50942,0xfdfd043a,0xbc252652,0xa70d2b2a,0x8a753ca2,0x915d31da, + 0x09c57872,0x12ed750a,0x3f956282,0x24bd6ffa,0x65654d92,0x7e4d40ea,0x53355762,0x481d5a1a, + 0x66c4d985,0x7decd4fd,0x5094c375,0x4bbcce0d,0x0a64ec65,0x114ce11d,0x3c34f695,0x271cfbed, + 0xbf84b245,0xa4acbf3d,0x89d4a8b5,0x92fca5cd,0xd32487a5,0xc80c8add,0xe5749d55,0xfe5c902d, + 0xb8c79a6b,0xa3ef9713,0x8e97809b,0x95bf8de3,0xd467af8b,0xcf4fa2f3,0xe237b57b,0xf91fb803, + 0x6187f1ab,0x7aaffcd3,0x57d7eb5b,0x4cffe623,0x0d27c44b,0x160fc933,0x3b77debb,0x205fd3c3, + 0x0e86505c,0x15ae5d24,0x38d64aac,0x23fe47d4,0x622665bc,0x790e68c4,0x54767f4c,0x4f5e7234, + 0xd7c63b9c,0xccee36e4,0xe196216c,0xfabe2c14,0xbb660e7c,0xa04e0304,0x8d36148c,0x961e19f4, + 0xa5cb3ad3,0xbee337ab,0x939b2023,0x88b32d5b,0xc96b0f33,0xd243024b,0xff3b15c3,0xe41318bb, + 0x7c8b5113,0x67a35c6b,0x4adb4be3,0x51f3469b,0x102b64f3,0x0b03698b,0x267b7e03,0x3d53737b, + 0x138af0e4,0x08a2fd9c,0x25daea14,0x3ef2e76c,0x7f2ac504,0x6402c87c,0x497adff4,0x5252d28c, + 0xcaca9b24,0xd1e2965c,0xfc9a81d4,0xe7b28cac,0xa66aaec4,0xbd42a3bc,0x903ab434,0x8b12b94c, + 0xcd89b30a,0xd6a1be72,0xfbd9a9fa,0xe0f1a482,0xa12986ea,0xba018b92,0x97799c1a,0x8c519162, + 0x14c9d8ca,0x0fe1d5b2,0x2299c23a,0x39b1cf42,0x7869ed2a,0x6341e052,0x4e39f7da,0x5511faa2, + 0x7bc8793d,0x60e07445,0x4d9863cd,0x56b06eb5,0x17684cdd,0x0c4041a5,0x2138562d,0x3a105b55, + 0xa28812fd,0xb9a01f85,0x94d8080d,0x8ff00575,0xce28271d,0xd5002a65,0xf8783ded,0xe3503095, + 0x754e2961,0x6e662419,0x431e3391,0x58363ee9,0x19ee1c81,0x02c611f9,0x2fbe0671,0x34960b09, + 0xac0e42a1,0xb7264fd9,0x9a5e5851,0x81765529,0xc0ae7741,0xdb867a39,0xf6fe6db1,0xedd660c9, + 0xc30fe356,0xd827ee2e,0xf55ff9a6,0xee77f4de,0xafafd6b6,0xb487dbce,0x99ffcc46,0x82d7c13e, + 0x1a4f8896,0x016785ee,0x2c1f9266,0x37379f1e,0x76efbd76,0x6dc7b00e,0x40bfa786,0x5b97aafe, + 0x1d0ca0b8,0x0624adc0,0x2b5cba48,0x3074b730,0x71ac9558,0x6a849820,0x47fc8fa8,0x5cd482d0, + 0xc44ccb78,0xdf64c600,0xf21cd188,0xe934dcf0,0xa8ecfe98,0xb3c4f3e0,0x9ebce468,0x8594e910, + 0xab4d6a8f,0xb06567f7,0x9d1d707f,0x86357d07,0xc7ed5f6f,0xdcc55217,0xf1bd459f,0xea9548e7, + 0x720d014f,0x69250c37,0x445d1bbf,0x5f7516c7,0x1ead34af,0x058539d7,0x28fd2e5f,0x33d52327}, + +{0x00000000,0x4f576811,0x9eaed022,0xd1f9b833,0x399cbdf3,0x76cbd5e2,0xa7326dd1,0xe86505c0, + 0x73397be6,0x3c6e13f7,0xed97abc4,0xa2c0c3d5,0x4aa5c615,0x05f2ae04,0xd40b1637,0x9b5c7e26, + 0xe672f7cc,0xa9259fdd,0x78dc27ee,0x378b4fff,0xdfee4a3f,0x90b9222e,0x41409a1d,0x0e17f20c, + 0x954b8c2a,0xda1ce43b,0x0be55c08,0x44b23419,0xacd731d9,0xe38059c8,0x3279e1fb,0x7d2e89ea, + 0xc824f22f,0x87739a3e,0x568a220d,0x19dd4a1c,0xf1b84fdc,0xbeef27cd,0x6f169ffe,0x2041f7ef, + 0xbb1d89c9,0xf44ae1d8,0x25b359eb,0x6ae431fa,0x8281343a,0xcdd65c2b,0x1c2fe418,0x53788c09, + 0x2e5605e3,0x61016df2,0xb0f8d5c1,0xffafbdd0,0x17cab810,0x589dd001,0x89646832,0xc6330023, + 0x5d6f7e05,0x12381614,0xc3c1ae27,0x8c96c636,0x64f3c3f6,0x2ba4abe7,0xfa5d13d4,0xb50a7bc5, + 0x9488f9e9,0xdbdf91f8,0x0a2629cb,0x457141da,0xad14441a,0xe2432c0b,0x33ba9438,0x7cedfc29, + 0xe7b1820f,0xa8e6ea1e,0x791f522d,0x36483a3c,0xde2d3ffc,0x917a57ed,0x4083efde,0x0fd487cf, + 0x72fa0e25,0x3dad6634,0xec54de07,0xa303b616,0x4b66b3d6,0x0431dbc7,0xd5c863f4,0x9a9f0be5, + 0x01c375c3,0x4e941dd2,0x9f6da5e1,0xd03acdf0,0x385fc830,0x7708a021,0xa6f11812,0xe9a67003, + 0x5cac0bc6,0x13fb63d7,0xc202dbe4,0x8d55b3f5,0x6530b635,0x2a67de24,0xfb9e6617,0xb4c90e06, + 0x2f957020,0x60c21831,0xb13ba002,0xfe6cc813,0x1609cdd3,0x595ea5c2,0x88a71df1,0xc7f075e0, + 0xbadefc0a,0xf589941b,0x24702c28,0x6b274439,0x834241f9,0xcc1529e8,0x1dec91db,0x52bbf9ca, + 0xc9e787ec,0x86b0effd,0x574957ce,0x181e3fdf,0xf07b3a1f,0xbf2c520e,0x6ed5ea3d,0x2182822c, + 0x2dd0ee65,0x62878674,0xb37e3e47,0xfc295656,0x144c5396,0x5b1b3b87,0x8ae283b4,0xc5b5eba5, + 0x5ee99583,0x11befd92,0xc04745a1,0x8f102db0,0x67752870,0x28224061,0xf9dbf852,0xb68c9043, + 0xcba219a9,0x84f571b8,0x550cc98b,0x1a5ba19a,0xf23ea45a,0xbd69cc4b,0x6c907478,0x23c71c69, + 0xb89b624f,0xf7cc0a5e,0x2635b26d,0x6962da7c,0x8107dfbc,0xce50b7ad,0x1fa90f9e,0x50fe678f, + 0xe5f41c4a,0xaaa3745b,0x7b5acc68,0x340da479,0xdc68a1b9,0x933fc9a8,0x42c6719b,0x0d91198a, + 0x96cd67ac,0xd99a0fbd,0x0863b78e,0x4734df9f,0xaf51da5f,0xe006b24e,0x31ff0a7d,0x7ea8626c, + 0x0386eb86,0x4cd18397,0x9d283ba4,0xd27f53b5,0x3a1a5675,0x754d3e64,0xa4b48657,0xebe3ee46, + 0x70bf9060,0x3fe8f871,0xee114042,0xa1462853,0x49232d93,0x06744582,0xd78dfdb1,0x98da95a0, + 0xb958178c,0xf60f7f9d,0x27f6c7ae,0x68a1afbf,0x80c4aa7f,0xcf93c26e,0x1e6a7a5d,0x513d124c, + 0xca616c6a,0x8536047b,0x54cfbc48,0x1b98d459,0xf3fdd199,0xbcaab988,0x6d5301bb,0x220469aa, + 0x5f2ae040,0x107d8851,0xc1843062,0x8ed35873,0x66b65db3,0x29e135a2,0xf8188d91,0xb74fe580, + 0x2c139ba6,0x6344f3b7,0xb2bd4b84,0xfdea2395,0x158f2655,0x5ad84e44,0x8b21f677,0xc4769e66, + 0x717ce5a3,0x3e2b8db2,0xefd23581,0xa0855d90,0x48e05850,0x07b73041,0xd64e8872,0x9919e063, + 0x02459e45,0x4d12f654,0x9ceb4e67,0xd3bc2676,0x3bd923b6,0x748e4ba7,0xa577f394,0xea209b85, + 0x970e126f,0xd8597a7e,0x09a0c24d,0x46f7aa5c,0xae92af9c,0xe1c5c78d,0x303c7fbe,0x7f6b17af, + 0xe4376989,0xab600198,0x7a99b9ab,0x35ced1ba,0xddabd47a,0x92fcbc6b,0x43050458,0x0c526c49}, + +{0x00000000,0x5ba1dcca,0xb743b994,0xece2655e,0x6a466e9f,0x31e7b255,0xdd05d70b,0x86a40bc1, + 0xd48cdd3e,0x8f2d01f4,0x63cf64aa,0x386eb860,0xbecab3a1,0xe56b6f6b,0x09890a35,0x5228d6ff, + 0xadd8a7cb,0xf6797b01,0x1a9b1e5f,0x413ac295,0xc79ec954,0x9c3f159e,0x70dd70c0,0x2b7cac0a, + 0x79547af5,0x22f5a63f,0xce17c361,0x95b61fab,0x1312146a,0x48b3c8a0,0xa451adfe,0xfff07134, + 0x5f705221,0x04d18eeb,0xe833ebb5,0xb392377f,0x35363cbe,0x6e97e074,0x8275852a,0xd9d459e0, + 0x8bfc8f1f,0xd05d53d5,0x3cbf368b,0x671eea41,0xe1bae180,0xba1b3d4a,0x56f95814,0x0d5884de, + 0xf2a8f5ea,0xa9092920,0x45eb4c7e,0x1e4a90b4,0x98ee9b75,0xc34f47bf,0x2fad22e1,0x740cfe2b, + 0x262428d4,0x7d85f41e,0x91679140,0xcac64d8a,0x4c62464b,0x17c39a81,0xfb21ffdf,0xa0802315, + 0xbee0a442,0xe5417888,0x09a31dd6,0x5202c11c,0xd4a6cadd,0x8f071617,0x63e57349,0x3844af83, + 0x6a6c797c,0x31cda5b6,0xdd2fc0e8,0x868e1c22,0x002a17e3,0x5b8bcb29,0xb769ae77,0xecc872bd, + 0x13380389,0x4899df43,0xa47bba1d,0xffda66d7,0x797e6d16,0x22dfb1dc,0xce3dd482,0x959c0848, + 0xc7b4deb7,0x9c15027d,0x70f76723,0x2b56bbe9,0xadf2b028,0xf6536ce2,0x1ab109bc,0x4110d576, + 0xe190f663,0xba312aa9,0x56d34ff7,0x0d72933d,0x8bd698fc,0xd0774436,0x3c952168,0x6734fda2, + 0x351c2b5d,0x6ebdf797,0x825f92c9,0xd9fe4e03,0x5f5a45c2,0x04fb9908,0xe819fc56,0xb3b8209c, + 0x4c4851a8,0x17e98d62,0xfb0be83c,0xa0aa34f6,0x260e3f37,0x7dafe3fd,0x914d86a3,0xcaec5a69, + 0x98c48c96,0xc365505c,0x2f873502,0x7426e9c8,0xf282e209,0xa9233ec3,0x45c15b9d,0x1e608757, + 0x79005533,0x22a189f9,0xce43eca7,0x95e2306d,0x13463bac,0x48e7e766,0xa4058238,0xffa45ef2, + 0xad8c880d,0xf62d54c7,0x1acf3199,0x416eed53,0xc7cae692,0x9c6b3a58,0x70895f06,0x2b2883cc, + 0xd4d8f2f8,0x8f792e32,0x639b4b6c,0x383a97a6,0xbe9e9c67,0xe53f40ad,0x09dd25f3,0x527cf939, + 0x00542fc6,0x5bf5f30c,0xb7179652,0xecb64a98,0x6a124159,0x31b39d93,0xdd51f8cd,0x86f02407, + 0x26700712,0x7dd1dbd8,0x9133be86,0xca92624c,0x4c36698d,0x1797b547,0xfb75d019,0xa0d40cd3, + 0xf2fcda2c,0xa95d06e6,0x45bf63b8,0x1e1ebf72,0x98bab4b3,0xc31b6879,0x2ff90d27,0x7458d1ed, + 0x8ba8a0d9,0xd0097c13,0x3ceb194d,0x674ac587,0xe1eece46,0xba4f128c,0x56ad77d2,0x0d0cab18, + 0x5f247de7,0x0485a12d,0xe867c473,0xb3c618b9,0x35621378,0x6ec3cfb2,0x8221aaec,0xd9807626, + 0xc7e0f171,0x9c412dbb,0x70a348e5,0x2b02942f,0xada69fee,0xf6074324,0x1ae5267a,0x4144fab0, + 0x136c2c4f,0x48cdf085,0xa42f95db,0xff8e4911,0x792a42d0,0x228b9e1a,0xce69fb44,0x95c8278e, + 0x6a3856ba,0x31998a70,0xdd7bef2e,0x86da33e4,0x007e3825,0x5bdfe4ef,0xb73d81b1,0xec9c5d7b, + 0xbeb48b84,0xe515574e,0x09f73210,0x5256eeda,0xd4f2e51b,0x8f5339d1,0x63b15c8f,0x38108045, + 0x9890a350,0xc3317f9a,0x2fd31ac4,0x7472c60e,0xf2d6cdcf,0xa9771105,0x4595745b,0x1e34a891, + 0x4c1c7e6e,0x17bda2a4,0xfb5fc7fa,0xa0fe1b30,0x265a10f1,0x7dfbcc3b,0x9119a965,0xcab875af, + 0x3548049b,0x6ee9d851,0x820bbd0f,0xd9aa61c5,0x5f0e6a04,0x04afb6ce,0xe84dd390,0xb3ec0f5a, + 0xe1c4d9a5,0xba65056f,0x56876031,0x0d26bcfb,0x8b82b73a,0xd0236bf0,0x3cc10eae,0x6760d264}}; diff --git a/thirdparty/libogg/framing.c b/thirdparty/libogg/framing.c index 79fc715c8c..83601199ad 100644 --- a/thirdparty/libogg/framing.c +++ b/thirdparty/libogg/framing.c @@ -5,14 +5,13 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2018 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: code raw packets into framed OggSquish stream and decode Ogg streams back into raw packets - last mod: $Id$ note: The CRC code is directly derived from public domain code by Ross Williams (ross@guest.adelaide.edu.au). See docs/framing.html @@ -20,6 +19,10 @@ ********************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdlib.h> #include <limits.h> #include <string.h> @@ -45,7 +48,7 @@ int ogg_page_eos(const ogg_page *og){ ogg_int64_t ogg_page_granulepos(const ogg_page *og){ unsigned char *page=og->header; - ogg_int64_t granulepos=page[13]&(0xff); + ogg_uint64_t granulepos=page[13]&(0xff); granulepos= (granulepos<<8)|(page[12]&0xff); granulepos= (granulepos<<8)|(page[11]&0xff); granulepos= (granulepos<<8)|(page[10]&0xff); @@ -53,21 +56,21 @@ ogg_int64_t ogg_page_granulepos(const ogg_page *og){ granulepos= (granulepos<<8)|(page[8]&0xff); granulepos= (granulepos<<8)|(page[7]&0xff); granulepos= (granulepos<<8)|(page[6]&0xff); - return(granulepos); + return((ogg_int64_t)granulepos); } int ogg_page_serialno(const ogg_page *og){ - return(og->header[14] | - (og->header[15]<<8) | - (og->header[16]<<16) | - (og->header[17]<<24)); + return((int)((ogg_uint32_t)og->header[14]) | + ((ogg_uint32_t)og->header[15]<<8) | + ((ogg_uint32_t)og->header[16]<<16) | + ((ogg_uint32_t)og->header[17]<<24)); } long ogg_page_pageno(const ogg_page *og){ - return(og->header[18] | - (og->header[19]<<8) | - (og->header[20]<<16) | - (og->header[21]<<24)); + return((long)((ogg_uint32_t)og->header[18]) | + ((ogg_uint32_t)og->header[19]<<8) | + ((ogg_uint32_t)og->header[20]<<16) | + ((ogg_uint32_t)og->header[21]<<24)); } @@ -99,90 +102,31 @@ int ogg_page_packets(const ogg_page *og){ #if 0 /* helper to initialize lookup for direct-table CRC (illustrative; we - use the static init below) */ - -static ogg_uint32_t _ogg_crc_entry(unsigned long index){ - int i; - unsigned long r; - - r = index << 24; - for (i=0; i<8; i++) - if (r & 0x80000000UL) - r = (r << 1) ^ 0x04c11db7; /* The same as the ethernet generator - polynomial, although we use an - unreflected alg and an init/final - of 0, not 0xffffffff */ - else - r<<=1; - return (r & 0xffffffffUL); + use the static init in crctable.h) */ + +static void _ogg_crc_init(){ + int i, j; + ogg_uint32_t polynomial, crc; + polynomial = 0x04c11db7; /* The same as the ethernet generator + polynomial, although we use an + unreflected alg and an init/final + of 0, not 0xffffffff */ + for (i = 0; i <= 0xFF; i++){ + crc = i << 24; + + for (j = 0; j < 8; j++) + crc = (crc << 1) ^ (crc & (1 << 31) ? polynomial : 0); + + crc_lookup[0][i] = crc; + } + + for (i = 0; i <= 0xFF; i++) + for (j = 1; j < 8; j++) + crc_lookup[j][i] = crc_lookup[0][(crc_lookup[j - 1][i] >> 24) & 0xFF] ^ (crc_lookup[j - 1][i] << 8); } #endif -static const ogg_uint32_t crc_lookup[256]={ - 0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9, - 0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005, - 0x2608edb8,0x22c9f00f,0x2f8ad6d6,0x2b4bcb61, - 0x350c9b64,0x31cd86d3,0x3c8ea00a,0x384fbdbd, - 0x4c11db70,0x48d0c6c7,0x4593e01e,0x4152fda9, - 0x5f15adac,0x5bd4b01b,0x569796c2,0x52568b75, - 0x6a1936c8,0x6ed82b7f,0x639b0da6,0x675a1011, - 0x791d4014,0x7ddc5da3,0x709f7b7a,0x745e66cd, - 0x9823b6e0,0x9ce2ab57,0x91a18d8e,0x95609039, - 0x8b27c03c,0x8fe6dd8b,0x82a5fb52,0x8664e6e5, - 0xbe2b5b58,0xbaea46ef,0xb7a96036,0xb3687d81, - 0xad2f2d84,0xa9ee3033,0xa4ad16ea,0xa06c0b5d, - 0xd4326d90,0xd0f37027,0xddb056fe,0xd9714b49, - 0xc7361b4c,0xc3f706fb,0xceb42022,0xca753d95, - 0xf23a8028,0xf6fb9d9f,0xfbb8bb46,0xff79a6f1, - 0xe13ef6f4,0xe5ffeb43,0xe8bccd9a,0xec7dd02d, - 0x34867077,0x30476dc0,0x3d044b19,0x39c556ae, - 0x278206ab,0x23431b1c,0x2e003dc5,0x2ac12072, - 0x128e9dcf,0x164f8078,0x1b0ca6a1,0x1fcdbb16, - 0x018aeb13,0x054bf6a4,0x0808d07d,0x0cc9cdca, - 0x7897ab07,0x7c56b6b0,0x71159069,0x75d48dde, - 0x6b93dddb,0x6f52c06c,0x6211e6b5,0x66d0fb02, - 0x5e9f46bf,0x5a5e5b08,0x571d7dd1,0x53dc6066, - 0x4d9b3063,0x495a2dd4,0x44190b0d,0x40d816ba, - 0xaca5c697,0xa864db20,0xa527fdf9,0xa1e6e04e, - 0xbfa1b04b,0xbb60adfc,0xb6238b25,0xb2e29692, - 0x8aad2b2f,0x8e6c3698,0x832f1041,0x87ee0df6, - 0x99a95df3,0x9d684044,0x902b669d,0x94ea7b2a, - 0xe0b41de7,0xe4750050,0xe9362689,0xedf73b3e, - 0xf3b06b3b,0xf771768c,0xfa325055,0xfef34de2, - 0xc6bcf05f,0xc27dede8,0xcf3ecb31,0xcbffd686, - 0xd5b88683,0xd1799b34,0xdc3abded,0xd8fba05a, - 0x690ce0ee,0x6dcdfd59,0x608edb80,0x644fc637, - 0x7a089632,0x7ec98b85,0x738aad5c,0x774bb0eb, - 0x4f040d56,0x4bc510e1,0x46863638,0x42472b8f, - 0x5c007b8a,0x58c1663d,0x558240e4,0x51435d53, - 0x251d3b9e,0x21dc2629,0x2c9f00f0,0x285e1d47, - 0x36194d42,0x32d850f5,0x3f9b762c,0x3b5a6b9b, - 0x0315d626,0x07d4cb91,0x0a97ed48,0x0e56f0ff, - 0x1011a0fa,0x14d0bd4d,0x19939b94,0x1d528623, - 0xf12f560e,0xf5ee4bb9,0xf8ad6d60,0xfc6c70d7, - 0xe22b20d2,0xe6ea3d65,0xeba91bbc,0xef68060b, - 0xd727bbb6,0xd3e6a601,0xdea580d8,0xda649d6f, - 0xc423cd6a,0xc0e2d0dd,0xcda1f604,0xc960ebb3, - 0xbd3e8d7e,0xb9ff90c9,0xb4bcb610,0xb07daba7, - 0xae3afba2,0xaafbe615,0xa7b8c0cc,0xa379dd7b, - 0x9b3660c6,0x9ff77d71,0x92b45ba8,0x9675461f, - 0x8832161a,0x8cf30bad,0x81b02d74,0x857130c3, - 0x5d8a9099,0x594b8d2e,0x5408abf7,0x50c9b640, - 0x4e8ee645,0x4a4ffbf2,0x470cdd2b,0x43cdc09c, - 0x7b827d21,0x7f436096,0x7200464f,0x76c15bf8, - 0x68860bfd,0x6c47164a,0x61043093,0x65c52d24, - 0x119b4be9,0x155a565e,0x18197087,0x1cd86d30, - 0x029f3d35,0x065e2082,0x0b1d065b,0x0fdc1bec, - 0x3793a651,0x3352bbe6,0x3e119d3f,0x3ad08088, - 0x2497d08d,0x2056cd3a,0x2d15ebe3,0x29d4f654, - 0xc5a92679,0xc1683bce,0xcc2b1d17,0xc8ea00a0, - 0xd6ad50a5,0xd26c4d12,0xdf2f6bcb,0xdbee767c, - 0xe3a1cbc1,0xe760d676,0xea23f0af,0xeee2ed18, - 0xf0a5bd1d,0xf464a0aa,0xf9278673,0xfde69bc4, - 0x89b8fd09,0x8d79e0be,0x803ac667,0x84fbdbd0, - 0x9abc8bd5,0x9e7d9662,0x933eb0bb,0x97ffad0c, - 0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668, - 0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4}; +#include "crctable.h" /* init the encode/decode logical stream state */ @@ -290,10 +234,27 @@ static int _os_lacing_expand(ogg_stream_state *os,long needed){ /* Direct table CRC; note that this will be faster in the future if we perform the checksum simultaneously with other copies */ +static ogg_uint32_t _os_update_crc(ogg_uint32_t crc, unsigned char *buffer, int size){ + while (size>=8){ + crc^=((ogg_uint32_t)buffer[0]<<24)|((ogg_uint32_t)buffer[1]<<16)|((ogg_uint32_t)buffer[2]<<8)|((ogg_uint32_t)buffer[3]); + + crc=crc_lookup[7][ crc>>24 ]^crc_lookup[6][(crc>>16)&0xFF]^ + crc_lookup[5][(crc>> 8)&0xFF]^crc_lookup[4][ crc &0xFF]^ + crc_lookup[3][buffer[4] ]^crc_lookup[2][buffer[5] ]^ + crc_lookup[1][buffer[6] ]^crc_lookup[0][buffer[7] ]; + + buffer+=8; + size-=8; + } + + while (size--) + crc=(crc<<8)^crc_lookup[0][((crc >> 24)&0xff)^*buffer++]; + return crc; +} + void ogg_page_checksum_set(ogg_page *og){ if(og){ ogg_uint32_t crc_reg=0; - int i; /* safety; needed for API behavior, but not framing code */ og->header[22]=0; @@ -301,10 +262,8 @@ void ogg_page_checksum_set(ogg_page *og){ og->header[24]=0; og->header[25]=0; - for(i=0;i<og->header_len;i++) - crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->header[i]]; - for(i=0;i<og->body_len;i++) - crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->body[i]]; + crc_reg=_os_update_crc(crc_reg,og->header,og->header_len); + crc_reg=_os_update_crc(crc_reg,og->body,og->body_len); og->header[22]=(unsigned char)(crc_reg&0xff); og->header[23]=(unsigned char)((crc_reg>>8)&0xff); @@ -414,9 +373,9 @@ static int ogg_stream_flush_i(ogg_stream_state *os,ogg_page *og, int force, int }else{ /* The extra packets_done, packet_just_done logic here attempts to do two things: - 1) Don't unneccessarily span pages. + 1) Don't unnecessarily span pages. 2) Unless necessary, don't flush pages if there are less than four packets on - them; this expands page size to reduce unneccessary overhead if incoming packets + them; this expands page size to reduce unnecessary overhead if incoming packets are large. These are not necessary behaviors, just 'always better than naive flushing' without requiring an application to explicitly request a specific optimized @@ -723,16 +682,15 @@ long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og){ /* replace the computed checksum with the one actually read in */ memcpy(page+22,chksum,4); +#ifndef DISABLE_CRC /* Bad checksum. Lose sync */ goto sync_fail; +#endif } } /* yes, have a whole page all ready to go */ { - unsigned char *page=oy->data+oy->returned; - long bytes; - if(og){ og->header=page; og->header_len=oy->headerbytes; @@ -1814,6 +1772,7 @@ int main(void){ test_pack(packets,headret,0,0,0); } +#ifndef DISABLE_CRC { /* test for the libogg 1.1.1 resync in large continuation bug found by Josh Coalson) */ @@ -1823,6 +1782,9 @@ int main(void){ fprintf(stderr,"testing continuation resync in very large packets... "); test_pack(packets,headret,100,2,3); } +#else + fprintf(stderr,"Skipping continuation resync test due to --disable-crc\n"); +#endif { /* term only page. why not? */ @@ -2084,6 +2046,7 @@ int main(void){ fprintf(stderr,"ok.\n"); } +#ifndef DISABLE_CRC /* Test recapture: page + garbage + page */ { ogg_page og_de; @@ -2125,6 +2088,9 @@ int main(void){ fprintf(stderr,"ok.\n"); } +#else + fprintf(stderr,"Skipping recapture test due to --disable-crc\n"); +#endif /* Free page data that was previously copied */ { @@ -2133,6 +2099,9 @@ int main(void){ } } } + ogg_sync_clear(&oy); + ogg_stream_clear(&os_en); + ogg_stream_clear(&os_de); return(0); } diff --git a/thirdparty/libogg/ogg/config_types.h b/thirdparty/libogg/ogg/config_types.h index e630657547..3574a8ad44 100644 --- a/thirdparty/libogg/ogg/config_types.h +++ b/thirdparty/libogg/ogg/config_types.h @@ -8,5 +8,6 @@ typedef uint16_t ogg_uint16_t; typedef int32_t ogg_int32_t; typedef uint32_t ogg_uint32_t; typedef int64_t ogg_int64_t; +typedef uint64_t ogg_uint64_t; #endif diff --git a/thirdparty/libogg/ogg/ogg.h b/thirdparty/libogg/ogg/ogg.h index 7609fc24d6..c4325aa76d 100644 --- a/thirdparty/libogg/ogg/ogg.h +++ b/thirdparty/libogg/ogg/ogg.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel libogg include - last mod: $Id$ ********************************************************************/ #ifndef _OGG_H diff --git a/thirdparty/libogg/ogg/os_types.h b/thirdparty/libogg/ogg/os_types.h index b8f56308b5..e655a1d628 100644 --- a/thirdparty/libogg/ogg/os_types.h +++ b/thirdparty/libogg/ogg/os_types.h @@ -10,8 +10,7 @@ * * ******************************************************************** - function: #ifdef jail to whip a few platforms into the UNIX ideal. - last mod: $Id$ + function: Define a consistent set of types on each platform. ********************************************************************/ #ifndef _OS_TYPES_H @@ -44,6 +43,7 @@ typedef unsigned long long ogg_uint64_t; # elif defined(__MWERKS__) typedef long long ogg_int64_t; + typedef unsigned long long ogg_uint64_t; typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef short ogg_int16_t; @@ -62,6 +62,7 @@ typedef __int64 ogg_int64_t; typedef __int32 ogg_int32_t; typedef unsigned __int32 ogg_uint32_t; + typedef unsigned __int64 ogg_uint64_t; typedef __int16 ogg_int16_t; typedef unsigned __int16 ogg_uint16_t; # endif @@ -69,12 +70,13 @@ #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ -# include <inttypes.h> +# include <sys/types.h> typedef int16_t ogg_int16_t; - typedef uint16_t ogg_uint16_t; + typedef u_int16_t ogg_uint16_t; typedef int32_t ogg_int32_t; - typedef uint32_t ogg_uint32_t; + typedef u_int32_t ogg_uint32_t; typedef int64_t ogg_int64_t; + typedef u_int64_t ogg_uint64_t; #elif defined(__HAIKU__) @@ -85,6 +87,7 @@ typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long ogg_int64_t; + typedef unsigned long long ogg_uint64_t; #elif defined(__BEOS__) @@ -95,6 +98,7 @@ typedef int32_t ogg_int32_t; typedef uint32_t ogg_uint32_t; typedef int64_t ogg_int64_t; + typedef uint64_t ogg_uint64_t; #elif defined (__EMX__) @@ -104,6 +108,8 @@ typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long ogg_int64_t; + typedef unsigned long long ogg_uint64_t; + #elif defined (DJGPP) @@ -112,11 +118,13 @@ typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long ogg_int64_t; + typedef unsigned long long ogg_uint64_t; #elif defined(R5900) /* PS2 EE */ typedef long ogg_int64_t; + typedef unsigned long ogg_uint64_t; typedef int ogg_int32_t; typedef unsigned ogg_uint32_t; typedef short ogg_int16_t; @@ -129,6 +137,7 @@ typedef signed int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long int ogg_int64_t; + typedef unsigned long long int ogg_uint64_t; #elif defined(__TMS320C6X__) @@ -138,6 +147,7 @@ typedef signed int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long int ogg_int64_t; + typedef unsigned long long int ogg_uint64_t; #else diff --git a/thirdparty/libwebp/src/dec/quant_dec.c b/thirdparty/libwebp/src/dec/quant_dec.c index f07212ad73..a0ac018b0f 100644 --- a/thirdparty/libwebp/src/dec/quant_dec.c +++ b/thirdparty/libwebp/src/dec/quant_dec.c @@ -61,12 +61,17 @@ static const uint16_t kAcTable[128] = { void VP8ParseQuant(VP8Decoder* const dec) { VP8BitReader* const br = &dec->br_; - const int base_q0 = VP8GetValue(br, 7); - const int dqy1_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - const int dqy2_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - const int dqy2_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - const int dquv_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; - const int dquv_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0; + const int base_q0 = VP8GetValue(br, 7, "global-header"); + const int dqy1_dc = VP8Get(br, "global-header") ? + VP8GetSignedValue(br, 4, "global-header") : 0; + const int dqy2_dc = VP8Get(br, "global-header") ? + VP8GetSignedValue(br, 4, "global-header") : 0; + const int dqy2_ac = VP8Get(br, "global-header") ? + VP8GetSignedValue(br, 4, "global-header") : 0; + const int dquv_dc = VP8Get(br, "global-header") ? + VP8GetSignedValue(br, 4, "global-header") : 0; + const int dquv_ac = VP8Get(br, "global-header") ? + VP8GetSignedValue(br, 4, "global-header") : 0; const VP8SegmentHeader* const hdr = &dec->segment_hdr_; int i; diff --git a/thirdparty/libwebp/src/dec/tree_dec.c b/thirdparty/libwebp/src/dec/tree_dec.c index 3f5a957d32..1c6fdea27c 100644 --- a/thirdparty/libwebp/src/dec/tree_dec.c +++ b/thirdparty/libwebp/src/dec/tree_dec.c @@ -296,20 +296,21 @@ static void ParseIntraMode(VP8BitReader* const br, // to decode more than 1 keyframe. if (dec->segment_hdr_.update_map_) { // Hardcoded tree parsing - block->segment_ = !VP8GetBit(br, dec->proba_.segments_[0]) - ? VP8GetBit(br, dec->proba_.segments_[1]) - : 2 + VP8GetBit(br, dec->proba_.segments_[2]); + block->segment_ = !VP8GetBit(br, dec->proba_.segments_[0], "segments") + ? VP8GetBit(br, dec->proba_.segments_[1], "segments") + : VP8GetBit(br, dec->proba_.segments_[2], "segments") + 2; } else { block->segment_ = 0; // default for intra } - if (dec->use_skip_proba_) block->skip_ = VP8GetBit(br, dec->skip_p_); + if (dec->use_skip_proba_) block->skip_ = VP8GetBit(br, dec->skip_p_, "skip"); - block->is_i4x4_ = !VP8GetBit(br, 145); // decide for B_PRED first + block->is_i4x4_ = !VP8GetBit(br, 145, "block-size"); if (!block->is_i4x4_) { // Hardcoded 16x16 intra-mode decision tree. const int ymode = - VP8GetBit(br, 156) ? (VP8GetBit(br, 128) ? TM_PRED : H_PRED) - : (VP8GetBit(br, 163) ? V_PRED : DC_PRED); + VP8GetBit(br, 156, "pred-modes") ? + (VP8GetBit(br, 128, "pred-modes") ? TM_PRED : H_PRED) : + (VP8GetBit(br, 163, "pred-modes") ? V_PRED : DC_PRED); block->imodes_[0] = ymode; memset(top, ymode, 4 * sizeof(*top)); memset(left, ymode, 4 * sizeof(*left)); @@ -323,22 +324,25 @@ static void ParseIntraMode(VP8BitReader* const br, const uint8_t* const prob = kBModesProba[top[x]][ymode]; #if (USE_GENERIC_TREE == 1) // Generic tree-parsing - int i = kYModesIntra4[VP8GetBit(br, prob[0])]; + int i = kYModesIntra4[VP8GetBit(br, prob[0], "pred-modes")]; while (i > 0) { - i = kYModesIntra4[2 * i + VP8GetBit(br, prob[i])]; + i = kYModesIntra4[2 * i + VP8GetBit(br, prob[i], "pred-modes")]; } ymode = -i; #else // Hardcoded tree parsing - ymode = !VP8GetBit(br, prob[0]) ? B_DC_PRED : - !VP8GetBit(br, prob[1]) ? B_TM_PRED : - !VP8GetBit(br, prob[2]) ? B_VE_PRED : - !VP8GetBit(br, prob[3]) ? - (!VP8GetBit(br, prob[4]) ? B_HE_PRED : - (!VP8GetBit(br, prob[5]) ? B_RD_PRED : B_VR_PRED)) : - (!VP8GetBit(br, prob[6]) ? B_LD_PRED : - (!VP8GetBit(br, prob[7]) ? B_VL_PRED : - (!VP8GetBit(br, prob[8]) ? B_HD_PRED : B_HU_PRED))); + ymode = !VP8GetBit(br, prob[0], "pred-modes") ? B_DC_PRED : + !VP8GetBit(br, prob[1], "pred-modes") ? B_TM_PRED : + !VP8GetBit(br, prob[2], "pred-modes") ? B_VE_PRED : + !VP8GetBit(br, prob[3], "pred-modes") ? + (!VP8GetBit(br, prob[4], "pred-modes") ? B_HE_PRED : + (!VP8GetBit(br, prob[5], "pred-modes") ? B_RD_PRED + : B_VR_PRED)) : + (!VP8GetBit(br, prob[6], "pred-modes") ? B_LD_PRED : + (!VP8GetBit(br, prob[7], "pred-modes") ? B_VL_PRED : + (!VP8GetBit(br, prob[8], "pred-modes") ? B_HD_PRED + : B_HU_PRED)) + ); #endif // USE_GENERIC_TREE top[x] = ymode; } @@ -348,9 +352,9 @@ static void ParseIntraMode(VP8BitReader* const br, } } // Hardcoded UVMode decision tree - block->uvmode_ = !VP8GetBit(br, 142) ? DC_PRED - : !VP8GetBit(br, 114) ? V_PRED - : VP8GetBit(br, 183) ? TM_PRED : H_PRED; + block->uvmode_ = !VP8GetBit(br, 142, "pred-modes-uv") ? DC_PRED + : !VP8GetBit(br, 114, "pred-modes-uv") ? V_PRED + : VP8GetBit(br, 183, "pred-modes-uv") ? TM_PRED : H_PRED; } int VP8ParseIntraModeRow(VP8BitReader* const br, VP8Decoder* const dec) { @@ -514,8 +518,10 @@ void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) { for (b = 0; b < NUM_BANDS; ++b) { for (c = 0; c < NUM_CTX; ++c) { for (p = 0; p < NUM_PROBAS; ++p) { - const int v = VP8GetBit(br, CoeffsUpdateProba[t][b][c][p]) ? - VP8GetValue(br, 8) : CoeffsProba0[t][b][c][p]; + const int v = + VP8GetBit(br, CoeffsUpdateProba[t][b][c][p], "global-header") ? + VP8GetValue(br, 8, "global-header") : + CoeffsProba0[t][b][c][p]; proba->bands_[t][b].probas_[c][p] = v; } } @@ -524,9 +530,8 @@ void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) { proba->bands_ptr_[t][b] = &proba->bands_[t][kBands[b]]; } } - dec->use_skip_proba_ = VP8Get(br); + dec->use_skip_proba_ = VP8Get(br, "global-header"); if (dec->use_skip_proba_) { - dec->skip_p_ = VP8GetValue(br, 8); + dec->skip_p_ = VP8GetValue(br, 8, "global-header"); } } - diff --git a/thirdparty/libwebp/src/dec/vp8_dec.c b/thirdparty/libwebp/src/dec/vp8_dec.c index c904b529f6..57efb69041 100644 --- a/thirdparty/libwebp/src/dec/vp8_dec.c +++ b/thirdparty/libwebp/src/dec/vp8_dec.c @@ -161,23 +161,26 @@ static int ParseSegmentHeader(VP8BitReader* br, VP8SegmentHeader* hdr, VP8Proba* proba) { assert(br != NULL); assert(hdr != NULL); - hdr->use_segment_ = VP8Get(br); + hdr->use_segment_ = VP8Get(br, "global-header"); if (hdr->use_segment_) { - hdr->update_map_ = VP8Get(br); - if (VP8Get(br)) { // update data + hdr->update_map_ = VP8Get(br, "global-header"); + if (VP8Get(br, "global-header")) { // update data int s; - hdr->absolute_delta_ = VP8Get(br); + hdr->absolute_delta_ = VP8Get(br, "global-header"); for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - hdr->quantizer_[s] = VP8Get(br) ? VP8GetSignedValue(br, 7) : 0; + hdr->quantizer_[s] = VP8Get(br, "global-header") ? + VP8GetSignedValue(br, 7, "global-header") : 0; } for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - hdr->filter_strength_[s] = VP8Get(br) ? VP8GetSignedValue(br, 6) : 0; + hdr->filter_strength_[s] = VP8Get(br, "global-header") ? + VP8GetSignedValue(br, 6, "global-header") : 0; } } if (hdr->update_map_) { int s; for (s = 0; s < MB_FEATURE_TREE_PROBS; ++s) { - proba->segments_[s] = VP8Get(br) ? VP8GetValue(br, 8) : 255u; + proba->segments_[s] = VP8Get(br, "global-header") ? + VP8GetValue(br, 8, "global-header") : 255u; } } } else { @@ -205,7 +208,7 @@ static VP8StatusCode ParsePartitions(VP8Decoder* const dec, size_t last_part; size_t p; - dec->num_parts_minus_one_ = (1 << VP8GetValue(br, 2)) - 1; + dec->num_parts_minus_one_ = (1 << VP8GetValue(br, 2, "global-header")) - 1; last_part = dec->num_parts_minus_one_; if (size < 3 * last_part) { // we can't even read the sizes with sz[]! That's a failure. @@ -229,21 +232,21 @@ static VP8StatusCode ParsePartitions(VP8Decoder* const dec, // Paragraph 9.4 static int ParseFilterHeader(VP8BitReader* br, VP8Decoder* const dec) { VP8FilterHeader* const hdr = &dec->filter_hdr_; - hdr->simple_ = VP8Get(br); - hdr->level_ = VP8GetValue(br, 6); - hdr->sharpness_ = VP8GetValue(br, 3); - hdr->use_lf_delta_ = VP8Get(br); + hdr->simple_ = VP8Get(br, "global-header"); + hdr->level_ = VP8GetValue(br, 6, "global-header"); + hdr->sharpness_ = VP8GetValue(br, 3, "global-header"); + hdr->use_lf_delta_ = VP8Get(br, "global-header"); if (hdr->use_lf_delta_) { - if (VP8Get(br)) { // update lf-delta? + if (VP8Get(br, "global-header")) { // update lf-delta? int i; for (i = 0; i < NUM_REF_LF_DELTAS; ++i) { - if (VP8Get(br)) { - hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6); + if (VP8Get(br, "global-header")) { + hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6, "global-header"); } } for (i = 0; i < NUM_MODE_LF_DELTAS; ++i) { - if (VP8Get(br)) { - hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6); + if (VP8Get(br, "global-header")) { + hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6, "global-header"); } } } @@ -352,8 +355,8 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { buf_size -= frm_hdr->partition_length_; if (frm_hdr->key_frame_) { - pic_hdr->colorspace_ = VP8Get(br); - pic_hdr->clamp_type_ = VP8Get(br); + pic_hdr->colorspace_ = VP8Get(br, "global-header"); + pic_hdr->clamp_type_ = VP8Get(br, "global-header"); } if (!ParseSegmentHeader(br, &dec->segment_hdr_, &dec->proba_)) { return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, @@ -378,7 +381,7 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { "Not a key frame."); } - VP8Get(br); // ignore the value of update_proba_ + VP8Get(br, "global-header"); // ignore the value of update_proba_ VP8ParseProba(br, dec); @@ -403,28 +406,28 @@ static const uint8_t kZigzag[16] = { // See section 13-2: http://tools.ietf.org/html/rfc6386#section-13.2 static int GetLargeValue(VP8BitReader* const br, const uint8_t* const p) { int v; - if (!VP8GetBit(br, p[3])) { - if (!VP8GetBit(br, p[4])) { + if (!VP8GetBit(br, p[3], "coeffs")) { + if (!VP8GetBit(br, p[4], "coeffs")) { v = 2; } else { - v = 3 + VP8GetBit(br, p[5]); + v = 3 + VP8GetBit(br, p[5], "coeffs"); } } else { - if (!VP8GetBit(br, p[6])) { - if (!VP8GetBit(br, p[7])) { - v = 5 + VP8GetBit(br, 159); + if (!VP8GetBit(br, p[6], "coeffs")) { + if (!VP8GetBit(br, p[7], "coeffs")) { + v = 5 + VP8GetBit(br, 159, "coeffs"); } else { - v = 7 + 2 * VP8GetBit(br, 165); - v += VP8GetBit(br, 145); + v = 7 + 2 * VP8GetBit(br, 165, "coeffs"); + v += VP8GetBit(br, 145, "coeffs"); } } else { const uint8_t* tab; - const int bit1 = VP8GetBit(br, p[8]); - const int bit0 = VP8GetBit(br, p[9 + bit1]); + const int bit1 = VP8GetBit(br, p[8], "coeffs"); + const int bit0 = VP8GetBit(br, p[9 + bit1], "coeffs"); const int cat = 2 * bit1 + bit0; v = 0; for (tab = kCat3456[cat]; *tab; ++tab) { - v += v + VP8GetBit(br, *tab); + v += v + VP8GetBit(br, *tab, "coeffs"); } v += 3 + (8 << cat); } @@ -438,24 +441,24 @@ static int GetCoeffsFast(VP8BitReader* const br, int ctx, const quant_t dq, int n, int16_t* out) { const uint8_t* p = prob[n]->probas_[ctx]; for (; n < 16; ++n) { - if (!VP8GetBit(br, p[0])) { + if (!VP8GetBit(br, p[0], "coeffs")) { return n; // previous coeff was last non-zero coeff } - while (!VP8GetBit(br, p[1])) { // sequence of zero coeffs + while (!VP8GetBit(br, p[1], "coeffs")) { // sequence of zero coeffs p = prob[++n]->probas_[0]; if (n == 16) return 16; } { // non zero coeff const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas_[0]; int v; - if (!VP8GetBit(br, p[2])) { + if (!VP8GetBit(br, p[2], "coeffs")) { v = 1; p = p_ctx[1]; } else { v = GetLargeValue(br, p); p = p_ctx[2]; } - out[kZigzag[n]] = VP8GetSigned(br, v) * dq[n > 0]; + out[kZigzag[n]] = VP8GetSigned(br, v, "coeffs") * dq[n > 0]; } } return 16; @@ -468,24 +471,24 @@ static int GetCoeffsAlt(VP8BitReader* const br, int ctx, const quant_t dq, int n, int16_t* out) { const uint8_t* p = prob[n]->probas_[ctx]; for (; n < 16; ++n) { - if (!VP8GetBitAlt(br, p[0])) { + if (!VP8GetBitAlt(br, p[0], "coeffs")) { return n; // previous coeff was last non-zero coeff } - while (!VP8GetBitAlt(br, p[1])) { // sequence of zero coeffs + while (!VP8GetBitAlt(br, p[1], "coeffs")) { // sequence of zero coeffs p = prob[++n]->probas_[0]; if (n == 16) return 16; } { // non zero coeff const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas_[0]; int v; - if (!VP8GetBitAlt(br, p[2])) { + if (!VP8GetBitAlt(br, p[2], "coeffs")) { v = 1; p = p_ctx[1]; } else { v = GetLargeValue(br, p); p = p_ctx[2]; } - out[kZigzag[n]] = VP8GetSigned(br, v) * dq[n > 0]; + out[kZigzag[n]] = VP8GetSigned(br, v, "coeffs") * dq[n > 0]; } } return 16; diff --git a/thirdparty/libwebp/src/dec/vp8i_dec.h b/thirdparty/libwebp/src/dec/vp8i_dec.h index 2d7900aae1..3de8d86f90 100644 --- a/thirdparty/libwebp/src/dec/vp8i_dec.h +++ b/thirdparty/libwebp/src/dec/vp8i_dec.h @@ -32,7 +32,7 @@ extern "C" { // version numbers #define DEC_MAJ_VERSION 1 #define DEC_MIN_VERSION 0 -#define DEC_REV_VERSION 2 +#define DEC_REV_VERSION 3 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline). // Constraints are: We need to store one 16x16 block of luma samples (y), diff --git a/thirdparty/libwebp/src/dec/vp8l_dec.c b/thirdparty/libwebp/src/dec/vp8l_dec.c index 333bb3e80d..d3e27119ea 100644 --- a/thirdparty/libwebp/src/dec/vp8l_dec.c +++ b/thirdparty/libwebp/src/dec/vp8l_dec.c @@ -362,12 +362,8 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize, VP8LMetadata* const hdr = &dec->hdr_; uint32_t* huffman_image = NULL; HTreeGroup* htree_groups = NULL; - // When reading htrees, some might be unused, as the format allows it. - // We will still read them but put them in this htree_group_bogus. - HTreeGroup htree_group_bogus; HuffmanCode* huffman_tables = NULL; - HuffmanCode* huffman_tables_bogus = NULL; - HuffmanCode* next = NULL; + HuffmanCode* huffman_table = NULL; int num_htree_groups = 1; int num_htree_groups_max = 1; int max_alphabet_size = 0; @@ -418,12 +414,6 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize, if (*mapped_group == -1) *mapped_group = num_htree_groups++; huffman_image[i] = *mapped_group; } - huffman_tables_bogus = (HuffmanCode*)WebPSafeMalloc( - table_size, sizeof(*huffman_tables_bogus)); - if (huffman_tables_bogus == NULL) { - dec->status_ = VP8_STATUS_OUT_OF_MEMORY; - goto Error; - } } else { num_htree_groups = num_htree_groups_max; } @@ -453,63 +443,71 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize, goto Error; } - next = huffman_tables; + huffman_table = huffman_tables; for (i = 0; i < num_htree_groups_max; ++i) { - // If the index "i" is unused in the Huffman image, read the coefficients - // but store them to a bogus htree_group. - const int is_bogus = (mapping != NULL && mapping[i] == -1); - HTreeGroup* const htree_group = - is_bogus ? &htree_group_bogus : - &htree_groups[(mapping == NULL) ? i : mapping[i]]; - HuffmanCode** const htrees = htree_group->htrees; - HuffmanCode* huffman_tables_i = is_bogus ? huffman_tables_bogus : next; - int size; - int total_size = 0; - int is_trivial_literal = 1; - int max_bits = 0; - for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) { - int alphabet_size = kAlphabetSize[j]; - htrees[j] = huffman_tables_i; - if (j == 0 && color_cache_bits > 0) { - alphabet_size += 1 << color_cache_bits; - } - size = - ReadHuffmanCode(alphabet_size, dec, code_lengths, huffman_tables_i); - if (size == 0) { - goto Error; - } - if (is_trivial_literal && kLiteralMap[j] == 1) { - is_trivial_literal = (huffman_tables_i->bits == 0); + // If the index "i" is unused in the Huffman image, just make sure the + // coefficients are valid but do not store them. + if (mapping != NULL && mapping[i] == -1) { + for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) { + int alphabet_size = kAlphabetSize[j]; + if (j == 0 && color_cache_bits > 0) { + alphabet_size += (1 << color_cache_bits); + } + // Passing in NULL so that nothing gets filled. + if (!ReadHuffmanCode(alphabet_size, dec, code_lengths, NULL)) { + goto Error; + } } - total_size += huffman_tables_i->bits; - huffman_tables_i += size; - if (j <= ALPHA) { - int local_max_bits = code_lengths[0]; - int k; - for (k = 1; k < alphabet_size; ++k) { - if (code_lengths[k] > local_max_bits) { - local_max_bits = code_lengths[k]; + } else { + HTreeGroup* const htree_group = + &htree_groups[(mapping == NULL) ? i : mapping[i]]; + HuffmanCode** const htrees = htree_group->htrees; + int size; + int total_size = 0; + int is_trivial_literal = 1; + int max_bits = 0; + for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) { + int alphabet_size = kAlphabetSize[j]; + htrees[j] = huffman_table; + if (j == 0 && color_cache_bits > 0) { + alphabet_size += (1 << color_cache_bits); + } + size = ReadHuffmanCode(alphabet_size, dec, code_lengths, huffman_table); + if (size == 0) { + goto Error; + } + if (is_trivial_literal && kLiteralMap[j] == 1) { + is_trivial_literal = (huffman_table->bits == 0); + } + total_size += huffman_table->bits; + huffman_table += size; + if (j <= ALPHA) { + int local_max_bits = code_lengths[0]; + int k; + for (k = 1; k < alphabet_size; ++k) { + if (code_lengths[k] > local_max_bits) { + local_max_bits = code_lengths[k]; + } } + max_bits += local_max_bits; } - max_bits += local_max_bits; } - } - if (!is_bogus) next = huffman_tables_i; - htree_group->is_trivial_literal = is_trivial_literal; - htree_group->is_trivial_code = 0; - if (is_trivial_literal) { - const int red = htrees[RED][0].value; - const int blue = htrees[BLUE][0].value; - const int alpha = htrees[ALPHA][0].value; - htree_group->literal_arb = ((uint32_t)alpha << 24) | (red << 16) | blue; - if (total_size == 0 && htrees[GREEN][0].value < NUM_LITERAL_CODES) { - htree_group->is_trivial_code = 1; - htree_group->literal_arb |= htrees[GREEN][0].value << 8; + htree_group->is_trivial_literal = is_trivial_literal; + htree_group->is_trivial_code = 0; + if (is_trivial_literal) { + const int red = htrees[RED][0].value; + const int blue = htrees[BLUE][0].value; + const int alpha = htrees[ALPHA][0].value; + htree_group->literal_arb = ((uint32_t)alpha << 24) | (red << 16) | blue; + if (total_size == 0 && htrees[GREEN][0].value < NUM_LITERAL_CODES) { + htree_group->is_trivial_code = 1; + htree_group->literal_arb |= htrees[GREEN][0].value << 8; + } } + htree_group->use_packed_table = + !htree_group->is_trivial_code && (max_bits < HUFFMAN_PACKED_BITS); + if (htree_group->use_packed_table) BuildPackedTable(htree_group); } - htree_group->use_packed_table = - !htree_group->is_trivial_code && (max_bits < HUFFMAN_PACKED_BITS); - if (htree_group->use_packed_table) BuildPackedTable(htree_group); } ok = 1; @@ -521,7 +519,6 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize, Error: WebPSafeFree(code_lengths); - WebPSafeFree(huffman_tables_bogus); WebPSafeFree(mapping); if (!ok) { WebPSafeFree(huffman_image); diff --git a/thirdparty/libwebp/src/demux/demux.c b/thirdparty/libwebp/src/demux/demux.c index d8f7a40a56..ab6433e54b 100644 --- a/thirdparty/libwebp/src/demux/demux.c +++ b/thirdparty/libwebp/src/demux/demux.c @@ -25,7 +25,7 @@ #define DMUX_MAJ_VERSION 1 #define DMUX_MIN_VERSION 0 -#define DMUX_REV_VERSION 2 +#define DMUX_REV_VERSION 3 typedef struct { size_t start_; // start location of the data diff --git a/thirdparty/libwebp/src/dsp/alpha_processing_sse2.c b/thirdparty/libwebp/src/dsp/alpha_processing_sse2.c index 76587006a1..2871c56d84 100644 --- a/thirdparty/libwebp/src/dsp/alpha_processing_sse2.c +++ b/thirdparty/libwebp/src/dsp/alpha_processing_sse2.c @@ -214,7 +214,7 @@ static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first, // Alpha detection static int HasAlpha8b_SSE2(const uint8_t* src, int length) { - const __m128i all_0xff = _mm_set1_epi8(0xff); + const __m128i all_0xff = _mm_set1_epi8((char)0xff); int i = 0; for (; i + 16 <= length; i += 16) { const __m128i v = _mm_loadu_si128((const __m128i*)(src + i)); @@ -228,7 +228,7 @@ static int HasAlpha8b_SSE2(const uint8_t* src, int length) { static int HasAlpha32b_SSE2(const uint8_t* src, int length) { const __m128i alpha_mask = _mm_set1_epi32(0xff); - const __m128i all_0xff = _mm_set1_epi8(0xff); + const __m128i all_0xff = _mm_set1_epi8((char)0xff); int i = 0; // We don't know if we can access the last 3 bytes after the last alpha // value 'src[4 * length - 4]' (because we don't know if alpha is the first diff --git a/thirdparty/libwebp/src/dsp/cpu.c b/thirdparty/libwebp/src/dsp/cpu.c index 8b40feed29..0fa5b6a5ce 100644 --- a/thirdparty/libwebp/src/dsp/cpu.c +++ b/thirdparty/libwebp/src/dsp/cpu.c @@ -173,8 +173,8 @@ static int AndroidCPUInfo(CPUFeature feature) { const AndroidCpuFamily cpu_family = android_getCpuFamily(); const uint64_t cpu_features = android_getCpuFeatures(); if (feature == kNEON) { - return (cpu_family == ANDROID_CPU_FAMILY_ARM && - 0 != (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON)); + return cpu_family == ANDROID_CPU_FAMILY_ARM && + (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON) != 0; } return 0; } diff --git a/thirdparty/libwebp/src/dsp/dec_sse2.c b/thirdparty/libwebp/src/dsp/dec_sse2.c index b3840faf3a..873aa59e8a 100644 --- a/thirdparty/libwebp/src/dsp/dec_sse2.c +++ b/thirdparty/libwebp/src/dsp/dec_sse2.c @@ -326,7 +326,7 @@ static WEBP_INLINE void Update2Pixels_SSE2(__m128i* const pi, __m128i* const qi, const __m128i a1_lo = _mm_srai_epi16(*a0_lo, 7); const __m128i a1_hi = _mm_srai_epi16(*a0_hi, 7); const __m128i delta = _mm_packs_epi16(a1_lo, a1_hi); - const __m128i sign_bit = _mm_set1_epi8(0x80); + const __m128i sign_bit = _mm_set1_epi8((char)0x80); *pi = _mm_adds_epi8(*pi, delta); *qi = _mm_subs_epi8(*qi, delta); FLIP_SIGN_BIT2(*pi, *qi); @@ -338,9 +338,9 @@ static WEBP_INLINE void NeedsFilter_SSE2(const __m128i* const p1, const __m128i* const q0, const __m128i* const q1, int thresh, __m128i* const mask) { - const __m128i m_thresh = _mm_set1_epi8(thresh); + const __m128i m_thresh = _mm_set1_epi8((char)thresh); const __m128i t1 = MM_ABS(*p1, *q1); // abs(p1 - q1) - const __m128i kFE = _mm_set1_epi8(0xFE); + const __m128i kFE = _mm_set1_epi8((char)0xFE); const __m128i t2 = _mm_and_si128(t1, kFE); // set lsb of each byte to zero const __m128i t3 = _mm_srli_epi16(t2, 1); // abs(p1 - q1) / 2 @@ -360,7 +360,7 @@ static WEBP_INLINE void DoFilter2_SSE2(__m128i* const p1, __m128i* const p0, __m128i* const q0, __m128i* const q1, int thresh) { __m128i a, mask; - const __m128i sign_bit = _mm_set1_epi8(0x80); + const __m128i sign_bit = _mm_set1_epi8((char)0x80); // convert p1/q1 to int8_t (for GetBaseDelta_SSE2) const __m128i p1s = _mm_xor_si128(*p1, sign_bit); const __m128i q1s = _mm_xor_si128(*q1, sign_bit); @@ -380,7 +380,7 @@ static WEBP_INLINE void DoFilter4_SSE2(__m128i* const p1, __m128i* const p0, const __m128i* const mask, int hev_thresh) { const __m128i zero = _mm_setzero_si128(); - const __m128i sign_bit = _mm_set1_epi8(0x80); + const __m128i sign_bit = _mm_set1_epi8((char)0x80); const __m128i k64 = _mm_set1_epi8(64); const __m128i k3 = _mm_set1_epi8(3); const __m128i k4 = _mm_set1_epi8(4); @@ -427,7 +427,7 @@ static WEBP_INLINE void DoFilter6_SSE2(__m128i* const p2, __m128i* const p1, const __m128i* const mask, int hev_thresh) { const __m128i zero = _mm_setzero_si128(); - const __m128i sign_bit = _mm_set1_epi8(0x80); + const __m128i sign_bit = _mm_set1_epi8((char)0x80); __m128i a, not_hev; // compute hev mask @@ -941,7 +941,7 @@ static void VR4_SSE2(uint8_t* dst) { // Vertical-Right const __m128i ABCD0 = _mm_srli_si128(XABCD, 1); const __m128i abcd = _mm_avg_epu8(XABCD, ABCD0); const __m128i _XABCD = _mm_slli_si128(XABCD, 1); - const __m128i IXABCD = _mm_insert_epi16(_XABCD, I | (X << 8), 0); + const __m128i IXABCD = _mm_insert_epi16(_XABCD, (short)(I | (X << 8)), 0); const __m128i avg1 = _mm_avg_epu8(IXABCD, ABCD0); const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb); diff --git a/thirdparty/libwebp/src/dsp/enc_sse2.c b/thirdparty/libwebp/src/dsp/enc_sse2.c index 7b3f142c31..b2e78ed941 100644 --- a/thirdparty/libwebp/src/dsp/enc_sse2.c +++ b/thirdparty/libwebp/src/dsp/enc_sse2.c @@ -777,7 +777,7 @@ static WEBP_INLINE void VR4_SSE2(uint8_t* dst, const __m128i ABCD0 = _mm_srli_si128(XABCD, 1); const __m128i abcd = _mm_avg_epu8(XABCD, ABCD0); const __m128i _XABCD = _mm_slli_si128(XABCD, 1); - const __m128i IXABCD = _mm_insert_epi16(_XABCD, I | (X << 8), 0); + const __m128i IXABCD = _mm_insert_epi16(_XABCD, (short)(I | (X << 8)), 0); const __m128i avg1 = _mm_avg_epu8(IXABCD, ABCD0); const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb); diff --git a/thirdparty/libwebp/src/dsp/filters.c b/thirdparty/libwebp/src/dsp/filters.c index 069a22eaef..9e910d99c9 100644 --- a/thirdparty/libwebp/src/dsp/filters.c +++ b/thirdparty/libwebp/src/dsp/filters.c @@ -33,9 +33,9 @@ static WEBP_INLINE void PredictLine_C(const uint8_t* src, const uint8_t* pred, uint8_t* dst, int length, int inverse) { int i; if (inverse) { - for (i = 0; i < length; ++i) dst[i] = src[i] + pred[i]; + for (i = 0; i < length; ++i) dst[i] = (uint8_t)(src[i] + pred[i]); } else { - for (i = 0; i < length; ++i) dst[i] = src[i] - pred[i]; + for (i = 0; i < length; ++i) dst[i] = (uint8_t)(src[i] - pred[i]); } } @@ -155,7 +155,7 @@ static WEBP_INLINE void DoGradientFilter_C(const uint8_t* in, const int pred = GradientPredictor_C(preds[w - 1], preds[w - stride], preds[w - stride - 1]); - out[w] = in[w] + (inverse ? pred : -pred); + out[w] = (uint8_t)(in[w] + (inverse ? pred : -pred)); } ++row; preds += stride; @@ -194,7 +194,7 @@ static void HorizontalUnfilter_C(const uint8_t* prev, const uint8_t* in, uint8_t pred = (prev == NULL) ? 0 : prev[0]; int i; for (i = 0; i < width; ++i) { - out[i] = pred + in[i]; + out[i] = (uint8_t)(pred + in[i]); pred = out[i]; } } @@ -206,7 +206,7 @@ static void VerticalUnfilter_C(const uint8_t* prev, const uint8_t* in, HorizontalUnfilter_C(NULL, in, out, width); } else { int i; - for (i = 0; i < width; ++i) out[i] = prev[i] + in[i]; + for (i = 0; i < width; ++i) out[i] = (uint8_t)(prev[i] + in[i]); } } #endif // !WEBP_NEON_OMIT_C_CODE @@ -220,7 +220,7 @@ static void GradientUnfilter_C(const uint8_t* prev, const uint8_t* in, int i; for (i = 0; i < width; ++i) { top = prev[i]; // need to read this first, in case prev==out - left = in[i] + GradientPredictor_C(left, top, top_left); + left = (uint8_t)(in[i] + GradientPredictor_C(left, top, top_left)); top_left = top; out[i] = left; } diff --git a/thirdparty/libwebp/src/dsp/filters_sse2.c b/thirdparty/libwebp/src/dsp/filters_sse2.c index 5a18895676..4b3f2d020f 100644 --- a/thirdparty/libwebp/src/dsp/filters_sse2.c +++ b/thirdparty/libwebp/src/dsp/filters_sse2.c @@ -163,7 +163,8 @@ static void GradientPredictDirect_SSE2(const uint8_t* const row, _mm_storel_epi64((__m128i*)(out + i), H); } for (; i < length; ++i) { - out[i] = row[i] - GradientPredictor_SSE2(row[i - 1], top[i], top[i - 1]); + const int delta = GradientPredictor_SSE2(row[i - 1], top[i], top[i - 1]); + out[i] = (uint8_t)(row[i] - delta); } } @@ -188,7 +189,7 @@ static WEBP_INLINE void DoGradientFilter_SSE2(const uint8_t* in, // Filter line-by-line. while (row < last_row) { - out[0] = in[0] - in[-stride]; + out[0] = (uint8_t)(in[0] - in[-stride]); GradientPredictDirect_SSE2(in + 1, in + 1 - stride, out + 1, width - 1); ++row; in += stride; @@ -223,7 +224,7 @@ static void HorizontalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, uint8_t* out, int width) { int i; __m128i last; - out[0] = in[0] + (prev == NULL ? 0 : prev[0]); + out[0] = (uint8_t)(in[0] + (prev == NULL ? 0 : prev[0])); if (width <= 1) return; last = _mm_set_epi32(0, 0, 0, out[0]); for (i = 1; i + 8 <= width; i += 8) { @@ -238,7 +239,7 @@ static void HorizontalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, _mm_storel_epi64((__m128i*)(out + i), A7); last = _mm_srli_epi64(A7, 56); } - for (; i < width; ++i) out[i] = in[i] + out[i - 1]; + for (; i < width; ++i) out[i] = (uint8_t)(in[i] + out[i - 1]); } static void VerticalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, @@ -259,7 +260,7 @@ static void VerticalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, _mm_storeu_si128((__m128i*)&out[i + 0], C0); _mm_storeu_si128((__m128i*)&out[i + 16], C1); } - for (; i < width; ++i) out[i] = in[i] + prev[i]; + for (; i < width; ++i) out[i] = (uint8_t)(in[i] + prev[i]); } } @@ -296,7 +297,8 @@ static void GradientPredictInverse_SSE2(const uint8_t* const in, _mm_storel_epi64((__m128i*)&row[i], out); } for (; i < length; ++i) { - row[i] = in[i] + GradientPredictor_SSE2(row[i - 1], top[i], top[i - 1]); + const int delta = GradientPredictor_SSE2(row[i - 1], top[i], top[i - 1]); + row[i] = (uint8_t)(in[i] + delta); } } } @@ -306,7 +308,7 @@ static void GradientUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, if (prev == NULL) { HorizontalUnfilter_SSE2(NULL, in, out, width); } else { - out[0] = in[0] + prev[0]; // predict from above + out[0] = (uint8_t)(in[0] + prev[0]); // predict from above GradientPredictInverse_SSE2(in + 1, prev + 1, out + 1, width - 1); } } diff --git a/thirdparty/libwebp/src/dsp/lossless.c b/thirdparty/libwebp/src/dsp/lossless.c index d21aa6a0a0..d05af84e7b 100644 --- a/thirdparty/libwebp/src/dsp/lossless.c +++ b/thirdparty/libwebp/src/dsp/lossless.c @@ -270,14 +270,14 @@ void VP8LTransformColorInverse_C(const VP8LMultipliers* const m, int i; for (i = 0; i < num_pixels; ++i) { const uint32_t argb = src[i]; - const uint32_t green = argb >> 8; + const int8_t green = (int8_t)(argb >> 8); const uint32_t red = argb >> 16; int new_red = red & 0xff; int new_blue = argb & 0xff; new_red += ColorTransformDelta(m->green_to_red_, green); new_red &= 0xff; new_blue += ColorTransformDelta(m->green_to_blue_, green); - new_blue += ColorTransformDelta(m->red_to_blue_, new_red); + new_blue += ColorTransformDelta(m->red_to_blue_, (int8_t)new_red); new_blue &= 0xff; dst[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue); } diff --git a/thirdparty/libwebp/src/dsp/lossless_enc.c b/thirdparty/libwebp/src/dsp/lossless_enc.c index 1408fbf580..9c36055afc 100644 --- a/thirdparty/libwebp/src/dsp/lossless_enc.c +++ b/thirdparty/libwebp/src/dsp/lossless_enc.c @@ -515,13 +515,17 @@ static WEBP_INLINE int ColorTransformDelta(int8_t color_pred, int8_t color) { return ((int)color_pred * color) >> 5; } +static WEBP_INLINE int8_t U32ToS8(uint32_t v) { + return (int8_t)(v & 0xff); +} + void VP8LTransformColor_C(const VP8LMultipliers* const m, uint32_t* data, int num_pixels) { int i; for (i = 0; i < num_pixels; ++i) { const uint32_t argb = data[i]; - const uint32_t green = argb >> 8; - const uint32_t red = argb >> 16; + const int8_t green = U32ToS8(argb >> 8); + const int8_t red = U32ToS8(argb >> 16); int new_red = red & 0xff; int new_blue = argb & 0xff; new_red -= ColorTransformDelta(m->green_to_red_, green); @@ -535,7 +539,7 @@ void VP8LTransformColor_C(const VP8LMultipliers* const m, uint32_t* data, static WEBP_INLINE uint8_t TransformColorRed(uint8_t green_to_red, uint32_t argb) { - const uint32_t green = argb >> 8; + const int8_t green = U32ToS8(argb >> 8); int new_red = argb >> 16; new_red -= ColorTransformDelta(green_to_red, green); return (new_red & 0xff); @@ -544,9 +548,9 @@ static WEBP_INLINE uint8_t TransformColorRed(uint8_t green_to_red, static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue, uint8_t red_to_blue, uint32_t argb) { - const uint32_t green = argb >> 8; - const uint32_t red = argb >> 16; - uint8_t new_blue = argb; + const int8_t green = U32ToS8(argb >> 8); + const int8_t red = U32ToS8(argb >> 16); + uint8_t new_blue = argb & 0xff; new_blue -= ColorTransformDelta(green_to_blue, green); new_blue -= ColorTransformDelta(red_to_blue, red); return (new_blue & 0xff); @@ -558,7 +562,7 @@ void VP8LCollectColorRedTransforms_C(const uint32_t* argb, int stride, while (tile_height-- > 0) { int x; for (x = 0; x < tile_width; ++x) { - ++histo[TransformColorRed(green_to_red, argb[x])]; + ++histo[TransformColorRed((uint8_t)green_to_red, argb[x])]; } argb += stride; } @@ -571,7 +575,8 @@ void VP8LCollectColorBlueTransforms_C(const uint32_t* argb, int stride, while (tile_height-- > 0) { int x; for (x = 0; x < tile_width; ++x) { - ++histo[TransformColorBlue(green_to_blue, red_to_blue, argb[x])]; + ++histo[TransformColorBlue((uint8_t)green_to_blue, (uint8_t)red_to_blue, + argb[x])]; } argb += stride; } diff --git a/thirdparty/libwebp/src/dsp/lossless_enc_sse2.c b/thirdparty/libwebp/src/dsp/lossless_enc_sse2.c index 36478c4912..8adc52139b 100644 --- a/thirdparty/libwebp/src/dsp/lossless_enc_sse2.c +++ b/thirdparty/libwebp/src/dsp/lossless_enc_sse2.c @@ -363,7 +363,7 @@ static void BundleColorMap_SSE2(const uint8_t* const row, int width, int xbits, assert(xbits <= 3); switch (xbits) { case 0: { - const __m128i ff = _mm_set1_epi16(0xff00); + const __m128i ff = _mm_set1_epi16((short)0xff00); const __m128i zero = _mm_setzero_si128(); // Store 0xff000000 | (row[x] << 8). for (x = 0; x + 16 <= width; x += 16, dst += 16) { @@ -382,7 +382,7 @@ static void BundleColorMap_SSE2(const uint8_t* const row, int width, int xbits, break; } case 1: { - const __m128i ff = _mm_set1_epi16(0xff00); + const __m128i ff = _mm_set1_epi16((short)0xff00); const __m128i mul = _mm_set1_epi16(0x110); for (x = 0; x + 16 <= width; x += 16, dst += 8) { // 0a0b | (where a/b are 4 bits). diff --git a/thirdparty/libwebp/src/dsp/lossless_enc_sse41.c b/thirdparty/libwebp/src/dsp/lossless_enc_sse41.c index 2e12a712eb..719d8ed25e 100644 --- a/thirdparty/libwebp/src/dsp/lossless_enc_sse41.c +++ b/thirdparty/libwebp/src/dsp/lossless_enc_sse41.c @@ -51,9 +51,9 @@ static void CollectColorBlueTransforms_SSE41(const uint32_t* argb, int stride, int histo[]) { const __m128i mults_r = _mm_set1_epi16(CST_5b(red_to_blue)); const __m128i mults_g = _mm_set1_epi16(CST_5b(green_to_blue)); - const __m128i mask_g = _mm_set1_epi16(0xff00); // green mask - const __m128i mask_gb = _mm_set1_epi32(0xffff); // green/blue mask - const __m128i mask_b = _mm_set1_epi16(0x00ff); // blue mask + const __m128i mask_g = _mm_set1_epi16((short)0xff00); // green mask + const __m128i mask_gb = _mm_set1_epi32(0xffff); // green/blue mask + const __m128i mask_b = _mm_set1_epi16(0x00ff); // blue mask const __m128i shuffler_lo = _mm_setr_epi8(-1, 2, -1, 6, -1, 10, -1, 14, -1, -1, -1, -1, -1, -1, -1, -1); const __m128i shuffler_hi = _mm_setr_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, diff --git a/thirdparty/libwebp/src/dsp/quant.h b/thirdparty/libwebp/src/dsp/quant.h index 5ba6f9c377..5e8dba8d19 100644 --- a/thirdparty/libwebp/src/dsp/quant.h +++ b/thirdparty/libwebp/src/dsp/quant.h @@ -10,6 +10,8 @@ #ifndef WEBP_DSP_QUANT_H_ #define WEBP_DSP_QUANT_H_ +#include <string.h> + #include "src/dsp/dsp.h" #include "src/webp/types.h" @@ -67,4 +69,17 @@ static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks, #endif // defined(WEBP_USE_NEON) && !defined(WEBP_ANDROID_NEON) && // !defined(WEBP_HAVE_NEON_RTCD) +static WEBP_INLINE int IsFlatSource16(const uint8_t* src) { + const uint32_t v = src[0] * 0x01010101u; + int i; + for (i = 0; i < 16; ++i) { + if (memcmp(src + 0, &v, 4) || memcmp(src + 4, &v, 4) || + memcmp(src + 8, &v, 4) || memcmp(src + 12, &v, 4)) { + return 0; + } + src += BPS; + } + return 1; +} + #endif // WEBP_DSP_QUANT_H_ diff --git a/thirdparty/libwebp/src/dsp/rescaler.c b/thirdparty/libwebp/src/dsp/rescaler.c index 753f84fcf4..c5a01e82df 100644 --- a/thirdparty/libwebp/src/dsp/rescaler.c +++ b/thirdparty/libwebp/src/dsp/rescaler.c @@ -109,8 +109,7 @@ void WebPRescalerExportRowExpand_C(WebPRescaler* const wrk) { for (x_out = 0; x_out < x_out_max; ++x_out) { const uint32_t J = frow[x_out]; const int v = (int)MULT_FIX(J, wrk->fy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; } } else { const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub); @@ -120,8 +119,7 @@ void WebPRescalerExportRowExpand_C(WebPRescaler* const wrk) { + (uint64_t)B * irow[x_out]; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX(J, wrk->fy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; } } } @@ -138,17 +136,15 @@ void WebPRescalerExportRowShrink_C(WebPRescaler* const wrk) { assert(!wrk->y_expand); if (yscale) { for (x_out = 0; x_out < x_out_max; ++x_out) { - const uint32_t frac = (uint32_t)MULT_FIX(frow[x_out], yscale); - const int v = (int)MULT_FIX_FLOOR(irow[x_out] - frac, wrk->fxy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + const uint32_t frac = (uint32_t)MULT_FIX_FLOOR(frow[x_out], yscale); + const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; irow[x_out] = frac; // new fractional start } } else { for (x_out = 0; x_out < x_out_max; ++x_out) { const int v = (int)MULT_FIX(irow[x_out], wrk->fxy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; irow[x_out] = 0; } } diff --git a/thirdparty/libwebp/src/dsp/rescaler_mips_dsp_r2.c b/thirdparty/libwebp/src/dsp/rescaler_mips_dsp_r2.c index ce9e64862e..419b741fa5 100644 --- a/thirdparty/libwebp/src/dsp/rescaler_mips_dsp_r2.c +++ b/thirdparty/libwebp/src/dsp/rescaler_mips_dsp_r2.c @@ -107,10 +107,9 @@ static void ExportRowShrink_MIPSdspR2(WebPRescaler* const wrk) { ); } for (i = 0; i < (x_out_max & 0x3); ++i) { - const uint32_t frac = (uint32_t)MULT_FIX(*frow++, yscale); - const int v = (int)MULT_FIX_FLOOR(*irow - frac, wrk->fxy_scale); - assert(v >= 0 && v <= 255); - *dst++ = v; + const uint32_t frac = (uint32_t)MULT_FIX_FLOOR(*frow++, yscale); + const int v = (int)MULT_FIX(*irow - frac, wrk->fxy_scale); + *dst++ = (v > 255) ? 255u : (uint8_t)v; *irow++ = frac; // new fractional start } } else { @@ -157,8 +156,7 @@ static void ExportRowShrink_MIPSdspR2(WebPRescaler* const wrk) { } for (i = 0; i < (x_out_max & 0x3); ++i) { const int v = (int)MULT_FIX_FLOOR(*irow, wrk->fxy_scale); - assert(v >= 0 && v <= 255); - *dst++ = v; + *dst++ = (v > 255) ? 255u : (uint8_t)v; *irow++ = 0; } } @@ -219,8 +217,7 @@ static void ExportRowExpand_MIPSdspR2(WebPRescaler* const wrk) { for (i = 0; i < (x_out_max & 0x3); ++i) { const uint32_t J = *frow++; const int v = (int)MULT_FIX(J, wrk->fy_scale); - assert(v >= 0 && v <= 255); - *dst++ = v; + *dst++ = (v > 255) ? 255u : (uint8_t)v; } } else { const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub); @@ -291,8 +288,7 @@ static void ExportRowExpand_MIPSdspR2(WebPRescaler* const wrk) { + (uint64_t)B * *irow++; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX(J, wrk->fy_scale); - assert(v >= 0 && v <= 255); - *dst++ = v; + *dst++ = (v > 255) ? 255u : (uint8_t)v; } } } diff --git a/thirdparty/libwebp/src/dsp/rescaler_msa.c b/thirdparty/libwebp/src/dsp/rescaler_msa.c index c559254836..256dbdd437 100644 --- a/thirdparty/libwebp/src/dsp/rescaler_msa.c +++ b/thirdparty/libwebp/src/dsp/rescaler_msa.c @@ -166,8 +166,7 @@ static WEBP_INLINE void ExportRowExpand_0(const uint32_t* frow, uint8_t* dst, for (x_out = 0; x_out < length; ++x_out) { const uint32_t J = frow[x_out]; const int v = (int)MULT_FIX(J, wrk->fy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; } } } @@ -241,8 +240,7 @@ static WEBP_INLINE void ExportRowExpand_1(const uint32_t* frow, uint32_t* irow, + (uint64_t)B * irow[x_out]; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX(J, wrk->fy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; } } } @@ -342,10 +340,9 @@ static WEBP_INLINE void ExportRowShrink_0(const uint32_t* frow, uint32_t* irow, length -= 4; } for (x_out = 0; x_out < length; ++x_out) { - const uint32_t frac = (uint32_t)MULT_FIX(frow[x_out], yscale); - const int v = (int)MULT_FIX_FLOOR(irow[x_out] - frac, wrk->fxy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + const uint32_t frac = (uint32_t)MULT_FIX_FLOOR(frow[x_out], yscale); + const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; irow[x_out] = frac; } } @@ -406,8 +403,7 @@ static WEBP_INLINE void ExportRowShrink_1(uint32_t* irow, uint8_t* dst, } for (x_out = 0; x_out < length; ++x_out) { const int v = (int)MULT_FIX(irow[x_out], wrk->fxy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; irow[x_out] = 0; } } diff --git a/thirdparty/libwebp/src/dsp/rescaler_neon.c b/thirdparty/libwebp/src/dsp/rescaler_neon.c index a553f06f79..b976a852cf 100644 --- a/thirdparty/libwebp/src/dsp/rescaler_neon.c +++ b/thirdparty/libwebp/src/dsp/rescaler_neon.c @@ -81,14 +81,13 @@ static void RescalerExportRowExpand_NEON(WebPRescaler* const wrk) { const uint32x4_t B1 = MULT_FIX(A1, fy_scale_half); const uint16x4_t C0 = vmovn_u32(B0); const uint16x4_t C1 = vmovn_u32(B1); - const uint8x8_t D = vmovn_u16(vcombine_u16(C0, C1)); + const uint8x8_t D = vqmovn_u16(vcombine_u16(C0, C1)); vst1_u8(dst + x_out, D); } for (; x_out < x_out_max; ++x_out) { const uint32_t J = frow[x_out]; const int v = (int)MULT_FIX_C(J, fy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; } } else { const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub); @@ -102,7 +101,7 @@ static void RescalerExportRowExpand_NEON(WebPRescaler* const wrk) { const uint32x4_t D1 = MULT_FIX(C1, fy_scale_half); const uint16x4_t E0 = vmovn_u32(D0); const uint16x4_t E1 = vmovn_u32(D1); - const uint8x8_t F = vmovn_u16(vcombine_u16(E0, E1)); + const uint8x8_t F = vqmovn_u16(vcombine_u16(E0, E1)); vst1_u8(dst + x_out, F); } for (; x_out < x_out_max; ++x_out) { @@ -110,8 +109,7 @@ static void RescalerExportRowExpand_NEON(WebPRescaler* const wrk) { + (uint64_t)B * irow[x_out]; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX_C(J, fy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; } } } @@ -135,23 +133,22 @@ static void RescalerExportRowShrink_NEON(WebPRescaler* const wrk) { for (x_out = 0; x_out < max_span; x_out += 8) { LOAD_32x8(frow + x_out, in0, in1); LOAD_32x8(irow + x_out, in2, in3); - const uint32x4_t A0 = MULT_FIX(in0, yscale_half); - const uint32x4_t A1 = MULT_FIX(in1, yscale_half); + const uint32x4_t A0 = MULT_FIX_FLOOR(in0, yscale_half); + const uint32x4_t A1 = MULT_FIX_FLOOR(in1, yscale_half); const uint32x4_t B0 = vqsubq_u32(in2, A0); const uint32x4_t B1 = vqsubq_u32(in3, A1); - const uint32x4_t C0 = MULT_FIX_FLOOR(B0, fxy_scale_half); - const uint32x4_t C1 = MULT_FIX_FLOOR(B1, fxy_scale_half); + const uint32x4_t C0 = MULT_FIX(B0, fxy_scale_half); + const uint32x4_t C1 = MULT_FIX(B1, fxy_scale_half); const uint16x4_t D0 = vmovn_u32(C0); const uint16x4_t D1 = vmovn_u32(C1); - const uint8x8_t E = vmovn_u16(vcombine_u16(D0, D1)); + const uint8x8_t E = vqmovn_u16(vcombine_u16(D0, D1)); vst1_u8(dst + x_out, E); STORE_32x8(A0, A1, irow + x_out); } for (; x_out < x_out_max; ++x_out) { - const uint32_t frac = (uint32_t)MULT_FIX_C(frow[x_out], yscale); - const int v = (int)MULT_FIX_FLOOR_C(irow[x_out] - frac, fxy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + const uint32_t frac = (uint32_t)MULT_FIX_FLOOR_C(frow[x_out], yscale); + const int v = (int)MULT_FIX_C(irow[x_out] - frac, fxy_scale); + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; irow[x_out] = frac; // new fractional start } } else { @@ -161,14 +158,13 @@ static void RescalerExportRowShrink_NEON(WebPRescaler* const wrk) { const uint32x4_t A1 = MULT_FIX(in1, fxy_scale_half); const uint16x4_t B0 = vmovn_u32(A0); const uint16x4_t B1 = vmovn_u32(A1); - const uint8x8_t C = vmovn_u16(vcombine_u16(B0, B1)); + const uint8x8_t C = vqmovn_u16(vcombine_u16(B0, B1)); vst1_u8(dst + x_out, C); STORE_32x8(zero, zero, irow + x_out); } for (; x_out < x_out_max; ++x_out) { const int v = (int)MULT_FIX_C(irow[x_out], fxy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; irow[x_out] = 0; } } diff --git a/thirdparty/libwebp/src/dsp/rescaler_sse2.c b/thirdparty/libwebp/src/dsp/rescaler_sse2.c index f7461a452c..d7effea16e 100644 --- a/thirdparty/libwebp/src/dsp/rescaler_sse2.c +++ b/thirdparty/libwebp/src/dsp/rescaler_sse2.c @@ -225,35 +225,6 @@ static WEBP_INLINE void ProcessRow_SSE2(const __m128i* const A0, _mm_storel_epi64((__m128i*)dst, G); } -static WEBP_INLINE void ProcessRow_Floor_SSE2(const __m128i* const A0, - const __m128i* const A1, - const __m128i* const A2, - const __m128i* const A3, - const __m128i* const mult, - uint8_t* const dst) { - const __m128i mask = _mm_set_epi32(0xffffffffu, 0, 0xffffffffu, 0); - const __m128i B0 = _mm_mul_epu32(*A0, *mult); - const __m128i B1 = _mm_mul_epu32(*A1, *mult); - const __m128i B2 = _mm_mul_epu32(*A2, *mult); - const __m128i B3 = _mm_mul_epu32(*A3, *mult); - const __m128i D0 = _mm_srli_epi64(B0, WEBP_RESCALER_RFIX); - const __m128i D1 = _mm_srli_epi64(B1, WEBP_RESCALER_RFIX); -#if (WEBP_RESCALER_RFIX < 32) - const __m128i D2 = - _mm_and_si128(_mm_slli_epi64(B2, 32 - WEBP_RESCALER_RFIX), mask); - const __m128i D3 = - _mm_and_si128(_mm_slli_epi64(B3, 32 - WEBP_RESCALER_RFIX), mask); -#else - const __m128i D2 = _mm_and_si128(B2, mask); - const __m128i D3 = _mm_and_si128(B3, mask); -#endif - const __m128i E0 = _mm_or_si128(D0, D2); - const __m128i E1 = _mm_or_si128(D1, D3); - const __m128i F = _mm_packs_epi32(E0, E1); - const __m128i G = _mm_packus_epi16(F, F); - _mm_storel_epi64((__m128i*)dst, G); -} - static void RescalerExportRowExpand_SSE2(WebPRescaler* const wrk) { int x_out; uint8_t* const dst = wrk->dst; @@ -274,8 +245,7 @@ static void RescalerExportRowExpand_SSE2(WebPRescaler* const wrk) { for (; x_out < x_out_max; ++x_out) { const uint32_t J = frow[x_out]; const int v = (int)MULT_FIX(J, wrk->fy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; } } else { const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub); @@ -308,8 +278,7 @@ static void RescalerExportRowExpand_SSE2(WebPRescaler* const wrk) { + (uint64_t)B * irow[x_out]; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX(J, wrk->fy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; } } } @@ -328,20 +297,15 @@ static void RescalerExportRowShrink_SSE2(WebPRescaler* const wrk) { const int scale_xy = wrk->fxy_scale; const __m128i mult_xy = _mm_set_epi32(0, scale_xy, 0, scale_xy); const __m128i mult_y = _mm_set_epi32(0, yscale, 0, yscale); - const __m128i rounder = _mm_set_epi32(0, ROUNDER, 0, ROUNDER); for (x_out = 0; x_out + 8 <= x_out_max; x_out += 8) { __m128i A0, A1, A2, A3, B0, B1, B2, B3; LoadDispatchAndMult_SSE2(irow + x_out, NULL, &A0, &A1, &A2, &A3); LoadDispatchAndMult_SSE2(frow + x_out, &mult_y, &B0, &B1, &B2, &B3); { - const __m128i C0 = _mm_add_epi64(B0, rounder); - const __m128i C1 = _mm_add_epi64(B1, rounder); - const __m128i C2 = _mm_add_epi64(B2, rounder); - const __m128i C3 = _mm_add_epi64(B3, rounder); - const __m128i D0 = _mm_srli_epi64(C0, WEBP_RESCALER_RFIX); // = frac - const __m128i D1 = _mm_srli_epi64(C1, WEBP_RESCALER_RFIX); - const __m128i D2 = _mm_srli_epi64(C2, WEBP_RESCALER_RFIX); - const __m128i D3 = _mm_srli_epi64(C3, WEBP_RESCALER_RFIX); + const __m128i D0 = _mm_srli_epi64(B0, WEBP_RESCALER_RFIX); // = frac + const __m128i D1 = _mm_srli_epi64(B1, WEBP_RESCALER_RFIX); + const __m128i D2 = _mm_srli_epi64(B2, WEBP_RESCALER_RFIX); + const __m128i D3 = _mm_srli_epi64(B3, WEBP_RESCALER_RFIX); const __m128i E0 = _mm_sub_epi64(A0, D0); // irow[x] - frac const __m128i E1 = _mm_sub_epi64(A1, D1); const __m128i E2 = _mm_sub_epi64(A2, D2); @@ -352,14 +316,13 @@ static void RescalerExportRowShrink_SSE2(WebPRescaler* const wrk) { const __m128i G1 = _mm_or_si128(D1, F3); _mm_storeu_si128((__m128i*)(irow + x_out + 0), G0); _mm_storeu_si128((__m128i*)(irow + x_out + 4), G1); - ProcessRow_Floor_SSE2(&E0, &E1, &E2, &E3, &mult_xy, dst + x_out); + ProcessRow_SSE2(&E0, &E1, &E2, &E3, &mult_xy, dst + x_out); } } for (; x_out < x_out_max; ++x_out) { - const uint32_t frac = (int)MULT_FIX(frow[x_out], yscale); - const int v = (int)MULT_FIX_FLOOR(irow[x_out] - frac, wrk->fxy_scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + const uint32_t frac = (int)MULT_FIX_FLOOR(frow[x_out], yscale); + const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; irow[x_out] = frac; // new fractional start } } else { @@ -375,8 +338,7 @@ static void RescalerExportRowShrink_SSE2(WebPRescaler* const wrk) { } for (; x_out < x_out_max; ++x_out) { const int v = (int)MULT_FIX(irow[x_out], scale); - assert(v >= 0 && v <= 255); - dst[x_out] = v; + dst[x_out] = (v > 255) ? 255u : (uint8_t)v; irow[x_out] = 0; } } diff --git a/thirdparty/libwebp/src/enc/backward_references_enc.c b/thirdparty/libwebp/src/enc/backward_references_enc.c index 3ab7b0ac7d..d445b40fc5 100644 --- a/thirdparty/libwebp/src/enc/backward_references_enc.c +++ b/thirdparty/libwebp/src/enc/backward_references_enc.c @@ -191,13 +191,14 @@ void VP8LHashChainClear(VP8LHashChain* const p) { // ----------------------------------------------------------------------------- -#define HASH_MULTIPLIER_HI (0xc6a4a793ULL) -#define HASH_MULTIPLIER_LO (0x5bd1e996ULL) +static const uint32_t kHashMultiplierHi = 0xc6a4a793u; +static const uint32_t kHashMultiplierLo = 0x5bd1e996u; -static WEBP_INLINE uint32_t GetPixPairHash64(const uint32_t* const argb) { +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE +uint32_t GetPixPairHash64(const uint32_t* const argb) { uint32_t key; - key = (argb[1] * HASH_MULTIPLIER_HI) & 0xffffffffu; - key += (argb[0] * HASH_MULTIPLIER_LO) & 0xffffffffu; + key = argb[1] * kHashMultiplierHi; + key += argb[0] * kHashMultiplierLo; key = key >> (32 - HASH_BITS); return key; } diff --git a/thirdparty/libwebp/src/enc/histogram_enc.c b/thirdparty/libwebp/src/enc/histogram_enc.c index 8ac6fa8e02..d89b98524a 100644 --- a/thirdparty/libwebp/src/enc/histogram_enc.c +++ b/thirdparty/libwebp/src/enc/histogram_enc.c @@ -929,9 +929,8 @@ static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo, } mappings = (int*) WebPSafeMalloc(*num_used, sizeof(*mappings)); - if (mappings == NULL || !HistoQueueInit(&histo_queue, kHistoQueueSize)) { - goto End; - } + if (mappings == NULL) return 0; + if (!HistoQueueInit(&histo_queue, kHistoQueueSize)) goto End; // Fill the initial mapping. for (j = 0, iter = 0; iter < image_histo->size; ++iter) { if (histograms[iter] == NULL) continue; diff --git a/thirdparty/libwebp/src/enc/predictor_enc.c b/thirdparty/libwebp/src/enc/predictor_enc.c index 802e89693e..2e6762ea0d 100644 --- a/thirdparty/libwebp/src/enc/predictor_enc.c +++ b/thirdparty/libwebp/src/enc/predictor_enc.c @@ -202,7 +202,7 @@ static uint32_t NearLossless(uint32_t value, uint32_t predict, } if ((value >> 24) == 0 || (value >> 24) == 0xff) { // Preserve transparency of fully transparent or fully opaque pixels. - a = NearLosslessDiff(value >> 24, predict >> 24); + a = NearLosslessDiff((value >> 24) & 0xff, (predict >> 24) & 0xff); } else { a = NearLosslessComponent(value >> 24, predict >> 24, 0xff, quantization); } @@ -215,12 +215,12 @@ static uint32_t NearLossless(uint32_t value, uint32_t predict, // The amount by which green has been adjusted during quantization. It is // subtracted from red and blue for compensation, to avoid accumulating two // quantization errors in them. - green_diff = NearLosslessDiff(new_green, value >> 8); + green_diff = NearLosslessDiff(new_green, (value >> 8) & 0xff); } - r = NearLosslessComponent(NearLosslessDiff(value >> 16, green_diff), + r = NearLosslessComponent(NearLosslessDiff((value >> 16) & 0xff, green_diff), (predict >> 16) & 0xff, 0xff - new_green, quantization); - b = NearLosslessComponent(NearLosslessDiff(value, green_diff), + b = NearLosslessComponent(NearLosslessDiff(value & 0xff, green_diff), predict & 0xff, 0xff - new_green, quantization); return ((uint32_t)a << 24) | ((uint32_t)r << 16) | ((uint32_t)g << 8) | b; } @@ -587,7 +587,7 @@ static void GetBestGreenToRed( } } } - best_tx->green_to_red_ = green_to_red_best; + best_tx->green_to_red_ = (green_to_red_best & 0xff); } static float GetPredictionCostCrossColorBlue( @@ -666,8 +666,8 @@ static void GetBestGreenRedToBlue( break; // out of iter-loop. } } - best_tx->green_to_blue_ = green_to_blue_best; - best_tx->red_to_blue_ = red_to_blue_best; + best_tx->green_to_blue_ = green_to_blue_best & 0xff; + best_tx->red_to_blue_ = red_to_blue_best & 0xff; } #undef kGreenRedToBlueMaxIters #undef kGreenRedToBlueNumAxis diff --git a/thirdparty/libwebp/src/enc/quant_enc.c b/thirdparty/libwebp/src/enc/quant_enc.c index 03c682e3ae..01eb565c7f 100644 --- a/thirdparty/libwebp/src/enc/quant_enc.c +++ b/thirdparty/libwebp/src/enc/quant_enc.c @@ -33,7 +33,7 @@ // number of non-zero coeffs below which we consider the block very flat // (and apply a penalty to complex predictions) -#define FLATNESS_LIMIT_I16 10 // I16 mode +#define FLATNESS_LIMIT_I16 0 // I16 mode (special case) #define FLATNESS_LIMIT_I4 3 // I4 mode #define FLATNESS_LIMIT_UV 2 // UV mode #define FLATNESS_PENALTY 140 // roughly ~1bit per block @@ -988,6 +988,7 @@ static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* rd) { VP8ModeScore* rd_cur = &rd_tmp; VP8ModeScore* rd_best = rd; int mode; + int is_flat = IsFlatSource16(it->yuv_in_ + Y_OFF_ENC); rd->mode_i16 = -1; for (mode = 0; mode < NUM_PRED_MODES; ++mode) { @@ -1003,10 +1004,14 @@ static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* rd) { tlambda ? MULT_8B(tlambda, VP8TDisto16x16(src, tmp_dst, kWeightY)) : 0; rd_cur->H = VP8FixedCostsI16[mode]; rd_cur->R = VP8GetCostLuma16(it, rd_cur); - if (mode > 0 && - IsFlat(rd_cur->y_ac_levels[0], kNumBlocks, FLATNESS_LIMIT_I16)) { - // penalty to avoid flat area to be mispredicted by complex mode - rd_cur->R += FLATNESS_PENALTY * kNumBlocks; + if (is_flat) { + // refine the first impression (which was in pixel space) + is_flat = IsFlat(rd_cur->y_ac_levels[0], kNumBlocks, FLATNESS_LIMIT_I16); + if (is_flat) { + // Block is very flat. We put emphasis on the distortion being very low! + rd_cur->D *= 2; + rd_cur->SD *= 2; + } } // Since we always examine Intra16 first, we can overwrite *rd directly. @@ -1087,7 +1092,8 @@ static int PickBestIntra4(VP8EncIterator* const it, VP8ModeScore* const rd) { : 0; rd_tmp.H = mode_costs[mode]; - // Add flatness penalty + // Add flatness penalty, to avoid flat area to be mispredicted + // by a complex mode. if (mode > 0 && IsFlat(tmp_levels, kNumBlocks, FLATNESS_LIMIT_I4)) { rd_tmp.R = FLATNESS_PENALTY * kNumBlocks; } else { @@ -1242,11 +1248,19 @@ static void RefineUsingDistortion(VP8EncIterator* const it, if (mode > 0 && VP8FixedCostsI16[mode] > bit_limit) { continue; } + if (score < best_score) { best_mode = mode; best_score = score; } } + if (it->x_ == 0 || it->y_ == 0) { + // avoid starting a checkerboard resonance from the border. See bug #432. + if (IsFlatSource16(src)) { + best_mode = (it->x_ == 0) ? 0 : 2; + try_both_modes = 0; // stick to i16 + } + } VP8SetIntra16Mode(it, best_mode); // we'll reconstruct later, if i16 mode actually gets selected } diff --git a/thirdparty/libwebp/src/enc/vp8i_enc.h b/thirdparty/libwebp/src/enc/vp8i_enc.h index 3a1967da88..24e1944610 100644 --- a/thirdparty/libwebp/src/enc/vp8i_enc.h +++ b/thirdparty/libwebp/src/enc/vp8i_enc.h @@ -32,7 +32,7 @@ extern "C" { // version numbers #define ENC_MAJ_VERSION 1 #define ENC_MIN_VERSION 0 -#define ENC_REV_VERSION 2 +#define ENC_REV_VERSION 3 enum { MAX_LF_LEVELS = 64, // Maximum loop filter level MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost diff --git a/thirdparty/libwebp/src/mux/muxi.h b/thirdparty/libwebp/src/mux/muxi.h index 3e9d8c48d8..7bc0b07e9b 100644 --- a/thirdparty/libwebp/src/mux/muxi.h +++ b/thirdparty/libwebp/src/mux/muxi.h @@ -29,7 +29,7 @@ extern "C" { #define MUX_MAJ_VERSION 1 #define MUX_MIN_VERSION 0 -#define MUX_REV_VERSION 2 +#define MUX_REV_VERSION 3 // Chunk object. typedef struct WebPChunk WebPChunk; diff --git a/thirdparty/libwebp/src/utils/bit_reader_inl_utils.h b/thirdparty/libwebp/src/utils/bit_reader_inl_utils.h index 7e607f370a..46b3880706 100644 --- a/thirdparty/libwebp/src/utils/bit_reader_inl_utils.h +++ b/thirdparty/libwebp/src/utils/bit_reader_inl_utils.h @@ -104,7 +104,8 @@ void VP8LoadNewBytes(VP8BitReader* const br) { } // Read a bit with proba 'prob'. Speed-critical function! -static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob) { +static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, + int prob, const char label[]) { // Don't move this declaration! It makes a big speed difference to store // 'range' *before* calling VP8LoadNewBytes(), even if this function doesn't // alter br->range_ value. @@ -129,13 +130,14 @@ static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob) { br->bits_ -= shift; } br->range_ = range - 1; + BT_TRACK(br); return bit; } } // simplified version of VP8GetBit() for prob=0x80 (note shift is always 1 here) static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE -int VP8GetSigned(VP8BitReader* const br, int v) { +int VP8GetSigned(VP8BitReader* const br, int v, const char label[]) { if (br->bits_ < 0) { VP8LoadNewBytes(br); } @@ -148,11 +150,13 @@ int VP8GetSigned(VP8BitReader* const br, int v) { br->range_ += mask; br->range_ |= 1; br->value_ -= (bit_t)((split + 1) & mask) << pos; + BT_TRACK(br); return (v ^ mask) - mask; } } -static WEBP_INLINE int VP8GetBitAlt(VP8BitReader* const br, int prob) { +static WEBP_INLINE int VP8GetBitAlt(VP8BitReader* const br, + int prob, const char label[]) { // Don't move this declaration! It makes a big speed difference to store // 'range' *before* calling VP8LoadNewBytes(), even if this function doesn't // alter br->range_ value. @@ -179,6 +183,7 @@ static WEBP_INLINE int VP8GetBitAlt(VP8BitReader* const br, int prob) { br->bits_ -= shift; } br->range_ = range; + BT_TRACK(br); return bit; } } diff --git a/thirdparty/libwebp/src/utils/bit_reader_utils.c b/thirdparty/libwebp/src/utils/bit_reader_utils.c index 5fa3ae7795..60271c0ae0 100644 --- a/thirdparty/libwebp/src/utils/bit_reader_utils.c +++ b/thirdparty/libwebp/src/utils/bit_reader_utils.c @@ -109,17 +109,18 @@ void VP8LoadFinalBytes(VP8BitReader* const br) { //------------------------------------------------------------------------------ // Higher-level calls -uint32_t VP8GetValue(VP8BitReader* const br, int bits) { +uint32_t VP8GetValue(VP8BitReader* const br, int bits, const char label[]) { uint32_t v = 0; while (bits-- > 0) { - v |= VP8GetBit(br, 0x80) << bits; + v |= VP8GetBit(br, 0x80, label) << bits; } return v; } -int32_t VP8GetSignedValue(VP8BitReader* const br, int bits) { - const int value = VP8GetValue(br, bits); - return VP8Get(br) ? -value : value; +int32_t VP8GetSignedValue(VP8BitReader* const br, int bits, + const char label[]) { + const int value = VP8GetValue(br, bits, label); + return VP8Get(br, label) ? -value : value; } //------------------------------------------------------------------------------ @@ -227,3 +228,78 @@ uint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits) { } //------------------------------------------------------------------------------ +// Bit-tracing tool + +#if (BITTRACE > 0) + +#include <stdlib.h> // for atexit() +#include <stdio.h> +#include <string.h> + +#define MAX_NUM_LABELS 32 +static struct { + const char* label; + int size; + int count; +} kLabels[MAX_NUM_LABELS]; + +static int last_label = 0; +static int last_pos = 0; +static const uint8_t* buf_start = NULL; +static int init_done = 0; + +static void PrintBitTraces(void) { + int i; + int scale = 1; + int total = 0; + const char* units = "bits"; +#if (BITTRACE == 2) + scale = 8; + units = "bytes"; +#endif + for (i = 0; i < last_label; ++i) total += kLabels[i].size; + if (total < 1) total = 1; // avoid rounding errors + printf("=== Bit traces ===\n"); + for (i = 0; i < last_label; ++i) { + const int skip = 16 - (int)strlen(kLabels[i].label); + const int value = (kLabels[i].size + scale - 1) / scale; + assert(skip > 0); + printf("%s \%*s: %6d %s \t[%5.2f%%] [count: %7d]\n", + kLabels[i].label, skip, "", value, units, + 100.f * kLabels[i].size / total, + kLabels[i].count); + } + total = (total + scale - 1) / scale; + printf("Total: %d %s\n", total, units); +} + +void BitTrace(const struct VP8BitReader* const br, const char label[]) { + int i, pos; + if (!init_done) { + memset(kLabels, 0, sizeof(kLabels)); + atexit(PrintBitTraces); + buf_start = br->buf_; + init_done = 1; + } + pos = (int)(br->buf_ - buf_start) * 8 - br->bits_; + // if there's a too large jump, we've changed partition -> reset counter + if (abs(pos - last_pos) > 32) { + buf_start = br->buf_; + pos = 0; + last_pos = 0; + } + if (br->range_ >= 0x7f) pos += kVP8Log2Range[br->range_ - 0x7f]; + for (i = 0; i < last_label; ++i) { + if (!strcmp(label, kLabels[i].label)) break; + } + if (i == MAX_NUM_LABELS) abort(); // overflow! + kLabels[i].label = label; + kLabels[i].size += pos - last_pos; + kLabels[i].count += 1; + if (i == last_label) ++last_label; + last_pos = pos; +} + +#endif // BITTRACE > 0 + +//------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/src/utils/bit_reader_utils.h b/thirdparty/libwebp/src/utils/bit_reader_utils.h index de810d402a..199dacf224 100644 --- a/thirdparty/libwebp/src/utils/bit_reader_utils.h +++ b/thirdparty/libwebp/src/utils/bit_reader_utils.h @@ -21,6 +21,27 @@ #endif #include "src/webp/types.h" +// Warning! This macro triggers quite some MACRO wizardry around func signature! +#if !defined(BITTRACE) +#define BITTRACE 0 // 0 = off, 1 = print bits, 2 = print bytes +#endif + +#if (BITTRACE > 0) +struct VP8BitReader; +extern void BitTrace(const struct VP8BitReader* const br, const char label[]); +#define BT_TRACK(br) BitTrace(br, label) +#define VP8Get(BR, L) VP8GetValue(BR, 1, L) +#else +#define BT_TRACK(br) +// We'll REMOVE the 'const char label[]' from all signatures and calls (!!): +#define VP8GetValue(BR, N, L) VP8GetValue(BR, N) +#define VP8Get(BR, L) VP8GetValue(BR, 1, L) +#define VP8GetSignedValue(BR, N, L) VP8GetSignedValue(BR, N) +#define VP8GetBit(BR, P, L) VP8GetBit(BR, P) +#define VP8GetBitAlt(BR, P, L) VP8GetBitAlt(BR, P) +#define VP8GetSigned(BR, V, L) VP8GetSigned(BR, V) +#endif + #ifdef __cplusplus extern "C" { #endif @@ -102,17 +123,15 @@ void VP8BitReaderSetBuffer(VP8BitReader* const br, void VP8RemapBitReader(VP8BitReader* const br, ptrdiff_t offset); // return the next value made of 'num_bits' bits -uint32_t VP8GetValue(VP8BitReader* const br, int num_bits); -static WEBP_INLINE uint32_t VP8Get(VP8BitReader* const br) { - return VP8GetValue(br, 1); -} +uint32_t VP8GetValue(VP8BitReader* const br, int num_bits, const char label[]); // return the next value with sign-extension. -int32_t VP8GetSignedValue(VP8BitReader* const br, int num_bits); +int32_t VP8GetSignedValue(VP8BitReader* const br, int num_bits, + const char label[]); // bit_reader_inl.h will implement the following methods: -// static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob) -// static WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v) +// static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob, ...) +// static WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v, ...) // and should be included by the .c files that actually need them. // This is to avoid recompiling the whole library whenever this file is touched, // and also allowing platform-specific ad-hoc hacks. diff --git a/thirdparty/libwebp/src/utils/bit_writer_utils.c b/thirdparty/libwebp/src/utils/bit_writer_utils.c index 7f83b4c8a2..bef0e31ca5 100644 --- a/thirdparty/libwebp/src/utils/bit_writer_utils.c +++ b/thirdparty/libwebp/src/utils/bit_writer_utils.c @@ -70,7 +70,7 @@ static void Flush(VP8BitWriter* const bw) { const int value = (bits & 0x100) ? 0x00 : 0xff; for (; bw->run_ > 0; --bw->run_) bw->buf_[pos++] = value; } - bw->buf_[pos++] = bits; + bw->buf_[pos++] = bits & 0xff; bw->pos_ = pos; } else { bw->run_++; // delay writing of bytes 0xff, pending eventual carry. diff --git a/thirdparty/libwebp/src/utils/color_cache_utils.h b/thirdparty/libwebp/src/utils/color_cache_utils.h index 20b7be11c9..ec21d5199b 100644 --- a/thirdparty/libwebp/src/utils/color_cache_utils.h +++ b/thirdparty/libwebp/src/utils/color_cache_utils.h @@ -17,6 +17,7 @@ #include <assert.h> +#include "src/dsp/dsp.h" #include "src/webp/types.h" #ifdef __cplusplus @@ -30,10 +31,11 @@ typedef struct { int hash_bits_; } VP8LColorCache; -static const uint64_t kHashMul = 0x1e35a7bdull; +static const uint32_t kHashMul = 0x1e35a7bdu; -static WEBP_INLINE int VP8LHashPix(uint32_t argb, int shift) { - return (int)(((argb * kHashMul) & 0xffffffffu) >> shift); +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE +int VP8LHashPix(uint32_t argb, int shift) { + return (int)((argb * kHashMul) >> shift); } static WEBP_INLINE uint32_t VP8LColorCacheLookup( diff --git a/thirdparty/libwebp/src/utils/huffman_utils.c b/thirdparty/libwebp/src/utils/huffman_utils.c index 7a69963c3e..0cba0fbb7d 100644 --- a/thirdparty/libwebp/src/utils/huffman_utils.c +++ b/thirdparty/libwebp/src/utils/huffman_utils.c @@ -91,7 +91,8 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits, assert(code_lengths_size != 0); assert(code_lengths != NULL); - assert(root_table != NULL); + assert((root_table != NULL && sorted != NULL) || + (root_table == NULL && sorted == NULL)); assert(root_bits > 0); // Build histogram of code lengths. @@ -120,16 +121,22 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits, for (symbol = 0; symbol < code_lengths_size; ++symbol) { const int symbol_code_length = code_lengths[symbol]; if (code_lengths[symbol] > 0) { - sorted[offset[symbol_code_length]++] = symbol; + if (sorted != NULL) { + sorted[offset[symbol_code_length]++] = symbol; + } else { + offset[symbol_code_length]++; + } } } // Special case code with only one value. if (offset[MAX_ALLOWED_CODE_LENGTH] == 1) { - HuffmanCode code; - code.bits = 0; - code.value = (uint16_t)sorted[0]; - ReplicateValue(table, 1, total_size, code); + if (sorted != NULL) { + HuffmanCode code; + code.bits = 0; + code.value = (uint16_t)sorted[0]; + ReplicateValue(table, 1, total_size, code); + } return total_size; } @@ -151,6 +158,7 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits, if (num_open < 0) { return 0; } + if (root_table == NULL) continue; for (; count[len] > 0; --count[len]) { HuffmanCode code; code.bits = (uint8_t)len; @@ -169,6 +177,7 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits, if (num_open < 0) { return 0; } + if (root_table == NULL) continue; for (; count[len] > 0; --count[len]) { HuffmanCode code; if ((key & mask) != low) { @@ -206,7 +215,10 @@ int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, const int code_lengths[], int code_lengths_size) { int total_size; assert(code_lengths_size <= MAX_CODE_LENGTHS_SIZE); - if (code_lengths_size <= SORTED_SIZE_CUTOFF) { + if (root_table == NULL) { + total_size = BuildHuffmanTable(NULL, root_bits, + code_lengths, code_lengths_size, NULL); + } else if (code_lengths_size <= SORTED_SIZE_CUTOFF) { // use local stack-allocated array. uint16_t sorted[SORTED_SIZE_CUTOFF]; total_size = BuildHuffmanTable(root_table, root_bits, diff --git a/thirdparty/libwebp/src/utils/huffman_utils.h b/thirdparty/libwebp/src/utils/huffman_utils.h index ff7ef17f3b..13b7ad1ac4 100644 --- a/thirdparty/libwebp/src/utils/huffman_utils.h +++ b/thirdparty/libwebp/src/utils/huffman_utils.h @@ -78,6 +78,8 @@ void VP8LHtreeGroupsFree(HTreeGroup* const htree_groups); // the huffman table. // Returns built table size or 0 in case of error (invalid tree or // memory error). +// If root_table is NULL, it returns 0 if a lookup cannot be built, something +// > 0 otherwise (but not the table size). int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, const int code_lengths[], int code_lengths_size); diff --git a/thirdparty/libwebp/src/utils/rescaler_utils.c b/thirdparty/libwebp/src/utils/rescaler_utils.c index 90e2ea76a1..4bcae24af5 100644 --- a/thirdparty/libwebp/src/utils/rescaler_utils.c +++ b/thirdparty/libwebp/src/utils/rescaler_utils.c @@ -84,14 +84,14 @@ int WebPRescalerGetScaledDimensions(int src_width, int src_height, int height = *scaled_height; // if width is unspecified, scale original proportionally to height ratio. - if (width == 0) { + if (width == 0 && src_height > 0) { width = - (int)(((uint64_t)src_width * height + src_height / 2) / src_height); + (int)(((uint64_t)src_width * height + src_height - 1) / src_height); } // if height is unspecified, scale original proportionally to width ratio. - if (height == 0) { + if (height == 0 && src_width > 0) { height = - (int)(((uint64_t)src_height * width + src_width / 2) / src_width); + (int)(((uint64_t)src_height * width + src_width - 1) / src_width); } // Check if the overall dimensions still make sense. if (width <= 0 || height <= 0) { diff --git a/thirdparty/libwebp/src/utils/thread_utils.c b/thirdparty/libwebp/src/utils/thread_utils.c index 2052b6b006..438296b45f 100644 --- a/thirdparty/libwebp/src/utils/thread_utils.c +++ b/thirdparty/libwebp/src/utils/thread_utils.c @@ -217,8 +217,12 @@ static THREADFN ThreadLoop(void* ptr) { done = 1; } // signal to the main thread that we're done (for Sync()) - pthread_cond_signal(&impl->condition_); + // Note the associated mutex does not need to be held when signaling the + // condition. Unlocking the mutex first may improve performance in some + // implementations, avoiding the case where the waiting thread can't + // reacquire the mutex when woken. pthread_mutex_unlock(&impl->mutex_); + pthread_cond_signal(&impl->condition_); } return THREAD_RETURN(NULL); // Thread is finished } @@ -240,7 +244,13 @@ static void ChangeState(WebPWorker* const worker, WebPWorkerStatus new_status) { // assign new status and release the working thread if needed if (new_status != OK) { worker->status_ = new_status; + // Note the associated mutex does not need to be held when signaling the + // condition. Unlocking the mutex first may improve performance in some + // implementations, avoiding the case where the waiting thread can't + // reacquire the mutex when woken. + pthread_mutex_unlock(&impl->mutex_); pthread_cond_signal(&impl->condition_); + return; } } pthread_mutex_unlock(&impl->mutex_); diff --git a/thirdparty/libwebp/src/utils/utils.h b/thirdparty/libwebp/src/utils/utils.h index c7620f91ec..2a3ec92678 100644 --- a/thirdparty/libwebp/src/utils/utils.h +++ b/thirdparty/libwebp/src/utils/utils.h @@ -92,14 +92,14 @@ static WEBP_INLINE uint32_t GetLE32(const uint8_t* const data) { // Store 16, 24 or 32 bits in little-endian order. static WEBP_INLINE void PutLE16(uint8_t* const data, int val) { assert(val < (1 << 16)); - data[0] = (val >> 0); - data[1] = (val >> 8); + data[0] = (val >> 0) & 0xff; + data[1] = (val >> 8) & 0xff; } static WEBP_INLINE void PutLE24(uint8_t* const data, int val) { assert(val < (1 << 24)); PutLE16(data, val & 0xffff); - data[2] = (val >> 16); + data[2] = (val >> 16) & 0xff; } static WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) { diff --git a/thirdparty/libwebp/src/webp/encode.h b/thirdparty/libwebp/src/webp/encode.h index 549cf07730..339f8810aa 100644 --- a/thirdparty/libwebp/src/webp/encode.h +++ b/thirdparty/libwebp/src/webp/encode.h @@ -62,6 +62,10 @@ WEBP_EXTERN size_t WebPEncodeBGRA(const uint8_t* bgra, // These functions are the equivalent of the above, but compressing in a // lossless manner. Files are usually larger than lossy format, but will // not suffer any compression loss. +// Note these functions, like the lossy versions, use the library's default +// settings. For lossless this means 'exact' is disabled. RGB values in +// transparent areas will be modified to improve compression. To avoid this, +// use WebPEncode() and set WebPConfig::exact to 1. WEBP_EXTERN size_t WebPEncodeLosslessRGB(const uint8_t* rgb, int width, int height, int stride, uint8_t** output); diff --git a/thirdparty/mbedtls/include/mbedtls/bn_mul.h b/thirdparty/mbedtls/include/mbedtls/bn_mul.h index c33bd8d4ab..748975ea51 100644 --- a/thirdparty/mbedtls/include/mbedtls/bn_mul.h +++ b/thirdparty/mbedtls/include/mbedtls/bn_mul.h @@ -642,7 +642,8 @@ "r6", "r7", "r8", "r9", "cc" \ ); -#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) +#elif (__ARM_ARCH >= 6) && \ + defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) #define MULADDC_INIT \ asm( diff --git a/thirdparty/mbedtls/include/mbedtls/check_config.h b/thirdparty/mbedtls/include/mbedtls/check_config.h index b86e5807e0..6eabcc8748 100644 --- a/thirdparty/mbedtls/include/mbedtls/check_config.h +++ b/thirdparty/mbedtls/include/mbedtls/check_config.h @@ -123,7 +123,7 @@ #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" #endif -#if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ +#if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ @@ -134,7 +134,9 @@ !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) ) ) + !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) && \ + !defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) && \ + !defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) ) ) #error "MBEDTLS_ECP_C defined, but not all prerequisites" #endif @@ -691,7 +693,7 @@ /* * Avoid warning from -pedantic. This is a convenient place for this * workaround since this is included by every single file before the - * #if defined(MBEDTLS_xxx_C) that results in emtpy translation units. + * #if defined(MBEDTLS_xxx_C) that results in empty translation units. */ typedef int mbedtls_iso_c_forbids_empty_translation_units; diff --git a/thirdparty/mbedtls/include/mbedtls/config.h b/thirdparty/mbedtls/include/mbedtls/config.h index e16e1e53d3..0cc502cd79 100644 --- a/thirdparty/mbedtls/include/mbedtls/config.h +++ b/thirdparty/mbedtls/include/mbedtls/config.h @@ -139,7 +139,7 @@ * * System has time.h, time(), and an implementation for * mbedtls_platform_gmtime_r() (see below). - * The time needs to be correct (not necesarily very accurate, but at least + * The time needs to be correct (not necessarily very accurate, but at least * the date should be correct). This is used to verify the validity period of * X.509 certificates. * @@ -276,28 +276,52 @@ * For example, when a function accepts as input a pointer to a buffer that may * contain untrusted data, and its documentation mentions that this pointer * must not be NULL: - * - the pointer is checked to be non-NULL only if this option is enabled - * - the content of the buffer is always validated + * - The pointer is checked to be non-NULL only if this option is enabled. + * - The content of the buffer is always validated. * * When this flag is defined, if a library function receives a parameter that - * is invalid, it will: - * - invoke the macro MBEDTLS_PARAM_FAILED() which by default expands to a - * call to the function mbedtls_param_failed() - * - immediately return (with a specific error code unless the function - * returns void and can't communicate an error). - * - * When defining this flag, you also need to: - * - either provide a definition of the function mbedtls_param_failed() in - * your application (see platform_util.h for its prototype) as the library - * calls that function, but does not provide a default definition for it, - * - or provide a different definition of the macro MBEDTLS_PARAM_FAILED() - * below if the above mechanism is not flexible enough to suit your needs. - * See the documentation of this macro later in this file. + * is invalid: + * 1. The function will invoke the macro MBEDTLS_PARAM_FAILED(). + * 2. If MBEDTLS_PARAM_FAILED() did not terminate the program, the function + * will immediately return. If the function returns an Mbed TLS error code, + * the error code in this case is MBEDTLS_ERR_xxx_BAD_INPUT_DATA. + * + * When defining this flag, you also need to arrange a definition for + * MBEDTLS_PARAM_FAILED(). You can do this by any of the following methods: + * - By default, the library defines MBEDTLS_PARAM_FAILED() to call a + * function mbedtls_param_failed(), but the library does not define this + * function. If you do not make any other arrangements, you must provide + * the function mbedtls_param_failed() in your application. + * See `platform_util.h` for its prototype. + * - If you enable the macro #MBEDTLS_CHECK_PARAMS_ASSERT, then the + * library defines #MBEDTLS_PARAM_FAILED(\c cond) to be `assert(cond)`. + * You can still supply an alternative definition of + * MBEDTLS_PARAM_FAILED(), which may call `assert`. + * - If you define a macro MBEDTLS_PARAM_FAILED() before including `config.h` + * or you uncomment the definition of MBEDTLS_PARAM_FAILED() in `config.h`, + * the library will call the macro that you defined and will not supply + * its own version. Note that if MBEDTLS_PARAM_FAILED() calls `assert`, + * you need to enable #MBEDTLS_CHECK_PARAMS_ASSERT so that library source + * files include `<assert.h>`. * * Uncomment to enable validation of application-controlled parameters. */ //#define MBEDTLS_CHECK_PARAMS +/** + * \def MBEDTLS_CHECK_PARAMS_ASSERT + * + * Allow MBEDTLS_PARAM_FAILED() to call `assert`, and make it default to + * `assert`. This macro is only used if #MBEDTLS_CHECK_PARAMS is defined. + * + * If this macro is not defined, then MBEDTLS_PARAM_FAILED() defaults to + * calling a function mbedtls_param_failed(). See the documentation of + * #MBEDTLS_CHECK_PARAMS for details. + * + * Uncomment to allow MBEDTLS_PARAM_FAILED() to call `assert`. + */ +//#define MBEDTLS_CHECK_PARAMS_ASSERT + /* \} name SECTION: System support */ /** @@ -401,7 +425,7 @@ * \note Because of a signature change, the core AES encryption and decryption routines are * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt, * respectively. When setting up alternative implementations, these functions should - * be overriden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt + * be overridden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt * must stay untouched. * * \note If you use the AES_xxx_ALT macros, then is is recommended to also set @@ -416,6 +440,16 @@ * dependencies on them, and considering stronger message digests * and ciphers instead. * + * \warning If both MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_DETERMINISTIC are + * enabled, then the deterministic ECDH signature functions pass the + * the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). Therefore + * alternative implementations should use the RNG only for generating + * the ephemeral key and nothing else. If this is not possible, then + * MBEDTLS_ECDSA_DETERMINISTIC should be disabled and an alternative + * implementation should be provided for mbedtls_ecdsa_sign_det_ext() + * (and for mbedtls_ecdsa_sign_det() too if backward compatibility is + * desirable). + * */ //#define MBEDTLS_MD2_PROCESS_ALT //#define MBEDTLS_MD4_PROCESS_ALT @@ -1558,7 +1592,7 @@ * \def MBEDTLS_SSL_SESSION_TICKETS * * Enable support for RFC 5077 session tickets in SSL. - * Client-side, provides full support for session tickets (maintainance of a + * Client-side, provides full support for session tickets (maintenance of a * session store remains the responsibility of the application, though). * Server-side, you also need to provide callbacks for writing and parsing * tickets, including authenticated encryption and key management. Example @@ -1642,9 +1676,7 @@ * * Uncomment this to enable pthread mutexes. */ -// -- GODOT start -- //#define MBEDTLS_THREADING_PTHREAD -// -- GODOT end -- /** * \def MBEDTLS_VERSION_FEATURES @@ -1726,7 +1758,7 @@ * * \warning TLS-level compression MAY REDUCE SECURITY! See for example the * CRIME attack. Before enabling this option, you should examine with care if - * CRIME or similar exploits may be a applicable to your use case. + * CRIME or similar exploits may be applicable to your use case. * * \note Currently compression can't be used with DTLS. * @@ -2838,9 +2870,7 @@ * * Enable this layer to allow use of mutexes within mbed TLS */ -// -- GODOT start -- //#define MBEDTLS_THREADING_C -// -- GODOT end -- /** * \def MBEDTLS_TIMING_C @@ -3042,7 +3072,7 @@ //#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ //#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ //#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ -/* Note: your snprintf must correclty zero-terminate the buffer! */ +/* Note: your snprintf must correctly zero-terminate the buffer! */ //#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */ //#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */ //#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */ @@ -3059,20 +3089,23 @@ //#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ //#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ //#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ -/* Note: your snprintf must correclty zero-terminate the buffer! */ +/* Note: your snprintf must correctly zero-terminate the buffer! */ //#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */ //#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ //#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ /** * \brief This macro is invoked by the library when an invalid parameter - * is detected that is only checked with MBEDTLS_CHECK_PARAMS + * is detected that is only checked with #MBEDTLS_CHECK_PARAMS * (see the documentation of that option for context). * - * When you leave this undefined here, a default definition is - * provided that invokes the function mbedtls_param_failed(), - * which is declared in platform_util.h for the benefit of the - * library, but that you need to define in your application. + * When you leave this undefined here, the library provides + * a default definition. If the macro #MBEDTLS_CHECK_PARAMS_ASSERT + * is defined, the default definition is `assert(cond)`, + * otherwise the default definition calls a function + * mbedtls_param_failed(). This function is declared in + * `platform_util.h` for the benefit of the library, but + * you need to define in your application. * * When you define this here, this replaces the default * definition in platform_util.h (which no longer declares the @@ -3081,6 +3114,9 @@ * particular, that all the necessary declarations are visible * from within the library - you can ensure that by providing * them in this file next to the macro definition). + * If you define this macro to call `assert`, also define + * #MBEDTLS_CHECK_PARAMS_ASSERT so that library source files + * include `<assert.h>`. * * Note that you may define this macro to expand to nothing, in * which case you don't have to worry about declarations or diff --git a/thirdparty/mbedtls/include/mbedtls/ecdsa.h b/thirdparty/mbedtls/include/mbedtls/ecdsa.h index f8b28507c2..932acc6d14 100644 --- a/thirdparty/mbedtls/include/mbedtls/ecdsa.h +++ b/thirdparty/mbedtls/include/mbedtls/ecdsa.h @@ -175,6 +175,19 @@ int mbedtls_ecdsa_sign( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, * (SECG): SEC1 Elliptic Curve Cryptography</em>, section * 4.1.3, step 5. * + * \warning Since the output of the internal RNG is always the same for + * the same key and message, this limits the efficiency of + * blinding and leaks information through side channels. For + * secure behavior use mbedtls_ecdsa_sign_det_ext() instead. + * + * (Optimally the blinding is a random value that is different + * on every execution. In this case the blinding is still + * random from the attackers perspective, but is the same on + * each execution. This means that this blinding does not + * prevent attackers from recovering secrets by combining + * several measurement traces, but may prevent some attacks + * that exploit relationships between secret data.) + * * \see ecp.h * * \param grp The context for the elliptic curve to use. @@ -200,6 +213,52 @@ int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, const mbedtls_mpi *d, const unsigned char *buf, size_t blen, mbedtls_md_type_t md_alg ); +/** + * \brief This function computes the ECDSA signature of a + * previously-hashed message, deterministic version. + * + * For more information, see <em>RFC-6979: Deterministic + * Usage of the Digital Signature Algorithm (DSA) and Elliptic + * Curve Digital Signature Algorithm (ECDSA)</em>. + * + * \note If the bitlength of the message hash is larger than the + * bitlength of the group order, then the hash is truncated as + * defined in <em>Standards for Efficient Cryptography Group + * (SECG): SEC1 Elliptic Curve Cryptography</em>, section + * 4.1.3, step 5. + * + * \see ecp.h + * + * \param grp The context for the elliptic curve to use. + * This must be initialized and have group parameters + * set, for example through mbedtls_ecp_group_load(). + * \param r The MPI context in which to store the first part + * the signature. This must be initialized. + * \param s The MPI context in which to store the second part + * the signature. This must be initialized. + * \param d The private signing key. This must be initialized + * and setup, for example through mbedtls_ecp_gen_privkey(). + * \param buf The hashed content to be signed. This must be a readable + * buffer of length \p blen Bytes. It may be \c NULL if + * \p blen is zero. + * \param blen The length of \p buf in Bytes. + * \param md_alg The hash algorithm used to hash the original data. + * \param f_rng_blind The RNG function used for blinding. This must not be + * \c NULL. + * \param p_rng_blind The RNG context to be passed to \p f_rng. This may be + * \c NULL if \p f_rng doesn't need a context parameter. + * + * \return \c 0 on success. + * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX + * error code on failure. + */ +int mbedtls_ecdsa_sign_det_ext( mbedtls_ecp_group *grp, mbedtls_mpi *r, + mbedtls_mpi *s, const mbedtls_mpi *d, + const unsigned char *buf, size_t blen, + mbedtls_md_type_t md_alg, + int (*f_rng_blind)(void *, unsigned char *, + size_t), + void *p_rng_blind ); #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ /** diff --git a/thirdparty/mbedtls/include/mbedtls/hkdf.h b/thirdparty/mbedtls/include/mbedtls/hkdf.h index 40ee64eb03..bcafe42513 100644 --- a/thirdparty/mbedtls/include/mbedtls/hkdf.h +++ b/thirdparty/mbedtls/include/mbedtls/hkdf.h @@ -7,22 +7,22 @@ * specified by RFC 5869. */ /* - * Copyright (C) 2016-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 + * Copyright (C) 2016-2019, ARM Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - * This file is part of mbed TLS (https://tls.mbed.org) + * This file is part of mbed TLS (https://tls.mbed.org) */ #ifndef MBEDTLS_HKDF_H #define MBEDTLS_HKDF_H diff --git a/thirdparty/mbedtls/include/mbedtls/hmac_drbg.h b/thirdparty/mbedtls/include/mbedtls/hmac_drbg.h index 7eae32bbd6..f1289cb306 100644 --- a/thirdparty/mbedtls/include/mbedtls/hmac_drbg.h +++ b/thirdparty/mbedtls/include/mbedtls/hmac_drbg.h @@ -82,7 +82,7 @@ extern "C" { */ typedef struct mbedtls_hmac_drbg_context { - /* Working state: the key K is not stored explicitely, + /* Working state: the key K is not stored explicitly, * but is implied by the HMAC context */ mbedtls_md_context_t md_ctx; /*!< HMAC context (inc. K) */ unsigned char V[MBEDTLS_MD_MAX_SIZE]; /*!< V in the spec */ diff --git a/thirdparty/mbedtls/include/mbedtls/pk.h b/thirdparty/mbedtls/include/mbedtls/pk.h index 91950f9407..136427503a 100644 --- a/thirdparty/mbedtls/include/mbedtls/pk.h +++ b/thirdparty/mbedtls/include/mbedtls/pk.h @@ -416,6 +416,10 @@ int mbedtls_pk_verify_ext( mbedtls_pk_type_t type, const void *options, * * \note For RSA, md_alg may be MBEDTLS_MD_NONE if hash_len != 0. * For ECDSA, md_alg may never be MBEDTLS_MD_NONE. + * + * \note In order to ensure enough space for the signature, the + * \p sig buffer size must be of at least + * `max(MBEDTLS_ECDSA_MAX_LEN, MBEDTLS_MPI_MAX_SIZE)` bytes. */ int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, @@ -430,6 +434,10 @@ int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, * \c mbedtls_ecp_set_max_ops() to reduce blocking for ECC * operations. For RSA, same as \c mbedtls_pk_sign(). * + * \note In order to ensure enough space for the signature, the + * \p sig buffer size must be of at least + * `max(MBEDTLS_ECDSA_MAX_LEN, MBEDTLS_MPI_MAX_SIZE)` bytes. + * * \param ctx The PK context to use. It must have been set up * with a private key. * \param md_alg Hash algorithm used (see notes) diff --git a/thirdparty/mbedtls/include/mbedtls/platform_util.h b/thirdparty/mbedtls/include/mbedtls/platform_util.h index dba6d45982..09d0965182 100644 --- a/thirdparty/mbedtls/include/mbedtls/platform_util.h +++ b/thirdparty/mbedtls/include/mbedtls/platform_util.h @@ -43,6 +43,12 @@ extern "C" { #if defined(MBEDTLS_CHECK_PARAMS) +#if defined(MBEDTLS_CHECK_PARAMS_ASSERT) +/* Allow the user to define MBEDTLS_PARAM_FAILED to something like assert + * (which is what our config.h suggests). */ +#include <assert.h> +#endif /* MBEDTLS_CHECK_PARAMS_ASSERT */ + #if defined(MBEDTLS_PARAM_FAILED) /** An alternative definition of MBEDTLS_PARAM_FAILED has been set in config.h. * @@ -50,6 +56,11 @@ extern "C" { * MBEDTLS_PARAM_FAILED() will expand to a call to mbedtls_param_failed(). */ #define MBEDTLS_PARAM_FAILED_ALT + +#elif defined(MBEDTLS_CHECK_PARAMS_ASSERT) +#define MBEDTLS_PARAM_FAILED( cond ) assert( cond ) +#define MBEDTLS_PARAM_FAILED_ALT + #else /* MBEDTLS_PARAM_FAILED */ #define MBEDTLS_PARAM_FAILED( cond ) \ mbedtls_param_failed( #cond, __FILE__, __LINE__ ) diff --git a/thirdparty/mbedtls/include/mbedtls/rsa.h b/thirdparty/mbedtls/include/mbedtls/rsa.h index 906c427332..35bacd8763 100644 --- a/thirdparty/mbedtls/include/mbedtls/rsa.h +++ b/thirdparty/mbedtls/include/mbedtls/rsa.h @@ -150,13 +150,13 @@ mbedtls_rsa_context; * \note The choice of padding mode is strictly enforced for private key * operations, since there might be security concerns in * mixing padding modes. For public key operations it is - * a default value, which can be overriden by calling specific + * a default value, which can be overridden by calling specific * \c rsa_rsaes_xxx or \c rsa_rsassa_xxx functions. * * \note The hash selected in \p hash_id is always used for OEAP * encryption. For PSS signatures, it is always used for - * making signatures, but can be overriden for verifying them. - * If set to #MBEDTLS_MD_NONE, it is always overriden. + * making signatures, but can be overridden for verifying them. + * If set to #MBEDTLS_MD_NONE, it is always overridden. * * \param ctx The RSA context to initialize. This must not be \c NULL. * \param padding The padding mode to use. This must be either @@ -904,7 +904,8 @@ int mbedtls_rsa_rsaes_oaep_decrypt( mbedtls_rsa_context *ctx, * the size of the hash corresponding to \p md_alg. * \param sig The buffer to hold the signature. This must be a writable * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. + * for an 2048-bit RSA modulus. A buffer length of + * #MBEDTLS_MPI_MAX_SIZE is always safe. * * \return \c 0 if the signing operation was successful. * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. @@ -951,7 +952,8 @@ int mbedtls_rsa_pkcs1_sign( mbedtls_rsa_context *ctx, * the size of the hash corresponding to \p md_alg. * \param sig The buffer to hold the signature. This must be a writable * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. + * for an 2048-bit RSA modulus. A buffer length of + * #MBEDTLS_MPI_MAX_SIZE is always safe. * * \return \c 0 if the signing operation was successful. * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. @@ -1012,7 +1014,8 @@ int mbedtls_rsa_rsassa_pkcs1_v15_sign( mbedtls_rsa_context *ctx, * the size of the hash corresponding to \p md_alg. * \param sig The buffer to hold the signature. This must be a writable * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. + * for an 2048-bit RSA modulus. A buffer length of + * #MBEDTLS_MPI_MAX_SIZE is always safe. * * \return \c 0 if the signing operation was successful. * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. diff --git a/thirdparty/mbedtls/include/mbedtls/ssl.h b/thirdparty/mbedtls/include/mbedtls/ssl.h index d31f6cdd56..1adf9608cc 100644 --- a/thirdparty/mbedtls/include/mbedtls/ssl.h +++ b/thirdparty/mbedtls/include/mbedtls/ssl.h @@ -2033,7 +2033,7 @@ void mbedtls_ssl_conf_ca_chain( mbedtls_ssl_config *conf, * provision more than one cert/key pair (eg one ECDSA, one * RSA with SHA-256, one RSA with SHA-1). An adequate * certificate will be selected according to the client's - * advertised capabilities. In case mutliple certificates are + * advertised capabilities. In case multiple certificates are * adequate, preference is given to the one set by the first * call to this function, then second, etc. * @@ -3206,7 +3206,7 @@ void mbedtls_ssl_free( mbedtls_ssl_context *ssl ); * mbedtls_ssl_config_defaults() or mbedtls_ssl_config_free(). * * \note You need to call mbedtls_ssl_config_defaults() unless you - * manually set all of the relevent fields yourself. + * manually set all of the relevant fields yourself. * * \param conf SSL configuration context */ diff --git a/thirdparty/mbedtls/include/mbedtls/ssl_ticket.h b/thirdparty/mbedtls/include/mbedtls/ssl_ticket.h index a84e7816e4..774a007a9f 100644 --- a/thirdparty/mbedtls/include/mbedtls/ssl_ticket.h +++ b/thirdparty/mbedtls/include/mbedtls/ssl_ticket.h @@ -117,14 +117,14 @@ int mbedtls_ssl_ticket_setup( mbedtls_ssl_ticket_context *ctx, /** * \brief Implementation of the ticket write callback * - * \note See \c mbedlts_ssl_ticket_write_t for description + * \note See \c mbedtls_ssl_ticket_write_t for description */ mbedtls_ssl_ticket_write_t mbedtls_ssl_ticket_write; /** * \brief Implementation of the ticket parse callback * - * \note See \c mbedlts_ssl_ticket_parse_t for description + * \note See \c mbedtls_ssl_ticket_parse_t for description */ mbedtls_ssl_ticket_parse_t mbedtls_ssl_ticket_parse; diff --git a/thirdparty/mbedtls/include/mbedtls/version.h b/thirdparty/mbedtls/include/mbedtls/version.h index ef8e4c1f4f..b4eef71e50 100644 --- a/thirdparty/mbedtls/include/mbedtls/version.h +++ b/thirdparty/mbedtls/include/mbedtls/version.h @@ -40,16 +40,16 @@ */ #define MBEDTLS_VERSION_MAJOR 2 #define MBEDTLS_VERSION_MINOR 16 -#define MBEDTLS_VERSION_PATCH 2 +#define MBEDTLS_VERSION_PATCH 3 /** * The single version number has the following structure: * MMNNPP00 * Major version | Minor version | Patch version */ -#define MBEDTLS_VERSION_NUMBER 0x02100200 -#define MBEDTLS_VERSION_STRING "2.16.2" -#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.16.2" +#define MBEDTLS_VERSION_NUMBER 0x02100300 +#define MBEDTLS_VERSION_STRING "2.16.3" +#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.16.3" #if defined(MBEDTLS_VERSION_C) diff --git a/thirdparty/mbedtls/include/mbedtls/x509.h b/thirdparty/mbedtls/include/mbedtls/x509.h index 9ae825c183..63aae32d87 100644 --- a/thirdparty/mbedtls/include/mbedtls/x509.h +++ b/thirdparty/mbedtls/include/mbedtls/x509.h @@ -77,7 +77,7 @@ #define MBEDTLS_ERR_X509_ALLOC_FAILED -0x2880 /**< Allocation of memory failed. */ #define MBEDTLS_ERR_X509_FILE_IO_ERROR -0x2900 /**< Read/write of file failed. */ #define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL -0x2980 /**< Destination buffer is too small. */ -#define MBEDTLS_ERR_X509_FATAL_ERROR -0x3000 /**< A fatal error occured, eg the chain is too long or the vrfy callback failed. */ +#define MBEDTLS_ERR_X509_FATAL_ERROR -0x3000 /**< A fatal error occurred, eg the chain is too long or the vrfy callback failed. */ /* \} name */ /** @@ -250,7 +250,7 @@ int mbedtls_x509_serial_gets( char *buf, size_t size, const mbedtls_x509_buf *se * * \param to mbedtls_x509_time to check * - * \return 1 if the given time is in the past or an error occured, + * \return 1 if the given time is in the past or an error occurred, * 0 otherwise. */ int mbedtls_x509_time_is_past( const mbedtls_x509_time *to ); @@ -264,7 +264,7 @@ int mbedtls_x509_time_is_past( const mbedtls_x509_time *to ); * * \param from mbedtls_x509_time to check * - * \return 1 if the given time is in the future or an error occured, + * \return 1 if the given time is in the future or an error occurred, * 0 otherwise. */ int mbedtls_x509_time_is_future( const mbedtls_x509_time *from ); diff --git a/thirdparty/mbedtls/include/mbedtls/x509_crl.h b/thirdparty/mbedtls/include/mbedtls/x509_crl.h index 08a4283a67..fa838d68cb 100644 --- a/thirdparty/mbedtls/include/mbedtls/x509_crl.h +++ b/thirdparty/mbedtls/include/mbedtls/x509_crl.h @@ -111,7 +111,7 @@ int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain, /** * \brief Parse one or more CRLs and append them to the chained list * - * \note Mutliple CRLs are accepted only if using PEM format + * \note Multiple CRLs are accepted only if using PEM format * * \param chain points to the start of the chain * \param buf buffer holding the CRL data in PEM or DER format @@ -126,7 +126,7 @@ int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, s /** * \brief Load one or more CRLs and append them to the chained list * - * \note Mutliple CRLs are accepted only if using PEM format + * \note Multiple CRLs are accepted only if using PEM format * * \param chain points to the start of the chain * \param path filename to read the CRLs from (in PEM or DER encoding) diff --git a/thirdparty/mbedtls/library/bignum.c b/thirdparty/mbedtls/library/bignum.c index 41946183c5..d1717e9435 100644 --- a/thirdparty/mbedtls/library/bignum.c +++ b/thirdparty/mbedtls/library/bignum.c @@ -742,10 +742,15 @@ cleanup: static mbedtls_mpi_uint mpi_uint_bigendian_to_host_c( mbedtls_mpi_uint x ) { uint8_t i; + unsigned char *x_ptr; mbedtls_mpi_uint tmp = 0; - /* This works regardless of the endianness. */ - for( i = 0; i < ciL; i++, x >>= 8 ) - tmp |= ( x & 0xFF ) << ( ( ciL - 1 - i ) << 3 ); + + for( i = 0, x_ptr = (unsigned char*) &x; i < ciL; i++, x_ptr++ ) + { + tmp <<= CHAR_BIT; + tmp |= (mbedtls_mpi_uint) *x_ptr; + } + return( tmp ); } @@ -2351,7 +2356,8 @@ static int mpi_miller_rabin( const mbedtls_mpi *X, size_t rounds, } if (count++ > 30) { - return MBEDTLS_ERR_MPI_NOT_ACCEPTABLE; + ret = MBEDTLS_ERR_MPI_NOT_ACCEPTABLE; + goto cleanup; } } while ( mbedtls_mpi_cmp_mpi( &A, &W ) >= 0 || diff --git a/thirdparty/mbedtls/library/certs.c b/thirdparty/mbedtls/library/certs.c index b07fd8a3a1..80ab0b9d6c 100644 --- a/thirdparty/mbedtls/library/certs.c +++ b/thirdparty/mbedtls/library/certs.c @@ -46,75 +46,67 @@ /* BEGIN FILE string macro TEST_CA_CRT_EC_PEM tests/data_files/test-ca2.crt */ #define TEST_CA_CRT_EC_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ - "MIICUjCCAdegAwIBAgIJAMFD4n5iQ8zoMAoGCCqGSM49BAMCMD4xCzAJBgNVBAYT\r\n" \ - "Ak5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UEAxMTUG9sYXJzc2wgVGVzdCBF\r\n" \ - "QyBDQTAeFw0xMzA5MjQxNTQ5NDhaFw0yMzA5MjIxNTQ5NDhaMD4xCzAJBgNVBAYT\r\n" \ - "Ak5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UEAxMTUG9sYXJzc2wgVGVzdCBF\r\n" \ - "QyBDQTB2MBAGByqGSM49AgEGBSuBBAAiA2IABMPaKzRBN1gvh1b+/Im6KUNLTuBu\r\n" \ - "ww5XUzM5WNRStJGVOQsj318XJGJI/BqVKc4sLYfCiFKAr9ZqqyHduNMcbli4yuiy\r\n" \ - "aY7zQa0pw7RfdadHb9UZKVVpmlM7ILRmFmAzHqOBoDCBnTAdBgNVHQ4EFgQUnW0g\r\n" \ - "JEkBPyvLeLUZvH4kydv7NnwwbgYDVR0jBGcwZYAUnW0gJEkBPyvLeLUZvH4kydv7\r\n" \ - "NnyhQqRAMD4xCzAJBgNVBAYTAk5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UE\r\n" \ - "AxMTUG9sYXJzc2wgVGVzdCBFQyBDQYIJAMFD4n5iQ8zoMAwGA1UdEwQFMAMBAf8w\r\n" \ - "CgYIKoZIzj0EAwIDaQAwZgIxAMO0YnNWKJUAfXgSJtJxexn4ipg+kv4znuR50v56\r\n" \ - "t4d0PCu412mUC6Nnd7izvtE2MgIxAP1nnJQjZ8BWukszFQDG48wxCCyci9qpdSMv\r\n" \ - "uCjn8pwUOkABXK8Mss90fzCfCEOtIA==\r\n" \ + "MIICBDCCAYigAwIBAgIJAMFD4n5iQ8zoMAwGCCqGSM49BAMCBQAwPjELMAkGA1UE\r\n" \ + "BhMCTkwxETAPBgNVBAoMCFBvbGFyU1NMMRwwGgYDVQQDDBNQb2xhcnNzbCBUZXN0\r\n" \ + "IEVDIENBMB4XDTE5MDIxMDE0NDQwMFoXDTI5MDIxMDE0NDQwMFowPjELMAkGA1UE\r\n" \ + "BhMCTkwxETAPBgNVBAoMCFBvbGFyU1NMMRwwGgYDVQQDDBNQb2xhcnNzbCBUZXN0\r\n" \ + "IEVDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEw9orNEE3WC+HVv78ibopQ0tO\r\n" \ + "4G7DDldTMzlY1FK0kZU5CyPfXxckYkj8GpUpziwth8KIUoCv1mqrId240xxuWLjK\r\n" \ + "6LJpjvNBrSnDtF91p0dv1RkpVWmaUzsgtGYWYDMeo1AwTjAMBgNVHRMEBTADAQH/\r\n" \ + "MB0GA1UdDgQWBBSdbSAkSQE/K8t4tRm8fiTJ2/s2fDAfBgNVHSMEGDAWgBSdbSAk\r\n" \ + "SQE/K8t4tRm8fiTJ2/s2fDAMBggqhkjOPQQDAgUAA2gAMGUCMFHKrjAPpHB0BN1a\r\n" \ + "LH8TwcJ3vh0AxeKZj30mRdOKBmg/jLS3rU3g8VQBHpn8sOTTBwIxANxPO5AerimZ\r\n" \ + "hCjMe0d4CTHf1gFZMF70+IqEP+o5VHsIp2Cqvflb0VGWFC5l9a4cQg==\r\n" \ "-----END CERTIFICATE-----\r\n" /* END FILE */ /* This is generated from tests/data_files/test-ca2.crt.der using `xxd -i`. */ /* BEGIN FILE binary macro TEST_CA_CRT_EC_DER tests/data_files/test-ca2.crt.der */ #define TEST_CA_CRT_EC_DER { \ - 0x30, 0x82, 0x02, 0x52, 0x30, 0x82, 0x01, 0xd7, 0xa0, 0x03, 0x02, 0x01, \ - 0x02, 0x02, 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, \ - 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, \ - 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, \ - 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \ - 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, \ - 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, \ - 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, \ - 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x33, 0x30, 0x39, \ - 0x32, 0x34, 0x31, 0x35, 0x34, 0x39, 0x34, 0x38, 0x5a, 0x17, 0x0d, 0x32, \ - 0x33, 0x30, 0x39, 0x32, 0x32, 0x31, 0x35, 0x34, 0x39, 0x34, 0x38, 0x5a, \ - 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, \ - 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \ - 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, \ - 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, \ - 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, \ - 0x43, 0x20, 0x43, 0x41, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, \ - 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, \ - 0x03, 0x62, 0x00, 0x04, 0xc3, 0xda, 0x2b, 0x34, 0x41, 0x37, 0x58, 0x2f, \ - 0x87, 0x56, 0xfe, 0xfc, 0x89, 0xba, 0x29, 0x43, 0x4b, 0x4e, 0xe0, 0x6e, \ - 0xc3, 0x0e, 0x57, 0x53, 0x33, 0x39, 0x58, 0xd4, 0x52, 0xb4, 0x91, 0x95, \ - 0x39, 0x0b, 0x23, 0xdf, 0x5f, 0x17, 0x24, 0x62, 0x48, 0xfc, 0x1a, 0x95, \ - 0x29, 0xce, 0x2c, 0x2d, 0x87, 0xc2, 0x88, 0x52, 0x80, 0xaf, 0xd6, 0x6a, \ - 0xab, 0x21, 0xdd, 0xb8, 0xd3, 0x1c, 0x6e, 0x58, 0xb8, 0xca, 0xe8, 0xb2, \ - 0x69, 0x8e, 0xf3, 0x41, 0xad, 0x29, 0xc3, 0xb4, 0x5f, 0x75, 0xa7, 0x47, \ - 0x6f, 0xd5, 0x19, 0x29, 0x55, 0x69, 0x9a, 0x53, 0x3b, 0x20, 0xb4, 0x66, \ - 0x16, 0x60, 0x33, 0x1e, 0xa3, 0x81, 0xa0, 0x30, 0x81, 0x9d, 0x30, 0x1d, \ - 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x9d, 0x6d, 0x20, \ - 0x24, 0x49, 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, \ - 0xc9, 0xdb, 0xfb, 0x36, 0x7c, 0x30, 0x6e, 0x06, 0x03, 0x55, 0x1d, 0x23, \ - 0x04, 0x67, 0x30, 0x65, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, 0x01, \ - 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, 0xfb, \ - 0x36, 0x7c, 0xa1, 0x42, 0xa4, 0x40, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, \ - 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, \ - 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, \ - 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, \ - 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, \ - 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x82, 0x09, \ - 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, 0x30, 0x0c, 0x06, \ - 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, \ - 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, \ - 0x69, 0x00, 0x30, 0x66, 0x02, 0x31, 0x00, 0xc3, 0xb4, 0x62, 0x73, 0x56, \ - 0x28, 0x95, 0x00, 0x7d, 0x78, 0x12, 0x26, 0xd2, 0x71, 0x7b, 0x19, 0xf8, \ - 0x8a, 0x98, 0x3e, 0x92, 0xfe, 0x33, 0x9e, 0xe4, 0x79, 0xd2, 0xfe, 0x7a, \ - 0xb7, 0x87, 0x74, 0x3c, 0x2b, 0xb8, 0xd7, 0x69, 0x94, 0x0b, 0xa3, 0x67, \ - 0x77, 0xb8, 0xb3, 0xbe, 0xd1, 0x36, 0x32, 0x02, 0x31, 0x00, 0xfd, 0x67, \ - 0x9c, 0x94, 0x23, 0x67, 0xc0, 0x56, 0xba, 0x4b, 0x33, 0x15, 0x00, 0xc6, \ - 0xe3, 0xcc, 0x31, 0x08, 0x2c, 0x9c, 0x8b, 0xda, 0xa9, 0x75, 0x23, 0x2f, \ - 0xb8, 0x28, 0xe7, 0xf2, 0x9c, 0x14, 0x3a, 0x40, 0x01, 0x5c, 0xaf, 0x0c, \ - 0xb2, 0xcf, 0x74, 0x7f, 0x30, 0x9f, 0x08, 0x43, 0xad, 0x20 \ + 0x30, 0x82, 0x02, 0x04, 0x30, 0x82, 0x01, 0x88, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, \ + 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, \ + 0x05, 0x00, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, \ + 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, \ + 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, 0x50, \ + 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, \ + 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, \ + 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, 0x5a, 0x17, \ + 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, \ + 0x30, 0x5a, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, \ + 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, \ + 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, 0x50, \ + 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, \ + 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, \ + 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, \ + 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0xc3, 0xda, 0x2b, 0x34, 0x41, 0x37, \ + 0x58, 0x2f, 0x87, 0x56, 0xfe, 0xfc, 0x89, 0xba, 0x29, 0x43, 0x4b, 0x4e, \ + 0xe0, 0x6e, 0xc3, 0x0e, 0x57, 0x53, 0x33, 0x39, 0x58, 0xd4, 0x52, 0xb4, \ + 0x91, 0x95, 0x39, 0x0b, 0x23, 0xdf, 0x5f, 0x17, 0x24, 0x62, 0x48, 0xfc, \ + 0x1a, 0x95, 0x29, 0xce, 0x2c, 0x2d, 0x87, 0xc2, 0x88, 0x52, 0x80, 0xaf, \ + 0xd6, 0x6a, 0xab, 0x21, 0xdd, 0xb8, 0xd3, 0x1c, 0x6e, 0x58, 0xb8, 0xca, \ + 0xe8, 0xb2, 0x69, 0x8e, 0xf3, 0x41, 0xad, 0x29, 0xc3, 0xb4, 0x5f, 0x75, \ + 0xa7, 0x47, 0x6f, 0xd5, 0x19, 0x29, 0x55, 0x69, 0x9a, 0x53, 0x3b, 0x20, \ + 0xb4, 0x66, 0x16, 0x60, 0x33, 0x1e, 0xa3, 0x50, 0x30, 0x4e, 0x30, 0x0c, \ + 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, \ + 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x9d, \ + 0x6d, 0x20, 0x24, 0x49, 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, \ + 0x7e, 0x24, 0xc9, 0xdb, 0xfb, 0x36, 0x7c, 0x30, 0x1f, 0x06, 0x03, 0x55, \ + 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, \ + 0x49, 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, \ + 0xdb, 0xfb, 0x36, 0x7c, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \ + 0x3d, 0x04, 0x03, 0x02, 0x05, 0x00, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, \ + 0x30, 0x51, 0xca, 0xae, 0x30, 0x0f, 0xa4, 0x70, 0x74, 0x04, 0xdd, 0x5a, \ + 0x2c, 0x7f, 0x13, 0xc1, 0xc2, 0x77, 0xbe, 0x1d, 0x00, 0xc5, 0xe2, 0x99, \ + 0x8f, 0x7d, 0x26, 0x45, 0xd3, 0x8a, 0x06, 0x68, 0x3f, 0x8c, 0xb4, 0xb7, \ + 0xad, 0x4d, 0xe0, 0xf1, 0x54, 0x01, 0x1e, 0x99, 0xfc, 0xb0, 0xe4, 0xd3, \ + 0x07, 0x02, 0x31, 0x00, 0xdc, 0x4f, 0x3b, 0x90, 0x1e, 0xae, 0x29, 0x99, \ + 0x84, 0x28, 0xcc, 0x7b, 0x47, 0x78, 0x09, 0x31, 0xdf, 0xd6, 0x01, 0x59, \ + 0x30, 0x5e, 0xf4, 0xf8, 0x8a, 0x84, 0x3f, 0xea, 0x39, 0x54, 0x7b, 0x08, \ + 0xa7, 0x60, 0xaa, 0xbd, 0xf9, 0x5b, 0xd1, 0x51, 0x96, 0x14, 0x2e, 0x65, \ + 0xf5, 0xae, 0x1c, 0x42 \ } /* END FILE */ @@ -160,7 +152,7 @@ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDQTCCAimgAwIBAgIBAzANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ - "MTEwMjEyMTQ0NDAwWhcNMjEwMjEyMTQ0NDAwWjA7MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "MTkwMjEwMTQ0NDAwWhcNMjkwMjEwMTQ0NDAwWjA7MQswCQYDVQQGEwJOTDERMA8G\r\n" \ "A1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwggEiMA0G\r\n" \ "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDA3zf8F7vglp0/ht6WMn1EpRagzSHx\r\n" \ "mdTs6st8GFgIlKXsm8WL3xoemTiZhx57wI053zhdcHgH057Zk+i5clHFzqMwUqny\r\n" \ @@ -170,12 +162,12 @@ "KNF+AksjoBXyOGVkCeoMbo4bF6BxyLObyavpw/LPh5aPgAIynplYb6LVAgMBAAGj\r\n" \ "UDBOMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFLRa5KWz3tJS9rnVppUP6z68x/3/\r\n" \ "MB8GA1UdIwQYMBaAFLRa5KWz3tJS9rnVppUP6z68x/3/MA0GCSqGSIb3DQEBCwUA\r\n" \ - "A4IBAQB2W2dIy4q4KysbrTL4HIaOqu62RceGuQ/KhyiI6O0ndCtQ/PgCBqHHTP8u\r\n" \ - "8F1X2ivb60ynHV6baMLPI4Kf1k4MONtLSf/++1qh0Gdycd3A8IDAfy0YnC1F3OPK\r\n" \ - "vWO/cZGitKoTbEpP4y4Rng3sFCDndRCWIRIDOEEW/H3lCcfL7sOQojdLl85ajFkh\r\n" \ - "YvcDqjmnTcspUnuq9Y00C7porXJthZwz1S18qVjcFNk0zEhVMUbupSrdXVmKtOJW\r\n" \ - "MWZjgcA+OXzcnb2hSKWbhjykH/u6/PqkuHPkD723rwXbmHdxRVS9CW57kDkn5ezJ\r\n" \ - "5pE6Sam4qFsCNFJNBV9FRf3ZBMFi\r\n" \ + "A4IBAQA4qFSCth2q22uJIdE4KGHJsJjVEfw2/xn+MkTvCMfxVrvmRvqCtjE4tKDl\r\n" \ + "oK4MxFOek07oDZwvtAT9ijn1hHftTNS7RH9zd/fxNpfcHnMZXVC4w4DNA1fSANtW\r\n" \ + "5sY1JB5Je9jScrsLSS+mAjyv0Ow3Hb2Bix8wu7xNNrV5fIf7Ubm+wt6SqEBxu3Kb\r\n" \ + "+EfObAT4huf3czznhH3C17ed6NSbXwoXfby7stWUDeRJv08RaFOykf/Aae7bY5PL\r\n" \ + "yTVrkAnikMntJ9YI+hNNYt3inqq11A5cN0+rVTst8UKCxzQ4GpvroSwPKTFkbMw4\r\n" \ + "/anT1dVxr/BtwJfiESoK3/4CeXR1\r\n" \ "-----END CERTIFICATE-----\r\n" /* END FILE */ @@ -183,76 +175,76 @@ * using `xxd -i`. */ /* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA256_DER tests/data_files/test-ca-sha256.crt.der */ #define TEST_CA_CRT_RSA_SHA256_DER { \ - 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \ - 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ - 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ - 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ - 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ - 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ - 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ - 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ - 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \ - 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ - 0x34, 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ - 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ - 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ - 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \ - 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, \ - 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, \ - 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, \ - 0x01, 0x00, 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, \ - 0x86, 0xde, 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, \ - 0x99, 0xd4, 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, \ - 0x9b, 0xc5, 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, \ - 0xc0, 0x8d, 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, 0x07, 0xd3, 0x9e, 0xd9, \ - 0x93, 0xe8, 0xb9, 0x72, 0x51, 0xc5, 0xce, 0xa3, 0x30, 0x52, 0xa9, 0xf2, \ - 0xe7, 0x40, 0x70, 0x14, 0xcb, 0x44, 0xa2, 0x72, 0x0b, 0xc2, 0xe5, 0x40, \ - 0xf9, 0x3e, 0xe5, 0xa6, 0x0e, 0xb3, 0xf9, 0xec, 0x4a, 0x63, 0xc0, 0xb8, \ - 0x29, 0x00, 0x74, 0x9c, 0x57, 0x3b, 0xa8, 0xa5, 0x04, 0x90, 0x71, 0xf1, \ - 0xbd, 0x83, 0xd9, 0x3f, 0xd6, 0xa5, 0xe2, 0x3c, 0x2a, 0x8f, 0xef, 0x27, \ - 0x60, 0xc3, 0xc6, 0x9f, 0xcb, 0xba, 0xec, 0x60, 0x7d, 0xb7, 0xe6, 0x84, \ - 0x32, 0xbe, 0x4f, 0xfb, 0x58, 0x26, 0x22, 0x03, 0x5b, 0xd4, 0xb4, 0xd5, \ - 0xfb, 0xf5, 0xe3, 0x96, 0x2e, 0x70, 0xc0, 0xe4, 0x2e, 0xbd, 0xfc, 0x2e, \ - 0xee, 0xe2, 0x41, 0x55, 0xc0, 0x34, 0x2e, 0x7d, 0x24, 0x72, 0x69, 0xcb, \ - 0x47, 0xb1, 0x14, 0x40, 0x83, 0x7d, 0x67, 0xf4, 0x86, 0xf6, 0x31, 0xab, \ - 0xf1, 0x79, 0xa4, 0xb2, 0xb5, 0x2e, 0x12, 0xf9, 0x84, 0x17, 0xf0, 0x62, \ - 0x6f, 0x27, 0x3e, 0x13, 0x58, 0xb1, 0x54, 0x0d, 0x21, 0x9a, 0x73, 0x37, \ - 0xa1, 0x30, 0xcf, 0x6f, 0x92, 0xdc, 0xf6, 0xe9, 0xfc, 0xac, 0xdb, 0x2e, \ - 0x28, 0xd1, 0x7e, 0x02, 0x4b, 0x23, 0xa0, 0x15, 0xf2, 0x38, 0x65, 0x64, \ - 0x09, 0xea, 0x0c, 0x6e, 0x8e, 0x1b, 0x17, 0xa0, 0x71, 0xc8, 0xb3, 0x9b, \ - 0xc9, 0xab, 0xe9, 0xc3, 0xf2, 0xcf, 0x87, 0x96, 0x8f, 0x80, 0x02, 0x32, \ - 0x9e, 0x99, 0x58, 0x6f, 0xa2, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, \ - 0x50, 0x30, 0x4e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, \ - 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, \ - 0x04, 0x16, 0x04, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, \ - 0xf6, 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, \ - 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, \ - 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, \ - 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, \ - 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, \ - 0x03, 0x82, 0x01, 0x01, 0x00, 0x76, 0x5b, 0x67, 0x48, 0xcb, 0x8a, 0xb8, \ - 0x2b, 0x2b, 0x1b, 0xad, 0x32, 0xf8, 0x1c, 0x86, 0x8e, 0xaa, 0xee, 0xb6, \ - 0x45, 0xc7, 0x86, 0xb9, 0x0f, 0xca, 0x87, 0x28, 0x88, 0xe8, 0xed, 0x27, \ - 0x74, 0x2b, 0x50, 0xfc, 0xf8, 0x02, 0x06, 0xa1, 0xc7, 0x4c, 0xff, 0x2e, \ - 0xf0, 0x5d, 0x57, 0xda, 0x2b, 0xdb, 0xeb, 0x4c, 0xa7, 0x1d, 0x5e, 0x9b, \ - 0x68, 0xc2, 0xcf, 0x23, 0x82, 0x9f, 0xd6, 0x4e, 0x0c, 0x38, 0xdb, 0x4b, \ - 0x49, 0xff, 0xfe, 0xfb, 0x5a, 0xa1, 0xd0, 0x67, 0x72, 0x71, 0xdd, 0xc0, \ - 0xf0, 0x80, 0xc0, 0x7f, 0x2d, 0x18, 0x9c, 0x2d, 0x45, 0xdc, 0xe3, 0xca, \ - 0xbd, 0x63, 0xbf, 0x71, 0x91, 0xa2, 0xb4, 0xaa, 0x13, 0x6c, 0x4a, 0x4f, \ - 0xe3, 0x2e, 0x11, 0x9e, 0x0d, 0xec, 0x14, 0x20, 0xe7, 0x75, 0x10, 0x96, \ - 0x21, 0x12, 0x03, 0x38, 0x41, 0x16, 0xfc, 0x7d, 0xe5, 0x09, 0xc7, 0xcb, \ - 0xee, 0xc3, 0x90, 0xa2, 0x37, 0x4b, 0x97, 0xce, 0x5a, 0x8c, 0x59, 0x21, \ - 0x62, 0xf7, 0x03, 0xaa, 0x39, 0xa7, 0x4d, 0xcb, 0x29, 0x52, 0x7b, 0xaa, \ - 0xf5, 0x8d, 0x34, 0x0b, 0xba, 0x68, 0xad, 0x72, 0x6d, 0x85, 0x9c, 0x33, \ - 0xd5, 0x2d, 0x7c, 0xa9, 0x58, 0xdc, 0x14, 0xd9, 0x34, 0xcc, 0x48, 0x55, \ - 0x31, 0x46, 0xee, 0xa5, 0x2a, 0xdd, 0x5d, 0x59, 0x8a, 0xb4, 0xe2, 0x56, \ - 0x31, 0x66, 0x63, 0x81, 0xc0, 0x3e, 0x39, 0x7c, 0xdc, 0x9d, 0xbd, 0xa1, \ - 0x48, 0xa5, 0x9b, 0x86, 0x3c, 0xa4, 0x1f, 0xfb, 0xba, 0xfc, 0xfa, 0xa4, \ - 0xb8, 0x73, 0xe4, 0x0f, 0xbd, 0xb7, 0xaf, 0x05, 0xdb, 0x98, 0x77, 0x71, \ - 0x45, 0x54, 0xbd, 0x09, 0x6e, 0x7b, 0x90, 0x39, 0x27, 0xe5, 0xec, 0xc9, \ - 0xe6, 0x91, 0x3a, 0x49, 0xa9, 0xb8, 0xa8, 0x5b, 0x02, 0x34, 0x52, 0x4d, \ - 0x05, 0x5f, 0x45, 0x45, 0xfd, 0xd9, 0x04, 0xc1, 0x62 \ + 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \ + 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \ + 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, \ + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, \ + 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, \ + 0x01, 0x00, 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, \ + 0x86, 0xde, 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, \ + 0x99, 0xd4, 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, \ + 0x9b, 0xc5, 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, \ + 0xc0, 0x8d, 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, 0x07, 0xd3, 0x9e, 0xd9, \ + 0x93, 0xe8, 0xb9, 0x72, 0x51, 0xc5, 0xce, 0xa3, 0x30, 0x52, 0xa9, 0xf2, \ + 0xe7, 0x40, 0x70, 0x14, 0xcb, 0x44, 0xa2, 0x72, 0x0b, 0xc2, 0xe5, 0x40, \ + 0xf9, 0x3e, 0xe5, 0xa6, 0x0e, 0xb3, 0xf9, 0xec, 0x4a, 0x63, 0xc0, 0xb8, \ + 0x29, 0x00, 0x74, 0x9c, 0x57, 0x3b, 0xa8, 0xa5, 0x04, 0x90, 0x71, 0xf1, \ + 0xbd, 0x83, 0xd9, 0x3f, 0xd6, 0xa5, 0xe2, 0x3c, 0x2a, 0x8f, 0xef, 0x27, \ + 0x60, 0xc3, 0xc6, 0x9f, 0xcb, 0xba, 0xec, 0x60, 0x7d, 0xb7, 0xe6, 0x84, \ + 0x32, 0xbe, 0x4f, 0xfb, 0x58, 0x26, 0x22, 0x03, 0x5b, 0xd4, 0xb4, 0xd5, \ + 0xfb, 0xf5, 0xe3, 0x96, 0x2e, 0x70, 0xc0, 0xe4, 0x2e, 0xbd, 0xfc, 0x2e, \ + 0xee, 0xe2, 0x41, 0x55, 0xc0, 0x34, 0x2e, 0x7d, 0x24, 0x72, 0x69, 0xcb, \ + 0x47, 0xb1, 0x14, 0x40, 0x83, 0x7d, 0x67, 0xf4, 0x86, 0xf6, 0x31, 0xab, \ + 0xf1, 0x79, 0xa4, 0xb2, 0xb5, 0x2e, 0x12, 0xf9, 0x84, 0x17, 0xf0, 0x62, \ + 0x6f, 0x27, 0x3e, 0x13, 0x58, 0xb1, 0x54, 0x0d, 0x21, 0x9a, 0x73, 0x37, \ + 0xa1, 0x30, 0xcf, 0x6f, 0x92, 0xdc, 0xf6, 0xe9, 0xfc, 0xac, 0xdb, 0x2e, \ + 0x28, 0xd1, 0x7e, 0x02, 0x4b, 0x23, 0xa0, 0x15, 0xf2, 0x38, 0x65, 0x64, \ + 0x09, 0xea, 0x0c, 0x6e, 0x8e, 0x1b, 0x17, 0xa0, 0x71, 0xc8, 0xb3, 0x9b, \ + 0xc9, 0xab, 0xe9, 0xc3, 0xf2, 0xcf, 0x87, 0x96, 0x8f, 0x80, 0x02, 0x32, \ + 0x9e, 0x99, 0x58, 0x6f, 0xa2, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, \ + 0x50, 0x30, 0x4e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, \ + 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, \ + 0x04, 0x16, 0x04, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, \ + 0xf6, 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, \ + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, \ + 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, \ + 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, \ + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, \ + 0x03, 0x82, 0x01, 0x01, 0x00, 0x38, 0xa8, 0x54, 0x82, 0xb6, 0x1d, 0xaa, \ + 0xdb, 0x6b, 0x89, 0x21, 0xd1, 0x38, 0x28, 0x61, 0xc9, 0xb0, 0x98, 0xd5, \ + 0x11, 0xfc, 0x36, 0xff, 0x19, 0xfe, 0x32, 0x44, 0xef, 0x08, 0xc7, 0xf1, \ + 0x56, 0xbb, 0xe6, 0x46, 0xfa, 0x82, 0xb6, 0x31, 0x38, 0xb4, 0xa0, 0xe5, \ + 0xa0, 0xae, 0x0c, 0xc4, 0x53, 0x9e, 0x93, 0x4e, 0xe8, 0x0d, 0x9c, 0x2f, \ + 0xb4, 0x04, 0xfd, 0x8a, 0x39, 0xf5, 0x84, 0x77, 0xed, 0x4c, 0xd4, 0xbb, \ + 0x44, 0x7f, 0x73, 0x77, 0xf7, 0xf1, 0x36, 0x97, 0xdc, 0x1e, 0x73, 0x19, \ + 0x5d, 0x50, 0xb8, 0xc3, 0x80, 0xcd, 0x03, 0x57, 0xd2, 0x00, 0xdb, 0x56, \ + 0xe6, 0xc6, 0x35, 0x24, 0x1e, 0x49, 0x7b, 0xd8, 0xd2, 0x72, 0xbb, 0x0b, \ + 0x49, 0x2f, 0xa6, 0x02, 0x3c, 0xaf, 0xd0, 0xec, 0x37, 0x1d, 0xbd, 0x81, \ + 0x8b, 0x1f, 0x30, 0xbb, 0xbc, 0x4d, 0x36, 0xb5, 0x79, 0x7c, 0x87, 0xfb, \ + 0x51, 0xb9, 0xbe, 0xc2, 0xde, 0x92, 0xa8, 0x40, 0x71, 0xbb, 0x72, 0x9b, \ + 0xf8, 0x47, 0xce, 0x6c, 0x04, 0xf8, 0x86, 0xe7, 0xf7, 0x73, 0x3c, 0xe7, \ + 0x84, 0x7d, 0xc2, 0xd7, 0xb7, 0x9d, 0xe8, 0xd4, 0x9b, 0x5f, 0x0a, 0x17, \ + 0x7d, 0xbc, 0xbb, 0xb2, 0xd5, 0x94, 0x0d, 0xe4, 0x49, 0xbf, 0x4f, 0x11, \ + 0x68, 0x53, 0xb2, 0x91, 0xff, 0xc0, 0x69, 0xee, 0xdb, 0x63, 0x93, 0xcb, \ + 0xc9, 0x35, 0x6b, 0x90, 0x09, 0xe2, 0x90, 0xc9, 0xed, 0x27, 0xd6, 0x08, \ + 0xfa, 0x13, 0x4d, 0x62, 0xdd, 0xe2, 0x9e, 0xaa, 0xb5, 0xd4, 0x0e, 0x5c, \ + 0x37, 0x4f, 0xab, 0x55, 0x3b, 0x2d, 0xf1, 0x42, 0x82, 0xc7, 0x34, 0x38, \ + 0x1a, 0x9b, 0xeb, 0xa1, 0x2c, 0x0f, 0x29, 0x31, 0x64, 0x6c, 0xcc, 0x38, \ + 0xfd, 0xa9, 0xd3, 0xd5, 0xd5, 0x71, 0xaf, 0xf0, 0x6d, 0xc0, 0x97, 0xe2, \ + 0x11, 0x2a, 0x0a, 0xdf, 0xfe, 0x02, 0x79, 0x74, 0x75 \ } /* END FILE */ @@ -262,7 +254,7 @@ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDQTCCAimgAwIBAgIBAzANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \ "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ - "MTEwMjEyMTQ0NDAwWhcNMjEwMjEyMTQ0NDAwWjA7MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "MTkwMjEwMTQ0NDAwWhcNMjkwMjEwMTQ0NDAwWjA7MQswCQYDVQQGEwJOTDERMA8G\r\n" \ "A1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwggEiMA0G\r\n" \ "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDA3zf8F7vglp0/ht6WMn1EpRagzSHx\r\n" \ "mdTs6st8GFgIlKXsm8WL3xoemTiZhx57wI053zhdcHgH057Zk+i5clHFzqMwUqny\r\n" \ @@ -272,88 +264,88 @@ "KNF+AksjoBXyOGVkCeoMbo4bF6BxyLObyavpw/LPh5aPgAIynplYb6LVAgMBAAGj\r\n" \ "UDBOMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFLRa5KWz3tJS9rnVppUP6z68x/3/\r\n" \ "MB8GA1UdIwQYMBaAFLRa5KWz3tJS9rnVppUP6z68x/3/MA0GCSqGSIb3DQEBBQUA\r\n" \ - "A4IBAQABE3OEPfEd/bcJW5ZdU3/VgPNS4tMzh8gnJP/V2FcvFtGylMpQq6YnEBYI\r\n" \ - "yBHAL4DRvlMY5rnXGBp3ODR8MpqHC6AquRTCLzjS57iYff//4QFQqW9n92zctspv\r\n" \ - "czkaPKgjqo1No3Uq0Xaz10rcxyTUPrf5wNVRZ2V0KvllvAAVSzbI4mpdUXztjhST\r\n" \ - "S5A2BeWQAAOr0zq1F7TSRVJpJs7jmB2ai/igkh1IAjcuwV6VwlP+sbw0gjQ0NpGM\r\n" \ - "iHpnlzRAi/tIbtOvMIGOBU2TIfax/5jq1agUx5aPmT5TWAiJPOOP6l5xXnDwxeYS\r\n" \ - "NWqiX9GyusBZjezaCaHabjDLU0qQ\r\n" \ + "A4IBAQB0ZiNRFdia6kskaPnhrqejIRq8YMEGAf2oIPnyZ78xoyERgc35lHGyMtsL\r\n" \ + "hWicNjP4d/hS9As4j5KA2gdNGi5ETA1X7SowWOGsryivSpMSHVy1+HdfWlsYQOzm\r\n" \ + "8o+faQNUm8XzPVmttfAVspxeHSxJZ36Oo+QWZ5wZlCIEyjEdLUId+Tm4Bz3B5jRD\r\n" \ + "zZa/SaqDokq66N2zpbgKKAl3GU2O++fBqP2dSkdQykmTxhLLWRN8FJqhYATyQntZ\r\n" \ + "0QSi3W9HfSZPnFTcPIXeoiPd2pLlxt1hZu8dws2LTXE63uP6MM4LHvWxiuJaWkP/\r\n" \ + "mtxyUALj2pQxRitopORFQdn7AOY5\r\n" \ "-----END CERTIFICATE-----\r\n" /* END FILE */ /* This is taken from tests/data_files/test-ca-sha1.crt.der. */ /* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA1_DER tests/data_files/test-ca-sha1.crt.der */ #define TEST_CA_CRT_RSA_SHA1_DER { \ - 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \ - 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ - 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ - 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ - 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ - 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ - 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ - 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ - 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \ - 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ - 0x34, 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ - 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ - 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ - 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \ - 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, \ - 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, \ - 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, \ - 0x01, 0x00, 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, \ - 0x86, 0xde, 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, \ - 0x99, 0xd4, 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, \ - 0x9b, 0xc5, 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, \ - 0xc0, 0x8d, 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, 0x07, 0xd3, 0x9e, 0xd9, \ - 0x93, 0xe8, 0xb9, 0x72, 0x51, 0xc5, 0xce, 0xa3, 0x30, 0x52, 0xa9, 0xf2, \ - 0xe7, 0x40, 0x70, 0x14, 0xcb, 0x44, 0xa2, 0x72, 0x0b, 0xc2, 0xe5, 0x40, \ - 0xf9, 0x3e, 0xe5, 0xa6, 0x0e, 0xb3, 0xf9, 0xec, 0x4a, 0x63, 0xc0, 0xb8, \ - 0x29, 0x00, 0x74, 0x9c, 0x57, 0x3b, 0xa8, 0xa5, 0x04, 0x90, 0x71, 0xf1, \ - 0xbd, 0x83, 0xd9, 0x3f, 0xd6, 0xa5, 0xe2, 0x3c, 0x2a, 0x8f, 0xef, 0x27, \ - 0x60, 0xc3, 0xc6, 0x9f, 0xcb, 0xba, 0xec, 0x60, 0x7d, 0xb7, 0xe6, 0x84, \ - 0x32, 0xbe, 0x4f, 0xfb, 0x58, 0x26, 0x22, 0x03, 0x5b, 0xd4, 0xb4, 0xd5, \ - 0xfb, 0xf5, 0xe3, 0x96, 0x2e, 0x70, 0xc0, 0xe4, 0x2e, 0xbd, 0xfc, 0x2e, \ - 0xee, 0xe2, 0x41, 0x55, 0xc0, 0x34, 0x2e, 0x7d, 0x24, 0x72, 0x69, 0xcb, \ - 0x47, 0xb1, 0x14, 0x40, 0x83, 0x7d, 0x67, 0xf4, 0x86, 0xf6, 0x31, 0xab, \ - 0xf1, 0x79, 0xa4, 0xb2, 0xb5, 0x2e, 0x12, 0xf9, 0x84, 0x17, 0xf0, 0x62, \ - 0x6f, 0x27, 0x3e, 0x13, 0x58, 0xb1, 0x54, 0x0d, 0x21, 0x9a, 0x73, 0x37, \ - 0xa1, 0x30, 0xcf, 0x6f, 0x92, 0xdc, 0xf6, 0xe9, 0xfc, 0xac, 0xdb, 0x2e, \ - 0x28, 0xd1, 0x7e, 0x02, 0x4b, 0x23, 0xa0, 0x15, 0xf2, 0x38, 0x65, 0x64, \ - 0x09, 0xea, 0x0c, 0x6e, 0x8e, 0x1b, 0x17, 0xa0, 0x71, 0xc8, 0xb3, 0x9b, \ - 0xc9, 0xab, 0xe9, 0xc3, 0xf2, 0xcf, 0x87, 0x96, 0x8f, 0x80, 0x02, 0x32, \ - 0x9e, 0x99, 0x58, 0x6f, 0xa2, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, \ - 0x50, 0x30, 0x4e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, \ - 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, \ - 0x04, 0x16, 0x04, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, \ - 0xf6, 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, \ - 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, \ - 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, \ - 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, \ - 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, \ - 0x03, 0x82, 0x01, 0x01, 0x00, 0x01, 0x13, 0x73, 0x84, 0x3d, 0xf1, 0x1d, \ - 0xfd, 0xb7, 0x09, 0x5b, 0x96, 0x5d, 0x53, 0x7f, 0xd5, 0x80, 0xf3, 0x52, \ - 0xe2, 0xd3, 0x33, 0x87, 0xc8, 0x27, 0x24, 0xff, 0xd5, 0xd8, 0x57, 0x2f, \ - 0x16, 0xd1, 0xb2, 0x94, 0xca, 0x50, 0xab, 0xa6, 0x27, 0x10, 0x16, 0x08, \ - 0xc8, 0x11, 0xc0, 0x2f, 0x80, 0xd1, 0xbe, 0x53, 0x18, 0xe6, 0xb9, 0xd7, \ - 0x18, 0x1a, 0x77, 0x38, 0x34, 0x7c, 0x32, 0x9a, 0x87, 0x0b, 0xa0, 0x2a, \ - 0xb9, 0x14, 0xc2, 0x2f, 0x38, 0xd2, 0xe7, 0xb8, 0x98, 0x7d, 0xff, 0xff, \ - 0xe1, 0x01, 0x50, 0xa9, 0x6f, 0x67, 0xf7, 0x6c, 0xdc, 0xb6, 0xca, 0x6f, \ - 0x73, 0x39, 0x1a, 0x3c, 0xa8, 0x23, 0xaa, 0x8d, 0x4d, 0xa3, 0x75, 0x2a, \ - 0xd1, 0x76, 0xb3, 0xd7, 0x4a, 0xdc, 0xc7, 0x24, 0xd4, 0x3e, 0xb7, 0xf9, \ - 0xc0, 0xd5, 0x51, 0x67, 0x65, 0x74, 0x2a, 0xf9, 0x65, 0xbc, 0x00, 0x15, \ - 0x4b, 0x36, 0xc8, 0xe2, 0x6a, 0x5d, 0x51, 0x7c, 0xed, 0x8e, 0x14, 0x93, \ - 0x4b, 0x90, 0x36, 0x05, 0xe5, 0x90, 0x00, 0x03, 0xab, 0xd3, 0x3a, 0xb5, \ - 0x17, 0xb4, 0xd2, 0x45, 0x52, 0x69, 0x26, 0xce, 0xe3, 0x98, 0x1d, 0x9a, \ - 0x8b, 0xf8, 0xa0, 0x92, 0x1d, 0x48, 0x02, 0x37, 0x2e, 0xc1, 0x5e, 0x95, \ - 0xc2, 0x53, 0xfe, 0xb1, 0xbc, 0x34, 0x82, 0x34, 0x34, 0x36, 0x91, 0x8c, \ - 0x88, 0x7a, 0x67, 0x97, 0x34, 0x40, 0x8b, 0xfb, 0x48, 0x6e, 0xd3, 0xaf, \ - 0x30, 0x81, 0x8e, 0x05, 0x4d, 0x93, 0x21, 0xf6, 0xb1, 0xff, 0x98, 0xea, \ - 0xd5, 0xa8, 0x14, 0xc7, 0x96, 0x8f, 0x99, 0x3e, 0x53, 0x58, 0x08, 0x89, \ - 0x3c, 0xe3, 0x8f, 0xea, 0x5e, 0x71, 0x5e, 0x70, 0xf0, 0xc5, 0xe6, 0x12, \ - 0x35, 0x6a, 0xa2, 0x5f, 0xd1, 0xb2, 0xba, 0xc0, 0x59, 0x8d, 0xec, 0xda, \ - 0x09, 0xa1, 0xda, 0x6e, 0x30, 0xcb, 0x53, 0x4a, 0x90 \ + 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \ + 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \ + 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, \ + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, \ + 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, \ + 0x01, 0x00, 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, \ + 0x86, 0xde, 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, \ + 0x99, 0xd4, 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, \ + 0x9b, 0xc5, 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, \ + 0xc0, 0x8d, 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, 0x07, 0xd3, 0x9e, 0xd9, \ + 0x93, 0xe8, 0xb9, 0x72, 0x51, 0xc5, 0xce, 0xa3, 0x30, 0x52, 0xa9, 0xf2, \ + 0xe7, 0x40, 0x70, 0x14, 0xcb, 0x44, 0xa2, 0x72, 0x0b, 0xc2, 0xe5, 0x40, \ + 0xf9, 0x3e, 0xe5, 0xa6, 0x0e, 0xb3, 0xf9, 0xec, 0x4a, 0x63, 0xc0, 0xb8, \ + 0x29, 0x00, 0x74, 0x9c, 0x57, 0x3b, 0xa8, 0xa5, 0x04, 0x90, 0x71, 0xf1, \ + 0xbd, 0x83, 0xd9, 0x3f, 0xd6, 0xa5, 0xe2, 0x3c, 0x2a, 0x8f, 0xef, 0x27, \ + 0x60, 0xc3, 0xc6, 0x9f, 0xcb, 0xba, 0xec, 0x60, 0x7d, 0xb7, 0xe6, 0x84, \ + 0x32, 0xbe, 0x4f, 0xfb, 0x58, 0x26, 0x22, 0x03, 0x5b, 0xd4, 0xb4, 0xd5, \ + 0xfb, 0xf5, 0xe3, 0x96, 0x2e, 0x70, 0xc0, 0xe4, 0x2e, 0xbd, 0xfc, 0x2e, \ + 0xee, 0xe2, 0x41, 0x55, 0xc0, 0x34, 0x2e, 0x7d, 0x24, 0x72, 0x69, 0xcb, \ + 0x47, 0xb1, 0x14, 0x40, 0x83, 0x7d, 0x67, 0xf4, 0x86, 0xf6, 0x31, 0xab, \ + 0xf1, 0x79, 0xa4, 0xb2, 0xb5, 0x2e, 0x12, 0xf9, 0x84, 0x17, 0xf0, 0x62, \ + 0x6f, 0x27, 0x3e, 0x13, 0x58, 0xb1, 0x54, 0x0d, 0x21, 0x9a, 0x73, 0x37, \ + 0xa1, 0x30, 0xcf, 0x6f, 0x92, 0xdc, 0xf6, 0xe9, 0xfc, 0xac, 0xdb, 0x2e, \ + 0x28, 0xd1, 0x7e, 0x02, 0x4b, 0x23, 0xa0, 0x15, 0xf2, 0x38, 0x65, 0x64, \ + 0x09, 0xea, 0x0c, 0x6e, 0x8e, 0x1b, 0x17, 0xa0, 0x71, 0xc8, 0xb3, 0x9b, \ + 0xc9, 0xab, 0xe9, 0xc3, 0xf2, 0xcf, 0x87, 0x96, 0x8f, 0x80, 0x02, 0x32, \ + 0x9e, 0x99, 0x58, 0x6f, 0xa2, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, \ + 0x50, 0x30, 0x4e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, \ + 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, \ + 0x04, 0x16, 0x04, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, \ + 0xf6, 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, \ + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, \ + 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, \ + 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, \ + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, \ + 0x03, 0x82, 0x01, 0x01, 0x00, 0x74, 0x66, 0x23, 0x51, 0x15, 0xd8, 0x9a, \ + 0xea, 0x4b, 0x24, 0x68, 0xf9, 0xe1, 0xae, 0xa7, 0xa3, 0x21, 0x1a, 0xbc, \ + 0x60, 0xc1, 0x06, 0x01, 0xfd, 0xa8, 0x20, 0xf9, 0xf2, 0x67, 0xbf, 0x31, \ + 0xa3, 0x21, 0x11, 0x81, 0xcd, 0xf9, 0x94, 0x71, 0xb2, 0x32, 0xdb, 0x0b, \ + 0x85, 0x68, 0x9c, 0x36, 0x33, 0xf8, 0x77, 0xf8, 0x52, 0xf4, 0x0b, 0x38, \ + 0x8f, 0x92, 0x80, 0xda, 0x07, 0x4d, 0x1a, 0x2e, 0x44, 0x4c, 0x0d, 0x57, \ + 0xed, 0x2a, 0x30, 0x58, 0xe1, 0xac, 0xaf, 0x28, 0xaf, 0x4a, 0x93, 0x12, \ + 0x1d, 0x5c, 0xb5, 0xf8, 0x77, 0x5f, 0x5a, 0x5b, 0x18, 0x40, 0xec, 0xe6, \ + 0xf2, 0x8f, 0x9f, 0x69, 0x03, 0x54, 0x9b, 0xc5, 0xf3, 0x3d, 0x59, 0xad, \ + 0xb5, 0xf0, 0x15, 0xb2, 0x9c, 0x5e, 0x1d, 0x2c, 0x49, 0x67, 0x7e, 0x8e, \ + 0xa3, 0xe4, 0x16, 0x67, 0x9c, 0x19, 0x94, 0x22, 0x04, 0xca, 0x31, 0x1d, \ + 0x2d, 0x42, 0x1d, 0xf9, 0x39, 0xb8, 0x07, 0x3d, 0xc1, 0xe6, 0x34, 0x43, \ + 0xcd, 0x96, 0xbf, 0x49, 0xaa, 0x83, 0xa2, 0x4a, 0xba, 0xe8, 0xdd, 0xb3, \ + 0xa5, 0xb8, 0x0a, 0x28, 0x09, 0x77, 0x19, 0x4d, 0x8e, 0xfb, 0xe7, 0xc1, \ + 0xa8, 0xfd, 0x9d, 0x4a, 0x47, 0x50, 0xca, 0x49, 0x93, 0xc6, 0x12, 0xcb, \ + 0x59, 0x13, 0x7c, 0x14, 0x9a, 0xa1, 0x60, 0x04, 0xf2, 0x42, 0x7b, 0x59, \ + 0xd1, 0x04, 0xa2, 0xdd, 0x6f, 0x47, 0x7d, 0x26, 0x4f, 0x9c, 0x54, 0xdc, \ + 0x3c, 0x85, 0xde, 0xa2, 0x23, 0xdd, 0xda, 0x92, 0xe5, 0xc6, 0xdd, 0x61, \ + 0x66, 0xef, 0x1d, 0xc2, 0xcd, 0x8b, 0x4d, 0x71, 0x3a, 0xde, 0xe3, 0xfa, \ + 0x30, 0xce, 0x0b, 0x1e, 0xf5, 0xb1, 0x8a, 0xe2, 0x5a, 0x5a, 0x43, 0xff, \ + 0x9a, 0xdc, 0x72, 0x50, 0x02, 0xe3, 0xda, 0x94, 0x31, 0x46, 0x2b, 0x68, \ + 0xa4, 0xe4, 0x45, 0x41, 0xd9, 0xfb, 0x00, 0xe6, 0x39 \ } /* END FILE */ @@ -617,7 +609,7 @@ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ - "MTEwMjEyMTQ0NDA2WhcNMjEwMjEyMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "MTkwMjEwMTQ0NDA2WhcNMjkwMjEwMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \ "A1UECgwIUG9sYXJTU0wxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN\r\n" \ "AQEBBQADggEPADCCAQoCggEBAMFNo93nzR3RBNdJcriZrA545Do8Ss86ExbQWuTN\r\n" \ "owCIp+4ea5anUrSQ7y1yej4kmvy2NKwk9XfgJmSMnLAofaHa6ozmyRyWvP7BBFKz\r\n" \ @@ -626,88 +618,88 @@ "hYvai0Re4hjGYi/HZo36Xdh98yeJKQHFkA4/J/EwyEoO79bex8cna8cFPXrEAjya\r\n" \ "HT4P6DSYW8tzS1KW2BGiLICIaTla0w+w3lkvEcf36hIBMJcCAwEAAaNNMEswCQYD\r\n" \ "VR0TBAIwADAdBgNVHQ4EFgQUpQXoZLjc32APUBJNYKhkr02LQ5MwHwYDVR0jBBgw\r\n" \ - "FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQELBQADggEBAGGEshT5\r\n" \ - "kvnRmLVScVeUEdwIrvW7ezbGbUvJ8VxeJ79/HSjlLiGbMc4uUathwtzEdi9R/4C5\r\n" \ - "DXBNeEPTkbB+fhG1W06iHYj/Dp8+aaG7fuDxKVKHVZSqBnmQLn73ymyclZNHii5A\r\n" \ - "3nTS8WUaHAzxN/rajOtoM7aH1P9tULpHrl+7HOeLMpxUnwI12ZqZaLIzxbcdJVcr\r\n" \ - "ra2F00aXCGkYVLvyvbZIq7LC+yVysej5gCeQYD7VFOEks0jhFjrS06gP0/XnWv6v\r\n" \ - "eBoPez9d+CCjkrhseiWzXOiriIMICX48EloO/DrsMRAtvlwq7EDz4QhILz6ffndm\r\n" \ - "e4K1cVANRPN2o9Y=\r\n" \ + "FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQELBQADggEBAC465FJh\r\n" \ + "Pqel7zJngHIHJrqj/wVAxGAFOTF396XKATGAp+HRCqJ81Ry60CNK1jDzk8dv6M6U\r\n" \ + "HoS7RIFiM/9rXQCbJfiPD5xMTejZp5n5UYHAmxsxDaazfA5FuBhkfokKK6jD4Eq9\r\n" \ + "1C94xGKb6X4/VkaPF7cqoBBw/bHxawXc0UEPjqayiBpCYU/rJoVZgLqFVP7Px3sv\r\n" \ + "a1nOrNx8rPPI1hJ+ZOg8maiPTxHZnBVLakSSLQy/sWeWyazO1RnrbxjrbgQtYKz0\r\n" \ + "e3nwGpu1w13vfckFmUSBhHXH7AAS/HpKC4IH7G2GAk3+n8iSSN71sZzpxonQwVbo\r\n" \ + "pMZqLmbBm/7WPLc=\r\n" \ "-----END CERTIFICATE-----\r\n" /* END FILE */ /* This is taken from tests/data_files/server2-sha256.crt.der. */ /* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA256_DER tests/data_files/server2-sha256.crt.der */ #define TEST_SRV_CRT_RSA_SHA256_DER { \ - 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \ - 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ - 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ - 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ - 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ - 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ - 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ - 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ - 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ - 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ - 0x34, 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ - 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ - 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ - 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x82, \ - 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \ - 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, \ - 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, \ - 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, \ - 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, \ - 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, \ - 0xef, 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, 0xfc, 0xb6, 0x34, 0xac, 0x24, \ - 0xf5, 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, 0xb0, 0x28, 0x7d, 0xa1, 0xda, \ - 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, 0xfe, 0xc1, 0x04, 0x52, 0xb3, \ - 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, 0xd8, 0x90, 0xc1, 0x61, 0xb4, \ - 0x66, 0x52, 0x36, 0xa2, 0x26, 0x53, 0xaa, 0xab, 0x74, 0x5e, 0x07, 0x7d, \ - 0x19, 0x82, 0xdb, 0x2a, 0xd8, 0x1f, 0xa0, 0xd9, 0x0d, 0x1c, 0x2d, 0x49, \ - 0x66, 0xf7, 0x5b, 0x25, 0x73, 0x46, 0xe8, 0x0b, 0x8a, 0x4f, 0x69, 0x0c, \ - 0xb5, 0x00, 0x90, 0xe1, 0xda, 0x82, 0x10, 0x66, 0x7d, 0xae, 0x54, 0x2b, \ - 0x8b, 0x65, 0x79, 0x91, 0xa1, 0xe2, 0x61, 0xc3, 0xcd, 0x40, 0x49, 0x08, \ - 0xee, 0x68, 0x0c, 0xf1, 0x8b, 0x86, 0xd2, 0x46, 0xbf, 0xd0, 0xb8, 0xaa, \ - 0x11, 0x03, 0x1e, 0x7f, 0x56, 0xa8, 0x1a, 0x1e, 0x44, 0x18, 0x0f, 0x0f, \ - 0x85, 0x8b, 0xda, 0x8b, 0x44, 0x5e, 0xe2, 0x18, 0xc6, 0x62, 0x2f, 0xc7, \ - 0x66, 0x8d, 0xfa, 0x5d, 0xd8, 0x7d, 0xf3, 0x27, 0x89, 0x29, 0x01, 0xc5, \ - 0x90, 0x0e, 0x3f, 0x27, 0xf1, 0x30, 0xc8, 0x4a, 0x0e, 0xef, 0xd6, 0xde, \ - 0xc7, 0xc7, 0x27, 0x6b, 0xc7, 0x05, 0x3d, 0x7a, 0xc4, 0x02, 0x3c, 0x9a, \ - 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, 0xcb, 0x73, 0x4b, 0x52, 0x96, \ - 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, 0x39, 0x5a, 0xd3, 0x0f, 0xb0, \ - 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, 0x12, 0x01, 0x30, 0x97, 0x02, \ - 0x03, 0x01, 0x00, 0x01, 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, \ - 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa5, 0x05, 0xe8, 0x64, 0xb8, 0xdc, \ - 0xdf, 0x60, 0x0f, 0x50, 0x12, 0x4d, 0x60, 0xa8, 0x64, 0xaf, 0x4d, 0x8b, \ - 0x43, 0x93, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, \ - 0x16, 0x80, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, \ - 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, \ - 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, \ - 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x61, 0x84, 0xb2, 0x14, 0xf9, \ - 0x92, 0xf9, 0xd1, 0x98, 0xb5, 0x52, 0x71, 0x57, 0x94, 0x11, 0xdc, 0x08, \ - 0xae, 0xf5, 0xbb, 0x7b, 0x36, 0xc6, 0x6d, 0x4b, 0xc9, 0xf1, 0x5c, 0x5e, \ - 0x27, 0xbf, 0x7f, 0x1d, 0x28, 0xe5, 0x2e, 0x21, 0x9b, 0x31, 0xce, 0x2e, \ - 0x51, 0xab, 0x61, 0xc2, 0xdc, 0xc4, 0x76, 0x2f, 0x51, 0xff, 0x80, 0xb9, \ - 0x0d, 0x70, 0x4d, 0x78, 0x43, 0xd3, 0x91, 0xb0, 0x7e, 0x7e, 0x11, 0xb5, \ - 0x5b, 0x4e, 0xa2, 0x1d, 0x88, 0xff, 0x0e, 0x9f, 0x3e, 0x69, 0xa1, 0xbb, \ - 0x7e, 0xe0, 0xf1, 0x29, 0x52, 0x87, 0x55, 0x94, 0xaa, 0x06, 0x79, 0x90, \ - 0x2e, 0x7e, 0xf7, 0xca, 0x6c, 0x9c, 0x95, 0x93, 0x47, 0x8a, 0x2e, 0x40, \ - 0xde, 0x74, 0xd2, 0xf1, 0x65, 0x1a, 0x1c, 0x0c, 0xf1, 0x37, 0xfa, 0xda, \ - 0x8c, 0xeb, 0x68, 0x33, 0xb6, 0x87, 0xd4, 0xff, 0x6d, 0x50, 0xba, 0x47, \ - 0xae, 0x5f, 0xbb, 0x1c, 0xe7, 0x8b, 0x32, 0x9c, 0x54, 0x9f, 0x02, 0x35, \ - 0xd9, 0x9a, 0x99, 0x68, 0xb2, 0x33, 0xc5, 0xb7, 0x1d, 0x25, 0x57, 0x2b, \ - 0xad, 0xad, 0x85, 0xd3, 0x46, 0x97, 0x08, 0x69, 0x18, 0x54, 0xbb, 0xf2, \ - 0xbd, 0xb6, 0x48, 0xab, 0xb2, 0xc2, 0xfb, 0x25, 0x72, 0xb1, 0xe8, 0xf9, \ - 0x80, 0x27, 0x90, 0x60, 0x3e, 0xd5, 0x14, 0xe1, 0x24, 0xb3, 0x48, 0xe1, \ - 0x16, 0x3a, 0xd2, 0xd3, 0xa8, 0x0f, 0xd3, 0xf5, 0xe7, 0x5a, 0xfe, 0xaf, \ - 0x78, 0x1a, 0x0f, 0x7b, 0x3f, 0x5d, 0xf8, 0x20, 0xa3, 0x92, 0xb8, 0x6c, \ - 0x7a, 0x25, 0xb3, 0x5c, 0xe8, 0xab, 0x88, 0x83, 0x08, 0x09, 0x7e, 0x3c, \ - 0x12, 0x5a, 0x0e, 0xfc, 0x3a, 0xec, 0x31, 0x10, 0x2d, 0xbe, 0x5c, 0x2a, \ - 0xec, 0x40, 0xf3, 0xe1, 0x08, 0x48, 0x2f, 0x3e, 0x9f, 0x7e, 0x77, 0x66, \ - 0x7b, 0x82, 0xb5, 0x71, 0x50, 0x0d, 0x44, 0xf3, 0x76, 0xa3, 0xd6 \ + 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ + 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x82, \ + 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \ + 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, \ + 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, \ + 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, \ + 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, \ + 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, \ + 0xef, 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, 0xfc, 0xb6, 0x34, 0xac, 0x24, \ + 0xf5, 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, 0xb0, 0x28, 0x7d, 0xa1, 0xda, \ + 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, 0xfe, 0xc1, 0x04, 0x52, 0xb3, \ + 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, 0xd8, 0x90, 0xc1, 0x61, 0xb4, \ + 0x66, 0x52, 0x36, 0xa2, 0x26, 0x53, 0xaa, 0xab, 0x74, 0x5e, 0x07, 0x7d, \ + 0x19, 0x82, 0xdb, 0x2a, 0xd8, 0x1f, 0xa0, 0xd9, 0x0d, 0x1c, 0x2d, 0x49, \ + 0x66, 0xf7, 0x5b, 0x25, 0x73, 0x46, 0xe8, 0x0b, 0x8a, 0x4f, 0x69, 0x0c, \ + 0xb5, 0x00, 0x90, 0xe1, 0xda, 0x82, 0x10, 0x66, 0x7d, 0xae, 0x54, 0x2b, \ + 0x8b, 0x65, 0x79, 0x91, 0xa1, 0xe2, 0x61, 0xc3, 0xcd, 0x40, 0x49, 0x08, \ + 0xee, 0x68, 0x0c, 0xf1, 0x8b, 0x86, 0xd2, 0x46, 0xbf, 0xd0, 0xb8, 0xaa, \ + 0x11, 0x03, 0x1e, 0x7f, 0x56, 0xa8, 0x1a, 0x1e, 0x44, 0x18, 0x0f, 0x0f, \ + 0x85, 0x8b, 0xda, 0x8b, 0x44, 0x5e, 0xe2, 0x18, 0xc6, 0x62, 0x2f, 0xc7, \ + 0x66, 0x8d, 0xfa, 0x5d, 0xd8, 0x7d, 0xf3, 0x27, 0x89, 0x29, 0x01, 0xc5, \ + 0x90, 0x0e, 0x3f, 0x27, 0xf1, 0x30, 0xc8, 0x4a, 0x0e, 0xef, 0xd6, 0xde, \ + 0xc7, 0xc7, 0x27, 0x6b, 0xc7, 0x05, 0x3d, 0x7a, 0xc4, 0x02, 0x3c, 0x9a, \ + 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, 0xcb, 0x73, 0x4b, 0x52, 0x96, \ + 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, 0x39, 0x5a, 0xd3, 0x0f, 0xb0, \ + 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, 0x12, 0x01, 0x30, 0x97, 0x02, \ + 0x03, 0x01, 0x00, 0x01, 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, \ + 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa5, 0x05, 0xe8, 0x64, 0xb8, 0xdc, \ + 0xdf, 0x60, 0x0f, 0x50, 0x12, 0x4d, 0x60, 0xa8, 0x64, 0xaf, 0x4d, 0x8b, \ + 0x43, 0x93, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, \ + 0x16, 0x80, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, \ + 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, \ + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, \ + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x2e, 0x3a, 0xe4, 0x52, 0x61, \ + 0x3e, 0xa7, 0xa5, 0xef, 0x32, 0x67, 0x80, 0x72, 0x07, 0x26, 0xba, 0xa3, \ + 0xff, 0x05, 0x40, 0xc4, 0x60, 0x05, 0x39, 0x31, 0x77, 0xf7, 0xa5, 0xca, \ + 0x01, 0x31, 0x80, 0xa7, 0xe1, 0xd1, 0x0a, 0xa2, 0x7c, 0xd5, 0x1c, 0xba, \ + 0xd0, 0x23, 0x4a, 0xd6, 0x30, 0xf3, 0x93, 0xc7, 0x6f, 0xe8, 0xce, 0x94, \ + 0x1e, 0x84, 0xbb, 0x44, 0x81, 0x62, 0x33, 0xff, 0x6b, 0x5d, 0x00, 0x9b, \ + 0x25, 0xf8, 0x8f, 0x0f, 0x9c, 0x4c, 0x4d, 0xe8, 0xd9, 0xa7, 0x99, 0xf9, \ + 0x51, 0x81, 0xc0, 0x9b, 0x1b, 0x31, 0x0d, 0xa6, 0xb3, 0x7c, 0x0e, 0x45, \ + 0xb8, 0x18, 0x64, 0x7e, 0x89, 0x0a, 0x2b, 0xa8, 0xc3, 0xe0, 0x4a, 0xbd, \ + 0xd4, 0x2f, 0x78, 0xc4, 0x62, 0x9b, 0xe9, 0x7e, 0x3f, 0x56, 0x46, 0x8f, \ + 0x17, 0xb7, 0x2a, 0xa0, 0x10, 0x70, 0xfd, 0xb1, 0xf1, 0x6b, 0x05, 0xdc, \ + 0xd1, 0x41, 0x0f, 0x8e, 0xa6, 0xb2, 0x88, 0x1a, 0x42, 0x61, 0x4f, 0xeb, \ + 0x26, 0x85, 0x59, 0x80, 0xba, 0x85, 0x54, 0xfe, 0xcf, 0xc7, 0x7b, 0x2f, \ + 0x6b, 0x59, 0xce, 0xac, 0xdc, 0x7c, 0xac, 0xf3, 0xc8, 0xd6, 0x12, 0x7e, \ + 0x64, 0xe8, 0x3c, 0x99, 0xa8, 0x8f, 0x4f, 0x11, 0xd9, 0x9c, 0x15, 0x4b, \ + 0x6a, 0x44, 0x92, 0x2d, 0x0c, 0xbf, 0xb1, 0x67, 0x96, 0xc9, 0xac, 0xce, \ + 0xd5, 0x19, 0xeb, 0x6f, 0x18, 0xeb, 0x6e, 0x04, 0x2d, 0x60, 0xac, 0xf4, \ + 0x7b, 0x79, 0xf0, 0x1a, 0x9b, 0xb5, 0xc3, 0x5d, 0xef, 0x7d, 0xc9, 0x05, \ + 0x99, 0x44, 0x81, 0x84, 0x75, 0xc7, 0xec, 0x00, 0x12, 0xfc, 0x7a, 0x4a, \ + 0x0b, 0x82, 0x07, 0xec, 0x6d, 0x86, 0x02, 0x4d, 0xfe, 0x9f, 0xc8, 0x92, \ + 0x48, 0xde, 0xf5, 0xb1, 0x9c, 0xe9, 0xc6, 0x89, 0xd0, 0xc1, 0x56, 0xe8, \ + 0xa4, 0xc6, 0x6a, 0x2e, 0x66, 0xc1, 0x9b, 0xfe, 0xd6, 0x3c, 0xb7 \ } /* END FILE */ @@ -717,7 +709,7 @@ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \ "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ - "MTEwMjEyMTQ0NDA2WhcNMjEwMjEyMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "MTkwMjEwMTQ0NDA2WhcNMjkwMjEwMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \ "A1UECgwIUG9sYXJTU0wxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN\r\n" \ "AQEBBQADggEPADCCAQoCggEBAMFNo93nzR3RBNdJcriZrA545Do8Ss86ExbQWuTN\r\n" \ "owCIp+4ea5anUrSQ7y1yej4kmvy2NKwk9XfgJmSMnLAofaHa6ozmyRyWvP7BBFKz\r\n" \ @@ -726,88 +718,88 @@ "hYvai0Re4hjGYi/HZo36Xdh98yeJKQHFkA4/J/EwyEoO79bex8cna8cFPXrEAjya\r\n" \ "HT4P6DSYW8tzS1KW2BGiLICIaTla0w+w3lkvEcf36hIBMJcCAwEAAaNNMEswCQYD\r\n" \ "VR0TBAIwADAdBgNVHQ4EFgQUpQXoZLjc32APUBJNYKhkr02LQ5MwHwYDVR0jBBgw\r\n" \ - "FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQEFBQADggEBAAFzC0rF\r\n" \ - "y6De8WMcdgQrEw3AhBHFjzqnxZw1ene4IBSC7lTw8rBSy3jOWQdPUWn+0y/pCeeF\r\n" \ - "kti6sevFdl1hLemGtd4q+T9TKEKGg3ND4ARfB5AUZZ9uEHq8WBkiwus5clGS17Qd\r\n" \ - "dS/TOisB59tQruLx1E1bPLtBKyqk4koC5WAULJwfpswGSyWJTpYwIpxcWE3D2tBu\r\n" \ - "UB6MZfXZFzWmWEOyKbeoXjXe8GBCGgHLywvYDsGQ36HSGtEsAvR2QaTLSxWYcfk1\r\n" \ - "fbDn4jSWkb4yZy1r01UEigFQtONieGwRFaUqEcFJHJvEEGVgh9keaVlOj2vrwf5r\r\n" \ - "4mN4lW7gLdenN6g=\r\n" \ + "FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQEFBQADggEBAJklg3Q4\r\n" \ + "cB7v7BzsxM/vLyKccO6op0/gZzM4ghuLq2Y32kl0sM6kSNUUmduuq3u/+GmUZN2A\r\n" \ + "O/7c+Hw7hDFEIvZk98aBGjCLqn3DmgHIv8ToQ67nellQxx2Uj309PdgjNi/r9HOc\r\n" \ + "KNAYPbBcg6MJGWWj2TI6vNaceios/DhOYx5V0j5nfqSJ/pnU0g9Ign2LAhgYpGJE\r\n" \ + "iEM9wW7hEMkwmk0h/sqZsrJsGH5YsF/VThSq/JVO1e2mZH2vruyZKJVBq+8tDNYp\r\n" \ + "HkK6tSyVYQhzIt3StMJWKMl/o5k2AYz6tSC164+1oG+ML3LWg8XrGKa91H4UOKap\r\n" \ + "Awgk0+4m0T25cNs=\r\n" \ "-----END CERTIFICATE-----\r\n" /* END FILE */ /* This is taken from tests/data_files/server2.crt.der. */ /* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA1_DER tests/data_files/server2.crt.der */ #define TEST_SRV_CRT_RSA_SHA1_DER { \ - 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \ - 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ - 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ - 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ - 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ - 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ - 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ - 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ - 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ - 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ - 0x34, 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ - 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ - 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ - 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x82, \ - 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \ - 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, \ - 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, \ - 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, \ - 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, \ - 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, \ - 0xef, 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, 0xfc, 0xb6, 0x34, 0xac, 0x24, \ - 0xf5, 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, 0xb0, 0x28, 0x7d, 0xa1, 0xda, \ - 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, 0xfe, 0xc1, 0x04, 0x52, 0xb3, \ - 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, 0xd8, 0x90, 0xc1, 0x61, 0xb4, \ - 0x66, 0x52, 0x36, 0xa2, 0x26, 0x53, 0xaa, 0xab, 0x74, 0x5e, 0x07, 0x7d, \ - 0x19, 0x82, 0xdb, 0x2a, 0xd8, 0x1f, 0xa0, 0xd9, 0x0d, 0x1c, 0x2d, 0x49, \ - 0x66, 0xf7, 0x5b, 0x25, 0x73, 0x46, 0xe8, 0x0b, 0x8a, 0x4f, 0x69, 0x0c, \ - 0xb5, 0x00, 0x90, 0xe1, 0xda, 0x82, 0x10, 0x66, 0x7d, 0xae, 0x54, 0x2b, \ - 0x8b, 0x65, 0x79, 0x91, 0xa1, 0xe2, 0x61, 0xc3, 0xcd, 0x40, 0x49, 0x08, \ - 0xee, 0x68, 0x0c, 0xf1, 0x8b, 0x86, 0xd2, 0x46, 0xbf, 0xd0, 0xb8, 0xaa, \ - 0x11, 0x03, 0x1e, 0x7f, 0x56, 0xa8, 0x1a, 0x1e, 0x44, 0x18, 0x0f, 0x0f, \ - 0x85, 0x8b, 0xda, 0x8b, 0x44, 0x5e, 0xe2, 0x18, 0xc6, 0x62, 0x2f, 0xc7, \ - 0x66, 0x8d, 0xfa, 0x5d, 0xd8, 0x7d, 0xf3, 0x27, 0x89, 0x29, 0x01, 0xc5, \ - 0x90, 0x0e, 0x3f, 0x27, 0xf1, 0x30, 0xc8, 0x4a, 0x0e, 0xef, 0xd6, 0xde, \ - 0xc7, 0xc7, 0x27, 0x6b, 0xc7, 0x05, 0x3d, 0x7a, 0xc4, 0x02, 0x3c, 0x9a, \ - 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, 0xcb, 0x73, 0x4b, 0x52, 0x96, \ - 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, 0x39, 0x5a, 0xd3, 0x0f, 0xb0, \ - 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, 0x12, 0x01, 0x30, 0x97, 0x02, \ - 0x03, 0x01, 0x00, 0x01, 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, \ - 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa5, 0x05, 0xe8, 0x64, 0xb8, 0xdc, \ - 0xdf, 0x60, 0x0f, 0x50, 0x12, 0x4d, 0x60, 0xa8, 0x64, 0xaf, 0x4d, 0x8b, \ - 0x43, 0x93, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, \ - 0x16, 0x80, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, \ - 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, \ - 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, \ - 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x01, 0x73, 0x0b, 0x4a, 0xc5, \ - 0xcb, 0xa0, 0xde, 0xf1, 0x63, 0x1c, 0x76, 0x04, 0x2b, 0x13, 0x0d, 0xc0, \ - 0x84, 0x11, 0xc5, 0x8f, 0x3a, 0xa7, 0xc5, 0x9c, 0x35, 0x7a, 0x77, 0xb8, \ - 0x20, 0x14, 0x82, 0xee, 0x54, 0xf0, 0xf2, 0xb0, 0x52, 0xcb, 0x78, 0xce, \ - 0x59, 0x07, 0x4f, 0x51, 0x69, 0xfe, 0xd3, 0x2f, 0xe9, 0x09, 0xe7, 0x85, \ - 0x92, 0xd8, 0xba, 0xb1, 0xeb, 0xc5, 0x76, 0x5d, 0x61, 0x2d, 0xe9, 0x86, \ - 0xb5, 0xde, 0x2a, 0xf9, 0x3f, 0x53, 0x28, 0x42, 0x86, 0x83, 0x73, 0x43, \ - 0xe0, 0x04, 0x5f, 0x07, 0x90, 0x14, 0x65, 0x9f, 0x6e, 0x10, 0x7a, 0xbc, \ - 0x58, 0x19, 0x22, 0xc2, 0xeb, 0x39, 0x72, 0x51, 0x92, 0xd7, 0xb4, 0x1d, \ - 0x75, 0x2f, 0xd3, 0x3a, 0x2b, 0x01, 0xe7, 0xdb, 0x50, 0xae, 0xe2, 0xf1, \ - 0xd4, 0x4d, 0x5b, 0x3c, 0xbb, 0x41, 0x2b, 0x2a, 0xa4, 0xe2, 0x4a, 0x02, \ - 0xe5, 0x60, 0x14, 0x2c, 0x9c, 0x1f, 0xa6, 0xcc, 0x06, 0x4b, 0x25, 0x89, \ - 0x4e, 0x96, 0x30, 0x22, 0x9c, 0x5c, 0x58, 0x4d, 0xc3, 0xda, 0xd0, 0x6e, \ - 0x50, 0x1e, 0x8c, 0x65, 0xf5, 0xd9, 0x17, 0x35, 0xa6, 0x58, 0x43, 0xb2, \ - 0x29, 0xb7, 0xa8, 0x5e, 0x35, 0xde, 0xf0, 0x60, 0x42, 0x1a, 0x01, 0xcb, \ - 0xcb, 0x0b, 0xd8, 0x0e, 0xc1, 0x90, 0xdf, 0xa1, 0xd2, 0x1a, 0xd1, 0x2c, \ - 0x02, 0xf4, 0x76, 0x41, 0xa4, 0xcb, 0x4b, 0x15, 0x98, 0x71, 0xf9, 0x35, \ - 0x7d, 0xb0, 0xe7, 0xe2, 0x34, 0x96, 0x91, 0xbe, 0x32, 0x67, 0x2d, 0x6b, \ - 0xd3, 0x55, 0x04, 0x8a, 0x01, 0x50, 0xb4, 0xe3, 0x62, 0x78, 0x6c, 0x11, \ - 0x15, 0xa5, 0x2a, 0x11, 0xc1, 0x49, 0x1c, 0x9b, 0xc4, 0x10, 0x65, 0x60, \ - 0x87, 0xd9, 0x1e, 0x69, 0x59, 0x4e, 0x8f, 0x6b, 0xeb, 0xc1, 0xfe, 0x6b, \ - 0xe2, 0x63, 0x78, 0x95, 0x6e, 0xe0, 0x2d, 0xd7, 0xa7, 0x37, 0xa8 \ + 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ + 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x82, \ + 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \ + 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, \ + 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, \ + 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, \ + 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, \ + 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, \ + 0xef, 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, 0xfc, 0xb6, 0x34, 0xac, 0x24, \ + 0xf5, 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, 0xb0, 0x28, 0x7d, 0xa1, 0xda, \ + 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, 0xfe, 0xc1, 0x04, 0x52, 0xb3, \ + 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, 0xd8, 0x90, 0xc1, 0x61, 0xb4, \ + 0x66, 0x52, 0x36, 0xa2, 0x26, 0x53, 0xaa, 0xab, 0x74, 0x5e, 0x07, 0x7d, \ + 0x19, 0x82, 0xdb, 0x2a, 0xd8, 0x1f, 0xa0, 0xd9, 0x0d, 0x1c, 0x2d, 0x49, \ + 0x66, 0xf7, 0x5b, 0x25, 0x73, 0x46, 0xe8, 0x0b, 0x8a, 0x4f, 0x69, 0x0c, \ + 0xb5, 0x00, 0x90, 0xe1, 0xda, 0x82, 0x10, 0x66, 0x7d, 0xae, 0x54, 0x2b, \ + 0x8b, 0x65, 0x79, 0x91, 0xa1, 0xe2, 0x61, 0xc3, 0xcd, 0x40, 0x49, 0x08, \ + 0xee, 0x68, 0x0c, 0xf1, 0x8b, 0x86, 0xd2, 0x46, 0xbf, 0xd0, 0xb8, 0xaa, \ + 0x11, 0x03, 0x1e, 0x7f, 0x56, 0xa8, 0x1a, 0x1e, 0x44, 0x18, 0x0f, 0x0f, \ + 0x85, 0x8b, 0xda, 0x8b, 0x44, 0x5e, 0xe2, 0x18, 0xc6, 0x62, 0x2f, 0xc7, \ + 0x66, 0x8d, 0xfa, 0x5d, 0xd8, 0x7d, 0xf3, 0x27, 0x89, 0x29, 0x01, 0xc5, \ + 0x90, 0x0e, 0x3f, 0x27, 0xf1, 0x30, 0xc8, 0x4a, 0x0e, 0xef, 0xd6, 0xde, \ + 0xc7, 0xc7, 0x27, 0x6b, 0xc7, 0x05, 0x3d, 0x7a, 0xc4, 0x02, 0x3c, 0x9a, \ + 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, 0xcb, 0x73, 0x4b, 0x52, 0x96, \ + 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, 0x39, 0x5a, 0xd3, 0x0f, 0xb0, \ + 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, 0x12, 0x01, 0x30, 0x97, 0x02, \ + 0x03, 0x01, 0x00, 0x01, 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, \ + 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa5, 0x05, 0xe8, 0x64, 0xb8, 0xdc, \ + 0xdf, 0x60, 0x0f, 0x50, 0x12, 0x4d, 0x60, 0xa8, 0x64, 0xaf, 0x4d, 0x8b, \ + 0x43, 0x93, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, \ + 0x16, 0x80, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, \ + 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, \ + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, \ + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x99, 0x25, 0x83, 0x74, 0x38, \ + 0x70, 0x1e, 0xef, 0xec, 0x1c, 0xec, 0xc4, 0xcf, 0xef, 0x2f, 0x22, 0x9c, \ + 0x70, 0xee, 0xa8, 0xa7, 0x4f, 0xe0, 0x67, 0x33, 0x38, 0x82, 0x1b, 0x8b, \ + 0xab, 0x66, 0x37, 0xda, 0x49, 0x74, 0xb0, 0xce, 0xa4, 0x48, 0xd5, 0x14, \ + 0x99, 0xdb, 0xae, 0xab, 0x7b, 0xbf, 0xf8, 0x69, 0x94, 0x64, 0xdd, 0x80, \ + 0x3b, 0xfe, 0xdc, 0xf8, 0x7c, 0x3b, 0x84, 0x31, 0x44, 0x22, 0xf6, 0x64, \ + 0xf7, 0xc6, 0x81, 0x1a, 0x30, 0x8b, 0xaa, 0x7d, 0xc3, 0x9a, 0x01, 0xc8, \ + 0xbf, 0xc4, 0xe8, 0x43, 0xae, 0xe7, 0x7a, 0x59, 0x50, 0xc7, 0x1d, 0x94, \ + 0x8f, 0x7d, 0x3d, 0x3d, 0xd8, 0x23, 0x36, 0x2f, 0xeb, 0xf4, 0x73, 0x9c, \ + 0x28, 0xd0, 0x18, 0x3d, 0xb0, 0x5c, 0x83, 0xa3, 0x09, 0x19, 0x65, 0xa3, \ + 0xd9, 0x32, 0x3a, 0xbc, 0xd6, 0x9c, 0x7a, 0x2a, 0x2c, 0xfc, 0x38, 0x4e, \ + 0x63, 0x1e, 0x55, 0xd2, 0x3e, 0x67, 0x7e, 0xa4, 0x89, 0xfe, 0x99, 0xd4, \ + 0xd2, 0x0f, 0x48, 0x82, 0x7d, 0x8b, 0x02, 0x18, 0x18, 0xa4, 0x62, 0x44, \ + 0x88, 0x43, 0x3d, 0xc1, 0x6e, 0xe1, 0x10, 0xc9, 0x30, 0x9a, 0x4d, 0x21, \ + 0xfe, 0xca, 0x99, 0xb2, 0xb2, 0x6c, 0x18, 0x7e, 0x58, 0xb0, 0x5f, 0xd5, \ + 0x4e, 0x14, 0xaa, 0xfc, 0x95, 0x4e, 0xd5, 0xed, 0xa6, 0x64, 0x7d, 0xaf, \ + 0xae, 0xec, 0x99, 0x28, 0x95, 0x41, 0xab, 0xef, 0x2d, 0x0c, 0xd6, 0x29, \ + 0x1e, 0x42, 0xba, 0xb5, 0x2c, 0x95, 0x61, 0x08, 0x73, 0x22, 0xdd, 0xd2, \ + 0xb4, 0xc2, 0x56, 0x28, 0xc9, 0x7f, 0xa3, 0x99, 0x36, 0x01, 0x8c, 0xfa, \ + 0xb5, 0x20, 0xb5, 0xeb, 0x8f, 0xb5, 0xa0, 0x6f, 0x8c, 0x2f, 0x72, 0xd6, \ + 0x83, 0xc5, 0xeb, 0x18, 0xa6, 0xbd, 0xd4, 0x7e, 0x14, 0x38, 0xa6, 0xa9, \ + 0x03, 0x08, 0x24, 0xd3, 0xee, 0x26, 0xd1, 0x3d, 0xb9, 0x70, 0xdb \ } /* END FILE */ @@ -966,71 +958,64 @@ /* BEGIN FILE string macro TEST_CLI_CRT_EC_PEM tests/data_files/cli2.crt */ #define TEST_CLI_CRT_EC_PEM \ "-----BEGIN CERTIFICATE-----\r\n" \ - "MIICLDCCAbKgAwIBAgIBDTAKBggqhkjOPQQDAjA+MQswCQYDVQQGEwJOTDERMA8G\r\n" \ - "A1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0EwHhcN\r\n" \ - "MTMwOTI0MTU1MjA0WhcNMjMwOTIyMTU1MjA0WjBBMQswCQYDVQQGEwJOTDERMA8G\r\n" \ - "A1UEChMIUG9sYXJTU0wxHzAdBgNVBAMTFlBvbGFyU1NMIFRlc3QgQ2xpZW50IDIw\r\n" \ - "WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARX5a6xc9/TrLuTuIH/Eq7u5lOszlVT\r\n" \ - "9jQOzC7jYyUL35ji81xgNpbA1RgUcOV/n9VLRRjlsGzVXPiWj4dwo+THo4GdMIGa\r\n" \ - "MAkGA1UdEwQCMAAwHQYDVR0OBBYEFHoAX4Zk/OBd5REQO7LmO8QmP8/iMG4GA1Ud\r\n" \ - "IwRnMGWAFJ1tICRJAT8ry3i1Gbx+JMnb+zZ8oUKkQDA+MQswCQYDVQQGEwJOTDER\r\n" \ - "MA8GA1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0GC\r\n" \ - "CQDBQ+J+YkPM6DAKBggqhkjOPQQDAgNoADBlAjBKZQ17IIOimbmoD/yN7o89u3BM\r\n" \ - "lgOsjnhw3fIOoLIWy2WOGsk/LGF++DzvrRzuNiACMQCd8iem1XS4JK7haj8xocpU\r\n" \ - "LwjQje5PDGHfd3h9tP38Qknu5bJqws0md2KOKHyeV0U=\r\n" \ + "MIIB3zCCAWOgAwIBAgIBDTAMBggqhkjOPQQDAgUAMD4xCzAJBgNVBAYTAk5MMREw\r\n" \ + "DwYDVQQKDAhQb2xhclNTTDEcMBoGA1UEAwwTUG9sYXJTU0wgVGVzdCBFQyBDQTAe\r\n" \ + "Fw0xOTAyMTAxNDQ0MDBaFw0yOTAyMTAxNDQ0MDBaMEExCzAJBgNVBAYTAk5MMREw\r\n" \ + "DwYDVQQKDAhQb2xhclNTTDEfMB0GA1UEAwwWUG9sYXJTU0wgVGVzdCBDbGllbnQg\r\n" \ + "MjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFflrrFz39Osu5O4gf8Sru7mU6zO\r\n" \ + "VVP2NA7MLuNjJQvfmOLzXGA2lsDVGBRw5X+f1UtFGOWwbNVc+JaPh3Cj5MejTTBL\r\n" \ + "MAkGA1UdEwQCMAAwHQYDVR0OBBYEFHoAX4Zk/OBd5REQO7LmO8QmP8/iMB8GA1Ud\r\n" \ + "IwQYMBaAFJ1tICRJAT8ry3i1Gbx+JMnb+zZ8MAwGCCqGSM49BAMCBQADaAAwZQIx\r\n" \ + "AMqme4DKMldUlplDET9Q6Eptre7uUWKhsLOF+zPkKDlfzpIkJYEFgcloDHGYw80u\r\n" \ + "IgIwNftyPXsabTqMM7iEHgVpX/GRozKklY9yQI/5eoA6gGW7Y+imuGR/oao5ySOb\r\n" \ + "a9Vk\r\n" \ "-----END CERTIFICATE-----\r\n" /* END FILE */ /* This is generated from tests/data_files/cli2.crt.der using `xxd -i`. */ /* BEGIN FILE binary macro TEST_CLI_CRT_EC_DER tests/data_files/cli2.crt.der */ #define TEST_CLI_CRT_EC_DER { \ - 0x30, 0x82, 0x02, 0x2c, 0x30, 0x82, 0x01, 0xb2, 0xa0, 0x03, 0x02, 0x01, \ - 0x02, 0x02, 0x01, 0x0d, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \ - 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ - 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ - 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, \ - 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, \ - 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ - 0x31, 0x33, 0x30, 0x39, 0x32, 0x34, 0x31, 0x35, 0x35, 0x32, 0x30, 0x34, \ - 0x5a, 0x17, 0x0d, 0x32, 0x33, 0x30, 0x39, 0x32, 0x32, 0x31, 0x35, 0x35, \ - 0x32, 0x30, 0x34, 0x5a, 0x30, 0x41, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ - 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ - 0x53, 0x4c, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, \ - 0x16, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \ - 0x73, 0x74, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x32, 0x30, \ - 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, \ - 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, \ - 0x00, 0x04, 0x57, 0xe5, 0xae, 0xb1, 0x73, 0xdf, 0xd3, 0xac, 0xbb, 0x93, \ - 0xb8, 0x81, 0xff, 0x12, 0xae, 0xee, 0xe6, 0x53, 0xac, 0xce, 0x55, 0x53, \ - 0xf6, 0x34, 0x0e, 0xcc, 0x2e, 0xe3, 0x63, 0x25, 0x0b, 0xdf, 0x98, 0xe2, \ - 0xf3, 0x5c, 0x60, 0x36, 0x96, 0xc0, 0xd5, 0x18, 0x14, 0x70, 0xe5, 0x7f, \ - 0x9f, 0xd5, 0x4b, 0x45, 0x18, 0xe5, 0xb0, 0x6c, 0xd5, 0x5c, 0xf8, 0x96, \ - 0x8f, 0x87, 0x70, 0xa3, 0xe4, 0xc7, 0xa3, 0x81, 0x9d, 0x30, 0x81, 0x9a, \ - 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, \ - 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x7a, 0x00, \ - 0x5f, 0x86, 0x64, 0xfc, 0xe0, 0x5d, 0xe5, 0x11, 0x10, 0x3b, 0xb2, 0xe6, \ - 0x3b, 0xc4, 0x26, 0x3f, 0xcf, 0xe2, 0x30, 0x6e, 0x06, 0x03, 0x55, 0x1d, \ - 0x23, 0x04, 0x67, 0x30, 0x65, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, \ - 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, \ - 0xfb, 0x36, 0x7c, 0xa1, 0x42, 0xa4, 0x40, 0x30, 0x3e, 0x31, 0x0b, 0x30, \ - 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ - 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, \ - 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, \ - 0x04, 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, \ - 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x82, \ - 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, 0x30, 0x0a, \ - 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x68, \ - 0x00, 0x30, 0x65, 0x02, 0x30, 0x4a, 0x65, 0x0d, 0x7b, 0x20, 0x83, 0xa2, \ - 0x99, 0xb9, 0xa8, 0x0f, 0xfc, 0x8d, 0xee, 0x8f, 0x3d, 0xbb, 0x70, 0x4c, \ - 0x96, 0x03, 0xac, 0x8e, 0x78, 0x70, 0xdd, 0xf2, 0x0e, 0xa0, 0xb2, 0x16, \ - 0xcb, 0x65, 0x8e, 0x1a, 0xc9, 0x3f, 0x2c, 0x61, 0x7e, 0xf8, 0x3c, 0xef, \ - 0xad, 0x1c, 0xee, 0x36, 0x20, 0x02, 0x31, 0x00, 0x9d, 0xf2, 0x27, 0xa6, \ - 0xd5, 0x74, 0xb8, 0x24, 0xae, 0xe1, 0x6a, 0x3f, 0x31, 0xa1, 0xca, 0x54, \ - 0x2f, 0x08, 0xd0, 0x8d, 0xee, 0x4f, 0x0c, 0x61, 0xdf, 0x77, 0x78, 0x7d, \ - 0xb4, 0xfd, 0xfc, 0x42, 0x49, 0xee, 0xe5, 0xb2, 0x6a, 0xc2, 0xcd, 0x26, \ - 0x77, 0x62, 0x8e, 0x28, 0x7c, 0x9e, 0x57, 0x45 \ + 0x30, 0x82, 0x01, 0xdf, 0x30, 0x82, 0x01, 0x63, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x0d, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \ + 0x3d, 0x04, 0x03, 0x02, 0x05, 0x00, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, \ + 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, \ + 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, \ + 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, \ + 0x03, 0x0c, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, \ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, \ + 0x17, 0x0d, 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, \ + 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, \ + 0x34, 0x34, 0x34, 0x30, 0x30, 0x5a, 0x30, 0x41, 0x31, 0x0b, 0x30, 0x09, \ + 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, \ + 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, \ + 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, \ + 0x03, 0x0c, 0x16, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, \ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, \ + 0x32, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, \ + 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, \ + 0x03, 0x42, 0x00, 0x04, 0x57, 0xe5, 0xae, 0xb1, 0x73, 0xdf, 0xd3, 0xac, \ + 0xbb, 0x93, 0xb8, 0x81, 0xff, 0x12, 0xae, 0xee, 0xe6, 0x53, 0xac, 0xce, \ + 0x55, 0x53, 0xf6, 0x34, 0x0e, 0xcc, 0x2e, 0xe3, 0x63, 0x25, 0x0b, 0xdf, \ + 0x98, 0xe2, 0xf3, 0x5c, 0x60, 0x36, 0x96, 0xc0, 0xd5, 0x18, 0x14, 0x70, \ + 0xe5, 0x7f, 0x9f, 0xd5, 0x4b, 0x45, 0x18, 0xe5, 0xb0, 0x6c, 0xd5, 0x5c, \ + 0xf8, 0x96, 0x8f, 0x87, 0x70, 0xa3, 0xe4, 0xc7, 0xa3, 0x4d, 0x30, 0x4b, \ + 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, \ + 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x7a, 0x00, \ + 0x5f, 0x86, 0x64, 0xfc, 0xe0, 0x5d, 0xe5, 0x11, 0x10, 0x3b, 0xb2, 0xe6, \ + 0x3b, 0xc4, 0x26, 0x3f, 0xcf, 0xe2, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, \ + 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, \ + 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, \ + 0xfb, 0x36, 0x7c, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, \ + 0x04, 0x03, 0x02, 0x05, 0x00, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x31, \ + 0x00, 0xca, 0xa6, 0x7b, 0x80, 0xca, 0x32, 0x57, 0x54, 0x96, 0x99, 0x43, \ + 0x11, 0x3f, 0x50, 0xe8, 0x4a, 0x6d, 0xad, 0xee, 0xee, 0x51, 0x62, 0xa1, \ + 0xb0, 0xb3, 0x85, 0xfb, 0x33, 0xe4, 0x28, 0x39, 0x5f, 0xce, 0x92, 0x24, \ + 0x25, 0x81, 0x05, 0x81, 0xc9, 0x68, 0x0c, 0x71, 0x98, 0xc3, 0xcd, 0x2e, \ + 0x22, 0x02, 0x30, 0x35, 0xfb, 0x72, 0x3d, 0x7b, 0x1a, 0x6d, 0x3a, 0x8c, \ + 0x33, 0xb8, 0x84, 0x1e, 0x05, 0x69, 0x5f, 0xf1, 0x91, 0xa3, 0x32, 0xa4, \ + 0x95, 0x8f, 0x72, 0x40, 0x8f, 0xf9, 0x7a, 0x80, 0x3a, 0x80, 0x65, 0xbb, \ + 0x63, 0xe8, 0xa6, 0xb8, 0x64, 0x7f, 0xa1, 0xaa, 0x39, 0xc9, 0x23, 0x9b, \ + 0x6b, 0xd5, 0x64 \ } /* END FILE */ @@ -1067,7 +1052,7 @@ "-----BEGIN CERTIFICATE-----\r\n" \ "MIIDPzCCAiegAwIBAgIBBDANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ - "MTEwMjEyMTQ0NDA2WhcNMjEwMjEyMTQ0NDA2WjA8MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "MTkwMjEwMTQ0NDA2WhcNMjkwMjEwMTQ0NDA2WjA8MQswCQYDVQQGEwJOTDERMA8G\r\n" \ "A1UECgwIUG9sYXJTU0wxGjAYBgNVBAMMEVBvbGFyU1NMIENsaWVudCAyMIIBIjAN\r\n" \ "BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyHTEzLn5tXnpRdkUYLB9u5Pyax6f\r\n" \ "M60Nj4o8VmXl3ETZzGaFB9X4J7BKNdBjngpuG7fa8H6r7gwQk4ZJGDTzqCrSV/Uu\r\n" \ @@ -1077,12 +1062,12 @@ "/DZrtenNLQNiTrM9AM+vdqBpVoNq0qjU51Bx5rU2BXcFbXvI5MT9TNUhXwIDAQAB\r\n" \ "o00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBRxoQBzckAvVHZeM/xSj7zx3WtGITAf\r\n" \ "BgNVHSMEGDAWgBS0WuSls97SUva51aaVD+s+vMf9/zANBgkqhkiG9w0BAQsFAAOC\r\n" \ - "AQEAlHabem2Tu69VUN7EipwnQn1dIHdgvT5i+iQHpSxY1crPnBbAeSdAXwsVEqLQ\r\n" \ - "gOOIAQD5VIITNuoGgo4i+4OpNh9u7ZkpRHla+/swsfrFWRRbBNP5Bcu74AGLstwU\r\n" \ - "zM8gIkBiyfM1Q1qDQISV9trlCG6O8vh8dp/rbI3rfzo99BOHXgFCrzXjCuW4vDsF\r\n" \ - "r+Dao26bX3sJ6UnEWg1H3o2x6PpUcvQ36h71/bz4TEbbUUEpe02V4QWuL+wrhHJL\r\n" \ - "U7o3SVE3Og7jPF8sat0a50YUWhwEFI256m02KAXLg89ueUyYKEr6rNwhcvXJpvU9\r\n" \ - "giIVvd0Sbjjnn7NC4VDbcXV8vw==\r\n" \ + "AQEAXidv1d4pLlBiKWED95rMycBdgDcgyNqJxakFkRfRyA2y1mlyTn7uBXRkNLY5\r\n" \ + "ZFzK82GCjk2Q2OD4RZSCPAJJqLpHHU34t71ciffvy2KK81YvrxczRhMAE64i+qna\r\n" \ + "yP3Td2XuWJR05PVPoSemsNELs9gWttdnYy3ce+EY2Y0n7Rsi7982EeLIAA7H6ca4\r\n" \ + "2Es/NUH//JZJT32OP0doMxeDRA+vplkKqTLLWf7dX26LIriBkBaRCgR5Yv9LBPFc\r\n" \ + "NOtpzu/LbrY7QFXKJMI+JXDudCsOn8KCmiA4d6Emisqfh3V3485l7HEQNcvLTxlD\r\n" \ + "6zDQyi0/ykYUYZkwQTK1N2Nvlw==\r\n" \ "-----END CERTIFICATE-----\r\n" /* END FILE */ @@ -1090,76 +1075,76 @@ using `xxd -i.` */ /* BEGIN FILE binary macro TEST_CLI_CRT_RSA_DER tests/data_files/cli-rsa-sha256.crt.der */ #define TEST_CLI_CRT_RSA_DER { \ - 0x30, 0x82, 0x03, 0x3f, 0x30, 0x82, 0x02, 0x27, 0xa0, 0x03, 0x02, 0x01, \ - 0x02, 0x02, 0x01, 0x04, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ - 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ - 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ - 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ - 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ - 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ - 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ - 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ - 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ - 0x34, 0x30, 0x36, 0x5a, 0x30, 0x3c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ - 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ - 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ - 0x53, 0x4c, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ - 0x11, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x43, 0x6c, \ - 0x69, 0x65, 0x6e, 0x74, 0x20, 0x32, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, \ - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, \ - 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, \ - 0x01, 0x01, 0x00, 0xc8, 0x74, 0xc4, 0xcc, 0xb9, 0xf9, 0xb5, 0x79, 0xe9, \ - 0x45, 0xd9, 0x14, 0x60, 0xb0, 0x7d, 0xbb, 0x93, 0xf2, 0x6b, 0x1e, 0x9f, \ - 0x33, 0xad, 0x0d, 0x8f, 0x8a, 0x3c, 0x56, 0x65, 0xe5, 0xdc, 0x44, 0xd9, \ - 0xcc, 0x66, 0x85, 0x07, 0xd5, 0xf8, 0x27, 0xb0, 0x4a, 0x35, 0xd0, 0x63, \ - 0x9e, 0x0a, 0x6e, 0x1b, 0xb7, 0xda, 0xf0, 0x7e, 0xab, 0xee, 0x0c, 0x10, \ - 0x93, 0x86, 0x49, 0x18, 0x34, 0xf3, 0xa8, 0x2a, 0xd2, 0x57, 0xf5, 0x2e, \ - 0xd4, 0x2f, 0x77, 0x29, 0x84, 0x61, 0x4d, 0x82, 0x50, 0x8f, 0xa7, 0x95, \ - 0x48, 0x70, 0xf5, 0x6e, 0x4d, 0xb2, 0xd5, 0x13, 0xc3, 0xd2, 0x1a, 0xed, \ - 0xe6, 0x43, 0xea, 0x42, 0x14, 0xeb, 0x74, 0xea, 0xc0, 0xed, 0x1f, 0xd4, \ - 0x57, 0x4e, 0xa9, 0xf3, 0xa8, 0xed, 0xd2, 0xe0, 0xc1, 0x30, 0x71, 0x30, \ - 0x32, 0x30, 0xd5, 0xd3, 0xf6, 0x08, 0xd0, 0x56, 0x4f, 0x46, 0x8e, 0xf2, \ - 0x5f, 0xf9, 0x3d, 0x67, 0x91, 0x88, 0x30, 0x2e, 0x42, 0xb2, 0xdf, 0x7d, \ - 0xfb, 0xe5, 0x0c, 0x77, 0xff, 0xec, 0x31, 0xc0, 0x78, 0x8f, 0xbf, 0xc2, \ - 0x7f, 0xca, 0xad, 0x6c, 0x21, 0xd6, 0x8d, 0xd9, 0x8b, 0x6a, 0x8e, 0x6f, \ - 0xe0, 0x9b, 0xf8, 0x10, 0x56, 0xcc, 0xb3, 0x8e, 0x13, 0x15, 0xe6, 0x34, \ - 0x04, 0x66, 0xc7, 0xee, 0xf9, 0x36, 0x0e, 0x6a, 0x95, 0xf6, 0x09, 0x9a, \ - 0x06, 0x67, 0xf4, 0x65, 0x71, 0xf8, 0xca, 0xa4, 0xb1, 0x25, 0xe0, 0xfe, \ - 0x3c, 0x8b, 0x35, 0x04, 0x67, 0xba, 0xe0, 0x4f, 0x76, 0x85, 0xfc, 0x7f, \ - 0xfc, 0x36, 0x6b, 0xb5, 0xe9, 0xcd, 0x2d, 0x03, 0x62, 0x4e, 0xb3, 0x3d, \ - 0x00, 0xcf, 0xaf, 0x76, 0xa0, 0x69, 0x56, 0x83, 0x6a, 0xd2, 0xa8, 0xd4, \ - 0xe7, 0x50, 0x71, 0xe6, 0xb5, 0x36, 0x05, 0x77, 0x05, 0x6d, 0x7b, 0xc8, \ - 0xe4, 0xc4, 0xfd, 0x4c, 0xd5, 0x21, 0x5f, 0x02, 0x03, 0x01, 0x00, 0x01, \ - 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, \ - 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, \ - 0x04, 0x14, 0x71, 0xa1, 0x00, 0x73, 0x72, 0x40, 0x2f, 0x54, 0x76, 0x5e, \ - 0x33, 0xfc, 0x52, 0x8f, 0xbc, 0xf1, 0xdd, 0x6b, 0x46, 0x21, 0x30, 0x1f, \ - 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xb4, \ - 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, 0xa6, 0x95, \ - 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, 0x09, 0x2a, \ - 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, \ - 0x01, 0x01, 0x00, 0x94, 0x76, 0x9b, 0x7a, 0x6d, 0x93, 0xbb, 0xaf, 0x55, \ - 0x50, 0xde, 0xc4, 0x8a, 0x9c, 0x27, 0x42, 0x7d, 0x5d, 0x20, 0x77, 0x60, \ - 0xbd, 0x3e, 0x62, 0xfa, 0x24, 0x07, 0xa5, 0x2c, 0x58, 0xd5, 0xca, 0xcf, \ - 0x9c, 0x16, 0xc0, 0x79, 0x27, 0x40, 0x5f, 0x0b, 0x15, 0x12, 0xa2, 0xd0, \ - 0x80, 0xe3, 0x88, 0x01, 0x00, 0xf9, 0x54, 0x82, 0x13, 0x36, 0xea, 0x06, \ - 0x82, 0x8e, 0x22, 0xfb, 0x83, 0xa9, 0x36, 0x1f, 0x6e, 0xed, 0x99, 0x29, \ - 0x44, 0x79, 0x5a, 0xfb, 0xfb, 0x30, 0xb1, 0xfa, 0xc5, 0x59, 0x14, 0x5b, \ - 0x04, 0xd3, 0xf9, 0x05, 0xcb, 0xbb, 0xe0, 0x01, 0x8b, 0xb2, 0xdc, 0x14, \ - 0xcc, 0xcf, 0x20, 0x22, 0x40, 0x62, 0xc9, 0xf3, 0x35, 0x43, 0x5a, 0x83, \ - 0x40, 0x84, 0x95, 0xf6, 0xda, 0xe5, 0x08, 0x6e, 0x8e, 0xf2, 0xf8, 0x7c, \ - 0x76, 0x9f, 0xeb, 0x6c, 0x8d, 0xeb, 0x7f, 0x3a, 0x3d, 0xf4, 0x13, 0x87, \ - 0x5e, 0x01, 0x42, 0xaf, 0x35, 0xe3, 0x0a, 0xe5, 0xb8, 0xbc, 0x3b, 0x05, \ - 0xaf, 0xe0, 0xda, 0xa3, 0x6e, 0x9b, 0x5f, 0x7b, 0x09, 0xe9, 0x49, 0xc4, \ - 0x5a, 0x0d, 0x47, 0xde, 0x8d, 0xb1, 0xe8, 0xfa, 0x54, 0x72, 0xf4, 0x37, \ - 0xea, 0x1e, 0xf5, 0xfd, 0xbc, 0xf8, 0x4c, 0x46, 0xdb, 0x51, 0x41, 0x29, \ - 0x7b, 0x4d, 0x95, 0xe1, 0x05, 0xae, 0x2f, 0xec, 0x2b, 0x84, 0x72, 0x4b, \ - 0x53, 0xba, 0x37, 0x49, 0x51, 0x37, 0x3a, 0x0e, 0xe3, 0x3c, 0x5f, 0x2c, \ - 0x6a, 0xdd, 0x1a, 0xe7, 0x46, 0x14, 0x5a, 0x1c, 0x04, 0x14, 0x8d, 0xb9, \ - 0xea, 0x6d, 0x36, 0x28, 0x05, 0xcb, 0x83, 0xcf, 0x6e, 0x79, 0x4c, 0x98, \ - 0x28, 0x4a, 0xfa, 0xac, 0xdc, 0x21, 0x72, 0xf5, 0xc9, 0xa6, 0xf5, 0x3d, \ - 0x82, 0x22, 0x15, 0xbd, 0xdd, 0x12, 0x6e, 0x38, 0xe7, 0x9f, 0xb3, 0x42, \ - 0xe1, 0x50, 0xdb, 0x71, 0x75, 0x7c, 0xbf \ + 0x30, 0x82, 0x03, 0x3f, 0x30, 0x82, 0x02, 0x27, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x04, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ + 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x36, 0x5a, 0x30, 0x3c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x11, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x43, 0x6c, \ + 0x69, 0x65, 0x6e, 0x74, 0x20, 0x32, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, \ + 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, \ + 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, \ + 0x01, 0x01, 0x00, 0xc8, 0x74, 0xc4, 0xcc, 0xb9, 0xf9, 0xb5, 0x79, 0xe9, \ + 0x45, 0xd9, 0x14, 0x60, 0xb0, 0x7d, 0xbb, 0x93, 0xf2, 0x6b, 0x1e, 0x9f, \ + 0x33, 0xad, 0x0d, 0x8f, 0x8a, 0x3c, 0x56, 0x65, 0xe5, 0xdc, 0x44, 0xd9, \ + 0xcc, 0x66, 0x85, 0x07, 0xd5, 0xf8, 0x27, 0xb0, 0x4a, 0x35, 0xd0, 0x63, \ + 0x9e, 0x0a, 0x6e, 0x1b, 0xb7, 0xda, 0xf0, 0x7e, 0xab, 0xee, 0x0c, 0x10, \ + 0x93, 0x86, 0x49, 0x18, 0x34, 0xf3, 0xa8, 0x2a, 0xd2, 0x57, 0xf5, 0x2e, \ + 0xd4, 0x2f, 0x77, 0x29, 0x84, 0x61, 0x4d, 0x82, 0x50, 0x8f, 0xa7, 0x95, \ + 0x48, 0x70, 0xf5, 0x6e, 0x4d, 0xb2, 0xd5, 0x13, 0xc3, 0xd2, 0x1a, 0xed, \ + 0xe6, 0x43, 0xea, 0x42, 0x14, 0xeb, 0x74, 0xea, 0xc0, 0xed, 0x1f, 0xd4, \ + 0x57, 0x4e, 0xa9, 0xf3, 0xa8, 0xed, 0xd2, 0xe0, 0xc1, 0x30, 0x71, 0x30, \ + 0x32, 0x30, 0xd5, 0xd3, 0xf6, 0x08, 0xd0, 0x56, 0x4f, 0x46, 0x8e, 0xf2, \ + 0x5f, 0xf9, 0x3d, 0x67, 0x91, 0x88, 0x30, 0x2e, 0x42, 0xb2, 0xdf, 0x7d, \ + 0xfb, 0xe5, 0x0c, 0x77, 0xff, 0xec, 0x31, 0xc0, 0x78, 0x8f, 0xbf, 0xc2, \ + 0x7f, 0xca, 0xad, 0x6c, 0x21, 0xd6, 0x8d, 0xd9, 0x8b, 0x6a, 0x8e, 0x6f, \ + 0xe0, 0x9b, 0xf8, 0x10, 0x56, 0xcc, 0xb3, 0x8e, 0x13, 0x15, 0xe6, 0x34, \ + 0x04, 0x66, 0xc7, 0xee, 0xf9, 0x36, 0x0e, 0x6a, 0x95, 0xf6, 0x09, 0x9a, \ + 0x06, 0x67, 0xf4, 0x65, 0x71, 0xf8, 0xca, 0xa4, 0xb1, 0x25, 0xe0, 0xfe, \ + 0x3c, 0x8b, 0x35, 0x04, 0x67, 0xba, 0xe0, 0x4f, 0x76, 0x85, 0xfc, 0x7f, \ + 0xfc, 0x36, 0x6b, 0xb5, 0xe9, 0xcd, 0x2d, 0x03, 0x62, 0x4e, 0xb3, 0x3d, \ + 0x00, 0xcf, 0xaf, 0x76, 0xa0, 0x69, 0x56, 0x83, 0x6a, 0xd2, 0xa8, 0xd4, \ + 0xe7, 0x50, 0x71, 0xe6, 0xb5, 0x36, 0x05, 0x77, 0x05, 0x6d, 0x7b, 0xc8, \ + 0xe4, 0xc4, 0xfd, 0x4c, 0xd5, 0x21, 0x5f, 0x02, 0x03, 0x01, 0x00, 0x01, \ + 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, \ + 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, \ + 0x04, 0x14, 0x71, 0xa1, 0x00, 0x73, 0x72, 0x40, 0x2f, 0x54, 0x76, 0x5e, \ + 0x33, 0xfc, 0x52, 0x8f, 0xbc, 0xf1, 0xdd, 0x6b, 0x46, 0x21, 0x30, 0x1f, \ + 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xb4, \ + 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, 0xa6, 0x95, \ + 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, 0x09, 0x2a, \ + 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, \ + 0x01, 0x01, 0x00, 0x5e, 0x27, 0x6f, 0xd5, 0xde, 0x29, 0x2e, 0x50, 0x62, \ + 0x29, 0x61, 0x03, 0xf7, 0x9a, 0xcc, 0xc9, 0xc0, 0x5d, 0x80, 0x37, 0x20, \ + 0xc8, 0xda, 0x89, 0xc5, 0xa9, 0x05, 0x91, 0x17, 0xd1, 0xc8, 0x0d, 0xb2, \ + 0xd6, 0x69, 0x72, 0x4e, 0x7e, 0xee, 0x05, 0x74, 0x64, 0x34, 0xb6, 0x39, \ + 0x64, 0x5c, 0xca, 0xf3, 0x61, 0x82, 0x8e, 0x4d, 0x90, 0xd8, 0xe0, 0xf8, \ + 0x45, 0x94, 0x82, 0x3c, 0x02, 0x49, 0xa8, 0xba, 0x47, 0x1d, 0x4d, 0xf8, \ + 0xb7, 0xbd, 0x5c, 0x89, 0xf7, 0xef, 0xcb, 0x62, 0x8a, 0xf3, 0x56, 0x2f, \ + 0xaf, 0x17, 0x33, 0x46, 0x13, 0x00, 0x13, 0xae, 0x22, 0xfa, 0xa9, 0xda, \ + 0xc8, 0xfd, 0xd3, 0x77, 0x65, 0xee, 0x58, 0x94, 0x74, 0xe4, 0xf5, 0x4f, \ + 0xa1, 0x27, 0xa6, 0xb0, 0xd1, 0x0b, 0xb3, 0xd8, 0x16, 0xb6, 0xd7, 0x67, \ + 0x63, 0x2d, 0xdc, 0x7b, 0xe1, 0x18, 0xd9, 0x8d, 0x27, 0xed, 0x1b, 0x22, \ + 0xef, 0xdf, 0x36, 0x11, 0xe2, 0xc8, 0x00, 0x0e, 0xc7, 0xe9, 0xc6, 0xb8, \ + 0xd8, 0x4b, 0x3f, 0x35, 0x41, 0xff, 0xfc, 0x96, 0x49, 0x4f, 0x7d, 0x8e, \ + 0x3f, 0x47, 0x68, 0x33, 0x17, 0x83, 0x44, 0x0f, 0xaf, 0xa6, 0x59, 0x0a, \ + 0xa9, 0x32, 0xcb, 0x59, 0xfe, 0xdd, 0x5f, 0x6e, 0x8b, 0x22, 0xb8, 0x81, \ + 0x90, 0x16, 0x91, 0x0a, 0x04, 0x79, 0x62, 0xff, 0x4b, 0x04, 0xf1, 0x5c, \ + 0x34, 0xeb, 0x69, 0xce, 0xef, 0xcb, 0x6e, 0xb6, 0x3b, 0x40, 0x55, 0xca, \ + 0x24, 0xc2, 0x3e, 0x25, 0x70, 0xee, 0x74, 0x2b, 0x0e, 0x9f, 0xc2, 0x82, \ + 0x9a, 0x20, 0x38, 0x77, 0xa1, 0x26, 0x8a, 0xca, 0x9f, 0x87, 0x75, 0x77, \ + 0xe3, 0xce, 0x65, 0xec, 0x71, 0x10, 0x35, 0xcb, 0xcb, 0x4f, 0x19, 0x43, \ + 0xeb, 0x30, 0xd0, 0xca, 0x2d, 0x3f, 0xca, 0x46, 0x14, 0x61, 0x99, 0x30, \ + 0x41, 0x32, 0xb5, 0x37, 0x63, 0x6f, 0x97 \ } /* END FILE */ diff --git a/thirdparty/mbedtls/library/ecdsa.c b/thirdparty/mbedtls/library/ecdsa.c index dc19384d61..2b4800642d 100644 --- a/thirdparty/mbedtls/library/ecdsa.c +++ b/thirdparty/mbedtls/library/ecdsa.c @@ -172,11 +172,11 @@ static void ecdsa_restart_det_free( mbedtls_ecdsa_restart_det_ctx *ctx ) } #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ -#define ECDSA_RS_ECP &rs_ctx->ecp +#define ECDSA_RS_ECP ( rs_ctx == NULL ? NULL : &rs_ctx->ecp ) /* Utility macro for checking and updating ops budget */ #define ECDSA_BUDGET( ops ) \ - MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, &rs_ctx->ecp, ops ) ); + MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, ECDSA_RS_ECP, ops ) ); /* Call this when entering a function that needs its own sub-context */ #define ECDSA_RS_ENTER( SUB ) do { \ @@ -254,6 +254,8 @@ static int ecdsa_sign_restartable( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, const mbedtls_mpi *d, const unsigned char *buf, size_t blen, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, + int (*f_rng_blind)(void *, unsigned char *, size_t), + void *p_rng_blind, mbedtls_ecdsa_restart_ctx *rs_ctx ) { int ret, key_tries, sign_tries; @@ -323,7 +325,9 @@ static int ecdsa_sign_restartable( mbedtls_ecp_group *grp, mul: #endif MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, &R, pk, &grp->G, - f_rng, p_rng, ECDSA_RS_ECP ) ); + f_rng_blind, + p_rng_blind, + ECDSA_RS_ECP ) ); MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( pr, &R.X, &grp->N ) ); } while( mbedtls_mpi_cmp_int( pr, 0 ) == 0 ); @@ -349,7 +353,8 @@ modn: * Generate a random value to blind inv_mod in next step, * avoiding a potential timing leak. */ - MBEDTLS_MPI_CHK( mbedtls_ecp_gen_privkey( grp, &t, f_rng, p_rng ) ); + MBEDTLS_MPI_CHK( mbedtls_ecp_gen_privkey( grp, &t, f_rng_blind, + p_rng_blind ) ); /* * Step 6: compute s = (e + r * d) / k = t (e + rd) / (kt) mod n @@ -392,8 +397,9 @@ int mbedtls_ecdsa_sign( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, ECDSA_VALIDATE_RET( f_rng != NULL ); ECDSA_VALIDATE_RET( buf != NULL || blen == 0 ); + /* Use the same RNG for both blinding and ephemeral key generation */ return( ecdsa_sign_restartable( grp, r, s, d, buf, blen, - f_rng, p_rng, NULL ) ); + f_rng, p_rng, f_rng, p_rng, NULL ) ); } #endif /* !MBEDTLS_ECDSA_SIGN_ALT */ @@ -405,6 +411,8 @@ static int ecdsa_sign_det_restartable( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, const mbedtls_mpi *d, const unsigned char *buf, size_t blen, mbedtls_md_type_t md_alg, + int (*f_rng_blind)(void *, unsigned char *, size_t), + void *p_rng_blind, mbedtls_ecdsa_restart_ctx *rs_ctx ) { int ret; @@ -451,8 +459,70 @@ sign: ret = mbedtls_ecdsa_sign( grp, r, s, d, buf, blen, mbedtls_hmac_drbg_random, p_rng ); #else - ret = ecdsa_sign_restartable( grp, r, s, d, buf, blen, - mbedtls_hmac_drbg_random, p_rng, rs_ctx ); + if( f_rng_blind != NULL ) + ret = ecdsa_sign_restartable( grp, r, s, d, buf, blen, + mbedtls_hmac_drbg_random, p_rng, + f_rng_blind, p_rng_blind, rs_ctx ); + else + { + mbedtls_hmac_drbg_context *p_rng_blind_det; + +#if !defined(MBEDTLS_ECP_RESTARTABLE) + /* + * To avoid reusing rng_ctx and risking incorrect behavior we seed a + * second HMAC-DRBG with the same seed. We also apply a label to avoid + * reusing the bits of the ephemeral key for blinding and eliminate the + * risk that they leak this way. + */ + const char* blind_label = "BLINDING CONTEXT"; + mbedtls_hmac_drbg_context rng_ctx_blind; + + mbedtls_hmac_drbg_init( &rng_ctx_blind ); + p_rng_blind_det = &rng_ctx_blind; + + mbedtls_hmac_drbg_seed_buf( p_rng_blind_det, md_info, + data, 2 * grp_len ); + ret = mbedtls_hmac_drbg_update_ret( p_rng_blind_det, + (const unsigned char*) blind_label, + strlen( blind_label ) ); + if( ret != 0 ) + { + mbedtls_hmac_drbg_free( &rng_ctx_blind ); + goto cleanup; + } +#else + /* + * In the case of restartable computations we would either need to store + * the second RNG in the restart context too or set it up at every + * restart. The first option would penalize the correct application of + * the function and the second would defeat the purpose of the + * restartable feature. + * + * Therefore in this case we reuse the original RNG. This comes with the + * price that the resulting signature might not be a valid deterministic + * ECDSA signature with a very low probability (same magnitude as + * successfully guessing the private key). However even then it is still + * a valid ECDSA signature. + */ + p_rng_blind_det = p_rng; +#endif /* MBEDTLS_ECP_RESTARTABLE */ + + /* + * Since the output of the RNGs is always the same for the same key and + * message, this limits the efficiency of blinding and leaks information + * through side channels. After mbedtls_ecdsa_sign_det() is removed NULL + * won't be a valid value for f_rng_blind anymore. Therefore it should + * be checked by the caller and this branch and check can be removed. + */ + ret = ecdsa_sign_restartable( grp, r, s, d, buf, blen, + mbedtls_hmac_drbg_random, p_rng, + mbedtls_hmac_drbg_random, p_rng_blind_det, + rs_ctx ); + +#if !defined(MBEDTLS_ECP_RESTARTABLE) + mbedtls_hmac_drbg_free( &rng_ctx_blind ); +#endif + } #endif /* MBEDTLS_ECDSA_SIGN_ALT */ cleanup: @@ -465,19 +535,40 @@ cleanup: } /* - * Deterministic signature wrapper + * Deterministic signature wrappers */ -int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, - const mbedtls_mpi *d, const unsigned char *buf, size_t blen, - mbedtls_md_type_t md_alg ) +int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r, + mbedtls_mpi *s, const mbedtls_mpi *d, + const unsigned char *buf, size_t blen, + mbedtls_md_type_t md_alg ) +{ + ECDSA_VALIDATE_RET( grp != NULL ); + ECDSA_VALIDATE_RET( r != NULL ); + ECDSA_VALIDATE_RET( s != NULL ); + ECDSA_VALIDATE_RET( d != NULL ); + ECDSA_VALIDATE_RET( buf != NULL || blen == 0 ); + + return( ecdsa_sign_det_restartable( grp, r, s, d, buf, blen, md_alg, + NULL, NULL, NULL ) ); +} + +int mbedtls_ecdsa_sign_det_ext( mbedtls_ecp_group *grp, mbedtls_mpi *r, + mbedtls_mpi *s, const mbedtls_mpi *d, + const unsigned char *buf, size_t blen, + mbedtls_md_type_t md_alg, + int (*f_rng_blind)(void *, unsigned char *, + size_t), + void *p_rng_blind ) { ECDSA_VALIDATE_RET( grp != NULL ); ECDSA_VALIDATE_RET( r != NULL ); ECDSA_VALIDATE_RET( s != NULL ); ECDSA_VALIDATE_RET( d != NULL ); ECDSA_VALIDATE_RET( buf != NULL || blen == 0 ); + ECDSA_VALIDATE_RET( f_rng_blind != NULL ); - return( ecdsa_sign_det_restartable( grp, r, s, d, buf, blen, md_alg, NULL ) ); + return( ecdsa_sign_det_restartable( grp, r, s, d, buf, blen, md_alg, + f_rng_blind, p_rng_blind, NULL ) ); } #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ @@ -656,11 +747,9 @@ int mbedtls_ecdsa_write_signature_restartable( mbedtls_ecdsa_context *ctx, mbedtls_mpi_init( &s ); #if defined(MBEDTLS_ECDSA_DETERMINISTIC) - (void) f_rng; - (void) p_rng; - MBEDTLS_MPI_CHK( ecdsa_sign_det_restartable( &ctx->grp, &r, &s, &ctx->d, - hash, hlen, md_alg, rs_ctx ) ); + hash, hlen, md_alg, f_rng, + p_rng, rs_ctx ) ); #else (void) md_alg; @@ -668,8 +757,10 @@ int mbedtls_ecdsa_write_signature_restartable( mbedtls_ecdsa_context *ctx, MBEDTLS_MPI_CHK( mbedtls_ecdsa_sign( &ctx->grp, &r, &s, &ctx->d, hash, hlen, f_rng, p_rng ) ); #else + /* Use the same RNG for both blinding and ephemeral key generation */ MBEDTLS_MPI_CHK( ecdsa_sign_restartable( &ctx->grp, &r, &s, &ctx->d, - hash, hlen, f_rng, p_rng, rs_ctx ) ); + hash, hlen, f_rng, p_rng, f_rng, + p_rng, rs_ctx ) ); #endif /* MBEDTLS_ECDSA_SIGN_ALT */ #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ diff --git a/thirdparty/mbedtls/library/ecjpake.c b/thirdparty/mbedtls/library/ecjpake.c index be941b14b1..1845c936ab 100644 --- a/thirdparty/mbedtls/library/ecjpake.c +++ b/thirdparty/mbedtls/library/ecjpake.c @@ -226,7 +226,7 @@ static int ecjpake_hash( const mbedtls_md_info_t *md_info, p += id_len; /* Compute hash */ - mbedtls_md( md_info, buf, p - buf, hash ); + MBEDTLS_MPI_CHK( mbedtls_md( md_info, buf, p - buf, hash ) ); /* Turn it into an integer mod n */ MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( h, hash, @@ -951,7 +951,7 @@ static const unsigned char ecjpake_test_pms[] = { 0xb4, 0x38, 0xf7, 0x19, 0xd3, 0xc4, 0xf3, 0x51 }; -/* Load my private keys and generate the correponding public keys */ +/* Load my private keys and generate the corresponding public keys */ static int ecjpake_test_load( mbedtls_ecjpake_context *ctx, const unsigned char *xm1, size_t len1, const unsigned char *xm2, size_t len2 ) diff --git a/thirdparty/mbedtls/library/entropy_poll.c b/thirdparty/mbedtls/library/entropy_poll.c index 4556f88a55..ba56b70f77 100644 --- a/thirdparty/mbedtls/library/entropy_poll.c +++ b/thirdparty/mbedtls/library/entropy_poll.c @@ -61,28 +61,43 @@ #define _WIN32_WINNT 0x0400 #endif #include <windows.h> -#include <wincrypt.h> +#include <bcrypt.h> +#if defined(_MSC_VER) && _MSC_VER <= 1600 +/* Visual Studio 2010 and earlier issue a warning when both <stdint.h> and + * <intsafe.h> are included, as they redefine a number of <TYPE>_MAX constants. + * These constants are guaranteed to be the same, though, so we suppress the + * warning when including intsafe.h. + */ +#pragma warning( push ) +#pragma warning( disable : 4005 ) +#endif +#include <intsafe.h> +#if defined(_MSC_VER) && _MSC_VER <= 1600 +#pragma warning( pop ) +#endif int mbedtls_platform_entropy_poll( void *data, unsigned char *output, size_t len, size_t *olen ) { - HCRYPTPROV provider; + ULONG len_as_ulong = 0; ((void) data); *olen = 0; - if( CryptAcquireContext( &provider, NULL, NULL, - PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == FALSE ) + /* + * BCryptGenRandom takes ULONG for size, which is smaller than size_t on + * 64-bit Windows platforms. Ensure len's value can be safely converted into + * a ULONG. + */ + if ( FAILED( SizeTToULong( len, &len_as_ulong ) ) ) { return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); } - if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE ) + if ( !BCRYPT_SUCCESS( BCryptGenRandom( NULL, output, len_as_ulong, BCRYPT_USE_SYSTEM_PREFERRED_RNG ) ) ) { - CryptReleaseContext( provider, 0 ); return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); } - CryptReleaseContext( provider, 0 ); *olen = len; return( 0 ); diff --git a/thirdparty/mbedtls/library/error.c b/thirdparty/mbedtls/library/error.c index 12312a0562..c596f0bcc5 100644 --- a/thirdparty/mbedtls/library/error.c +++ b/thirdparty/mbedtls/library/error.c @@ -567,7 +567,7 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen ) if( use_ret == -(MBEDTLS_ERR_X509_BUFFER_TOO_SMALL) ) mbedtls_snprintf( buf, buflen, "X509 - Destination buffer is too small" ); if( use_ret == -(MBEDTLS_ERR_X509_FATAL_ERROR) ) - mbedtls_snprintf( buf, buflen, "X509 - A fatal error occured, eg the chain is too long or the vrfy callback failed" ); + mbedtls_snprintf( buf, buflen, "X509 - A fatal error occurred, eg the chain is too long or the vrfy callback failed" ); #endif /* MBEDTLS_X509_USE_C || MBEDTLS_X509_CREATE_C */ // END generated code diff --git a/thirdparty/mbedtls/library/havege.c b/thirdparty/mbedtls/library/havege.c index 54f897c6e7..c139e1db03 100644 --- a/thirdparty/mbedtls/library/havege.c +++ b/thirdparty/mbedtls/library/havege.c @@ -38,8 +38,19 @@ #include "mbedtls/timing.h" #include "mbedtls/platform_util.h" +#include <limits.h> #include <string.h> +/* If int isn't capable of storing 2^32 distinct values, the code of this + * module may cause a processor trap or a miscalculation. If int is more + * than 32 bits, the code may not calculate the intended values. */ +#if INT_MIN + 1 != -0x7fffffff +#error "The HAVEGE module requires int to be exactly 32 bits, with INT_MIN = -2^31." +#endif +#if UINT_MAX != 0xffffffff +#error "The HAVEGE module requires unsigned to be exactly 32 bits." +#endif + /* ------------------------------------------------------------------------ * On average, one iteration accesses two 8-word blocks in the havege WALK * table, and generates 16 words in the RES array. @@ -54,7 +65,7 @@ * ------------------------------------------------------------------------ */ -#define SWAP(X,Y) { int *T = (X); (X) = (Y); (Y) = T; } +#define SWAP(X,Y) { unsigned *T = (X); (X) = (Y); (Y) = T; } #define TST1_ENTER if( PTEST & 1 ) { PTEST ^= 3; PTEST >>= 1; #define TST2_ENTER if( PTEST & 1 ) { PTEST ^= 3; PTEST >>= 1; @@ -77,7 +88,7 @@ PTX = (PT1 >> 18) & 7; \ PT1 &= 0x1FFF; \ PT2 &= 0x1FFF; \ - CLK = (int) mbedtls_timing_hardclock(); \ + CLK = (unsigned) mbedtls_timing_hardclock(); \ \ i = 0; \ A = &WALK[PT1 ]; RES[i++] ^= *A; \ @@ -100,7 +111,7 @@ \ IN = (*A >> (5)) ^ (*A << (27)) ^ CLK; \ *A = (*B >> (6)) ^ (*B << (26)) ^ CLK; \ - *B = IN; CLK = (int) mbedtls_timing_hardclock(); \ + *B = IN; CLK = (unsigned) mbedtls_timing_hardclock(); \ *C = (*C >> (7)) ^ (*C << (25)) ^ CLK; \ *D = (*D >> (8)) ^ (*D << (24)) ^ CLK; \ \ @@ -151,19 +162,20 @@ PT1 ^= (PT2 ^ 0x10) & 0x10; \ \ for( n++, i = 0; i < 16; i++ ) \ - hs->pool[n % MBEDTLS_HAVEGE_COLLECT_SIZE] ^= RES[i]; + POOL[n % MBEDTLS_HAVEGE_COLLECT_SIZE] ^= RES[i]; /* * Entropy gathering function */ static void havege_fill( mbedtls_havege_state *hs ) { - int i, n = 0; - int U1, U2, *A, *B, *C, *D; - int PT1, PT2, *WALK, RES[16]; - int PTX, PTY, CLK, PTEST, IN; + unsigned i, n = 0; + unsigned U1, U2, *A, *B, *C, *D; + unsigned PT1, PT2, *WALK, *POOL, RES[16]; + unsigned PTX, PTY, CLK, PTEST, IN; - WALK = hs->WALK; + WALK = (unsigned *) hs->WALK; + POOL = (unsigned *) hs->pool; PT1 = hs->PT1; PT2 = hs->PT2; diff --git a/thirdparty/mbedtls/library/hmac_drbg.c b/thirdparty/mbedtls/library/hmac_drbg.c index c50330e7d8..50d88bd54b 100644 --- a/thirdparty/mbedtls/library/hmac_drbg.c +++ b/thirdparty/mbedtls/library/hmac_drbg.c @@ -149,20 +149,32 @@ int mbedtls_hmac_drbg_seed_buf( mbedtls_hmac_drbg_context *ctx, } /* - * HMAC_DRBG reseeding: 10.1.2.4 (arabic) + 9.2 (Roman) + * Internal function used both for seeding and reseeding the DRBG. + * Comments starting with arabic numbers refer to section 10.1.2.4 + * of SP800-90A, while roman numbers refer to section 9.2. */ -int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx, - const unsigned char *additional, size_t len ) +static int hmac_drbg_reseed_core( mbedtls_hmac_drbg_context *ctx, + const unsigned char *additional, size_t len, + int use_nonce ) { unsigned char seed[MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT]; - size_t seedlen; + size_t seedlen = 0; int ret; - /* III. Check input length */ - if( len > MBEDTLS_HMAC_DRBG_MAX_INPUT || - ctx->entropy_len + len > MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT ) { - return( MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG ); + size_t total_entropy_len; + + if( use_nonce == 0 ) + total_entropy_len = ctx->entropy_len; + else + total_entropy_len = ctx->entropy_len * 3 / 2; + + /* III. Check input length */ + if( len > MBEDTLS_HMAC_DRBG_MAX_INPUT || + total_entropy_len + len > MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT ) + { + return( MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG ); + } } memset( seed, 0, MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT ); @@ -170,9 +182,32 @@ int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx, /* IV. Gather entropy_len bytes of entropy for the seed */ if( ( ret = ctx->f_entropy( ctx->p_entropy, seed, ctx->entropy_len ) ) != 0 ) + { return( MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED ); + } + seedlen += ctx->entropy_len; + + /* For initial seeding, allow adding of nonce generated + * from the entropy source. See Sect 8.6.7 in SP800-90A. */ + if( use_nonce ) + { + /* Note: We don't merge the two calls to f_entropy() in order + * to avoid requesting too much entropy from f_entropy() + * at once. Specifically, if the underlying digest is not + * SHA-1, 3 / 2 * entropy_len is at least 36 Bytes, which + * is larger than the maximum of 32 Bytes that our own + * entropy source implementation can emit in a single + * call in configurations disabling SHA-512. */ + if( ( ret = ctx->f_entropy( ctx->p_entropy, + seed + seedlen, + ctx->entropy_len / 2 ) ) != 0 ) + { + return( MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED ); + } + + seedlen += ctx->entropy_len / 2; + } - seedlen = ctx->entropy_len; /* 1. Concatenate entropy and additional data if any */ if( additional != NULL && len != 0 ) @@ -195,7 +230,19 @@ exit: } /* + * HMAC_DRBG reseeding: 10.1.2.4 + 9.2 + */ +int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx, + const unsigned char *additional, size_t len ) +{ + return( hmac_drbg_reseed_core( ctx, additional, len, 0 ) ); +} + +/* * HMAC_DRBG initialisation (10.1.2.3 + 9.1) + * + * The nonce is not passed as a separate parameter but extracted + * from the entropy source as suggested in 8.6.7. */ int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx, const mbedtls_md_info_t * md_info, @@ -205,7 +252,7 @@ int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx, size_t len ) { int ret; - size_t entropy_len, md_size; + size_t md_size; if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) return( ret ); @@ -233,20 +280,15 @@ int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx, * * (This also matches the sizes used in the NIST test vectors.) */ - entropy_len = md_size <= 20 ? 16 : /* 160-bits hash -> 128 bits */ - md_size <= 28 ? 24 : /* 224-bits hash -> 192 bits */ - 32; /* better (256+) -> 256 bits */ - - /* - * For initialisation, use more entropy to emulate a nonce - * (Again, matches test vectors.) - */ - ctx->entropy_len = entropy_len * 3 / 2; + ctx->entropy_len = md_size <= 20 ? 16 : /* 160-bits hash -> 128 bits */ + md_size <= 28 ? 24 : /* 224-bits hash -> 192 bits */ + 32; /* better (256+) -> 256 bits */ - if( ( ret = mbedtls_hmac_drbg_reseed( ctx, custom, len ) ) != 0 ) + if( ( ret = hmac_drbg_reseed_core( ctx, custom, len, + 1 /* add nonce */ ) ) != 0 ) + { return( ret ); - - ctx->entropy_len = entropy_len; + } return( 0 ); } diff --git a/thirdparty/mbedtls/library/net_sockets.c b/thirdparty/mbedtls/library/net_sockets.c index 816b1303df..5d538bfd56 100644 --- a/thirdparty/mbedtls/library/net_sockets.c +++ b/thirdparty/mbedtls/library/net_sockets.c @@ -284,7 +284,7 @@ static int net_would_block( const mbedtls_net_context *ctx ) int err = errno; /* - * Never return 'WOULD BLOCK' on a non-blocking socket + * Never return 'WOULD BLOCK' on a blocking socket */ if( ( fcntl( ctx->fd, F_GETFL ) & O_NONBLOCK ) != O_NONBLOCK ) { diff --git a/thirdparty/mbedtls/library/pkwrite.c b/thirdparty/mbedtls/library/pkwrite.c index 8d1da2f757..03d14f2ff9 100644 --- a/thirdparty/mbedtls/library/pkwrite.c +++ b/thirdparty/mbedtls/library/pkwrite.c @@ -38,7 +38,9 @@ #include "mbedtls/rsa.h" #endif #if defined(MBEDTLS_ECP_C) +#include "mbedtls/bignum.h" #include "mbedtls/ecp.h" +#include "mbedtls/platform_util.h" #endif #if defined(MBEDTLS_ECDSA_C) #include "mbedtls/ecdsa.h" @@ -150,6 +152,26 @@ static int pk_write_ec_param( unsigned char **p, unsigned char *start, return( (int) len ); } + +/* + * privateKey OCTET STRING -- always of length ceil(log2(n)/8) + */ +static int pk_write_ec_private( unsigned char **p, unsigned char *start, + mbedtls_ecp_keypair *ec ) +{ + int ret; + size_t byte_length = ( ec->grp.pbits + 7 ) / 8; + unsigned char tmp[MBEDTLS_ECP_MAX_BYTES]; + + ret = mbedtls_mpi_write_binary( &ec->d, tmp, byte_length ); + if( ret != 0 ) + goto exit; + ret = mbedtls_asn1_write_octet_string( p, start, tmp, byte_length ); + +exit: + mbedtls_platform_zeroize( tmp, byte_length ); + return( ret ); +} #endif /* MBEDTLS_ECP_C */ int mbedtls_pk_write_pubkey( unsigned char **p, unsigned char *start, @@ -364,9 +386,8 @@ int mbedtls_pk_write_key_der( mbedtls_pk_context *key, unsigned char *buf, size_ MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_CONSTRUCTED | 0 ) ); len += par_len; - /* privateKey: write as MPI then fix tag */ - MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( &c, buf, &ec->d ) ); - *c = MBEDTLS_ASN1_OCTET_STRING; + /* privateKey */ + MBEDTLS_ASN1_CHK_ADD( len, pk_write_ec_private( &c, buf, ec ) ); /* version */ MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_int( &c, buf, 1 ) ); diff --git a/thirdparty/mbedtls/library/platform_util.c b/thirdparty/mbedtls/library/platform_util.c index 756e22679a..b1f745097c 100644 --- a/thirdparty/mbedtls/library/platform_util.c +++ b/thirdparty/mbedtls/library/platform_util.c @@ -72,7 +72,10 @@ static void * (* const volatile memset_func)( void *, int, size_t ) = memset; void mbedtls_platform_zeroize( void *buf, size_t len ) { - memset_func( buf, 0, len ); + MBEDTLS_INTERNAL_VALIDATE( len == 0 || buf != NULL ); + + if( len > 0 ) + memset_func( buf, 0, len ); } #endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */ diff --git a/thirdparty/mbedtls/library/ssl_srv.c b/thirdparty/mbedtls/library/ssl_srv.c index bc77f80203..5825970c43 100644 --- a/thirdparty/mbedtls/library/ssl_srv.c +++ b/thirdparty/mbedtls/library/ssl_srv.c @@ -1449,7 +1449,7 @@ read_record_header: */ /* - * Minimal length (with everything empty and extensions ommitted) is + * Minimal length (with everything empty and extensions omitted) is * 2 + 32 + 1 + 2 + 1 = 38 bytes. Check that first, so that we can * read at least up to session id length without worrying. */ diff --git a/thirdparty/mbedtls/library/ssl_tls.c b/thirdparty/mbedtls/library/ssl_tls.c index 38690fa664..b8f35fec5d 100644 --- a/thirdparty/mbedtls/library/ssl_tls.c +++ b/thirdparty/mbedtls/library/ssl_tls.c @@ -2606,7 +2606,7 @@ int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want ) } /* - * A record can't be split accross datagrams. If we need to read but + * A record can't be split across datagrams. If we need to read but * are not at the beginning of a new record, the caller did something * wrong. */ @@ -9043,8 +9043,12 @@ static int ssl_preset_suiteb_hashes[] = { #if defined(MBEDTLS_ECP_C) static mbedtls_ecp_group_id ssl_preset_suiteb_curves[] = { +#if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) MBEDTLS_ECP_DP_SECP256R1, +#endif +#if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) MBEDTLS_ECP_DP_SECP384R1, +#endif MBEDTLS_ECP_DP_NONE }; #endif diff --git a/thirdparty/mbedtls/library/timing.c b/thirdparty/mbedtls/library/timing.c index 413d133fb6..009516a6e3 100644 --- a/thirdparty/mbedtls/library/timing.c +++ b/thirdparty/mbedtls/library/timing.c @@ -51,7 +51,6 @@ #if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) #include <windows.h> -#include <winbase.h> #include <process.h> struct _hr_time diff --git a/thirdparty/mbedtls/library/version_features.c b/thirdparty/mbedtls/library/version_features.c index 24143d052c..a99ee808d6 100644 --- a/thirdparty/mbedtls/library/version_features.c +++ b/thirdparty/mbedtls/library/version_features.c @@ -87,6 +87,9 @@ static const char *features[] = { #if defined(MBEDTLS_CHECK_PARAMS) "MBEDTLS_CHECK_PARAMS", #endif /* MBEDTLS_CHECK_PARAMS */ +#if defined(MBEDTLS_CHECK_PARAMS_ASSERT) + "MBEDTLS_CHECK_PARAMS_ASSERT", +#endif /* MBEDTLS_CHECK_PARAMS_ASSERT */ #if defined(MBEDTLS_TIMING_ALT) "MBEDTLS_TIMING_ALT", #endif /* MBEDTLS_TIMING_ALT */ diff --git a/thirdparty/mbedtls/library/x509.c b/thirdparty/mbedtls/library/x509.c index a562df7ca3..2e0b0e8f6c 100644 --- a/thirdparty/mbedtls/library/x509.c +++ b/thirdparty/mbedtls/library/x509.c @@ -123,7 +123,7 @@ int mbedtls_x509_get_alg_null( unsigned char **p, const unsigned char *end, } /* - * Parse an algorithm identifier with (optional) paramaters + * Parse an algorithm identifier with (optional) parameters */ int mbedtls_x509_get_alg( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *alg, mbedtls_x509_buf *params ) diff --git a/thirdparty/mbedtls/library/x509_crt.c b/thirdparty/mbedtls/library/x509_crt.c index 97e1d72e3c..a3697f13f9 100644 --- a/thirdparty/mbedtls/library/x509_crt.c +++ b/thirdparty/mbedtls/library/x509_crt.c @@ -65,6 +65,19 @@ #if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) #include <windows.h> +#if defined(_MSC_VER) && _MSC_VER <= 1600 +/* Visual Studio 2010 and earlier issue a warning when both <stdint.h> and + * <intsafe.h> are included, as they redefine a number of <TYPE>_MAX constants. + * These constants are guaranteed to be the same, though, so we suppress the + * warning when including intsafe.h. + */ +#pragma warning( push ) +#pragma warning( disable : 4005 ) +#endif +#include <intsafe.h> +#if defined(_MSC_VER) && _MSC_VER <= 1600 +#pragma warning( pop ) +#endif #else #include <time.h> #endif @@ -1277,6 +1290,7 @@ int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ) char filename[MAX_PATH]; char *p; size_t len = strlen( path ); + int lengthAsInt = 0; WIN32_FIND_DATAW file_data; HANDLE hFind; @@ -1291,7 +1305,18 @@ int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ) p = filename + len; filename[len++] = '*'; - w_ret = MultiByteToWideChar( CP_ACP, 0, filename, (int)len, szDir, + if ( FAILED ( SizeTToInt( len, &lengthAsInt ) ) ) + return( MBEDTLS_ERR_X509_FILE_IO_ERROR ); + + /* + * Note this function uses the code page CP_ACP, and assumes the incoming + * string is encoded in ANSI, before translating it into Unicode. If the + * incoming string were changed to be UTF-8, then the length check needs to + * change to check the number of characters, not the number of bytes, in the + * incoming string are less than MAX_PATH to avoid a buffer overrun with + * MultiByteToWideChar(). + */ + w_ret = MultiByteToWideChar( CP_ACP, 0, filename, lengthAsInt, szDir, MAX_PATH - 3 ); if( w_ret == 0 ) return( MBEDTLS_ERR_X509_BAD_INPUT_DATA ); @@ -1308,8 +1333,11 @@ int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ) if( file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) continue; + if ( FAILED( SizeTToInt( wcslen( file_data.cFileName ), &lengthAsInt ) ) ) + return( MBEDTLS_ERR_X509_FILE_IO_ERROR ); + w_ret = WideCharToMultiByte( CP_ACP, 0, file_data.cFileName, - lstrlenW( file_data.cFileName ), + lengthAsInt, p, (int) len - 1, NULL, NULL ); if( w_ret == 0 ) @@ -2087,15 +2115,13 @@ check_signature: continue; } - break; - } - - if( parent != NULL ) - { *r_parent = parent; *r_signature_is_good = signature_is_good; + + break; } - else + + if( parent == NULL ) { *r_parent = fallback_parent; *r_signature_is_good = fallback_signature_is_good; @@ -2236,7 +2262,7 @@ static int x509_crt_check_ee_locally_trusted( * Tests for (aspects of) this function should include at least: * - trusted EE * - EE -> trusted root - * - EE -> intermedate CA -> trusted root + * - EE -> intermediate CA -> trusted root * - if relevant: EE untrusted * - if relevant: EE -> intermediate, untrusted * with the aspect under test checked at each relevant level (EE, int, root). diff --git a/thirdparty/mbedtls/library/x509write_crt.c b/thirdparty/mbedtls/library/x509write_crt.c index 10497e752b..61d7ba44a0 100644 --- a/thirdparty/mbedtls/library/x509write_crt.c +++ b/thirdparty/mbedtls/library/x509write_crt.c @@ -45,6 +45,16 @@ #include "mbedtls/pem.h" #endif /* MBEDTLS_PEM_WRITE_C */ +/* + * For the currently used signature algorithms the buffer to store any signature + * must be at least of size MAX(MBEDTLS_ECDSA_MAX_LEN, MBEDTLS_MPI_MAX_SIZE) + */ +#if MBEDTLS_ECDSA_MAX_LEN > MBEDTLS_MPI_MAX_SIZE +#define SIGNATURE_MAX_SIZE MBEDTLS_ECDSA_MAX_LEN +#else +#define SIGNATURE_MAX_SIZE MBEDTLS_MPI_MAX_SIZE +#endif + void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx ) { memset( ctx, 0, sizeof( mbedtls_x509write_cert ) ); @@ -334,7 +344,7 @@ int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx, unsigned char *buf, size_t sig_oid_len = 0; unsigned char *c, *c2; unsigned char hash[64]; - unsigned char sig[MBEDTLS_MPI_MAX_SIZE]; + unsigned char sig[SIGNATURE_MAX_SIZE]; unsigned char tmp_buf[2048]; size_t sub_len = 0, pub_len = 0, sig_and_oid_len = 0, sig_len; size_t len = 0; diff --git a/thirdparty/mbedtls/library/x509write_csr.c b/thirdparty/mbedtls/library/x509write_csr.c index d70ba0ed92..b65a11c6aa 100644 --- a/thirdparty/mbedtls/library/x509write_csr.c +++ b/thirdparty/mbedtls/library/x509write_csr.c @@ -44,6 +44,16 @@ #include "mbedtls/pem.h" #endif +/* + * For the currently used signature algorithms the buffer to store any signature + * must be at least of size MAX(MBEDTLS_ECDSA_MAX_LEN, MBEDTLS_MPI_MAX_SIZE) + */ +#if MBEDTLS_ECDSA_MAX_LEN > MBEDTLS_MPI_MAX_SIZE +#define SIGNATURE_MAX_SIZE MBEDTLS_ECDSA_MAX_LEN +#else +#define SIGNATURE_MAX_SIZE MBEDTLS_MPI_MAX_SIZE +#endif + void mbedtls_x509write_csr_init( mbedtls_x509write_csr *ctx ) { memset( ctx, 0, sizeof( mbedtls_x509write_csr ) ); @@ -159,7 +169,7 @@ int mbedtls_x509write_csr_der( mbedtls_x509write_csr *ctx, unsigned char *buf, s size_t sig_oid_len = 0; unsigned char *c, *c2; unsigned char hash[64]; - unsigned char sig[MBEDTLS_MPI_MAX_SIZE]; + unsigned char sig[SIGNATURE_MAX_SIZE]; unsigned char tmp_buf[2048]; size_t pub_len = 0, sig_and_oid_len = 0, sig_len; size_t len = 0; diff --git a/thirdparty/mbedtls/1453.diff b/thirdparty/mbedtls/patches/1453.diff index b1c9c43ed2..b1c9c43ed2 100644 --- a/thirdparty/mbedtls/1453.diff +++ b/thirdparty/mbedtls/patches/1453.diff diff --git a/thirdparty/mbedtls/padlock.diff b/thirdparty/mbedtls/patches/padlock.diff index 6ace48891c..6ace48891c 100644 --- a/thirdparty/mbedtls/padlock.diff +++ b/thirdparty/mbedtls/patches/padlock.diff diff --git a/thirdparty/miniupnpc/LICENSE b/thirdparty/miniupnpc/LICENSE index 39e0345f8a..1460310752 100644 --- a/thirdparty/miniupnpc/LICENSE +++ b/thirdparty/miniupnpc/LICENSE @@ -24,4 +24,3 @@ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/thirdparty/miniupnpc/miniupnpc/connecthostport.c b/thirdparty/miniupnpc/miniupnpc/connecthostport.c index a59dc82437..f3982e1a77 100644 --- a/thirdparty/miniupnpc/miniupnpc/connecthostport.c +++ b/thirdparty/miniupnpc/miniupnpc/connecthostport.c @@ -1,4 +1,4 @@ -/* $Id: connecthostport.c,v 1.21 2019/04/23 12:11:08 nanard Exp $ */ +/* $Id: connecthostport.c,v 1.22 2019/10/13 17:22:08 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project : miniupnp * Author : Thomas Bernard @@ -195,6 +195,10 @@ SOCKET connecthostport(const char * host, unsigned short port, { if(!ISINVALID(s)) closesocket(s); +#ifdef DEBUG + printf("ai_family=%d ai_socktype=%d ai_protocol=%d (PF_INET=%d, PF_INET6=%d)\n", + p->ai_family, p->ai_socktype, p->ai_protocol, PF_INET, PF_INET6); +#endif s = socket(p->ai_family, p->ai_socktype, p->ai_protocol); if(ISINVALID(s)) continue; diff --git a/thirdparty/miniupnpc/miniupnpc/miniupnpc.c b/thirdparty/miniupnpc/miniupnpc/miniupnpc.c index 3181d10eb6..95ab6cf56b 100644 --- a/thirdparty/miniupnpc/miniupnpc/miniupnpc.c +++ b/thirdparty/miniupnpc/miniupnpc/miniupnpc.c @@ -564,6 +564,7 @@ UPNP_GetValidIGD(struct UPNPDev * devlist, char * lanaddr, int lanaddrlen) { struct xml_desc { + char lanaddr[40]; char * xml; int size; int is_igd; @@ -573,7 +574,6 @@ UPNP_GetValidIGD(struct UPNPDev * devlist, int i; int state = -1; /* state 1 : IGD connected. State 2 : IGD. State 3 : anything */ char extIpAddr[16]; - char myLanAddr[40]; int status_code = -1; if(!devlist) @@ -596,7 +596,7 @@ UPNP_GetValidIGD(struct UPNPDev * devlist, /* we should choose an internet gateway device. * with st == urn:schemas-upnp-org:device:InternetGatewayDevice:1 */ desc[i].xml = miniwget_getaddr(dev->descURL, &(desc[i].size), - myLanAddr, sizeof(myLanAddr), + desc[i].lanaddr, sizeof(desc[i].lanaddr), dev->scope_id, &status_code); #ifdef DEBUG if(!desc[i].xml) @@ -613,8 +613,6 @@ UPNP_GetValidIGD(struct UPNPDev * devlist, "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:")) { desc[i].is_igd = 1; - if(lanaddr) - strncpy(lanaddr, myLanAddr, lanaddrlen); } } } @@ -680,6 +678,8 @@ UPNP_GetValidIGD(struct UPNPDev * devlist, } state = 0; free_and_return: + if (lanaddr != NULL && state >= 1 && state <= 3 && i < ndev) + strncpy(lanaddr, desc[i].lanaddr, lanaddrlen); for(i = 0; i < ndev; i++) free(desc[i].xml); free(desc); @@ -713,4 +713,3 @@ UPNP_GetIGDFromUrl(const char * rootdescurl, return 0; } } - diff --git a/thirdparty/miniupnpc/miniupnpc/upnpc.c b/thirdparty/miniupnpc/miniupnpc/upnpc.c index 674c89beb0..4325658bee 100644 --- a/thirdparty/miniupnpc/miniupnpc/upnpc.c +++ b/thirdparty/miniupnpc/miniupnpc/upnpc.c @@ -250,6 +250,7 @@ static int SetRedirectAndTest(struct UPNPUrls * urls, const char * eport, const char * proto, const char * leaseDuration, + const char * remoteHost, const char * description, int addAny) { @@ -283,7 +284,7 @@ static int SetRedirectAndTest(struct UPNPUrls * urls, if (addAny) { r = UPNP_AddAnyPortMapping(urls->controlURL, data->first.servicetype, eport, iport, iaddr, description, - proto, 0, leaseDuration, reservedPort); + proto, remoteHost, leaseDuration, reservedPort); if(r==UPNPCOMMAND_SUCCESS) eport = reservedPort; else @@ -292,7 +293,7 @@ static int SetRedirectAndTest(struct UPNPUrls * urls, } else { r = UPNP_AddPortMapping(urls->controlURL, data->first.servicetype, eport, iport, iaddr, description, - proto, 0, leaseDuration); + proto, remoteHost, leaseDuration); if(r!=UPNPCOMMAND_SUCCESS) { printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", eport, iport, iaddr, r, strupnperror(r)); @@ -302,7 +303,7 @@ static int SetRedirectAndTest(struct UPNPUrls * urls, r = UPNP_GetSpecificPortMappingEntry(urls->controlURL, data->first.servicetype, - eport, proto, NULL/*remoteHost*/, + eport, proto, remoteHost, intClient, intPort, NULL/*desc*/, NULL/*enabled*/, duration); if(r!=UPNPCOMMAND_SUCCESS) { @@ -642,12 +643,12 @@ int main(int argc, char ** argv) || (command == 'U' && commandargc<2) || (command == 'D' && commandargc<1)) { - fprintf(stderr, "Usage :\t%s [options] -a ip port external_port protocol [duration]\n\t\tAdd port redirection\n", argv[0]); - fprintf(stderr, " \t%s [options] -d external_port protocol <remote host>\n\t\tDelete port redirection\n", argv[0]); + fprintf(stderr, "Usage :\t%s [options] -a ip port external_port protocol [duration] [remote host]\n\t\tAdd port redirection\n", argv[0]); + fprintf(stderr, " \t%s [options] -d external_port protocol [remote host]\n\t\tDelete port redirection\n", argv[0]); fprintf(stderr, " \t%s [options] -s\n\t\tGet Connection status\n", argv[0]); fprintf(stderr, " \t%s [options] -l\n\t\tList redirections\n", argv[0]); fprintf(stderr, " \t%s [options] -L\n\t\tList redirections (using GetListOfPortMappings (for IGD:2 only)\n", argv[0]); - fprintf(stderr, " \t%s [options] -n ip port external_port protocol [duration]\n\t\tAdd (any) port redirection allowing IGD to use alternative external_port (for IGD:2 only)\n", argv[0]); + fprintf(stderr, " \t%s [options] -n ip port external_port protocol [duration] [remote host]\n\t\tAdd (any) port redirection allowing IGD to use alternative external_port (for IGD:2 only)\n", argv[0]); fprintf(stderr, " \t%s [options] -N external_port_start external_port_end protocol [manage]\n\t\tDelete range of port redirections (for IGD:2 only)\n", argv[0]); fprintf(stderr, " \t%s [options] -r port1 [external_port1] protocol1 [port2 [external_port2] protocol2] [...]\n\t\tAdd all redirections to the current host\n", argv[0]); fprintf(stderr, " \t%s [options] -A remote_ip remote_port internal_ip internal_port protocol lease_time\n\t\tAdd Pinhole (for IGD:2 only)\n", argv[0]); @@ -734,7 +735,8 @@ int main(int argc, char ** argv) if (SetRedirectAndTest(&urls, &data, commandargv[0], commandargv[1], commandargv[2], commandargv[3], - (commandargc > 4)?commandargv[4]:"0", + (commandargc > 4)&is_int(commandargv[4])?commandargv[4]:"0", + (commandargc > 4)&!is_int(commandargv[4])?commandargv[4]:(commandargc > 5)?commandargv[5]:NULL, description, 0) < 0) retcode = 2; break; @@ -747,7 +749,8 @@ int main(int argc, char ** argv) if (SetRedirectAndTest(&urls, &data, commandargv[0], commandargv[1], commandargv[2], commandargv[3], - (commandargc > 4)?commandargv[4]:"0", + (commandargc > 4)&is_int(commandargv[4])?commandargv[4]:"0", + (commandargc > 4)&!is_int(commandargv[4])?commandargv[4]:(commandargc > 5)?commandargv[5]:NULL, description, 1) < 0) retcode = 2; break; @@ -775,7 +778,7 @@ int main(int argc, char ** argv) /* 2nd parameter is an integer : <port> <external_port> <protocol> */ if (SetRedirectAndTest(&urls, &data, lanaddr, commandargv[i], - commandargv[i+1], commandargv[i+2], "0", + commandargv[i+1], commandargv[i+2], "0", NULL, description, 0) < 0) retcode = 2; i+=3; /* 3 parameters parsed */ @@ -783,7 +786,7 @@ int main(int argc, char ** argv) /* 2nd parameter not an integer : <port> <protocol> */ if (SetRedirectAndTest(&urls, &data, lanaddr, commandargv[i], - commandargv[i], commandargv[i+1], "0", + commandargv[i], commandargv[i+1], "0", NULL, description, 0) < 0) retcode = 2; i+=2; /* 2 parameters parsed */ diff --git a/thirdparty/miniupnpc/miniupnpc/upnperrors.c b/thirdparty/miniupnpc/miniupnpc/upnperrors.c index 650af42557..4496e8622c 100644 --- a/thirdparty/miniupnpc/miniupnpc/upnperrors.c +++ b/thirdparty/miniupnpc/miniupnpc/upnperrors.c @@ -1,9 +1,10 @@ -/* $Id: upnperrors.c,v 1.9 2019/06/25 21:15:46 nanard Exp $ */ -/* Project : miniupnp +/* $Id: upnperrors.c,v 1.10 2019/08/24 08:49:53 nanard Exp $ */ +/* vim: tabstop=4 shiftwidth=4 noexpandtab + * Project : miniupnp * Author : Thomas BERNARD * copyright (c) 2007-2019 Thomas Bernard * All Right reserved. - * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ + * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * This software is subjet to the conditions detailed in the * provided LICENCE file. */ #include <string.h> @@ -71,7 +72,7 @@ const char * strupnperror(int err) s = "ProtocolWildcardingNotAllowed"; break; case 708: - s = "WildcardNotPermittedInSrcIP"; + s = "InvalidLayer2Address"; break; case 709: s = "NoPacketSent"; diff --git a/thirdparty/misc/stb_vorbis.c b/thirdparty/misc/stb_vorbis.c index 71af404dae..4ab8880d5d 100644 --- a/thirdparty/misc/stb_vorbis.c +++ b/thirdparty/misc/stb_vorbis.c @@ -1,4 +1,4 @@ -// Ogg Vorbis audio decoder - v1.16 - public domain +// Ogg Vorbis audio decoder - v1.17 - public domain // http://nothings.org/stb_vorbis/ // // Original version written by Sean Barrett in 2007. @@ -30,9 +30,10 @@ // Tom Beaumont Ingo Leitgeb Nicolas Guillemot // Phillip Bennefall Rohit Thiago Goulart // manxorist@github saga musix github:infatum -// Timur Gagiev +// Timur Gagiev Maxwell Koo // // Partial history: +// 1.17 - 2019-07-08 - fix CVE-2019-13217..CVE-2019-13223 (by ForAllSecure) // 1.16 - 2019-03-04 - fix warnings // 1.15 - 2019-02-07 - explicit failure if Ogg Skeleton data is found // 1.14 - 2018-02-11 - delete bogus dealloca usage @@ -1202,8 +1203,10 @@ static int lookup1_values(int entries, int dim) int r = (int) floor(exp((float) log((float) entries) / dim)); if ((int) floor(pow((float) r+1, dim)) <= entries) // (int) cast for MinGW warning; ++r; // floor() to avoid _ftol() when non-CRT - assert(pow((float) r+1, dim) > entries); - assert((int) floor(pow((float) r, dim)) <= entries); // (int),floor() as above + if (pow((float) r+1, dim) <= entries) + return -1; + if ((int) floor(pow((float) r, dim)) > entries) + return -1; return r; } @@ -2013,7 +2016,7 @@ static __forceinline void draw_line(float *output, int x0, int y0, int x1, int y ady -= abs(base) * adx; if (x1 > n) x1 = n; if (x < x1) { - LINE_OP(output[x], inverse_db_table[y]); + LINE_OP(output[x], inverse_db_table[y&255]); for (++x; x < x1; ++x) { err += ady; if (err >= adx) { @@ -2021,7 +2024,7 @@ static __forceinline void draw_line(float *output, int x0, int y0, int x1, int y y += sy; } else y += base; - LINE_OP(output[x], inverse_db_table[y]); + LINE_OP(output[x], inverse_db_table[y&255]); } } } @@ -3048,7 +3051,6 @@ static float *get_window(vorb *f, int len) len <<= 1; if (len == f->blocksize_0) return f->window[0]; if (len == f->blocksize_1) return f->window[1]; - assert(0); return NULL; } @@ -3454,6 +3456,7 @@ static int vorbis_finish_frame(stb_vorbis *f, int len, int left, int right) if (f->previous_length) { int i,j, n = f->previous_length; float *w = get_window(f, n); + if (w == NULL) return 0; for (i=0; i < f->channels; ++i) { for (j=0; j < n; ++j) f->channel_buffers[i][left+j] = @@ -3695,6 +3698,7 @@ static int start_decoder(vorb *f) while (current_entry < c->entries) { int limit = c->entries - current_entry; int n = get_bits(f, ilog(limit)); + if (current_length >= 32) return error(f, VORBIS_invalid_setup); if (current_entry + n > (int) c->entries) { return error(f, VORBIS_invalid_setup); } memset(lengths + current_entry, current_length, n); current_entry += n; @@ -3798,7 +3802,9 @@ static int start_decoder(vorb *f) c->value_bits = get_bits(f, 4)+1; c->sequence_p = get_bits(f,1); if (c->lookup_type == 1) { - c->lookup_values = lookup1_values(c->entries, c->dimensions); + int values = lookup1_values(c->entries, c->dimensions); + if (values < 0) return error(f, VORBIS_invalid_setup); + c->lookup_values = (uint32) values; } else { c->lookup_values = c->entries * c->dimensions; } @@ -3934,6 +3940,9 @@ static int start_decoder(vorb *f) p[j].id = j; } qsort(p, g->values, sizeof(p[0]), point_compare); + for (j=0; j < g->values-1; ++j) + if (p[j].x == p[j+1].x) + return error(f, VORBIS_invalid_setup); for (j=0; j < g->values; ++j) g->sorted_order[j] = (uint8) p[j].id; // precompute the neighbors @@ -4020,6 +4029,7 @@ static int start_decoder(vorb *f) max_submaps = m->submaps; if (get_bits(f,1)) { m->coupling_steps = get_bits(f,8)+1; + if (m->coupling_steps > f->channels) return error(f, VORBIS_invalid_setup); for (k=0; k < m->coupling_steps; ++k) { m->chan[k].magnitude = get_bits(f, ilog(f->channels-1)); m->chan[k].angle = get_bits(f, ilog(f->channels-1)); @@ -5386,6 +5396,12 @@ int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, in #endif // STB_VORBIS_NO_PULLDATA_API /* Version history + 1.17 - 2019-07-08 - fix CVE-2019-13217, -13218, -13219, -13220, -13221, -13222, -13223 + found with Mayhem by ForAllSecure + 1.16 - 2019-03-04 - fix warnings + 1.15 - 2019-02-07 - explicit failure if Ogg Skeleton data is found + 1.14 - 2018-02-11 - delete bogus dealloca usage + 1.13 - 2018-01-29 - fix truncation of last frame (hopefully) 1.12 - 2017-11-21 - limit residue begin/end to blocksize/2 to avoid large temp allocs in bad/corrupt files 1.11 - 2017-07-23 - fix MinGW compilation 1.10 - 2017-03-03 - more robust seeking; fix negative ilog(); clear error in open_memory diff --git a/thirdparty/nanosvg/nanosvg.h b/thirdparty/nanosvg/nanosvg.h index 8c8b061cd1..e5f6900614 100644 --- a/thirdparty/nanosvg/nanosvg.h +++ b/thirdparty/nanosvg/nanosvg.h @@ -1102,7 +1102,7 @@ static double nsvg__atof(const char* s) // Parse integer part if (nsvg__isdigit(*cur)) { // Parse digit sequence - intPart = (double)strtoll(cur, &end, 10); + intPart = strtoll(cur, &end, 10); if (cur != end) { res = (double)intPart; hasIntPart = 1; @@ -1130,7 +1130,7 @@ static double nsvg__atof(const char* s) // Parse optional exponent if (*cur == 'e' || *cur == 'E') { - int expPart = 0; + long expPart = 0; cur++; // skip 'E' expPart = strtol(cur, &end, 10); // Parse digit sequence with sign if (cur != end) { @@ -1168,7 +1168,7 @@ static const char* nsvg__parseNumber(const char* s, char* it, const int size) } } // exponent - if (*s == 'e' || *s == 'E') { + if ((*s == 'e' || *s == 'E') && (s[1] != 'm' && s[1] != 'x')) { if (i < last) it[i++] = *s; s++; if (*s == '-' || *s == '+') { diff --git a/thirdparty/opus/analysis.c b/thirdparty/opus/analysis.c index 663431a436..cb46dec582 100644 --- a/thirdparty/opus/analysis.c +++ b/thirdparty/opus/analysis.c @@ -29,20 +29,29 @@ #include "config.h" #endif +#define ANALYSIS_C + +#include <stdio.h> + +#include "mathops.h" #include "kiss_fft.h" #include "celt.h" #include "modes.h" #include "arch.h" #include "quant_bands.h" -#include <stdio.h> #include "analysis.h" #include "mlp.h" #include "stack_alloc.h" +#include "float_cast.h" #ifndef M_PI #define M_PI 3.141592653 #endif +#ifndef DISABLE_FLOAT_API + +#define TRANSITION_PENALTY 10 + static const float dct_table[128] = { 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, 0.250000f, @@ -96,52 +105,118 @@ static const float analysis_window[240] = { }; static const int tbands[NB_TBANDS+1] = { - 2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 68, 80, 96, 120 -}; - -static const int extra_bands[NB_TOT_BANDS+1] = { - 1, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 68, 80, 96, 120, 160, 200 + 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 136, 160, 192, 240 }; -/*static const float tweight[NB_TBANDS+1] = { - .3, .4, .5, .6, .7, .8, .9, 1., 1., 1., 1., 1., 1., 1., .8, .7, .6, .5 -};*/ - #define NB_TONAL_SKIP_BANDS 9 -#define cA 0.43157974f -#define cB 0.67848403f -#define cC 0.08595542f -#define cE ((float)M_PI/2) -static OPUS_INLINE float fast_atan2f(float y, float x) { - float x2, y2; - /* Should avoid underflow on the values we'll get */ - if (ABS16(x)+ABS16(y)<1e-9f) +static opus_val32 silk_resampler_down2_hp( + opus_val32 *S, /* I/O State vector [ 2 ] */ + opus_val32 *out, /* O Output signal [ floor(len/2) ] */ + const opus_val32 *in, /* I Input signal [ len ] */ + int inLen /* I Number of input samples */ +) +{ + int k, len2 = inLen/2; + opus_val32 in32, out32, out32_hp, Y, X; + opus_val64 hp_ener = 0; + /* Internal variables and state are in Q10 format */ + for( k = 0; k < len2; k++ ) { + /* Convert to Q10 */ + in32 = in[ 2 * k ]; + + /* All-pass section for even input sample */ + Y = SUB32( in32, S[ 0 ] ); + X = MULT16_32_Q15(QCONST16(0.6074371f, 15), Y); + out32 = ADD32( S[ 0 ], X ); + S[ 0 ] = ADD32( in32, X ); + out32_hp = out32; + /* Convert to Q10 */ + in32 = in[ 2 * k + 1 ]; + + /* All-pass section for odd input sample, and add to output of previous section */ + Y = SUB32( in32, S[ 1 ] ); + X = MULT16_32_Q15(QCONST16(0.15063f, 15), Y); + out32 = ADD32( out32, S[ 1 ] ); + out32 = ADD32( out32, X ); + S[ 1 ] = ADD32( in32, X ); + + Y = SUB32( -in32, S[ 2 ] ); + X = MULT16_32_Q15(QCONST16(0.15063f, 15), Y); + out32_hp = ADD32( out32_hp, S[ 2 ] ); + out32_hp = ADD32( out32_hp, X ); + S[ 2 ] = ADD32( -in32, X ); + + hp_ener += out32_hp*(opus_val64)out32_hp; + /* Add, convert back to int16 and store to output */ + out[ k ] = HALF32(out32); + } +#ifdef FIXED_POINT + /* len2 can be up to 480, so we shift by 8 more to make it fit. */ + hp_ener = hp_ener >> (2*SIG_SHIFT + 8); +#endif + return (opus_val32)hp_ener; +} + +static opus_val32 downmix_and_resample(downmix_func downmix, const void *_x, opus_val32 *y, opus_val32 S[3], int subframe, int offset, int c1, int c2, int C, int Fs) +{ + VARDECL(opus_val32, tmp); + opus_val32 scale; + int j; + opus_val32 ret = 0; + SAVE_STACK; + + if (subframe==0) return 0; + if (Fs == 48000) { - x*=1e12f; - y*=1e12f; + subframe *= 2; + offset *= 2; + } else if (Fs == 16000) { + subframe = subframe*2/3; + offset = offset*2/3; } - x2 = x*x; - y2 = y*y; - if(x2<y2){ - float den = (y2 + cB*x2) * (y2 + cC*x2); - if (den!=0) - return -x*y*(y2 + cA*x2) / den + (y<0 ? -cE : cE); - else - return (y<0 ? -cE : cE); - }else{ - float den = (x2 + cB*y2) * (x2 + cC*y2); - if (den!=0) - return x*y*(x2 + cA*y2) / den + (y<0 ? -cE : cE) - (x*y<0 ? -cE : cE); - else - return (y<0 ? -cE : cE) - (x*y<0 ? -cE : cE); + ALLOC(tmp, subframe, opus_val32); + + downmix(_x, tmp, subframe, offset, c1, c2, C); +#ifdef FIXED_POINT + scale = (1<<SIG_SHIFT); +#else + scale = 1.f/32768; +#endif + if (c2==-2) + scale /= C; + else if (c2>-1) + scale /= 2; + for (j=0;j<subframe;j++) + tmp[j] *= scale; + if (Fs == 48000) + { + ret = silk_resampler_down2_hp(S, y, tmp, subframe); + } else if (Fs == 24000) { + OPUS_COPY(y, tmp, subframe); + } else if (Fs == 16000) { + VARDECL(opus_val32, tmp3x); + ALLOC(tmp3x, 3*subframe, opus_val32); + /* Don't do this at home! This resampler is horrible and it's only (barely) + usable for the purpose of the analysis because we don't care about all + the aliasing between 8 kHz and 12 kHz. */ + for (j=0;j<subframe;j++) + { + tmp3x[3*j] = tmp[j]; + tmp3x[3*j+1] = tmp[j]; + tmp3x[3*j+2] = tmp[j]; + } + silk_resampler_down2_hp(S, y, tmp3x, 3*subframe); } + RESTORE_STACK; + return ret; } -void tonality_analysis_init(TonalityAnalysisState *tonal) +void tonality_analysis_init(TonalityAnalysisState *tonal, opus_int32 Fs) { /* Initialize reusable fields. */ tonal->arch = opus_select_arch(); + tonal->Fs = Fs; /* Clear remaining fields. */ tonality_analysis_reset(tonal); } @@ -157,15 +232,34 @@ void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, int { int pos; int curr_lookahead; - float psum; + float tonality_max; + float tonality_avg; + int tonality_count; int i; + int pos0; + float prob_avg; + float prob_count; + float prob_min, prob_max; + float vad_prob; + int mpos, vpos; + int bandwidth_span; pos = tonal->read_pos; curr_lookahead = tonal->write_pos-tonal->read_pos; if (curr_lookahead<0) curr_lookahead += DETECT_SIZE; - if (len > 480 && pos != tonal->write_pos) + tonal->read_subframe += len/(tonal->Fs/400); + while (tonal->read_subframe>=8) + { + tonal->read_subframe -= 8; + tonal->read_pos++; + } + if (tonal->read_pos>=DETECT_SIZE) + tonal->read_pos-=DETECT_SIZE; + + /* On long frames, look at the second analysis window rather than the first. */ + if (len > tonal->Fs/50 && pos != tonal->write_pos) { pos++; if (pos==DETECT_SIZE) @@ -175,33 +269,178 @@ void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, int pos--; if (pos<0) pos = DETECT_SIZE-1; + pos0 = pos; OPUS_COPY(info_out, &tonal->info[pos], 1); - tonal->read_subframe += len/120; - while (tonal->read_subframe>=4) + if (!info_out->valid) + return; + tonality_max = tonality_avg = info_out->tonality; + tonality_count = 1; + /* Look at the neighbouring frames and pick largest bandwidth found (to be safe). */ + bandwidth_span = 6; + /* If possible, look ahead for a tone to compensate for the delay in the tone detector. */ + for (i=0;i<3;i++) { - tonal->read_subframe -= 4; - tonal->read_pos++; + pos++; + if (pos==DETECT_SIZE) + pos = 0; + if (pos == tonal->write_pos) + break; + tonality_max = MAX32(tonality_max, tonal->info[pos].tonality); + tonality_avg += tonal->info[pos].tonality; + tonality_count++; + info_out->bandwidth = IMAX(info_out->bandwidth, tonal->info[pos].bandwidth); + bandwidth_span--; } - if (tonal->read_pos>=DETECT_SIZE) - tonal->read_pos-=DETECT_SIZE; + pos = pos0; + /* Look back in time to see if any has a wider bandwidth than the current frame. */ + for (i=0;i<bandwidth_span;i++) + { + pos--; + if (pos < 0) + pos = DETECT_SIZE-1; + if (pos == tonal->write_pos) + break; + info_out->bandwidth = IMAX(info_out->bandwidth, tonal->info[pos].bandwidth); + } + info_out->tonality = MAX32(tonality_avg/tonality_count, tonality_max-.2f); + + mpos = vpos = pos0; + /* If we have enough look-ahead, compensate for the ~5-frame delay in the music prob and + ~1 frame delay in the VAD prob. */ + if (curr_lookahead > 15) + { + mpos += 5; + if (mpos>=DETECT_SIZE) + mpos -= DETECT_SIZE; + vpos += 1; + if (vpos>=DETECT_SIZE) + vpos -= DETECT_SIZE; + } + + /* The following calculations attempt to minimize a "badness function" + for the transition. When switching from speech to music, the badness + of switching at frame k is + b_k = S*v_k + \sum_{i=0}^{k-1} v_i*(p_i - T) + where + v_i is the activity probability (VAD) at frame i, + p_i is the music probability at frame i + T is the probability threshold for switching + S is the penalty for switching during active audio rather than silence + the current frame has index i=0 + + Rather than apply badness to directly decide when to switch, what we compute + instead is the threshold for which the optimal switching point is now. When + considering whether to switch now (frame 0) or at frame k, we have: + S*v_0 = S*v_k + \sum_{i=0}^{k-1} v_i*(p_i - T) + which gives us: + T = ( \sum_{i=0}^{k-1} v_i*p_i + S*(v_k-v_0) ) / ( \sum_{i=0}^{k-1} v_i ) + We take the min threshold across all positive values of k (up to the maximum + amount of lookahead we have) to give us the threshold for which the current + frame is the optimal switch point. + + The last step is that we need to consider whether we want to switch at all. + For that we use the average of the music probability over the entire window. + If the threshold is higher than that average we're not going to + switch, so we compute a min with the average as well. The result of all these + min operations is music_prob_min, which gives the threshold for switching to music + if we're currently encoding for speech. + + We do the exact opposite to compute music_prob_max which is used for switching + from music to speech. + */ + prob_min = 1.f; + prob_max = 0.f; + vad_prob = tonal->info[vpos].activity_probability; + prob_count = MAX16(.1f, vad_prob); + prob_avg = MAX16(.1f, vad_prob)*tonal->info[mpos].music_prob; + while (1) + { + float pos_vad; + mpos++; + if (mpos==DETECT_SIZE) + mpos = 0; + if (mpos == tonal->write_pos) + break; + vpos++; + if (vpos==DETECT_SIZE) + vpos = 0; + if (vpos == tonal->write_pos) + break; + pos_vad = tonal->info[vpos].activity_probability; + prob_min = MIN16((prob_avg - TRANSITION_PENALTY*(vad_prob - pos_vad))/prob_count, prob_min); + prob_max = MAX16((prob_avg + TRANSITION_PENALTY*(vad_prob - pos_vad))/prob_count, prob_max); + prob_count += MAX16(.1f, pos_vad); + prob_avg += MAX16(.1f, pos_vad)*tonal->info[mpos].music_prob; + } + info_out->music_prob = prob_avg/prob_count; + prob_min = MIN16(prob_avg/prob_count, prob_min); + prob_max = MAX16(prob_avg/prob_count, prob_max); + prob_min = MAX16(prob_min, 0.f); + prob_max = MIN16(prob_max, 1.f); + + /* If we don't have enough look-ahead, do our best to make a decent decision. */ + if (curr_lookahead < 10) + { + float pmin, pmax; + pmin = prob_min; + pmax = prob_max; + pos = pos0; + /* Look for min/max in the past. */ + for (i=0;i<IMIN(tonal->count-1, 15);i++) + { + pos--; + if (pos < 0) + pos = DETECT_SIZE-1; + pmin = MIN16(pmin, tonal->info[pos].music_prob); + pmax = MAX16(pmax, tonal->info[pos].music_prob); + } + /* Bias against switching on active audio. */ + pmin = MAX16(0.f, pmin - .1f*vad_prob); + pmax = MIN16(1.f, pmax + .1f*vad_prob); + prob_min += (1.f-.1f*curr_lookahead)*(pmin - prob_min); + prob_max += (1.f-.1f*curr_lookahead)*(pmax - prob_max); + } + info_out->music_prob_min = prob_min; + info_out->music_prob_max = prob_max; - /* Compensate for the delay in the features themselves. - FIXME: Need a better estimate the 10 I just made up */ - curr_lookahead = IMAX(curr_lookahead-10, 0); - - psum=0; - /* Summing the probability of transition patterns that involve music at - time (DETECT_SIZE-curr_lookahead-1) */ - for (i=0;i<DETECT_SIZE-curr_lookahead;i++) - psum += tonal->pmusic[i]; - for (;i<DETECT_SIZE;i++) - psum += tonal->pspeech[i]; - psum = psum*tonal->music_confidence + (1-psum)*tonal->speech_confidence; - /*printf("%f %f %f\n", psum, info_out->music_prob, info_out->tonality);*/ - - info_out->music_prob = psum; + /* printf("%f %f %f %f %f\n", prob_min, prob_max, prob_avg/prob_count, vad_prob, info_out->music_prob); */ } +static const float std_feature_bias[9] = { + 5.684947f, 3.475288f, 1.770634f, 1.599784f, 3.773215f, + 2.163313f, 1.260756f, 1.116868f, 1.918795f +}; + +#define LEAKAGE_OFFSET 2.5f +#define LEAKAGE_SLOPE 2.f + +#ifdef FIXED_POINT +/* For fixed-point, the input is +/-2^15 shifted up by SIG_SHIFT, so we need to + compensate for that in the energy. */ +#define SCALE_COMPENS (1.f/((opus_int32)1<<(15+SIG_SHIFT))) +#define SCALE_ENER(e) ((SCALE_COMPENS*SCALE_COMPENS)*(e)) +#else +#define SCALE_ENER(e) (e) +#endif + +#ifdef FIXED_POINT +static int is_digital_silence32(const opus_val32* pcm, int frame_size, int channels, int lsb_depth) +{ + int silence = 0; + opus_val32 sample_max = 0; +#ifdef MLP_TRAINING + return 0; +#endif + sample_max = celt_maxabs32(pcm, frame_size*channels); + + silence = (sample_max == 0); + (void)lsb_depth; + return silence; +} +#else +#define is_digital_silence32(pcm, frame_size, channels, lsb_depth) is_digital_silence(pcm, frame_size, channels, lsb_depth) +#endif + static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt_mode, const void *x, int len, int offset, int c1, int c2, int C, int lsb_depth, downmix_func downmix) { int i, b; @@ -230,24 +469,50 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt float alpha, alphaE, alphaE2; float frame_loudness; float bandwidth_mask; + int is_masked[NB_TBANDS+1]; int bandwidth=0; float maxE = 0; float noise_floor; int remaining; AnalysisInfo *info; + float hp_ener; + float tonality2[240]; + float midE[8]; + float spec_variability=0; + float band_log2[NB_TBANDS+1]; + float leakage_from[NB_TBANDS+1]; + float leakage_to[NB_TBANDS+1]; + float layer_out[MAX_NEURONS]; + float below_max_pitch; + float above_max_pitch; + int is_silence; SAVE_STACK; - tonal->last_transition++; - alpha = 1.f/IMIN(20, 1+tonal->count); - alphaE = 1.f/IMIN(50, 1+tonal->count); - alphaE2 = 1.f/IMIN(1000, 1+tonal->count); + if (!tonal->initialized) + { + tonal->mem_fill = 240; + tonal->initialized = 1; + } + alpha = 1.f/IMIN(10, 1+tonal->count); + alphaE = 1.f/IMIN(25, 1+tonal->count); + /* Noise floor related decay for bandwidth detection: -2.2 dB/second */ + alphaE2 = 1.f/IMIN(100, 1+tonal->count); + if (tonal->count <= 1) alphaE2 = 1; + + if (tonal->Fs == 48000) + { + /* len and offset are now at 24 kHz. */ + len/= 2; + offset /= 2; + } else if (tonal->Fs == 16000) { + len = 3*len/2; + offset = 3*offset/2; + } - if (tonal->count<4) - tonal->music_prob = .5; kfft = celt_mode->mdct.kfft[0]; - if (tonal->count==0) - tonal->mem_fill = 240; - downmix(x, &tonal->inmem[tonal->mem_fill], IMIN(len, ANALYSIS_BUF_SIZE-tonal->mem_fill), offset, c1, c2, C); + tonal->hp_ener_accum += (float)downmix_and_resample(downmix, x, + &tonal->inmem[tonal->mem_fill], tonal->downmix_state, + IMIN(len, ANALYSIS_BUF_SIZE-tonal->mem_fill), offset, c1, c2, C, tonal->Fs); if (tonal->mem_fill+len < ANALYSIS_BUF_SIZE) { tonal->mem_fill += len; @@ -255,10 +520,13 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt RESTORE_STACK; return; } + hp_ener = tonal->hp_ener_accum; info = &tonal->info[tonal->write_pos++]; if (tonal->write_pos>=DETECT_SIZE) tonal->write_pos-=DETECT_SIZE; + is_silence = is_digital_silence32(tonal->inmem, ANALYSIS_BUF_SIZE, 1, lsb_depth); + ALLOC(in, 480, kiss_fft_cpx); ALLOC(out, 480, kiss_fft_cpx); ALLOC(tonality, 240, float); @@ -273,8 +541,20 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt } OPUS_MOVE(tonal->inmem, tonal->inmem+ANALYSIS_BUF_SIZE-240, 240); remaining = len - (ANALYSIS_BUF_SIZE-tonal->mem_fill); - downmix(x, &tonal->inmem[240], remaining, offset+ANALYSIS_BUF_SIZE-tonal->mem_fill, c1, c2, C); + tonal->hp_ener_accum = (float)downmix_and_resample(downmix, x, + &tonal->inmem[240], tonal->downmix_state, remaining, + offset+ANALYSIS_BUF_SIZE-tonal->mem_fill, c1, c2, C, tonal->Fs); tonal->mem_fill = 240 + remaining; + if (is_silence) + { + /* On silence, copy the previous analysis. */ + int prev_pos = tonal->write_pos-2; + if (prev_pos < 0) + prev_pos += DETECT_SIZE; + OPUS_COPY(info, &tonal->info[prev_pos], 1); + RESTORE_STACK; + return; + } opus_fft(kfft, in, out, tonal->arch); #ifndef FIXED_POINT /* If there's any NaN on the input, the entire output will be NaN, so we only need to check one value. */ @@ -305,24 +585,31 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt d_angle2 = angle2 - angle; d2_angle2 = d_angle2 - d_angle; - mod1 = d2_angle - (float)floor(.5+d2_angle); + mod1 = d2_angle - (float)float2int(d2_angle); noisiness[i] = ABS16(mod1); mod1 *= mod1; mod1 *= mod1; - mod2 = d2_angle2 - (float)floor(.5+d2_angle2); + mod2 = d2_angle2 - (float)float2int(d2_angle2); noisiness[i] += ABS16(mod2); mod2 *= mod2; mod2 *= mod2; - avg_mod = .25f*(d2A[i]+2.f*mod1+mod2); + avg_mod = .25f*(d2A[i]+mod1+2*mod2); + /* This introduces an extra delay of 2 frames in the detection. */ tonality[i] = 1.f/(1.f+40.f*16.f*pi4*avg_mod)-.015f; + /* No delay on this detection, but it's less reliable. */ + tonality2[i] = 1.f/(1.f+40.f*16.f*pi4*mod2)-.015f; A[i] = angle2; dA[i] = d_angle2; d2A[i] = mod2; } - + for (i=2;i<N2-1;i++) + { + float tt = MIN32(tonality2[i], MAX32(tonality2[i-1], tonality2[i+1])); + tonality[i] = .9f*MAX32(tonality[i], tt-.1f); + } frame_tonality = 0; max_frame_tonality = 0; /*tw_sum = 0;*/ @@ -339,6 +626,22 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt } relativeE = 0; frame_loudness = 0; + /* The energy of the very first band is special because of DC. */ + { + float E = 0; + float X1r, X2r; + X1r = 2*(float)out[0].r; + X2r = 2*(float)out[0].i; + E = X1r*X1r + X2r*X2r; + for (i=1;i<4;i++) + { + float binE = out[i].r*(float)out[i].r + out[N-i].r*(float)out[N-i].r + + out[i].i*(float)out[i].i + out[N-i].i*(float)out[N-i].i; + E += binE; + } + E = SCALE_ENER(E); + band_log2[0] = .5f*1.442695f*(float)log(E+1e-10f); + } for (b=0;b<NB_TBANDS;b++) { float E=0, tE=0, nE=0; @@ -348,12 +651,9 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt { float binE = out[i].r*(float)out[i].r + out[N-i].r*(float)out[N-i].r + out[i].i*(float)out[i].i + out[N-i].i*(float)out[N-i].i; -#ifdef FIXED_POINT - /* FIXME: It's probably best to change the BFCC filter initial state instead */ - binE *= 5.55e-17f; -#endif + binE = SCALE_ENER(binE); E += binE; - tE += binE*tonality[i]; + tE += binE*MAX32(0, tonality[i]); nE += binE*2.f*(.5f-noisiness[i]); } #ifndef FIXED_POINT @@ -371,14 +671,27 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt frame_loudness += (float)sqrt(E+1e-10f); logE[b] = (float)log(E+1e-10f); - tonal->lowE[b] = MIN32(logE[b], tonal->lowE[b]+.01f); - tonal->highE[b] = MAX32(logE[b], tonal->highE[b]-.1f); - if (tonal->highE[b] < tonal->lowE[b]+1.f) + band_log2[b+1] = .5f*1.442695f*(float)log(E+1e-10f); + tonal->logE[tonal->E_count][b] = logE[b]; + if (tonal->count==0) + tonal->highE[b] = tonal->lowE[b] = logE[b]; + if (tonal->highE[b] > tonal->lowE[b] + 7.5) { - tonal->highE[b]+=.5f; - tonal->lowE[b]-=.5f; + if (tonal->highE[b] - logE[b] > logE[b] - tonal->lowE[b]) + tonal->highE[b] -= .01f; + else + tonal->lowE[b] += .01f; } - relativeE += (logE[b]-tonal->lowE[b])/(1e-15f+tonal->highE[b]-tonal->lowE[b]); + if (logE[b] > tonal->highE[b]) + { + tonal->highE[b] = logE[b]; + tonal->lowE[b] = MAX32(tonal->highE[b]-15, tonal->lowE[b]); + } else if (logE[b] < tonal->lowE[b]) + { + tonal->lowE[b] = logE[b]; + tonal->highE[b] = MIN32(tonal->lowE[b]+15, tonal->highE[b]); + } + relativeE += (logE[b]-tonal->lowE[b])/(1e-5f + (tonal->highE[b]-tonal->lowE[b])); L1=L2=0; for (i=0;i<NB_FRAMES;i++) @@ -410,45 +723,135 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt tonal->prev_band_tonality[b] = band_tonality[b]; } + leakage_from[0] = band_log2[0]; + leakage_to[0] = band_log2[0] - LEAKAGE_OFFSET; + for (b=1;b<NB_TBANDS+1;b++) + { + float leak_slope = LEAKAGE_SLOPE*(tbands[b]-tbands[b-1])/4; + leakage_from[b] = MIN16(leakage_from[b-1]+leak_slope, band_log2[b]); + leakage_to[b] = MAX16(leakage_to[b-1]-leak_slope, band_log2[b]-LEAKAGE_OFFSET); + } + for (b=NB_TBANDS-2;b>=0;b--) + { + float leak_slope = LEAKAGE_SLOPE*(tbands[b+1]-tbands[b])/4; + leakage_from[b] = MIN16(leakage_from[b+1]+leak_slope, leakage_from[b]); + leakage_to[b] = MAX16(leakage_to[b+1]-leak_slope, leakage_to[b]); + } + celt_assert(NB_TBANDS+1 <= LEAK_BANDS); + for (b=0;b<NB_TBANDS+1;b++) + { + /* leak_boost[] is made up of two terms. The first, based on leakage_to[], + represents the boost needed to overcome the amount of analysis leakage + cause in a weaker band b by louder neighbouring bands. + The second, based on leakage_from[], applies to a loud band b for + which the quantization noise causes synthesis leakage to the weaker + neighbouring bands. */ + float boost = MAX16(0, leakage_to[b] - band_log2[b]) + + MAX16(0, band_log2[b] - (leakage_from[b]+LEAKAGE_OFFSET)); + info->leak_boost[b] = IMIN(255, (int)floor(.5 + 64.f*boost)); + } + for (;b<LEAK_BANDS;b++) info->leak_boost[b] = 0; + + for (i=0;i<NB_FRAMES;i++) + { + int j; + float mindist = 1e15f; + for (j=0;j<NB_FRAMES;j++) + { + int k; + float dist=0; + for (k=0;k<NB_TBANDS;k++) + { + float tmp; + tmp = tonal->logE[i][k] - tonal->logE[j][k]; + dist += tmp*tmp; + } + if (j!=i) + mindist = MIN32(mindist, dist); + } + spec_variability += mindist; + } + spec_variability = (float)sqrt(spec_variability/NB_FRAMES/NB_TBANDS); bandwidth_mask = 0; bandwidth = 0; maxE = 0; noise_floor = 5.7e-4f/(1<<(IMAX(0,lsb_depth-8))); -#ifdef FIXED_POINT - noise_floor *= 1<<(15+SIG_SHIFT); -#endif noise_floor *= noise_floor; - for (b=0;b<NB_TOT_BANDS;b++) + below_max_pitch=0; + above_max_pitch=0; + for (b=0;b<NB_TBANDS;b++) { float E=0; + float Em; int band_start, band_end; /* Keep a margin of 300 Hz for aliasing */ - band_start = extra_bands[b]; - band_end = extra_bands[b+1]; + band_start = tbands[b]; + band_end = tbands[b+1]; for (i=band_start;i<band_end;i++) { float binE = out[i].r*(float)out[i].r + out[N-i].r*(float)out[N-i].r + out[i].i*(float)out[i].i + out[N-i].i*(float)out[N-i].i; E += binE; } + E = SCALE_ENER(E); maxE = MAX32(maxE, E); + if (band_start < 64) + { + below_max_pitch += E; + } else { + above_max_pitch += E; + } tonal->meanE[b] = MAX32((1-alphaE2)*tonal->meanE[b], E); - E = MAX32(E, tonal->meanE[b]); - /* Use a simple follower with 13 dB/Bark slope for spreading function */ - bandwidth_mask = MAX32(.05f*bandwidth_mask, E); + Em = MAX32(E, tonal->meanE[b]); /* Consider the band "active" only if all these conditions are met: - 1) less than 10 dB below the simple follower - 2) less than 90 dB below the peak band (maximal masking possible considering + 1) less than 90 dB below the peak band (maximal masking possible considering both the ATH and the loudness-dependent slope of the spreading function) - 3) above the PCM quantization noise floor + 2) above the PCM quantization noise floor + We use b+1 because the first CELT band isn't included in tbands[] */ - if (E>.1*bandwidth_mask && E*1e9f > maxE && E > noise_floor*(band_end-band_start)) - bandwidth = b; + if (E*1e9f > maxE && (Em > 3*noise_floor*(band_end-band_start) || E > noise_floor*(band_end-band_start))) + bandwidth = b+1; + /* Check if the band is masked (see below). */ + is_masked[b] = E < (tonal->prev_bandwidth >= b+1 ? .01f : .05f)*bandwidth_mask; + /* Use a simple follower with 13 dB/Bark slope for spreading function. */ + bandwidth_mask = MAX32(.05f*bandwidth_mask, E); } + /* Special case for the last two bands, for which we don't have spectrum but only + the energy above 12 kHz. The difficulty here is that the high-pass we use + leaks some LF energy, so we need to increase the threshold without accidentally cutting + off the band. */ + if (tonal->Fs == 48000) { + float noise_ratio; + float Em; + float E = hp_ener*(1.f/(60*60)); + noise_ratio = tonal->prev_bandwidth==20 ? 10.f : 30.f; + +#ifdef FIXED_POINT + /* silk_resampler_down2_hp() shifted right by an extra 8 bits. */ + E *= 256.f*(1.f/Q15ONE)*(1.f/Q15ONE); +#endif + above_max_pitch += E; + tonal->meanE[b] = MAX32((1-alphaE2)*tonal->meanE[b], E); + Em = MAX32(E, tonal->meanE[b]); + if (Em > 3*noise_ratio*noise_floor*160 || E > noise_ratio*noise_floor*160) + bandwidth = 20; + /* Check if the band is masked (see below). */ + is_masked[b] = E < (tonal->prev_bandwidth == 20 ? .01f : .05f)*bandwidth_mask; + } + if (above_max_pitch > below_max_pitch) + info->max_pitch_ratio = below_max_pitch/above_max_pitch; + else + info->max_pitch_ratio = 1; + /* In some cases, resampling aliasing can create a small amount of energy in the first band + being cut. So if the last band is masked, we don't include it. */ + if (bandwidth == 20 && is_masked[NB_TBANDS]) + bandwidth-=2; + else if (bandwidth > 0 && bandwidth <= NB_TBANDS && is_masked[bandwidth-1]) + bandwidth--; if (tonal->count<=2) bandwidth = 20; frame_loudness = 20*(float)log10(frame_loudness); - tonal->Etracker = MAX32(tonal->Etracker-.03f, frame_loudness); + tonal->Etracker = MAX32(tonal->Etracker-.003f, frame_loudness); tonal->lowECount *= (1-alphaE); if (frame_loudness < tonal->Etracker-30) tonal->lowECount += alphaE; @@ -460,11 +863,18 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt sum += dct_table[i*16+b]*logE[b]; BFCC[i] = sum; } + for (i=0;i<8;i++) + { + float sum=0; + for (b=0;b<16;b++) + sum += dct_table[i*16+b]*.5f*(tonal->highE[b]+tonal->lowE[b]); + midE[i] = sum; + } frame_stationarity /= NB_TBANDS; relativeE /= NB_TBANDS; if (tonal->count<10) - relativeE = .5; + relativeE = .5f; frame_noisiness /= NB_TBANDS; #if 1 info->activity = frame_noisiness + (1-frame_noisiness)*relativeE; @@ -479,7 +889,7 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt info->tonality_slope = slope; tonal->E_count = (tonal->E_count+1)%NB_FRAMES; - tonal->count++; + tonal->count = IMIN(tonal->count+1, ANALYSIS_COUNT_MAX); info->tonality = frame_tonality; for (i=0;i<4;i++) @@ -498,6 +908,8 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt for (i=0;i<9;i++) tonal->std[i] = (1-alpha)*tonal->std[i] + alpha*features[i]*features[i]; } + for (i=0;i<4;i++) + features[i] = BFCC[i]-midE[i]; for (i=0;i<8;i++) { @@ -507,136 +919,31 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt tonal->mem[i] = BFCC[i]; } for (i=0;i<9;i++) - features[11+i] = (float)sqrt(tonal->std[i]); - features[20] = info->tonality; - features[21] = info->activity; - features[22] = frame_stationarity; - features[23] = info->tonality_slope; - features[24] = tonal->lowECount; - -#ifndef DISABLE_FLOAT_API - mlp_process(&net, features, frame_probs); - frame_probs[0] = .5f*(frame_probs[0]+1); - /* Curve fitting between the MLP probability and the actual probability */ - frame_probs[0] = .01f + 1.21f*frame_probs[0]*frame_probs[0] - .23f*(float)pow(frame_probs[0], 10); - /* Probability of active audio (as opposed to silence) */ - frame_probs[1] = .5f*frame_probs[1]+.5f; - /* Consider that silence has a 50-50 probability. */ - frame_probs[0] = frame_probs[1]*frame_probs[0] + (1-frame_probs[1])*.5f; - - /*printf("%f %f ", frame_probs[0], frame_probs[1]);*/ - { - /* Probability of state transition */ - float tau; - /* Represents independence of the MLP probabilities, where - beta=1 means fully independent. */ - float beta; - /* Denormalized probability of speech (p0) and music (p1) after update */ - float p0, p1; - /* Probabilities for "all speech" and "all music" */ - float s0, m0; - /* Probability sum for renormalisation */ - float psum; - /* Instantaneous probability of speech and music, with beta pre-applied. */ - float speech0; - float music0; - float p, q; - - /* One transition every 3 minutes of active audio */ - tau = .00005f*frame_probs[1]; - /* Adapt beta based on how "unexpected" the new prob is */ - p = MAX16(.05f,MIN16(.95f,frame_probs[0])); - q = MAX16(.05f,MIN16(.95f,tonal->music_prob)); - beta = .01f+.05f*ABS16(p-q)/(p*(1-q)+q*(1-p)); - /* p0 and p1 are the probabilities of speech and music at this frame - using only information from previous frame and applying the - state transition model */ - p0 = (1-tonal->music_prob)*(1-tau) + tonal->music_prob *tau; - p1 = tonal->music_prob *(1-tau) + (1-tonal->music_prob)*tau; - /* We apply the current probability with exponent beta to work around - the fact that the probability estimates aren't independent. */ - p0 *= (float)pow(1-frame_probs[0], beta); - p1 *= (float)pow(frame_probs[0], beta); - /* Normalise the probabilities to get the Marokv probability of music. */ - tonal->music_prob = p1/(p0+p1); - info->music_prob = tonal->music_prob; - - /* This chunk of code deals with delayed decision. */ - psum=1e-20f; - /* Instantaneous probability of speech and music, with beta pre-applied. */ - speech0 = (float)pow(1-frame_probs[0], beta); - music0 = (float)pow(frame_probs[0], beta); - if (tonal->count==1) - { - tonal->pspeech[0]=.5; - tonal->pmusic [0]=.5; - } - /* Updated probability of having only speech (s0) or only music (m0), - before considering the new observation. */ - s0 = tonal->pspeech[0] + tonal->pspeech[1]; - m0 = tonal->pmusic [0] + tonal->pmusic [1]; - /* Updates s0 and m0 with instantaneous probability. */ - tonal->pspeech[0] = s0*(1-tau)*speech0; - tonal->pmusic [0] = m0*(1-tau)*music0; - /* Propagate the transition probabilities */ - for (i=1;i<DETECT_SIZE-1;i++) - { - tonal->pspeech[i] = tonal->pspeech[i+1]*speech0; - tonal->pmusic [i] = tonal->pmusic [i+1]*music0; - } - /* Probability that the latest frame is speech, when all the previous ones were music. */ - tonal->pspeech[DETECT_SIZE-1] = m0*tau*speech0; - /* Probability that the latest frame is music, when all the previous ones were speech. */ - tonal->pmusic [DETECT_SIZE-1] = s0*tau*music0; - - /* Renormalise probabilities to 1 */ - for (i=0;i<DETECT_SIZE;i++) - psum += tonal->pspeech[i] + tonal->pmusic[i]; - psum = 1.f/psum; - for (i=0;i<DETECT_SIZE;i++) - { - tonal->pspeech[i] *= psum; - tonal->pmusic [i] *= psum; - } - psum = tonal->pmusic[0]; - for (i=1;i<DETECT_SIZE;i++) - psum += tonal->pspeech[i]; - - /* Estimate our confidence in the speech/music decisions */ - if (frame_probs[1]>.75) - { - if (tonal->music_prob>.9) - { - float adapt; - adapt = 1.f/(++tonal->music_confidence_count); - tonal->music_confidence_count = IMIN(tonal->music_confidence_count, 500); - tonal->music_confidence += adapt*MAX16(-.2f,frame_probs[0]-tonal->music_confidence); - } - if (tonal->music_prob<.1) - { - float adapt; - adapt = 1.f/(++tonal->speech_confidence_count); - tonal->speech_confidence_count = IMIN(tonal->speech_confidence_count, 500); - tonal->speech_confidence += adapt*MIN16(.2f,frame_probs[0]-tonal->speech_confidence); - } - } else { - if (tonal->music_confidence_count==0) - tonal->music_confidence = .9f; - if (tonal->speech_confidence_count==0) - tonal->speech_confidence = .1f; - } - } - if (tonal->last_music != (tonal->music_prob>.5f)) - tonal->last_transition=0; - tonal->last_music = tonal->music_prob>.5f; -#else - info->music_prob = 0; -#endif - /*for (i=0;i<25;i++) + features[11+i] = (float)sqrt(tonal->std[i]) - std_feature_bias[i]; + features[18] = spec_variability - 0.78f; + features[20] = info->tonality - 0.154723f; + features[21] = info->activity - 0.724643f; + features[22] = frame_stationarity - 0.743717f; + features[23] = info->tonality_slope + 0.069216f; + features[24] = tonal->lowECount - 0.067930f; + + compute_dense(&layer0, layer_out, features); + compute_gru(&layer1, tonal->rnn_state, layer_out); + compute_dense(&layer2, frame_probs, tonal->rnn_state); + + /* Probability of speech or music vs noise */ + info->activity_probability = frame_probs[1]; + info->music_prob = frame_probs[0]; + + /*printf("%f %f %f\n", frame_probs[0], frame_probs[1], info->music_prob);*/ +#ifdef MLP_TRAINING + for (i=0;i<25;i++) printf("%f ", features[i]); - printf("\n");*/ + printf("\n"); +#endif info->bandwidth = bandwidth; + tonal->prev_bandwidth = bandwidth; /*printf("%d %d\n", info->bandwidth, info->opus_bandwidth);*/ info->noisiness = frame_noisiness; info->valid = 1; @@ -650,23 +957,25 @@ void run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, co int offset; int pcm_len; + analysis_frame_size -= analysis_frame_size&1; if (analysis_pcm != NULL) { /* Avoid overflow/wrap-around of the analysis buffer */ - analysis_frame_size = IMIN((DETECT_SIZE-5)*Fs/100, analysis_frame_size); + analysis_frame_size = IMIN((DETECT_SIZE-5)*Fs/50, analysis_frame_size); pcm_len = analysis_frame_size - analysis->analysis_offset; offset = analysis->analysis_offset; - do { - tonality_analysis(analysis, celt_mode, analysis_pcm, IMIN(480, pcm_len), offset, c1, c2, C, lsb_depth, downmix); - offset += 480; - pcm_len -= 480; - } while (pcm_len>0); + while (pcm_len>0) { + tonality_analysis(analysis, celt_mode, analysis_pcm, IMIN(Fs/50, pcm_len), offset, c1, c2, C, lsb_depth, downmix); + offset += Fs/50; + pcm_len -= Fs/50; + } analysis->analysis_offset = analysis_frame_size; analysis->analysis_offset -= frame_size; } - analysis_info->valid = 0; tonality_get_info(analysis, analysis_info, frame_size); } + +#endif /* DISABLE_FLOAT_API */ diff --git a/thirdparty/opus/analysis.h b/thirdparty/opus/analysis.h index 9eae56a525..0b66555f21 100644 --- a/thirdparty/opus/analysis.h +++ b/thirdparty/opus/analysis.h @@ -30,16 +30,24 @@ #include "celt.h" #include "opus_private.h" +#include "mlp.h" #define NB_FRAMES 8 #define NB_TBANDS 18 -#define NB_TOT_BANDS 21 -#define ANALYSIS_BUF_SIZE 720 /* 15 ms at 48 kHz */ +#define ANALYSIS_BUF_SIZE 720 /* 30 ms at 24 kHz */ -#define DETECT_SIZE 200 +/* At that point we can stop counting frames because it no longer matters. */ +#define ANALYSIS_COUNT_MAX 10000 + +#define DETECT_SIZE 100 + +/* Uncomment this to print the MLP features on stdout. */ +/*#define MLP_TRAINING*/ typedef struct { int arch; + int application; + opus_int32 Fs; #define TONALITY_ANALYSIS_RESET_START angle float angle[240]; float d_angle[240]; @@ -48,35 +56,27 @@ typedef struct { int mem_fill; /* number of usable samples in the buffer */ float prev_band_tonality[NB_TBANDS]; float prev_tonality; + int prev_bandwidth; float E[NB_FRAMES][NB_TBANDS]; + float logE[NB_FRAMES][NB_TBANDS]; float lowE[NB_TBANDS]; float highE[NB_TBANDS]; - float meanE[NB_TOT_BANDS]; + float meanE[NB_TBANDS+1]; float mem[32]; float cmean[8]; float std[9]; - float music_prob; float Etracker; float lowECount; int E_count; - int last_music; - int last_transition; int count; - float subframe_mem[3]; int analysis_offset; - /** Probability of having speech for time i to DETECT_SIZE-1 (and music before). - pspeech[0] is the probability that all frames in the window are speech. */ - float pspeech[DETECT_SIZE]; - /** Probability of having music for time i to DETECT_SIZE-1 (and speech before). - pmusic[0] is the probability that all frames in the window are music. */ - float pmusic[DETECT_SIZE]; - float speech_confidence; - float music_confidence; - int speech_confidence_count; - int music_confidence_count; int write_pos; int read_pos; int read_subframe; + float hp_ener_accum; + int initialized; + float rnn_state[MAX_NEURONS]; + opus_val32 downmix_state[3]; AnalysisInfo info[DETECT_SIZE]; } TonalityAnalysisState; @@ -86,7 +86,7 @@ typedef struct { * not be repeated every analysis step. No allocated memory is retained * by the state struct, so no cleanup call is required. */ -void tonality_analysis_init(TonalityAnalysisState *analysis); +void tonality_analysis_init(TonalityAnalysisState *analysis, opus_int32 Fs); /** Reset a TonalityAnalysisState stuct. * diff --git a/thirdparty/opus/celt/_kiss_fft_guts.h b/thirdparty/opus/celt/_kiss_fft_guts.h index 5e3d58fd66..17392b3e90 100644 --- a/thirdparty/opus/celt/_kiss_fft_guts.h +++ b/thirdparty/opus/celt/_kiss_fft_guts.h @@ -58,12 +58,12 @@ # define S_MUL(a,b) MULT16_32_Q15(b, a) # define C_MUL(m,a,b) \ - do{ (m).r = SUB32(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)); \ - (m).i = ADD32(S_MUL((a).r,(b).i) , S_MUL((a).i,(b).r)); }while(0) + do{ (m).r = SUB32_ovflw(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)); \ + (m).i = ADD32_ovflw(S_MUL((a).r,(b).i) , S_MUL((a).i,(b).r)); }while(0) # define C_MULC(m,a,b) \ - do{ (m).r = ADD32(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)); \ - (m).i = SUB32(S_MUL((a).i,(b).r) , S_MUL((a).r,(b).i)); }while(0) + do{ (m).r = ADD32_ovflw(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)); \ + (m).i = SUB32_ovflw(S_MUL((a).i,(b).r) , S_MUL((a).r,(b).i)); }while(0) # define C_MULBYSCALAR( c, s ) \ do{ (c).r = S_MUL( (c).r , s ) ;\ @@ -77,17 +77,17 @@ DIVSCALAR( (c).i , div); }while (0) #define C_ADD( res, a,b)\ - do {(res).r=ADD32((a).r,(b).r); (res).i=ADD32((a).i,(b).i); \ + do {(res).r=ADD32_ovflw((a).r,(b).r); (res).i=ADD32_ovflw((a).i,(b).i); \ }while(0) #define C_SUB( res, a,b)\ - do {(res).r=SUB32((a).r,(b).r); (res).i=SUB32((a).i,(b).i); \ + do {(res).r=SUB32_ovflw((a).r,(b).r); (res).i=SUB32_ovflw((a).i,(b).i); \ }while(0) #define C_ADDTO( res , a)\ - do {(res).r = ADD32((res).r, (a).r); (res).i = ADD32((res).i,(a).i);\ + do {(res).r = ADD32_ovflw((res).r, (a).r); (res).i = ADD32_ovflw((res).i,(a).i);\ }while(0) #define C_SUBFROM( res , a)\ - do {(res).r = ADD32((res).r,(a).r); (res).i = SUB32((res).i,(a).i); \ + do {(res).r = ADD32_ovflw((res).r,(a).r); (res).i = SUB32_ovflw((res).i,(a).i); \ }while(0) #if defined(OPUS_ARM_INLINE_ASM) diff --git a/thirdparty/opus/celt/arch.h b/thirdparty/opus/celt/arch.h index 8ceab5fe10..08b07db598 100644 --- a/thirdparty/opus/celt/arch.h +++ b/thirdparty/opus/celt/arch.h @@ -46,25 +46,50 @@ # endif # endif +#if OPUS_GNUC_PREREQ(3, 0) +#define opus_likely(x) (__builtin_expect(!!(x), 1)) +#define opus_unlikely(x) (__builtin_expect(!!(x), 0)) +#else +#define opus_likely(x) (!!(x)) +#define opus_unlikely(x) (!!(x)) +#endif + #define CELT_SIG_SCALE 32768.f -#define celt_fatal(str) _celt_fatal(str, __FILE__, __LINE__); -#ifdef ENABLE_ASSERTIONS +#define CELT_FATAL(str) celt_fatal(str, __FILE__, __LINE__); + +#if defined(ENABLE_ASSERTIONS) || defined(ENABLE_HARDENING) +#ifdef __GNUC__ +__attribute__((noreturn)) +#endif +void celt_fatal(const char *str, const char *file, int line); + +#if defined(CELT_C) && !defined(OVERRIDE_celt_fatal) #include <stdio.h> #include <stdlib.h> #ifdef __GNUC__ __attribute__((noreturn)) #endif -static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line) +void celt_fatal(const char *str, const char *file, int line) { fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str); abort(); } -#define celt_assert(cond) {if (!(cond)) {celt_fatal("assertion failed: " #cond);}} -#define celt_assert2(cond, message) {if (!(cond)) {celt_fatal("assertion failed: " #cond "\n" message);}} +#endif + +#define celt_assert(cond) {if (!(cond)) {CELT_FATAL("assertion failed: " #cond);}} +#define celt_assert2(cond, message) {if (!(cond)) {CELT_FATAL("assertion failed: " #cond "\n" message);}} +#define MUST_SUCCEED(call) celt_assert((call) == OPUS_OK) #else #define celt_assert(cond) #define celt_assert2(cond, message) +#define MUST_SUCCEED(call) do {if((call) != OPUS_OK) {RESTORE_STACK; return OPUS_INTERNAL_ERROR;} } while (0) +#endif + +#if defined(ENABLE_ASSERTIONS) +#define celt_sig_assert(cond) {if (!(cond)) {CELT_FATAL("signal assertion failed: " #cond);}} +#else +#define celt_sig_assert(cond) #endif #define IMUL32(a,b) ((a)*(b)) @@ -93,14 +118,20 @@ static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line) typedef opus_int16 opus_val16; typedef opus_int32 opus_val32; +typedef opus_int64 opus_val64; typedef opus_val32 celt_sig; typedef opus_val16 celt_norm; typedef opus_val32 celt_ener; +#define celt_isnan(x) 0 + #define Q15ONE 32767 #define SIG_SHIFT 12 +/* Safe saturation value for 32-bit signals. Should be less than + 2^31*(1-0.85) to avoid blowing up on DC at deemphasis.*/ +#define SIG_SAT (300000000) #define NORM_SCALING 16384 @@ -129,7 +160,7 @@ static OPUS_INLINE opus_int16 SAT16(opus_int32 x) { #ifdef OPUS_ARM_PRESUME_AARCH64_NEON_INTR #include "arm/fixed_arm64.h" -#elif OPUS_ARM_INLINE_EDSP +#elif defined (OPUS_ARM_INLINE_EDSP) #include "arm/fixed_armv5e.h" #elif defined (OPUS_ARM_INLINE_ASM) #include "arm/fixed_armv4.h" @@ -147,6 +178,7 @@ static OPUS_INLINE opus_int16 SAT16(opus_int32 x) { typedef float opus_val16; typedef float opus_val32; +typedef float opus_val64; typedef float celt_sig; typedef float celt_norm; @@ -186,6 +218,7 @@ static OPUS_INLINE int celt_isnan(float x) #define NEG16(x) (-(x)) #define NEG32(x) (-(x)) +#define NEG32_ovflw(x) (-(x)) #define EXTRACT16(x) (x) #define EXTEND32(x) (x) #define SHR16(a,shift) (a) @@ -202,6 +235,7 @@ static OPUS_INLINE int celt_isnan(float x) #define SATURATE16(x) (x) #define ROUND16(a,shift) (a) +#define SROUND16(a,shift) (a) #define HALF16(x) (.5f*(x)) #define HALF32(x) (.5f*(x)) @@ -209,6 +243,8 @@ static OPUS_INLINE int celt_isnan(float x) #define SUB16(a,b) ((a)-(b)) #define ADD32(a,b) ((a)+(b)) #define SUB32(a,b) ((a)-(b)) +#define ADD32_ovflw(a,b) ((a)+(b)) +#define SUB32_ovflw(a,b) ((a)-(b)) #define MULT16_16_16(a,b) ((a)*(b)) #define MULT16_16(a,b) ((opus_val32)(a)*(opus_val32)(b)) #define MAC16_16(c,a,b) ((c)+(opus_val32)(a)*(opus_val32)(b)) @@ -243,9 +279,9 @@ static OPUS_INLINE int celt_isnan(float x) #ifndef GLOBAL_STACK_SIZE #ifdef FIXED_POINT -#define GLOBAL_STACK_SIZE 100000 +#define GLOBAL_STACK_SIZE 120000 #else -#define GLOBAL_STACK_SIZE 100000 +#define GLOBAL_STACK_SIZE 120000 #endif #endif diff --git a/thirdparty/opus/celt/arm/arm2gnu.pl b/thirdparty/opus/celt/arm/arm2gnu.pl index 6c922ac819..a2895f7445 100755 --- a/thirdparty/opus/celt/arm/arm2gnu.pl +++ b/thirdparty/opus/celt/arm/arm2gnu.pl @@ -164,11 +164,11 @@ while (<>) { $prefix = ""; if ($proc) { - $prefix = $prefix.sprintf("\t.type\t%s, %%function; ",$proc) unless ($apple); + $prefix = $prefix.sprintf("\t.type\t%s, %%function", $proc) unless ($apple); # Make sure we $prefix isn't empty here (for the $apple case). # We handle mangling the label here, make sure it doesn't match # the label handling below (if $prefix would be empty). - $prefix = "; "; + $prefix = $prefix."; "; push(@proc_stack, $proc); s/^[A-Za-z_\.]\w+/$symprefix$&:/; } diff --git a/thirdparty/opus/celt/arm/arm_celt_map.c b/thirdparty/opus/celt/arm/arm_celt_map.c index 4d4d069a86..ca988b66f5 100644 --- a/thirdparty/opus/celt/arm/arm_celt_map.c +++ b/thirdparty/opus/celt/arm/arm_celt_map.c @@ -35,12 +35,29 @@ #if defined(OPUS_HAVE_RTCD) +# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR) +opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *x, const opus_val16 *y, int N) = { + celt_inner_prod_c, /* ARMv4 */ + celt_inner_prod_c, /* EDSP */ + celt_inner_prod_c, /* Media */ + celt_inner_prod_neon /* NEON */ +}; + +void (*const DUAL_INNER_PROD_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02, + int N, opus_val32 *xy1, opus_val32 *xy2) = { + dual_inner_prod_c, /* ARMv4 */ + dual_inner_prod_c, /* EDSP */ + dual_inner_prod_c, /* Media */ + dual_inner_prod_neon /* NEON */ +}; +# endif + # if defined(FIXED_POINT) # if ((defined(OPUS_ARM_MAY_HAVE_NEON) && !defined(OPUS_ARM_PRESUME_NEON)) || \ (defined(OPUS_ARM_MAY_HAVE_MEDIA) && !defined(OPUS_ARM_PRESUME_MEDIA)) || \ (defined(OPUS_ARM_MAY_HAVE_EDSP) && !defined(OPUS_ARM_PRESUME_EDSP))) opus_val32 (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *, - const opus_val16 *, opus_val32 *, int , int) = { + const opus_val16 *, opus_val32 *, int, int, int) = { celt_pitch_xcorr_c, /* ARMv4 */ MAY_HAVE_EDSP(celt_pitch_xcorr), /* EDSP */ MAY_HAVE_MEDIA(celt_pitch_xcorr), /* Media */ @@ -51,7 +68,7 @@ opus_val32 (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *, # else /* !FIXED_POINT */ # if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR) void (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *, - const opus_val16 *, opus_val32 *, int, int) = { + const opus_val16 *, opus_val32 *, int, int, int) = { celt_pitch_xcorr_c, /* ARMv4 */ celt_pitch_xcorr_c, /* EDSP */ celt_pitch_xcorr_c, /* Media */ diff --git a/thirdparty/opus/celt/tests/test_unit_types.c b/thirdparty/opus/celt/arm/armopts.s index 67a0fb8ed3..fb9196072a 100644 --- a/thirdparty/opus/celt/tests/test_unit_types.c +++ b/thirdparty/opus/celt/arm/armopts.s @@ -1,5 +1,4 @@ -/* Copyright (c) 2008-2011 Xiph.Org Foundation - Written by Jean-Marc Valin */ +/* Copyright (C) 2013 Mozilla Corporation */ /* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -25,26 +24,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +; Set the following to 1 if we have EDSP instructions +; (LDRD/STRD, etc., ARMv5E and later). +OPUS_ARM_MAY_HAVE_EDSP * -#include "opus_types.h" -#include <stdio.h> +; Set the following to 1 if we have ARMv6 media instructions. +OPUS_ARM_MAY_HAVE_MEDIA * -int main(void) -{ - opus_int16 i = 1; - i <<= 14; - if (i>>14 != 1) - { - fprintf(stderr, "opus_int16 isn't 16 bits\n"); - return 1; - } - if (sizeof(opus_int16)*2 != sizeof(opus_int32)) - { - fprintf(stderr, "16*2 != 32\n"); - return 1; - } - return 0; -} +; Set the following to 1 if we have NEON (some ARMv7) +OPUS_ARM_MAY_HAVE_NEON * + +END diff --git a/thirdparty/opus/celt/arm/celt_ne10_fft.c b/thirdparty/opus/celt/arm/celt_fft_ne10.c index 42d96a7117..ea5fd7808b 100644 --- a/thirdparty/opus/celt/arm/celt_ne10_fft.c +++ b/thirdparty/opus/celt/arm/celt_fft_ne10.c @@ -1,7 +1,7 @@ /* Copyright (c) 2015 Xiph.Org Foundation Written by Viswanath Puttagunta */ /** - @file celt_ne10_fft.c + @file celt_fft_ne10.c @brief ARM Neon optimizations for fft using NE10 library */ @@ -36,7 +36,6 @@ #endif #endif -#include <NE10_init.h> #include <NE10_dsp.h> #include "os_support.h" #include "kiss_fft.h" diff --git a/thirdparty/opus/celt/arm/celt_ne10_mdct.c b/thirdparty/opus/celt/arm/celt_mdct_ne10.c index 293c3efd7a..3531d02d10 100644 --- a/thirdparty/opus/celt/arm/celt_ne10_mdct.c +++ b/thirdparty/opus/celt/arm/celt_mdct_ne10.c @@ -1,7 +1,7 @@ /* Copyright (c) 2015 Xiph.Org Foundation Written by Viswanath Puttagunta */ /** - @file celt_ne10_mdct.c + @file celt_mdct_ne10.c @brief ARM Neon optimizations for mdct using NE10 library */ diff --git a/thirdparty/opus/celt/arm/celt_neon_intr.c b/thirdparty/opus/celt/arm/celt_neon_intr.c index 47bbe3dc22..effda769d0 100644 --- a/thirdparty/opus/celt/arm/celt_neon_intr.c +++ b/thirdparty/opus/celt/arm/celt_neon_intr.c @@ -191,121 +191,21 @@ static void xcorr_kernel_neon_float(const float32_t *x, const float32_t *y, vst1q_f32(sum, SUMM); } -/* - * Function: xcorr_kernel_neon_float_process1 - * --------------------------------- - * Computes single correlation values and stores in *sum - */ -static void xcorr_kernel_neon_float_process1(const float32_t *x, - const float32_t *y, float32_t *sum, int len) { - float32x4_t XX[4]; - float32x4_t YY[4]; - float32x2_t XX_2; - float32x2_t YY_2; - float32x4_t SUMM; - float32x2_t SUMM_2[2]; - const float32_t *xi = x; - const float32_t *yi = y; - - SUMM = vdupq_n_f32(0); - - /* Work on 16 values per iteration */ - while (len >= 16) { - XX[0] = vld1q_f32(xi); - xi += 4; - XX[1] = vld1q_f32(xi); - xi += 4; - XX[2] = vld1q_f32(xi); - xi += 4; - XX[3] = vld1q_f32(xi); - xi += 4; - - YY[0] = vld1q_f32(yi); - yi += 4; - YY[1] = vld1q_f32(yi); - yi += 4; - YY[2] = vld1q_f32(yi); - yi += 4; - YY[3] = vld1q_f32(yi); - yi += 4; - - SUMM = vmlaq_f32(SUMM, YY[0], XX[0]); - SUMM = vmlaq_f32(SUMM, YY[1], XX[1]); - SUMM = vmlaq_f32(SUMM, YY[2], XX[2]); - SUMM = vmlaq_f32(SUMM, YY[3], XX[3]); - len -= 16; - } - - /* Work on 8 values */ - if (len >= 8) { - XX[0] = vld1q_f32(xi); - xi += 4; - XX[1] = vld1q_f32(xi); - xi += 4; - - YY[0] = vld1q_f32(yi); - yi += 4; - YY[1] = vld1q_f32(yi); - yi += 4; - - SUMM = vmlaq_f32(SUMM, YY[0], XX[0]); - SUMM = vmlaq_f32(SUMM, YY[1], XX[1]); - len -= 8; - } - - /* Work on 4 values */ - if (len >= 4) { - XX[0] = vld1q_f32(xi); - xi += 4; - YY[0] = vld1q_f32(yi); - yi += 4; - SUMM = vmlaq_f32(SUMM, YY[0], XX[0]); - len -= 4; - } - - /* Start accumulating results */ - SUMM_2[0] = vget_low_f32(SUMM); - if (len >= 2) { - /* While at it, consume 2 more values if available */ - XX_2 = vld1_f32(xi); - xi += 2; - YY_2 = vld1_f32(yi); - yi += 2; - SUMM_2[0] = vmla_f32(SUMM_2[0], YY_2, XX_2); - len -= 2; - } - SUMM_2[1] = vget_high_f32(SUMM); - SUMM_2[0] = vadd_f32(SUMM_2[0], SUMM_2[1]); - SUMM_2[0] = vpadd_f32(SUMM_2[0], SUMM_2[0]); - /* Ok, now we have result accumulated in SUMM_2[0].0 */ - - if (len > 0) { - /* Case when you have one value left */ - XX_2 = vld1_dup_f32(xi); - YY_2 = vld1_dup_f32(yi); - SUMM_2[0] = vmla_f32(SUMM_2[0], XX_2, YY_2); - } - - vst1_lane_f32(sum, SUMM_2[0], 0); -} - void celt_pitch_xcorr_float_neon(const opus_val16 *_x, const opus_val16 *_y, - opus_val32 *xcorr, int len, int max_pitch) { + opus_val32 *xcorr, int len, int max_pitch, int arch) { int i; + (void)arch; celt_assert(max_pitch > 0); - celt_assert((((unsigned char *)_x-(unsigned char *)NULL)&3)==0); + celt_sig_assert((((unsigned char *)_x-(unsigned char *)NULL)&3)==0); for (i = 0; i < (max_pitch-3); i += 4) { xcorr_kernel_neon_float((const float32_t *)_x, (const float32_t *)_y+i, (float32_t *)xcorr+i, len); } - /* In case max_pitch isn't multiple of 4 - * compute single correlation value per iteration - */ + /* In case max_pitch isn't a multiple of 4, do non-unrolled version. */ for (; i < max_pitch; i++) { - xcorr_kernel_neon_float_process1((const float32_t *)_x, - (const float32_t *)_y+i, (float32_t *)xcorr+i, len); + xcorr[i] = celt_inner_prod_neon(_x, _y+i, len); } } #endif diff --git a/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S b/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S index 5b2ee55a10..10668e54a5 100644 --- a/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S +++ b/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm-gnu.S @@ -44,7 +44,7 @@ .if OPUS_ARM_MAY_HAVE_NEON @ Compute sum[k]=sum(x[j]*y[j+k],j=0...len-1), k=0...3 -; xcorr_kernel_neon: @ PROC + .type xcorr_kernel_neon, %function; xcorr_kernel_neon: @ PROC xcorr_kernel_neon_start: @ input: @ r3 = int len @@ -156,8 +156,8 @@ xcorr_kernel_neon_process1: .size xcorr_kernel_neon, .-xcorr_kernel_neon @ ENDP @ opus_val32 celt_pitch_xcorr_neon(opus_val16 *_x, opus_val16 *_y, -@ opus_val32 *xcorr, int len, int max_pitch) -; celt_pitch_xcorr_neon: @ PROC +@ opus_val32 *xcorr, int len, int max_pitch, int arch) + .type celt_pitch_xcorr_neon, %function; celt_pitch_xcorr_neon: @ PROC @ input: @ r0 = opus_val16 *_x @ r1 = opus_val16 *_y @@ -171,6 +171,8 @@ xcorr_kernel_neon_process1: @ r6 = int max_pitch @ r12 = int j @ q15 = int maxcorr[4] (q15 is not used by xcorr_kernel_neon()) + @ ignored: + @ int arch STMFD sp!, {r4-r6, lr} LDR r6, [sp, #16] VMOV.S32 q15, #1 @@ -260,7 +262,7 @@ celt_pitch_xcorr_neon_done: @ This will get used on ARMv7 devices without NEON, so it has been optimized @ to take advantage of dual-issuing where possible. -; xcorr_kernel_edsp: @ PROC + .type xcorr_kernel_edsp, %function; xcorr_kernel_edsp: @ PROC xcorr_kernel_edsp_start: @ input: @ r3 = int len @@ -344,7 +346,7 @@ xcorr_kernel_edsp_done: LDMFD sp!, {r2,r4,r5,pc} .size xcorr_kernel_edsp, .-xcorr_kernel_edsp @ ENDP -; celt_pitch_xcorr_edsp: @ PROC + .type celt_pitch_xcorr_edsp, %function; celt_pitch_xcorr_edsp: @ PROC @ input: @ r0 = opus_val16 *_x (must be 32-bit aligned) @ r1 = opus_val16 *_y (only needs to be 16-bit aligned) @@ -361,6 +363,8 @@ xcorr_kernel_edsp_done: @ r9 = opus_val32 sum3 @ r1 = int max_pitch @ r12 = int j + @ ignored: + @ int arch STMFD sp!, {r4-r11, lr} MOV r5, r1 LDR r1, [sp, #36] diff --git a/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm.s b/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm.s index f96e0a88bb..6e873afc37 100644 --- a/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm.s +++ b/thirdparty/opus/celt/arm/celt_pitch_xcorr_arm.s @@ -153,7 +153,7 @@ xcorr_kernel_neon_process1 ENDP ; opus_val32 celt_pitch_xcorr_neon(opus_val16 *_x, opus_val16 *_y, -; opus_val32 *xcorr, int len, int max_pitch) +; opus_val32 *xcorr, int len, int max_pitch, int arch) celt_pitch_xcorr_neon PROC ; input: ; r0 = opus_val16 *_x @@ -168,6 +168,8 @@ celt_pitch_xcorr_neon PROC ; r6 = int max_pitch ; r12 = int j ; q15 = int maxcorr[4] (q15 is not used by xcorr_kernel_neon()) + ; ignored: + ; int arch STMFD sp!, {r4-r6, lr} LDR r6, [sp, #16] VMOV.S32 q15, #1 @@ -358,6 +360,8 @@ celt_pitch_xcorr_edsp PROC ; r9 = opus_val32 sum3 ; r1 = int max_pitch ; r12 = int j + ; ignored: + ; int arch STMFD sp!, {r4-r11, lr} MOV r5, r1 LDR r1, [sp, #36] diff --git a/thirdparty/opus/celt/arm/fft_arm.h b/thirdparty/opus/celt/arm/fft_arm.h index 0cb55d8e22..0b78175f3a 100644 --- a/thirdparty/opus/celt/arm/fft_arm.h +++ b/thirdparty/opus/celt/arm/fft_arm.h @@ -34,7 +34,6 @@ #if !defined(FFT_ARM_H) #define FFT_ARM_H -#include "config.h" #include "kiss_fft.h" #if defined(HAVE_ARM_NE10) diff --git a/thirdparty/opus/celt/arm/fixed_armv4.h b/thirdparty/opus/celt/arm/fixed_armv4.h index efb3b1896a..d84888a772 100644 --- a/thirdparty/opus/celt/arm/fixed_armv4.h +++ b/thirdparty/opus/celt/arm/fixed_armv4.h @@ -37,7 +37,7 @@ static OPUS_INLINE opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b) "#MULT16_32_Q16\n\t" "smull %0, %1, %2, %3\n\t" : "=&r"(rd_lo), "=&r"(rd_hi) - : "%r"(b),"r"(a<<16) + : "%r"(b),"r"(SHL32(a,16)) ); return rd_hi; } @@ -54,10 +54,10 @@ static OPUS_INLINE opus_val32 MULT16_32_Q15_armv4(opus_val16 a, opus_val32 b) "#MULT16_32_Q15\n\t" "smull %0, %1, %2, %3\n\t" : "=&r"(rd_lo), "=&r"(rd_hi) - : "%r"(b), "r"(a<<16) + : "%r"(b), "r"(SHL32(a,16)) ); /*We intentionally don't OR in the high bit of rd_lo for speed.*/ - return rd_hi<<1; + return SHL32(rd_hi,1); } #define MULT16_32_Q15(a, b) (MULT16_32_Q15_armv4(a, b)) diff --git a/thirdparty/opus/celt/arm/fixed_armv5e.h b/thirdparty/opus/celt/arm/fixed_armv5e.h index 36a6321101..6bf73cbace 100644 --- a/thirdparty/opus/celt/arm/fixed_armv5e.h +++ b/thirdparty/opus/celt/arm/fixed_armv5e.h @@ -59,7 +59,7 @@ static OPUS_INLINE opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b) : "=r"(res) : "r"(b), "r"(a) ); - return res<<1; + return SHL32(res,1); } #define MULT16_32_Q15(a, b) (MULT16_32_Q15_armv5e(a, b)) @@ -76,7 +76,7 @@ static OPUS_INLINE opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a, "#MAC16_32_Q15\n\t" "smlawb %0, %1, %2, %3;\n" : "=r"(res) - : "r"(b<<1), "r"(a), "r"(c) + : "r"(SHL32(b,1)), "r"(a), "r"(c) ); return res; } diff --git a/thirdparty/opus/celt/arm/mdct_arm.h b/thirdparty/opus/celt/arm/mdct_arm.h index 49cbb44576..14200bac4b 100644 --- a/thirdparty/opus/celt/arm/mdct_arm.h +++ b/thirdparty/opus/celt/arm/mdct_arm.h @@ -33,7 +33,6 @@ #if !defined(MDCT_ARM_H) #define MDCT_ARM_H -#include "config.h" #include "mdct.h" #if defined(HAVE_ARM_NE10) diff --git a/thirdparty/opus/celt/arm/pitch_arm.h b/thirdparty/opus/celt/arm/pitch_arm.h index 14331169ee..bed8b04eac 100644 --- a/thirdparty/opus/celt/arm/pitch_arm.h +++ b/thirdparty/opus/celt/arm/pitch_arm.h @@ -30,11 +30,47 @@ # include "armcpu.h" +# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) +opus_val32 celt_inner_prod_neon(const opus_val16 *x, const opus_val16 *y, int N); +void dual_inner_prod_neon(const opus_val16 *x, const opus_val16 *y01, + const opus_val16 *y02, int N, opus_val32 *xy1, opus_val32 *xy2); + +# if !defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_PRESUME_NEON) +# define OVERRIDE_CELT_INNER_PROD (1) +# define OVERRIDE_DUAL_INNER_PROD (1) +# define celt_inner_prod(x, y, N, arch) ((void)(arch), PRESUME_NEON(celt_inner_prod)(x, y, N)) +# define dual_inner_prod(x, y01, y02, N, xy1, xy2, arch) ((void)(arch), PRESUME_NEON(dual_inner_prod)(x, y01, y02, N, xy1, xy2)) +# endif +# endif + +# if !defined(OVERRIDE_CELT_INNER_PROD) +# if defined(OPUS_HAVE_RTCD) && (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)) +extern opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *x, const opus_val16 *y, int N); +# define OVERRIDE_CELT_INNER_PROD (1) +# define celt_inner_prod(x, y, N, arch) ((*CELT_INNER_PROD_IMPL[(arch)&OPUS_ARCHMASK])(x, y, N)) +# elif defined(OPUS_ARM_PRESUME_NEON_INTR) +# define OVERRIDE_CELT_INNER_PROD (1) +# define celt_inner_prod(x, y, N, arch) ((void)(arch), celt_inner_prod_neon(x, y, N)) +# endif +# endif + +# if !defined(OVERRIDE_DUAL_INNER_PROD) +# if defined(OPUS_HAVE_RTCD) && (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)) +extern void (*const DUAL_INNER_PROD_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *x, + const opus_val16 *y01, const opus_val16 *y02, int N, opus_val32 *xy1, opus_val32 *xy2); +# define OVERRIDE_DUAL_INNER_PROD (1) +# define dual_inner_prod(x, y01, y02, N, xy1, xy2, arch) ((*DUAL_INNER_PROD_IMPL[(arch)&OPUS_ARCHMASK])(x, y01, y02, N, xy1, xy2)) +# elif defined(OPUS_ARM_PRESUME_NEON_INTR) +# define OVERRIDE_DUAL_INNER_PROD (1) +# define dual_inner_prod(x, y01, y02, N, xy1, xy2, arch) ((void)(arch), dual_inner_prod_neon(x, y01, y02, N, xy1, xy2)) +# endif +# endif + # if defined(FIXED_POINT) # if defined(OPUS_ARM_MAY_HAVE_NEON) opus_val32 celt_pitch_xcorr_neon(const opus_val16 *_x, const opus_val16 *_y, - opus_val32 *xcorr, int len, int max_pitch); + opus_val32 *xcorr, int len, int max_pitch, int arch); # endif # if defined(OPUS_ARM_MAY_HAVE_MEDIA) @@ -43,7 +79,7 @@ opus_val32 celt_pitch_xcorr_neon(const opus_val16 *_x, const opus_val16 *_y, # if defined(OPUS_ARM_MAY_HAVE_EDSP) opus_val32 celt_pitch_xcorr_edsp(const opus_val16 *_x, const opus_val16 *_y, - opus_val32 *xcorr, int len, int max_pitch); + opus_val32 *xcorr, int len, int max_pitch, int arch); # endif # if defined(OPUS_HAVE_RTCD) && \ @@ -52,18 +88,17 @@ opus_val32 celt_pitch_xcorr_edsp(const opus_val16 *_x, const opus_val16 *_y, (defined(OPUS_ARM_MAY_HAVE_EDSP) && !defined(OPUS_ARM_PRESUME_EDSP))) extern opus_val32 (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *, - const opus_val16 *, opus_val32 *, int, int); + const opus_val16 *, opus_val32 *, int, int, int); # define OVERRIDE_PITCH_XCORR (1) # define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \ ((*CELT_PITCH_XCORR_IMPL[(arch)&OPUS_ARCHMASK])(_x, _y, \ - xcorr, len, max_pitch)) + xcorr, len, max_pitch, arch)) # elif defined(OPUS_ARM_PRESUME_EDSP) || \ defined(OPUS_ARM_PRESUME_MEDIA) || \ defined(OPUS_ARM_PRESUME_NEON) # define OVERRIDE_PITCH_XCORR (1) -# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \ - ((void)(arch),PRESUME_NEON(celt_pitch_xcorr)(_x, _y, xcorr, len, max_pitch)) +# define celt_pitch_xcorr (PRESUME_NEON(celt_pitch_xcorr)) # endif @@ -99,25 +134,24 @@ extern void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])( /* Float case */ #if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) void celt_pitch_xcorr_float_neon(const opus_val16 *_x, const opus_val16 *_y, - opus_val32 *xcorr, int len, int max_pitch); + opus_val32 *xcorr, int len, int max_pitch, int arch); #endif # if defined(OPUS_HAVE_RTCD) && \ (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)) extern void (*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *, - const opus_val16 *, opus_val32 *, int, int); + const opus_val16 *, opus_val32 *, int, int, int); # define OVERRIDE_PITCH_XCORR (1) # define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \ ((*CELT_PITCH_XCORR_IMPL[(arch)&OPUS_ARCHMASK])(_x, _y, \ - xcorr, len, max_pitch)) + xcorr, len, max_pitch, arch)) # elif defined(OPUS_ARM_PRESUME_NEON_INTR) # define OVERRIDE_PITCH_XCORR (1) -# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \ - ((void)(arch),celt_pitch_xcorr_float_neon(_x, _y, xcorr, len, max_pitch)) +# define celt_pitch_xcorr celt_pitch_xcorr_float_neon # endif diff --git a/thirdparty/opus/celt/arm/pitch_neon_intr.c b/thirdparty/opus/celt/arm/pitch_neon_intr.c new file mode 100644 index 0000000000..1ac38c433a --- /dev/null +++ b/thirdparty/opus/celt/arm/pitch_neon_intr.c @@ -0,0 +1,290 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <arm_neon.h> +#include "pitch.h" + +#ifdef FIXED_POINT + +opus_val32 celt_inner_prod_neon(const opus_val16 *x, const opus_val16 *y, int N) +{ + int i; + opus_val32 xy; + int16x8_t x_s16x8, y_s16x8; + int32x4_t xy_s32x4 = vdupq_n_s32(0); + int64x2_t xy_s64x2; + int64x1_t xy_s64x1; + + for (i = 0; i < N - 7; i += 8) { + x_s16x8 = vld1q_s16(&x[i]); + y_s16x8 = vld1q_s16(&y[i]); + xy_s32x4 = vmlal_s16(xy_s32x4, vget_low_s16 (x_s16x8), vget_low_s16 (y_s16x8)); + xy_s32x4 = vmlal_s16(xy_s32x4, vget_high_s16(x_s16x8), vget_high_s16(y_s16x8)); + } + + if (N - i >= 4) { + const int16x4_t x_s16x4 = vld1_s16(&x[i]); + const int16x4_t y_s16x4 = vld1_s16(&y[i]); + xy_s32x4 = vmlal_s16(xy_s32x4, x_s16x4, y_s16x4); + i += 4; + } + + xy_s64x2 = vpaddlq_s32(xy_s32x4); + xy_s64x1 = vadd_s64(vget_low_s64(xy_s64x2), vget_high_s64(xy_s64x2)); + xy = vget_lane_s32(vreinterpret_s32_s64(xy_s64x1), 0); + + for (; i < N; i++) { + xy = MAC16_16(xy, x[i], y[i]); + } + +#ifdef OPUS_CHECK_ASM + celt_assert(celt_inner_prod_c(x, y, N) == xy); +#endif + + return xy; +} + +void dual_inner_prod_neon(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02, + int N, opus_val32 *xy1, opus_val32 *xy2) +{ + int i; + opus_val32 xy01, xy02; + int16x8_t x_s16x8, y01_s16x8, y02_s16x8; + int32x4_t xy01_s32x4 = vdupq_n_s32(0); + int32x4_t xy02_s32x4 = vdupq_n_s32(0); + int64x2_t xy01_s64x2, xy02_s64x2; + int64x1_t xy01_s64x1, xy02_s64x1; + + for (i = 0; i < N - 7; i += 8) { + x_s16x8 = vld1q_s16(&x[i]); + y01_s16x8 = vld1q_s16(&y01[i]); + y02_s16x8 = vld1q_s16(&y02[i]); + xy01_s32x4 = vmlal_s16(xy01_s32x4, vget_low_s16 (x_s16x8), vget_low_s16 (y01_s16x8)); + xy02_s32x4 = vmlal_s16(xy02_s32x4, vget_low_s16 (x_s16x8), vget_low_s16 (y02_s16x8)); + xy01_s32x4 = vmlal_s16(xy01_s32x4, vget_high_s16(x_s16x8), vget_high_s16(y01_s16x8)); + xy02_s32x4 = vmlal_s16(xy02_s32x4, vget_high_s16(x_s16x8), vget_high_s16(y02_s16x8)); + } + + if (N - i >= 4) { + const int16x4_t x_s16x4 = vld1_s16(&x[i]); + const int16x4_t y01_s16x4 = vld1_s16(&y01[i]); + const int16x4_t y02_s16x4 = vld1_s16(&y02[i]); + xy01_s32x4 = vmlal_s16(xy01_s32x4, x_s16x4, y01_s16x4); + xy02_s32x4 = vmlal_s16(xy02_s32x4, x_s16x4, y02_s16x4); + i += 4; + } + + xy01_s64x2 = vpaddlq_s32(xy01_s32x4); + xy02_s64x2 = vpaddlq_s32(xy02_s32x4); + xy01_s64x1 = vadd_s64(vget_low_s64(xy01_s64x2), vget_high_s64(xy01_s64x2)); + xy02_s64x1 = vadd_s64(vget_low_s64(xy02_s64x2), vget_high_s64(xy02_s64x2)); + xy01 = vget_lane_s32(vreinterpret_s32_s64(xy01_s64x1), 0); + xy02 = vget_lane_s32(vreinterpret_s32_s64(xy02_s64x1), 0); + + for (; i < N; i++) { + xy01 = MAC16_16(xy01, x[i], y01[i]); + xy02 = MAC16_16(xy02, x[i], y02[i]); + } + *xy1 = xy01; + *xy2 = xy02; + +#ifdef OPUS_CHECK_ASM + { + opus_val32 xy1_c, xy2_c; + dual_inner_prod_c(x, y01, y02, N, &xy1_c, &xy2_c); + celt_assert(xy1_c == *xy1); + celt_assert(xy2_c == *xy2); + } +#endif +} + +#else /* !FIXED_POINT */ + +/* ========================================================================== */ + +#ifdef OPUS_CHECK_ASM + +/* This part of code simulates floating-point NEON operations. */ + +/* celt_inner_prod_neon_float_c_simulation() simulates the floating-point */ +/* operations of celt_inner_prod_neon(), and both functions should have bit */ +/* exact output. */ +static opus_val32 celt_inner_prod_neon_float_c_simulation(const opus_val16 *x, const opus_val16 *y, int N) +{ + int i; + opus_val32 xy, xy0 = 0, xy1 = 0, xy2 = 0, xy3 = 0; + for (i = 0; i < N - 3; i += 4) { + xy0 = MAC16_16(xy0, x[i + 0], y[i + 0]); + xy1 = MAC16_16(xy1, x[i + 1], y[i + 1]); + xy2 = MAC16_16(xy2, x[i + 2], y[i + 2]); + xy3 = MAC16_16(xy3, x[i + 3], y[i + 3]); + } + xy0 += xy2; + xy1 += xy3; + xy = xy0 + xy1; + for (; i < N; i++) { + xy = MAC16_16(xy, x[i], y[i]); + } + return xy; +} + +/* dual_inner_prod_neon_float_c_simulation() simulates the floating-point */ +/* operations of dual_inner_prod_neon(), and both functions should have bit */ +/* exact output. */ +static void dual_inner_prod_neon_float_c_simulation(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02, + int N, opus_val32 *xy1, opus_val32 *xy2) +{ + int i; + opus_val32 xy01, xy02, xy01_0 = 0, xy01_1 = 0, xy01_2 = 0, xy01_3 = 0, xy02_0 = 0, xy02_1 = 0, xy02_2 = 0, xy02_3 = 0; + for (i = 0; i < N - 3; i += 4) { + xy01_0 = MAC16_16(xy01_0, x[i + 0], y01[i + 0]); + xy01_1 = MAC16_16(xy01_1, x[i + 1], y01[i + 1]); + xy01_2 = MAC16_16(xy01_2, x[i + 2], y01[i + 2]); + xy01_3 = MAC16_16(xy01_3, x[i + 3], y01[i + 3]); + xy02_0 = MAC16_16(xy02_0, x[i + 0], y02[i + 0]); + xy02_1 = MAC16_16(xy02_1, x[i + 1], y02[i + 1]); + xy02_2 = MAC16_16(xy02_2, x[i + 2], y02[i + 2]); + xy02_3 = MAC16_16(xy02_3, x[i + 3], y02[i + 3]); + } + xy01_0 += xy01_2; + xy02_0 += xy02_2; + xy01_1 += xy01_3; + xy02_1 += xy02_3; + xy01 = xy01_0 + xy01_1; + xy02 = xy02_0 + xy02_1; + for (; i < N; i++) { + xy01 = MAC16_16(xy01, x[i], y01[i]); + xy02 = MAC16_16(xy02, x[i], y02[i]); + } + *xy1 = xy01; + *xy2 = xy02; +} + +#endif /* OPUS_CHECK_ASM */ + +/* ========================================================================== */ + +opus_val32 celt_inner_prod_neon(const opus_val16 *x, const opus_val16 *y, int N) +{ + int i; + opus_val32 xy; + float32x4_t xy_f32x4 = vdupq_n_f32(0); + float32x2_t xy_f32x2; + + for (i = 0; i < N - 7; i += 8) { + float32x4_t x_f32x4, y_f32x4; + x_f32x4 = vld1q_f32(&x[i]); + y_f32x4 = vld1q_f32(&y[i]); + xy_f32x4 = vmlaq_f32(xy_f32x4, x_f32x4, y_f32x4); + x_f32x4 = vld1q_f32(&x[i + 4]); + y_f32x4 = vld1q_f32(&y[i + 4]); + xy_f32x4 = vmlaq_f32(xy_f32x4, x_f32x4, y_f32x4); + } + + if (N - i >= 4) { + const float32x4_t x_f32x4 = vld1q_f32(&x[i]); + const float32x4_t y_f32x4 = vld1q_f32(&y[i]); + xy_f32x4 = vmlaq_f32(xy_f32x4, x_f32x4, y_f32x4); + i += 4; + } + + xy_f32x2 = vadd_f32(vget_low_f32(xy_f32x4), vget_high_f32(xy_f32x4)); + xy_f32x2 = vpadd_f32(xy_f32x2, xy_f32x2); + xy = vget_lane_f32(xy_f32x2, 0); + + for (; i < N; i++) { + xy = MAC16_16(xy, x[i], y[i]); + } + +#ifdef OPUS_CHECK_ASM + celt_assert(ABS32(celt_inner_prod_neon_float_c_simulation(x, y, N) - xy) <= VERY_SMALL); +#endif + + return xy; +} + +void dual_inner_prod_neon(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02, + int N, opus_val32 *xy1, opus_val32 *xy2) +{ + int i; + opus_val32 xy01, xy02; + float32x4_t xy01_f32x4 = vdupq_n_f32(0); + float32x4_t xy02_f32x4 = vdupq_n_f32(0); + float32x2_t xy01_f32x2, xy02_f32x2; + + for (i = 0; i < N - 7; i += 8) { + float32x4_t x_f32x4, y01_f32x4, y02_f32x4; + x_f32x4 = vld1q_f32(&x[i]); + y01_f32x4 = vld1q_f32(&y01[i]); + y02_f32x4 = vld1q_f32(&y02[i]); + xy01_f32x4 = vmlaq_f32(xy01_f32x4, x_f32x4, y01_f32x4); + xy02_f32x4 = vmlaq_f32(xy02_f32x4, x_f32x4, y02_f32x4); + x_f32x4 = vld1q_f32(&x[i + 4]); + y01_f32x4 = vld1q_f32(&y01[i + 4]); + y02_f32x4 = vld1q_f32(&y02[i + 4]); + xy01_f32x4 = vmlaq_f32(xy01_f32x4, x_f32x4, y01_f32x4); + xy02_f32x4 = vmlaq_f32(xy02_f32x4, x_f32x4, y02_f32x4); + } + + if (N - i >= 4) { + const float32x4_t x_f32x4 = vld1q_f32(&x[i]); + const float32x4_t y01_f32x4 = vld1q_f32(&y01[i]); + const float32x4_t y02_f32x4 = vld1q_f32(&y02[i]); + xy01_f32x4 = vmlaq_f32(xy01_f32x4, x_f32x4, y01_f32x4); + xy02_f32x4 = vmlaq_f32(xy02_f32x4, x_f32x4, y02_f32x4); + i += 4; + } + + xy01_f32x2 = vadd_f32(vget_low_f32(xy01_f32x4), vget_high_f32(xy01_f32x4)); + xy02_f32x2 = vadd_f32(vget_low_f32(xy02_f32x4), vget_high_f32(xy02_f32x4)); + xy01_f32x2 = vpadd_f32(xy01_f32x2, xy01_f32x2); + xy02_f32x2 = vpadd_f32(xy02_f32x2, xy02_f32x2); + xy01 = vget_lane_f32(xy01_f32x2, 0); + xy02 = vget_lane_f32(xy02_f32x2, 0); + + for (; i < N; i++) { + xy01 = MAC16_16(xy01, x[i], y01[i]); + xy02 = MAC16_16(xy02, x[i], y02[i]); + } + *xy1 = xy01; + *xy2 = xy02; + +#ifdef OPUS_CHECK_ASM + { + opus_val32 xy1_c, xy2_c; + dual_inner_prod_neon_float_c_simulation(x, y01, y02, N, &xy1_c, &xy2_c); + celt_assert(ABS32(xy1_c - *xy1) <= VERY_SMALL); + celt_assert(ABS32(xy2_c - *xy2) <= VERY_SMALL); + } +#endif +} + +#endif /* FIXED_POINT */ diff --git a/thirdparty/opus/celt/bands.c b/thirdparty/opus/celt/bands.c index 87eaa6c031..2702963c37 100644 --- a/thirdparty/opus/celt/bands.c +++ b/thirdparty/opus/celt/bands.c @@ -65,19 +65,19 @@ opus_uint32 celt_lcg_rand(opus_uint32 seed) /* This is a cos() approximation designed to be bit-exact on any platform. Bit exactness with this approximation is important because it has an impact on the bit allocation */ -static opus_int16 bitexact_cos(opus_int16 x) +opus_int16 bitexact_cos(opus_int16 x) { opus_int32 tmp; opus_int16 x2; tmp = (4096+((opus_int32)(x)*(x)))>>13; - celt_assert(tmp<=32767); + celt_sig_assert(tmp<=32767); x2 = tmp; x2 = (32767-x2) + FRAC_MUL16(x2, (-7651 + FRAC_MUL16(x2, (8277 + FRAC_MUL16(-626, x2))))); - celt_assert(x2<=32766); + celt_sig_assert(x2<=32766); return 1+x2; } -static int bitexact_log2tan(int isin,int icos) +int bitexact_log2tan(int isin,int icos) { int lc; int ls; @@ -92,10 +92,11 @@ static int bitexact_log2tan(int isin,int icos) #ifdef FIXED_POINT /* Compute the amplitude (sqrt energy) in each of the bands */ -void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM) +void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch) { int i, c, N; const opus_int16 *eBands = m->eBands; + (void)arch; N = m->shortMdctSize<<LM; c=0; do { for (i=0;i<end;i++) @@ -155,7 +156,7 @@ void normalise_bands(const CELTMode *m, const celt_sig * OPUS_RESTRICT freq, cel #else /* FIXED_POINT */ /* Compute the amplitude (sqrt energy) in each of the bands */ -void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM) +void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch) { int i, c, N; const opus_int16 *eBands = m->eBands; @@ -164,7 +165,7 @@ void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *band for (i=0;i<end;i++) { opus_val32 sum; - sum = 1e-27f + celt_inner_prod_c(&X[c*N+(eBands[i]<<LM)], &X[c*N+(eBands[i]<<LM)], (eBands[i+1]-eBands[i])<<LM); + sum = 1e-27f + celt_inner_prod(&X[c*N+(eBands[i]<<LM)], &X[c*N+(eBands[i]<<LM)], (eBands[i+1]-eBands[i])<<LM, arch); bandE[i+c*m->nbEBands] = celt_sqrt(sum); /*printf ("%f ", bandE[i+c*m->nbEBands]);*/ } @@ -224,9 +225,9 @@ void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X, #endif j=M*eBands[i]; band_end = M*eBands[i+1]; - lg = ADD16(bandLogE[i], SHL16((opus_val16)eMeans[i],6)); + lg = SATURATE16(ADD32(bandLogE[i], SHL32((opus_val32)eMeans[i],6))); #ifndef FIXED_POINT - g = celt_exp2(lg); + g = celt_exp2(MIN32(32.f, lg)); #else /* Handle the integer part of the log energy */ shift = 16-(lg>>DB_SHIFT); @@ -241,12 +242,12 @@ void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X, /* Handle extreme gains with negative shift. */ if (shift<0) { - /* For shift < -2 we'd be likely to overflow, so we're capping - the gain here. This shouldn't happen unless the bitstream is - already corrupted. */ - if (shift < -2) + /* For shift <= -2 and g > 16384 we'd be likely to overflow, so we're + capping the gain here, which is equivalent to a cap of 18 on lg. + This shouldn't trigger unless the bitstream is already corrupted. */ + if (shift <= -2) { - g = 32767; + g = 16384; shift = -2; } do { @@ -281,7 +282,7 @@ void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_mas N0 = m->eBands[i+1]-m->eBands[i]; /* depth in 1/8 bits */ - celt_assert(pulses[i]>=0); + celt_sig_assert(pulses[i]>=0); depth = celt_udiv(1+pulses[i], (m->eBands[i+1]-m->eBands[i]))>>LM; #ifdef FIXED_POINT @@ -360,6 +361,30 @@ void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_mas } } +/* Compute the weights to use for optimizing normalized distortion across + channels. We use the amplitude to weight square distortion, which means + that we use the square root of the value we would have been using if we + wanted to minimize the MSE in the non-normalized domain. This roughly + corresponds to some quick-and-dirty perceptual experiments I ran to + measure inter-aural masking (there doesn't seem to be any published data + on the topic). */ +static void compute_channel_weights(celt_ener Ex, celt_ener Ey, opus_val16 w[2]) +{ + celt_ener minE; +#ifdef FIXED_POINT + int shift; +#endif + minE = MIN32(Ex, Ey); + /* Adjustment to make the weights a bit more conservative. */ + Ex = ADD32(Ex, minE/3); + Ey = ADD32(Ey, minE/3); +#ifdef FIXED_POINT + shift = celt_ilog2(EPSILON+MAX32(Ex, Ey))-14; +#endif + w[0] = VSHR32(Ex, shift); + w[1] = VSHR32(Ey, shift); +} + static void intensity_stereo(const CELTMode *m, celt_norm * OPUS_RESTRICT X, const celt_norm * OPUS_RESTRICT Y, const celt_ener *bandE, int bandID, int N) { int i = bandID; @@ -453,7 +478,7 @@ static void stereo_merge(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT /* Decide whether we should spread the pulses in the current frame */ int spreading_decision(const CELTMode *m, const celt_norm *X, int *average, int last_decision, int *hf_average, int *tapset_decision, int update_hf, - int end, int C, int M) + int end, int C, int M, const int *spread_weight) { int i, c, N0; int sum = 0, nbBands=0; @@ -494,8 +519,8 @@ int spreading_decision(const CELTMode *m, const celt_norm *X, int *average, if (i>m->nbEBands-4) hf_sum += celt_udiv(32*(tcount[1]+tcount[0]), N); tmp = (2*tcount[2] >= N) + (2*tcount[1] >= N) + (2*tcount[0] >= N); - sum += tmp*256; - nbBands++; + sum += tmp*spread_weight[i]; + nbBands+=spread_weight[i]; } } while (++c<C); @@ -519,7 +544,7 @@ int spreading_decision(const CELTMode *m, const celt_norm *X, int *average, /*printf("%d %d %d\n", hf_sum, *hf_average, *tapset_decision);*/ celt_assert(nbBands>0); /* end has to be non-zero */ celt_assert(sum>=0); - sum = celt_udiv(sum, nbBands); + sum = celt_udiv((opus_int32)sum<<8, nbBands); /* Recursive averaging */ sum = (sum+*average)>>1; *average = sum; @@ -647,6 +672,7 @@ static int compute_qn(int N, int b, int offset, int pulse_cap, int stereo) struct band_ctx { int encode; + int resynth; const CELTMode *m; int i; int intensity; @@ -657,6 +683,9 @@ struct band_ctx { const celt_ener *bandE; opus_uint32 seed; int arch; + int theta_round; + int disable_inv; + int avoid_split_noise; }; struct split_ctx { @@ -714,8 +743,35 @@ static void compute_theta(struct band_ctx *ctx, struct split_ctx *sctx, if (qn!=1) { if (encode) - itheta = (itheta*(opus_int32)qn+8192)>>14; - + { + if (!stereo || ctx->theta_round == 0) + { + itheta = (itheta*(opus_int32)qn+8192)>>14; + if (!stereo && ctx->avoid_split_noise && itheta > 0 && itheta < qn) + { + /* Check if the selected value of theta will cause the bit allocation + to inject noise on one side. If so, make sure the energy of that side + is zero. */ + int unquantized = celt_udiv((opus_int32)itheta*16384, qn); + imid = bitexact_cos((opus_int16)unquantized); + iside = bitexact_cos((opus_int16)(16384-unquantized)); + delta = FRAC_MUL16((N-1)<<7,bitexact_log2tan(iside,imid)); + if (delta > *b) + itheta = qn; + else if (delta < -*b) + itheta = 0; + } + } else { + int down; + /* Bias quantization towards itheta=0 and itheta=16384. */ + int bias = itheta > 8192 ? 32767/qn : -32767/qn; + down = IMIN(qn-1, IMAX(0, (itheta*(opus_int32)qn + bias)>>14)); + if (ctx->theta_round < 0) + itheta = down; + else + itheta = down+1; + } + } /* Entropy coding of the angle. We use a uniform pdf for the time split, a step for stereo, and a triangular one for the rest. */ if (stereo && N>2) @@ -793,7 +849,7 @@ static void compute_theta(struct band_ctx *ctx, struct split_ctx *sctx, } else if (stereo) { if (encode) { - inv = itheta > 8192; + inv = itheta > 8192 && !ctx->disable_inv; if (inv) { int j; @@ -810,6 +866,9 @@ static void compute_theta(struct band_ctx *ctx, struct split_ctx *sctx, inv = ec_dec_bit_logp(ec, 2); } else inv = 0; + /* inv flag override to avoid problems with downmixing. */ + if (ctx->disable_inv) + inv = 0; itheta = 0; } qalloc = ec_tell_frac(ec) - tell; @@ -845,11 +904,6 @@ static void compute_theta(struct band_ctx *ctx, struct split_ctx *sctx, static unsigned quant_band_n1(struct band_ctx *ctx, celt_norm *X, celt_norm *Y, int b, celt_norm *lowband_out) { -#ifdef RESYNTH - int resynth = 1; -#else - int resynth = !ctx->encode; -#endif int c; int stereo; celt_norm *x = X; @@ -874,7 +928,7 @@ static unsigned quant_band_n1(struct band_ctx *ctx, celt_norm *X, celt_norm *Y, ctx->remaining_bits -= 1<<BITRES; b-=1<<BITRES; } - if (resynth) + if (ctx->resynth) x[0] = sign ? -NORM_SCALING : NORM_SCALING; x = Y; } while (++c<1+stereo); @@ -899,11 +953,6 @@ static unsigned quant_partition(struct band_ctx *ctx, celt_norm *X, int B0=B; opus_val16 mid=0, side=0; unsigned cm=0; -#ifdef RESYNTH - int resynth = 1; -#else - int resynth = !ctx->encode; -#endif celt_norm *Y=NULL; int encode; const CELTMode *m; @@ -935,8 +984,7 @@ static unsigned quant_partition(struct band_ctx *ctx, celt_norm *X, fill = (fill&1)|(fill<<1); B = (B+1)>>1; - compute_theta(ctx, &sctx, X, Y, N, &b, B, B0, - LM, 0, &fill); + compute_theta(ctx, &sctx, X, Y, N, &b, B, B0, LM, 0, &fill); imid = sctx.imid; iside = sctx.iside; delta = sctx.delta; @@ -970,24 +1018,20 @@ static unsigned quant_partition(struct band_ctx *ctx, celt_norm *X, rebalance = ctx->remaining_bits; if (mbits >= sbits) { - cm = quant_partition(ctx, X, N, mbits, B, - lowband, LM, + cm = quant_partition(ctx, X, N, mbits, B, lowband, LM, MULT16_16_P15(gain,mid), fill); rebalance = mbits - (rebalance-ctx->remaining_bits); if (rebalance > 3<<BITRES && itheta!=0) sbits += rebalance - (3<<BITRES); - cm |= quant_partition(ctx, Y, N, sbits, B, - next_lowband2, LM, + cm |= quant_partition(ctx, Y, N, sbits, B, next_lowband2, LM, MULT16_16_P15(gain,side), fill>>B)<<(B0>>1); } else { - cm = quant_partition(ctx, Y, N, sbits, B, - next_lowband2, LM, + cm = quant_partition(ctx, Y, N, sbits, B, next_lowband2, LM, MULT16_16_P15(gain,side), fill>>B)<<(B0>>1); rebalance = sbits - (rebalance-ctx->remaining_bits); if (rebalance > 3<<BITRES && itheta!=16384) mbits += rebalance - (3<<BITRES); - cm |= quant_partition(ctx, X, N, mbits, B, - lowband, LM, + cm |= quant_partition(ctx, X, N, mbits, B, lowband, LM, MULT16_16_P15(gain,mid), fill); } } else { @@ -1012,18 +1056,14 @@ static unsigned quant_partition(struct band_ctx *ctx, celt_norm *X, /* Finally do the actual quantization */ if (encode) { - cm = alg_quant(X, N, K, spread, B, ec -#ifdef RESYNTH - , gain -#endif - ); + cm = alg_quant(X, N, K, spread, B, ec, gain, ctx->resynth, ctx->arch); } else { cm = alg_unquant(X, N, K, spread, B, ec, gain); } } else { /* If there's no pulse, fill the band anyway */ int j; - if (resynth) + if (ctx->resynth) { unsigned cm_mask; /* B can be as large as 16, so this shift might overflow an int on a @@ -1080,11 +1120,6 @@ static unsigned quant_band(struct band_ctx *ctx, celt_norm *X, int recombine=0; int longBlocks; unsigned cm=0; -#ifdef RESYNTH - int resynth = 1; -#else - int resynth = !ctx->encode; -#endif int k; int encode; int tf_change; @@ -1151,11 +1186,10 @@ static unsigned quant_band(struct band_ctx *ctx, celt_norm *X, deinterleave_hadamard(lowband, N_B>>recombine, B0<<recombine, longBlocks); } - cm = quant_partition(ctx, X, N, b, B, lowband, - LM, gain, fill); + cm = quant_partition(ctx, X, N, b, B, lowband, LM, gain, fill); /* This code is used by the decoder and by the resynthesis-enabled encoder */ - if (resynth) + if (ctx->resynth) { /* Undo the sample reorganization going from time order to frequency order */ if (B0>1) @@ -1208,11 +1242,6 @@ static unsigned quant_band_stereo(struct band_ctx *ctx, celt_norm *X, celt_norm int inv = 0; opus_val16 mid=0, side=0; unsigned cm=0; -#ifdef RESYNTH - int resynth = 1; -#else - int resynth = !ctx->encode; -#endif int mbits, sbits, delta; int itheta; int qalloc; @@ -1232,8 +1261,7 @@ static unsigned quant_band_stereo(struct band_ctx *ctx, celt_norm *X, celt_norm orig_fill = fill; - compute_theta(ctx, &sctx, X, Y, N, &b, B, B, - LM, 1, &fill); + compute_theta(ctx, &sctx, X, Y, N, &b, B, B, LM, 1, &fill); inv = sctx.inv; imid = sctx.imid; iside = sctx.iside; @@ -1281,13 +1309,13 @@ static unsigned quant_band_stereo(struct band_ctx *ctx, celt_norm *X, celt_norm sign = 1-2*sign; /* We use orig_fill here because we want to fold the side, but if itheta==16384, we'll have cleared the low bits of fill. */ - cm = quant_band(ctx, x2, N, mbits, B, lowband, - LM, lowband_out, Q15ONE, lowband_scratch, orig_fill); + cm = quant_band(ctx, x2, N, mbits, B, lowband, LM, lowband_out, Q15ONE, + lowband_scratch, orig_fill); /* We don't split N=2 bands, so cm is either 1 or 0 (for a fold-collapse), and there's no need to worry about mixing with the other channel. */ y2[0] = -sign*x2[1]; y2[1] = sign*x2[0]; - if (resynth) + if (ctx->resynth) { celt_norm tmp; X[0] = MULT16_16_Q15(mid, X[0]); @@ -1314,38 +1342,32 @@ static unsigned quant_band_stereo(struct band_ctx *ctx, celt_norm *X, celt_norm { /* In stereo mode, we do not apply a scaling to the mid because we need the normalized mid for folding later. */ - cm = quant_band(ctx, X, N, mbits, B, - lowband, LM, lowband_out, - Q15ONE, lowband_scratch, fill); + cm = quant_band(ctx, X, N, mbits, B, lowband, LM, lowband_out, Q15ONE, + lowband_scratch, fill); rebalance = mbits - (rebalance-ctx->remaining_bits); if (rebalance > 3<<BITRES && itheta!=0) sbits += rebalance - (3<<BITRES); /* For a stereo split, the high bits of fill are always zero, so no folding will be done to the side. */ - cm |= quant_band(ctx, Y, N, sbits, B, - NULL, LM, NULL, - side, NULL, fill>>B); + cm |= quant_band(ctx, Y, N, sbits, B, NULL, LM, NULL, side, NULL, fill>>B); } else { /* For a stereo split, the high bits of fill are always zero, so no folding will be done to the side. */ - cm = quant_band(ctx, Y, N, sbits, B, - NULL, LM, NULL, - side, NULL, fill>>B); + cm = quant_band(ctx, Y, N, sbits, B, NULL, LM, NULL, side, NULL, fill>>B); rebalance = sbits - (rebalance-ctx->remaining_bits); if (rebalance > 3<<BITRES && itheta!=16384) mbits += rebalance - (3<<BITRES); /* In stereo mode, we do not apply a scaling to the mid because we need the normalized mid for folding later. */ - cm |= quant_band(ctx, X, N, mbits, B, - lowband, LM, lowband_out, - Q15ONE, lowband_scratch, fill); + cm |= quant_band(ctx, X, N, mbits, B, lowband, LM, lowband_out, Q15ONE, + lowband_scratch, fill); } } /* This code is used by the decoder and by the resynthesis-enabled encoder */ - if (resynth) + if (ctx->resynth) { if (N!=2) stereo_merge(X, Y, mid, N, ctx->arch); @@ -1359,19 +1381,38 @@ static unsigned quant_band_stereo(struct band_ctx *ctx, celt_norm *X, celt_norm return cm; } +static void special_hybrid_folding(const CELTMode *m, celt_norm *norm, celt_norm *norm2, int start, int M, int dual_stereo) +{ + int n1, n2; + const opus_int16 * OPUS_RESTRICT eBands = m->eBands; + n1 = M*(eBands[start+1]-eBands[start]); + n2 = M*(eBands[start+2]-eBands[start+1]); + /* Duplicate enough of the first band folding data to be able to fold the second band. + Copies no data for CELT-only mode. */ + OPUS_COPY(&norm[n1], &norm[2*n1 - n2], n2-n1); + if (dual_stereo) + OPUS_COPY(&norm2[n1], &norm2[2*n1 - n2], n2-n1); +} void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_norm *X_, celt_norm *Y_, unsigned char *collapse_masks, const celt_ener *bandE, int *pulses, int shortBlocks, int spread, int dual_stereo, int intensity, int *tf_res, opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int LM, int codedBands, - opus_uint32 *seed, int arch) + opus_uint32 *seed, int complexity, int arch, int disable_inv) { int i; opus_int32 remaining_bits; const opus_int16 * OPUS_RESTRICT eBands = m->eBands; celt_norm * OPUS_RESTRICT norm, * OPUS_RESTRICT norm2; VARDECL(celt_norm, _norm); + VARDECL(celt_norm, _lowband_scratch); + VARDECL(celt_norm, X_save); + VARDECL(celt_norm, Y_save); + VARDECL(celt_norm, X_save2); + VARDECL(celt_norm, Y_save2); + VARDECL(celt_norm, norm_save2); + int resynth_alloc; celt_norm *lowband_scratch; int B; int M; @@ -1379,10 +1420,11 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, int update_lowband = 1; int C = Y_ != NULL ? 2 : 1; int norm_offset; + int theta_rdo = encode && Y_!=NULL && !dual_stereo && complexity>=8; #ifdef RESYNTH int resynth = 1; #else - int resynth = !encode; + int resynth = !encode || theta_rdo; #endif struct band_ctx ctx; SAVE_STACK; @@ -1395,9 +1437,24 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, ALLOC(_norm, C*(M*eBands[m->nbEBands-1]-norm_offset), celt_norm); norm = _norm; norm2 = norm + M*eBands[m->nbEBands-1]-norm_offset; - /* We can use the last band as scratch space because we don't need that - scratch space for the last band. */ - lowband_scratch = X_+M*eBands[m->nbEBands-1]; + + /* For decoding, we can use the last band as scratch space because we don't need that + scratch space for the last band and we don't care about the data there until we're + decoding the last band. */ + if (encode && resynth) + resynth_alloc = M*(eBands[m->nbEBands]-eBands[m->nbEBands-1]); + else + resynth_alloc = ALLOC_NONE; + ALLOC(_lowband_scratch, resynth_alloc, celt_norm); + if (encode && resynth) + lowband_scratch = _lowband_scratch; + else + lowband_scratch = X_+M*eBands[m->nbEBands-1]; + ALLOC(X_save, resynth_alloc, celt_norm); + ALLOC(Y_save, resynth_alloc, celt_norm); + ALLOC(X_save2, resynth_alloc, celt_norm); + ALLOC(Y_save2, resynth_alloc, celt_norm); + ALLOC(norm_save2, resynth_alloc, celt_norm); lowband_offset = 0; ctx.bandE = bandE; @@ -1408,6 +1465,11 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, ctx.seed = *seed; ctx.spread = spread; ctx.arch = arch; + ctx.disable_inv = disable_inv; + ctx.resynth = resynth; + ctx.theta_round = 0; + /* Avoid injecting noise in the first band on transients. */ + ctx.avoid_split_noise = B > 1; for (i=start;i<end;i++) { opus_int32 tell; @@ -1430,6 +1492,7 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, else Y = NULL; N = M*eBands[i+1]-M*eBands[i]; + celt_assert(N > 0); tell = ec_tell_frac(ec); /* Compute how many bits we want to allocate to this band */ @@ -1445,8 +1508,15 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, b = 0; } +#ifndef DISABLE_UPDATE_DRAFT + if (resynth && (M*eBands[i]-N >= M*eBands[start] || i==start+1) && (update_lowband || lowband_offset==0)) + lowband_offset = i; + if (i == start+1) + special_hybrid_folding(m, norm, norm2, start, M, dual_stereo); +#else if (resynth && M*eBands[i]-N >= M*eBands[start] && (update_lowband || lowband_offset==0)) lowband_offset = i; +#endif tf_change = tf_res[i]; ctx.tf_change = tf_change; @@ -1457,7 +1527,7 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, Y = norm; lowband_scratch = NULL; } - if (i==end-1) + if (last && !theta_rdo) lowband_scratch = NULL; /* Get a conservative estimate of the collapse_mask's for the bands we're @@ -1472,7 +1542,11 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, fold_start = lowband_offset; while(M*eBands[--fold_start] > effective_lowband+norm_offset); fold_end = lowband_offset-1; +#ifndef DISABLE_UPDATE_DRAFT + while(++fold_end < i && M*eBands[fold_end] < effective_lowband+norm_offset+N); +#else while(M*eBands[++fold_end] < effective_lowband+norm_offset+N); +#endif x_cm = y_cm = 0; fold_i = fold_start; do { x_cm |= collapse_masks[fold_i*C+0]; @@ -1505,13 +1579,79 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, } else { if (Y!=NULL) { - x_cm = quant_band_stereo(&ctx, X, Y, N, b, B, - effective_lowband != -1 ? norm+effective_lowband : NULL, LM, - last?NULL:norm+M*eBands[i]-norm_offset, lowband_scratch, x_cm|y_cm); + if (theta_rdo && i < intensity) + { + ec_ctx ec_save, ec_save2; + struct band_ctx ctx_save, ctx_save2; + opus_val32 dist0, dist1; + unsigned cm, cm2; + int nstart_bytes, nend_bytes, save_bytes; + unsigned char *bytes_buf; + unsigned char bytes_save[1275]; + opus_val16 w[2]; + compute_channel_weights(bandE[i], bandE[i+m->nbEBands], w); + /* Make a copy. */ + cm = x_cm|y_cm; + ec_save = *ec; + ctx_save = ctx; + OPUS_COPY(X_save, X, N); + OPUS_COPY(Y_save, Y, N); + /* Encode and round down. */ + ctx.theta_round = -1; + x_cm = quant_band_stereo(&ctx, X, Y, N, b, B, + effective_lowband != -1 ? norm+effective_lowband : NULL, LM, + last?NULL:norm+M*eBands[i]-norm_offset, lowband_scratch, cm); + dist0 = MULT16_32_Q15(w[0], celt_inner_prod(X_save, X, N, arch)) + MULT16_32_Q15(w[1], celt_inner_prod(Y_save, Y, N, arch)); + + /* Save first result. */ + cm2 = x_cm; + ec_save2 = *ec; + ctx_save2 = ctx; + OPUS_COPY(X_save2, X, N); + OPUS_COPY(Y_save2, Y, N); + if (!last) + OPUS_COPY(norm_save2, norm+M*eBands[i]-norm_offset, N); + nstart_bytes = ec_save.offs; + nend_bytes = ec_save.storage; + bytes_buf = ec_save.buf+nstart_bytes; + save_bytes = nend_bytes-nstart_bytes; + OPUS_COPY(bytes_save, bytes_buf, save_bytes); + + /* Restore */ + *ec = ec_save; + ctx = ctx_save; + OPUS_COPY(X, X_save, N); + OPUS_COPY(Y, Y_save, N); +#ifndef DISABLE_UPDATE_DRAFT + if (i == start+1) + special_hybrid_folding(m, norm, norm2, start, M, dual_stereo); +#endif + /* Encode and round up. */ + ctx.theta_round = 1; + x_cm = quant_band_stereo(&ctx, X, Y, N, b, B, + effective_lowband != -1 ? norm+effective_lowband : NULL, LM, + last?NULL:norm+M*eBands[i]-norm_offset, lowband_scratch, cm); + dist1 = MULT16_32_Q15(w[0], celt_inner_prod(X_save, X, N, arch)) + MULT16_32_Q15(w[1], celt_inner_prod(Y_save, Y, N, arch)); + if (dist0 >= dist1) { + x_cm = cm2; + *ec = ec_save2; + ctx = ctx_save2; + OPUS_COPY(X, X_save2, N); + OPUS_COPY(Y, Y_save2, N); + if (!last) + OPUS_COPY(norm+M*eBands[i]-norm_offset, norm_save2, N); + OPUS_COPY(bytes_buf, bytes_save, save_bytes); + } + } else { + ctx.theta_round = 0; + x_cm = quant_band_stereo(&ctx, X, Y, N, b, B, + effective_lowband != -1 ? norm+effective_lowband : NULL, LM, + last?NULL:norm+M*eBands[i]-norm_offset, lowband_scratch, x_cm|y_cm); + } } else { x_cm = quant_band(&ctx, X, N, b, B, effective_lowband != -1 ? norm+effective_lowband : NULL, LM, - last?NULL:norm+M*eBands[i]-norm_offset, Q15ONE, lowband_scratch, x_cm|y_cm); + last?NULL:norm+M*eBands[i]-norm_offset, Q15ONE, lowband_scratch, x_cm|y_cm); } y_cm = x_cm; } @@ -1521,6 +1661,9 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, /* Update the folding position only as long as we have 1 bit/sample depth. */ update_lowband = b>(N<<BITRES); + /* We only need to avoid noise on a split for the first band. After that, we + have folding. */ + ctx.avoid_split_noise = 0; } *seed = ctx.seed; diff --git a/thirdparty/opus/celt/bands.h b/thirdparty/opus/celt/bands.h index e8bef4bad0..422b32cf75 100644 --- a/thirdparty/opus/celt/bands.h +++ b/thirdparty/opus/celt/bands.h @@ -36,12 +36,15 @@ #include "entdec.h" #include "rate.h" +opus_int16 bitexact_cos(opus_int16 x); +int bitexact_log2tan(int isin,int icos); + /** Compute the amplitude (sqrt energy) in each of the bands * @param m Mode data * @param X Spectrum * @param bandE Square root of the energy for each band (returned) */ -void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM); +void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch); /*void compute_noise_energies(const CELTMode *m, const celt_sig *X, const opus_val16 *tonality, celt_ener *bandE);*/ @@ -69,7 +72,7 @@ void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X, int spreading_decision(const CELTMode *m, const celt_norm *X, int *average, int last_decision, int *hf_average, int *tapset_decision, int update_hf, - int end, int C, int M); + int end, int C, int M, const int *spread_weight); #ifdef MEASURE_NORM_MSE void measure_norm_mse(const CELTMode *m, float *X, float *X0, float *bandE, float *bandE0, int M, int N, int C); @@ -105,7 +108,7 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, const celt_ener *bandE, int *pulses, int shortBlocks, int spread, int dual_stereo, int intensity, int *tf_res, opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed, - int arch); + int complexity, int arch, int disable_inv); void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size, int start, diff --git a/thirdparty/opus/celt/celt.c b/thirdparty/opus/celt/celt.c index b121c51a1f..9ce234695c 100644 --- a/thirdparty/opus/celt/celt.c +++ b/thirdparty/opus/celt/celt.c @@ -111,26 +111,31 @@ void comb_filter_const_c(opus_val32 *y, opus_val32 *x, int T, int N, t = MAC16_32_Q16(x[i], g10, x2); t = MAC16_32_Q16(t, g11, ADD32(x1,x3)); t = MAC16_32_Q16(t, g12, ADD32(x0,x4)); + t = SATURATE(t, SIG_SAT); y[i] = t; x4=SHL32(x[i-T+3],1); t = MAC16_32_Q16(x[i+1], g10, x1); t = MAC16_32_Q16(t, g11, ADD32(x0,x2)); t = MAC16_32_Q16(t, g12, ADD32(x4,x3)); + t = SATURATE(t, SIG_SAT); y[i+1] = t; x3=SHL32(x[i-T+4],1); t = MAC16_32_Q16(x[i+2], g10, x0); t = MAC16_32_Q16(t, g11, ADD32(x4,x1)); t = MAC16_32_Q16(t, g12, ADD32(x3,x2)); + t = SATURATE(t, SIG_SAT); y[i+2] = t; x2=SHL32(x[i-T+5],1); t = MAC16_32_Q16(x[i+3], g10, x4); t = MAC16_32_Q16(t, g11, ADD32(x3,x0)); t = MAC16_32_Q16(t, g12, ADD32(x2,x1)); + t = SATURATE(t, SIG_SAT); y[i+3] = t; x1=SHL32(x[i-T+6],1); t = MAC16_32_Q16(x[i+4], g10, x3); t = MAC16_32_Q16(t, g11, ADD32(x2,x4)); t = MAC16_32_Q16(t, g12, ADD32(x1,x0)); + t = SATURATE(t, SIG_SAT); y[i+4] = t; } #ifdef CUSTOM_MODES @@ -141,6 +146,7 @@ void comb_filter_const_c(opus_val32 *y, opus_val32 *x, int T, int N, t = MAC16_32_Q16(x[i], g10, x2); t = MAC16_32_Q16(t, g11, ADD32(x1,x3)); t = MAC16_32_Q16(t, g12, ADD32(x0,x4)); + t = SATURATE(t, SIG_SAT); y[i] = t; x4=x3; x3=x2; @@ -169,6 +175,7 @@ void comb_filter_const_c(opus_val32 *y, opus_val32 *x, int T, int N, + MULT16_32_Q15(g10,x2) + MULT16_32_Q15(g11,ADD32(x1,x3)) + MULT16_32_Q15(g12,ADD32(x0,x4)); + y[i] = SATURATE(y[i], SIG_SAT); x4=x3; x3=x2; x2=x1; @@ -200,6 +207,10 @@ void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N, OPUS_MOVE(y, x, N); return; } + /* When the gain is zero, T0 and/or T1 is set to zero. We need + to have then be at least 2 to avoid processing garbage data. */ + T0 = IMAX(T0, COMBFILTER_MINPERIOD); + T1 = IMAX(T1, COMBFILTER_MINPERIOD); g00 = MULT16_16_P15(g0, gains[tapset0][0]); g01 = MULT16_16_P15(g0, gains[tapset0][1]); g02 = MULT16_16_P15(g0, gains[tapset0][2]); @@ -225,6 +236,7 @@ void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N, + MULT16_32_Q15(MULT16_16_Q15(f,g10),x2) + MULT16_32_Q15(MULT16_16_Q15(f,g11),ADD32(x1,x3)) + MULT16_32_Q15(MULT16_16_Q15(f,g12),ADD32(x0,x4)); + y[i] = SATURATE(y[i], SIG_SAT); x4=x3; x3=x2; x2=x1; @@ -244,11 +256,16 @@ void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N, } #endif /* OVERRIDE_comb_filter */ +/* TF change table. Positive values mean better frequency resolution (longer + effective window), whereas negative values mean better time resolution + (shorter effective window). The second index is computed as: + 4*isTransient + 2*tf_select + per_band_flag */ const signed char tf_select_table[4][8] = { - {0, -1, 0, -1, 0,-1, 0,-1}, - {0, -1, 0, -2, 1, 0, 1,-1}, - {0, -2, 0, -3, 2, 0, 1,-1}, - {0, -2, 0, -3, 3, 0, 1,-1}, + /*isTransient=0 isTransient=1 */ + {0, -1, 0, -1, 0,-1, 0,-1}, /* 2.5 ms */ + {0, -1, 0, -2, 1, 0, 1,-1}, /* 5 ms */ + {0, -2, 0, -3, 2, 0, 1,-1}, /* 10 ms */ + {0, -2, 0, -3, 3, 0, 1,-1}, /* 20 ms */ }; diff --git a/thirdparty/opus/celt/celt.h b/thirdparty/opus/celt/celt.h index d1f7eb690d..24b6b2b520 100644 --- a/thirdparty/opus/celt/celt.h +++ b/thirdparty/opus/celt/celt.h @@ -50,6 +50,8 @@ extern "C" { #define CELTDecoder OpusCustomDecoder #define CELTMode OpusCustomMode +#define LEAK_BANDS 19 + typedef struct { int valid; float tonality; @@ -57,17 +59,27 @@ typedef struct { float noisiness; float activity; float music_prob; - int bandwidth; -}AnalysisInfo; + float music_prob_min; + float music_prob_max; + int bandwidth; + float activity_probability; + float max_pitch_ratio; + /* Store as Q6 char to save space. */ + unsigned char leak_boost[LEAK_BANDS]; +} AnalysisInfo; + +typedef struct { + int signalType; + int offset; +} SILKInfo; #define __celt_check_mode_ptr_ptr(ptr) ((ptr) + ((ptr) - (const CELTMode**)(ptr))) #define __celt_check_analysis_ptr(ptr) ((ptr) + ((ptr) - (const AnalysisInfo*)(ptr))) -/* Encoder/decoder Requests */ +#define __celt_check_silkinfo_ptr(ptr) ((ptr) + ((ptr) - (const SILKInfo*)(ptr))) -/* Expose this option again when variable framesize actually works */ -#define OPUS_FRAMESIZE_VARIABLE 5010 /**< Optimize the frame size dynamically */ +/* Encoder/decoder Requests */ #define CELT_SET_PREDICTION_REQUEST 10002 @@ -116,6 +128,9 @@ typedef struct { #define OPUS_SET_ENERGY_MASK_REQUEST 10026 #define OPUS_SET_ENERGY_MASK(x) OPUS_SET_ENERGY_MASK_REQUEST, __opus_check_val16_ptr(x) +#define CELT_SET_SILK_INFO_REQUEST 10028 +#define CELT_SET_SILK_INFO(x) CELT_SET_SILK_INFO_REQUEST, __celt_check_silkinfo_ptr(x) + /* Encoder stuff */ int celt_encoder_get_size(int channels); @@ -194,6 +209,13 @@ static OPUS_INLINE int fromOpus(unsigned char c) extern const signed char tf_select_table[4][8]; +#if defined(ENABLE_HARDENING) || defined(ENABLE_ASSERTIONS) +void validate_celt_decoder(CELTDecoder *st); +#define VALIDATE_CELT_DECODER(st) validate_celt_decoder(st) +#else +#define VALIDATE_CELT_DECODER(st) +#endif + int resampling_factor(opus_int32 rate); void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RESTRICT inp, diff --git a/thirdparty/opus/celt/celt_decoder.c b/thirdparty/opus/celt/celt_decoder.c index b978bb34d1..e6efce9358 100644 --- a/thirdparty/opus/celt/celt_decoder.c +++ b/thirdparty/opus/celt/celt_decoder.c @@ -51,6 +51,14 @@ #include "celt_lpc.h" #include "vq.h" +/* The maximum pitch lag to allow in the pitch-based PLC. It's possible to save + CPU time in the PLC pitch search by making this smaller than MAX_PERIOD. The + current value corresponds to a pitch of 66.67 Hz. */ +#define PLC_PITCH_LAG_MAX (720) +/* The minimum pitch lag to allow in the pitch-based PLC. This corresponds to a + pitch of 480 Hz. */ +#define PLC_PITCH_LAG_MIN (100) + #if defined(SMALL_FOOTPRINT) && defined(FIXED_POINT) #define NORM_ALIASING_HACK #endif @@ -73,6 +81,7 @@ struct OpusCustomDecoder { int downsample; int start, end; int signalling; + int disable_inv; int arch; /* Everything beyond this point gets cleared on a reset */ @@ -100,6 +109,38 @@ struct OpusCustomDecoder { /* opus_val16 backgroundLogE[], Size = 2*mode->nbEBands */ }; +#if defined(ENABLE_HARDENING) || defined(ENABLE_ASSERTIONS) +/* Make basic checks on the CELT state to ensure we don't end + up writing all over memory. */ +void validate_celt_decoder(CELTDecoder *st) +{ +#ifndef CUSTOM_MODES + celt_assert(st->mode == opus_custom_mode_create(48000, 960, NULL)); + celt_assert(st->overlap == 120); +#endif + celt_assert(st->channels == 1 || st->channels == 2); + celt_assert(st->stream_channels == 1 || st->stream_channels == 2); + celt_assert(st->downsample > 0); + celt_assert(st->start == 0 || st->start == 17); + celt_assert(st->start < st->end); + celt_assert(st->end <= 21); +#ifdef OPUS_ARCHMASK + celt_assert(st->arch >= 0); + celt_assert(st->arch <= OPUS_ARCHMASK); +#endif + celt_assert(st->last_pitch_index <= PLC_PITCH_LAG_MAX); + celt_assert(st->last_pitch_index >= PLC_PITCH_LAG_MIN || st->last_pitch_index == 0); + celt_assert(st->postfilter_period < MAX_PERIOD); + celt_assert(st->postfilter_period >= COMBFILTER_MINPERIOD || st->postfilter_period == 0); + celt_assert(st->postfilter_period_old < MAX_PERIOD); + celt_assert(st->postfilter_period_old >= COMBFILTER_MINPERIOD || st->postfilter_period_old == 0); + celt_assert(st->postfilter_tapset <= 2); + celt_assert(st->postfilter_tapset >= 0); + celt_assert(st->postfilter_tapset_old <= 2); + celt_assert(st->postfilter_tapset_old >= 0); +} +#endif + int celt_decoder_get_size(int channels) { const CELTMode *mode = opus_custom_mode_create(48000, 960, NULL); @@ -163,6 +204,11 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMod st->start = 0; st->end = st->mode->effEBands; st->signalling = 1; +#ifndef DISABLE_UPDATE_DRAFT + st->disable_inv = channels == 1; +#else + st->disable_inv = 0; +#endif st->arch = opus_select_arch(); opus_custom_decoder_ctl(st, OPUS_RESET_STATE); @@ -177,6 +223,36 @@ void opus_custom_decoder_destroy(CELTDecoder *st) } #endif /* CUSTOM_MODES */ +#ifndef CUSTOM_MODES +/* Special case for stereo with no downsampling and no accumulation. This is + quite common and we can make it faster by processing both channels in the + same loop, reducing overhead due to the dependency loop in the IIR filter. */ +static void deemphasis_stereo_simple(celt_sig *in[], opus_val16 *pcm, int N, const opus_val16 coef0, + celt_sig *mem) +{ + celt_sig * OPUS_RESTRICT x0; + celt_sig * OPUS_RESTRICT x1; + celt_sig m0, m1; + int j; + x0=in[0]; + x1=in[1]; + m0 = mem[0]; + m1 = mem[1]; + for (j=0;j<N;j++) + { + celt_sig tmp0, tmp1; + /* Add VERY_SMALL to x[] first to reduce dependency chain. */ + tmp0 = x0[j] + VERY_SMALL + m0; + tmp1 = x1[j] + VERY_SMALL + m1; + m0 = MULT16_32_Q15(coef0, tmp0); + m1 = MULT16_32_Q15(coef0, tmp1); + pcm[2*j ] = SCALEOUT(SIG2WORD16(tmp0)); + pcm[2*j+1] = SCALEOUT(SIG2WORD16(tmp1)); + } + mem[0] = m0; + mem[1] = m1; +} +#endif #ifndef RESYNTH static @@ -190,6 +266,14 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c opus_val16 coef0; VARDECL(celt_sig, scratch); SAVE_STACK; +#ifndef CUSTOM_MODES + /* Short version for common case. */ + if (downsample == 1 && C == 2 && !accum) + { + deemphasis_stereo_simple(in, pcm, N, coef[0], mem); + return; + } +#endif #ifndef FIXED_POINT (void)accum; celt_assert(accum==0); @@ -225,7 +309,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c /* Shortcut for the standard (non-custom modes) case */ for (j=0;j<N;j++) { - celt_sig tmp = x[j] + m + VERY_SMALL; + celt_sig tmp = x[j] + VERY_SMALL + m; m = MULT16_32_Q15(coef0, tmp); scratch[j] = tmp; } @@ -246,7 +330,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c { for (j=0;j<N;j++) { - celt_sig tmp = x[j] + m + VERY_SMALL; + celt_sig tmp = x[j] + VERY_SMALL + m; m = MULT16_32_Q15(coef0, tmp); y[j*C] = SCALEOUT(SIG2WORD16(tmp)); } @@ -333,7 +417,7 @@ void celt_synthesis(const CELTMode *mode, celt_norm *X, celt_sig * out_syn[], denormalise_bands(mode, X+N, freq2, oldBandE+nbEBands, start, effEnd, M, downsample, silence); for (i=0;i<N;i++) - freq[i] = HALF32(ADD32(freq[i],freq2[i])); + freq[i] = ADD32(HALF32(freq[i]), HALF32(freq2[i])); for (b=0;b<B;b++) clt_mdct_backward(&mode->mdct, &freq[b], out_syn[0]+NB*b, mode->window, overlap, shift, B, arch); } else { @@ -345,6 +429,12 @@ void celt_synthesis(const CELTMode *mode, celt_norm *X, celt_sig * out_syn[], clt_mdct_backward(&mode->mdct, &freq[b], out_syn[c]+NB*b, mode->window, overlap, shift, B, arch); } while (++c<CC); } + /* Saturate IMDCT output so that we can't overflow in the pitch postfilter + or in the */ + c=0; do { + for (i=0;i<N;i++) + out_syn[c][i] = SATURATE(out_syn[c][i], SIG_SAT); + } while (++c<CC); RESTORE_STACK; } @@ -387,14 +477,6 @@ static void tf_decode(int start, int end, int isTransient, int *tf_res, int LM, } } -/* The maximum pitch lag to allow in the pitch-based PLC. It's possible to save - CPU time in the PLC pitch search by making this smaller than MAX_PERIOD. The - current value corresponds to a pitch of 66.67 Hz. */ -#define PLC_PITCH_LAG_MAX (720) -/* The minimum pitch lag to allow in the pitch-based PLC. This corresponds to a - pitch of 480 Hz. */ -#define PLC_PITCH_LAG_MIN (100) - static int celt_plc_pitch_search(celt_sig *decode_mem[2], int C, int arch) { int pitch_index; @@ -504,12 +586,15 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) celt_synthesis(mode, X, out_syn, oldBandE, start, effEnd, C, C, 0, LM, st->downsample, 0, st->arch); } else { + int exc_length; /* Pitch-based PLC */ const opus_val16 *window; + opus_val16 *exc; opus_val16 fade = Q15ONE; int pitch_index; VARDECL(opus_val32, etmp); - VARDECL(opus_val16, exc); + VARDECL(opus_val16, _exc); + VARDECL(opus_val16, fir_tmp); if (loss_count == 0) { @@ -519,8 +604,14 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) fade = QCONST16(.8f,15); } + /* We want the excitation for 2 pitch periods in order to look for a + decaying signal, but we can't get more than MAX_PERIOD. */ + exc_length = IMIN(2*pitch_index, MAX_PERIOD); + ALLOC(etmp, overlap, opus_val32); - ALLOC(exc, MAX_PERIOD, opus_val16); + ALLOC(_exc, MAX_PERIOD+LPC_ORDER, opus_val16); + ALLOC(fir_tmp, exc_length, opus_val16); + exc = _exc+LPC_ORDER; window = mode->window; c=0; do { opus_val16 decay; @@ -529,13 +620,11 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) celt_sig *buf; int extrapolation_offset; int extrapolation_len; - int exc_length; int j; buf = decode_mem[c]; - for (i=0;i<MAX_PERIOD;i++) { - exc[i] = ROUND16(buf[DECODE_BUFFER_SIZE-MAX_PERIOD+i], SIG_SHIFT); - } + for (i=0;i<MAX_PERIOD+LPC_ORDER;i++) + exc[i-LPC_ORDER] = ROUND16(buf[DECODE_BUFFER_SIZE-MAX_PERIOD-LPC_ORDER+i], SIG_SHIFT); if (loss_count == 0) { @@ -561,22 +650,32 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) #endif } _celt_lpc(lpc+c*LPC_ORDER, ac, LPC_ORDER); +#ifdef FIXED_POINT + /* For fixed-point, apply bandwidth expansion until we can guarantee that + no overflow can happen in the IIR filter. This means: + 32768*sum(abs(filter)) < 2^31 */ + while (1) { + opus_val16 tmp=Q15ONE; + opus_val32 sum=QCONST16(1., SIG_SHIFT); + for (i=0;i<LPC_ORDER;i++) + sum += ABS16(lpc[c*LPC_ORDER+i]); + if (sum < 65535) break; + for (i=0;i<LPC_ORDER;i++) + { + tmp = MULT16_16_Q15(QCONST16(.99f,15), tmp); + lpc[c*LPC_ORDER+i] = MULT16_16_Q15(lpc[c*LPC_ORDER+i], tmp); + } + } +#endif } - /* We want the excitation for 2 pitch periods in order to look for a - decaying signal, but we can't get more than MAX_PERIOD. */ - exc_length = IMIN(2*pitch_index, MAX_PERIOD); /* Initialize the LPC history with the samples just before the start of the region for which we're computing the excitation. */ { - opus_val16 lpc_mem[LPC_ORDER]; - for (i=0;i<LPC_ORDER;i++) - { - lpc_mem[i] = - ROUND16(buf[DECODE_BUFFER_SIZE-exc_length-1-i], SIG_SHIFT); - } - /* Compute the excitation for exc_length samples before the loss. */ + /* Compute the excitation for exc_length samples before the loss. We need the copy + because celt_fir() cannot filter in-place. */ celt_fir(exc+MAX_PERIOD-exc_length, lpc+c*LPC_ORDER, - exc+MAX_PERIOD-exc_length, exc_length, LPC_ORDER, lpc_mem, st->arch); + fir_tmp, exc_length, LPC_ORDER, st->arch); + OPUS_COPY(exc+MAX_PERIOD-exc_length, fir_tmp, exc_length); } /* Check if the waveform is decaying, and if so how fast. @@ -630,9 +729,8 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) tmp = ROUND16( buf[DECODE_BUFFER_SIZE-MAX_PERIOD-N+extrapolation_offset+j], SIG_SHIFT); - S1 += SHR32(MULT16_16(tmp, tmp), 8); + S1 += SHR32(MULT16_16(tmp, tmp), 10); } - { opus_val16 lpc_mem[LPC_ORDER]; /* Copy the last decoded samples (prior to the overlap region) to @@ -644,6 +742,10 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) celt_iir(buf+DECODE_BUFFER_SIZE-N, lpc+c*LPC_ORDER, buf+DECODE_BUFFER_SIZE-N, extrapolation_len, LPC_ORDER, lpc_mem, st->arch); +#ifdef FIXED_POINT + for (i=0; i < extrapolation_len; i++) + buf[DECODE_BUFFER_SIZE-N+i] = SATURATE(buf[DECODE_BUFFER_SIZE-N+i], SIG_SAT); +#endif } /* Check if the synthesis energy is higher than expected, which can @@ -654,7 +756,7 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) for (i=0;i<extrapolation_len;i++) { opus_val16 tmp = ROUND16(buf[DECODE_BUFFER_SIZE-N+i], SIG_SHIFT); - S2 += SHR32(MULT16_16(tmp, tmp), 8); + S2 += SHR32(MULT16_16(tmp, tmp), 10); } /* This checks for an "explosion" in the synthesis. */ #ifdef FIXED_POINT @@ -762,6 +864,7 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat const opus_int16 *eBands; ALLOC_STACK; + VALIDATE_CELT_DECODER(st); mode = st->mode; nbEBands = mode->nbEBands; overlap = mode->overlap; @@ -956,7 +1059,7 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat ALLOC(pulses, nbEBands, int); ALLOC(fine_priority, nbEBands, int); - codedBands = compute_allocation(mode, start, end, offsets, cap, + codedBands = clt_compute_allocation(mode, start, end, offsets, cap, alloc_trim, &intensity, &dual_stereo, bits, &balance, pulses, fine_quant, fine_priority, C, LM, dec, 0, 0, 0); @@ -979,7 +1082,8 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat quant_all_bands(0, mode, start, end, X, C==2 ? X+N : NULL, collapse_masks, NULL, pulses, shortBlocks, spread_decision, dual_stereo, intensity, tf_res, - len*(8<<BITRES)-anti_collapse_rsv, balance, dec, LM, codedBands, &st->rng, st->arch); + len*(8<<BITRES)-anti_collapse_rsv, balance, dec, LM, codedBands, &st->rng, 0, + st->arch, st->disable_inv); if (anti_collapse_rsv > 0) { @@ -1234,6 +1338,26 @@ int opus_custom_decoder_ctl(CELTDecoder * OPUS_RESTRICT st, int request, ...) *value=st->rng; } break; + case OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST: + { + opus_int32 value = va_arg(ap, opus_int32); + if(value<0 || value>1) + { + goto bad_arg; + } + st->disable_inv = value; + } + break; + case OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST: + { + opus_int32 *value = va_arg(ap, opus_int32*); + if (!value) + { + goto bad_arg; + } + *value = st->disable_inv; + } + break; default: goto bad_request; } diff --git a/thirdparty/opus/celt/celt_encoder.c b/thirdparty/opus/celt/celt_encoder.c index 3ee7a4d3f7..44cb0850ab 100644 --- a/thirdparty/opus/celt/celt_encoder.c +++ b/thirdparty/opus/celt/celt_encoder.c @@ -73,8 +73,8 @@ struct OpusCustomEncoder { int constrained_vbr; /* If zero, VBR can do whatever it likes with the rate */ int loss_rate; int lsb_depth; - int variable_duration; int lfe; + int disable_inv; int arch; /* Everything beyond this point gets cleared on a reset */ @@ -98,6 +98,7 @@ struct OpusCustomEncoder { #endif int consec_transient; AnalysisInfo analysis; + SILKInfo silk_info; opus_val32 preemph_memE[2]; opus_val32 preemph_memD[2]; @@ -123,6 +124,7 @@ struct OpusCustomEncoder { /* opus_val16 oldBandE[], Size = channels*mode->nbEBands */ /* opus_val16 oldLogE[], Size = channels*mode->nbEBands */ /* opus_val16 oldLogE2[], Size = channels*mode->nbEBands */ + /* opus_val16 energyError[], Size = channels*mode->nbEBands */ }; int celt_encoder_get_size(int channels) @@ -136,9 +138,10 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_get_size(const CELTMode *mode, int int size = sizeof(struct CELTEncoder) + (channels*mode->overlap-1)*sizeof(celt_sig) /* celt_sig in_mem[channels*mode->overlap]; */ + channels*COMBFILTER_MAXPERIOD*sizeof(celt_sig) /* celt_sig prefilter_mem[channels*COMBFILTER_MAXPERIOD]; */ - + 3*channels*mode->nbEBands*sizeof(opus_val16); /* opus_val16 oldBandE[channels*mode->nbEBands]; */ + + 4*channels*mode->nbEBands*sizeof(opus_val16); /* opus_val16 oldBandE[channels*mode->nbEBands]; */ /* opus_val16 oldLogE[channels*mode->nbEBands]; */ /* opus_val16 oldLogE2[channels*mode->nbEBands]; */ + /* opus_val16 energyError[channels*mode->nbEBands]; */ return size; } @@ -178,7 +181,6 @@ static int opus_custom_encoder_init_arch(CELTEncoder *st, const CELTMode *mode, st->start = 0; st->end = st->mode->effEBands; st->signalling = 1; - st->arch = arch; st->constrained_vbr = 1; @@ -223,7 +225,8 @@ void opus_custom_encoder_destroy(CELTEncoder *st) static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int C, - opus_val16 *tf_estimate, int *tf_chan) + opus_val16 *tf_estimate, int *tf_chan, int allow_weak_transients, + int *weak_transient) { int i; VARDECL(opus_val16, tmp); @@ -233,6 +236,12 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int int c; opus_val16 tf_max; int len2; + /* Forward masking: 6.7 dB/ms. */ +#ifdef FIXED_POINT + int forward_shift = 4; +#else + opus_val16 forward_decay = QCONST16(.0625f,15); +#endif /* Table of 6*64/x, trained on real data to minimize the average error */ static const unsigned char inv_table[128] = { 255,255,156,110, 86, 70, 59, 51, 45, 40, 37, 33, 31, 28, 26, 25, @@ -247,6 +256,19 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int SAVE_STACK; ALLOC(tmp, len, opus_val16); + *weak_transient = 0; + /* For lower bitrates, let's be more conservative and have a forward masking + decay of 3.3 dB/ms. This avoids having to code transients at very low + bitrate (mostly for hybrid), which can result in unstable energy and/or + partial collapse. */ + if (allow_weak_transients) + { +#ifdef FIXED_POINT + forward_shift = 5; +#else + forward_decay = QCONST16(.03125f,15); +#endif + } len2=len/2; for (c=0;c<C;c++) { @@ -269,7 +291,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int mem0 = mem1 + y - 2*x; mem1 = x - .5f*y; #endif - tmp[i] = EXTRACT16(SHR32(y,2)); + tmp[i] = SROUND16(y, 2); /*printf("%f ", tmp[i]);*/ } /*printf("\n");*/ @@ -280,7 +302,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int /* Normalize tmp to max range */ { int shift=0; - shift = 14-celt_ilog2(1+celt_maxabs16(tmp, len)); + shift = 14-celt_ilog2(MAX16(1, celt_maxabs16(tmp, len))); if (shift!=0) { for (i=0;i<len;i++) @@ -299,9 +321,9 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int mean += x2; #ifdef FIXED_POINT /* FIXME: Use PSHR16() instead */ - tmp[i] = mem0 + PSHR32(x2-mem0,4); + tmp[i] = mem0 + PSHR32(x2-mem0,forward_shift); #else - tmp[i] = mem0 + MULT16_16_P15(QCONST16(.0625f,15),x2-mem0); + tmp[i] = mem0 + MULT16_16_P15(forward_decay,x2-mem0); #endif mem0 = tmp[i]; } @@ -311,6 +333,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int /* Backward pass to compute the pre-echo threshold */ for (i=len2-1;i>=0;i--) { + /* Backward masking: 13.9 dB/ms. */ #ifdef FIXED_POINT /* FIXME: Use PSHR16() instead */ tmp[i] = mem0 + PSHR32(tmp[i]-mem0,3); @@ -339,6 +362,12 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int /* Compute harmonic mean discarding the unreliable boundaries The data is smooth, so we only take 1/4th of the samples */ unmask=0; + /* We should never see NaNs here. If we find any, then something really bad happened and we better abort + before it does any damage later on. If these asserts are disabled (no hardening), then the table + lookup a few lines below (id = ...) is likely to crash dur to an out-of-bounds read. DO NOT FIX + that crash on NaN since it could result in a worse issue later on. */ + celt_assert(!celt_isnan(tmp[0])); + celt_assert(!celt_isnan(norm)); for (i=12;i<len2-5;i+=4) { int id; @@ -359,7 +388,12 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int } } is_transient = mask_metric>200; - + /* For low bitrates, define "weak transients" that need to be + handled differently to avoid partial collapse. */ + if (allow_weak_transients && is_transient && mask_metric<600) { + is_transient = 0; + *weak_transient = 1; + } /* Arbitrary metric for VBR boost */ tf_max = MAX16(0,celt_sqrt(27*mask_metric)-42); /* *tf_estimate = 1 + MIN16(1, sqrt(MAX16(0, tf_max-30))/20); */ @@ -549,7 +583,7 @@ static opus_val32 l1_metric(const celt_norm *tmp, int N, int LM, opus_val16 bias static int tf_analysis(const CELTMode *m, int len, int isTransient, int *tf_res, int lambda, celt_norm *X, int N0, int LM, - int *tf_sum, opus_val16 tf_estimate, int tf_chan) + opus_val16 tf_estimate, int tf_chan, int *importance) { int i; VARDECL(int, metric); @@ -574,7 +608,6 @@ static int tf_analysis(const CELTMode *m, int len, int isTransient, ALLOC(path0, len, int); ALLOC(path1, len, int); - *tf_sum = 0; for (i=0;i<len;i++) { int k, N; @@ -629,27 +662,26 @@ static int tf_analysis(const CELTMode *m, int len, int isTransient, metric[i] = 2*best_level; else metric[i] = -2*best_level; - *tf_sum += (isTransient ? LM : 0) - metric[i]/2; /* For bands that can't be split to -1, set the metric to the half-way point to avoid biasing the decision */ if (narrow && (metric[i]==0 || metric[i]==-2*LM)) metric[i]-=1; - /*printf("%d ", metric[i]);*/ + /*printf("%d ", metric[i]/2 + (!isTransient)*LM);*/ } /*printf("\n");*/ /* Search for the optimal tf resolution, including tf_select */ tf_select = 0; for (sel=0;sel<2;sel++) { - cost0 = 0; - cost1 = isTransient ? 0 : lambda; + cost0 = importance[0]*abs(metric[0]-2*tf_select_table[LM][4*isTransient+2*sel+0]); + cost1 = importance[0]*abs(metric[0]-2*tf_select_table[LM][4*isTransient+2*sel+1]) + (isTransient ? 0 : lambda); for (i=1;i<len;i++) { int curr0, curr1; curr0 = IMIN(cost0, cost1 + lambda); curr1 = IMIN(cost0 + lambda, cost1); - cost0 = curr0 + abs(metric[i]-2*tf_select_table[LM][4*isTransient+2*sel+0]); - cost1 = curr1 + abs(metric[i]-2*tf_select_table[LM][4*isTransient+2*sel+1]); + cost0 = curr0 + importance[i]*abs(metric[i]-2*tf_select_table[LM][4*isTransient+2*sel+0]); + cost1 = curr1 + importance[i]*abs(metric[i]-2*tf_select_table[LM][4*isTransient+2*sel+1]); } cost0 = IMIN(cost0, cost1); selcost[sel]=cost0; @@ -658,8 +690,8 @@ static int tf_analysis(const CELTMode *m, int len, int isTransient, * If tests confirm it's useful for non-transients, we could allow it. */ if (selcost[1]<selcost[0] && isTransient) tf_select=1; - cost0 = 0; - cost1 = isTransient ? 0 : lambda; + cost0 = importance[0]*abs(metric[0]-2*tf_select_table[LM][4*isTransient+2*tf_select+0]); + cost1 = importance[0]*abs(metric[0]-2*tf_select_table[LM][4*isTransient+2*tf_select+1]) + (isTransient ? 0 : lambda); /* Viterbi forward pass */ for (i=1;i<len;i++) { @@ -687,8 +719,8 @@ static int tf_analysis(const CELTMode *m, int len, int isTransient, curr1 = from1; path1[i]= 1; } - cost0 = curr0 + abs(metric[i]-2*tf_select_table[LM][4*isTransient+2*tf_select+0]); - cost1 = curr1 + abs(metric[i]-2*tf_select_table[LM][4*isTransient+2*tf_select+1]); + cost0 = curr0 + importance[i]*abs(metric[i]-2*tf_select_table[LM][4*isTransient+2*tf_select+0]); + cost1 = curr1 + importance[i]*abs(metric[i]-2*tf_select_table[LM][4*isTransient+2*tf_select+1]); } tf_res[len-1] = cost0 < cost1 ? 0 : 1; /* Viterbi backward pass to check the decisions */ @@ -754,7 +786,7 @@ static void tf_encode(int start, int end, int isTransient, int *tf_res, int LM, static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X, const opus_val16 *bandLogE, int end, int LM, int C, int N0, AnalysisInfo *analysis, opus_val16 *stereo_saving, opus_val16 tf_estimate, - int intensity, opus_val16 surround_trim, int arch) + int intensity, opus_val16 surround_trim, opus_int32 equiv_rate, int arch) { int i; opus_val32 diff=0; @@ -762,6 +794,14 @@ static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X, int trim_index; opus_val16 trim = QCONST16(5.f, 8); opus_val16 logXC, logXC2; + /* At low bitrate, reducing the trim seems to help. At higher bitrates, it's less + clear what's best, so we're keeping it as it was before, at least for now. */ + if (equiv_rate < 64000) { + trim = QCONST16(4.f, 8); + } else if (equiv_rate < 80000) { + opus_int32 frac = (equiv_rate-64000) >> 10; + trim = QCONST16(4.f, 8) + QCONST16(1.f/16.f, 8)*frac; + } if (C==2) { opus_val16 sum = 0; /* Q10 */ @@ -809,7 +849,7 @@ static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X, } while (++c<C); diff /= C*(end-1); /*printf("%f\n", diff);*/ - trim -= MAX16(-QCONST16(2.f, 8), MIN16(QCONST16(2.f, 8), SHR16(diff+QCONST16(1.f, DB_SHIFT),DB_SHIFT-8)/6 )); + trim -= MAX32(-QCONST16(2.f, 8), MIN32(QCONST16(2.f, 8), SHR32(diff+QCONST16(1.f, DB_SHIFT),DB_SHIFT-8)/6 )); trim -= SHR16(surround_trim, DB_SHIFT-8); trim -= 2*SHR16(tf_estimate, 14-8); #ifndef DISABLE_FLOAT_API @@ -930,7 +970,8 @@ static opus_val16 median_of_3(const opus_val16 *x) static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 *bandLogE2, int nbEBands, int start, int end, int C, int *offsets, int lsb_depth, const opus_int16 *logN, int isTransient, int vbr, int constrained_vbr, const opus_int16 *eBands, int LM, - int effectiveBytes, opus_int32 *tot_boost_, int lfe, opus_val16 *surround_dynalloc) + int effectiveBytes, opus_int32 *tot_boost_, int lfe, opus_val16 *surround_dynalloc, + AnalysisInfo *analysis, int *importance, int *spread_weight) { int i, c; opus_int32 tot_boost=0; @@ -956,6 +997,42 @@ static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 for (i=0;i<end;i++) maxDepth = MAX16(maxDepth, bandLogE[c*nbEBands+i]-noise_floor[i]); } while (++c<C); + { + /* Compute a really simple masking model to avoid taking into account completely masked + bands when computing the spreading decision. */ + VARDECL(opus_val16, mask); + VARDECL(opus_val16, sig); + ALLOC(mask, nbEBands, opus_val16); + ALLOC(sig, nbEBands, opus_val16); + for (i=0;i<end;i++) + mask[i] = bandLogE[i]-noise_floor[i]; + if (C==2) + { + for (i=0;i<end;i++) + mask[i] = MAX16(mask[i], bandLogE[nbEBands+i]-noise_floor[i]); + } + OPUS_COPY(sig, mask, end); + for (i=1;i<end;i++) + mask[i] = MAX16(mask[i], mask[i-1] - QCONST16(2.f, DB_SHIFT)); + for (i=end-2;i>=0;i--) + mask[i] = MAX16(mask[i], mask[i+1] - QCONST16(3.f, DB_SHIFT)); + for (i=0;i<end;i++) + { + /* Compute SMR: Mask is never more than 72 dB below the peak and never below the noise floor.*/ + opus_val16 smr = sig[i]-MAX16(MAX16(0, maxDepth-QCONST16(12.f, DB_SHIFT)), mask[i]); + /* Clamp SMR to make sure we're not shifting by something negative or too large. */ +#ifdef FIXED_POINT + /* FIXME: Use PSHR16() instead */ + int shift = -PSHR32(MAX16(-QCONST16(5.f, DB_SHIFT), MIN16(0, smr)), DB_SHIFT); +#else + int shift = IMIN(5, IMAX(0, -(int)floor(.5f + smr))); +#endif + spread_weight[i] = 32 >> shift; + } + /*for (i=0;i<end;i++) + printf("%d ", spread_weight[i]); + printf("\n");*/ + } /* Make sure that dynamic allocation can't make us bust the budget */ if (effectiveBytes > 50 && LM>=1 && !lfe) { @@ -1012,6 +1089,14 @@ static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 } for (i=start;i<end;i++) follower[i] = MAX16(follower[i], surround_dynalloc[i]); + for (i=start;i<end;i++) + { +#ifdef FIXED_POINT + importance[i] = PSHR32(13*celt_exp2(MIN16(follower[i], QCONST16(4.f, DB_SHIFT))), 16); +#else + importance[i] = (int)floor(.5f+13*celt_exp2(MIN16(follower[i], QCONST16(4.f, DB_SHIFT)))); +#endif + } /* For non-transient CBR/CVBR frames, halve the dynalloc contribution */ if ((!vbr || constrained_vbr)&&!isTransient) { @@ -1020,14 +1105,26 @@ static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 } for (i=start;i<end;i++) { - int width; - int boost; - int boost_bits; - if (i<8) follower[i] *= 2; if (i>=12) follower[i] = HALF16(follower[i]); + } +#ifdef DISABLE_FLOAT_API + (void)analysis; +#else + if (analysis->valid) + { + for (i=start;i<IMIN(LEAK_BANDS, end);i++) + follower[i] = follower[i] + QCONST16(1.f/64.f, DB_SHIFT)*analysis->leak_boost[i]; + } +#endif + for (i=start;i<end;i++) + { + int width; + int boost; + int boost_bits; + follower[i] = MIN16(follower[i], QCONST16(4, DB_SHIFT)); width = C*(eBands[i+1]-eBands[i])<<LM; @@ -1042,11 +1139,11 @@ static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 boost = (int)SHR32(EXTEND32(follower[i])*width/6,DB_SHIFT); boost_bits = boost*6<<BITRES; } - /* For CBR and non-transient CVBR frames, limit dynalloc to 1/4 of the bits */ + /* For CBR and non-transient CVBR frames, limit dynalloc to 2/3 of the bits */ if ((!vbr || (constrained_vbr&&!isTransient)) - && (tot_boost+boost_bits)>>BITRES>>3 > effectiveBytes/4) + && (tot_boost+boost_bits)>>BITRES>>3 > 2*effectiveBytes/3) { - opus_int32 cap = ((effectiveBytes/4)<<BITRES<<3); + opus_int32 cap = ((2*effectiveBytes/3)<<BITRES<<3); offsets[i] = cap-tot_boost; tot_boost = cap; break; @@ -1055,6 +1152,9 @@ static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 tot_boost += boost_bits; } } + } else { + for (i=start;i<end;i++) + importance[i] = 13; } *tot_boost_ = tot_boost; RESTORE_STACK; @@ -1063,7 +1163,7 @@ static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 static int run_prefilter(CELTEncoder *st, celt_sig *in, celt_sig *prefilter_mem, int CC, int N, - int prefilter_tapset, int *pitch, opus_val16 *gain, int *qgain, int enabled, int nbAvailableBytes) + int prefilter_tapset, int *pitch, opus_val16 *gain, int *qgain, int enabled, int nbAvailableBytes, AnalysisInfo *analysis) { int c; VARDECL(celt_sig, _pre); @@ -1119,7 +1219,12 @@ static int run_prefilter(CELTEncoder *st, celt_sig *in, celt_sig *prefilter_mem, gain1 = 0; pitch_index = COMBFILTER_MINPERIOD; } - +#ifndef DISABLE_FLOAT_API + if (analysis->valid) + gain1 = (opus_val16)(gain1 * analysis->max_pitch_ratio); +#else + (void)analysis; +#endif /* Gain threshold for enabling the prefilter/postfilter */ pf_threshold = QCONST16(.2f,15); @@ -1193,7 +1298,7 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32 int LM, opus_int32 bitrate, int lastCodedBands, int C, int intensity, int constrained_vbr, opus_val16 stereo_saving, int tot_boost, opus_val16 tf_estimate, int pitch_change, opus_val16 maxDepth, - int variable_duration, int lfe, int has_surround_mask, opus_val16 surround_masking, + int lfe, int has_surround_mask, opus_val16 surround_masking, opus_val16 temporal_vbr) { /* The target rate in 8th bits per frame */ @@ -1235,10 +1340,9 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32 SHR32(MULT16_16(stereo_saving-QCONST16(0.1f,8),(coded_stereo_dof<<BITRES)),8)); } /* Boost the rate according to dynalloc (minus the dynalloc average for calibration). */ - target += tot_boost-(16<<LM); + target += tot_boost-(19<<LM); /* Apply transient boost, compensating for average boost. */ - tf_calibration = variable_duration==OPUS_FRAMESIZE_VARIABLE ? - QCONST16(0.02f,14) : QCONST16(0.04f,14); + tf_calibration = QCONST16(0.044f,14); target += (opus_int32)SHL32(MULT16_32_Q15(tf_estimate-tf_calibration, target),1); #ifndef DISABLE_FLOAT_API @@ -1249,7 +1353,7 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32 float tonal; /* Tonality boost (compensating for the average). */ - tonal = MAX16(0.f,analysis->tonality-.15f)-0.09f; + tonal = MAX16(0.f,analysis->tonality-.15f)-0.12f; tonal_target = target + (opus_int32)((coded_bins<<BITRES)*1.2f*tonal); if (pitch_change) tonal_target += (opus_int32)((coded_bins<<BITRES)*.8f); @@ -1279,21 +1383,11 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32 /*printf("%f %d\n", maxDepth, floor_depth);*/ } - if ((!has_surround_mask||lfe) && (constrained_vbr || bitrate<64000)) + /* Make VBR less aggressive for constrained VBR because we can't keep a higher bitrate + for long. Needs tuning. */ + if ((!has_surround_mask||lfe) && constrained_vbr) { - opus_val16 rate_factor = Q15ONE; - if (bitrate < 64000) - { -#ifdef FIXED_POINT - rate_factor = MAX16(0,(bitrate-32000)); -#else - rate_factor = MAX16(0,(1.f/32768)*(bitrate-32000)); -#endif - } - if (constrained_vbr) - rate_factor = MIN16(rate_factor, QCONST16(0.67f, 15)); - target = base_target + (opus_int32)MULT16_32_Q15(rate_factor, target-base_target); - + target = base_target + (opus_int32)MULT16_32_Q15(QCONST16(0.67f, 15), target-base_target); } if (!has_surround_mask && tf_estimate < QCONST16(.2f, 14)) @@ -1327,11 +1421,13 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, VARDECL(int, pulses); VARDECL(int, cap); VARDECL(int, offsets); + VARDECL(int, importance); + VARDECL(int, spread_weight); VARDECL(int, fine_priority); VARDECL(int, tf_res); VARDECL(unsigned char, collapse_masks); celt_sig *prefilter_mem; - opus_val16 *oldBandE, *oldLogE, *oldLogE2; + opus_val16 *oldBandE, *oldLogE, *oldLogE2, *energyError; int shortBlocks=0; int isTransient=0; const int CC = st->channels; @@ -1343,7 +1439,6 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, int end; int effEnd; int codedBands; - int tf_sum; int alloc_trim; int pitch_index=COMBFILTER_MINPERIOD; opus_val16 gain1 = 0; @@ -1355,6 +1450,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, opus_int32 total_boost; opus_int32 balance; opus_int32 tell; + opus_int32 tell0_frac; int prefilter_tapset=0; int pf_on; int anti_collapse_rsv; @@ -1376,7 +1472,10 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, opus_val16 surround_masking=0; opus_val16 temporal_vbr=0; opus_val16 surround_trim = 0; - opus_int32 equiv_rate = 510000; + opus_int32 equiv_rate; + int hybrid; + int weak_transient = 0; + int enable_tf_analysis; VARDECL(opus_val16, surround_dynalloc); ALLOC_STACK; @@ -1386,6 +1485,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, eBands = mode->eBands; start = st->start; end = st->end; + hybrid = start != 0; tf_estimate = 0; if (nbCompressedBytes<2 || pcm==NULL) { @@ -1409,12 +1509,14 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, oldBandE = (opus_val16*)(st->in_mem+CC*(overlap+COMBFILTER_MAXPERIOD)); oldLogE = oldBandE + CC*nbEBands; oldLogE2 = oldLogE + CC*nbEBands; + energyError = oldLogE2 + CC*nbEBands; if (enc==NULL) { - tell=1; + tell0_frac=tell=1; nbFilledBytes=0; } else { + tell0_frac=ec_tell_frac(enc); tell=ec_tell(enc); nbFilledBytes=(tell+4)>>3; } @@ -1467,10 +1569,11 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, if (st->bitrate!=OPUS_BITRATE_MAX) nbCompressedBytes = IMAX(2, IMIN(nbCompressedBytes, (tmp+4*mode->Fs)/(8*mode->Fs)-!!st->signalling)); - effectiveBytes = nbCompressedBytes; + effectiveBytes = nbCompressedBytes - nbFilledBytes; } + equiv_rate = ((opus_int32)nbCompressedBytes*8*50 >> (3-LM)) - (40*C+20)*((400>>LM) - 50); if (st->bitrate != OPUS_BITRATE_MAX) - equiv_rate = st->bitrate - (40*C+20)*((400>>LM) - 50); + equiv_rate = IMIN(equiv_rate, st->bitrate - (40*C+20)*((400>>LM) - 50)); if (enc==NULL) { @@ -1558,17 +1661,17 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, { int enabled; int qg; - enabled = ((st->lfe&&nbAvailableBytes>3) || nbAvailableBytes>12*C) && start==0 && !silence && !st->disable_pf - && st->complexity >= 5 && !(st->consec_transient && LM!=3 && st->variable_duration==OPUS_FRAMESIZE_VARIABLE); + enabled = ((st->lfe&&nbAvailableBytes>3) || nbAvailableBytes>12*C) && !hybrid && !silence && !st->disable_pf + && st->complexity >= 5; prefilter_tapset = st->tapset_decision; - pf_on = run_prefilter(st, in, prefilter_mem, CC, N, prefilter_tapset, &pitch_index, &gain1, &qg, enabled, nbAvailableBytes); + pf_on = run_prefilter(st, in, prefilter_mem, CC, N, prefilter_tapset, &pitch_index, &gain1, &qg, enabled, nbAvailableBytes, &st->analysis); if ((gain1 > QCONST16(.4f,15) || st->prefilter_gain > QCONST16(.4f,15)) && (!st->analysis.valid || st->analysis.tonality > .3) && (pitch_index > 1.26*st->prefilter_period || pitch_index < .79*st->prefilter_period)) pitch_change = 1; if (pf_on==0) { - if(start==0 && tell+16<=total_bits) + if(!hybrid && tell+16<=total_bits) ec_enc_bit_logp(enc, 0, 1); } else { /*This block is not gated by a total bits check only because @@ -1589,8 +1692,12 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, shortBlocks = 0; if (st->complexity >= 1 && !st->lfe) { + /* Reduces the likelihood of energy instability on fricatives at low bitrate + in hybrid mode. It seems like we still want to have real transients on vowels + though (small SILK quantization offset value). */ + int allow_weak_transients = hybrid && effectiveBytes<15 && st->silk_info.signalType != 2; isTransient = transient_analysis(in, N+overlap, CC, - &tf_estimate, &tf_chan); + &tf_estimate, &tf_chan, allow_weak_transients, &weak_transient); } if (LM>0 && ec_tell(enc)+3<=total_bits) { @@ -1610,16 +1717,19 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, if (secondMdct) { compute_mdcts(mode, 0, in, freq, C, CC, LM, st->upsample, st->arch); - compute_band_energies(mode, freq, bandE, effEnd, C, LM); + compute_band_energies(mode, freq, bandE, effEnd, C, LM, st->arch); amp2Log2(mode, effEnd, end, bandE, bandLogE2, C); for (i=0;i<C*nbEBands;i++) bandLogE2[i] += HALF16(SHL16(LM, DB_SHIFT)); } compute_mdcts(mode, shortBlocks, in, freq, C, CC, LM, st->upsample, st->arch); + /* This should catch any NaN in the CELT input. Since we're not supposed to see any (they're filtered + at the Opus layer), just abort. */ + celt_assert(!celt_isnan(freq[0]) && (C==1 || !celt_isnan(freq[N]))); if (CC==2&&C==1) tf_chan = 0; - compute_band_energies(mode, freq, bandE, effEnd, C, LM); + compute_band_energies(mode, freq, bandE, effEnd, C, LM, st->arch); if (st->lfe) { @@ -1634,7 +1744,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, ALLOC(surround_dynalloc, C*nbEBands, opus_val16); OPUS_CLEAR(surround_dynalloc, end); /* This computes how much masking takes place between surround channels */ - if (start==0&&st->energy_mask&&!st->lfe) + if (!hybrid&&st->energy_mask&&!st->lfe) { int mask_end; int midband; @@ -1736,14 +1846,14 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, /* Last chance to catch any transient we might have missed in the time-domain analysis */ - if (LM>0 && ec_tell(enc)+3<=total_bits && !isTransient && st->complexity>=5 && !st->lfe) + if (LM>0 && ec_tell(enc)+3<=total_bits && !isTransient && st->complexity>=5 && !st->lfe && !hybrid) { if (patch_transient_decision(bandLogE, oldBandE, nbEBands, start, end, C)) { isTransient = 1; shortBlocks = M; compute_mdcts(mode, shortBlocks, in, freq, C, CC, LM, st->upsample, st->arch); - compute_band_energies(mode, freq, bandE, effEnd, C, LM); + compute_band_energies(mode, freq, bandE, effEnd, C, LM, st->arch); amp2Log2(mode, effEnd, end, bandE, bandLogE, C); /* Compensate for the scaling of short vs long mdcts */ for (i=0;i<C*nbEBands;i++) @@ -1760,31 +1870,59 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, /* Band normalisation */ normalise_bands(mode, freq, X, bandE, effEnd, C, M); + enable_tf_analysis = effectiveBytes>=15*C && !hybrid && st->complexity>=2 && !st->lfe; + + ALLOC(offsets, nbEBands, int); + ALLOC(importance, nbEBands, int); + ALLOC(spread_weight, nbEBands, int); + + maxDepth = dynalloc_analysis(bandLogE, bandLogE2, nbEBands, start, end, C, offsets, + st->lsb_depth, mode->logN, isTransient, st->vbr, st->constrained_vbr, + eBands, LM, effectiveBytes, &tot_boost, st->lfe, surround_dynalloc, &st->analysis, importance, spread_weight); + ALLOC(tf_res, nbEBands, int); /* Disable variable tf resolution for hybrid and at very low bitrate */ - if (effectiveBytes>=15*C && start==0 && st->complexity>=2 && !st->lfe) + if (enable_tf_analysis) { int lambda; - if (effectiveBytes<40) - lambda = 12; - else if (effectiveBytes<60) - lambda = 6; - else if (effectiveBytes<100) - lambda = 4; - else - lambda = 3; - lambda*=2; - tf_select = tf_analysis(mode, effEnd, isTransient, tf_res, lambda, X, N, LM, &tf_sum, tf_estimate, tf_chan); + lambda = IMAX(80, 20480/effectiveBytes + 2); + tf_select = tf_analysis(mode, effEnd, isTransient, tf_res, lambda, X, N, LM, tf_estimate, tf_chan, importance); for (i=effEnd;i<end;i++) tf_res[i] = tf_res[effEnd-1]; + } else if (hybrid && weak_transient) + { + /* For weak transients, we rely on the fact that improving time resolution using + TF on a long window is imperfect and will not result in an energy collapse at + low bitrate. */ + for (i=0;i<end;i++) + tf_res[i] = 1; + tf_select=0; + } else if (hybrid && effectiveBytes<15 && st->silk_info.signalType != 2) + { + /* For low bitrate hybrid, we force temporal resolution to 5 ms rather than 2.5 ms. */ + for (i=0;i<end;i++) + tf_res[i] = 0; + tf_select=isTransient; } else { - tf_sum = 0; for (i=0;i<end;i++) tf_res[i] = isTransient; tf_select=0; } ALLOC(error, C*nbEBands, opus_val16); + c=0; + do { + for (i=start;i<end;i++) + { + /* When the energy is stable, slightly bias energy quantization towards + the previous error to make the gain more stable (a constant offset is + better than fluctuations). */ + if (ABS32(SUB32(bandLogE[i+c*nbEBands], oldBandE[i+c*nbEBands])) < QCONST16(2.f, DB_SHIFT)) + { + bandLogE[i+c*nbEBands] -= MULT16_16_Q15(energyError[i+c*nbEBands], QCONST16(0.25f, 15)); + } + } + } while (++c < C); quant_coarse_energy(mode, start, end, effEnd, bandLogE, oldBandE, total_bits, error, enc, C, LM, nbAvailableBytes, st->force_intra, @@ -1798,7 +1936,15 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, { st->tapset_decision = 0; st->spread_decision = SPREAD_NORMAL; - } else if (shortBlocks || st->complexity < 3 || nbAvailableBytes < 10*C || start != 0) + } else if (hybrid) + { + if (st->complexity == 0) + st->spread_decision = SPREAD_NONE; + else if (isTransient) + st->spread_decision = SPREAD_NORMAL; + else + st->spread_decision = SPREAD_AGGRESSIVE; + } else if (shortBlocks || st->complexity < 3 || nbAvailableBytes < 10*C) { if (st->complexity == 0) st->spread_decision = SPREAD_NONE; @@ -1822,7 +1968,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, { st->spread_decision = spreading_decision(mode, X, &st->tonal_average, st->spread_decision, &st->hf_average, - &st->tapset_decision, pf_on&&!shortBlocks, effEnd, C, M); + &st->tapset_decision, pf_on&&!shortBlocks, effEnd, C, M, spread_weight); } /*printf("%d %d\n", st->tapset_decision, st->spread_decision);*/ /*printf("%f %d %f %d\n\n", st->analysis.tonality, st->spread_decision, st->analysis.tonality_slope, st->tapset_decision);*/ @@ -1830,11 +1976,6 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, ec_enc_icdf(enc, st->spread_decision, spread_icdf, 5); } - ALLOC(offsets, nbEBands, int); - - maxDepth = dynalloc_analysis(bandLogE, bandLogE2, nbEBands, start, end, C, offsets, - st->lsb_depth, mode->logN, isTransient, st->vbr, st->constrained_vbr, - eBands, LM, effectiveBytes, &tot_boost, st->lfe, surround_dynalloc); /* For LFE, everything interesting is in the first band */ if (st->lfe) offsets[0] = IMIN(8, effectiveBytes/3); @@ -1896,12 +2037,15 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, alloc_trim = 5; if (tell+(6<<BITRES) <= total_bits - total_boost) { - if (st->lfe) + if (start > 0 || st->lfe) + { + st->stereo_saving = 0; alloc_trim = 5; - else + } else { alloc_trim = alloc_trim_analysis(mode, X, bandLogE, end, LM, C, N, &st->analysis, &st->stereo_saving, tf_estimate, - st->intensity, surround_trim, st->arch); + st->intensity, surround_trim, equiv_rate, st->arch); + } ec_enc_icdf(enc, alloc_trim, trim_icdf, 7); tell = ec_tell_frac(enc); } @@ -1919,17 +2063,36 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, /* Don't attempt to use more than 510 kb/s, even for frames smaller than 20 ms. The CELT allocator will just not be able to use more than that anyway. */ nbCompressedBytes = IMIN(nbCompressedBytes,1275>>(3-LM)); - base_target = vbr_rate - ((40*C+20)<<BITRES); + if (!hybrid) + { + base_target = vbr_rate - ((40*C+20)<<BITRES); + } else { + base_target = IMAX(0, vbr_rate - ((9*C+4)<<BITRES)); + } if (st->constrained_vbr) base_target += (st->vbr_offset>>lm_diff); - target = compute_vbr(mode, &st->analysis, base_target, LM, equiv_rate, + if (!hybrid) + { + target = compute_vbr(mode, &st->analysis, base_target, LM, equiv_rate, st->lastCodedBands, C, st->intensity, st->constrained_vbr, st->stereo_saving, tot_boost, tf_estimate, pitch_change, maxDepth, - st->variable_duration, st->lfe, st->energy_mask!=NULL, surround_masking, + st->lfe, st->energy_mask!=NULL, surround_masking, temporal_vbr); - + } else { + target = base_target; + /* Tonal frames (offset<100) need more bits than noisy (offset>100) ones. */ + if (st->silk_info.offset < 100) target += 12 << BITRES >> (3-LM); + if (st->silk_info.offset > 100) target -= 18 << BITRES >> (3-LM); + /* Boosting bitrate on transients and vowels with significant temporal + spikes. */ + target += (opus_int32)MULT16_16_Q14(tf_estimate-QCONST16(.25f,14), (50<<BITRES)); + /* If we have a strong transient, let's make sure it has enough bits to code + the first two bands, so that it can use folding rather than noise. */ + if (tf_estimate > QCONST16(.7f,14)) + target = IMAX(target, 50<<BITRES); + } /* The current offset is removed from the target and the space used so far is added*/ target=target+tell; @@ -1937,11 +2100,16 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, result in the encoder running out of bits. The margin of 2 bytes ensures that none of the bust-prevention logic in the decoder will have triggered so far. */ - min_allowed = ((tell+total_boost+(1<<(BITRES+3))-1)>>(BITRES+3)) + 2 - nbFilledBytes; + min_allowed = ((tell+total_boost+(1<<(BITRES+3))-1)>>(BITRES+3)) + 2; + /* Take into account the 37 bits we need to have left in the packet to + signal a redundant frame in hybrid mode. Creating a shorter packet would + create an entropy coder desync. */ + if (hybrid) + min_allowed = IMAX(min_allowed, (tell0_frac+(37<<BITRES)+total_boost+(1<<(BITRES+3))-1)>>(BITRES+3)); nbAvailableBytes = (target+(1<<(BITRES+2)))>>(BITRES+3); nbAvailableBytes = IMAX(min_allowed,nbAvailableBytes); - nbAvailableBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes) - nbFilledBytes; + nbAvailableBytes = IMIN(nbCompressedBytes,nbAvailableBytes); /* By how much did we "miss" the target on that frame */ delta = target - vbr_rate; @@ -1988,7 +2156,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, st->vbr_reservoir = 0; /*printf ("+%d\n", adjust);*/ } - nbCompressedBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes); + nbCompressedBytes = IMIN(nbCompressedBytes,nbAvailableBytes); /*printf("%d\n", nbCompressedBytes*50*8);*/ /* This moves the raw bits to take into account the new compressed size */ ec_enc_shrink(enc, nbCompressedBytes); @@ -2023,7 +2191,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, #endif if (st->lfe) signalBandwidth = 1; - codedBands = compute_allocation(mode, start, end, offsets, cap, + codedBands = clt_compute_allocation(mode, start, end, offsets, cap, alloc_trim, &st->intensity, &dual_stereo, bits, &balance, pulses, fine_quant, fine_priority, C, LM, enc, 1, st->lastCodedBands, signalBandwidth); if (st->lastCodedBands) @@ -2038,7 +2206,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, quant_all_bands(1, mode, start, end, X, C==2 ? X+N : NULL, collapse_masks, bandE, pulses, shortBlocks, st->spread_decision, dual_stereo, st->intensity, tf_res, nbCompressedBytes*(8<<BITRES)-anti_collapse_rsv, - balance, enc, LM, codedBands, &st->rng, st->arch); + balance, enc, LM, codedBands, &st->rng, st->complexity, st->arch, st->disable_inv); if (anti_collapse_rsv > 0) { @@ -2049,6 +2217,14 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, ec_enc_bits(enc, anti_collapse_on, 1); } quant_energy_finalise(mode, start, end, oldBandE, error, fine_quant, fine_priority, nbCompressedBytes*8-ec_tell(enc), enc, C); + OPUS_CLEAR(energyError, nbEBands*CC); + c=0; + do { + for (i=start;i<end;i++) + { + energyError[i+c*nbEBands] = MAX16(-QCONST16(0.5f, 15), MIN16(QCONST16(0.5f, 15), error[i+c*nbEBands])); + } + } while (++c < C); if (silence) { @@ -2321,10 +2497,24 @@ int opus_custom_encoder_ctl(CELTEncoder * OPUS_RESTRICT st, int request, ...) *value=st->lsb_depth; } break; - case OPUS_SET_EXPERT_FRAME_DURATION_REQUEST: + case OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST: { opus_int32 value = va_arg(ap, opus_int32); - st->variable_duration = value; + if(value<0 || value>1) + { + goto bad_arg; + } + st->disable_inv = value; + } + break; + case OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST: + { + opus_int32 *value = va_arg(ap, opus_int32*); + if (!value) + { + goto bad_arg; + } + *value = st->disable_inv; } break; case OPUS_RESET_STATE: @@ -2368,6 +2558,13 @@ int opus_custom_encoder_ctl(CELTEncoder * OPUS_RESTRICT st, int request, ...) OPUS_COPY(&st->analysis, info, 1); } break; + case CELT_SET_SILK_INFO_REQUEST: + { + SILKInfo *info = va_arg(ap, SILKInfo *); + if (info) + OPUS_COPY(&st->silk_info, info, 1); + } + break; case CELT_GET_MODE_REQUEST: { const CELTMode ** value = va_arg(ap, const CELTMode**); diff --git a/thirdparty/opus/celt/celt_lpc.c b/thirdparty/opus/celt/celt_lpc.c index b410a21c5f..8ecb693ee9 100644 --- a/thirdparty/opus/celt/celt_lpc.c +++ b/thirdparty/opus/celt/celt_lpc.c @@ -89,58 +89,40 @@ int p void celt_fir_c( - const opus_val16 *_x, + const opus_val16 *x, const opus_val16 *num, - opus_val16 *_y, + opus_val16 *y, int N, int ord, - opus_val16 *mem, int arch) { int i,j; VARDECL(opus_val16, rnum); - VARDECL(opus_val16, x); SAVE_STACK; - + celt_assert(x != y); ALLOC(rnum, ord, opus_val16); - ALLOC(x, N+ord, opus_val16); for(i=0;i<ord;i++) rnum[i] = num[ord-i-1]; - for(i=0;i<ord;i++) - x[i] = mem[ord-i-1]; - for (i=0;i<N;i++) - x[i+ord]=_x[i]; - for(i=0;i<ord;i++) - mem[i] = _x[N-i-1]; -#ifdef SMALL_FOOTPRINT - (void)arch; - for (i=0;i<N;i++) - { - opus_val32 sum = SHL32(EXTEND32(_x[i]), SIG_SHIFT); - for (j=0;j<ord;j++) - { - sum = MAC16_16(sum,rnum[j],x[i+j]); - } - _y[i] = SATURATE16(PSHR32(sum, SIG_SHIFT)); - } -#else for (i=0;i<N-3;i+=4) { - opus_val32 sum[4]={0,0,0,0}; - xcorr_kernel(rnum, x+i, sum, ord, arch); - _y[i ] = SATURATE16(ADD32(EXTEND32(_x[i ]), PSHR32(sum[0], SIG_SHIFT))); - _y[i+1] = SATURATE16(ADD32(EXTEND32(_x[i+1]), PSHR32(sum[1], SIG_SHIFT))); - _y[i+2] = SATURATE16(ADD32(EXTEND32(_x[i+2]), PSHR32(sum[2], SIG_SHIFT))); - _y[i+3] = SATURATE16(ADD32(EXTEND32(_x[i+3]), PSHR32(sum[3], SIG_SHIFT))); + opus_val32 sum[4]; + sum[0] = SHL32(EXTEND32(x[i ]), SIG_SHIFT); + sum[1] = SHL32(EXTEND32(x[i+1]), SIG_SHIFT); + sum[2] = SHL32(EXTEND32(x[i+2]), SIG_SHIFT); + sum[3] = SHL32(EXTEND32(x[i+3]), SIG_SHIFT); + xcorr_kernel(rnum, x+i-ord, sum, ord, arch); + y[i ] = ROUND16(sum[0], SIG_SHIFT); + y[i+1] = ROUND16(sum[1], SIG_SHIFT); + y[i+2] = ROUND16(sum[2], SIG_SHIFT); + y[i+3] = ROUND16(sum[3], SIG_SHIFT); } for (;i<N;i++) { - opus_val32 sum = 0; + opus_val32 sum = SHL32(EXTEND32(x[i]), SIG_SHIFT); for (j=0;j<ord;j++) - sum = MAC16_16(sum,rnum[j],x[i+j]); - _y[i] = SATURATE16(ADD32(EXTEND32(_x[i]), PSHR32(sum, SIG_SHIFT))); + sum = MAC16_16(sum,rnum[j],x[i+j-ord]); + y[i] = ROUND16(sum, SIG_SHIFT); } -#endif RESTORE_STACK; } @@ -166,7 +148,7 @@ void celt_iir(const opus_val32 *_x, { mem[j]=mem[j-1]; } - mem[0] = ROUND16(sum,SIG_SHIFT); + mem[0] = SROUND16(sum, SIG_SHIFT); _y[i] = sum; } #else @@ -195,20 +177,20 @@ void celt_iir(const opus_val32 *_x, xcorr_kernel(rden, y+i, sum, ord, arch); /* Patch up the result to compensate for the fact that this is an IIR */ - y[i+ord ] = -ROUND16(sum[0],SIG_SHIFT); + y[i+ord ] = -SROUND16(sum[0],SIG_SHIFT); _y[i ] = sum[0]; sum[1] = MAC16_16(sum[1], y[i+ord ], den[0]); - y[i+ord+1] = -ROUND16(sum[1],SIG_SHIFT); + y[i+ord+1] = -SROUND16(sum[1],SIG_SHIFT); _y[i+1] = sum[1]; sum[2] = MAC16_16(sum[2], y[i+ord+1], den[0]); sum[2] = MAC16_16(sum[2], y[i+ord ], den[1]); - y[i+ord+2] = -ROUND16(sum[2],SIG_SHIFT); + y[i+ord+2] = -SROUND16(sum[2],SIG_SHIFT); _y[i+2] = sum[2]; sum[3] = MAC16_16(sum[3], y[i+ord+2], den[0]); sum[3] = MAC16_16(sum[3], y[i+ord+1], den[1]); sum[3] = MAC16_16(sum[3], y[i+ord ], den[2]); - y[i+ord+3] = -ROUND16(sum[3],SIG_SHIFT); + y[i+ord+3] = -SROUND16(sum[3],SIG_SHIFT); _y[i+3] = sum[3]; } for (;i<N;i++) @@ -216,7 +198,7 @@ void celt_iir(const opus_val32 *_x, opus_val32 sum = _x[i]; for (j=0;j<ord;j++) sum -= MULT16_16(rden[j],y[i+j]); - y[i+ord] = ROUND16(sum,SIG_SHIFT); + y[i+ord] = SROUND16(sum,SIG_SHIFT); _y[i] = sum; } for(i=0;i<ord;i++) diff --git a/thirdparty/opus/celt/celt_lpc.h b/thirdparty/opus/celt/celt_lpc.h index 323459eb1a..a4c5fd6ea5 100644 --- a/thirdparty/opus/celt/celt_lpc.h +++ b/thirdparty/opus/celt/celt_lpc.h @@ -45,12 +45,11 @@ void celt_fir_c( opus_val16 *y, int N, int ord, - opus_val16 *mem, int arch); #if !defined(OVERRIDE_CELT_FIR) -#define celt_fir(x, num, y, N, ord, mem, arch) \ - (celt_fir_c(x, num, y, N, ord, mem, arch)) +#define celt_fir(x, num, y, N, ord, arch) \ + (celt_fir_c(x, num, y, N, ord, arch)) #endif void celt_iir(const opus_val32 *x, diff --git a/thirdparty/opus/celt/cwrs.c b/thirdparty/opus/celt/cwrs.c index 9722f0ac86..a552e4f0fb 100644 --- a/thirdparty/opus/celt/cwrs.c +++ b/thirdparty/opus/celt/cwrs.c @@ -482,7 +482,7 @@ static opus_val32 cwrsi(int _n,int _k,opus_uint32 _i,int *_y){ k0=_k; q=row[_n]; if(q>_i){ - celt_assert(p>q); + celt_sig_assert(p>q); _k=_n; do p=CELT_PVQ_U_ROW[--_k][_n]; while(p>_i); diff --git a/thirdparty/opus/celt/entcode.h b/thirdparty/opus/celt/entcode.h index 13d6c84ef0..3763e3f284 100644 --- a/thirdparty/opus/celt/entcode.h +++ b/thirdparty/opus/celt/entcode.h @@ -122,7 +122,7 @@ opus_uint32 ec_tell_frac(ec_ctx *_this); /* Tested exhaustively for all n and for 1<=d<=256 */ static OPUS_INLINE opus_uint32 celt_udiv(opus_uint32 n, opus_uint32 d) { - celt_assert(d>0); + celt_sig_assert(d>0); #ifdef USE_SMALL_DIV_TABLE if (d>256) return n/d; @@ -138,7 +138,7 @@ static OPUS_INLINE opus_uint32 celt_udiv(opus_uint32 n, opus_uint32 d) { } static OPUS_INLINE opus_int32 celt_sudiv(opus_int32 n, opus_int32 d) { - celt_assert(d>0); + celt_sig_assert(d>0); #ifdef USE_SMALL_DIV_TABLE if (n<0) return -(opus_int32)celt_udiv(-n, d); diff --git a/thirdparty/opus/celt/entdec.h b/thirdparty/opus/celt/entdec.h index d8ab318730..025fc1870d 100644 --- a/thirdparty/opus/celt/entdec.h +++ b/thirdparty/opus/celt/entdec.h @@ -85,7 +85,7 @@ int ec_dec_icdf(ec_dec *_this,const unsigned char *_icdf,unsigned _ftb); The bits must have been encoded with ec_enc_uint(). No call to ec_dec_update() is necessary after this call. _ft: The number of integers that can be decoded (one more than the max). - This must be at least one, and no more than 2**32-1. + This must be at least 2, and no more than 2**32-1. Return: The decoded bits.*/ opus_uint32 ec_dec_uint(ec_dec *_this,opus_uint32 _ft); diff --git a/thirdparty/opus/celt/entenc.h b/thirdparty/opus/celt/entenc.h index 796bc4d572..f502eaf662 100644 --- a/thirdparty/opus/celt/entenc.h +++ b/thirdparty/opus/celt/entenc.h @@ -67,7 +67,7 @@ void ec_enc_icdf(ec_enc *_this,int _s,const unsigned char *_icdf,unsigned _ftb); /*Encodes a raw unsigned integer in the stream. _fl: The integer to encode. _ft: The number of integers that can be encoded (one more than the max). - This must be at least one, and no more than 2**32-1.*/ + This must be at least 2, and no more than 2**32-1.*/ void ec_enc_uint(ec_enc *_this,opus_uint32 _fl,opus_uint32 _ft); /*Encodes a sequence of raw bits in the stream. diff --git a/thirdparty/opus/celt/fixed_debug.h b/thirdparty/opus/celt/fixed_debug.h index d28227f5dc..f435295234 100644 --- a/thirdparty/opus/celt/fixed_debug.h +++ b/thirdparty/opus/celt/fixed_debug.h @@ -59,6 +59,14 @@ extern opus_int64 celt_mips; #define SHR(a,b) SHR32(a,b) #define PSHR(a,b) PSHR32(a,b) +/** Add two 32-bit values, ignore any overflows */ +#define ADD32_ovflw(a,b) (celt_mips+=2,(opus_val32)((opus_uint32)(a)+(opus_uint32)(b))) +/** Subtract two 32-bit values, ignore any overflows */ +#define SUB32_ovflw(a,b) (celt_mips+=2,(opus_val32)((opus_uint32)(a)-(opus_uint32)(b))) +/* Avoid MSVC warning C4146: unary minus operator applied to unsigned type */ +/** Negate 32-bit value, ignore any overflows */ +#define NEG32_ovflw(a) (celt_mips+=2,(opus_val32)(0-(opus_uint32)(a))) + static OPUS_INLINE short NEG16(int x) { int res; @@ -227,12 +235,11 @@ static OPUS_INLINE int SHL32_(opus_int64 a, int shift, char *file, int line) #define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift))) #define ROUND16(x,a) (celt_mips--,EXTRACT16(PSHR32((x),(a)))) +#define SROUND16(x,a) (celt_mips--,EXTRACT16(SATURATE(PSHR32(x,a), 32767))); + #define HALF16(x) (SHR16(x,1)) #define HALF32(x) (SHR32(x,1)) -//#define SHR(a,shift) ((a) >> (shift)) -//#define SHL(a,shift) ((a) << (shift)) - #define ADD16(a, b) ADD16_(a, b, __FILE__, __LINE__) static OPUS_INLINE short ADD16_(int a, int b, char *file, int line) { diff --git a/thirdparty/opus/celt/fixed_generic.h b/thirdparty/opus/celt/fixed_generic.h index 1cfd6d6989..5f4abda76e 100644 --- a/thirdparty/opus/celt/fixed_generic.h +++ b/thirdparty/opus/celt/fixed_generic.h @@ -104,6 +104,9 @@ /** Shift by a and round-to-neareast 32-bit value. Result is a 16-bit value */ #define ROUND16(x,a) (EXTRACT16(PSHR32((x),(a)))) +/** Shift by a and round-to-neareast 32-bit value. Result is a saturated 16-bit value */ +#define SROUND16(x,a) EXTRACT16(SATURATE(PSHR32(x,a), 32767)); + /** Divide by two */ #define HALF16(x) (SHR16(x,1)) #define HALF32(x) (SHR32(x,1)) @@ -117,6 +120,14 @@ /** Subtract two 32-bit values */ #define SUB32(a,b) ((opus_val32)(a)-(opus_val32)(b)) +/** Add two 32-bit values, ignore any overflows */ +#define ADD32_ovflw(a,b) ((opus_val32)((opus_uint32)(a)+(opus_uint32)(b))) +/** Subtract two 32-bit values, ignore any overflows */ +#define SUB32_ovflw(a,b) ((opus_val32)((opus_uint32)(a)-(opus_uint32)(b))) +/* Avoid MSVC warning C4146: unary minus operator applied to unsigned type */ +/** Negate 32-bit value, ignore any overflows */ +#define NEG32_ovflw(a) ((opus_val32)(0-(opus_uint32)(a))) + /** 16x16 multiplication where the result fits in 16 bits */ #define MULT16_16_16(a,b) ((((opus_val16)(a))*((opus_val16)(b)))) diff --git a/thirdparty/opus/celt/float_cast.h b/thirdparty/opus/celt/float_cast.h index ed5a39b543..889dae965f 100644 --- a/thirdparty/opus/celt/float_cast.h +++ b/thirdparty/opus/celt/float_cast.h @@ -61,7 +61,13 @@ ** the config.h file. */ -#if (HAVE_LRINTF) +/* With GCC, when SSE is available, the fastest conversion is cvtss2si. */ +#if defined(__GNUC__) && defined(__SSE__) + +#include <xmmintrin.h> +static OPUS_INLINE opus_int32 float2int(float x) {return _mm_cvt_ss2si(_mm_set_ss(x));} + +#elif defined(HAVE_LRINTF) /* These defines enable functionality introduced with the 1999 ISO C ** standard. They must be defined before the inclusion of math.h to @@ -90,10 +96,10 @@ #include <math.h> #define float2int(x) lrint(x) -#elif (defined(_MSC_VER) && _MSC_VER >= 1400) && defined (_M_X64) +#elif (defined(_MSC_VER) && _MSC_VER >= 1400) && (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1)) #include <xmmintrin.h> - __inline long int float2int(float value) + static __inline long int float2int(float value) { return _mm_cvtss_si32(_mm_load_ss(&value)); } @@ -104,7 +110,7 @@ ** Therefore implement OPUS_INLINE versions of these functions here. */ - __inline long int + static __inline long int float2int (float flt) { int intgr; diff --git a/thirdparty/opus/celt/kiss_fft.c b/thirdparty/opus/celt/kiss_fft.c index 1f8fd05321..83775165d8 100644 --- a/thirdparty/opus/celt/kiss_fft.c +++ b/thirdparty/opus/celt/kiss_fft.c @@ -82,8 +82,8 @@ static void kf_bfly2( C_SUB( Fout2[0] , Fout[0] , t ); C_ADDTO( Fout[0] , t ); - t.r = S_MUL(Fout2[1].r+Fout2[1].i, tw); - t.i = S_MUL(Fout2[1].i-Fout2[1].r, tw); + t.r = S_MUL(ADD32_ovflw(Fout2[1].r, Fout2[1].i), tw); + t.i = S_MUL(SUB32_ovflw(Fout2[1].i, Fout2[1].r), tw); C_SUB( Fout2[1] , Fout[1] , t ); C_ADDTO( Fout[1] , t ); @@ -92,8 +92,8 @@ static void kf_bfly2( C_SUB( Fout2[2] , Fout[2] , t ); C_ADDTO( Fout[2] , t ); - t.r = S_MUL(Fout2[3].i-Fout2[3].r, tw); - t.i = S_MUL(-Fout2[3].i-Fout2[3].r, tw); + t.r = S_MUL(SUB32_ovflw(Fout2[3].i, Fout2[3].r), tw); + t.i = S_MUL(NEG32_ovflw(ADD32_ovflw(Fout2[3].i, Fout2[3].r)), tw); C_SUB( Fout2[3] , Fout[3] , t ); C_ADDTO( Fout[3] , t ); Fout += 8; @@ -126,10 +126,10 @@ static void kf_bfly4( C_ADDTO( *Fout , scratch1 ); C_SUB( scratch1 , Fout[1] , Fout[3] ); - Fout[1].r = scratch0.r + scratch1.i; - Fout[1].i = scratch0.i - scratch1.r; - Fout[3].r = scratch0.r - scratch1.i; - Fout[3].i = scratch0.i + scratch1.r; + Fout[1].r = ADD32_ovflw(scratch0.r, scratch1.i); + Fout[1].i = SUB32_ovflw(scratch0.i, scratch1.r); + Fout[3].r = SUB32_ovflw(scratch0.r, scratch1.i); + Fout[3].i = ADD32_ovflw(scratch0.i, scratch1.r); Fout+=4; } } else { @@ -160,10 +160,10 @@ static void kf_bfly4( tw3 += fstride*3; C_ADDTO( *Fout , scratch[3] ); - Fout[m].r = scratch[5].r + scratch[4].i; - Fout[m].i = scratch[5].i - scratch[4].r; - Fout[m3].r = scratch[5].r - scratch[4].i; - Fout[m3].i = scratch[5].i + scratch[4].r; + Fout[m].r = ADD32_ovflw(scratch[5].r, scratch[4].i); + Fout[m].i = SUB32_ovflw(scratch[5].i, scratch[4].r); + Fout[m3].r = SUB32_ovflw(scratch[5].r, scratch[4].i); + Fout[m3].i = ADD32_ovflw(scratch[5].i, scratch[4].r); ++Fout; } } @@ -212,18 +212,18 @@ static void kf_bfly3( tw1 += fstride; tw2 += fstride*2; - Fout[m].r = Fout->r - HALF_OF(scratch[3].r); - Fout[m].i = Fout->i - HALF_OF(scratch[3].i); + Fout[m].r = SUB32_ovflw(Fout->r, HALF_OF(scratch[3].r)); + Fout[m].i = SUB32_ovflw(Fout->i, HALF_OF(scratch[3].i)); C_MULBYSCALAR( scratch[0] , epi3.i ); C_ADDTO(*Fout,scratch[3]); - Fout[m2].r = Fout[m].r + scratch[0].i; - Fout[m2].i = Fout[m].i - scratch[0].r; + Fout[m2].r = ADD32_ovflw(Fout[m].r, scratch[0].i); + Fout[m2].i = SUB32_ovflw(Fout[m].i, scratch[0].r); - Fout[m].r -= scratch[0].i; - Fout[m].i += scratch[0].r; + Fout[m].r = SUB32_ovflw(Fout[m].r, scratch[0].i); + Fout[m].i = ADD32_ovflw(Fout[m].i, scratch[0].r); ++Fout; } while(--k); @@ -282,22 +282,22 @@ static void kf_bfly5( C_ADD( scratch[8],scratch[2],scratch[3]); C_SUB( scratch[9],scratch[2],scratch[3]); - Fout0->r += scratch[7].r + scratch[8].r; - Fout0->i += scratch[7].i + scratch[8].i; + Fout0->r = ADD32_ovflw(Fout0->r, ADD32_ovflw(scratch[7].r, scratch[8].r)); + Fout0->i = ADD32_ovflw(Fout0->i, ADD32_ovflw(scratch[7].i, scratch[8].i)); - scratch[5].r = scratch[0].r + S_MUL(scratch[7].r,ya.r) + S_MUL(scratch[8].r,yb.r); - scratch[5].i = scratch[0].i + S_MUL(scratch[7].i,ya.r) + S_MUL(scratch[8].i,yb.r); + scratch[5].r = ADD32_ovflw(scratch[0].r, ADD32_ovflw(S_MUL(scratch[7].r,ya.r), S_MUL(scratch[8].r,yb.r))); + scratch[5].i = ADD32_ovflw(scratch[0].i, ADD32_ovflw(S_MUL(scratch[7].i,ya.r), S_MUL(scratch[8].i,yb.r))); - scratch[6].r = S_MUL(scratch[10].i,ya.i) + S_MUL(scratch[9].i,yb.i); - scratch[6].i = -S_MUL(scratch[10].r,ya.i) - S_MUL(scratch[9].r,yb.i); + scratch[6].r = ADD32_ovflw(S_MUL(scratch[10].i,ya.i), S_MUL(scratch[9].i,yb.i)); + scratch[6].i = NEG32_ovflw(ADD32_ovflw(S_MUL(scratch[10].r,ya.i), S_MUL(scratch[9].r,yb.i))); C_SUB(*Fout1,scratch[5],scratch[6]); C_ADD(*Fout4,scratch[5],scratch[6]); - scratch[11].r = scratch[0].r + S_MUL(scratch[7].r,yb.r) + S_MUL(scratch[8].r,ya.r); - scratch[11].i = scratch[0].i + S_MUL(scratch[7].i,yb.r) + S_MUL(scratch[8].i,ya.r); - scratch[12].r = - S_MUL(scratch[10].i,yb.i) + S_MUL(scratch[9].i,ya.i); - scratch[12].i = S_MUL(scratch[10].r,yb.i) - S_MUL(scratch[9].r,ya.i); + scratch[11].r = ADD32_ovflw(scratch[0].r, ADD32_ovflw(S_MUL(scratch[7].r,yb.r), S_MUL(scratch[8].r,ya.r))); + scratch[11].i = ADD32_ovflw(scratch[0].i, ADD32_ovflw(S_MUL(scratch[7].i,yb.r), S_MUL(scratch[8].i,ya.r))); + scratch[12].r = SUB32_ovflw(S_MUL(scratch[9].i,ya.i), S_MUL(scratch[10].i,yb.i)); + scratch[12].i = SUB32_ovflw(S_MUL(scratch[10].r,yb.i), S_MUL(scratch[9].r,ya.i)); C_ADD(*Fout2,scratch[11],scratch[12]); C_SUB(*Fout3,scratch[11],scratch[12]); diff --git a/thirdparty/opus/celt/mathops.c b/thirdparty/opus/celt/mathops.c index 21a01f52e4..6ee9b9e101 100644 --- a/thirdparty/opus/celt/mathops.c +++ b/thirdparty/opus/celt/mathops.c @@ -38,7 +38,8 @@ #include "mathops.h" /*Compute floor(sqrt(_val)) with exact arithmetic. - This has been tested on all possible 32-bit inputs.*/ + _val must be greater than 0. + This has been tested on all possible 32-bit inputs greater than 0.*/ unsigned isqrt32(opus_uint32 _val){ unsigned b; unsigned g; @@ -182,7 +183,7 @@ opus_val32 celt_rcp(opus_val32 x) int i; opus_val16 n; opus_val16 r; - celt_assert2(x>0, "celt_rcp() only defined for positive values"); + celt_sig_assert(x>0); i = celt_ilog2(x); /* n is Q15 with range [0,1). */ n = VSHR32(x,i-15)-32768; diff --git a/thirdparty/opus/celt/mathops.h b/thirdparty/opus/celt/mathops.h index a0525a9610..5e86ff0dd2 100644 --- a/thirdparty/opus/celt/mathops.h +++ b/thirdparty/opus/celt/mathops.h @@ -38,11 +38,44 @@ #include "entcode.h" #include "os_support.h" +#define PI 3.141592653f + /* Multiplies two 16-bit fractional values. Bit-exactness of this macro is important */ #define FRAC_MUL16(a,b) ((16384+((opus_int32)(opus_int16)(a)*(opus_int16)(b)))>>15) unsigned isqrt32(opus_uint32 _val); +/* CELT doesn't need it for fixed-point, by analysis.c does. */ +#if !defined(FIXED_POINT) || defined(ANALYSIS_C) +#define cA 0.43157974f +#define cB 0.67848403f +#define cC 0.08595542f +#define cE ((float)PI/2) +static OPUS_INLINE float fast_atan2f(float y, float x) { + float x2, y2; + x2 = x*x; + y2 = y*y; + /* For very small values, we don't care about the answer, so + we can just return 0. */ + if (x2 + y2 < 1e-18f) + { + return 0; + } + if(x2<y2){ + float den = (y2 + cB*x2) * (y2 + cC*x2); + return -x*y*(y2 + cA*x2) / den + (y<0 ? -cE : cE); + }else{ + float den = (x2 + cB*y2) * (x2 + cC*y2); + return x*y*(x2 + cA*y2) / den + (y<0 ? -cE : cE) - (x*y<0 ? -cE : cE); + } +} +#undef cA +#undef cB +#undef cC +#undef cE +#endif + + #ifndef OVERRIDE_CELT_MAXABS16 static OPUS_INLINE opus_val32 celt_maxabs16(const opus_val16 *x, int len) { @@ -80,7 +113,6 @@ static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len) #ifndef FIXED_POINT -#define PI 3.141592653f #define celt_sqrt(x) ((float)sqrt(x)) #define celt_rsqrt(x) (1.f/celt_sqrt(x)) #define celt_rsqrt_norm(x) (celt_rsqrt(x)) @@ -147,7 +179,7 @@ static OPUS_INLINE float celt_exp2(float x) /** Integer log in base2. Undefined for zero and negative numbers */ static OPUS_INLINE opus_int16 celt_ilog2(opus_int32 x) { - celt_assert2(x>0, "celt_ilog2() only defined for strictly positive numbers"); + celt_sig_assert(x>0); return EC_ILOG(x)-1; } #endif diff --git a/thirdparty/opus/celt/mdct.c b/thirdparty/opus/celt/mdct.c index 5315ad11a3..5c6dab5b75 100644 --- a/thirdparty/opus/celt/mdct.c +++ b/thirdparty/opus/celt/mdct.c @@ -270,8 +270,8 @@ void clt_mdct_backward_c(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_sca int rev; kiss_fft_scalar yr, yi; rev = *bitrev++; - yr = S_MUL(*xp2, t[i]) + S_MUL(*xp1, t[N4+i]); - yi = S_MUL(*xp1, t[i]) - S_MUL(*xp2, t[N4+i]); + yr = ADD32_ovflw(S_MUL(*xp2, t[i]), S_MUL(*xp1, t[N4+i])); + yi = SUB32_ovflw(S_MUL(*xp1, t[i]), S_MUL(*xp2, t[N4+i])); /* We swap real and imag because we use an FFT instead of an IFFT. */ yp[2*rev+1] = yr; yp[2*rev] = yi; @@ -301,8 +301,8 @@ void clt_mdct_backward_c(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_sca t0 = t[i]; t1 = t[N4+i]; /* We'd scale up by 2 here, but instead it's done when mixing the windows */ - yr = S_MUL(re,t0) + S_MUL(im,t1); - yi = S_MUL(re,t1) - S_MUL(im,t0); + yr = ADD32_ovflw(S_MUL(re,t0), S_MUL(im,t1)); + yi = SUB32_ovflw(S_MUL(re,t1), S_MUL(im,t0)); /* We swap real and imag because we're using an FFT instead of an IFFT. */ re = yp1[1]; im = yp1[0]; @@ -312,8 +312,8 @@ void clt_mdct_backward_c(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_sca t0 = t[(N4-i-1)]; t1 = t[(N2-i-1)]; /* We'd scale up by 2 here, but instead it's done when mixing the windows */ - yr = S_MUL(re,t0) + S_MUL(im,t1); - yi = S_MUL(re,t1) - S_MUL(im,t0); + yr = ADD32_ovflw(S_MUL(re,t0), S_MUL(im,t1)); + yi = SUB32_ovflw(S_MUL(re,t1), S_MUL(im,t0)); yp1[0] = yr; yp0[1] = yi; yp0 += 2; @@ -333,8 +333,8 @@ void clt_mdct_backward_c(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_sca kiss_fft_scalar x1, x2; x1 = *xp1; x2 = *yp1; - *yp1++ = MULT16_32_Q15(*wp2, x2) - MULT16_32_Q15(*wp1, x1); - *xp1-- = MULT16_32_Q15(*wp1, x2) + MULT16_32_Q15(*wp2, x1); + *yp1++ = SUB32_ovflw(MULT16_32_Q15(*wp2, x2), MULT16_32_Q15(*wp1, x1)); + *xp1-- = ADD32_ovflw(MULT16_32_Q15(*wp1, x2), MULT16_32_Q15(*wp2, x1)); wp1++; wp2--; } diff --git a/thirdparty/opus/celt/mips/celt_mipsr1.h b/thirdparty/opus/celt/mips/celt_mipsr1.h index e85661a661..c332fe0471 100644 --- a/thirdparty/opus/celt/mips/celt_mipsr1.h +++ b/thirdparty/opus/celt/mips/celt_mipsr1.h @@ -53,6 +53,7 @@ #include "celt_lpc.h" #include "vq.h" +#define OVERRIDE_COMB_FILTER_CONST #define OVERRIDE_comb_filter void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N, opus_val16 g0, opus_val16 g1, int tapset0, int tapset1, diff --git a/thirdparty/opus/celt/mips/vq_mipsr1.h b/thirdparty/opus/celt/mips/vq_mipsr1.h index 54cef86133..f26a33e755 100644 --- a/thirdparty/opus/celt/mips/vq_mipsr1.h +++ b/thirdparty/opus/celt/mips/vq_mipsr1.h @@ -36,11 +36,6 @@ #include "mathops.h" #include "arch.h" -static unsigned extract_collapse_mask(int *iy, int N, int B); -static void normalise_residual(int * OPUS_RESTRICT iy, celt_norm * OPUS_RESTRICT X, int N, opus_val32 Ryy, opus_val16 gain); -static void exp_rotation(celt_norm *X, int len, int dir, int stride, int K, int spread); -static void renormalise_vector_mips(celt_norm *X, int N, opus_val16 gain, int arch); - #define OVERRIDE_vq_exp_rotation1 static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_val16 s) { @@ -69,11 +64,7 @@ static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_ } #define OVERRIDE_renormalise_vector - -#define renormalise_vector(X, N, gain, arch) \ - (renormalise_vector_mips(X, N, gain, arch)) - -void renormalise_vector_mips(celt_norm *X, int N, opus_val16 gain, int arch) +void renormalise_vector(celt_norm *X, int N, opus_val16 gain, int arch) { int i; #ifdef FIXED_POINT diff --git a/thirdparty/opus/celt/modes.c b/thirdparty/opus/celt/modes.c index 911686e905..390c5e8aeb 100644 --- a/thirdparty/opus/celt/modes.c +++ b/thirdparty/opus/celt/modes.c @@ -427,7 +427,7 @@ void opus_custom_mode_destroy(CELTMode *mode) } #endif /* CUSTOM_MODES_ONLY */ opus_free((opus_int16*)mode->eBands); - opus_free((opus_int16*)mode->allocVectors); + opus_free((unsigned char*)mode->allocVectors); opus_free((opus_val16*)mode->window); opus_free((opus_int16*)mode->logN); diff --git a/thirdparty/opus/celt/pitch.c b/thirdparty/opus/celt/pitch.c index bf46e7d562..872582a48a 100644 --- a/thirdparty/opus/celt/pitch.c +++ b/thirdparty/opus/celt/pitch.c @@ -102,11 +102,9 @@ static void find_best_pitch(opus_val32 *xcorr, opus_val16 *y, int len, } } -static void celt_fir5(const opus_val16 *x, +static void celt_fir5(opus_val16 *x, const opus_val16 *num, - opus_val16 *y, - int N, - opus_val16 *mem) + int N) { int i; opus_val16 num0, num1, num2, num3, num4; @@ -116,11 +114,11 @@ static void celt_fir5(const opus_val16 *x, num2=num[2]; num3=num[3]; num4=num[4]; - mem0=mem[0]; - mem1=mem[1]; - mem2=mem[2]; - mem3=mem[3]; - mem4=mem[4]; + mem0=0; + mem1=0; + mem2=0; + mem3=0; + mem4=0; for (i=0;i<N;i++) { opus_val32 sum = SHL32(EXTEND32(x[i]), SIG_SHIFT); @@ -134,13 +132,8 @@ static void celt_fir5(const opus_val16 *x, mem2 = mem1; mem1 = mem0; mem0 = x[i]; - y[i] = ROUND16(sum, SIG_SHIFT); + x[i] = ROUND16(sum, SIG_SHIFT); } - mem[0]=mem0; - mem[1]=mem1; - mem[2]=mem2; - mem[3]=mem3; - mem[4]=mem4; } @@ -150,7 +143,7 @@ void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x int i; opus_val32 ac[5]; opus_val16 tmp=Q15ONE; - opus_val16 lpc[4], mem[5]={0,0,0,0,0}; + opus_val16 lpc[4]; opus_val16 lpc2[5]; opus_val16 c1 = QCONST16(.8f,15); #ifdef FIXED_POINT @@ -211,7 +204,7 @@ void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x lpc2[2] = lpc[2] + MULT16_16_Q15(c1,lpc[1]); lpc2[3] = lpc[3] + MULT16_16_Q15(c1,lpc[2]); lpc2[4] = MULT16_16_Q15(c1,lpc[3]); - celt_fir5(x_lp, lpc2, x_lp, len>>1, mem); + celt_fir5(x_lp, lpc2, len>>1); } /* Pure C implementation. */ @@ -220,13 +213,8 @@ opus_val32 #else void #endif -#if defined(OVERRIDE_PITCH_XCORR) celt_pitch_xcorr_c(const opus_val16 *_x, const opus_val16 *_y, - opus_val32 *xcorr, int len, int max_pitch) -#else -celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch, int arch) -#endif { #if 0 /* This is a simple version of the pitch correlation that should work @@ -261,15 +249,11 @@ celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y, opus_val32 maxcorr=1; #endif celt_assert(max_pitch>0); - celt_assert((((unsigned char *)_x-(unsigned char *)NULL)&3)==0); + celt_sig_assert((((unsigned char *)_x-(unsigned char *)NULL)&3)==0); for (i=0;i<max_pitch-3;i+=4) { opus_val32 sum[4]={0,0,0,0}; -#if defined(OVERRIDE_PITCH_XCORR) - xcorr_kernel_c(_x, _y+i, sum, len); -#else xcorr_kernel(_x, _y+i, sum, len, arch); -#endif xcorr[i]=sum[0]; xcorr[i+1]=sum[1]; xcorr[i+2]=sum[2]; @@ -285,11 +269,7 @@ celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y, for (;i<max_pitch;i++) { opus_val32 sum; -#if defined(OVERRIDE_PITCH_XCORR) - sum = celt_inner_prod_c(_x, _y+i, len); -#else sum = celt_inner_prod(_x, _y+i, len, arch); -#endif xcorr[i] = sum; #ifdef FIXED_POINT maxcorr = MAX32(maxcorr, sum); @@ -378,7 +358,7 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR for (j=0;j<len>>1;j++) sum += SHR32(MULT16_16(x_lp[j],y[i+j]), shift); #else - sum = celt_inner_prod_c(x_lp, y+i, len>>1); + sum = celt_inner_prod(x_lp, y+i, len>>1, arch); #endif xcorr[i] = MAX32(-1, sum); #ifdef FIXED_POINT @@ -424,7 +404,7 @@ static opus_val16 compute_pitch_gain(opus_val32 xy, opus_val32 xx, opus_val32 yy sx = celt_ilog2(xx)-14; sy = celt_ilog2(yy)-14; shift = sx + sy; - x2y2 = MULT16_16_Q14(VSHR32(xx, sx), VSHR32(yy, sy)); + x2y2 = SHR32(MULT16_16(VSHR32(xx, sx), VSHR32(yy, sy)), 14); if (shift & 1) { if (x2y2 < 32768) { diff --git a/thirdparty/opus/celt/pitch.h b/thirdparty/opus/celt/pitch.h index d3503532a0..e425f56aea 100644 --- a/thirdparty/opus/celt/pitch.h +++ b/thirdparty/opus/celt/pitch.h @@ -46,8 +46,7 @@ #include "mips/pitch_mipsr1.h" #endif -#if ((defined(OPUS_ARM_ASM) && defined(FIXED_POINT)) \ - || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)) +#if (defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)) # include "arm/pitch_arm.h" #endif @@ -184,17 +183,10 @@ opus_val32 void #endif celt_pitch_xcorr_c(const opus_val16 *_x, const opus_val16 *_y, - opus_val32 *xcorr, int len, int max_pitch); - -#if !defined(OVERRIDE_PITCH_XCORR) -#ifdef FIXED_POINT -opus_val32 -#else -void -#endif -celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch, int arch); +#ifndef OVERRIDE_PITCH_XCORR +# define celt_pitch_xcorr celt_pitch_xcorr_c #endif #endif diff --git a/thirdparty/opus/celt/quant_bands.c b/thirdparty/opus/celt/quant_bands.c index 95076e0af2..39a221eda5 100644 --- a/thirdparty/opus/celt/quant_bands.c +++ b/thirdparty/opus/celt/quant_bands.c @@ -418,6 +418,7 @@ void quant_energy_finalise(const CELTMode *m, int start, int end, opus_val16 *ol offset = (q2-.5f)*(1<<(14-fine_quant[i]-1))*(1.f/16384); #endif oldEBands[i+c*m->nbEBands] += offset; + error[i+c*m->nbEBands] -= offset; bits_left--; } while (++c < C); } @@ -456,7 +457,7 @@ void unquant_coarse_energy(const CELTMode *m, int start, int end, opus_val16 *ol /* It would be better to express this invariant as a test on C at function entry, but that isn't enough to make the static analyzer happy. */ - celt_assert(c<2); + celt_sig_assert(c<2); tell = ec_tell(dec); if(budget-tell>=15) { @@ -547,9 +548,15 @@ void amp2Log2(const CELTMode *m, int effEnd, int end, c=0; do { for (i=0;i<effEnd;i++) + { bandLogE[i+c*m->nbEBands] = - celt_log2(SHL32(bandE[i+c*m->nbEBands],2)) + celt_log2(bandE[i+c*m->nbEBands]) - SHL16((opus_val16)eMeans[i],6); +#ifdef FIXED_POINT + /* Compensate for bandE[] being Q12 but celt_log2() taking a Q14 input. */ + bandLogE[i+c*m->nbEBands] += QCONST16(2.f, DB_SHIFT); +#endif + } for (i=effEnd;i<end;i++) bandLogE[c*m->nbEBands+i] = -QCONST16(14.f,DB_SHIFT); } while (++c < C); diff --git a/thirdparty/opus/celt/rate.c b/thirdparty/opus/celt/rate.c index 7dfa5be8a6..465e1ba26c 100644 --- a/thirdparty/opus/celt/rate.c +++ b/thirdparty/opus/celt/rate.c @@ -348,12 +348,17 @@ static OPUS_INLINE int interp_bits2pulses(const CELTMode *m, int start, int end, /*This if() block is the only part of the allocation function that is not a mandatory part of the bitstream: any bands we choose to skip here must be explicitly signaled.*/ - /*Choose a threshold with some hysteresis to keep bands from - fluctuating in and out.*/ + int depth_threshold; + /*We choose a threshold with some hysteresis to keep bands from + fluctuating in and out, but we try not to fold below a certain point. */ + if (codedBands > 17) + depth_threshold = j<prev ? 7 : 9; + else + depth_threshold = 0; #ifdef FUZZING if ((rand()&0x1) == 0) #else - if (codedBands<=start+2 || (band_bits > ((j<prev?7:9)*band_width<<LM<<BITRES)>>4 && j<=signalBandwidth)) + if (codedBands<=start+2 || (band_bits > (depth_threshold*band_width<<LM<<BITRES)>>4 && j<=signalBandwidth)) #endif { ec_enc_bit_logp(ec, 1, 1); @@ -524,7 +529,7 @@ static OPUS_INLINE int interp_bits2pulses(const CELTMode *m, int start, int end, return codedBands; } -int compute_allocation(const CELTMode *m, int start, int end, const int *offsets, const int *cap, int alloc_trim, int *intensity, int *dual_stereo, +int clt_compute_allocation(const CELTMode *m, int start, int end, const int *offsets, const int *cap, int alloc_trim, int *intensity, int *dual_stereo, opus_int32 total, opus_int32 *balance, int *pulses, int *ebits, int *fine_priority, int C, int LM, ec_ctx *ec, int encode, int prev, int signalBandwidth) { int lo, hi, len, j; diff --git a/thirdparty/opus/celt/rate.h b/thirdparty/opus/celt/rate.h index 515f7687ce..fad5e412da 100644 --- a/thirdparty/opus/celt/rate.h +++ b/thirdparty/opus/celt/rate.h @@ -95,7 +95,7 @@ static OPUS_INLINE int pulses2bits(const CELTMode *m, int band, int LM, int puls @param pulses Number of pulses per band (returned) @return Total number of bits allocated */ -int compute_allocation(const CELTMode *m, int start, int end, const int *offsets, const int *cap, int alloc_trim, int *intensity, int *dual_stero, +int clt_compute_allocation(const CELTMode *m, int start, int end, const int *offsets, const int *cap, int alloc_trim, int *intensity, int *dual_stereo, opus_int32 total, opus_int32 *balance, int *pulses, int *ebits, int *fine_priority, int C, int LM, ec_ctx *ec, int encode, int prev, int signalBandwidth); #endif diff --git a/thirdparty/opus/celt/static_modes_fixed_arm_ne10.h b/thirdparty/opus/celt/static_modes_fixed_arm_ne10.h index b8ef0cee98..7623092192 100644 --- a/thirdparty/opus/celt/static_modes_fixed_arm_ne10.h +++ b/thirdparty/opus/celt/static_modes_fixed_arm_ne10.h @@ -1,7 +1,7 @@ /* The contents of this file was automatically generated by * dump_mode_arm_ne10.c with arguments: 48000 960 * It contains static definitions for some pre-defined modes. */ -#include <NE10_init.h> +#include <NE10_types.h> #ifndef NE10_FFT_PARAMS48000_960 #define NE10_FFT_PARAMS48000_960 diff --git a/thirdparty/opus/celt/static_modes_float_arm_ne10.h b/thirdparty/opus/celt/static_modes_float_arm_ne10.h index 934a82a420..66e1abb101 100644 --- a/thirdparty/opus/celt/static_modes_float_arm_ne10.h +++ b/thirdparty/opus/celt/static_modes_float_arm_ne10.h @@ -1,7 +1,7 @@ /* The contents of this file was automatically generated by * dump_mode_arm_ne10.c with arguments: 48000 960 * It contains static definitions for some pre-defined modes. */ -#include <NE10_init.h> +#include <NE10_types.h> #ifndef NE10_FFT_PARAMS48000_960 #define NE10_FFT_PARAMS48000_960 diff --git a/thirdparty/opus/celt/tests/test_unit_cwrs32.c b/thirdparty/opus/celt/tests/test_unit_cwrs32.c deleted file mode 100644 index 36dd8af5f5..0000000000 --- a/thirdparty/opus/celt/tests/test_unit_cwrs32.c +++ /dev/null @@ -1,161 +0,0 @@ -/* Copyright (c) 2008-2011 Xiph.Org Foundation, Mozilla Corporation, - Gregory Maxwell - Written by Jean-Marc Valin, Gregory Maxwell, and Timothy B. Terriberry */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> -#include <string.h> - -#ifndef CUSTOM_MODES -#define CUSTOM_MODES -#else -#define TEST_CUSTOM_MODES -#endif - -#define CELT_C -#include "stack_alloc.h" -#include "entenc.c" -#include "entdec.c" -#include "entcode.c" -#include "cwrs.c" -#include "mathops.c" -#include "rate.h" - -#define NMAX (240) -#define KMAX (128) - -#ifdef TEST_CUSTOM_MODES - -#define NDIMS (44) -static const int pn[NDIMS]={ - 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 18, 20, 22, - 24, 26, 28, 30, 32, 36, 40, 44, 48, - 52, 56, 60, 64, 72, 80, 88, 96, 104, - 112, 120, 128, 144, 160, 176, 192, 208 -}; -static const int pkmax[NDIMS]={ - 128, 128, 128, 128, 88, 52, 36, 26, 22, - 18, 16, 15, 13, 12, 12, 11, 10, 9, - 9, 8, 8, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 5, 5, 5, 5, 5, 5, - 4, 4, 4, 4, 4, 4, 4, 4 -}; - -#else /* TEST_CUSTOM_MODES */ - -#define NDIMS (22) -static const int pn[NDIMS]={ - 2, 3, 4, 6, 8, 9, 11, 12, 16, - 18, 22, 24, 32, 36, 44, 48, 64, 72, - 88, 96, 144, 176 -}; -static const int pkmax[NDIMS]={ - 128, 128, 128, 88, 36, 26, 18, 16, 12, - 11, 9, 9, 7, 7, 6, 6, 5, 5, - 5, 5, 4, 4 -}; - -#endif - -int main(void){ - int t; - int n; - ALLOC_STACK; - for(t=0;t<NDIMS;t++){ - int pseudo; - n=pn[t]; - for(pseudo=1;pseudo<41;pseudo++) - { - int k; -#if defined(SMALL_FOOTPRINT) - opus_uint32 uu[KMAX+2U]; -#endif - opus_uint32 inc; - opus_uint32 nc; - opus_uint32 i; - k=get_pulses(pseudo); - if (k>pkmax[t])break; - printf("Testing CWRS with N=%i, K=%i...\n",n,k); -#if defined(SMALL_FOOTPRINT) - nc=ncwrs_urow(n,k,uu); -#else - nc=CELT_PVQ_V(n,k); -#endif - inc=nc/20000; - if(inc<1)inc=1; - for(i=0;i<nc;i+=inc){ -#if defined(SMALL_FOOTPRINT) - opus_uint32 u[KMAX+2U]; -#endif - int y[NMAX]; - int sy; - opus_uint32 v; - opus_uint32 ii; - int j; -#if defined(SMALL_FOOTPRINT) - memcpy(u,uu,(k+2U)*sizeof(*u)); - cwrsi(n,k,i,y,u); -#else - cwrsi(n,k,i,y); -#endif - sy=0; - for(j=0;j<n;j++)sy+=abs(y[j]); - if(sy!=k){ - fprintf(stderr,"N=%d Pulse count mismatch in cwrsi (%d!=%d).\n", - n,sy,k); - return 99; - } - /*printf("%6u of %u:",i,nc); - for(j=0;j<n;j++)printf(" %+3i",y[j]); - printf(" ->");*/ -#if defined(SMALL_FOOTPRINT) - ii=icwrs(n,k,&v,y,u); -#else - ii=icwrs(n,y); - v=CELT_PVQ_V(n,k); -#endif - if(ii!=i){ - fprintf(stderr,"Combination-index mismatch (%lu!=%lu).\n", - (long)ii,(long)i); - return 1; - } - if(v!=nc){ - fprintf(stderr,"Combination count mismatch (%lu!=%lu).\n", - (long)v,(long)nc); - return 2; - } - /*printf(" %6u\n",i);*/ - } - /*printf("\n");*/ - } - } - return 0; -} diff --git a/thirdparty/opus/celt/tests/test_unit_dft.c b/thirdparty/opus/celt/tests/test_unit_dft.c deleted file mode 100644 index 6166eb0e4f..0000000000 --- a/thirdparty/opus/celt/tests/test_unit_dft.c +++ /dev/null @@ -1,189 +0,0 @@ -/* Copyright (c) 2008 Xiph.Org Foundation - Written by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define SKIP_CONFIG_H - -#ifndef CUSTOM_MODES -#define CUSTOM_MODES -#endif - -#include <stdio.h> - -#define CELT_C -#define TEST_UNIT_DFT_C -#include "stack_alloc.h" -#include "kiss_fft.h" -#include "kiss_fft.c" -#include "mathops.c" -#include "entcode.c" - -#if defined(OPUS_X86_MAY_HAVE_SSE2) || defined(OPUS_X86_MAY_HAVE_SSE4_1) -# include "x86/x86cpu.c" -#elif defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) -# include "arm/armcpu.c" -# include "celt_lpc.c" -# include "pitch.c" -# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) -# include "arm/celt_neon_intr.c" -# if defined(HAVE_ARM_NE10) -# include "mdct.c" -# include "arm/celt_ne10_fft.c" -# include "arm/celt_ne10_mdct.c" -# endif -# endif -# include "arm/arm_celt_map.c" -#endif - -#ifndef M_PI -#define M_PI 3.141592653 -#endif - -int ret = 0; - -void check(kiss_fft_cpx * in,kiss_fft_cpx * out,int nfft,int isinverse) -{ - int bin,k; - double errpow=0,sigpow=0, snr; - - for (bin=0;bin<nfft;++bin) { - double ansr = 0; - double ansi = 0; - double difr; - double difi; - - for (k=0;k<nfft;++k) { - double phase = -2*M_PI*bin*k/nfft; - double re = cos(phase); - double im = sin(phase); - if (isinverse) - im = -im; - - if (!isinverse) - { - re /= nfft; - im /= nfft; - } - - ansr += in[k].r * re - in[k].i * im; - ansi += in[k].r * im + in[k].i * re; - } - /*printf ("%d %d ", (int)ansr, (int)ansi);*/ - difr = ansr - out[bin].r; - difi = ansi - out[bin].i; - errpow += difr*difr + difi*difi; - sigpow += ansr*ansr+ansi*ansi; - } - snr = 10*log10(sigpow/errpow); - printf("nfft=%d inverse=%d,snr = %f\n",nfft,isinverse,snr ); - if (snr<60) { - printf( "** poor snr: %f ** \n", snr); - ret = 1; - } -} - -void test1d(int nfft,int isinverse,int arch) -{ - size_t buflen = sizeof(kiss_fft_cpx)*nfft; - - kiss_fft_cpx * in = (kiss_fft_cpx*)malloc(buflen); - kiss_fft_cpx * out= (kiss_fft_cpx*)malloc(buflen); - kiss_fft_state *cfg = opus_fft_alloc(nfft,0,0,arch); - int k; - - for (k=0;k<nfft;++k) { - in[k].r = (rand() % 32767) - 16384; - in[k].i = (rand() % 32767) - 16384; - } - - for (k=0;k<nfft;++k) { - in[k].r *= 32768; - in[k].i *= 32768; - } - - if (isinverse) - { - for (k=0;k<nfft;++k) { - in[k].r /= nfft; - in[k].i /= nfft; - } - } - - /*for (k=0;k<nfft;++k) printf("%d %d ", in[k].r, in[k].i);printf("\n");*/ - - if (isinverse) - opus_ifft(cfg,in,out, arch); - else - opus_fft(cfg,in,out, arch); - - /*for (k=0;k<nfft;++k) printf("%d %d ", out[k].r, out[k].i);printf("\n");*/ - - check(in,out,nfft,isinverse); - - free(in); - free(out); - opus_fft_free(cfg, arch); -} - -int main(int argc,char ** argv) -{ - ALLOC_STACK; - int arch = opus_select_arch(); - - if (argc>1) { - int k; - for (k=1;k<argc;++k) { - test1d(atoi(argv[k]),0,arch); - test1d(atoi(argv[k]),1,arch); - } - }else{ - test1d(32,0,arch); - test1d(32,1,arch); - test1d(128,0,arch); - test1d(128,1,arch); - test1d(256,0,arch); - test1d(256,1,arch); -#ifndef RADIX_TWO_ONLY - test1d(36,0,arch); - test1d(36,1,arch); - test1d(50,0,arch); - test1d(50,1,arch); - test1d(60,0,arch); - test1d(60,1,arch); - test1d(120,0,arch); - test1d(120,1,arch); - test1d(240,0,arch); - test1d(240,1,arch); - test1d(480,0,arch); - test1d(480,1,arch); -#endif - } - return ret; -} diff --git a/thirdparty/opus/celt/tests/test_unit_entropy.c b/thirdparty/opus/celt/tests/test_unit_entropy.c deleted file mode 100644 index ff9265864c..0000000000 --- a/thirdparty/opus/celt/tests/test_unit_entropy.c +++ /dev/null @@ -1,382 +0,0 @@ -/* Copyright (c) 2007-2011 Xiph.Org Foundation, Mozilla Corporation, - Gregory Maxwell - Written by Jean-Marc Valin, Gregory Maxwell, and Timothy B. Terriberry */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdlib.h> -#include <stdio.h> -#include <math.h> -#include <time.h> -#include "entcode.h" -#include "entenc.h" -#include "entdec.h" -#include <string.h> - -#include "entenc.c" -#include "entdec.c" -#include "entcode.c" - -#ifndef M_LOG2E -# define M_LOG2E 1.4426950408889634074 -#endif -#define DATA_SIZE 10000000 -#define DATA_SIZE2 10000 - -int main(int _argc,char **_argv){ - ec_enc enc; - ec_dec dec; - long nbits; - long nbits2; - double entropy; - int ft; - int ftb; - int sz; - int i; - int ret; - unsigned int sym; - unsigned int seed; - unsigned char *ptr; - const char *env_seed; - ret=0; - entropy=0; - if (_argc > 2) { - fprintf(stderr, "Usage: %s [<seed>]\n", _argv[0]); - return 1; - } - env_seed = getenv("SEED"); - if (_argc > 1) - seed = atoi(_argv[1]); - else if (env_seed) - seed = atoi(env_seed); - else - seed = time(NULL); - /*Testing encoding of raw bit values.*/ - ptr = (unsigned char *)malloc(DATA_SIZE); - ec_enc_init(&enc,ptr, DATA_SIZE); - for(ft=2;ft<1024;ft++){ - for(i=0;i<ft;i++){ - entropy+=log(ft)*M_LOG2E; - ec_enc_uint(&enc,i,ft); - } - } - /*Testing encoding of raw bit values.*/ - for(ftb=1;ftb<16;ftb++){ - for(i=0;i<(1<<ftb);i++){ - entropy+=ftb; - nbits=ec_tell(&enc); - ec_enc_bits(&enc,i,ftb); - nbits2=ec_tell(&enc); - if(nbits2-nbits!=ftb){ - fprintf(stderr,"Used %li bits to encode %i bits directly.\n", - nbits2-nbits,ftb); - ret=-1; - } - } - } - nbits=ec_tell_frac(&enc); - ec_enc_done(&enc); - fprintf(stderr, - "Encoded %0.2lf bits of entropy to %0.2lf bits (%0.3lf%% wasted).\n", - entropy,ldexp(nbits,-3),100*(nbits-ldexp(entropy,3))/nbits); - fprintf(stderr,"Packed to %li bytes.\n",(long)ec_range_bytes(&enc)); - ec_dec_init(&dec,ptr,DATA_SIZE); - for(ft=2;ft<1024;ft++){ - for(i=0;i<ft;i++){ - sym=ec_dec_uint(&dec,ft); - if(sym!=(unsigned)i){ - fprintf(stderr,"Decoded %i instead of %i with ft of %i.\n",sym,i,ft); - ret=-1; - } - } - } - for(ftb=1;ftb<16;ftb++){ - for(i=0;i<(1<<ftb);i++){ - sym=ec_dec_bits(&dec,ftb); - if(sym!=(unsigned)i){ - fprintf(stderr,"Decoded %i instead of %i with ftb of %i.\n",sym,i,ftb); - ret=-1; - } - } - } - nbits2=ec_tell_frac(&dec); - if(nbits!=nbits2){ - fprintf(stderr, - "Reported number of bits used was %0.2lf, should be %0.2lf.\n", - ldexp(nbits2,-3),ldexp(nbits,-3)); - ret=-1; - } - /*Testing an encoder bust prefers range coder data over raw bits. - This isn't a general guarantee, will only work for data that is buffered in - the encoder state and not yet stored in the user buffer, and should never - get used in practice. - It's mostly here for code coverage completeness.*/ - /*Start with a 16-bit buffer.*/ - ec_enc_init(&enc,ptr,2); - /*Write 7 raw bits.*/ - ec_enc_bits(&enc,0x55,7); - /*Write 12.3 bits of range coder data.*/ - ec_enc_uint(&enc,1,2); - ec_enc_uint(&enc,1,3); - ec_enc_uint(&enc,1,4); - ec_enc_uint(&enc,1,5); - ec_enc_uint(&enc,2,6); - ec_enc_uint(&enc,6,7); - ec_enc_done(&enc); - ec_dec_init(&dec,ptr,2); - if(!enc.error - /*The raw bits should have been overwritten by the range coder data.*/ - ||ec_dec_bits(&dec,7)!=0x05 - /*And all the range coder data should have been encoded correctly.*/ - ||ec_dec_uint(&dec,2)!=1 - ||ec_dec_uint(&dec,3)!=1 - ||ec_dec_uint(&dec,4)!=1 - ||ec_dec_uint(&dec,5)!=1 - ||ec_dec_uint(&dec,6)!=2 - ||ec_dec_uint(&dec,7)!=6){ - fprintf(stderr,"Encoder bust overwrote range coder data with raw bits.\n"); - ret=-1; - } - srand(seed); - fprintf(stderr,"Testing random streams... Random seed: %u (%.4X)\n", seed, rand() % 65536); - for(i=0;i<409600;i++){ - unsigned *data; - unsigned *tell; - unsigned tell_bits; - int j; - int zeros; - ft=rand()/((RAND_MAX>>(rand()%11U))+1U)+10; - sz=rand()/((RAND_MAX>>(rand()%9U))+1U); - data=(unsigned *)malloc(sz*sizeof(*data)); - tell=(unsigned *)malloc((sz+1)*sizeof(*tell)); - ec_enc_init(&enc,ptr,DATA_SIZE2); - zeros = rand()%13==0; - tell[0]=ec_tell_frac(&enc); - for(j=0;j<sz;j++){ - if (zeros) - data[j]=0; - else - data[j]=rand()%ft; - ec_enc_uint(&enc,data[j],ft); - tell[j+1]=ec_tell_frac(&enc); - } - if (rand()%2==0) - while(ec_tell(&enc)%8 != 0) - ec_enc_uint(&enc, rand()%2, 2); - tell_bits = ec_tell(&enc); - ec_enc_done(&enc); - if(tell_bits!=(unsigned)ec_tell(&enc)){ - fprintf(stderr,"ec_tell() changed after ec_enc_done(): %i instead of %i (Random seed: %u)\n", - ec_tell(&enc),tell_bits,seed); - ret=-1; - } - if ((tell_bits+7)/8 < ec_range_bytes(&enc)) - { - fprintf (stderr, "ec_tell() lied, there's %i bytes instead of %d (Random seed: %u)\n", - ec_range_bytes(&enc), (tell_bits+7)/8,seed); - ret=-1; - } - ec_dec_init(&dec,ptr,DATA_SIZE2); - if(ec_tell_frac(&dec)!=tell[0]){ - fprintf(stderr, - "Tell mismatch between encoder and decoder at symbol %i: %i instead of %i (Random seed: %u).\n", - 0,ec_tell_frac(&dec),tell[0],seed); - } - for(j=0;j<sz;j++){ - sym=ec_dec_uint(&dec,ft); - if(sym!=data[j]){ - fprintf(stderr, - "Decoded %i instead of %i with ft of %i at position %i of %i (Random seed: %u).\n", - sym,data[j],ft,j,sz,seed); - ret=-1; - } - if(ec_tell_frac(&dec)!=tell[j+1]){ - fprintf(stderr, - "Tell mismatch between encoder and decoder at symbol %i: %i instead of %i (Random seed: %u).\n", - j+1,ec_tell_frac(&dec),tell[j+1],seed); - } - } - free(tell); - free(data); - } - /*Test compatibility between multiple different encode/decode routines.*/ - for(i=0;i<409600;i++){ - unsigned *logp1; - unsigned *data; - unsigned *tell; - unsigned *enc_method; - int j; - sz=rand()/((RAND_MAX>>(rand()%9U))+1U); - logp1=(unsigned *)malloc(sz*sizeof(*logp1)); - data=(unsigned *)malloc(sz*sizeof(*data)); - tell=(unsigned *)malloc((sz+1)*sizeof(*tell)); - enc_method=(unsigned *)malloc(sz*sizeof(*enc_method)); - ec_enc_init(&enc,ptr,DATA_SIZE2); - tell[0]=ec_tell_frac(&enc); - for(j=0;j<sz;j++){ - data[j]=rand()/((RAND_MAX>>1)+1); - logp1[j]=(rand()%15)+1; - enc_method[j]=rand()/((RAND_MAX>>2)+1); - switch(enc_method[j]){ - case 0:{ - ec_encode(&enc,data[j]?(1<<logp1[j])-1:0, - (1<<logp1[j])-(data[j]?0:1),1<<logp1[j]); - }break; - case 1:{ - ec_encode_bin(&enc,data[j]?(1<<logp1[j])-1:0, - (1<<logp1[j])-(data[j]?0:1),logp1[j]); - }break; - case 2:{ - ec_enc_bit_logp(&enc,data[j],logp1[j]); - }break; - case 3:{ - unsigned char icdf[2]; - icdf[0]=1; - icdf[1]=0; - ec_enc_icdf(&enc,data[j],icdf,logp1[j]); - }break; - } - tell[j+1]=ec_tell_frac(&enc); - } - ec_enc_done(&enc); - if((ec_tell(&enc)+7U)/8U<ec_range_bytes(&enc)){ - fprintf(stderr,"tell() lied, there's %i bytes instead of %d (Random seed: %u)\n", - ec_range_bytes(&enc),(ec_tell(&enc)+7)/8,seed); - ret=-1; - } - ec_dec_init(&dec,ptr,DATA_SIZE2); - if(ec_tell_frac(&dec)!=tell[0]){ - fprintf(stderr, - "Tell mismatch between encoder and decoder at symbol %i: %i instead of %i (Random seed: %u).\n", - 0,ec_tell_frac(&dec),tell[0],seed); - } - for(j=0;j<sz;j++){ - int fs; - int dec_method; - dec_method=rand()/((RAND_MAX>>2)+1); - switch(dec_method){ - case 0:{ - fs=ec_decode(&dec,1<<logp1[j]); - sym=fs>=(1<<logp1[j])-1; - ec_dec_update(&dec,sym?(1<<logp1[j])-1:0, - (1<<logp1[j])-(sym?0:1),1<<logp1[j]); - }break; - case 1:{ - fs=ec_decode_bin(&dec,logp1[j]); - sym=fs>=(1<<logp1[j])-1; - ec_dec_update(&dec,sym?(1<<logp1[j])-1:0, - (1<<logp1[j])-(sym?0:1),1<<logp1[j]); - }break; - case 2:{ - sym=ec_dec_bit_logp(&dec,logp1[j]); - }break; - case 3:{ - unsigned char icdf[2]; - icdf[0]=1; - icdf[1]=0; - sym=ec_dec_icdf(&dec,icdf,logp1[j]); - }break; - } - if(sym!=data[j]){ - fprintf(stderr, - "Decoded %i instead of %i with logp1 of %i at position %i of %i (Random seed: %u).\n", - sym,data[j],logp1[j],j,sz,seed); - fprintf(stderr,"Encoding method: %i, decoding method: %i\n", - enc_method[j],dec_method); - ret=-1; - } - if(ec_tell_frac(&dec)!=tell[j+1]){ - fprintf(stderr, - "Tell mismatch between encoder and decoder at symbol %i: %i instead of %i (Random seed: %u).\n", - j+1,ec_tell_frac(&dec),tell[j+1],seed); - } - } - free(enc_method); - free(tell); - free(data); - free(logp1); - } - ec_enc_init(&enc,ptr,DATA_SIZE2); - ec_enc_bit_logp(&enc,0,1); - ec_enc_bit_logp(&enc,0,1); - ec_enc_bit_logp(&enc,0,1); - ec_enc_bit_logp(&enc,0,1); - ec_enc_bit_logp(&enc,0,2); - ec_enc_patch_initial_bits(&enc,3,2); - if(enc.error){ - fprintf(stderr,"patch_initial_bits failed"); - ret=-1; - } - ec_enc_patch_initial_bits(&enc,0,5); - if(!enc.error){ - fprintf(stderr,"patch_initial_bits didn't fail when it should have"); - ret=-1; - } - ec_enc_done(&enc); - if(ec_range_bytes(&enc)!=1||ptr[0]!=192){ - fprintf(stderr,"Got %d when expecting 192 for patch_initial_bits",ptr[0]); - ret=-1; - } - ec_enc_init(&enc,ptr,DATA_SIZE2); - ec_enc_bit_logp(&enc,0,1); - ec_enc_bit_logp(&enc,0,1); - ec_enc_bit_logp(&enc,1,6); - ec_enc_bit_logp(&enc,0,2); - ec_enc_patch_initial_bits(&enc,0,2); - if(enc.error){ - fprintf(stderr,"patch_initial_bits failed"); - ret=-1; - } - ec_enc_done(&enc); - if(ec_range_bytes(&enc)!=2||ptr[0]!=63){ - fprintf(stderr,"Got %d when expecting 63 for patch_initial_bits",ptr[0]); - ret=-1; - } - ec_enc_init(&enc,ptr,2); - ec_enc_bit_logp(&enc,0,2); - for(i=0;i<48;i++){ - ec_enc_bits(&enc,0,1); - } - ec_enc_done(&enc); - if(!enc.error){ - fprintf(stderr,"Raw bits overfill didn't fail when it should have"); - ret=-1; - } - ec_enc_init(&enc,ptr,2); - for(i=0;i<17;i++){ - ec_enc_bits(&enc,0,1); - } - ec_enc_done(&enc); - if(!enc.error){ - fprintf(stderr,"17 raw bits encoded in two bytes"); - ret=-1; - } - free(ptr); - return ret; -} diff --git a/thirdparty/opus/celt/tests/test_unit_laplace.c b/thirdparty/opus/celt/tests/test_unit_laplace.c deleted file mode 100644 index 22951e29ee..0000000000 --- a/thirdparty/opus/celt/tests/test_unit_laplace.c +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright (c) 2008-2011 Xiph.Org Foundation, Mozilla Corporation - Written by Jean-Marc Valin and Timothy B. Terriberry */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> -#include <stdlib.h> -#include "laplace.h" -#define CELT_C -#include "stack_alloc.h" - -#include "entenc.c" -#include "entdec.c" -#include "entcode.c" -#include "laplace.c" - -#define DATA_SIZE 40000 - -int ec_laplace_get_start_freq(int decay) -{ - opus_uint32 ft = 32768 - LAPLACE_MINP*(2*LAPLACE_NMIN+1); - int fs = (ft*(16384-decay))/(16384+decay); - return fs+LAPLACE_MINP; -} - -int main(void) -{ - int i; - int ret = 0; - ec_enc enc; - ec_dec dec; - unsigned char *ptr; - int val[10000], decay[10000]; - ALLOC_STACK; - ptr = (unsigned char *)malloc(DATA_SIZE); - ec_enc_init(&enc,ptr,DATA_SIZE); - - val[0] = 3; decay[0] = 6000; - val[1] = 0; decay[1] = 5800; - val[2] = -1; decay[2] = 5600; - for (i=3;i<10000;i++) - { - val[i] = rand()%15-7; - decay[i] = rand()%11000+5000; - } - for (i=0;i<10000;i++) - ec_laplace_encode(&enc, &val[i], - ec_laplace_get_start_freq(decay[i]), decay[i]); - - ec_enc_done(&enc); - - ec_dec_init(&dec,ec_get_buffer(&enc),ec_range_bytes(&enc)); - - for (i=0;i<10000;i++) - { - int d = ec_laplace_decode(&dec, - ec_laplace_get_start_freq(decay[i]), decay[i]); - if (d != val[i]) - { - fprintf (stderr, "Got %d instead of %d\n", d, val[i]); - ret = 1; - } - } - - free(ptr); - return ret; -} diff --git a/thirdparty/opus/celt/tests/test_unit_mathops.c b/thirdparty/opus/celt/tests/test_unit_mathops.c deleted file mode 100644 index fd3319da91..0000000000 --- a/thirdparty/opus/celt/tests/test_unit_mathops.c +++ /dev/null @@ -1,304 +0,0 @@ -/* Copyright (c) 2008-2011 Xiph.Org Foundation, Mozilla Corporation, - Gregory Maxwell - Written by Jean-Marc Valin, Gregory Maxwell, and Timothy B. Terriberry */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef CUSTOM_MODES -#define CUSTOM_MODES -#endif - -#define CELT_C - -#include <stdio.h> -#include <math.h> -#include "mathops.c" -#include "entenc.c" -#include "entdec.c" -#include "entcode.c" -#include "bands.c" -#include "quant_bands.c" -#include "laplace.c" -#include "vq.c" -#include "cwrs.c" -#include "pitch.c" -#include "celt_lpc.c" -#include "celt.c" - -#if defined(OPUS_X86_MAY_HAVE_SSE) || defined(OPUS_X86_MAY_HAVE_SSE2) || defined(OPUS_X86_MAY_HAVE_SSE4_1) -# if defined(OPUS_X86_MAY_HAVE_SSE) -# include "x86/pitch_sse.c" -# endif -# if defined(OPUS_X86_MAY_HAVE_SSE2) -# include "x86/pitch_sse2.c" -# endif -# if defined(OPUS_X86_MAY_HAVE_SSE4_1) -# include "x86/pitch_sse4_1.c" -# include "x86/celt_lpc_sse.c" -# endif -# include "x86/x86_celt_map.c" -#elif defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) -# include "arm/armcpu.c" -# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) -# include "arm/celt_neon_intr.c" -# if defined(HAVE_ARM_NE10) -# include "kiss_fft.c" -# include "mdct.c" -# include "arm/celt_ne10_fft.c" -# include "arm/celt_ne10_mdct.c" -# endif -# endif -# include "arm/arm_celt_map.c" -#endif - -#ifdef FIXED_POINT -#define WORD "%d" -#else -#define WORD "%f" -#endif - -int ret = 0; - -void testdiv(void) -{ - opus_int32 i; - for (i=1;i<=327670;i++) - { - double prod; - opus_val32 val; - val = celt_rcp(i); -#ifdef FIXED_POINT - prod = (1./32768./65526.)*val*i; -#else - prod = val*i; -#endif - if (fabs(prod-1) > .00025) - { - fprintf (stderr, "div failed: 1/%d="WORD" (product = %f)\n", i, val, prod); - ret = 1; - } - } -} - -void testsqrt(void) -{ - opus_int32 i; - for (i=1;i<=1000000000;i++) - { - double ratio; - opus_val16 val; - val = celt_sqrt(i); - ratio = val/sqrt(i); - if (fabs(ratio - 1) > .0005 && fabs(val-sqrt(i)) > 2) - { - fprintf (stderr, "sqrt failed: sqrt(%d)="WORD" (ratio = %f)\n", i, val, ratio); - ret = 1; - } - i+= i>>10; - } -} - -void testbitexactcos(void) -{ - int i; - opus_int32 min_d,max_d,last,chk; - chk=max_d=0; - last=min_d=32767; - for(i=64;i<=16320;i++) - { - opus_int32 d; - opus_int32 q=bitexact_cos(i); - chk ^= q*i; - d = last - q; - if (d>max_d)max_d=d; - if (d<min_d)min_d=d; - last = q; - } - if ((chk!=89408644)||(max_d!=5)||(min_d!=0)||(bitexact_cos(64)!=32767)|| - (bitexact_cos(16320)!=200)||(bitexact_cos(8192)!=23171)) - { - fprintf (stderr, "bitexact_cos failed\n"); - ret = 1; - } -} - -void testbitexactlog2tan(void) -{ - int i,fail; - opus_int32 min_d,max_d,last,chk; - fail=chk=max_d=0; - last=min_d=15059; - for(i=64;i<8193;i++) - { - opus_int32 d; - opus_int32 mid=bitexact_cos(i); - opus_int32 side=bitexact_cos(16384-i); - opus_int32 q=bitexact_log2tan(mid,side); - chk ^= q*i; - d = last - q; - if (q!=-1*bitexact_log2tan(side,mid)) - fail = 1; - if (d>max_d)max_d=d; - if (d<min_d)min_d=d; - last = q; - } - if ((chk!=15821257)||(max_d!=61)||(min_d!=-2)||fail|| - (bitexact_log2tan(32767,200)!=15059)||(bitexact_log2tan(30274,12540)!=2611)|| - (bitexact_log2tan(23171,23171)!=0)) - { - fprintf (stderr, "bitexact_log2tan failed\n"); - ret = 1; - } -} - -#ifndef FIXED_POINT -void testlog2(void) -{ - float x; - for (x=0.001;x<1677700.0;x+=(x/8.0)) - { - float error = fabs((1.442695040888963387*log(x))-celt_log2(x)); - if (error>0.0009) - { - fprintf (stderr, "celt_log2 failed: fabs((1.442695040888963387*log(x))-celt_log2(x))>0.001 (x = %f, error = %f)\n", x,error); - ret = 1; - } - } -} - -void testexp2(void) -{ - float x; - for (x=-11.0;x<24.0;x+=0.0007) - { - float error = fabs(x-(1.442695040888963387*log(celt_exp2(x)))); - if (error>0.0002) - { - fprintf (stderr, "celt_exp2 failed: fabs(x-(1.442695040888963387*log(celt_exp2(x))))>0.0005 (x = %f, error = %f)\n", x,error); - ret = 1; - } - } -} - -void testexp2log2(void) -{ - float x; - for (x=-11.0;x<24.0;x+=0.0007) - { - float error = fabs(x-(celt_log2(celt_exp2(x)))); - if (error>0.001) - { - fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_log2(celt_exp2(x))))>0.001 (x = %f, error = %f)\n", x,error); - ret = 1; - } - } -} -#else -void testlog2(void) -{ - opus_val32 x; - for (x=8;x<1073741824;x+=(x>>3)) - { - float error = fabs((1.442695040888963387*log(x/16384.0))-celt_log2(x)/1024.0); - if (error>0.003) - { - fprintf (stderr, "celt_log2 failed: x = %ld, error = %f\n", (long)x,error); - ret = 1; - } - } -} - -void testexp2(void) -{ - opus_val16 x; - for (x=-32768;x<15360;x++) - { - float error1 = fabs(x/1024.0-(1.442695040888963387*log(celt_exp2(x)/65536.0))); - float error2 = fabs(exp(0.6931471805599453094*x/1024.0)-celt_exp2(x)/65536.0); - if (error1>0.0002&&error2>0.00004) - { - fprintf (stderr, "celt_exp2 failed: x = "WORD", error1 = %f, error2 = %f\n", x,error1,error2); - ret = 1; - } - } -} - -void testexp2log2(void) -{ - opus_val32 x; - for (x=8;x<65536;x+=(x>>3)) - { - float error = fabs(x-0.25*celt_exp2(celt_log2(x)))/16384; - if (error>0.004) - { - fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_exp2(celt_log2(x))))>0.001 (x = %ld, error = %f)\n", (long)x,error); - ret = 1; - } - } -} - -void testilog2(void) -{ - opus_val32 x; - for (x=1;x<=268435455;x+=127) - { - opus_val32 lg; - opus_val32 y; - - lg = celt_ilog2(x); - if (lg<0 || lg>=31) - { - printf("celt_ilog2 failed: 0<=celt_ilog2(x)<31 (x = %d, celt_ilog2(x) = %d)\n",x,lg); - ret = 1; - } - y = 1<<lg; - - if (x<y || (x>>1)>=y) - { - printf("celt_ilog2 failed: 2**celt_ilog2(x)<=x<2**(celt_ilog2(x)+1) (x = %d, 2**celt_ilog2(x) = %d)\n",x,y); - ret = 1; - } - } -} -#endif - -int main(void) -{ - testbitexactcos(); - testbitexactlog2tan(); - testdiv(); - testsqrt(); - testlog2(); - testexp2(); - testexp2log2(); -#ifdef FIXED_POINT - testilog2(); -#endif - return ret; -} diff --git a/thirdparty/opus/celt/tests/test_unit_mdct.c b/thirdparty/opus/celt/tests/test_unit_mdct.c deleted file mode 100644 index 8dbb9caa2e..0000000000 --- a/thirdparty/opus/celt/tests/test_unit_mdct.c +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright (c) 2008-2011 Xiph.Org Foundation - Written by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define SKIP_CONFIG_H - -#ifndef CUSTOM_MODES -#define CUSTOM_MODES -#endif - -#include <stdio.h> - -#define CELT_C -#include "mdct.h" -#include "stack_alloc.h" - -#include "kiss_fft.c" -#include "mdct.c" -#include "mathops.c" -#include "entcode.c" - -#if defined(OPUS_X86_MAY_HAVE_SSE2) || defined(OPUS_X86_MAY_HAVE_SSE4_1) -# include "x86/x86cpu.c" -#elif defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) -# include "arm/armcpu.c" -# include "pitch.c" -# include "celt_lpc.c" -# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) -# include "arm/celt_neon_intr.c" -# if defined(HAVE_ARM_NE10) -# include "arm/celt_ne10_fft.c" -# include "arm/celt_ne10_mdct.c" -# endif -# endif -# include "arm/arm_celt_map.c" -#endif - -#ifndef M_PI -#define M_PI 3.141592653 -#endif - -int ret = 0; -void check(kiss_fft_scalar * in,kiss_fft_scalar * out,int nfft,int isinverse) -{ - int bin,k; - double errpow=0,sigpow=0; - double snr; - for (bin=0;bin<nfft/2;++bin) { - double ansr = 0; - double difr; - - for (k=0;k<nfft;++k) { - double phase = 2*M_PI*(k+.5+.25*nfft)*(bin+.5)/nfft; - double re = cos(phase); - - re /= nfft/4; - - ansr += in[k] * re; - } - /*printf ("%f %f\n", ansr, out[bin]);*/ - difr = ansr - out[bin]; - errpow += difr*difr; - sigpow += ansr*ansr; - } - snr = 10*log10(sigpow/errpow); - printf("nfft=%d inverse=%d,snr = %f\n",nfft,isinverse,snr ); - if (snr<60) { - printf( "** poor snr: %f **\n", snr); - ret = 1; - } -} - -void check_inv(kiss_fft_scalar * in,kiss_fft_scalar * out,int nfft,int isinverse) -{ - int bin,k; - double errpow=0,sigpow=0; - double snr; - for (bin=0;bin<nfft;++bin) { - double ansr = 0; - double difr; - - for (k=0;k<nfft/2;++k) { - double phase = 2*M_PI*(bin+.5+.25*nfft)*(k+.5)/nfft; - double re = cos(phase); - - /*re *= 2;*/ - - ansr += in[k] * re; - } - /*printf ("%f %f\n", ansr, out[bin]);*/ - difr = ansr - out[bin]; - errpow += difr*difr; - sigpow += ansr*ansr; - } - snr = 10*log10(sigpow/errpow); - printf("nfft=%d inverse=%d,snr = %f\n",nfft,isinverse,snr ); - if (snr<60) { - printf( "** poor snr: %f **\n", snr); - ret = 1; - } -} - - -void test1d(int nfft,int isinverse,int arch) -{ - mdct_lookup cfg; - size_t buflen = sizeof(kiss_fft_scalar)*nfft; - - kiss_fft_scalar * in = (kiss_fft_scalar*)malloc(buflen); - kiss_fft_scalar * in_copy = (kiss_fft_scalar*)malloc(buflen); - kiss_fft_scalar * out= (kiss_fft_scalar*)malloc(buflen); - opus_val16 * window= (opus_val16*)malloc(sizeof(opus_val16)*nfft/2); - int k; - - clt_mdct_init(&cfg, nfft, 0, arch); - for (k=0;k<nfft;++k) { - in[k] = (rand() % 32768) - 16384; - } - - for (k=0;k<nfft/2;++k) { - window[k] = Q15ONE; - } - for (k=0;k<nfft;++k) { - in[k] *= 32768; - } - - if (isinverse) - { - for (k=0;k<nfft;++k) { - in[k] /= nfft; - } - } - - for (k=0;k<nfft;++k) - in_copy[k] = in[k]; - /*for (k=0;k<nfft;++k) printf("%d %d ", in[k].r, in[k].i);printf("\n");*/ - - if (isinverse) - { - for (k=0;k<nfft;++k) - out[k] = 0; - clt_mdct_backward(&cfg,in,out, window, nfft/2, 0, 1, arch); - /* apply TDAC because clt_mdct_backward() no longer does that */ - for (k=0;k<nfft/4;++k) - out[nfft-k-1] = out[nfft/2+k]; - check_inv(in,out,nfft,isinverse); - } else { - clt_mdct_forward(&cfg,in,out,window, nfft/2, 0, 1, arch); - check(in_copy,out,nfft,isinverse); - } - /*for (k=0;k<nfft;++k) printf("%d %d ", out[k].r, out[k].i);printf("\n");*/ - - - free(in); - free(in_copy); - free(out); - free(window); - clt_mdct_clear(&cfg, arch); -} - -int main(int argc,char ** argv) -{ - ALLOC_STACK; - int arch = opus_select_arch(); - - if (argc>1) { - int k; - for (k=1;k<argc;++k) { - test1d(atoi(argv[k]),0,arch); - test1d(atoi(argv[k]),1,arch); - } - }else{ - test1d(32,0,arch); - test1d(32,1,arch); - test1d(256,0,arch); - test1d(256,1,arch); - test1d(512,0,arch); - test1d(512,1,arch); - test1d(1024,0,arch); - test1d(1024,1,arch); - test1d(2048,0,arch); - test1d(2048,1,arch); -#ifndef RADIX_TWO_ONLY - test1d(36,0,arch); - test1d(36,1,arch); - test1d(40,0,arch); - test1d(40,1,arch); - test1d(60,0,arch); - test1d(60,1,arch); - test1d(120,0,arch); - test1d(120,1,arch); - test1d(240,0,arch); - test1d(240,1,arch); - test1d(480,0,arch); - test1d(480,1,arch); - test1d(960,0,arch); - test1d(960,1,arch); - test1d(1920,0,arch); - test1d(1920,1,arch); -#endif - } - return ret; -} diff --git a/thirdparty/opus/celt/tests/test_unit_rotation.c b/thirdparty/opus/celt/tests/test_unit_rotation.c deleted file mode 100644 index 1080c2085d..0000000000 --- a/thirdparty/opus/celt/tests/test_unit_rotation.c +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (c) 2008-2011 Xiph.Org Foundation - Written by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef CUSTOM_MODES -#define CUSTOM_MODES -#endif - -#define CELT_C - -#include <stdio.h> -#include <stdlib.h> -#include "vq.c" -#include "cwrs.c" -#include "entcode.c" -#include "entenc.c" -#include "entdec.c" -#include "mathops.c" -#include "bands.h" -#include "pitch.c" -#include "celt_lpc.c" -#include "celt.c" -#include <math.h> - -#if defined(OPUS_X86_MAY_HAVE_SSE) || defined(OPUS_X86_MAY_HAVE_SSE2) || defined(OPUS_X86_MAY_HAVE_SSE4_1) -# if defined(OPUS_X86_MAY_HAVE_SSE) -# include "x86/pitch_sse.c" -# endif -# if defined(OPUS_X86_MAY_HAVE_SSE2) -# include "x86/pitch_sse2.c" -# endif -# if defined(OPUS_X86_MAY_HAVE_SSE4_1) -# include "x86/pitch_sse4_1.c" -# include "x86/celt_lpc_sse.c" -# endif -# include "x86/x86_celt_map.c" -#elif defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) -# include "arm/armcpu.c" -# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) -# include "arm/celt_neon_intr.c" -# if defined(HAVE_ARM_NE10) -# include "kiss_fft.c" -# include "mdct.c" -# include "arm/celt_ne10_fft.c" -# include "arm/celt_ne10_mdct.c" -# endif -# endif -# include "arm/arm_celt_map.c" -#endif - -#define MAX_SIZE 100 - -int ret=0; -void test_rotation(int N, int K) -{ - int i; - double err = 0, ener = 0, snr, snr0; - opus_val16 x0[MAX_SIZE]; - opus_val16 x1[MAX_SIZE]; - for (i=0;i<N;i++) - x1[i] = x0[i] = rand()%32767-16384; - exp_rotation(x1, N, 1, 1, K, SPREAD_NORMAL); - for (i=0;i<N;i++) - { - err += (x0[i]-(double)x1[i])*(x0[i]-(double)x1[i]); - ener += x0[i]*(double)x0[i]; - } - snr0 = 20*log10(ener/err); - err = ener = 0; - exp_rotation(x1, N, -1, 1, K, SPREAD_NORMAL); - for (i=0;i<N;i++) - { - err += (x0[i]-(double)x1[i])*(x0[i]-(double)x1[i]); - ener += x0[i]*(double)x0[i]; - } - snr = 20*log10(ener/err); - printf ("SNR for size %d (%d pulses) is %f (was %f without inverse)\n", N, K, snr, snr0); - if (snr < 60 || snr0 > 20) - { - fprintf(stderr, "FAIL!\n"); - ret = 1; - } -} - -int main(void) -{ - ALLOC_STACK; - test_rotation(15, 3); - test_rotation(23, 5); - test_rotation(50, 3); - test_rotation(80, 1); - return ret; -} diff --git a/thirdparty/opus/celt/vq.c b/thirdparty/opus/celt/vq.c index d29f38fd8e..8011e22548 100644 --- a/thirdparty/opus/celt/vq.c +++ b/thirdparty/opus/celt/vq.c @@ -39,6 +39,10 @@ #include "rate.h" #include "pitch.h" +#if defined(MIPSr1_ASM) +#include "mips/vq_mipsr1.h" +#endif + #ifndef OVERRIDE_vq_exp_rotation1 static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_val16 s) { @@ -67,7 +71,7 @@ static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_ } #endif /* OVERRIDE_vq_exp_rotation1 */ -static void exp_rotation(celt_norm *X, int len, int dir, int stride, int K, int spread) +void exp_rotation(celt_norm *X, int len, int dir, int stride, int K, int spread) { static const int SPREAD_FACTOR[3]={15,10,5}; int i; @@ -158,42 +162,27 @@ static unsigned extract_collapse_mask(int *iy, int N, int B) return collapse_mask; } -unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc -#ifdef RESYNTH - , opus_val16 gain -#endif - ) +opus_val16 op_pvq_search_c(celt_norm *X, int *iy, int K, int N, int arch) { VARDECL(celt_norm, y); - VARDECL(int, iy); - VARDECL(opus_val16, signx); + VARDECL(int, signx); int i, j; - opus_val16 s; int pulsesLeft; opus_val32 sum; opus_val32 xy; opus_val16 yy; - unsigned collapse_mask; SAVE_STACK; - celt_assert2(K>0, "alg_quant() needs at least one pulse"); - celt_assert2(N>1, "alg_quant() needs at least two dimensions"); - + (void)arch; ALLOC(y, N, celt_norm); - ALLOC(iy, N, int); - ALLOC(signx, N, opus_val16); - - exp_rotation(X, N, 1, B, K, spread); + ALLOC(signx, N, int); /* Get rid of the sign */ sum = 0; j=0; do { - if (X[j]>0) - signx[j]=1; - else { - signx[j]=-1; - X[j]=-X[j]; - } + signx[j] = X[j]<0; + /* OPT: Make sure the compiler doesn't use a branch on ABS16(). */ + X[j] = ABS16(X[j]); iy[j] = 0; y[j] = 0; } while (++j<N); @@ -225,7 +214,12 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc while (++j<N); sum = QCONST16(1.f,14); } - rcp = EXTRACT16(MULT16_32_Q16(K-1, celt_rcp(sum))); +#ifdef FIXED_POINT + rcp = EXTRACT16(MULT16_32_Q16(K, celt_rcp(sum))); +#else + /* Using K+e with e < 1 guarantees we cannot get more than K pulses. */ + rcp = EXTRACT16(MULT16_32_Q16(K+0.8f, celt_rcp(sum))); +#endif j=0; do { #ifdef FIXED_POINT /* It's really important to round *towards zero* here */ @@ -240,12 +234,12 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc pulsesLeft -= iy[j]; } while (++j<N); } - celt_assert2(pulsesLeft>=1, "Allocated too many pulses in the quick pass"); + celt_sig_assert(pulsesLeft>=0); /* This should never happen, but just in case it does (e.g. on silence) we fill the first bin with pulses. */ #ifdef FIXED_POINT_DEBUG - celt_assert2(pulsesLeft<=N+3, "Not enough pulses in the quick pass"); + celt_sig_assert(pulsesLeft<=N+3); #endif if (pulsesLeft > N+3) { @@ -256,12 +250,12 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc pulsesLeft=0; } - s = 1; for (i=0;i<pulsesLeft;i++) { + opus_val16 Rxy, Ryy; int best_id; - opus_val32 best_num = -VERY_LARGE16; - opus_val16 best_den = 0; + opus_val32 best_num; + opus_val16 best_den; #ifdef FIXED_POINT int rshift; #endif @@ -272,9 +266,22 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc /* The squared magnitude term gets added anyway, so we might as well add it outside the loop */ yy = ADD16(yy, 1); - j=0; + + /* Calculations for position 0 are out of the loop, in part to reduce + mispredicted branches (since the if condition is usually false) + in the loop. */ + /* Temporary sums of the new pulse(s) */ + Rxy = EXTRACT16(SHR32(ADD32(xy, EXTEND32(X[0])),rshift)); + /* We're multiplying y[j] by two so we don't have to do it here */ + Ryy = ADD16(yy, y[0]); + + /* Approximate score: we maximise Rxy/sqrt(Ryy) (we're guaranteed that + Rxy is positive because the sign is pre-computed) */ + Rxy = MULT16_16_Q15(Rxy,Rxy); + best_den = Ryy; + best_num = Rxy; + j=1; do { - opus_val16 Rxy, Ryy; /* Temporary sums of the new pulse(s) */ Rxy = EXTRACT16(SHR32(ADD32(xy, EXTEND32(X[j])),rshift)); /* We're multiplying y[j] by two so we don't have to do it here */ @@ -285,8 +292,11 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc Rxy = MULT16_16_Q15(Rxy,Rxy); /* The idea is to check for num/den >= best_num/best_den, but that way we can do it without any division */ - /* OPT: Make sure to use conditional moves here */ - if (MULT16_16(best_den, Rxy) > MULT16_16(Ryy, best_num)) + /* OPT: It's not clear whether a cmov is faster than a branch here + since the condition is more often false than true and using + a cmov introduces data dependencies across iterations. The optimal + choice may be architecture-dependent. */ + if (opus_unlikely(MULT16_16(best_den, Rxy) > MULT16_16(Ryy, best_num))) { best_den = Ryy; best_num = Rxy; @@ -301,23 +311,47 @@ unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc /* Only now that we've made the final choice, update y/iy */ /* Multiplying y[j] by 2 so we don't have to do it everywhere else */ - y[best_id] += 2*s; + y[best_id] += 2; iy[best_id]++; } /* Put the original sign back */ j=0; do { - X[j] = MULT16_16(signx[j],X[j]); - if (signx[j] < 0) - iy[j] = -iy[j]; + /*iy[j] = signx[j] ? -iy[j] : iy[j];*/ + /* OPT: The is more likely to be compiled without a branch than the code above + but has the same performance otherwise. */ + iy[j] = (iy[j]^-signx[j]) + signx[j]; } while (++j<N); + RESTORE_STACK; + return yy; +} + +unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc, + opus_val16 gain, int resynth, int arch) +{ + VARDECL(int, iy); + opus_val16 yy; + unsigned collapse_mask; + SAVE_STACK; + + celt_assert2(K>0, "alg_quant() needs at least one pulse"); + celt_assert2(N>1, "alg_quant() needs at least two dimensions"); + + /* Covers vectorization by up to 4. */ + ALLOC(iy, N+3, int); + + exp_rotation(X, N, 1, B, K, spread); + + yy = op_pvq_search(X, iy, K, N, arch); + encode_pulses(iy, N, K, enc); -#ifdef RESYNTH - normalise_residual(iy, X, N, yy, gain); - exp_rotation(X, N, -1, B, K, spread); -#endif + if (resynth) + { + normalise_residual(iy, X, N, yy, gain); + exp_rotation(X, N, -1, B, K, spread); + } collapse_mask = extract_collapse_mask(iy, N, B); RESTORE_STACK; @@ -401,7 +435,7 @@ int stereo_itheta(const celt_norm *X, const celt_norm *Y, int stereo, int N, int /* 0.63662 = 2/pi */ itheta = MULT16_16_Q15(QCONST16(0.63662f,15),celt_atan2p(side, mid)); #else - itheta = (int)floor(.5f+16384*0.63662f*atan2(side,mid)); + itheta = (int)floor(.5f+16384*0.63662f*fast_atan2f(side,mid)); #endif return itheta; diff --git a/thirdparty/opus/celt/vq.h b/thirdparty/opus/celt/vq.h index 5cfcbe50ea..45ec55918e 100644 --- a/thirdparty/opus/celt/vq.h +++ b/thirdparty/opus/celt/vq.h @@ -37,10 +37,18 @@ #include "entdec.h" #include "modes.h" -#if defined(MIPSr1_ASM) -#include "mips/vq_mipsr1.h" +#if (defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(FIXED_POINT)) +#include "x86/vq_sse.h" #endif +void exp_rotation(celt_norm *X, int len, int dir, int stride, int K, int spread); + +opus_val16 op_pvq_search_c(celt_norm *X, int *iy, int K, int N, int arch); + +#if !defined(OVERRIDE_OP_PVQ_SEARCH) +#define op_pvq_search(x, iy, K, N, arch) \ + (op_pvq_search_c(x, iy, K, N, arch)) +#endif /** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of * the pitch and a combination of pulses such that its norm is still equal @@ -51,12 +59,8 @@ * @param enc Entropy encoder state * @ret A mask indicating which blocks in the band received pulses */ -unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, - ec_enc *enc -#ifdef RESYNTH - , opus_val16 gain -#endif - ); +unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc, + opus_val16 gain, int resynth, int arch); /** Algebraic pulse decoder * @param X Decoded normalised spectrum (returned) diff --git a/thirdparty/opus/celt/x86/celt_lpc_sse.h b/thirdparty/opus/celt/x86/celt_lpc_sse.h index c5ec796ed5..7d1ecf7533 100644 --- a/thirdparty/opus/celt/x86/celt_lpc_sse.h +++ b/thirdparty/opus/celt/x86/celt_lpc_sse.h @@ -41,12 +41,11 @@ void celt_fir_sse4_1( opus_val16 *y, int N, int ord, - opus_val16 *mem, int arch); #if defined(OPUS_X86_PRESUME_SSE4_1) -#define celt_fir(x, num, y, N, ord, mem, arch) \ - ((void)arch, celt_fir_sse4_1(x, num, y, N, ord, mem, arch)) +#define celt_fir(x, num, y, N, ord, arch) \ + ((void)arch, celt_fir_sse4_1(x, num, y, N, ord, arch)) #else @@ -56,11 +55,10 @@ extern void (*const CELT_FIR_IMPL[OPUS_ARCHMASK + 1])( opus_val16 *y, int N, int ord, - opus_val16 *mem, int arch); -# define celt_fir(x, num, y, N, ord, mem, arch) \ - ((*CELT_FIR_IMPL[(arch) & OPUS_ARCHMASK])(x, num, y, N, ord, mem, arch)) +# define celt_fir(x, num, y, N, ord, arch) \ + ((*CELT_FIR_IMPL[(arch) & OPUS_ARCHMASK])(x, num, y, N, ord, arch)) #endif #endif diff --git a/thirdparty/opus/celt/x86/celt_lpc_sse.c b/thirdparty/opus/celt/x86/celt_lpc_sse4_1.c index 67e5592acf..5478568849 100644 --- a/thirdparty/opus/celt/x86/celt_lpc_sse.c +++ b/thirdparty/opus/celt/x86/celt_lpc_sse4_1.c @@ -40,65 +40,23 @@ #if defined(FIXED_POINT) -void celt_fir_sse4_1(const opus_val16 *_x, +void celt_fir_sse4_1(const opus_val16 *x, const opus_val16 *num, - opus_val16 *_y, + opus_val16 *y, int N, int ord, - opus_val16 *mem, int arch) { int i,j; VARDECL(opus_val16, rnum); - VARDECL(opus_val16, x); __m128i vecNoA; opus_int32 noA ; SAVE_STACK; ALLOC(rnum, ord, opus_val16); - ALLOC(x, N+ord, opus_val16); for(i=0;i<ord;i++) rnum[i] = num[ord-i-1]; - for(i=0;i<ord;i++) - x[i] = mem[ord-i-1]; - - for (i=0;i<N-7;i+=8) - { - x[i+ord ]=_x[i ]; - x[i+ord+1]=_x[i+1]; - x[i+ord+2]=_x[i+2]; - x[i+ord+3]=_x[i+3]; - x[i+ord+4]=_x[i+4]; - x[i+ord+5]=_x[i+5]; - x[i+ord+6]=_x[i+6]; - x[i+ord+7]=_x[i+7]; - } - - for (;i<N-3;i+=4) - { - x[i+ord ]=_x[i ]; - x[i+ord+1]=_x[i+1]; - x[i+ord+2]=_x[i+2]; - x[i+ord+3]=_x[i+3]; - } - - for (;i<N;i++) - x[i+ord]=_x[i]; - - for(i=0;i<ord;i++) - mem[i] = _x[N-i-1]; -#ifdef SMALL_FOOTPRINT - for (i=0;i<N;i++) - { - opus_val32 sum = SHL32(EXTEND32(_x[i]), SIG_SHIFT); - for (j=0;j<ord;j++) - { - sum = MAC16_16(sum,rnum[j],x[i+j]); - } - _y[i] = SATURATE16(PSHR32(sum, SIG_SHIFT)); - } -#else noA = EXTEND32(1) << SIG_SHIFT >> 1; vecNoA = _mm_set_epi32(noA, noA, noA, noA); @@ -107,25 +65,24 @@ void celt_fir_sse4_1(const opus_val16 *_x, opus_val32 sums[4] = {0}; __m128i vecSum, vecX; - xcorr_kernel(rnum, x+i, sums, ord, arch); + xcorr_kernel(rnum, x+i-ord, sums, ord, arch); vecSum = _mm_loadu_si128((__m128i *)sums); vecSum = _mm_add_epi32(vecSum, vecNoA); vecSum = _mm_srai_epi32(vecSum, SIG_SHIFT); - vecX = OP_CVTEPI16_EPI32_M64(_x + i); + vecX = OP_CVTEPI16_EPI32_M64(x + i); vecSum = _mm_add_epi32(vecSum, vecX); vecSum = _mm_packs_epi32(vecSum, vecSum); - _mm_storel_epi64((__m128i *)(_y + i), vecSum); + _mm_storel_epi64((__m128i *)(y + i), vecSum); } for (;i<N;i++) { opus_val32 sum = 0; for (j=0;j<ord;j++) - sum = MAC16_16(sum, rnum[j], x[i + j]); - _y[i] = SATURATE16(ADD32(EXTEND32(_x[i]), PSHR32(sum, SIG_SHIFT))); + sum = MAC16_16(sum, rnum[j], x[i+j-ord]); + y[i] = SATURATE16(ADD32(EXTEND32(x[i]), PSHR32(sum, SIG_SHIFT))); } -#endif RESTORE_STACK; } diff --git a/thirdparty/opus/celt/x86/vq_sse.h b/thirdparty/opus/celt/x86/vq_sse.h new file mode 100644 index 0000000000..b4efe8f249 --- /dev/null +++ b/thirdparty/opus/celt/x86/vq_sse.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2016 Jean-Marc Valin */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef VQ_SSE_H +#define VQ_SSE_H + +#if defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(FIXED_POINT) +#define OVERRIDE_OP_PVQ_SEARCH + +opus_val16 op_pvq_search_sse2(celt_norm *_X, int *iy, int K, int N, int arch); + +#if defined(OPUS_X86_PRESUME_SSE2) +#define op_pvq_search(x, iy, K, N, arch) \ + (op_pvq_search_sse2(x, iy, K, N, arch)) + +#else + +extern opus_val16 (*const OP_PVQ_SEARCH_IMPL[OPUS_ARCHMASK + 1])( + celt_norm *_X, int *iy, int K, int N, int arch); + +# define op_pvq_search(X, iy, K, N, arch) \ + ((*OP_PVQ_SEARCH_IMPL[(arch) & OPUS_ARCHMASK])(X, iy, K, N, arch)) + +#endif +#endif + +#endif diff --git a/thirdparty/opus/celt/x86/vq_sse2.c b/thirdparty/opus/celt/x86/vq_sse2.c new file mode 100644 index 0000000000..775042860d --- /dev/null +++ b/thirdparty/opus/celt/x86/vq_sse2.c @@ -0,0 +1,217 @@ +/* Copyright (c) 2007-2008 CSIRO + Copyright (c) 2007-2009 Xiph.Org Foundation + Copyright (c) 2007-2016 Jean-Marc Valin */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <xmmintrin.h> +#include <emmintrin.h> +#include "celt_lpc.h" +#include "stack_alloc.h" +#include "mathops.h" +#include "vq.h" +#include "x86cpu.h" + + +#ifndef FIXED_POINT + +opus_val16 op_pvq_search_sse2(celt_norm *_X, int *iy, int K, int N, int arch) +{ + int i, j; + int pulsesLeft; + float xy, yy; + VARDECL(celt_norm, y); + VARDECL(celt_norm, X); + VARDECL(float, signy); + __m128 signmask; + __m128 sums; + __m128i fours; + SAVE_STACK; + + (void)arch; + /* All bits set to zero, except for the sign bit. */ + signmask = _mm_set_ps1(-0.f); + fours = _mm_set_epi32(4, 4, 4, 4); + ALLOC(y, N+3, celt_norm); + ALLOC(X, N+3, celt_norm); + ALLOC(signy, N+3, float); + + OPUS_COPY(X, _X, N); + X[N] = X[N+1] = X[N+2] = 0; + sums = _mm_setzero_ps(); + for (j=0;j<N;j+=4) + { + __m128 x4, s4; + x4 = _mm_loadu_ps(&X[j]); + s4 = _mm_cmplt_ps(x4, _mm_setzero_ps()); + /* Get rid of the sign */ + x4 = _mm_andnot_ps(signmask, x4); + sums = _mm_add_ps(sums, x4); + /* Clear y and iy in case we don't do the projection. */ + _mm_storeu_ps(&y[j], _mm_setzero_ps()); + _mm_storeu_si128((__m128i*)&iy[j], _mm_setzero_si128()); + _mm_storeu_ps(&X[j], x4); + _mm_storeu_ps(&signy[j], s4); + } + sums = _mm_add_ps(sums, _mm_shuffle_ps(sums, sums, _MM_SHUFFLE(1, 0, 3, 2))); + sums = _mm_add_ps(sums, _mm_shuffle_ps(sums, sums, _MM_SHUFFLE(2, 3, 0, 1))); + + xy = yy = 0; + + pulsesLeft = K; + + /* Do a pre-search by projecting on the pyramid */ + if (K > (N>>1)) + { + __m128i pulses_sum; + __m128 yy4, xy4; + __m128 rcp4; + opus_val32 sum = _mm_cvtss_f32(sums); + /* If X is too small, just replace it with a pulse at 0 */ + /* Prevents infinities and NaNs from causing too many pulses + to be allocated. 64 is an approximation of infinity here. */ + if (!(sum > EPSILON && sum < 64)) + { + X[0] = QCONST16(1.f,14); + j=1; do + X[j]=0; + while (++j<N); + sums = _mm_set_ps1(1.f); + } + /* Using K+e with e < 1 guarantees we cannot get more than K pulses. */ + rcp4 = _mm_mul_ps(_mm_set_ps1((float)(K+.8)), _mm_rcp_ps(sums)); + xy4 = yy4 = _mm_setzero_ps(); + pulses_sum = _mm_setzero_si128(); + for (j=0;j<N;j+=4) + { + __m128 rx4, x4, y4; + __m128i iy4; + x4 = _mm_loadu_ps(&X[j]); + rx4 = _mm_mul_ps(x4, rcp4); + iy4 = _mm_cvttps_epi32(rx4); + pulses_sum = _mm_add_epi32(pulses_sum, iy4); + _mm_storeu_si128((__m128i*)&iy[j], iy4); + y4 = _mm_cvtepi32_ps(iy4); + xy4 = _mm_add_ps(xy4, _mm_mul_ps(x4, y4)); + yy4 = _mm_add_ps(yy4, _mm_mul_ps(y4, y4)); + /* double the y[] vector so we don't have to do it in the search loop. */ + _mm_storeu_ps(&y[j], _mm_add_ps(y4, y4)); + } + pulses_sum = _mm_add_epi32(pulses_sum, _mm_shuffle_epi32(pulses_sum, _MM_SHUFFLE(1, 0, 3, 2))); + pulses_sum = _mm_add_epi32(pulses_sum, _mm_shuffle_epi32(pulses_sum, _MM_SHUFFLE(2, 3, 0, 1))); + pulsesLeft -= _mm_cvtsi128_si32(pulses_sum); + xy4 = _mm_add_ps(xy4, _mm_shuffle_ps(xy4, xy4, _MM_SHUFFLE(1, 0, 3, 2))); + xy4 = _mm_add_ps(xy4, _mm_shuffle_ps(xy4, xy4, _MM_SHUFFLE(2, 3, 0, 1))); + xy = _mm_cvtss_f32(xy4); + yy4 = _mm_add_ps(yy4, _mm_shuffle_ps(yy4, yy4, _MM_SHUFFLE(1, 0, 3, 2))); + yy4 = _mm_add_ps(yy4, _mm_shuffle_ps(yy4, yy4, _MM_SHUFFLE(2, 3, 0, 1))); + yy = _mm_cvtss_f32(yy4); + } + X[N] = X[N+1] = X[N+2] = -100; + y[N] = y[N+1] = y[N+2] = 100; + celt_sig_assert(pulsesLeft>=0); + + /* This should never happen, but just in case it does (e.g. on silence) + we fill the first bin with pulses. */ + if (pulsesLeft > N+3) + { + opus_val16 tmp = (opus_val16)pulsesLeft; + yy = MAC16_16(yy, tmp, tmp); + yy = MAC16_16(yy, tmp, y[0]); + iy[0] += pulsesLeft; + pulsesLeft=0; + } + + for (i=0;i<pulsesLeft;i++) + { + int best_id; + __m128 xy4, yy4; + __m128 max, max2; + __m128i count; + __m128i pos; + /* The squared magnitude term gets added anyway, so we might as well + add it outside the loop */ + yy = ADD16(yy, 1); + xy4 = _mm_load1_ps(&xy); + yy4 = _mm_load1_ps(&yy); + max = _mm_setzero_ps(); + pos = _mm_setzero_si128(); + count = _mm_set_epi32(3, 2, 1, 0); + for (j=0;j<N;j+=4) + { + __m128 x4, y4, r4; + x4 = _mm_loadu_ps(&X[j]); + y4 = _mm_loadu_ps(&y[j]); + x4 = _mm_add_ps(x4, xy4); + y4 = _mm_add_ps(y4, yy4); + y4 = _mm_rsqrt_ps(y4); + r4 = _mm_mul_ps(x4, y4); + /* Update the index of the max. */ + pos = _mm_max_epi16(pos, _mm_and_si128(count, _mm_castps_si128(_mm_cmpgt_ps(r4, max)))); + /* Update the max. */ + max = _mm_max_ps(max, r4); + /* Update the indices (+4) */ + count = _mm_add_epi32(count, fours); + } + /* Horizontal max */ + max2 = _mm_max_ps(max, _mm_shuffle_ps(max, max, _MM_SHUFFLE(1, 0, 3, 2))); + max2 = _mm_max_ps(max2, _mm_shuffle_ps(max2, max2, _MM_SHUFFLE(2, 3, 0, 1))); + /* Now that max2 contains the max at all positions, look at which value(s) of the + partial max is equal to the global max. */ + pos = _mm_and_si128(pos, _mm_castps_si128(_mm_cmpeq_ps(max, max2))); + pos = _mm_max_epi16(pos, _mm_unpackhi_epi64(pos, pos)); + pos = _mm_max_epi16(pos, _mm_shufflelo_epi16(pos, _MM_SHUFFLE(1, 0, 3, 2))); + best_id = _mm_cvtsi128_si32(pos); + + /* Updating the sums of the new pulse(s) */ + xy = ADD32(xy, EXTEND32(X[best_id])); + /* We're multiplying y[j] by two so we don't have to do it here */ + yy = ADD16(yy, y[best_id]); + + /* Only now that we've made the final choice, update y/iy */ + /* Multiplying y[j] by 2 so we don't have to do it everywhere else */ + y[best_id] += 2; + iy[best_id]++; + } + + /* Put the original sign back */ + for (j=0;j<N;j+=4) + { + __m128i y4; + __m128i s4; + y4 = _mm_loadu_si128((__m128i*)&iy[j]); + s4 = _mm_castps_si128(_mm_loadu_ps(&signy[j])); + y4 = _mm_xor_si128(_mm_add_epi32(y4, s4), s4); + _mm_storeu_si128((__m128i*)&iy[j], y4); + } + RESTORE_STACK; + return yy; +} + +#endif diff --git a/thirdparty/opus/celt/x86/x86_celt_map.c b/thirdparty/opus/celt/x86/x86_celt_map.c index 47ba41b9ee..d39d88edec 100644 --- a/thirdparty/opus/celt/x86/x86_celt_map.c +++ b/thirdparty/opus/celt/x86/x86_celt_map.c @@ -33,6 +33,7 @@ #include "celt_lpc.h" #include "pitch.h" #include "pitch_sse.h" +#include "vq.h" #if defined(OPUS_HAVE_RTCD) @@ -46,7 +47,6 @@ void (*const CELT_FIR_IMPL[OPUS_ARCHMASK + 1])( opus_val16 *y, int N, int ord, - opus_val16 *mem, int arch ) = { celt_fir_c, /* non-sse */ @@ -151,5 +151,17 @@ void (*const COMB_FILTER_CONST_IMPL[OPUS_ARCHMASK + 1])( #endif +#if defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2) +opus_val16 (*const OP_PVQ_SEARCH_IMPL[OPUS_ARCHMASK + 1])( + celt_norm *_X, int *iy, int K, int N, int arch +) = { + op_pvq_search_c, /* non-sse */ + op_pvq_search_c, + MAY_HAVE_SSE2(op_pvq_search), + MAY_HAVE_SSE2(op_pvq_search), + MAY_HAVE_SSE2(op_pvq_search) +}; +#endif + #endif #endif diff --git a/thirdparty/opus/celt/x86/x86cpu.h b/thirdparty/opus/celt/x86/x86cpu.h index 04fd48aac4..1e2bf17b9b 100644 --- a/thirdparty/opus/celt/x86/x86cpu.h +++ b/thirdparty/opus/celt/x86/x86cpu.h @@ -82,7 +82,9 @@ int opus_select_arch(void); (_mm_cvtepi8_epi32(*(__m128i *)(x))) #endif -# if !defined(__OPTIMIZE__) +/* similar reasoning about the instruction sequence as in the 32-bit macro above, + */ +# if defined(__clang__) || !defined(__OPTIMIZE__) # define OP_CVTEPI16_EPI32_M64(x) \ (_mm_cvtepi16_epi32(_mm_loadl_epi64((__m128i *)(x)))) # else diff --git a/thirdparty/opus/config.h b/thirdparty/opus/config.h index 7b9c92c6a8..3ed0874d4b 100644 --- a/thirdparty/opus/config.h +++ b/thirdparty/opus/config.h @@ -1,5 +1,44 @@ -/* Opus configuration header */ -/* Based on the output of libopus configure script */ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Get CPU Info by asm method */ +#define CPU_INFO_BY_ASM 1 + +/* Get CPU Info by c method */ +/* #undef CPU_INFO_BY_C */ + +/* Custom modes */ +/* #undef CUSTOM_MODES */ + +/* Do not build the float API */ +/* #undef DISABLE_FLOAT_API */ + +/* Disable bitstream fixes from RFC 8251 */ +/* #undef DISABLE_UPDATE_DRAFT */ + +/* Assertions */ +/* #undef ENABLE_ASSERTIONS */ + +/* Hardening */ +#define ENABLE_HARDENING 1 + +/* Debug fixed-point implementation */ +/* #undef FIXED_DEBUG */ + +/* Compile as fixed-point (for machines without a fast enough FPU) */ +/* #undef FIXED_POINT */ + +/* Float approximations */ +/* #undef FLOAT_APPROX */ + +/* Fuzzing */ +/* #undef FUZZING */ + +/* Define to 1 if you have the <alloca.h> header file. */ +/* #undef HAVE_ALLOCA_H */ + +/* NE10 library is installed on host. Make sure it is on target! */ +/* #undef HAVE_ARM_NE10 */ /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 @@ -7,16 +46,12 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 -#if (!defined( _MSC_VER ) || ( _MSC_VER >= 1800 )) - /* Define to 1 if you have the `lrint' function. */ #define HAVE_LRINT 1 /* Define to 1 if you have the `lrintf' function. */ #define HAVE_LRINTF 1 -#endif - /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 @@ -41,8 +76,10 @@ /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to 1 if you have the `__malloc_hook' function. */ +#define HAVE___MALLOC_HOOK 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" #ifdef OPUS_ARM_OPT @@ -92,9 +129,80 @@ #endif // OPUS_ARM64_OPT +/* Define if binary requires Aarch64 Neon Intrinsics */ +/* #undef OPUS_ARM_PRESUME_AARCH64_NEON_INTR */ + +/* Define if binary requires EDSP instruction support */ +/* #undef OPUS_ARM_PRESUME_EDSP */ + +/* Define if binary requires ARMv6 media instruction support */ +/* #undef OPUS_ARM_PRESUME_MEDIA */ + +/* Define if binary requires NEON instruction support */ +/* #undef OPUS_ARM_PRESUME_NEON */ + +/* Define if binary requires NEON intrinsics support */ +/* #undef OPUS_ARM_PRESUME_NEON_INTR */ + /* This is a build of OPUS */ #define OPUS_BUILD /**/ +/* Run bit-exactness checks between optimized and c implementations */ +/* #undef OPUS_CHECK_ASM */ + +#ifndef OPUS_ARM_OPT +/* Use run-time CPU capabilities detection */ +#define OPUS_HAVE_RTCD 1 +#endif + +/* Compiler supports X86 AVX Intrinsics */ +/* #define OPUS_X86_MAY_HAVE_AVX */ + +/* Compiler supports X86 SSE Intrinsics */ +/* #define OPUS_X86_MAY_HAVE_SSE */ + +/* Compiler supports X86 SSE2 Intrinsics */ +/* #define OPUS_X86_MAY_HAVE_SSE2 */ + +/* Compiler supports X86 SSE4.1 Intrinsics */ +/* #define OPUS_X86_MAY_HAVE_SSE4_1 */ + +/* Define if binary requires AVX intrinsics support */ +/* #undef OPUS_X86_PRESUME_AVX */ + +/* Define if binary requires SSE intrinsics support */ +#define OPUS_X86_PRESUME_SSE 1 + +/* Define if binary requires SSE2 intrinsics support */ +#define OPUS_X86_PRESUME_SSE2 1 + +/* Define if binary requires SSE4.1 intrinsics support */ +#define OPUS_X86_PRESUME_SSE4_1 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opus@xiph.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "opus" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "opus 1.3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "opus" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.3.1" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Make use of alloca */ +/* #undef USE_ALLOCA */ + #ifndef WIN32 /* Use C99 variable-size arrays */ #define VAR_ARRAYS 1 @@ -103,11 +211,13 @@ #define USE_ALLOCA 1 #endif +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + #ifndef OPUS_FIXED_POINT #define FLOAT_APPROX 1 #endif - /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus @@ -117,11 +227,7 @@ /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ -#if (!defined( _MSC_VER ) || ( _MSC_VER >= 1800 )) #define restrict __restrict -#else -#undef restrict -#endif /* Work around a bug in Sun C++: it does not support _Restrict or __restrict__, even though the corresponding Sun C compiler ends up with "#define restrict _Restrict" or "#define restrict __restrict__" in the diff --git a/thirdparty/opus/info.c b/thirdparty/opus/info.c index c36f9a9ee1..3a1a5bf75b 100644 --- a/thirdparty/opus/info.c +++ b/thirdparty/opus/info.c @@ -107,26 +107,32 @@ static int op_tags_ensure_capacity(OpusTags *_tags,size_t _ncomments){ char **user_comments; int *comment_lengths; int cur_ncomments; - char *binary_suffix_data; - int binary_suffix_len; size_t size; if(OP_UNLIKELY(_ncomments>=(size_t)INT_MAX))return OP_EFAULT; size=sizeof(*_tags->comment_lengths)*(_ncomments+1); if(size/sizeof(*_tags->comment_lengths)!=_ncomments+1)return OP_EFAULT; cur_ncomments=_tags->comments; - comment_lengths=_tags->comment_lengths; - binary_suffix_len=comment_lengths==NULL?0:comment_lengths[cur_ncomments]; + /*We only support growing. + Trimming requires cleaning up the allocated strings in the old space, and + is best handled separately if it's ever needed.*/ + OP_ASSERT(_ncomments>=(size_t)cur_ncomments); comment_lengths=(int *)_ogg_realloc(_tags->comment_lengths,size); if(OP_UNLIKELY(comment_lengths==NULL))return OP_EFAULT; - comment_lengths[_ncomments]=binary_suffix_len; + if(_tags->comment_lengths==NULL){ + OP_ASSERT(cur_ncomments==0); + comment_lengths[cur_ncomments]=0; + } + comment_lengths[_ncomments]=comment_lengths[cur_ncomments]; _tags->comment_lengths=comment_lengths; size=sizeof(*_tags->user_comments)*(_ncomments+1); if(size/sizeof(*_tags->user_comments)!=_ncomments+1)return OP_EFAULT; - user_comments=_tags->user_comments; - binary_suffix_data=user_comments==NULL?NULL:user_comments[cur_ncomments]; user_comments=(char **)_ogg_realloc(_tags->user_comments,size); if(OP_UNLIKELY(user_comments==NULL))return OP_EFAULT; - user_comments[_ncomments]=binary_suffix_data; + if(_tags->user_comments==NULL){ + OP_ASSERT(cur_ncomments==0); + user_comments[cur_ncomments]=NULL; + } + user_comments[_ncomments]=user_comments[cur_ncomments]; _tags->user_comments=user_comments; return 0; } @@ -275,28 +281,30 @@ int opus_tags_copy(OpusTags *_dst,const OpusTags *_src){ ret=opus_tags_copy_impl(&dst,_src); if(OP_UNLIKELY(ret<0))opus_tags_clear(&dst); else *_dst=*&dst; - return 0; + return ret; } int opus_tags_add(OpusTags *_tags,const char *_tag,const char *_value){ - char *comment; - int tag_len; - int value_len; - int ncomments; - int ret; + char *comment; + size_t tag_len; + size_t value_len; + int ncomments; + int ret; ncomments=_tags->comments; ret=op_tags_ensure_capacity(_tags,ncomments+1); if(OP_UNLIKELY(ret<0))return ret; tag_len=strlen(_tag); value_len=strlen(_value); /*+2 for '=' and '\0'.*/ + if(tag_len+value_len<tag_len)return OP_EFAULT; + if(tag_len+value_len>(size_t)INT_MAX-2)return OP_EFAULT; comment=(char *)_ogg_malloc(sizeof(*comment)*(tag_len+value_len+2)); if(OP_UNLIKELY(comment==NULL))return OP_EFAULT; memcpy(comment,_tag,sizeof(*comment)*tag_len); comment[tag_len]='='; memcpy(comment+tag_len+1,_value,sizeof(*comment)*(value_len+1)); _tags->user_comments[ncomments]=comment; - _tags->comment_lengths[ncomments]=tag_len+value_len+1; + _tags->comment_lengths[ncomments]=(int)(tag_len+value_len+1); _tags->comments=ncomments+1; return 0; } @@ -337,7 +345,10 @@ int opus_tags_set_binary_suffix(OpusTags *_tags, } int opus_tagcompare(const char *_tag_name,const char *_comment){ - return opus_tagncompare(_tag_name,strlen(_tag_name),_comment); + size_t tag_len; + tag_len=strlen(_tag_name); + if(OP_UNLIKELY(tag_len>(size_t)INT_MAX))return -1; + return opus_tagncompare(_tag_name,(int)tag_len,_comment); } int opus_tagncompare(const char *_tag_name,int _tag_len,const char *_comment){ @@ -348,17 +359,18 @@ int opus_tagncompare(const char *_tag_name,int _tag_len,const char *_comment){ } const char *opus_tags_query(const OpusTags *_tags,const char *_tag,int _count){ - char **user_comments; - int tag_len; - int found; - int ncomments; - int ci; + char **user_comments; + size_t tag_len; + int found; + int ncomments; + int ci; tag_len=strlen(_tag); + if(OP_UNLIKELY(tag_len>(size_t)INT_MAX))return NULL; ncomments=_tags->comments; user_comments=_tags->user_comments; found=0; for(ci=0;ci<ncomments;ci++){ - if(!opus_tagncompare(_tag,tag_len,user_comments[ci])){ + if(!opus_tagncompare(_tag,(int)tag_len,user_comments[ci])){ /*We return a pointer to the data, not a copy.*/ if(_count==found++)return user_comments[ci]+tag_len+1; } @@ -368,17 +380,18 @@ const char *opus_tags_query(const OpusTags *_tags,const char *_tag,int _count){ } int opus_tags_query_count(const OpusTags *_tags,const char *_tag){ - char **user_comments; - int tag_len; - int found; - int ncomments; - int ci; + char **user_comments; + size_t tag_len; + int found; + int ncomments; + int ci; tag_len=strlen(_tag); + if(OP_UNLIKELY(tag_len>(size_t)INT_MAX))return 0; ncomments=_tags->comments; user_comments=_tags->user_comments; found=0; for(ci=0;ci<ncomments;ci++){ - if(!opus_tagncompare(_tag,tag_len,user_comments[ci]))found++; + if(!opus_tagncompare(_tag,(int)tag_len,user_comments[ci]))found++; } return found; } @@ -403,7 +416,8 @@ static int opus_tags_get_gain(const OpusTags *_tags,int *_gain_q8, ncomments=_tags->comments; /*Look for the first valid tag with the name _tag_name and use that.*/ for(ci=0;ci<ncomments;ci++){ - if(opus_tagncompare(_tag_name,_tag_len,comments[ci])==0){ + OP_ASSERT(_tag_len<=(size_t)INT_MAX); + if(opus_tagncompare(_tag_name,(int)_tag_len,comments[ci])==0){ char *p; opus_int32 gain_q8; int negative; @@ -439,8 +453,7 @@ int opus_tags_get_track_gain(const OpusTags *_tags,int *_gain_q8){ } static int op_is_jpeg(const unsigned char *_buf,size_t _buf_sz){ - return _buf_sz>=11&&memcmp(_buf,"\xFF\xD8\xFF\xE0",4)==0 - &&(_buf[4]<<8|_buf[5])>=16&&memcmp(_buf+6,"JFIF",5)==0; + return _buf_sz>=3&&memcmp(_buf,"\xFF\xD8\xFF",3)==0; } /*Tries to extract the width, height, bits per pixel, and palette size of a diff --git a/thirdparty/opus/internal.h b/thirdparty/opus/internal.h index ee48ea34c9..9ac17e028f 100644 --- a/thirdparty/opus/internal.h +++ b/thirdparty/opus/internal.h @@ -136,6 +136,9 @@ struct OggOpusLink{ that end-trimming calculations work properly. This is only valid for seekable sources.*/ opus_int64 end_offset; + /*The total duration of all prior links. + This is always zero for non-seekable sources.*/ + ogg_int64_t pcm_file_offset; /*The granule position of the last sample. This is only valid for seekable sources.*/ ogg_int64_t pcm_end; @@ -150,23 +153,25 @@ struct OggOpusLink{ }; struct OggOpusFile{ - /*The callbacks used to access the data source.*/ + /*The callbacks used to access the stream.*/ OpusFileCallbacks callbacks; - /*A FILE *, memory bufer, etc.*/ - void *source; - /*Whether or not we can seek with this data source.*/ + /*A FILE *, memory buffer, etc.*/ + void *stream; + /*Whether or not we can seek with this stream.*/ int seekable; /*The number of links in this chained Ogg Opus file.*/ int nlinks; /*The cached information from each link in a chained Ogg Opus file. - If source isn't seekable (e.g., it's a pipe), only the current link + If stream isn't seekable (e.g., it's a pipe), only the current link appears.*/ OggOpusLink *links; /*The number of serial numbers from a single link.*/ int nserialnos; /*The capacity of the list of serial numbers from a single link.*/ int cserialnos; - /*Storage for the list of serial numbers from a single link.*/ + /*Storage for the list of serial numbers from a single link. + This is a scratch buffer used when scanning the BOS pages at the start of + each link.*/ ogg_uint32_t *serialnos; /*This is the current offset of the data processed by the ogg_sync_state. After a seek, this should be set to the target offset so that we can track @@ -174,9 +179,9 @@ struct OggOpusFile{ After a call to op_get_next_page(), this will point to the first byte after that page.*/ opus_int64 offset; - /*The total size of this data source, or -1 if it's unseekable.*/ + /*The total size of this stream, or -1 if it's unseekable.*/ opus_int64 end; - /*Used to locate pages in the data source.*/ + /*Used to locate pages in the stream.*/ ogg_sync_state oy; /*One of OP_NOTOPEN, OP_PARTOPEN, OP_OPENED, OP_STREAMSET, OP_INITSET.*/ int ready_state; @@ -227,7 +232,7 @@ struct OggOpusFile{ /*The number of valid samples in the decoded buffer.*/ int od_buffer_size; /*The type of gain offset to apply. - One of OP_HEADER_GAIN, OP_TRACK_GAIN, or OP_ABSOLUTE_GAIN.*/ + One of OP_HEADER_GAIN, OP_ALBUM_GAIN, OP_TRACK_GAIN, or OP_ABSOLUTE_GAIN.*/ int gain_type; /*The offset to apply to the gain.*/ opus_int32 gain_offset_q8; diff --git a/thirdparty/opus/mapping_matrix.c b/thirdparty/opus/mapping_matrix.c new file mode 100644 index 0000000000..31298af057 --- /dev/null +++ b/thirdparty/opus/mapping_matrix.c @@ -0,0 +1,378 @@ +/* Copyright (c) 2017 Google Inc. + Written by Andrew Allen */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "arch.h" +#include "float_cast.h" +#include "opus_private.h" +#include "opus_defines.h" +#include "mapping_matrix.h" + +#define MATRIX_INDEX(nb_rows, row, col) (nb_rows * col + row) + +opus_int32 mapping_matrix_get_size(int rows, int cols) +{ + opus_int32 size; + + /* Mapping Matrix must only support up to 255 channels in or out. + * Additionally, the total cell count must be <= 65004 octets in order + * for the matrix to be stored in an OGG header. + */ + if (rows > 255 || cols > 255) + return 0; + size = rows * (opus_int32)cols * sizeof(opus_int16); + if (size > 65004) + return 0; + + return align(sizeof(MappingMatrix)) + align(size); +} + +opus_int16 *mapping_matrix_get_data(const MappingMatrix *matrix) +{ + /* void* cast avoids clang -Wcast-align warning */ + return (opus_int16*)(void*)((char*)matrix + align(sizeof(MappingMatrix))); +} + +void mapping_matrix_init(MappingMatrix * const matrix, + int rows, int cols, int gain, const opus_int16 *data, opus_int32 data_size) +{ + int i; + opus_int16 *ptr; + +#if !defined(ENABLE_ASSERTIONS) + (void)data_size; +#endif + celt_assert(align(data_size) == align(rows * cols * sizeof(opus_int16))); + + matrix->rows = rows; + matrix->cols = cols; + matrix->gain = gain; + ptr = mapping_matrix_get_data(matrix); + for (i = 0; i < rows * cols; i++) + { + ptr[i] = data[i]; + } +} + +#ifndef DISABLE_FLOAT_API +void mapping_matrix_multiply_channel_in_float( + const MappingMatrix *matrix, + const float *input, + int input_rows, + opus_val16 *output, + int output_row, + int output_rows, + int frame_size) +{ + /* Matrix data is ordered col-wise. */ + opus_int16* matrix_data; + int i, col; + + celt_assert(input_rows <= matrix->cols && output_rows <= matrix->rows); + + matrix_data = mapping_matrix_get_data(matrix); + + for (i = 0; i < frame_size; i++) + { + float tmp = 0; + for (col = 0; col < input_rows; col++) + { + tmp += + matrix_data[MATRIX_INDEX(matrix->rows, output_row, col)] * + input[MATRIX_INDEX(input_rows, col, i)]; + } +#if defined(FIXED_POINT) + output[output_rows * i] = FLOAT2INT16((1/32768.f)*tmp); +#else + output[output_rows * i] = (1/32768.f)*tmp; +#endif + } +} + +void mapping_matrix_multiply_channel_out_float( + const MappingMatrix *matrix, + const opus_val16 *input, + int input_row, + int input_rows, + float *output, + int output_rows, + int frame_size +) +{ + /* Matrix data is ordered col-wise. */ + opus_int16* matrix_data; + int i, row; + float input_sample; + + celt_assert(input_rows <= matrix->cols && output_rows <= matrix->rows); + + matrix_data = mapping_matrix_get_data(matrix); + + for (i = 0; i < frame_size; i++) + { +#if defined(FIXED_POINT) + input_sample = (1/32768.f)*input[input_rows * i]; +#else + input_sample = input[input_rows * i]; +#endif + for (row = 0; row < output_rows; row++) + { + float tmp = + (1/32768.f)*matrix_data[MATRIX_INDEX(matrix->rows, row, input_row)] * + input_sample; + output[MATRIX_INDEX(output_rows, row, i)] += tmp; + } + } +} +#endif /* DISABLE_FLOAT_API */ + +void mapping_matrix_multiply_channel_in_short( + const MappingMatrix *matrix, + const opus_int16 *input, + int input_rows, + opus_val16 *output, + int output_row, + int output_rows, + int frame_size) +{ + /* Matrix data is ordered col-wise. */ + opus_int16* matrix_data; + int i, col; + + celt_assert(input_rows <= matrix->cols && output_rows <= matrix->rows); + + matrix_data = mapping_matrix_get_data(matrix); + + for (i = 0; i < frame_size; i++) + { + opus_val32 tmp = 0; + for (col = 0; col < input_rows; col++) + { +#if defined(FIXED_POINT) + tmp += + ((opus_int32)matrix_data[MATRIX_INDEX(matrix->rows, output_row, col)] * + (opus_int32)input[MATRIX_INDEX(input_rows, col, i)]) >> 8; +#else + tmp += + matrix_data[MATRIX_INDEX(matrix->rows, output_row, col)] * + input[MATRIX_INDEX(input_rows, col, i)]; +#endif + } +#if defined(FIXED_POINT) + output[output_rows * i] = (opus_int16)((tmp + 64) >> 7); +#else + output[output_rows * i] = (1/(32768.f*32768.f))*tmp; +#endif + } +} + +void mapping_matrix_multiply_channel_out_short( + const MappingMatrix *matrix, + const opus_val16 *input, + int input_row, + int input_rows, + opus_int16 *output, + int output_rows, + int frame_size) +{ + /* Matrix data is ordered col-wise. */ + opus_int16* matrix_data; + int i, row; + opus_int32 input_sample; + + celt_assert(input_rows <= matrix->cols && output_rows <= matrix->rows); + + matrix_data = mapping_matrix_get_data(matrix); + + for (i = 0; i < frame_size; i++) + { +#if defined(FIXED_POINT) + input_sample = (opus_int32)input[input_rows * i]; +#else + input_sample = (opus_int32)FLOAT2INT16(input[input_rows * i]); +#endif + for (row = 0; row < output_rows; row++) + { + opus_int32 tmp = + (opus_int32)matrix_data[MATRIX_INDEX(matrix->rows, row, input_row)] * + input_sample; + output[MATRIX_INDEX(output_rows, row, i)] += (tmp + 16384) >> 15; + } + } +} + +const MappingMatrix mapping_matrix_foa_mixing = { 6, 6, 0 }; +const opus_int16 mapping_matrix_foa_mixing_data[36] = { + 16384, 0, -16384, 23170, 0, 0, 16384, 23170, + 16384, 0, 0, 0, 16384, 0, -16384, -23170, + 0, 0, 16384, -23170, 16384, 0, 0, 0, + 0, 0, 0, 0, 32767, 0, 0, 0, + 0, 0, 0, 32767 +}; + +const MappingMatrix mapping_matrix_soa_mixing = { 11, 11, 0 }; +const opus_int16 mapping_matrix_soa_mixing_data[121] = { + 10923, 7723, 13377, -13377, 11585, 9459, 7723, -16384, + -6689, 0, 0, 10923, 7723, 13377, 13377, -11585, + 9459, 7723, 16384, -6689, 0, 0, 10923, -15447, + 13377, 0, 0, -18919, 7723, 0, 13377, 0, + 0, 10923, 7723, -13377, -13377, 11585, -9459, 7723, + 16384, -6689, 0, 0, 10923, -7723, 0, 13377, + -16384, 0, -15447, 0, 9459, 0, 0, 10923, + -7723, 0, -13377, 16384, 0, -15447, 0, 9459, + 0, 0, 10923, 15447, 0, 0, 0, 0, + -15447, 0, -18919, 0, 0, 10923, 7723, -13377, + 13377, -11585, -9459, 7723, -16384, -6689, 0, 0, + 10923, -15447, -13377, 0, 0, 18919, 7723, 0, + 13377, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 32767, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32767 +}; + +const MappingMatrix mapping_matrix_toa_mixing = { 18, 18, 0 }; +const opus_int16 mapping_matrix_toa_mixing_data[324] = { + 8208, 0, -881, 14369, 0, 0, -8192, -4163, + 13218, 0, 0, 0, 11095, -8836, -6218, 14833, + 0, 0, 8208, -10161, 881, 10161, -13218, -2944, + -8192, 2944, 0, -10488, -6218, 6248, -11095, -6248, + 0, -10488, 0, 0, 8208, 10161, 881, -10161, + -13218, 2944, -8192, -2944, 0, 10488, -6218, -6248, + -11095, 6248, 0, 10488, 0, 0, 8176, 5566, + -11552, 5566, 9681, -11205, 8192, -11205, 0, 4920, + -15158, 9756, -3334, 9756, 0, -4920, 0, 0, + 8176, 7871, 11552, 0, 0, 15846, 8192, 0, + -9681, -6958, 0, 13797, 3334, 0, -15158, 0, + 0, 0, 8176, 0, 11552, 7871, 0, 0, + 8192, 15846, 9681, 0, 0, 0, 3334, 13797, + 15158, 6958, 0, 0, 8176, 5566, -11552, -5566, + -9681, -11205, 8192, 11205, 0, 4920, 15158, 9756, + -3334, -9756, 0, 4920, 0, 0, 8208, 14369, + -881, 0, 0, -4163, -8192, 0, -13218, -14833, + 0, -8836, 11095, 0, 6218, 0, 0, 0, + 8208, 10161, 881, 10161, 13218, 2944, -8192, 2944, + 0, 10488, 6218, -6248, -11095, -6248, 0, -10488, + 0, 0, 8208, -14369, -881, 0, 0, 4163, + -8192, 0, -13218, 14833, 0, 8836, 11095, 0, + 6218, 0, 0, 0, 8208, 0, -881, -14369, + 0, 0, -8192, 4163, 13218, 0, 0, 0, + 11095, 8836, -6218, -14833, 0, 0, 8176, -5566, + -11552, 5566, -9681, 11205, 8192, -11205, 0, -4920, + 15158, -9756, -3334, 9756, 0, -4920, 0, 0, + 8176, 0, 11552, -7871, 0, 0, 8192, -15846, + 9681, 0, 0, 0, 3334, -13797, 15158, -6958, + 0, 0, 8176, -7871, 11552, 0, 0, -15846, + 8192, 0, -9681, 6958, 0, -13797, 3334, 0, + -15158, 0, 0, 0, 8176, -5566, -11552, -5566, + 9681, 11205, 8192, 11205, 0, -4920, -15158, -9756, + -3334, -9756, 0, 4920, 0, 0, 8208, -10161, + 881, -10161, 13218, -2944, -8192, -2944, 0, -10488, + 6218, 6248, -11095, 6248, 0, 10488, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32767, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 32767 +}; + +const MappingMatrix mapping_matrix_foa_demixing = { 6, 6, 0 }; +const opus_int16 mapping_matrix_foa_demixing_data[36] = { + 16384, 16384, 16384, 16384, 0, 0, 0, 23170, + 0, -23170, 0, 0, -16384, 16384, -16384, 16384, + 0, 0, 23170, 0, -23170, 0, 0, 0, + 0, 0, 0, 0, 32767, 0, 0, 0, + 0, 0, 0, 32767 +}; + +const MappingMatrix mapping_matrix_soa_demixing = { 11, 11, 3050 }; +const opus_int16 mapping_matrix_soa_demixing_data[121] = { + 2771, 2771, 2771, 2771, 2771, 2771, 2771, 2771, + 2771, 0, 0, 10033, 10033, -20066, 10033, 14189, + 14189, -28378, 10033, -20066, 0, 0, 3393, 3393, + 3393, -3393, 0, 0, 0, -3393, -3393, 0, + 0, -17378, 17378, 0, -17378, -24576, 24576, 0, + 17378, 0, 0, 0, -14189, 14189, 0, -14189, + -28378, 28378, 0, 14189, 0, 0, 0, 2399, + 2399, -4799, -2399, 0, 0, 0, -2399, 4799, + 0, 0, 1959, 1959, 1959, 1959, -3918, -3918, + -3918, 1959, 1959, 0, 0, -4156, 4156, 0, + 4156, 0, 0, 0, -4156, 0, 0, 0, + 8192, 8192, -16384, 8192, 16384, 16384, -32768, 8192, + -16384, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8312, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8312 +}; + +const MappingMatrix mapping_matrix_toa_demixing = { 18, 18, 0 }; +const opus_int16 mapping_matrix_toa_demixing_data[324] = { + 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, + 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, + 0, 0, 0, -9779, 9779, 6263, 8857, 0, + 6263, 13829, 9779, -13829, 0, -6263, 0, -8857, + -6263, -9779, 0, 0, -3413, 3413, 3413, -11359, + 11359, 11359, -11359, -3413, 3413, -3413, -3413, -11359, + 11359, 11359, -11359, 3413, 0, 0, 13829, 9779, + -9779, 6263, 0, 8857, -6263, 0, 9779, 0, + -13829, 6263, -8857, 0, -6263, -9779, 0, 0, + 0, -15617, -15617, 6406, 0, 0, -6406, 0, + 15617, 0, 0, -6406, 0, 0, 6406, 15617, + 0, 0, 0, -5003, 5003, -10664, 15081, 0, + -10664, -7075, 5003, 7075, 0, 10664, 0, -15081, + 10664, -5003, 0, 0, -8176, -8176, -8176, 8208, + 8208, 8208, 8208, -8176, -8176, -8176, -8176, 8208, + 8208, 8208, 8208, -8176, 0, 0, -7075, 5003, + -5003, -10664, 0, 15081, 10664, 0, 5003, 0, + 7075, -10664, -15081, 0, 10664, -5003, 0, 0, + 15617, 0, 0, 0, -6406, 6406, 0, -15617, + 0, -15617, 15617, 0, 6406, -6406, 0, 0, + 0, 0, 0, -11393, 11393, 2993, -4233, 0, + 2993, -16112, 11393, 16112, 0, -2993, 0, 4233, + -2993, -11393, 0, 0, 0, -9974, -9974, -13617, + 0, 0, 13617, 0, 9974, 0, 0, 13617, + 0, 0, -13617, 9974, 0, 0, 0, 5579, + -5579, 10185, 14403, 0, 10185, -7890, -5579, 7890, + 0, -10185, 0, -14403, -10185, 5579, 0, 0, + 11826, -11826, -11826, -901, 901, 901, -901, 11826, + -11826, 11826, 11826, -901, 901, 901, -901, -11826, + 0, 0, -7890, -5579, 5579, 10185, 0, 14403, + -10185, 0, -5579, 0, 7890, 10185, -14403, 0, + -10185, 5579, 0, 0, -9974, 0, 0, 0, + -13617, 13617, 0, 9974, 0, 9974, -9974, 0, + 13617, -13617, 0, 0, 0, 0, 16112, -11393, + 11393, -2993, 0, 4233, 2993, 0, -11393, 0, + -16112, -2993, -4233, 0, 2993, 11393, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32767, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 32767 +}; + diff --git a/thirdparty/opus/mapping_matrix.h b/thirdparty/opus/mapping_matrix.h new file mode 100644 index 0000000000..98bc82df3e --- /dev/null +++ b/thirdparty/opus/mapping_matrix.h @@ -0,0 +1,133 @@ +/* Copyright (c) 2017 Google Inc. + Written by Andrew Allen */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file mapping_matrix.h + * @brief Opus reference implementation mapping matrix API + */ + +#ifndef MAPPING_MATRIX_H +#define MAPPING_MATRIX_H + +#include "opus_types.h" +#include "opus_projection.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct MappingMatrix +{ + int rows; /* number of channels outputted from matrix. */ + int cols; /* number of channels inputted to matrix. */ + int gain; /* in dB. S7.8-format. */ + /* Matrix cell data goes here using col-wise ordering. */ +} MappingMatrix; + +opus_int32 mapping_matrix_get_size(int rows, int cols); + +opus_int16 *mapping_matrix_get_data(const MappingMatrix *matrix); + +void mapping_matrix_init( + MappingMatrix * const matrix, + int rows, + int cols, + int gain, + const opus_int16 *data, + opus_int32 data_size +); + +#ifndef DISABLE_FLOAT_API +void mapping_matrix_multiply_channel_in_float( + const MappingMatrix *matrix, + const float *input, + int input_rows, + opus_val16 *output, + int output_row, + int output_rows, + int frame_size +); + +void mapping_matrix_multiply_channel_out_float( + const MappingMatrix *matrix, + const opus_val16 *input, + int input_row, + int input_rows, + float *output, + int output_rows, + int frame_size +); +#endif /* DISABLE_FLOAT_API */ + +void mapping_matrix_multiply_channel_in_short( + const MappingMatrix *matrix, + const opus_int16 *input, + int input_rows, + opus_val16 *output, + int output_row, + int output_rows, + int frame_size +); + +void mapping_matrix_multiply_channel_out_short( + const MappingMatrix *matrix, + const opus_val16 *input, + int input_row, + int input_rows, + opus_int16 *output, + int output_rows, + int frame_size +); + +/* Pre-computed mixing and demixing matrices for 1st to 3rd-order ambisonics. + * foa: first-order ambisonics + * soa: second-order ambisonics + * toa: third-order ambisonics + */ +extern const MappingMatrix mapping_matrix_foa_mixing; +extern const opus_int16 mapping_matrix_foa_mixing_data[36]; + +extern const MappingMatrix mapping_matrix_soa_mixing; +extern const opus_int16 mapping_matrix_soa_mixing_data[121]; + +extern const MappingMatrix mapping_matrix_toa_mixing; +extern const opus_int16 mapping_matrix_toa_mixing_data[324]; + +extern const MappingMatrix mapping_matrix_foa_demixing; +extern const opus_int16 mapping_matrix_foa_demixing_data[36]; + +extern const MappingMatrix mapping_matrix_soa_demixing; +extern const opus_int16 mapping_matrix_soa_demixing_data[121]; + +extern const MappingMatrix mapping_matrix_toa_demixing; +extern const opus_int16 mapping_matrix_toa_demixing_data[324]; + +#ifdef __cplusplus +} +#endif + +#endif /* MAPPING_MATRIX_H */ diff --git a/thirdparty/opus/mlp.c b/thirdparty/opus/mlp.c index ff9e50df47..964c6a98f6 100644 --- a/thirdparty/opus/mlp.c +++ b/thirdparty/opus/mlp.c @@ -1,5 +1,5 @@ /* Copyright (c) 2008-2011 Octasic Inc. - Written by Jean-Marc Valin */ + 2012-2017 Jean-Marc Valin */ /* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -29,42 +29,13 @@ #include "config.h" #endif +#include <math.h> #include "opus_types.h" #include "opus_defines.h" - -#include <math.h> -#include "mlp.h" #include "arch.h" #include "tansig_table.h" -#define MAX_NEURONS 100 +#include "mlp.h" -#if 0 -static OPUS_INLINE opus_val16 tansig_approx(opus_val32 _x) /* Q19 */ -{ - int i; - opus_val16 xx; /* Q11 */ - /*double x, y;*/ - opus_val16 dy, yy; /* Q14 */ - /*x = 1.9073e-06*_x;*/ - if (_x>=QCONST32(8,19)) - return QCONST32(1.,14); - if (_x<=-QCONST32(8,19)) - return -QCONST32(1.,14); - xx = EXTRACT16(SHR32(_x, 8)); - /*i = lrint(25*x);*/ - i = SHR32(ADD32(1024,MULT16_16(25, xx)),11); - /*x -= .04*i;*/ - xx -= EXTRACT16(SHR32(MULT16_16(20972,i),8)); - /*x = xx*(1./2048);*/ - /*y = tansig_table[250+i];*/ - yy = tansig_table[250+i]; - /*y = yy*(1./16384);*/ - dy = 16384-MULT16_16_Q14(yy,yy); - yy = yy + MULT16_16_Q14(MULT16_16_Q11(xx,dy),(16384 - MULT16_16_Q11(yy,xx))); - return yy; -} -#else -/*extern const float tansig_table[501];*/ static OPUS_INLINE float tansig_approx(float x) { int i; @@ -92,54 +63,82 @@ static OPUS_INLINE float tansig_approx(float x) y = y + x*dy*(1 - y*x); return sign*y; } -#endif -#if 0 -void mlp_process(const MLP *m, const opus_val16 *in, opus_val16 *out) +static OPUS_INLINE float sigmoid_approx(float x) { - int j; - opus_val16 hidden[MAX_NEURONS]; - const opus_val16 *W = m->weights; - /* Copy to tmp_in */ - for (j=0;j<m->topo[1];j++) - { - int k; - opus_val32 sum = SHL32(EXTEND32(*W++),8); - for (k=0;k<m->topo[0];k++) - sum = MAC16_16(sum, in[k],*W++); - hidden[j] = tansig_approx(sum); - } - for (j=0;j<m->topo[2];j++) - { - int k; - opus_val32 sum = SHL32(EXTEND32(*W++),14); - for (k=0;k<m->topo[1];k++) - sum = MAC16_16(sum, hidden[k], *W++); - out[j] = tansig_approx(EXTRACT16(PSHR32(sum,17))); - } + return .5f + .5f*tansig_approx(.5f*x); +} + +static void gemm_accum(float *out, const opus_int8 *weights, int rows, int cols, int col_stride, const float *x) +{ + int i, j; + for (i=0;i<rows;i++) + { + for (j=0;j<cols;j++) + out[i] += weights[j*col_stride + i]*x[j]; + } } -#else -void mlp_process(const MLP *m, const float *in, float *out) + +void compute_dense(const DenseLayer *layer, float *output, const float *input) { - int j; - float hidden[MAX_NEURONS]; - const float *W = m->weights; - /* Copy to tmp_in */ - for (j=0;j<m->topo[1];j++) - { - int k; - float sum = *W++; - for (k=0;k<m->topo[0];k++) - sum = sum + in[k]**W++; - hidden[j] = tansig_approx(sum); - } - for (j=0;j<m->topo[2];j++) - { - int k; - float sum = *W++; - for (k=0;k<m->topo[1];k++) - sum = sum + hidden[k]**W++; - out[j] = tansig_approx(sum); - } + int i; + int N, M; + int stride; + M = layer->nb_inputs; + N = layer->nb_neurons; + stride = N; + for (i=0;i<N;i++) + output[i] = layer->bias[i]; + gemm_accum(output, layer->input_weights, N, M, stride, input); + for (i=0;i<N;i++) + output[i] *= WEIGHTS_SCALE; + if (layer->sigmoid) { + for (i=0;i<N;i++) + output[i] = sigmoid_approx(output[i]); + } else { + for (i=0;i<N;i++) + output[i] = tansig_approx(output[i]); + } } -#endif + +void compute_gru(const GRULayer *gru, float *state, const float *input) +{ + int i; + int N, M; + int stride; + float tmp[MAX_NEURONS]; + float z[MAX_NEURONS]; + float r[MAX_NEURONS]; + float h[MAX_NEURONS]; + M = gru->nb_inputs; + N = gru->nb_neurons; + stride = 3*N; + /* Compute update gate. */ + for (i=0;i<N;i++) + z[i] = gru->bias[i]; + gemm_accum(z, gru->input_weights, N, M, stride, input); + gemm_accum(z, gru->recurrent_weights, N, N, stride, state); + for (i=0;i<N;i++) + z[i] = sigmoid_approx(WEIGHTS_SCALE*z[i]); + + /* Compute reset gate. */ + for (i=0;i<N;i++) + r[i] = gru->bias[N + i]; + gemm_accum(r, &gru->input_weights[N], N, M, stride, input); + gemm_accum(r, &gru->recurrent_weights[N], N, N, stride, state); + for (i=0;i<N;i++) + r[i] = sigmoid_approx(WEIGHTS_SCALE*r[i]); + + /* Compute output. */ + for (i=0;i<N;i++) + h[i] = gru->bias[2*N + i]; + for (i=0;i<N;i++) + tmp[i] = state[i] * r[i]; + gemm_accum(h, &gru->input_weights[2*N], N, M, stride, input); + gemm_accum(h, &gru->recurrent_weights[2*N], N, N, stride, tmp); + for (i=0;i<N;i++) + h[i] = z[i]*state[i] + (1-z[i])*tansig_approx(WEIGHTS_SCALE*h[i]); + for (i=0;i<N;i++) + state[i] = h[i]; +} + diff --git a/thirdparty/opus/mlp.h b/thirdparty/opus/mlp.h index 618e246e2c..d7670550fd 100644 --- a/thirdparty/opus/mlp.h +++ b/thirdparty/opus/mlp.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2008-2011 Octasic Inc. - Written by Jean-Marc Valin */ +/* Copyright (c) 2017 Jean-Marc Valin */ /* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -28,16 +27,34 @@ #ifndef _MLP_H_ #define _MLP_H_ -#include "arch.h" +#include "opus_types.h" + +#define WEIGHTS_SCALE (1.f/128) + +#define MAX_NEURONS 32 typedef struct { - int layers; - const int *topo; - const float *weights; -} MLP; + const opus_int8 *bias; + const opus_int8 *input_weights; + int nb_inputs; + int nb_neurons; + int sigmoid; +} DenseLayer; + +typedef struct { + const opus_int8 *bias; + const opus_int8 *input_weights; + const opus_int8 *recurrent_weights; + int nb_inputs; + int nb_neurons; +} GRULayer; + +extern const DenseLayer layer0; +extern const GRULayer layer1; +extern const DenseLayer layer2; -extern const MLP net; +void compute_dense(const DenseLayer *layer, float *output, const float *input); -void mlp_process(const MLP *m, const float *in, float *out); +void compute_gru(const GRULayer *gru, float *state, const float *input); #endif /* _MLP_H_ */ diff --git a/thirdparty/opus/mlp_data.c b/thirdparty/opus/mlp_data.c index c2fda4e2e5..ae4178df76 100644 --- a/thirdparty/opus/mlp_data.c +++ b/thirdparty/opus/mlp_data.c @@ -1,5 +1,4 @@ -/* The contents of this file was automatically generated by mlp_train.c - It contains multi-layer perceptron (MLP) weights. */ +/*This file is automatically generated from a Keras model*/ #ifdef HAVE_CONFIG_H #include "config.h" @@ -7,103 +6,667 @@ #include "mlp.h" -/* RMS error was 0.138320, seed was 1361535663 */ +static const opus_int8 layer0_weights[800] = { + -30, -9, 2, -12, 5, -1, 8, 9, + 9, 8, -13, 18, -17, -34, -5, 17, + -11, 0, -4, 10, 2, 10, 15, -8, + 2, -1, 0, 5, 13, -3, -16, 1, + -5, 3, 7, -28, -13, 6, 36, -3, + 19, -60, -17, -28, 7, -11, -30, -7, + 2, -42, -21, -3, 6, -22, 33, -9, + 7, -30, 21, -14, 24, -11, -20, -18, + -5, -12, 12, -49, -50, -49, 16, 9, + -37, -1, 9, 34, -13, -31, -31, 12, + 16, 44, -42, 2, -9, 8, -18, -6, + 9, 36, 19, 11, 13, 12, -21, 3, + -28, -12, 3, 33, 25, -14, 11, 1, + -94, -39, 18, -12, -11, -15, -7, 49, + 52, 10, -43, 9, 57, 8, 21, -6, + 14, -15, 44, -8, 7, -30, -13, -2, + -9, 25, -2, -127, 18, -11, -52, 26, + -27, 27, 10, -10, 7, 43, 6, -24, + 41, 10, -18, -27, 10, 17, 9, 10, + -17, -10, 20, -6, 22, 55, 35, -80, + 36, 25, -24, -36, 15, 9, -19, 88, + 19, 64, -51, -35, 17, 0, -7, 41, + -16, 27, 4, 15, -1, 18, -16, 47, + -39, -54, -8, 13, -25, -20, 102, -18, + -5, 44, 11, -28, 71, 2, -51, -5, + 5, 2, -83, -9, -29, 8, 21, -53, + 58, -37, -7, 13, 38, 9, 34, -1, + -41, 21, 4, -24, -36, -33, -21, 32, + 75, -2, 1, -68, -1, 47, -29, 32, + 20, 12, -65, -87, 5, 16, -12, 24, + 40, 15, 7, 19, -26, -17, 17, 6, + -2, -37, -30, -9, 32, -127, -39, 0, + -31, -27, 4, -22, 23, -6, -77, 35, + -61, 32, -37, -24, 13, -11, -1, -40, + -3, 17, -7, 13, 11, 59, -19, 10, + 6, -18, 0, 13, 3, -6, -23, 19, + 11, -17, 13, -1, -80, 40, -53, 69, + -29, -54, 0, -4, 33, -25, -2, 38, + 35, 36, -15, 46, 2, -13, -16, -8, + -8, 12, -24, -9, -55, -5, -9, 32, + 11, 7, 12, -18, -10, -86, -38, 54, + 37, -25, 18, -43, 7, -27, -27, -54, + 13, 9, 22, 70, 6, 35, -7, 23, + -15, -44, -6, 7, -66, -85, 32, 40, + -19, -9, -7, 12, -15, 7, 2, 6, + -35, 11, 28, 0, 26, 14, 1, 1, + 4, 12, 18, 35, 22, -18, -3, 14, + -1, 7, 14, -8, -14, -3, 4, -3, + -19, -7, -1, -25, -27, 25, -26, -2, + 33, -22, -27, -25, 4, -9, 7, 21, + 26, -30, 10, -9, -20, 11, 27, 10, + 5, -18, 14, -4, 2, -17, -5, -7, + -9, -13, 15, 29, 1, -10, -16, -10, + 35, 36, -7, -22, -44, 17, 30, 22, + 21, -1, 22, -11, 32, -8, -7, 5, + -10, 5, 30, -20, 29, -20, -34, 12, + -4, -6, 6, -13, 10, -5, -68, -1, + 24, 9, 19, -24, -64, 31, 19, 27, + -26, 75, -45, 41, 39, -42, 8, 6, + 23, -30, 16, -25, 30, 34, 8, -38, + -3, 18, 16, -31, 22, -4, -9, 1, + 20, 9, 38, -32, 0, -45, 0, -6, + -13, 11, -25, -32, -22, 31, -24, -11, + -11, -4, -4, 20, -34, 22, 20, 9, + -25, 27, -5, 28, -29, 29, 6, 21, + -6, -18, 54, 4, -46, 23, 21, -14, + -31, 36, -41, -24, 4, 22, 10, 11, + 7, 36, -32, -13, -52, -17, 24, 28, + -37, -36, -1, 24, 9, -38, 35, 48, + 18, 2, -1, 45, 10, 39, 24, -38, + 13, 8, -16, 8, 25, 11, 7, -29, + -11, 7, 20, -30, -38, -45, 14, -18, + -28, -9, 65, 61, 22, -53, -38, -16, + 36, 46, 20, -39, 32, -61, -6, -6, + -36, -33, -18, -28, 56, 101, 45, 11, + -28, -23, -29, -61, 20, -47, 2, 48, + 27, -17, 1, 40, 1, 3, -51, 15, + 35, 28, 22, 35, 53, -61, -29, 12, + -6, -21, 10, 3, -20, 2, -25, 1, + -6, 31, 11, -3, 1, -10, -52, 6, + 126, -105, 122, 127, -128, 127, 127, -128, + 127, 108, 12, 127, 48, -128, -36, -128, + 127, 127, -128, -128, 127, 89, -128, 127, + -128, -128, -128, 127, 127, -128, -128, -93, + -82, 20, 125, 65, -82, 127, 38, -74, + 81, 88, -88, 79, 51, -47, -111, -26, + 14, 83, -88, -112, 24, 35, -101, 98, + -99, -48, -45, 46, 83, -60, -79, 45, + -20, -41, 9, 4, 52, 54, 93, -10, + 4, 13, 3, 123, 6, 94, -111, -69, + -14, -31, 10, 12, 53, -79, -11, -21, + -2, -44, -72, 92, 65, -57, 56, -38, + 127, -56, -128, 127, 127, -128, 86, 117, + -75, -128, 127, -19, -99, -112, 127, -128, + 127, -48, 114, 118, -128, -128, 117, -17, + -6, 121, -128, 127, -128, 82, 54, -106, + 127, 127, -33, 100, -39, -23, 18, -78, + -34, -29, -1, -30, 127, -26, 127, -128, + 126, -128, 27, -23, -79, -120, -127, 127, + 72, 66, 29, 7, -66, -56, -117, -128 +}; + +static const opus_int8 layer0_bias[32] = { + 51, -16, 1, 13, -5, -6, -16, -7, + 11, -6, 106, 26, 28, -14, 21, -29, + 7, 18, -18, -17, 21, -17, -9, 20, + -25, -3, -34, 48, 11, -13, -31, -20 +}; + +static const opus_int8 layer1_weights[2304] = { + 22, -1, -7, 7, 29, -27, -31, -17, + -13, 33, 44, -8, 11, 33, 24, 78, + 15, 19, 30, -2, -24, 5, 49, 5, + 36, 29, -14, -11, -48, -33, 21, -42, + -38, -12, 55, -37, 54, -8, 1, 36, + 17, 0, 51, 31, 59, 7, -12, 53, + 4, 32, -14, 48, 5, -10, -16, -8, + 1, -16, -56, -24, -6, 18, -2, 23, + 6, 46, -6, -10, 20, 35, -44, -15, + -49, 36, 16, 5, -7, -79, -67, 12, + 70, -3, -79, -54, -85, -24, 47, -22, + 33, 21, 69, -1, 11, 22, 14, -16, + -16, -22, -28, -11, 11, -41, 31, -26, + -33, -19, -4, 27, 32, -50, 5, -10, + -38, -22, -8, 35, -31, 1, -41, -15, + -11, 44, 28, -17, -41, -23, 17, 2, + -23, -26, -13, -13, -17, 6, 14, -31, + -25, 9, -19, 39, -8, 4, 31, -1, + -45, -11, -28, -92, -46, -15, 21, 118, + -22, 45, -51, 11, -20, -20, -15, 13, + -21, -97, -29, -32, -23, -42, 94, 1, + 23, -8, 63, -3, -46, 19, -26, 32, + -40, -74, -26, 26, -4, -13, 30, -20, + -30, -25, -14, -31, -45, -43, 4, -60, + -48, -12, -34, 2, 2, 3, 13, 15, + 11, 16, 5, 46, -9, -55, -16, -57, + 29, 14, 38, -50, -2, -44, -11, -8, + 52, -27, -38, -7, 20, 47, 17, -59, + 0, 47, 46, -63, 35, -17, 19, 33, + 68, -19, 2, 15, -16, 28, -16, -103, + 26, -35, 47, -39, -60, 30, 31, -23, + -52, -13, 116, 47, -25, 30, 40, 30, + -22, 2, 12, -27, -18, 31, -10, 27, + -8, -66, 12, 14, 4, -26, -28, -13, + 3, 13, -26, -51, 37, 5, 2, -21, + 47, 3, 13, 25, -41, -27, -8, -4, + 5, -76, -33, 28, 10, 9, -46, -74, + 19, 28, 25, 31, 54, -55, 68, 38, + -24, -32, 2, 4, 68, 11, -1, 99, + 5, 16, -2, -74, 40, 26, -26, 33, + 31, -1, -68, 14, -6, 25, 9, 29, + 60, 61, 7, -7, 0, -24, 7, 77, + 4, -1, 16, -7, 13, -15, -19, 28, + -31, -24, -16, 37, 24, 13, 30, 10, + -30, 11, 11, -10, 22, 60, 28, 45, + -3, -40, -62, -5, -102, 9, -32, -27, + -54, 21, 15, -5, 37, -43, -11, 37, + -19, 47, -64, -128, -27, -114, 21, -66, + 59, 46, -3, -12, -87, -9, 4, 19, + -113, -36, 78, 57, -26, -38, -77, -10, + 6, 6, -75, 25, -97, -11, 33, -46, + 1, 13, -21, -33, -20, 16, -6, -3, + -11, -4, -27, 38, 8, -41, -2, -33, + 18, 19, -26, 1, -29, -22, -4, -14, + -55, -11, -80, -3, 11, 34, 90, 51, + 11, 17, 43, 36, 127, -32, 29, 103, + 9, 27, 13, 64, 56, 70, -14, 3, + -12, 10, 37, 3, 12, -22, -10, 46, + 28, 10, 20, 26, -24, 18, 9, 7, + 14, 34, -5, -7, 31, -14, -56, 11, + -18, -8, -17, -7, -10, -40, 10, -33, + -32, -43, 5, 9, 11, -4, 10, 50, + -12, -5, 46, 9, 7, 1, 11, 15, + 91, -17, 7, -50, 23, 6, -30, -99, + 0, -17, 14, 8, -10, -25, -30, -69, + -62, 31, 127, 114, -23, 101, -5, -54, + -6, -22, 7, -56, 39, 18, -29, 0, + 46, 8, -79, 4, -21, 18, -32, 62, + -12, -8, -12, -58, 31, -32, 17, 6, + -24, 25, 24, 9, -4, -19, 45, 6, + 17, -14, 5, -27, 16, -4, -41, 25, + -36, 5, 15, 12, 50, 27, 25, 23, + -44, -69, -9, -19, -48, -8, 4, 12, + -6, 13, -19, -30, -36, 26, 37, -1, + -3, -30, -42, -14, -10, -20, 26, -54, + -27, -44, 4, 73, -26, 90, 32, -69, + -29, -16, 3, 103, 15, -17, 37, 24, + -23, -31, 33, -37, -64, 25, 13, -81, + -28, -32, 27, 5, -35, -23, 15, -22, + 19, -7, 9, 30, 19, -23, 27, -13, + 43, 29, -29, -6, 9, -40, -33, -33, + -32, 9, 11, -48, -8, -23, -52, 46, + 17, -22, -42, 35, -15, -41, 16, 34, + 31, -42, -19, -11, 55, 7, -39, 89, + -11, -33, 20, -14, 22, 32, 3, -17, + -6, 14, 34, 1, 55, -21, -90, -8, + 18, 27, 13, -29, 21, 15, -33, -51, + -9, -11, 4, -16, -18, 23, -4, -4, + 48, 1, 7, 29, -14, -12, -16, 17, + 35, 8, 0, -7, -2, 9, 8, 17, + -6, 53, -32, -21, -50, 5, 99, -60, + -5, -53, 10, -31, 12, -5, 7, 80, + 36, 18, -31, 9, 98, 36, -63, -35, + 4, -13, -28, -24, 28, -13, 18, 16, + -1, -18, -34, 10, 20, 7, 4, 29, + 11, 25, -7, 36, 14, 45, 24, 1, + -16, 30, 6, 35, -6, -11, -24, 13, + -1, 27, 39, 20, 48, -11, -4, -13, + 28, 11, -31, -18, 31, -29, 22, -2, + -20, -16, 5, 30, -12, -28, -3, 93, + -16, 23, 18, -29, 6, -54, -37, 28, + -3, -3, -47, -3, -36, -55, -3, 41, + -10, 47, -2, 23, 42, -7, -71, -27, + 83, -64, 7, -24, 8, 26, -17, 15, + 12, 31, -30, -38, -13, -33, -56, 4, + -17, 20, 18, 1, -30, -5, -6, -31, + -14, -37, 0, 22, 10, -30, 37, -17, + 18, 6, 5, 23, -36, -32, 14, 18, + -13, -61, -52, -69, 44, -30, 16, 18, + -4, -25, 14, 81, 26, -8, -23, -59, + 52, -104, 17, 119, -32, 26, 17, 1, + 23, 45, 29, -64, -57, -14, 73, 21, + -13, -13, 9, -68, -7, -52, 3, 24, + -39, 44, -15, 27, 14, 19, -9, -28, + -11, 5, 3, -34, -2, 2, 22, -6, + -23, 4, 3, 13, -22, -13, -10, -18, + 29, 6, 44, -13, -24, -8, 2, 30, + 14, 43, 6, 17, -73, -6, -7, 20, + -80, -7, -7, -28, 15, -69, -38, -5, + -100, -35, 15, -79, 23, 29, -18, -27, + 21, -66, -37, 8, -22, -39, 48, 4, + -13, 1, -9, 11, -29, 22, 6, -49, + 32, -14, 47, -18, -4, 44, -52, -74, + 43, 30, 23, -14, 5, 0, -27, 4, + -7, 10, -4, 10, 1, -16, 11, -18, + -2, -5, 2, -11, 0, -20, -4, 38, + 74, 59, 39, 64, -10, 26, -3, -40, + -68, 3, -30, -51, 8, -19, -27, -46, + 51, 52, 54, 36, 90, 92, 14, 13, + -5, 0, 16, -62, 16, 11, -47, -37, + -6, -5, 21, 54, -57, 32, 42, -6, + 62, -9, 16, 21, 24, 9, -10, -4, + 33, 50, 13, -15, 1, -35, -48, 18, + -11, -17, -67, -13, 21, 38, -44, 36, + -16, 29, 17, 5, -10, 18, 17, -32, + 2, 8, 22, -56, -15, -32, 40, 43, + 19, 46, -7, -100, -96, 19, 53, 24, + 21, -26, -48, -101, -82, 61, 38, -85, + -28, -34, -1, 63, -5, -5, 39, 39, + -38, 32, -12, -28, 20, 40, -8, 2, + 31, 12, -35, -13, 20, -25, 30, 8, + 3, -13, -9, -20, 2, -13, 24, 37, + -10, 33, 6, 20, -16, -24, -6, -6, + -19, -5, 22, 21, 10, 11, -4, -39, + -1, 6, 49, 41, -15, -57, 21, -62, + 77, -69, -13, 0, -74, 1, -7, -38, + -8, 6, 63, 28, 4, 26, -52, 82, + 63, 13, 45, -33, 44, -52, -65, -21, + -46, -49, 64, -17, 32, 24, 68, -39, + -16, -5, -26, 28, 5, -61, -28, 2, + 24, 11, -12, -33, 9, -37, -3, -28, + 22, -37, -12, 19, 0, -18, -2, 14, + 1, 4, 8, -9, -2, 43, -17, -2, + -66, -31, 56, -40, -87, -36, -2, -4, + -42, -45, -1, 31, -43, -15, 27, 63, + -11, 32, -10, -33, 27, -19, 4, 15, + -26, -34, 29, -4, -39, -65, 14, -20, + -21, -17, -36, 13, 59, 47, -38, -33, + 13, -37, -8, -37, -7, -6, -76, -31, + -12, -46, 7, 24, -21, -30, -14, 9, + 15, -12, -13, 47, -27, -25, -1, -39, + 0, 20, -9, 6, 7, 4, 3, 7, + 39, 50, 22, -7, 14, -20, 1, 70, + -28, 29, -41, 10, -16, -5, -28, -2, + -37, 32, -18, 17, 62, -11, -20, -50, + 36, 21, -62, -12, -56, 52, 50, 17, + 3, 48, 44, -41, -25, 3, 16, -3, + 0, 33, -6, 15, 27, 34, -25, 22, + 9, 17, -11, 36, 16, -2, 12, 21, + -52, 45, -2, -10, 46, 21, -18, 67, + -28, -13, 30, 37, 42, 16, -9, 11, + 75, 7, -64, -40, -10, 29, 57, -23, + 5, 53, -77, 3, -17, -5, 47, -55, + -35, -36, -13, 52, -53, -71, 52, -111, + -23, -26, -28, 29, -43, 55, -19, 43, + -19, 54, -12, -33, -44, -39, -19, -10, + -31, -10, 21, 38, -57, -20, 2, -25, + 8, -6, 50, 12, 15, 25, -25, 15, + -30, -6, 9, 25, 37, 19, -4, 31, + -22, 2, 4, 2, 36, 7, 3, -34, + -80, 36, -10, -2, -5, 31, -36, 49, + -70, 20, -36, 21, 24, 25, -46, -51, + 36, -58, -48, -40, -10, 55, 71, 47, + 10, -1, 1, 2, -46, -68, 16, 13, + 0, -74, -29, 73, -52, -18, -11, 7, + -44, -82, -32, -70, -28, -1, -39, -68, + -6, -41, 12, -22, -16, 40, -11, -25, + 51, -9, 21, 4, 4, -34, 7, -78, + 16, 6, -38, -30, -2, -44, 32, 0, + 22, 64, 5, -72, -2, -14, -10, -16, + -8, -25, 12, 102, -58, 37, -10, -23, + 15, 49, 7, -7, 2, -20, -32, 45, + -6, 48, 28, 30, 33, -1, 22, -6, + 30, 65, -17, 29, 74, 37, -26, -10, + 15, -24, 19, -66, 22, -10, -31, -1, + -18, -9, 11, 37, -4, 45, 5, 41, + 17, 1, 1, 24, -58, 41, 5, -51, + 14, 8, 43, 16, -10, -1, 45, 32, + -64, 3, -33, -25, -3, -27, -68, 12, + 23, -11, -13, -37, -40, 4, -21, -12, + 32, -23, -19, 76, 41, -23, -24, -44, + -65, -1, -15, 1, 71, 63, 5, 20, + -3, 21, -23, 31, -32, 18, -2, 27, + 31, 46, -5, -39, -5, -35, 18, -18, + -40, -10, 3, 12, 2, -2, -22, 40, + 5, -6, 60, 36, 3, 29, -27, 10, + 25, -54, 5, 26, 39, 35, -24, -37, + 30, -91, 28, -4, -21, -27, -39, -6, + 5, 12, -128, 38, -16, 29, -95, -29, + 82, -2, 35, 2, 12, 8, -22, 10, + 80, -47, 2, -25, -73, -79, 16, -30, + -32, -66, 48, 21, -45, -11, -47, 14, + -27, -17, -7, 15, -44, -14, -44, -26, + -32, 26, -23, 17, -7, -28, 26, -6, + 28, 6, -26, 2, 13, -14, -23, -14, + 19, 46, 16, 2, -33, -21, 28, -17, + -42, 44, -37, 1, -39, 28, 84, -46, + 15, 10, 13, -44, 72, -26, 26, 32, + -28, -12, -83, 2, 10, -30, -44, -10, + -28, 53, 45, 65, 0, -25, 57, 36, + -33, 6, 29, 44, -53, 11, 19, -2, + -27, 35, 32, 49, 4, 23, 38, 36, + 24, 10, 51, -39, 4, -7, 26, 37, + -35, 11, -47, -18, 28, 16, -35, 42, + 17, -21, -41, 28, 14, -12, 11, -45, + 7, -43, -15, 18, -5, 38, -40, -50, + -30, -21, 9, -98, 13, 12, 23, 75, + -56, -7, -3, -4, -1, -34, 12, -49, + 11, 26, -18, -28, -17, 33, 13, -14, + 40, 24, -72, -37, 10, 17, -6, 22, + 16, 16, -6, -12, -30, -14, 10, 40, + -23, 12, 15, -3, -15, 13, -56, -4, + -30, 1, -3, -17, 27, 50, -5, 64, + -36, -19, 7, 29, 22, 25, 9, -16, + -58, -69, -40, -61, -71, -14, 42, 93, + 26, 11, -6, -58, -11, 70, -52, 19, + 9, -30, -33, 11, -37, -47, -21, -22, + -40, 10, 47, 4, -23, 17, 48, 41, + -48, 14, 10, 15, 34, -23, -2, -47, + 23, -32, -13, -10, -26, -26, -4, 16, + 38, -14, 0, -12, -7, -7, 20, 44, + -1, -32, -27, -16, 4, -6, -18, 14, + 5, 4, -29, 28, 7, -7, 15, -11, + -20, -45, -36, 16, 84, 34, -59, -30, + 22, 126, 8, 68, 79, -17, 21, -68, + 37, 5, 15, 63, 49, 127, -90, 85, + 43, 7, 16, 9, 6, -45, -57, -43, + 57, 11, -23, -11, -29, 60, -26, 0, + 7, 42, -24, 10, 23, -25, 8, -7, + -40, 19, -17, 35, 4, 27, -39, -91, + 27, -36, 34, 2, 16, -24, 25, 7, + -21, 5, 17, 10, -22, -30, 9, -17, + -61, -26, 33, 21, 58, -51, -14, 69, + -38, 20, 7, 80, -4, -65, -6, -27, + 53, -12, 47, -1, -15, 1, 60, 102, + -79, -4, 12, 9, 22, 37, -8, -4, + 37, 2, -3, -15, -16, -11, -5, 19, + -6, -43, 20, -25, -18, 10, -27, 0, + -28, -27, -11, 10, -18, -2, -4, -16, + 26, 14, -6, 7, -6, 1, 53, -2, + -29, 23, 9, -30, -6, -4, -6, 56, + 70, 0, -33, -20, -17, -9, -24, 46, + -5, -105, 47, -46, -51, 20, 20, -53, + -81, -1, -7, 75, -5, -21, -65, 12, + -52, 22, -50, -12, 49, 54, 76, -81, + 10, 45, -41, -59, 18, -19, 25, 14, + -31, -53, -5, 12, 31, 84, -23, 2, + 7, 2, 10, -32, 39, -2, -12, 1, + -9, 0, -10, -11, 9, 15, -8, -2, + 2, -1, 10, 14, -5, -40, 19, -7, + -7, 26, -4, 2, 1, -27, 35, 32, + 21, -31, 26, 43, -9, 4, -32, 40, + -62, -52, 36, 22, 38, 22, 36, -96, + 6, -10, -23, -49, 15, -33, -18, -3, + 0, 41, 21, -19, 21, 23, -39, -23, + -6, 6, 47, 56, 4, 74, 0, -98, + 29, -47, -14, -36, 21, -22, 22, 16, + 13, 12, 16, -5, 13, 17, -13, -15, + 1, -34, -26, 26, 12, 32, 27, 13, + -67, 27, 2, 8, 10, 18, 16, 20, + -17, -17, 57, -64, 5, 14, 19, 31, + -18, -44, -46, -16, 4, -25, 17, -126, + -24, 39, 4, 8, 55, -25, -34, 39, + -16, 3, 9, 71, 72, -31, -55, 6, + 10, -25, 32, -85, -21, 18, -8, 15, + 12, -27, -7, 1, -21, -2, -5, 48, + -16, 18, 1, -22, -26, 16, 14, -31, + 27, -6, -15, -21, 4, -14, 18, -36 +}; + +static const opus_int8 layer1_recur_weights[1728] = { + 20, 67, -99, 12, 41, -25, 49, -44, + 35, 81, 110, 47, 34, -66, -14, 14, + -60, 34, 29, -73, 10, 41, 35, 89, + 7, -35, 22, 7, 27, -20, -6, 56, + 26, 66, 6, 33, -55, 53, 1, -21, + 14, 17, 68, 55, 59, 0, 18, -9, + 5, -41, 6, -5, -114, -12, 29, 42, + -23, 10, 81, -27, 20, -53, -30, -62, + 40, 95, 25, -4, 3, 18, -8, -15, + -29, -82, 2, -57, -3, -61, -29, -29, + 49, 2, -55, 5, -69, -99, -49, -51, + 6, -25, 12, 89, 44, -33, 5, 41, + 1, 23, -37, -37, -28, -48, 3, 4, + -41, -30, -57, -35, -39, -1, -13, -56, + -5, 50, 49, 41, -4, -4, 33, -22, + -1, 33, 34, 18, 40, -42, 12, 1, + -6, -2, 18, 17, 39, 44, 11, 65, + -60, -45, 10, 91, 21, 9, -62, -11, + 8, 69, 37, 24, -30, 21, 26, -27, + 1, -28, 24, 66, -8, 6, -71, 34, + 24, 44, 58, -78, -19, 57, 17, -60, + 1, 12, -3, -1, -40, 22, 11, -5, + 25, 12, 1, 72, 79, 7, -50, 23, + 18, 13, 21, -11, -20, 5, 77, -94, + 24, 15, 57, -51, 3, 36, 53, -1, + 4, 14, 30, -31, 22, 40, 32, -11, + -34, -36, -59, 58, 25, 21, -54, -23, + 40, 46, 18, 0, 12, 54, -96, -99, + -59, 5, 119, -38, 50, 55, 12, -16, + 67, 0, 34, 35, 39, 35, -1, 69, + 24, 27, -30, -35, -4, -70, 2, -44, + -7, -6, 19, -9, 60, 44, -21, -10, + 37, 43, -16, -3, 30, -15, -65, 31, + -55, 18, -98, 76, 64, 25, 24, -18, + -7, -68, -10, 38, 27, -60, 36, 33, + 16, 30, 34, -39, -37, 31, 12, 53, + -54, 14, -26, -49, -128, -13, -5, -22, + -11, -85, 55, -8, -51, -11, -33, -10, + -31, -76, -41, 23, 44, -40, -54, -127, + -101, 19, -23, -15, 15, 27, 58, -60, + 8, 14, -33, 1, 48, -9, -11, -123, + 3, 53, 23, 4, -28, 22, 2, -29, + -67, 36, 12, 7, 55, -21, 88, 20, + -1, -21, -17, 3, 41, 32, -10, -14, + -5, -57, 67, 57, 21, 23, -2, -27, + -73, -24, 120, 21, 18, -35, 42, -7, + 3, -45, -25, 76, -34, 50, 11, -54, + -91, 3, -113, -20, -5, 47, 15, -47, + 17, 27, -3, -26, -7, 10, 7, 74, + -40, 64, -7, -5, -24, -49, -24, -3, + -10, 27, -17, -8, -3, 14, -27, 33, + 13, 39, 28, -7, -38, 29, 16, 44, + 19, 55, -3, 9, -13, -57, 43, 43, + 31, 0, -93, -17, 19, -56, 4, -12, + -25, 37, -85, -13, -118, 33, -17, 56, + 71, -80, -4, 6, -11, -18, 47, -52, + 25, 9, 48, -107, 1, 21, 20, -3, + 10, -16, -4, 24, 17, 31, -61, -18, + -50, 24, -10, 12, 71, 26, 11, -3, + 4, 1, 0, -7, -40, 18, 38, -34, + 38, 17, 8, -34, 2, 21, 123, -32, + -26, 43, 14, -34, -1, -9, 37, -16, + 6, -17, -62, 68, 22, 17, 11, -75, + 33, -80, 62, -9, -75, 76, 36, -41, + -8, -40, -11, -71, 40, -39, 62, -49, + -81, 16, -9, -52, 52, 61, 17, -103, + -27, -10, -8, -54, -57, 21, 23, -16, + -52, 36, 18, 10, -5, 8, 15, -29, + 5, -19, -37, 8, -53, 6, 19, -37, + 38, -17, 48, 10, 0, 81, 46, 70, + -29, 101, 11, 44, -44, -3, 24, 11, + 3, 14, -9, 11, 14, -45, 13, 46, + -3, -57, 68, 44, 63, 98, 25, -28, + -23, 15, 32, -10, 53, -6, -2, -9, + -6, 16, -107, -11, -11, -28, 59, 57, + -22, 38, 42, 83, 27, 5, 29, -30, + 12, -21, -13, 31, 38, -21, 58, -10, + -10, -15, -2, -5, 11, 12, -73, -28, + -38, 22, 2, -25, 73, -52, -12, -55, + 32, -63, 21, 51, 33, 52, -26, 55, + -26, -26, 57, -32, -4, -52, -61, 21, + -33, -91, -51, 69, -90, -53, -38, -44, + 12, -76, -20, 77, -45, -7, 86, 43, + -109, -33, -105, -40, -121, -10, 0, -72, + 45, -51, -75, -49, -38, -1, -62, 18, + -1, 30, -44, -14, -10, -67, 40, -10, + -34, 46, -64, -32, 29, -13, 33, 3, + -32, -5, 28, -27, -25, 93, 24, 68, + -40, 57, 23, -3, -21, -58, 17, -39, + -17, -22, -89, 11, 18, -46, 27, 24, + 46, 127, 61, 87, 31, 127, -36, 47, + -23, 47, 127, -24, 110, 122, 30, 100, + 0, 96, -12, 6, 50, 44, -13, 73, + 4, 55, -11, -15, 49, 42, -6, 20, + -35, 58, 18, 38, 42, 72, 19, -21, + 11, 9, -37, 7, 29, 31, 16, -17, + 13, -50, 19, 5, -23, 51, -16, -5, + 4, -24, 76, 10, -53, -28, -7, -65, + 74, 40, -16, -29, 32, -16, -49, -35, + -3, 59, -96, -50, -43, -43, -61, -15, + -8, -36, -34, -33, -14, 11, -3, -39, + 4, -114, -123, -11, -49, -21, 14, -56, + 1, 43, -63, 26, 40, 18, -10, -26, + -14, -15, -35, -35, -11, 32, -44, -67, + 2, 22, 7, 3, -9, -30, -51, -28, + 28, 6, -22, 16, 34, -25, -52, -54, + -8, -6, 5, 8, 20, -16, -17, -44, + 27, 3, 31, -5, -48, -1, -3, 116, + 11, 71, -31, -47, 109, 50, -22, -12, + -57, 32, 66, 8, -25, -93, -54, -10, + 19, -76, -34, 97, 48, -36, -18, -30, + -39, -26, -12, 28, 14, 12, -12, -31, + 38, 2, 10, 4, -40, 20, 16, -61, + 2, 64, 39, 5, 15, 33, 40, -61, + -49, 93, -10, 33, 28, -11, -27, -18, + 39, -62, -6, -6, 62, 11, -8, 38, + -67, 12, 27, 39, -27, 123, -18, -6, + -65, 83, -64, 20, 19, -11, 33, 24, + 17, 56, 78, 7, -15, 54, -101, -9, + 115, -96, 50, 51, 35, 34, 27, 37, + -40, -11, 8, -36, 42, -45, 2, -23, + 0, 67, -8, -9, -13, 50, -14, -27, + 4, 0, -8, -14, 30, -9, 29, 15, + 9, -38, 37, -8, 50, -46, 54, 41, + -11, -8, -11, -26, 39, 45, 14, -26, + -17, -27, 69, 38, 39, 98, 66, 0, + 42, 123, -101, -19, -83, 117, -32, 56, + 10, 12, -88, 79, -53, 56, 63, 95, + -62, 9, 36, -13, -79, -16, 37, -46, + 35, -34, 14, 17, -54, 5, 21, -7, + 7, 63, 56, 15, 27, -76, -25, 4, + -26, -63, 28, -67, -52, 43, -47, -70, + 40, -12, 40, -66, -37, 0, 35, 37, + -53, 4, -17, -51, 11, 21, 14, -34, + -4, 24, -42, 29, 22, 7, 28, 12, + 37, 39, -39, -19, 65, -60, -50, -2, + 1, 82, 39, 19, -23, -43, -22, -67, + -35, -34, 32, 102, 81, 127, 36, 67, + -45, 1, -67, -52, -4, 35, 20, 28, + 71, 86, -35, -9, -83, -34, 12, 9, + -23, 2, 14, 28, -23, 7, -25, 45, + 7, 17, -37, 0, -19, 31, 26, 40, + -27, -16, 17, 5, -21, 23, 24, 96, + -55, 52, -19, -14, -6, 1, 50, -34, + 86, -53, 38, 2, -52, -36, -13, 60, + -85, -120, 32, 7, -12, 22, 70, -7, + -94, 38, -76, -31, -20, 15, -28, 7, + 6, 40, 53, 88, 3, 38, 18, -8, + -22, -23, 51, 37, -9, 13, -32, 25, + -21, 27, 31, 20, 18, -9, -13, 1, + 21, -24, -13, 39, 15, -11, -29, -36, + 18, 15, 8, 27, 21, -94, -1, -22, + 49, 66, -1, 6, -3, -40, -18, 6, + 28, 12, 33, -59, 62, 60, -48, 90, + -1, 108, 9, 18, -2, 27, 77, -65, + 82, -48, -38, -19, -11, 127, 50, 66, + 18, -13, -22, 60, -38, 40, -14, -26, + -13, 38, 67, 57, 30, 33, 26, 36, + 38, -17, 27, -28, 20, 12, -64, 18, + 5, -33, -27, 13, -26, 32, 35, -5, + -48, -14, 92, 43, -47, -14, 40, 11, + 51, 66, 22, -63, -16, -61, 4, -28, + 27, 20, -33, -30, -21, -29, -53, 31, + -40, 24, 43, -4, -19, 21, 67, 20, + 100, -16, -93, 78, -6, -18, -52, -37, + -9, 66, -31, -8, 26, 18, 4, 24, + -22, 17, -2, -13, 27, 0, 8, -18, + -25, 5, -21, -24, -7, 18, -93, 21, + 7, 2, -75, 69, 50, -5, -15, -17, + 60, -42, 55, 1, -4, 3, 10, 46, + 16, -13, 45, -7, -10, -44, -108, 49, + 2, -15, -64, -12, -72, 32, -38, -45, + 10, -54, 13, -13, -27, -36, -64, 58, + -62, -101, 88, -86, -71, -39, -9, -128, + 32, 15, -4, 54, -16, -39, -26, -36, + 46, 48, -64, -10, 19, 30, -13, 34, + -8, 50, 60, -22, -6, -11, -30, 5, + 50, 32, 56, 0, 25, 6, 68, 11, + -29, 45, -9, -12, 4, 1, 18, -49, + 0, -38, -19, 90, 29, 35, 51, 8, + -48, 96, -1, -12, -9, -32, -63, -65, + -7, 38, 89, 28, -85, -28, -23, -25, + -128, 56, 79, -36, 99, -6, -37, 7, + -13, -69, -46, -29, 25, 64, -21, 17, + 1, 42, -66, 1, 80, 26, -32, 21, + 15, 15, 6, 6, -10, 15, 127, 5, + 38, 27, 87, -57, -25, 11, 72, -21, + -5, 11, -13, -66, 78, 36, -3, 41, + -21, 8, -33, 23, 73, 28, 57, -25, + -5, 4, -22, -47, 15, 4, -57, -72, + 33, 1, 18, 2, 53, -71, -99, -21, + -3, -111, 108, 71, -14, 82, 25, 61, + -48, 5, 9, -51, -20, -25, -3, 14, + -33, 14, -3, -34, 22, 12, -19, -38, + -16, 2, 21, 16, 26, -31, 75, 44, + -31, 16, 26, 66, 17, -9, -22, -22, + 22, -44, 22, 27, 2, 58, -14, 10, + -73, -42, 55, -25, -61, 72, -1, 30, + -58, -25, 63, 26, -48, -40, 26, -30, + 60, 8, -17, -1, -18, -20, 43, -20, + -4, -28, 127, -106, 29, 70, 64, -27, + 39, -33, -5, -88, -40, -52, 26, 44, + -17, 23, 2, -49, 22, -9, -8, 86, + 49, -43, -60, 1, 10, 45, 36, -53, + -4, 33, 38, 48, -72, 1, 19, 21, + -65, 4, -5, -62, 27, -25, 17, -6, + 6, -45, -39, -46, 4, 26, 127, -9, + 18, -33, -18, -3, 33, 2, -5, 15, + -26, -22, -117, -63, -17, -59, 61, -74, + 7, -47, -58, -128, -67, 15, -16, -128, + 12, 2, 20, 9, -48, -40, 43, 3, + -40, -16, -38, -6, -22, -28, -16, -59, + -22, 6, -5, 11, -12, -66, -40, 27, + -62, -44, -19, 38, -3, 39, -8, 40, + -24, 13, 21, 50, -60, -22, 53, -29, + -6, 1, 22, -59, 0, 17, -39, 115 +}; -static const float weights[422] = { +static const opus_int8 layer1_bias[72] = { + -42, 20, 16, 0, 105, 60, 1, -97, + 24, 60, 18, 13, 62, 25, 127, 34, + 79, 55, 118, 127, 95, 31, -4, 87, + 21, 12, 2, -14, 18, 23, 8, 17, + -1, -8, 5, 4, 24, 37, 21, 13, + 36, 13, 17, 18, 37, 30, 33, 1, + 8, -16, -11, -5, -31, -3, -5, 0, + 6, 3, 58, -7, -1, -16, 5, -13, + 16, 10, -2, -14, 11, -4, 3, -11 +}; -/* hidden layer */ --0.0941125f, -0.302976f, -0.603555f, -0.19393f, -0.185983f, --0.601617f, -0.0465317f, -0.114563f, -0.103599f, -0.618938f, --0.317859f, -0.169949f, -0.0702885f, 0.148065f, 0.409524f, -0.548432f, 0.367649f, -0.494393f, 0.764306f, -1.83957f, -0.170849f, 12.786f, -1.08848f, -1.27284f, -16.2606f, -24.1773f, -5.57454f, -0.17276f, -0.163388f, -0.224421f, --0.0948944f, -0.0728695f, -0.26557f, -0.100283f, -0.0515459f, --0.146142f, -0.120674f, -0.180655f, 0.12857f, 0.442138f, --0.493735f, 0.167767f, 0.206699f, -0.197567f, 0.417999f, -1.50364f, -0.773341f, -10.0401f, 0.401872f, 2.97966f, -15.2165f, -1.88905f, -1.19254f, 0.0285397f, -0.00405139f, -0.0707565f, 0.00825699f, -0.0927269f, -0.010393f, -0.00428882f, --0.00489743f, -0.0709731f, -0.00255992f, 0.0395619f, 0.226424f, -0.0325231f, 0.162175f, -0.100118f, 0.485789f, 0.12697f, -0.285937f, 0.0155637f, 0.10546f, 3.05558f, 1.15059f, --1.00904f, -1.83088f, 3.31766f, -3.42516f, -0.119135f, --0.0405654f, 0.00690068f, 0.0179877f, -0.0382487f, 0.00597941f, --0.0183611f, 0.00190395f, -0.144322f, -0.0435671f, 0.000990594f, -0.221087f, 0.142405f, 0.484066f, 0.404395f, 0.511955f, --0.237255f, 0.241742f, 0.35045f, -0.699428f, 10.3993f, -2.6507f, -2.43459f, -4.18838f, 1.05928f, 1.71067f, -0.00667811f, -0.0721335f, -0.0397346f, 0.0362704f, -0.11496f, --0.0235776f, 0.0082161f, -0.0141741f, -0.0329699f, -0.0354253f, -0.00277404f, -0.290654f, -1.14767f, -0.319157f, -0.686544f, -0.36897f, 0.478899f, 0.182579f, -0.411069f, 0.881104f, --4.60683f, 1.4697f, 0.335845f, -1.81905f, -30.1699f, -5.55225f, 0.0019508f, -0.123576f, -0.0727332f, -0.0641597f, --0.0534458f, -0.108166f, -0.0937368f, -0.0697883f, -0.0275475f, --0.192309f, -0.110074f, 0.285375f, -0.405597f, 0.0926724f, --0.287881f, -0.851193f, -0.099493f, -0.233764f, -1.2852f, -1.13611f, 3.12168f, -0.0699f, -1.86216f, 2.65292f, --7.31036f, 2.44776f, -0.00111802f, -0.0632786f, -0.0376296f, --0.149851f, 0.142963f, 0.184368f, 0.123433f, 0.0756158f, -0.117312f, 0.0933395f, 0.0692163f, 0.0842592f, 0.0704683f, -0.0589963f, 0.0942205f, -0.448862f, 0.0262677f, 0.270352f, --0.262317f, 0.172586f, 2.00227f, -0.159216f, 0.038422f, -10.2073f, 4.15536f, -2.3407f, -0.0550265f, 0.00964792f, --0.141336f, 0.0274501f, 0.0343921f, -0.0487428f, 0.0950172f, --0.00775017f, -0.0372492f, -0.00548121f, -0.0663695f, 0.0960506f, --0.200008f, -0.0412827f, 0.58728f, 0.0515787f, 0.337254f, -0.855024f, 0.668371f, -0.114904f, -3.62962f, -0.467477f, --0.215472f, 2.61537f, 0.406117f, -1.36373f, 0.0425394f, -0.12208f, 0.0934502f, 0.123055f, 0.0340935f, -0.142466f, -0.035037f, -0.0490666f, 0.0733208f, 0.0576672f, 0.123984f, --0.0517194f, -0.253018f, 0.590565f, 0.145849f, 0.315185f, -0.221534f, -0.149081f, 0.216161f, -0.349575f, 24.5664f, --0.994196f, 0.614289f, -18.7905f, -2.83277f, -0.716801f, --0.347201f, 0.479515f, -0.246027f, 0.0758683f, 0.137293f, --0.17781f, 0.118751f, -0.00108329f, -0.237334f, 0.355732f, --0.12991f, -0.0547627f, -0.318576f, -0.325524f, 0.180494f, --0.0625604f, 0.141219f, 0.344064f, 0.37658f, -0.591772f, -5.8427f, -0.38075f, 0.221894f, -1.41934f, -1.87943e+06f, -1.34114f, 0.0283355f, -0.0447856f, -0.0211466f, -0.0256927f, -0.0139618f, 0.0207934f, -0.0107666f, 0.0110969f, 0.0586069f, --0.0253545f, -0.0328433f, 0.11872f, -0.216943f, 0.145748f, -0.119808f, -0.0915211f, -0.120647f, -0.0787719f, -0.143644f, --0.595116f, -1.152f, -1.25335f, -1.17092f, 4.34023f, --975268.f, -1.37033f, -0.0401123f, 0.210602f, -0.136656f, -0.135962f, -0.0523293f, 0.0444604f, 0.0143928f, 0.00412666f, --0.0193003f, 0.218452f, -0.110204f, -2.02563f, 0.918238f, --2.45362f, 1.19542f, -0.061362f, -1.92243f, 0.308111f, -0.49764f, 0.912356f, 0.209272f, -2.34525f, 2.19326f, --6.47121f, 1.69771f, -0.725123f, 0.0118929f, 0.0377944f, -0.0554003f, 0.0226452f, -0.0704421f, -0.0300309f, 0.0122978f, --0.0041782f, -0.0686612f, 0.0313115f, 0.039111f, 0.364111f, --0.0945548f, 0.0229876f, -0.17414f, 0.329795f, 0.114714f, -0.30022f, 0.106997f, 0.132355f, 5.79932f, 0.908058f, --0.905324f, -3.3561f, 0.190647f, 0.184211f, -0.673648f, -0.231807f, -0.0586222f, 0.230752f, -0.438277f, 0.245857f, --0.17215f, 0.0876383f, -0.720512f, 0.162515f, 0.0170571f, -0.101781f, 0.388477f, 1.32931f, 1.08548f, -0.936301f, --2.36958f, -6.71988f, -3.44376f, 2.13818f, 14.2318f, -4.91459f, -3.09052f, -9.69191f, -0.768234f, 1.79604f, -0.0549653f, 0.163399f, 0.0797025f, 0.0343933f, -0.0555876f, --0.00505673f, 0.0187258f, 0.0326628f, 0.0231486f, 0.15573f, -0.0476223f, -0.254824f, 1.60155f, -0.801221f, 2.55496f, -0.737629f, -1.36249f, -0.695463f, -2.44301f, -1.73188f, -3.95279f, 1.89068f, 0.486087f, -11.3343f, 3.9416e+06f, +static const opus_int8 layer2_weights[48] = { + -113, -88, 31, -128, -126, -61, 85, -35, + 118, -128, -61, 127, -128, -17, -128, 127, + 104, -9, -128, 33, 45, 127, 5, 83, + 84, -128, -85, -128, -45, 48, -53, -128, + 46, 127, -17, 125, 117, -41, -117, -91, + -127, -68, -1, -89, -80, 32, 106, 7 +}; -/* output layer */ --0.381439f, 0.12115f, -0.906927f, 2.93878f, 1.6388f, -0.882811f, 0.874344f, 1.21726f, -0.874545f, 0.321706f, -0.785055f, 0.946558f, -0.575066f, -3.46553f, 0.884905f, -0.0924047f, -9.90712f, 0.391338f, 0.160103f, -2.04954f, -4.1455f, 0.0684029f, -0.144761f, -0.285282f, 0.379244f, --1.1584f, -0.0277241f, -9.85f, -4.82386f, 3.71333f, -3.87308f, 3.52558f}; +static const opus_int8 layer2_bias[2] = { + 14, 117 +}; -static const int topo[3] = {25, 15, 2}; +const DenseLayer layer0 = { + layer0_bias, + layer0_weights, + 25, 32, 0 +}; -const MLP net = { - 3, - topo, - weights +const GRULayer layer1 = { + layer1_bias, + layer1_weights, + layer1_recur_weights, + 32, 24 }; + +const DenseLayer layer2 = { + layer2_bias, + layer2_weights, + 24, 2, 1 +}; + diff --git a/thirdparty/opus/opus.c b/thirdparty/opus/opus.c index f76f125cfa..538b5ea74e 100644 --- a/thirdparty/opus/opus.c +++ b/thirdparty/opus/opus.c @@ -107,7 +107,7 @@ OPUS_EXPORT void opus_pcm_soft_clip(float *_x, int N, int C, float *declip_mem) /* Slightly boost "a" by 2^-22. This is just enough to ensure -ffast-math does not cause output values larger than +/-1, but small enough not to matter even for 24-bit output. */ - a += a*2.4e-7; + a += a*2.4e-7f; if (x[i*C]>0) a = -a; /* Apply soft clipping */ @@ -252,7 +252,7 @@ int opus_packet_parse_impl(const unsigned char *data, opus_int32 len, /* Number of frames encoded in bits 0 to 5 */ ch = *data++; count = ch&0x3F; - if (count <= 0 || framesize*count > 5760) + if (count <= 0 || framesize*(opus_int32)count > 5760) return OPUS_INVALID_PACKET; len--; /* Padding flag is bit 6 */ diff --git a/thirdparty/opus/opus/opus.h b/thirdparty/opus/opus/opus.h index 5be73ddf4e..d282f21d25 100644 --- a/thirdparty/opus/opus/opus.h +++ b/thirdparty/opus/opus/opus.h @@ -531,7 +531,7 @@ OPUS_EXPORT int opus_packet_parse( const unsigned char *frames[48], opus_int16 size[48], int *payload_offset -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5); /** Gets the bandwidth of an Opus packet. * @param [in] data <tt>char*</tt>: Opus packet diff --git a/thirdparty/opus/opus/opus_defines.h b/thirdparty/opus/opus/opus_defines.h index 315412dd1d..d141418b21 100644 --- a/thirdparty/opus/opus/opus_defines.h +++ b/thirdparty/opus/opus/opus_defines.h @@ -165,8 +165,13 @@ extern "C" { #define OPUS_GET_EXPERT_FRAME_DURATION_REQUEST 4041 #define OPUS_SET_PREDICTION_DISABLED_REQUEST 4042 #define OPUS_GET_PREDICTION_DISABLED_REQUEST 4043 - /* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ +#define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046 +#define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047 +#define OPUS_GET_IN_DTX_REQUEST 4049 + +/** Defines for the presence of extended APIs. */ +#define OPUS_HAVE_OPUS_PROJECTION_H /* Macros to trigger compilation errors when the wrong types are provided to a CTL */ #define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) @@ -208,6 +213,9 @@ extern "C" { #define OPUS_FRAMESIZE_20_MS 5004 /**< Use 20 ms frames */ #define OPUS_FRAMESIZE_40_MS 5005 /**< Use 40 ms frames */ #define OPUS_FRAMESIZE_60_MS 5006 /**< Use 60 ms frames */ +#define OPUS_FRAMESIZE_80_MS 5007 /**< Use 80 ms frames */ +#define OPUS_FRAMESIZE_100_MS 5008 /**< Use 100 ms frames */ +#define OPUS_FRAMESIZE_120_MS 5009 /**< Use 120 ms frames */ /**@}*/ @@ -566,7 +574,9 @@ extern "C" { * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> - * <dt>OPUS_FRAMESIZE_VARIABLE</dt><dd>Optimize the frame size dynamically.</dd> + * <dt>OPUS_FRAMESIZE_80_MS</dt><dd>Use 80 ms frames.</dd> + * <dt>OPUS_FRAMESIZE_100_MS</dt><dd>Use 100 ms frames.</dd> + * <dt>OPUS_FRAMESIZE_120_MS</dt><dd>Use 120 ms frames.</dd> * </dl> * @hideinitializer */ #define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int(x) @@ -581,7 +591,9 @@ extern "C" { * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> - * <dt>OPUS_FRAMESIZE_VARIABLE</dt><dd>Optimize the frame size dynamically.</dd> + * <dt>OPUS_FRAMESIZE_80_MS</dt><dd>Use 80 ms frames.</dd> + * <dt>OPUS_FRAMESIZE_100_MS</dt><dd>Use 100 ms frames.</dd> + * <dt>OPUS_FRAMESIZE_120_MS</dt><dd>Use 120 ms frames.</dd> * </dl> * @hideinitializer */ #define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int_ptr(x) @@ -681,6 +693,40 @@ extern "C" { */ #define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) +/** If set to 1, disables the use of phase inversion for intensity stereo, + * improving the quality of mono downmixes, but slightly reducing normal + * stereo quality. Disabling phase inversion in the decoder does not comply + * with RFC 6716, although it does not cause any interoperability issue and + * is expected to become part of the Opus standard once RFC 6716 is updated + * by draft-ietf-codec-opus-update. + * @see OPUS_GET_PHASE_INVERSION_DISABLED + * @param[in] x <tt>opus_int32</tt>: Allowed values: + * <dl> + * <dt>0</dt><dd>Enable phase inversion (default).</dd> + * <dt>1</dt><dd>Disable phase inversion.</dd> + * </dl> + * @hideinitializer */ +#define OPUS_SET_PHASE_INVERSION_DISABLED(x) OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured phase inversion status. + * @see OPUS_SET_PHASE_INVERSION_DISABLED + * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: + * <dl> + * <dt>0</dt><dd>Stereo phase inversion enabled (default).</dd> + * <dt>1</dt><dd>Stereo phase inversion disabled.</dd> + * </dl> + * @hideinitializer */ +#define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int_ptr(x) +/** Gets the DTX state of the encoder. + * Returns whether the last encoded frame was either a comfort noise update + * during DTX or not encoded because of DTX. + * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: + * <dl> + * <dt>0</dt><dd>The encoder is not in DTX.</dd> + * <dt>1</dt><dd>The encoder is in DTX.</dd> + * </dl> + * @hideinitializer */ +#define OPUS_GET_IN_DTX(x) OPUS_GET_IN_DTX_REQUEST, __opus_check_int_ptr(x) + /**@}*/ /** @defgroup opus_decoderctls Decoder related CTLs diff --git a/thirdparty/opus/opus/opus_multistream.h b/thirdparty/opus/opus/opus_multistream.h index 3622e009fb..babcee6905 100644 --- a/thirdparty/opus/opus/opus_multistream.h +++ b/thirdparty/opus/opus/opus_multistream.h @@ -273,7 +273,7 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_enc unsigned char *mapping, int application, int *error -) OPUS_ARG_NONNULL(5); +) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6); /** Initialize a previously allocated multistream encoder state. * The memory pointed to by \a st must be at least the size returned by @@ -342,7 +342,7 @@ OPUS_EXPORT int opus_multistream_surround_encoder_init( int *coupled_streams, unsigned char *mapping, int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6) OPUS_ARG_NONNULL(7); /** Encodes a multistream Opus frame. * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. diff --git a/thirdparty/opus/opus/opus_projection.h b/thirdparty/opus/opus/opus_projection.h new file mode 100644 index 0000000000..9dabf4e85c --- /dev/null +++ b/thirdparty/opus/opus/opus_projection.h @@ -0,0 +1,568 @@ +/* Copyright (c) 2017 Google Inc. + Written by Andrew Allen */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus_projection.h + * @brief Opus projection reference API + */ + +#ifndef OPUS_PROJECTION_H +#define OPUS_PROJECTION_H + +#include "opus_multistream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @cond OPUS_INTERNAL_DOC */ + +/** These are the actual encoder and decoder CTL ID numbers. + * They should not be used directly by applications.c + * In general, SETs should be even and GETs should be odd.*/ +/**@{*/ +#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST 6001 +#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST 6003 +#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST 6005 +/**@}*/ + + +/** @endcond */ + +/** @defgroup opus_projection_ctls Projection specific encoder and decoder CTLs + * + * These are convenience macros that are specific to the + * opus_projection_encoder_ctl() and opus_projection_decoder_ctl() + * interface. + * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, + * @ref opus_decoderctls, and @ref opus_multistream_ctls may be applied to a + * projection encoder or decoder as well. + */ +/**@{*/ + +/** Gets the gain (in dB. S7.8-format) of the demixing matrix from the encoder. + * @param[out] x <tt>opus_int32 *</tt>: Returns the gain (in dB. S7.8-format) + * of the demixing matrix. + * @hideinitializer + */ +#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST, __opus_check_int_ptr(x) + + +/** Gets the size in bytes of the demixing matrix from the encoder. + * @param[out] x <tt>opus_int32 *</tt>: Returns the size in bytes of the + * demixing matrix. + * @hideinitializer + */ +#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST, __opus_check_int_ptr(x) + + +/** Copies the demixing matrix to the supplied pointer location. + * @param[out] x <tt>unsigned char *</tt>: Returns the demixing matrix to the + * supplied pointer location. + * @param y <tt>opus_int32</tt>: The size in bytes of the reserved memory at the + * pointer location. + * @hideinitializer + */ +#define OPUS_PROJECTION_GET_DEMIXING_MATRIX(x,y) OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST, x, __opus_check_int(y) + + +/**@}*/ + +/** Opus projection encoder state. + * This contains the complete state of a projection Opus encoder. + * It is position independent and can be freely copied. + * @see opus_projection_ambisonics_encoder_create + */ +typedef struct OpusProjectionEncoder OpusProjectionEncoder; + + +/** Opus projection decoder state. + * This contains the complete state of a projection Opus decoder. + * It is position independent and can be freely copied. + * @see opus_projection_decoder_create + * @see opus_projection_decoder_init + */ +typedef struct OpusProjectionDecoder OpusProjectionDecoder; + + +/**\name Projection encoder functions */ +/**@{*/ + +/** Gets the size of an OpusProjectionEncoder structure. + * @param channels <tt>int</tt>: The total number of input channels to encode. + * This must be no more than 255. + * @param mapping_family <tt>int</tt>: The mapping family to use for selecting + * the appropriate projection. + * @returns The size in bytes on success, or a negative error code + * (see @ref opus_errorcodes) on error. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_ambisonics_encoder_get_size( + int channels, + int mapping_family +); + + +/** Allocates and initializes a projection encoder state. + * Call opus_projection_encoder_destroy() to release + * this object when finished. + * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels <tt>int</tt>: Number of channels in the input signal. + * This must be at most 255. + * It may be greater than the number of + * coded channels (<code>streams + + * coupled_streams</code>). + * @param mapping_family <tt>int</tt>: The mapping family to use for selecting + * the appropriate projection. + * @param[out] streams <tt>int *</tt>: The total number of streams that will + * be encoded from the input. + * @param[out] coupled_streams <tt>int *</tt>: Number of coupled (2 channel) + * streams that will be encoded from the input. + * @param application <tt>int</tt>: The target encoder application. + * This must be one of the following: + * <dl> + * <dt>#OPUS_APPLICATION_VOIP</dt> + * <dd>Process signal for improved speech intelligibility.</dd> + * <dt>#OPUS_APPLICATION_AUDIO</dt> + * <dd>Favor faithfulness to the original input.</dd> + * <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> + * <dd>Configure the minimum possible coding delay by disabling certain modes + * of operation.</dd> + * </dl> + * @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error + * code (see @ref opus_errorcodes) on + * failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionEncoder *opus_projection_ambisonics_encoder_create( + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + int application, + int *error +) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5); + + +/** Initialize a previously allocated projection encoder state. + * The memory pointed to by \a st must be at least the size returned by + * opus_projection_ambisonics_encoder_get_size(). + * This is intended for applications which use their own allocator instead of + * malloc. + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @see opus_projection_ambisonics_encoder_create + * @see opus_projection_ambisonics_encoder_get_size + * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state to initialize. + * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels <tt>int</tt>: Number of channels in the input signal. + * This must be at most 255. + * It may be greater than the number of + * coded channels (<code>streams + + * coupled_streams</code>). + * @param streams <tt>int</tt>: The total number of streams to encode from the + * input. + * This must be no more than the number of channels. + * @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (<code>streams + + * coupled_streams</code>) must be no + * more than the number of input channels. + * @param application <tt>int</tt>: The target encoder application. + * This must be one of the following: + * <dl> + * <dt>#OPUS_APPLICATION_VOIP</dt> + * <dd>Process signal for improved speech intelligibility.</dd> + * <dt>#OPUS_APPLICATION_AUDIO</dt> + * <dd>Favor faithfulness to the original input.</dd> + * <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> + * <dd>Configure the minimum possible coding delay by disabling certain modes + * of operation.</dd> + * </dl> + * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) + * on failure. + */ +OPUS_EXPORT int opus_projection_ambisonics_encoder_init( + OpusProjectionEncoder *st, + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + int application +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6); + + +/** Encodes a projection Opus frame. + * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state. + * @param[in] pcm <tt>const opus_int16*</tt>: The input signal as interleaved + * samples. + * This must contain + * <code>frame_size*channels</code> + * samples. + * @param frame_size <tt>int</tt>: Number of samples per channel in the input + * signal. + * This must be an Opus frame size for the + * encoder's sampling rate. + * For example, at 48 kHz the permitted values + * are 120, 240, 480, 960, 1920, and 2880. + * Passing in a duration of less than 10 ms + * (480 samples at 48 kHz) will prevent the + * encoder from using the LPC or hybrid modes. + * @param[out] data <tt>unsigned char*</tt>: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode( + OpusProjectionEncoder *st, + const opus_int16 *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + + +/** Encodes a projection Opus frame from floating point input. + * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state. + * @param[in] pcm <tt>const float*</tt>: The input signal as interleaved + * samples with a normal range of + * +/-1.0. + * Samples with a range beyond +/-1.0 + * are supported but will be clipped by + * decoders using the integer API and + * should only be used if it is known + * that the far end supports extended + * dynamic range. + * This must contain + * <code>frame_size*channels</code> + * samples. + * @param frame_size <tt>int</tt>: Number of samples per channel in the input + * signal. + * This must be an Opus frame size for the + * encoder's sampling rate. + * For example, at 48 kHz the permitted values + * are 120, 240, 480, 960, 1920, and 2880. + * Passing in a duration of less than 10 ms + * (480 samples at 48 kHz) will prevent the + * encoder from using the LPC or hybrid modes. + * @param[out] data <tt>unsigned char*</tt>: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode_float( + OpusProjectionEncoder *st, + const float *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + + +/** Frees an <code>OpusProjectionEncoder</code> allocated by + * opus_projection_ambisonics_encoder_create(). + * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state to be freed. + */ +OPUS_EXPORT void opus_projection_encoder_destroy(OpusProjectionEncoder *st); + + +/** Perform a CTL function on a projection Opus encoder. + * + * Generally the request and subsequent arguments are generated by a + * convenience macro. + * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls, + * @ref opus_encoderctls, @ref opus_multistream_ctls, or + * @ref opus_projection_ctls + * @see opus_genericctls + * @see opus_encoderctls + * @see opus_multistream_ctls + * @see opus_projection_ctls + */ +OPUS_EXPORT int opus_projection_encoder_ctl(OpusProjectionEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); + + +/**@}*/ + +/**\name Projection decoder functions */ +/**@{*/ + +/** Gets the size of an <code>OpusProjectionDecoder</code> structure. + * @param channels <tt>int</tt>: The total number of output channels. + * This must be no more than 255. + * @param streams <tt>int</tt>: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams <tt>int</tt>: Number streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (<code>streams + + * coupled_streams</code>) must be no + * more than 255. + * @returns The size in bytes on success, or a negative error code + * (see @ref opus_errorcodes) on error. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_decoder_get_size( + int channels, + int streams, + int coupled_streams +); + + +/** Allocates and initializes a projection decoder state. + * Call opus_projection_decoder_destroy() to release + * this object when finished. + * @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels <tt>int</tt>: Number of channels to output. + * This must be at most 255. + * It may be different from the number of coded + * channels (<code>streams + + * coupled_streams</code>). + * @param streams <tt>int</tt>: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (<code>streams + + * coupled_streams</code>) must be no + * more than 255. + * @param[in] demixing_matrix <tt>const unsigned char[demixing_matrix_size]</tt>: Demixing matrix + * that mapping from coded channels to output channels, + * as described in @ref opus_projection and + * @ref opus_projection_ctls. + * @param demixing_matrix_size <tt>opus_int32</tt>: The size in bytes of the + * demixing matrix, as + * described in @ref + * opus_projection_ctls. + * @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error + * code (see @ref opus_errorcodes) on + * failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionDecoder *opus_projection_decoder_create( + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + unsigned char *demixing_matrix, + opus_int32 demixing_matrix_size, + int *error +) OPUS_ARG_NONNULL(5); + + +/** Intialize a previously allocated projection decoder state object. + * The memory pointed to by \a st must be at least the size returned by + * opus_projection_decoder_get_size(). + * This is intended for applications which use their own allocator instead of + * malloc. + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @see opus_projection_decoder_create + * @see opus_projection_deocder_get_size + * @param st <tt>OpusProjectionDecoder*</tt>: Projection encoder state to initialize. + * @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels <tt>int</tt>: Number of channels to output. + * This must be at most 255. + * It may be different from the number of coded + * channels (<code>streams + + * coupled_streams</code>). + * @param streams <tt>int</tt>: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (<code>streams + + * coupled_streams</code>) must be no + * more than 255. + * @param[in] demixing_matrix <tt>const unsigned char[demixing_matrix_size]</tt>: Demixing matrix + * that mapping from coded channels to output channels, + * as described in @ref opus_projection and + * @ref opus_projection_ctls. + * @param demixing_matrix_size <tt>opus_int32</tt>: The size in bytes of the + * demixing matrix, as + * described in @ref + * opus_projection_ctls. + * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) + * on failure. + */ +OPUS_EXPORT int opus_projection_decoder_init( + OpusProjectionDecoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + unsigned char *demixing_matrix, + opus_int32 demixing_matrix_size +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + + +/** Decode a projection Opus packet. + * @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state. + * @param[in] data <tt>const unsigned char*</tt>: Input payload. + * Use a <code>NULL</code> + * pointer to indicate packet + * loss. + * @param len <tt>opus_int32</tt>: Number of bytes in payload. + * @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved + * samples. + * This must contain room for + * <code>frame_size*channels</code> + * samples. + * @param frame_size <tt>int</tt>: The number of samples per channel of + * available space in \a pcm. + * If this is less than the maximum packet duration + * (120 ms; 5760 for 48kHz), this function will not be capable + * of decoding some packets. In the case of PLC (data==NULL) + * or FEC (decode_fec=1), then frame_size needs to be exactly + * the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the + * next incoming packet. For the PLC and FEC cases, frame_size + * <b>must</b> be a multiple of 2.5 ms. + * @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band + * forward error correction data be decoded. + * If no such data is available, the frame is + * decoded as if it were lost. + * @returns Number of samples decoded on success or a negative error code + * (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode( + OpusProjectionDecoder *st, + const unsigned char *data, + opus_int32 len, + opus_int16 *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + + +/** Decode a projection Opus packet with floating point output. + * @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state. + * @param[in] data <tt>const unsigned char*</tt>: Input payload. + * Use a <code>NULL</code> + * pointer to indicate packet + * loss. + * @param len <tt>opus_int32</tt>: Number of bytes in payload. + * @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved + * samples. + * This must contain room for + * <code>frame_size*channels</code> + * samples. + * @param frame_size <tt>int</tt>: The number of samples per channel of + * available space in \a pcm. + * If this is less than the maximum packet duration + * (120 ms; 5760 for 48kHz), this function will not be capable + * of decoding some packets. In the case of PLC (data==NULL) + * or FEC (decode_fec=1), then frame_size needs to be exactly + * the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the + * next incoming packet. For the PLC and FEC cases, frame_size + * <b>must</b> be a multiple of 2.5 ms. + * @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band + * forward error correction data be decoded. + * If no such data is available, the frame is + * decoded as if it were lost. + * @returns Number of samples decoded on success or a negative error code + * (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode_float( + OpusProjectionDecoder *st, + const unsigned char *data, + opus_int32 len, + float *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + + +/** Perform a CTL function on a projection Opus decoder. + * + * Generally the request and subsequent arguments are generated by a + * convenience macro. + * @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls, + * @ref opus_decoderctls, @ref opus_multistream_ctls, or + * @ref opus_projection_ctls. + * @see opus_genericctls + * @see opus_decoderctls + * @see opus_multistream_ctls + * @see opus_projection_ctls + */ +OPUS_EXPORT int opus_projection_decoder_ctl(OpusProjectionDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); + + +/** Frees an <code>OpusProjectionDecoder</code> allocated by + * opus_projection_decoder_create(). + * @param st <tt>OpusProjectionDecoder</tt>: Projection decoder state to be freed. + */ +OPUS_EXPORT void opus_projection_decoder_destroy(OpusProjectionDecoder *st); + + +/**@}*/ + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_PROJECTION_H */ diff --git a/thirdparty/opus/opus/opus_types.h b/thirdparty/opus/opus/opus_types.h index b28e03aea2..7cf675580f 100644 --- a/thirdparty/opus/opus/opus_types.h +++ b/thirdparty/opus/opus/opus_types.h @@ -33,14 +33,29 @@ #ifndef OPUS_TYPES_H #define OPUS_TYPES_H +#define opus_int int /* used for counters etc; at least 16 bits */ +#define opus_int64 long long +#define opus_int8 signed char + +#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ +#define opus_uint64 unsigned long long +#define opus_uint8 unsigned char + /* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ -#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) +#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) #include <stdint.h> - +# undef opus_int64 +# undef opus_int8 +# undef opus_uint64 +# undef opus_uint8 + typedef int8_t opus_int8; + typedef uint8_t opus_uint8; typedef int16_t opus_int16; typedef uint16_t opus_uint16; typedef int32_t opus_int32; typedef uint32_t opus_uint32; + typedef int64_t opus_int64; + typedef uint64_t opus_uint64; #elif defined(_WIN32) # if defined(__CYGWIN__) @@ -148,12 +163,4 @@ #endif -#define opus_int int /* used for counters etc; at least 16 bits */ -#define opus_int64 long long -#define opus_int8 signed char - -#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ -#define opus_uint64 unsigned long long -#define opus_uint8 unsigned char - #endif /* OPUS_TYPES_H */ diff --git a/thirdparty/opus/opus/opusfile.h b/thirdparty/opus/opus/opusfile.h index 4bf2fba926..e3a3dc8389 100644 --- a/thirdparty/opus/opus/opusfile.h +++ b/thirdparty/opus/opus/opusfile.h @@ -239,7 +239,8 @@ struct OpusHead{ -32768...32767. The <tt>libopusfile</tt> API will automatically apply this gain to the decoded output before returning it, scaling it by - <code>pow(10,output_gain/(20.0*256))</code>.*/ + <code>pow(10,output_gain/(20.0*256))</code>. + You can adjust this behavior with op_set_gain_offset().*/ int output_gain; /**The channel mapping family, in the range 0...255. Channel mapping family 0 covers mono or stereo in a single stream. @@ -1154,16 +1155,18 @@ OP_WARN_UNUSED_RESULT OggOpusFile *op_open_url(const char *_url, int *_error,...) OP_ARG_NONNULL(1); /**Open a stream using the given set of callbacks to access it. - \param _source The stream to read from (e.g., a <code>FILE *</code>). + \param _stream The stream to read from (e.g., a <code>FILE *</code>). + This value will be passed verbatim as the first + argument to all of the callbacks. \param _cb The callbacks with which to access the stream. <code><a href="#op_read_func">read()</a></code> must be implemented. <code><a href="#op_seek_func">seek()</a></code> and <code><a href="#op_tell_func">tell()</a></code> may be <code>NULL</code>, or may always return -1 to - indicate a source is unseekable, but if + indicate a stream is unseekable, but if <code><a href="#op_seek_func">seek()</a></code> is - implemented and succeeds on a particular source, then + implemented and succeeds on a particular stream, then <code><a href="#op_tell_func">tell()</a></code> must also. <code><a href="#op_close_func">close()</a></code> may @@ -1226,11 +1229,11 @@ OP_WARN_UNUSED_RESULT OggOpusFile *op_open_url(const char *_url, basic validity checks.</dd> </dl> \return A freshly opened \c OggOpusFile, or <code>NULL</code> on error. - <tt>libopusfile</tt> does <em>not</em> take ownership of the source + <tt>libopusfile</tt> does <em>not</em> take ownership of the stream if the call fails. - The calling application is responsible for closing the source if + The calling application is responsible for closing the stream if this call returns an error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_open_callbacks(void *_source, +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_callbacks(void *_stream, const OpusFileCallbacks *_cb,const unsigned char *_initial_data, size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); @@ -1332,18 +1335,20 @@ OP_WARN_UNUSED_RESULT OggOpusFile *op_test_url(const char *_url, For new code, you are likely better off using op_test() instead, which is less resource-intensive, requires less data to succeed, and imposes a hard limit on the amount of data it examines (important for unseekable - sources, where all such data must be buffered until you are sure of the + streams, where all such data must be buffered until you are sure of the stream type). - \param _source The stream to read from (e.g., a <code>FILE *</code>). + \param _stream The stream to read from (e.g., a <code>FILE *</code>). + This value will be passed verbatim as the first + argument to all of the callbacks. \param _cb The callbacks with which to access the stream. <code><a href="#op_read_func">read()</a></code> must be implemented. <code><a href="#op_seek_func">seek()</a></code> and <code><a href="#op_tell_func">tell()</a></code> may be <code>NULL</code>, or may always return -1 to - indicate a source is unseekable, but if + indicate a stream is unseekable, but if <code><a href="#op_seek_func">seek()</a></code> is - implemented and succeeds on a particular source, then + implemented and succeeds on a particular stream, then <code><a href="#op_tell_func">tell()</a></code> must also. <code><a href="#op_close_func">close()</a></code> may @@ -1373,11 +1378,11 @@ OP_WARN_UNUSED_RESULT OggOpusFile *op_test_url(const char *_url, See op_open_callbacks() for a full list of failure codes. \return A partially opened \c OggOpusFile, or <code>NULL</code> on error. - <tt>libopusfile</tt> does <em>not</em> take ownership of the source + <tt>libopusfile</tt> does <em>not</em> take ownership of the stream if the call fails. - The calling application is responsible for closing the source if + The calling application is responsible for closing the stream if this call returns an error.*/ -OP_WARN_UNUSED_RESULT OggOpusFile *op_test_callbacks(void *_source, +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_callbacks(void *_stream, const OpusFileCallbacks *_cb,const unsigned char *_initial_data, size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); @@ -1434,7 +1439,7 @@ void op_free(OggOpusFile *_of); Their documention will indicate so explicitly.*/ /*@{*/ -/**Returns whether or not the data source being read is seekable. +/**Returns whether or not the stream being read is seekable. This is true if <ol> <li>The <code><a href="#op_seek_func">seek()</a></code> and @@ -1455,9 +1460,9 @@ int op_seekable(const OggOpusFile *_of) OP_ARG_NONNULL(1); return 1. The actual number of links is not known until the stream is fully opened. \param _of The \c OggOpusFile from which to retrieve the link count. - \return For fully-open seekable sources, this returns the total number of + \return For fully-open seekable streams, this returns the total number of links in the whole stream, which will be at least 1. - For partially-open or unseekable sources, this always returns 1.*/ + For partially-open or unseekable streams, this always returns 1.*/ int op_link_count(const OggOpusFile *_of) OP_ARG_NONNULL(1); /**Get the serial number of the given link in a (possibly-chained) Ogg Opus @@ -1471,7 +1476,7 @@ int op_link_count(const OggOpusFile *_of) OP_ARG_NONNULL(1); \return The serial number of the given link. If \a _li is greater than the total number of links, this returns the serial number of the last link. - If the source is not seekable, this always returns the serial number + If the stream is not seekable, this always returns the serial number of the current link.*/ opus_uint32 op_serialno(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); @@ -1488,7 +1493,7 @@ opus_uint32 op_serialno(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); \return The channel count of the given link. If \a _li is greater than the total number of links, this returns the channel count of the last link. - If the source is not seekable, this always returns the channel count + If the stream is not seekable, this always returns the channel count of the current link.*/ int op_channel_count(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); @@ -1507,9 +1512,9 @@ int op_channel_count(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); compressed size of link \a _li if it is non-negative, or a negative value on error. The compressed size of the entire stream may be smaller than that - of the underlying source if trailing garbage was detected in the + of the underlying stream if trailing garbage was detected in the file. - \retval #OP_EINVAL The source is not seekable (so we can't know the length), + \retval #OP_EINVAL The stream is not seekable (so we can't know the length), \a _li wasn't less than the total number of links in the stream, or the stream was only partially open.*/ opus_int64 op_raw_total(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); @@ -1527,7 +1532,7 @@ opus_int64 op_raw_total(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); \return The PCM length of the entire stream if \a _li is negative, the PCM length of link \a _li if it is non-negative, or a negative value on error. - \retval #OP_EINVAL The source is not seekable (so we can't know the length), + \retval #OP_EINVAL The stream is not seekable (so we can't know the length), \a _li wasn't less than the total number of links in the stream, or the stream was only partially open.*/ ogg_int64_t op_pcm_total(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); @@ -1575,8 +1580,8 @@ const OpusTags *op_tags(const OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); \param _of The \c OggOpusFile from which to retrieve the current link index. \return The index of the current link on success, or a negative value on failure. - For seekable streams, this is a number between 0 and the value - returned by op_link_count(). + For seekable streams, this is a number between 0 (inclusive) and the + value returned by op_link_count() (exclusive). For unseekable streams, this value starts at 0 and increments by one each time a new link is encountered (even though op_link_count() always returns 1). @@ -1640,10 +1645,10 @@ ogg_int64_t op_pcm_tell(const OggOpusFile *_of) OP_ARG_NONNULL(1); /*@{*/ /**\name Functions for seeking in Opus streams - These functions let you seek in Opus streams, if the underlying source + These functions let you seek in Opus streams, if the underlying stream support it. Seeking is implemented for all built-in stream I/O routines, though some - individual sources may not be seekable (pipes, live HTTP streams, or HTTP + individual streams may not be seekable (pipes, live HTTP streams, or HTTP streams from a server that does not support <code>Range</code> requests). op_raw_seek() is the fastest: it is guaranteed to perform at most one @@ -1670,6 +1675,8 @@ ogg_int64_t op_pcm_tell(const OggOpusFile *_of) OP_ARG_NONNULL(1); packets out of the tail of the link to which it seeks. \param _of The \c OggOpusFile in which to seek. \param _byte_offset The byte position to seek to. + This must be between 0 and #op_raw_total(\a _of,\c -1) + (inclusive). \return 0 on success, or a negative error code on failure. \retval #OP_EREAD The underlying seek operation failed. \retval #OP_EINVAL The stream was only partially open, or the target was diff --git a/thirdparty/opus/opus_compare.c b/thirdparty/opus/opus_compare.c index 06c67d752f..1956e08fa5 100644 --- a/thirdparty/opus/opus_compare.c +++ b/thirdparty/opus/opus_compare.c @@ -363,6 +363,9 @@ int main(int _argc,const char **_argv){ Ef*=Ef; err+=Ef*Ef; } + free(xb); + free(X); + free(Y); err=pow(err/nframes,1.0/16); Q=100*(1-0.5*log(1+err)/log(1.13)); if(Q<0){ diff --git a/thirdparty/opus/opus_decoder.c b/thirdparty/opus/opus_decoder.c index 080bec5072..9113638a00 100644 --- a/thirdparty/opus/opus_decoder.c +++ b/thirdparty/opus/opus_decoder.c @@ -78,6 +78,26 @@ struct OpusDecoder { opus_uint32 rangeFinal; }; +#if defined(ENABLE_HARDENING) || defined(ENABLE_ASSERTIONS) +static void validate_opus_decoder(OpusDecoder *st) +{ + celt_assert(st->channels == 1 || st->channels == 2); + celt_assert(st->Fs == 48000 || st->Fs == 24000 || st->Fs == 16000 || st->Fs == 12000 || st->Fs == 8000); + celt_assert(st->DecControl.API_sampleRate == st->Fs); + celt_assert(st->DecControl.internalSampleRate == 0 || st->DecControl.internalSampleRate == 16000 || st->DecControl.internalSampleRate == 12000 || st->DecControl.internalSampleRate == 8000); + celt_assert(st->DecControl.nChannelsAPI == st->channels); + celt_assert(st->DecControl.nChannelsInternal == 0 || st->DecControl.nChannelsInternal == 1 || st->DecControl.nChannelsInternal == 2); + celt_assert(st->DecControl.payloadSize_ms == 0 || st->DecControl.payloadSize_ms == 10 || st->DecControl.payloadSize_ms == 20 || st->DecControl.payloadSize_ms == 40 || st->DecControl.payloadSize_ms == 60); +#ifdef OPUS_ARCHMASK + celt_assert(st->arch >= 0); + celt_assert(st->arch <= OPUS_ARCHMASK); +#endif + celt_assert(st->stream_channels == 1 || st->stream_channels == 2); +} +#define VALIDATE_OPUS_DECODER(st) validate_opus_decoder(st) +#else +#define VALIDATE_OPUS_DECODER(st) +#endif int opus_decoder_get_size(int channels) { @@ -104,7 +124,7 @@ int opus_decoder_init(OpusDecoder *st, opus_int32 Fs, int channels) return OPUS_BAD_ARG; OPUS_CLEAR((char*)st, opus_decoder_get_size(channels)); - /* Initialize SILK encoder */ + /* Initialize SILK decoder */ ret = silk_Get_Decoder_Size(&silkDecSizeBytes); if (ret) return OPUS_INTERNAL_ERROR; @@ -217,6 +237,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, int audiosize; int mode; + int bandwidth; int transition=0; int start_band; int redundancy=0; @@ -253,10 +274,12 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, { audiosize = st->frame_size; mode = st->mode; + bandwidth = st->bandwidth; ec_dec_init(&dec,(unsigned char*)data,len); } else { audiosize = frame_size; mode = st->prev_mode; + bandwidth = 0; if (mode == 0) { @@ -355,15 +378,15 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, { st->DecControl.nChannelsInternal = st->stream_channels; if( mode == MODE_SILK_ONLY ) { - if( st->bandwidth == OPUS_BANDWIDTH_NARROWBAND ) { + if( bandwidth == OPUS_BANDWIDTH_NARROWBAND ) { st->DecControl.internalSampleRate = 8000; - } else if( st->bandwidth == OPUS_BANDWIDTH_MEDIUMBAND ) { + } else if( bandwidth == OPUS_BANDWIDTH_MEDIUMBAND ) { st->DecControl.internalSampleRate = 12000; - } else if( st->bandwidth == OPUS_BANDWIDTH_WIDEBAND ) { + } else if( bandwidth == OPUS_BANDWIDTH_WIDEBAND ) { st->DecControl.internalSampleRate = 16000; } else { st->DecControl.internalSampleRate = 16000; - silk_assert( 0 ); + celt_assert( 0 ); } } else { /* Hybrid mode */ @@ -427,10 +450,26 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, if (mode != MODE_CELT_ONLY) start_band = 17; + if (redundancy) + { + transition = 0; + pcm_transition_silk_size=ALLOC_NONE; + } + + ALLOC(pcm_transition_silk, pcm_transition_silk_size, opus_val16); + + if (transition && mode != MODE_CELT_ONLY) + { + pcm_transition = pcm_transition_silk; + opus_decode_frame(st, NULL, 0, pcm_transition, IMIN(F5, audiosize), 0); + } + + + if (bandwidth) { int endband=21; - switch(st->bandwidth) + switch(bandwidth) { case OPUS_BANDWIDTH_NARROWBAND: endband = 13; @@ -445,24 +484,13 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, case OPUS_BANDWIDTH_FULLBAND: endband = 21; break; + default: + celt_assert(0); + break; } - celt_decoder_ctl(celt_dec, CELT_SET_END_BAND(endband)); - celt_decoder_ctl(celt_dec, CELT_SET_CHANNELS(st->stream_channels)); - } - - if (redundancy) - { - transition = 0; - pcm_transition_silk_size=ALLOC_NONE; - } - - ALLOC(pcm_transition_silk, pcm_transition_silk_size, opus_val16); - - if (transition && mode != MODE_CELT_ONLY) - { - pcm_transition = pcm_transition_silk; - opus_decode_frame(st, NULL, 0, pcm_transition, IMIN(F5, audiosize), 0); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, CELT_SET_END_BAND(endband))); } + MUST_SUCCEED(celt_decoder_ctl(celt_dec, CELT_SET_CHANNELS(st->stream_channels))); /* Only allocation memory for redundancy if/when needed */ redundant_audio_size = redundancy ? F5*st->channels : ALLOC_NONE; @@ -471,21 +499,21 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, /* 5 ms redundant frame for CELT->SILK*/ if (redundancy && celt_to_silk) { - celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0)); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0))); celt_decode_with_ec(celt_dec, data+len, redundancy_bytes, redundant_audio, F5, NULL, 0); - celt_decoder_ctl(celt_dec, OPUS_GET_FINAL_RANGE(&redundant_rng)); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, OPUS_GET_FINAL_RANGE(&redundant_rng))); } /* MUST be after PLC */ - celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(start_band)); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(start_band))); if (mode != MODE_SILK_ONLY) { int celt_frame_size = IMIN(F20, frame_size); /* Make sure to discard any previous CELT state */ if (mode != st->prev_mode && st->prev_mode > 0 && !st->prev_redundancy) - celt_decoder_ctl(celt_dec, OPUS_RESET_STATE); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, OPUS_RESET_STATE)); /* Decode CELT */ celt_ret = celt_decode_with_ec(celt_dec, decode_fec ? NULL : data, len, pcm, celt_frame_size, &dec, celt_accum); @@ -500,7 +528,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, do a fade-out by decoding a silence frame */ if (st->prev_mode == MODE_HYBRID && !(redundancy && celt_to_silk && st->prev_redundancy) ) { - celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0)); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0))); celt_decode_with_ec(celt_dec, silence, 2, pcm, F2_5, NULL, celt_accum); } } @@ -518,18 +546,18 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, { const CELTMode *celt_mode; - celt_decoder_ctl(celt_dec, CELT_GET_MODE(&celt_mode)); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, CELT_GET_MODE(&celt_mode))); window = celt_mode->window; } /* 5 ms redundant frame for SILK->CELT */ if (redundancy && !celt_to_silk) { - celt_decoder_ctl(celt_dec, OPUS_RESET_STATE); - celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0)); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, OPUS_RESET_STATE)); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, CELT_SET_START_BAND(0))); celt_decode_with_ec(celt_dec, data+len, redundancy_bytes, redundant_audio, F5, NULL, 0); - celt_decoder_ctl(celt_dec, OPUS_GET_FINAL_RANGE(&redundant_rng)); + MUST_SUCCEED(celt_decoder_ctl(celt_dec, OPUS_GET_FINAL_RANGE(&redundant_rng))); smooth_fade(pcm+st->channels*(frame_size-F2_5), redundant_audio+st->channels*F2_5, pcm+st->channels*(frame_size-F2_5), F2_5, st->channels, window, st->Fs); } @@ -605,6 +633,7 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data, int packet_frame_size, packet_bandwidth, packet_mode, packet_stream_channels; /* 48 x 2.5 ms = 120 ms */ opus_int16 size[48]; + VALIDATE_OPUS_DECODER(st); if (decode_fec<0 || decode_fec>1) return OPUS_BAD_ARG; /* For FEC/PLC, frame_size has to be to have a multiple of 2.5 ms */ @@ -740,6 +769,7 @@ int opus_decode_float(OpusDecoder *st, const unsigned char *data, else return OPUS_INVALID_PACKET; } + celt_assert(st->channels == 1 || st->channels == 2); ALLOC(out, frame_size*st->channels, opus_int16); ret = opus_decode_native(st, data, len, out, frame_size, decode_fec, 0, NULL, 0); @@ -777,6 +807,7 @@ int opus_decode(OpusDecoder *st, const unsigned char *data, else return OPUS_INVALID_PACKET; } + celt_assert(st->channels == 1 || st->channels == 2); ALLOC(out, frame_size*st->channels, float); ret = opus_decode_native(st, data, len, out, frame_size, decode_fec, 0, NULL, 1); @@ -864,7 +895,7 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...) goto bad_arg; } if (st->prev_mode == MODE_CELT_ONLY) - celt_decoder_ctl(celt_dec, OPUS_GET_PITCH(value)); + ret = celt_decoder_ctl(celt_dec, OPUS_GET_PITCH(value)); else *value = st->DecControl.prevPitchLag; } @@ -891,7 +922,7 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...) break; case OPUS_GET_LAST_PACKET_DURATION_REQUEST: { - opus_uint32 *value = va_arg(ap, opus_uint32*); + opus_int32 *value = va_arg(ap, opus_int32*); if (!value) { goto bad_arg; @@ -899,6 +930,26 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...) *value = st->last_packet_duration; } break; + case OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST: + { + opus_int32 value = va_arg(ap, opus_int32); + if(value<0 || value>1) + { + goto bad_arg; + } + ret = celt_decoder_ctl(celt_dec, OPUS_SET_PHASE_INVERSION_DISABLED(value)); + } + break; + case OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST: + { + opus_int32 *value = va_arg(ap, opus_int32*); + if (!value) + { + goto bad_arg; + } + ret = celt_decoder_ctl(celt_dec, OPUS_GET_PHASE_INVERSION_DISABLED(value)); + } + break; default: /*fprintf(stderr, "unknown opus_decoder_ctl() request: %d", request);*/ ret = OPUS_UNIMPLEMENTED; diff --git a/thirdparty/opus/opus_encoder.c b/thirdparty/opus/opus_encoder.c index 9a516a884a..e98ac5b8d0 100644 --- a/thirdparty/opus/opus_encoder.c +++ b/thirdparty/opus/opus_encoder.c @@ -53,6 +53,10 @@ #define MAX_ENCODER_BUFFER 480 +#ifndef DISABLE_FLOAT_API +#define PSEUDO_SNR_THRESHOLD 316.23f /* 10^(25/10) */ +#endif + typedef struct { opus_val32 XX, XY, YY; opus_val16 smoothed_width; @@ -82,6 +86,7 @@ struct OpusEncoder { int encoder_buffer; int lfe; int arch; + int use_dtx; /* general DTX for both SILK and CELT */ #ifndef DISABLE_FLOAT_API TonalityAnalysisState analysis; #endif @@ -97,6 +102,8 @@ struct OpusEncoder { int prev_channels; int prev_framesize; int bandwidth; + /* Bandwidth determined automatically from the rate (before any other adjustment) */ + int auto_bandwidth; int silk_bw_switch; /* Sampling rate (at the API level) */ int first; @@ -105,7 +112,10 @@ struct OpusEncoder { opus_val16 delay_buffer[MAX_ENCODER_BUFFER*2]; #ifndef DISABLE_FLOAT_API int detected_bandwidth; + int nb_no_activity_frames; + opus_val32 peak_signal_energy; #endif + int nonfinal_frame; /* current frame is not the final in a packet */ opus_uint32 rangeFinal; }; @@ -113,38 +123,46 @@ struct OpusEncoder { middle (memoriless) threshold. The second column is the hysteresis (difference with the middle) */ static const opus_int32 mono_voice_bandwidth_thresholds[8] = { - 11000, 1000, /* NB<->MB */ - 14000, 1000, /* MB<->WB */ - 17000, 1000, /* WB<->SWB */ - 21000, 2000, /* SWB<->FB */ + 9000, 700, /* NB<->MB */ + 9000, 700, /* MB<->WB */ + 13500, 1000, /* WB<->SWB */ + 14000, 2000, /* SWB<->FB */ }; static const opus_int32 mono_music_bandwidth_thresholds[8] = { - 12000, 1000, /* NB<->MB */ - 15000, 1000, /* MB<->WB */ - 18000, 2000, /* WB<->SWB */ - 22000, 2000, /* SWB<->FB */ + 9000, 700, /* NB<->MB */ + 9000, 700, /* MB<->WB */ + 11000, 1000, /* WB<->SWB */ + 12000, 2000, /* SWB<->FB */ }; static const opus_int32 stereo_voice_bandwidth_thresholds[8] = { - 11000, 1000, /* NB<->MB */ - 14000, 1000, /* MB<->WB */ - 21000, 2000, /* WB<->SWB */ - 28000, 2000, /* SWB<->FB */ + 9000, 700, /* NB<->MB */ + 9000, 700, /* MB<->WB */ + 13500, 1000, /* WB<->SWB */ + 14000, 2000, /* SWB<->FB */ }; static const opus_int32 stereo_music_bandwidth_thresholds[8] = { - 12000, 1000, /* NB<->MB */ - 18000, 2000, /* MB<->WB */ - 21000, 2000, /* WB<->SWB */ - 30000, 2000, /* SWB<->FB */ + 9000, 700, /* NB<->MB */ + 9000, 700, /* MB<->WB */ + 11000, 1000, /* WB<->SWB */ + 12000, 2000, /* SWB<->FB */ }; /* Threshold bit-rates for switching between mono and stereo */ -static const opus_int32 stereo_voice_threshold = 30000; -static const opus_int32 stereo_music_threshold = 30000; +static const opus_int32 stereo_voice_threshold = 19000; +static const opus_int32 stereo_music_threshold = 17000; /* Threshold bit-rate for switching between SILK/hybrid and CELT-only */ static const opus_int32 mode_thresholds[2][2] = { /* voice */ /* music */ - { 64000, 16000}, /* mono */ - { 36000, 16000}, /* stereo */ + { 64000, 10000}, /* mono */ + { 44000, 10000}, /* stereo */ +}; + +static const opus_int32 fec_thresholds[] = { + 12000, 1000, /* NB */ + 14000, 1000, /* MB */ + 16000, 1000, /* WB */ + 20000, 1000, /* SWB */ + 22000, 1000, /* FB */ }; int opus_encoder_get_size(int channels) @@ -245,7 +263,8 @@ int opus_encoder_init(OpusEncoder* st, opus_int32 Fs, int channels, int applicat st->bandwidth = OPUS_BANDWIDTH_FULLBAND; #ifndef DISABLE_FLOAT_API - tonality_analysis_init(&st->analysis); + tonality_analysis_init(&st->analysis, st->Fs); + st->analysis.application = st->application; #endif return OPUS_OK; @@ -323,10 +342,11 @@ static void silk_biquad_float( } #endif -static void hp_cutoff(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *out, opus_val32 *hp_mem, int len, int channels, opus_int32 Fs) +static void hp_cutoff(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *out, opus_val32 *hp_mem, int len, int channels, opus_int32 Fs, int arch) { opus_int32 B_Q28[ 3 ], A_Q28[ 2 ]; opus_int32 Fc_Q19, r_Q28, r_Q22; + (void)arch; silk_assert( cutoff_Hz <= silk_int32_MAX / SILK_FIX_CONST( 1.5 * 3.14159 / 1000, 19 ) ); Fc_Q19 = silk_DIV32_16( silk_SMULBB( SILK_FIX_CONST( 1.5 * 3.14159 / 1000, 19 ), cutoff_Hz ), Fs/1000 ); @@ -346,9 +366,10 @@ static void hp_cutoff(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou A_Q28[ 1 ] = silk_SMULWW( r_Q22, r_Q22 ); #ifdef FIXED_POINT - silk_biquad_alt( in, B_Q28, A_Q28, hp_mem, out, len, channels ); - if( channels == 2 ) { - silk_biquad_alt( in+1, B_Q28, A_Q28, hp_mem+2, out+1, len, channels ); + if( channels == 1 ) { + silk_biquad_alt_stride1( in, B_Q28, A_Q28, hp_mem, out, len ); + } else { + silk_biquad_alt_stride2( in, B_Q28, A_Q28, hp_mem, out, len, arch ); } #else silk_biquad_float( in, B_Q28, A_Q28, hp_mem, out, len, channels ); @@ -364,21 +385,17 @@ static void dc_reject(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou int c, i; int shift; - /* Approximates -round(log2(4.*cutoff_Hz/Fs)) */ - shift=celt_ilog2(Fs/(cutoff_Hz*3)); + /* Approximates -round(log2(6.3*cutoff_Hz/Fs)) */ + shift=celt_ilog2(Fs/(cutoff_Hz*4)); for (c=0;c<channels;c++) { for (i=0;i<len;i++) { - opus_val32 x, tmp, y; - x = SHL32(EXTEND32(in[channels*i+c]), 15); - /* First stage */ - tmp = x-hp_mem[2*c]; + opus_val32 x, y; + x = SHL32(EXTEND32(in[channels*i+c]), 14); + y = x-hp_mem[2*c]; hp_mem[2*c] = hp_mem[2*c] + PSHR32(x - hp_mem[2*c], shift); - /* Second stage */ - y = tmp - hp_mem[2*c+1]; - hp_mem[2*c+1] = hp_mem[2*c+1] + PSHR32(tmp - hp_mem[2*c+1], shift); - out[channels*i+c] = EXTRACT16(SATURATE(PSHR32(y, 15), 32767)); + out[channels*i+c] = EXTRACT16(SATURATE(PSHR32(y, 14), 32767)); } } } @@ -386,24 +403,41 @@ static void dc_reject(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou #else static void dc_reject(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *out, opus_val32 *hp_mem, int len, int channels, opus_int32 Fs) { - int c, i; - float coef; - - coef = 4.0f*cutoff_Hz/Fs; - for (c=0;c<channels;c++) + int i; + float coef, coef2; + coef = 6.3f*cutoff_Hz/Fs; + coef2 = 1-coef; + if (channels==2) { + float m0, m2; + m0 = hp_mem[0]; + m2 = hp_mem[2]; for (i=0;i<len;i++) { - opus_val32 x, tmp, y; - x = in[channels*i+c]; - /* First stage */ - tmp = x-hp_mem[2*c]; - hp_mem[2*c] = hp_mem[2*c] + coef*(x - hp_mem[2*c]) + VERY_SMALL; - /* Second stage */ - y = tmp - hp_mem[2*c+1]; - hp_mem[2*c+1] = hp_mem[2*c+1] + coef*(tmp - hp_mem[2*c+1]) + VERY_SMALL; - out[channels*i+c] = y; + opus_val32 x0, x1, out0, out1; + x0 = in[2*i+0]; + x1 = in[2*i+1]; + out0 = x0-m0; + out1 = x1-m2; + m0 = coef*x0 + VERY_SMALL + coef2*m0; + m2 = coef*x1 + VERY_SMALL + coef2*m2; + out[2*i+0] = out0; + out[2*i+1] = out1; } + hp_mem[0] = m0; + hp_mem[2] = m2; + } else { + float m0; + m0 = hp_mem[0]; + for (i=0;i<len;i++) + { + opus_val32 x, y; + x = in[i]; + y = x-m0; + m0 = coef*x + VERY_SMALL + coef2*m0; + out[i] = y; + } + hp_mem[0] = m0; } } #endif @@ -521,287 +555,57 @@ static opus_int32 user_bitrate_to_bitrate(OpusEncoder *st, int frame_size, int m } #ifndef DISABLE_FLOAT_API -/* Don't use more than 60 ms for the frame size analysis */ -#define MAX_DYNAMIC_FRAMESIZE 24 -/* Estimates how much the bitrate will be boosted based on the sub-frame energy */ -static float transient_boost(const float *E, const float *E_1, int LM, int maxM) -{ - int i; - int M; - float sumE=0, sumE_1=0; - float metric; - - M = IMIN(maxM, (1<<LM)+1); - for (i=0;i<M;i++) - { - sumE += E[i]; - sumE_1 += E_1[i]; - } - metric = sumE*sumE_1/(M*M); - /*if (LM==3) - printf("%f\n", metric);*/ - /*return metric>10 ? 1 : 0;*/ - /*return MAX16(0,1-exp(-.25*(metric-2.)));*/ - return MIN16(1,(float)sqrt(MAX16(0,.05f*(metric-2)))); -} - -/* Viterbi decoding trying to find the best frame size combination using look-ahead - - State numbering: - 0: unused - 1: 2.5 ms - 2: 5 ms (#1) - 3: 5 ms (#2) - 4: 10 ms (#1) - 5: 10 ms (#2) - 6: 10 ms (#3) - 7: 10 ms (#4) - 8: 20 ms (#1) - 9: 20 ms (#2) - 10: 20 ms (#3) - 11: 20 ms (#4) - 12: 20 ms (#5) - 13: 20 ms (#6) - 14: 20 ms (#7) - 15: 20 ms (#8) -*/ -static int transient_viterbi(const float *E, const float *E_1, int N, int frame_cost, int rate) -{ - int i; - float cost[MAX_DYNAMIC_FRAMESIZE][16]; - int states[MAX_DYNAMIC_FRAMESIZE][16]; - float best_cost; - int best_state; - float factor; - /* Take into account that we damp VBR in the 32 kb/s to 64 kb/s range. */ - if (rate<80) - factor=0; - else if (rate>160) - factor=1; - else - factor = (rate-80.f)/80.f; - /* Makes variable framesize less aggressive at lower bitrates, but I can't - find any valid theoretical justification for this (other than it seems - to help) */ - for (i=0;i<16;i++) - { - /* Impossible state */ - states[0][i] = -1; - cost[0][i] = 1e10; - } - for (i=0;i<4;i++) - { - cost[0][1<<i] = (frame_cost + rate*(1<<i))*(1+factor*transient_boost(E, E_1, i, N+1)); - states[0][1<<i] = i; - } - for (i=1;i<N;i++) - { - int j; - - /* Follow continuations */ - for (j=2;j<16;j++) - { - cost[i][j] = cost[i-1][j-1]; - states[i][j] = j-1; - } - - /* New frames */ - for(j=0;j<4;j++) - { - int k; - float min_cost; - float curr_cost; - states[i][1<<j] = 1; - min_cost = cost[i-1][1]; - for(k=1;k<4;k++) - { - float tmp = cost[i-1][(1<<(k+1))-1]; - if (tmp < min_cost) - { - states[i][1<<j] = (1<<(k+1))-1; - min_cost = tmp; - } - } - curr_cost = (frame_cost + rate*(1<<j))*(1+factor*transient_boost(E+i, E_1+i, j, N-i+1)); - cost[i][1<<j] = min_cost; - /* If part of the frame is outside the analysis window, only count part of the cost */ - if (N-i < (1<<j)) - cost[i][1<<j] += curr_cost*(float)(N-i)/(1<<j); - else - cost[i][1<<j] += curr_cost; - } - } - - best_state=1; - best_cost = cost[N-1][1]; - /* Find best end state (doesn't force a frame to end at N-1) */ - for (i=2;i<16;i++) - { - if (cost[N-1][i]<best_cost) - { - best_cost = cost[N-1][i]; - best_state = i; - } - } - - /* Follow transitions back */ - for (i=N-1;i>=0;i--) - { - /*printf("%d ", best_state);*/ - best_state = states[i][best_state]; - } - /*printf("%d\n", best_state);*/ - return best_state; -} - -static int optimize_framesize(const void *x, int len, int C, opus_int32 Fs, - int bitrate, opus_val16 tonality, float *mem, int buffering, - downmix_func downmix) -{ - int N; - int i; - float e[MAX_DYNAMIC_FRAMESIZE+4]; - float e_1[MAX_DYNAMIC_FRAMESIZE+3]; - opus_val32 memx; - int bestLM=0; - int subframe; - int pos; - int offset; - VARDECL(opus_val32, sub); - - subframe = Fs/400; - ALLOC(sub, subframe, opus_val32); - e[0]=mem[0]; - e_1[0]=1.f/(EPSILON+mem[0]); - if (buffering) - { - /* Consider the CELT delay when not in restricted-lowdelay */ - /* We assume the buffering is between 2.5 and 5 ms */ - offset = 2*subframe - buffering; - celt_assert(offset>=0 && offset <= subframe); - len -= offset; - e[1]=mem[1]; - e_1[1]=1.f/(EPSILON+mem[1]); - e[2]=mem[2]; - e_1[2]=1.f/(EPSILON+mem[2]); - pos = 3; - } else { - pos=1; - offset=0; - } - N=IMIN(len/subframe, MAX_DYNAMIC_FRAMESIZE); - /* Just silencing a warning, it's really initialized later */ - memx = 0; - for (i=0;i<N;i++) - { - float tmp; - opus_val32 tmpx; - int j; - tmp=EPSILON; - - downmix(x, sub, subframe, i*subframe+offset, 0, -2, C); - if (i==0) - memx = sub[0]; - for (j=0;j<subframe;j++) - { - tmpx = sub[j]; - tmp += (tmpx-memx)*(float)(tmpx-memx); - memx = tmpx; - } - e[i+pos] = tmp; - e_1[i+pos] = 1.f/tmp; - } - /* Hack to get 20 ms working with APPLICATION_AUDIO - The real problem is that the corresponding memory needs to use 1.5 ms - from this frame and 1 ms from the next frame */ - e[i+pos] = e[i+pos-1]; - if (buffering) - N=IMIN(MAX_DYNAMIC_FRAMESIZE, N+2); - bestLM = transient_viterbi(e, e_1, N, (int)((1.f+.5f*tonality)*(60*C+40)), bitrate/400); - mem[0] = e[1<<bestLM]; - if (buffering) - { - mem[1] = e[(1<<bestLM)+1]; - mem[2] = e[(1<<bestLM)+2]; - } - return bestLM; -} - -#endif - -#ifndef DISABLE_FLOAT_API #ifdef FIXED_POINT #define PCM2VAL(x) FLOAT2INT16(x) #else #define PCM2VAL(x) SCALEIN(x) #endif -void downmix_float(const void *_x, opus_val32 *sub, int subframe, int offset, int c1, int c2, int C) + +void downmix_float(const void *_x, opus_val32 *y, int subframe, int offset, int c1, int c2, int C) { const float *x; - opus_val32 scale; int j; + x = (const float *)_x; for (j=0;j<subframe;j++) - sub[j] = PCM2VAL(x[(j+offset)*C+c1]); + y[j] = PCM2VAL(x[(j+offset)*C+c1]); if (c2>-1) { for (j=0;j<subframe;j++) - sub[j] += PCM2VAL(x[(j+offset)*C+c2]); + y[j] += PCM2VAL(x[(j+offset)*C+c2]); } else if (c2==-2) { int c; for (c=1;c<C;c++) { for (j=0;j<subframe;j++) - sub[j] += PCM2VAL(x[(j+offset)*C+c]); + y[j] += PCM2VAL(x[(j+offset)*C+c]); } } -#ifdef FIXED_POINT - scale = (1<<SIG_SHIFT); -#else - scale = 1.f; -#endif - if (C==-2) - scale /= C; - else - scale /= 2; - for (j=0;j<subframe;j++) - sub[j] *= scale; } #endif -void downmix_int(const void *_x, opus_val32 *sub, int subframe, int offset, int c1, int c2, int C) +void downmix_int(const void *_x, opus_val32 *y, int subframe, int offset, int c1, int c2, int C) { const opus_int16 *x; - opus_val32 scale; int j; + x = (const opus_int16 *)_x; for (j=0;j<subframe;j++) - sub[j] = x[(j+offset)*C+c1]; + y[j] = x[(j+offset)*C+c1]; if (c2>-1) { for (j=0;j<subframe;j++) - sub[j] += x[(j+offset)*C+c2]; + y[j] += x[(j+offset)*C+c2]; } else if (c2==-2) { int c; for (c=1;c<C;c++) { for (j=0;j<subframe;j++) - sub[j] += x[(j+offset)*C+c]; + y[j] += x[(j+offset)*C+c]; } } -#ifdef FIXED_POINT - scale = (1<<SIG_SHIFT); -#else - scale = 1.f/32768; -#endif - if (C==-2) - scale /= C; - else - scale /= 2; - for (j=0;j<subframe;j++) - sub[j] *= scale; } opus_int32 frame_size_select(opus_int32 frame_size, int variable_duration, opus_int32 Fs) @@ -811,53 +615,24 @@ opus_int32 frame_size_select(opus_int32 frame_size, int variable_duration, opus_ return -1; if (variable_duration == OPUS_FRAMESIZE_ARG) new_size = frame_size; - else if (variable_duration == OPUS_FRAMESIZE_VARIABLE) - new_size = Fs/50; - else if (variable_duration >= OPUS_FRAMESIZE_2_5_MS && variable_duration <= OPUS_FRAMESIZE_60_MS) - new_size = IMIN(3*Fs/50, (Fs/400)<<(variable_duration-OPUS_FRAMESIZE_2_5_MS)); + else if (variable_duration >= OPUS_FRAMESIZE_2_5_MS && variable_duration <= OPUS_FRAMESIZE_120_MS) + { + if (variable_duration <= OPUS_FRAMESIZE_40_MS) + new_size = (Fs/400)<<(variable_duration-OPUS_FRAMESIZE_2_5_MS); + else + new_size = (variable_duration-OPUS_FRAMESIZE_2_5_MS-2)*Fs/50; + } else return -1; if (new_size>frame_size) return -1; - if (400*new_size!=Fs && 200*new_size!=Fs && 100*new_size!=Fs && - 50*new_size!=Fs && 25*new_size!=Fs && 50*new_size!=3*Fs) + if (400*new_size!=Fs && 200*new_size!=Fs && 100*new_size!=Fs && + 50*new_size!=Fs && 25*new_size!=Fs && 50*new_size!=3*Fs && + 50*new_size!=4*Fs && 50*new_size!=5*Fs && 50*new_size!=6*Fs) return -1; return new_size; } -opus_int32 compute_frame_size(const void *analysis_pcm, int frame_size, - int variable_duration, int C, opus_int32 Fs, int bitrate_bps, - int delay_compensation, downmix_func downmix -#ifndef DISABLE_FLOAT_API - , float *subframe_mem -#endif - ) -{ -#ifndef DISABLE_FLOAT_API - if (variable_duration == OPUS_FRAMESIZE_VARIABLE && frame_size >= Fs/200) - { - int LM = 3; - LM = optimize_framesize(analysis_pcm, frame_size, C, Fs, bitrate_bps, - 0, subframe_mem, delay_compensation, downmix); - while ((Fs/400<<LM)>frame_size) - LM--; - frame_size = (Fs/400<<LM); - } else -#else - (void)analysis_pcm; - (void)C; - (void)bitrate_bps; - (void)delay_compensation; - (void)downmix; -#endif - { - frame_size = frame_size_select(frame_size, variable_duration, Fs); - } - if (frame_size<0) - return -1; - return frame_size; -} - opus_val16 compute_stereo_width(const opus_val16 *pcm, int frame_size, opus_int32 Fs, StereoWidthState *mem) { opus_val32 xx, xy, yy; @@ -904,6 +679,12 @@ opus_val16 compute_stereo_width(const opus_val16 *pcm, int frame_size, opus_int3 xy += SHR32(pxy, 10); yy += SHR32(pyy, 10); } +#ifndef FIXED_POINT + if (!(xx < 1e9f) || celt_isnan(xx) || !(yy < 1e9f) || celt_isnan(yy)) + { + xy = xx = yy = 0; + } +#endif mem->XX += MULT16_32_Q15(short_alpha, xx-mem->XX); mem->XY += MULT16_32_Q15(short_alpha, xy-mem->XY); mem->YY += MULT16_32_Q15(short_alpha, yy-mem->YY); @@ -934,6 +715,354 @@ opus_val16 compute_stereo_width(const opus_val16 *pcm, int frame_size, opus_int3 return EXTRACT16(MIN32(Q15ONE, MULT16_16(20, mem->max_follower))); } +static int decide_fec(int useInBandFEC, int PacketLoss_perc, int last_fec, int mode, int *bandwidth, opus_int32 rate) +{ + int orig_bandwidth; + if (!useInBandFEC || PacketLoss_perc == 0 || mode == MODE_CELT_ONLY) + return 0; + orig_bandwidth = *bandwidth; + for (;;) + { + opus_int32 hysteresis; + opus_int32 LBRR_rate_thres_bps; + /* Compute threshold for using FEC at the current bandwidth setting */ + LBRR_rate_thres_bps = fec_thresholds[2*(*bandwidth - OPUS_BANDWIDTH_NARROWBAND)]; + hysteresis = fec_thresholds[2*(*bandwidth - OPUS_BANDWIDTH_NARROWBAND) + 1]; + if (last_fec == 1) LBRR_rate_thres_bps -= hysteresis; + if (last_fec == 0) LBRR_rate_thres_bps += hysteresis; + LBRR_rate_thres_bps = silk_SMULWB( silk_MUL( LBRR_rate_thres_bps, + 125 - silk_min( PacketLoss_perc, 25 ) ), SILK_FIX_CONST( 0.01, 16 ) ); + /* If loss <= 5%, we look at whether we have enough rate to enable FEC. + If loss > 5%, we decrease the bandwidth until we can enable FEC. */ + if (rate > LBRR_rate_thres_bps) + return 1; + else if (PacketLoss_perc <= 5) + return 0; + else if (*bandwidth > OPUS_BANDWIDTH_NARROWBAND) + (*bandwidth)--; + else + break; + } + /* Couldn't find any bandwidth to enable FEC, keep original bandwidth. */ + *bandwidth = orig_bandwidth; + return 0; +} + +static int compute_silk_rate_for_hybrid(int rate, int bandwidth, int frame20ms, int vbr, int fec, int channels) { + int entry; + int i; + int N; + int silk_rate; + static int rate_table[][5] = { + /* |total| |-------- SILK------------| + |-- No FEC -| |--- FEC ---| + 10ms 20ms 10ms 20ms */ + { 0, 0, 0, 0, 0}, + {12000, 10000, 10000, 11000, 11000}, + {16000, 13500, 13500, 15000, 15000}, + {20000, 16000, 16000, 18000, 18000}, + {24000, 18000, 18000, 21000, 21000}, + {32000, 22000, 22000, 28000, 28000}, + {64000, 38000, 38000, 50000, 50000} + }; + /* Do the allocation per-channel. */ + rate /= channels; + entry = 1 + frame20ms + 2*fec; + N = sizeof(rate_table)/sizeof(rate_table[0]); + for (i=1;i<N;i++) + { + if (rate_table[i][0] > rate) break; + } + if (i == N) + { + silk_rate = rate_table[i-1][entry]; + /* For now, just give 50% of the extra bits to SILK. */ + silk_rate += (rate-rate_table[i-1][0])/2; + } else { + opus_int32 lo, hi, x0, x1; + lo = rate_table[i-1][entry]; + hi = rate_table[i][entry]; + x0 = rate_table[i-1][0]; + x1 = rate_table[i][0]; + silk_rate = (lo*(x1-rate) + hi*(rate-x0))/(x1-x0); + } + if (!vbr) + { + /* Tiny boost to SILK for CBR. We should probably tune this better. */ + silk_rate += 100; + } + if (bandwidth==OPUS_BANDWIDTH_SUPERWIDEBAND) + silk_rate += 300; + silk_rate *= channels; + /* Small adjustment for stereo (calibrated for 32 kb/s, haven't tried other bitrates). */ + if (channels == 2 && rate >= 12000) + silk_rate -= 1000; + return silk_rate; +} + +/* Returns the equivalent bitrate corresponding to 20 ms frames, + complexity 10 VBR operation. */ +static opus_int32 compute_equiv_rate(opus_int32 bitrate, int channels, + int frame_rate, int vbr, int mode, int complexity, int loss) +{ + opus_int32 equiv; + equiv = bitrate; + /* Take into account overhead from smaller frames. */ + if (frame_rate > 50) + equiv -= (40*channels+20)*(frame_rate - 50); + /* CBR is about a 8% penalty for both SILK and CELT. */ + if (!vbr) + equiv -= equiv/12; + /* Complexity makes about 10% difference (from 0 to 10) in general. */ + equiv = equiv * (90+complexity)/100; + if (mode == MODE_SILK_ONLY || mode == MODE_HYBRID) + { + /* SILK complexity 0-1 uses the non-delayed-decision NSQ, which + costs about 20%. */ + if (complexity<2) + equiv = equiv*4/5; + equiv -= equiv*loss/(6*loss + 10); + } else if (mode == MODE_CELT_ONLY) { + /* CELT complexity 0-4 doesn't have the pitch filter, which costs + about 10%. */ + if (complexity<5) + equiv = equiv*9/10; + } else { + /* Mode not known yet */ + /* Half the SILK loss*/ + equiv -= equiv*loss/(12*loss + 20); + } + return equiv; +} + +#ifndef DISABLE_FLOAT_API + +int is_digital_silence(const opus_val16* pcm, int frame_size, int channels, int lsb_depth) +{ + int silence = 0; + opus_val32 sample_max = 0; +#ifdef MLP_TRAINING + return 0; +#endif + sample_max = celt_maxabs16(pcm, frame_size*channels); + +#ifdef FIXED_POINT + silence = (sample_max == 0); + (void)lsb_depth; +#else + silence = (sample_max <= (opus_val16) 1 / (1 << lsb_depth)); +#endif + + return silence; +} + +#ifdef FIXED_POINT +static opus_val32 compute_frame_energy(const opus_val16 *pcm, int frame_size, int channels, int arch) +{ + int i; + opus_val32 sample_max; + int max_shift; + int shift; + opus_val32 energy = 0; + int len = frame_size*channels; + (void)arch; + /* Max amplitude in the signal */ + sample_max = celt_maxabs16(pcm, len); + + /* Compute the right shift required in the MAC to avoid an overflow */ + max_shift = celt_ilog2(len); + shift = IMAX(0, (celt_ilog2(sample_max) << 1) + max_shift - 28); + + /* Compute the energy */ + for (i=0; i<len; i++) + energy += SHR32(MULT16_16(pcm[i], pcm[i]), shift); + + /* Normalize energy by the frame size and left-shift back to the original position */ + energy /= len; + energy = SHL32(energy, shift); + + return energy; +} +#else +static opus_val32 compute_frame_energy(const opus_val16 *pcm, int frame_size, int channels, int arch) +{ + int len = frame_size*channels; + return celt_inner_prod(pcm, pcm, len, arch)/len; +} +#endif + +/* Decides if DTX should be turned on (=1) or off (=0) */ +static int decide_dtx_mode(float activity_probability, /* probability that current frame contains speech/music */ + int *nb_no_activity_frames, /* number of consecutive frames with no activity */ + opus_val32 peak_signal_energy, /* peak energy of desired signal detected so far */ + const opus_val16 *pcm, /* input pcm signal */ + int frame_size, /* frame size */ + int channels, + int is_silence, /* only digital silence detected in this frame */ + int arch + ) +{ + opus_val32 noise_energy; + + if (!is_silence) + { + if (activity_probability < DTX_ACTIVITY_THRESHOLD) /* is noise */ + { + noise_energy = compute_frame_energy(pcm, frame_size, channels, arch); + + /* but is sufficiently quiet */ + is_silence = peak_signal_energy >= (PSEUDO_SNR_THRESHOLD * noise_energy); + } + } + + if (is_silence) + { + /* The number of consecutive DTX frames should be within the allowed bounds */ + (*nb_no_activity_frames)++; + + if (*nb_no_activity_frames > NB_SPEECH_FRAMES_BEFORE_DTX) + { + if (*nb_no_activity_frames <= (NB_SPEECH_FRAMES_BEFORE_DTX + MAX_CONSECUTIVE_DTX)) + /* Valid frame for DTX! */ + return 1; + else + (*nb_no_activity_frames) = NB_SPEECH_FRAMES_BEFORE_DTX; + } + } else + (*nb_no_activity_frames) = 0; + + return 0; +} + +#endif + +static opus_int32 encode_multiframe_packet(OpusEncoder *st, + const opus_val16 *pcm, + int nb_frames, + int frame_size, + unsigned char *data, + opus_int32 out_data_bytes, + int to_celt, + int lsb_depth, + int float_api) +{ + int i; + int ret = 0; + VARDECL(unsigned char, tmp_data); + int bak_mode, bak_bandwidth, bak_channels, bak_to_mono; + VARDECL(OpusRepacketizer, rp); + int max_header_bytes; + opus_int32 bytes_per_frame; + opus_int32 cbr_bytes; + opus_int32 repacketize_len; + int tmp_len; + ALLOC_STACK; + + /* Worst cases: + * 2 frames: Code 2 with different compressed sizes + * >2 frames: Code 3 VBR */ + max_header_bytes = nb_frames == 2 ? 3 : (2+(nb_frames-1)*2); + + if (st->use_vbr || st->user_bitrate_bps==OPUS_BITRATE_MAX) + repacketize_len = out_data_bytes; + else { + cbr_bytes = 3*st->bitrate_bps/(3*8*st->Fs/(frame_size*nb_frames)); + repacketize_len = IMIN(cbr_bytes, out_data_bytes); + } + bytes_per_frame = IMIN(1276, 1+(repacketize_len-max_header_bytes)/nb_frames); + + ALLOC(tmp_data, nb_frames*bytes_per_frame, unsigned char); + ALLOC(rp, 1, OpusRepacketizer); + opus_repacketizer_init(rp); + + bak_mode = st->user_forced_mode; + bak_bandwidth = st->user_bandwidth; + bak_channels = st->force_channels; + + st->user_forced_mode = st->mode; + st->user_bandwidth = st->bandwidth; + st->force_channels = st->stream_channels; + + bak_to_mono = st->silk_mode.toMono; + if (bak_to_mono) + st->force_channels = 1; + else + st->prev_channels = st->stream_channels; + + for (i=0;i<nb_frames;i++) + { + st->silk_mode.toMono = 0; + st->nonfinal_frame = i<(nb_frames-1); + + /* When switching from SILK/Hybrid to CELT, only ask for a switch at the last frame */ + if (to_celt && i==nb_frames-1) + st->user_forced_mode = MODE_CELT_ONLY; + + tmp_len = opus_encode_native(st, pcm+i*(st->channels*frame_size), frame_size, + tmp_data+i*bytes_per_frame, bytes_per_frame, lsb_depth, NULL, 0, 0, 0, 0, + NULL, float_api); + + if (tmp_len<0) + { + RESTORE_STACK; + return OPUS_INTERNAL_ERROR; + } + + ret = opus_repacketizer_cat(rp, tmp_data+i*bytes_per_frame, tmp_len); + + if (ret<0) + { + RESTORE_STACK; + return OPUS_INTERNAL_ERROR; + } + } + + ret = opus_repacketizer_out_range_impl(rp, 0, nb_frames, data, repacketize_len, 0, !st->use_vbr); + + if (ret<0) + { + RESTORE_STACK; + return OPUS_INTERNAL_ERROR; + } + + /* Discard configs that were forced locally for the purpose of repacketization */ + st->user_forced_mode = bak_mode; + st->user_bandwidth = bak_bandwidth; + st->force_channels = bak_channels; + st->silk_mode.toMono = bak_to_mono; + + RESTORE_STACK; + return ret; +} + +static int compute_redundancy_bytes(opus_int32 max_data_bytes, opus_int32 bitrate_bps, int frame_rate, int channels) +{ + int redundancy_bytes_cap; + int redundancy_bytes; + opus_int32 redundancy_rate; + int base_bits; + opus_int32 available_bits; + base_bits = (40*channels+20); + + /* Equivalent rate for 5 ms frames. */ + redundancy_rate = bitrate_bps + base_bits*(200 - frame_rate); + /* For VBR, further increase the bitrate if we can afford it. It's pretty short + and we'll avoid artefacts. */ + redundancy_rate = 3*redundancy_rate/2; + redundancy_bytes = redundancy_rate/1600; + + /* Compute the max rate we can use given CBR or VBR with cap. */ + available_bits = max_data_bytes*8 - 2*base_bits; + redundancy_bytes_cap = (available_bits*240/(240+48000/frame_rate) + base_bits)/8; + redundancy_bytes = IMIN(redundancy_bytes, redundancy_bytes_cap); + /* It we can't get enough bits for redundancy to be worth it, rely on the decoder PLC. */ + if (redundancy_bytes > 4 + 8*channels) + redundancy_bytes = IMIN(257, redundancy_bytes); + else + redundancy_bytes = 0; + return redundancy_bytes; +} + opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_size, unsigned char *data, opus_int32 out_data_bytes, int lsb_depth, const void *analysis_pcm, opus_int32 analysis_size, int c1, int c2, @@ -971,6 +1100,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ AnalysisInfo analysis_info; int analysis_read_pos_bak=-1; int analysis_read_subframe_bak=-1; + int is_silence = 0; #endif VARDECL(opus_val16, tmp_prefill); @@ -979,15 +1109,19 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ max_data_bytes = IMIN(1276, out_data_bytes); st->rangeFinal = 0; - if ((!st->variable_duration && 400*frame_size != st->Fs && 200*frame_size != st->Fs && 100*frame_size != st->Fs && - 50*frame_size != st->Fs && 25*frame_size != st->Fs && 50*frame_size != 3*st->Fs) - || (400*frame_size < st->Fs) - || max_data_bytes<=0 - ) + if (frame_size <= 0 || max_data_bytes <= 0) { RESTORE_STACK; return OPUS_BAD_ARG; } + + /* Cannot encode 100 ms in 1 byte */ + if (max_data_bytes==1 && st->Fs==(frame_size*10)) + { + RESTORE_STACK; + return OPUS_BUFFER_TOO_SMALL; + } + silk_enc = (char*)st+st->silk_enc_offset; celt_enc = (CELTEncoder*)((char*)st+st->celt_enc_offset); if (st->application == OPUS_APPLICATION_RESTRICTED_LOWDELAY) @@ -1001,31 +1135,55 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ #ifndef DISABLE_FLOAT_API analysis_info.valid = 0; #ifdef FIXED_POINT - if (st->silk_mode.complexity >= 10 && st->Fs==48000) + if (st->silk_mode.complexity >= 10 && st->Fs>=16000) #else - if (st->silk_mode.complexity >= 7 && st->Fs==48000) + if (st->silk_mode.complexity >= 7 && st->Fs>=16000) #endif { + is_silence = is_digital_silence(pcm, frame_size, st->channels, lsb_depth); analysis_read_pos_bak = st->analysis.read_pos; analysis_read_subframe_bak = st->analysis.read_subframe; run_analysis(&st->analysis, celt_mode, analysis_pcm, analysis_size, frame_size, c1, c2, analysis_channels, st->Fs, lsb_depth, downmix, &analysis_info); + + /* Track the peak signal energy */ + if (!is_silence && analysis_info.activity_probability > DTX_ACTIVITY_THRESHOLD) + st->peak_signal_energy = MAX32(MULT16_32_Q15(QCONST16(0.999f, 15), st->peak_signal_energy), + compute_frame_energy(pcm, frame_size, st->channels, st->arch)); + } else if (st->analysis.initialized) { + tonality_analysis_reset(&st->analysis); } #else (void)analysis_pcm; (void)analysis_size; + (void)c1; + (void)c2; + (void)analysis_channels; + (void)downmix; #endif - st->voice_ratio = -1; - #ifndef DISABLE_FLOAT_API + /* Reset voice_ratio if this frame is not silent or if analysis is disabled. + * Otherwise, preserve voice_ratio from the last non-silent frame */ + if (!is_silence) + st->voice_ratio = -1; + st->detected_bandwidth = 0; if (analysis_info.valid) { int analysis_bandwidth; if (st->signal_type == OPUS_AUTO) - st->voice_ratio = (int)floor(.5+100*(1-analysis_info.music_prob)); + { + float prob; + if (st->prev_mode == 0) + prob = analysis_info.music_prob; + else if (st->prev_mode == MODE_CELT_ONLY) + prob = analysis_info.music_prob_max; + else + prob = analysis_info.music_prob_min; + st->voice_ratio = (int)floor(.5+100*(1-prob)); + } analysis_bandwidth = analysis_info.bandwidth; if (analysis_bandwidth<=12) @@ -1039,6 +1197,8 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ else st->detected_bandwidth = OPUS_BANDWIDTH_FULLBAND; } +#else + st->voice_ratio = -1; #endif if (st->channels==2 && st->force_channels!=1) @@ -1052,12 +1212,13 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if (!st->use_vbr) { int cbrBytes; - /* Multiply by 3 to make sure the division is exact. */ - int frame_rate3 = 3*st->Fs/frame_size; + /* Multiply by 12 to make sure the division is exact. */ + int frame_rate12 = 12*st->Fs/frame_size; /* We need to make sure that "int" values always fit in 16 bits. */ - cbrBytes = IMIN( (3*st->bitrate_bps/8 + frame_rate3/2)/frame_rate3, max_data_bytes); - st->bitrate_bps = cbrBytes*(opus_int32)frame_rate3*8/3; - max_data_bytes = cbrBytes; + cbrBytes = IMIN( (12*st->bitrate_bps/8 + frame_rate12/2)/frame_rate12, max_data_bytes); + st->bitrate_bps = cbrBytes*(opus_int32)frame_rate12*8/12; + /* Make sure we provide at least one byte to avoid failing. */ + max_data_bytes = IMAX(1, cbrBytes); } if (max_data_bytes<3 || st->bitrate_bps < 3*frame_rate*8 || (frame_rate<50 && (max_data_bytes*frame_rate<300 || st->bitrate_bps < 2400))) @@ -1065,25 +1226,63 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ /*If the space is too low to do something useful, emit 'PLC' frames.*/ int tocmode = st->mode; int bw = st->bandwidth == 0 ? OPUS_BANDWIDTH_NARROWBAND : st->bandwidth; + int packet_code = 0; + int num_multiframes = 0; + if (tocmode==0) tocmode = MODE_SILK_ONLY; if (frame_rate>100) tocmode = MODE_CELT_ONLY; - if (frame_rate < 50) - tocmode = MODE_SILK_ONLY; + /* 40 ms -> 2 x 20 ms if in CELT_ONLY or HYBRID mode */ + if (frame_rate==25 && tocmode!=MODE_SILK_ONLY) + { + frame_rate = 50; + packet_code = 1; + } + + /* >= 60 ms frames */ + if (frame_rate<=16) + { + /* 1 x 60 ms, 2 x 40 ms, 2 x 60 ms */ + if (out_data_bytes==1 || (tocmode==MODE_SILK_ONLY && frame_rate!=10)) + { + tocmode = MODE_SILK_ONLY; + + packet_code = frame_rate <= 12; + frame_rate = frame_rate == 12 ? 25 : 16; + } + else + { + num_multiframes = 50/frame_rate; + frame_rate = 50; + packet_code = 3; + } + } + if(tocmode==MODE_SILK_ONLY&&bw>OPUS_BANDWIDTH_WIDEBAND) bw=OPUS_BANDWIDTH_WIDEBAND; else if (tocmode==MODE_CELT_ONLY&&bw==OPUS_BANDWIDTH_MEDIUMBAND) bw=OPUS_BANDWIDTH_NARROWBAND; else if (tocmode==MODE_HYBRID&&bw<=OPUS_BANDWIDTH_SUPERWIDEBAND) bw=OPUS_BANDWIDTH_SUPERWIDEBAND; + data[0] = gen_toc(tocmode, frame_rate, bw, st->stream_channels); - ret = 1; + data[0] |= packet_code; + + ret = packet_code <= 1 ? 1 : 2; + + max_data_bytes = IMAX(max_data_bytes, ret); + + if (packet_code==3) + data[1] = num_multiframes; + if (!st->use_vbr) { ret = opus_packet_pad(data, ret, max_data_bytes); if (ret == OPUS_OK) ret = max_data_bytes; + else + ret = OPUS_INTERNAL_ERROR; } RESTORE_STACK; return ret; @@ -1091,7 +1290,8 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ max_rate = frame_rate*max_data_bytes*8; /* Equivalent 20-ms rate for mode/channel/bandwidth decisions */ - equiv_rate = st->bitrate_bps - (40*st->channels+20)*(st->Fs/frame_size - 50); + equiv_rate = compute_equiv_rate(st->bitrate_bps, st->channels, st->Fs/frame_size, + st->use_vbr, 0, st->silk_mode.complexity, st->silk_mode.packetLossPercentage); if (st->signal_type == OPUS_SIGNAL_VOICE) voice_est = 127; @@ -1132,7 +1332,17 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ } #endif } - equiv_rate = st->bitrate_bps - (40*st->stream_channels+20)*(st->Fs/frame_size - 50); + /* Update equivalent rate for channels decision. */ + equiv_rate = compute_equiv_rate(st->bitrate_bps, st->stream_channels, st->Fs/frame_size, + st->use_vbr, 0, st->silk_mode.complexity, st->silk_mode.packetLossPercentage); + + /* Allow SILK DTX if DTX is enabled but the generalized DTX cannot be used, + e.g. because of the complexity setting or sample rate. */ +#ifndef DISABLE_FLOAT_API + st->silk_mode.useDTX = st->use_dtx && !(analysis_info.valid || is_silence); +#else + st->silk_mode.useDTX = st->use_dtx; +#endif /* Mode selection depending on application and signal type */ if (st->application == OPUS_APPLICATION_RESTRICTED_LOWDELAY) @@ -1181,10 +1391,15 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ /* When FEC is enabled and there's enough packet loss, use SILK */ if (st->silk_mode.useInBandFEC && st->silk_mode.packetLossPercentage > (128-voice_est)>>4) st->mode = MODE_SILK_ONLY; - /* When encoding voice and DTX is enabled, set the encoder to SILK mode (at least for now) */ + /* When encoding voice and DTX is enabled but the generalized DTX cannot be used, + use SILK in order to make use of its DTX. */ if (st->silk_mode.useDTX && voice_est > 100) st->mode = MODE_SILK_ONLY; #endif + + /* If max_data_bytes represents less than 6 kb/s, switch to CELT-only mode */ + if (max_data_bytes < (frame_rate > 50 ? 9000 : 6000)*frame_size / (st->Fs * 8)) + st->mode = MODE_CELT_ONLY; } else { st->mode = st->user_forced_mode; } @@ -1194,19 +1409,6 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ st->mode = MODE_CELT_ONLY; if (st->lfe) st->mode = MODE_CELT_ONLY; - /* If max_data_bytes represents less than 8 kb/s, switch to CELT-only mode */ - if (max_data_bytes < (frame_rate > 50 ? 12000 : 8000)*frame_size / (st->Fs * 8)) - st->mode = MODE_CELT_ONLY; - - if (st->stream_channels == 1 && st->prev_channels ==2 && st->silk_mode.toMono==0 - && st->mode != MODE_CELT_ONLY && st->prev_mode != MODE_CELT_ONLY) - { - /* Delay stereo->mono transition by two frames so that SILK can do a smooth downmix */ - st->silk_mode.toMono = 1; - st->stream_channels = 2; - } else { - st->silk_mode.toMono = 0; - } if (st->prev_mode > 0 && ((st->mode != MODE_CELT_ONLY && st->prev_mode == MODE_CELT_ONLY) || @@ -1226,24 +1428,23 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ } } } - /* For the first frame at a new SILK bandwidth */ - if (st->silk_bw_switch) - { - redundancy = 1; - celt_to_silk = 1; - st->silk_bw_switch = 0; - prefill=1; - } - if (redundancy) + /* When encoding multiframes, we can ask for a switch to CELT only in the last frame. This switch + * is processed above as the requested mode shouldn't interrupt stereo->mono transition. */ + if (st->stream_channels == 1 && st->prev_channels ==2 && st->silk_mode.toMono==0 + && st->mode != MODE_CELT_ONLY && st->prev_mode != MODE_CELT_ONLY) { - /* Fair share of the max size allowed */ - redundancy_bytes = IMIN(257, max_data_bytes*(opus_int32)(st->Fs/200)/(frame_size+st->Fs/200)); - /* For VBR, target the actual bitrate (subject to the limit above) */ - if (st->use_vbr) - redundancy_bytes = IMIN(redundancy_bytes, st->bitrate_bps/1600); + /* Delay stereo->mono transition by two frames so that SILK can do a smooth downmix */ + st->silk_mode.toMono = 1; + st->stream_channels = 2; + } else { + st->silk_mode.toMono = 0; } + /* Update equivalent rate with mode decision. */ + equiv_rate = compute_equiv_rate(st->bitrate_bps, st->stream_channels, st->Fs/frame_size, + st->use_vbr, st->mode, st->silk_mode.complexity, st->silk_mode.packetLossPercentage); + if (st->mode != MODE_CELT_ONLY && st->prev_mode == MODE_CELT_ONLY) { silk_EncControlStruct dummy; @@ -1257,17 +1458,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ const opus_int32 *voice_bandwidth_thresholds, *music_bandwidth_thresholds; opus_int32 bandwidth_thresholds[8]; int bandwidth = OPUS_BANDWIDTH_FULLBAND; - opus_int32 equiv_rate2; - equiv_rate2 = equiv_rate; - if (st->mode != MODE_CELT_ONLY) - { - /* Adjust the threshold +/- 10% depending on complexity */ - equiv_rate2 = equiv_rate2 * (45+st->silk_mode.complexity)/50; - /* CBR is less efficient by ~1 kb/s */ - if (!st->use_vbr) - equiv_rate2 -= 1000; - } if (st->channels==2 && st->force_channels!=1) { voice_bandwidth_thresholds = stereo_voice_bandwidth_thresholds; @@ -1288,15 +1479,19 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ hysteresis = bandwidth_thresholds[2*(bandwidth-OPUS_BANDWIDTH_MEDIUMBAND)+1]; if (!st->first) { - if (st->bandwidth >= bandwidth) + if (st->auto_bandwidth >= bandwidth) threshold -= hysteresis; else threshold += hysteresis; } - if (equiv_rate2 >= threshold) + if (equiv_rate >= threshold) break; } while (--bandwidth>OPUS_BANDWIDTH_NARROWBAND); - st->bandwidth = bandwidth; + /* We don't use mediumband anymore, except when explicitly requested or during + mode transitions. */ + if (bandwidth == OPUS_BANDWIDTH_MEDIUMBAND) + bandwidth = OPUS_BANDWIDTH_WIDEBAND; + st->bandwidth = st->auto_bandwidth = bandwidth; /* Prevents any transition to SWB/FB until the SILK layer has fully switched to WB mode and turned the variable LP filter off */ if (!st->first && st->mode != MODE_CELT_ONLY && !st->silk_mode.inWBmodeWithoutVariableLP && st->bandwidth > OPUS_BANDWIDTH_WIDEBAND) @@ -1349,6 +1544,8 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ st->bandwidth = IMIN(st->bandwidth, st->detected_bandwidth); } #endif + st->silk_mode.LBRR_coded = decide_fec(st->silk_mode.useInBandFEC, st->silk_mode.packetLossPercentage, + st->silk_mode.LBRR_coded, st->mode, &st->bandwidth, equiv_rate); celt_encoder_ctl(celt_enc, OPUS_SET_LSB_DEPTH(lsb_depth)); /* CELT mode doesn't support mediumband, use wideband instead */ @@ -1357,15 +1554,34 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if (st->lfe) st->bandwidth = OPUS_BANDWIDTH_NARROWBAND; - /* Can't support higher than wideband for >20 ms frames */ - if (frame_size > st->Fs/50 && (st->mode == MODE_CELT_ONLY || st->bandwidth > OPUS_BANDWIDTH_WIDEBAND)) + curr_bandwidth = st->bandwidth; + + /* Chooses the appropriate mode for speech + *NEVER* switch to/from CELT-only mode here as this will invalidate some assumptions */ + if (st->mode == MODE_SILK_ONLY && curr_bandwidth > OPUS_BANDWIDTH_WIDEBAND) + st->mode = MODE_HYBRID; + if (st->mode == MODE_HYBRID && curr_bandwidth <= OPUS_BANDWIDTH_WIDEBAND) + st->mode = MODE_SILK_ONLY; + + /* Can't support higher than >60 ms frames, and >20 ms when in Hybrid or CELT-only modes */ + if ((frame_size > st->Fs/50 && (st->mode != MODE_SILK_ONLY)) || frame_size > 3*st->Fs/50) { - VARDECL(unsigned char, tmp_data); + int enc_frame_size; int nb_frames; - int bak_mode, bak_bandwidth, bak_channels, bak_to_mono; - VARDECL(OpusRepacketizer, rp); - opus_int32 bytes_per_frame; - opus_int32 repacketize_len; + + if (st->mode == MODE_SILK_ONLY) + { + if (frame_size == 2*st->Fs/25) /* 80 ms -> 2x 40 ms */ + enc_frame_size = st->Fs/25; + else if (frame_size == 3*st->Fs/25) /* 120 ms -> 2x 60 ms */ + enc_frame_size = 3*st->Fs/50; + else /* 100 ms -> 5x 20 ms */ + enc_frame_size = st->Fs/50; + } + else + enc_frame_size = st->Fs/50; + + nb_frames = frame_size/enc_frame_size; #ifndef DISABLE_FLOAT_API if (analysis_read_pos_bak!= -1) @@ -1375,74 +1591,34 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ } #endif - nb_frames = frame_size > st->Fs/25 ? 3 : 2; - bytes_per_frame = IMIN(1276,(out_data_bytes-3)/nb_frames); - - ALLOC(tmp_data, nb_frames*bytes_per_frame, unsigned char); - - ALLOC(rp, 1, OpusRepacketizer); - opus_repacketizer_init(rp); - - bak_mode = st->user_forced_mode; - bak_bandwidth = st->user_bandwidth; - bak_channels = st->force_channels; + ret = encode_multiframe_packet(st, pcm, nb_frames, enc_frame_size, data, + out_data_bytes, to_celt, lsb_depth, float_api); - st->user_forced_mode = st->mode; - st->user_bandwidth = st->bandwidth; - st->force_channels = st->stream_channels; - bak_to_mono = st->silk_mode.toMono; - - if (bak_to_mono) - st->force_channels = 1; - else - st->prev_channels = st->stream_channels; - for (i=0;i<nb_frames;i++) - { - int tmp_len; - st->silk_mode.toMono = 0; - /* When switching from SILK/Hybrid to CELT, only ask for a switch at the last frame */ - if (to_celt && i==nb_frames-1) - st->user_forced_mode = MODE_CELT_ONLY; - tmp_len = opus_encode_native(st, pcm+i*(st->channels*st->Fs/50), st->Fs/50, - tmp_data+i*bytes_per_frame, bytes_per_frame, lsb_depth, - NULL, 0, c1, c2, analysis_channels, downmix, float_api); - if (tmp_len<0) - { - RESTORE_STACK; - return OPUS_INTERNAL_ERROR; - } - ret = opus_repacketizer_cat(rp, tmp_data+i*bytes_per_frame, tmp_len); - if (ret<0) - { - RESTORE_STACK; - return OPUS_INTERNAL_ERROR; - } - } - if (st->use_vbr) - repacketize_len = out_data_bytes; - else - repacketize_len = IMIN(3*st->bitrate_bps/(3*8*50/nb_frames), out_data_bytes); - ret = opus_repacketizer_out_range_impl(rp, 0, nb_frames, data, repacketize_len, 0, !st->use_vbr); - if (ret<0) - { - RESTORE_STACK; - return OPUS_INTERNAL_ERROR; - } - st->user_forced_mode = bak_mode; - st->user_bandwidth = bak_bandwidth; - st->force_channels = bak_channels; - st->silk_mode.toMono = bak_to_mono; RESTORE_STACK; return ret; } - curr_bandwidth = st->bandwidth; - /* Chooses the appropriate mode for speech - *NEVER* switch to/from CELT-only mode here as this will invalidate some assumptions */ - if (st->mode == MODE_SILK_ONLY && curr_bandwidth > OPUS_BANDWIDTH_WIDEBAND) - st->mode = MODE_HYBRID; - if (st->mode == MODE_HYBRID && curr_bandwidth <= OPUS_BANDWIDTH_WIDEBAND) - st->mode = MODE_SILK_ONLY; + /* For the first frame at a new SILK bandwidth */ + if (st->silk_bw_switch) + { + redundancy = 1; + celt_to_silk = 1; + st->silk_bw_switch = 0; + /* Do a prefill without reseting the sampling rate control. */ + prefill=2; + } + + /* If we decided to go with CELT, make sure redundancy is off, no matter what + we decided earlier. */ + if (st->mode == MODE_CELT_ONLY) + redundancy = 0; + + if (redundancy) + { + redundancy_bytes = compute_redundancy_bytes(max_data_bytes, st->bitrate_bps, frame_rate, st->stream_channels); + if (redundancy_bytes == 0) + redundancy = 0; + } /* printf("%d %d %d %d\n", st->bitrate_bps, st->stream_channels, st->mode, curr_bandwidth); */ bytes_target = IMIN(max_data_bytes-redundancy_bytes, st->bitrate_bps * frame_size / (st->Fs * 8)) - 1; @@ -1467,7 +1643,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if (st->application == OPUS_APPLICATION_VOIP) { - hp_cutoff(pcm, cutoff_Hz, &pcm_buf[total_buffer*st->channels], st->hp_mem, frame_size, st->channels, st->Fs); + hp_cutoff(pcm, cutoff_Hz, &pcm_buf[total_buffer*st->channels], st->hp_mem, frame_size, st->channels, st->Fs, st->arch); } else { dc_reject(pcm, 3, &pcm_buf[total_buffer*st->channels], st->hp_mem, frame_size, st->channels, st->Fs); } @@ -1492,6 +1668,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if (st->mode != MODE_CELT_ONLY) { opus_int32 total_bitRate, celt_rate; + opus_int activity; #ifdef FIXED_POINT const opus_int16 *pcm_silk; #else @@ -1499,30 +1676,26 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ ALLOC(pcm_silk, st->channels*frame_size, opus_int16); #endif + activity = VAD_NO_DECISION; +#ifndef DISABLE_FLOAT_API + if( analysis_info.valid ) { + /* Inform SILK about the Opus VAD decision */ + activity = ( analysis_info.activity_probability >= DTX_ACTIVITY_THRESHOLD ); + } +#endif + /* Distribute bits between SILK and CELT */ total_bitRate = 8 * bytes_target * frame_rate; if( st->mode == MODE_HYBRID ) { - int HB_gain_ref; /* Base rate for SILK */ - st->silk_mode.bitRate = st->stream_channels * ( 5000 + 1000 * ( st->Fs == 100 * frame_size ) ); - if( curr_bandwidth == OPUS_BANDWIDTH_SUPERWIDEBAND ) { - /* SILK gets 2/3 of the remaining bits */ - st->silk_mode.bitRate += ( total_bitRate - st->silk_mode.bitRate ) * 2 / 3; - } else { /* FULLBAND */ - /* SILK gets 3/5 of the remaining bits */ - st->silk_mode.bitRate += ( total_bitRate - st->silk_mode.bitRate ) * 3 / 5; - } - /* Don't let SILK use more than 80% */ - if( st->silk_mode.bitRate > total_bitRate * 4/5 ) { - st->silk_mode.bitRate = total_bitRate * 4/5; - } + st->silk_mode.bitRate = compute_silk_rate_for_hybrid(total_bitRate, + curr_bandwidth, st->Fs == 50 * frame_size, st->use_vbr, st->silk_mode.LBRR_coded, + st->stream_channels); if (!st->energy_masking) { /* Increasingly attenuate high band when it gets allocated fewer bits */ celt_rate = total_bitRate - st->silk_mode.bitRate; - HB_gain_ref = (curr_bandwidth == OPUS_BANDWIDTH_SUPERWIDEBAND) ? 3000 : 3600; - HB_gain = SHL32((opus_val32)celt_rate, 9) / SHR32((opus_val32)celt_rate + st->stream_channels * HB_gain_ref, 6); - HB_gain = HB_gain < (opus_val32)Q15ONE*6/7 ? HB_gain + Q15ONE/7 : Q15ONE; + HB_gain = Q15ONE - SHR32(celt_exp2(-celt_rate * QCONST16(1.f/1024, 10)), 1); } } else { /* SILK gets all bits */ @@ -1569,7 +1742,6 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ st->silk_mode.bitRate += 3*rate_offset/5; else st->silk_mode.bitRate += rate_offset; - bytes_target += rate_offset * frame_size / (8 * st->Fs); } st->silk_mode.payloadSize_ms = 1000 * frame_size / st->Fs; @@ -1580,7 +1752,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ } else if (curr_bandwidth == OPUS_BANDWIDTH_MEDIUMBAND) { st->silk_mode.desiredInternalSampleRate = 12000; } else { - silk_assert( st->mode == MODE_HYBRID || curr_bandwidth == OPUS_BANDWIDTH_WIDEBAND ); + celt_assert( st->mode == MODE_HYBRID || curr_bandwidth == OPUS_BANDWIDTH_WIDEBAND ); st->silk_mode.desiredInternalSampleRate = 16000; } if( st->mode == MODE_HYBRID ) { @@ -1590,40 +1762,53 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ st->silk_mode.minInternalSampleRate = 8000; } + st->silk_mode.maxInternalSampleRate = 16000; if (st->mode == MODE_SILK_ONLY) { opus_int32 effective_max_rate = max_rate; - st->silk_mode.maxInternalSampleRate = 16000; if (frame_rate > 50) effective_max_rate = effective_max_rate*2/3; - if (effective_max_rate < 13000) + if (effective_max_rate < 8000) { st->silk_mode.maxInternalSampleRate = 12000; st->silk_mode.desiredInternalSampleRate = IMIN(12000, st->silk_mode.desiredInternalSampleRate); } - if (effective_max_rate < 9600) + if (effective_max_rate < 7000) { st->silk_mode.maxInternalSampleRate = 8000; st->silk_mode.desiredInternalSampleRate = IMIN(8000, st->silk_mode.desiredInternalSampleRate); } - } else { - st->silk_mode.maxInternalSampleRate = 16000; } st->silk_mode.useCBR = !st->use_vbr; /* Call SILK encoder for the low band */ - nBytes = IMIN(1275, max_data_bytes-1-redundancy_bytes); - st->silk_mode.maxBits = nBytes*8; - /* Only allow up to 90% of the bits for hybrid mode*/ - if (st->mode == MODE_HYBRID) - st->silk_mode.maxBits = (opus_int32)st->silk_mode.maxBits*9/10; + /* Max bits for SILK, counting ToC, redundancy bytes, and optionally redundancy. */ + st->silk_mode.maxBits = (max_data_bytes-1)*8; + if (redundancy && redundancy_bytes >= 2) + { + /* Counting 1 bit for redundancy position and 20 bits for flag+size (only for hybrid). */ + st->silk_mode.maxBits -= redundancy_bytes*8 + 1; + if (st->mode == MODE_HYBRID) + st->silk_mode.maxBits -= 20; + } if (st->silk_mode.useCBR) { - st->silk_mode.maxBits = (st->silk_mode.bitRate * frame_size / (st->Fs * 8))*8; - /* Reduce the initial target to make it easier to reach the CBR rate */ - st->silk_mode.bitRate = IMAX(1, st->silk_mode.bitRate-2000); + if (st->mode == MODE_HYBRID) + { + st->silk_mode.maxBits = IMIN(st->silk_mode.maxBits, st->silk_mode.bitRate * frame_size / st->Fs); + } + } else { + /* Constrained VBR. */ + if (st->mode == MODE_HYBRID) + { + /* Compute SILK bitrate corresponding to the max total bits available */ + opus_int32 maxBitRate = compute_silk_rate_for_hybrid(st->silk_mode.maxBits*st->Fs / frame_size, + curr_bandwidth, st->Fs == 50 * frame_size, st->use_vbr, st->silk_mode.LBRR_coded, + st->stream_channels); + st->silk_mode.maxBits = maxBitRate * frame_size / st->Fs; + } } if (prefill) @@ -1646,7 +1831,9 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ for (i=0;i<st->encoder_buffer*st->channels;i++) pcm_silk[i] = FLOAT2INT16(st->delay_buffer[i]); #endif - silk_Encode( silk_enc, &st->silk_mode, pcm_silk, st->encoder_buffer, NULL, &zero, 1 ); + silk_Encode( silk_enc, &st->silk_mode, pcm_silk, st->encoder_buffer, NULL, &zero, prefill, activity ); + /* Prevent a second switch in the real encode call. */ + st->silk_mode.opusCanSwitch = 0; } #ifdef FIXED_POINT @@ -1655,20 +1842,14 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ for (i=0;i<frame_size*st->channels;i++) pcm_silk[i] = FLOAT2INT16(pcm_buf[total_buffer*st->channels + i]); #endif - ret = silk_Encode( silk_enc, &st->silk_mode, pcm_silk, frame_size, &enc, &nBytes, 0 ); + ret = silk_Encode( silk_enc, &st->silk_mode, pcm_silk, frame_size, &enc, &nBytes, 0, activity ); if( ret ) { /*fprintf (stderr, "SILK encode error: %d\n", ret);*/ /* Handle error */ RESTORE_STACK; return OPUS_INTERNAL_ERROR; } - if (nBytes==0) - { - st->rangeFinal = 0; - data[-1] = gen_toc(st->mode, st->Fs/frame_size, curr_bandwidth, st->stream_channels); - RESTORE_STACK; - return 1; - } + /* Extract SILK internal bandwidth for signaling in first byte */ if( st->mode == MODE_SILK_ONLY ) { if( st->silk_mode.internalSampleRate == 8000 ) { @@ -1679,14 +1860,24 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ curr_bandwidth = OPUS_BANDWIDTH_WIDEBAND; } } else { - silk_assert( st->silk_mode.internalSampleRate == 16000 ); + celt_assert( st->silk_mode.internalSampleRate == 16000 ); + } + + st->silk_mode.opusCanSwitch = st->silk_mode.switchReady && !st->nonfinal_frame; + + if (nBytes==0) + { + st->rangeFinal = 0; + data[-1] = gen_toc(st->mode, st->Fs/frame_size, curr_bandwidth, st->stream_channels); + RESTORE_STACK; + return 1; } - st->silk_mode.opusCanSwitch = st->silk_mode.switchReady; /* FIXME: How do we allocate the redundancy for CBR? */ if (st->silk_mode.opusCanSwitch) { - redundancy = 1; + redundancy_bytes = compute_redundancy_bytes(max_data_bytes, st->bitrate_bps, frame_rate, st->stream_channels); + redundancy = (redundancy_bytes != 0); celt_to_silk = 0; st->silk_bw_switch = 1; } @@ -1727,40 +1918,18 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if (st->mode == MODE_HYBRID) { - int len; - - len = (ec_tell(&enc)+7)>>3; - if (redundancy) - len += st->mode == MODE_HYBRID ? 3 : 1; if( st->use_vbr ) { - nb_compr_bytes = len + bytes_target - (st->silk_mode.bitRate * frame_size) / (8 * st->Fs); - } else { - /* check if SILK used up too much */ - nb_compr_bytes = len > bytes_target ? len : bytes_target; + celt_encoder_ctl(celt_enc, OPUS_SET_BITRATE(st->bitrate_bps-st->silk_mode.bitRate)); + celt_encoder_ctl(celt_enc, OPUS_SET_VBR_CONSTRAINT(0)); } } else { if (st->use_vbr) { - opus_int32 bonus=0; -#ifndef DISABLE_FLOAT_API - if (st->variable_duration==OPUS_FRAMESIZE_VARIABLE && frame_size != st->Fs/50) - { - bonus = (60*st->stream_channels+40)*(st->Fs/frame_size-50); - if (analysis_info.valid) - bonus = (opus_int32)(bonus*(1.f+.5f*analysis_info.tonality)); - } -#endif celt_encoder_ctl(celt_enc, OPUS_SET_VBR(1)); celt_encoder_ctl(celt_enc, OPUS_SET_VBR_CONSTRAINT(st->vbr_constraint)); - celt_encoder_ctl(celt_enc, OPUS_SET_BITRATE(st->bitrate_bps+bonus)); - nb_compr_bytes = max_data_bytes-1-redundancy_bytes; - } else { - nb_compr_bytes = bytes_target; + celt_encoder_ctl(celt_enc, OPUS_SET_BITRATE(st->bitrate_bps)); } } - - } else { - nb_compr_bytes = 0; } ALLOC(tmp_prefill, st->channels*st->Fs/400, opus_val16); @@ -1786,7 +1955,14 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ } st->prev_HB_gain = HB_gain; if (st->mode != MODE_HYBRID || st->stream_channels==1) - st->silk_mode.stereoWidth_Q14 = IMIN((1<<14),2*IMAX(0,equiv_rate-30000)); + { + if (equiv_rate > 32000) + st->silk_mode.stereoWidth_Q14 = 16384; + else if (equiv_rate < 16000) + st->silk_mode.stereoWidth_Q14 = 0; + else + st->silk_mode.stereoWidth_Q14 = 16384 - 2048*(opus_int32)(32000-equiv_rate)/(equiv_rate-14000); + } if( !st->energy_masking && st->channels == 2 ) { /* Apply stereo width reduction (at low bitrates) */ if( st->hybrid_stereo_width_Q14 < (1 << 14) || st->silk_mode.stereoWidth_Q14 < (1 << 14) ) { @@ -1809,19 +1985,23 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if ( st->mode != MODE_CELT_ONLY && ec_tell(&enc)+17+20*(st->mode == MODE_HYBRID) <= 8*(max_data_bytes-1)) { /* For SILK mode, the redundancy is inferred from the length */ - if (st->mode == MODE_HYBRID && (redundancy || ec_tell(&enc)+37 <= 8*nb_compr_bytes)) + if (st->mode == MODE_HYBRID) ec_enc_bit_logp(&enc, redundancy, 12); if (redundancy) { int max_redundancy; ec_enc_bit_logp(&enc, celt_to_silk, 1); if (st->mode == MODE_HYBRID) - max_redundancy = (max_data_bytes-1)-nb_compr_bytes; + { + /* Reserve the 8 bits needed for the redundancy length, + and at least a few bits for CELT if possible */ + max_redundancy = (max_data_bytes-1)-((ec_tell(&enc)+8+3+7)>>3); + } else max_redundancy = (max_data_bytes-1)-((ec_tell(&enc)+7)>>3); /* Target the same bit-rate for redundancy as for the rest, up to a max of 257 bytes */ - redundancy_bytes = IMIN(max_redundancy, st->bitrate_bps/1600); + redundancy_bytes = IMIN(max_redundancy, redundancy_bytes); redundancy_bytes = IMIN(257, IMAX(2, redundancy_bytes)); if (st->mode == MODE_HYBRID) ec_enc_uint(&enc, redundancy_bytes-2, 256); @@ -1843,7 +2023,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ ec_enc_done(&enc); nb_compr_bytes = ret; } else { - nb_compr_bytes = IMIN((max_data_bytes-1)-redundancy_bytes, nb_compr_bytes); + nb_compr_bytes = (max_data_bytes-1)-redundancy_bytes; ec_enc_shrink(&enc, nb_compr_bytes); } @@ -1851,6 +2031,12 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if (redundancy || st->mode != MODE_SILK_ONLY) celt_encoder_ctl(celt_enc, CELT_SET_ANALYSIS(&analysis_info)); #endif + if (st->mode == MODE_HYBRID) { + SILKInfo info; + info.signalType = st->silk_mode.signalType; + info.offset = st->silk_mode.offset; + celt_encoder_ctl(celt_enc, CELT_SET_SILK_INFO(&info)); + } /* 5 ms redundant frame for CELT->SILK */ if (redundancy && celt_to_silk) @@ -1858,6 +2044,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ int err; celt_encoder_ctl(celt_enc, CELT_SET_START_BAND(0)); celt_encoder_ctl(celt_enc, OPUS_SET_VBR(0)); + celt_encoder_ctl(celt_enc, OPUS_SET_BITRATE(OPUS_BITRATE_MAX)); err = celt_encode_with_ec(celt_enc, pcm_buf, st->Fs/200, data+nb_compr_bytes, redundancy_bytes, NULL); if (err < 0) { @@ -1881,15 +2068,25 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ celt_encode_with_ec(celt_enc, tmp_prefill, st->Fs/400, dummy, 2, NULL); celt_encoder_ctl(celt_enc, CELT_SET_PREDICTION(0)); } - /* If false, we already busted the budget and we'll end up with a "PLC packet" */ + /* If false, we already busted the budget and we'll end up with a "PLC frame" */ if (ec_tell(&enc) <= 8*nb_compr_bytes) { + /* Set the bitrate again if it was overridden in the redundancy code above*/ + if (redundancy && celt_to_silk && st->mode==MODE_HYBRID && st->use_vbr) + celt_encoder_ctl(celt_enc, OPUS_SET_BITRATE(st->bitrate_bps-st->silk_mode.bitRate)); + celt_encoder_ctl(celt_enc, OPUS_SET_VBR(st->use_vbr)); ret = celt_encode_with_ec(celt_enc, pcm_buf, frame_size, NULL, nb_compr_bytes, &enc); if (ret < 0) { RESTORE_STACK; return OPUS_INTERNAL_ERROR; } + /* Put CELT->SILK redundancy data in the right place. */ + if (redundancy && celt_to_silk && st->mode==MODE_HYBRID && st->use_vbr) + { + OPUS_MOVE(data+ret, data+nb_compr_bytes, redundancy_bytes); + nb_compr_bytes = nb_compr_bytes+redundancy_bytes; + } } } @@ -1905,7 +2102,15 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ celt_encoder_ctl(celt_enc, OPUS_RESET_STATE); celt_encoder_ctl(celt_enc, CELT_SET_START_BAND(0)); celt_encoder_ctl(celt_enc, CELT_SET_PREDICTION(0)); + celt_encoder_ctl(celt_enc, OPUS_SET_VBR(0)); + celt_encoder_ctl(celt_enc, OPUS_SET_BITRATE(OPUS_BITRATE_MAX)); + if (st->mode == MODE_HYBRID) + { + /* Shrink packet to what the encoder actually used. */ + nb_compr_bytes = ret; + ec_enc_shrink(&enc, nb_compr_bytes); + } /* NOTE: We could speed this up slightly (at the expense of code size) by just adding a function that prefills the buffer */ celt_encode_with_ec(celt_enc, pcm_buf+st->channels*(frame_size-N2-N4), N4, dummy, 2, NULL); @@ -1935,6 +2140,23 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ st->first = 0; + /* DTX decision */ +#ifndef DISABLE_FLOAT_API + if (st->use_dtx && (analysis_info.valid || is_silence)) + { + if (decide_dtx_mode(analysis_info.activity_probability, &st->nb_no_activity_frames, + st->peak_signal_energy, pcm, frame_size, st->channels, is_silence, st->arch)) + { + st->rangeFinal = 0; + data[0] = gen_toc(st->mode, st->Fs/frame_size, curr_bandwidth, st->stream_channels); + RESTORE_STACK; + return 1; + } + } else { + st->nb_no_activity_frames = 0; + } +#endif + /* In the unlikely case that the SILK encoder busted its target, tell the decoder to call the PLC */ if (ec_tell(&enc) > (max_data_bytes-1)*8) @@ -1962,7 +2184,6 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ if (!st->use_vbr) { if (opus_packet_pad(data, ret, max_data_bytes) != OPUS_OK) - { RESTORE_STACK; return OPUS_INTERNAL_ERROR; @@ -1981,18 +2202,15 @@ opus_int32 opus_encode_float(OpusEncoder *st, const float *pcm, int analysis_fra { int i, ret; int frame_size; - int delay_compensation; VARDECL(opus_int16, in); ALLOC_STACK; - if (st->application == OPUS_APPLICATION_RESTRICTED_LOWDELAY) - delay_compensation = 0; - else - delay_compensation = st->delay_compensation; - frame_size = compute_frame_size(pcm, analysis_frame_size, - st->variable_duration, st->channels, st->Fs, st->bitrate_bps, - delay_compensation, downmix_float, st->analysis.subframe_mem); - + frame_size = frame_size_select(analysis_frame_size, st->variable_duration, st->Fs); + if (frame_size <= 0) + { + RESTORE_STACK; + return OPUS_BAD_ARG; + } ALLOC(in, frame_size*st->channels, opus_int16); for (i=0;i<frame_size*st->channels;i++) @@ -2008,18 +2226,7 @@ opus_int32 opus_encode(OpusEncoder *st, const opus_int16 *pcm, int analysis_fram unsigned char *data, opus_int32 out_data_bytes) { int frame_size; - int delay_compensation; - if (st->application == OPUS_APPLICATION_RESTRICTED_LOWDELAY) - delay_compensation = 0; - else - delay_compensation = st->delay_compensation; - frame_size = compute_frame_size(pcm, analysis_frame_size, - st->variable_duration, st->channels, st->Fs, st->bitrate_bps, - delay_compensation, downmix_int -#ifndef DISABLE_FLOAT_API - , st->analysis.subframe_mem -#endif - ); + frame_size = frame_size_select(analysis_frame_size, st->variable_duration, st->Fs); return opus_encode_native(st, pcm, frame_size, data, out_data_bytes, 16, pcm, analysis_frame_size, 0, -2, st->channels, downmix_int, 0); } @@ -2030,18 +2237,15 @@ opus_int32 opus_encode(OpusEncoder *st, const opus_int16 *pcm, int analysis_fram { int i, ret; int frame_size; - int delay_compensation; VARDECL(float, in); ALLOC_STACK; - if (st->application == OPUS_APPLICATION_RESTRICTED_LOWDELAY) - delay_compensation = 0; - else - delay_compensation = st->delay_compensation; - frame_size = compute_frame_size(pcm, analysis_frame_size, - st->variable_duration, st->channels, st->Fs, st->bitrate_bps, - delay_compensation, downmix_int, st->analysis.subframe_mem); - + frame_size = frame_size_select(analysis_frame_size, st->variable_duration, st->Fs); + if (frame_size <= 0) + { + RESTORE_STACK; + return OPUS_BAD_ARG; + } ALLOC(in, frame_size*st->channels, float); for (i=0;i<frame_size*st->channels;i++) @@ -2055,14 +2259,7 @@ opus_int32 opus_encode_float(OpusEncoder *st, const float *pcm, int analysis_fra unsigned char *data, opus_int32 out_data_bytes) { int frame_size; - int delay_compensation; - if (st->application == OPUS_APPLICATION_RESTRICTED_LOWDELAY) - delay_compensation = 0; - else - delay_compensation = st->delay_compensation; - frame_size = compute_frame_size(pcm, analysis_frame_size, - st->variable_duration, st->channels, st->Fs, st->bitrate_bps, - delay_compensation, downmix_float, st->analysis.subframe_mem); + frame_size = frame_size_select(analysis_frame_size, st->variable_duration, st->Fs); return opus_encode_native(st, pcm, frame_size, data, out_data_bytes, 24, pcm, analysis_frame_size, 0, -2, st->channels, downmix_float, 1); } @@ -2093,6 +2290,9 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...) break; } st->application = value; +#ifndef DISABLE_FLOAT_API + st->analysis.application = value; +#endif } break; case OPUS_GET_APPLICATION_REQUEST: @@ -2211,7 +2411,7 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...) { goto bad_arg; } - st->silk_mode.useDTX = value; + st->use_dtx = value; } break; case OPUS_GET_DTX_REQUEST: @@ -2221,7 +2421,7 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...) { goto bad_arg; } - *value = st->silk_mode.useDTX; + *value = st->use_dtx; } break; case OPUS_SET_COMPLEXITY_REQUEST: @@ -2422,15 +2622,15 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...) case OPUS_SET_EXPERT_FRAME_DURATION_REQUEST: { opus_int32 value = va_arg(ap, opus_int32); - if (value != OPUS_FRAMESIZE_ARG && value != OPUS_FRAMESIZE_2_5_MS && - value != OPUS_FRAMESIZE_5_MS && value != OPUS_FRAMESIZE_10_MS && - value != OPUS_FRAMESIZE_20_MS && value != OPUS_FRAMESIZE_40_MS && - value != OPUS_FRAMESIZE_60_MS && value != OPUS_FRAMESIZE_VARIABLE) + if (value != OPUS_FRAMESIZE_ARG && value != OPUS_FRAMESIZE_2_5_MS && + value != OPUS_FRAMESIZE_5_MS && value != OPUS_FRAMESIZE_10_MS && + value != OPUS_FRAMESIZE_20_MS && value != OPUS_FRAMESIZE_40_MS && + value != OPUS_FRAMESIZE_60_MS && value != OPUS_FRAMESIZE_80_MS && + value != OPUS_FRAMESIZE_100_MS && value != OPUS_FRAMESIZE_120_MS) { goto bad_arg; } st->variable_duration = value; - celt_encoder_ctl(celt_enc, OPUS_SET_EXPERT_FRAME_DURATION(value)); } break; case OPUS_GET_EXPERT_FRAME_DURATION_REQUEST: @@ -2459,6 +2659,26 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...) *value = st->silk_mode.reducedDependency; } break; + case OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST: + { + opus_int32 value = va_arg(ap, opus_int32); + if(value<0 || value>1) + { + goto bad_arg; + } + celt_encoder_ctl(celt_enc, OPUS_SET_PHASE_INVERSION_DISABLED(value)); + } + break; + case OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST: + { + opus_int32 *value = va_arg(ap, opus_int32*); + if (!value) + { + goto bad_arg; + } + celt_encoder_ctl(celt_enc, OPUS_GET_PHASE_INVERSION_DISABLED(value)); + } + break; case OPUS_RESET_STATE: { void *silk_enc; @@ -2507,6 +2727,33 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...) ret = celt_encoder_ctl(celt_enc, OPUS_SET_ENERGY_MASK(value)); } break; + case OPUS_GET_IN_DTX_REQUEST: + { + opus_int32 *value = va_arg(ap, opus_int32*); + if (!value) + { + goto bad_arg; + } + if (st->silk_mode.useDTX && (st->prev_mode == MODE_SILK_ONLY || st->prev_mode == MODE_HYBRID)) { + /* DTX determined by Silk. */ + int n; + void *silk_enc = (char*)st+st->silk_enc_offset; + *value = 1; + for (n=0;n<st->silk_mode.nChannelsInternal;n++) { + *value = *value && ((silk_encoder*)silk_enc)->state_Fxx[n].sCmn.noSpeechCounter >= NB_SPEECH_FRAMES_BEFORE_DTX; + } + } +#ifndef DISABLE_FLOAT_API + else if (st->use_dtx) { + /* DTX determined by Opus. */ + *value = st->nb_no_activity_frames >= NB_SPEECH_FRAMES_BEFORE_DTX; + } +#endif + else { + *value = 0; + } + } + break; case CELT_GET_MODE_REQUEST: { diff --git a/thirdparty/opus/opus_multistream_decoder.c b/thirdparty/opus/opus_multistream_decoder.c index b95eaa6eac..0018517aeb 100644 --- a/thirdparty/opus/opus_multistream_decoder.c +++ b/thirdparty/opus/opus_multistream_decoder.c @@ -37,15 +37,18 @@ #include "float_cast.h" #include "os_support.h" -struct OpusMSDecoder { - ChannelLayout layout; - /* Decoder states go here */ -}; - - +/* DECODER */ +#if defined(ENABLE_HARDENING) || defined(ENABLE_ASSERTIONS) +static void validate_ms_decoder(OpusMSDecoder *st) +{ + validate_layout(&st->layout); +} +#define VALIDATE_MS_DECODER(st) validate_ms_decoder(st) +#else +#define VALIDATE_MS_DECODER(st) +#endif -/* DECODER */ opus_int32 opus_multistream_decoder_get_size(int nb_streams, int nb_coupled_streams) { @@ -143,15 +146,6 @@ OpusMSDecoder *opus_multistream_decoder_create( return st; } -typedef void (*opus_copy_channel_out_func)( - void *dst, - int dst_stride, - int dst_channel, - const opus_val16 *src, - int src_stride, - int frame_size -); - static int opus_multistream_packet_validate(const unsigned char *data, opus_int32 len, int nb_streams, opus_int32 Fs) { @@ -181,7 +175,7 @@ static int opus_multistream_packet_validate(const unsigned char *data, return samples; } -static int opus_multistream_decode_native( +int opus_multistream_decode_native( OpusMSDecoder *st, const unsigned char *data, opus_int32 len, @@ -189,7 +183,8 @@ static int opus_multistream_decode_native( opus_copy_channel_out_func copy_channel_out, int frame_size, int decode_fec, - int soft_clip + int soft_clip, + void *user_data ) { opus_int32 Fs; @@ -201,8 +196,14 @@ static int opus_multistream_decode_native( VARDECL(opus_val16, buf); ALLOC_STACK; + VALIDATE_MS_DECODER(st); + if (frame_size <= 0) + { + RESTORE_STACK; + return OPUS_BAD_ARG; + } /* Limit frame_size to avoid excessive stack allocations. */ - opus_multistream_decoder_ctl(st, OPUS_GET_SAMPLE_RATE(&Fs)); + MUST_SUCCEED(opus_multistream_decoder_ctl(st, OPUS_GET_SAMPLE_RATE(&Fs))); frame_size = IMIN(frame_size, Fs/25*3); ALLOC(buf, 2*frame_size, opus_val16); ptr = (char*)st + align(sizeof(OpusMSDecoder)); @@ -237,7 +238,8 @@ static int opus_multistream_decode_native( for (s=0;s<st->layout.nb_streams;s++) { OpusDecoder *dec; - int packet_offset, ret; + opus_int32 packet_offset; + int ret; dec = (OpusDecoder*)ptr; ptr += (s < st->layout.nb_coupled_streams) ? align(coupled_size) : align(mono_size); @@ -265,7 +267,7 @@ static int opus_multistream_decode_native( while ( (chan = get_left_channel(&st->layout, s, prev)) != -1) { (*copy_channel_out)(pcm, st->layout.nb_channels, chan, - buf, 2, frame_size); + buf, 2, frame_size, user_data); prev = chan; } prev = -1; @@ -273,7 +275,7 @@ static int opus_multistream_decode_native( while ( (chan = get_right_channel(&st->layout, s, prev)) != -1) { (*copy_channel_out)(pcm, st->layout.nb_channels, chan, - buf+1, 2, frame_size); + buf+1, 2, frame_size, user_data); prev = chan; } } else { @@ -283,7 +285,7 @@ static int opus_multistream_decode_native( while ( (chan = get_mono_channel(&st->layout, s, prev)) != -1) { (*copy_channel_out)(pcm, st->layout.nb_channels, chan, - buf, 1, frame_size); + buf, 1, frame_size, user_data); prev = chan; } } @@ -294,7 +296,7 @@ static int opus_multistream_decode_native( if (st->layout.mapping[c] == 255) { (*copy_channel_out)(pcm, st->layout.nb_channels, c, - NULL, 0, frame_size); + NULL, 0, frame_size, user_data); } } RESTORE_STACK; @@ -308,11 +310,13 @@ static void opus_copy_channel_out_float( int dst_channel, const opus_val16 *src, int src_stride, - int frame_size + int frame_size, + void *user_data ) { float *float_dst; opus_int32 i; + (void)user_data; float_dst = (float*)dst; if (src != NULL) { @@ -337,11 +341,13 @@ static void opus_copy_channel_out_short( int dst_channel, const opus_val16 *src, int src_stride, - int frame_size + int frame_size, + void *user_data ) { opus_int16 *short_dst; opus_int32 i; + (void)user_data; short_dst = (opus_int16*)dst; if (src != NULL) { @@ -372,7 +378,7 @@ int opus_multistream_decode( ) { return opus_multistream_decode_native(st, data, len, - pcm, opus_copy_channel_out_short, frame_size, decode_fec, 0); + pcm, opus_copy_channel_out_short, frame_size, decode_fec, 0, NULL); } #ifndef DISABLE_FLOAT_API @@ -380,7 +386,7 @@ int opus_multistream_decode_float(OpusMSDecoder *st, const unsigned char *data, opus_int32 len, float *pcm, int frame_size, int decode_fec) { return opus_multistream_decode_native(st, data, len, - pcm, opus_copy_channel_out_float, frame_size, decode_fec, 0); + pcm, opus_copy_channel_out_float, frame_size, decode_fec, 0, NULL); } #endif @@ -390,32 +396,30 @@ int opus_multistream_decode(OpusMSDecoder *st, const unsigned char *data, opus_int32 len, opus_int16 *pcm, int frame_size, int decode_fec) { return opus_multistream_decode_native(st, data, len, - pcm, opus_copy_channel_out_short, frame_size, decode_fec, 1); + pcm, opus_copy_channel_out_short, frame_size, decode_fec, 1, NULL); } int opus_multistream_decode_float( OpusMSDecoder *st, const unsigned char *data, opus_int32 len, - float *pcm, + opus_val16 *pcm, int frame_size, int decode_fec ) { return opus_multistream_decode_native(st, data, len, - pcm, opus_copy_channel_out_float, frame_size, decode_fec, 0); + pcm, opus_copy_channel_out_float, frame_size, decode_fec, 0, NULL); } #endif -int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) +int opus_multistream_decoder_ctl_va_list(OpusMSDecoder *st, int request, + va_list ap) { - va_list ap; int coupled_size, mono_size; char *ptr; int ret = OPUS_OK; - va_start(ap, request); - coupled_size = opus_decoder_get_size(2); mono_size = opus_decoder_get_size(1); ptr = (char*)st + align(sizeof(OpusMSDecoder)); @@ -425,6 +429,7 @@ int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) case OPUS_GET_SAMPLE_RATE_REQUEST: case OPUS_GET_GAIN_REQUEST: case OPUS_GET_LAST_PACKET_DURATION_REQUEST: + case OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST: { OpusDecoder *dec; /* For int32* GET params, just query the first stream */ @@ -482,7 +487,7 @@ int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OpusDecoder **value; stream_id = va_arg(ap, opus_int32); if (stream_id<0 || stream_id >= st->layout.nb_streams) - ret = OPUS_BAD_ARG; + goto bad_arg; value = va_arg(ap, OpusDecoder**); if (!value) { @@ -499,6 +504,7 @@ int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) } break; case OPUS_SET_GAIN_REQUEST: + case OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST: { int s; /* This works for int32 params */ @@ -522,14 +528,20 @@ int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) ret = OPUS_UNIMPLEMENTED; break; } - - va_end(ap); return ret; bad_arg: - va_end(ap); return OPUS_BAD_ARG; } +int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) +{ + int ret; + va_list ap; + va_start(ap, request); + ret = opus_multistream_decoder_ctl_va_list(st, request, ap); + va_end(ap); + return ret; +} void opus_multistream_decoder_destroy(OpusMSDecoder *st) { diff --git a/thirdparty/opus/opus_multistream_encoder.c b/thirdparty/opus/opus_multistream_encoder.c index 1698223a16..93204a14c1 100644 --- a/thirdparty/opus/opus_multistream_encoder.c +++ b/thirdparty/opus/opus_multistream_encoder.c @@ -61,38 +61,6 @@ static const VorbisLayout vorbis_mappings[8] = { {5, 3, {0, 6, 1, 2, 3, 4, 5, 7}}, /* 8: 7.1 surround */ }; -typedef void (*opus_copy_channel_in_func)( - opus_val16 *dst, - int dst_stride, - const void *src, - int src_stride, - int src_channel, - int frame_size -); - -typedef enum { - MAPPING_TYPE_NONE, - MAPPING_TYPE_SURROUND -#ifdef ENABLE_EXPERIMENTAL_AMBISONICS - , /* Do not include comma at end of enumerator list */ - MAPPING_TYPE_AMBISONICS -#endif -} MappingType; - -struct OpusMSEncoder { - ChannelLayout layout; - int arch; - int lfe_stream; - int application; - int variable_duration; - MappingType mapping_type; - opus_int32 bitrate_bps; - float subframe_mem[3]; - /* Encoder states go here */ - /* then opus_val32 window_mem[channels*120]; */ - /* then opus_val32 preemph_mem[channels]; */ -}; - static opus_val32 *ms_get_preemph_mem(OpusMSEncoder *st) { int s; @@ -133,6 +101,29 @@ static opus_val32 *ms_get_window_mem(OpusMSEncoder *st) return (opus_val32*)(void*)ptr; } +static int validate_ambisonics(int nb_channels, int *nb_streams, int *nb_coupled_streams) +{ + int order_plus_one; + int acn_channels; + int nondiegetic_channels; + + if (nb_channels < 1 || nb_channels > 227) + return 0; + + order_plus_one = isqrt32(nb_channels); + acn_channels = order_plus_one * order_plus_one; + nondiegetic_channels = nb_channels - acn_channels; + + if (nondiegetic_channels != 0 && nondiegetic_channels != 2) + return 0; + + if (nb_streams) + *nb_streams = acn_channels + (nondiegetic_channels != 0); + if (nb_coupled_streams) + *nb_coupled_streams = nondiegetic_channels != 0; + return 1; +} + static int validate_encoder_layout(const ChannelLayout *layout) { int s; @@ -240,6 +231,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b int pos[8] = {0}; int upsample; int frame_size; + int freq_size; opus_val16 channel_offset; opus_val32 bandE[21]; opus_val16 maskLogE[3][21]; @@ -250,6 +242,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b upsample = resampling_factor(rate); frame_size = len*upsample; + freq_size = IMIN(960, frame_size); /* LM = log2(frame_size / 120) */ for (LM=0;LM<celt_mode->maxLM;LM++) @@ -258,7 +251,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b ALLOC(in, frame_size+overlap, opus_val32); ALLOC(x, len, opus_val16); - ALLOC(freq, frame_size, opus_val32); + ALLOC(freq, freq_size, opus_val32); channel_pos(channels, pos); @@ -268,8 +261,11 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b for (c=0;c<channels;c++) { + int frame; + int nb_frames = frame_size/freq_size; + celt_assert(nb_frames*freq_size == frame_size); OPUS_COPY(in, mem+c*overlap, overlap); - (*copy_channel_in)(x, 1, pcm, channels, c, len); + (*copy_channel_in)(x, 1, pcm, channels, c, len, NULL); celt_preemphasis(x, in+overlap, frame_size, 1, upsample, celt_mode->preemph, preemph_mem+c, 0); #ifndef FIXED_POINT { @@ -284,18 +280,26 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b } } #endif - clt_mdct_forward(&celt_mode->mdct, in, freq, celt_mode->window, - overlap, celt_mode->maxLM-LM, 1, arch); - if (upsample != 1) + OPUS_CLEAR(bandE, 21); + for (frame=0;frame<nb_frames;frame++) { - int bound = len; - for (i=0;i<bound;i++) - freq[i] *= upsample; - for (;i<frame_size;i++) - freq[i] = 0; - } + opus_val32 tmpE[21]; + clt_mdct_forward(&celt_mode->mdct, in+960*frame, freq, celt_mode->window, + overlap, celt_mode->maxLM-LM, 1, arch); + if (upsample != 1) + { + int bound = freq_size/upsample; + for (i=0;i<bound;i++) + freq[i] *= upsample; + for (;i<freq_size;i++) + freq[i] = 0; + } - compute_band_energies(celt_mode, freq, bandE, 21, 1, LM); + compute_band_energies(celt_mode, freq, tmpE, 21, 1, LM, arch); + /* If we have multiple frames, take the max energy. */ + for (i=0;i<21;i++) + bandE[i] = MAX32(bandE[i], tmpE[i]); + } amp2Log2(celt_mode, 21, 21, bandE, bandLogE+21*c, 1); /* Apply spreading function with -6 dB/band going up and -12 dB/band going down. */ for (i=1;i<21;i++) @@ -408,12 +412,10 @@ opus_int32 opus_multistream_surround_encoder_get_size(int channels, int mapping_ { nb_streams=channels; nb_coupled_streams=0; -#ifdef ENABLE_EXPERIMENTAL_AMBISONICS - } else if (mapping_family==254) + } else if (mapping_family==2) { - nb_streams=channels; - nb_coupled_streams=0; -#endif + if (!validate_ambisonics(channels, &nb_streams, &nb_coupled_streams)) + return 0; } else return 0; size = opus_multistream_encoder_get_size(nb_streams, nb_coupled_streams); @@ -448,7 +450,6 @@ static int opus_multistream_encoder_init_impl( st->layout.nb_channels = channels; st->layout.nb_streams = streams; st->layout.nb_coupled_streams = coupled_streams; - st->subframe_mem[0]=st->subframe_mem[1]=st->subframe_mem[2]=0; if (mapping_type != MAPPING_TYPE_SURROUND) st->lfe_stream = -1; st->bitrate_bps = OPUS_AUTO; @@ -456,7 +457,13 @@ static int opus_multistream_encoder_init_impl( st->variable_duration = OPUS_FRAMESIZE_ARG; for (i=0;i<st->layout.nb_channels;i++) st->layout.mapping[i] = mapping[i]; - if (!validate_layout(&st->layout) || !validate_encoder_layout(&st->layout)) + if (!validate_layout(&st->layout)) + return OPUS_BAD_ARG; + if (mapping_type == MAPPING_TYPE_SURROUND && + !validate_encoder_layout(&st->layout)) + return OPUS_BAD_ARG; + if (mapping_type == MAPPING_TYPE_AMBISONICS && + !validate_ambisonics(st->layout.nb_channels, NULL, NULL)) return OPUS_BAD_ARG; ptr = (char*)st + align(sizeof(OpusMSEncoder)); coupled_size = opus_encoder_get_size(2); @@ -549,25 +556,23 @@ int opus_multistream_surround_encoder_init( *coupled_streams=0; for(i=0;i<channels;i++) mapping[i] = i; -#ifdef ENABLE_EXPERIMENTAL_AMBISONICS - } else if (mapping_family==254) + } else if (mapping_family==2) { int i; - *streams=channels; - *coupled_streams=0; - for(i=0;i<channels;i++) - mapping[i] = i; -#endif + if (!validate_ambisonics(channels, streams, coupled_streams)) + return OPUS_BAD_ARG; + for(i = 0; i < (*streams - *coupled_streams); i++) + mapping[i] = i + (*coupled_streams * 2); + for(i = 0; i < *coupled_streams * 2; i++) + mapping[i + (*streams - *coupled_streams)] = i; } else return OPUS_UNIMPLEMENTED; if (channels>2 && mapping_family==1) { mapping_type = MAPPING_TYPE_SURROUND; -#ifdef ENABLE_EXPERIMENTAL_AMBISONICS - } else if (mapping_family==254) + } else if (mapping_family==2) { mapping_type = MAPPING_TYPE_AMBISONICS; -#endif } else { mapping_type = MAPPING_TYPE_NONE; @@ -672,62 +677,62 @@ static void surround_rate_allocation( int lfe_offset; int coupled_ratio; /* Q8 */ int lfe_ratio; /* Q8 */ + int nb_lfe; + int nb_uncoupled; + int nb_coupled; + int nb_normal; + opus_int32 channel_offset; + opus_int32 bitrate; + int total; + + nb_lfe = (st->lfe_stream!=-1); + nb_coupled = st->layout.nb_coupled_streams; + nb_uncoupled = st->layout.nb_streams-nb_coupled-nb_lfe; + nb_normal = 2*nb_coupled + nb_uncoupled; + + /* Give each non-LFE channel enough bits per channel for coding band energy. */ + channel_offset = 40*IMAX(50, Fs/frame_size); - if (st->bitrate_bps > st->layout.nb_channels*40000) - stream_offset = 20000; - else - stream_offset = st->bitrate_bps/st->layout.nb_channels/2; - stream_offset += 60*(Fs/frame_size-50); - /* We start by giving each stream (coupled or uncoupled) the same bitrate. - This models the main saving of coupled channels over uncoupled. */ - /* The LFE stream is an exception to the above and gets fewer bits. */ - lfe_offset = 3500 + 60*(Fs/frame_size-50); - /* Coupled streams get twice the mono rate after the first 20 kb/s. */ - coupled_ratio = 512; - /* Should depend on the bitrate, for now we assume LFE gets 1/8 the bits of mono */ - lfe_ratio = 32; - - /* Compute bitrate allocation between streams */ if (st->bitrate_bps==OPUS_AUTO) { - channel_rate = Fs+60*Fs/frame_size; + bitrate = nb_normal*(channel_offset + Fs + 10000) + 8000*nb_lfe; } else if (st->bitrate_bps==OPUS_BITRATE_MAX) { - channel_rate = 300000; + bitrate = nb_normal*300000 + nb_lfe*128000; } else { - int nb_lfe; - int nb_uncoupled; - int nb_coupled; - int total; - nb_lfe = (st->lfe_stream!=-1); - nb_coupled = st->layout.nb_coupled_streams; - nb_uncoupled = st->layout.nb_streams-nb_coupled-nb_lfe; - total = (nb_uncoupled<<8) /* mono */ - + coupled_ratio*nb_coupled /* stereo */ - + nb_lfe*lfe_ratio; - channel_rate = 256*(st->bitrate_bps-lfe_offset*nb_lfe-stream_offset*(nb_coupled+nb_uncoupled))/total; + bitrate = st->bitrate_bps; } -#ifndef FIXED_POINT - if (st->variable_duration==OPUS_FRAMESIZE_VARIABLE && frame_size != Fs/50) - { - opus_int32 bonus; - bonus = 60*(Fs/frame_size-50); - channel_rate += bonus; - } -#endif + + /* Give LFE some basic stream_channel allocation but never exceed 1/20 of the + total rate for the non-energy part to avoid problems at really low rate. */ + lfe_offset = IMIN(bitrate/20, 3000) + 15*IMAX(50, Fs/frame_size); + + /* We give each stream (coupled or uncoupled) a starting bitrate. + This models the main saving of coupled channels over uncoupled. */ + stream_offset = (bitrate - channel_offset*nb_normal - lfe_offset*nb_lfe)/nb_normal/2; + stream_offset = IMAX(0, IMIN(20000, stream_offset)); + + /* Coupled streams get twice the mono rate after the offset is allocated. */ + coupled_ratio = 512; + /* Should depend on the bitrate, for now we assume LFE gets 1/8 the bits of mono */ + lfe_ratio = 32; + + total = (nb_uncoupled<<8) /* mono */ + + coupled_ratio*nb_coupled /* stereo */ + + nb_lfe*lfe_ratio; + channel_rate = 256*(opus_int64)(bitrate - lfe_offset*nb_lfe - stream_offset*(nb_coupled+nb_uncoupled) - channel_offset*nb_normal)/total; for (i=0;i<st->layout.nb_streams;i++) { if (i<st->layout.nb_coupled_streams) - rate[i] = stream_offset+(channel_rate*coupled_ratio>>8); + rate[i] = 2*channel_offset + IMAX(0, stream_offset+(channel_rate*coupled_ratio>>8)); else if (i!=st->lfe_stream) - rate[i] = stream_offset+channel_rate; + rate[i] = channel_offset + IMAX(0, stream_offset + channel_rate); else - rate[i] = lfe_offset+(channel_rate*lfe_ratio>>8); + rate[i] = IMAX(0, lfe_offset+(channel_rate*lfe_ratio>>8)); } } -#ifdef ENABLE_EXPERIMENTAL_AMBISONICS static void ambisonics_rate_allocation( OpusMSEncoder *st, opus_int32 *rate, @@ -736,50 +741,31 @@ static void ambisonics_rate_allocation( ) { int i; - int non_mono_rate; - int total_rate; + opus_int32 total_rate; + opus_int32 per_stream_rate; - /* The mono channel gets (rate_ratio_num / rate_ratio_den) times as many bits - * as all other channels */ - const int rate_ratio_num = 4; - const int rate_ratio_den = 3; - const int num_channels = st->layout.nb_streams; + const int nb_channels = st->layout.nb_streams + st->layout.nb_coupled_streams; if (st->bitrate_bps==OPUS_AUTO) { - total_rate = num_channels * (20000 + st->layout.nb_streams*(Fs+60*Fs/frame_size)); + total_rate = (st->layout.nb_coupled_streams + st->layout.nb_streams) * + (Fs+60*Fs/frame_size) + st->layout.nb_streams * (opus_int32)15000; } else if (st->bitrate_bps==OPUS_BITRATE_MAX) { - total_rate = num_channels * 320000; - } else { - total_rate = st->bitrate_bps; - } - - /* Let y be the non-mono rate and let p, q be integers such that the mono - * channel rate is (p/q) * y. - * Also let T be the total bitrate to allocate. Then - * (n - 1) y + (p/q) y = T - * y = (T q) / (qn - q + p) - */ - non_mono_rate = - total_rate * rate_ratio_den - / (rate_ratio_den*num_channels + rate_ratio_num - rate_ratio_den); - -#ifndef FIXED_POINT - if (st->variable_duration==OPUS_FRAMESIZE_VARIABLE && frame_size != Fs/50) + total_rate = nb_channels * 320000; + } else { - opus_int32 bonus = 60*(Fs/frame_size-50); - non_mono_rate += bonus; + total_rate = st->bitrate_bps; } -#endif - rate[0] = total_rate - (num_channels - 1) * non_mono_rate; - for (i=1;i<st->layout.nb_streams;i++) + /* Allocate equal number of bits to Ambisonic (uncoupled) and non-diegetic + * (coupled) streams */ + per_stream_rate = total_rate / st->layout.nb_streams; + for (i = 0; i < st->layout.nb_streams; i++) { - rate[i] = non_mono_rate; + rate[i] = per_stream_rate; } } -#endif /* ENABLE_EXPERIMENTAL_AMBISONICS */ static opus_int32 rate_allocation( OpusMSEncoder *st, @@ -795,11 +781,9 @@ static opus_int32 rate_allocation( ptr = (char*)st + align(sizeof(OpusMSEncoder)); opus_encoder_ctl((OpusEncoder*)ptr, OPUS_GET_SAMPLE_RATE(&Fs)); -#ifdef ENABLE_EXPERIMENTAL_AMBISONICS if (st->mapping_type == MAPPING_TYPE_AMBISONICS) { ambisonics_rate_allocation(st, rate, frame_size, Fs); } else -#endif { surround_rate_allocation(st, rate, frame_size, Fs); } @@ -812,9 +796,9 @@ static opus_int32 rate_allocation( return rate_sum; } -/* Max size in case the encoder decides to return three frames */ -#define MS_FRAME_TMP (3*1275+7) -static int opus_multistream_encode_native +/* Max size in case the encoder decides to return six frames (6 x 20 ms = 120 ms) */ +#define MS_FRAME_TMP (6*1275+12) +int opus_multistream_encode_native ( OpusMSEncoder *st, opus_copy_channel_in_func copy_channel_in, @@ -824,7 +808,8 @@ static int opus_multistream_encode_native opus_int32 max_data_bytes, int lsb_depth, downmix_func downmix, - int float_api + int float_api, + void *user_data ) { opus_int32 Fs; @@ -859,32 +844,8 @@ static int opus_multistream_encode_native opus_encoder_ctl((OpusEncoder*)ptr, OPUS_GET_VBR(&vbr)); opus_encoder_ctl((OpusEncoder*)ptr, CELT_GET_MODE(&celt_mode)); - { - opus_int32 delay_compensation; - int channels; - - channels = st->layout.nb_streams + st->layout.nb_coupled_streams; - opus_encoder_ctl((OpusEncoder*)ptr, OPUS_GET_LOOKAHEAD(&delay_compensation)); - delay_compensation -= Fs/400; - frame_size = compute_frame_size(pcm, analysis_frame_size, - st->variable_duration, channels, Fs, st->bitrate_bps, - delay_compensation, downmix -#ifndef DISABLE_FLOAT_API - , st->subframe_mem -#endif - ); - } - - if (400*frame_size < Fs) - { - RESTORE_STACK; - return OPUS_BAD_ARG; - } - /* Validate frame_size before using it to allocate stack space. - This mirrors the checks in opus_encode[_float](). */ - if (400*frame_size != Fs && 200*frame_size != Fs && - 100*frame_size != Fs && 50*frame_size != Fs && - 25*frame_size != Fs && 50*frame_size != 3*Fs) + frame_size = frame_size_select(analysis_frame_size, st->variable_duration, Fs); + if (frame_size <= 0) { RESTORE_STACK; return OPUS_BAD_ARG; @@ -892,6 +853,9 @@ static int opus_multistream_encode_native /* Smallest packet the encoder can produce. */ smallest_packet = st->layout.nb_streams*2-1; + /* 100 ms needs an extra byte per stream for the ToC. */ + if (Fs/frame_size == 10) + smallest_packet += st->layout.nb_streams; if (max_data_bytes < smallest_packet) { RESTORE_STACK; @@ -952,11 +916,9 @@ static int opus_multistream_encode_native opus_encoder_ctl(enc, OPUS_SET_FORCE_CHANNELS(2)); } } -#ifdef ENABLE_EXPERIMENTAL_AMBISONICS else if (st->mapping_type == MAPPING_TYPE_AMBISONICS) { opus_encoder_ctl(enc, OPUS_SET_FORCE_MODE(MODE_CELT_ONLY)); } -#endif } ptr = (char*)st + align(sizeof(OpusMSEncoder)); @@ -979,9 +941,9 @@ static int opus_multistream_encode_native left = get_left_channel(&st->layout, s, -1); right = get_right_channel(&st->layout, s, -1); (*copy_channel_in)(buf, 2, - pcm, st->layout.nb_channels, left, frame_size); + pcm, st->layout.nb_channels, left, frame_size, user_data); (*copy_channel_in)(buf+1, 2, - pcm, st->layout.nb_channels, right, frame_size); + pcm, st->layout.nb_channels, right, frame_size, user_data); ptr += align(coupled_size); if (st->mapping_type == MAPPING_TYPE_SURROUND) { @@ -997,7 +959,7 @@ static int opus_multistream_encode_native int i; int chan = get_mono_channel(&st->layout, s, -1); (*copy_channel_in)(buf, 1, - pcm, st->layout.nb_channels, chan, frame_size); + pcm, st->layout.nb_channels, chan, frame_size, user_data); ptr += align(mono_size); if (st->mapping_type == MAPPING_TYPE_SURROUND) { @@ -1013,6 +975,9 @@ static int opus_multistream_encode_native curr_max = max_data_bytes - tot_size; /* Reserve one byte for the last stream and two for the others */ curr_max -= IMAX(0,2*(st->layout.nb_streams-s-1)-1); + /* For 100 ms, reserve an extra byte per stream for the ToC */ + if (Fs/frame_size == 10) + curr_max -= st->layout.nb_streams-s-1; curr_max = IMIN(curr_max,MS_FRAME_TMP); /* Repacketizer will add one or two bytes for self-delimited frames */ if (s != st->layout.nb_streams-1) curr_max -= curr_max>253 ? 2 : 1; @@ -1053,11 +1018,13 @@ static void opus_copy_channel_in_float( const void *src, int src_stride, int src_channel, - int frame_size + int frame_size, + void *user_data ) { const float *float_src; opus_int32 i; + (void)user_data; float_src = (const float *)src; for (i=0;i<frame_size;i++) #if defined(FIXED_POINT) @@ -1074,11 +1041,13 @@ static void opus_copy_channel_in_short( const void *src, int src_stride, int src_channel, - int frame_size + int frame_size, + void *user_data ) { const opus_int16 *short_src; opus_int32 i; + (void)user_data; short_src = (const opus_int16 *)src; for (i=0;i<frame_size;i++) #if defined(FIXED_POINT) @@ -1099,7 +1068,7 @@ int opus_multistream_encode( ) { return opus_multistream_encode_native(st, opus_copy_channel_in_short, - pcm, frame_size, data, max_data_bytes, 16, downmix_int, 0); + pcm, frame_size, data, max_data_bytes, 16, downmix_int, 0, NULL); } #ifndef DISABLE_FLOAT_API @@ -1112,7 +1081,7 @@ int opus_multistream_encode_float( ) { return opus_multistream_encode_native(st, opus_copy_channel_in_float, - pcm, frame_size, data, max_data_bytes, 16, downmix_float, 1); + pcm, frame_size, data, max_data_bytes, 16, downmix_float, 1, NULL); } #endif @@ -1128,7 +1097,7 @@ int opus_multistream_encode_float ) { return opus_multistream_encode_native(st, opus_copy_channel_in_float, - pcm, frame_size, data, max_data_bytes, 24, downmix_float, 1); + pcm, frame_size, data, max_data_bytes, 24, downmix_float, 1, NULL); } int opus_multistream_encode( @@ -1140,19 +1109,17 @@ int opus_multistream_encode( ) { return opus_multistream_encode_native(st, opus_copy_channel_in_short, - pcm, frame_size, data, max_data_bytes, 16, downmix_int, 0); + pcm, frame_size, data, max_data_bytes, 16, downmix_int, 0, NULL); } #endif -int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) +int opus_multistream_encoder_ctl_va_list(OpusMSEncoder *st, int request, + va_list ap) { - va_list ap; int coupled_size, mono_size; char *ptr; int ret = OPUS_OK; - va_start(ap, request); - coupled_size = opus_encoder_get_size(2); mono_size = opus_encoder_get_size(1); ptr = (char*)st + align(sizeof(OpusMSEncoder)); @@ -1161,9 +1128,11 @@ int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) case OPUS_SET_BITRATE_REQUEST: { opus_int32 value = va_arg(ap, opus_int32); - if (value<0 && value!=OPUS_AUTO && value!=OPUS_BITRATE_MAX) + if (value != OPUS_AUTO && value != OPUS_BITRATE_MAX) { - goto bad_arg; + if (value <= 0) + goto bad_arg; + value = IMIN(300000*st->layout.nb_channels, IMAX(500*st->layout.nb_channels, value)); } st->bitrate_bps = value; } @@ -1206,6 +1175,7 @@ int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) case OPUS_GET_INBAND_FEC_REQUEST: case OPUS_GET_FORCE_CHANNELS_REQUEST: case OPUS_GET_PREDICTION_DISABLED_REQUEST: + case OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST: { OpusEncoder *enc; /* For int32* GET params, just query the first stream */ @@ -1252,6 +1222,7 @@ int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) case OPUS_SET_FORCE_MODE_REQUEST: case OPUS_SET_FORCE_CHANNELS_REQUEST: case OPUS_SET_PREDICTION_DISABLED_REQUEST: + case OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST: { int s; /* This works for int32 params */ @@ -1278,7 +1249,7 @@ int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OpusEncoder **value; stream_id = va_arg(ap, opus_int32); if (stream_id<0 || stream_id >= st->layout.nb_streams) - ret = OPUS_BAD_ARG; + goto bad_arg; value = va_arg(ap, OpusEncoder**); if (!value) { @@ -1313,7 +1284,6 @@ int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) case OPUS_RESET_STATE: { int s; - st->subframe_mem[0] = st->subframe_mem[1] = st->subframe_mem[2] = 0; if (st->mapping_type == MAPPING_TYPE_SURROUND) { OPUS_CLEAR(ms_get_preemph_mem(st), st->layout.nb_channels); @@ -1337,14 +1307,21 @@ int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) ret = OPUS_UNIMPLEMENTED; break; } - - va_end(ap); return ret; bad_arg: - va_end(ap); return OPUS_BAD_ARG; } +int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) +{ + int ret; + va_list ap; + va_start(ap, request); + ret = opus_multistream_encoder_ctl_va_list(st, request, ap); + va_end(ap); + return ret; +} + void opus_multistream_encoder_destroy(OpusMSEncoder *st) { opus_free(st); diff --git a/thirdparty/opus/opus_private.h b/thirdparty/opus/opus_private.h index 3b62eed096..5e2463f546 100644 --- a/thirdparty/opus/opus_private.h +++ b/thirdparty/opus/opus_private.h @@ -33,6 +33,7 @@ #include "opus.h" #include "celt.h" +#include <stdarg.h> /* va_list */ #include <stddef.h> /* offsetof */ struct OpusRepacketizer { @@ -50,12 +51,59 @@ typedef struct ChannelLayout { unsigned char mapping[256]; } ChannelLayout; +typedef enum { + MAPPING_TYPE_NONE, + MAPPING_TYPE_SURROUND, + MAPPING_TYPE_AMBISONICS +} MappingType; + +struct OpusMSEncoder { + ChannelLayout layout; + int arch; + int lfe_stream; + int application; + int variable_duration; + MappingType mapping_type; + opus_int32 bitrate_bps; + /* Encoder states go here */ + /* then opus_val32 window_mem[channels*120]; */ + /* then opus_val32 preemph_mem[channels]; */ +}; + +struct OpusMSDecoder { + ChannelLayout layout; + /* Decoder states go here */ +}; + +int opus_multistream_encoder_ctl_va_list(struct OpusMSEncoder *st, int request, + va_list ap); +int opus_multistream_decoder_ctl_va_list(struct OpusMSDecoder *st, int request, + va_list ap); + int validate_layout(const ChannelLayout *layout); int get_left_channel(const ChannelLayout *layout, int stream_id, int prev); int get_right_channel(const ChannelLayout *layout, int stream_id, int prev); int get_mono_channel(const ChannelLayout *layout, int stream_id, int prev); - +typedef void (*opus_copy_channel_in_func)( + opus_val16 *dst, + int dst_stride, + const void *src, + int src_stride, + int src_channel, + int frame_size, + void *user_data +); + +typedef void (*opus_copy_channel_out_func)( + void *dst, + int dst_stride, + int dst_channel, + const opus_val16 *src, + int src_stride, + int frame_size, + void *user_data +); #define MODE_SILK_ONLY 1000 #define MODE_HYBRID 1001 @@ -87,19 +135,12 @@ int get_mono_channel(const ChannelLayout *layout, int stream_id, int prev); typedef void (*downmix_func)(const void *, opus_val32 *, int, int, int, int, int); void downmix_float(const void *_x, opus_val32 *sub, int subframe, int offset, int c1, int c2, int C); void downmix_int(const void *_x, opus_val32 *sub, int subframe, int offset, int c1, int c2, int C); +int is_digital_silence(const opus_val16* pcm, int frame_size, int channels, int lsb_depth); int encode_size(int size, unsigned char *data); opus_int32 frame_size_select(opus_int32 frame_size, int variable_duration, opus_int32 Fs); -opus_int32 compute_frame_size(const void *analysis_pcm, int frame_size, - int variable_duration, int C, opus_int32 Fs, int bitrate_bps, - int delay_compensation, downmix_func downmix -#ifndef DISABLE_FLOAT_API - , float *subframe_mem -#endif - ); - opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_size, unsigned char *data, opus_int32 out_data_bytes, int lsb_depth, const void *analysis_pcm, opus_int32 analysis_size, int c1, int c2, @@ -131,4 +172,30 @@ opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int int pad_frame(unsigned char *data, opus_int32 len, opus_int32 new_len); +int opus_multistream_encode_native +( + struct OpusMSEncoder *st, + opus_copy_channel_in_func copy_channel_in, + const void *pcm, + int analysis_frame_size, + unsigned char *data, + opus_int32 max_data_bytes, + int lsb_depth, + downmix_func downmix, + int float_api, + void *user_data +); + +int opus_multistream_decode_native( + struct OpusMSDecoder *st, + const unsigned char *data, + opus_int32 len, + void *pcm, + opus_copy_channel_out_func copy_channel_out, + int frame_size, + int decode_fec, + int soft_clip, + void *user_data +); + #endif /* OPUS_PRIVATE_H */ diff --git a/thirdparty/opus/opus_projection_decoder.c b/thirdparty/opus/opus_projection_decoder.c new file mode 100644 index 0000000000..c2e07d5bcf --- /dev/null +++ b/thirdparty/opus/opus_projection_decoder.c @@ -0,0 +1,258 @@ +/* Copyright (c) 2017 Google Inc. + Written by Andrew Allen */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mathops.h" +#include "os_support.h" +#include "opus_private.h" +#include "opus_defines.h" +#include "opus_projection.h" +#include "opus_multistream.h" +#include "mapping_matrix.h" +#include "stack_alloc.h" + +struct OpusProjectionDecoder +{ + opus_int32 demixing_matrix_size_in_bytes; + /* Encoder states go here */ +}; + +#if !defined(DISABLE_FLOAT_API) +static void opus_projection_copy_channel_out_float( + void *dst, + int dst_stride, + int dst_channel, + const opus_val16 *src, + int src_stride, + int frame_size, + void *user_data) +{ + float *float_dst; + const MappingMatrix *matrix; + float_dst = (float *)dst; + matrix = (const MappingMatrix *)user_data; + + if (dst_channel == 0) + OPUS_CLEAR(float_dst, frame_size * dst_stride); + + if (src != NULL) + mapping_matrix_multiply_channel_out_float(matrix, src, dst_channel, + src_stride, float_dst, dst_stride, frame_size); +} +#endif + +static void opus_projection_copy_channel_out_short( + void *dst, + int dst_stride, + int dst_channel, + const opus_val16 *src, + int src_stride, + int frame_size, + void *user_data) +{ + opus_int16 *short_dst; + const MappingMatrix *matrix; + short_dst = (opus_int16 *)dst; + matrix = (const MappingMatrix *)user_data; + if (dst_channel == 0) + OPUS_CLEAR(short_dst, frame_size * dst_stride); + + if (src != NULL) + mapping_matrix_multiply_channel_out_short(matrix, src, dst_channel, + src_stride, short_dst, dst_stride, frame_size); +} + +static MappingMatrix *get_dec_demixing_matrix(OpusProjectionDecoder *st) +{ + /* void* cast avoids clang -Wcast-align warning */ + return (MappingMatrix*)(void*)((char*)st + + align(sizeof(OpusProjectionDecoder))); +} + +static OpusMSDecoder *get_multistream_decoder(OpusProjectionDecoder *st) +{ + /* void* cast avoids clang -Wcast-align warning */ + return (OpusMSDecoder*)(void*)((char*)st + + align(sizeof(OpusProjectionDecoder) + + st->demixing_matrix_size_in_bytes)); +} + +opus_int32 opus_projection_decoder_get_size(int channels, int streams, + int coupled_streams) +{ + opus_int32 matrix_size; + opus_int32 decoder_size; + + matrix_size = + mapping_matrix_get_size(streams + coupled_streams, channels); + if (!matrix_size) + return 0; + + decoder_size = opus_multistream_decoder_get_size(streams, coupled_streams); + if (!decoder_size) + return 0; + + return align(sizeof(OpusProjectionDecoder)) + matrix_size + decoder_size; +} + +int opus_projection_decoder_init(OpusProjectionDecoder *st, opus_int32 Fs, + int channels, int streams, int coupled_streams, + unsigned char *demixing_matrix, opus_int32 demixing_matrix_size) +{ + int nb_input_streams; + opus_int32 expected_matrix_size; + int i, ret; + unsigned char mapping[255]; + VARDECL(opus_int16, buf); + ALLOC_STACK; + + /* Verify supplied matrix size. */ + nb_input_streams = streams + coupled_streams; + expected_matrix_size = nb_input_streams * channels * sizeof(opus_int16); + if (expected_matrix_size != demixing_matrix_size) + { + RESTORE_STACK; + return OPUS_BAD_ARG; + } + + /* Convert demixing matrix input into internal format. */ + ALLOC(buf, nb_input_streams * channels, opus_int16); + for (i = 0; i < nb_input_streams * channels; i++) + { + int s = demixing_matrix[2*i + 1] << 8 | demixing_matrix[2*i]; + s = ((s & 0xFFFF) ^ 0x8000) - 0x8000; + buf[i] = (opus_int16)s; + } + + /* Assign demixing matrix. */ + st->demixing_matrix_size_in_bytes = + mapping_matrix_get_size(channels, nb_input_streams); + if (!st->demixing_matrix_size_in_bytes) + { + RESTORE_STACK; + return OPUS_BAD_ARG; + } + + mapping_matrix_init(get_dec_demixing_matrix(st), channels, nb_input_streams, 0, + buf, demixing_matrix_size); + + /* Set trivial mapping so each input channel pairs with a matrix column. */ + for (i = 0; i < channels; i++) + mapping[i] = i; + + ret = opus_multistream_decoder_init( + get_multistream_decoder(st), Fs, channels, streams, coupled_streams, mapping); + RESTORE_STACK; + return ret; +} + +OpusProjectionDecoder *opus_projection_decoder_create( + opus_int32 Fs, int channels, int streams, int coupled_streams, + unsigned char *demixing_matrix, opus_int32 demixing_matrix_size, int *error) +{ + int size; + int ret; + OpusProjectionDecoder *st; + + /* Allocate space for the projection decoder. */ + size = opus_projection_decoder_get_size(channels, streams, coupled_streams); + if (!size) { + if (error) + *error = OPUS_ALLOC_FAIL; + return NULL; + } + st = (OpusProjectionDecoder *)opus_alloc(size); + if (!st) + { + if (error) + *error = OPUS_ALLOC_FAIL; + return NULL; + } + + /* Initialize projection decoder with provided settings. */ + ret = opus_projection_decoder_init(st, Fs, channels, streams, coupled_streams, + demixing_matrix, demixing_matrix_size); + if (ret != OPUS_OK) + { + opus_free(st); + st = NULL; + } + if (error) + *error = ret; + return st; +} + +#ifdef FIXED_POINT +int opus_projection_decode(OpusProjectionDecoder *st, const unsigned char *data, + opus_int32 len, opus_int16 *pcm, int frame_size, + int decode_fec) +{ + return opus_multistream_decode_native(get_multistream_decoder(st), data, len, + pcm, opus_projection_copy_channel_out_short, frame_size, decode_fec, 0, + get_dec_demixing_matrix(st)); +} +#else +int opus_projection_decode(OpusProjectionDecoder *st, const unsigned char *data, + opus_int32 len, opus_int16 *pcm, int frame_size, + int decode_fec) +{ + return opus_multistream_decode_native(get_multistream_decoder(st), data, len, + pcm, opus_projection_copy_channel_out_short, frame_size, decode_fec, 1, + get_dec_demixing_matrix(st)); +} +#endif + +#ifndef DISABLE_FLOAT_API +int opus_projection_decode_float(OpusProjectionDecoder *st, const unsigned char *data, + opus_int32 len, float *pcm, int frame_size, int decode_fec) +{ + return opus_multistream_decode_native(get_multistream_decoder(st), data, len, + pcm, opus_projection_copy_channel_out_float, frame_size, decode_fec, 0, + get_dec_demixing_matrix(st)); +} +#endif + +int opus_projection_decoder_ctl(OpusProjectionDecoder *st, int request, ...) +{ + va_list ap; + int ret = OPUS_OK; + + va_start(ap, request); + ret = opus_multistream_decoder_ctl_va_list(get_multistream_decoder(st), + request, ap); + va_end(ap); + return ret; +} + +void opus_projection_decoder_destroy(OpusProjectionDecoder *st) +{ + opus_free(st); +} + diff --git a/thirdparty/opus/opus_projection_encoder.c b/thirdparty/opus/opus_projection_encoder.c new file mode 100644 index 0000000000..06fb2d2526 --- /dev/null +++ b/thirdparty/opus/opus_projection_encoder.c @@ -0,0 +1,468 @@ +/* Copyright (c) 2017 Google Inc. + Written by Andrew Allen */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mathops.h" +#include "os_support.h" +#include "opus_private.h" +#include "opus_defines.h" +#include "opus_projection.h" +#include "opus_multistream.h" +#include "stack_alloc.h" +#include "mapping_matrix.h" + +struct OpusProjectionEncoder +{ + opus_int32 mixing_matrix_size_in_bytes; + opus_int32 demixing_matrix_size_in_bytes; + /* Encoder states go here */ +}; + +#if !defined(DISABLE_FLOAT_API) +static void opus_projection_copy_channel_in_float( + opus_val16 *dst, + int dst_stride, + const void *src, + int src_stride, + int src_channel, + int frame_size, + void *user_data +) +{ + mapping_matrix_multiply_channel_in_float((const MappingMatrix*)user_data, + (const float*)src, src_stride, dst, src_channel, dst_stride, frame_size); +} +#endif + +static void opus_projection_copy_channel_in_short( + opus_val16 *dst, + int dst_stride, + const void *src, + int src_stride, + int src_channel, + int frame_size, + void *user_data +) +{ + mapping_matrix_multiply_channel_in_short((const MappingMatrix*)user_data, + (const opus_int16*)src, src_stride, dst, src_channel, dst_stride, frame_size); +} + +static int get_order_plus_one_from_channels(int channels, int *order_plus_one) +{ + int order_plus_one_; + int acn_channels; + int nondiegetic_channels; + + /* Allowed numbers of channels: + * (1 + n)^2 + 2j, for n = 0...14 and j = 0 or 1. + */ + if (channels < 1 || channels > 227) + return OPUS_BAD_ARG; + + order_plus_one_ = isqrt32(channels); + acn_channels = order_plus_one_ * order_plus_one_; + nondiegetic_channels = channels - acn_channels; + if (nondiegetic_channels != 0 && nondiegetic_channels != 2) + return OPUS_BAD_ARG; + + if (order_plus_one) + *order_plus_one = order_plus_one_; + return OPUS_OK; +} + +static int get_streams_from_channels(int channels, int mapping_family, + int *streams, int *coupled_streams, + int *order_plus_one) +{ + if (mapping_family == 3) + { + if (get_order_plus_one_from_channels(channels, order_plus_one) != OPUS_OK) + return OPUS_BAD_ARG; + if (streams) + *streams = (channels + 1) / 2; + if (coupled_streams) + *coupled_streams = channels / 2; + return OPUS_OK; + } + return OPUS_BAD_ARG; +} + +static MappingMatrix *get_mixing_matrix(OpusProjectionEncoder *st) +{ + /* void* cast avoids clang -Wcast-align warning */ + return (MappingMatrix *)(void*)((char*)st + + align(sizeof(OpusProjectionEncoder))); +} + +static MappingMatrix *get_enc_demixing_matrix(OpusProjectionEncoder *st) +{ + /* void* cast avoids clang -Wcast-align warning */ + return (MappingMatrix *)(void*)((char*)st + + align(sizeof(OpusProjectionEncoder) + + st->mixing_matrix_size_in_bytes)); +} + +static OpusMSEncoder *get_multistream_encoder(OpusProjectionEncoder *st) +{ + /* void* cast avoids clang -Wcast-align warning */ + return (OpusMSEncoder *)(void*)((char*)st + + align(sizeof(OpusProjectionEncoder) + + st->mixing_matrix_size_in_bytes + + st->demixing_matrix_size_in_bytes)); +} + +opus_int32 opus_projection_ambisonics_encoder_get_size(int channels, + int mapping_family) +{ + int nb_streams; + int nb_coupled_streams; + int order_plus_one; + int mixing_matrix_rows, mixing_matrix_cols; + int demixing_matrix_rows, demixing_matrix_cols; + opus_int32 mixing_matrix_size, demixing_matrix_size; + opus_int32 encoder_size; + int ret; + + ret = get_streams_from_channels(channels, mapping_family, &nb_streams, + &nb_coupled_streams, &order_plus_one); + if (ret != OPUS_OK) + return 0; + + if (order_plus_one == 2) + { + mixing_matrix_rows = mapping_matrix_foa_mixing.rows; + mixing_matrix_cols = mapping_matrix_foa_mixing.cols; + demixing_matrix_rows = mapping_matrix_foa_demixing.rows; + demixing_matrix_cols = mapping_matrix_foa_demixing.cols; + } + else if (order_plus_one == 3) + { + mixing_matrix_rows = mapping_matrix_soa_mixing.rows; + mixing_matrix_cols = mapping_matrix_soa_mixing.cols; + demixing_matrix_rows = mapping_matrix_soa_demixing.rows; + demixing_matrix_cols = mapping_matrix_soa_demixing.cols; + } + else if (order_plus_one == 4) + { + mixing_matrix_rows = mapping_matrix_toa_mixing.rows; + mixing_matrix_cols = mapping_matrix_toa_mixing.cols; + demixing_matrix_rows = mapping_matrix_toa_demixing.rows; + demixing_matrix_cols = mapping_matrix_toa_demixing.cols; + } + else + return 0; + + mixing_matrix_size = + mapping_matrix_get_size(mixing_matrix_rows, mixing_matrix_cols); + if (!mixing_matrix_size) + return 0; + + demixing_matrix_size = + mapping_matrix_get_size(demixing_matrix_rows, demixing_matrix_cols); + if (!demixing_matrix_size) + return 0; + + encoder_size = + opus_multistream_encoder_get_size(nb_streams, nb_coupled_streams); + if (!encoder_size) + return 0; + + return align(sizeof(OpusProjectionEncoder)) + + mixing_matrix_size + demixing_matrix_size + encoder_size; +} + +int opus_projection_ambisonics_encoder_init(OpusProjectionEncoder *st, opus_int32 Fs, + int channels, int mapping_family, + int *streams, int *coupled_streams, + int application) +{ + MappingMatrix *mixing_matrix; + MappingMatrix *demixing_matrix; + OpusMSEncoder *ms_encoder; + int i; + int ret; + int order_plus_one; + unsigned char mapping[255]; + + if (streams == NULL || coupled_streams == NULL) { + return OPUS_BAD_ARG; + } + + if (get_streams_from_channels(channels, mapping_family, streams, + coupled_streams, &order_plus_one) != OPUS_OK) + return OPUS_BAD_ARG; + + if (mapping_family == 3) + { + /* Assign mixing matrix based on available pre-computed matrices. */ + mixing_matrix = get_mixing_matrix(st); + if (order_plus_one == 2) + { + mapping_matrix_init(mixing_matrix, mapping_matrix_foa_mixing.rows, + mapping_matrix_foa_mixing.cols, mapping_matrix_foa_mixing.gain, + mapping_matrix_foa_mixing_data, + sizeof(mapping_matrix_foa_mixing_data)); + } + else if (order_plus_one == 3) + { + mapping_matrix_init(mixing_matrix, mapping_matrix_soa_mixing.rows, + mapping_matrix_soa_mixing.cols, mapping_matrix_soa_mixing.gain, + mapping_matrix_soa_mixing_data, + sizeof(mapping_matrix_soa_mixing_data)); + } + else if (order_plus_one == 4) + { + mapping_matrix_init(mixing_matrix, mapping_matrix_toa_mixing.rows, + mapping_matrix_toa_mixing.cols, mapping_matrix_toa_mixing.gain, + mapping_matrix_toa_mixing_data, + sizeof(mapping_matrix_toa_mixing_data)); + } + else + return OPUS_BAD_ARG; + + st->mixing_matrix_size_in_bytes = mapping_matrix_get_size( + mixing_matrix->rows, mixing_matrix->cols); + if (!st->mixing_matrix_size_in_bytes) + return OPUS_BAD_ARG; + + /* Assign demixing matrix based on available pre-computed matrices. */ + demixing_matrix = get_enc_demixing_matrix(st); + if (order_plus_one == 2) + { + mapping_matrix_init(demixing_matrix, mapping_matrix_foa_demixing.rows, + mapping_matrix_foa_demixing.cols, mapping_matrix_foa_demixing.gain, + mapping_matrix_foa_demixing_data, + sizeof(mapping_matrix_foa_demixing_data)); + } + else if (order_plus_one == 3) + { + mapping_matrix_init(demixing_matrix, mapping_matrix_soa_demixing.rows, + mapping_matrix_soa_demixing.cols, mapping_matrix_soa_demixing.gain, + mapping_matrix_soa_demixing_data, + sizeof(mapping_matrix_soa_demixing_data)); + } + else if (order_plus_one == 4) + { + mapping_matrix_init(demixing_matrix, mapping_matrix_toa_demixing.rows, + mapping_matrix_toa_demixing.cols, mapping_matrix_toa_demixing.gain, + mapping_matrix_toa_demixing_data, + sizeof(mapping_matrix_toa_demixing_data)); + } + else + return OPUS_BAD_ARG; + + st->demixing_matrix_size_in_bytes = mapping_matrix_get_size( + demixing_matrix->rows, demixing_matrix->cols); + if (!st->demixing_matrix_size_in_bytes) + return OPUS_BAD_ARG; + } + else + return OPUS_UNIMPLEMENTED; + + /* Ensure matrices are large enough for desired coding scheme. */ + if (*streams + *coupled_streams > mixing_matrix->rows || + channels > mixing_matrix->cols || + channels > demixing_matrix->rows || + *streams + *coupled_streams > demixing_matrix->cols) + return OPUS_BAD_ARG; + + /* Set trivial mapping so each input channel pairs with a matrix column. */ + for (i = 0; i < channels; i++) + mapping[i] = i; + + /* Initialize multistream encoder with provided settings. */ + ms_encoder = get_multistream_encoder(st); + ret = opus_multistream_encoder_init(ms_encoder, Fs, channels, *streams, + *coupled_streams, mapping, application); + return ret; +} + +OpusProjectionEncoder *opus_projection_ambisonics_encoder_create( + opus_int32 Fs, int channels, int mapping_family, int *streams, + int *coupled_streams, int application, int *error) +{ + int size; + int ret; + OpusProjectionEncoder *st; + + /* Allocate space for the projection encoder. */ + size = opus_projection_ambisonics_encoder_get_size(channels, mapping_family); + if (!size) { + if (error) + *error = OPUS_ALLOC_FAIL; + return NULL; + } + st = (OpusProjectionEncoder *)opus_alloc(size); + if (!st) + { + if (error) + *error = OPUS_ALLOC_FAIL; + return NULL; + } + + /* Initialize projection encoder with provided settings. */ + ret = opus_projection_ambisonics_encoder_init(st, Fs, channels, + mapping_family, streams, coupled_streams, application); + if (ret != OPUS_OK) + { + opus_free(st); + st = NULL; + } + if (error) + *error = ret; + return st; +} + +int opus_projection_encode(OpusProjectionEncoder *st, const opus_int16 *pcm, + int frame_size, unsigned char *data, + opus_int32 max_data_bytes) +{ + return opus_multistream_encode_native(get_multistream_encoder(st), + opus_projection_copy_channel_in_short, pcm, frame_size, data, + max_data_bytes, 16, downmix_int, 0, get_mixing_matrix(st)); +} + +#ifndef DISABLE_FLOAT_API +#ifdef FIXED_POINT +int opus_projection_encode_float(OpusProjectionEncoder *st, const float *pcm, + int frame_size, unsigned char *data, + opus_int32 max_data_bytes) +{ + return opus_multistream_encode_native(get_multistream_encoder(st), + opus_projection_copy_channel_in_float, pcm, frame_size, data, + max_data_bytes, 16, downmix_float, 1, get_mixing_matrix(st)); +} +#else +int opus_projection_encode_float(OpusProjectionEncoder *st, const float *pcm, + int frame_size, unsigned char *data, + opus_int32 max_data_bytes) +{ + return opus_multistream_encode_native(get_multistream_encoder(st), + opus_projection_copy_channel_in_float, pcm, frame_size, data, + max_data_bytes, 24, downmix_float, 1, get_mixing_matrix(st)); +} +#endif +#endif + +void opus_projection_encoder_destroy(OpusProjectionEncoder *st) +{ + opus_free(st); +} + +int opus_projection_encoder_ctl(OpusProjectionEncoder *st, int request, ...) +{ + va_list ap; + MappingMatrix *demixing_matrix; + OpusMSEncoder *ms_encoder; + int ret = OPUS_OK; + + ms_encoder = get_multistream_encoder(st); + demixing_matrix = get_enc_demixing_matrix(st); + + va_start(ap, request); + switch(request) + { + case OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST: + { + opus_int32 *value = va_arg(ap, opus_int32*); + if (!value) + { + goto bad_arg; + } + *value = + ms_encoder->layout.nb_channels * (ms_encoder->layout.nb_streams + + ms_encoder->layout.nb_coupled_streams) * sizeof(opus_int16); + } + break; + case OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST: + { + opus_int32 *value = va_arg(ap, opus_int32*); + if (!value) + { + goto bad_arg; + } + *value = demixing_matrix->gain; + } + break; + case OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST: + { + int i, j, k, l; + int nb_input_streams; + int nb_output_streams; + unsigned char *external_char; + opus_int16 *internal_short; + opus_int32 external_size; + opus_int32 internal_size; + + /* (I/O is in relation to the decoder's perspective). */ + nb_input_streams = ms_encoder->layout.nb_streams + + ms_encoder->layout.nb_coupled_streams; + nb_output_streams = ms_encoder->layout.nb_channels; + + external_char = va_arg(ap, unsigned char *); + external_size = va_arg(ap, opus_int32); + if (!external_char) + { + goto bad_arg; + } + internal_short = mapping_matrix_get_data(demixing_matrix); + internal_size = nb_input_streams * nb_output_streams * sizeof(opus_int16); + if (external_size != internal_size) + { + goto bad_arg; + } + + /* Copy demixing matrix subset to output destination. */ + l = 0; + for (i = 0; i < nb_input_streams; i++) { + for (j = 0; j < nb_output_streams; j++) { + k = demixing_matrix->rows * i + j; + external_char[2*l] = (unsigned char)internal_short[k]; + external_char[2*l+1] = (unsigned char)(internal_short[k] >> 8); + l++; + } + } + } + break; + default: + { + ret = opus_multistream_encoder_ctl_va_list(ms_encoder, request, ap); + } + break; + } + va_end(ap); + return ret; + +bad_arg: + va_end(ap); + return OPUS_BAD_ARG; +} + diff --git a/thirdparty/opus/opusfile.c b/thirdparty/opus/opusfile.c index b8b3a354cf..8b000a2c58 100644 --- a/thirdparty/opus/opusfile.c +++ b/thirdparty/opus/opusfile.c @@ -86,14 +86,15 @@ int op_test(OpusHead *_head, This is to prevent us spending a lot of time allocating memory and looking for Ogg pages in non-Ogg files.*/ if(memcmp(_initial_data,"OggS",4)!=0)return OP_ENOTFORMAT; + if(OP_UNLIKELY(_initial_bytes>(size_t)LONG_MAX))return OP_EFAULT; ogg_sync_init(&oy); - data=ogg_sync_buffer(&oy,_initial_bytes); + data=ogg_sync_buffer(&oy,(long)_initial_bytes); if(data!=NULL){ ogg_stream_state os; ogg_page og; int ret; memcpy(data,_initial_data,_initial_bytes); - ogg_sync_wrote(&oy,_initial_bytes); + ogg_sync_wrote(&oy,(long)_initial_bytes); ogg_stream_init(&os,-1); err=OP_FALSE; do{ @@ -147,7 +148,7 @@ static int op_get_data(OggOpusFile *_of,int _nbytes){ int nbytes; OP_ASSERT(_nbytes>0); buffer=(unsigned char *)ogg_sync_buffer(&_of->oy,_nbytes); - nbytes=(int)(*_of->callbacks.read)(_of->source,buffer,_nbytes); + nbytes=(int)(*_of->callbacks.read)(_of->stream,buffer,_nbytes); OP_ASSERT(nbytes<=_nbytes); if(OP_LIKELY(nbytes>0))ogg_sync_wrote(&_of->oy,nbytes); return nbytes; @@ -157,7 +158,7 @@ static int op_get_data(OggOpusFile *_of,int _nbytes){ static int op_seek_helper(OggOpusFile *_of,opus_int64 _offset){ if(_offset==_of->offset)return 0; if(_of->callbacks.seek==NULL - ||(*_of->callbacks.seek)(_of->source,_offset,SEEK_SET)){ + ||(*_of->callbacks.seek)(_of->stream,_offset,SEEK_SET)){ return OP_EREAD; } _of->offset=_offset; @@ -165,7 +166,7 @@ static int op_seek_helper(OggOpusFile *_of,opus_int64 _offset){ return 0; } -/*Get the current position indicator of the underlying source. +/*Get the current position indicator of the underlying stream. This should be the same as the value reported by tell().*/ static opus_int64 op_position(const OggOpusFile *_of){ /*The current position indicator is _not_ simply offset. @@ -369,7 +370,7 @@ static int op_get_prev_page_serial(OggOpusFile *_of,OpusSeekRecord *_sr, search_start=llret+1; } /*We started from the beginning of the stream and found nothing. - This should be impossible unless the contents of the source changed out + This should be impossible unless the contents of the stream changed out from under us after we read from it.*/ if(OP_UNLIKELY(!begin)&&OP_UNLIKELY(_offset<0))return OP_EBADLINK; /*Bump up the chunk size. @@ -455,7 +456,7 @@ static opus_int64 op_get_last_page(OggOpusFile *_of,ogg_int64_t *_gp, } } /*We started from at or before the beginning of the link and found nothing. - This should be impossible unless the contents of the source changed out + This should be impossible unless the contents of the stream changed out from under us after we read from it.*/ if((OP_UNLIKELY(left_link)||OP_UNLIKELY(!begin))&&OP_UNLIKELY(_offset<0)){ return OP_EBADLINK; @@ -855,6 +856,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, /*Fail if the pre-skip is non-zero, since it's asking us to skip more samples than exist.*/ if(_link->head.pre_skip>0)return OP_EBADTIMESTAMP; + _link->pcm_file_offset=0; /*Set pcm_end and end_offset so we can skip the call to op_find_final_pcm_offset().*/ _link->pcm_start=_link->pcm_end=0; @@ -866,7 +868,8 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, if(_link->head.pre_skip>0)return OP_EBADTIMESTAMP; /*Set pcm_end and end_offset so we can skip the call to op_find_final_pcm_offset().*/ - _link->pcm_end=_link->pcm_start=0; + _link->pcm_file_offset=0; + _link->pcm_start=_link->pcm_end=0; _link->end_offset=_link->data_offset; /*Tell the caller we've got a buffered page for them.*/ return 1; @@ -951,6 +954,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, /*Update the packet count after end-trimming.*/ _of->op_count=pi; _of->cur_discard_count=_link->head.pre_skip; + _link->pcm_file_offset=0; _of->prev_packet_gp=_link->pcm_start=pcm_start; _of->prev_page_offset=page_offset; return 0; @@ -1271,6 +1275,7 @@ static int op_bisect_forward_serialno(OggOpusFile *_of, always starts with a seek.*/ ret=op_find_initial_pcm_offset(_of,links+nlinks,NULL); if(OP_UNLIKELY(ret<0))return ret; + links[nlinks].pcm_file_offset=total_duration; _searched=_of->offset; /*Mark the current link count so it can be cleaned up on error.*/ _of->nlinks=++nlinks; @@ -1390,8 +1395,8 @@ static int op_open_seekable2_impl(OggOpusFile *_of){ opus_int64 data_offset; int ret; /*We can seek, so set out learning all about this file.*/ - (*_of->callbacks.seek)(_of->source,0,SEEK_END); - _of->offset=_of->end=(*_of->callbacks.tell)(_of->source); + (*_of->callbacks.seek)(_of->stream,0,SEEK_END); + _of->offset=_of->end=(*_of->callbacks.tell)(_of->stream); if(OP_UNLIKELY(_of->end<0))return OP_EREAD; data_offset=_of->links[0].data_offset; if(OP_UNLIKELY(_of->end<data_offset))return OP_EBADLINK; @@ -1436,7 +1441,7 @@ static int op_open_seekable2(OggOpusFile *_of){ prev_page_offset=_of->prev_page_offset; start_offset=_of->offset; memcpy(op_start,_of->op,sizeof(*op_start)*start_op_count); - OP_ASSERT((*_of->callbacks.tell)(_of->source)==op_position(_of)); + OP_ASSERT((*_of->callbacks.tell)(_of->stream)==op_position(_of)); ogg_sync_init(&_of->oy); ogg_stream_init(&_of->os,-1); ret=op_open_seekable2_impl(_of); @@ -1454,7 +1459,7 @@ static int op_open_seekable2(OggOpusFile *_of){ _of->cur_discard_count=_of->links[0].head.pre_skip; if(OP_UNLIKELY(ret<0))return ret; /*And restore the position indicator.*/ - ret=(*_of->callbacks.seek)(_of->source,op_position(_of),SEEK_SET); + ret=(*_of->callbacks.seek)(_of->stream,op_position(_of),SEEK_SET); return OP_UNLIKELY(ret<0)?OP_EREAD:0; } @@ -1493,19 +1498,20 @@ static void op_clear(OggOpusFile *_of){ _ogg_free(_of->serialnos); ogg_stream_clear(&_of->os); ogg_sync_clear(&_of->oy); - if(_of->callbacks.close!=NULL)(*_of->callbacks.close)(_of->source); + if(_of->callbacks.close!=NULL)(*_of->callbacks.close)(_of->stream); } static int op_open1(OggOpusFile *_of, - void *_source,const OpusFileCallbacks *_cb, + void *_stream,const OpusFileCallbacks *_cb, const unsigned char *_initial_data,size_t _initial_bytes){ ogg_page og; ogg_page *pog; int seekable; int ret; memset(_of,0,sizeof(*_of)); + if(OP_UNLIKELY(_initial_bytes>(size_t)LONG_MAX))return OP_EFAULT; _of->end=-1; - _of->source=_source; + _of->stream=_stream; *&_of->callbacks=*_cb; /*At a minimum, we need to be able to read data.*/ if(OP_UNLIKELY(_of->callbacks.read==NULL))return OP_EREAD; @@ -1520,18 +1526,18 @@ static int op_open1(OggOpusFile *_of, decoding entire files from RAM.*/ if(_initial_bytes>0){ char *buffer; - buffer=ogg_sync_buffer(&_of->oy,_initial_bytes); + buffer=ogg_sync_buffer(&_of->oy,(long)_initial_bytes); memcpy(buffer,_initial_data,_initial_bytes*sizeof(*buffer)); - ogg_sync_wrote(&_of->oy,_initial_bytes); + ogg_sync_wrote(&_of->oy,(long)_initial_bytes); } /*Can we seek? Stevens suggests the seek test is portable.*/ - seekable=_cb->seek!=NULL&&(*_cb->seek)(_source,0,SEEK_CUR)!=-1; + seekable=_cb->seek!=NULL&&(*_cb->seek)(_stream,0,SEEK_CUR)!=-1; /*If seek is implemented, tell must also be implemented.*/ if(seekable){ opus_int64 pos; if(OP_UNLIKELY(_of->callbacks.tell==NULL))return OP_EINVAL; - pos=(*_of->callbacks.tell)(_of->source); + pos=(*_of->callbacks.tell)(_of->stream); /*If the current position is not equal to the initial bytes consumed, absolute seeking will not work.*/ if(OP_UNLIKELY(pos!=(opus_int64)_initial_bytes))return OP_EINVAL; @@ -1590,14 +1596,14 @@ static int op_open2(OggOpusFile *_of){ return ret; } -OggOpusFile *op_test_callbacks(void *_source,const OpusFileCallbacks *_cb, +OggOpusFile *op_test_callbacks(void *_stream,const OpusFileCallbacks *_cb, const unsigned char *_initial_data,size_t _initial_bytes,int *_error){ OggOpusFile *of; int ret; of=(OggOpusFile *)_ogg_malloc(sizeof(*of)); ret=OP_EFAULT; if(OP_LIKELY(of!=NULL)){ - ret=op_open1(of,_source,_cb,_initial_data,_initial_bytes); + ret=op_open1(of,_stream,_cb,_initial_data,_initial_bytes); if(OP_LIKELY(ret>=0)){ if(_error!=NULL)*_error=0; return of; @@ -1611,10 +1617,10 @@ OggOpusFile *op_test_callbacks(void *_source,const OpusFileCallbacks *_cb, return NULL; } -OggOpusFile *op_open_callbacks(void *_source,const OpusFileCallbacks *_cb, +OggOpusFile *op_open_callbacks(void *_stream,const OpusFileCallbacks *_cb, const unsigned char *_initial_data,size_t _initial_bytes,int *_error){ OggOpusFile *of; - of=op_test_callbacks(_source,_cb,_initial_data,_initial_bytes,_error); + of=op_test_callbacks(_stream,_cb,_initial_data,_initial_bytes,_error); if(OP_LIKELY(of!=NULL)){ int ret; ret=op_open2(of); @@ -1627,15 +1633,15 @@ OggOpusFile *op_open_callbacks(void *_source,const OpusFileCallbacks *_cb, /*Convenience routine to clean up from failure for the open functions that create their own streams.*/ -static OggOpusFile *op_open_close_on_failure(void *_source, +static OggOpusFile *op_open_close_on_failure(void *_stream, const OpusFileCallbacks *_cb,int *_error){ OggOpusFile *of; - if(OP_UNLIKELY(_source==NULL)){ + if(OP_UNLIKELY(_stream==NULL)){ if(_error!=NULL)*_error=OP_EFAULT; return NULL; } - of=op_open_callbacks(_source,_cb,NULL,0,_error); - if(OP_UNLIKELY(of==NULL))(*_cb->close)(_source); + of=op_open_callbacks(_stream,_cb,NULL,0,_error); + if(OP_UNLIKELY(of==NULL))(*_cb->close)(_stream); return of; } @@ -1653,15 +1659,15 @@ OggOpusFile *op_open_memory(const unsigned char *_data,size_t _size, /*Convenience routine to clean up from failure for the open functions that create their own streams.*/ -static OggOpusFile *op_test_close_on_failure(void *_source, +static OggOpusFile *op_test_close_on_failure(void *_stream, const OpusFileCallbacks *_cb,int *_error){ OggOpusFile *of; - if(OP_UNLIKELY(_source==NULL)){ + if(OP_UNLIKELY(_stream==NULL)){ if(_error!=NULL)*_error=OP_EFAULT; return NULL; } - of=op_test_callbacks(_source,_cb,NULL,0,_error); - if(OP_UNLIKELY(of==NULL))(*_cb->close)(_source); + of=op_test_callbacks(_stream,_cb,NULL,0,_error); + if(OP_UNLIKELY(of==NULL))(*_cb->close)(_stream); return of; } @@ -1702,7 +1708,7 @@ int op_link_count(const OggOpusFile *_of){ return _of->nlinks; } -ogg_uint32_t op_serialno(const OggOpusFile *_of,int _li){ +opus_uint32 op_serialno(const OggOpusFile *_of,int _li){ if(OP_UNLIKELY(_li>=_of->nlinks))_li=_of->nlinks-1; if(!_of->seekable)_li=0; return _of->links[_li<0?_of->cur_link:_li].serialno; @@ -1718,13 +1724,14 @@ opus_int64 op_raw_total(const OggOpusFile *_of,int _li){ ||OP_UNLIKELY(_li>=_of->nlinks)){ return OP_EINVAL; } - if(_li<0)return _of->end-_of->links[0].offset; + if(_li<0)return _of->end; return (_li+1>=_of->nlinks?_of->end:_of->links[_li+1].offset) - -_of->links[_li].offset; + -(_li>0?_of->links[_li].offset:0); } ogg_int64_t op_pcm_total(const OggOpusFile *_of,int _li){ OggOpusLink *links; + ogg_int64_t pcm_total; ogg_int64_t diff; int nlinks; nlinks=_of->nlinks; @@ -1737,20 +1744,14 @@ ogg_int64_t op_pcm_total(const OggOpusFile *_of,int _li){ /*We verify that the granule position differences are larger than the pre-skip and that the total duration does not overflow during link enumeration, so we don't have to check here.*/ + pcm_total=0; if(_li<0){ - ogg_int64_t pcm_total; - int li; - pcm_total=0; - for(li=0;li<nlinks;li++){ - OP_ALWAYS_TRUE(!op_granpos_diff(&diff, - links[li].pcm_end,links[li].pcm_start)); - pcm_total+=diff-links[li].head.pre_skip; - } - return pcm_total; + pcm_total=links[nlinks-1].pcm_file_offset; + _li=nlinks-1; } OP_ALWAYS_TRUE(!op_granpos_diff(&diff, links[_li].pcm_end,links[_li].pcm_start)); - return diff-links[_li].head.pre_skip; + return pcm_total+diff-links[_li].head.pre_skip; } const OpusHead *op_head(const OggOpusFile *_of,int _li){ @@ -1820,6 +1821,34 @@ opus_int32 op_bitrate_instant(OggOpusFile *_of){ return ret; } +/*Given a serialno, find a link with a corresponding Opus stream, if it exists. + Return: The index of the link to which the page belongs, or a negative number + if it was not a desired Opus bitstream section.*/ +static int op_get_link_from_serialno(const OggOpusFile *_of,int _cur_link, + opus_int64 _page_offset,ogg_uint32_t _serialno){ + const OggOpusLink *links; + int nlinks; + int li_lo; + int li_hi; + OP_ASSERT(_of->seekable); + links=_of->links; + nlinks=_of->nlinks; + li_lo=0; + /*Start off by guessing we're just a multiplexed page in the current link.*/ + li_hi=_cur_link+1<nlinks&&_page_offset<links[_cur_link+1].offset? + _cur_link+1:nlinks; + do{ + if(_page_offset>=links[_cur_link].offset)li_lo=_cur_link; + else li_hi=_cur_link; + _cur_link=li_lo+(li_hi-li_lo>>1); + } + while(li_hi-li_lo>1); + /*We've identified the link that should contain this page. + Make sure it's a page we care about.*/ + if(links[_cur_link].serialno!=_serialno)return OP_FALSE; + return _cur_link; +} + /*Fetch and process a page. This handles the case where we're at a bitstream boundary and dumps the decoding machine. @@ -1876,19 +1905,28 @@ static int op_fetch_and_process_page(OggOpusFile *_of, if(OP_UNLIKELY(_of->ready_state<OP_STREAMSET)){ if(seekable){ ogg_uint32_t serialno; - int nlinks; - int li; serialno=ogg_page_serialno(&og); - /*Match the serialno to bitstream section. - We use this rather than offset positions to avoid problems near - logical bitstream boundaries.*/ - nlinks=_of->nlinks; - for(li=0;li<nlinks&&links[li].serialno!=serialno;li++); - /*Not a desired Opus bitstream section. - Keep trying.*/ - if(li>=nlinks)continue; + /*Match the serialno to bitstream section.*/ + OP_ASSERT(cur_link>=0&&cur_link<_of->nlinks); + if(links[cur_link].serialno!=serialno){ + /*It wasn't a page from the current link. + Is it from the next one?*/ + if(OP_LIKELY(cur_link+1<_of->nlinks&&links[cur_link+1].serialno== + serialno)){ + cur_link++; + } + else{ + int new_link; + new_link= + op_get_link_from_serialno(_of,cur_link,_page_offset,serialno); + /*Not a desired Opus bitstream section. + Keep trying.*/ + if(new_link<0)continue; + cur_link=new_link; + } + } cur_serialno=serialno; - _of->cur_link=cur_link=li; + _of->cur_link=cur_link; ogg_stream_reset_serialno(&_of->os,serialno); _of->ready_state=OP_STREAMSET; /*If we're at the start of this link, initialize the granule position @@ -1942,13 +1980,32 @@ static int op_fetch_and_process_page(OggOpusFile *_of, opus_int32 total_duration; int durations[255]; int op_count; + int report_hole; + report_hole=0; total_duration=op_collect_audio_packets(_of,durations); if(OP_UNLIKELY(total_duration<0)){ - /*Drain the packets from the page anyway.*/ + /*libogg reported a hole (a gap in the page sequence numbers). + Drain the packets from the page anyway. + If we don't, they'll still be there when we fetch the next page. + Then, when we go to pull out packets, we might get more than 255, + which would overrun our packet buffer.*/ total_duration=op_collect_audio_packets(_of,durations); OP_ASSERT(total_duration>=0); - /*Report holes to the caller.*/ - if(!_ignore_holes)return OP_HOLE; + if(!_ignore_holes){ + /*Report the hole to the caller after we finish timestamping the + packets.*/ + report_hole=1; + /*We had lost or damaged pages, so reset our granule position + tracking. + This makes holes behave the same as a small raw seek. + If the next page is the EOS page, we'll discard it (because we + can't perform end trimming properly), and we'll always discard at + least 80 ms of audio (to allow decoder state to re-converge). + We could try to fill in the gap with PLC by looking at timestamps + in the non-EOS case, but that's complicated and error prone and we + can't rely on the timestamps being valid.*/ + _of->prev_packet_gp=-1; + } } op_count=_of->op_count; /*If we found at least one audio data packet, compute per-packet granule @@ -1975,6 +2032,7 @@ static int op_fetch_and_process_page(OggOpusFile *_of, Proceed to the next link, rather than risk playing back some samples that shouldn't have been played.*/ _of->op_count=0; + if(report_hole)return OP_HOLE; continue; } /*By default discard 80 ms of data after a seek, unless we seek @@ -2020,7 +2078,11 @@ static int op_fetch_and_process_page(OggOpusFile *_of, &&OP_LIKELY(diff<total_duration)){ cur_packet_gp=prev_packet_gp; for(pi=0;pi<op_count;pi++){ - diff=durations[pi]-diff; + /*Check for overflow.*/ + if(diff<0&&OP_UNLIKELY(OP_INT64_MAX+diff<durations[pi])){ + diff=durations[pi]+1; + } + else diff=durations[pi]-diff; /*If we have samples to trim...*/ if(diff>0){ /*If we trimmed the entire packet, stop (the spec says encoders @@ -2076,10 +2138,11 @@ static int op_fetch_and_process_page(OggOpusFile *_of, } _of->prev_packet_gp=prev_packet_gp; _of->prev_page_offset=_page_offset; - _of->op_count=pi; - /*If end-trimming didn't trim all the packets, we're done.*/ - if(OP_LIKELY(pi>0))return 0; + _of->op_count=op_count=pi; } + if(report_hole)return OP_HOLE; + /*If end-trimming didn't trim all the packets, we're done.*/ + if(op_count>0)return 0; } } } @@ -2117,35 +2180,41 @@ static ogg_int64_t op_get_granulepos(const OggOpusFile *_of, ogg_int64_t _pcm_offset,int *_li){ const OggOpusLink *links; ogg_int64_t duration; + ogg_int64_t pcm_start; + opus_int32 pre_skip; int nlinks; - int li; + int li_lo; + int li_hi; OP_ASSERT(_pcm_offset>=0); nlinks=_of->nlinks; links=_of->links; - for(li=0;OP_LIKELY(li<nlinks);li++){ - ogg_int64_t pcm_start; - opus_int32 pre_skip; - pcm_start=links[li].pcm_start; - pre_skip=links[li].head.pre_skip; - OP_ALWAYS_TRUE(!op_granpos_diff(&duration,links[li].pcm_end,pcm_start)); - duration-=pre_skip; - if(_pcm_offset<duration){ - _pcm_offset+=pre_skip; - if(OP_UNLIKELY(pcm_start>OP_INT64_MAX-_pcm_offset)){ - /*Adding this amount to the granule position would overflow the positive - half of its 64-bit range. - Since signed overflow is undefined in C, do it in a way the compiler - isn't allowed to screw up.*/ - _pcm_offset-=OP_INT64_MAX-pcm_start+1; - pcm_start=OP_INT64_MIN; - } - pcm_start+=_pcm_offset; - *_li=li; - return pcm_start; - } - _pcm_offset-=duration; - } - return -1; + li_lo=0; + li_hi=nlinks; + do{ + int li; + li=li_lo+(li_hi-li_lo>>1); + if(links[li].pcm_file_offset<=_pcm_offset)li_lo=li; + else li_hi=li; + } + while(li_hi-li_lo>1); + _pcm_offset-=links[li_lo].pcm_file_offset; + pcm_start=links[li_lo].pcm_start; + pre_skip=links[li_lo].head.pre_skip; + OP_ALWAYS_TRUE(!op_granpos_diff(&duration,links[li_lo].pcm_end,pcm_start)); + duration-=pre_skip; + if(_pcm_offset>=duration)return -1; + _pcm_offset+=pre_skip; + if(OP_UNLIKELY(pcm_start>OP_INT64_MAX-_pcm_offset)){ + /*Adding this amount to the granule position would overflow the positive + half of its 64-bit range. + Since signed overflow is undefined in C, do it in a way the compiler + isn't allowed to screw up.*/ + _pcm_offset-=OP_INT64_MAX-pcm_start+1; + pcm_start=OP_INT64_MIN; + } + pcm_start+=_pcm_offset; + *_li=li_lo; + return pcm_start; } /*A small helper to determine if an Ogg page contains data that continues onto @@ -2532,15 +2601,14 @@ int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset){ ogg_int64_t gp; gp=_of->prev_packet_gp; if(OP_LIKELY(gp!=-1)){ - int nbuffered; + ogg_int64_t discard_count; + int nbuffered; nbuffered=OP_MAX(_of->od_buffer_size-_of->od_buffer_pos,0); OP_ALWAYS_TRUE(!op_granpos_add(&gp,gp,-nbuffered)); /*We do _not_ add cur_discard_count to gp. Otherwise the total amount to discard could grow without bound, and it would be better just to do a full seek.*/ - if(OP_LIKELY(!op_granpos_diff(&diff,gp,pcm_start))){ - ogg_int64_t discard_count; - discard_count=_pcm_offset-diff; + if(OP_LIKELY(!op_granpos_diff(&discard_count,target_gp,gp))){ /*We use a threshold of 90 ms instead of 80, since 80 ms is the _minimum_ we would have discarded after a full seek. Assuming 20 ms frames (the default), we'd discard 90 ms on average.*/ @@ -2606,22 +2674,14 @@ static ogg_int64_t op_get_pcm_offset(const OggOpusFile *_of, ogg_int64_t _gp,int _li){ const OggOpusLink *links; ogg_int64_t pcm_offset; - ogg_int64_t delta; - int li; links=_of->links; - pcm_offset=0; - OP_ASSERT(_li<_of->nlinks); - for(li=0;li<_li;li++){ - OP_ALWAYS_TRUE(!op_granpos_diff(&delta, - links[li].pcm_end,links[li].pcm_start)); - delta-=links[li].head.pre_skip; - pcm_offset+=delta; - } - OP_ASSERT(_li>=0); + OP_ASSERT(_li>=0&&_li<_of->nlinks); + pcm_offset=links[_li].pcm_file_offset; if(_of->seekable&&OP_UNLIKELY(op_granpos_cmp(_gp,links[_li].pcm_end)>0)){ _gp=links[_li].pcm_end; } if(OP_LIKELY(op_granpos_cmp(_gp,links[_li].pcm_start)>0)){ + ogg_int64_t delta; if(OP_UNLIKELY(op_granpos_diff(&delta,_gp,links[_li].pcm_start)<0)){ /*This means an unseekable stream claimed to have a page from more than 2 billion days after we joined.*/ diff --git a/thirdparty/opus/repacketizer.c b/thirdparty/opus/repacketizer.c index c80ee7f001..bda44a148a 100644 --- a/thirdparty/opus/repacketizer.c +++ b/thirdparty/opus/repacketizer.c @@ -213,7 +213,8 @@ opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int { /* Using OPUS_MOVE() instead of OPUS_COPY() in case we're doing in-place padding from opus_packet_pad or opus_packet_unpad(). */ - celt_assert(frames[i] + len[i] <= data || ptr <= frames[i]); + /* assert disabled because it's not valid in C. */ + /* celt_assert(frames[i] + len[i] <= data || ptr <= frames[i]); */ OPUS_MOVE(ptr, frames[i], len[i]); ptr += len[i]; } diff --git a/thirdparty/opus/silk/A2NLSF.c b/thirdparty/opus/silk/A2NLSF.c index b6e9e5ffcc..b487686ff9 100644 --- a/thirdparty/opus/silk/A2NLSF.c +++ b/thirdparty/opus/silk/A2NLSF.c @@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE. /* Number of binary divisions, when not in low complexity mode */ #define BIN_DIV_STEPS_A2NLSF_FIX 3 /* must be no higher than 16 - log2( LSF_COS_TAB_SZ_FIX ) */ -#define MAX_ITERATIONS_A2NLSF_FIX 30 +#define MAX_ITERATIONS_A2NLSF_FIX 16 /* Helper function for A2NLSF(..) */ /* Transforms polynomials from cos(n*f) to cos(f)^n */ @@ -130,7 +130,7 @@ void silk_A2NLSF( const opus_int d /* I Filter order (must be even) */ ) { - opus_int i, k, m, dd, root_ix, ffrac; + opus_int i, k, m, dd, root_ix, ffrac; opus_int32 xlo, xhi, xmid; opus_int32 ylo, yhi, ymid, thr; opus_int32 nom, den; @@ -239,13 +239,13 @@ void silk_A2NLSF( /* Set NLSFs to white spectrum and exit */ NLSF[ 0 ] = (opus_int16)silk_DIV32_16( 1 << 15, d + 1 ); for( k = 1; k < d; k++ ) { - NLSF[ k ] = (opus_int16)silk_SMULBB( k + 1, NLSF[ 0 ] ); + NLSF[ k ] = (opus_int16)silk_ADD16( NLSF[ k-1 ], NLSF[ 0 ] ); } return; } /* Error: Apply progressively more bandwidth expansion and run again */ - silk_bwexpander_32( a_Q16, d, 65536 - silk_SMULBB( 10 + i, i ) ); /* 10_Q16 = 0.00015*/ + silk_bwexpander_32( a_Q16, d, 65536 - silk_LSHIFT( 1, i ) ); silk_A2NLSF_init( a_Q16, P, Q, dd ); p = P; /* Pointer to polynomial */ diff --git a/thirdparty/opus/silk/API.h b/thirdparty/opus/silk/API.h index 0131acbb08..4d90ff9aa3 100644 --- a/thirdparty/opus/silk/API.h +++ b/thirdparty/opus/silk/API.h @@ -80,7 +80,8 @@ opus_int silk_Encode( /* O Returns error co opus_int nSamplesIn, /* I Number of samples in input vector */ ec_enc *psRangeEnc, /* I/O Compressor data structure */ opus_int32 *nBytesOut, /* I/O Number of bytes in payload (input: Max bytes) */ - const opus_int prefillFlag /* I Flag to indicate prefilling buffers no coding */ + const opus_int prefillFlag, /* I Flag to indicate prefilling buffers no coding */ + int activity /* I Decision of Opus voice activity detector */ ); /****************************************/ diff --git a/thirdparty/opus/silk/CNG.c b/thirdparty/opus/silk/CNG.c index 8443ad63bb..ef8e38df9f 100644 --- a/thirdparty/opus/silk/CNG.c +++ b/thirdparty/opus/silk/CNG.c @@ -138,16 +138,16 @@ void silk_CNG( gain_Q16 = silk_LSHIFT32( silk_SQRT_APPROX( gain_Q16 ), 8 ); } gain_Q10 = silk_RSHIFT( gain_Q16, 6 ); - + silk_CNG_exc( CNG_sig_Q14 + MAX_LPC_ORDER, psCNG->CNG_exc_buf_Q14, length, &psCNG->rand_seed ); /* Convert CNG NLSF to filter representation */ - silk_NLSF2A( A_Q12, psCNG->CNG_smth_NLSF_Q15, psDec->LPC_order ); + silk_NLSF2A( A_Q12, psCNG->CNG_smth_NLSF_Q15, psDec->LPC_order, psDec->arch ); /* Generate CNG signal, by synthesis filtering */ silk_memcpy( CNG_sig_Q14, psCNG->CNG_synth_state, MAX_LPC_ORDER * sizeof( opus_int32 ) ); + celt_assert( psDec->LPC_order == 10 || psDec->LPC_order == 16 ); for( i = 0; i < length; i++ ) { - silk_assert( psDec->LPC_order == 10 || psDec->LPC_order == 16 ); /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LPC_pred_Q10 = silk_RSHIFT( psDec->LPC_order, 1 ); LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, CNG_sig_Q14[ MAX_LPC_ORDER + i - 1 ], A_Q12[ 0 ] ); @@ -170,11 +170,11 @@ void silk_CNG( } /* Update states */ - CNG_sig_Q14[ MAX_LPC_ORDER + i ] = silk_ADD_LSHIFT( CNG_sig_Q14[ MAX_LPC_ORDER + i ], LPC_pred_Q10, 4 ); - + CNG_sig_Q14[ MAX_LPC_ORDER + i ] = silk_ADD_SAT32( CNG_sig_Q14[ MAX_LPC_ORDER + i ], silk_LSHIFT_SAT32( LPC_pred_Q10, 4 ) ); + /* Scale with Gain and add to input signal */ frame[ i ] = (opus_int16)silk_ADD_SAT16( frame[ i ], silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( CNG_sig_Q14[ MAX_LPC_ORDER + i ], gain_Q10 ), 8 ) ) ); - + } silk_memcpy( psCNG->CNG_synth_state, &CNG_sig_Q14[ length ], MAX_LPC_ORDER * sizeof( opus_int32 ) ); } else { diff --git a/thirdparty/opus/silk/LPC_analysis_filter.c b/thirdparty/opus/silk/LPC_analysis_filter.c index 20906673ff..d34b5eb709 100644 --- a/thirdparty/opus/silk/LPC_analysis_filter.c +++ b/thirdparty/opus/silk/LPC_analysis_filter.c @@ -39,6 +39,13 @@ POSSIBILITY OF SUCH DAMAGE. /* first d output samples are set to zero */ /*******************************************/ +/* OPT: Using celt_fir() for this function should be faster, but it may cause + integer overflows in intermediate values (not final results), which the + current implementation silences by casting to unsigned. Enabling + this should be safe in pretty much all cases, even though it is not technically + C89-compliant. */ +#define USE_CELT_FIR 0 + void silk_LPC_analysis_filter( opus_int16 *out, /* O Output signal */ const opus_int16 *in, /* I Input signal */ @@ -49,8 +56,7 @@ void silk_LPC_analysis_filter( ) { opus_int j; -#ifdef FIXED_POINT - opus_int16 mem[SILK_MAX_ORDER_LPC]; +#if defined(FIXED_POINT) && USE_CELT_FIR opus_int16 num[SILK_MAX_ORDER_LPC]; #else int ix; @@ -58,19 +64,16 @@ void silk_LPC_analysis_filter( const opus_int16 *in_ptr; #endif - silk_assert( d >= 6 ); - silk_assert( (d & 1) == 0 ); - silk_assert( d <= len ); + celt_assert( d >= 6 ); + celt_assert( (d & 1) == 0 ); + celt_assert( d <= len ); -#ifdef FIXED_POINT - silk_assert( d <= SILK_MAX_ORDER_LPC ); +#if defined(FIXED_POINT) && USE_CELT_FIR + celt_assert( d <= SILK_MAX_ORDER_LPC ); for ( j = 0; j < d; j++ ) { num[ j ] = -B[ j ]; } - for (j=0;j<d;j++) { - mem[ j ] = in[ d - j - 1 ]; - } - celt_fir( in + d, num, out + d, len - d, d, mem, arch ); + celt_fir( in + d, num, out + d, len - d, d, arch ); for ( j = 0; j < d; j++ ) { out[ j ] = 0; } diff --git a/thirdparty/opus/silk/LPC_fit.c b/thirdparty/opus/silk/LPC_fit.c new file mode 100644 index 0000000000..cdea4f3abc --- /dev/null +++ b/thirdparty/opus/silk/LPC_fit.c @@ -0,0 +1,81 @@ +/*********************************************************************** +Copyright (c) 2013, Koen Vos. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "SigProc_FIX.h" + +/* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around */ +void silk_LPC_fit( + opus_int16 *a_QOUT, /* O Output signal */ + opus_int32 *a_QIN, /* I/O Input signal */ + const opus_int QOUT, /* I Input Q domain */ + const opus_int QIN, /* I Input Q domain */ + const opus_int d /* I Filter order */ +) +{ + opus_int i, k, idx = 0; + opus_int32 maxabs, absval, chirp_Q16; + + /* Limit the maximum absolute value of the prediction coefficients, so that they'll fit in int16 */ + for( i = 0; i < 10; i++ ) { + /* Find maximum absolute value and its index */ + maxabs = 0; + for( k = 0; k < d; k++ ) { + absval = silk_abs( a_QIN[k] ); + if( absval > maxabs ) { + maxabs = absval; + idx = k; + } + } + maxabs = silk_RSHIFT_ROUND( maxabs, QIN - QOUT ); + + if( maxabs > silk_int16_MAX ) { + /* Reduce magnitude of prediction coefficients */ + maxabs = silk_min( maxabs, 163838 ); /* ( silk_int32_MAX >> 14 ) + silk_int16_MAX = 163838 */ + chirp_Q16 = SILK_FIX_CONST( 0.999, 16 ) - silk_DIV32( silk_LSHIFT( maxabs - silk_int16_MAX, 14 ), + silk_RSHIFT32( silk_MUL( maxabs, idx + 1), 2 ) ); + silk_bwexpander_32( a_QIN, d, chirp_Q16 ); + } else { + break; + } + } + + if( i == 10 ) { + /* Reached the last iteration, clip the coefficients */ + for( k = 0; k < d; k++ ) { + a_QOUT[ k ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( a_QIN[ k ], QIN - QOUT ) ); + a_QIN[ k ] = silk_LSHIFT( (opus_int32)a_QOUT[ k ], QIN - QOUT ); + } + } else { + for( k = 0; k < d; k++ ) { + a_QOUT[ k ] = (opus_int16)silk_RSHIFT_ROUND( a_QIN[ k ], QIN - QOUT ); + } + } +} diff --git a/thirdparty/opus/silk/LPC_inv_pred_gain.c b/thirdparty/opus/silk/LPC_inv_pred_gain.c index 4af89aa5fa..a3746a6ef9 100644 --- a/thirdparty/opus/silk/LPC_inv_pred_gain.c +++ b/thirdparty/opus/silk/LPC_inv_pred_gain.c @@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. #endif #include "SigProc_FIX.h" +#include "define.h" #define QA 24 #define A_LIMIT SILK_FIX_CONST( 0.99975, QA ) @@ -38,117 +39,103 @@ POSSIBILITY OF SUCH DAMAGE. /* Compute inverse of LPC prediction gain, and */ /* test if LPC coefficients are stable (all poles within unit circle) */ -static opus_int32 LPC_inverse_pred_gain_QA( /* O Returns inverse prediction gain in energy domain, Q30 */ - opus_int32 A_QA[ 2 ][ SILK_MAX_ORDER_LPC ], /* I Prediction coefficients */ +static opus_int32 LPC_inverse_pred_gain_QA_c( /* O Returns inverse prediction gain in energy domain, Q30 */ + opus_int32 A_QA[ SILK_MAX_ORDER_LPC ], /* I Prediction coefficients */ const opus_int order /* I Prediction order */ ) { opus_int k, n, mult2Q; - opus_int32 invGain_Q30, rc_Q31, rc_mult1_Q30, rc_mult2, tmp_QA; - opus_int32 *Aold_QA, *Anew_QA; + opus_int32 invGain_Q30, rc_Q31, rc_mult1_Q30, rc_mult2, tmp1, tmp2; - Anew_QA = A_QA[ order & 1 ]; - - invGain_Q30 = (opus_int32)1 << 30; + invGain_Q30 = SILK_FIX_CONST( 1, 30 ); for( k = order - 1; k > 0; k-- ) { /* Check for stability */ - if( ( Anew_QA[ k ] > A_LIMIT ) || ( Anew_QA[ k ] < -A_LIMIT ) ) { + if( ( A_QA[ k ] > A_LIMIT ) || ( A_QA[ k ] < -A_LIMIT ) ) { return 0; } /* Set RC equal to negated AR coef */ - rc_Q31 = -silk_LSHIFT( Anew_QA[ k ], 31 - QA ); + rc_Q31 = -silk_LSHIFT( A_QA[ k ], 31 - QA ); /* rc_mult1_Q30 range: [ 1 : 2^30 ] */ - rc_mult1_Q30 = ( (opus_int32)1 << 30 ) - silk_SMMUL( rc_Q31, rc_Q31 ); + rc_mult1_Q30 = silk_SUB32( SILK_FIX_CONST( 1, 30 ), silk_SMMUL( rc_Q31, rc_Q31 ) ); silk_assert( rc_mult1_Q30 > ( 1 << 15 ) ); /* reduce A_LIMIT if fails */ silk_assert( rc_mult1_Q30 <= ( 1 << 30 ) ); - /* rc_mult2 range: [ 2^30 : silk_int32_MAX ] */ - mult2Q = 32 - silk_CLZ32( silk_abs( rc_mult1_Q30 ) ); - rc_mult2 = silk_INVERSE32_varQ( rc_mult1_Q30, mult2Q + 30 ); - /* Update inverse gain */ /* invGain_Q30 range: [ 0 : 2^30 ] */ invGain_Q30 = silk_LSHIFT( silk_SMMUL( invGain_Q30, rc_mult1_Q30 ), 2 ); silk_assert( invGain_Q30 >= 0 ); silk_assert( invGain_Q30 <= ( 1 << 30 ) ); + if( invGain_Q30 < SILK_FIX_CONST( 1.0f / MAX_PREDICTION_POWER_GAIN, 30 ) ) { + return 0; + } - /* Swap pointers */ - Aold_QA = Anew_QA; - Anew_QA = A_QA[ k & 1 ]; + /* rc_mult2 range: [ 2^30 : silk_int32_MAX ] */ + mult2Q = 32 - silk_CLZ32( silk_abs( rc_mult1_Q30 ) ); + rc_mult2 = silk_INVERSE32_varQ( rc_mult1_Q30, mult2Q + 30 ); /* Update AR coefficient */ - for( n = 0; n < k; n++ ) { - tmp_QA = Aold_QA[ n ] - MUL32_FRAC_Q( Aold_QA[ k - n - 1 ], rc_Q31, 31 ); - Anew_QA[ n ] = MUL32_FRAC_Q( tmp_QA, rc_mult2 , mult2Q ); + for( n = 0; n < (k + 1) >> 1; n++ ) { + opus_int64 tmp64; + tmp1 = A_QA[ n ]; + tmp2 = A_QA[ k - n - 1 ]; + tmp64 = silk_RSHIFT_ROUND64( silk_SMULL( silk_SUB_SAT32(tmp1, + MUL32_FRAC_Q( tmp2, rc_Q31, 31 ) ), rc_mult2 ), mult2Q); + if( tmp64 > silk_int32_MAX || tmp64 < silk_int32_MIN ) { + return 0; + } + A_QA[ n ] = ( opus_int32 )tmp64; + tmp64 = silk_RSHIFT_ROUND64( silk_SMULL( silk_SUB_SAT32(tmp2, + MUL32_FRAC_Q( tmp1, rc_Q31, 31 ) ), rc_mult2), mult2Q); + if( tmp64 > silk_int32_MAX || tmp64 < silk_int32_MIN ) { + return 0; + } + A_QA[ k - n - 1 ] = ( opus_int32 )tmp64; } } /* Check for stability */ - if( ( Anew_QA[ 0 ] > A_LIMIT ) || ( Anew_QA[ 0 ] < -A_LIMIT ) ) { + if( ( A_QA[ k ] > A_LIMIT ) || ( A_QA[ k ] < -A_LIMIT ) ) { return 0; } /* Set RC equal to negated AR coef */ - rc_Q31 = -silk_LSHIFT( Anew_QA[ 0 ], 31 - QA ); + rc_Q31 = -silk_LSHIFT( A_QA[ 0 ], 31 - QA ); /* Range: [ 1 : 2^30 ] */ - rc_mult1_Q30 = ( (opus_int32)1 << 30 ) - silk_SMMUL( rc_Q31, rc_Q31 ); + rc_mult1_Q30 = silk_SUB32( SILK_FIX_CONST( 1, 30 ), silk_SMMUL( rc_Q31, rc_Q31 ) ); /* Update inverse gain */ /* Range: [ 0 : 2^30 ] */ invGain_Q30 = silk_LSHIFT( silk_SMMUL( invGain_Q30, rc_mult1_Q30 ), 2 ); - silk_assert( invGain_Q30 >= 0 ); - silk_assert( invGain_Q30 <= 1<<30 ); + silk_assert( invGain_Q30 >= 0 ); + silk_assert( invGain_Q30 <= ( 1 << 30 ) ); + if( invGain_Q30 < SILK_FIX_CONST( 1.0f / MAX_PREDICTION_POWER_GAIN, 30 ) ) { + return 0; + } return invGain_Q30; } /* For input in Q12 domain */ -opus_int32 silk_LPC_inverse_pred_gain( /* O Returns inverse prediction gain in energy domain, Q30 */ +opus_int32 silk_LPC_inverse_pred_gain_c( /* O Returns inverse prediction gain in energy domain, Q30 */ const opus_int16 *A_Q12, /* I Prediction coefficients, Q12 [order] */ const opus_int order /* I Prediction order */ ) { opus_int k; - opus_int32 Atmp_QA[ 2 ][ SILK_MAX_ORDER_LPC ]; - opus_int32 *Anew_QA; + opus_int32 Atmp_QA[ SILK_MAX_ORDER_LPC ]; opus_int32 DC_resp = 0; - Anew_QA = Atmp_QA[ order & 1 ]; - /* Increase Q domain of the AR coefficients */ for( k = 0; k < order; k++ ) { DC_resp += (opus_int32)A_Q12[ k ]; - Anew_QA[ k ] = silk_LSHIFT32( (opus_int32)A_Q12[ k ], QA - 12 ); + Atmp_QA[ k ] = silk_LSHIFT32( (opus_int32)A_Q12[ k ], QA - 12 ); } /* If the DC is unstable, we don't even need to do the full calculations */ if( DC_resp >= 4096 ) { return 0; } - return LPC_inverse_pred_gain_QA( Atmp_QA, order ); + return LPC_inverse_pred_gain_QA_c( Atmp_QA, order ); } - -#ifdef FIXED_POINT - -/* For input in Q24 domain */ -opus_int32 silk_LPC_inverse_pred_gain_Q24( /* O Returns inverse prediction gain in energy domain, Q30 */ - const opus_int32 *A_Q24, /* I Prediction coefficients [order] */ - const opus_int order /* I Prediction order */ -) -{ - opus_int k; - opus_int32 Atmp_QA[ 2 ][ SILK_MAX_ORDER_LPC ]; - opus_int32 *Anew_QA; - - Anew_QA = Atmp_QA[ order & 1 ]; - - /* Increase Q domain of the AR coefficients */ - for( k = 0; k < order; k++ ) { - Anew_QA[ k ] = silk_RSHIFT32( A_Q24[ k ], 24 - QA ); - } - - return LPC_inverse_pred_gain_QA( Atmp_QA, order ); -} -#endif diff --git a/thirdparty/opus/silk/LP_variable_cutoff.c b/thirdparty/opus/silk/LP_variable_cutoff.c index f639e1f899..79112ad354 100644 --- a/thirdparty/opus/silk/LP_variable_cutoff.c +++ b/thirdparty/opus/silk/LP_variable_cutoff.c @@ -130,6 +130,6 @@ void silk_LP_variable_cutoff( /* ARMA low-pass filtering */ silk_assert( TRANSITION_NB == 3 && TRANSITION_NA == 2 ); - silk_biquad_alt( frame, B_Q28, A_Q28, psLP->In_LP_State, frame, frame_length, 1); + silk_biquad_alt_stride1( frame, B_Q28, A_Q28, psLP->In_LP_State, frame, frame_length); } } diff --git a/thirdparty/opus/silk/MacroCount.h b/thirdparty/opus/silk/MacroCount.h index 834817d058..78100ffede 100644 --- a/thirdparty/opus/silk/MacroCount.h +++ b/thirdparty/opus/silk/MacroCount.h @@ -319,14 +319,6 @@ static OPUS_INLINE opus_int32 silk_ADD_POS_SAT32(opus_int64 a, opus_int64 b){ return(tmp); } -#undef silk_ADD_POS_SAT64 -static OPUS_INLINE opus_int64 silk_ADD_POS_SAT64(opus_int64 a, opus_int64 b){ - opus_int64 tmp; - ops_count += 1; - tmp = ((((a)+(b)) & 0x8000000000000000LL) ? silk_int64_MAX : ((a)+(b))); - return(tmp); -} - #undef silk_LSHIFT8 static OPUS_INLINE opus_int8 silk_LSHIFT8(opus_int8 a, opus_int32 shift){ opus_int8 ret; @@ -699,7 +691,7 @@ return(ret); #undef silk_LIMIT_32 -static OPUS_INLINE opus_int silk_LIMIT_32(opus_int32 a, opus_int32 limit1, opus_int32 limit2) +static OPUS_INLINE opus_int32 silk_LIMIT_32(opus_int32 a, opus_int32 limit1, opus_int32 limit2) { opus_int32 ret; ops_count += 6; diff --git a/thirdparty/opus/silk/MacroDebug.h b/thirdparty/opus/silk/MacroDebug.h index 35aedc5c5f..8dd4ce2ee2 100644 --- a/thirdparty/opus/silk/MacroDebug.h +++ b/thirdparty/opus/silk/MacroDebug.h @@ -539,8 +539,7 @@ static OPUS_INLINE opus_int32 silk_DIV32_16_(opus_int32 a32, opus_int32 b32, cha no checking needed for silk_POS_SAT32 no checking needed for silk_ADD_POS_SAT8 no checking needed for silk_ADD_POS_SAT16 - no checking needed for silk_ADD_POS_SAT32 - no checking needed for silk_ADD_POS_SAT64 */ + no checking needed for silk_ADD_POS_SAT32 */ #undef silk_LSHIFT8 #define silk_LSHIFT8(a,b) silk_LSHIFT8_((a), (b), __FILE__, __LINE__) diff --git a/thirdparty/opus/silk/NLSF2A.c b/thirdparty/opus/silk/NLSF2A.c index b1c559ea68..d5b7730638 100644 --- a/thirdparty/opus/silk/NLSF2A.c +++ b/thirdparty/opus/silk/NLSF2A.c @@ -66,7 +66,8 @@ static OPUS_INLINE void silk_NLSF2A_find_poly( void silk_NLSF2A( opus_int16 *a_Q12, /* O monic whitening filter coefficients in Q12, [ d ] */ const opus_int16 *NLSF, /* I normalized line spectral frequencies in Q15, [ d ] */ - const opus_int d /* I filter order (should be even) */ + const opus_int d, /* I filter order (should be even) */ + int arch /* I Run-time architecture */ ) { /* This ordering was found to maximize quality. It improves numerical accuracy of @@ -83,15 +84,14 @@ void silk_NLSF2A( opus_int32 P[ SILK_MAX_ORDER_LPC / 2 + 1 ], Q[ SILK_MAX_ORDER_LPC / 2 + 1 ]; opus_int32 Ptmp, Qtmp, f_int, f_frac, cos_val, delta; opus_int32 a32_QA1[ SILK_MAX_ORDER_LPC ]; - opus_int32 maxabs, absval, idx=0, sc_Q16; silk_assert( LSF_COS_TAB_SZ_FIX == 128 ); - silk_assert( d==10||d==16 ); + celt_assert( d==10 || d==16 ); /* convert LSFs to 2*cos(LSF), using piecewise linear curve from table */ ordering = d == 16 ? ordering16 : ordering10; for( k = 0; k < d; k++ ) { - silk_assert(NLSF[k] >= 0 ); + silk_assert( NLSF[k] >= 0 ); /* f_int on a scale 0-127 (rounded down) */ f_int = silk_RSHIFT( NLSF[k], 15 - 7 ); @@ -126,52 +126,15 @@ void silk_NLSF2A( a32_QA1[ d-k-1 ] = Qtmp - Ptmp; /* QA+1 */ } - /* Limit the maximum absolute value of the prediction coefficients, so that they'll fit in int16 */ - for( i = 0; i < 10; i++ ) { - /* Find maximum absolute value and its index */ - maxabs = 0; - for( k = 0; k < d; k++ ) { - absval = silk_abs( a32_QA1[k] ); - if( absval > maxabs ) { - maxabs = absval; - idx = k; - } - } - maxabs = silk_RSHIFT_ROUND( maxabs, QA + 1 - 12 ); /* QA+1 -> Q12 */ - - if( maxabs > silk_int16_MAX ) { - /* Reduce magnitude of prediction coefficients */ - maxabs = silk_min( maxabs, 163838 ); /* ( silk_int32_MAX >> 14 ) + silk_int16_MAX = 163838 */ - sc_Q16 = SILK_FIX_CONST( 0.999, 16 ) - silk_DIV32( silk_LSHIFT( maxabs - silk_int16_MAX, 14 ), - silk_RSHIFT32( silk_MUL( maxabs, idx + 1), 2 ) ); - silk_bwexpander_32( a32_QA1, d, sc_Q16 ); - } else { - break; - } - } + /* Convert int32 coefficients to Q12 int16 coefs */ + silk_LPC_fit( a_Q12, a32_QA1, 12, QA + 1, d ); - if( i == 10 ) { - /* Reached the last iteration, clip the coefficients */ + for( i = 0; silk_LPC_inverse_pred_gain( a_Q12, d, arch ) == 0 && i < MAX_LPC_STABILIZE_ITERATIONS; i++ ) { + /* Prediction coefficients are (too close to) unstable; apply bandwidth expansion */ + /* on the unscaled coefficients, convert to Q12 and measure again */ + silk_bwexpander_32( a32_QA1, d, 65536 - silk_LSHIFT( 2, i ) ); for( k = 0; k < d; k++ ) { - a_Q12[ k ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( a32_QA1[ k ], QA + 1 - 12 ) ); /* QA+1 -> Q12 */ - a32_QA1[ k ] = silk_LSHIFT( (opus_int32)a_Q12[ k ], QA + 1 - 12 ); - } - } else { - for( k = 0; k < d; k++ ) { - a_Q12[ k ] = (opus_int16)silk_RSHIFT_ROUND( a32_QA1[ k ], QA + 1 - 12 ); /* QA+1 -> Q12 */ - } - } - - for( i = 0; i < MAX_LPC_STABILIZE_ITERATIONS; i++ ) { - if( silk_LPC_inverse_pred_gain( a_Q12, d ) < SILK_FIX_CONST( 1.0 / MAX_PREDICTION_POWER_GAIN, 30 ) ) { - /* Prediction coefficients are (too close to) unstable; apply bandwidth expansion */ - /* on the unscaled coefficients, convert to Q12 and measure again */ - silk_bwexpander_32( a32_QA1, d, 65536 - silk_LSHIFT( 2, i ) ); - for( k = 0; k < d; k++ ) { - a_Q12[ k ] = (opus_int16)silk_RSHIFT_ROUND( a32_QA1[ k ], QA + 1 - 12 ); /* QA+1 -> Q12 */ - } - } else { - break; + a_Q12[ k ] = (opus_int16)silk_RSHIFT_ROUND( a32_QA1[ k ], QA + 1 - 12 ); /* QA+1 -> Q12 */ } } } diff --git a/thirdparty/opus/silk/NLSF_VQ.c b/thirdparty/opus/silk/NLSF_VQ.c index 69b6e22e18..b83182a79c 100644 --- a/thirdparty/opus/silk/NLSF_VQ.c +++ b/thirdparty/opus/silk/NLSF_VQ.c @@ -33,36 +33,44 @@ POSSIBILITY OF SUCH DAMAGE. /* Compute quantization errors for an LPC_order element input vector for a VQ codebook */ void silk_NLSF_VQ( - opus_int32 err_Q26[], /* O Quantization errors [K] */ + opus_int32 err_Q24[], /* O Quantization errors [K] */ const opus_int16 in_Q15[], /* I Input vectors to be quantized [LPC_order] */ const opus_uint8 pCB_Q8[], /* I Codebook vectors [K*LPC_order] */ + const opus_int16 pWght_Q9[], /* I Codebook weights [K*LPC_order] */ const opus_int K, /* I Number of codebook vectors */ const opus_int LPC_order /* I Number of LPCs */ ) { - opus_int i, m; - opus_int32 diff_Q15, sum_error_Q30, sum_error_Q26; + opus_int i, m; + opus_int32 diff_Q15, diffw_Q24, sum_error_Q24, pred_Q24; + const opus_int16 *w_Q9_ptr; + const opus_uint8 *cb_Q8_ptr; - silk_assert( LPC_order <= 16 ); - silk_assert( ( LPC_order & 1 ) == 0 ); + celt_assert( ( LPC_order & 1 ) == 0 ); /* Loop over codebook */ + cb_Q8_ptr = pCB_Q8; + w_Q9_ptr = pWght_Q9; for( i = 0; i < K; i++ ) { - sum_error_Q26 = 0; - for( m = 0; m < LPC_order; m += 2 ) { - /* Compute weighted squared quantization error for index m */ - diff_Q15 = silk_SUB_LSHIFT32( in_Q15[ m ], (opus_int32)*pCB_Q8++, 7 ); /* range: [ -32767 : 32767 ]*/ - sum_error_Q30 = silk_SMULBB( diff_Q15, diff_Q15 ); + sum_error_Q24 = 0; + pred_Q24 = 0; + for( m = LPC_order-2; m >= 0; m -= 2 ) { + /* Compute weighted absolute predictive quantization error for index m + 1 */ + diff_Q15 = silk_SUB_LSHIFT32( in_Q15[ m + 1 ], (opus_int32)cb_Q8_ptr[ m + 1 ], 7 ); /* range: [ -32767 : 32767 ]*/ + diffw_Q24 = silk_SMULBB( diff_Q15, w_Q9_ptr[ m + 1 ] ); + sum_error_Q24 = silk_ADD32( sum_error_Q24, silk_abs( silk_SUB_RSHIFT32( diffw_Q24, pred_Q24, 1 ) ) ); + pred_Q24 = diffw_Q24; - /* Compute weighted squared quantization error for index m + 1 */ - diff_Q15 = silk_SUB_LSHIFT32( in_Q15[m + 1], (opus_int32)*pCB_Q8++, 7 ); /* range: [ -32767 : 32767 ]*/ - sum_error_Q30 = silk_SMLABB( sum_error_Q30, diff_Q15, diff_Q15 ); + /* Compute weighted absolute predictive quantization error for index m */ + diff_Q15 = silk_SUB_LSHIFT32( in_Q15[ m ], (opus_int32)cb_Q8_ptr[ m ], 7 ); /* range: [ -32767 : 32767 ]*/ + diffw_Q24 = silk_SMULBB( diff_Q15, w_Q9_ptr[ m ] ); + sum_error_Q24 = silk_ADD32( sum_error_Q24, silk_abs( silk_SUB_RSHIFT32( diffw_Q24, pred_Q24, 1 ) ) ); + pred_Q24 = diffw_Q24; - sum_error_Q26 = silk_ADD_RSHIFT32( sum_error_Q26, sum_error_Q30, 4 ); - - silk_assert( sum_error_Q26 >= 0 ); - silk_assert( sum_error_Q30 >= 0 ); + silk_assert( sum_error_Q24 >= 0 ); } - err_Q26[ i ] = sum_error_Q26; + err_Q24[ i ] = sum_error_Q24; + cb_Q8_ptr += LPC_order; + w_Q9_ptr += LPC_order; } } diff --git a/thirdparty/opus/silk/NLSF_VQ_weights_laroia.c b/thirdparty/opus/silk/NLSF_VQ_weights_laroia.c index 04894c59ab..9873bcde10 100644 --- a/thirdparty/opus/silk/NLSF_VQ_weights_laroia.c +++ b/thirdparty/opus/silk/NLSF_VQ_weights_laroia.c @@ -48,8 +48,8 @@ void silk_NLSF_VQ_weights_laroia( opus_int k; opus_int32 tmp1_int, tmp2_int; - silk_assert( D > 0 ); - silk_assert( ( D & 1 ) == 0 ); + celt_assert( D > 0 ); + celt_assert( ( D & 1 ) == 0 ); /* First value */ tmp1_int = silk_max_int( pNLSF_Q15[ 0 ], 1 ); diff --git a/thirdparty/opus/silk/NLSF_decode.c b/thirdparty/opus/silk/NLSF_decode.c index 9f715060b8..eeb0ba8c92 100644 --- a/thirdparty/opus/silk/NLSF_decode.c +++ b/thirdparty/opus/silk/NLSF_decode.c @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "main.h" /* Predictive dequantizer for NLSF residuals */ -static OPUS_INLINE void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */ +static OPUS_INLINE void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */ opus_int16 x_Q10[], /* O Output [ order ] */ const opus_int8 indices[], /* I Quantization indices [ order ] */ const opus_uint8 pred_coef_Q8[], /* I Backward predictor coefs [ order ] */ @@ -70,15 +70,9 @@ void silk_NLSF_decode( opus_uint8 pred_Q8[ MAX_LPC_ORDER ]; opus_int16 ec_ix[ MAX_LPC_ORDER ]; opus_int16 res_Q10[ MAX_LPC_ORDER ]; - opus_int16 W_tmp_QW[ MAX_LPC_ORDER ]; - opus_int32 W_tmp_Q9, NLSF_Q15_tmp; + opus_int32 NLSF_Q15_tmp; const opus_uint8 *pCB_element; - - /* Decode first stage */ - pCB_element = &psNLSF_CB->CB1_NLSF_Q8[ NLSFIndices[ 0 ] * psNLSF_CB->order ]; - for( i = 0; i < psNLSF_CB->order; i++ ) { - pNLSF_Q15[ i ] = silk_LSHIFT( (opus_int16)pCB_element[ i ], 7 ); - } + const opus_int16 *pCB_Wght_Q9; /* Unpack entropy table indices and predictor for current CB1 index */ silk_NLSF_unpack( ec_ix, pred_Q8, psNLSF_CB, NLSFIndices[ 0 ] ); @@ -86,13 +80,11 @@ void silk_NLSF_decode( /* Predictive residual dequantizer */ silk_NLSF_residual_dequant( res_Q10, &NLSFIndices[ 1 ], pred_Q8, psNLSF_CB->quantStepSize_Q16, psNLSF_CB->order ); - /* Weights from codebook vector */ - silk_NLSF_VQ_weights_laroia( W_tmp_QW, pNLSF_Q15, psNLSF_CB->order ); - - /* Apply inverse square-rooted weights and add to output */ + /* Apply inverse square-rooted weights to first stage and add to output */ + pCB_element = &psNLSF_CB->CB1_NLSF_Q8[ NLSFIndices[ 0 ] * psNLSF_CB->order ]; + pCB_Wght_Q9 = &psNLSF_CB->CB1_Wght_Q9[ NLSFIndices[ 0 ] * psNLSF_CB->order ]; for( i = 0; i < psNLSF_CB->order; i++ ) { - W_tmp_Q9 = silk_SQRT_APPROX( silk_LSHIFT( (opus_int32)W_tmp_QW[ i ], 18 - NLSF_W_Q ) ); - NLSF_Q15_tmp = silk_ADD32( pNLSF_Q15[ i ], silk_DIV32_16( silk_LSHIFT( (opus_int32)res_Q10[ i ], 14 ), W_tmp_Q9 ) ); + NLSF_Q15_tmp = silk_ADD_LSHIFT32( silk_DIV32_16( silk_LSHIFT( (opus_int32)res_Q10[ i ], 14 ), pCB_Wght_Q9[ i ] ), (opus_int16)pCB_element[ i ], 7 ); pNLSF_Q15[ i ] = (opus_int16)silk_LIMIT( NLSF_Q15_tmp, 0, 32767 ); } diff --git a/thirdparty/opus/silk/NLSF_del_dec_quant.c b/thirdparty/opus/silk/NLSF_del_dec_quant.c index de88fee060..44a16acd0b 100644 --- a/thirdparty/opus/silk/NLSF_del_dec_quant.c +++ b/thirdparty/opus/silk/NLSF_del_dec_quant.c @@ -84,7 +84,7 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns nStates = 1; RD_Q25[ 0 ] = 0; prev_out_Q10[ 0 ] = 0; - for( i = order - 1; ; i-- ) { + for( i = order - 1; i >= 0; i-- ) { rates_Q5 = &ec_rates_Q5[ ec_ix[ i ] ]; in_Q10 = x_Q10[ i ]; for( j = 0; j < nStates; j++ ) { @@ -131,7 +131,7 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns RD_Q25[ j + nStates ] = silk_SMLABB( silk_MLA( RD_tmp_Q25, silk_SMULBB( diff_Q10, diff_Q10 ), w_Q5[ i ] ), mu_Q20, rate1_Q5 ); } - if( nStates <= ( NLSF_QUANT_DEL_DEC_STATES >> 1 ) ) { + if( nStates <= NLSF_QUANT_DEL_DEC_STATES/2 ) { /* double number of states and copy */ for( j = 0; j < nStates; j++ ) { ind[ j + nStates ][ i ] = ind[ j ][ i ] + 1; @@ -140,7 +140,7 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns for( j = nStates; j < NLSF_QUANT_DEL_DEC_STATES; j++ ) { ind[ j ][ i ] = ind[ j - nStates ][ i ]; } - } else if( i > 0 ) { + } else { /* sort lower and upper half of RD_Q25, pairwise */ for( j = 0; j < NLSF_QUANT_DEL_DEC_STATES; j++ ) { if( RD_Q25[ j ] > RD_Q25[ j + NLSF_QUANT_DEL_DEC_STATES ] ) { @@ -191,8 +191,6 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns for( j = 0; j < NLSF_QUANT_DEL_DEC_STATES; j++ ) { ind[ j ][ i ] += silk_RSHIFT( ind_sort[ j ], NLSF_QUANT_DEL_DEC_STATES_LOG2 ); } - } else { /* i == 0 */ - break; } } diff --git a/thirdparty/opus/silk/NLSF_encode.c b/thirdparty/opus/silk/NLSF_encode.c index f03c3f1c35..01ac7db78c 100644 --- a/thirdparty/opus/silk/NLSF_encode.c +++ b/thirdparty/opus/silk/NLSF_encode.c @@ -37,9 +37,9 @@ POSSIBILITY OF SUCH DAMAGE. /***********************/ opus_int32 silk_NLSF_encode( /* O Returns RD value in Q25 */ opus_int8 *NLSFIndices, /* I Codebook path vector [ LPC_ORDER + 1 ] */ - opus_int16 *pNLSF_Q15, /* I/O Quantized NLSF vector [ LPC_ORDER ] */ + opus_int16 *pNLSF_Q15, /* I/O (Un)quantized NLSF vector [ LPC_ORDER ] */ const silk_NLSF_CB_struct *psNLSF_CB, /* I Codebook object */ - const opus_int16 *pW_QW, /* I NLSF weight vector [ LPC_ORDER ] */ + const opus_int16 *pW_Q2, /* I NLSF weight vector [ LPC_ORDER ] */ const opus_int NLSF_mu_Q20, /* I Rate weight for the RD optimization */ const opus_int nSurvivors, /* I Max survivors after first stage */ const opus_int signalType /* I Signal type: 0/1/2 */ @@ -47,34 +47,32 @@ opus_int32 silk_NLSF_encode( /* O Returns { opus_int i, s, ind1, bestIndex, prob_Q8, bits_q7; opus_int32 W_tmp_Q9, ret; - VARDECL( opus_int32, err_Q26 ); + VARDECL( opus_int32, err_Q24 ); VARDECL( opus_int32, RD_Q25 ); VARDECL( opus_int, tempIndices1 ); VARDECL( opus_int8, tempIndices2 ); - opus_int16 res_Q15[ MAX_LPC_ORDER ]; opus_int16 res_Q10[ MAX_LPC_ORDER ]; opus_int16 NLSF_tmp_Q15[ MAX_LPC_ORDER ]; - opus_int16 W_tmp_QW[ MAX_LPC_ORDER ]; opus_int16 W_adj_Q5[ MAX_LPC_ORDER ]; opus_uint8 pred_Q8[ MAX_LPC_ORDER ]; opus_int16 ec_ix[ MAX_LPC_ORDER ]; const opus_uint8 *pCB_element, *iCDF_ptr; + const opus_int16 *pCB_Wght_Q9; SAVE_STACK; - silk_assert( nSurvivors <= NLSF_VQ_MAX_SURVIVORS ); - silk_assert( signalType >= 0 && signalType <= 2 ); + celt_assert( signalType >= 0 && signalType <= 2 ); silk_assert( NLSF_mu_Q20 <= 32767 && NLSF_mu_Q20 >= 0 ); /* NLSF stabilization */ silk_NLSF_stabilize( pNLSF_Q15, psNLSF_CB->deltaMin_Q15, psNLSF_CB->order ); /* First stage: VQ */ - ALLOC( err_Q26, psNLSF_CB->nVectors, opus_int32 ); - silk_NLSF_VQ( err_Q26, pNLSF_Q15, psNLSF_CB->CB1_NLSF_Q8, psNLSF_CB->nVectors, psNLSF_CB->order ); + ALLOC( err_Q24, psNLSF_CB->nVectors, opus_int32 ); + silk_NLSF_VQ( err_Q24, pNLSF_Q15, psNLSF_CB->CB1_NLSF_Q8, psNLSF_CB->CB1_Wght_Q9, psNLSF_CB->nVectors, psNLSF_CB->order ); /* Sort the quantization errors */ ALLOC( tempIndices1, nSurvivors, opus_int ); - silk_insertion_sort_increasing( err_Q26, tempIndices1, psNLSF_CB->nVectors, nSurvivors ); + silk_insertion_sort_increasing( err_Q24, tempIndices1, psNLSF_CB->nVectors, nSurvivors ); ALLOC( RD_Q25, nSurvivors, opus_int32 ); ALLOC( tempIndices2, nSurvivors * MAX_LPC_ORDER, opus_int8 ); @@ -85,23 +83,12 @@ opus_int32 silk_NLSF_encode( /* O Returns /* Residual after first stage */ pCB_element = &psNLSF_CB->CB1_NLSF_Q8[ ind1 * psNLSF_CB->order ]; + pCB_Wght_Q9 = &psNLSF_CB->CB1_Wght_Q9[ ind1 * psNLSF_CB->order ]; for( i = 0; i < psNLSF_CB->order; i++ ) { NLSF_tmp_Q15[ i ] = silk_LSHIFT16( (opus_int16)pCB_element[ i ], 7 ); - res_Q15[ i ] = pNLSF_Q15[ i ] - NLSF_tmp_Q15[ i ]; - } - - /* Weights from codebook vector */ - silk_NLSF_VQ_weights_laroia( W_tmp_QW, NLSF_tmp_Q15, psNLSF_CB->order ); - - /* Apply square-rooted weights */ - for( i = 0; i < psNLSF_CB->order; i++ ) { - W_tmp_Q9 = silk_SQRT_APPROX( silk_LSHIFT( (opus_int32)W_tmp_QW[ i ], 18 - NLSF_W_Q ) ); - res_Q10[ i ] = (opus_int16)silk_RSHIFT( silk_SMULBB( res_Q15[ i ], W_tmp_Q9 ), 14 ); - } - - /* Modify input weights accordingly */ - for( i = 0; i < psNLSF_CB->order; i++ ) { - W_adj_Q5[ i ] = silk_DIV32_16( silk_LSHIFT( (opus_int32)pW_QW[ i ], 5 ), W_tmp_QW[ i ] ); + W_tmp_Q9 = pCB_Wght_Q9[ i ]; + res_Q10[ i ] = (opus_int16)silk_RSHIFT( silk_SMULBB( pNLSF_Q15[ i ] - NLSF_tmp_Q15[ i ], W_tmp_Q9 ), 14 ); + W_adj_Q5[ i ] = silk_DIV32_varQ( (opus_int32)pW_Q2[ i ], silk_SMULBB( W_tmp_Q9, W_tmp_Q9 ), 21 ); } /* Unpack entropy table indices and predictor for current CB1 index */ diff --git a/thirdparty/opus/silk/NSQ.c b/thirdparty/opus/silk/NSQ.c index 43e3fee7e0..1d64d8e257 100644 --- a/thirdparty/opus/silk/NSQ.c +++ b/thirdparty/opus/silk/NSQ.c @@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE. static OPUS_INLINE void silk_nsq_scale_states( const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ - const opus_int32 x_Q3[], /* I input in Q3 */ + const opus_int16 x16[], /* I input */ opus_int32 x_sc_Q10[], /* O input scaled with 1/Gain */ const opus_int16 sLTP[], /* I re-whitened LTP state in Q0 */ opus_int32 sLTP_Q15[], /* O LTP state matching scaled input */ @@ -75,14 +75,14 @@ static OPUS_INLINE void silk_noise_shape_quantizer( void silk_NSQ_c ( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3[], /* I Prefiltered input signal */ + const opus_int16 x16[], /* I Input */ opus_int8 pulses[], /* O Quantized pulse signal */ const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefs */ const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I Long term prediction coefs */ - const opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ + const opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I Long term shaping coefs */ const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I Spectral tilt */ const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I Low frequency shaping coefs */ @@ -117,8 +117,7 @@ void silk_NSQ_c LSF_interpolation_flag = 1; } - ALLOC( sLTP_Q15, - psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); + ALLOC( sLTP_Q15, psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); ALLOC( sLTP, psEncC->ltp_mem_length + psEncC->frame_length, opus_int16 ); ALLOC( x_sc_Q10, psEncC->subfr_length, opus_int32 ); /* Set up pointers to start of sub frame */ @@ -128,7 +127,7 @@ void silk_NSQ_c for( k = 0; k < psEncC->nb_subfr; k++ ) { A_Q12 = &PredCoef_Q12[ (( k >> 1 ) | ( 1 - LSF_interpolation_flag )) * MAX_LPC_ORDER ]; B_Q14 = <PCoef_Q14[ k * LTP_ORDER ]; - AR_shp_Q13 = &AR2_Q13[ k * MAX_SHAPE_LPC_ORDER ]; + AR_shp_Q13 = &AR_Q13[ k * MAX_SHAPE_LPC_ORDER ]; /* Noise shape parameters */ silk_assert( HarmShapeGain_Q14[ k ] >= 0 ); @@ -144,7 +143,7 @@ void silk_NSQ_c if( ( k & ( 3 - silk_LSHIFT( LSF_interpolation_flag, 1 ) ) ) == 0 ) { /* Rewhiten with new A coefs */ start_idx = psEncC->ltp_mem_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2; - silk_assert( start_idx > 0 ); + celt_assert( start_idx > 0 ); silk_LPC_analysis_filter( &sLTP[ start_idx ], &NSQ->xq[ start_idx + k * psEncC->subfr_length ], A_Q12, psEncC->ltp_mem_length - start_idx, psEncC->predictLPCOrder, psEncC->arch ); @@ -154,13 +153,13 @@ void silk_NSQ_c } } - silk_nsq_scale_states( psEncC, NSQ, x_Q3, x_sc_Q10, sLTP, sLTP_Q15, k, LTP_scale_Q14, Gains_Q16, pitchL, psIndices->signalType ); + silk_nsq_scale_states( psEncC, NSQ, x16, x_sc_Q10, sLTP, sLTP_Q15, k, LTP_scale_Q14, Gains_Q16, pitchL, psIndices->signalType ); silk_noise_shape_quantizer( NSQ, psIndices->signalType, x_sc_Q10, pulses, pxq, sLTP_Q15, A_Q12, B_Q14, AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14[ k ], LF_shp_Q14[ k ], Gains_Q16[ k ], Lambda_Q10, offset_Q10, psEncC->subfr_length, psEncC->shapingLPCOrder, psEncC->predictLPCOrder, psEncC->arch ); - x_Q3 += psEncC->subfr_length; + x16 += psEncC->subfr_length; pulses += psEncC->subfr_length; pxq += psEncC->subfr_length; } @@ -169,7 +168,6 @@ void silk_NSQ_c NSQ->lagPrev = pitchL[ psEncC->nb_subfr - 1 ]; /* Save quantized speech and noise shaping signals */ - /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[ psEncC->ltp_mem_length ], psEncC->frame_length * sizeof( opus_int16 ) ) */ silk_memmove( NSQ->xq, &NSQ->xq[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) ); silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) ); RESTORE_STACK; @@ -249,15 +247,15 @@ void silk_noise_shape_quantizer( } /* Noise shape feedback */ - silk_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ - n_AR_Q12 = silk_NSQ_noise_shape_feedback_loop(psLPC_Q14, NSQ->sAR2_Q14, AR_shp_Q13, shapingLPCOrder, arch); + celt_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ + n_AR_Q12 = silk_NSQ_noise_shape_feedback_loop(&NSQ->sDiff_shp_Q14, NSQ->sAR2_Q14, AR_shp_Q13, shapingLPCOrder, arch); n_AR_Q12 = silk_SMLAWB( n_AR_Q12, NSQ->sLF_AR_shp_Q14, Tilt_Q14 ); n_LF_Q12 = silk_SMULWB( NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 ); n_LF_Q12 = silk_SMLAWT( n_LF_Q12, NSQ->sLF_AR_shp_Q14, LF_shp_Q14 ); - silk_assert( lag > 0 || signalType != TYPE_VOICED ); + celt_assert( lag > 0 || signalType != TYPE_VOICED ); /* Combine prediction and noise shaping signals */ tmp1 = silk_SUB32( silk_LSHIFT32( LPC_pred_Q10, 2 ), n_AR_Q12 ); /* Q12 */ @@ -279,14 +277,27 @@ void silk_noise_shape_quantizer( r_Q10 = silk_SUB32( x_sc_Q10[ i ], tmp1 ); /* residual error Q10 */ /* Flip sign depending on dither */ - if ( NSQ->rand_seed < 0 ) { - r_Q10 = -r_Q10; + if( NSQ->rand_seed < 0 ) { + r_Q10 = -r_Q10; } r_Q10 = silk_LIMIT_32( r_Q10, -(31 << 10), 30 << 10 ); /* Find two quantization level candidates and measure their rate-distortion */ q1_Q10 = silk_SUB32( r_Q10, offset_Q10 ); q1_Q0 = silk_RSHIFT( q1_Q10, 10 ); + if (Lambda_Q10 > 2048) { + /* For aggressive RDO, the bias becomes more than one pulse. */ + int rdo_offset = Lambda_Q10/2 - 512; + if (q1_Q10 > rdo_offset) { + q1_Q0 = silk_RSHIFT( q1_Q10 - rdo_offset, 10 ); + } else if (q1_Q10 < -rdo_offset) { + q1_Q0 = silk_RSHIFT( q1_Q10 + rdo_offset, 10 ); + } else if (q1_Q10 < 0) { + q1_Q0 = -1; + } else { + q1_Q0 = 0; + } + } if( q1_Q0 > 0 ) { q1_Q10 = silk_SUB32( silk_LSHIFT( q1_Q0, 10 ), QUANT_LEVEL_ADJUST_Q10 ); q1_Q10 = silk_ADD32( q1_Q10, offset_Q10 ); @@ -337,7 +348,8 @@ void silk_noise_shape_quantizer( /* Update states */ psLPC_Q14++; *psLPC_Q14 = xq_Q14; - sLF_AR_shp_Q14 = silk_SUB_LSHIFT32( xq_Q14, n_AR_Q12, 2 ); + NSQ->sDiff_shp_Q14 = silk_SUB_LSHIFT32( xq_Q14, x_sc_Q10[ i ], 4 ); + sLF_AR_shp_Q14 = silk_SUB_LSHIFT32( NSQ->sDiff_shp_Q14, n_AR_Q12, 2 ); NSQ->sLF_AR_shp_Q14 = sLF_AR_shp_Q14; NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx ] = silk_SUB_LSHIFT32( sLF_AR_shp_Q14, n_LF_Q12, 2 ); @@ -356,7 +368,7 @@ void silk_noise_shape_quantizer( static OPUS_INLINE void silk_nsq_scale_states( const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ - const opus_int32 x_Q3[], /* I input in Q3 */ + const opus_int16 x16[], /* I input */ opus_int32 x_sc_Q10[], /* O input scaled with 1/Gain */ const opus_int16 sLTP[], /* I re-whitened LTP state in Q0 */ opus_int32 sLTP_Q15[], /* O LTP state matching scaled input */ @@ -368,28 +380,18 @@ static OPUS_INLINE void silk_nsq_scale_states( ) { opus_int i, lag; - opus_int32 gain_adj_Q16, inv_gain_Q31, inv_gain_Q23; + opus_int32 gain_adj_Q16, inv_gain_Q31, inv_gain_Q26; lag = pitchL[ subfr ]; inv_gain_Q31 = silk_INVERSE32_varQ( silk_max( Gains_Q16[ subfr ], 1 ), 47 ); silk_assert( inv_gain_Q31 != 0 ); - /* Calculate gain adjustment factor */ - if( Gains_Q16[ subfr ] != NSQ->prev_gain_Q16 ) { - gain_adj_Q16 = silk_DIV32_varQ( NSQ->prev_gain_Q16, Gains_Q16[ subfr ], 16 ); - } else { - gain_adj_Q16 = (opus_int32)1 << 16; - } - /* Scale input */ - inv_gain_Q23 = silk_RSHIFT_ROUND( inv_gain_Q31, 8 ); + inv_gain_Q26 = silk_RSHIFT_ROUND( inv_gain_Q31, 5 ); for( i = 0; i < psEncC->subfr_length; i++ ) { - x_sc_Q10[ i ] = silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); + x_sc_Q10[ i ] = silk_SMULWW( x16[ i ], inv_gain_Q26 ); } - /* Save inverse gain */ - NSQ->prev_gain_Q16 = Gains_Q16[ subfr ]; - /* After rewhitening the LTP state is un-scaled, so scale with inv_gain_Q16 */ if( NSQ->rewhite_flag ) { if( subfr == 0 ) { @@ -403,7 +405,9 @@ static OPUS_INLINE void silk_nsq_scale_states( } /* Adjust for changing gain */ - if( gain_adj_Q16 != (opus_int32)1 << 16 ) { + if( Gains_Q16[ subfr ] != NSQ->prev_gain_Q16 ) { + gain_adj_Q16 = silk_DIV32_varQ( NSQ->prev_gain_Q16, Gains_Q16[ subfr ], 16 ); + /* Scale long-term shaping state */ for( i = NSQ->sLTP_shp_buf_idx - psEncC->ltp_mem_length; i < NSQ->sLTP_shp_buf_idx; i++ ) { NSQ->sLTP_shp_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); @@ -417,6 +421,7 @@ static OPUS_INLINE void silk_nsq_scale_states( } NSQ->sLF_AR_shp_Q14 = silk_SMULWW( gain_adj_Q16, NSQ->sLF_AR_shp_Q14 ); + NSQ->sDiff_shp_Q14 = silk_SMULWW( gain_adj_Q16, NSQ->sDiff_shp_Q14 ); /* Scale short-term prediction and shaping states */ for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { @@ -425,5 +430,8 @@ static OPUS_INLINE void silk_nsq_scale_states( for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { NSQ->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sAR2_Q14[ i ] ); } + + /* Save inverse gain */ + NSQ->prev_gain_Q16 = Gains_Q16[ subfr ]; } } diff --git a/thirdparty/opus/silk/NSQ_del_dec.c b/thirdparty/opus/silk/NSQ_del_dec.c index ab6feeac98..3fd9fa0d5b 100644 --- a/thirdparty/opus/silk/NSQ_del_dec.c +++ b/thirdparty/opus/silk/NSQ_del_dec.c @@ -43,6 +43,7 @@ typedef struct { opus_int32 Shape_Q14[ DECISION_DELAY ]; opus_int32 sAR2_Q14[ MAX_SHAPE_LPC_ORDER ]; opus_int32 LF_AR_Q14; + opus_int32 Diff_Q14; opus_int32 Seed; opus_int32 SeedInit; opus_int32 RD_Q10; @@ -53,6 +54,7 @@ typedef struct { opus_int32 RD_Q10; opus_int32 xq_Q14; opus_int32 LF_AR_Q14; + opus_int32 Diff_Q14; opus_int32 sLTP_shp_Q14; opus_int32 LPC_exc_Q14; } NSQ_sample_struct; @@ -66,7 +68,7 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states */ - const opus_int32 x_Q3[], /* I Input in Q3 */ + const opus_int16 x16[], /* I Input */ opus_int32 x_sc_Q10[], /* O Input scaled with 1/Gain in Q10 */ const opus_int16 sLTP[], /* I Re-whitened LTP state in Q0 */ opus_int32 sLTP_Q15[], /* O LTP state matching scaled input */ @@ -107,20 +109,20 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( opus_int predictLPCOrder, /* I Prediction filter order */ opus_int warping_Q16, /* I */ opus_int nStatesDelayedDecision, /* I Number of states in decision tree */ - opus_int *smpl_buf_idx, /* I Index to newest samples in buffers */ + opus_int *smpl_buf_idx, /* I/O Index to newest samples in buffers */ opus_int decisionDelay, /* I */ int arch /* I */ ); void silk_NSQ_del_dec_c( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3[], /* I Prefiltered input signal */ + const opus_int16 x16[], /* I Input */ opus_int8 pulses[], /* O Quantized pulse signal */ const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefs */ const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I Long term prediction coefs */ - const opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ + const opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I Long term shaping coefs */ const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I Spectral tilt */ const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I Low frequency shaping coefs */ @@ -159,6 +161,7 @@ void silk_NSQ_del_dec_c( psDD->SeedInit = psDD->Seed; psDD->RD_Q10 = 0; psDD->LF_AR_Q14 = NSQ->sLF_AR_shp_Q14; + psDD->Diff_Q14 = NSQ->sDiff_shp_Q14; psDD->Shape_Q14[ 0 ] = NSQ->sLTP_shp_Q14[ psEncC->ltp_mem_length - 1 ]; silk_memcpy( psDD->sLPC_Q14, NSQ->sLPC_Q14, NSQ_LPC_BUF_LENGTH * sizeof( opus_int32 ) ); silk_memcpy( psDD->sAR2_Q14, NSQ->sAR2_Q14, sizeof( NSQ->sAR2_Q14 ) ); @@ -186,8 +189,7 @@ void silk_NSQ_del_dec_c( LSF_interpolation_flag = 1; } - ALLOC( sLTP_Q15, - psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); + ALLOC( sLTP_Q15, psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); ALLOC( sLTP, psEncC->ltp_mem_length + psEncC->frame_length, opus_int16 ); ALLOC( x_sc_Q10, psEncC->subfr_length, opus_int32 ); ALLOC( delayedGain_Q10, DECISION_DELAY, opus_int32 ); @@ -199,7 +201,7 @@ void silk_NSQ_del_dec_c( for( k = 0; k < psEncC->nb_subfr; k++ ) { A_Q12 = &PredCoef_Q12[ ( ( k >> 1 ) | ( 1 - LSF_interpolation_flag ) ) * MAX_LPC_ORDER ]; B_Q14 = <PCoef_Q14[ k * LTP_ORDER ]; - AR_shp_Q13 = &AR2_Q13[ k * MAX_SHAPE_LPC_ORDER ]; + AR_shp_Q13 = &AR_Q13[ k * MAX_SHAPE_LPC_ORDER ]; /* Noise shape parameters */ silk_assert( HarmShapeGain_Q14[ k ] >= 0 ); @@ -235,7 +237,8 @@ void silk_NSQ_del_dec_c( psDD = &psDelDec[ Winner_ind ]; last_smple_idx = smpl_buf_idx + decisionDelay; for( i = 0; i < decisionDelay; i++ ) { - last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK; + last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY; + if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY; pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10[ last_smple_idx ], 10 ); pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( psDD->Xq_Q14[ last_smple_idx ], Gains_Q16[ 1 ] ), 14 ) ); @@ -247,7 +250,7 @@ void silk_NSQ_del_dec_c( /* Rewhiten with new A coefs */ start_idx = psEncC->ltp_mem_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2; - silk_assert( start_idx > 0 ); + celt_assert( start_idx > 0 ); silk_LPC_analysis_filter( &sLTP[ start_idx ], &NSQ->xq[ start_idx + k * psEncC->subfr_length ], A_Q12, psEncC->ltp_mem_length - start_idx, psEncC->predictLPCOrder, psEncC->arch ); @@ -257,7 +260,7 @@ void silk_NSQ_del_dec_c( } } - silk_nsq_del_dec_scale_states( psEncC, NSQ, psDelDec, x_Q3, x_sc_Q10, sLTP, sLTP_Q15, k, + silk_nsq_del_dec_scale_states( psEncC, NSQ, psDelDec, x16, x_sc_Q10, sLTP, sLTP_Q15, k, psEncC->nStatesDelayedDecision, LTP_scale_Q14, Gains_Q16, pitchL, psIndices->signalType, decisionDelay ); silk_noise_shape_quantizer_del_dec( NSQ, psDelDec, psIndices->signalType, x_sc_Q10, pulses, pxq, sLTP_Q15, @@ -265,7 +268,7 @@ void silk_NSQ_del_dec_c( Gains_Q16[ k ], Lambda_Q10, offset_Q10, psEncC->subfr_length, subfr++, psEncC->shapingLPCOrder, psEncC->predictLPCOrder, psEncC->warping_Q16, psEncC->nStatesDelayedDecision, &smpl_buf_idx, decisionDelay, psEncC->arch ); - x_Q3 += psEncC->subfr_length; + x16 += psEncC->subfr_length; pulses += psEncC->subfr_length; pxq += psEncC->subfr_length; } @@ -286,7 +289,9 @@ void silk_NSQ_del_dec_c( last_smple_idx = smpl_buf_idx + decisionDelay; Gain_Q10 = silk_RSHIFT32( Gains_Q16[ psEncC->nb_subfr - 1 ], 6 ); for( i = 0; i < decisionDelay; i++ ) { - last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK; + last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY; + if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY; + pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10[ last_smple_idx ], 10 ); pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( psDD->Xq_Q14[ last_smple_idx ], Gain_Q10 ), 8 ) ); @@ -297,10 +302,10 @@ void silk_NSQ_del_dec_c( /* Update states */ NSQ->sLF_AR_shp_Q14 = psDD->LF_AR_Q14; + NSQ->sDiff_shp_Q14 = psDD->Diff_Q14; NSQ->lagPrev = pitchL[ psEncC->nb_subfr - 1 ]; /* Save quantized speech signal */ - /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[psEncC->ltp_mem_length], psEncC->frame_length * sizeof( opus_int16 ) ) */ silk_memmove( NSQ->xq, &NSQ->xq[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) ); silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) ); RESTORE_STACK; @@ -335,7 +340,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( opus_int predictLPCOrder, /* I Prediction filter order */ opus_int warping_Q16, /* I */ opus_int nStatesDelayedDecision, /* I Number of states in decision tree */ - opus_int *smpl_buf_idx, /* I Index to newest samples in buffers */ + opus_int *smpl_buf_idx, /* I/O Index to newest samples in buffers */ opus_int decisionDelay, /* I */ int arch /* I */ ) @@ -356,7 +361,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( NSQ_sample_struct *psSS; SAVE_STACK; - silk_assert( nStatesDelayedDecision > 0 ); + celt_assert( nStatesDelayedDecision > 0 ); ALLOC( psSampleState, nStatesDelayedDecision, NSQ_sample_pair ); shp_lag_ptr = &NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ]; @@ -414,9 +419,9 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( LPC_pred_Q14 = silk_LSHIFT( LPC_pred_Q14, 4 ); /* Q10 -> Q14 */ /* Noise shape feedback */ - silk_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ + celt_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ /* Output of lowpass section */ - tmp2 = silk_SMLAWB( psLPC_Q14[ 0 ], psDD->sAR2_Q14[ 0 ], warping_Q16 ); + tmp2 = silk_SMLAWB( psDD->Diff_Q14, psDD->sAR2_Q14[ 0 ], warping_Q16 ); /* Output of allpass section */ tmp1 = silk_SMLAWB( psDD->sAR2_Q14[ 0 ], psDD->sAR2_Q14[ 1 ] - tmp2, warping_Q16 ); psDD->sAR2_Q14[ 0 ] = tmp2; @@ -462,6 +467,19 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( /* Find two quantization level candidates and measure their rate-distortion */ q1_Q10 = silk_SUB32( r_Q10, offset_Q10 ); q1_Q0 = silk_RSHIFT( q1_Q10, 10 ); + if (Lambda_Q10 > 2048) { + /* For aggressive RDO, the bias becomes more than one pulse. */ + int rdo_offset = Lambda_Q10/2 - 512; + if (q1_Q10 > rdo_offset) { + q1_Q0 = silk_RSHIFT( q1_Q10 - rdo_offset, 10 ); + } else if (q1_Q10 < -rdo_offset) { + q1_Q0 = silk_RSHIFT( q1_Q10 + rdo_offset, 10 ); + } else if (q1_Q10 < 0) { + q1_Q0 = -1; + } else { + q1_Q0 = 0; + } + } if( q1_Q0 > 0 ) { q1_Q10 = silk_SUB32( silk_LSHIFT( q1_Q0, 10 ), QUANT_LEVEL_ADJUST_Q10 ); q1_Q10 = silk_ADD32( q1_Q10, offset_Q10 ); @@ -515,7 +533,8 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( xq_Q14 = silk_ADD32( LPC_exc_Q14, LPC_pred_Q14 ); /* Update states */ - sLF_AR_shp_Q14 = silk_SUB32( xq_Q14, n_AR_Q14 ); + psSS[ 0 ].Diff_Q14 = silk_SUB_LSHIFT32( xq_Q14, x_Q10[ i ], 4 ); + sLF_AR_shp_Q14 = silk_SUB32( psSS[ 0 ].Diff_Q14, n_AR_Q14 ); psSS[ 0 ].sLTP_shp_Q14 = silk_SUB32( sLF_AR_shp_Q14, n_LF_Q14 ); psSS[ 0 ].LF_AR_Q14 = sLF_AR_shp_Q14; psSS[ 0 ].LPC_exc_Q14 = LPC_exc_Q14; @@ -529,21 +548,22 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( exc_Q14 = -exc_Q14; } - /* Add predictions */ LPC_exc_Q14 = silk_ADD32( exc_Q14, LTP_pred_Q14 ); xq_Q14 = silk_ADD32( LPC_exc_Q14, LPC_pred_Q14 ); /* Update states */ - sLF_AR_shp_Q14 = silk_SUB32( xq_Q14, n_AR_Q14 ); + psSS[ 1 ].Diff_Q14 = silk_SUB_LSHIFT32( xq_Q14, x_Q10[ i ], 4 ); + sLF_AR_shp_Q14 = silk_SUB32( psSS[ 1 ].Diff_Q14, n_AR_Q14 ); psSS[ 1 ].sLTP_shp_Q14 = silk_SUB32( sLF_AR_shp_Q14, n_LF_Q14 ); psSS[ 1 ].LF_AR_Q14 = sLF_AR_shp_Q14; psSS[ 1 ].LPC_exc_Q14 = LPC_exc_Q14; psSS[ 1 ].xq_Q14 = xq_Q14; } - *smpl_buf_idx = ( *smpl_buf_idx - 1 ) & DECISION_DELAY_MASK; /* Index to newest samples */ - last_smple_idx = ( *smpl_buf_idx + decisionDelay ) & DECISION_DELAY_MASK; /* Index to decisionDelay old samples */ + *smpl_buf_idx = ( *smpl_buf_idx - 1 ) % DECISION_DELAY; + if( *smpl_buf_idx < 0 ) *smpl_buf_idx += DECISION_DELAY; + last_smple_idx = ( *smpl_buf_idx + decisionDelay ) % DECISION_DELAY; /* Find winner */ RDmin_Q10 = psSampleState[ 0 ][ 0 ].RD_Q10; @@ -607,6 +627,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( psDD = &psDelDec[ k ]; psSS = &psSampleState[ k ][ 0 ]; psDD->LF_AR_Q14 = psSS->LF_AR_Q14; + psDD->Diff_Q14 = psSS->Diff_Q14; psDD->sLPC_Q14[ NSQ_LPC_BUF_LENGTH + i ] = psSS->xq_Q14; psDD->Xq_Q14[ *smpl_buf_idx ] = psSS->xq_Q14; psDD->Q_Q10[ *smpl_buf_idx ] = psSS->Q_Q10; @@ -631,7 +652,7 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states */ - const opus_int32 x_Q3[], /* I Input in Q3 */ + const opus_int16 x16[], /* I Input */ opus_int32 x_sc_Q10[], /* O Input scaled with 1/Gain in Q10 */ const opus_int16 sLTP[], /* I Re-whitened LTP state in Q0 */ opus_int32 sLTP_Q15[], /* O LTP state matching scaled input */ @@ -645,29 +666,19 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( ) { opus_int i, k, lag; - opus_int32 gain_adj_Q16, inv_gain_Q31, inv_gain_Q23; + opus_int32 gain_adj_Q16, inv_gain_Q31, inv_gain_Q26; NSQ_del_dec_struct *psDD; lag = pitchL[ subfr ]; inv_gain_Q31 = silk_INVERSE32_varQ( silk_max( Gains_Q16[ subfr ], 1 ), 47 ); silk_assert( inv_gain_Q31 != 0 ); - /* Calculate gain adjustment factor */ - if( Gains_Q16[ subfr ] != NSQ->prev_gain_Q16 ) { - gain_adj_Q16 = silk_DIV32_varQ( NSQ->prev_gain_Q16, Gains_Q16[ subfr ], 16 ); - } else { - gain_adj_Q16 = (opus_int32)1 << 16; - } - /* Scale input */ - inv_gain_Q23 = silk_RSHIFT_ROUND( inv_gain_Q31, 8 ); + inv_gain_Q26 = silk_RSHIFT_ROUND( inv_gain_Q31, 5 ); for( i = 0; i < psEncC->subfr_length; i++ ) { - x_sc_Q10[ i ] = silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); + x_sc_Q10[ i ] = silk_SMULWW( x16[ i ], inv_gain_Q26 ); } - /* Save inverse gain */ - NSQ->prev_gain_Q16 = Gains_Q16[ subfr ]; - /* After rewhitening the LTP state is un-scaled, so scale with inv_gain_Q16 */ if( NSQ->rewhite_flag ) { if( subfr == 0 ) { @@ -681,7 +692,9 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( } /* Adjust for changing gain */ - if( gain_adj_Q16 != (opus_int32)1 << 16 ) { + if( Gains_Q16[ subfr ] != NSQ->prev_gain_Q16 ) { + gain_adj_Q16 = silk_DIV32_varQ( NSQ->prev_gain_Q16, Gains_Q16[ subfr ], 16 ); + /* Scale long-term shaping state */ for( i = NSQ->sLTP_shp_buf_idx - psEncC->ltp_mem_length; i < NSQ->sLTP_shp_buf_idx; i++ ) { NSQ->sLTP_shp_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); @@ -699,6 +712,7 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( /* Scale scalar states */ psDD->LF_AR_Q14 = silk_SMULWW( gain_adj_Q16, psDD->LF_AR_Q14 ); + psDD->Diff_Q14 = silk_SMULWW( gain_adj_Q16, psDD->Diff_Q14 ); /* Scale short-term prediction and shaping states */ for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { @@ -712,5 +726,8 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( psDD->Shape_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Shape_Q14[ i ] ); } } + + /* Save inverse gain */ + NSQ->prev_gain_Q16 = Gains_Q16[ subfr ]; } } diff --git a/thirdparty/opus/silk/PLC.c b/thirdparty/opus/silk/PLC.c index fb6ea887b7..f89391651c 100644 --- a/thirdparty/opus/silk/PLC.c +++ b/thirdparty/opus/silk/PLC.c @@ -275,7 +275,7 @@ static OPUS_INLINE void silk_PLC_conceal( /* Reduce random noise for unvoiced frames with high LPC gain */ opus_int32 invGain_Q30, down_scale_Q30; - invGain_Q30 = silk_LPC_inverse_pred_gain( psPLC->prevLPC_Q12, psDec->LPC_order ); + invGain_Q30 = silk_LPC_inverse_pred_gain( psPLC->prevLPC_Q12, psDec->LPC_order, arch ); down_scale_Q30 = silk_min_32( silk_RSHIFT( (opus_int32)1 << 30, LOG2_INV_LPC_GAIN_HIGH_THRES ), invGain_Q30 ); down_scale_Q30 = silk_max_32( silk_RSHIFT( (opus_int32)1 << 30, LOG2_INV_LPC_GAIN_LOW_THRES ), down_scale_Q30 ); @@ -291,7 +291,7 @@ static OPUS_INLINE void silk_PLC_conceal( /* Rewhiten LTP state */ idx = psDec->ltp_mem_length - lag - psDec->LPC_order - LTP_ORDER / 2; - silk_assert( idx > 0 ); + celt_assert( idx > 0 ); silk_LPC_analysis_filter( &sLTP[ idx ], &psDec->outBuf[ idx ], A_Q12, psDec->ltp_mem_length - idx, psDec->LPC_order, arch ); /* Scale LTP state */ inv_gain_Q30 = silk_INVERSE32_varQ( psPLC->prevGain_Q16[ 1 ], 46 ); @@ -328,8 +328,10 @@ static OPUS_INLINE void silk_PLC_conceal( for( j = 0; j < LTP_ORDER; j++ ) { B_Q14[ j ] = silk_RSHIFT( silk_SMULBB( harm_Gain_Q15, B_Q14[ j ] ), 15 ); } - /* Gradually reduce excitation gain */ - rand_scale_Q14 = silk_RSHIFT( silk_SMULBB( rand_scale_Q14, rand_Gain_Q15 ), 15 ); + if ( psDec->indices.signalType != TYPE_NO_VOICE_ACTIVITY ) { + /* Gradually reduce excitation gain */ + rand_scale_Q14 = silk_RSHIFT( silk_SMULBB( rand_scale_Q14, rand_Gain_Q15 ), 15 ); + } /* Slowly increase pitch lag */ psPLC->pitchL_Q8 = silk_SMLAWB( psPLC->pitchL_Q8, psPLC->pitchL_Q8, PITCH_DRIFT_FAC_Q16 ); @@ -345,7 +347,7 @@ static OPUS_INLINE void silk_PLC_conceal( /* Copy LPC state */ silk_memcpy( sLPC_Q14_ptr, psDec->sLPC_Q14_buf, MAX_LPC_ORDER * sizeof( opus_int32 ) ); - silk_assert( psDec->LPC_order >= 10 ); /* check that unrolling works */ + celt_assert( psDec->LPC_order >= 10 ); /* check that unrolling works */ for( i = 0; i < psDec->frame_length; i++ ) { /* partly unrolled */ /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ diff --git a/thirdparty/opus/silk/SigProc_FIX.h b/thirdparty/opus/silk/SigProc_FIX.h index b63299441e..f9ae326326 100644 --- a/thirdparty/opus/silk/SigProc_FIX.h +++ b/thirdparty/opus/silk/SigProc_FIX.h @@ -35,7 +35,7 @@ extern "C" /*#define silk_MACRO_COUNT */ /* Used to enable WMOPS counting */ -#define SILK_MAX_ORDER_LPC 16 /* max order of the LPC analysis in schur() and k2a() */ +#define SILK_MAX_ORDER_LPC 24 /* max order of the LPC analysis in schur() and k2a() */ #include <string.h> /* for memset(), memcpy(), memmove() */ #include "typedef.h" @@ -47,6 +47,11 @@ extern "C" #include "x86/SigProc_FIX_sse.h" #endif +#if (defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)) +#include "arm/biquad_alt_arm.h" +#include "arm/LPC_inv_pred_gain_arm.h" +#endif + /********************************************************************/ /* SIGNAL PROCESSING FUNCTIONS */ /********************************************************************/ @@ -96,14 +101,22 @@ void silk_resampler_down2_3( * slower than biquad() but uses more precise coefficients * can handle (slowly) varying coefficients */ -void silk_biquad_alt( +void silk_biquad_alt_stride1( const opus_int16 *in, /* I input signal */ const opus_int32 *B_Q28, /* I MA coefficients [3] */ const opus_int32 *A_Q28, /* I AR coefficients [2] */ opus_int32 *S, /* I/O State vector [2] */ opus_int16 *out, /* O output signal */ - const opus_int32 len, /* I signal length (must be even) */ - opus_int stride /* I Operate on interleaved signal if > 1 */ + const opus_int32 len /* I signal length (must be even) */ +); + +void silk_biquad_alt_stride2_c( + const opus_int16 *in, /* I input signal */ + const opus_int32 *B_Q28, /* I MA coefficients [3] */ + const opus_int32 *A_Q28, /* I AR coefficients [2] */ + opus_int32 *S, /* I/O State vector [4] */ + opus_int16 *out, /* O output signal */ + const opus_int32 len /* I signal length (must be even) */ ); /* Variable order MA prediction error filter. */ @@ -132,17 +145,11 @@ void silk_bwexpander_32( /* Compute inverse of LPC prediction gain, and */ /* test if LPC coefficients are stable (all poles within unit circle) */ -opus_int32 silk_LPC_inverse_pred_gain( /* O Returns inverse prediction gain in energy domain, Q30 */ +opus_int32 silk_LPC_inverse_pred_gain_c( /* O Returns inverse prediction gain in energy domain, Q30 */ const opus_int16 *A_Q12, /* I Prediction coefficients, Q12 [order] */ const opus_int order /* I Prediction order */ ); -/* For input in Q24 domain */ -opus_int32 silk_LPC_inverse_pred_gain_Q24( /* O Returns inverse prediction gain in energy domain, Q30 */ - const opus_int32 *A_Q24, /* I Prediction coefficients [order] */ - const opus_int order /* I Prediction order */ -); - /* Split signal in two decimated bands using first-order allpass filters */ void silk_ana_filt_bank_1( const opus_int16 *in, /* I Input signal [N] */ @@ -152,6 +159,14 @@ void silk_ana_filt_bank_1( const opus_int32 N /* I Number of input samples */ ); +#if !defined(OVERRIDE_silk_biquad_alt_stride2) +#define silk_biquad_alt_stride2(in, B_Q28, A_Q28, S, out, len, arch) ((void)(arch), silk_biquad_alt_stride2_c(in, B_Q28, A_Q28, S, out, len)) +#endif + +#if !defined(OVERRIDE_silk_LPC_inverse_pred_gain) +#define silk_LPC_inverse_pred_gain(A_Q12, order, arch) ((void)(arch), silk_LPC_inverse_pred_gain_c(A_Q12, order)) +#endif + /********************************************************************/ /* SCALAR FUNCTIONS */ /********************************************************************/ @@ -271,7 +286,17 @@ void silk_A2NLSF( void silk_NLSF2A( opus_int16 *a_Q12, /* O monic whitening filter coefficients in Q12, [ d ] */ const opus_int16 *NLSF, /* I normalized line spectral frequencies in Q15, [ d ] */ - const opus_int d /* I filter order (should be even) */ + const opus_int d, /* I filter order (should be even) */ + int arch /* I Run-time architecture */ +); + +/* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around */ +void silk_LPC_fit( + opus_int16 *a_QOUT, /* O Output signal */ + opus_int32 *a_QIN, /* I/O Input signal */ + const opus_int QOUT, /* I Input Q domain */ + const opus_int QIN, /* I Input Q domain */ + const opus_int d /* I Filter order */ ); void silk_insertion_sort_increasing( @@ -471,8 +496,7 @@ static OPUS_INLINE opus_int32 silk_ROR32( opus_int32 a32, opus_int rot ) /* Add with saturation for positive input values */ #define silk_ADD_POS_SAT8(a, b) ((((a)+(b)) & 0x80) ? silk_int8_MAX : ((a)+(b))) #define silk_ADD_POS_SAT16(a, b) ((((a)+(b)) & 0x8000) ? silk_int16_MAX : ((a)+(b))) -#define silk_ADD_POS_SAT32(a, b) ((((a)+(b)) & 0x80000000) ? silk_int32_MAX : ((a)+(b))) -#define silk_ADD_POS_SAT64(a, b) ((((a)+(b)) & 0x8000000000000000LL) ? silk_int64_MAX : ((a)+(b))) +#define silk_ADD_POS_SAT32(a, b) ((((opus_uint32)(a)+(opus_uint32)(b)) & 0x80000000) ? silk_int32_MAX : ((a)+(b))) #define silk_LSHIFT8(a, shift) ((opus_int8)((opus_uint8)(a)<<(shift))) /* shift >= 0, shift < 8 */ #define silk_LSHIFT16(a, shift) ((opus_int16)((opus_uint16)(a)<<(shift))) /* shift >= 0, shift < 16 */ @@ -572,7 +596,9 @@ static OPUS_INLINE opus_int64 silk_max_64(opus_int64 a, opus_int64 b) /* Make sure to store the result as the seed for the next call (also in between */ /* frames), otherwise result won't be random at all. When only using some of the */ /* bits, take the most significant bits by right-shifting. */ -#define silk_RAND(seed) (silk_MLA_ovflw(907633515, (seed), 196314165)) +#define RAND_MULTIPLIER 196314165 +#define RAND_INCREMENT 907633515 +#define silk_RAND(seed) (silk_MLA_ovflw((RAND_INCREMENT), (seed), (RAND_MULTIPLIER))) /* Add some multiplication functions that can be easily mapped to ARM. */ diff --git a/thirdparty/opus/silk/VAD.c b/thirdparty/opus/silk/VAD.c index 0a782af2f1..d0cda52162 100644 --- a/thirdparty/opus/silk/VAD.c +++ b/thirdparty/opus/silk/VAD.c @@ -101,9 +101,9 @@ opus_int silk_VAD_GetSA_Q8_c( /* O Return v /* Safety checks */ silk_assert( VAD_N_BANDS == 4 ); - silk_assert( MAX_FRAME_LENGTH >= psEncC->frame_length ); - silk_assert( psEncC->frame_length <= 512 ); - silk_assert( psEncC->frame_length == 8 * silk_RSHIFT( psEncC->frame_length, 3 ) ); + celt_assert( MAX_FRAME_LENGTH >= psEncC->frame_length ); + celt_assert( psEncC->frame_length <= 512 ); + celt_assert( psEncC->frame_length == 8 * silk_RSHIFT( psEncC->frame_length, 3 ) ); /***********************/ /* Filter and Decimate */ @@ -252,15 +252,14 @@ opus_int silk_VAD_GetSA_Q8_c( /* O Return v speech_nrg += ( b + 1 ) * silk_RSHIFT( Xnrg[ b ] - psSilk_VAD->NL[ b ], 4 ); } + if( psEncC->frame_length == 20 * psEncC->fs_kHz ) { + speech_nrg = silk_RSHIFT32( speech_nrg, 1 ); + } /* Power scaling */ if( speech_nrg <= 0 ) { SA_Q15 = silk_RSHIFT( SA_Q15, 1 ); - } else if( speech_nrg < 32768 ) { - if( psEncC->frame_length == 10 * psEncC->fs_kHz ) { - speech_nrg = silk_LSHIFT_SAT32( speech_nrg, 16 ); - } else { - speech_nrg = silk_LSHIFT_SAT32( speech_nrg, 15 ); - } + } else if( speech_nrg < 16384 ) { + speech_nrg = silk_LSHIFT32( speech_nrg, 16 ); /* square-root */ speech_nrg = silk_SQRT_APPROX( speech_nrg ); @@ -313,6 +312,8 @@ void silk_VAD_GetNoiseLevels( /* Initially faster smoothing */ if( psSilk_VAD->counter < 1000 ) { /* 1000 = 20 sec */ min_coef = silk_DIV32_16( silk_int16_MAX, silk_RSHIFT( psSilk_VAD->counter, 4 ) + 1 ); + /* Increment frame counter */ + psSilk_VAD->counter++; } else { min_coef = 0; } @@ -356,7 +357,4 @@ void silk_VAD_GetNoiseLevels( /* Store as part of state */ psSilk_VAD->NL[ k ] = nl; } - - /* Increment frame counter */ - psSilk_VAD->counter++; } diff --git a/thirdparty/opus/silk/VQ_WMat_EC.c b/thirdparty/opus/silk/VQ_WMat_EC.c index 7983f1db80..0f3d545c4e 100644 --- a/thirdparty/opus/silk/VQ_WMat_EC.c +++ b/thirdparty/opus/silk/VQ_WMat_EC.c @@ -34,84 +34,95 @@ POSSIBILITY OF SUCH DAMAGE. /* Entropy constrained matrix-weighted VQ, hard-coded to 5-element vectors, for a single input data vector */ void silk_VQ_WMat_EC_c( opus_int8 *ind, /* O index of best codebook vector */ - opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */ + opus_int32 *res_nrg_Q15, /* O best residual energy */ + opus_int32 *rate_dist_Q8, /* O best total bitrate */ opus_int *gain_Q7, /* O sum of absolute LTP coefficients */ - const opus_int16 *in_Q14, /* I input vector to be quantized */ - const opus_int32 *W_Q18, /* I weighting matrix */ + const opus_int32 *XX_Q17, /* I correlation matrix */ + const opus_int32 *xX_Q17, /* I correlation vector */ const opus_int8 *cb_Q7, /* I codebook */ const opus_uint8 *cb_gain_Q7, /* I codebook effective gain */ const opus_uint8 *cl_Q5, /* I code length for each codebook vector */ - const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */ + const opus_int subfr_len, /* I number of samples per subframe */ const opus_int32 max_gain_Q7, /* I maximum sum of absolute LTP coefficients */ - opus_int L /* I number of vectors in codebook */ + const opus_int L /* I number of vectors in codebook */ ) { opus_int k, gain_tmp_Q7; const opus_int8 *cb_row_Q7; - opus_int16 diff_Q14[ 5 ]; - opus_int32 sum1_Q14, sum2_Q16; + opus_int32 neg_xX_Q24[ 5 ]; + opus_int32 sum1_Q15, sum2_Q24; + opus_int32 bits_res_Q8, bits_tot_Q8; + + /* Negate and convert to new Q domain */ + neg_xX_Q24[ 0 ] = -silk_LSHIFT32( xX_Q17[ 0 ], 7 ); + neg_xX_Q24[ 1 ] = -silk_LSHIFT32( xX_Q17[ 1 ], 7 ); + neg_xX_Q24[ 2 ] = -silk_LSHIFT32( xX_Q17[ 2 ], 7 ); + neg_xX_Q24[ 3 ] = -silk_LSHIFT32( xX_Q17[ 3 ], 7 ); + neg_xX_Q24[ 4 ] = -silk_LSHIFT32( xX_Q17[ 4 ], 7 ); /* Loop over codebook */ - *rate_dist_Q14 = silk_int32_MAX; + *rate_dist_Q8 = silk_int32_MAX; + *res_nrg_Q15 = silk_int32_MAX; cb_row_Q7 = cb_Q7; + /* In things go really bad, at least *ind is set to something safe. */ + *ind = 0; for( k = 0; k < L; k++ ) { + opus_int32 penalty; gain_tmp_Q7 = cb_gain_Q7[k]; - - diff_Q14[ 0 ] = in_Q14[ 0 ] - silk_LSHIFT( cb_row_Q7[ 0 ], 7 ); - diff_Q14[ 1 ] = in_Q14[ 1 ] - silk_LSHIFT( cb_row_Q7[ 1 ], 7 ); - diff_Q14[ 2 ] = in_Q14[ 2 ] - silk_LSHIFT( cb_row_Q7[ 2 ], 7 ); - diff_Q14[ 3 ] = in_Q14[ 3 ] - silk_LSHIFT( cb_row_Q7[ 3 ], 7 ); - diff_Q14[ 4 ] = in_Q14[ 4 ] - silk_LSHIFT( cb_row_Q7[ 4 ], 7 ); - /* Weighted rate */ - sum1_Q14 = silk_SMULBB( mu_Q9, cl_Q5[ k ] ); + /* Quantization error: 1 - 2 * xX * cb + cb' * XX * cb */ + sum1_Q15 = SILK_FIX_CONST( 1.001, 15 ); /* Penalty for too large gain */ - sum1_Q14 = silk_ADD_LSHIFT32( sum1_Q14, silk_max( silk_SUB32( gain_tmp_Q7, max_gain_Q7 ), 0 ), 10 ); - - silk_assert( sum1_Q14 >= 0 ); - - /* first row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 1 ], diff_Q14[ 1 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 2 ], diff_Q14[ 2 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 3 ], diff_Q14[ 3 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 4 ], diff_Q14[ 4 ] ); - sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 0 ], diff_Q14[ 0 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 0 ] ); - - /* second row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 7 ], diff_Q14[ 2 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 8 ], diff_Q14[ 3 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 9 ], diff_Q14[ 4 ] ); - sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 6 ], diff_Q14[ 1 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 1 ] ); - - /* third row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 13 ], diff_Q14[ 3 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 14 ], diff_Q14[ 4 ] ); - sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 12 ], diff_Q14[ 2 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 2 ] ); - - /* fourth row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 19 ], diff_Q14[ 4 ] ); - sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 18 ], diff_Q14[ 3 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 3 ] ); - - /* last row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 24 ], diff_Q14[ 4 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 4 ] ); - - silk_assert( sum1_Q14 >= 0 ); + penalty = silk_LSHIFT32( silk_max( silk_SUB32( gain_tmp_Q7, max_gain_Q7 ), 0 ), 11 ); + + /* first row of XX_Q17 */ + sum2_Q24 = silk_MLA( neg_xX_Q24[ 0 ], XX_Q17[ 1 ], cb_row_Q7[ 1 ] ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 2 ], cb_row_Q7[ 2 ] ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 3 ], cb_row_Q7[ 3 ] ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 4 ], cb_row_Q7[ 4 ] ); + sum2_Q24 = silk_LSHIFT32( sum2_Q24, 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 0 ], cb_row_Q7[ 0 ] ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7[ 0 ] ); + + /* second row of XX_Q17 */ + sum2_Q24 = silk_MLA( neg_xX_Q24[ 1 ], XX_Q17[ 7 ], cb_row_Q7[ 2 ] ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 8 ], cb_row_Q7[ 3 ] ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 9 ], cb_row_Q7[ 4 ] ); + sum2_Q24 = silk_LSHIFT32( sum2_Q24, 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 6 ], cb_row_Q7[ 1 ] ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7[ 1 ] ); + + /* third row of XX_Q17 */ + sum2_Q24 = silk_MLA( neg_xX_Q24[ 2 ], XX_Q17[ 13 ], cb_row_Q7[ 3 ] ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 14 ], cb_row_Q7[ 4 ] ); + sum2_Q24 = silk_LSHIFT32( sum2_Q24, 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 12 ], cb_row_Q7[ 2 ] ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7[ 2 ] ); + + /* fourth row of XX_Q17 */ + sum2_Q24 = silk_MLA( neg_xX_Q24[ 3 ], XX_Q17[ 19 ], cb_row_Q7[ 4 ] ); + sum2_Q24 = silk_LSHIFT32( sum2_Q24, 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 18 ], cb_row_Q7[ 3 ] ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7[ 3 ] ); + + /* last row of XX_Q17 */ + sum2_Q24 = silk_LSHIFT32( neg_xX_Q24[ 4 ], 1 ); + sum2_Q24 = silk_MLA( sum2_Q24, XX_Q17[ 24 ], cb_row_Q7[ 4 ] ); + sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7[ 4 ] ); /* find best */ - if( sum1_Q14 < *rate_dist_Q14 ) { - *rate_dist_Q14 = sum1_Q14; - *ind = (opus_int8)k; - *gain_Q7 = gain_tmp_Q7; + if( sum1_Q15 >= 0 ) { + /* Translate residual energy to bits using high-rate assumption (6 dB ==> 1 bit/sample) */ + bits_res_Q8 = silk_SMULBB( subfr_len, silk_lin2log( sum1_Q15 + penalty) - (15 << 7) ); + /* In the following line we reduce the codelength component by half ("-1"); seems to slghtly improve quality */ + bits_tot_Q8 = silk_ADD_LSHIFT32( bits_res_Q8, cl_Q5[ k ], 3-1 ); + if( bits_tot_Q8 <= *rate_dist_Q8 ) { + *rate_dist_Q8 = bits_tot_Q8; + *res_nrg_Q15 = sum1_Q15 + penalty; + *ind = (opus_int8)k; + *gain_Q7 = gain_tmp_Q7; + } } /* Go to next cbk vector */ diff --git a/thirdparty/opus/silk/arm/LPC_inv_pred_gain_arm.h b/thirdparty/opus/silk/arm/LPC_inv_pred_gain_arm.h new file mode 100644 index 0000000000..9895b555c8 --- /dev/null +++ b/thirdparty/opus/silk/arm/LPC_inv_pred_gain_arm.h @@ -0,0 +1,57 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SILK_LPC_INV_PRED_GAIN_ARM_H +# define SILK_LPC_INV_PRED_GAIN_ARM_H + +# include "celt/arm/armcpu.h" + +# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) +opus_int32 silk_LPC_inverse_pred_gain_neon( /* O Returns inverse prediction gain in energy domain, Q30 */ + const opus_int16 *A_Q12, /* I Prediction coefficients, Q12 [order] */ + const opus_int order /* I Prediction order */ +); + +# if !defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_PRESUME_NEON) +# define OVERRIDE_silk_LPC_inverse_pred_gain (1) +# define silk_LPC_inverse_pred_gain(A_Q12, order, arch) ((void)(arch), PRESUME_NEON(silk_LPC_inverse_pred_gain)(A_Q12, order)) +# endif +# endif + +# if !defined(OVERRIDE_silk_LPC_inverse_pred_gain) +/*Is run-time CPU detection enabled on this platform?*/ +# if defined(OPUS_HAVE_RTCD) && (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)) +extern opus_int32 (*const SILK_LPC_INVERSE_PRED_GAIN_IMPL[OPUS_ARCHMASK+1])(const opus_int16 *A_Q12, const opus_int order); +# define OVERRIDE_silk_LPC_inverse_pred_gain (1) +# define silk_LPC_inverse_pred_gain(A_Q12, order, arch) ((*SILK_LPC_INVERSE_PRED_GAIN_IMPL[(arch)&OPUS_ARCHMASK])(A_Q12, order)) +# elif defined(OPUS_ARM_PRESUME_NEON_INTR) +# define OVERRIDE_silk_LPC_inverse_pred_gain (1) +# define silk_LPC_inverse_pred_gain(A_Q12, order, arch) ((void)(arch), silk_LPC_inverse_pred_gain_neon(A_Q12, order)) +# endif +# endif + +#endif /* end SILK_LPC_INV_PRED_GAIN_ARM_H */ diff --git a/thirdparty/opus/silk/arm/LPC_inv_pred_gain_neon_intr.c b/thirdparty/opus/silk/arm/LPC_inv_pred_gain_neon_intr.c new file mode 100644 index 0000000000..ab426bcd66 --- /dev/null +++ b/thirdparty/opus/silk/arm/LPC_inv_pred_gain_neon_intr.c @@ -0,0 +1,280 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <arm_neon.h> +#include "SigProc_FIX.h" +#include "define.h" + +#define QA 24 +#define A_LIMIT SILK_FIX_CONST( 0.99975, QA ) + +#define MUL32_FRAC_Q(a32, b32, Q) ((opus_int32)(silk_RSHIFT_ROUND64(silk_SMULL(a32, b32), Q))) + +/* The difficulty is how to judge a 64-bit signed integer tmp64 is 32-bit overflowed, + * since NEON has no 64-bit min, max or comparison instructions. + * A failed idea is to compare the results of vmovn(tmp64) and vqmovn(tmp64) whether they are equal or not. + * However, this idea fails when the tmp64 is something like 0xFFFFFFF980000000. + * Here we know that mult2Q >= 1, so the highest bit (bit 63, sign bit) of tmp64 must equal to bit 62. + * tmp64 was shifted left by 1 and we got tmp64'. If high_half(tmp64') != 0 and high_half(tmp64') != -1, + * then we know that bit 31 to bit 63 of tmp64 can not all be the sign bit, and therefore tmp64 is 32-bit overflowed. + * That is, we judge if tmp64' > 0x00000000FFFFFFFF, or tmp64' <= 0xFFFFFFFF00000000. + * We use narrowing shift right 31 bits to tmp32' to save data bandwidth and instructions. + * That is, we judge if tmp32' > 0x00000000, or tmp32' <= 0xFFFFFFFF. + */ + +/* Compute inverse of LPC prediction gain, and */ +/* test if LPC coefficients are stable (all poles within unit circle) */ +static OPUS_INLINE opus_int32 LPC_inverse_pred_gain_QA_neon( /* O Returns inverse prediction gain in energy domain, Q30 */ + opus_int32 A_QA[ SILK_MAX_ORDER_LPC ], /* I Prediction coefficients */ + const opus_int order /* I Prediction order */ +) +{ + opus_int k, n, mult2Q; + opus_int32 invGain_Q30, rc_Q31, rc_mult1_Q30, rc_mult2, tmp1, tmp2; + opus_int32 max, min; + int32x4_t max_s32x4, min_s32x4; + int32x2_t max_s32x2, min_s32x2; + + max_s32x4 = vdupq_n_s32( silk_int32_MIN ); + min_s32x4 = vdupq_n_s32( silk_int32_MAX ); + invGain_Q30 = SILK_FIX_CONST( 1, 30 ); + for( k = order - 1; k > 0; k-- ) { + int32x2_t rc_Q31_s32x2, rc_mult2_s32x2; + int64x2_t mult2Q_s64x2; + + /* Check for stability */ + if( ( A_QA[ k ] > A_LIMIT ) || ( A_QA[ k ] < -A_LIMIT ) ) { + return 0; + } + + /* Set RC equal to negated AR coef */ + rc_Q31 = -silk_LSHIFT( A_QA[ k ], 31 - QA ); + + /* rc_mult1_Q30 range: [ 1 : 2^30 ] */ + rc_mult1_Q30 = silk_SUB32( SILK_FIX_CONST( 1, 30 ), silk_SMMUL( rc_Q31, rc_Q31 ) ); + silk_assert( rc_mult1_Q30 > ( 1 << 15 ) ); /* reduce A_LIMIT if fails */ + silk_assert( rc_mult1_Q30 <= ( 1 << 30 ) ); + + /* Update inverse gain */ + /* invGain_Q30 range: [ 0 : 2^30 ] */ + invGain_Q30 = silk_LSHIFT( silk_SMMUL( invGain_Q30, rc_mult1_Q30 ), 2 ); + silk_assert( invGain_Q30 >= 0 ); + silk_assert( invGain_Q30 <= ( 1 << 30 ) ); + if( invGain_Q30 < SILK_FIX_CONST( 1.0f / MAX_PREDICTION_POWER_GAIN, 30 ) ) { + return 0; + } + + /* rc_mult2 range: [ 2^30 : silk_int32_MAX ] */ + mult2Q = 32 - silk_CLZ32( silk_abs( rc_mult1_Q30 ) ); + rc_mult2 = silk_INVERSE32_varQ( rc_mult1_Q30, mult2Q + 30 ); + + /* Update AR coefficient */ + rc_Q31_s32x2 = vdup_n_s32( rc_Q31 ); + mult2Q_s64x2 = vdupq_n_s64( -mult2Q ); + rc_mult2_s32x2 = vdup_n_s32( rc_mult2 ); + + for( n = 0; n < ( ( k + 1 ) >> 1 ) - 3; n += 4 ) { + /* We always calculate extra elements of A_QA buffer when ( k % 4 ) != 0, to take the advantage of SIMD parallelization. */ + int32x4_t tmp1_s32x4, tmp2_s32x4, t0_s32x4, t1_s32x4, s0_s32x4, s1_s32x4, t_QA0_s32x4, t_QA1_s32x4; + int64x2_t t0_s64x2, t1_s64x2, t2_s64x2, t3_s64x2; + tmp1_s32x4 = vld1q_s32( A_QA + n ); + tmp2_s32x4 = vld1q_s32( A_QA + k - n - 4 ); + tmp2_s32x4 = vrev64q_s32( tmp2_s32x4 ); + tmp2_s32x4 = vcombine_s32( vget_high_s32( tmp2_s32x4 ), vget_low_s32( tmp2_s32x4 ) ); + t0_s32x4 = vqrdmulhq_lane_s32( tmp2_s32x4, rc_Q31_s32x2, 0 ); + t1_s32x4 = vqrdmulhq_lane_s32( tmp1_s32x4, rc_Q31_s32x2, 0 ); + t_QA0_s32x4 = vqsubq_s32( tmp1_s32x4, t0_s32x4 ); + t_QA1_s32x4 = vqsubq_s32( tmp2_s32x4, t1_s32x4 ); + t0_s64x2 = vmull_s32( vget_low_s32 ( t_QA0_s32x4 ), rc_mult2_s32x2 ); + t1_s64x2 = vmull_s32( vget_high_s32( t_QA0_s32x4 ), rc_mult2_s32x2 ); + t2_s64x2 = vmull_s32( vget_low_s32 ( t_QA1_s32x4 ), rc_mult2_s32x2 ); + t3_s64x2 = vmull_s32( vget_high_s32( t_QA1_s32x4 ), rc_mult2_s32x2 ); + t0_s64x2 = vrshlq_s64( t0_s64x2, mult2Q_s64x2 ); + t1_s64x2 = vrshlq_s64( t1_s64x2, mult2Q_s64x2 ); + t2_s64x2 = vrshlq_s64( t2_s64x2, mult2Q_s64x2 ); + t3_s64x2 = vrshlq_s64( t3_s64x2, mult2Q_s64x2 ); + t0_s32x4 = vcombine_s32( vmovn_s64( t0_s64x2 ), vmovn_s64( t1_s64x2 ) ); + t1_s32x4 = vcombine_s32( vmovn_s64( t2_s64x2 ), vmovn_s64( t3_s64x2 ) ); + s0_s32x4 = vcombine_s32( vshrn_n_s64( t0_s64x2, 31 ), vshrn_n_s64( t1_s64x2, 31 ) ); + s1_s32x4 = vcombine_s32( vshrn_n_s64( t2_s64x2, 31 ), vshrn_n_s64( t3_s64x2, 31 ) ); + max_s32x4 = vmaxq_s32( max_s32x4, s0_s32x4 ); + min_s32x4 = vminq_s32( min_s32x4, s0_s32x4 ); + max_s32x4 = vmaxq_s32( max_s32x4, s1_s32x4 ); + min_s32x4 = vminq_s32( min_s32x4, s1_s32x4 ); + t1_s32x4 = vrev64q_s32( t1_s32x4 ); + t1_s32x4 = vcombine_s32( vget_high_s32( t1_s32x4 ), vget_low_s32( t1_s32x4 ) ); + vst1q_s32( A_QA + n, t0_s32x4 ); + vst1q_s32( A_QA + k - n - 4, t1_s32x4 ); + } + for( ; n < (k + 1) >> 1; n++ ) { + opus_int64 tmp64; + tmp1 = A_QA[ n ]; + tmp2 = A_QA[ k - n - 1 ]; + tmp64 = silk_RSHIFT_ROUND64( silk_SMULL( silk_SUB_SAT32(tmp1, + MUL32_FRAC_Q( tmp2, rc_Q31, 31 ) ), rc_mult2 ), mult2Q); + if( tmp64 > silk_int32_MAX || tmp64 < silk_int32_MIN ) { + return 0; + } + A_QA[ n ] = ( opus_int32 )tmp64; + tmp64 = silk_RSHIFT_ROUND64( silk_SMULL( silk_SUB_SAT32(tmp2, + MUL32_FRAC_Q( tmp1, rc_Q31, 31 ) ), rc_mult2), mult2Q); + if( tmp64 > silk_int32_MAX || tmp64 < silk_int32_MIN ) { + return 0; + } + A_QA[ k - n - 1 ] = ( opus_int32 )tmp64; + } + } + + /* Check for stability */ + if( ( A_QA[ k ] > A_LIMIT ) || ( A_QA[ k ] < -A_LIMIT ) ) { + return 0; + } + + max_s32x2 = vmax_s32( vget_low_s32( max_s32x4 ), vget_high_s32( max_s32x4 ) ); + min_s32x2 = vmin_s32( vget_low_s32( min_s32x4 ), vget_high_s32( min_s32x4 ) ); + max_s32x2 = vmax_s32( max_s32x2, vreinterpret_s32_s64( vshr_n_s64( vreinterpret_s64_s32( max_s32x2 ), 32 ) ) ); + min_s32x2 = vmin_s32( min_s32x2, vreinterpret_s32_s64( vshr_n_s64( vreinterpret_s64_s32( min_s32x2 ), 32 ) ) ); + max = vget_lane_s32( max_s32x2, 0 ); + min = vget_lane_s32( min_s32x2, 0 ); + if( ( max > 0 ) || ( min < -1 ) ) { + return 0; + } + + /* Set RC equal to negated AR coef */ + rc_Q31 = -silk_LSHIFT( A_QA[ 0 ], 31 - QA ); + + /* Range: [ 1 : 2^30 ] */ + rc_mult1_Q30 = silk_SUB32( SILK_FIX_CONST( 1, 30 ), silk_SMMUL( rc_Q31, rc_Q31 ) ); + + /* Update inverse gain */ + /* Range: [ 0 : 2^30 ] */ + invGain_Q30 = silk_LSHIFT( silk_SMMUL( invGain_Q30, rc_mult1_Q30 ), 2 ); + silk_assert( invGain_Q30 >= 0 ); + silk_assert( invGain_Q30 <= ( 1 << 30 ) ); + if( invGain_Q30 < SILK_FIX_CONST( 1.0f / MAX_PREDICTION_POWER_GAIN, 30 ) ) { + return 0; + } + + return invGain_Q30; +} + +/* For input in Q12 domain */ +opus_int32 silk_LPC_inverse_pred_gain_neon( /* O Returns inverse prediction gain in energy domain, Q30 */ + const opus_int16 *A_Q12, /* I Prediction coefficients, Q12 [order] */ + const opus_int order /* I Prediction order */ +) +{ +#ifdef OPUS_CHECK_ASM + const opus_int32 invGain_Q30_c = silk_LPC_inverse_pred_gain_c( A_Q12, order ); +#endif + + opus_int32 invGain_Q30; + if( ( SILK_MAX_ORDER_LPC != 24 ) || ( order & 1 )) { + invGain_Q30 = silk_LPC_inverse_pred_gain_c( A_Q12, order ); + } + else { + opus_int32 Atmp_QA[ SILK_MAX_ORDER_LPC ]; + opus_int32 DC_resp; + int16x8_t t0_s16x8, t1_s16x8, t2_s16x8; + int32x4_t t0_s32x4; + const opus_int leftover = order & 7; + + /* Increase Q domain of the AR coefficients */ + t0_s16x8 = vld1q_s16( A_Q12 + 0 ); + t1_s16x8 = vld1q_s16( A_Q12 + 8 ); + t2_s16x8 = vld1q_s16( A_Q12 + 16 ); + t0_s32x4 = vpaddlq_s16( t0_s16x8 ); + + switch( order - leftover ) + { + case 24: + t0_s32x4 = vpadalq_s16( t0_s32x4, t2_s16x8 ); + /* FALLTHROUGH */ + + case 16: + t0_s32x4 = vpadalq_s16( t0_s32x4, t1_s16x8 ); + vst1q_s32( Atmp_QA + 16, vshll_n_s16( vget_low_s16 ( t2_s16x8 ), QA - 12 ) ); + vst1q_s32( Atmp_QA + 20, vshll_n_s16( vget_high_s16( t2_s16x8 ), QA - 12 ) ); + /* FALLTHROUGH */ + + case 8: + { + const int32x2_t t_s32x2 = vpadd_s32( vget_low_s32( t0_s32x4 ), vget_high_s32( t0_s32x4 ) ); + const int64x1_t t_s64x1 = vpaddl_s32( t_s32x2 ); + DC_resp = vget_lane_s32( vreinterpret_s32_s64( t_s64x1 ), 0 ); + vst1q_s32( Atmp_QA + 8, vshll_n_s16( vget_low_s16 ( t1_s16x8 ), QA - 12 ) ); + vst1q_s32( Atmp_QA + 12, vshll_n_s16( vget_high_s16( t1_s16x8 ), QA - 12 ) ); + } + break; + + default: + DC_resp = 0; + break; + } + A_Q12 += order - leftover; + + switch( leftover ) + { + case 6: + DC_resp += (opus_int32)A_Q12[ 5 ]; + DC_resp += (opus_int32)A_Q12[ 4 ]; + /* FALLTHROUGH */ + + case 4: + DC_resp += (opus_int32)A_Q12[ 3 ]; + DC_resp += (opus_int32)A_Q12[ 2 ]; + /* FALLTHROUGH */ + + case 2: + DC_resp += (opus_int32)A_Q12[ 1 ]; + DC_resp += (opus_int32)A_Q12[ 0 ]; + /* FALLTHROUGH */ + + default: + break; + } + + /* If the DC is unstable, we don't even need to do the full calculations */ + if( DC_resp >= 4096 ) { + invGain_Q30 = 0; + } else { + vst1q_s32( Atmp_QA + 0, vshll_n_s16( vget_low_s16 ( t0_s16x8 ), QA - 12 ) ); + vst1q_s32( Atmp_QA + 4, vshll_n_s16( vget_high_s16( t0_s16x8 ), QA - 12 ) ); + invGain_Q30 = LPC_inverse_pred_gain_QA_neon( Atmp_QA, order ); + } + } + +#ifdef OPUS_CHECK_ASM + silk_assert( invGain_Q30_c == invGain_Q30 ); +#endif + + return invGain_Q30; +} diff --git a/thirdparty/opus/silk/arm/NSQ_del_dec_arm.h b/thirdparty/opus/silk/arm/NSQ_del_dec_arm.h new file mode 100644 index 0000000000..9e76e16927 --- /dev/null +++ b/thirdparty/opus/silk/arm/NSQ_del_dec_arm.h @@ -0,0 +1,100 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SILK_NSQ_DEL_DEC_ARM_H +#define SILK_NSQ_DEL_DEC_ARM_H + +#include "celt/arm/armcpu.h" + +#if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) +void silk_NSQ_del_dec_neon( + const silk_encoder_state *psEncC, silk_nsq_state *NSQ, + SideInfoIndices *psIndices, const opus_int16 x16[], opus_int8 pulses[], + const opus_int16 PredCoef_Q12[2 * MAX_LPC_ORDER], + const opus_int16 LTPCoef_Q14[LTP_ORDER * MAX_NB_SUBFR], + const opus_int16 AR_Q13[MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER], + const opus_int HarmShapeGain_Q14[MAX_NB_SUBFR], + const opus_int Tilt_Q14[MAX_NB_SUBFR], + const opus_int32 LF_shp_Q14[MAX_NB_SUBFR], + const opus_int32 Gains_Q16[MAX_NB_SUBFR], + const opus_int pitchL[MAX_NB_SUBFR], const opus_int Lambda_Q10, + const opus_int LTP_scale_Q14); + +#if !defined(OPUS_HAVE_RTCD) +#define OVERRIDE_silk_NSQ_del_dec (1) +#define silk_NSQ_del_dec(psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, \ + LTPCoef_Q14, AR_Q13, HarmShapeGain_Q14, Tilt_Q14, \ + LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, \ + LTP_scale_Q14, arch) \ + ((void)(arch), \ + PRESUME_NEON(silk_NSQ_del_dec)( \ + psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, LTPCoef_Q14, \ + AR_Q13, HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, \ + Lambda_Q10, LTP_scale_Q14)) +#endif +#endif + +#if !defined(OVERRIDE_silk_NSQ_del_dec) +/*Is run-time CPU detection enabled on this platform?*/ +#if defined(OPUS_HAVE_RTCD) && (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && \ + !defined(OPUS_ARM_PRESUME_NEON_INTR)) +extern void (*const SILK_NSQ_DEL_DEC_IMPL[OPUS_ARCHMASK + 1])( + const silk_encoder_state *psEncC, silk_nsq_state *NSQ, + SideInfoIndices *psIndices, const opus_int16 x16[], opus_int8 pulses[], + const opus_int16 PredCoef_Q12[2 * MAX_LPC_ORDER], + const opus_int16 LTPCoef_Q14[LTP_ORDER * MAX_NB_SUBFR], + const opus_int16 AR_Q13[MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER], + const opus_int HarmShapeGain_Q14[MAX_NB_SUBFR], + const opus_int Tilt_Q14[MAX_NB_SUBFR], + const opus_int32 LF_shp_Q14[MAX_NB_SUBFR], + const opus_int32 Gains_Q16[MAX_NB_SUBFR], + const opus_int pitchL[MAX_NB_SUBFR], const opus_int Lambda_Q10, + const opus_int LTP_scale_Q14); +#define OVERRIDE_silk_NSQ_del_dec (1) +#define silk_NSQ_del_dec(psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, \ + LTPCoef_Q14, AR_Q13, HarmShapeGain_Q14, Tilt_Q14, \ + LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, \ + LTP_scale_Q14, arch) \ + ((*SILK_NSQ_DEL_DEC_IMPL[(arch)&OPUS_ARCHMASK])( \ + psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, LTPCoef_Q14, \ + AR_Q13, HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, \ + Lambda_Q10, LTP_scale_Q14)) +#elif defined(OPUS_ARM_PRESUME_NEON_INTR) +#define OVERRIDE_silk_NSQ_del_dec (1) +#define silk_NSQ_del_dec(psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, \ + LTPCoef_Q14, AR_Q13, HarmShapeGain_Q14, Tilt_Q14, \ + LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, \ + LTP_scale_Q14, arch) \ + ((void)(arch), \ + silk_NSQ_del_dec_neon(psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, \ + LTPCoef_Q14, AR_Q13, HarmShapeGain_Q14, Tilt_Q14, \ + LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, \ + LTP_scale_Q14)) +#endif +#endif + +#endif /* end SILK_NSQ_DEL_DEC_ARM_H */ diff --git a/thirdparty/opus/silk/arm/NSQ_del_dec_neon_intr.c b/thirdparty/opus/silk/arm/NSQ_del_dec_neon_intr.c new file mode 100644 index 0000000000..212410f362 --- /dev/null +++ b/thirdparty/opus/silk/arm/NSQ_del_dec_neon_intr.c @@ -0,0 +1,1124 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <arm_neon.h> +#ifdef OPUS_CHECK_ASM +# include <string.h> +#endif +#include "main.h" +#include "stack_alloc.h" + +/* NEON intrinsics optimization now can only parallelize up to 4 delay decision states. */ +/* If there are more states, C function is called, and this optimization must be expanded. */ +#define NEON_MAX_DEL_DEC_STATES 4 + +typedef struct { + opus_int32 sLPC_Q14[ MAX_SUB_FRAME_LENGTH + NSQ_LPC_BUF_LENGTH ][ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 RandState[ DECISION_DELAY ][ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 Q_Q10[ DECISION_DELAY ][ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 Xq_Q14[ DECISION_DELAY ][ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 Pred_Q15[ DECISION_DELAY ][ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 Shape_Q14[ DECISION_DELAY ][ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 sAR2_Q14[ MAX_SHAPE_LPC_ORDER ][ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 LF_AR_Q14[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 Diff_Q14[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 Seed[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 SeedInit[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 RD_Q10[ NEON_MAX_DEL_DEC_STATES ]; +} NSQ_del_decs_struct; + +typedef struct { + opus_int32 Q_Q10[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 RD_Q10[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 xq_Q14[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 LF_AR_Q14[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 Diff_Q14[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 sLTP_shp_Q14[ NEON_MAX_DEL_DEC_STATES ]; + opus_int32 LPC_exc_Q14[ NEON_MAX_DEL_DEC_STATES ]; +} NSQ_samples_struct; + +static OPUS_INLINE void silk_nsq_del_dec_scale_states_neon( + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + NSQ_del_decs_struct psDelDec[], /* I/O Delayed decision states */ + const opus_int16 x16[], /* I Input */ + opus_int32 x_sc_Q10[], /* O Input scaled with 1/Gain in Q10 */ + const opus_int16 sLTP[], /* I Re-whitened LTP state in Q0 */ + opus_int32 sLTP_Q15[], /* O LTP state matching scaled input */ + opus_int subfr, /* I Subframe number */ + const opus_int LTP_scale_Q14, /* I LTP state scaling */ + const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I */ + const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lag */ + const opus_int signal_type, /* I Signal type */ + const opus_int decisionDelay /* I Decision delay */ +); + +/******************************************/ +/* Noise shape quantizer for one subframe */ +/******************************************/ +static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_neon( + silk_nsq_state *NSQ, /* I/O NSQ state */ + NSQ_del_decs_struct psDelDec[], /* I/O Delayed decision states */ + opus_int signalType, /* I Signal type */ + const opus_int32 x_Q10[], /* I */ + opus_int8 pulses[], /* O */ + opus_int16 xq[], /* O */ + opus_int32 sLTP_Q15[], /* I/O LTP filter state */ + opus_int32 delayedGain_Q10[], /* I/O Gain delay buffer */ + const opus_int16 a_Q12[], /* I Short term prediction coefs */ + const opus_int16 b_Q14[], /* I Long term prediction coefs */ + const opus_int16 AR_shp_Q13[], /* I Noise shaping coefs */ + opus_int lag, /* I Pitch lag */ + opus_int32 HarmShapeFIRPacked_Q14, /* I */ + opus_int Tilt_Q14, /* I Spectral tilt */ + opus_int32 LF_shp_Q14, /* I */ + opus_int32 Gain_Q16, /* I */ + opus_int Lambda_Q10, /* I */ + opus_int offset_Q10, /* I */ + opus_int length, /* I Input length */ + opus_int subfr, /* I Subframe number */ + opus_int shapingLPCOrder, /* I Shaping LPC filter order */ + opus_int predictLPCOrder, /* I Prediction filter order */ + opus_int warping_Q16, /* I */ + opus_int nStatesDelayedDecision, /* I Number of states in decision tree */ + opus_int *smpl_buf_idx, /* I/O Index to newest samples in buffers */ + opus_int decisionDelay /* I */ +); + +static OPUS_INLINE void copy_winner_state_kernel( + const NSQ_del_decs_struct *psDelDec, + const opus_int offset, + const opus_int last_smple_idx, + const opus_int Winner_ind, + const int32x2_t gain_lo_s32x2, + const int32x2_t gain_hi_s32x2, + const int32x4_t shift_s32x4, + int32x4_t t0_s32x4, + int32x4_t t1_s32x4, + opus_int8 *const pulses, + opus_int16 *pxq, + silk_nsq_state *NSQ +) +{ + int16x8_t t_s16x8; + int32x4_t o0_s32x4, o1_s32x4; + + t0_s32x4 = vld1q_lane_s32( &psDelDec->Q_Q10[ last_smple_idx - 0 ][ Winner_ind ], t0_s32x4, 0 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Q_Q10[ last_smple_idx - 1 ][ Winner_ind ], t0_s32x4, 1 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Q_Q10[ last_smple_idx - 2 ][ Winner_ind ], t0_s32x4, 2 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Q_Q10[ last_smple_idx - 3 ][ Winner_ind ], t0_s32x4, 3 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Q_Q10[ last_smple_idx - 4 ][ Winner_ind ], t1_s32x4, 0 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Q_Q10[ last_smple_idx - 5 ][ Winner_ind ], t1_s32x4, 1 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Q_Q10[ last_smple_idx - 6 ][ Winner_ind ], t1_s32x4, 2 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Q_Q10[ last_smple_idx - 7 ][ Winner_ind ], t1_s32x4, 3 ); + t_s16x8 = vcombine_s16( vrshrn_n_s32( t0_s32x4, 10 ), vrshrn_n_s32( t1_s32x4, 10 ) ); + vst1_s8( &pulses[ offset ], vmovn_s16( t_s16x8 ) ); + + t0_s32x4 = vld1q_lane_s32( &psDelDec->Xq_Q14[ last_smple_idx - 0 ][ Winner_ind ], t0_s32x4, 0 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Xq_Q14[ last_smple_idx - 1 ][ Winner_ind ], t0_s32x4, 1 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Xq_Q14[ last_smple_idx - 2 ][ Winner_ind ], t0_s32x4, 2 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Xq_Q14[ last_smple_idx - 3 ][ Winner_ind ], t0_s32x4, 3 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Xq_Q14[ last_smple_idx - 4 ][ Winner_ind ], t1_s32x4, 0 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Xq_Q14[ last_smple_idx - 5 ][ Winner_ind ], t1_s32x4, 1 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Xq_Q14[ last_smple_idx - 6 ][ Winner_ind ], t1_s32x4, 2 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Xq_Q14[ last_smple_idx - 7 ][ Winner_ind ], t1_s32x4, 3 ); + o0_s32x4 = vqdmulhq_lane_s32( t0_s32x4, gain_lo_s32x2, 0 ); + o1_s32x4 = vqdmulhq_lane_s32( t1_s32x4, gain_lo_s32x2, 0 ); + o0_s32x4 = vmlaq_lane_s32( o0_s32x4, t0_s32x4, gain_hi_s32x2, 0 ); + o1_s32x4 = vmlaq_lane_s32( o1_s32x4, t1_s32x4, gain_hi_s32x2, 0 ); + o0_s32x4 = vrshlq_s32( o0_s32x4, shift_s32x4 ); + o1_s32x4 = vrshlq_s32( o1_s32x4, shift_s32x4 ); + vst1_s16( &pxq[ offset + 0 ], vqmovn_s32( o0_s32x4 ) ); + vst1_s16( &pxq[ offset + 4 ], vqmovn_s32( o1_s32x4 ) ); + + t0_s32x4 = vld1q_lane_s32( &psDelDec->Shape_Q14[ last_smple_idx - 0 ][ Winner_ind ], t0_s32x4, 0 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Shape_Q14[ last_smple_idx - 1 ][ Winner_ind ], t0_s32x4, 1 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Shape_Q14[ last_smple_idx - 2 ][ Winner_ind ], t0_s32x4, 2 ); + t0_s32x4 = vld1q_lane_s32( &psDelDec->Shape_Q14[ last_smple_idx - 3 ][ Winner_ind ], t0_s32x4, 3 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Shape_Q14[ last_smple_idx - 4 ][ Winner_ind ], t1_s32x4, 0 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Shape_Q14[ last_smple_idx - 5 ][ Winner_ind ], t1_s32x4, 1 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Shape_Q14[ last_smple_idx - 6 ][ Winner_ind ], t1_s32x4, 2 ); + t1_s32x4 = vld1q_lane_s32( &psDelDec->Shape_Q14[ last_smple_idx - 7 ][ Winner_ind ], t1_s32x4, 3 ); + vst1q_s32( &NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx + offset + 0 ], t0_s32x4 ); + vst1q_s32( &NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx + offset + 4 ], t1_s32x4 ); +} + +static OPUS_INLINE void copy_winner_state( + const NSQ_del_decs_struct *psDelDec, + const opus_int decisionDelay, + const opus_int smpl_buf_idx, + const opus_int Winner_ind, + const opus_int32 gain, + const opus_int32 shift, + opus_int8 *const pulses, + opus_int16 *pxq, + silk_nsq_state *NSQ +) +{ + opus_int i, last_smple_idx; + const int32x2_t gain_lo_s32x2 = vdup_n_s32( silk_LSHIFT32( gain & 0x0000FFFF, 15 ) ); + const int32x2_t gain_hi_s32x2 = vdup_n_s32( gain >> 16 ); + const int32x4_t shift_s32x4 = vdupq_n_s32( -shift ); + int32x4_t t0_s32x4, t1_s32x4; + + t0_s32x4 = t1_s32x4 = vdupq_n_s32( 0 ); /* initialization */ + last_smple_idx = smpl_buf_idx + decisionDelay - 1 + DECISION_DELAY; + if( last_smple_idx >= DECISION_DELAY ) last_smple_idx -= DECISION_DELAY; + if( last_smple_idx >= DECISION_DELAY ) last_smple_idx -= DECISION_DELAY; + + for( i = 0; ( i < ( decisionDelay - 7 ) ) && ( last_smple_idx >= 7 ); i += 8, last_smple_idx -= 8 ) { + copy_winner_state_kernel( psDelDec, i - decisionDelay, last_smple_idx, Winner_ind, gain_lo_s32x2, gain_hi_s32x2, shift_s32x4, t0_s32x4, t1_s32x4, pulses, pxq, NSQ ); + } + for( ; ( i < decisionDelay ) && ( last_smple_idx >= 0 ); i++, last_smple_idx-- ) { + pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDelDec->Q_Q10[ last_smple_idx ][ Winner_ind ], 10 ); + pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( psDelDec->Xq_Q14[ last_smple_idx ][ Winner_ind ], gain ), shift ) ); + NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - decisionDelay + i ] = psDelDec->Shape_Q14[ last_smple_idx ][ Winner_ind ]; + } + + last_smple_idx += DECISION_DELAY; + for( ; i < ( decisionDelay - 7 ); i++, last_smple_idx-- ) { + copy_winner_state_kernel( psDelDec, i - decisionDelay, last_smple_idx, Winner_ind, gain_lo_s32x2, gain_hi_s32x2, shift_s32x4, t0_s32x4, t1_s32x4, pulses, pxq, NSQ ); + } + for( ; i < decisionDelay; i++, last_smple_idx-- ) { + pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDelDec->Q_Q10[ last_smple_idx ][ Winner_ind ], 10 ); + pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( psDelDec->Xq_Q14[ last_smple_idx ][ Winner_ind ], gain ), shift ) ); + NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - decisionDelay + i ] = psDelDec->Shape_Q14[ last_smple_idx ][ Winner_ind ]; + } +} + +void silk_NSQ_del_dec_neon( + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16[], /* I Input */ + opus_int8 pulses[], /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I Long term prediction coefs */ + const opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I Long term shaping coefs */ + const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I Spectral tilt */ + const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I Quantization step sizes */ + const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ +) +{ +#ifdef OPUS_CHECK_ASM + silk_nsq_state NSQ_c; + SideInfoIndices psIndices_c; + opus_int8 pulses_c[ MAX_FRAME_LENGTH ]; + const opus_int8 *const pulses_a = pulses; + + ( void )pulses_a; + silk_memcpy( &NSQ_c, NSQ, sizeof( NSQ_c ) ); + silk_memcpy( &psIndices_c, psIndices, sizeof( psIndices_c ) ); + silk_memcpy( pulses_c, pulses, sizeof( pulses_c ) ); + silk_NSQ_del_dec_c( psEncC, &NSQ_c, &psIndices_c, x16, pulses_c, PredCoef_Q12, LTPCoef_Q14, AR_Q13, HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, + pitchL, Lambda_Q10, LTP_scale_Q14 ); +#endif + + /* The optimization parallelizes the different delay decision states. */ + if(( psEncC->nStatesDelayedDecision > NEON_MAX_DEL_DEC_STATES ) || ( psEncC->nStatesDelayedDecision <= 2 )) { + /* NEON intrinsics optimization now can only parallelize up to 4 delay decision states. */ + /* If there are more states, C function is called, and this optimization must be expanded. */ + /* When the number of delay decision states is less than 3, there are penalties using this */ + /* optimization, and C function is called. */ + /* When the number of delay decision states is 2, it's better to specialize another */ + /* structure NSQ_del_dec2_struct and optimize with shorter NEON registers. (Low priority) */ + silk_NSQ_del_dec_c( psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, LTPCoef_Q14, AR_Q13, HarmShapeGain_Q14, + Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14 ); + } else { + opus_int i, k, lag, start_idx, LSF_interpolation_flag, Winner_ind, subfr; + opus_int smpl_buf_idx, decisionDelay; + const opus_int16 *A_Q12, *B_Q14, *AR_shp_Q13; + opus_int16 *pxq; + VARDECL( opus_int32, sLTP_Q15 ); + VARDECL( opus_int16, sLTP ); + opus_int32 HarmShapeFIRPacked_Q14; + opus_int offset_Q10; + opus_int32 RDmin_Q10, Gain_Q10; + VARDECL( opus_int32, x_sc_Q10 ); + VARDECL( opus_int32, delayedGain_Q10 ); + VARDECL( NSQ_del_decs_struct, psDelDec ); + int32x4_t t_s32x4; + SAVE_STACK; + + /* Set unvoiced lag to the previous one, overwrite later for voiced */ + lag = NSQ->lagPrev; + + silk_assert( NSQ->prev_gain_Q16 != 0 ); + + /* Initialize delayed decision states */ + ALLOC( psDelDec, 1, NSQ_del_decs_struct ); + /* Only RandState and RD_Q10 need to be initialized to 0. */ + silk_memset( psDelDec->RandState, 0, sizeof( psDelDec->RandState ) ); + vst1q_s32( psDelDec->RD_Q10, vdupq_n_s32( 0 ) ); + + for( k = 0; k < psEncC->nStatesDelayedDecision; k++ ) { + psDelDec->SeedInit[ k ] = psDelDec->Seed[ k ] = ( k + psIndices->Seed ) & 3; + } + vst1q_s32( psDelDec->LF_AR_Q14, vld1q_dup_s32( &NSQ->sLF_AR_shp_Q14 ) ); + vst1q_s32( psDelDec->Diff_Q14, vld1q_dup_s32( &NSQ->sDiff_shp_Q14 ) ); + vst1q_s32( psDelDec->Shape_Q14[ 0 ], vld1q_dup_s32( &NSQ->sLTP_shp_Q14[ psEncC->ltp_mem_length - 1 ] ) ); + for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { + vst1q_s32( psDelDec->sLPC_Q14[ i ], vld1q_dup_s32( &NSQ->sLPC_Q14[ i ] ) ); + } + for( i = 0; i < (opus_int)( sizeof( NSQ->sAR2_Q14 ) / sizeof( NSQ->sAR2_Q14[ 0 ] ) ); i++ ) { + vst1q_s32( psDelDec->sAR2_Q14[ i ], vld1q_dup_s32( &NSQ->sAR2_Q14[ i ] ) ); + } + + offset_Q10 = silk_Quantization_Offsets_Q10[ psIndices->signalType >> 1 ][ psIndices->quantOffsetType ]; + smpl_buf_idx = 0; /* index of oldest samples */ + + decisionDelay = silk_min_int( DECISION_DELAY, psEncC->subfr_length ); + + /* For voiced frames limit the decision delay to lower than the pitch lag */ + if( psIndices->signalType == TYPE_VOICED ) { + opus_int pitch_min = pitchL[ 0 ]; + for( k = 1; k < psEncC->nb_subfr; k++ ) { + pitch_min = silk_min_int( pitch_min, pitchL[ k ] ); + } + decisionDelay = silk_min_int( decisionDelay, pitch_min - LTP_ORDER / 2 - 1 ); + } else { + if( lag > 0 ) { + decisionDelay = silk_min_int( decisionDelay, lag - LTP_ORDER / 2 - 1 ); + } + } + + if( psIndices->NLSFInterpCoef_Q2 == 4 ) { + LSF_interpolation_flag = 0; + } else { + LSF_interpolation_flag = 1; + } + + ALLOC( sLTP_Q15, psEncC->ltp_mem_length + psEncC->frame_length, opus_int32 ); + ALLOC( sLTP, psEncC->ltp_mem_length + psEncC->frame_length, opus_int16 ); + ALLOC( x_sc_Q10, psEncC->subfr_length, opus_int32 ); + ALLOC( delayedGain_Q10, DECISION_DELAY, opus_int32 ); + /* Set up pointers to start of sub frame */ + pxq = &NSQ->xq[ psEncC->ltp_mem_length ]; + NSQ->sLTP_shp_buf_idx = psEncC->ltp_mem_length; + NSQ->sLTP_buf_idx = psEncC->ltp_mem_length; + subfr = 0; + for( k = 0; k < psEncC->nb_subfr; k++ ) { + A_Q12 = &PredCoef_Q12[ ( ( k >> 1 ) | ( 1 - LSF_interpolation_flag ) ) * MAX_LPC_ORDER ]; + B_Q14 = <PCoef_Q14[ k * LTP_ORDER ]; + AR_shp_Q13 = &AR_Q13[ k * MAX_SHAPE_LPC_ORDER ]; + + /* Noise shape parameters */ + silk_assert( HarmShapeGain_Q14[ k ] >= 0 ); + HarmShapeFIRPacked_Q14 = silk_RSHIFT( HarmShapeGain_Q14[ k ], 2 ); + HarmShapeFIRPacked_Q14 |= silk_LSHIFT( (opus_int32)silk_RSHIFT( HarmShapeGain_Q14[ k ], 1 ), 16 ); + + NSQ->rewhite_flag = 0; + if( psIndices->signalType == TYPE_VOICED ) { + /* Voiced */ + lag = pitchL[ k ]; + + /* Re-whitening */ + if( ( k & ( 3 - silk_LSHIFT( LSF_interpolation_flag, 1 ) ) ) == 0 ) { + if( k == 2 ) { + /* RESET DELAYED DECISIONS */ + /* Find winner */ + int32x4_t RD_Q10_s32x4; + RDmin_Q10 = psDelDec->RD_Q10[ 0 ]; + Winner_ind = 0; + for( i = 1; i < psEncC->nStatesDelayedDecision; i++ ) { + if( psDelDec->RD_Q10[ i ] < RDmin_Q10 ) { + RDmin_Q10 = psDelDec->RD_Q10[ i ]; + Winner_ind = i; + } + } + psDelDec->RD_Q10[ Winner_ind ] -= ( silk_int32_MAX >> 4 ); + RD_Q10_s32x4 = vld1q_s32( psDelDec->RD_Q10 ); + RD_Q10_s32x4 = vaddq_s32( RD_Q10_s32x4, vdupq_n_s32( silk_int32_MAX >> 4 ) ); + vst1q_s32( psDelDec->RD_Q10, RD_Q10_s32x4 ); + + /* Copy final part of signals from winner state to output and long-term filter states */ + copy_winner_state( psDelDec, decisionDelay, smpl_buf_idx, Winner_ind, Gains_Q16[ 1 ], 14, pulses, pxq, NSQ ); + + subfr = 0; + } + + /* Rewhiten with new A coefs */ + start_idx = psEncC->ltp_mem_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2; + silk_assert( start_idx > 0 ); + + silk_LPC_analysis_filter( &sLTP[ start_idx ], &NSQ->xq[ start_idx + k * psEncC->subfr_length ], + A_Q12, psEncC->ltp_mem_length - start_idx, psEncC->predictLPCOrder, psEncC->arch ); + + NSQ->sLTP_buf_idx = psEncC->ltp_mem_length; + NSQ->rewhite_flag = 1; + } + } + + silk_nsq_del_dec_scale_states_neon( psEncC, NSQ, psDelDec, x16, x_sc_Q10, sLTP, sLTP_Q15, k, + LTP_scale_Q14, Gains_Q16, pitchL, psIndices->signalType, decisionDelay ); + + silk_noise_shape_quantizer_del_dec_neon( NSQ, psDelDec, psIndices->signalType, x_sc_Q10, pulses, pxq, sLTP_Q15, + delayedGain_Q10, A_Q12, B_Q14, AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14[ k ], LF_shp_Q14[ k ], + Gains_Q16[ k ], Lambda_Q10, offset_Q10, psEncC->subfr_length, subfr++, psEncC->shapingLPCOrder, + psEncC->predictLPCOrder, psEncC->warping_Q16, psEncC->nStatesDelayedDecision, &smpl_buf_idx, decisionDelay ); + + x16 += psEncC->subfr_length; + pulses += psEncC->subfr_length; + pxq += psEncC->subfr_length; + } + + /* Find winner */ + RDmin_Q10 = psDelDec->RD_Q10[ 0 ]; + Winner_ind = 0; + for( k = 1; k < psEncC->nStatesDelayedDecision; k++ ) { + if( psDelDec->RD_Q10[ k ] < RDmin_Q10 ) { + RDmin_Q10 = psDelDec->RD_Q10[ k ]; + Winner_ind = k; + } + } + + /* Copy final part of signals from winner state to output and long-term filter states */ + psIndices->Seed = psDelDec->SeedInit[ Winner_ind ]; + Gain_Q10 = silk_RSHIFT32( Gains_Q16[ psEncC->nb_subfr - 1 ], 6 ); + copy_winner_state( psDelDec, decisionDelay, smpl_buf_idx, Winner_ind, Gain_Q10, 8, pulses, pxq, NSQ ); + + t_s32x4 = vdupq_n_s32( 0 ); /* initialization */ + for( i = 0; i < ( NSQ_LPC_BUF_LENGTH - 3 ); i += 4 ) { + t_s32x4 = vld1q_lane_s32( &psDelDec->sLPC_Q14[ i + 0 ][ Winner_ind ], t_s32x4, 0 ); + t_s32x4 = vld1q_lane_s32( &psDelDec->sLPC_Q14[ i + 1 ][ Winner_ind ], t_s32x4, 1 ); + t_s32x4 = vld1q_lane_s32( &psDelDec->sLPC_Q14[ i + 2 ][ Winner_ind ], t_s32x4, 2 ); + t_s32x4 = vld1q_lane_s32( &psDelDec->sLPC_Q14[ i + 3 ][ Winner_ind ], t_s32x4, 3 ); + vst1q_s32( &NSQ->sLPC_Q14[ i ], t_s32x4 ); + } + + for( ; i < NSQ_LPC_BUF_LENGTH; i++ ) { + NSQ->sLPC_Q14[ i ] = psDelDec->sLPC_Q14[ i ][ Winner_ind ]; + } + + for( i = 0; i < (opus_int)( sizeof( NSQ->sAR2_Q14 ) / sizeof( NSQ->sAR2_Q14[ 0 ] ) - 3 ); i += 4 ) { + t_s32x4 = vld1q_lane_s32( &psDelDec->sAR2_Q14[ i + 0 ][ Winner_ind ], t_s32x4, 0 ); + t_s32x4 = vld1q_lane_s32( &psDelDec->sAR2_Q14[ i + 1 ][ Winner_ind ], t_s32x4, 1 ); + t_s32x4 = vld1q_lane_s32( &psDelDec->sAR2_Q14[ i + 2 ][ Winner_ind ], t_s32x4, 2 ); + t_s32x4 = vld1q_lane_s32( &psDelDec->sAR2_Q14[ i + 3 ][ Winner_ind ], t_s32x4, 3 ); + vst1q_s32( &NSQ->sAR2_Q14[ i ], t_s32x4 ); + } + + for( ; i < (opus_int)( sizeof( NSQ->sAR2_Q14 ) / sizeof( NSQ->sAR2_Q14[ 0 ] ) ); i++ ) { + NSQ->sAR2_Q14[ i ] = psDelDec->sAR2_Q14[ i ][ Winner_ind ]; + } + + /* Update states */ + NSQ->sLF_AR_shp_Q14 = psDelDec->LF_AR_Q14[ Winner_ind ]; + NSQ->sDiff_shp_Q14 = psDelDec->Diff_Q14[ Winner_ind ]; + NSQ->lagPrev = pitchL[ psEncC->nb_subfr - 1 ]; + + /* Save quantized speech signal */ + silk_memmove( NSQ->xq, &NSQ->xq[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) ); + silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) ); + RESTORE_STACK; + } + +#ifdef OPUS_CHECK_ASM + silk_assert( !memcmp( &NSQ_c, NSQ, sizeof( NSQ_c ) ) ); + silk_assert( !memcmp( &psIndices_c, psIndices, sizeof( psIndices_c ) ) ); + silk_assert( !memcmp( pulses_c, pulses_a, sizeof( pulses_c ) ) ); +#endif +} + +/******************************************/ +/* Noise shape quantizer for one subframe */ +/******************************************/ +/* Note: Function silk_short_prediction_create_arch_coef_neon() defined in NSQ_neon.h is actually a hacking C function. */ +/* Therefore here we append "_local" to the NEON function name to avoid confusion. */ +static OPUS_INLINE void silk_short_prediction_create_arch_coef_neon_local(opus_int32 *out, const opus_int16 *in, opus_int order) +{ + int16x8_t t_s16x8; + int32x4_t t0_s32x4, t1_s32x4, t2_s32x4, t3_s32x4; + silk_assert( order == 10 || order == 16 ); + + t_s16x8 = vld1q_s16( in + 0 ); /* 7 6 5 4 3 2 1 0 */ + t_s16x8 = vrev64q_s16( t_s16x8 ); /* 4 5 6 7 0 1 2 3 */ + t2_s32x4 = vshll_n_s16( vget_high_s16( t_s16x8 ), 15 ); /* 4 5 6 7 */ + t3_s32x4 = vshll_n_s16( vget_low_s16( t_s16x8 ), 15 ); /* 0 1 2 3 */ + + if( order == 16 ) { + t_s16x8 = vld1q_s16( in + 8 ); /* F E D C B A 9 8 */ + t_s16x8 = vrev64q_s16( t_s16x8 ); /* C D E F 8 9 A B */ + t0_s32x4 = vshll_n_s16( vget_high_s16( t_s16x8 ), 15 ); /* C D E F */ + t1_s32x4 = vshll_n_s16( vget_low_s16( t_s16x8 ), 15 ); /* 8 9 A B */ + } else { + int16x4_t t_s16x4; + + t0_s32x4 = vdupq_n_s32( 0 ); /* zero zero zero zero */ + t_s16x4 = vld1_s16( in + 6 ); /* 9 8 7 6 */ + t_s16x4 = vrev64_s16( t_s16x4 ); /* 6 7 8 9 */ + t1_s32x4 = vshll_n_s16( t_s16x4, 15 ); + t1_s32x4 = vcombine_s32( vget_low_s32(t0_s32x4), vget_low_s32( t1_s32x4 ) ); /* 8 9 zero zero */ + } + vst1q_s32( out + 0, t0_s32x4 ); + vst1q_s32( out + 4, t1_s32x4 ); + vst1q_s32( out + 8, t2_s32x4 ); + vst1q_s32( out + 12, t3_s32x4 ); +} + +static OPUS_INLINE int32x4_t silk_SMLAWB_lane0_neon( + const int32x4_t out_s32x4, + const int32x4_t in_s32x4, + const int32x2_t coef_s32x2 +) +{ + return vaddq_s32( out_s32x4, vqdmulhq_lane_s32( in_s32x4, coef_s32x2, 0 ) ); +} + +static OPUS_INLINE int32x4_t silk_SMLAWB_lane1_neon( + const int32x4_t out_s32x4, + const int32x4_t in_s32x4, + const int32x2_t coef_s32x2 +) +{ + return vaddq_s32( out_s32x4, vqdmulhq_lane_s32( in_s32x4, coef_s32x2, 1 ) ); +} + +/* Note: This function has different return value than silk_noise_shape_quantizer_short_prediction_neon(). */ +/* Therefore here we append "_local" to the function name to avoid confusion. */ +static OPUS_INLINE int32x4_t silk_noise_shape_quantizer_short_prediction_neon_local(const opus_int32 *buf32, const opus_int32 *a_Q12_arch, opus_int order) +{ + const int32x4_t a_Q12_arch0_s32x4 = vld1q_s32( a_Q12_arch + 0 ); + const int32x4_t a_Q12_arch1_s32x4 = vld1q_s32( a_Q12_arch + 4 ); + const int32x4_t a_Q12_arch2_s32x4 = vld1q_s32( a_Q12_arch + 8 ); + const int32x4_t a_Q12_arch3_s32x4 = vld1q_s32( a_Q12_arch + 12 ); + int32x4_t LPC_pred_Q14_s32x4; + + silk_assert( order == 10 || order == 16 ); + /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ + LPC_pred_Q14_s32x4 = vdupq_n_s32( silk_RSHIFT( order, 1 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane0_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 0 * NEON_MAX_DEL_DEC_STATES ), vget_low_s32( a_Q12_arch0_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane1_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 1 * NEON_MAX_DEL_DEC_STATES ), vget_low_s32( a_Q12_arch0_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane0_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 2 * NEON_MAX_DEL_DEC_STATES ), vget_high_s32( a_Q12_arch0_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane1_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 3 * NEON_MAX_DEL_DEC_STATES ), vget_high_s32( a_Q12_arch0_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane0_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 4 * NEON_MAX_DEL_DEC_STATES ), vget_low_s32( a_Q12_arch1_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane1_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 5 * NEON_MAX_DEL_DEC_STATES ), vget_low_s32( a_Q12_arch1_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane0_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 6 * NEON_MAX_DEL_DEC_STATES ), vget_high_s32( a_Q12_arch1_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane1_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 7 * NEON_MAX_DEL_DEC_STATES ), vget_high_s32( a_Q12_arch1_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane0_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 8 * NEON_MAX_DEL_DEC_STATES ), vget_low_s32( a_Q12_arch2_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane1_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 9 * NEON_MAX_DEL_DEC_STATES ), vget_low_s32( a_Q12_arch2_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane0_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 10 * NEON_MAX_DEL_DEC_STATES ), vget_high_s32( a_Q12_arch2_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane1_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 11 * NEON_MAX_DEL_DEC_STATES ), vget_high_s32( a_Q12_arch2_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane0_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 12 * NEON_MAX_DEL_DEC_STATES ), vget_low_s32( a_Q12_arch3_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane1_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 13 * NEON_MAX_DEL_DEC_STATES ), vget_low_s32( a_Q12_arch3_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane0_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 14 * NEON_MAX_DEL_DEC_STATES ), vget_high_s32( a_Q12_arch3_s32x4 ) ); + LPC_pred_Q14_s32x4 = silk_SMLAWB_lane1_neon( LPC_pred_Q14_s32x4, vld1q_s32( buf32 + 15 * NEON_MAX_DEL_DEC_STATES ), vget_high_s32( a_Q12_arch3_s32x4 ) ); + + return LPC_pred_Q14_s32x4; +} + +static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_neon( + silk_nsq_state *NSQ, /* I/O NSQ state */ + NSQ_del_decs_struct psDelDec[], /* I/O Delayed decision states */ + opus_int signalType, /* I Signal type */ + const opus_int32 x_Q10[], /* I */ + opus_int8 pulses[], /* O */ + opus_int16 xq[], /* O */ + opus_int32 sLTP_Q15[], /* I/O LTP filter state */ + opus_int32 delayedGain_Q10[], /* I/O Gain delay buffer */ + const opus_int16 a_Q12[], /* I Short term prediction coefs */ + const opus_int16 b_Q14[], /* I Long term prediction coefs */ + const opus_int16 AR_shp_Q13[], /* I Noise shaping coefs */ + opus_int lag, /* I Pitch lag */ + opus_int32 HarmShapeFIRPacked_Q14, /* I */ + opus_int Tilt_Q14, /* I Spectral tilt */ + opus_int32 LF_shp_Q14, /* I */ + opus_int32 Gain_Q16, /* I */ + opus_int Lambda_Q10, /* I */ + opus_int offset_Q10, /* I */ + opus_int length, /* I Input length */ + opus_int subfr, /* I Subframe number */ + opus_int shapingLPCOrder, /* I Shaping LPC filter order */ + opus_int predictLPCOrder, /* I Prediction filter order */ + opus_int warping_Q16, /* I */ + opus_int nStatesDelayedDecision, /* I Number of states in decision tree */ + opus_int *smpl_buf_idx, /* I/O Index to newest samples in buffers */ + opus_int decisionDelay /* I */ +) +{ + opus_int i, j, k, Winner_ind, RDmin_ind, RDmax_ind, last_smple_idx; + opus_int32 Winner_rand_state; + opus_int32 LTP_pred_Q14, n_LTP_Q14; + opus_int32 RDmin_Q10, RDmax_Q10; + opus_int32 Gain_Q10; + opus_int32 *pred_lag_ptr, *shp_lag_ptr; + opus_int32 a_Q12_arch[MAX_LPC_ORDER]; + const int32x2_t warping_Q16_s32x2 = vdup_n_s32( silk_LSHIFT32( warping_Q16, 16 ) >> 1 ); + const opus_int32 LF_shp_Q29 = silk_LSHIFT32( LF_shp_Q14, 16 ) >> 1; + opus_int32 AR_shp_Q28[ MAX_SHAPE_LPC_ORDER ]; + const uint32x4_t rand_multiplier_u32x4 = vdupq_n_u32( RAND_MULTIPLIER ); + const uint32x4_t rand_increment_u32x4 = vdupq_n_u32( RAND_INCREMENT ); + + VARDECL( NSQ_samples_struct, psSampleState ); + SAVE_STACK; + + silk_assert( nStatesDelayedDecision > 0 ); + silk_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ + ALLOC( psSampleState, 2, NSQ_samples_struct ); + + shp_lag_ptr = &NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ]; + pred_lag_ptr = &sLTP_Q15[ NSQ->sLTP_buf_idx - lag + LTP_ORDER / 2 ]; + Gain_Q10 = silk_RSHIFT( Gain_Q16, 6 ); + + for( i = 0; i < ( MAX_SHAPE_LPC_ORDER - 7 ); i += 8 ) { + const int16x8_t t_s16x8 = vld1q_s16( AR_shp_Q13 + i ); + vst1q_s32( AR_shp_Q28 + i + 0, vshll_n_s16( vget_low_s16( t_s16x8 ), 15 ) ); + vst1q_s32( AR_shp_Q28 + i + 4, vshll_n_s16( vget_high_s16( t_s16x8 ), 15 ) ); + } + + for( ; i < MAX_SHAPE_LPC_ORDER; i++ ) { + AR_shp_Q28[i] = silk_LSHIFT32( AR_shp_Q13[i], 15 ); + } + + silk_short_prediction_create_arch_coef_neon_local( a_Q12_arch, a_Q12, predictLPCOrder ); + + for( i = 0; i < length; i++ ) { + int32x4_t Seed_s32x4, LPC_pred_Q14_s32x4; + int32x4_t sign_s32x4, tmp1_s32x4, tmp2_s32x4; + int32x4_t n_AR_Q14_s32x4, n_LF_Q14_s32x4; + int32x2_t AR_shp_Q28_s32x2; + int16x4_t r_Q10_s16x4, rr_Q10_s16x4; + + /* Perform common calculations used in all states */ + + /* Long-term prediction */ + if( signalType == TYPE_VOICED ) { + /* Unrolled loop */ + /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ + LTP_pred_Q14 = 2; + LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ 0 ], b_Q14[ 0 ] ); + LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -1 ], b_Q14[ 1 ] ); + LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -2 ], b_Q14[ 2 ] ); + LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], b_Q14[ 3 ] ); + LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); + LTP_pred_Q14 = silk_LSHIFT( LTP_pred_Q14, 1 ); /* Q13 -> Q14 */ + pred_lag_ptr++; + } else { + LTP_pred_Q14 = 0; + } + + /* Long-term shaping */ + if( lag > 0 ) { + /* Symmetric, packed FIR coefficients */ + n_LTP_Q14 = silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = silk_SMLAWT( n_LTP_Q14, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = silk_SUB_LSHIFT32( LTP_pred_Q14, n_LTP_Q14, 2 ); /* Q12 -> Q14 */ + shp_lag_ptr++; + } else { + n_LTP_Q14 = 0; + } + + /* Generate dither */ + Seed_s32x4 = vld1q_s32( psDelDec->Seed ); + Seed_s32x4 = vreinterpretq_s32_u32( vmlaq_u32( rand_increment_u32x4, vreinterpretq_u32_s32( Seed_s32x4 ), rand_multiplier_u32x4 ) ); + vst1q_s32( psDelDec->Seed, Seed_s32x4 ); + + /* Short-term prediction */ + LPC_pred_Q14_s32x4 = silk_noise_shape_quantizer_short_prediction_neon_local(psDelDec->sLPC_Q14[ NSQ_LPC_BUF_LENGTH - 16 + i ], a_Q12_arch, predictLPCOrder); + LPC_pred_Q14_s32x4 = vshlq_n_s32( LPC_pred_Q14_s32x4, 4 ); /* Q10 -> Q14 */ + + /* Noise shape feedback */ + /* Output of lowpass section */ + tmp2_s32x4 = silk_SMLAWB_lane0_neon( vld1q_s32( psDelDec->Diff_Q14 ), vld1q_s32( psDelDec->sAR2_Q14[ 0 ] ), warping_Q16_s32x2 ); + /* Output of allpass section */ + tmp1_s32x4 = vsubq_s32( vld1q_s32( psDelDec->sAR2_Q14[ 1 ] ), tmp2_s32x4 ); + tmp1_s32x4 = silk_SMLAWB_lane0_neon( vld1q_s32( psDelDec->sAR2_Q14[ 0 ] ), tmp1_s32x4, warping_Q16_s32x2 ); + vst1q_s32( psDelDec->sAR2_Q14[ 0 ], tmp2_s32x4 ); + AR_shp_Q28_s32x2 = vld1_s32( AR_shp_Q28 ); + n_AR_Q14_s32x4 = vaddq_s32( vdupq_n_s32( silk_RSHIFT( shapingLPCOrder, 1 ) ), vqdmulhq_lane_s32( tmp2_s32x4, AR_shp_Q28_s32x2, 0 ) ); + + /* Loop over allpass sections */ + for( j = 2; j < shapingLPCOrder; j += 2 ) { + /* Output of allpass section */ + tmp2_s32x4 = vsubq_s32( vld1q_s32( psDelDec->sAR2_Q14[ j + 0 ] ), tmp1_s32x4 ); + tmp2_s32x4 = silk_SMLAWB_lane0_neon( vld1q_s32( psDelDec->sAR2_Q14[ j - 1 ] ), tmp2_s32x4, warping_Q16_s32x2 ); + vst1q_s32( psDelDec->sAR2_Q14[ j - 1 ], tmp1_s32x4 ); + n_AR_Q14_s32x4 = vaddq_s32( n_AR_Q14_s32x4, vqdmulhq_lane_s32( tmp1_s32x4, AR_shp_Q28_s32x2, 1 ) ); + /* Output of allpass section */ + tmp1_s32x4 = vsubq_s32( vld1q_s32( psDelDec->sAR2_Q14[ j + 1 ] ), tmp2_s32x4 ); + tmp1_s32x4 = silk_SMLAWB_lane0_neon( vld1q_s32( psDelDec->sAR2_Q14[ j + 0 ] ), tmp1_s32x4, warping_Q16_s32x2 ); + vst1q_s32( psDelDec->sAR2_Q14[ j + 0 ], tmp2_s32x4 ); + AR_shp_Q28_s32x2 = vld1_s32( &AR_shp_Q28[ j ] ); + n_AR_Q14_s32x4 = vaddq_s32( n_AR_Q14_s32x4, vqdmulhq_lane_s32( tmp2_s32x4, AR_shp_Q28_s32x2, 0 ) ); + } + vst1q_s32( psDelDec->sAR2_Q14[ shapingLPCOrder - 1 ], tmp1_s32x4 ); + n_AR_Q14_s32x4 = vaddq_s32( n_AR_Q14_s32x4, vqdmulhq_lane_s32( tmp1_s32x4, AR_shp_Q28_s32x2, 1 ) ); + n_AR_Q14_s32x4 = vshlq_n_s32( n_AR_Q14_s32x4, 1 ); /* Q11 -> Q12 */ + n_AR_Q14_s32x4 = vaddq_s32( n_AR_Q14_s32x4, vqdmulhq_n_s32( vld1q_s32( psDelDec->LF_AR_Q14 ), silk_LSHIFT32( Tilt_Q14, 16 ) >> 1 ) ); /* Q12 */ + n_AR_Q14_s32x4 = vshlq_n_s32( n_AR_Q14_s32x4, 2 ); /* Q12 -> Q14 */ + n_LF_Q14_s32x4 = vqdmulhq_n_s32( vld1q_s32( psDelDec->Shape_Q14[ *smpl_buf_idx ] ), LF_shp_Q29 ); /* Q12 */ + n_LF_Q14_s32x4 = vaddq_s32( n_LF_Q14_s32x4, vqdmulhq_n_s32( vld1q_s32( psDelDec->LF_AR_Q14 ), silk_LSHIFT32( LF_shp_Q14 >> 16 , 15 ) ) ); /* Q12 */ + n_LF_Q14_s32x4 = vshlq_n_s32( n_LF_Q14_s32x4, 2 ); /* Q12 -> Q14 */ + + /* Input minus prediction plus noise feedback */ + /* r = x[ i ] - LTP_pred - LPC_pred + n_AR + n_Tilt + n_LF + n_LTP */ + tmp1_s32x4 = vaddq_s32( n_AR_Q14_s32x4, n_LF_Q14_s32x4 ); /* Q14 */ + tmp2_s32x4 = vaddq_s32( vdupq_n_s32( n_LTP_Q14 ), LPC_pred_Q14_s32x4 ); /* Q13 */ + tmp1_s32x4 = vsubq_s32( tmp2_s32x4, tmp1_s32x4 ); /* Q13 */ + tmp1_s32x4 = vrshrq_n_s32( tmp1_s32x4, 4 ); /* Q10 */ + tmp1_s32x4 = vsubq_s32( vdupq_n_s32( x_Q10[ i ] ), tmp1_s32x4 ); /* residual error Q10 */ + + /* Flip sign depending on dither */ + sign_s32x4 = vreinterpretq_s32_u32( vcltq_s32( Seed_s32x4, vdupq_n_s32( 0 ) ) ); + tmp1_s32x4 = veorq_s32( tmp1_s32x4, sign_s32x4 ); + tmp1_s32x4 = vsubq_s32( tmp1_s32x4, sign_s32x4 ); + tmp1_s32x4 = vmaxq_s32( tmp1_s32x4, vdupq_n_s32( -( 31 << 10 ) ) ); + tmp1_s32x4 = vminq_s32( tmp1_s32x4, vdupq_n_s32( 30 << 10 ) ); + r_Q10_s16x4 = vmovn_s32( tmp1_s32x4 ); + + /* Find two quantization level candidates and measure their rate-distortion */ + { + int16x4_t q1_Q10_s16x4 = vsub_s16( r_Q10_s16x4, vdup_n_s16( offset_Q10 ) ); + int16x4_t q1_Q0_s16x4 = vshr_n_s16( q1_Q10_s16x4, 10 ); + int16x4_t q2_Q10_s16x4; + int32x4_t rd1_Q10_s32x4, rd2_Q10_s32x4; + uint32x4_t t_u32x4; + + if( Lambda_Q10 > 2048 ) { + /* For aggressive RDO, the bias becomes more than one pulse. */ + const int rdo_offset = Lambda_Q10/2 - 512; + const uint16x4_t greaterThanRdo = vcgt_s16( q1_Q10_s16x4, vdup_n_s16( rdo_offset ) ); + const uint16x4_t lessThanMinusRdo = vclt_s16( q1_Q10_s16x4, vdup_n_s16( -rdo_offset ) ); + /* If Lambda_Q10 > 32767, then q1_Q0, q1_Q10 and q2_Q10 must change to 32-bit. */ + silk_assert( Lambda_Q10 <= 32767 ); + + q1_Q0_s16x4 = vreinterpret_s16_u16( vclt_s16( q1_Q10_s16x4, vdup_n_s16( 0 ) ) ); + q1_Q0_s16x4 = vbsl_s16( greaterThanRdo, vsub_s16( q1_Q10_s16x4, vdup_n_s16( rdo_offset ) ), q1_Q0_s16x4 ); + q1_Q0_s16x4 = vbsl_s16( lessThanMinusRdo, vadd_s16( q1_Q10_s16x4, vdup_n_s16( rdo_offset ) ), q1_Q0_s16x4 ); + q1_Q0_s16x4 = vshr_n_s16( q1_Q0_s16x4, 10 ); + } + { + const uint16x4_t equal0_u16x4 = vceq_s16( q1_Q0_s16x4, vdup_n_s16( 0 ) ); + const uint16x4_t equalMinus1_u16x4 = vceq_s16( q1_Q0_s16x4, vdup_n_s16( -1 ) ); + const uint16x4_t lessThanMinus1_u16x4 = vclt_s16( q1_Q0_s16x4, vdup_n_s16( -1 ) ); + int16x4_t tmp1_s16x4, tmp2_s16x4; + + q1_Q10_s16x4 = vshl_n_s16( q1_Q0_s16x4, 10 ); + tmp1_s16x4 = vadd_s16( q1_Q10_s16x4, vdup_n_s16( offset_Q10 - QUANT_LEVEL_ADJUST_Q10 ) ); + q1_Q10_s16x4 = vadd_s16( q1_Q10_s16x4, vdup_n_s16( offset_Q10 + QUANT_LEVEL_ADJUST_Q10 ) ); + q1_Q10_s16x4 = vbsl_s16( lessThanMinus1_u16x4, q1_Q10_s16x4, tmp1_s16x4 ); + q1_Q10_s16x4 = vbsl_s16( equal0_u16x4, vdup_n_s16( offset_Q10 ), q1_Q10_s16x4 ); + q1_Q10_s16x4 = vbsl_s16( equalMinus1_u16x4, vdup_n_s16( offset_Q10 - ( 1024 - QUANT_LEVEL_ADJUST_Q10 ) ), q1_Q10_s16x4 ); + q2_Q10_s16x4 = vadd_s16( q1_Q10_s16x4, vdup_n_s16( 1024 ) ); + q2_Q10_s16x4 = vbsl_s16( equal0_u16x4, vdup_n_s16( offset_Q10 + 1024 - QUANT_LEVEL_ADJUST_Q10 ), q2_Q10_s16x4 ); + q2_Q10_s16x4 = vbsl_s16( equalMinus1_u16x4, vdup_n_s16( offset_Q10 ), q2_Q10_s16x4 ); + tmp1_s16x4 = q1_Q10_s16x4; + tmp2_s16x4 = q2_Q10_s16x4; + tmp1_s16x4 = vbsl_s16( vorr_u16( equalMinus1_u16x4, lessThanMinus1_u16x4 ), vneg_s16( tmp1_s16x4 ), tmp1_s16x4 ); + tmp2_s16x4 = vbsl_s16( lessThanMinus1_u16x4, vneg_s16( tmp2_s16x4 ), tmp2_s16x4 ); + rd1_Q10_s32x4 = vmull_s16( tmp1_s16x4, vdup_n_s16( Lambda_Q10 ) ); + rd2_Q10_s32x4 = vmull_s16( tmp2_s16x4, vdup_n_s16( Lambda_Q10 ) ); + } + + rr_Q10_s16x4 = vsub_s16( r_Q10_s16x4, q1_Q10_s16x4 ); + rd1_Q10_s32x4 = vmlal_s16( rd1_Q10_s32x4, rr_Q10_s16x4, rr_Q10_s16x4 ); + rd1_Q10_s32x4 = vshrq_n_s32( rd1_Q10_s32x4, 10 ); + + rr_Q10_s16x4 = vsub_s16( r_Q10_s16x4, q2_Q10_s16x4 ); + rd2_Q10_s32x4 = vmlal_s16( rd2_Q10_s32x4, rr_Q10_s16x4, rr_Q10_s16x4 ); + rd2_Q10_s32x4 = vshrq_n_s32( rd2_Q10_s32x4, 10 ); + + tmp2_s32x4 = vld1q_s32( psDelDec->RD_Q10 ); + tmp1_s32x4 = vaddq_s32( tmp2_s32x4, vminq_s32( rd1_Q10_s32x4, rd2_Q10_s32x4 ) ); + tmp2_s32x4 = vaddq_s32( tmp2_s32x4, vmaxq_s32( rd1_Q10_s32x4, rd2_Q10_s32x4 ) ); + vst1q_s32( psSampleState[ 0 ].RD_Q10, tmp1_s32x4 ); + vst1q_s32( psSampleState[ 1 ].RD_Q10, tmp2_s32x4 ); + t_u32x4 = vcltq_s32( rd1_Q10_s32x4, rd2_Q10_s32x4 ); + tmp1_s32x4 = vbslq_s32( t_u32x4, vmovl_s16( q1_Q10_s16x4 ), vmovl_s16( q2_Q10_s16x4 ) ); + tmp2_s32x4 = vbslq_s32( t_u32x4, vmovl_s16( q2_Q10_s16x4 ), vmovl_s16( q1_Q10_s16x4 ) ); + vst1q_s32( psSampleState[ 0 ].Q_Q10, tmp1_s32x4 ); + vst1q_s32( psSampleState[ 1 ].Q_Q10, tmp2_s32x4 ); + } + + { + /* Update states for best quantization */ + int32x4_t exc_Q14_s32x4, LPC_exc_Q14_s32x4, xq_Q14_s32x4, sLF_AR_shp_Q14_s32x4; + + /* Quantized excitation */ + exc_Q14_s32x4 = vshlq_n_s32( tmp1_s32x4, 4 ); + exc_Q14_s32x4 = veorq_s32( exc_Q14_s32x4, sign_s32x4 ); + exc_Q14_s32x4 = vsubq_s32( exc_Q14_s32x4, sign_s32x4 ); + + /* Add predictions */ + LPC_exc_Q14_s32x4 = vaddq_s32( exc_Q14_s32x4, vdupq_n_s32( LTP_pred_Q14 ) ); + xq_Q14_s32x4 = vaddq_s32( LPC_exc_Q14_s32x4, LPC_pred_Q14_s32x4 ); + + /* Update states */ + tmp1_s32x4 = vsubq_s32( xq_Q14_s32x4, vshlq_n_s32( vdupq_n_s32( x_Q10[ i ] ), 4 ) ); + vst1q_s32( psSampleState[ 0 ].Diff_Q14, tmp1_s32x4 ); + sLF_AR_shp_Q14_s32x4 = vsubq_s32( tmp1_s32x4, n_AR_Q14_s32x4 ); + vst1q_s32( psSampleState[ 0 ].sLTP_shp_Q14, vsubq_s32( sLF_AR_shp_Q14_s32x4, n_LF_Q14_s32x4 ) ); + vst1q_s32( psSampleState[ 0 ].LF_AR_Q14, sLF_AR_shp_Q14_s32x4 ); + vst1q_s32( psSampleState[ 0 ].LPC_exc_Q14, LPC_exc_Q14_s32x4 ); + vst1q_s32( psSampleState[ 0 ].xq_Q14, xq_Q14_s32x4 ); + + /* Quantized excitation */ + exc_Q14_s32x4 = vshlq_n_s32( tmp2_s32x4, 4 ); + exc_Q14_s32x4 = veorq_s32( exc_Q14_s32x4, sign_s32x4 ); + exc_Q14_s32x4 = vsubq_s32( exc_Q14_s32x4, sign_s32x4 ); + + /* Add predictions */ + LPC_exc_Q14_s32x4 = vaddq_s32( exc_Q14_s32x4, vdupq_n_s32( LTP_pred_Q14 ) ); + xq_Q14_s32x4 = vaddq_s32( LPC_exc_Q14_s32x4, LPC_pred_Q14_s32x4 ); + + /* Update states */ + tmp1_s32x4 = vsubq_s32( xq_Q14_s32x4, vshlq_n_s32( vdupq_n_s32( x_Q10[ i ] ), 4 ) ); + vst1q_s32( psSampleState[ 1 ].Diff_Q14, tmp1_s32x4 ); + sLF_AR_shp_Q14_s32x4 = vsubq_s32( tmp1_s32x4, n_AR_Q14_s32x4 ); + vst1q_s32( psSampleState[ 1 ].sLTP_shp_Q14, vsubq_s32( sLF_AR_shp_Q14_s32x4, n_LF_Q14_s32x4 ) ); + vst1q_s32( psSampleState[ 1 ].LF_AR_Q14, sLF_AR_shp_Q14_s32x4 ); + vst1q_s32( psSampleState[ 1 ].LPC_exc_Q14, LPC_exc_Q14_s32x4 ); + vst1q_s32( psSampleState[ 1 ].xq_Q14, xq_Q14_s32x4 ); + } + + *smpl_buf_idx = *smpl_buf_idx ? ( *smpl_buf_idx - 1 ) : ( DECISION_DELAY - 1); + last_smple_idx = *smpl_buf_idx + decisionDelay + DECISION_DELAY; + if( last_smple_idx >= DECISION_DELAY ) last_smple_idx -= DECISION_DELAY; + if( last_smple_idx >= DECISION_DELAY ) last_smple_idx -= DECISION_DELAY; + + /* Find winner */ + RDmin_Q10 = psSampleState[ 0 ].RD_Q10[ 0 ]; + Winner_ind = 0; + for( k = 1; k < nStatesDelayedDecision; k++ ) { + if( psSampleState[ 0 ].RD_Q10[ k ] < RDmin_Q10 ) { + RDmin_Q10 = psSampleState[ 0 ].RD_Q10[ k ]; + Winner_ind = k; + } + } + + /* Increase RD values of expired states */ + { + uint32x4_t t_u32x4; + Winner_rand_state = psDelDec->RandState[ last_smple_idx ][ Winner_ind ]; + t_u32x4 = vceqq_s32( vld1q_s32( psDelDec->RandState[ last_smple_idx ] ), vdupq_n_s32( Winner_rand_state ) ); + t_u32x4 = vmvnq_u32( t_u32x4 ); + t_u32x4 = vshrq_n_u32( t_u32x4, 5 ); + tmp1_s32x4 = vld1q_s32( psSampleState[ 0 ].RD_Q10 ); + tmp2_s32x4 = vld1q_s32( psSampleState[ 1 ].RD_Q10 ); + tmp1_s32x4 = vaddq_s32( tmp1_s32x4, vreinterpretq_s32_u32( t_u32x4 ) ); + tmp2_s32x4 = vaddq_s32( tmp2_s32x4, vreinterpretq_s32_u32( t_u32x4 ) ); + vst1q_s32( psSampleState[ 0 ].RD_Q10, tmp1_s32x4 ); + vst1q_s32( psSampleState[ 1 ].RD_Q10, tmp2_s32x4 ); + + /* Find worst in first set and best in second set */ + RDmax_Q10 = psSampleState[ 0 ].RD_Q10[ 0 ]; + RDmin_Q10 = psSampleState[ 1 ].RD_Q10[ 0 ]; + RDmax_ind = 0; + RDmin_ind = 0; + for( k = 1; k < nStatesDelayedDecision; k++ ) { + /* find worst in first set */ + if( psSampleState[ 0 ].RD_Q10[ k ] > RDmax_Q10 ) { + RDmax_Q10 = psSampleState[ 0 ].RD_Q10[ k ]; + RDmax_ind = k; + } + /* find best in second set */ + if( psSampleState[ 1 ].RD_Q10[ k ] < RDmin_Q10 ) { + RDmin_Q10 = psSampleState[ 1 ].RD_Q10[ k ]; + RDmin_ind = k; + } + } + } + + /* Replace a state if best from second set outperforms worst in first set */ + if( RDmin_Q10 < RDmax_Q10 ) { + opus_int32 (*ptr)[NEON_MAX_DEL_DEC_STATES] = psDelDec->RandState; + const int numOthers = (int)( ( sizeof( NSQ_del_decs_struct ) - sizeof( ( (NSQ_del_decs_struct *)0 )->sLPC_Q14 ) ) + / ( NEON_MAX_DEL_DEC_STATES * sizeof( opus_int32 ) ) ); + /* Only ( predictLPCOrder - 1 ) of sLPC_Q14 buffer need to be updated, though the first several */ + /* useless sLPC_Q14[] will be different comparing with C when predictLPCOrder < NSQ_LPC_BUF_LENGTH. */ + /* Here just update constant ( NSQ_LPC_BUF_LENGTH - 1 ) for simplicity. */ + for( j = i + 1; j < i + NSQ_LPC_BUF_LENGTH; j++ ) { + psDelDec->sLPC_Q14[ j ][ RDmax_ind ] = psDelDec->sLPC_Q14[ j ][ RDmin_ind ]; + } + for( j = 0; j < numOthers; j++ ) { + ptr[ j ][ RDmax_ind ] = ptr[ j ][ RDmin_ind ]; + } + + psSampleState[ 0 ].Q_Q10[ RDmax_ind ] = psSampleState[ 1 ].Q_Q10[ RDmin_ind ]; + psSampleState[ 0 ].RD_Q10[ RDmax_ind ] = psSampleState[ 1 ].RD_Q10[ RDmin_ind ]; + psSampleState[ 0 ].xq_Q14[ RDmax_ind ] = psSampleState[ 1 ].xq_Q14[ RDmin_ind ]; + psSampleState[ 0 ].LF_AR_Q14[ RDmax_ind ] = psSampleState[ 1 ].LF_AR_Q14[ RDmin_ind ]; + psSampleState[ 0 ].Diff_Q14[ RDmax_ind ] = psSampleState[ 1 ].Diff_Q14[ RDmin_ind ]; + psSampleState[ 0 ].sLTP_shp_Q14[ RDmax_ind ] = psSampleState[ 1 ].sLTP_shp_Q14[ RDmin_ind ]; + psSampleState[ 0 ].LPC_exc_Q14[ RDmax_ind ] = psSampleState[ 1 ].LPC_exc_Q14[ RDmin_ind ]; + } + + /* Write samples from winner to output and long-term filter states */ + if( subfr > 0 || i >= decisionDelay ) { + pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDelDec->Q_Q10[ last_smple_idx ][ Winner_ind ], 10 ); + xq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( + silk_SMULWW( psDelDec->Xq_Q14[ last_smple_idx ][ Winner_ind ], delayedGain_Q10[ last_smple_idx ] ), 8 ) ); + NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - decisionDelay ] = psDelDec->Shape_Q14[ last_smple_idx ][ Winner_ind ]; + sLTP_Q15[ NSQ->sLTP_buf_idx - decisionDelay ] = psDelDec->Pred_Q15[ last_smple_idx ][ Winner_ind ]; + } + NSQ->sLTP_shp_buf_idx++; + NSQ->sLTP_buf_idx++; + + /* Update states */ + vst1q_s32( psDelDec->LF_AR_Q14, vld1q_s32( psSampleState[ 0 ].LF_AR_Q14 ) ); + vst1q_s32( psDelDec->Diff_Q14, vld1q_s32( psSampleState[ 0 ].Diff_Q14 ) ); + vst1q_s32( psDelDec->sLPC_Q14[ NSQ_LPC_BUF_LENGTH + i ], vld1q_s32( psSampleState[ 0 ].xq_Q14 ) ); + vst1q_s32( psDelDec->Xq_Q14[ *smpl_buf_idx ], vld1q_s32( psSampleState[ 0 ].xq_Q14 ) ); + tmp1_s32x4 = vld1q_s32( psSampleState[ 0 ].Q_Q10 ); + vst1q_s32( psDelDec->Q_Q10[ *smpl_buf_idx ], tmp1_s32x4 ); + vst1q_s32( psDelDec->Pred_Q15[ *smpl_buf_idx ], vshlq_n_s32( vld1q_s32( psSampleState[ 0 ].LPC_exc_Q14 ), 1 ) ); + vst1q_s32( psDelDec->Shape_Q14[ *smpl_buf_idx ], vld1q_s32( psSampleState[ 0 ].sLTP_shp_Q14 ) ); + tmp1_s32x4 = vrshrq_n_s32( tmp1_s32x4, 10 ); + tmp1_s32x4 = vaddq_s32( vld1q_s32( psDelDec->Seed ), tmp1_s32x4 ); + vst1q_s32( psDelDec->Seed, tmp1_s32x4 ); + vst1q_s32( psDelDec->RandState[ *smpl_buf_idx ], tmp1_s32x4 ); + vst1q_s32( psDelDec->RD_Q10, vld1q_s32( psSampleState[ 0 ].RD_Q10 ) ); + delayedGain_Q10[ *smpl_buf_idx ] = Gain_Q10; + } + /* Update LPC states */ + silk_memcpy( psDelDec->sLPC_Q14[ 0 ], psDelDec->sLPC_Q14[ length ], NEON_MAX_DEL_DEC_STATES * NSQ_LPC_BUF_LENGTH * sizeof( opus_int32 ) ); + + RESTORE_STACK; +} + +static OPUS_INLINE void silk_SMULWB_8_neon( + const opus_int16 *a, + const int32x2_t b, + opus_int32 *o +) +{ + const int16x8_t a_s16x8 = vld1q_s16( a ); + int32x4_t o0_s32x4, o1_s32x4; + + o0_s32x4 = vshll_n_s16( vget_low_s16( a_s16x8 ), 15 ); + o1_s32x4 = vshll_n_s16( vget_high_s16( a_s16x8 ), 15 ); + o0_s32x4 = vqdmulhq_lane_s32( o0_s32x4, b, 0 ); + o1_s32x4 = vqdmulhq_lane_s32( o1_s32x4, b, 0 ); + vst1q_s32( o, o0_s32x4 ); + vst1q_s32( o + 4, o1_s32x4 ); +} + +/* Only works when ( b >= -65536 ) && ( b < 65536 ). */ +static OPUS_INLINE void silk_SMULWW_small_b_4_neon( + opus_int32 *a, + const int32x2_t b_s32x2) +{ + int32x4_t o_s32x4; + + o_s32x4 = vld1q_s32( a ); + o_s32x4 = vqdmulhq_lane_s32( o_s32x4, b_s32x2, 0 ); + vst1q_s32( a, o_s32x4 ); +} + +/* Only works when ( b >= -65536 ) && ( b < 65536 ). */ +static OPUS_INLINE void silk_SMULWW_small_b_8_neon( + opus_int32 *a, + const int32x2_t b_s32x2 +) +{ + int32x4_t o0_s32x4, o1_s32x4; + + o0_s32x4 = vld1q_s32( a ); + o1_s32x4 = vld1q_s32( a + 4 ); + o0_s32x4 = vqdmulhq_lane_s32( o0_s32x4, b_s32x2, 0 ); + o1_s32x4 = vqdmulhq_lane_s32( o1_s32x4, b_s32x2, 0 ); + vst1q_s32( a, o0_s32x4 ); + vst1q_s32( a + 4, o1_s32x4 ); +} + +static OPUS_INLINE void silk_SMULWW_4_neon( + opus_int32 *a, + const int32x2_t b_s32x2) +{ + int32x4_t a_s32x4, o_s32x4; + + a_s32x4 = vld1q_s32( a ); + o_s32x4 = vqdmulhq_lane_s32( a_s32x4, b_s32x2, 0 ); + o_s32x4 = vmlaq_lane_s32( o_s32x4, a_s32x4, b_s32x2, 1 ); + vst1q_s32( a, o_s32x4 ); +} + +static OPUS_INLINE void silk_SMULWW_8_neon( + opus_int32 *a, + const int32x2_t b_s32x2 +) +{ + int32x4_t a0_s32x4, a1_s32x4, o0_s32x4, o1_s32x4; + + a0_s32x4 = vld1q_s32( a ); + a1_s32x4 = vld1q_s32( a + 4 ); + o0_s32x4 = vqdmulhq_lane_s32( a0_s32x4, b_s32x2, 0 ); + o1_s32x4 = vqdmulhq_lane_s32( a1_s32x4, b_s32x2, 0 ); + o0_s32x4 = vmlaq_lane_s32( o0_s32x4, a0_s32x4, b_s32x2, 1 ); + o1_s32x4 = vmlaq_lane_s32( o1_s32x4, a1_s32x4, b_s32x2, 1 ); + vst1q_s32( a, o0_s32x4 ); + vst1q_s32( a + 4, o1_s32x4 ); +} + +static OPUS_INLINE void silk_SMULWW_loop_neon( + const opus_int16 *a, + const opus_int32 b, + opus_int32 *o, + const opus_int loop_num +) +{ + opus_int i; + int32x2_t b_s32x2; + + b_s32x2 = vdup_n_s32( b ); + for( i = 0; i < loop_num - 7; i += 8 ) { + silk_SMULWB_8_neon( a + i, b_s32x2, o + i ); + } + for( ; i < loop_num; i++ ) { + o[ i ] = silk_SMULWW( a[ i ], b ); + } +} + +static OPUS_INLINE void silk_nsq_del_dec_scale_states_neon( + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + NSQ_del_decs_struct psDelDec[], /* I/O Delayed decision states */ + const opus_int16 x16[], /* I Input */ + opus_int32 x_sc_Q10[], /* O Input scaled with 1/Gain in Q10 */ + const opus_int16 sLTP[], /* I Re-whitened LTP state in Q0 */ + opus_int32 sLTP_Q15[], /* O LTP state matching scaled input */ + opus_int subfr, /* I Subframe number */ + const opus_int LTP_scale_Q14, /* I LTP state scaling */ + const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I */ + const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lag */ + const opus_int signal_type, /* I Signal type */ + const opus_int decisionDelay /* I Decision delay */ +) +{ + opus_int i, lag; + opus_int32 gain_adj_Q16, inv_gain_Q31, inv_gain_Q26; + + lag = pitchL[ subfr ]; + inv_gain_Q31 = silk_INVERSE32_varQ( silk_max( Gains_Q16[ subfr ], 1 ), 47 ); + silk_assert( inv_gain_Q31 != 0 ); + + /* Scale input */ + inv_gain_Q26 = silk_RSHIFT_ROUND( inv_gain_Q31, 5 ); + silk_SMULWW_loop_neon( x16, inv_gain_Q26, x_sc_Q10, psEncC->subfr_length ); + + /* After rewhitening the LTP state is un-scaled, so scale with inv_gain_Q16 */ + if( NSQ->rewhite_flag ) { + if( subfr == 0 ) { + /* Do LTP downscaling */ + inv_gain_Q31 = silk_LSHIFT( silk_SMULWB( inv_gain_Q31, LTP_scale_Q14 ), 2 ); + } + silk_SMULWW_loop_neon( sLTP + NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2, inv_gain_Q31, sLTP_Q15 + NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2, lag + LTP_ORDER / 2 ); + } + + /* Adjust for changing gain */ + if( Gains_Q16[ subfr ] != NSQ->prev_gain_Q16 ) { + int32x2_t gain_adj_Q16_s32x2; + gain_adj_Q16 = silk_DIV32_varQ( NSQ->prev_gain_Q16, Gains_Q16[ subfr ], 16 ); + + /* Scale long-term shaping state */ + if( ( gain_adj_Q16 >= -65536 ) && ( gain_adj_Q16 < 65536 ) ) { + gain_adj_Q16_s32x2 = vdup_n_s32( silk_LSHIFT32( gain_adj_Q16, 15 ) ); + for( i = NSQ->sLTP_shp_buf_idx - psEncC->ltp_mem_length; i < NSQ->sLTP_shp_buf_idx - 7; i += 8 ) { + silk_SMULWW_small_b_8_neon( NSQ->sLTP_shp_Q14 + i, gain_adj_Q16_s32x2 ); + } + for( ; i < NSQ->sLTP_shp_buf_idx; i++ ) { + NSQ->sLTP_shp_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); + } + + /* Scale long-term prediction state */ + if( signal_type == TYPE_VOICED && NSQ->rewhite_flag == 0 ) { + for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx - decisionDelay - 7; i += 8 ) { + silk_SMULWW_small_b_8_neon( sLTP_Q15 + i, gain_adj_Q16_s32x2 ); + } + for( ; i < NSQ->sLTP_buf_idx - decisionDelay; i++ ) { + sLTP_Q15[ i ] = silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); + } + } + + /* Scale scalar states */ + silk_SMULWW_small_b_4_neon( psDelDec->LF_AR_Q14, gain_adj_Q16_s32x2 ); + silk_SMULWW_small_b_4_neon( psDelDec->Diff_Q14, gain_adj_Q16_s32x2 ); + + /* Scale short-term prediction and shaping states */ + for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { + silk_SMULWW_small_b_4_neon( psDelDec->sLPC_Q14[ i ], gain_adj_Q16_s32x2 ); + } + + for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { + silk_SMULWW_small_b_4_neon( psDelDec->sAR2_Q14[ i ], gain_adj_Q16_s32x2 ); + } + + for( i = 0; i < DECISION_DELAY; i++ ) { + silk_SMULWW_small_b_4_neon( psDelDec->Pred_Q15[ i ], gain_adj_Q16_s32x2 ); + silk_SMULWW_small_b_4_neon( psDelDec->Shape_Q14[ i ], gain_adj_Q16_s32x2 ); + } + } else { + gain_adj_Q16_s32x2 = vdup_n_s32( silk_LSHIFT32( gain_adj_Q16 & 0x0000FFFF, 15 ) ); + gain_adj_Q16_s32x2 = vset_lane_s32( gain_adj_Q16 >> 16, gain_adj_Q16_s32x2, 1 ); + for( i = NSQ->sLTP_shp_buf_idx - psEncC->ltp_mem_length; i < NSQ->sLTP_shp_buf_idx - 7; i += 8 ) { + silk_SMULWW_8_neon( NSQ->sLTP_shp_Q14 + i, gain_adj_Q16_s32x2 ); + } + for( ; i < NSQ->sLTP_shp_buf_idx; i++ ) { + NSQ->sLTP_shp_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); + } + + /* Scale long-term prediction state */ + if( signal_type == TYPE_VOICED && NSQ->rewhite_flag == 0 ) { + for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx - decisionDelay - 7; i += 8 ) { + silk_SMULWW_8_neon( sLTP_Q15 + i, gain_adj_Q16_s32x2 ); + } + for( ; i < NSQ->sLTP_buf_idx - decisionDelay; i++ ) { + sLTP_Q15[ i ] = silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); + } + } + + /* Scale scalar states */ + silk_SMULWW_4_neon( psDelDec->LF_AR_Q14, gain_adj_Q16_s32x2 ); + silk_SMULWW_4_neon( psDelDec->Diff_Q14, gain_adj_Q16_s32x2 ); + + /* Scale short-term prediction and shaping states */ + for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { + silk_SMULWW_4_neon( psDelDec->sLPC_Q14[ i ], gain_adj_Q16_s32x2 ); + } + + for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { + silk_SMULWW_4_neon( psDelDec->sAR2_Q14[ i ], gain_adj_Q16_s32x2 ); + } + + for( i = 0; i < DECISION_DELAY; i++ ) { + silk_SMULWW_4_neon( psDelDec->Pred_Q15[ i ], gain_adj_Q16_s32x2 ); + silk_SMULWW_4_neon( psDelDec->Shape_Q14[ i ], gain_adj_Q16_s32x2 ); + } + } + + /* Save inverse gain */ + NSQ->prev_gain_Q16 = Gains_Q16[ subfr ]; + } +} diff --git a/thirdparty/opus/silk/arm/NSQ_neon.h b/thirdparty/opus/silk/arm/NSQ_neon.h index 77c946af85..b31d9442d6 100644 --- a/thirdparty/opus/silk/arm/NSQ_neon.h +++ b/thirdparty/opus/silk/arm/NSQ_neon.h @@ -28,30 +28,31 @@ POSSIBILITY OF SUCH DAMAGE. #define SILK_NSQ_NEON_H #include "cpu_support.h" +#include "SigProc_FIX.h" #undef silk_short_prediction_create_arch_coef /* For vectorized calc, reverse a_Q12 coefs, convert to 32-bit, and shift for vqdmulhq_s32. */ static OPUS_INLINE void silk_short_prediction_create_arch_coef_neon(opus_int32 *out, const opus_int16 *in, opus_int order) { - out[15] = in[0] << 15; - out[14] = in[1] << 15; - out[13] = in[2] << 15; - out[12] = in[3] << 15; - out[11] = in[4] << 15; - out[10] = in[5] << 15; - out[9] = in[6] << 15; - out[8] = in[7] << 15; - out[7] = in[8] << 15; - out[6] = in[9] << 15; + out[15] = silk_LSHIFT32(in[0], 15); + out[14] = silk_LSHIFT32(in[1], 15); + out[13] = silk_LSHIFT32(in[2], 15); + out[12] = silk_LSHIFT32(in[3], 15); + out[11] = silk_LSHIFT32(in[4], 15); + out[10] = silk_LSHIFT32(in[5], 15); + out[9] = silk_LSHIFT32(in[6], 15); + out[8] = silk_LSHIFT32(in[7], 15); + out[7] = silk_LSHIFT32(in[8], 15); + out[6] = silk_LSHIFT32(in[9], 15); if (order == 16) { - out[5] = in[10] << 15; - out[4] = in[11] << 15; - out[3] = in[12] << 15; - out[2] = in[13] << 15; - out[1] = in[14] << 15; - out[0] = in[15] << 15; + out[5] = silk_LSHIFT32(in[10], 15); + out[4] = silk_LSHIFT32(in[11], 15); + out[3] = silk_LSHIFT32(in[12], 15); + out[2] = silk_LSHIFT32(in[13], 15); + out[1] = silk_LSHIFT32(in[14], 15); + out[0] = silk_LSHIFT32(in[15], 15); } else { diff --git a/thirdparty/opus/silk/arm/arm_silk_map.c b/thirdparty/opus/silk/arm/arm_silk_map.c index 9bd86a7b21..0b9bfec2ca 100644 --- a/thirdparty/opus/silk/arm/arm_silk_map.c +++ b/thirdparty/opus/silk/arm/arm_silk_map.c @@ -28,13 +28,62 @@ POSSIBILITY OF SUCH DAMAGE. # include "config.h" #endif +#include "main_FIX.h" #include "NSQ.h" +#include "SigProc_FIX.h" #if defined(OPUS_HAVE_RTCD) # if (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && \ !defined(OPUS_ARM_PRESUME_NEON_INTR)) +void (*const SILK_BIQUAD_ALT_STRIDE2_IMPL[OPUS_ARCHMASK + 1])( + const opus_int16 *in, /* I input signal */ + const opus_int32 *B_Q28, /* I MA coefficients [3] */ + const opus_int32 *A_Q28, /* I AR coefficients [2] */ + opus_int32 *S, /* I/O State vector [4] */ + opus_int16 *out, /* O output signal */ + const opus_int32 len /* I signal length (must be even) */ +) = { + silk_biquad_alt_stride2_c, /* ARMv4 */ + silk_biquad_alt_stride2_c, /* EDSP */ + silk_biquad_alt_stride2_c, /* Media */ + silk_biquad_alt_stride2_neon, /* Neon */ +}; + +opus_int32 (*const SILK_LPC_INVERSE_PRED_GAIN_IMPL[OPUS_ARCHMASK + 1])( /* O Returns inverse prediction gain in energy domain, Q30 */ + const opus_int16 *A_Q12, /* I Prediction coefficients, Q12 [order] */ + const opus_int order /* I Prediction order */ +) = { + silk_LPC_inverse_pred_gain_c, /* ARMv4 */ + silk_LPC_inverse_pred_gain_c, /* EDSP */ + silk_LPC_inverse_pred_gain_c, /* Media */ + silk_LPC_inverse_pred_gain_neon, /* Neon */ +}; + +void (*const SILK_NSQ_DEL_DEC_IMPL[OPUS_ARCHMASK + 1])( + const silk_encoder_state *psEncC, /* I Encoder State */ + silk_nsq_state *NSQ, /* I/O NSQ state */ + SideInfoIndices *psIndices, /* I/O Quantization Indices */ + const opus_int16 x16[], /* I Input */ + opus_int8 pulses[], /* O Quantized pulse signal */ + const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefs */ + const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I Long term prediction coefs */ + const opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ + const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I Long term shaping coefs */ + const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I Spectral tilt */ + const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I Low frequency shaping coefs */ + const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I Quantization step sizes */ + const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */ + const opus_int Lambda_Q10, /* I Rate/distortion tradeoff */ + const opus_int LTP_scale_Q14 /* I LTP state scaling */ +) = { + silk_NSQ_del_dec_c, /* ARMv4 */ + silk_NSQ_del_dec_c, /* EDSP */ + silk_NSQ_del_dec_c, /* Media */ + silk_NSQ_del_dec_neon, /* Neon */ +}; + /*There is no table for silk_noise_shape_quantizer_short_prediction because the NEON version takes different parameters than the C version. Instead RTCD is done via if statements at the call sites. @@ -52,4 +101,23 @@ opus_int32 # endif +# if defined(FIXED_POINT) && \ + defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR) + +void (*const SILK_WARPED_AUTOCORRELATION_FIX_IMPL[OPUS_ARCHMASK + 1])( + opus_int32 *corr, /* O Result [order + 1] */ + opus_int *scale, /* O Scaling of the correlation vector */ + const opus_int16 *input, /* I Input data to correlate */ + const opus_int warping_Q16, /* I Warping coefficient */ + const opus_int length, /* I Length of input */ + const opus_int order /* I Correlation order (even) */ +) = { + silk_warped_autocorrelation_FIX_c, /* ARMv4 */ + silk_warped_autocorrelation_FIX_c, /* EDSP */ + silk_warped_autocorrelation_FIX_c, /* Media */ + silk_warped_autocorrelation_FIX_neon, /* Neon */ +}; + +# endif + #endif /* OPUS_HAVE_RTCD */ diff --git a/thirdparty/opus/silk/arm/biquad_alt_arm.h b/thirdparty/opus/silk/arm/biquad_alt_arm.h new file mode 100644 index 0000000000..66ea9f43dd --- /dev/null +++ b/thirdparty/opus/silk/arm/biquad_alt_arm.h @@ -0,0 +1,68 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SILK_BIQUAD_ALT_ARM_H +# define SILK_BIQUAD_ALT_ARM_H + +# include "celt/arm/armcpu.h" + +# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) +void silk_biquad_alt_stride2_neon( + const opus_int16 *in, /* I input signal */ + const opus_int32 *B_Q28, /* I MA coefficients [3] */ + const opus_int32 *A_Q28, /* I AR coefficients [2] */ + opus_int32 *S, /* I/O State vector [4] */ + opus_int16 *out, /* O output signal */ + const opus_int32 len /* I signal length (must be even) */ +); + +# if !defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_PRESUME_NEON) +# define OVERRIDE_silk_biquad_alt_stride2 (1) +# define silk_biquad_alt_stride2(in, B_Q28, A_Q28, S, out, len, arch) ((void)(arch), PRESUME_NEON(silk_biquad_alt_stride2)(in, B_Q28, A_Q28, S, out, len)) +# endif +# endif + +# if !defined(OVERRIDE_silk_biquad_alt_stride2) +/*Is run-time CPU detection enabled on this platform?*/ +# if defined(OPUS_HAVE_RTCD) && (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)) +extern void (*const SILK_BIQUAD_ALT_STRIDE2_IMPL[OPUS_ARCHMASK+1])( + const opus_int16 *in, /* I input signal */ + const opus_int32 *B_Q28, /* I MA coefficients [3] */ + const opus_int32 *A_Q28, /* I AR coefficients [2] */ + opus_int32 *S, /* I/O State vector [4] */ + opus_int16 *out, /* O output signal */ + const opus_int32 len /* I signal length (must be even) */ + ); +# define OVERRIDE_silk_biquad_alt_stride2 (1) +# define silk_biquad_alt_stride2(in, B_Q28, A_Q28, S, out, len, arch) ((*SILK_BIQUAD_ALT_STRIDE2_IMPL[(arch)&OPUS_ARCHMASK])(in, B_Q28, A_Q28, S, out, len)) +# elif defined(OPUS_ARM_PRESUME_NEON_INTR) +# define OVERRIDE_silk_biquad_alt_stride2 (1) +# define silk_biquad_alt_stride2(in, B_Q28, A_Q28, S, out, len, arch) ((void)(arch), silk_biquad_alt_stride2_neon(in, B_Q28, A_Q28, S, out, len)) +# endif +# endif + +#endif /* end SILK_BIQUAD_ALT_ARM_H */ diff --git a/thirdparty/opus/silk/arm/biquad_alt_neon_intr.c b/thirdparty/opus/silk/arm/biquad_alt_neon_intr.c new file mode 100644 index 0000000000..9715733185 --- /dev/null +++ b/thirdparty/opus/silk/arm/biquad_alt_neon_intr.c @@ -0,0 +1,156 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <arm_neon.h> +#ifdef OPUS_CHECK_ASM +# include <string.h> +# include "stack_alloc.h" +#endif +#include "SigProc_FIX.h" + +static inline void silk_biquad_alt_stride2_kernel( const int32x4_t A_L_s32x4, const int32x4_t A_U_s32x4, const int32x4_t B_Q28_s32x4, const int32x2_t t_s32x2, const int32x4_t in_s32x4, int32x4_t *S_s32x4, int32x2_t *out32_Q14_s32x2 ) +{ + int32x4_t t_s32x4, out32_Q14_s32x4; + + *out32_Q14_s32x2 = vadd_s32( vget_low_s32( *S_s32x4 ), t_s32x2 ); /* silk_SMLAWB( S{0,1}, B_Q28[ 0 ], in{0,1} ) */ + *S_s32x4 = vcombine_s32( vget_high_s32( *S_s32x4 ), vdup_n_s32( 0 ) ); /* S{0,1} = S{2,3}; S{2,3} = 0; */ + *out32_Q14_s32x2 = vshl_n_s32( *out32_Q14_s32x2, 2 ); /* out32_Q14_{0,1} = silk_LSHIFT( silk_SMLAWB( S{0,1}, B_Q28[ 0 ], in{0,1} ), 2 ); */ + out32_Q14_s32x4 = vcombine_s32( *out32_Q14_s32x2, *out32_Q14_s32x2 ); /* out32_Q14_{0,1,0,1} */ + t_s32x4 = vqdmulhq_s32( out32_Q14_s32x4, A_L_s32x4 ); /* silk_SMULWB( out32_Q14_{0,1,0,1}, A{0,0,1,1}_L_Q28 ) */ + *S_s32x4 = vrsraq_n_s32( *S_s32x4, t_s32x4, 14 ); /* S{0,1} = S{2,3} + silk_RSHIFT_ROUND(); S{2,3} = silk_RSHIFT_ROUND(); */ + t_s32x4 = vqdmulhq_s32( out32_Q14_s32x4, A_U_s32x4 ); /* silk_SMULWB( out32_Q14_{0,1,0,1}, A{0,0,1,1}_U_Q28 ) */ + *S_s32x4 = vaddq_s32( *S_s32x4, t_s32x4 ); /* S0 = silk_SMLAWB( S{0,1,2,3}, out32_Q14_{0,1,0,1}, A{0,0,1,1}_U_Q28 ); */ + t_s32x4 = vqdmulhq_s32( in_s32x4, B_Q28_s32x4 ); /* silk_SMULWB( B_Q28[ {1,1,2,2} ], in{0,1,0,1} ) */ + *S_s32x4 = vaddq_s32( *S_s32x4, t_s32x4 ); /* S0 = silk_SMLAWB( S0, B_Q28[ {1,1,2,2} ], in{0,1,0,1} ); */ +} + +void silk_biquad_alt_stride2_neon( + const opus_int16 *in, /* I input signal */ + const opus_int32 *B_Q28, /* I MA coefficients [3] */ + const opus_int32 *A_Q28, /* I AR coefficients [2] */ + opus_int32 *S, /* I/O State vector [4] */ + opus_int16 *out, /* O output signal */ + const opus_int32 len /* I signal length (must be even) */ +) +{ + /* DIRECT FORM II TRANSPOSED (uses 2 element state vector) */ + opus_int k = 0; + const int32x2_t offset_s32x2 = vdup_n_s32( (1<<14) - 1 ); + const int32x4_t offset_s32x4 = vcombine_s32( offset_s32x2, offset_s32x2 ); + int16x4_t in_s16x4 = vdup_n_s16( 0 ); + int16x4_t out_s16x4; + int32x2_t A_Q28_s32x2, A_L_s32x2, A_U_s32x2, B_Q28_s32x2, t_s32x2; + int32x4_t A_L_s32x4, A_U_s32x4, B_Q28_s32x4, S_s32x4, out32_Q14_s32x4; + int32x2x2_t t0_s32x2x2, t1_s32x2x2, t2_s32x2x2, S_s32x2x2; + +#ifdef OPUS_CHECK_ASM + opus_int32 S_c[ 4 ]; + VARDECL( opus_int16, out_c ); + SAVE_STACK; + ALLOC( out_c, 2 * len, opus_int16 ); + + silk_memcpy( &S_c, S, sizeof( S_c ) ); + silk_biquad_alt_stride2_c( in, B_Q28, A_Q28, S_c, out_c, len ); +#endif + + /* Negate A_Q28 values and split in two parts */ + A_Q28_s32x2 = vld1_s32( A_Q28 ); + A_Q28_s32x2 = vneg_s32( A_Q28_s32x2 ); + A_L_s32x2 = vshl_n_s32( A_Q28_s32x2, 18 ); /* ( -A_Q28[] & 0x00003FFF ) << 18 */ + A_L_s32x2 = vreinterpret_s32_u32( vshr_n_u32( vreinterpret_u32_s32( A_L_s32x2 ), 3 ) ); /* ( -A_Q28[] & 0x00003FFF ) << 15 */ + A_U_s32x2 = vshr_n_s32( A_Q28_s32x2, 14 ); /* silk_RSHIFT( -A_Q28[], 14 ) */ + A_U_s32x2 = vshl_n_s32( A_U_s32x2, 16 ); /* silk_RSHIFT( -A_Q28[], 14 ) << 16 (Clip two leading bits to conform to C function.) */ + A_U_s32x2 = vshr_n_s32( A_U_s32x2, 1 ); /* silk_RSHIFT( -A_Q28[], 14 ) << 15 */ + + B_Q28_s32x2 = vld1_s32( B_Q28 ); + t_s32x2 = vld1_s32( B_Q28 + 1 ); + t0_s32x2x2 = vzip_s32( A_L_s32x2, A_L_s32x2 ); + t1_s32x2x2 = vzip_s32( A_U_s32x2, A_U_s32x2 ); + t2_s32x2x2 = vzip_s32( t_s32x2, t_s32x2 ); + A_L_s32x4 = vcombine_s32( t0_s32x2x2.val[ 0 ], t0_s32x2x2.val[ 1 ] ); /* A{0,0,1,1}_L_Q28 */ + A_U_s32x4 = vcombine_s32( t1_s32x2x2.val[ 0 ], t1_s32x2x2.val[ 1 ] ); /* A{0,0,1,1}_U_Q28 */ + B_Q28_s32x4 = vcombine_s32( t2_s32x2x2.val[ 0 ], t2_s32x2x2.val[ 1 ] ); /* B_Q28[ {1,1,2,2} ] */ + S_s32x4 = vld1q_s32( S ); /* S0 = S[ 0 ]; S3 = S[ 3 ]; */ + S_s32x2x2 = vtrn_s32( vget_low_s32( S_s32x4 ), vget_high_s32( S_s32x4 ) ); /* S2 = S[ 1 ]; S1 = S[ 2 ]; */ + S_s32x4 = vcombine_s32( S_s32x2x2.val[ 0 ], S_s32x2x2.val[ 1 ] ); + + for( ; k < len - 1; k += 2 ) { + int32x4_t in_s32x4[ 2 ], t_s32x4; + int32x2_t out32_Q14_s32x2[ 2 ]; + + /* S[ 2 * i + 0 ], S[ 2 * i + 1 ], S[ 2 * i + 2 ], S[ 2 * i + 3 ]: Q12 */ + in_s16x4 = vld1_s16( &in[ 2 * k ] ); /* in{0,1,2,3} = in[ 2 * k + {0,1,2,3} ]; */ + in_s32x4[ 0 ] = vshll_n_s16( in_s16x4, 15 ); /* in{0,1,2,3} << 15 */ + t_s32x4 = vqdmulhq_lane_s32( in_s32x4[ 0 ], B_Q28_s32x2, 0 ); /* silk_SMULWB( B_Q28[ 0 ], in{0,1,2,3} ) */ + in_s32x4[ 1 ] = vcombine_s32( vget_high_s32( in_s32x4[ 0 ] ), vget_high_s32( in_s32x4[ 0 ] ) ); /* in{2,3,2,3} << 15 */ + in_s32x4[ 0 ] = vcombine_s32( vget_low_s32 ( in_s32x4[ 0 ] ), vget_low_s32 ( in_s32x4[ 0 ] ) ); /* in{0,1,0,1} << 15 */ + silk_biquad_alt_stride2_kernel( A_L_s32x4, A_U_s32x4, B_Q28_s32x4, vget_low_s32 ( t_s32x4 ), in_s32x4[ 0 ], &S_s32x4, &out32_Q14_s32x2[ 0 ] ); + silk_biquad_alt_stride2_kernel( A_L_s32x4, A_U_s32x4, B_Q28_s32x4, vget_high_s32( t_s32x4 ), in_s32x4[ 1 ], &S_s32x4, &out32_Q14_s32x2[ 1 ] ); + + /* Scale back to Q0 and saturate */ + out32_Q14_s32x4 = vcombine_s32( out32_Q14_s32x2[ 0 ], out32_Q14_s32x2[ 1 ] ); /* out32_Q14_{0,1,2,3} */ + out32_Q14_s32x4 = vaddq_s32( out32_Q14_s32x4, offset_s32x4 ); /* out32_Q14_{0,1,2,3} + (1<<14) - 1 */ + out_s16x4 = vqshrn_n_s32( out32_Q14_s32x4, 14 ); /* (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14_{0,1,2,3} + (1<<14) - 1, 14 ) ) */ + vst1_s16( &out[ 2 * k ], out_s16x4 ); /* out[ 2 * k + {0,1,2,3} ] = (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14_{0,1,2,3} + (1<<14) - 1, 14 ) ); */ + } + + /* Process leftover. */ + if( k < len ) { + int32x4_t in_s32x4; + int32x2_t out32_Q14_s32x2; + + /* S[ 2 * i + 0 ], S[ 2 * i + 1 ]: Q12 */ + in_s16x4 = vld1_lane_s16( &in[ 2 * k + 0 ], in_s16x4, 0 ); /* in{0,1} = in[ 2 * k + {0,1} ]; */ + in_s16x4 = vld1_lane_s16( &in[ 2 * k + 1 ], in_s16x4, 1 ); /* in{0,1} = in[ 2 * k + {0,1} ]; */ + in_s32x4 = vshll_n_s16( in_s16x4, 15 ); /* in{0,1} << 15 */ + t_s32x2 = vqdmulh_lane_s32( vget_low_s32( in_s32x4 ), B_Q28_s32x2, 0 ); /* silk_SMULWB( B_Q28[ 0 ], in{0,1} ) */ + in_s32x4 = vcombine_s32( vget_low_s32( in_s32x4 ), vget_low_s32( in_s32x4 ) ); /* in{0,1,0,1} << 15 */ + silk_biquad_alt_stride2_kernel( A_L_s32x4, A_U_s32x4, B_Q28_s32x4, t_s32x2, in_s32x4, &S_s32x4, &out32_Q14_s32x2 ); + + /* Scale back to Q0 and saturate */ + out32_Q14_s32x2 = vadd_s32( out32_Q14_s32x2, offset_s32x2 ); /* out32_Q14_{0,1} + (1<<14) - 1 */ + out32_Q14_s32x4 = vcombine_s32( out32_Q14_s32x2, out32_Q14_s32x2 ); /* out32_Q14_{0,1,0,1} + (1<<14) - 1 */ + out_s16x4 = vqshrn_n_s32( out32_Q14_s32x4, 14 ); /* (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14_{0,1,0,1} + (1<<14) - 1, 14 ) ) */ + vst1_lane_s16( &out[ 2 * k + 0 ], out_s16x4, 0 ); /* out[ 2 * k + 0 ] = (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14_0 + (1<<14) - 1, 14 ) ); */ + vst1_lane_s16( &out[ 2 * k + 1 ], out_s16x4, 1 ); /* out[ 2 * k + 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14_1 + (1<<14) - 1, 14 ) ); */ + } + + vst1q_lane_s32( &S[ 0 ], S_s32x4, 0 ); /* S[ 0 ] = S0; */ + vst1q_lane_s32( &S[ 1 ], S_s32x4, 2 ); /* S[ 1 ] = S2; */ + vst1q_lane_s32( &S[ 2 ], S_s32x4, 1 ); /* S[ 2 ] = S1; */ + vst1q_lane_s32( &S[ 3 ], S_s32x4, 3 ); /* S[ 3 ] = S3; */ + +#ifdef OPUS_CHECK_ASM + silk_assert( !memcmp( S_c, S, sizeof( S_c ) ) ); + silk_assert( !memcmp( out_c, out, 2 * len * sizeof( opus_int16 ) ) ); + RESTORE_STACK; +#endif +} diff --git a/thirdparty/opus/silk/arm/macros_armv4.h b/thirdparty/opus/silk/arm/macros_armv4.h index 3f30e97288..877eb18dd5 100644 --- a/thirdparty/opus/silk/arm/macros_armv4.h +++ b/thirdparty/opus/silk/arm/macros_armv4.h @@ -28,6 +28,11 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef SILK_MACROS_ARMv4_H #define SILK_MACROS_ARMv4_H +/* This macro only avoids the undefined behaviour from a left shift of + a negative value. It should only be used in macros that can't include + SigProc_FIX.h. In other cases, use silk_LSHIFT32(). */ +#define SAFE_SHL(a,b) ((opus_int32)((opus_uint32)(a) << (b))) + /* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */ #undef silk_SMULWB static OPUS_INLINE opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b) @@ -38,7 +43,7 @@ static OPUS_INLINE opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b) "#silk_SMULWB\n\t" "smull %0, %1, %2, %3\n\t" : "=&r"(rd_lo), "=&r"(rd_hi) - : "%r"(a), "r"(b<<16) + : "%r"(a), "r"(SAFE_SHL(b,16)) ); return rd_hi; } @@ -80,7 +85,7 @@ static OPUS_INLINE opus_int32 silk_SMULWW_armv4(opus_int32 a, opus_int32 b) : "=&r"(rd_lo), "=&r"(rd_hi) : "%r"(a), "r"(b) ); - return (rd_hi<<16)+(rd_lo>>16); + return SAFE_SHL(rd_hi,16)+(rd_lo>>16); } #define silk_SMULWW(a, b) (silk_SMULWW_armv4(a, b)) @@ -96,8 +101,10 @@ static OPUS_INLINE opus_int32 silk_SMLAWW_armv4(opus_int32 a, opus_int32 b, : "=&r"(rd_lo), "=&r"(rd_hi) : "%r"(b), "r"(c) ); - return a+(rd_hi<<16)+(rd_lo>>16); + return a+SAFE_SHL(rd_hi,16)+(rd_lo>>16); } #define silk_SMLAWW(a, b, c) (silk_SMLAWW_armv4(a, b, c)) +#undef SAFE_SHL + #endif /* SILK_MACROS_ARMv4_H */ diff --git a/thirdparty/opus/silk/arm/macros_armv5e.h b/thirdparty/opus/silk/arm/macros_armv5e.h index aad4117e46..b14ec65ddb 100644 --- a/thirdparty/opus/silk/arm/macros_armv5e.h +++ b/thirdparty/opus/silk/arm/macros_armv5e.h @@ -29,6 +29,11 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef SILK_MACROS_ARMv5E_H #define SILK_MACROS_ARMv5E_H +/* This macro only avoids the undefined behaviour from a left shift of + a negative value. It should only be used in macros that can't include + SigProc_FIX.h. In other cases, use silk_LSHIFT32(). */ +#define SAFE_SHL(a,b) ((opus_int32)((opus_uint32)(a) << (b))) + /* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */ #undef silk_SMULWB static OPUS_INLINE opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b) @@ -190,7 +195,7 @@ static OPUS_INLINE opus_int32 silk_CLZ16_armv5(opus_int16 in16) "#silk_CLZ16\n\t" "clz %0, %1;\n" : "=r"(res) - : "r"(in16<<16|0x8000) + : "r"(SAFE_SHL(in16,16)|0x8000) ); return res; } @@ -210,4 +215,6 @@ static OPUS_INLINE opus_int32 silk_CLZ32_armv5(opus_int32 in32) } #define silk_CLZ32(in32) (silk_CLZ32_armv5(in32)) +#undef SAFE_SHL + #endif /* SILK_MACROS_ARMv5E_H */ diff --git a/thirdparty/opus/silk/biquad_alt.c b/thirdparty/opus/silk/biquad_alt.c index d55f5ee92e..54566a43c0 100644 --- a/thirdparty/opus/silk/biquad_alt.c +++ b/thirdparty/opus/silk/biquad_alt.c @@ -39,14 +39,13 @@ POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FIX.h" /* Second order ARMA filter, alternative implementation */ -void silk_biquad_alt( +void silk_biquad_alt_stride1( const opus_int16 *in, /* I input signal */ const opus_int32 *B_Q28, /* I MA coefficients [3] */ const opus_int32 *A_Q28, /* I AR coefficients [2] */ opus_int32 *S, /* I/O State vector [2] */ opus_int16 *out, /* O output signal */ - const opus_int32 len, /* I signal length (must be even) */ - opus_int stride /* I Operate on interleaved signal if > 1 */ + const opus_int32 len /* I signal length (must be even) */ ) { /* DIRECT FORM II TRANSPOSED (uses 2 element state vector) */ @@ -61,7 +60,7 @@ void silk_biquad_alt( for( k = 0; k < len; k++ ) { /* S[ 0 ], S[ 1 ]: Q12 */ - inval = in[ k * stride ]; + inval = in[ k ]; out32_Q14 = silk_LSHIFT( silk_SMLAWB( S[ 0 ], B_Q28[ 0 ], inval ), 2 ); S[ 0 ] = S[1] + silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14, A0_L_Q28 ), 14 ); @@ -73,6 +72,50 @@ void silk_biquad_alt( S[ 1 ] = silk_SMLAWB( S[ 1 ], B_Q28[ 2 ], inval ); /* Scale back to Q0 and saturate */ - out[ k * stride ] = (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14 + (1<<14) - 1, 14 ) ); + out[ k ] = (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14 + (1<<14) - 1, 14 ) ); + } +} + +void silk_biquad_alt_stride2_c( + const opus_int16 *in, /* I input signal */ + const opus_int32 *B_Q28, /* I MA coefficients [3] */ + const opus_int32 *A_Q28, /* I AR coefficients [2] */ + opus_int32 *S, /* I/O State vector [4] */ + opus_int16 *out, /* O output signal */ + const opus_int32 len /* I signal length (must be even) */ +) +{ + /* DIRECT FORM II TRANSPOSED (uses 2 element state vector) */ + opus_int k; + opus_int32 A0_U_Q28, A0_L_Q28, A1_U_Q28, A1_L_Q28, out32_Q14[ 2 ]; + + /* Negate A_Q28 values and split in two parts */ + A0_L_Q28 = ( -A_Q28[ 0 ] ) & 0x00003FFF; /* lower part */ + A0_U_Q28 = silk_RSHIFT( -A_Q28[ 0 ], 14 ); /* upper part */ + A1_L_Q28 = ( -A_Q28[ 1 ] ) & 0x00003FFF; /* lower part */ + A1_U_Q28 = silk_RSHIFT( -A_Q28[ 1 ], 14 ); /* upper part */ + + for( k = 0; k < len; k++ ) { + /* S[ 0 ], S[ 1 ], S[ 2 ], S[ 3 ]: Q12 */ + out32_Q14[ 0 ] = silk_LSHIFT( silk_SMLAWB( S[ 0 ], B_Q28[ 0 ], in[ 2 * k + 0 ] ), 2 ); + out32_Q14[ 1 ] = silk_LSHIFT( silk_SMLAWB( S[ 2 ], B_Q28[ 0 ], in[ 2 * k + 1 ] ), 2 ); + + S[ 0 ] = S[ 1 ] + silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14[ 0 ], A0_L_Q28 ), 14 ); + S[ 2 ] = S[ 3 ] + silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14[ 1 ], A0_L_Q28 ), 14 ); + S[ 0 ] = silk_SMLAWB( S[ 0 ], out32_Q14[ 0 ], A0_U_Q28 ); + S[ 2 ] = silk_SMLAWB( S[ 2 ], out32_Q14[ 1 ], A0_U_Q28 ); + S[ 0 ] = silk_SMLAWB( S[ 0 ], B_Q28[ 1 ], in[ 2 * k + 0 ] ); + S[ 2 ] = silk_SMLAWB( S[ 2 ], B_Q28[ 1 ], in[ 2 * k + 1 ] ); + + S[ 1 ] = silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14[ 0 ], A1_L_Q28 ), 14 ); + S[ 3 ] = silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14[ 1 ], A1_L_Q28 ), 14 ); + S[ 1 ] = silk_SMLAWB( S[ 1 ], out32_Q14[ 0 ], A1_U_Q28 ); + S[ 3 ] = silk_SMLAWB( S[ 3 ], out32_Q14[ 1 ], A1_U_Q28 ); + S[ 1 ] = silk_SMLAWB( S[ 1 ], B_Q28[ 2 ], in[ 2 * k + 0 ] ); + S[ 3 ] = silk_SMLAWB( S[ 3 ], B_Q28[ 2 ], in[ 2 * k + 1 ] ); + + /* Scale back to Q0 and saturate */ + out[ 2 * k + 0 ] = (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14[ 0 ] + (1<<14) - 1, 14 ) ); + out[ 2 * k + 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14[ 1 ] + (1<<14) - 1, 14 ) ); } } diff --git a/thirdparty/opus/silk/bwexpander.c b/thirdparty/opus/silk/bwexpander.c index 2eb4456695..afa97907ec 100644 --- a/thirdparty/opus/silk/bwexpander.c +++ b/thirdparty/opus/silk/bwexpander.c @@ -45,7 +45,7 @@ void silk_bwexpander( /* Bias in silk_SMULWB can lead to unstable filters */ for( i = 0; i < d - 1; i++ ) { ar[ i ] = (opus_int16)silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, ar[ i ] ), 16 ); - chirp_Q16 += silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, chirp_minus_one_Q16 ), 16 ); + chirp_Q16 += silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, chirp_minus_one_Q16 ), 16 ); } ar[ d - 1 ] = (opus_int16)silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, ar[ d - 1 ] ), 16 ); } diff --git a/thirdparty/opus/silk/check_control_input.c b/thirdparty/opus/silk/check_control_input.c index b5de9ce48d..739fb01f1e 100644 --- a/thirdparty/opus/silk/check_control_input.c +++ b/thirdparty/opus/silk/check_control_input.c @@ -38,7 +38,7 @@ opus_int check_control_input( silk_EncControlStruct *encControl /* I Control structure */ ) { - silk_assert( encControl != NULL ); + celt_assert( encControl != NULL ); if( ( ( encControl->API_sampleRate != 8000 ) && ( encControl->API_sampleRate != 12000 ) && @@ -59,46 +59,46 @@ opus_int check_control_input( ( encControl->minInternalSampleRate > encControl->desiredInternalSampleRate ) || ( encControl->maxInternalSampleRate < encControl->desiredInternalSampleRate ) || ( encControl->minInternalSampleRate > encControl->maxInternalSampleRate ) ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_FS_NOT_SUPPORTED; } if( encControl->payloadSize_ms != 10 && encControl->payloadSize_ms != 20 && encControl->payloadSize_ms != 40 && encControl->payloadSize_ms != 60 ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_PACKET_SIZE_NOT_SUPPORTED; } if( encControl->packetLossPercentage < 0 || encControl->packetLossPercentage > 100 ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_INVALID_LOSS_RATE; } if( encControl->useDTX < 0 || encControl->useDTX > 1 ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_INVALID_DTX_SETTING; } if( encControl->useCBR < 0 || encControl->useCBR > 1 ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_INVALID_CBR_SETTING; } if( encControl->useInBandFEC < 0 || encControl->useInBandFEC > 1 ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_INVALID_INBAND_FEC_SETTING; } if( encControl->nChannelsAPI < 1 || encControl->nChannelsAPI > ENCODER_NUM_CHANNELS ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERROR; } if( encControl->nChannelsInternal < 1 || encControl->nChannelsInternal > ENCODER_NUM_CHANNELS ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERROR; } if( encControl->nChannelsInternal > encControl->nChannelsAPI ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_INVALID_NUMBER_OF_CHANNELS_ERROR; } if( encControl->complexity < 0 || encControl->complexity > 10 ) { - silk_assert( 0 ); + celt_assert( 0 ); return SILK_ENC_INVALID_COMPLEXITY_SETTING; } diff --git a/thirdparty/opus/silk/control.h b/thirdparty/opus/silk/control.h index 747e5426a0..b76ec33cd6 100644 --- a/thirdparty/opus/silk/control.h +++ b/thirdparty/opus/silk/control.h @@ -77,6 +77,9 @@ typedef struct { /* I: Flag to enable in-band Forward Error Correction (FEC); 0/1 */ opus_int useInBandFEC; + /* I: Flag to actually code in-band Forward Error Correction (FEC) in the current packet; 0/1 */ + opus_int LBRR_coded; + /* I: Flag to enable discontinuous transmission (DTX); 0/1 */ opus_int useDTX; @@ -110,6 +113,11 @@ typedef struct { /* O: Tells the Opus encoder we're ready to switch */ opus_int switchReady; + /* O: SILK Signal type */ + opus_int signalType; + + /* O: SILK offset (dithering) */ + opus_int offset; } silk_EncControlStruct; /**************************************************************************/ diff --git a/thirdparty/opus/silk/control_SNR.c b/thirdparty/opus/silk/control_SNR.c index cee87eb0d8..9a6db27543 100644 --- a/thirdparty/opus/silk/control_SNR.c +++ b/thirdparty/opus/silk/control_SNR.c @@ -32,45 +32,82 @@ POSSIBILITY OF SUCH DAMAGE. #include "main.h" #include "tuning_parameters.h" +/* These tables hold SNR values divided by 21 (so they fit in 8 bits) + for different target bitrates spaced at 400 bps interval. The first + 10 values are omitted (0-4 kb/s) because they're all zeros. + These tables were obtained by running different SNRs through the + encoder and measuring the active bitrate. */ +static const unsigned char silk_TargetRate_NB_21[117 - 10] = { + 0, 15, 39, 52, 61, 68, + 74, 79, 84, 88, 92, 95, 99,102,105,108,111,114,117,119,122,124, + 126,129,131,133,135,137,139,142,143,145,147,149,151,153,155,157, + 158,160,162,163,165,167,168,170,171,173,174,176,177,179,180,182, + 183,185,186,187,189,190,192,193,194,196,197,199,200,201,203,204, + 205,207,208,209,211,212,213,215,216,217,219,220,221,223,224,225, + 227,228,230,231,232,234,235,236,238,239,241,242,243,245,246,248, + 249,250,252,253,255 +}; + +static const unsigned char silk_TargetRate_MB_21[165 - 10] = { + 0, 0, 28, 43, 52, 59, + 65, 70, 74, 78, 81, 85, 87, 90, 93, 95, 98,100,102,105,107,109, + 111,113,115,116,118,120,122,123,125,127,128,130,131,133,134,136, + 137,138,140,141,143,144,145,147,148,149,151,152,153,154,156,157, + 158,159,160,162,163,164,165,166,167,168,169,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,188,189,190, + 191,192,193,194,195,196,197,198,199,200,201,202,203,203,204,205, + 206,207,208,209,210,211,212,213,214,214,215,216,217,218,219,220, + 221,222,223,224,224,225,226,227,228,229,230,231,232,233,234,235, + 236,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250, + 251,252,253,254,255 +}; + +static const unsigned char silk_TargetRate_WB_21[201 - 10] = { + 0, 0, 0, 8, 29, 41, + 49, 56, 62, 66, 70, 74, 77, 80, 83, 86, 88, 91, 93, 95, 97, 99, + 101,103,105,107,108,110,112,113,115,116,118,119,121,122,123,125, + 126,127,129,130,131,132,134,135,136,137,138,140,141,142,143,144, + 145,146,147,148,149,150,151,152,153,154,156,157,158,159,159,160, + 161,162,163,164,165,166,167,168,169,170,171,171,172,173,174,175, + 176,177,177,178,179,180,181,181,182,183,184,185,185,186,187,188, + 189,189,190,191,192,192,193,194,195,195,196,197,198,198,199,200, + 200,201,202,203,203,204,205,206,206,207,208,209,209,210,211,211, + 212,213,214,214,215,216,216,217,218,219,219,220,221,221,222,223, + 224,224,225,226,226,227,228,229,229,230,231,232,232,233,234,234, + 235,236,237,237,238,239,240,240,241,242,243,243,244,245,246,246, + 247,248,249,249,250,251,252,253,255 +}; + /* Control SNR of redidual quantizer */ opus_int silk_control_SNR( silk_encoder_state *psEncC, /* I/O Pointer to Silk encoder state */ opus_int32 TargetRate_bps /* I Target max bitrate (bps) */ ) { - opus_int k, ret = SILK_NO_ERROR; - opus_int32 frac_Q6; - const opus_int32 *rateTable; - - /* Set bitrate/coding quality */ - TargetRate_bps = silk_LIMIT( TargetRate_bps, MIN_TARGET_RATE_BPS, MAX_TARGET_RATE_BPS ); - if( TargetRate_bps != psEncC->TargetRate_bps ) { - psEncC->TargetRate_bps = TargetRate_bps; - - /* If new TargetRate_bps, translate to SNR_dB value */ - if( psEncC->fs_kHz == 8 ) { - rateTable = silk_TargetRate_table_NB; - } else if( psEncC->fs_kHz == 12 ) { - rateTable = silk_TargetRate_table_MB; - } else { - rateTable = silk_TargetRate_table_WB; - } + int id; + int bound; + const unsigned char *snr_table; - /* Reduce bitrate for 10 ms modes in these calculations */ - if( psEncC->nb_subfr == 2 ) { - TargetRate_bps -= REDUCE_BITRATE_10_MS_BPS; - } - - /* Find bitrate interval in table and interpolate */ - for( k = 1; k < TARGET_RATE_TAB_SZ; k++ ) { - if( TargetRate_bps <= rateTable[ k ] ) { - frac_Q6 = silk_DIV32( silk_LSHIFT( TargetRate_bps - rateTable[ k - 1 ], 6 ), - rateTable[ k ] - rateTable[ k - 1 ] ); - psEncC->SNR_dB_Q7 = silk_LSHIFT( silk_SNR_table_Q1[ k - 1 ], 6 ) + silk_MUL( frac_Q6, silk_SNR_table_Q1[ k ] - silk_SNR_table_Q1[ k - 1 ] ); - break; - } - } + psEncC->TargetRate_bps = TargetRate_bps; + if( psEncC->nb_subfr == 2 ) { + TargetRate_bps -= 2000 + psEncC->fs_kHz/16; } - - return ret; + if( psEncC->fs_kHz == 8 ) { + bound = sizeof(silk_TargetRate_NB_21); + snr_table = silk_TargetRate_NB_21; + } else if( psEncC->fs_kHz == 12 ) { + bound = sizeof(silk_TargetRate_MB_21); + snr_table = silk_TargetRate_MB_21; + } else { + bound = sizeof(silk_TargetRate_WB_21); + snr_table = silk_TargetRate_WB_21; + } + id = (TargetRate_bps+200)/400; + id = silk_min(id - 10, bound-1); + if( id <= 0 ) { + psEncC->SNR_dB_Q7 = 0; + } else { + psEncC->SNR_dB_Q7 = snr_table[id]*21; + } + return SILK_NO_ERROR; } diff --git a/thirdparty/opus/silk/control_audio_bandwidth.c b/thirdparty/opus/silk/control_audio_bandwidth.c index 4f9bc5cbda..f6d22d8395 100644 --- a/thirdparty/opus/silk/control_audio_bandwidth.c +++ b/thirdparty/opus/silk/control_audio_bandwidth.c @@ -39,9 +39,15 @@ opus_int silk_control_audio_bandwidth( ) { opus_int fs_kHz; + opus_int orig_kHz; opus_int32 fs_Hz; - fs_kHz = psEncC->fs_kHz; + orig_kHz = psEncC->fs_kHz; + /* Handle a bandwidth-switching reset where we need to be aware what the last sampling rate was. */ + if( orig_kHz == 0 ) { + orig_kHz = psEncC->sLP.saved_fs_kHz; + } + fs_kHz = orig_kHz; fs_Hz = silk_SMULBB( fs_kHz, 1000 ); if( fs_Hz == 0 ) { /* Encoder has just been initialized */ @@ -61,7 +67,7 @@ opus_int silk_control_audio_bandwidth( } if( psEncC->allow_bandwidth_switch || encControl->opusCanSwitch ) { /* Check if we should switch down */ - if( silk_SMULBB( psEncC->fs_kHz, 1000 ) > psEncC->desiredInternal_fs_Hz ) + if( silk_SMULBB( orig_kHz, 1000 ) > psEncC->desiredInternal_fs_Hz ) { /* Switch down */ if( psEncC->sLP.mode == 0 ) { @@ -76,7 +82,7 @@ opus_int silk_control_audio_bandwidth( psEncC->sLP.mode = 0; /* Switch to a lower sample frequency */ - fs_kHz = psEncC->fs_kHz == 16 ? 12 : 8; + fs_kHz = orig_kHz == 16 ? 12 : 8; } else { if( psEncC->sLP.transition_frame_no <= 0 ) { encControl->switchReady = 1; @@ -90,12 +96,12 @@ opus_int silk_control_audio_bandwidth( } else /* Check if we should switch up */ - if( silk_SMULBB( psEncC->fs_kHz, 1000 ) < psEncC->desiredInternal_fs_Hz ) + if( silk_SMULBB( orig_kHz, 1000 ) < psEncC->desiredInternal_fs_Hz ) { /* Switch up */ if( encControl->opusCanSwitch ) { /* Switch to a higher sample frequency */ - fs_kHz = psEncC->fs_kHz == 8 ? 12 : 16; + fs_kHz = orig_kHz == 8 ? 12 : 16; /* New transition */ psEncC->sLP.transition_frame_no = 0; diff --git a/thirdparty/opus/silk/control_codec.c b/thirdparty/opus/silk/control_codec.c index 044eea3f2a..52aa8fded3 100644 --- a/thirdparty/opus/silk/control_codec.c +++ b/thirdparty/opus/silk/control_codec.c @@ -57,7 +57,7 @@ static opus_int silk_setup_complexity( static OPUS_INLINE opus_int silk_setup_LBRR( silk_encoder_state *psEncC, /* I/O */ - const opus_int32 TargetRate_bps /* I */ + const silk_EncControlStruct *encControl /* I */ ); @@ -65,7 +65,6 @@ static OPUS_INLINE opus_int silk_setup_LBRR( opus_int silk_control_encoder( silk_encoder_state_Fxx *psEnc, /* I/O Pointer to Silk encoder state */ silk_EncControlStruct *encControl, /* I Control structure */ - const opus_int32 TargetRate_bps, /* I Target max bitrate (bps) */ const opus_int allow_bw_switch, /* I Flag to allow switching audio bandwidth */ const opus_int channelNb, /* I Channel number */ const opus_int force_fs_kHz @@ -125,7 +124,7 @@ opus_int silk_control_encoder( /********************************************/ /* Set LBRR usage */ /********************************************/ - ret += silk_setup_LBRR( &psEnc->sCmn, TargetRate_bps ); + ret += silk_setup_LBRR( &psEnc->sCmn, encControl ); psEnc->sCmn.controlled_since_last_payload = 1; @@ -239,12 +238,11 @@ static opus_int silk_setup_fs( } /* Set internal sampling frequency */ - silk_assert( fs_kHz == 8 || fs_kHz == 12 || fs_kHz == 16 ); - silk_assert( psEnc->sCmn.nb_subfr == 2 || psEnc->sCmn.nb_subfr == 4 ); + celt_assert( fs_kHz == 8 || fs_kHz == 12 || fs_kHz == 16 ); + celt_assert( psEnc->sCmn.nb_subfr == 2 || psEnc->sCmn.nb_subfr == 4 ); if( psEnc->sCmn.fs_kHz != fs_kHz ) { /* reset part of the state */ silk_memset( &psEnc->sShape, 0, sizeof( psEnc->sShape ) ); - silk_memset( &psEnc->sPrefilt, 0, sizeof( psEnc->sPrefilt ) ); silk_memset( &psEnc->sCmn.sNSQ, 0, sizeof( psEnc->sCmn.sNSQ ) ); silk_memset( psEnc->sCmn.prev_NLSFq_Q15, 0, sizeof( psEnc->sCmn.prev_NLSFq_Q15 ) ); silk_memset( &psEnc->sCmn.sLP.In_LP_State, 0, sizeof( psEnc->sCmn.sLP.In_LP_State ) ); @@ -255,7 +253,6 @@ static opus_int silk_setup_fs( /* Initialize non-zero parameters */ psEnc->sCmn.prevLag = 100; psEnc->sCmn.first_frame_after_reset = 1; - psEnc->sPrefilt.lagPrev = 100; psEnc->sShape.LastGainIndex = 10; psEnc->sCmn.sNSQ.lagPrev = 100; psEnc->sCmn.sNSQ.prev_gain_Q16 = 65536; @@ -293,19 +290,16 @@ static opus_int silk_setup_fs( psEnc->sCmn.pitch_LPC_win_length = silk_SMULBB( FIND_PITCH_LPC_WIN_MS_2_SF, fs_kHz ); } if( psEnc->sCmn.fs_kHz == 16 ) { - psEnc->sCmn.mu_LTP_Q9 = SILK_FIX_CONST( MU_LTP_QUANT_WB, 9 ); psEnc->sCmn.pitch_lag_low_bits_iCDF = silk_uniform8_iCDF; } else if( psEnc->sCmn.fs_kHz == 12 ) { - psEnc->sCmn.mu_LTP_Q9 = SILK_FIX_CONST( MU_LTP_QUANT_MB, 9 ); psEnc->sCmn.pitch_lag_low_bits_iCDF = silk_uniform6_iCDF; } else { - psEnc->sCmn.mu_LTP_Q9 = SILK_FIX_CONST( MU_LTP_QUANT_NB, 9 ); psEnc->sCmn.pitch_lag_low_bits_iCDF = silk_uniform4_iCDF; } } /* Check that settings are valid */ - silk_assert( ( psEnc->sCmn.subfr_length * psEnc->sCmn.nb_subfr ) == psEnc->sCmn.frame_length ); + celt_assert( ( psEnc->sCmn.subfr_length * psEnc->sCmn.nb_subfr ) == psEnc->sCmn.frame_length ); return ret; } @@ -318,61 +312,76 @@ static opus_int silk_setup_complexity( opus_int ret = 0; /* Set encoding complexity */ - silk_assert( Complexity >= 0 && Complexity <= 10 ); - if( Complexity < 2 ) { + celt_assert( Complexity >= 0 && Complexity <= 10 ); + if( Complexity < 1 ) { psEncC->pitchEstimationComplexity = SILK_PE_MIN_COMPLEX; psEncC->pitchEstimationThreshold_Q16 = SILK_FIX_CONST( 0.8, 16 ); psEncC->pitchEstimationLPCOrder = 6; - psEncC->shapingLPCOrder = 8; + psEncC->shapingLPCOrder = 12; psEncC->la_shape = 3 * psEncC->fs_kHz; psEncC->nStatesDelayedDecision = 1; psEncC->useInterpolatedNLSFs = 0; - psEncC->LTPQuantLowComplexity = 1; psEncC->NLSF_MSVQ_Survivors = 2; psEncC->warping_Q16 = 0; - } else if( Complexity < 4 ) { + } else if( Complexity < 2 ) { psEncC->pitchEstimationComplexity = SILK_PE_MID_COMPLEX; psEncC->pitchEstimationThreshold_Q16 = SILK_FIX_CONST( 0.76, 16 ); psEncC->pitchEstimationLPCOrder = 8; - psEncC->shapingLPCOrder = 10; + psEncC->shapingLPCOrder = 14; psEncC->la_shape = 5 * psEncC->fs_kHz; psEncC->nStatesDelayedDecision = 1; psEncC->useInterpolatedNLSFs = 0; - psEncC->LTPQuantLowComplexity = 0; + psEncC->NLSF_MSVQ_Survivors = 3; + psEncC->warping_Q16 = 0; + } else if( Complexity < 3 ) { + psEncC->pitchEstimationComplexity = SILK_PE_MIN_COMPLEX; + psEncC->pitchEstimationThreshold_Q16 = SILK_FIX_CONST( 0.8, 16 ); + psEncC->pitchEstimationLPCOrder = 6; + psEncC->shapingLPCOrder = 12; + psEncC->la_shape = 3 * psEncC->fs_kHz; + psEncC->nStatesDelayedDecision = 2; + psEncC->useInterpolatedNLSFs = 0; + psEncC->NLSF_MSVQ_Survivors = 2; + psEncC->warping_Q16 = 0; + } else if( Complexity < 4 ) { + psEncC->pitchEstimationComplexity = SILK_PE_MID_COMPLEX; + psEncC->pitchEstimationThreshold_Q16 = SILK_FIX_CONST( 0.76, 16 ); + psEncC->pitchEstimationLPCOrder = 8; + psEncC->shapingLPCOrder = 14; + psEncC->la_shape = 5 * psEncC->fs_kHz; + psEncC->nStatesDelayedDecision = 2; + psEncC->useInterpolatedNLSFs = 0; psEncC->NLSF_MSVQ_Survivors = 4; psEncC->warping_Q16 = 0; } else if( Complexity < 6 ) { psEncC->pitchEstimationComplexity = SILK_PE_MID_COMPLEX; psEncC->pitchEstimationThreshold_Q16 = SILK_FIX_CONST( 0.74, 16 ); psEncC->pitchEstimationLPCOrder = 10; - psEncC->shapingLPCOrder = 12; + psEncC->shapingLPCOrder = 16; psEncC->la_shape = 5 * psEncC->fs_kHz; psEncC->nStatesDelayedDecision = 2; psEncC->useInterpolatedNLSFs = 1; - psEncC->LTPQuantLowComplexity = 0; - psEncC->NLSF_MSVQ_Survivors = 8; + psEncC->NLSF_MSVQ_Survivors = 6; psEncC->warping_Q16 = psEncC->fs_kHz * SILK_FIX_CONST( WARPING_MULTIPLIER, 16 ); } else if( Complexity < 8 ) { psEncC->pitchEstimationComplexity = SILK_PE_MID_COMPLEX; psEncC->pitchEstimationThreshold_Q16 = SILK_FIX_CONST( 0.72, 16 ); psEncC->pitchEstimationLPCOrder = 12; - psEncC->shapingLPCOrder = 14; + psEncC->shapingLPCOrder = 20; psEncC->la_shape = 5 * psEncC->fs_kHz; psEncC->nStatesDelayedDecision = 3; psEncC->useInterpolatedNLSFs = 1; - psEncC->LTPQuantLowComplexity = 0; - psEncC->NLSF_MSVQ_Survivors = 16; + psEncC->NLSF_MSVQ_Survivors = 8; psEncC->warping_Q16 = psEncC->fs_kHz * SILK_FIX_CONST( WARPING_MULTIPLIER, 16 ); } else { psEncC->pitchEstimationComplexity = SILK_PE_MAX_COMPLEX; psEncC->pitchEstimationThreshold_Q16 = SILK_FIX_CONST( 0.7, 16 ); psEncC->pitchEstimationLPCOrder = 16; - psEncC->shapingLPCOrder = 16; + psEncC->shapingLPCOrder = 24; psEncC->la_shape = 5 * psEncC->fs_kHz; psEncC->nStatesDelayedDecision = MAX_DEL_DEC_STATES; psEncC->useInterpolatedNLSFs = 1; - psEncC->LTPQuantLowComplexity = 0; - psEncC->NLSF_MSVQ_Survivors = 32; + psEncC->NLSF_MSVQ_Survivors = 16; psEncC->warping_Q16 = psEncC->fs_kHz * SILK_FIX_CONST( WARPING_MULTIPLIER, 16 ); } @@ -381,46 +390,32 @@ static opus_int silk_setup_complexity( psEncC->shapeWinLength = SUB_FRAME_LENGTH_MS * psEncC->fs_kHz + 2 * psEncC->la_shape; psEncC->Complexity = Complexity; - silk_assert( psEncC->pitchEstimationLPCOrder <= MAX_FIND_PITCH_LPC_ORDER ); - silk_assert( psEncC->shapingLPCOrder <= MAX_SHAPE_LPC_ORDER ); - silk_assert( psEncC->nStatesDelayedDecision <= MAX_DEL_DEC_STATES ); - silk_assert( psEncC->warping_Q16 <= 32767 ); - silk_assert( psEncC->la_shape <= LA_SHAPE_MAX ); - silk_assert( psEncC->shapeWinLength <= SHAPE_LPC_WIN_MAX ); - silk_assert( psEncC->NLSF_MSVQ_Survivors <= NLSF_VQ_MAX_SURVIVORS ); + celt_assert( psEncC->pitchEstimationLPCOrder <= MAX_FIND_PITCH_LPC_ORDER ); + celt_assert( psEncC->shapingLPCOrder <= MAX_SHAPE_LPC_ORDER ); + celt_assert( psEncC->nStatesDelayedDecision <= MAX_DEL_DEC_STATES ); + celt_assert( psEncC->warping_Q16 <= 32767 ); + celt_assert( psEncC->la_shape <= LA_SHAPE_MAX ); + celt_assert( psEncC->shapeWinLength <= SHAPE_LPC_WIN_MAX ); return ret; } static OPUS_INLINE opus_int silk_setup_LBRR( silk_encoder_state *psEncC, /* I/O */ - const opus_int32 TargetRate_bps /* I */ + const silk_EncControlStruct *encControl /* I */ ) { opus_int LBRR_in_previous_packet, ret = SILK_NO_ERROR; - opus_int32 LBRR_rate_thres_bps; LBRR_in_previous_packet = psEncC->LBRR_enabled; - psEncC->LBRR_enabled = 0; - if( psEncC->useInBandFEC && psEncC->PacketLoss_perc > 0 ) { - if( psEncC->fs_kHz == 8 ) { - LBRR_rate_thres_bps = LBRR_NB_MIN_RATE_BPS; - } else if( psEncC->fs_kHz == 12 ) { - LBRR_rate_thres_bps = LBRR_MB_MIN_RATE_BPS; + psEncC->LBRR_enabled = encControl->LBRR_coded; + if( psEncC->LBRR_enabled ) { + /* Set gain increase for coding LBRR excitation */ + if( LBRR_in_previous_packet == 0 ) { + /* Previous packet did not have LBRR, and was therefore coded at a higher bitrate */ + psEncC->LBRR_GainIncreases = 7; } else { - LBRR_rate_thres_bps = LBRR_WB_MIN_RATE_BPS; - } - LBRR_rate_thres_bps = silk_SMULWB( silk_MUL( LBRR_rate_thres_bps, 125 - silk_min( psEncC->PacketLoss_perc, 25 ) ), SILK_FIX_CONST( 0.01, 16 ) ); - - if( TargetRate_bps > LBRR_rate_thres_bps ) { - /* Set gain increase for coding LBRR excitation */ - if( LBRR_in_previous_packet == 0 ) { - /* Previous packet did not have LBRR, and was therefore coded at a higher bitrate */ - psEncC->LBRR_GainIncreases = 7; - } else { - psEncC->LBRR_GainIncreases = silk_max_int( 7 - silk_SMULWB( (opus_int32)psEncC->PacketLoss_perc, SILK_FIX_CONST( 0.4, 16 ) ), 2 ); - } - psEncC->LBRR_enabled = 1; + psEncC->LBRR_GainIncreases = silk_max_int( 7 - silk_SMULWB( (opus_int32)psEncC->PacketLoss_perc, SILK_FIX_CONST( 0.4, 16 ) ), 2 ); } } diff --git a/thirdparty/opus/silk/debug.h b/thirdparty/opus/silk/debug.h index efb6d3e99e..6f68c1ca0f 100644 --- a/thirdparty/opus/silk/debug.h +++ b/thirdparty/opus/silk/debug.h @@ -39,23 +39,10 @@ extern "C" unsigned long GetHighResolutionTime(void); /* O time in usec*/ -/* make SILK_DEBUG dependent on compiler's _DEBUG */ -#if defined _WIN32 - #ifdef _DEBUG - #define SILK_DEBUG 1 - #else - #define SILK_DEBUG 0 - #endif - - /* overrule the above */ - #if 0 - /* #define NO_ASSERTS*/ - #undef SILK_DEBUG - #define SILK_DEBUG 1 - #endif -#else - #define SILK_DEBUG 0 -#endif +/* Set to 1 to enable DEBUG_STORE_DATA() macros for dumping + * intermediate signals from the codec. + */ +#define SILK_DEBUG 0 /* Flag for using timers */ #define SILK_TIC_TOC 0 diff --git a/thirdparty/opus/silk/dec_API.c b/thirdparty/opus/silk/dec_API.c index b7d8ed48d8..7d5ca7fb9f 100644 --- a/thirdparty/opus/silk/dec_API.c +++ b/thirdparty/opus/silk/dec_API.c @@ -104,7 +104,7 @@ opus_int silk_Decode( /* O Returns error co int delay_stack_alloc; SAVE_STACK; - silk_assert( decControl->nChannelsInternal == 1 || decControl->nChannelsInternal == 2 ); + celt_assert( decControl->nChannelsInternal == 1 || decControl->nChannelsInternal == 2 ); /**********************************/ /* Test if first frame in payload */ @@ -143,13 +143,13 @@ opus_int silk_Decode( /* O Returns error co channel_state[ n ].nFramesPerPacket = 3; channel_state[ n ].nb_subfr = 4; } else { - silk_assert( 0 ); + celt_assert( 0 ); RESTORE_STACK; return SILK_DEC_INVALID_FRAME_SIZE; } fs_kHz_dec = ( decControl->internalSampleRate >> 10 ) + 1; if( fs_kHz_dec != 8 && fs_kHz_dec != 12 && fs_kHz_dec != 16 ) { - silk_assert( 0 ); + celt_assert( 0 ); RESTORE_STACK; return SILK_DEC_INVALID_SAMPLING_FREQUENCY; } diff --git a/thirdparty/opus/silk/decode_core.c b/thirdparty/opus/silk/decode_core.c index e569c0e72b..1c352a6522 100644 --- a/thirdparty/opus/silk/decode_core.c +++ b/thirdparty/opus/silk/decode_core.c @@ -141,7 +141,7 @@ void silk_decode_core( if( k == 0 || ( k == 2 && NLSF_interpolation_flag ) ) { /* Rewhiten with new A coefs */ start_idx = psDec->ltp_mem_length - lag - psDec->LPC_order - LTP_ORDER / 2; - silk_assert( start_idx > 0 ); + celt_assert( start_idx > 0 ); if( k == 2 ) { silk_memcpy( &psDec->outBuf[ psDec->ltp_mem_length ], xq, 2 * psDec->subfr_length * sizeof( opus_int16 ) ); @@ -196,7 +196,7 @@ void silk_decode_core( for( i = 0; i < psDec->subfr_length; i++ ) { /* Short-term prediction */ - silk_assert( psDec->LPC_order == 10 || psDec->LPC_order == 16 ); + celt_assert( psDec->LPC_order == 10 || psDec->LPC_order == 16 ); /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LPC_pred_Q10 = silk_RSHIFT( psDec->LPC_order, 1 ); LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 1 ], A_Q12_tmp[ 0 ] ); @@ -225,8 +225,6 @@ void silk_decode_core( pxq[ i ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( sLPC_Q14[ MAX_LPC_ORDER + i ], Gain_Q10 ), 8 ) ); } - /* DEBUG_STORE_DATA( dec.pcm, pxq, psDec->subfr_length * sizeof( opus_int16 ) ) */ - /* Update LPC filter state */ silk_memcpy( sLPC_Q14, &sLPC_Q14[ psDec->subfr_length ], MAX_LPC_ORDER * sizeof( opus_int32 ) ); pexc_Q14 += psDec->subfr_length; diff --git a/thirdparty/opus/silk/decode_frame.c b/thirdparty/opus/silk/decode_frame.c index a605d95ac6..e73825b267 100644 --- a/thirdparty/opus/silk/decode_frame.c +++ b/thirdparty/opus/silk/decode_frame.c @@ -55,7 +55,7 @@ opus_int silk_decode_frame( psDecCtrl->LTP_scale_Q14 = 0; /* Safety checks */ - silk_assert( L > 0 && L <= MAX_FRAME_LENGTH ); + celt_assert( L > 0 && L <= MAX_FRAME_LENGTH ); if( lostFlag == FLAG_DECODE_NORMAL || ( lostFlag == FLAG_DECODE_LBRR && psDec->LBRR_flags[ psDec->nFramesDecoded ] == 1 ) ) @@ -91,19 +91,20 @@ opus_int silk_decode_frame( psDec->lossCnt = 0; psDec->prevSignalType = psDec->indices.signalType; - silk_assert( psDec->prevSignalType >= 0 && psDec->prevSignalType <= 2 ); + celt_assert( psDec->prevSignalType >= 0 && psDec->prevSignalType <= 2 ); /* A frame has been decoded without errors */ psDec->first_frame_after_reset = 0; } else { /* Handle packet loss by extrapolation */ + psDec->indices.signalType = psDec->prevSignalType; silk_PLC( psDec, psDecCtrl, pOut, 1, arch ); } /*************************/ /* Update output buffer. */ /*************************/ - silk_assert( psDec->ltp_mem_length >= psDec->frame_length ); + celt_assert( psDec->ltp_mem_length >= psDec->frame_length ); mv_len = psDec->ltp_mem_length - psDec->frame_length; silk_memmove( psDec->outBuf, &psDec->outBuf[ psDec->frame_length ], mv_len * sizeof(opus_int16) ); silk_memcpy( &psDec->outBuf[ mv_len ], pOut, psDec->frame_length * sizeof( opus_int16 ) ); diff --git a/thirdparty/opus/silk/decode_indices.c b/thirdparty/opus/silk/decode_indices.c index 7afe5c26c1..0bb4a997a5 100644 --- a/thirdparty/opus/silk/decode_indices.c +++ b/thirdparty/opus/silk/decode_indices.c @@ -79,7 +79,7 @@ void silk_decode_indices( /**********************/ psDec->indices.NLSFIndices[ 0 ] = (opus_int8)ec_dec_icdf( psRangeDec, &psDec->psNLSF_CB->CB1_iCDF[ ( psDec->indices.signalType >> 1 ) * psDec->psNLSF_CB->nVectors ], 8 ); silk_NLSF_unpack( ec_ix, pred_Q8, psDec->psNLSF_CB, psDec->indices.NLSFIndices[ 0 ] ); - silk_assert( psDec->psNLSF_CB->order == psDec->LPC_order ); + celt_assert( psDec->psNLSF_CB->order == psDec->LPC_order ); for( i = 0; i < psDec->psNLSF_CB->order; i++ ) { Ix = ec_dec_icdf( psRangeDec, &psDec->psNLSF_CB->ec_iCDF[ ec_ix[ i ] ], 8 ); if( Ix == 0 ) { diff --git a/thirdparty/opus/silk/decode_parameters.c b/thirdparty/opus/silk/decode_parameters.c index e345b1dcef..a56a409858 100644 --- a/thirdparty/opus/silk/decode_parameters.c +++ b/thirdparty/opus/silk/decode_parameters.c @@ -52,7 +52,7 @@ void silk_decode_parameters( silk_NLSF_decode( pNLSF_Q15, psDec->indices.NLSFIndices, psDec->psNLSF_CB ); /* Convert NLSF parameters to AR prediction filter coefficients */ - silk_NLSF2A( psDecCtrl->PredCoef_Q12[ 1 ], pNLSF_Q15, psDec->LPC_order ); + silk_NLSF2A( psDecCtrl->PredCoef_Q12[ 1 ], pNLSF_Q15, psDec->LPC_order, psDec->arch ); /* If just reset, e.g., because internal Fs changed, do not allow interpolation */ /* improves the case of packet loss in the first frame after a switch */ @@ -69,7 +69,7 @@ void silk_decode_parameters( } /* Convert NLSF parameters to AR prediction filter coefficients */ - silk_NLSF2A( psDecCtrl->PredCoef_Q12[ 0 ], pNLSF0_Q15, psDec->LPC_order ); + silk_NLSF2A( psDecCtrl->PredCoef_Q12[ 0 ], pNLSF0_Q15, psDec->LPC_order, psDec->arch ); } else { /* Copy LPC coefficients for first half from second half */ silk_memcpy( psDecCtrl->PredCoef_Q12[ 0 ], psDecCtrl->PredCoef_Q12[ 1 ], psDec->LPC_order * sizeof( opus_int16 ) ); diff --git a/thirdparty/opus/silk/decode_pitch.c b/thirdparty/opus/silk/decode_pitch.c index fedbc6a525..fd1b6bf551 100644 --- a/thirdparty/opus/silk/decode_pitch.c +++ b/thirdparty/opus/silk/decode_pitch.c @@ -51,7 +51,7 @@ void silk_decode_pitch( Lag_CB_ptr = &silk_CB_lags_stage2[ 0 ][ 0 ]; cbk_size = PE_NB_CBKS_STAGE2_EXT; } else { - silk_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1 ); + celt_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1 ); Lag_CB_ptr = &silk_CB_lags_stage2_10_ms[ 0 ][ 0 ]; cbk_size = PE_NB_CBKS_STAGE2_10MS; } @@ -60,7 +60,7 @@ void silk_decode_pitch( Lag_CB_ptr = &silk_CB_lags_stage3[ 0 ][ 0 ]; cbk_size = PE_NB_CBKS_STAGE3_MAX; } else { - silk_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1 ); + celt_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1 ); Lag_CB_ptr = &silk_CB_lags_stage3_10_ms[ 0 ][ 0 ]; cbk_size = PE_NB_CBKS_STAGE3_10MS; } diff --git a/thirdparty/opus/silk/decode_pulses.c b/thirdparty/opus/silk/decode_pulses.c index d6bbec9225..a56d2d3074 100644 --- a/thirdparty/opus/silk/decode_pulses.c +++ b/thirdparty/opus/silk/decode_pulses.c @@ -56,7 +56,7 @@ void silk_decode_pulses( silk_assert( 1 << LOG2_SHELL_CODEC_FRAME_LENGTH == SHELL_CODEC_FRAME_LENGTH ); iter = silk_RSHIFT( frame_length, LOG2_SHELL_CODEC_FRAME_LENGTH ); if( iter * SHELL_CODEC_FRAME_LENGTH < frame_length ) { - silk_assert( frame_length == 12 * 10 ); /* Make sure only happens for 10 ms @ 12 kHz */ + celt_assert( frame_length == 12 * 10 ); /* Make sure only happens for 10 ms @ 12 kHz */ iter++; } diff --git a/thirdparty/opus/silk/decoder_set_fs.c b/thirdparty/opus/silk/decoder_set_fs.c index eef0fd25e1..d9a13d0f0c 100644 --- a/thirdparty/opus/silk/decoder_set_fs.c +++ b/thirdparty/opus/silk/decoder_set_fs.c @@ -40,8 +40,8 @@ opus_int silk_decoder_set_fs( { opus_int frame_length, ret = 0; - silk_assert( fs_kHz == 8 || fs_kHz == 12 || fs_kHz == 16 ); - silk_assert( psDec->nb_subfr == MAX_NB_SUBFR || psDec->nb_subfr == MAX_NB_SUBFR/2 ); + celt_assert( fs_kHz == 8 || fs_kHz == 12 || fs_kHz == 16 ); + celt_assert( psDec->nb_subfr == MAX_NB_SUBFR || psDec->nb_subfr == MAX_NB_SUBFR/2 ); /* New (sub)frame length */ psDec->subfr_length = silk_SMULBB( SUB_FRAME_LENGTH_MS, fs_kHz ); @@ -86,7 +86,7 @@ opus_int silk_decoder_set_fs( psDec->pitch_lag_low_bits_iCDF = silk_uniform4_iCDF; } else { /* unsupported sampling rate */ - silk_assert( 0 ); + celt_assert( 0 ); } psDec->first_frame_after_reset = 1; psDec->lagPrev = 100; @@ -101,7 +101,7 @@ opus_int silk_decoder_set_fs( } /* Check that settings are valid */ - silk_assert( psDec->frame_length > 0 && psDec->frame_length <= MAX_FRAME_LENGTH ); + celt_assert( psDec->frame_length > 0 && psDec->frame_length <= MAX_FRAME_LENGTH ); return ret; } diff --git a/thirdparty/opus/silk/define.h b/thirdparty/opus/silk/define.h index 19c9b00e25..247cb0bf71 100644 --- a/thirdparty/opus/silk/define.h +++ b/thirdparty/opus/silk/define.h @@ -46,7 +46,6 @@ extern "C" /* Limits on bitrate */ #define MIN_TARGET_RATE_BPS 5000 #define MAX_TARGET_RATE_BPS 80000 -#define TARGET_RATE_TAB_SZ 8 /* LBRR thresholds */ #define LBRR_NB_MIN_RATE_BPS 12000 @@ -56,6 +55,12 @@ extern "C" /* DTX settings */ #define NB_SPEECH_FRAMES_BEFORE_DTX 10 /* eq 200 ms */ #define MAX_CONSECUTIVE_DTX 20 /* eq 400 ms */ +#define DTX_ACTIVITY_THRESHOLD 0.1f + +/* VAD decision */ +#define VAD_NO_DECISION -1 +#define VAD_NO_ACTIVITY 0 +#define VAD_ACTIVITY 1 /* Maximum sampling frequency */ #define MAX_FS_KHZ 16 @@ -147,7 +152,7 @@ extern "C" #define USE_HARM_SHAPING 1 /* Max LPC order of noise shaping filters */ -#define MAX_SHAPE_LPC_ORDER 16 +#define MAX_SHAPE_LPC_ORDER 24 #define HARM_SHAPE_FIR_TAPS 3 @@ -157,8 +162,7 @@ extern "C" #define LTP_BUF_LENGTH 512 #define LTP_MASK ( LTP_BUF_LENGTH - 1 ) -#define DECISION_DELAY 32 -#define DECISION_DELAY_MASK ( DECISION_DELAY - 1 ) +#define DECISION_DELAY 40 /* Number of subframes for excitation entropy coding */ #define SHELL_CODEC_FRAME_LENGTH 16 @@ -173,11 +177,7 @@ extern "C" #define MAX_MATRIX_SIZE MAX_LPC_ORDER /* Max of LPC Order and LTP order */ -#if( MAX_LPC_ORDER > DECISION_DELAY ) # define NSQ_LPC_BUF_LENGTH MAX_LPC_ORDER -#else -# define NSQ_LPC_BUF_LENGTH DECISION_DELAY -#endif /***************************/ /* Voice activity detector */ @@ -205,7 +205,6 @@ extern "C" /******************/ #define NLSF_W_Q 2 #define NLSF_VQ_MAX_VECTORS 32 -#define NLSF_VQ_MAX_SURVIVORS 32 #define NLSF_QUANT_MAX_AMPLITUDE 4 #define NLSF_QUANT_MAX_AMPLITUDE_EXT 10 #define NLSF_QUANT_LEVEL_ADJ 0.1 diff --git a/thirdparty/opus/silk/enc_API.c b/thirdparty/opus/silk/enc_API.c index f8060286db..55a33f37e9 100644 --- a/thirdparty/opus/silk/enc_API.c +++ b/thirdparty/opus/silk/enc_API.c @@ -82,7 +82,7 @@ opus_int silk_InitEncoder( /* O Returns error co silk_memset( psEnc, 0, sizeof( silk_encoder ) ); for( n = 0; n < ENCODER_NUM_CHANNELS; n++ ) { if( ret += silk_init_encoder( &psEnc->state_Fxx[ n ], arch ) ) { - silk_assert( 0 ); + celt_assert( 0 ); } } @@ -91,7 +91,7 @@ opus_int silk_InitEncoder( /* O Returns error co /* Read control structure */ if( ret += silk_QueryEncoder( encState, encStatus ) ) { - silk_assert( 0 ); + celt_assert( 0 ); } return ret; @@ -144,7 +144,8 @@ opus_int silk_Encode( /* O Returns error co opus_int nSamplesIn, /* I Number of samples in input vector */ ec_enc *psRangeEnc, /* I/O Compressor data structure */ opus_int32 *nBytesOut, /* I/O Number of bytes in payload (input: Max bytes) */ - const opus_int prefillFlag /* I Flag to indicate prefilling buffers no coding */ + const opus_int prefillFlag, /* I Flag to indicate prefilling buffers no coding */ + opus_int activity /* I Decision of Opus voice activity detector */ ) { opus_int n, i, nBits, flags, tmp_payloadSize_ms = 0, tmp_complexity = 0, ret = 0; @@ -166,7 +167,7 @@ opus_int silk_Encode( /* O Returns error co /* Check values in encoder control structure */ if( ( ret = check_control_input( encControl ) ) != 0 ) { - silk_assert( 0 ); + celt_assert( 0 ); RESTORE_STACK; return ret; } @@ -199,16 +200,26 @@ opus_int silk_Encode( /* O Returns error co tot_blocks = ( nBlocksOf10ms > 1 ) ? nBlocksOf10ms >> 1 : 1; curr_block = 0; if( prefillFlag ) { + silk_LP_state save_LP; /* Only accept input length of 10 ms */ if( nBlocksOf10ms != 1 ) { - silk_assert( 0 ); + celt_assert( 0 ); RESTORE_STACK; return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES; } + if ( prefillFlag == 2 ) { + save_LP = psEnc->state_Fxx[ 0 ].sCmn.sLP; + /* Save the sampling rate so the bandwidth switching code can keep handling transitions. */ + save_LP.saved_fs_kHz = psEnc->state_Fxx[ 0 ].sCmn.fs_kHz; + } /* Reset Encoder */ for( n = 0; n < encControl->nChannelsInternal; n++ ) { ret = silk_init_encoder( &psEnc->state_Fxx[ n ], psEnc->state_Fxx[ n ].sCmn.arch ); - silk_assert( !ret ); + /* Restore the variable LP state. */ + if ( prefillFlag == 2 ) { + psEnc->state_Fxx[ n ].sCmn.sLP = save_LP; + } + celt_assert( !ret ); } tmp_payloadSize_ms = encControl->payloadSize_ms; encControl->payloadSize_ms = 10; @@ -221,23 +232,22 @@ opus_int silk_Encode( /* O Returns error co } else { /* Only accept input lengths that are a multiple of 10 ms */ if( nBlocksOf10ms * encControl->API_sampleRate != 100 * nSamplesIn || nSamplesIn < 0 ) { - silk_assert( 0 ); + celt_assert( 0 ); RESTORE_STACK; return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES; } /* Make sure no more than one packet can be produced */ if( 1000 * (opus_int32)nSamplesIn > encControl->payloadSize_ms * encControl->API_sampleRate ) { - silk_assert( 0 ); + celt_assert( 0 ); RESTORE_STACK; return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES; } } - TargetRate_bps = silk_RSHIFT32( encControl->bitRate, encControl->nChannelsInternal - 1 ); for( n = 0; n < encControl->nChannelsInternal; n++ ) { /* Force the side channel to the same rate as the mid */ opus_int force_fs_kHz = (n==1) ? psEnc->state_Fxx[0].sCmn.fs_kHz : 0; - if( ( ret = silk_control_encoder( &psEnc->state_Fxx[ n ], encControl, TargetRate_bps, psEnc->allowBandwidthSwitch, n, force_fs_kHz ) ) != 0 ) { + if( ( ret = silk_control_encoder( &psEnc->state_Fxx[ n ], encControl, psEnc->allowBandwidthSwitch, n, force_fs_kHz ) ) != 0 ) { silk_assert( 0 ); RESTORE_STACK; return ret; @@ -249,7 +259,7 @@ opus_int silk_Encode( /* O Returns error co } psEnc->state_Fxx[ n ].sCmn.inDTX = psEnc->state_Fxx[ n ].sCmn.useDTX; } - silk_assert( encControl->nChannelsInternal == 1 || psEnc->state_Fxx[ 0 ].sCmn.fs_kHz == psEnc->state_Fxx[ 1 ].sCmn.fs_kHz ); + celt_assert( encControl->nChannelsInternal == 1 || psEnc->state_Fxx[ 0 ].sCmn.fs_kHz == psEnc->state_Fxx[ 1 ].sCmn.fs_kHz ); /* Input buffering/resampling and encoding */ nSamplesToBufferMax = @@ -307,7 +317,7 @@ opus_int silk_Encode( /* O Returns error co } psEnc->state_Fxx[ 0 ].sCmn.inputBufIx += nSamplesToBuffer; } else { - silk_assert( encControl->nChannelsAPI == 1 && encControl->nChannelsInternal == 1 ); + celt_assert( encControl->nChannelsAPI == 1 && encControl->nChannelsInternal == 1 ); silk_memcpy(buf, samplesIn, nSamplesFromInput*sizeof(opus_int16)); ret += silk_resampler( &psEnc->state_Fxx[ 0 ].sCmn.resampler_state, &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ psEnc->state_Fxx[ 0 ].sCmn.inputBufIx + 2 ], buf, nSamplesFromInput ); @@ -323,8 +333,8 @@ opus_int silk_Encode( /* O Returns error co /* Silk encoder */ if( psEnc->state_Fxx[ 0 ].sCmn.inputBufIx >= psEnc->state_Fxx[ 0 ].sCmn.frame_length ) { /* Enough data in input buffer, so encode */ - silk_assert( psEnc->state_Fxx[ 0 ].sCmn.inputBufIx == psEnc->state_Fxx[ 0 ].sCmn.frame_length ); - silk_assert( encControl->nChannelsInternal == 1 || psEnc->state_Fxx[ 1 ].sCmn.inputBufIx == psEnc->state_Fxx[ 1 ].sCmn.frame_length ); + celt_assert( psEnc->state_Fxx[ 0 ].sCmn.inputBufIx == psEnc->state_Fxx[ 0 ].sCmn.frame_length ); + celt_assert( encControl->nChannelsInternal == 1 || psEnc->state_Fxx[ 1 ].sCmn.inputBufIx == psEnc->state_Fxx[ 1 ].sCmn.frame_length ); /* Deal with LBRR data */ if( psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded == 0 && !prefillFlag ) { @@ -416,7 +426,6 @@ opus_int silk_Encode( /* O Returns error co /* Reset side channel encoder memory for first frame with side coding */ if( psEnc->prev_decode_only_middle == 1 ) { silk_memset( &psEnc->state_Fxx[ 1 ].sShape, 0, sizeof( psEnc->state_Fxx[ 1 ].sShape ) ); - silk_memset( &psEnc->state_Fxx[ 1 ].sPrefilt, 0, sizeof( psEnc->state_Fxx[ 1 ].sPrefilt ) ); silk_memset( &psEnc->state_Fxx[ 1 ].sCmn.sNSQ, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.sNSQ ) ); silk_memset( psEnc->state_Fxx[ 1 ].sCmn.prev_NLSFq_Q15, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.prev_NLSFq_Q15 ) ); silk_memset( &psEnc->state_Fxx[ 1 ].sCmn.sLP.In_LP_State, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.sLP.In_LP_State ) ); @@ -427,7 +436,7 @@ opus_int silk_Encode( /* O Returns error co psEnc->state_Fxx[ 1 ].sCmn.sNSQ.prev_gain_Q16 = 65536; psEnc->state_Fxx[ 1 ].sCmn.first_frame_after_reset = 1; } - silk_encode_do_VAD_Fxx( &psEnc->state_Fxx[ 1 ] ); + silk_encode_do_VAD_Fxx( &psEnc->state_Fxx[ 1 ], activity ); } else { psEnc->state_Fxx[ 1 ].sCmn.VAD_flags[ psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded ] = 0; } @@ -442,7 +451,7 @@ opus_int silk_Encode( /* O Returns error co silk_memcpy( psEnc->state_Fxx[ 0 ].sCmn.inputBuf, psEnc->sStereo.sMid, 2 * sizeof( opus_int16 ) ); silk_memcpy( psEnc->sStereo.sMid, &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ psEnc->state_Fxx[ 0 ].sCmn.frame_length ], 2 * sizeof( opus_int16 ) ); } - silk_encode_do_VAD_Fxx( &psEnc->state_Fxx[ 0 ] ); + silk_encode_do_VAD_Fxx( &psEnc->state_Fxx[ 0 ], activity ); /* Encode */ for( n = 0; n < encControl->nChannelsInternal; n++ ) { @@ -557,6 +566,10 @@ opus_int silk_Encode( /* O Returns error co } } + encControl->signalType = psEnc->state_Fxx[0].sCmn.indices.signalType; + encControl->offset = silk_Quantization_Offsets_Q10 + [ psEnc->state_Fxx[0].sCmn.indices.signalType >> 1 ] + [ psEnc->state_Fxx[0].sCmn.indices.quantOffsetType ]; RESTORE_STACK; return ret; } diff --git a/thirdparty/opus/silk/encode_indices.c b/thirdparty/opus/silk/encode_indices.c index 666c8c0b13..4bcbc3347b 100644 --- a/thirdparty/opus/silk/encode_indices.c +++ b/thirdparty/opus/silk/encode_indices.c @@ -56,8 +56,8 @@ void silk_encode_indices( /* Encode signal type and quantizer offset */ /*******************************************/ typeOffset = 2 * psIndices->signalType + psIndices->quantOffsetType; - silk_assert( typeOffset >= 0 && typeOffset < 6 ); - silk_assert( encode_LBRR == 0 || typeOffset >= 2 ); + celt_assert( typeOffset >= 0 && typeOffset < 6 ); + celt_assert( encode_LBRR == 0 || typeOffset >= 2 ); if( encode_LBRR || typeOffset >= 2 ) { ec_enc_icdf( psRangeEnc, typeOffset - 2, silk_type_offset_VAD_iCDF, 8 ); } else { @@ -90,7 +90,7 @@ void silk_encode_indices( /****************/ ec_enc_icdf( psRangeEnc, psIndices->NLSFIndices[ 0 ], &psEncC->psNLSF_CB->CB1_iCDF[ ( psIndices->signalType >> 1 ) * psEncC->psNLSF_CB->nVectors ], 8 ); silk_NLSF_unpack( ec_ix, pred_Q8, psEncC->psNLSF_CB, psIndices->NLSFIndices[ 0 ] ); - silk_assert( psEncC->psNLSF_CB->order == psEncC->predictLPCOrder ); + celt_assert( psEncC->psNLSF_CB->order == psEncC->predictLPCOrder ); for( i = 0; i < psEncC->psNLSF_CB->order; i++ ) { if( psIndices->NLSFIndices[ i+1 ] >= NLSF_QUANT_MAX_AMPLITUDE ) { ec_enc_icdf( psRangeEnc, 2 * NLSF_QUANT_MAX_AMPLITUDE, &psEncC->psNLSF_CB->ec_iCDF[ ec_ix[ i ] ], 8 ); diff --git a/thirdparty/opus/silk/encode_pulses.c b/thirdparty/opus/silk/encode_pulses.c index ab00264f99..8a1999138b 100644 --- a/thirdparty/opus/silk/encode_pulses.c +++ b/thirdparty/opus/silk/encode_pulses.c @@ -86,7 +86,7 @@ void silk_encode_pulses( silk_assert( 1 << LOG2_SHELL_CODEC_FRAME_LENGTH == SHELL_CODEC_FRAME_LENGTH ); iter = silk_RSHIFT( frame_length, LOG2_SHELL_CODEC_FRAME_LENGTH ); if( iter * SHELL_CODEC_FRAME_LENGTH < frame_length ) { - silk_assert( frame_length == 12 * 10 ); /* Make sure only happens for 10 ms @ 12 kHz */ + celt_assert( frame_length == 12 * 10 ); /* Make sure only happens for 10 ms @ 12 kHz */ iter++; silk_memset( &pulses[ frame_length ], 0, SHELL_CODEC_FRAME_LENGTH * sizeof(opus_int8)); } diff --git a/thirdparty/opus/silk/fixed/apply_sine_window_FIX.c b/thirdparty/opus/silk/fixed/apply_sine_window_FIX.c index 4502b7130e..03e088a6de 100644 --- a/thirdparty/opus/silk/fixed/apply_sine_window_FIX.c +++ b/thirdparty/opus/silk/fixed/apply_sine_window_FIX.c @@ -57,15 +57,15 @@ void silk_apply_sine_window( opus_int k, f_Q16, c_Q16; opus_int32 S0_Q16, S1_Q16; - silk_assert( win_type == 1 || win_type == 2 ); + celt_assert( win_type == 1 || win_type == 2 ); /* Length must be in a range from 16 to 120 and a multiple of 4 */ - silk_assert( length >= 16 && length <= 120 ); - silk_assert( ( length & 3 ) == 0 ); + celt_assert( length >= 16 && length <= 120 ); + celt_assert( ( length & 3 ) == 0 ); /* Frequency */ k = ( length >> 2 ) - 4; - silk_assert( k >= 0 && k <= 26 ); + celt_assert( k >= 0 && k <= 26 ); f_Q16 = (opus_int)freq_table_Q16[ k ]; /* Factor used for cosine approximation */ diff --git a/thirdparty/opus/silk/fixed/arm/warped_autocorrelation_FIX_arm.h b/thirdparty/opus/silk/fixed/arm/warped_autocorrelation_FIX_arm.h new file mode 100644 index 0000000000..1992e43288 --- /dev/null +++ b/thirdparty/opus/silk/fixed/arm/warped_autocorrelation_FIX_arm.h @@ -0,0 +1,68 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SILK_WARPED_AUTOCORRELATION_FIX_ARM_H +# define SILK_WARPED_AUTOCORRELATION_FIX_ARM_H + +# include "celt/arm/armcpu.h" + +# if defined(FIXED_POINT) + +# if defined(OPUS_ARM_MAY_HAVE_NEON_INTR) +void silk_warped_autocorrelation_FIX_neon( + opus_int32 *corr, /* O Result [order + 1] */ + opus_int *scale, /* O Scaling of the correlation vector */ + const opus_int16 *input, /* I Input data to correlate */ + const opus_int warping_Q16, /* I Warping coefficient */ + const opus_int length, /* I Length of input */ + const opus_int order /* I Correlation order (even) */ +); + +# if !defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_PRESUME_NEON) +# define OVERRIDE_silk_warped_autocorrelation_FIX (1) +# define silk_warped_autocorrelation_FIX(corr, scale, input, warping_Q16, length, order, arch) \ + ((void)(arch), PRESUME_NEON(silk_warped_autocorrelation_FIX)(corr, scale, input, warping_Q16, length, order)) +# endif +# endif + +# if !defined(OVERRIDE_silk_warped_autocorrelation_FIX) +/*Is run-time CPU detection enabled on this platform?*/ +# if defined(OPUS_HAVE_RTCD) && (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && !defined(OPUS_ARM_PRESUME_NEON_INTR)) +extern void (*const SILK_WARPED_AUTOCORRELATION_FIX_IMPL[OPUS_ARCHMASK+1])(opus_int32*, opus_int*, const opus_int16*, const opus_int, const opus_int, const opus_int); +# define OVERRIDE_silk_warped_autocorrelation_FIX (1) +# define silk_warped_autocorrelation_FIX(corr, scale, input, warping_Q16, length, order, arch) \ + ((*SILK_WARPED_AUTOCORRELATION_FIX_IMPL[(arch)&OPUS_ARCHMASK])(corr, scale, input, warping_Q16, length, order)) +# elif defined(OPUS_ARM_PRESUME_NEON_INTR) +# define OVERRIDE_silk_warped_autocorrelation_FIX (1) +# define silk_warped_autocorrelation_FIX(corr, scale, input, warping_Q16, length, order, arch) \ + ((void)(arch), silk_warped_autocorrelation_FIX_neon(corr, scale, input, warping_Q16, length, order)) +# endif +# endif + +# endif /* end FIXED_POINT */ + +#endif /* end SILK_WARPED_AUTOCORRELATION_FIX_ARM_H */ diff --git a/thirdparty/opus/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c b/thirdparty/opus/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c new file mode 100644 index 0000000000..00a70cb51f --- /dev/null +++ b/thirdparty/opus/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c @@ -0,0 +1,260 @@ +/*********************************************************************** +Copyright (c) 2017 Google Inc., Jean-Marc Valin +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <arm_neon.h> +#ifdef OPUS_CHECK_ASM +# include <string.h> +#endif +#include "stack_alloc.h" +#include "main_FIX.h" + +static OPUS_INLINE void calc_corr( const opus_int32 *const input_QS, opus_int64 *const corr_QC, const opus_int offset, const int32x4_t state_QS_s32x4 ) +{ + int64x2_t corr_QC_s64x2[ 2 ], t_s64x2[ 2 ]; + const int32x4_t input_QS_s32x4 = vld1q_s32( input_QS + offset ); + corr_QC_s64x2[ 0 ] = vld1q_s64( corr_QC + offset + 0 ); + corr_QC_s64x2[ 1 ] = vld1q_s64( corr_QC + offset + 2 ); + t_s64x2[ 0 ] = vmull_s32( vget_low_s32( state_QS_s32x4 ), vget_low_s32( input_QS_s32x4 ) ); + t_s64x2[ 1 ] = vmull_s32( vget_high_s32( state_QS_s32x4 ), vget_high_s32( input_QS_s32x4 ) ); + corr_QC_s64x2[ 0 ] = vsraq_n_s64( corr_QC_s64x2[ 0 ], t_s64x2[ 0 ], 2 * QS - QC ); + corr_QC_s64x2[ 1 ] = vsraq_n_s64( corr_QC_s64x2[ 1 ], t_s64x2[ 1 ], 2 * QS - QC ); + vst1q_s64( corr_QC + offset + 0, corr_QC_s64x2[ 0 ] ); + vst1q_s64( corr_QC + offset + 2, corr_QC_s64x2[ 1 ] ); +} + +static OPUS_INLINE int32x4_t calc_state( const int32x4_t state_QS0_s32x4, const int32x4_t state_QS0_1_s32x4, const int32x4_t state_QS1_1_s32x4, const int32x4_t warping_Q16_s32x4 ) +{ + int32x4_t t_s32x4 = vsubq_s32( state_QS0_s32x4, state_QS0_1_s32x4 ); + t_s32x4 = vqdmulhq_s32( t_s32x4, warping_Q16_s32x4 ); + return vaddq_s32( state_QS1_1_s32x4, t_s32x4 ); +} + +void silk_warped_autocorrelation_FIX_neon( + opus_int32 *corr, /* O Result [order + 1] */ + opus_int *scale, /* O Scaling of the correlation vector */ + const opus_int16 *input, /* I Input data to correlate */ + const opus_int warping_Q16, /* I Warping coefficient */ + const opus_int length, /* I Length of input */ + const opus_int order /* I Correlation order (even) */ +) +{ + if( ( MAX_SHAPE_LPC_ORDER > 24 ) || ( order < 6 ) ) { + silk_warped_autocorrelation_FIX_c( corr, scale, input, warping_Q16, length, order ); + } else { + opus_int n, i, lsh; + opus_int64 corr_QC[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; /* In reverse order */ + opus_int64 corr_QC_orderT; + int64x2_t lsh_s64x2; + const opus_int orderT = ( order + 3 ) & ~3; + opus_int64 *corr_QCT; + opus_int32 *input_QS; + VARDECL( opus_int32, input_QST ); + VARDECL( opus_int32, state ); + SAVE_STACK; + + /* Order must be even */ + silk_assert( ( order & 1 ) == 0 ); + silk_assert( 2 * QS - QC >= 0 ); + + ALLOC( input_QST, length + 2 * MAX_SHAPE_LPC_ORDER, opus_int32 ); + + input_QS = input_QST; + /* input_QS has zero paddings in the beginning and end. */ + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + + /* Loop over samples */ + for( n = 0; n < length - 7; n += 8, input_QS += 8 ) { + const int16x8_t t0_s16x4 = vld1q_s16( input + n ); + vst1q_s32( input_QS + 0, vshll_n_s16( vget_low_s16( t0_s16x4 ), QS ) ); + vst1q_s32( input_QS + 4, vshll_n_s16( vget_high_s16( t0_s16x4 ), QS ) ); + } + for( ; n < length; n++, input_QS++ ) { + input_QS[ 0 ] = silk_LSHIFT32( (opus_int32)input[ n ], QS ); + } + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS += 4; + vst1q_s32( input_QS, vdupq_n_s32( 0 ) ); + input_QS = input_QST + MAX_SHAPE_LPC_ORDER - orderT; + + /* The following loop runs ( length + order ) times, with ( order ) extra epilogues. */ + /* The zero paddings in input_QS guarantee corr_QC's correctness even with the extra epilogues. */ + /* The values of state_QS will be polluted by the extra epilogues, however they are temporary values. */ + + /* Keep the C code here to help understand the intrinsics optimization. */ + /* + { + opus_int32 state_QS[ 2 ][ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; + opus_int32 *state_QST[ 3 ]; + state_QST[ 0 ] = state_QS[ 0 ]; + state_QST[ 1 ] = state_QS[ 1 ]; + for( n = 0; n < length + order; n++, input_QS++ ) { + state_QST[ 0 ][ orderT ] = input_QS[ orderT ]; + for( i = 0; i < orderT; i++ ) { + corr_QC[ i ] += silk_RSHIFT64( silk_SMULL( state_QST[ 0 ][ i ], input_QS[ i ] ), 2 * QS - QC ); + state_QST[ 1 ][ i ] = silk_SMLAWB( state_QST[ 1 ][ i + 1 ], state_QST[ 0 ][ i ] - state_QST[ 0 ][ i + 1 ], warping_Q16 ); + } + state_QST[ 2 ] = state_QST[ 0 ]; + state_QST[ 0 ] = state_QST[ 1 ]; + state_QST[ 1 ] = state_QST[ 2 ]; + } + } + */ + + { + const int32x4_t warping_Q16_s32x4 = vdupq_n_s32( warping_Q16 << 15 ); + const opus_int32 *in = input_QS + orderT; + opus_int o = orderT; + int32x4_t state_QS_s32x4[ 3 ][ 2 ]; + + ALLOC( state, length + orderT, opus_int32 ); + state_QS_s32x4[ 2 ][ 1 ] = vdupq_n_s32( 0 ); + + /* Calculate 8 taps of all inputs in each loop. */ + do { + state_QS_s32x4[ 0 ][ 0 ] = state_QS_s32x4[ 0 ][ 1 ] = + state_QS_s32x4[ 1 ][ 0 ] = state_QS_s32x4[ 1 ][ 1 ] = vdupq_n_s32( 0 ); + n = 0; + do { + calc_corr( input_QS + n, corr_QC, o - 8, state_QS_s32x4[ 0 ][ 0 ] ); + calc_corr( input_QS + n, corr_QC, o - 4, state_QS_s32x4[ 0 ][ 1 ] ); + state_QS_s32x4[ 2 ][ 1 ] = vld1q_s32( in + n ); + vst1q_lane_s32( state + n, state_QS_s32x4[ 0 ][ 0 ], 0 ); + state_QS_s32x4[ 2 ][ 0 ] = vextq_s32( state_QS_s32x4[ 0 ][ 0 ], state_QS_s32x4[ 0 ][ 1 ], 1 ); + state_QS_s32x4[ 2 ][ 1 ] = vextq_s32( state_QS_s32x4[ 0 ][ 1 ], state_QS_s32x4[ 2 ][ 1 ], 1 ); + state_QS_s32x4[ 0 ][ 0 ] = calc_state( state_QS_s32x4[ 0 ][ 0 ], state_QS_s32x4[ 2 ][ 0 ], state_QS_s32x4[ 1 ][ 0 ], warping_Q16_s32x4 ); + state_QS_s32x4[ 0 ][ 1 ] = calc_state( state_QS_s32x4[ 0 ][ 1 ], state_QS_s32x4[ 2 ][ 1 ], state_QS_s32x4[ 1 ][ 1 ], warping_Q16_s32x4 ); + state_QS_s32x4[ 1 ][ 0 ] = state_QS_s32x4[ 2 ][ 0 ]; + state_QS_s32x4[ 1 ][ 1 ] = state_QS_s32x4[ 2 ][ 1 ]; + } while( ++n < ( length + order ) ); + in = state; + o -= 8; + } while( o > 4 ); + + if( o ) { + /* Calculate the last 4 taps of all inputs. */ + opus_int32 *stateT = state; + silk_assert( o == 4 ); + state_QS_s32x4[ 0 ][ 0 ] = state_QS_s32x4[ 1 ][ 0 ] = vdupq_n_s32( 0 ); + n = length + order; + do { + calc_corr( input_QS, corr_QC, 0, state_QS_s32x4[ 0 ][ 0 ] ); + state_QS_s32x4[ 2 ][ 0 ] = vld1q_s32( stateT ); + vst1q_lane_s32( stateT, state_QS_s32x4[ 0 ][ 0 ], 0 ); + state_QS_s32x4[ 2 ][ 0 ] = vextq_s32( state_QS_s32x4[ 0 ][ 0 ], state_QS_s32x4[ 2 ][ 0 ], 1 ); + state_QS_s32x4[ 0 ][ 0 ] = calc_state( state_QS_s32x4[ 0 ][ 0 ], state_QS_s32x4[ 2 ][ 0 ], state_QS_s32x4[ 1 ][ 0 ], warping_Q16_s32x4 ); + state_QS_s32x4[ 1 ][ 0 ] = state_QS_s32x4[ 2 ][ 0 ]; + input_QS++; + stateT++; + } while( --n ); + } + } + + { + const opus_int16 *inputT = input; + int32x4_t t_s32x4; + int64x1_t t_s64x1; + int64x2_t t_s64x2 = vdupq_n_s64( 0 ); + for( n = 0; n <= length - 8; n += 8 ) { + int16x8_t input_s16x8 = vld1q_s16( inputT ); + t_s32x4 = vmull_s16( vget_low_s16( input_s16x8 ), vget_low_s16( input_s16x8 ) ); + t_s32x4 = vmlal_s16( t_s32x4, vget_high_s16( input_s16x8 ), vget_high_s16( input_s16x8 ) ); + t_s64x2 = vaddw_s32( t_s64x2, vget_low_s32( t_s32x4 ) ); + t_s64x2 = vaddw_s32( t_s64x2, vget_high_s32( t_s32x4 ) ); + inputT += 8; + } + t_s64x1 = vadd_s64( vget_low_s64( t_s64x2 ), vget_high_s64( t_s64x2 ) ); + corr_QC_orderT = vget_lane_s64( t_s64x1, 0 ); + for( ; n < length; n++ ) { + corr_QC_orderT += silk_SMULL( input[ n ], input[ n ] ); + } + corr_QC_orderT = silk_LSHIFT64( corr_QC_orderT, QC ); + corr_QC[ orderT ] = corr_QC_orderT; + } + + corr_QCT = corr_QC + orderT - order; + lsh = silk_CLZ64( corr_QC_orderT ) - 35; + lsh = silk_LIMIT( lsh, -12 - QC, 30 - QC ); + *scale = -( QC + lsh ); + silk_assert( *scale >= -30 && *scale <= 12 ); + lsh_s64x2 = vdupq_n_s64( lsh ); + for( i = 0; i <= order - 3; i += 4 ) { + int32x4_t corr_s32x4; + int64x2_t corr_QC0_s64x2, corr_QC1_s64x2; + corr_QC0_s64x2 = vld1q_s64( corr_QCT + i ); + corr_QC1_s64x2 = vld1q_s64( corr_QCT + i + 2 ); + corr_QC0_s64x2 = vshlq_s64( corr_QC0_s64x2, lsh_s64x2 ); + corr_QC1_s64x2 = vshlq_s64( corr_QC1_s64x2, lsh_s64x2 ); + corr_s32x4 = vcombine_s32( vmovn_s64( corr_QC1_s64x2 ), vmovn_s64( corr_QC0_s64x2 ) ); + corr_s32x4 = vrev64q_s32( corr_s32x4 ); + vst1q_s32( corr + order - i - 3, corr_s32x4 ); + } + if( lsh >= 0 ) { + for( ; i < order + 1; i++ ) { + corr[ order - i ] = (opus_int32)silk_CHECK_FIT32( silk_LSHIFT64( corr_QCT[ i ], lsh ) ); + } + } else { + for( ; i < order + 1; i++ ) { + corr[ order - i ] = (opus_int32)silk_CHECK_FIT32( silk_RSHIFT64( corr_QCT[ i ], -lsh ) ); + } + } + silk_assert( corr_QCT[ order ] >= 0 ); /* If breaking, decrease QC*/ + RESTORE_STACK; + } + +#ifdef OPUS_CHECK_ASM + { + opus_int32 corr_c[ MAX_SHAPE_LPC_ORDER + 1 ]; + opus_int scale_c; + silk_warped_autocorrelation_FIX_c( corr_c, &scale_c, input, warping_Q16, length, order ); + silk_assert( !memcmp( corr_c, corr, sizeof( corr_c[ 0 ] ) * ( order + 1 ) ) ); + silk_assert( scale_c == *scale ); + } +#endif +} diff --git a/thirdparty/opus/silk/fixed/burg_modified_FIX.c b/thirdparty/opus/silk/fixed/burg_modified_FIX.c index 17d0e0993c..274d4b28e1 100644 --- a/thirdparty/opus/silk/fixed/burg_modified_FIX.c +++ b/thirdparty/opus/silk/fixed/burg_modified_FIX.c @@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE. #define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384 */ #define QA 25 -#define N_BITS_HEAD_ROOM 2 +#define N_BITS_HEAD_ROOM 3 #define MIN_RSHIFTS -16 #define MAX_RSHIFTS (32 - QA) @@ -65,7 +65,7 @@ void silk_burg_modified_c( opus_int32 xcorr[ SILK_MAX_ORDER_LPC ]; opus_int64 C0_64; - silk_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); + celt_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); /* Compute autocorrelations, added over subframes */ C0_64 = silk_inner_prod16_aligned_64( x, x, subfr_length*nb_subfr, arch ); diff --git a/thirdparty/opus/silk/fixed/corrMatrix_FIX.c b/thirdparty/opus/silk/fixed/corrMatrix_FIX.c index c1d437c785..1b4a29c232 100644 --- a/thirdparty/opus/silk/fixed/corrMatrix_FIX.c +++ b/thirdparty/opus/silk/fixed/corrMatrix_FIX.c @@ -58,7 +58,7 @@ void silk_corrVector_FIX( for( lag = 0; lag < order; lag++ ) { inner_prod = 0; for( i = 0; i < L; i++ ) { - inner_prod += silk_RSHIFT32( silk_SMULBB( ptr1[ i ], ptr2[i] ), rshifts ); + inner_prod = silk_ADD_RSHIFT32( inner_prod, silk_SMULBB( ptr1[ i ], ptr2[i] ), rshifts ); } Xt[ lag ] = inner_prod; /* X[:,lag]'*t */ ptr1--; /* Go to next column of X */ @@ -77,61 +77,54 @@ void silk_corrMatrix_FIX( const opus_int16 *x, /* I x vector [L + order - 1] used to form data matrix X */ const opus_int L, /* I Length of vectors */ const opus_int order, /* I Max lag for correlation */ - const opus_int head_room, /* I Desired headroom */ opus_int32 *XX, /* O Pointer to X'*X correlation matrix [ order x order ] */ - opus_int *rshifts, /* I/O Right shifts of correlations */ + opus_int32 *nrg, /* O Energy of x vector */ + opus_int *rshifts, /* O Right shifts of correlations and energy */ int arch /* I Run-time architecture */ ) { - opus_int i, j, lag, rshifts_local, head_room_rshifts; + opus_int i, j, lag; opus_int32 energy; const opus_int16 *ptr1, *ptr2; /* Calculate energy to find shift used to fit in 32 bits */ - silk_sum_sqr_shift( &energy, &rshifts_local, x, L + order - 1 ); - /* Add shifts to get the desired head room */ - head_room_rshifts = silk_max( head_room - silk_CLZ32( energy ), 0 ); - - energy = silk_RSHIFT32( energy, head_room_rshifts ); - rshifts_local += head_room_rshifts; + silk_sum_sqr_shift( nrg, rshifts, x, L + order - 1 ); + energy = *nrg; /* Calculate energy of first column (0) of X: X[:,0]'*X[:,0] */ /* Remove contribution of first order - 1 samples */ for( i = 0; i < order - 1; i++ ) { - energy -= silk_RSHIFT32( silk_SMULBB( x[ i ], x[ i ] ), rshifts_local ); - } - if( rshifts_local < *rshifts ) { - /* Adjust energy */ - energy = silk_RSHIFT32( energy, *rshifts - rshifts_local ); - rshifts_local = *rshifts; + energy -= silk_RSHIFT32( silk_SMULBB( x[ i ], x[ i ] ), *rshifts ); } /* Calculate energy of remaining columns of X: X[:,j]'*X[:,j] */ /* Fill out the diagonal of the correlation matrix */ matrix_ptr( XX, 0, 0, order ) = energy; + silk_assert( energy >= 0 ); ptr1 = &x[ order - 1 ]; /* First sample of column 0 of X */ for( j = 1; j < order; j++ ) { - energy = silk_SUB32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ L - j ], ptr1[ L - j ] ), rshifts_local ) ); - energy = silk_ADD32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ -j ], ptr1[ -j ] ), rshifts_local ) ); + energy = silk_SUB32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ L - j ], ptr1[ L - j ] ), *rshifts ) ); + energy = silk_ADD32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ -j ], ptr1[ -j ] ), *rshifts ) ); matrix_ptr( XX, j, j, order ) = energy; + silk_assert( energy >= 0 ); } ptr2 = &x[ order - 2 ]; /* First sample of column 1 of X */ /* Calculate the remaining elements of the correlation matrix */ - if( rshifts_local > 0 ) { + if( *rshifts > 0 ) { /* Right shifting used */ for( lag = 1; lag < order; lag++ ) { /* Inner product of column 0 and column lag: X[:,0]'*X[:,lag] */ energy = 0; for( i = 0; i < L; i++ ) { - energy += silk_RSHIFT32( silk_SMULBB( ptr1[ i ], ptr2[i] ), rshifts_local ); + energy += silk_RSHIFT32( silk_SMULBB( ptr1[ i ], ptr2[i] ), *rshifts ); } /* Calculate remaining off diagonal: X[:,j]'*X[:,j + lag] */ matrix_ptr( XX, lag, 0, order ) = energy; matrix_ptr( XX, 0, lag, order ) = energy; for( j = 1; j < ( order - lag ); j++ ) { - energy = silk_SUB32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ L - j ], ptr2[ L - j ] ), rshifts_local ) ); - energy = silk_ADD32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ -j ], ptr2[ -j ] ), rshifts_local ) ); + energy = silk_SUB32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ L - j ], ptr2[ L - j ] ), *rshifts ) ); + energy = silk_ADD32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ -j ], ptr2[ -j ] ), *rshifts ) ); matrix_ptr( XX, lag + j, j, order ) = energy; matrix_ptr( XX, j, lag + j, order ) = energy; } @@ -153,6 +146,5 @@ void silk_corrMatrix_FIX( ptr2--;/* Update pointer to first sample of next column (lag) in X */ } } - *rshifts = rshifts_local; } diff --git a/thirdparty/opus/silk/fixed/encode_frame_FIX.c b/thirdparty/opus/silk/fixed/encode_frame_FIX.c index 5ef44b03fc..a02bf87dbb 100644 --- a/thirdparty/opus/silk/fixed/encode_frame_FIX.c +++ b/thirdparty/opus/silk/fixed/encode_frame_FIX.c @@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "config.h" #endif +#include <stdlib.h> #include "main_FIX.h" #include "stack_alloc.h" #include "tuning_parameters.h" @@ -37,26 +38,33 @@ POSSIBILITY OF SUCH DAMAGE. static OPUS_INLINE void silk_LBRR_encode_FIX( silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */ silk_encoder_control_FIX *psEncCtrl, /* I/O Pointer to Silk FIX encoder control struct */ - const opus_int32 xfw_Q3[], /* I Input signal */ + const opus_int16 x16[], /* I Input signal */ opus_int condCoding /* I The type of conditional coding used so far for this frame */ ); void silk_encode_do_VAD_FIX( - silk_encoder_state_FIX *psEnc /* I/O Pointer to Silk FIX encoder state */ + silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */ + opus_int activity /* I Decision of Opus voice activity detector */ ) { + const opus_int activity_threshold = SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ); + /****************************/ /* Voice Activity Detection */ /****************************/ silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.arch ); + /* If Opus VAD is inactive and Silk VAD is active: lower Silk VAD to just under the threshold */ + if( activity == VAD_NO_ACTIVITY && psEnc->sCmn.speech_activity_Q8 >= activity_threshold ) { + psEnc->sCmn.speech_activity_Q8 = activity_threshold - 1; + } /**************************************************/ /* Convert speech activity into VAD and DTX flags */ /**************************************************/ - if( psEnc->sCmn.speech_activity_Q8 < SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ) ) { + if( psEnc->sCmn.speech_activity_Q8 < activity_threshold ) { psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY; psEnc->sCmn.noSpeechCounter++; - if( psEnc->sCmn.noSpeechCounter < NB_SPEECH_FRAMES_BEFORE_DTX ) { + if( psEnc->sCmn.noSpeechCounter <= NB_SPEECH_FRAMES_BEFORE_DTX ) { psEnc->sCmn.inDTX = 0; } else if( psEnc->sCmn.noSpeechCounter > MAX_CONSECUTIVE_DTX + NB_SPEECH_FRAMES_BEFORE_DTX ) { psEnc->sCmn.noSpeechCounter = NB_SPEECH_FRAMES_BEFORE_DTX; @@ -94,6 +102,9 @@ opus_int silk_encode_frame_FIX( opus_int16 ec_prevLagIndex_copy; opus_int ec_prevSignalType_copy; opus_int8 LastGainIndex_copy2; + opus_int gain_lock[ MAX_NB_SUBFR ] = {0}; + opus_int16 best_gain_mult[ MAX_NB_SUBFR ]; + opus_int best_sum[ MAX_NB_SUBFR ]; SAVE_STACK; /* This is totally unnecessary but many compilers (including gcc) are too dumb to realise it */ @@ -118,7 +129,6 @@ opus_int silk_encode_frame_FIX( silk_memcpy( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length * sizeof( opus_int16 ) ); if( !psEnc->sCmn.prefillFlag ) { - VARDECL( opus_int32, xfw_Q3 ); VARDECL( opus_int16, res_pitch ); VARDECL( opus_uint8, ec_buf_copy ); opus_int16 *res_pitch_frame; @@ -132,7 +142,7 @@ opus_int silk_encode_frame_FIX( /*****************************************/ /* Find pitch lags, initial LPC analysis */ /*****************************************/ - silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame, psEnc->sCmn.arch ); + silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame - psEnc->sCmn.ltp_mem_length, psEnc->sCmn.arch ); /************************/ /* Noise shape analysis */ @@ -142,23 +152,17 @@ opus_int silk_encode_frame_FIX( /***************************************************/ /* Find linear prediction coefficients (LPC + LTP) */ /***************************************************/ - silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding ); + silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame, condCoding ); /****************************************/ /* Process gains */ /****************************************/ silk_process_gains_FIX( psEnc, &sEncCtrl, condCoding ); - /*****************************************/ - /* Prefiltering for noise shaper */ - /*****************************************/ - ALLOC( xfw_Q3, psEnc->sCmn.frame_length, opus_int32 ); - silk_prefilter_FIX( psEnc, &sEncCtrl, xfw_Q3, x_frame ); - /****************************************/ /* Low Bitrate Redundant Encoding */ /****************************************/ - silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw_Q3, condCoding ); + silk_LBRR_encode_FIX( psEnc, &sEncCtrl, x_frame, condCoding ); /* Loop over quantizer and entropy coding to control bitrate */ maxIter = 6; @@ -194,17 +198,21 @@ opus_int silk_encode_frame_FIX( /* Noise shaping quantization */ /*****************************************/ if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) { - silk_NSQ_del_dec( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw_Q3, psEnc->sCmn.pulses, - sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14, + silk_NSQ_del_dec( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, x_frame, psEnc->sCmn.pulses, + sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR_Q13, sEncCtrl.HarmShapeGain_Q14, sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.pitchL, sEncCtrl.Lambda_Q10, sEncCtrl.LTP_scale_Q14, psEnc->sCmn.arch ); } else { - silk_NSQ( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw_Q3, psEnc->sCmn.pulses, - sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14, + silk_NSQ( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, x_frame, psEnc->sCmn.pulses, + sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR_Q13, sEncCtrl.HarmShapeGain_Q14, sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.pitchL, sEncCtrl.Lambda_Q10, sEncCtrl.LTP_scale_Q14, psEnc->sCmn.arch); } + if ( iter == maxIter && !found_lower ) { + silk_memcpy( &sRangeEnc_copy2, psRangeEnc, sizeof( ec_enc ) ); + } + /****************************************/ /* Encode Parameters */ /****************************************/ @@ -218,6 +226,33 @@ opus_int silk_encode_frame_FIX( nBits = ec_tell( psRangeEnc ); + /* If we still bust after the last iteration, do some damage control. */ + if ( iter == maxIter && !found_lower && nBits > maxBits ) { + silk_memcpy( psRangeEnc, &sRangeEnc_copy2, sizeof( ec_enc ) ); + + /* Keep gains the same as the last frame. */ + psEnc->sShape.LastGainIndex = sEncCtrl.lastGainIndexPrev; + for ( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { + psEnc->sCmn.indices.GainsIndices[ i ] = 4; + } + if (condCoding != CODE_CONDITIONALLY) { + psEnc->sCmn.indices.GainsIndices[ 0 ] = sEncCtrl.lastGainIndexPrev; + } + psEnc->sCmn.ec_prevLagIndex = ec_prevLagIndex_copy; + psEnc->sCmn.ec_prevSignalType = ec_prevSignalType_copy; + /* Clear all pulses. */ + for ( i = 0; i < psEnc->sCmn.frame_length; i++ ) { + psEnc->sCmn.pulses[ i ] = 0; + } + + silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesEncoded, 0, condCoding ); + + silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType, + psEnc->sCmn.pulses, psEnc->sCmn.frame_length ); + + nBits = ec_tell( psRangeEnc ); + } + if( useCBR == 0 && iter == 0 && nBits <= maxBits ) { break; } @@ -227,7 +262,7 @@ opus_int silk_encode_frame_FIX( if( found_lower && ( gainsID == gainsID_lower || nBits > maxBits ) ) { /* Restore output state from earlier iteration that did meet the bitrate budget */ silk_memcpy( psRangeEnc, &sRangeEnc_copy2, sizeof( ec_enc ) ); - silk_assert( sRangeEnc_copy2.offs <= 1275 ); + celt_assert( sRangeEnc_copy2.offs <= 1275 ); silk_memcpy( psRangeEnc->buf, ec_buf_copy, sRangeEnc_copy2.offs ); silk_memcpy( &psEnc->sCmn.sNSQ, &sNSQ_copy2, sizeof( silk_nsq_state ) ); psEnc->sShape.LastGainIndex = LastGainIndex_copy2; @@ -255,7 +290,7 @@ opus_int silk_encode_frame_FIX( gainsID_lower = gainsID; /* Copy part of the output state */ silk_memcpy( &sRangeEnc_copy2, psRangeEnc, sizeof( ec_enc ) ); - silk_assert( psRangeEnc->offs <= 1275 ); + celt_assert( psRangeEnc->offs <= 1275 ); silk_memcpy( ec_buf_copy, psRangeEnc->buf, psRangeEnc->offs ); silk_memcpy( &sNSQ_copy2, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) ); LastGainIndex_copy2 = psEnc->sShape.LastGainIndex; @@ -265,15 +300,35 @@ opus_int silk_encode_frame_FIX( break; } + if ( !found_lower && nBits > maxBits ) { + int j; + for ( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { + int sum=0; + for ( j = i*psEnc->sCmn.subfr_length; j < (i+1)*psEnc->sCmn.subfr_length; j++ ) { + sum += abs( psEnc->sCmn.pulses[j] ); + } + if ( iter == 0 || (sum < best_sum[i] && !gain_lock[i]) ) { + best_sum[i] = sum; + best_gain_mult[i] = gainMult_Q8; + } else { + gain_lock[i] = 1; + } + } + } if( ( found_lower & found_upper ) == 0 ) { /* Adjust gain according to high-rate rate/distortion curve */ - opus_int32 gain_factor_Q16; - gain_factor_Q16 = silk_log2lin( silk_LSHIFT( nBits - maxBits, 7 ) / psEnc->sCmn.frame_length + SILK_FIX_CONST( 16, 7 ) ); - gain_factor_Q16 = silk_min_32( gain_factor_Q16, SILK_FIX_CONST( 2, 16 ) ); if( nBits > maxBits ) { - gain_factor_Q16 = silk_max_32( gain_factor_Q16, SILK_FIX_CONST( 1.3, 16 ) ); + if (gainMult_Q8 < 16384) { + gainMult_Q8 *= 2; + } else { + gainMult_Q8 = 32767; + } + } else { + opus_int32 gain_factor_Q16; + gain_factor_Q16 = silk_log2lin( silk_LSHIFT( nBits - maxBits, 7 ) / psEnc->sCmn.frame_length + SILK_FIX_CONST( 16, 7 ) ); + gainMult_Q8 = silk_SMULWB( gain_factor_Q16, gainMult_Q8 ); } - gainMult_Q8 = silk_SMULWB( gain_factor_Q16, gainMult_Q8 ); + } else { /* Adjust gain by interpolating */ gainMult_Q8 = gainMult_lower + silk_DIV32_16( silk_MUL( gainMult_upper - gainMult_lower, maxBits - nBits_lower ), nBits_upper - nBits_lower ); @@ -287,7 +342,13 @@ opus_int silk_encode_frame_FIX( } for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { - sEncCtrl.Gains_Q16[ i ] = silk_LSHIFT_SAT32( silk_SMULWB( sEncCtrl.GainsUnq_Q16[ i ], gainMult_Q8 ), 8 ); + opus_int16 tmp; + if ( gain_lock[i] ) { + tmp = best_gain_mult[i]; + } else { + tmp = gainMult_Q8; + } + sEncCtrl.Gains_Q16[ i ] = silk_LSHIFT_SAT32( silk_SMULWB( sEncCtrl.GainsUnq_Q16[ i ], tmp ), 8 ); } /* Quantize gains */ @@ -331,7 +392,7 @@ opus_int silk_encode_frame_FIX( static OPUS_INLINE void silk_LBRR_encode_FIX( silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */ silk_encoder_control_FIX *psEncCtrl, /* I/O Pointer to Silk FIX encoder control struct */ - const opus_int32 xfw_Q3[], /* I Input signal */ + const opus_int16 x16[], /* I Input signal */ opus_int condCoding /* I The type of conditional coding used so far for this frame */ ) { @@ -370,14 +431,14 @@ static OPUS_INLINE void silk_LBRR_encode_FIX( /* Noise shaping quantization */ /*****************************************/ if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) { - silk_NSQ_del_dec( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, xfw_Q3, + silk_NSQ_del_dec( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, x16, psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14, - psEncCtrl->AR2_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14, + psEncCtrl->AR_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14, psEncCtrl->Gains_Q16, psEncCtrl->pitchL, psEncCtrl->Lambda_Q10, psEncCtrl->LTP_scale_Q14, psEnc->sCmn.arch ); } else { - silk_NSQ( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, xfw_Q3, + silk_NSQ( &psEnc->sCmn, &sNSQ_LBRR, psIndices_LBRR, x16, psEnc->sCmn.pulses_LBRR[ psEnc->sCmn.nFramesEncoded ], psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14, - psEncCtrl->AR2_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14, + psEncCtrl->AR_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14, psEncCtrl->Gains_Q16, psEncCtrl->pitchL, psEncCtrl->Lambda_Q10, psEncCtrl->LTP_scale_Q14, psEnc->sCmn.arch ); } diff --git a/thirdparty/opus/silk/fixed/find_LPC_FIX.c b/thirdparty/opus/silk/fixed/find_LPC_FIX.c index e11cdc86e6..c762a0f2a2 100644 --- a/thirdparty/opus/silk/fixed/find_LPC_FIX.c +++ b/thirdparty/opus/silk/fixed/find_LPC_FIX.c @@ -92,7 +92,7 @@ void silk_find_LPC_FIX( silk_interpolate( NLSF0_Q15, psEncC->prev_NLSFq_Q15, NLSF_Q15, k, psEncC->predictLPCOrder ); /* Convert to LPC for residual energy evaluation */ - silk_NLSF2A( a_tmp_Q12, NLSF0_Q15, psEncC->predictLPCOrder ); + silk_NLSF2A( a_tmp_Q12, NLSF0_Q15, psEncC->predictLPCOrder, psEncC->arch ); /* Calculate residual energy with NLSF interpolation */ silk_LPC_analysis_filter( LPC_res, x, a_tmp_Q12, 2 * subfr_length, psEncC->predictLPCOrder, psEncC->arch ); @@ -146,6 +146,6 @@ void silk_find_LPC_FIX( silk_A2NLSF( NLSF_Q15, a_Q16, psEncC->predictLPCOrder ); } - silk_assert( psEncC->indices.NLSFInterpCoef_Q2 == 4 || ( psEncC->useInterpolatedNLSFs && !psEncC->first_frame_after_reset && psEncC->nb_subfr == MAX_NB_SUBFR ) ); + celt_assert( psEncC->indices.NLSFInterpCoef_Q2 == 4 || ( psEncC->useInterpolatedNLSFs && !psEncC->first_frame_after_reset && psEncC->nb_subfr == MAX_NB_SUBFR ) ); RESTORE_STACK; } diff --git a/thirdparty/opus/silk/fixed/find_LTP_FIX.c b/thirdparty/opus/silk/fixed/find_LTP_FIX.c index 1314a28137..62d4afb250 100644 --- a/thirdparty/opus/silk/fixed/find_LTP_FIX.c +++ b/thirdparty/opus/silk/fixed/find_LTP_FIX.c @@ -32,214 +32,68 @@ POSSIBILITY OF SUCH DAMAGE. #include "main_FIX.h" #include "tuning_parameters.h" -/* Head room for correlations */ -#define LTP_CORRS_HEAD_ROOM 2 - -void silk_fit_LTP( - opus_int32 LTP_coefs_Q16[ LTP_ORDER ], - opus_int16 LTP_coefs_Q14[ LTP_ORDER ] -); - void silk_find_LTP_FIX( - opus_int16 b_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ - opus_int32 WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ - opus_int *LTPredCodGain_Q7, /* O LTP coding gain */ - const opus_int16 r_lpc[], /* I residual signal after LPC signal + state for first 10 ms */ + opus_int32 XXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Correlation matrix */ + opus_int32 xXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER ], /* O Correlation vector */ + const opus_int16 r_ptr[], /* I Residual signal after LPC */ const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ - const opus_int32 Wght_Q15[ MAX_NB_SUBFR ], /* I weights */ - const opus_int subfr_length, /* I subframe length */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int mem_offset, /* I number of samples in LTP memory */ - opus_int corr_rshifts[ MAX_NB_SUBFR ], /* O right shifts applied to correlations */ + const opus_int subfr_length, /* I Subframe length */ + const opus_int nb_subfr, /* I Number of subframes */ int arch /* I Run-time architecture */ ) { - opus_int i, k, lshift; - const opus_int16 *r_ptr, *lag_ptr; - opus_int16 *b_Q14_ptr; - - opus_int32 regu; - opus_int32 *WLTP_ptr; - opus_int32 b_Q16[ LTP_ORDER ], delta_b_Q14[ LTP_ORDER ], d_Q14[ MAX_NB_SUBFR ], nrg[ MAX_NB_SUBFR ], g_Q26; - opus_int32 w[ MAX_NB_SUBFR ], WLTP_max, max_abs_d_Q14, max_w_bits; - - opus_int32 temp32, denom32; - opus_int extra_shifts; - opus_int rr_shifts, maxRshifts, maxRshifts_wxtra, LZs; - opus_int32 LPC_res_nrg, LPC_LTP_res_nrg, div_Q16; - opus_int32 Rr[ LTP_ORDER ], rr[ MAX_NB_SUBFR ]; - opus_int32 wd, m_Q12; - - b_Q14_ptr = b_Q14; - WLTP_ptr = WLTP; - r_ptr = &r_lpc[ mem_offset ]; + opus_int i, k, extra_shifts; + opus_int xx_shifts, xX_shifts, XX_shifts; + const opus_int16 *lag_ptr; + opus_int32 *XXLTP_Q17_ptr, *xXLTP_Q17_ptr; + opus_int32 xx, nrg, temp; + + xXLTP_Q17_ptr = xXLTP_Q17; + XXLTP_Q17_ptr = XXLTP_Q17; for( k = 0; k < nb_subfr; k++ ) { lag_ptr = r_ptr - ( lag[ k ] + LTP_ORDER / 2 ); - silk_sum_sqr_shift( &rr[ k ], &rr_shifts, r_ptr, subfr_length ); /* rr[ k ] in Q( -rr_shifts ) */ - - /* Assure headroom */ - LZs = silk_CLZ32( rr[k] ); - if( LZs < LTP_CORRS_HEAD_ROOM ) { - rr[ k ] = silk_RSHIFT_ROUND( rr[ k ], LTP_CORRS_HEAD_ROOM - LZs ); - rr_shifts += ( LTP_CORRS_HEAD_ROOM - LZs ); - } - corr_rshifts[ k ] = rr_shifts; - silk_corrMatrix_FIX( lag_ptr, subfr_length, LTP_ORDER, LTP_CORRS_HEAD_ROOM, WLTP_ptr, &corr_rshifts[ k ], arch ); /* WLTP_fix_ptr in Q( -corr_rshifts[ k ] ) */ - - /* The correlation vector always has lower max abs value than rr and/or RR so head room is assured */ - silk_corrVector_FIX( lag_ptr, r_ptr, subfr_length, LTP_ORDER, Rr, corr_rshifts[ k ], arch ); /* Rr_fix_ptr in Q( -corr_rshifts[ k ] ) */ - if( corr_rshifts[ k ] > rr_shifts ) { - rr[ k ] = silk_RSHIFT( rr[ k ], corr_rshifts[ k ] - rr_shifts ); /* rr[ k ] in Q( -corr_rshifts[ k ] ) */ + silk_sum_sqr_shift( &xx, &xx_shifts, r_ptr, subfr_length + LTP_ORDER ); /* xx in Q( -xx_shifts ) */ + silk_corrMatrix_FIX( lag_ptr, subfr_length, LTP_ORDER, XXLTP_Q17_ptr, &nrg, &XX_shifts, arch ); /* XXLTP_Q17_ptr and nrg in Q( -XX_shifts ) */ + extra_shifts = xx_shifts - XX_shifts; + if( extra_shifts > 0 ) { + /* Shift XX */ + xX_shifts = xx_shifts; + for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) { + XXLTP_Q17_ptr[ i ] = silk_RSHIFT32( XXLTP_Q17_ptr[ i ], extra_shifts ); /* Q( -xX_shifts ) */ + } + nrg = silk_RSHIFT32( nrg, extra_shifts ); /* Q( -xX_shifts ) */ + } else if( extra_shifts < 0 ) { + /* Shift xx */ + xX_shifts = XX_shifts; + xx = silk_RSHIFT32( xx, -extra_shifts ); /* Q( -xX_shifts ) */ + } else { + xX_shifts = xx_shifts; } - silk_assert( rr[ k ] >= 0 ); - - regu = 1; - regu = silk_SMLAWB( regu, rr[ k ], SILK_FIX_CONST( LTP_DAMPING/3, 16 ) ); - regu = silk_SMLAWB( regu, matrix_ptr( WLTP_ptr, 0, 0, LTP_ORDER ), SILK_FIX_CONST( LTP_DAMPING/3, 16 ) ); - regu = silk_SMLAWB( regu, matrix_ptr( WLTP_ptr, LTP_ORDER-1, LTP_ORDER-1, LTP_ORDER ), SILK_FIX_CONST( LTP_DAMPING/3, 16 ) ); - silk_regularize_correlations_FIX( WLTP_ptr, &rr[k], regu, LTP_ORDER ); - - silk_solve_LDL_FIX( WLTP_ptr, LTP_ORDER, Rr, b_Q16 ); /* WLTP_fix_ptr and Rr_fix_ptr both in Q(-corr_rshifts[k]) */ - - /* Limit and store in Q14 */ - silk_fit_LTP( b_Q16, b_Q14_ptr ); - - /* Calculate residual energy */ - nrg[ k ] = silk_residual_energy16_covar_FIX( b_Q14_ptr, WLTP_ptr, Rr, rr[ k ], LTP_ORDER, 14 ); /* nrg_fix in Q( -corr_rshifts[ k ] ) */ - - /* temp = Wght[ k ] / ( nrg[ k ] * Wght[ k ] + 0.01f * subfr_length ); */ - extra_shifts = silk_min_int( corr_rshifts[ k ], LTP_CORRS_HEAD_ROOM ); - denom32 = silk_LSHIFT_SAT32( silk_SMULWB( nrg[ k ], Wght_Q15[ k ] ), 1 + extra_shifts ) + /* Q( -corr_rshifts[ k ] + extra_shifts ) */ - silk_RSHIFT( silk_SMULWB( (opus_int32)subfr_length, 655 ), corr_rshifts[ k ] - extra_shifts ); /* Q( -corr_rshifts[ k ] + extra_shifts ) */ - denom32 = silk_max( denom32, 1 ); - silk_assert( ((opus_int64)Wght_Q15[ k ] << 16 ) < silk_int32_MAX ); /* Wght always < 0.5 in Q0 */ - temp32 = silk_DIV32( silk_LSHIFT( (opus_int32)Wght_Q15[ k ], 16 ), denom32 ); /* Q( 15 + 16 + corr_rshifts[k] - extra_shifts ) */ - temp32 = silk_RSHIFT( temp32, 31 + corr_rshifts[ k ] - extra_shifts - 26 ); /* Q26 */ + silk_corrVector_FIX( lag_ptr, r_ptr, subfr_length, LTP_ORDER, xXLTP_Q17_ptr, xX_shifts, arch ); /* xXLTP_Q17_ptr in Q( -xX_shifts ) */ - /* Limit temp such that the below scaling never wraps around */ - WLTP_max = 0; + /* At this point all correlations are in Q(-xX_shifts) */ + temp = silk_SMLAWB( 1, nrg, SILK_FIX_CONST( LTP_CORR_INV_MAX, 16 ) ); + temp = silk_max( temp, xx ); +TIC(div) +#if 0 for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) { - WLTP_max = silk_max( WLTP_ptr[ i ], WLTP_max ); + XXLTP_Q17_ptr[ i ] = silk_DIV32_varQ( XXLTP_Q17_ptr[ i ], temp, 17 ); } - lshift = silk_CLZ32( WLTP_max ) - 1 - 3; /* keep 3 bits free for vq_nearest_neighbor_fix */ - silk_assert( 26 - 18 + lshift >= 0 ); - if( 26 - 18 + lshift < 31 ) { - temp32 = silk_min_32( temp32, silk_LSHIFT( (opus_int32)1, 26 - 18 + lshift ) ); - } - - silk_scale_vector32_Q26_lshift_18( WLTP_ptr, temp32, LTP_ORDER * LTP_ORDER ); /* WLTP_ptr in Q( 18 - corr_rshifts[ k ] ) */ - - w[ k ] = matrix_ptr( WLTP_ptr, LTP_ORDER/2, LTP_ORDER/2, LTP_ORDER ); /* w in Q( 18 - corr_rshifts[ k ] ) */ - silk_assert( w[k] >= 0 ); - - r_ptr += subfr_length; - b_Q14_ptr += LTP_ORDER; - WLTP_ptr += LTP_ORDER * LTP_ORDER; - } - - maxRshifts = 0; - for( k = 0; k < nb_subfr; k++ ) { - maxRshifts = silk_max_int( corr_rshifts[ k ], maxRshifts ); - } - - /* Compute LTP coding gain */ - if( LTPredCodGain_Q7 != NULL ) { - LPC_LTP_res_nrg = 0; - LPC_res_nrg = 0; - silk_assert( LTP_CORRS_HEAD_ROOM >= 2 ); /* Check that no overflow will happen when adding */ - for( k = 0; k < nb_subfr; k++ ) { - LPC_res_nrg = silk_ADD32( LPC_res_nrg, silk_RSHIFT( silk_ADD32( silk_SMULWB( rr[ k ], Wght_Q15[ k ] ), 1 ), 1 + ( maxRshifts - corr_rshifts[ k ] ) ) ); /* Q( -maxRshifts ) */ - LPC_LTP_res_nrg = silk_ADD32( LPC_LTP_res_nrg, silk_RSHIFT( silk_ADD32( silk_SMULWB( nrg[ k ], Wght_Q15[ k ] ), 1 ), 1 + ( maxRshifts - corr_rshifts[ k ] ) ) ); /* Q( -maxRshifts ) */ - } - LPC_LTP_res_nrg = silk_max( LPC_LTP_res_nrg, 1 ); /* avoid division by zero */ - - div_Q16 = silk_DIV32_varQ( LPC_res_nrg, LPC_LTP_res_nrg, 16 ); - *LTPredCodGain_Q7 = ( opus_int )silk_SMULBB( 3, silk_lin2log( div_Q16 ) - ( 16 << 7 ) ); - - silk_assert( *LTPredCodGain_Q7 == ( opus_int )silk_SAT16( silk_MUL( 3, silk_lin2log( div_Q16 ) - ( 16 << 7 ) ) ) ); - } - - /* smoothing */ - /* d = sum( B, 1 ); */ - b_Q14_ptr = b_Q14; - for( k = 0; k < nb_subfr; k++ ) { - d_Q14[ k ] = 0; for( i = 0; i < LTP_ORDER; i++ ) { - d_Q14[ k ] += b_Q14_ptr[ i ]; - } - b_Q14_ptr += LTP_ORDER; - } - - /* m = ( w * d' ) / ( sum( w ) + 1e-3 ); */ - - /* Find maximum absolute value of d_Q14 and the bits used by w in Q0 */ - max_abs_d_Q14 = 0; - max_w_bits = 0; - for( k = 0; k < nb_subfr; k++ ) { - max_abs_d_Q14 = silk_max_32( max_abs_d_Q14, silk_abs( d_Q14[ k ] ) ); - /* w[ k ] is in Q( 18 - corr_rshifts[ k ] ) */ - /* Find bits needed in Q( 18 - maxRshifts ) */ - max_w_bits = silk_max_32( max_w_bits, 32 - silk_CLZ32( w[ k ] ) + corr_rshifts[ k ] - maxRshifts ); - } - - /* max_abs_d_Q14 = (5 << 15); worst case, i.e. LTP_ORDER * -silk_int16_MIN */ - silk_assert( max_abs_d_Q14 <= ( 5 << 15 ) ); - - /* How many bits is needed for w*d' in Q( 18 - maxRshifts ) in the worst case, of all d_Q14's being equal to max_abs_d_Q14 */ - extra_shifts = max_w_bits + 32 - silk_CLZ32( max_abs_d_Q14 ) - 14; - - /* Subtract what we got available; bits in output var plus maxRshifts */ - extra_shifts -= ( 32 - 1 - 2 + maxRshifts ); /* Keep sign bit free as well as 2 bits for accumulation */ - extra_shifts = silk_max_int( extra_shifts, 0 ); - - maxRshifts_wxtra = maxRshifts + extra_shifts; - - temp32 = silk_RSHIFT( 262, maxRshifts + extra_shifts ) + 1; /* 1e-3f in Q( 18 - (maxRshifts + extra_shifts) ) */ - wd = 0; - for( k = 0; k < nb_subfr; k++ ) { - /* w has at least 2 bits of headroom so no overflow should happen */ - temp32 = silk_ADD32( temp32, silk_RSHIFT( w[ k ], maxRshifts_wxtra - corr_rshifts[ k ] ) ); /* Q( 18 - maxRshifts_wxtra ) */ - wd = silk_ADD32( wd, silk_LSHIFT( silk_SMULWW( silk_RSHIFT( w[ k ], maxRshifts_wxtra - corr_rshifts[ k ] ), d_Q14[ k ] ), 2 ) ); /* Q( 18 - maxRshifts_wxtra ) */ - } - m_Q12 = silk_DIV32_varQ( wd, temp32, 12 ); - - b_Q14_ptr = b_Q14; - for( k = 0; k < nb_subfr; k++ ) { - /* w_fix[ k ] from Q( 18 - corr_rshifts[ k ] ) to Q( 16 ) */ - if( 2 - corr_rshifts[k] > 0 ) { - temp32 = silk_RSHIFT( w[ k ], 2 - corr_rshifts[ k ] ); - } else { - temp32 = silk_LSHIFT_SAT32( w[ k ], corr_rshifts[ k ] - 2 ); + xXLTP_Q17_ptr[ i ] = silk_DIV32_varQ( xXLTP_Q17_ptr[ i ], temp, 17 ); } - - g_Q26 = silk_MUL( - silk_DIV32( - SILK_FIX_CONST( LTP_SMOOTHING, 26 ), - silk_RSHIFT( SILK_FIX_CONST( LTP_SMOOTHING, 26 ), 10 ) + temp32 ), /* Q10 */ - silk_LSHIFT_SAT32( silk_SUB_SAT32( (opus_int32)m_Q12, silk_RSHIFT( d_Q14[ k ], 2 ) ), 4 ) ); /* Q16 */ - - temp32 = 0; - for( i = 0; i < LTP_ORDER; i++ ) { - delta_b_Q14[ i ] = silk_max_16( b_Q14_ptr[ i ], 1638 ); /* 1638_Q14 = 0.1_Q0 */ - temp32 += delta_b_Q14[ i ]; /* Q14 */ +#else + for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) { + XXLTP_Q17_ptr[ i ] = (opus_int32)( silk_LSHIFT64( (opus_int64)XXLTP_Q17_ptr[ i ], 17 ) / temp ); } - temp32 = silk_DIV32( g_Q26, temp32 ); /* Q14 -> Q12 */ for( i = 0; i < LTP_ORDER; i++ ) { - b_Q14_ptr[ i ] = silk_LIMIT_32( (opus_int32)b_Q14_ptr[ i ] + silk_SMULWB( silk_LSHIFT_SAT32( temp32, 4 ), delta_b_Q14[ i ] ), -16000, 28000 ); + xXLTP_Q17_ptr[ i ] = (opus_int32)( silk_LSHIFT64( (opus_int64)xXLTP_Q17_ptr[ i ], 17 ) / temp ); } - b_Q14_ptr += LTP_ORDER; - } -} - -void silk_fit_LTP( - opus_int32 LTP_coefs_Q16[ LTP_ORDER ], - opus_int16 LTP_coefs_Q14[ LTP_ORDER ] -) -{ - opus_int i; - - for( i = 0; i < LTP_ORDER; i++ ) { - LTP_coefs_Q14[ i ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( LTP_coefs_Q16[ i ], 2 ) ); +#endif +TOC(div) + r_ptr += subfr_length; + XXLTP_Q17_ptr += LTP_ORDER * LTP_ORDER; + xXLTP_Q17_ptr += LTP_ORDER; } } diff --git a/thirdparty/opus/silk/fixed/find_pitch_lags_FIX.c b/thirdparty/opus/silk/fixed/find_pitch_lags_FIX.c index b8440a8247..6c3379f2bb 100644 --- a/thirdparty/opus/silk/fixed/find_pitch_lags_FIX.c +++ b/thirdparty/opus/silk/fixed/find_pitch_lags_FIX.c @@ -44,7 +44,7 @@ void silk_find_pitch_lags_FIX( { opus_int buf_len, i, scale; opus_int32 thrhld_Q13, res_nrg; - const opus_int16 *x_buf, *x_buf_ptr; + const opus_int16 *x_ptr; VARDECL( opus_int16, Wsig ); opus_int16 *Wsig_ptr; opus_int32 auto_corr[ MAX_FIND_PITCH_LPC_ORDER + 1 ]; @@ -59,9 +59,7 @@ void silk_find_pitch_lags_FIX( buf_len = psEnc->sCmn.la_pitch + psEnc->sCmn.frame_length + psEnc->sCmn.ltp_mem_length; /* Safety check */ - silk_assert( buf_len >= psEnc->sCmn.pitch_LPC_win_length ); - - x_buf = x - psEnc->sCmn.ltp_mem_length; + celt_assert( buf_len >= psEnc->sCmn.pitch_LPC_win_length ); /*************************************/ /* Estimate LPC AR coefficients */ @@ -72,19 +70,19 @@ void silk_find_pitch_lags_FIX( ALLOC( Wsig, psEnc->sCmn.pitch_LPC_win_length, opus_int16 ); /* First LA_LTP samples */ - x_buf_ptr = x_buf + buf_len - psEnc->sCmn.pitch_LPC_win_length; + x_ptr = x + buf_len - psEnc->sCmn.pitch_LPC_win_length; Wsig_ptr = Wsig; - silk_apply_sine_window( Wsig_ptr, x_buf_ptr, 1, psEnc->sCmn.la_pitch ); + silk_apply_sine_window( Wsig_ptr, x_ptr, 1, psEnc->sCmn.la_pitch ); /* Middle un - windowed samples */ Wsig_ptr += psEnc->sCmn.la_pitch; - x_buf_ptr += psEnc->sCmn.la_pitch; - silk_memcpy( Wsig_ptr, x_buf_ptr, ( psEnc->sCmn.pitch_LPC_win_length - silk_LSHIFT( psEnc->sCmn.la_pitch, 1 ) ) * sizeof( opus_int16 ) ); + x_ptr += psEnc->sCmn.la_pitch; + silk_memcpy( Wsig_ptr, x_ptr, ( psEnc->sCmn.pitch_LPC_win_length - silk_LSHIFT( psEnc->sCmn.la_pitch, 1 ) ) * sizeof( opus_int16 ) ); /* Last LA_LTP samples */ Wsig_ptr += psEnc->sCmn.pitch_LPC_win_length - silk_LSHIFT( psEnc->sCmn.la_pitch, 1 ); - x_buf_ptr += psEnc->sCmn.pitch_LPC_win_length - silk_LSHIFT( psEnc->sCmn.la_pitch, 1 ); - silk_apply_sine_window( Wsig_ptr, x_buf_ptr, 2, psEnc->sCmn.la_pitch ); + x_ptr += psEnc->sCmn.pitch_LPC_win_length - silk_LSHIFT( psEnc->sCmn.la_pitch, 1 ); + silk_apply_sine_window( Wsig_ptr, x_ptr, 2, psEnc->sCmn.la_pitch ); /* Calculate autocorrelation sequence */ silk_autocorr( auto_corr, &scale, Wsig, psEnc->sCmn.pitch_LPC_win_length, psEnc->sCmn.pitchEstimationLPCOrder + 1, arch ); @@ -112,7 +110,7 @@ void silk_find_pitch_lags_FIX( /*****************************************/ /* LPC analysis filtering */ /*****************************************/ - silk_LPC_analysis_filter( res, x_buf, A_Q12, buf_len, psEnc->sCmn.pitchEstimationLPCOrder, psEnc->sCmn.arch ); + silk_LPC_analysis_filter( res, x, A_Q12, buf_len, psEnc->sCmn.pitchEstimationLPCOrder, psEnc->sCmn.arch ); if( psEnc->sCmn.indices.signalType != TYPE_NO_VOICE_ACTIVITY && psEnc->sCmn.first_frame_after_reset == 0 ) { /* Threshold for pitch estimator */ diff --git a/thirdparty/opus/silk/fixed/find_pred_coefs_FIX.c b/thirdparty/opus/silk/fixed/find_pred_coefs_FIX.c index d308e9cf5f..606d863347 100644 --- a/thirdparty/opus/silk/fixed/find_pred_coefs_FIX.c +++ b/thirdparty/opus/silk/fixed/find_pred_coefs_FIX.c @@ -41,13 +41,12 @@ void silk_find_pred_coefs_FIX( ) { opus_int i; - opus_int32 invGains_Q16[ MAX_NB_SUBFR ], local_gains[ MAX_NB_SUBFR ], Wght_Q15[ MAX_NB_SUBFR ]; + opus_int32 invGains_Q16[ MAX_NB_SUBFR ], local_gains[ MAX_NB_SUBFR ]; opus_int16 NLSF_Q15[ MAX_LPC_ORDER ]; const opus_int16 *x_ptr; opus_int16 *x_pre_ptr; VARDECL( opus_int16, LPC_in_pre ); - opus_int32 tmp, min_gain_Q16, minInvGain_Q30; - opus_int LTP_corrs_rshift[ MAX_NB_SUBFR ]; + opus_int32 min_gain_Q16, minInvGain_Q30; SAVE_STACK; /* weighting for weighted least squares */ @@ -61,13 +60,11 @@ void silk_find_pred_coefs_FIX( /* Invert and normalize gains, and ensure that maximum invGains_Q16 is within range of a 16 bit int */ invGains_Q16[ i ] = silk_DIV32_varQ( min_gain_Q16, psEncCtrl->Gains_Q16[ i ], 16 - 2 ); - /* Ensure Wght_Q15 a minimum value 1 */ - invGains_Q16[ i ] = silk_max( invGains_Q16[ i ], 363 ); + /* Limit inverse */ + invGains_Q16[ i ] = silk_max( invGains_Q16[ i ], 100 ); /* Square the inverted gains */ silk_assert( invGains_Q16[ i ] == silk_SAT16( invGains_Q16[ i ] ) ); - tmp = silk_SMULWB( invGains_Q16[ i ], invGains_Q16[ i ] ); - Wght_Q15[ i ] = silk_RSHIFT( tmp, 1 ); /* Invert the inverted and normalized gains */ local_gains[ i ] = silk_DIV32( ( (opus_int32)1 << 16 ), invGains_Q16[ i ] ); @@ -77,24 +74,24 @@ void silk_find_pred_coefs_FIX( psEnc->sCmn.nb_subfr * psEnc->sCmn.predictLPCOrder + psEnc->sCmn.frame_length, opus_int16 ); if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) { - VARDECL( opus_int32, WLTP ); + VARDECL( opus_int32, xXLTP_Q17 ); + VARDECL( opus_int32, XXLTP_Q17 ); /**********/ /* VOICED */ /**********/ - silk_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 ); + celt_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 ); - ALLOC( WLTP, psEnc->sCmn.nb_subfr * LTP_ORDER * LTP_ORDER, opus_int32 ); + ALLOC( xXLTP_Q17, psEnc->sCmn.nb_subfr * LTP_ORDER, opus_int32 ); + ALLOC( XXLTP_Q17, psEnc->sCmn.nb_subfr * LTP_ORDER * LTP_ORDER, opus_int32 ); /* LTP analysis */ - silk_find_LTP_FIX( psEncCtrl->LTPCoef_Q14, WLTP, &psEncCtrl->LTPredCodGain_Q7, - res_pitch, psEncCtrl->pitchL, Wght_Q15, psEnc->sCmn.subfr_length, - psEnc->sCmn.nb_subfr, psEnc->sCmn.ltp_mem_length, LTP_corrs_rshift, psEnc->sCmn.arch ); + silk_find_LTP_FIX( XXLTP_Q17, xXLTP_Q17, res_pitch, + psEncCtrl->pitchL, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.arch ); /* Quantize LTP gain parameters */ silk_quant_LTP_gains( psEncCtrl->LTPCoef_Q14, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex, - &psEnc->sCmn.sum_log_gain_Q7, WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sCmn.LTPQuantLowComplexity, psEnc->sCmn.nb_subfr, - psEnc->sCmn.arch); + &psEnc->sCmn.sum_log_gain_Q7, &psEncCtrl->LTPredCodGain_Q7, XXLTP_Q17, xXLTP_Q17, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.arch ); /* Control LTP scaling */ silk_LTP_scale_ctrl_FIX( psEnc, psEncCtrl, condCoding ); diff --git a/thirdparty/opus/silk/fixed/k2a_FIX.c b/thirdparty/opus/silk/fixed/k2a_FIX.c index 5fee599bcb..549f6eadaa 100644 --- a/thirdparty/opus/silk/fixed/k2a_FIX.c +++ b/thirdparty/opus/silk/fixed/k2a_FIX.c @@ -39,14 +39,15 @@ void silk_k2a( ) { opus_int k, n; - opus_int32 Atmp[ SILK_MAX_ORDER_LPC ]; + opus_int32 rc, tmp1, tmp2; for( k = 0; k < order; k++ ) { - for( n = 0; n < k; n++ ) { - Atmp[ n ] = A_Q24[ n ]; - } - for( n = 0; n < k; n++ ) { - A_Q24[ n ] = silk_SMLAWB( A_Q24[ n ], silk_LSHIFT( Atmp[ k - n - 1 ], 1 ), rc_Q15[ k ] ); + rc = rc_Q15[ k ]; + for( n = 0; n < (k + 1) >> 1; n++ ) { + tmp1 = A_Q24[ n ]; + tmp2 = A_Q24[ k - n - 1 ]; + A_Q24[ n ] = silk_SMLAWB( tmp1, silk_LSHIFT( tmp2, 1 ), rc ); + A_Q24[ k - n - 1 ] = silk_SMLAWB( tmp2, silk_LSHIFT( tmp1, 1 ), rc ); } A_Q24[ k ] = -silk_LSHIFT( (opus_int32)rc_Q15[ k ], 9 ); } diff --git a/thirdparty/opus/silk/fixed/k2a_Q16_FIX.c b/thirdparty/opus/silk/fixed/k2a_Q16_FIX.c index 3b03987544..1595aa6212 100644 --- a/thirdparty/opus/silk/fixed/k2a_Q16_FIX.c +++ b/thirdparty/opus/silk/fixed/k2a_Q16_FIX.c @@ -39,15 +39,16 @@ void silk_k2a_Q16( ) { opus_int k, n; - opus_int32 Atmp[ SILK_MAX_ORDER_LPC ]; + opus_int32 rc, tmp1, tmp2; for( k = 0; k < order; k++ ) { - for( n = 0; n < k; n++ ) { - Atmp[ n ] = A_Q24[ n ]; + rc = rc_Q16[ k ]; + for( n = 0; n < (k + 1) >> 1; n++ ) { + tmp1 = A_Q24[ n ]; + tmp2 = A_Q24[ k - n - 1 ]; + A_Q24[ n ] = silk_SMLAWW( tmp1, tmp2, rc ); + A_Q24[ k - n - 1 ] = silk_SMLAWW( tmp2, tmp1, rc ); } - for( n = 0; n < k; n++ ) { - A_Q24[ n ] = silk_SMLAWW( A_Q24[ n ], Atmp[ k - n - 1 ], rc_Q16[ k ] ); - } - A_Q24[ k ] = -silk_LSHIFT( rc_Q16[ k ], 8 ); + A_Q24[ k ] = -silk_LSHIFT( rc, 8 ); } } diff --git a/thirdparty/opus/silk/fixed/main_FIX.h b/thirdparty/opus/silk/fixed/main_FIX.h index 375b5eb32e..6d2112e511 100644 --- a/thirdparty/opus/silk/fixed/main_FIX.h +++ b/thirdparty/opus/silk/fixed/main_FIX.h @@ -36,6 +36,11 @@ POSSIBILITY OF SUCH DAMAGE. #include "debug.h" #include "entenc.h" +#if ((defined(OPUS_ARM_ASM) && defined(FIXED_POINT)) \ + || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)) +#include "fixed/arm/warped_autocorrelation_FIX_arm.h" +#endif + #ifndef FORCE_CPP_BUILD #ifdef __cplusplus extern "C" @@ -47,6 +52,9 @@ extern "C" #define silk_encode_do_VAD_Fxx silk_encode_do_VAD_FIX #define silk_encode_frame_Fxx silk_encode_frame_FIX +#define QC 10 +#define QS 13 + /*********************/ /* Encoder Functions */ /*********************/ @@ -58,7 +66,8 @@ void silk_HP_variable_cutoff( /* Encoder main function */ void silk_encode_do_VAD_FIX( - silk_encoder_state_FIX *psEnc /* I/O Pointer to Silk FIX encoder state */ + silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */ + opus_int activity /* I Decision of Opus voice activity detector */ ); /* Encoder main function */ @@ -81,33 +90,11 @@ opus_int silk_init_encoder( opus_int silk_control_encoder( silk_encoder_state_Fxx *psEnc, /* I/O Pointer to Silk encoder state */ silk_EncControlStruct *encControl, /* I Control structure */ - const opus_int32 TargetRate_bps, /* I Target max bitrate (bps) */ const opus_int allow_bw_switch, /* I Flag to allow switching audio bandwidth */ const opus_int channelNb, /* I Channel number */ const opus_int force_fs_kHz ); -/****************/ -/* Prefiltering */ -/****************/ -void silk_prefilter_FIX( - silk_encoder_state_FIX *psEnc, /* I/O Encoder state */ - const silk_encoder_control_FIX *psEncCtrl, /* I Encoder control */ - opus_int32 xw_Q10[], /* O Weighted signal */ - const opus_int16 x[] /* I Speech signal */ -); - -void silk_warped_LPC_analysis_filter_FIX_c( - opus_int32 state[], /* I/O State [order + 1] */ - opus_int32 res_Q2[], /* O Residual signal [length] */ - const opus_int16 coef_Q13[], /* I Coefficients [order] */ - const opus_int16 input[], /* I Input signal [length] */ - const opus_int16 lambda_Q16, /* I Warping factor */ - const opus_int length, /* I Length of input signal */ - const opus_int order /* I Filter order (even) */ -); - - /**************************/ /* Noise shaping analysis */ /**************************/ @@ -121,7 +108,7 @@ void silk_noise_shape_analysis_FIX( ); /* Autocorrelations for a warped frequency axis */ -void silk_warped_autocorrelation_FIX( +void silk_warped_autocorrelation_FIX_c( opus_int32 *corr, /* O Result [order + 1] */ opus_int *scale, /* O Scaling of the correlation vector */ const opus_int16 *input, /* I Input data to correlate */ @@ -130,6 +117,11 @@ void silk_warped_autocorrelation_FIX( const opus_int order /* I Correlation order (even) */ ); +#if !defined(OVERRIDE_silk_warped_autocorrelation_FIX) +#define silk_warped_autocorrelation_FIX(corr, scale, input, warping_Q16, length, order, arch) \ + ((void)(arch), silk_warped_autocorrelation_FIX_c(corr, scale, input, warping_Q16, length, order)) +#endif + /* Calculation of LTP state scaling */ void silk_LTP_scale_ctrl_FIX( silk_encoder_state_FIX *psEnc, /* I/O encoder state */ @@ -168,16 +160,12 @@ void silk_find_LPC_FIX( /* LTP analysis */ void silk_find_LTP_FIX( - opus_int16 b_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ - opus_int32 WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ - opus_int *LTPredCodGain_Q7, /* O LTP coding gain */ - const opus_int16 r_lpc[], /* I residual signal after LPC signal + state for first 10 ms */ + opus_int32 XXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Correlation matrix */ + opus_int32 xXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER ], /* O Correlation vector */ + const opus_int16 r_lpc[], /* I Residual signal after LPC */ const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ - const opus_int32 Wght_Q15[ MAX_NB_SUBFR ], /* I weights */ - const opus_int subfr_length, /* I subframe length */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int mem_offset, /* I number of samples in LTP memory */ - opus_int corr_rshifts[ MAX_NB_SUBFR ], /* O right shifts applied to correlations */ + const opus_int subfr_length, /* I Subframe length */ + const opus_int nb_subfr, /* I Number of subframes */ int arch /* I Run-time architecture */ ); @@ -231,9 +219,9 @@ void silk_corrMatrix_FIX( const opus_int16 *x, /* I x vector [L + order - 1] used to form data matrix X */ const opus_int L, /* I Length of vectors */ const opus_int order, /* I Max lag for correlation */ - const opus_int head_room, /* I Desired headroom */ opus_int32 *XX, /* O Pointer to X'*X correlation matrix [ order x order ] */ - opus_int *rshifts, /* I/O Right shifts of correlations */ + opus_int32 *nrg, /* O Energy of x vector */ + opus_int *rshifts, /* O Right shifts of correlations */ int arch /* I Run-time architecture */ ); @@ -248,22 +236,6 @@ void silk_corrVector_FIX( int arch /* I Run-time architecture */ ); -/* Add noise to matrix diagonal */ -void silk_regularize_correlations_FIX( - opus_int32 *XX, /* I/O Correlation matrices */ - opus_int32 *xx, /* I/O Correlation values */ - opus_int32 noise, /* I Noise to add */ - opus_int D /* I Dimension of XX */ -); - -/* Solves Ax = b, assuming A is symmetric */ -void silk_solve_LDL_FIX( - opus_int32 *A, /* I Pointer to symetric square matrix A */ - opus_int M, /* I Size of matrix */ - const opus_int32 *b, /* I Pointer to b vector */ - opus_int32 *x_Q16 /* O Pointer to x solution vector */ -); - #ifndef FORCE_CPP_BUILD #ifdef __cplusplus } diff --git a/thirdparty/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h b/thirdparty/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h index c30481e437..3999b5bd09 100644 --- a/thirdparty/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h +++ b/thirdparty/opus/silk/fixed/mips/noise_shape_analysis_FIX_mipsr1.h @@ -169,7 +169,7 @@ void silk_noise_shape_analysis_FIX( if( psEnc->sCmn.warping_Q16 > 0 ) { /* Calculate warped auto correlation */ - silk_warped_autocorrelation_FIX( auto_corr, &scale, x_windowed, warping_Q16, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder ); + silk_warped_autocorrelation_FIX( auto_corr, &scale, x_windowed, warping_Q16, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder, arch ); } else { /* Calculate regular auto correlation */ silk_autocorr( auto_corr, &scale, x_windowed, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder + 1, arch ); @@ -224,8 +224,8 @@ void silk_noise_shape_analysis_FIX( silk_bwexpander_32( AR1_Q24, psEnc->sCmn.shapingLPCOrder, BWExp1_Q16 ); /* Ratio of prediction gains, in energy domain */ - pre_nrg_Q30 = silk_LPC_inverse_pred_gain_Q24( AR2_Q24, psEnc->sCmn.shapingLPCOrder ); - nrg = silk_LPC_inverse_pred_gain_Q24( AR1_Q24, psEnc->sCmn.shapingLPCOrder ); + pre_nrg_Q30 = silk_LPC_inverse_pred_gain_Q24( AR2_Q24, psEnc->sCmn.shapingLPCOrder, arch ); + nrg = silk_LPC_inverse_pred_gain_Q24( AR1_Q24, psEnc->sCmn.shapingLPCOrder, arch ); /*psEncCtrl->GainsPre[ k ] = 1.0f - 0.7f * ( 1.0f - pre_nrg / nrg ) = 0.3f + 0.7f * pre_nrg / nrg;*/ pre_nrg_Q30 = silk_LSHIFT32( silk_SMULWB( pre_nrg_Q30, SILK_FIX_CONST( 0.7, 15 ) ), 1 ); diff --git a/thirdparty/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h b/thirdparty/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h deleted file mode 100644 index 21b256885f..0000000000 --- a/thirdparty/opus/silk/fixed/mips/prefilter_FIX_mipsr1.h +++ /dev/null @@ -1,184 +0,0 @@ -/*********************************************************************** -Copyright (c) 2006-2011, Skype Limited. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -- Neither the name of Internet Society, IETF or IETF Trust, nor the -names of specific contributors, may be used to endorse or promote -products derived from this software without specific prior written -permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -***********************************************************************/ -#ifndef __PREFILTER_FIX_MIPSR1_H__ -#define __PREFILTER_FIX_MIPSR1_H__ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main_FIX.h" -#include "stack_alloc.h" -#include "tuning_parameters.h" - -#define OVERRIDE_silk_warped_LPC_analysis_filter_FIX -void silk_warped_LPC_analysis_filter_FIX( - opus_int32 state[], /* I/O State [order + 1] */ - opus_int32 res_Q2[], /* O Residual signal [length] */ - const opus_int16 coef_Q13[], /* I Coefficients [order] */ - const opus_int16 input[], /* I Input signal [length] */ - const opus_int16 lambda_Q16, /* I Warping factor */ - const opus_int length, /* I Length of input signal */ - const opus_int order, /* I Filter order (even) */ - int arch -) -{ - opus_int n, i; - opus_int32 acc_Q11, acc_Q22, tmp1, tmp2, tmp3, tmp4; - opus_int32 state_cur, state_next; - - (void)arch; - - /* Order must be even */ - /* Length must be even */ - - silk_assert( ( order & 1 ) == 0 ); - silk_assert( ( length & 1 ) == 0 ); - - for( n = 0; n < length; n+=2 ) { - /* Output of lowpass section */ - tmp2 = silk_SMLAWB( state[ 0 ], state[ 1 ], lambda_Q16 ); - state_cur = silk_LSHIFT( input[ n ], 14 ); - /* Output of allpass section */ - tmp1 = silk_SMLAWB( state[ 1 ], state[ 2 ] - tmp2, lambda_Q16 ); - state_next = tmp2; - acc_Q11 = silk_RSHIFT( order, 1 ); - acc_Q11 = silk_SMLAWB( acc_Q11, tmp2, coef_Q13[ 0 ] ); - - - /* Output of lowpass section */ - tmp4 = silk_SMLAWB( state_cur, state_next, lambda_Q16 ); - state[ 0 ] = silk_LSHIFT( input[ n+1 ], 14 ); - /* Output of allpass section */ - tmp3 = silk_SMLAWB( state_next, tmp1 - tmp4, lambda_Q16 ); - state[ 1 ] = tmp4; - acc_Q22 = silk_RSHIFT( order, 1 ); - acc_Q22 = silk_SMLAWB( acc_Q22, tmp4, coef_Q13[ 0 ] ); - - /* Loop over allpass sections */ - for( i = 2; i < order; i += 2 ) { - /* Output of allpass section */ - tmp2 = silk_SMLAWB( state[ i ], state[ i + 1 ] - tmp1, lambda_Q16 ); - state_cur = tmp1; - acc_Q11 = silk_SMLAWB( acc_Q11, tmp1, coef_Q13[ i - 1 ] ); - /* Output of allpass section */ - tmp1 = silk_SMLAWB( state[ i + 1 ], state[ i + 2 ] - tmp2, lambda_Q16 ); - state_next = tmp2; - acc_Q11 = silk_SMLAWB( acc_Q11, tmp2, coef_Q13[ i ] ); - - - /* Output of allpass section */ - tmp4 = silk_SMLAWB( state_cur, state_next - tmp3, lambda_Q16 ); - state[ i ] = tmp3; - acc_Q22 = silk_SMLAWB( acc_Q22, tmp3, coef_Q13[ i - 1 ] ); - /* Output of allpass section */ - tmp3 = silk_SMLAWB( state_next, tmp1 - tmp4, lambda_Q16 ); - state[ i + 1 ] = tmp4; - acc_Q22 = silk_SMLAWB( acc_Q22, tmp4, coef_Q13[ i ] ); - } - acc_Q11 = silk_SMLAWB( acc_Q11, tmp1, coef_Q13[ order - 1 ] ); - res_Q2[ n ] = silk_LSHIFT( (opus_int32)input[ n ], 2 ) - silk_RSHIFT_ROUND( acc_Q11, 9 ); - - state[ order ] = tmp3; - acc_Q22 = silk_SMLAWB( acc_Q22, tmp3, coef_Q13[ order - 1 ] ); - res_Q2[ n+1 ] = silk_LSHIFT( (opus_int32)input[ n+1 ], 2 ) - silk_RSHIFT_ROUND( acc_Q22, 9 ); - } -} - - - -/* Prefilter for finding Quantizer input signal */ -#define OVERRIDE_silk_prefilt_FIX -static inline void silk_prefilt_FIX( - silk_prefilter_state_FIX *P, /* I/O state */ - opus_int32 st_res_Q12[], /* I short term residual signal */ - opus_int32 xw_Q3[], /* O prefiltered signal */ - opus_int32 HarmShapeFIRPacked_Q12, /* I Harmonic shaping coeficients */ - opus_int Tilt_Q14, /* I Tilt shaping coeficient */ - opus_int32 LF_shp_Q14, /* I Low-frequancy shaping coeficients */ - opus_int lag, /* I Lag for harmonic shaping */ - opus_int length /* I Length of signals */ -) -{ - opus_int i, idx, LTP_shp_buf_idx; - opus_int32 n_LTP_Q12, n_Tilt_Q10, n_LF_Q10; - opus_int32 sLF_MA_shp_Q12, sLF_AR_shp_Q12; - opus_int16 *LTP_shp_buf; - - /* To speed up use temp variables instead of using the struct */ - LTP_shp_buf = P->sLTP_shp; - LTP_shp_buf_idx = P->sLTP_shp_buf_idx; - sLF_AR_shp_Q12 = P->sLF_AR_shp_Q12; - sLF_MA_shp_Q12 = P->sLF_MA_shp_Q12; - - if( lag > 0 ) { - for( i = 0; i < length; i++ ) { - /* unrolled loop */ - silk_assert( HARM_SHAPE_FIR_TAPS == 3 ); - idx = lag + LTP_shp_buf_idx; - n_LTP_Q12 = silk_SMULBB( LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 - 1) & LTP_MASK ], HarmShapeFIRPacked_Q12 ); - n_LTP_Q12 = silk_SMLABT( n_LTP_Q12, LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 ) & LTP_MASK ], HarmShapeFIRPacked_Q12 ); - n_LTP_Q12 = silk_SMLABB( n_LTP_Q12, LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 + 1) & LTP_MASK ], HarmShapeFIRPacked_Q12 ); - - n_Tilt_Q10 = silk_SMULWB( sLF_AR_shp_Q12, Tilt_Q14 ); - n_LF_Q10 = silk_SMLAWB( silk_SMULWT( sLF_AR_shp_Q12, LF_shp_Q14 ), sLF_MA_shp_Q12, LF_shp_Q14 ); - - sLF_AR_shp_Q12 = silk_SUB32( st_res_Q12[ i ], silk_LSHIFT( n_Tilt_Q10, 2 ) ); - sLF_MA_shp_Q12 = silk_SUB32( sLF_AR_shp_Q12, silk_LSHIFT( n_LF_Q10, 2 ) ); - - LTP_shp_buf_idx = ( LTP_shp_buf_idx - 1 ) & LTP_MASK; - LTP_shp_buf[ LTP_shp_buf_idx ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sLF_MA_shp_Q12, 12 ) ); - - xw_Q3[i] = silk_RSHIFT_ROUND( silk_SUB32( sLF_MA_shp_Q12, n_LTP_Q12 ), 9 ); - } - } - else - { - for( i = 0; i < length; i++ ) { - - n_LTP_Q12 = 0; - - n_Tilt_Q10 = silk_SMULWB( sLF_AR_shp_Q12, Tilt_Q14 ); - n_LF_Q10 = silk_SMLAWB( silk_SMULWT( sLF_AR_shp_Q12, LF_shp_Q14 ), sLF_MA_shp_Q12, LF_shp_Q14 ); - - sLF_AR_shp_Q12 = silk_SUB32( st_res_Q12[ i ], silk_LSHIFT( n_Tilt_Q10, 2 ) ); - sLF_MA_shp_Q12 = silk_SUB32( sLF_AR_shp_Q12, silk_LSHIFT( n_LF_Q10, 2 ) ); - - LTP_shp_buf_idx = ( LTP_shp_buf_idx - 1 ) & LTP_MASK; - LTP_shp_buf[ LTP_shp_buf_idx ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sLF_MA_shp_Q12, 12 ) ); - - xw_Q3[i] = silk_RSHIFT_ROUND( sLF_MA_shp_Q12, 9 ); - } - } - - /* Copy temp variable back to state */ - P->sLF_AR_shp_Q12 = sLF_AR_shp_Q12; - P->sLF_MA_shp_Q12 = sLF_MA_shp_Q12; - P->sLTP_shp_buf_idx = LTP_shp_buf_idx; -} - -#endif /* __PREFILTER_FIX_MIPSR1_H__ */ diff --git a/thirdparty/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h b/thirdparty/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h index e803ef0fce..66eb2ed26d 100644 --- a/thirdparty/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h +++ b/thirdparty/opus/silk/fixed/mips/warped_autocorrelation_FIX_mipsr1.h @@ -41,8 +41,8 @@ POSSIBILITY OF SUCH DAMAGE. #define QS 14 /* Autocorrelations for a warped frequency axis */ -#define OVERRIDE_silk_warped_autocorrelation_FIX -void silk_warped_autocorrelation_FIX( +#define OVERRIDE_silk_warped_autocorrelation_FIX_c +void silk_warped_autocorrelation_FIX_c( opus_int32 *corr, /* O Result [order + 1] */ opus_int *scale, /* O Scaling of the correlation vector */ const opus_int16 *input, /* I Input data to correlate */ diff --git a/thirdparty/opus/silk/fixed/noise_shape_analysis_FIX.c b/thirdparty/opus/silk/fixed/noise_shape_analysis_FIX.c index 22a89f75ae..85fea0bf09 100644 --- a/thirdparty/opus/silk/fixed/noise_shape_analysis_FIX.c +++ b/thirdparty/opus/silk/fixed/noise_shape_analysis_FIX.c @@ -57,88 +57,79 @@ static OPUS_INLINE opus_int32 warped_gain( /* gain in Q16*/ /* Convert warped filter coefficients to monic pseudo-warped coefficients and limit maximum */ /* amplitude of monic warped coefficients by using bandwidth expansion on the true coefficients */ static OPUS_INLINE void limit_warped_coefs( - opus_int32 *coefs_syn_Q24, - opus_int32 *coefs_ana_Q24, + opus_int32 *coefs_Q24, opus_int lambda_Q16, opus_int32 limit_Q24, opus_int order ) { opus_int i, iter, ind = 0; - opus_int32 tmp, maxabs_Q24, chirp_Q16, gain_syn_Q16, gain_ana_Q16; + opus_int32 tmp, maxabs_Q24, chirp_Q16, gain_Q16; opus_int32 nom_Q16, den_Q24; + opus_int32 limit_Q20, maxabs_Q20; /* Convert to monic coefficients */ lambda_Q16 = -lambda_Q16; for( i = order - 1; i > 0; i-- ) { - coefs_syn_Q24[ i - 1 ] = silk_SMLAWB( coefs_syn_Q24[ i - 1 ], coefs_syn_Q24[ i ], lambda_Q16 ); - coefs_ana_Q24[ i - 1 ] = silk_SMLAWB( coefs_ana_Q24[ i - 1 ], coefs_ana_Q24[ i ], lambda_Q16 ); + coefs_Q24[ i - 1 ] = silk_SMLAWB( coefs_Q24[ i - 1 ], coefs_Q24[ i ], lambda_Q16 ); } lambda_Q16 = -lambda_Q16; - nom_Q16 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 16 ), -(opus_int32)lambda_Q16, lambda_Q16 ); - den_Q24 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_syn_Q24[ 0 ], lambda_Q16 ); - gain_syn_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 ); - den_Q24 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_ana_Q24[ 0 ], lambda_Q16 ); - gain_ana_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 ); + nom_Q16 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 16 ), -(opus_int32)lambda_Q16, lambda_Q16 ); + den_Q24 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_Q24[ 0 ], lambda_Q16 ); + gain_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 ); for( i = 0; i < order; i++ ) { - coefs_syn_Q24[ i ] = silk_SMULWW( gain_syn_Q16, coefs_syn_Q24[ i ] ); - coefs_ana_Q24[ i ] = silk_SMULWW( gain_ana_Q16, coefs_ana_Q24[ i ] ); + coefs_Q24[ i ] = silk_SMULWW( gain_Q16, coefs_Q24[ i ] ); } - + limit_Q20 = silk_RSHIFT(limit_Q24, 4); for( iter = 0; iter < 10; iter++ ) { /* Find maximum absolute value */ maxabs_Q24 = -1; for( i = 0; i < order; i++ ) { - tmp = silk_max( silk_abs_int32( coefs_syn_Q24[ i ] ), silk_abs_int32( coefs_ana_Q24[ i ] ) ); + tmp = silk_abs_int32( coefs_Q24[ i ] ); if( tmp > maxabs_Q24 ) { maxabs_Q24 = tmp; ind = i; } } - if( maxabs_Q24 <= limit_Q24 ) { + /* Use Q20 to avoid any overflow when multiplying by (ind + 1) later. */ + maxabs_Q20 = silk_RSHIFT(maxabs_Q24, 4); + if( maxabs_Q20 <= limit_Q20 ) { /* Coefficients are within range - done */ return; } /* Convert back to true warped coefficients */ for( i = 1; i < order; i++ ) { - coefs_syn_Q24[ i - 1 ] = silk_SMLAWB( coefs_syn_Q24[ i - 1 ], coefs_syn_Q24[ i ], lambda_Q16 ); - coefs_ana_Q24[ i - 1 ] = silk_SMLAWB( coefs_ana_Q24[ i - 1 ], coefs_ana_Q24[ i ], lambda_Q16 ); + coefs_Q24[ i - 1 ] = silk_SMLAWB( coefs_Q24[ i - 1 ], coefs_Q24[ i ], lambda_Q16 ); } - gain_syn_Q16 = silk_INVERSE32_varQ( gain_syn_Q16, 32 ); - gain_ana_Q16 = silk_INVERSE32_varQ( gain_ana_Q16, 32 ); + gain_Q16 = silk_INVERSE32_varQ( gain_Q16, 32 ); for( i = 0; i < order; i++ ) { - coefs_syn_Q24[ i ] = silk_SMULWW( gain_syn_Q16, coefs_syn_Q24[ i ] ); - coefs_ana_Q24[ i ] = silk_SMULWW( gain_ana_Q16, coefs_ana_Q24[ i ] ); + coefs_Q24[ i ] = silk_SMULWW( gain_Q16, coefs_Q24[ i ] ); } /* Apply bandwidth expansion */ chirp_Q16 = SILK_FIX_CONST( 0.99, 16 ) - silk_DIV32_varQ( - silk_SMULWB( maxabs_Q24 - limit_Q24, silk_SMLABB( SILK_FIX_CONST( 0.8, 10 ), SILK_FIX_CONST( 0.1, 10 ), iter ) ), - silk_MUL( maxabs_Q24, ind + 1 ), 22 ); - silk_bwexpander_32( coefs_syn_Q24, order, chirp_Q16 ); - silk_bwexpander_32( coefs_ana_Q24, order, chirp_Q16 ); + silk_SMULWB( maxabs_Q20 - limit_Q20, silk_SMLABB( SILK_FIX_CONST( 0.8, 10 ), SILK_FIX_CONST( 0.1, 10 ), iter ) ), + silk_MUL( maxabs_Q20, ind + 1 ), 22 ); + silk_bwexpander_32( coefs_Q24, order, chirp_Q16 ); /* Convert to monic warped coefficients */ lambda_Q16 = -lambda_Q16; for( i = order - 1; i > 0; i-- ) { - coefs_syn_Q24[ i - 1 ] = silk_SMLAWB( coefs_syn_Q24[ i - 1 ], coefs_syn_Q24[ i ], lambda_Q16 ); - coefs_ana_Q24[ i - 1 ] = silk_SMLAWB( coefs_ana_Q24[ i - 1 ], coefs_ana_Q24[ i ], lambda_Q16 ); + coefs_Q24[ i - 1 ] = silk_SMLAWB( coefs_Q24[ i - 1 ], coefs_Q24[ i ], lambda_Q16 ); } lambda_Q16 = -lambda_Q16; nom_Q16 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 16 ), -(opus_int32)lambda_Q16, lambda_Q16 ); - den_Q24 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_syn_Q24[ 0 ], lambda_Q16 ); - gain_syn_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 ); - den_Q24 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_ana_Q24[ 0 ], lambda_Q16 ); - gain_ana_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 ); + den_Q24 = silk_SMLAWB( SILK_FIX_CONST( 1.0, 24 ), coefs_Q24[ 0 ], lambda_Q16 ); + gain_Q16 = silk_DIV32_varQ( nom_Q16, den_Q24, 24 ); for( i = 0; i < order; i++ ) { - coefs_syn_Q24[ i ] = silk_SMULWW( gain_syn_Q16, coefs_syn_Q24[ i ] ); - coefs_ana_Q24[ i ] = silk_SMULWW( gain_ana_Q16, coefs_ana_Q24[ i ] ); + coefs_Q24[ i ] = silk_SMULWW( gain_Q16, coefs_Q24[ i ] ); } } silk_assert( 0 ); } -#if defined(MIPSr1_ASM) +/* Disable MIPS version until it's updated. */ +#if 0 && defined(MIPSr1_ASM) #include "mips/noise_shape_analysis_FIX_mipsr1.h" #endif @@ -155,14 +146,13 @@ void silk_noise_shape_analysis_FIX( ) { silk_shape_state_FIX *psShapeSt = &psEnc->sShape; - opus_int k, i, nSamples, Qnrg, b_Q14, warping_Q16, scale = 0; - opus_int32 SNR_adj_dB_Q7, HarmBoost_Q16, HarmShapeGain_Q16, Tilt_Q16, tmp32; - opus_int32 nrg, pre_nrg_Q30, log_energy_Q7, log_energy_prev_Q7, energy_variation_Q7; - opus_int32 delta_Q16, BWExp1_Q16, BWExp2_Q16, gain_mult_Q16, gain_add_Q16, strength_Q16, b_Q8; + opus_int k, i, nSamples, nSegs, Qnrg, b_Q14, warping_Q16, scale = 0; + opus_int32 SNR_adj_dB_Q7, HarmShapeGain_Q16, Tilt_Q16, tmp32; + opus_int32 nrg, log_energy_Q7, log_energy_prev_Q7, energy_variation_Q7; + opus_int32 BWExp_Q16, gain_mult_Q16, gain_add_Q16, strength_Q16, b_Q8; opus_int32 auto_corr[ MAX_SHAPE_LPC_ORDER + 1 ]; opus_int32 refl_coef_Q16[ MAX_SHAPE_LPC_ORDER ]; - opus_int32 AR1_Q24[ MAX_SHAPE_LPC_ORDER ]; - opus_int32 AR2_Q24[ MAX_SHAPE_LPC_ORDER ]; + opus_int32 AR_Q24[ MAX_SHAPE_LPC_ORDER ]; VARDECL( opus_int16, x_windowed ); const opus_int16 *x_ptr, *pitch_res_ptr; SAVE_STACK; @@ -209,14 +199,14 @@ void silk_noise_shape_analysis_FIX( if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) { /* Initially set to 0; may be overruled in process_gains(..) */ psEnc->sCmn.indices.quantOffsetType = 0; - psEncCtrl->sparseness_Q8 = 0; } else { /* Sparseness measure, based on relative fluctuations of energy per 2 milliseconds */ nSamples = silk_LSHIFT( psEnc->sCmn.fs_kHz, 1 ); energy_variation_Q7 = 0; log_energy_prev_Q7 = 0; pitch_res_ptr = pitch_res; - for( k = 0; k < silk_SMULBB( SUB_FRAME_LENGTH_MS, psEnc->sCmn.nb_subfr ) / 2; k++ ) { + nSegs = silk_SMULBB( SUB_FRAME_LENGTH_MS, psEnc->sCmn.nb_subfr ) / 2; + for( k = 0; k < nSegs; k++ ) { silk_sum_sqr_shift( &nrg, &scale, pitch_res_ptr, nSamples ); nrg += silk_RSHIFT( nSamples, scale ); /* Q(-scale)*/ @@ -228,18 +218,12 @@ void silk_noise_shape_analysis_FIX( pitch_res_ptr += nSamples; } - psEncCtrl->sparseness_Q8 = silk_RSHIFT( silk_sigm_Q15( silk_SMULWB( energy_variation_Q7 - - SILK_FIX_CONST( 5.0, 7 ), SILK_FIX_CONST( 0.1, 16 ) ) ), 7 ); - /* Set quantization offset depending on sparseness measure */ - if( psEncCtrl->sparseness_Q8 > SILK_FIX_CONST( SPARSENESS_THRESHOLD_QNT_OFFSET, 8 ) ) { + if( energy_variation_Q7 > SILK_FIX_CONST( ENERGY_VARIATION_THRESHOLD_QNT_OFFSET, 7 ) * (nSegs-1) ) { psEnc->sCmn.indices.quantOffsetType = 0; } else { psEnc->sCmn.indices.quantOffsetType = 1; } - - /* Increase coding SNR for sparse signals */ - SNR_adj_dB_Q7 = silk_SMLAWB( SNR_adj_dB_Q7, SILK_FIX_CONST( SPARSE_SNR_INCR_dB, 15 ), psEncCtrl->sparseness_Q8 - SILK_FIX_CONST( 0.5, 8 ) ); } /*******************************/ @@ -247,14 +231,8 @@ void silk_noise_shape_analysis_FIX( /*******************************/ /* More BWE for signals with high prediction gain */ strength_Q16 = silk_SMULWB( psEncCtrl->predGain_Q16, SILK_FIX_CONST( FIND_PITCH_WHITE_NOISE_FRACTION, 16 ) ); - BWExp1_Q16 = BWExp2_Q16 = silk_DIV32_varQ( SILK_FIX_CONST( BANDWIDTH_EXPANSION, 16 ), + BWExp_Q16 = silk_DIV32_varQ( SILK_FIX_CONST( BANDWIDTH_EXPANSION, 16 ), silk_SMLAWW( SILK_FIX_CONST( 1.0, 16 ), strength_Q16, strength_Q16 ), 16 ); - delta_Q16 = silk_SMULWB( SILK_FIX_CONST( 1.0, 16 ) - silk_SMULBB( 3, psEncCtrl->coding_quality_Q14 ), - SILK_FIX_CONST( LOW_RATE_BANDWIDTH_EXPANSION_DELTA, 16 ) ); - BWExp1_Q16 = silk_SUB32( BWExp1_Q16, delta_Q16 ); - BWExp2_Q16 = silk_ADD32( BWExp2_Q16, delta_Q16 ); - /* BWExp1 will be applied after BWExp2, so make it relative */ - BWExp1_Q16 = silk_DIV32_16( silk_LSHIFT( BWExp1_Q16, 14 ), silk_RSHIFT( BWExp2_Q16, 2 ) ); if( psEnc->sCmn.warping_Q16 > 0 ) { /* Slightly more warping in analysis will move quantization noise up in frequency, where it's better masked */ @@ -284,7 +262,7 @@ void silk_noise_shape_analysis_FIX( if( psEnc->sCmn.warping_Q16 > 0 ) { /* Calculate warped auto correlation */ - silk_warped_autocorrelation_FIX( auto_corr, &scale, x_windowed, warping_Q16, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder ); + silk_warped_autocorrelation_FIX( auto_corr, &scale, x_windowed, warping_Q16, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder, arch ); } else { /* Calculate regular auto correlation */ silk_autocorr( auto_corr, &scale, x_windowed, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder + 1, arch ); @@ -299,7 +277,7 @@ void silk_noise_shape_analysis_FIX( silk_assert( nrg >= 0 ); /* Convert reflection coefficients to prediction coefficients */ - silk_k2a_Q16( AR2_Q24, refl_coef_Q16, psEnc->sCmn.shapingLPCOrder ); + silk_k2a_Q16( AR_Q24, refl_coef_Q16, psEnc->sCmn.shapingLPCOrder ); Qnrg = -scale; /* range: -12...30*/ silk_assert( Qnrg >= -12 ); @@ -318,40 +296,34 @@ void silk_noise_shape_analysis_FIX( if( psEnc->sCmn.warping_Q16 > 0 ) { /* Adjust gain for warping */ - gain_mult_Q16 = warped_gain( AR2_Q24, warping_Q16, psEnc->sCmn.shapingLPCOrder ); - silk_assert( psEncCtrl->Gains_Q16[ k ] >= 0 ); - if ( silk_SMULWW( silk_RSHIFT_ROUND( psEncCtrl->Gains_Q16[ k ], 1 ), gain_mult_Q16 ) >= ( silk_int32_MAX >> 1 ) ) { - psEncCtrl->Gains_Q16[ k ] = silk_int32_MAX; + gain_mult_Q16 = warped_gain( AR_Q24, warping_Q16, psEnc->sCmn.shapingLPCOrder ); + silk_assert( psEncCtrl->Gains_Q16[ k ] > 0 ); + if( psEncCtrl->Gains_Q16[ k ] < SILK_FIX_CONST( 0.25, 16 ) ) { + psEncCtrl->Gains_Q16[ k ] = silk_SMULWW( psEncCtrl->Gains_Q16[ k ], gain_mult_Q16 ); } else { - psEncCtrl->Gains_Q16[ k ] = silk_SMULWW( psEncCtrl->Gains_Q16[ k ], gain_mult_Q16 ); + psEncCtrl->Gains_Q16[ k ] = silk_SMULWW( silk_RSHIFT_ROUND( psEncCtrl->Gains_Q16[ k ], 1 ), gain_mult_Q16 ); + if ( psEncCtrl->Gains_Q16[ k ] >= ( silk_int32_MAX >> 1 ) ) { + psEncCtrl->Gains_Q16[ k ] = silk_int32_MAX; + } else { + psEncCtrl->Gains_Q16[ k ] = silk_LSHIFT32( psEncCtrl->Gains_Q16[ k ], 1 ); + } } + silk_assert( psEncCtrl->Gains_Q16[ k ] > 0 ); } - /* Bandwidth expansion for synthesis filter shaping */ - silk_bwexpander_32( AR2_Q24, psEnc->sCmn.shapingLPCOrder, BWExp2_Q16 ); - - /* Compute noise shaping filter coefficients */ - silk_memcpy( AR1_Q24, AR2_Q24, psEnc->sCmn.shapingLPCOrder * sizeof( opus_int32 ) ); - - /* Bandwidth expansion for analysis filter shaping */ - silk_assert( BWExp1_Q16 <= SILK_FIX_CONST( 1.0, 16 ) ); - silk_bwexpander_32( AR1_Q24, psEnc->sCmn.shapingLPCOrder, BWExp1_Q16 ); - - /* Ratio of prediction gains, in energy domain */ - pre_nrg_Q30 = silk_LPC_inverse_pred_gain_Q24( AR2_Q24, psEnc->sCmn.shapingLPCOrder ); - nrg = silk_LPC_inverse_pred_gain_Q24( AR1_Q24, psEnc->sCmn.shapingLPCOrder ); - - /*psEncCtrl->GainsPre[ k ] = 1.0f - 0.7f * ( 1.0f - pre_nrg / nrg ) = 0.3f + 0.7f * pre_nrg / nrg;*/ - pre_nrg_Q30 = silk_LSHIFT32( silk_SMULWB( pre_nrg_Q30, SILK_FIX_CONST( 0.7, 15 ) ), 1 ); - psEncCtrl->GainsPre_Q14[ k ] = ( opus_int ) SILK_FIX_CONST( 0.3, 14 ) + silk_DIV32_varQ( pre_nrg_Q30, nrg, 14 ); + /* Bandwidth expansion */ + silk_bwexpander_32( AR_Q24, psEnc->sCmn.shapingLPCOrder, BWExp_Q16 ); - /* Convert to monic warped prediction coefficients and limit absolute values */ - limit_warped_coefs( AR2_Q24, AR1_Q24, warping_Q16, SILK_FIX_CONST( 3.999, 24 ), psEnc->sCmn.shapingLPCOrder ); + if( psEnc->sCmn.warping_Q16 > 0 ) { + /* Convert to monic warped prediction coefficients and limit absolute values */ + limit_warped_coefs( AR_Q24, warping_Q16, SILK_FIX_CONST( 3.999, 24 ), psEnc->sCmn.shapingLPCOrder ); - /* Convert from Q24 to Q13 and store in int16 */ - for( i = 0; i < psEnc->sCmn.shapingLPCOrder; i++ ) { - psEncCtrl->AR1_Q13[ k * MAX_SHAPE_LPC_ORDER + i ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( AR1_Q24[ i ], 11 ) ); - psEncCtrl->AR2_Q13[ k * MAX_SHAPE_LPC_ORDER + i ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( AR2_Q24[ i ], 11 ) ); + /* Convert from Q24 to Q13 and store in int16 */ + for( i = 0; i < psEnc->sCmn.shapingLPCOrder; i++ ) { + psEncCtrl->AR_Q13[ k * MAX_SHAPE_LPC_ORDER + i ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( AR_Q24[ i ], 11 ) ); + } + } else { + silk_LPC_fit( &psEncCtrl->AR_Q13[ k * MAX_SHAPE_LPC_ORDER ], AR_Q24, 13, 24, psEnc->sCmn.shapingLPCOrder ); } } @@ -368,11 +340,6 @@ void silk_noise_shape_analysis_FIX( psEncCtrl->Gains_Q16[ k ] = silk_ADD_POS_SAT32( psEncCtrl->Gains_Q16[ k ], gain_add_Q16 ); } - gain_mult_Q16 = SILK_FIX_CONST( 1.0, 16 ) + silk_RSHIFT_ROUND( silk_MLA( SILK_FIX_CONST( INPUT_TILT, 26 ), - psEncCtrl->coding_quality_Q14, SILK_FIX_CONST( HIGH_RATE_INPUT_TILT, 12 ) ), 10 ); - for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) { - psEncCtrl->GainsPre_Q14[ k ] = silk_SMULWB( gain_mult_Q16, psEncCtrl->GainsPre_Q14[ k ] ); - } /************************************************/ /* Control low-frequency shaping and noise tilt */ @@ -410,14 +377,6 @@ void silk_noise_shape_analysis_FIX( /****************************/ /* HARMONIC SHAPING CONTROL */ /****************************/ - /* Control boosting of harmonic frequencies */ - HarmBoost_Q16 = silk_SMULWB( silk_SMULWB( SILK_FIX_CONST( 1.0, 17 ) - silk_LSHIFT( psEncCtrl->coding_quality_Q14, 3 ), - psEnc->LTPCorr_Q15 ), SILK_FIX_CONST( LOW_RATE_HARMONIC_BOOST, 16 ) ); - - /* More harmonic boost for noisy input signals */ - HarmBoost_Q16 = silk_SMLAWB( HarmBoost_Q16, - SILK_FIX_CONST( 1.0, 16 ) - silk_LSHIFT( psEncCtrl->input_quality_Q14, 2 ), SILK_FIX_CONST( LOW_INPUT_QUALITY_HARMONIC_BOOST, 16 ) ); - if( USE_HARM_SHAPING && psEnc->sCmn.indices.signalType == TYPE_VOICED ) { /* More harmonic noise shaping for high bitrates or noisy input */ HarmShapeGain_Q16 = silk_SMLAWB( SILK_FIX_CONST( HARMONIC_SHAPING, 16 ), @@ -435,14 +394,11 @@ void silk_noise_shape_analysis_FIX( /* Smooth over subframes */ /*************************/ for( k = 0; k < MAX_NB_SUBFR; k++ ) { - psShapeSt->HarmBoost_smth_Q16 = - silk_SMLAWB( psShapeSt->HarmBoost_smth_Q16, HarmBoost_Q16 - psShapeSt->HarmBoost_smth_Q16, SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) ); psShapeSt->HarmShapeGain_smth_Q16 = silk_SMLAWB( psShapeSt->HarmShapeGain_smth_Q16, HarmShapeGain_Q16 - psShapeSt->HarmShapeGain_smth_Q16, SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) ); psShapeSt->Tilt_smth_Q16 = silk_SMLAWB( psShapeSt->Tilt_smth_Q16, Tilt_Q16 - psShapeSt->Tilt_smth_Q16, SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) ); - psEncCtrl->HarmBoost_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psShapeSt->HarmBoost_smth_Q16, 2 ); psEncCtrl->HarmShapeGain_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psShapeSt->HarmShapeGain_smth_Q16, 2 ); psEncCtrl->Tilt_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psShapeSt->Tilt_smth_Q16, 2 ); } diff --git a/thirdparty/opus/silk/fixed/pitch_analysis_core_FIX.c b/thirdparty/opus/silk/fixed/pitch_analysis_core_FIX.c index 01bb9fc0a8..14729046d2 100644 --- a/thirdparty/opus/silk/fixed/pitch_analysis_core_FIX.c +++ b/thirdparty/opus/silk/fixed/pitch_analysis_core_FIX.c @@ -80,7 +80,7 @@ static void silk_P_Ana_calc_energy_st3( /* FIXED POINT CORE PITCH ANALYSIS FUNCTION */ /*************************************************************/ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unvoiced */ - const opus_int16 *frame, /* I Signal of length PE_FRAME_LENGTH_MS*Fs_kHz */ + const opus_int16 *frame_unscaled, /* I Signal of length PE_FRAME_LENGTH_MS*Fs_kHz */ opus_int *pitch_out, /* O 4 pitch lag values */ opus_int16 *lagIndex, /* O Lag Index */ opus_int8 *contourIndex, /* O Pitch contour Index */ @@ -94,16 +94,17 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 int arch /* I Run-time architecture */ ) { - VARDECL( opus_int16, frame_8kHz ); + VARDECL( opus_int16, frame_8kHz_buf ); VARDECL( opus_int16, frame_4kHz ); + VARDECL( opus_int16, frame_scaled ); opus_int32 filt_state[ 6 ]; - const opus_int16 *input_frame_ptr; + const opus_int16 *frame, *frame_8kHz; opus_int i, k, d, j; VARDECL( opus_int16, C ); VARDECL( opus_int32, xcorr32 ); const opus_int16 *target_ptr, *basis_ptr; - opus_int32 cross_corr, normalizer, energy, shift, energy_basis, energy_target; - opus_int d_srch[ PE_D_SRCH_LENGTH ], Cmax, length_d_srch, length_d_comp; + opus_int32 cross_corr, normalizer, energy, energy_basis, energy_target; + opus_int d_srch[ PE_D_SRCH_LENGTH ], Cmax, length_d_srch, length_d_comp, shift; VARDECL( opus_int16, d_comp ); opus_int32 sum, threshold, lag_counter; opus_int CBimax, CBimax_new, CBimax_old, lag, start_lag, end_lag, lag_new; @@ -119,12 +120,13 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 opus_int32 delta_lag_log2_sqr_Q7, lag_log2_Q7, prevLag_log2_Q7, prev_lag_bias_Q13; const opus_int8 *Lag_CB_ptr; SAVE_STACK; + /* Check for valid sampling frequency */ - silk_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 ); + celt_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 ); /* Check for valid complexity setting */ - silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); - silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); + celt_assert( complexity >= SILK_PE_MIN_COMPLEX ); + celt_assert( complexity <= SILK_PE_MAX_COMPLEX ); silk_assert( search_thres1_Q16 >= 0 && search_thres1_Q16 <= (1<<16) ); silk_assert( search_thres2_Q13 >= 0 && search_thres2_Q13 <= (1<<13) ); @@ -137,17 +139,33 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 min_lag = PE_MIN_LAG_MS * Fs_kHz; max_lag = PE_MAX_LAG_MS * Fs_kHz - 1; + /* Downscale input if necessary */ + silk_sum_sqr_shift( &energy, &shift, frame_unscaled, frame_length ); + shift += 3 - silk_CLZ32( energy ); /* at least two bits headroom */ + ALLOC( frame_scaled, frame_length, opus_int16 ); + if( shift > 0 ) { + shift = silk_RSHIFT( shift + 1, 1 ); + for( i = 0; i < frame_length; i++ ) { + frame_scaled[ i ] = silk_RSHIFT( frame_unscaled[ i ], shift ); + } + frame = frame_scaled; + } else { + frame = frame_unscaled; + } + + ALLOC( frame_8kHz_buf, ( Fs_kHz == 8 ) ? 1 : frame_length_8kHz, opus_int16 ); /* Resample from input sampled at Fs_kHz to 8 kHz */ - ALLOC( frame_8kHz, frame_length_8kHz, opus_int16 ); if( Fs_kHz == 16 ) { silk_memset( filt_state, 0, 2 * sizeof( opus_int32 ) ); - silk_resampler_down2( filt_state, frame_8kHz, frame, frame_length ); + silk_resampler_down2( filt_state, frame_8kHz_buf, frame, frame_length ); + frame_8kHz = frame_8kHz_buf; } else if( Fs_kHz == 12 ) { silk_memset( filt_state, 0, 6 * sizeof( opus_int32 ) ); - silk_resampler_down2_3( filt_state, frame_8kHz, frame, frame_length ); + silk_resampler_down2_3( filt_state, frame_8kHz_buf, frame, frame_length ); + frame_8kHz = frame_8kHz_buf; } else { - silk_assert( Fs_kHz == 8 ); - silk_memcpy( frame_8kHz, frame, frame_length_8kHz * sizeof(opus_int16) ); + celt_assert( Fs_kHz == 8 ); + frame_8kHz = frame; } /* Decimate again to 4 kHz */ @@ -160,19 +178,6 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 frame_4kHz[ i ] = silk_ADD_SAT16( frame_4kHz[ i ], frame_4kHz[ i - 1 ] ); } - /******************************************************************************* - ** Scale 4 kHz signal down to prevent correlations measures from overflowing - ** find scaling as max scaling for each 8kHz(?) subframe - *******************************************************************************/ - - /* Inner product is calculated with different lengths, so scale for the worst case */ - silk_sum_sqr_shift( &energy, &shift, frame_4kHz, frame_length_4kHz ); - if( shift > 0 ) { - shift = silk_RSHIFT( shift, 1 ); - for( i = 0; i < frame_length_4kHz; i++ ) { - frame_4kHz[ i ] = silk_RSHIFT( frame_4kHz[ i ], shift ); - } - } /****************************************************************************** * FIRST STAGE, operating in 4 khz @@ -183,14 +188,14 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 target_ptr = &frame_4kHz[ silk_LSHIFT( SF_LENGTH_4KHZ, 2 ) ]; for( k = 0; k < nb_subfr >> 1; k++ ) { /* Check that we are within range of the array */ - silk_assert( target_ptr >= frame_4kHz ); - silk_assert( target_ptr + SF_LENGTH_8KHZ <= frame_4kHz + frame_length_4kHz ); + celt_assert( target_ptr >= frame_4kHz ); + celt_assert( target_ptr + SF_LENGTH_8KHZ <= frame_4kHz + frame_length_4kHz ); basis_ptr = target_ptr - MIN_LAG_4KHZ; /* Check that we are within range of the array */ - silk_assert( basis_ptr >= frame_4kHz ); - silk_assert( basis_ptr + SF_LENGTH_8KHZ <= frame_4kHz + frame_length_4kHz ); + celt_assert( basis_ptr >= frame_4kHz ); + celt_assert( basis_ptr + SF_LENGTH_8KHZ <= frame_4kHz + frame_length_4kHz ); celt_pitch_xcorr( target_ptr, target_ptr - MAX_LAG_4KHZ, xcorr32, SF_LENGTH_8KHZ, MAX_LAG_4KHZ - MIN_LAG_4KHZ + 1, arch ); @@ -244,7 +249,7 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 /* Sort */ length_d_srch = silk_ADD_LSHIFT32( 4, complexity, 1 ); - silk_assert( 3 * length_d_srch <= PE_D_SRCH_LENGTH ); + celt_assert( 3 * length_d_srch <= PE_D_SRCH_LENGTH ); silk_insertion_sort_decreasing_int16( C, d_srch, CSTRIDE_4KHZ, length_d_srch ); @@ -269,7 +274,7 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 break; } } - silk_assert( length_d_srch > 0 ); + celt_assert( length_d_srch > 0 ); ALLOC( d_comp, D_COMP_STRIDE, opus_int16 ); for( i = D_COMP_MIN; i < D_COMP_MAX; i++ ) { @@ -311,18 +316,6 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 ** SECOND STAGE, operating at 8 kHz, on lag sections with high correlation *************************************************************************************/ - /****************************************************************************** - ** Scale signal down to avoid correlations measures from overflowing - *******************************************************************************/ - /* find scaling as max scaling for each subframe */ - silk_sum_sqr_shift( &energy, &shift, frame_8kHz, frame_length_8kHz ); - if( shift > 0 ) { - shift = silk_RSHIFT( shift, 1 ); - for( i = 0; i < frame_length_8kHz; i++ ) { - frame_8kHz[ i ] = silk_RSHIFT( frame_8kHz[ i ], shift ); - } - } - /********************************************************************************* * Find energy of each subframe projected onto its history, for a range of delays *********************************************************************************/ @@ -332,8 +325,8 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 for( k = 0; k < nb_subfr; k++ ) { /* Check that we are within range of the array */ - silk_assert( target_ptr >= frame_8kHz ); - silk_assert( target_ptr + SF_LENGTH_8KHZ <= frame_8kHz + frame_length_8kHz ); + celt_assert( target_ptr >= frame_8kHz ); + celt_assert( target_ptr + SF_LENGTH_8KHZ <= frame_8kHz + frame_length_8kHz ); energy_target = silk_ADD32( silk_inner_prod_aligned( target_ptr, target_ptr, SF_LENGTH_8KHZ, arch ), 1 ); for( j = 0; j < length_d_comp; j++ ) { @@ -462,24 +455,6 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 silk_assert( *LTPCorr_Q15 >= 0 ); if( Fs_kHz > 8 ) { - VARDECL( opus_int16, scratch_mem ); - /***************************************************************************/ - /* Scale input signal down to avoid correlations measures from overflowing */ - /***************************************************************************/ - /* find scaling as max scaling for each subframe */ - silk_sum_sqr_shift( &energy, &shift, frame, frame_length ); - ALLOC( scratch_mem, shift > 0 ? frame_length : ALLOC_NONE, opus_int16 ); - if( shift > 0 ) { - /* Move signal to scratch mem because the input signal should be unchanged */ - shift = silk_RSHIFT( shift, 1 ); - for( i = 0; i < frame_length; i++ ) { - scratch_mem[ i ] = silk_RSHIFT( frame[ i ], shift ); - } - input_frame_ptr = scratch_mem; - } else { - input_frame_ptr = frame; - } - /* Search in original signal */ CBimax_old = CBimax; @@ -519,14 +494,14 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 /* Calculate the correlations and energies needed in stage 3 */ ALLOC( energies_st3, nb_subfr * nb_cbk_search, silk_pe_stage3_vals ); ALLOC( cross_corr_st3, nb_subfr * nb_cbk_search, silk_pe_stage3_vals ); - silk_P_Ana_calc_corr_st3( cross_corr_st3, input_frame_ptr, start_lag, sf_length, nb_subfr, complexity, arch ); - silk_P_Ana_calc_energy_st3( energies_st3, input_frame_ptr, start_lag, sf_length, nb_subfr, complexity, arch ); + silk_P_Ana_calc_corr_st3( cross_corr_st3, frame, start_lag, sf_length, nb_subfr, complexity, arch ); + silk_P_Ana_calc_energy_st3( energies_st3, frame, start_lag, sf_length, nb_subfr, complexity, arch ); lag_counter = 0; silk_assert( lag == silk_SAT16( lag ) ); contour_bias_Q15 = silk_DIV32_16( SILK_FIX_CONST( PE_FLATCONTOUR_BIAS, 15 ), lag ); - target_ptr = &input_frame_ptr[ PE_LTP_MEM_LENGTH_MS * Fs_kHz ]; + target_ptr = &frame[ PE_LTP_MEM_LENGTH_MS * Fs_kHz ]; energy_target = silk_ADD32( silk_inner_prod_aligned( target_ptr, target_ptr, nb_subfr * sf_length, arch ), 1 ); for( d = start_lag; d <= end_lag; d++ ) { for( j = 0; j < nb_cbk_search; j++ ) { @@ -575,7 +550,7 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0 *lagIndex = (opus_int16)( lag - MIN_LAG_8KHZ ); *contourIndex = (opus_int8)CBimax; } - silk_assert( *lagIndex >= 0 ); + celt_assert( *lagIndex >= 0 ); /* return as voiced */ RESTORE_STACK; return 0; @@ -612,8 +587,8 @@ static void silk_P_Ana_calc_corr_st3( const opus_int8 *Lag_range_ptr, *Lag_CB_ptr; SAVE_STACK; - silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); - silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); + celt_assert( complexity >= SILK_PE_MIN_COMPLEX ); + celt_assert( complexity <= SILK_PE_MAX_COMPLEX ); if( nb_subfr == PE_MAX_NB_SUBFR ) { Lag_range_ptr = &silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ]; @@ -621,7 +596,7 @@ static void silk_P_Ana_calc_corr_st3( nb_cbk_search = silk_nb_cbk_searchs_stage3[ complexity ]; cbk_size = PE_NB_CBKS_STAGE3_MAX; } else { - silk_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1); + celt_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1); Lag_range_ptr = &silk_Lag_range_stage3_10_ms[ 0 ][ 0 ]; Lag_CB_ptr = &silk_CB_lags_stage3_10_ms[ 0 ][ 0 ]; nb_cbk_search = PE_NB_CBKS_STAGE3_10MS; @@ -637,7 +612,7 @@ static void silk_P_Ana_calc_corr_st3( /* Calculate the correlations for each subframe */ lag_low = matrix_ptr( Lag_range_ptr, k, 0, 2 ); lag_high = matrix_ptr( Lag_range_ptr, k, 1, 2 ); - silk_assert(lag_high-lag_low+1 <= SCRATCH_SIZE); + celt_assert(lag_high-lag_low+1 <= SCRATCH_SIZE); celt_pitch_xcorr( target_ptr, target_ptr - start_lag - lag_high, xcorr32, sf_length, lag_high - lag_low + 1, arch ); for( j = lag_low; j <= lag_high; j++ ) { silk_assert( lag_counter < SCRATCH_SIZE ); @@ -684,8 +659,8 @@ static void silk_P_Ana_calc_energy_st3( const opus_int8 *Lag_range_ptr, *Lag_CB_ptr; SAVE_STACK; - silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); - silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); + celt_assert( complexity >= SILK_PE_MIN_COMPLEX ); + celt_assert( complexity <= SILK_PE_MAX_COMPLEX ); if( nb_subfr == PE_MAX_NB_SUBFR ) { Lag_range_ptr = &silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ]; @@ -693,7 +668,7 @@ static void silk_P_Ana_calc_energy_st3( nb_cbk_search = silk_nb_cbk_searchs_stage3[ complexity ]; cbk_size = PE_NB_CBKS_STAGE3_MAX; } else { - silk_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1); + celt_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1); Lag_range_ptr = &silk_Lag_range_stage3_10_ms[ 0 ][ 0 ]; Lag_CB_ptr = &silk_CB_lags_stage3_10_ms[ 0 ][ 0 ]; nb_cbk_search = PE_NB_CBKS_STAGE3_10MS; diff --git a/thirdparty/opus/silk/fixed/prefilter_FIX.c b/thirdparty/opus/silk/fixed/prefilter_FIX.c deleted file mode 100644 index 6a8e35152e..0000000000 --- a/thirdparty/opus/silk/fixed/prefilter_FIX.c +++ /dev/null @@ -1,221 +0,0 @@ -/*********************************************************************** -Copyright (c) 2006-2011, Skype Limited. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -- Neither the name of Internet Society, IETF or IETF Trust, nor the -names of specific contributors, may be used to endorse or promote -products derived from this software without specific prior written -permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -***********************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main_FIX.h" -#include "stack_alloc.h" -#include "tuning_parameters.h" - -#if defined(MIPSr1_ASM) -#include "mips/prefilter_FIX_mipsr1.h" -#endif - - -#if !defined(OVERRIDE_silk_warped_LPC_analysis_filter_FIX) -#define silk_warped_LPC_analysis_filter_FIX(state, res_Q2, coef_Q13, input, lambda_Q16, length, order, arch) \ - ((void)(arch),silk_warped_LPC_analysis_filter_FIX_c(state, res_Q2, coef_Q13, input, lambda_Q16, length, order)) -#endif - -/* Prefilter for finding Quantizer input signal */ -static OPUS_INLINE void silk_prefilt_FIX( - silk_prefilter_state_FIX *P, /* I/O state */ - opus_int32 st_res_Q12[], /* I short term residual signal */ - opus_int32 xw_Q3[], /* O prefiltered signal */ - opus_int32 HarmShapeFIRPacked_Q12, /* I Harmonic shaping coeficients */ - opus_int Tilt_Q14, /* I Tilt shaping coeficient */ - opus_int32 LF_shp_Q14, /* I Low-frequancy shaping coeficients */ - opus_int lag, /* I Lag for harmonic shaping */ - opus_int length /* I Length of signals */ -); - -void silk_warped_LPC_analysis_filter_FIX_c( - opus_int32 state[], /* I/O State [order + 1] */ - opus_int32 res_Q2[], /* O Residual signal [length] */ - const opus_int16 coef_Q13[], /* I Coefficients [order] */ - const opus_int16 input[], /* I Input signal [length] */ - const opus_int16 lambda_Q16, /* I Warping factor */ - const opus_int length, /* I Length of input signal */ - const opus_int order /* I Filter order (even) */ -) -{ - opus_int n, i; - opus_int32 acc_Q11, tmp1, tmp2; - - /* Order must be even */ - silk_assert( ( order & 1 ) == 0 ); - - for( n = 0; n < length; n++ ) { - /* Output of lowpass section */ - tmp2 = silk_SMLAWB( state[ 0 ], state[ 1 ], lambda_Q16 ); - state[ 0 ] = silk_LSHIFT( input[ n ], 14 ); - /* Output of allpass section */ - tmp1 = silk_SMLAWB( state[ 1 ], state[ 2 ] - tmp2, lambda_Q16 ); - state[ 1 ] = tmp2; - acc_Q11 = silk_RSHIFT( order, 1 ); - acc_Q11 = silk_SMLAWB( acc_Q11, tmp2, coef_Q13[ 0 ] ); - /* Loop over allpass sections */ - for( i = 2; i < order; i += 2 ) { - /* Output of allpass section */ - tmp2 = silk_SMLAWB( state[ i ], state[ i + 1 ] - tmp1, lambda_Q16 ); - state[ i ] = tmp1; - acc_Q11 = silk_SMLAWB( acc_Q11, tmp1, coef_Q13[ i - 1 ] ); - /* Output of allpass section */ - tmp1 = silk_SMLAWB( state[ i + 1 ], state[ i + 2 ] - tmp2, lambda_Q16 ); - state[ i + 1 ] = tmp2; - acc_Q11 = silk_SMLAWB( acc_Q11, tmp2, coef_Q13[ i ] ); - } - state[ order ] = tmp1; - acc_Q11 = silk_SMLAWB( acc_Q11, tmp1, coef_Q13[ order - 1 ] ); - res_Q2[ n ] = silk_LSHIFT( (opus_int32)input[ n ], 2 ) - silk_RSHIFT_ROUND( acc_Q11, 9 ); - } -} - -void silk_prefilter_FIX( - silk_encoder_state_FIX *psEnc, /* I/O Encoder state */ - const silk_encoder_control_FIX *psEncCtrl, /* I Encoder control */ - opus_int32 xw_Q3[], /* O Weighted signal */ - const opus_int16 x[] /* I Speech signal */ -) -{ - silk_prefilter_state_FIX *P = &psEnc->sPrefilt; - opus_int j, k, lag; - opus_int32 tmp_32; - const opus_int16 *AR1_shp_Q13; - const opus_int16 *px; - opus_int32 *pxw_Q3; - opus_int HarmShapeGain_Q12, Tilt_Q14; - opus_int32 HarmShapeFIRPacked_Q12, LF_shp_Q14; - VARDECL( opus_int32, x_filt_Q12 ); - VARDECL( opus_int32, st_res_Q2 ); - opus_int16 B_Q10[ 2 ]; - SAVE_STACK; - - /* Set up pointers */ - px = x; - pxw_Q3 = xw_Q3; - lag = P->lagPrev; - ALLOC( x_filt_Q12, psEnc->sCmn.subfr_length, opus_int32 ); - ALLOC( st_res_Q2, psEnc->sCmn.subfr_length, opus_int32 ); - for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) { - /* Update Variables that change per sub frame */ - if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) { - lag = psEncCtrl->pitchL[ k ]; - } - - /* Noise shape parameters */ - HarmShapeGain_Q12 = silk_SMULWB( (opus_int32)psEncCtrl->HarmShapeGain_Q14[ k ], 16384 - psEncCtrl->HarmBoost_Q14[ k ] ); - silk_assert( HarmShapeGain_Q12 >= 0 ); - HarmShapeFIRPacked_Q12 = silk_RSHIFT( HarmShapeGain_Q12, 2 ); - HarmShapeFIRPacked_Q12 |= silk_LSHIFT( (opus_int32)silk_RSHIFT( HarmShapeGain_Q12, 1 ), 16 ); - Tilt_Q14 = psEncCtrl->Tilt_Q14[ k ]; - LF_shp_Q14 = psEncCtrl->LF_shp_Q14[ k ]; - AR1_shp_Q13 = &psEncCtrl->AR1_Q13[ k * MAX_SHAPE_LPC_ORDER ]; - - /* Short term FIR filtering*/ - silk_warped_LPC_analysis_filter_FIX( P->sAR_shp, st_res_Q2, AR1_shp_Q13, px, - psEnc->sCmn.warping_Q16, psEnc->sCmn.subfr_length, psEnc->sCmn.shapingLPCOrder, psEnc->sCmn.arch ); - - /* Reduce (mainly) low frequencies during harmonic emphasis */ - B_Q10[ 0 ] = silk_RSHIFT_ROUND( psEncCtrl->GainsPre_Q14[ k ], 4 ); - tmp_32 = silk_SMLABB( SILK_FIX_CONST( INPUT_TILT, 26 ), psEncCtrl->HarmBoost_Q14[ k ], HarmShapeGain_Q12 ); /* Q26 */ - tmp_32 = silk_SMLABB( tmp_32, psEncCtrl->coding_quality_Q14, SILK_FIX_CONST( HIGH_RATE_INPUT_TILT, 12 ) ); /* Q26 */ - tmp_32 = silk_SMULWB( tmp_32, -psEncCtrl->GainsPre_Q14[ k ] ); /* Q24 */ - tmp_32 = silk_RSHIFT_ROUND( tmp_32, 14 ); /* Q10 */ - B_Q10[ 1 ]= silk_SAT16( tmp_32 ); - x_filt_Q12[ 0 ] = silk_MLA( silk_MUL( st_res_Q2[ 0 ], B_Q10[ 0 ] ), P->sHarmHP_Q2, B_Q10[ 1 ] ); - for( j = 1; j < psEnc->sCmn.subfr_length; j++ ) { - x_filt_Q12[ j ] = silk_MLA( silk_MUL( st_res_Q2[ j ], B_Q10[ 0 ] ), st_res_Q2[ j - 1 ], B_Q10[ 1 ] ); - } - P->sHarmHP_Q2 = st_res_Q2[ psEnc->sCmn.subfr_length - 1 ]; - - silk_prefilt_FIX( P, x_filt_Q12, pxw_Q3, HarmShapeFIRPacked_Q12, Tilt_Q14, LF_shp_Q14, lag, psEnc->sCmn.subfr_length ); - - px += psEnc->sCmn.subfr_length; - pxw_Q3 += psEnc->sCmn.subfr_length; - } - - P->lagPrev = psEncCtrl->pitchL[ psEnc->sCmn.nb_subfr - 1 ]; - RESTORE_STACK; -} - -#ifndef OVERRIDE_silk_prefilt_FIX -/* Prefilter for finding Quantizer input signal */ -static OPUS_INLINE void silk_prefilt_FIX( - silk_prefilter_state_FIX *P, /* I/O state */ - opus_int32 st_res_Q12[], /* I short term residual signal */ - opus_int32 xw_Q3[], /* O prefiltered signal */ - opus_int32 HarmShapeFIRPacked_Q12, /* I Harmonic shaping coeficients */ - opus_int Tilt_Q14, /* I Tilt shaping coeficient */ - opus_int32 LF_shp_Q14, /* I Low-frequancy shaping coeficients */ - opus_int lag, /* I Lag for harmonic shaping */ - opus_int length /* I Length of signals */ -) -{ - opus_int i, idx, LTP_shp_buf_idx; - opus_int32 n_LTP_Q12, n_Tilt_Q10, n_LF_Q10; - opus_int32 sLF_MA_shp_Q12, sLF_AR_shp_Q12; - opus_int16 *LTP_shp_buf; - - /* To speed up use temp variables instead of using the struct */ - LTP_shp_buf = P->sLTP_shp; - LTP_shp_buf_idx = P->sLTP_shp_buf_idx; - sLF_AR_shp_Q12 = P->sLF_AR_shp_Q12; - sLF_MA_shp_Q12 = P->sLF_MA_shp_Q12; - - for( i = 0; i < length; i++ ) { - if( lag > 0 ) { - /* unrolled loop */ - silk_assert( HARM_SHAPE_FIR_TAPS == 3 ); - idx = lag + LTP_shp_buf_idx; - n_LTP_Q12 = silk_SMULBB( LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 - 1) & LTP_MASK ], HarmShapeFIRPacked_Q12 ); - n_LTP_Q12 = silk_SMLABT( n_LTP_Q12, LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 ) & LTP_MASK ], HarmShapeFIRPacked_Q12 ); - n_LTP_Q12 = silk_SMLABB( n_LTP_Q12, LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 + 1) & LTP_MASK ], HarmShapeFIRPacked_Q12 ); - } else { - n_LTP_Q12 = 0; - } - - n_Tilt_Q10 = silk_SMULWB( sLF_AR_shp_Q12, Tilt_Q14 ); - n_LF_Q10 = silk_SMLAWB( silk_SMULWT( sLF_AR_shp_Q12, LF_shp_Q14 ), sLF_MA_shp_Q12, LF_shp_Q14 ); - - sLF_AR_shp_Q12 = silk_SUB32( st_res_Q12[ i ], silk_LSHIFT( n_Tilt_Q10, 2 ) ); - sLF_MA_shp_Q12 = silk_SUB32( sLF_AR_shp_Q12, silk_LSHIFT( n_LF_Q10, 2 ) ); - - LTP_shp_buf_idx = ( LTP_shp_buf_idx - 1 ) & LTP_MASK; - LTP_shp_buf[ LTP_shp_buf_idx ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sLF_MA_shp_Q12, 12 ) ); - - xw_Q3[i] = silk_RSHIFT_ROUND( silk_SUB32( sLF_MA_shp_Q12, n_LTP_Q12 ), 9 ); - } - - /* Copy temp variable back to state */ - P->sLF_AR_shp_Q12 = sLF_AR_shp_Q12; - P->sLF_MA_shp_Q12 = sLF_MA_shp_Q12; - P->sLTP_shp_buf_idx = LTP_shp_buf_idx; -} -#endif /* OVERRIDE_silk_prefilt_FIX */ diff --git a/thirdparty/opus/silk/fixed/residual_energy16_FIX.c b/thirdparty/opus/silk/fixed/residual_energy16_FIX.c index ebffb2a66f..7f130f3d3d 100644 --- a/thirdparty/opus/silk/fixed/residual_energy16_FIX.c +++ b/thirdparty/opus/silk/fixed/residual_energy16_FIX.c @@ -47,10 +47,10 @@ opus_int32 silk_residual_energy16_covar_FIX( const opus_int32 *pRow; /* Safety checks */ - silk_assert( D >= 0 ); - silk_assert( D <= 16 ); - silk_assert( cQ > 0 ); - silk_assert( cQ < 16 ); + celt_assert( D >= 0 ); + celt_assert( D <= 16 ); + celt_assert( cQ > 0 ); + celt_assert( cQ < 16 ); lshifts = 16 - cQ; Qxtra = lshifts; diff --git a/thirdparty/opus/silk/fixed/residual_energy_FIX.c b/thirdparty/opus/silk/fixed/residual_energy_FIX.c index 41f74778e8..6c7cade9a0 100644 --- a/thirdparty/opus/silk/fixed/residual_energy_FIX.c +++ b/thirdparty/opus/silk/fixed/residual_energy_FIX.c @@ -58,7 +58,7 @@ void silk_residual_energy_FIX( /* Filter input to create the LPC residual for each frame half, and measure subframe energies */ ALLOC( LPC_res, ( MAX_NB_SUBFR >> 1 ) * offset, opus_int16 ); - silk_assert( ( nb_subfr >> 1 ) * ( MAX_NB_SUBFR >> 1 ) == nb_subfr ); + celt_assert( ( nb_subfr >> 1 ) * ( MAX_NB_SUBFR >> 1 ) == nb_subfr ); for( i = 0; i < nb_subfr >> 1; i++ ) { /* Calculate half frame LPC residual signal including preceding samples */ silk_LPC_analysis_filter( LPC_res, x_ptr, a_Q12[ i ], ( MAX_NB_SUBFR >> 1 ) * offset, LPC_order, arch ); diff --git a/thirdparty/opus/silk/fixed/schur64_FIX.c b/thirdparty/opus/silk/fixed/schur64_FIX.c index 764a10ef3e..4b7e19ea59 100644 --- a/thirdparty/opus/silk/fixed/schur64_FIX.c +++ b/thirdparty/opus/silk/fixed/schur64_FIX.c @@ -43,7 +43,7 @@ opus_int32 silk_schur64( /* O returns residual ene opus_int32 C[ SILK_MAX_ORDER_LPC + 1 ][ 2 ]; opus_int32 Ctmp1_Q30, Ctmp2_Q30, rc_tmp_Q31; - silk_assert( order==6||order==8||order==10||order==12||order==14||order==16 ); + celt_assert( order >= 0 && order <= SILK_MAX_ORDER_LPC ); /* Check for invalid input */ if( c[ 0 ] <= 0 ) { @@ -51,9 +51,10 @@ opus_int32 silk_schur64( /* O returns residual ene return 0; } - for( k = 0; k < order + 1; k++ ) { + k = 0; + do { C[ k ][ 0 ] = C[ k ][ 1 ] = c[ k ]; - } + } while( ++k <= order ); for( k = 0; k < order; k++ ) { /* Check that we won't be getting an unstable rc, otherwise stop here. */ diff --git a/thirdparty/opus/silk/fixed/schur_FIX.c b/thirdparty/opus/silk/fixed/schur_FIX.c index c4c0ef23b4..2840f6b1aa 100644 --- a/thirdparty/opus/silk/fixed/schur_FIX.c +++ b/thirdparty/opus/silk/fixed/schur_FIX.c @@ -43,28 +43,29 @@ opus_int32 silk_schur( /* O Returns residual ene opus_int32 C[ SILK_MAX_ORDER_LPC + 1 ][ 2 ]; opus_int32 Ctmp1, Ctmp2, rc_tmp_Q15; - silk_assert( order==6||order==8||order==10||order==12||order==14||order==16 ); + celt_assert( order >= 0 && order <= SILK_MAX_ORDER_LPC ); /* Get number of leading zeros */ lz = silk_CLZ32( c[ 0 ] ); /* Copy correlations and adjust level to Q30 */ + k = 0; if( lz < 2 ) { /* lz must be 1, so shift one to the right */ - for( k = 0; k < order + 1; k++ ) { + do { C[ k ][ 0 ] = C[ k ][ 1 ] = silk_RSHIFT( c[ k ], 1 ); - } + } while( ++k <= order ); } else if( lz > 2 ) { /* Shift to the left */ lz -= 2; - for( k = 0; k < order + 1; k++ ) { + do { C[ k ][ 0 ] = C[ k ][ 1 ] = silk_LSHIFT( c[ k ], lz ); - } + } while( ++k <= order ); } else { /* No need to shift */ - for( k = 0; k < order + 1; k++ ) { + do { C[ k ][ 0 ] = C[ k ][ 1 ] = c[ k ]; - } + } while( ++k <= order ); } for( k = 0; k < order; k++ ) { diff --git a/thirdparty/opus/silk/fixed/solve_LS_FIX.c b/thirdparty/opus/silk/fixed/solve_LS_FIX.c deleted file mode 100644 index 51d7d49d02..0000000000 --- a/thirdparty/opus/silk/fixed/solve_LS_FIX.c +++ /dev/null @@ -1,249 +0,0 @@ -/*********************************************************************** -Copyright (c) 2006-2011, Skype Limited. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -- Neither the name of Internet Society, IETF or IETF Trust, nor the -names of specific contributors, may be used to endorse or promote -products derived from this software without specific prior written -permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -***********************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main_FIX.h" -#include "stack_alloc.h" -#include "tuning_parameters.h" - -/*****************************/ -/* Internal function headers */ -/*****************************/ - -typedef struct { - opus_int32 Q36_part; - opus_int32 Q48_part; -} inv_D_t; - -/* Factorize square matrix A into LDL form */ -static OPUS_INLINE void silk_LDL_factorize_FIX( - opus_int32 *A, /* I/O Pointer to Symetric Square Matrix */ - opus_int M, /* I Size of Matrix */ - opus_int32 *L_Q16, /* I/O Pointer to Square Upper triangular Matrix */ - inv_D_t *inv_D /* I/O Pointer to vector holding inverted diagonal elements of D */ -); - -/* Solve Lx = b, when L is lower triangular and has ones on the diagonal */ -static OPUS_INLINE void silk_LS_SolveFirst_FIX( - const opus_int32 *L_Q16, /* I Pointer to Lower Triangular Matrix */ - opus_int M, /* I Dim of Matrix equation */ - const opus_int32 *b, /* I b Vector */ - opus_int32 *x_Q16 /* O x Vector */ -); - -/* Solve L^t*x = b, where L is lower triangular with ones on the diagonal */ -static OPUS_INLINE void silk_LS_SolveLast_FIX( - const opus_int32 *L_Q16, /* I Pointer to Lower Triangular Matrix */ - const opus_int M, /* I Dim of Matrix equation */ - const opus_int32 *b, /* I b Vector */ - opus_int32 *x_Q16 /* O x Vector */ -); - -static OPUS_INLINE void silk_LS_divide_Q16_FIX( - opus_int32 T[], /* I/O Numenator vector */ - inv_D_t *inv_D, /* I 1 / D vector */ - opus_int M /* I dimension */ -); - -/* Solves Ax = b, assuming A is symmetric */ -void silk_solve_LDL_FIX( - opus_int32 *A, /* I Pointer to symetric square matrix A */ - opus_int M, /* I Size of matrix */ - const opus_int32 *b, /* I Pointer to b vector */ - opus_int32 *x_Q16 /* O Pointer to x solution vector */ -) -{ - VARDECL( opus_int32, L_Q16 ); - opus_int32 Y[ MAX_MATRIX_SIZE ]; - inv_D_t inv_D[ MAX_MATRIX_SIZE ]; - SAVE_STACK; - - silk_assert( M <= MAX_MATRIX_SIZE ); - ALLOC( L_Q16, M * M, opus_int32 ); - - /*************************************************** - Factorize A by LDL such that A = L*D*L', - where L is lower triangular with ones on diagonal - ****************************************************/ - silk_LDL_factorize_FIX( A, M, L_Q16, inv_D ); - - /**************************************************** - * substitute D*L'*x = Y. ie: - L*D*L'*x = b => L*Y = b <=> Y = inv(L)*b - ******************************************************/ - silk_LS_SolveFirst_FIX( L_Q16, M, b, Y ); - - /**************************************************** - D*L'*x = Y <=> L'*x = inv(D)*Y, because D is - diagonal just multiply with 1/d_i - ****************************************************/ - silk_LS_divide_Q16_FIX( Y, inv_D, M ); - - /**************************************************** - x = inv(L') * inv(D) * Y - *****************************************************/ - silk_LS_SolveLast_FIX( L_Q16, M, Y, x_Q16 ); - RESTORE_STACK; -} - -static OPUS_INLINE void silk_LDL_factorize_FIX( - opus_int32 *A, /* I/O Pointer to Symetric Square Matrix */ - opus_int M, /* I Size of Matrix */ - opus_int32 *L_Q16, /* I/O Pointer to Square Upper triangular Matrix */ - inv_D_t *inv_D /* I/O Pointer to vector holding inverted diagonal elements of D */ -) -{ - opus_int i, j, k, status, loop_count; - const opus_int32 *ptr1, *ptr2; - opus_int32 diag_min_value, tmp_32, err; - opus_int32 v_Q0[ MAX_MATRIX_SIZE ], D_Q0[ MAX_MATRIX_SIZE ]; - opus_int32 one_div_diag_Q36, one_div_diag_Q40, one_div_diag_Q48; - - silk_assert( M <= MAX_MATRIX_SIZE ); - - status = 1; - diag_min_value = silk_max_32( silk_SMMUL( silk_ADD_SAT32( A[ 0 ], A[ silk_SMULBB( M, M ) - 1 ] ), SILK_FIX_CONST( FIND_LTP_COND_FAC, 31 ) ), 1 << 9 ); - for( loop_count = 0; loop_count < M && status == 1; loop_count++ ) { - status = 0; - for( j = 0; j < M; j++ ) { - ptr1 = matrix_adr( L_Q16, j, 0, M ); - tmp_32 = 0; - for( i = 0; i < j; i++ ) { - v_Q0[ i ] = silk_SMULWW( D_Q0[ i ], ptr1[ i ] ); /* Q0 */ - tmp_32 = silk_SMLAWW( tmp_32, v_Q0[ i ], ptr1[ i ] ); /* Q0 */ - } - tmp_32 = silk_SUB32( matrix_ptr( A, j, j, M ), tmp_32 ); - - if( tmp_32 < diag_min_value ) { - tmp_32 = silk_SUB32( silk_SMULBB( loop_count + 1, diag_min_value ), tmp_32 ); - /* Matrix not positive semi-definite, or ill conditioned */ - for( i = 0; i < M; i++ ) { - matrix_ptr( A, i, i, M ) = silk_ADD32( matrix_ptr( A, i, i, M ), tmp_32 ); - } - status = 1; - break; - } - D_Q0[ j ] = tmp_32; /* always < max(Correlation) */ - - /* two-step division */ - one_div_diag_Q36 = silk_INVERSE32_varQ( tmp_32, 36 ); /* Q36 */ - one_div_diag_Q40 = silk_LSHIFT( one_div_diag_Q36, 4 ); /* Q40 */ - err = silk_SUB32( (opus_int32)1 << 24, silk_SMULWW( tmp_32, one_div_diag_Q40 ) ); /* Q24 */ - one_div_diag_Q48 = silk_SMULWW( err, one_div_diag_Q40 ); /* Q48 */ - - /* Save 1/Ds */ - inv_D[ j ].Q36_part = one_div_diag_Q36; - inv_D[ j ].Q48_part = one_div_diag_Q48; - - matrix_ptr( L_Q16, j, j, M ) = 65536; /* 1.0 in Q16 */ - ptr1 = matrix_adr( A, j, 0, M ); - ptr2 = matrix_adr( L_Q16, j + 1, 0, M ); - for( i = j + 1; i < M; i++ ) { - tmp_32 = 0; - for( k = 0; k < j; k++ ) { - tmp_32 = silk_SMLAWW( tmp_32, v_Q0[ k ], ptr2[ k ] ); /* Q0 */ - } - tmp_32 = silk_SUB32( ptr1[ i ], tmp_32 ); /* always < max(Correlation) */ - - /* tmp_32 / D_Q0[j] : Divide to Q16 */ - matrix_ptr( L_Q16, i, j, M ) = silk_ADD32( silk_SMMUL( tmp_32, one_div_diag_Q48 ), - silk_RSHIFT( silk_SMULWW( tmp_32, one_div_diag_Q36 ), 4 ) ); - - /* go to next column */ - ptr2 += M; - } - } - } - - silk_assert( status == 0 ); -} - -static OPUS_INLINE void silk_LS_divide_Q16_FIX( - opus_int32 T[], /* I/O Numenator vector */ - inv_D_t *inv_D, /* I 1 / D vector */ - opus_int M /* I dimension */ -) -{ - opus_int i; - opus_int32 tmp_32; - opus_int32 one_div_diag_Q36, one_div_diag_Q48; - - for( i = 0; i < M; i++ ) { - one_div_diag_Q36 = inv_D[ i ].Q36_part; - one_div_diag_Q48 = inv_D[ i ].Q48_part; - - tmp_32 = T[ i ]; - T[ i ] = silk_ADD32( silk_SMMUL( tmp_32, one_div_diag_Q48 ), silk_RSHIFT( silk_SMULWW( tmp_32, one_div_diag_Q36 ), 4 ) ); - } -} - -/* Solve Lx = b, when L is lower triangular and has ones on the diagonal */ -static OPUS_INLINE void silk_LS_SolveFirst_FIX( - const opus_int32 *L_Q16, /* I Pointer to Lower Triangular Matrix */ - opus_int M, /* I Dim of Matrix equation */ - const opus_int32 *b, /* I b Vector */ - opus_int32 *x_Q16 /* O x Vector */ -) -{ - opus_int i, j; - const opus_int32 *ptr32; - opus_int32 tmp_32; - - for( i = 0; i < M; i++ ) { - ptr32 = matrix_adr( L_Q16, i, 0, M ); - tmp_32 = 0; - for( j = 0; j < i; j++ ) { - tmp_32 = silk_SMLAWW( tmp_32, ptr32[ j ], x_Q16[ j ] ); - } - x_Q16[ i ] = silk_SUB32( b[ i ], tmp_32 ); - } -} - -/* Solve L^t*x = b, where L is lower triangular with ones on the diagonal */ -static OPUS_INLINE void silk_LS_SolveLast_FIX( - const opus_int32 *L_Q16, /* I Pointer to Lower Triangular Matrix */ - const opus_int M, /* I Dim of Matrix equation */ - const opus_int32 *b, /* I b Vector */ - opus_int32 *x_Q16 /* O x Vector */ -) -{ - opus_int i, j; - const opus_int32 *ptr32; - opus_int32 tmp_32; - - for( i = M - 1; i >= 0; i-- ) { - ptr32 = matrix_adr( L_Q16, 0, i, M ); - tmp_32 = 0; - for( j = M - 1; j > i; j-- ) { - tmp_32 = silk_SMLAWW( tmp_32, ptr32[ silk_SMULBB( j, M ) ], x_Q16[ j ] ); - } - x_Q16[ i ] = silk_SUB32( b[ i ], tmp_32 ); - } -} diff --git a/thirdparty/opus/silk/fixed/structs_FIX.h b/thirdparty/opus/silk/fixed/structs_FIX.h index 3294b25128..2774a97b24 100644 --- a/thirdparty/opus/silk/fixed/structs_FIX.h +++ b/thirdparty/opus/silk/fixed/structs_FIX.h @@ -48,30 +48,16 @@ typedef struct { } silk_shape_state_FIX; /********************************/ -/* Prefilter state */ -/********************************/ -typedef struct { - opus_int16 sLTP_shp[ LTP_BUF_LENGTH ]; - opus_int32 sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; - opus_int sLTP_shp_buf_idx; - opus_int32 sLF_AR_shp_Q12; - opus_int32 sLF_MA_shp_Q12; - opus_int32 sHarmHP_Q2; - opus_int32 rand_seed; - opus_int lagPrev; -} silk_prefilter_state_FIX; - -/********************************/ /* Encoder state FIX */ /********************************/ typedef struct { silk_encoder_state sCmn; /* Common struct, shared with floating-point code */ silk_shape_state_FIX sShape; /* Shape state */ - silk_prefilter_state_FIX sPrefilt; /* Prefilter State */ /* Buffer for find pitch and noise shape analysis */ silk_DWORD_ALIGN opus_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */ opus_int LTPCorr_Q15; /* Normalized correlation from pitch lag estimator */ + opus_int32 resNrgSmth; } silk_encoder_state_FIX; /************************/ @@ -87,11 +73,8 @@ typedef struct { /* Noise shaping parameters */ /* Testing */ - silk_DWORD_ALIGN opus_int16 AR1_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; - silk_DWORD_ALIGN opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; + silk_DWORD_ALIGN opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ]; /* Packs two int16 coefficients per int32 value */ - opus_int GainsPre_Q14[ MAX_NB_SUBFR ]; - opus_int HarmBoost_Q14[ MAX_NB_SUBFR ]; opus_int Tilt_Q14[ MAX_NB_SUBFR ]; opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ]; opus_int Lambda_Q10; @@ -99,7 +82,6 @@ typedef struct { opus_int coding_quality_Q14; /* measures */ - opus_int sparseness_Q8; opus_int32 predGain_Q16; opus_int LTPredCodGain_Q7; opus_int32 ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */ diff --git a/thirdparty/opus/silk/fixed/warped_autocorrelation_FIX.c b/thirdparty/opus/silk/fixed/warped_autocorrelation_FIX.c index 6ca6c1184d..5c79553bc0 100644 --- a/thirdparty/opus/silk/fixed/warped_autocorrelation_FIX.c +++ b/thirdparty/opus/silk/fixed/warped_autocorrelation_FIX.c @@ -31,17 +31,14 @@ POSSIBILITY OF SUCH DAMAGE. #include "main_FIX.h" -#define QC 10 -#define QS 14 - #if defined(MIPSr1_ASM) #include "mips/warped_autocorrelation_FIX_mipsr1.h" #endif -#ifndef OVERRIDE_silk_warped_autocorrelation_FIX /* Autocorrelations for a warped frequency axis */ -void silk_warped_autocorrelation_FIX( +#ifndef OVERRIDE_silk_warped_autocorrelation_FIX_c +void silk_warped_autocorrelation_FIX_c( opus_int32 *corr, /* O Result [order + 1] */ opus_int *scale, /* O Scaling of the correlation vector */ const opus_int16 *input, /* I Input data to correlate */ @@ -56,7 +53,7 @@ void silk_warped_autocorrelation_FIX( opus_int64 corr_QC[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; /* Order must be even */ - silk_assert( ( order & 1 ) == 0 ); + celt_assert( ( order & 1 ) == 0 ); silk_assert( 2 * QS - QC >= 0 ); /* Loop over samples */ @@ -92,4 +89,4 @@ void silk_warped_autocorrelation_FIX( } silk_assert( corr_QC[ 0 ] >= 0 ); /* If breaking, decrease QC*/ } -#endif /* OVERRIDE_silk_warped_autocorrelation_FIX */ +#endif /* OVERRIDE_silk_warped_autocorrelation_FIX_c */ diff --git a/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c b/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse4_1.c index 3c3583c5fc..bbb1ce0fcc 100644 --- a/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse.c +++ b/thirdparty/opus/silk/fixed/x86/burg_modified_FIX_sse4_1.c @@ -72,7 +72,7 @@ void silk_burg_modified_sse4_1( __m128i FIRST_3210, LAST_3210, ATMP_3210, TMP1_3210, TMP2_3210, T1_3210, T2_3210, PTR_3210, SUBFR_3210, X1_3210, X2_3210; __m128i CONST1 = _mm_set1_epi32(1); - silk_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); + celt_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); /* Compute autocorrelations, added over subframes */ silk_sum_sqr_shift( &C0, &rshifts, x, nb_subfr * subfr_length ); diff --git a/thirdparty/opus/silk/fixed/x86/prefilter_FIX_sse.c b/thirdparty/opus/silk/fixed/x86/prefilter_FIX_sse.c deleted file mode 100644 index 488a603f5d..0000000000 --- a/thirdparty/opus/silk/fixed/x86/prefilter_FIX_sse.c +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (c) 2014, Cisco Systems, INC - Written by XiangMingZhu WeiZhou MinPeng YanWang - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <xmmintrin.h> -#include <emmintrin.h> -#include <smmintrin.h> -#include "main.h" -#include "celt/x86/x86cpu.h" - -void silk_warped_LPC_analysis_filter_FIX_sse4_1( - opus_int32 state[], /* I/O State [order + 1] */ - opus_int32 res_Q2[], /* O Residual signal [length] */ - const opus_int16 coef_Q13[], /* I Coefficients [order] */ - const opus_int16 input[], /* I Input signal [length] */ - const opus_int16 lambda_Q16, /* I Warping factor */ - const opus_int length, /* I Length of input signal */ - const opus_int order /* I Filter order (even) */ -) -{ - opus_int n, i; - opus_int32 acc_Q11, tmp1, tmp2; - - /* Order must be even */ - silk_assert( ( order & 1 ) == 0 ); - - if (order == 10) - { - if (0 == lambda_Q16) - { - __m128i coef_Q13_3210, coef_Q13_7654; - __m128i coef_Q13_0123, coef_Q13_4567; - __m128i state_0123, state_4567; - __m128i xmm_product1, xmm_product2; - __m128i xmm_tempa, xmm_tempb; - - register opus_int32 sum; - register opus_int32 state_8, state_9, state_a; - register opus_int64 coef_Q13_8, coef_Q13_9; - - silk_assert( length > 0 ); - - coef_Q13_3210 = OP_CVTEPI16_EPI32_M64( &coef_Q13[ 0 ] ); - coef_Q13_7654 = OP_CVTEPI16_EPI32_M64( &coef_Q13[ 4 ] ); - - coef_Q13_0123 = _mm_shuffle_epi32( coef_Q13_3210, _MM_SHUFFLE( 0, 1, 2, 3 ) ); - coef_Q13_4567 = _mm_shuffle_epi32( coef_Q13_7654, _MM_SHUFFLE( 0, 1, 2, 3 ) ); - - coef_Q13_8 = (opus_int64) coef_Q13[ 8 ]; - coef_Q13_9 = (opus_int64) coef_Q13[ 9 ]; - - state_0123 = _mm_loadu_si128( (__m128i *)(&state[ 0 ] ) ); - state_4567 = _mm_loadu_si128( (__m128i *)(&state[ 4 ] ) ); - - state_0123 = _mm_shuffle_epi32( state_0123, _MM_SHUFFLE( 0, 1, 2, 3 ) ); - state_4567 = _mm_shuffle_epi32( state_4567, _MM_SHUFFLE( 0, 1, 2, 3 ) ); - - state_8 = state[ 8 ]; - state_9 = state[ 9 ]; - state_a = 0; - - for( n = 0; n < length; n++ ) - { - xmm_product1 = _mm_mul_epi32( coef_Q13_0123, state_0123 ); /* 64-bit multiply, only 2 pairs */ - xmm_product2 = _mm_mul_epi32( coef_Q13_4567, state_4567 ); - - xmm_tempa = _mm_shuffle_epi32( state_0123, _MM_SHUFFLE( 0, 1, 2, 3 ) ); - xmm_tempb = _mm_shuffle_epi32( state_4567, _MM_SHUFFLE( 0, 1, 2, 3 ) ); - - xmm_product1 = _mm_srli_epi64( xmm_product1, 16 ); /* >> 16, zero extending works */ - xmm_product2 = _mm_srli_epi64( xmm_product2, 16 ); - - xmm_tempa = _mm_mul_epi32( coef_Q13_3210, xmm_tempa ); - xmm_tempb = _mm_mul_epi32( coef_Q13_7654, xmm_tempb ); - - xmm_tempa = _mm_srli_epi64( xmm_tempa, 16 ); - xmm_tempb = _mm_srli_epi64( xmm_tempb, 16 ); - - xmm_tempa = _mm_add_epi32( xmm_tempa, xmm_product1 ); - xmm_tempb = _mm_add_epi32( xmm_tempb, xmm_product2 ); - xmm_tempa = _mm_add_epi32( xmm_tempa, xmm_tempb ); - - sum = (coef_Q13_8 * state_8) >> 16; - sum += (coef_Q13_9 * state_9) >> 16; - - xmm_tempa = _mm_add_epi32( xmm_tempa, _mm_shuffle_epi32( xmm_tempa, _MM_SHUFFLE( 0, 0, 0, 2 ) ) ); - sum += _mm_cvtsi128_si32( xmm_tempa); - res_Q2[ n ] = silk_LSHIFT( (opus_int32)input[ n ], 2 ) - silk_RSHIFT_ROUND( ( 5 + sum ), 9); - - /* move right */ - state_a = state_9; - state_9 = state_8; - state_8 = _mm_cvtsi128_si32( state_4567 ); - state_4567 = _mm_alignr_epi8( state_0123, state_4567, 4 ); - - state_0123 = _mm_alignr_epi8( _mm_cvtsi32_si128( silk_LSHIFT( input[ n ], 14 ) ), state_0123, 4 ); - } - - _mm_storeu_si128( (__m128i *)( &state[ 0 ] ), _mm_shuffle_epi32( state_0123, _MM_SHUFFLE( 0, 1, 2, 3 ) ) ); - _mm_storeu_si128( (__m128i *)( &state[ 4 ] ), _mm_shuffle_epi32( state_4567, _MM_SHUFFLE( 0, 1, 2, 3 ) ) ); - state[ 8 ] = state_8; - state[ 9 ] = state_9; - state[ 10 ] = state_a; - - return; - } - } - - for( n = 0; n < length; n++ ) { - /* Output of lowpass section */ - tmp2 = silk_SMLAWB( state[ 0 ], state[ 1 ], lambda_Q16 ); - state[ 0 ] = silk_LSHIFT( input[ n ], 14 ); - /* Output of allpass section */ - tmp1 = silk_SMLAWB( state[ 1 ], state[ 2 ] - tmp2, lambda_Q16 ); - state[ 1 ] = tmp2; - acc_Q11 = silk_RSHIFT( order, 1 ); - acc_Q11 = silk_SMLAWB( acc_Q11, tmp2, coef_Q13[ 0 ] ); - /* Loop over allpass sections */ - for( i = 2; i < order; i += 2 ) { - /* Output of allpass section */ - tmp2 = silk_SMLAWB( state[ i ], state[ i + 1 ] - tmp1, lambda_Q16 ); - state[ i ] = tmp1; - acc_Q11 = silk_SMLAWB( acc_Q11, tmp1, coef_Q13[ i - 1 ] ); - /* Output of allpass section */ - tmp1 = silk_SMLAWB( state[ i + 1 ], state[ i + 2 ] - tmp2, lambda_Q16 ); - state[ i + 1 ] = tmp2; - acc_Q11 = silk_SMLAWB( acc_Q11, tmp2, coef_Q13[ i ] ); - } - state[ order ] = tmp1; - acc_Q11 = silk_SMLAWB( acc_Q11, tmp1, coef_Q13[ order - 1 ] ); - res_Q2[ n ] = silk_LSHIFT( (opus_int32)input[ n ], 2 ) - silk_RSHIFT_ROUND( acc_Q11, 9 ); - } -} diff --git a/thirdparty/opus/silk/fixed/x86/vector_ops_FIX_sse.c b/thirdparty/opus/silk/fixed/x86/vector_ops_FIX_sse4_1.c index c1e90564d0..c1e90564d0 100644 --- a/thirdparty/opus/silk/fixed/x86/vector_ops_FIX_sse.c +++ b/thirdparty/opus/silk/fixed/x86/vector_ops_FIX_sse4_1.c diff --git a/thirdparty/opus/silk/float/LPC_analysis_filter_FLP.c b/thirdparty/opus/silk/float/LPC_analysis_filter_FLP.c index cae89a0a18..0e1a1fed0f 100644 --- a/thirdparty/opus/silk/float/LPC_analysis_filter_FLP.c +++ b/thirdparty/opus/silk/float/LPC_analysis_filter_FLP.c @@ -215,7 +215,7 @@ void silk_LPC_analysis_filter_FLP( const opus_int Order /* I LPC order */ ) { - silk_assert( Order <= length ); + celt_assert( Order <= length ); switch( Order ) { case 6: @@ -239,7 +239,7 @@ void silk_LPC_analysis_filter_FLP( break; default: - silk_assert( 0 ); + celt_assert( 0 ); break; } diff --git a/thirdparty/opus/silk/float/LPC_inv_pred_gain_FLP.c b/thirdparty/opus/silk/float/LPC_inv_pred_gain_FLP.c index 25178bacdd..2be2122d61 100644 --- a/thirdparty/opus/silk/float/LPC_inv_pred_gain_FLP.c +++ b/thirdparty/opus/silk/float/LPC_inv_pred_gain_FLP.c @@ -31,8 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FIX.h" #include "SigProc_FLP.h" - -#define RC_THRESHOLD 0.9999f +#include "define.h" /* compute inverse of LPC prediction gain, and */ /* test if LPC coefficients are stable (all poles within unit circle) */ @@ -43,34 +42,32 @@ silk_float silk_LPC_inverse_pred_gain_FLP( /* O return inverse prediction ga ) { opus_int k, n; - double invGain, rc, rc_mult1, rc_mult2; - silk_float Atmp[ 2 ][ SILK_MAX_ORDER_LPC ]; - silk_float *Aold, *Anew; + double invGain, rc, rc_mult1, rc_mult2, tmp1, tmp2; + silk_float Atmp[ SILK_MAX_ORDER_LPC ]; - Anew = Atmp[ order & 1 ]; - silk_memcpy( Anew, A, order * sizeof(silk_float) ); + silk_memcpy( Atmp, A, order * sizeof(silk_float) ); invGain = 1.0; for( k = order - 1; k > 0; k-- ) { - rc = -Anew[ k ]; - if( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) { + rc = -Atmp[ k ]; + rc_mult1 = 1.0f - rc * rc; + invGain *= rc_mult1; + if( invGain * MAX_PREDICTION_POWER_GAIN < 1.0f ) { return 0.0f; } - rc_mult1 = 1.0f - rc * rc; rc_mult2 = 1.0f / rc_mult1; - invGain *= rc_mult1; - /* swap pointers */ - Aold = Anew; - Anew = Atmp[ k & 1 ]; - for( n = 0; n < k; n++ ) { - Anew[ n ] = (silk_float)( ( Aold[ n ] - Aold[ k - n - 1 ] * rc ) * rc_mult2 ); + for( n = 0; n < (k + 1) >> 1; n++ ) { + tmp1 = Atmp[ n ]; + tmp2 = Atmp[ k - n - 1 ]; + Atmp[ n ] = (silk_float)( ( tmp1 - tmp2 * rc ) * rc_mult2 ); + Atmp[ k - n - 1 ] = (silk_float)( ( tmp2 - tmp1 * rc ) * rc_mult2 ); } } - rc = -Anew[ 0 ]; - if( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) { - return 0.0f; - } + rc = -Atmp[ 0 ]; rc_mult1 = 1.0f - rc * rc; invGain *= rc_mult1; + if( invGain * MAX_PREDICTION_POWER_GAIN < 1.0f ) { + return 0.0f; + } return (silk_float)invGain; } diff --git a/thirdparty/opus/silk/float/SigProc_FLP.h b/thirdparty/opus/silk/float/SigProc_FLP.h index f0cb3733be..953de8b09e 100644 --- a/thirdparty/opus/silk/float/SigProc_FLP.h +++ b/thirdparty/opus/silk/float/SigProc_FLP.h @@ -68,13 +68,6 @@ void silk_k2a_FLP( opus_int32 order /* I prediction order */ ); -/* Solve the normal equations using the Levinson-Durbin recursion */ -silk_float silk_levinsondurbin_FLP( /* O prediction error energy */ - silk_float A[], /* O prediction coefficients [order] */ - const silk_float corr[], /* I input auto-correlations [order + 1] */ - const opus_int order /* I prediction order */ -); - /* compute autocorrelation */ void silk_autocorrelation_FLP( silk_float *results, /* O result (length correlationCount) */ diff --git a/thirdparty/opus/silk/float/apply_sine_window_FLP.c b/thirdparty/opus/silk/float/apply_sine_window_FLP.c index 6aae57c0ab..e49e717991 100644 --- a/thirdparty/opus/silk/float/apply_sine_window_FLP.c +++ b/thirdparty/opus/silk/float/apply_sine_window_FLP.c @@ -45,10 +45,10 @@ void silk_apply_sine_window_FLP( opus_int k; silk_float freq, c, S0, S1; - silk_assert( win_type == 1 || win_type == 2 ); + celt_assert( win_type == 1 || win_type == 2 ); /* Length must be multiple of 4 */ - silk_assert( ( length & 3 ) == 0 ); + celt_assert( ( length & 3 ) == 0 ); freq = PI / ( length + 1 ); diff --git a/thirdparty/opus/silk/float/burg_modified_FLP.c b/thirdparty/opus/silk/float/burg_modified_FLP.c index ea5dc25a93..756b76a35b 100644 --- a/thirdparty/opus/silk/float/burg_modified_FLP.c +++ b/thirdparty/opus/silk/float/burg_modified_FLP.c @@ -52,7 +52,7 @@ silk_float silk_burg_modified_FLP( /* O returns residual energy double CAf[ SILK_MAX_ORDER_LPC + 1 ], CAb[ SILK_MAX_ORDER_LPC + 1 ]; double Af[ SILK_MAX_ORDER_LPC ]; - silk_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); + celt_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); /* Compute autocorrelations, added over subframes */ C0 = silk_energy_FLP( x, nb_subfr * subfr_length ); diff --git a/thirdparty/opus/silk/float/encode_frame_FLP.c b/thirdparty/opus/silk/float/encode_frame_FLP.c index 2092a4d9e2..b029c3f5ca 100644 --- a/thirdparty/opus/silk/float/encode_frame_FLP.c +++ b/thirdparty/opus/silk/float/encode_frame_FLP.c @@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "config.h" #endif +#include <stdlib.h> #include "main_FLP.h" #include "tuning_parameters.h" @@ -41,21 +42,28 @@ static OPUS_INLINE void silk_LBRR_encode_FLP( ); void silk_encode_do_VAD_FLP( - silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + opus_int activity /* I Decision of Opus voice activity detector */ ) { + const opus_int activity_threshold = SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ); + /****************************/ /* Voice Activity Detection */ /****************************/ silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.arch ); + /* If Opus VAD is inactive and Silk VAD is active: lower Silk VAD to just under the threshold */ + if( activity == VAD_NO_ACTIVITY && psEnc->sCmn.speech_activity_Q8 >= activity_threshold ) { + psEnc->sCmn.speech_activity_Q8 = activity_threshold - 1; + } /**************************************************/ /* Convert speech activity into VAD and DTX flags */ /**************************************************/ - if( psEnc->sCmn.speech_activity_Q8 < SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ) ) { + if( psEnc->sCmn.speech_activity_Q8 < activity_threshold ) { psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY; psEnc->sCmn.noSpeechCounter++; - if( psEnc->sCmn.noSpeechCounter < NB_SPEECH_FRAMES_BEFORE_DTX ) { + if( psEnc->sCmn.noSpeechCounter <= NB_SPEECH_FRAMES_BEFORE_DTX ) { psEnc->sCmn.inDTX = 0; } else if( psEnc->sCmn.noSpeechCounter > MAX_CONSECUTIVE_DTX + NB_SPEECH_FRAMES_BEFORE_DTX ) { psEnc->sCmn.noSpeechCounter = NB_SPEECH_FRAMES_BEFORE_DTX; @@ -85,7 +93,6 @@ opus_int silk_encode_frame_FLP( silk_encoder_control_FLP sEncCtrl; opus_int i, iter, maxIter, found_upper, found_lower, ret = 0; silk_float *x_frame, *res_pitch_frame; - silk_float xfw[ MAX_FRAME_LENGTH ]; silk_float res_pitch[ 2 * MAX_FRAME_LENGTH + LA_PITCH_MAX ]; ec_enc sRangeEnc_copy, sRangeEnc_copy2; silk_nsq_state sNSQ_copy, sNSQ_copy2; @@ -97,6 +104,9 @@ opus_int silk_encode_frame_FLP( opus_int8 LastGainIndex_copy2; opus_int32 pGains_Q16[ MAX_NB_SUBFR ]; opus_uint8 ec_buf_copy[ 1275 ]; + opus_int gain_lock[ MAX_NB_SUBFR ] = {0}; + opus_int16 best_gain_mult[ MAX_NB_SUBFR ]; + opus_int best_sum[ MAX_NB_SUBFR ]; /* This is totally unnecessary but many compilers (including gcc) are too dumb to realise it */ LastGainIndex_copy2 = nBits_lower = nBits_upper = gainMult_lower = gainMult_upper = 0; @@ -139,22 +149,17 @@ opus_int silk_encode_frame_FLP( /***************************************************/ /* Find linear prediction coefficients (LPC + LTP) */ /***************************************************/ - silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding ); + silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame, condCoding ); /****************************************/ /* Process gains */ /****************************************/ silk_process_gains_FLP( psEnc, &sEncCtrl, condCoding ); - /*****************************************/ - /* Prefiltering for noise shaper */ - /*****************************************/ - silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame ); - /****************************************/ /* Low Bitrate Redundant Encoding */ /****************************************/ - silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw, condCoding ); + silk_LBRR_encode_FLP( psEnc, &sEncCtrl, x_frame, condCoding ); /* Loop over quantizer and entroy coding to control bitrate */ maxIter = 6; @@ -188,7 +193,11 @@ opus_int silk_encode_frame_FLP( /*****************************************/ /* Noise shaping quantization */ /*****************************************/ - silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulses, xfw ); + silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulses, x_frame ); + + if ( iter == maxIter && !found_lower ) { + silk_memcpy( &sRangeEnc_copy2, psRangeEnc, sizeof( ec_enc ) ); + } /****************************************/ /* Encode Parameters */ @@ -203,6 +212,33 @@ opus_int silk_encode_frame_FLP( nBits = ec_tell( psRangeEnc ); + /* If we still bust after the last iteration, do some damage control. */ + if ( iter == maxIter && !found_lower && nBits > maxBits ) { + silk_memcpy( psRangeEnc, &sRangeEnc_copy2, sizeof( ec_enc ) ); + + /* Keep gains the same as the last frame. */ + psEnc->sShape.LastGainIndex = sEncCtrl.lastGainIndexPrev; + for ( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { + psEnc->sCmn.indices.GainsIndices[ i ] = 4; + } + if (condCoding != CODE_CONDITIONALLY) { + psEnc->sCmn.indices.GainsIndices[ 0 ] = sEncCtrl.lastGainIndexPrev; + } + psEnc->sCmn.ec_prevLagIndex = ec_prevLagIndex_copy; + psEnc->sCmn.ec_prevSignalType = ec_prevSignalType_copy; + /* Clear all pulses. */ + for ( i = 0; i < psEnc->sCmn.frame_length; i++ ) { + psEnc->sCmn.pulses[ i ] = 0; + } + + silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesEncoded, 0, condCoding ); + + silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType, + psEnc->sCmn.pulses, psEnc->sCmn.frame_length ); + + nBits = ec_tell( psRangeEnc ); + } + if( useCBR == 0 && iter == 0 && nBits <= maxBits ) { break; } @@ -212,7 +248,7 @@ opus_int silk_encode_frame_FLP( if( found_lower && ( gainsID == gainsID_lower || nBits > maxBits ) ) { /* Restore output state from earlier iteration that did meet the bitrate budget */ silk_memcpy( psRangeEnc, &sRangeEnc_copy2, sizeof( ec_enc ) ); - silk_assert( sRangeEnc_copy2.offs <= 1275 ); + celt_assert( sRangeEnc_copy2.offs <= 1275 ); silk_memcpy( psRangeEnc->buf, ec_buf_copy, sRangeEnc_copy2.offs ); silk_memcpy( &psEnc->sCmn.sNSQ, &sNSQ_copy2, sizeof( silk_nsq_state ) ); psEnc->sShape.LastGainIndex = LastGainIndex_copy2; @@ -223,7 +259,9 @@ opus_int silk_encode_frame_FLP( if( nBits > maxBits ) { if( found_lower == 0 && iter >= 2 ) { /* Adjust the quantizer's rate/distortion tradeoff and discard previous "upper" results */ - sEncCtrl.Lambda *= 1.5f; + sEncCtrl.Lambda = silk_max_float(sEncCtrl.Lambda*1.5f, 1.5f); + /* Reducing dithering can help us hit the target. */ + psEnc->sCmn.indices.quantOffsetType = 0; found_upper = 0; gainsID_upper = -1; } else { @@ -240,7 +278,7 @@ opus_int silk_encode_frame_FLP( gainsID_lower = gainsID; /* Copy part of the output state */ silk_memcpy( &sRangeEnc_copy2, psRangeEnc, sizeof( ec_enc ) ); - silk_assert( psRangeEnc->offs <= 1275 ); + celt_assert( psRangeEnc->offs <= 1275 ); silk_memcpy( ec_buf_copy, psRangeEnc->buf, psRangeEnc->offs ); silk_memcpy( &sNSQ_copy2, &psEnc->sCmn.sNSQ, sizeof( silk_nsq_state ) ); LastGainIndex_copy2 = psEnc->sShape.LastGainIndex; @@ -250,15 +288,34 @@ opus_int silk_encode_frame_FLP( break; } + if ( !found_lower && nBits > maxBits ) { + int j; + for ( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { + int sum=0; + for ( j = i*psEnc->sCmn.subfr_length; j < (i+1)*psEnc->sCmn.subfr_length; j++ ) { + sum += abs( psEnc->sCmn.pulses[j] ); + } + if ( iter == 0 || (sum < best_sum[i] && !gain_lock[i]) ) { + best_sum[i] = sum; + best_gain_mult[i] = gainMult_Q8; + } else { + gain_lock[i] = 1; + } + } + } if( ( found_lower & found_upper ) == 0 ) { /* Adjust gain according to high-rate rate/distortion curve */ - opus_int32 gain_factor_Q16; - gain_factor_Q16 = silk_log2lin( silk_LSHIFT( nBits - maxBits, 7 ) / psEnc->sCmn.frame_length + SILK_FIX_CONST( 16, 7 ) ); - gain_factor_Q16 = silk_min_32( gain_factor_Q16, SILK_FIX_CONST( 2, 16 ) ); if( nBits > maxBits ) { - gain_factor_Q16 = silk_max_32( gain_factor_Q16, SILK_FIX_CONST( 1.3, 16 ) ); + if (gainMult_Q8 < 16384) { + gainMult_Q8 *= 2; + } else { + gainMult_Q8 = 32767; + } + } else { + opus_int32 gain_factor_Q16; + gain_factor_Q16 = silk_log2lin( silk_LSHIFT( nBits - maxBits, 7 ) / psEnc->sCmn.frame_length + SILK_FIX_CONST( 16, 7 ) ); + gainMult_Q8 = silk_SMULWB( gain_factor_Q16, gainMult_Q8 ); } - gainMult_Q8 = silk_SMULWB( gain_factor_Q16, gainMult_Q8 ); } else { /* Adjust gain by interpolating */ gainMult_Q8 = gainMult_lower + ( ( gainMult_upper - gainMult_lower ) * ( maxBits - nBits_lower ) ) / ( nBits_upper - nBits_lower ); @@ -272,7 +329,13 @@ opus_int silk_encode_frame_FLP( } for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { - pGains_Q16[ i ] = silk_LSHIFT_SAT32( silk_SMULWB( sEncCtrl.GainsUnq_Q16[ i ], gainMult_Q8 ), 8 ); + opus_int16 tmp; + if ( gain_lock[i] ) { + tmp = best_gain_mult[i]; + } else { + tmp = gainMult_Q8; + } + pGains_Q16[ i ] = silk_LSHIFT_SAT32( silk_SMULWB( sEncCtrl.GainsUnq_Q16[ i ], tmp ), 8 ); } /* Quantize gains */ diff --git a/thirdparty/opus/silk/float/energy_FLP.c b/thirdparty/opus/silk/float/energy_FLP.c index 24b8179f9e..7bc7173c9c 100644 --- a/thirdparty/opus/silk/float/energy_FLP.c +++ b/thirdparty/opus/silk/float/energy_FLP.c @@ -37,13 +37,12 @@ double silk_energy_FLP( opus_int dataSize ) { - opus_int i, dataSize4; + opus_int i; double result; /* 4x unrolled loop */ result = 0.0; - dataSize4 = dataSize & 0xFFFC; - for( i = 0; i < dataSize4; i += 4 ) { + for( i = 0; i < dataSize - 3; i += 4 ) { result += data[ i + 0 ] * (double)data[ i + 0 ] + data[ i + 1 ] * (double)data[ i + 1 ] + data[ i + 2 ] * (double)data[ i + 2 ] + diff --git a/thirdparty/opus/silk/float/find_LPC_FLP.c b/thirdparty/opus/silk/float/find_LPC_FLP.c index fcfe1c3681..fa3ffe7f8b 100644 --- a/thirdparty/opus/silk/float/find_LPC_FLP.c +++ b/thirdparty/opus/silk/float/find_LPC_FLP.c @@ -73,7 +73,7 @@ void silk_find_LPC_FLP( silk_interpolate( NLSF0_Q15, psEncC->prev_NLSFq_Q15, NLSF_Q15, k, psEncC->predictLPCOrder ); /* Convert to LPC for residual energy evaluation */ - silk_NLSF2A_FLP( a_tmp, NLSF0_Q15, psEncC->predictLPCOrder ); + silk_NLSF2A_FLP( a_tmp, NLSF0_Q15, psEncC->predictLPCOrder, psEncC->arch ); /* Calculate residual energy with LSF interpolation */ silk_LPC_analysis_filter_FLP( LPC_res, a_tmp, x, 2 * subfr_length, psEncC->predictLPCOrder ); @@ -99,6 +99,6 @@ void silk_find_LPC_FLP( silk_A2NLSF_FLP( NLSF_Q15, a, psEncC->predictLPCOrder ); } - silk_assert( psEncC->indices.NLSFInterpCoef_Q2 == 4 || + celt_assert( psEncC->indices.NLSFInterpCoef_Q2 == 4 || ( psEncC->useInterpolatedNLSFs && !psEncC->first_frame_after_reset && psEncC->nb_subfr == MAX_NB_SUBFR ) ); } diff --git a/thirdparty/opus/silk/float/find_LTP_FLP.c b/thirdparty/opus/silk/float/find_LTP_FLP.c index 7229996014..f97064930e 100644 --- a/thirdparty/opus/silk/float/find_LTP_FLP.c +++ b/thirdparty/opus/silk/float/find_LTP_FLP.c @@ -33,100 +33,32 @@ POSSIBILITY OF SUCH DAMAGE. #include "tuning_parameters.h" void silk_find_LTP_FLP( - silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ - silk_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ - silk_float *LTPredCodGain, /* O LTP coding gain */ - const silk_float r_lpc[], /* I LPC residual */ - const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ - const silk_float Wght[ MAX_NB_SUBFR ], /* I Weights */ + silk_float XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ + silk_float xX[ MAX_NB_SUBFR * LTP_ORDER ], /* O Weight for LTP quantization */ + const silk_float r_ptr[], /* I LPC residual */ + const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ const opus_int subfr_length, /* I Subframe length */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int mem_offset /* I Number of samples in LTP memory */ + const opus_int nb_subfr /* I number of subframes */ ) { - opus_int i, k; - silk_float *b_ptr, temp, *WLTP_ptr; - silk_float LPC_res_nrg, LPC_LTP_res_nrg; - silk_float d[ MAX_NB_SUBFR ], m, g, delta_b[ LTP_ORDER ]; - silk_float w[ MAX_NB_SUBFR ], nrg[ MAX_NB_SUBFR ], regu; - silk_float Rr[ LTP_ORDER ], rr[ MAX_NB_SUBFR ]; - const silk_float *r_ptr, *lag_ptr; + opus_int k; + silk_float *xX_ptr, *XX_ptr; + const silk_float *lag_ptr; + silk_float xx, temp; - b_ptr = b; - WLTP_ptr = WLTP; - r_ptr = &r_lpc[ mem_offset ]; + xX_ptr = xX; + XX_ptr = XX; for( k = 0; k < nb_subfr; k++ ) { lag_ptr = r_ptr - ( lag[ k ] + LTP_ORDER / 2 ); + silk_corrMatrix_FLP( lag_ptr, subfr_length, LTP_ORDER, XX_ptr ); + silk_corrVector_FLP( lag_ptr, r_ptr, subfr_length, LTP_ORDER, xX_ptr ); + xx = ( silk_float )silk_energy_FLP( r_ptr, subfr_length + LTP_ORDER ); + temp = 1.0f / silk_max( xx, LTP_CORR_INV_MAX * 0.5f * ( XX_ptr[ 0 ] + XX_ptr[ 24 ] ) + 1.0f ); + silk_scale_vector_FLP( XX_ptr, temp, LTP_ORDER * LTP_ORDER ); + silk_scale_vector_FLP( xX_ptr, temp, LTP_ORDER ); - silk_corrMatrix_FLP( lag_ptr, subfr_length, LTP_ORDER, WLTP_ptr ); - silk_corrVector_FLP( lag_ptr, r_ptr, subfr_length, LTP_ORDER, Rr ); - - rr[ k ] = ( silk_float )silk_energy_FLP( r_ptr, subfr_length ); - regu = 1.0f + rr[ k ] + - matrix_ptr( WLTP_ptr, 0, 0, LTP_ORDER ) + - matrix_ptr( WLTP_ptr, LTP_ORDER-1, LTP_ORDER-1, LTP_ORDER ); - regu *= LTP_DAMPING / 3; - silk_regularize_correlations_FLP( WLTP_ptr, &rr[ k ], regu, LTP_ORDER ); - silk_solve_LDL_FLP( WLTP_ptr, LTP_ORDER, Rr, b_ptr ); - - /* Calculate residual energy */ - nrg[ k ] = silk_residual_energy_covar_FLP( b_ptr, WLTP_ptr, Rr, rr[ k ], LTP_ORDER ); - - temp = Wght[ k ] / ( nrg[ k ] * Wght[ k ] + 0.01f * subfr_length ); - silk_scale_vector_FLP( WLTP_ptr, temp, LTP_ORDER * LTP_ORDER ); - w[ k ] = matrix_ptr( WLTP_ptr, LTP_ORDER / 2, LTP_ORDER / 2, LTP_ORDER ); - - r_ptr += subfr_length; - b_ptr += LTP_ORDER; - WLTP_ptr += LTP_ORDER * LTP_ORDER; - } - - /* Compute LTP coding gain */ - if( LTPredCodGain != NULL ) { - LPC_LTP_res_nrg = 1e-6f; - LPC_res_nrg = 0.0f; - for( k = 0; k < nb_subfr; k++ ) { - LPC_res_nrg += rr[ k ] * Wght[ k ]; - LPC_LTP_res_nrg += nrg[ k ] * Wght[ k ]; - } - - silk_assert( LPC_LTP_res_nrg > 0 ); - *LTPredCodGain = 3.0f * silk_log2( LPC_res_nrg / LPC_LTP_res_nrg ); - } - - /* Smoothing */ - /* d = sum( B, 1 ); */ - b_ptr = b; - for( k = 0; k < nb_subfr; k++ ) { - d[ k ] = 0; - for( i = 0; i < LTP_ORDER; i++ ) { - d[ k ] += b_ptr[ i ]; - } - b_ptr += LTP_ORDER; - } - /* m = ( w * d' ) / ( sum( w ) + 1e-3 ); */ - temp = 1e-3f; - for( k = 0; k < nb_subfr; k++ ) { - temp += w[ k ]; - } - m = 0; - for( k = 0; k < nb_subfr; k++ ) { - m += d[ k ] * w[ k ]; - } - m = m / temp; - - b_ptr = b; - for( k = 0; k < nb_subfr; k++ ) { - g = LTP_SMOOTHING / ( LTP_SMOOTHING + w[ k ] ) * ( m - d[ k ] ); - temp = 0; - for( i = 0; i < LTP_ORDER; i++ ) { - delta_b[ i ] = silk_max_float( b_ptr[ i ], 0.1f ); - temp += delta_b[ i ]; - } - temp = g / temp; - for( i = 0; i < LTP_ORDER; i++ ) { - b_ptr[ i ] = b_ptr[ i ] + delta_b[ i ] * temp; - } - b_ptr += LTP_ORDER; + r_ptr += subfr_length; + XX_ptr += LTP_ORDER * LTP_ORDER; + xX_ptr += LTP_ORDER; } } diff --git a/thirdparty/opus/silk/float/find_pitch_lags_FLP.c b/thirdparty/opus/silk/float/find_pitch_lags_FLP.c index f3b22d25ce..dedbcd2836 100644 --- a/thirdparty/opus/silk/float/find_pitch_lags_FLP.c +++ b/thirdparty/opus/silk/float/find_pitch_lags_FLP.c @@ -56,7 +56,7 @@ void silk_find_pitch_lags_FLP( buf_len = psEnc->sCmn.la_pitch + psEnc->sCmn.frame_length + psEnc->sCmn.ltp_mem_length; /* Safety check */ - silk_assert( buf_len >= psEnc->sCmn.pitch_LPC_win_length ); + celt_assert( buf_len >= psEnc->sCmn.pitch_LPC_win_length ); x_buf = x - psEnc->sCmn.ltp_mem_length; diff --git a/thirdparty/opus/silk/float/find_pred_coefs_FLP.c b/thirdparty/opus/silk/float/find_pred_coefs_FLP.c index 1af4fe5f1b..dcf7c5202d 100644 --- a/thirdparty/opus/silk/float/find_pred_coefs_FLP.c +++ b/thirdparty/opus/silk/float/find_pred_coefs_FLP.c @@ -41,8 +41,9 @@ void silk_find_pred_coefs_FLP( ) { opus_int i; - silk_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ]; - silk_float invGains[ MAX_NB_SUBFR ], Wght[ MAX_NB_SUBFR ]; + silk_float XXLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ]; + silk_float xXLTP[ MAX_NB_SUBFR * LTP_ORDER ]; + silk_float invGains[ MAX_NB_SUBFR ]; opus_int16 NLSF_Q15[ MAX_LPC_ORDER ]; const silk_float *x_ptr; silk_float *x_pre_ptr, LPC_in_pre[ MAX_NB_SUBFR * MAX_LPC_ORDER + MAX_FRAME_LENGTH ]; @@ -52,23 +53,20 @@ void silk_find_pred_coefs_FLP( for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { silk_assert( psEncCtrl->Gains[ i ] > 0.0f ); invGains[ i ] = 1.0f / psEncCtrl->Gains[ i ]; - Wght[ i ] = invGains[ i ] * invGains[ i ]; } if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) { /**********/ /* VOICED */ /**********/ - silk_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 ); + celt_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 ); /* LTP analysis */ - silk_find_LTP_FLP( psEncCtrl->LTPCoef, WLTP, &psEncCtrl->LTPredCodGain, res_pitch, - psEncCtrl->pitchL, Wght, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.ltp_mem_length ); + silk_find_LTP_FLP( XXLTP, xXLTP, res_pitch, psEncCtrl->pitchL, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr ); /* Quantize LTP gain parameters */ silk_quant_LTP_gains_FLP( psEncCtrl->LTPCoef, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex, - &psEnc->sCmn.sum_log_gain_Q7, WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sCmn.LTPQuantLowComplexity, psEnc->sCmn.nb_subfr, - psEnc->sCmn.arch ); + &psEnc->sCmn.sum_log_gain_Q7, &psEncCtrl->LTPredCodGain, XXLTP, xXLTP, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.arch ); /* Control LTP scaling */ silk_LTP_scale_ctrl_FLP( psEnc, psEncCtrl, condCoding ); diff --git a/thirdparty/opus/silk/float/inner_product_FLP.c b/thirdparty/opus/silk/float/inner_product_FLP.c index 029c012911..cdd39d24ce 100644 --- a/thirdparty/opus/silk/float/inner_product_FLP.c +++ b/thirdparty/opus/silk/float/inner_product_FLP.c @@ -38,13 +38,12 @@ double silk_inner_product_FLP( opus_int dataSize ) { - opus_int i, dataSize4; + opus_int i; double result; /* 4x unrolled loop */ result = 0.0; - dataSize4 = dataSize & 0xFFFC; - for( i = 0; i < dataSize4; i += 4 ) { + for( i = 0; i < dataSize - 3; i += 4 ) { result += data1[ i + 0 ] * (double)data2[ i + 0 ] + data1[ i + 1 ] * (double)data2[ i + 1 ] + data1[ i + 2 ] * (double)data2[ i + 2 ] + diff --git a/thirdparty/opus/silk/float/k2a_FLP.c b/thirdparty/opus/silk/float/k2a_FLP.c index 12af4e7669..1448008dbb 100644 --- a/thirdparty/opus/silk/float/k2a_FLP.c +++ b/thirdparty/opus/silk/float/k2a_FLP.c @@ -39,15 +39,16 @@ void silk_k2a_FLP( ) { opus_int k, n; - silk_float Atmp[ SILK_MAX_ORDER_LPC ]; + silk_float rck, tmp1, tmp2; for( k = 0; k < order; k++ ) { - for( n = 0; n < k; n++ ) { - Atmp[ n ] = A[ n ]; + rck = rc[ k ]; + for( n = 0; n < (k + 1) >> 1; n++ ) { + tmp1 = A[ n ]; + tmp2 = A[ k - n - 1 ]; + A[ n ] = tmp1 + tmp2 * rck; + A[ k - n - 1 ] = tmp2 + tmp1 * rck; } - for( n = 0; n < k; n++ ) { - A[ n ] += Atmp[ k - n - 1 ] * rc[ k ]; - } - A[ k ] = -rc[ k ]; + A[ k ] = -rck; } } diff --git a/thirdparty/opus/silk/float/levinsondurbin_FLP.c b/thirdparty/opus/silk/float/levinsondurbin_FLP.c deleted file mode 100644 index f0ba606981..0000000000 --- a/thirdparty/opus/silk/float/levinsondurbin_FLP.c +++ /dev/null @@ -1,81 +0,0 @@ -/*********************************************************************** -Copyright (c) 2006-2011, Skype Limited. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -- Neither the name of Internet Society, IETF or IETF Trust, nor the -names of specific contributors, may be used to endorse or promote -products derived from this software without specific prior written -permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -***********************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "SigProc_FLP.h" - -/* Solve the normal equations using the Levinson-Durbin recursion */ -silk_float silk_levinsondurbin_FLP( /* O prediction error energy */ - silk_float A[], /* O prediction coefficients [order] */ - const silk_float corr[], /* I input auto-correlations [order + 1] */ - const opus_int order /* I prediction order */ -) -{ - opus_int i, mHalf, m; - silk_float min_nrg, nrg, t, km, Atmp1, Atmp2; - - min_nrg = 1e-12f * corr[ 0 ] + 1e-9f; - nrg = corr[ 0 ]; - nrg = silk_max_float(min_nrg, nrg); - A[ 0 ] = corr[ 1 ] / nrg; - nrg -= A[ 0 ] * corr[ 1 ]; - nrg = silk_max_float(min_nrg, nrg); - - for( m = 1; m < order; m++ ) - { - t = corr[ m + 1 ]; - for( i = 0; i < m; i++ ) { - t -= A[ i ] * corr[ m - i ]; - } - - /* reflection coefficient */ - km = t / nrg; - - /* residual energy */ - nrg -= km * t; - nrg = silk_max_float(min_nrg, nrg); - - mHalf = m >> 1; - for( i = 0; i < mHalf; i++ ) { - Atmp1 = A[ i ]; - Atmp2 = A[ m - i - 1 ]; - A[ m - i - 1 ] -= km * Atmp1; - A[ i ] -= km * Atmp2; - } - if( m & 1 ) { - A[ mHalf ] -= km * A[ mHalf ]; - } - A[ m ] = km; - } - - /* return the residual energy */ - return nrg; -} - diff --git a/thirdparty/opus/silk/float/main_FLP.h b/thirdparty/opus/silk/float/main_FLP.h index e5a75972e5..5dc0ccf4a4 100644 --- a/thirdparty/opus/silk/float/main_FLP.h +++ b/thirdparty/opus/silk/float/main_FLP.h @@ -56,7 +56,8 @@ void silk_HP_variable_cutoff( /* Encoder main function */ void silk_encode_do_VAD_FLP( - silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + opus_int activity /* I Decision of Opus voice activity detector */ ); /* Encoder main function */ @@ -79,22 +80,11 @@ opus_int silk_init_encoder( opus_int silk_control_encoder( silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ silk_EncControlStruct *encControl, /* I Control structure */ - const opus_int32 TargetRate_bps, /* I Target max bitrate (bps) */ const opus_int allow_bw_switch, /* I Flag to allow switching audio bandwidth */ const opus_int channelNb, /* I Channel number */ const opus_int force_fs_kHz ); -/****************/ -/* Prefiltering */ -/****************/ -void silk_prefilter_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - const silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */ - silk_float xw[], /* O Weighted signal */ - const silk_float x[] /* I Speech signal */ -); - /**************************/ /* Noise shaping analysis */ /**************************/ @@ -153,15 +143,12 @@ void silk_find_LPC_FLP( /* LTP analysis */ void silk_find_LTP_FLP( - silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ - silk_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ - silk_float *LTPredCodGain, /* O LTP coding gain */ - const silk_float r_lpc[], /* I LPC residual */ + silk_float XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ + silk_float xX[ MAX_NB_SUBFR * LTP_ORDER ], /* O Weight for LTP quantization */ + const silk_float r_ptr[], /* I LPC residual */ const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ - const silk_float Wght[ MAX_NB_SUBFR ], /* I Weights */ const opus_int subfr_length, /* I Subframe length */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int mem_offset /* I Number of samples in LTP memory */ + const opus_int nb_subfr /* I number of subframes */ ); void silk_LTP_analysis_filter_FLP( @@ -198,14 +185,15 @@ void silk_LPC_analysis_filter_FLP( /* LTP tap quantizer */ void silk_quant_LTP_gains_FLP( - silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */ + silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* O Quantized LTP gains */ opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook index */ opus_int8 *periodicity_index, /* O Periodicity index */ opus_int32 *sum_log_gain_Q7, /* I/O Cumulative max prediction gain */ - const silk_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Error weights */ - const opus_int mu_Q10, /* I Mu value (R/D tradeoff) */ - const opus_int lowComplexity, /* I Flag for low complexity */ - const opus_int nb_subfr, /* I number of subframes */ + silk_float *pred_gain_dB, /* O LTP prediction gain */ + const silk_float XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Correlation matrix */ + const silk_float xX[ MAX_NB_SUBFR * LTP_ORDER ], /* I Correlation vector */ + const opus_int subfr_len, /* I Number of samples per subframe */ + const opus_int nb_subfr, /* I Number of subframes */ int arch /* I Run-time architecture */ ); @@ -245,22 +233,6 @@ void silk_corrVector_FLP( silk_float *Xt /* O X'*t correlation vector [order] */ ); -/* Add noise to matrix diagonal */ -void silk_regularize_correlations_FLP( - silk_float *XX, /* I/O Correlation matrices */ - silk_float *xx, /* I/O Correlation values */ - const silk_float noise, /* I Noise energy to add */ - const opus_int D /* I Dimension of XX */ -); - -/* Function to solve linear equation Ax = b, where A is an MxM symmetric matrix */ -void silk_solve_LDL_FLP( - silk_float *A, /* I/O Symmetric square matrix, out: reg. */ - const opus_int M, /* I Size of matrix */ - const silk_float *b, /* I Pointer to b vector */ - silk_float *x /* O Pointer to x solution vector */ -); - /* Apply sine window to signal vector. */ /* Window types: */ /* 1 -> sine window from 0 to pi/2 */ @@ -285,7 +257,8 @@ void silk_A2NLSF_FLP( void silk_NLSF2A_FLP( silk_float *pAR, /* O LPC coefficients [ LPC_order ] */ const opus_int16 *NLSF_Q15, /* I NLSF vector [ LPC_order ] */ - const opus_int LPC_order /* I LPC order */ + const opus_int LPC_order, /* I LPC order */ + int arch /* I Run-time architecture */ ); /* Limit, stabilize, and quantize NLSFs */ diff --git a/thirdparty/opus/silk/float/noise_shape_analysis_FLP.c b/thirdparty/opus/silk/float/noise_shape_analysis_FLP.c index 65f6ea5870..cb3d8a50b7 100644 --- a/thirdparty/opus/silk/float/noise_shape_analysis_FLP.c +++ b/thirdparty/opus/silk/float/noise_shape_analysis_FLP.c @@ -55,25 +55,21 @@ static OPUS_INLINE silk_float warped_gain( /* Convert warped filter coefficients to monic pseudo-warped coefficients and limit maximum */ /* amplitude of monic warped coefficients by using bandwidth expansion on the true coefficients */ static OPUS_INLINE void warped_true2monic_coefs( - silk_float *coefs_syn, - silk_float *coefs_ana, + silk_float *coefs, silk_float lambda, silk_float limit, opus_int order ) { opus_int i, iter, ind = 0; - silk_float tmp, maxabs, chirp, gain_syn, gain_ana; + silk_float tmp, maxabs, chirp, gain; /* Convert to monic coefficients */ for( i = order - 1; i > 0; i-- ) { - coefs_syn[ i - 1 ] -= lambda * coefs_syn[ i ]; - coefs_ana[ i - 1 ] -= lambda * coefs_ana[ i ]; + coefs[ i - 1 ] -= lambda * coefs[ i ]; } - gain_syn = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs_syn[ 0 ] ); - gain_ana = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs_ana[ 0 ] ); + gain = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs[ 0 ] ); for( i = 0; i < order; i++ ) { - coefs_syn[ i ] *= gain_syn; - coefs_ana[ i ] *= gain_ana; + coefs[ i ] *= gain; } /* Limit */ @@ -81,7 +77,7 @@ static OPUS_INLINE void warped_true2monic_coefs( /* Find maximum absolute value */ maxabs = -1.0f; for( i = 0; i < order; i++ ) { - tmp = silk_max( silk_abs_float( coefs_syn[ i ] ), silk_abs_float( coefs_ana[ i ] ) ); + tmp = silk_abs_float( coefs[ i ] ); if( tmp > maxabs ) { maxabs = tmp; ind = i; @@ -94,36 +90,59 @@ static OPUS_INLINE void warped_true2monic_coefs( /* Convert back to true warped coefficients */ for( i = 1; i < order; i++ ) { - coefs_syn[ i - 1 ] += lambda * coefs_syn[ i ]; - coefs_ana[ i - 1 ] += lambda * coefs_ana[ i ]; + coefs[ i - 1 ] += lambda * coefs[ i ]; } - gain_syn = 1.0f / gain_syn; - gain_ana = 1.0f / gain_ana; + gain = 1.0f / gain; for( i = 0; i < order; i++ ) { - coefs_syn[ i ] *= gain_syn; - coefs_ana[ i ] *= gain_ana; + coefs[ i ] *= gain; } /* Apply bandwidth expansion */ chirp = 0.99f - ( 0.8f + 0.1f * iter ) * ( maxabs - limit ) / ( maxabs * ( ind + 1 ) ); - silk_bwexpander_FLP( coefs_syn, order, chirp ); - silk_bwexpander_FLP( coefs_ana, order, chirp ); + silk_bwexpander_FLP( coefs, order, chirp ); /* Convert to monic warped coefficients */ for( i = order - 1; i > 0; i-- ) { - coefs_syn[ i - 1 ] -= lambda * coefs_syn[ i ]; - coefs_ana[ i - 1 ] -= lambda * coefs_ana[ i ]; + coefs[ i - 1 ] -= lambda * coefs[ i ]; } - gain_syn = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs_syn[ 0 ] ); - gain_ana = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs_ana[ 0 ] ); + gain = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs[ 0 ] ); for( i = 0; i < order; i++ ) { - coefs_syn[ i ] *= gain_syn; - coefs_ana[ i ] *= gain_ana; + coefs[ i ] *= gain; } } silk_assert( 0 ); } +static OPUS_INLINE void limit_coefs( + silk_float *coefs, + silk_float limit, + opus_int order +) { + opus_int i, iter, ind = 0; + silk_float tmp, maxabs, chirp; + + for( iter = 0; iter < 10; iter++ ) { + /* Find maximum absolute value */ + maxabs = -1.0f; + for( i = 0; i < order; i++ ) { + tmp = silk_abs_float( coefs[ i ] ); + if( tmp > maxabs ) { + maxabs = tmp; + ind = i; + } + } + if( maxabs <= limit ) { + /* Coefficients are within range - done */ + return; + } + + /* Apply bandwidth expansion */ + chirp = 0.99f - ( 0.8f + 0.1f * iter ) * ( maxabs - limit ) / ( maxabs * ( ind + 1 ) ); + silk_bwexpander_FLP( coefs, order, chirp ); + } + silk_assert( 0 ); +} + /* Compute noise shaping coefficients and initial gain values */ void silk_noise_shape_analysis_FLP( silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ @@ -133,12 +152,13 @@ void silk_noise_shape_analysis_FLP( ) { silk_shape_state_FLP *psShapeSt = &psEnc->sShape; - opus_int k, nSamples; - silk_float SNR_adj_dB, HarmBoost, HarmShapeGain, Tilt; - silk_float nrg, pre_nrg, log_energy, log_energy_prev, energy_variation; - silk_float delta, BWExp1, BWExp2, gain_mult, gain_add, strength, b, warping; + opus_int k, nSamples, nSegs; + silk_float SNR_adj_dB, HarmShapeGain, Tilt; + silk_float nrg, log_energy, log_energy_prev, energy_variation; + silk_float BWExp, gain_mult, gain_add, strength, b, warping; silk_float x_windowed[ SHAPE_LPC_WIN_MAX ]; silk_float auto_corr[ MAX_SHAPE_LPC_ORDER + 1 ]; + silk_float rc[ MAX_SHAPE_LPC_ORDER + 1 ]; const silk_float *x_ptr, *pitch_res_ptr; /* Point to start of first LPC analysis block */ @@ -176,14 +196,14 @@ void silk_noise_shape_analysis_FLP( if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) { /* Initially set to 0; may be overruled in process_gains(..) */ psEnc->sCmn.indices.quantOffsetType = 0; - psEncCtrl->sparseness = 0.0f; } else { /* Sparseness measure, based on relative fluctuations of energy per 2 milliseconds */ nSamples = 2 * psEnc->sCmn.fs_kHz; energy_variation = 0.0f; log_energy_prev = 0.0f; pitch_res_ptr = pitch_res; - for( k = 0; k < silk_SMULBB( SUB_FRAME_LENGTH_MS, psEnc->sCmn.nb_subfr ) / 2; k++ ) { + nSegs = silk_SMULBB( SUB_FRAME_LENGTH_MS, psEnc->sCmn.nb_subfr ) / 2; + for( k = 0; k < nSegs; k++ ) { nrg = ( silk_float )nSamples + ( silk_float )silk_energy_FLP( pitch_res_ptr, nSamples ); log_energy = silk_log2( nrg ); if( k > 0 ) { @@ -192,17 +212,13 @@ void silk_noise_shape_analysis_FLP( log_energy_prev = log_energy; pitch_res_ptr += nSamples; } - psEncCtrl->sparseness = silk_sigmoid( 0.4f * ( energy_variation - 5.0f ) ); /* Set quantization offset depending on sparseness measure */ - if( psEncCtrl->sparseness > SPARSENESS_THRESHOLD_QNT_OFFSET ) { + if( energy_variation > ENERGY_VARIATION_THRESHOLD_QNT_OFFSET * (nSegs-1) ) { psEnc->sCmn.indices.quantOffsetType = 0; } else { psEnc->sCmn.indices.quantOffsetType = 1; } - - /* Increase coding SNR for sparse signals */ - SNR_adj_dB += SPARSE_SNR_INCR_dB * ( psEncCtrl->sparseness - 0.5f ); } /*******************************/ @@ -210,19 +226,10 @@ void silk_noise_shape_analysis_FLP( /*******************************/ /* More BWE for signals with high prediction gain */ strength = FIND_PITCH_WHITE_NOISE_FRACTION * psEncCtrl->predGain; /* between 0.0 and 1.0 */ - BWExp1 = BWExp2 = BANDWIDTH_EXPANSION / ( 1.0f + strength * strength ); - delta = LOW_RATE_BANDWIDTH_EXPANSION_DELTA * ( 1.0f - 0.75f * psEncCtrl->coding_quality ); - BWExp1 -= delta; - BWExp2 += delta; - /* BWExp1 will be applied after BWExp2, so make it relative */ - BWExp1 /= BWExp2; - - if( psEnc->sCmn.warping_Q16 > 0 ) { - /* Slightly more warping in analysis will move quantization noise up in frequency, where it's better masked */ - warping = (silk_float)psEnc->sCmn.warping_Q16 / 65536.0f + 0.01f * psEncCtrl->coding_quality; - } else { - warping = 0.0f; - } + BWExp = BANDWIDTH_EXPANSION / ( 1.0f + strength * strength ); + + /* Slightly more warping in analysis will move quantization noise up in frequency, where it's better masked */ + warping = (silk_float)psEnc->sCmn.warping_Q16 / 65536.0f + 0.01f * psEncCtrl->coding_quality; /********************************************/ /* Compute noise shaping AR coefs and gains */ @@ -252,37 +259,28 @@ void silk_noise_shape_analysis_FLP( } /* Add white noise, as a fraction of energy */ - auto_corr[ 0 ] += auto_corr[ 0 ] * SHAPE_WHITE_NOISE_FRACTION; + auto_corr[ 0 ] += auto_corr[ 0 ] * SHAPE_WHITE_NOISE_FRACTION + 1.0f; /* Convert correlations to prediction coefficients, and compute residual energy */ - nrg = silk_levinsondurbin_FLP( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], auto_corr, psEnc->sCmn.shapingLPCOrder ); + nrg = silk_schur_FLP( rc, auto_corr, psEnc->sCmn.shapingLPCOrder ); + silk_k2a_FLP( &psEncCtrl->AR[ k * MAX_SHAPE_LPC_ORDER ], rc, psEnc->sCmn.shapingLPCOrder ); psEncCtrl->Gains[ k ] = ( silk_float )sqrt( nrg ); if( psEnc->sCmn.warping_Q16 > 0 ) { /* Adjust gain for warping */ - psEncCtrl->Gains[ k ] *= warped_gain( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], warping, psEnc->sCmn.shapingLPCOrder ); + psEncCtrl->Gains[ k ] *= warped_gain( &psEncCtrl->AR[ k * MAX_SHAPE_LPC_ORDER ], warping, psEnc->sCmn.shapingLPCOrder ); } /* Bandwidth expansion for synthesis filter shaping */ - silk_bwexpander_FLP( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder, BWExp2 ); - - /* Compute noise shaping filter coefficients */ - silk_memcpy( - &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ], - &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], - psEnc->sCmn.shapingLPCOrder * sizeof( silk_float ) ); + silk_bwexpander_FLP( &psEncCtrl->AR[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder, BWExp ); - /* Bandwidth expansion for analysis filter shaping */ - silk_bwexpander_FLP( &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder, BWExp1 ); - - /* Ratio of prediction gains, in energy domain */ - pre_nrg = silk_LPC_inverse_pred_gain_FLP( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder ); - nrg = silk_LPC_inverse_pred_gain_FLP( &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder ); - psEncCtrl->GainsPre[ k ] = 1.0f - 0.7f * ( 1.0f - pre_nrg / nrg ); - - /* Convert to monic warped prediction coefficients and limit absolute values */ - warped_true2monic_coefs( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ], - warping, 3.999f, psEnc->sCmn.shapingLPCOrder ); + if( psEnc->sCmn.warping_Q16 > 0 ) { + /* Convert to monic warped prediction coefficients and limit absolute values */ + warped_true2monic_coefs( &psEncCtrl->AR[ k * MAX_SHAPE_LPC_ORDER ], warping, 3.999f, psEnc->sCmn.shapingLPCOrder ); + } else { + /* Limit absolute values */ + limit_coefs( &psEncCtrl->AR[ k * MAX_SHAPE_LPC_ORDER ], 3.999f, psEnc->sCmn.shapingLPCOrder ); + } } /*****************/ @@ -296,11 +294,6 @@ void silk_noise_shape_analysis_FLP( psEncCtrl->Gains[ k ] += gain_add; } - gain_mult = 1.0f + INPUT_TILT + psEncCtrl->coding_quality * HIGH_RATE_INPUT_TILT; - for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) { - psEncCtrl->GainsPre[ k ] *= gain_mult; - } - /************************************************/ /* Control low-frequency shaping and noise tilt */ /************************************************/ @@ -331,12 +324,6 @@ void silk_noise_shape_analysis_FLP( /****************************/ /* HARMONIC SHAPING CONTROL */ /****************************/ - /* Control boosting of harmonic frequencies */ - HarmBoost = LOW_RATE_HARMONIC_BOOST * ( 1.0f - psEncCtrl->coding_quality ) * psEnc->LTPCorr; - - /* More harmonic boost for noisy input signals */ - HarmBoost += LOW_INPUT_QUALITY_HARMONIC_BOOST * ( 1.0f - psEncCtrl->input_quality ); - if( USE_HARM_SHAPING && psEnc->sCmn.indices.signalType == TYPE_VOICED ) { /* Harmonic noise shaping */ HarmShapeGain = HARMONIC_SHAPING; @@ -355,8 +342,6 @@ void silk_noise_shape_analysis_FLP( /* Smooth over subframes */ /*************************/ for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) { - psShapeSt->HarmBoost_smth += SUBFR_SMTH_COEF * ( HarmBoost - psShapeSt->HarmBoost_smth ); - psEncCtrl->HarmBoost[ k ] = psShapeSt->HarmBoost_smth; psShapeSt->HarmShapeGain_smth += SUBFR_SMTH_COEF * ( HarmShapeGain - psShapeSt->HarmShapeGain_smth ); psEncCtrl->HarmShapeGain[ k ] = psShapeSt->HarmShapeGain_smth; psShapeSt->Tilt_smth += SUBFR_SMTH_COEF * ( Tilt - psShapeSt->Tilt_smth ); diff --git a/thirdparty/opus/silk/float/pitch_analysis_core_FLP.c b/thirdparty/opus/silk/float/pitch_analysis_core_FLP.c index d0e637a29d..f351bc3718 100644 --- a/thirdparty/opus/silk/float/pitch_analysis_core_FLP.c +++ b/thirdparty/opus/silk/float/pitch_analysis_core_FLP.c @@ -109,11 +109,11 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, const opus_int8 *Lag_CB_ptr; /* Check for valid sampling frequency */ - silk_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 ); + celt_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 ); /* Check for valid complexity setting */ - silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); - silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); + celt_assert( complexity >= SILK_PE_MIN_COMPLEX ); + celt_assert( complexity <= SILK_PE_MAX_COMPLEX ); silk_assert( search_thres1 >= 0.0f && search_thres1 <= 1.0f ); silk_assert( search_thres2 >= 0.0f && search_thres2 <= 1.0f ); @@ -148,7 +148,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, silk_resampler_down2_3( filt_state, frame_8_FIX, frame_12_FIX, frame_length ); silk_short2float_array( frame_8kHz, frame_8_FIX, frame_length_8kHz ); } else { - silk_assert( Fs_kHz == 8 ); + celt_assert( Fs_kHz == 8 ); silk_float2short_array( frame_8_FIX, frame, frame_length_8kHz ); } @@ -159,7 +159,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, /* Low-pass filter */ for( i = frame_length_4kHz - 1; i > 0; i-- ) { - frame_4kHz[ i ] += frame_4kHz[ i - 1 ]; + frame_4kHz[ i ] = silk_ADD_SAT16( frame_4kHz[ i ], frame_4kHz[ i - 1 ] ); } /****************************************************************************** @@ -169,14 +169,14 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, target_ptr = &frame_4kHz[ silk_LSHIFT( sf_length_4kHz, 2 ) ]; for( k = 0; k < nb_subfr >> 1; k++ ) { /* Check that we are within range of the array */ - silk_assert( target_ptr >= frame_4kHz ); - silk_assert( target_ptr + sf_length_8kHz <= frame_4kHz + frame_length_4kHz ); + celt_assert( target_ptr >= frame_4kHz ); + celt_assert( target_ptr + sf_length_8kHz <= frame_4kHz + frame_length_4kHz ); basis_ptr = target_ptr - min_lag_4kHz; /* Check that we are within range of the array */ - silk_assert( basis_ptr >= frame_4kHz ); - silk_assert( basis_ptr + sf_length_8kHz <= frame_4kHz + frame_length_4kHz ); + celt_assert( basis_ptr >= frame_4kHz ); + celt_assert( basis_ptr + sf_length_8kHz <= frame_4kHz + frame_length_4kHz ); celt_pitch_xcorr( target_ptr, target_ptr-max_lag_4kHz, xcorr, sf_length_8kHz, max_lag_4kHz - min_lag_4kHz + 1, arch ); @@ -215,7 +215,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, /* Sort */ length_d_srch = 4 + 2 * complexity; - silk_assert( 3 * length_d_srch <= PE_D_SRCH_LENGTH ); + celt_assert( 3 * length_d_srch <= PE_D_SRCH_LENGTH ); silk_insertion_sort_decreasing_FLP( &C[ 0 ][ min_lag_4kHz ], d_srch, max_lag_4kHz - min_lag_4kHz + 1, length_d_srch ); /* Escape if correlation is very low already here */ @@ -238,7 +238,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, break; } } - silk_assert( length_d_srch > 0 ); + celt_assert( length_d_srch > 0 ); for( i = min_lag_8kHz - 5; i < max_lag_8kHz + 5; i++ ) { d_comp[ i ] = 0; @@ -471,7 +471,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, *lagIndex = (opus_int16)( lag - min_lag_8kHz ); *contourIndex = (opus_int8)CBimax; } - silk_assert( *lagIndex >= 0 ); + celt_assert( *lagIndex >= 0 ); /* return as voiced */ return 0; } @@ -506,8 +506,8 @@ static void silk_P_Ana_calc_corr_st3( opus_val32 xcorr[ SCRATCH_SIZE ]; const opus_int8 *Lag_range_ptr, *Lag_CB_ptr; - silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); - silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); + celt_assert( complexity >= SILK_PE_MIN_COMPLEX ); + celt_assert( complexity <= SILK_PE_MAX_COMPLEX ); if( nb_subfr == PE_MAX_NB_SUBFR ) { Lag_range_ptr = &silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ]; @@ -515,7 +515,7 @@ static void silk_P_Ana_calc_corr_st3( nb_cbk_search = silk_nb_cbk_searchs_stage3[ complexity ]; cbk_size = PE_NB_CBKS_STAGE3_MAX; } else { - silk_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1); + celt_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1); Lag_range_ptr = &silk_Lag_range_stage3_10_ms[ 0 ][ 0 ]; Lag_CB_ptr = &silk_CB_lags_stage3_10_ms[ 0 ][ 0 ]; nb_cbk_search = PE_NB_CBKS_STAGE3_10MS; @@ -572,8 +572,8 @@ static void silk_P_Ana_calc_energy_st3( silk_float scratch_mem[ SCRATCH_SIZE ]; const opus_int8 *Lag_range_ptr, *Lag_CB_ptr; - silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); - silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); + celt_assert( complexity >= SILK_PE_MIN_COMPLEX ); + celt_assert( complexity <= SILK_PE_MAX_COMPLEX ); if( nb_subfr == PE_MAX_NB_SUBFR ) { Lag_range_ptr = &silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ]; @@ -581,7 +581,7 @@ static void silk_P_Ana_calc_energy_st3( nb_cbk_search = silk_nb_cbk_searchs_stage3[ complexity ]; cbk_size = PE_NB_CBKS_STAGE3_MAX; } else { - silk_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1); + celt_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1); Lag_range_ptr = &silk_Lag_range_stage3_10_ms[ 0 ][ 0 ]; Lag_CB_ptr = &silk_CB_lags_stage3_10_ms[ 0 ][ 0 ]; nb_cbk_search = PE_NB_CBKS_STAGE3_10MS; diff --git a/thirdparty/opus/silk/float/prefilter_FLP.c b/thirdparty/opus/silk/float/prefilter_FLP.c deleted file mode 100644 index 8bc32fb410..0000000000 --- a/thirdparty/opus/silk/float/prefilter_FLP.c +++ /dev/null @@ -1,206 +0,0 @@ -/*********************************************************************** -Copyright (c) 2006-2011, Skype Limited. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -- Neither the name of Internet Society, IETF or IETF Trust, nor the -names of specific contributors, may be used to endorse or promote -products derived from this software without specific prior written -permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -***********************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main_FLP.h" -#include "tuning_parameters.h" - -/* -* Prefilter for finding Quantizer input signal -*/ -static OPUS_INLINE void silk_prefilt_FLP( - silk_prefilter_state_FLP *P, /* I/O state */ - silk_float st_res[], /* I */ - silk_float xw[], /* O */ - silk_float *HarmShapeFIR, /* I */ - silk_float Tilt, /* I */ - silk_float LF_MA_shp, /* I */ - silk_float LF_AR_shp, /* I */ - opus_int lag, /* I */ - opus_int length /* I */ -); - -static void silk_warped_LPC_analysis_filter_FLP( - silk_float state[], /* I/O State [order + 1] */ - silk_float res[], /* O Residual signal [length] */ - const silk_float coef[], /* I Coefficients [order] */ - const silk_float input[], /* I Input signal [length] */ - const silk_float lambda, /* I Warping factor */ - const opus_int length, /* I Length of input signal */ - const opus_int order /* I Filter order (even) */ -) -{ - opus_int n, i; - silk_float acc, tmp1, tmp2; - - /* Order must be even */ - silk_assert( ( order & 1 ) == 0 ); - - for( n = 0; n < length; n++ ) { - /* Output of lowpass section */ - tmp2 = state[ 0 ] + lambda * state[ 1 ]; - state[ 0 ] = input[ n ]; - /* Output of allpass section */ - tmp1 = state[ 1 ] + lambda * ( state[ 2 ] - tmp2 ); - state[ 1 ] = tmp2; - acc = coef[ 0 ] * tmp2; - /* Loop over allpass sections */ - for( i = 2; i < order; i += 2 ) { - /* Output of allpass section */ - tmp2 = state[ i ] + lambda * ( state[ i + 1 ] - tmp1 ); - state[ i ] = tmp1; - acc += coef[ i - 1 ] * tmp1; - /* Output of allpass section */ - tmp1 = state[ i + 1 ] + lambda * ( state[ i + 2 ] - tmp2 ); - state[ i + 1 ] = tmp2; - acc += coef[ i ] * tmp2; - } - state[ order ] = tmp1; - acc += coef[ order - 1 ] * tmp1; - res[ n ] = input[ n ] - acc; - } -} - -/* -* silk_prefilter. Main prefilter function -*/ -void silk_prefilter_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - const silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */ - silk_float xw[], /* O Weighted signal */ - const silk_float x[] /* I Speech signal */ -) -{ - silk_prefilter_state_FLP *P = &psEnc->sPrefilt; - opus_int j, k, lag; - silk_float HarmShapeGain, Tilt, LF_MA_shp, LF_AR_shp; - silk_float B[ 2 ]; - const silk_float *AR1_shp; - const silk_float *px; - silk_float *pxw; - silk_float HarmShapeFIR[ 3 ]; - silk_float st_res[ MAX_SUB_FRAME_LENGTH + MAX_LPC_ORDER ]; - - /* Set up pointers */ - px = x; - pxw = xw; - lag = P->lagPrev; - for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) { - /* Update Variables that change per sub frame */ - if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) { - lag = psEncCtrl->pitchL[ k ]; - } - - /* Noise shape parameters */ - HarmShapeGain = psEncCtrl->HarmShapeGain[ k ] * ( 1.0f - psEncCtrl->HarmBoost[ k ] ); - HarmShapeFIR[ 0 ] = 0.25f * HarmShapeGain; - HarmShapeFIR[ 1 ] = 32767.0f / 65536.0f * HarmShapeGain; - HarmShapeFIR[ 2 ] = 0.25f * HarmShapeGain; - Tilt = psEncCtrl->Tilt[ k ]; - LF_MA_shp = psEncCtrl->LF_MA_shp[ k ]; - LF_AR_shp = psEncCtrl->LF_AR_shp[ k ]; - AR1_shp = &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ]; - - /* Short term FIR filtering */ - silk_warped_LPC_analysis_filter_FLP( P->sAR_shp, st_res, AR1_shp, px, - (silk_float)psEnc->sCmn.warping_Q16 / 65536.0f, psEnc->sCmn.subfr_length, psEnc->sCmn.shapingLPCOrder ); - - /* Reduce (mainly) low frequencies during harmonic emphasis */ - B[ 0 ] = psEncCtrl->GainsPre[ k ]; - B[ 1 ] = -psEncCtrl->GainsPre[ k ] * - ( psEncCtrl->HarmBoost[ k ] * HarmShapeGain + INPUT_TILT + psEncCtrl->coding_quality * HIGH_RATE_INPUT_TILT ); - pxw[ 0 ] = B[ 0 ] * st_res[ 0 ] + B[ 1 ] * P->sHarmHP; - for( j = 1; j < psEnc->sCmn.subfr_length; j++ ) { - pxw[ j ] = B[ 0 ] * st_res[ j ] + B[ 1 ] * st_res[ j - 1 ]; - } - P->sHarmHP = st_res[ psEnc->sCmn.subfr_length - 1 ]; - - silk_prefilt_FLP( P, pxw, pxw, HarmShapeFIR, Tilt, LF_MA_shp, LF_AR_shp, lag, psEnc->sCmn.subfr_length ); - - px += psEnc->sCmn.subfr_length; - pxw += psEnc->sCmn.subfr_length; - } - P->lagPrev = psEncCtrl->pitchL[ psEnc->sCmn.nb_subfr - 1 ]; -} - -/* -* Prefilter for finding Quantizer input signal -*/ -static OPUS_INLINE void silk_prefilt_FLP( - silk_prefilter_state_FLP *P, /* I/O state */ - silk_float st_res[], /* I */ - silk_float xw[], /* O */ - silk_float *HarmShapeFIR, /* I */ - silk_float Tilt, /* I */ - silk_float LF_MA_shp, /* I */ - silk_float LF_AR_shp, /* I */ - opus_int lag, /* I */ - opus_int length /* I */ -) -{ - opus_int i; - opus_int idx, LTP_shp_buf_idx; - silk_float n_Tilt, n_LF, n_LTP; - silk_float sLF_AR_shp, sLF_MA_shp; - silk_float *LTP_shp_buf; - - /* To speed up use temp variables instead of using the struct */ - LTP_shp_buf = P->sLTP_shp; - LTP_shp_buf_idx = P->sLTP_shp_buf_idx; - sLF_AR_shp = P->sLF_AR_shp; - sLF_MA_shp = P->sLF_MA_shp; - - for( i = 0; i < length; i++ ) { - if( lag > 0 ) { - silk_assert( HARM_SHAPE_FIR_TAPS == 3 ); - idx = lag + LTP_shp_buf_idx; - n_LTP = LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 - 1) & LTP_MASK ] * HarmShapeFIR[ 0 ]; - n_LTP += LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 ) & LTP_MASK ] * HarmShapeFIR[ 1 ]; - n_LTP += LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 + 1) & LTP_MASK ] * HarmShapeFIR[ 2 ]; - } else { - n_LTP = 0; - } - - n_Tilt = sLF_AR_shp * Tilt; - n_LF = sLF_AR_shp * LF_AR_shp + sLF_MA_shp * LF_MA_shp; - - sLF_AR_shp = st_res[ i ] - n_Tilt; - sLF_MA_shp = sLF_AR_shp - n_LF; - - LTP_shp_buf_idx = ( LTP_shp_buf_idx - 1 ) & LTP_MASK; - LTP_shp_buf[ LTP_shp_buf_idx ] = sLF_MA_shp; - - xw[ i ] = sLF_MA_shp - n_LTP; - } - /* Copy temp variable back to state */ - P->sLF_AR_shp = sLF_AR_shp; - P->sLF_MA_shp = sLF_MA_shp; - P->sLTP_shp_buf_idx = LTP_shp_buf_idx; -} diff --git a/thirdparty/opus/silk/float/residual_energy_FLP.c b/thirdparty/opus/silk/float/residual_energy_FLP.c index b2e03a86a4..1bd07b33a4 100644 --- a/thirdparty/opus/silk/float/residual_energy_FLP.c +++ b/thirdparty/opus/silk/float/residual_energy_FLP.c @@ -47,7 +47,7 @@ silk_float silk_residual_energy_covar_FLP( /* O silk_float tmp, nrg = 0.0f, regularization; /* Safety checks */ - silk_assert( D >= 0 ); + celt_assert( D >= 0 ); regularization = REGULARIZATION_FACTOR * ( wXX[ 0 ] + wXX[ D * D - 1 ] ); for( k = 0; k < MAX_ITERATIONS_RESIDUAL_NRG; k++ ) { diff --git a/thirdparty/opus/silk/float/schur_FLP.c b/thirdparty/opus/silk/float/schur_FLP.c index ee436f8351..8526c748d3 100644 --- a/thirdparty/opus/silk/float/schur_FLP.c +++ b/thirdparty/opus/silk/float/schur_FLP.c @@ -38,22 +38,23 @@ silk_float silk_schur_FLP( /* O returns residual energy ) { opus_int k, n; - silk_float C[ SILK_MAX_ORDER_LPC + 1 ][ 2 ]; - silk_float Ctmp1, Ctmp2, rc_tmp; + double C[ SILK_MAX_ORDER_LPC + 1 ][ 2 ]; + double Ctmp1, Ctmp2, rc_tmp; - silk_assert( order==6||order==8||order==10||order==12||order==14||order==16 ); + celt_assert( order >= 0 && order <= SILK_MAX_ORDER_LPC ); /* Copy correlations */ - for( k = 0; k < order+1; k++ ) { + k = 0; + do { C[ k ][ 0 ] = C[ k ][ 1 ] = auto_corr[ k ]; - } + } while( ++k <= order ); for( k = 0; k < order; k++ ) { /* Get reflection coefficient */ rc_tmp = -C[ k + 1 ][ 0 ] / silk_max_float( C[ 0 ][ 1 ], 1e-9f ); /* Save the output */ - refl_coef[ k ] = rc_tmp; + refl_coef[ k ] = (silk_float)rc_tmp; /* Update correlations */ for( n = 0; n < order - k; n++ ) { @@ -65,6 +66,5 @@ silk_float silk_schur_FLP( /* O returns residual energy } /* Return residual energy */ - return C[ 0 ][ 1 ]; + return (silk_float)C[ 0 ][ 1 ]; } - diff --git a/thirdparty/opus/silk/float/solve_LS_FLP.c b/thirdparty/opus/silk/float/solve_LS_FLP.c deleted file mode 100644 index 7c90d665a0..0000000000 --- a/thirdparty/opus/silk/float/solve_LS_FLP.c +++ /dev/null @@ -1,207 +0,0 @@ -/*********************************************************************** -Copyright (c) 2006-2011, Skype Limited. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -- Neither the name of Internet Society, IETF or IETF Trust, nor the -names of specific contributors, may be used to endorse or promote -products derived from this software without specific prior written -permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -***********************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "main_FLP.h" -#include "tuning_parameters.h" - -/********************************************************************** - * LDL Factorisation. Finds the upper triangular matrix L and the diagonal - * Matrix D (only the diagonal elements returned in a vector)such that - * the symmetric matric A is given by A = L*D*L'. - **********************************************************************/ -static OPUS_INLINE void silk_LDL_FLP( - silk_float *A, /* I/O Pointer to Symetric Square Matrix */ - opus_int M, /* I Size of Matrix */ - silk_float *L, /* I/O Pointer to Square Upper triangular Matrix */ - silk_float *Dinv /* I/O Pointer to vector holding the inverse diagonal elements of D */ -); - -/********************************************************************** - * Function to solve linear equation Ax = b, when A is a MxM lower - * triangular matrix, with ones on the diagonal. - **********************************************************************/ -static OPUS_INLINE void silk_SolveWithLowerTriangularWdiagOnes_FLP( - const silk_float *L, /* I Pointer to Lower Triangular Matrix */ - opus_int M, /* I Dim of Matrix equation */ - const silk_float *b, /* I b Vector */ - silk_float *x /* O x Vector */ -); - -/********************************************************************** - * Function to solve linear equation (A^T)x = b, when A is a MxM lower - * triangular, with ones on the diagonal. (ie then A^T is upper triangular) - **********************************************************************/ -static OPUS_INLINE void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( - const silk_float *L, /* I Pointer to Lower Triangular Matrix */ - opus_int M, /* I Dim of Matrix equation */ - const silk_float *b, /* I b Vector */ - silk_float *x /* O x Vector */ -); - -/********************************************************************** - * Function to solve linear equation Ax = b, when A is a MxM - * symmetric square matrix - using LDL factorisation - **********************************************************************/ -void silk_solve_LDL_FLP( - silk_float *A, /* I/O Symmetric square matrix, out: reg. */ - const opus_int M, /* I Size of matrix */ - const silk_float *b, /* I Pointer to b vector */ - silk_float *x /* O Pointer to x solution vector */ -) -{ - opus_int i; - silk_float L[ MAX_MATRIX_SIZE ][ MAX_MATRIX_SIZE ]; - silk_float T[ MAX_MATRIX_SIZE ]; - silk_float Dinv[ MAX_MATRIX_SIZE ]; /* inverse diagonal elements of D*/ - - silk_assert( M <= MAX_MATRIX_SIZE ); - - /*************************************************** - Factorize A by LDL such that A = L*D*(L^T), - where L is lower triangular with ones on diagonal - ****************************************************/ - silk_LDL_FLP( A, M, &L[ 0 ][ 0 ], Dinv ); - - /**************************************************** - * substitute D*(L^T) = T. ie: - L*D*(L^T)*x = b => L*T = b <=> T = inv(L)*b - ******************************************************/ - silk_SolveWithLowerTriangularWdiagOnes_FLP( &L[ 0 ][ 0 ], M, b, T ); - - /**************************************************** - D*(L^T)*x = T <=> (L^T)*x = inv(D)*T, because D is - diagonal just multiply with 1/d_i - ****************************************************/ - for( i = 0; i < M; i++ ) { - T[ i ] = T[ i ] * Dinv[ i ]; - } - /**************************************************** - x = inv(L') * inv(D) * T - *****************************************************/ - silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( &L[ 0 ][ 0 ], M, T, x ); -} - -static OPUS_INLINE void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( - const silk_float *L, /* I Pointer to Lower Triangular Matrix */ - opus_int M, /* I Dim of Matrix equation */ - const silk_float *b, /* I b Vector */ - silk_float *x /* O x Vector */ -) -{ - opus_int i, j; - silk_float temp; - const silk_float *ptr1; - - for( i = M - 1; i >= 0; i-- ) { - ptr1 = matrix_adr( L, 0, i, M ); - temp = 0; - for( j = M - 1; j > i ; j-- ) { - temp += ptr1[ j * M ] * x[ j ]; - } - temp = b[ i ] - temp; - x[ i ] = temp; - } -} - -static OPUS_INLINE void silk_SolveWithLowerTriangularWdiagOnes_FLP( - const silk_float *L, /* I Pointer to Lower Triangular Matrix */ - opus_int M, /* I Dim of Matrix equation */ - const silk_float *b, /* I b Vector */ - silk_float *x /* O x Vector */ -) -{ - opus_int i, j; - silk_float temp; - const silk_float *ptr1; - - for( i = 0; i < M; i++ ) { - ptr1 = matrix_adr( L, i, 0, M ); - temp = 0; - for( j = 0; j < i; j++ ) { - temp += ptr1[ j ] * x[ j ]; - } - temp = b[ i ] - temp; - x[ i ] = temp; - } -} - -static OPUS_INLINE void silk_LDL_FLP( - silk_float *A, /* I/O Pointer to Symetric Square Matrix */ - opus_int M, /* I Size of Matrix */ - silk_float *L, /* I/O Pointer to Square Upper triangular Matrix */ - silk_float *Dinv /* I/O Pointer to vector holding the inverse diagonal elements of D */ -) -{ - opus_int i, j, k, loop_count, err = 1; - silk_float *ptr1, *ptr2; - double temp, diag_min_value; - silk_float v[ MAX_MATRIX_SIZE ], D[ MAX_MATRIX_SIZE ]; /* temp arrays*/ - - silk_assert( M <= MAX_MATRIX_SIZE ); - - diag_min_value = FIND_LTP_COND_FAC * 0.5f * ( A[ 0 ] + A[ M * M - 1 ] ); - for( loop_count = 0; loop_count < M && err == 1; loop_count++ ) { - err = 0; - for( j = 0; j < M; j++ ) { - ptr1 = matrix_adr( L, j, 0, M ); - temp = matrix_ptr( A, j, j, M ); /* element in row j column j*/ - for( i = 0; i < j; i++ ) { - v[ i ] = ptr1[ i ] * D[ i ]; - temp -= ptr1[ i ] * v[ i ]; - } - if( temp < diag_min_value ) { - /* Badly conditioned matrix: add white noise and run again */ - temp = ( loop_count + 1 ) * diag_min_value - temp; - for( i = 0; i < M; i++ ) { - matrix_ptr( A, i, i, M ) += ( silk_float )temp; - } - err = 1; - break; - } - D[ j ] = ( silk_float )temp; - Dinv[ j ] = ( silk_float )( 1.0f / temp ); - matrix_ptr( L, j, j, M ) = 1.0f; - - ptr1 = matrix_adr( A, j, 0, M ); - ptr2 = matrix_adr( L, j + 1, 0, M); - for( i = j + 1; i < M; i++ ) { - temp = 0.0; - for( k = 0; k < j; k++ ) { - temp += ptr2[ k ] * v[ k ]; - } - matrix_ptr( L, i, j, M ) = ( silk_float )( ( ptr1[ i ] - temp ) * Dinv[ j ] ); - ptr2 += M; /* go to next column*/ - } - } - } - silk_assert( err == 0 ); -} - diff --git a/thirdparty/opus/silk/float/sort_FLP.c b/thirdparty/opus/silk/float/sort_FLP.c index f08d7592c5..0e18f31950 100644 --- a/thirdparty/opus/silk/float/sort_FLP.c +++ b/thirdparty/opus/silk/float/sort_FLP.c @@ -47,9 +47,9 @@ void silk_insertion_sort_decreasing_FLP( opus_int i, j; /* Safety checks */ - silk_assert( K > 0 ); - silk_assert( L > 0 ); - silk_assert( L >= K ); + celt_assert( K > 0 ); + celt_assert( L > 0 ); + celt_assert( L >= K ); /* Write start indices in index vector */ for( i = 0; i < K; i++ ) { diff --git a/thirdparty/opus/silk/float/structs_FLP.h b/thirdparty/opus/silk/float/structs_FLP.h index 14d647ced2..3150b386e4 100644 --- a/thirdparty/opus/silk/float/structs_FLP.h +++ b/thirdparty/opus/silk/float/structs_FLP.h @@ -42,32 +42,16 @@ extern "C" /********************************/ typedef struct { opus_int8 LastGainIndex; - silk_float HarmBoost_smth; silk_float HarmShapeGain_smth; silk_float Tilt_smth; } silk_shape_state_FLP; /********************************/ -/* Prefilter state */ -/********************************/ -typedef struct { - silk_float sLTP_shp[ LTP_BUF_LENGTH ]; - silk_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; - opus_int sLTP_shp_buf_idx; - silk_float sLF_AR_shp; - silk_float sLF_MA_shp; - silk_float sHarmHP; - opus_int32 rand_seed; - opus_int lagPrev; -} silk_prefilter_state_FLP; - -/********************************/ /* Encoder state FLP */ /********************************/ typedef struct { silk_encoder_state sCmn; /* Common struct, shared with fixed-point code */ silk_shape_state_FLP sShape; /* Noise shaping state */ - silk_prefilter_state_FLP sPrefilt; /* Prefilter State */ /* Buffer for find pitch and noise shape analysis */ silk_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */ @@ -86,12 +70,9 @@ typedef struct { opus_int pitchL[ MAX_NB_SUBFR ]; /* Noise shaping parameters */ - silk_float AR1[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; - silk_float AR2[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; + silk_float AR[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; silk_float LF_MA_shp[ MAX_NB_SUBFR ]; silk_float LF_AR_shp[ MAX_NB_SUBFR ]; - silk_float GainsPre[ MAX_NB_SUBFR ]; - silk_float HarmBoost[ MAX_NB_SUBFR ]; silk_float Tilt[ MAX_NB_SUBFR ]; silk_float HarmShapeGain[ MAX_NB_SUBFR ]; silk_float Lambda; @@ -99,7 +80,6 @@ typedef struct { silk_float coding_quality; /* Measures */ - silk_float sparseness; silk_float predGain; silk_float LTPredCodGain; silk_float ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */ diff --git a/thirdparty/opus/silk/float/warped_autocorrelation_FLP.c b/thirdparty/opus/silk/float/warped_autocorrelation_FLP.c index 542414f48e..09186e73d4 100644 --- a/thirdparty/opus/silk/float/warped_autocorrelation_FLP.c +++ b/thirdparty/opus/silk/float/warped_autocorrelation_FLP.c @@ -42,11 +42,11 @@ void silk_warped_autocorrelation_FLP( { opus_int n, i; double tmp1, tmp2; - double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; - double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; + double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; + double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; /* Order must be even */ - silk_assert( ( order & 1 ) == 0 ); + celt_assert( ( order & 1 ) == 0 ); /* Loop over samples */ for( n = 0; n < length; n++ ) { diff --git a/thirdparty/opus/silk/float/wrappers_FLP.c b/thirdparty/opus/silk/float/wrappers_FLP.c index 6666b8efaa..ad90b874a4 100644 --- a/thirdparty/opus/silk/float/wrappers_FLP.c +++ b/thirdparty/opus/silk/float/wrappers_FLP.c @@ -54,13 +54,14 @@ void silk_A2NLSF_FLP( void silk_NLSF2A_FLP( silk_float *pAR, /* O LPC coefficients [ LPC_order ] */ const opus_int16 *NLSF_Q15, /* I NLSF vector [ LPC_order ] */ - const opus_int LPC_order /* I LPC order */ + const opus_int LPC_order, /* I LPC order */ + int arch /* I Run-time architecture */ ) { opus_int i; opus_int16 a_fix_Q12[ MAX_LPC_ORDER ]; - silk_NLSF2A( a_fix_Q12, NLSF_Q15, LPC_order ); + silk_NLSF2A( a_fix_Q12, NLSF_Q15, LPC_order, arch ); for( i = 0; i < LPC_order; i++ ) { pAR[ i ] = ( silk_float )a_fix_Q12[ i ] * ( 1.0f / 4096.0f ); @@ -102,14 +103,14 @@ void silk_NSQ_wrapper_FLP( ) { opus_int i, j; - opus_int32 x_Q3[ MAX_FRAME_LENGTH ]; + opus_int16 x16[ MAX_FRAME_LENGTH ]; opus_int32 Gains_Q16[ MAX_NB_SUBFR ]; silk_DWORD_ALIGN opus_int16 PredCoef_Q12[ 2 ][ MAX_LPC_ORDER ]; opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ]; opus_int LTP_scale_Q14; /* Noise shaping parameters */ - opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; + opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ]; /* Packs two int16 coefficients per int32 value */ opus_int Lambda_Q10; opus_int Tilt_Q14[ MAX_NB_SUBFR ]; @@ -119,7 +120,7 @@ void silk_NSQ_wrapper_FLP( /* Noise shape parameters */ for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { for( j = 0; j < psEnc->sCmn.shapingLPCOrder; j++ ) { - AR2_Q13[ i * MAX_SHAPE_LPC_ORDER + j ] = silk_float2int( psEncCtrl->AR2[ i * MAX_SHAPE_LPC_ORDER + j ] * 8192.0f ); + AR_Q13[ i * MAX_SHAPE_LPC_ORDER + j ] = silk_float2int( psEncCtrl->AR[ i * MAX_SHAPE_LPC_ORDER + j ] * 8192.0f ); } } @@ -155,16 +156,16 @@ void silk_NSQ_wrapper_FLP( /* Convert input to fix */ for( i = 0; i < psEnc->sCmn.frame_length; i++ ) { - x_Q3[ i ] = silk_float2int( 8.0f * x[ i ] ); + x16[ i ] = silk_float2int( x[ i ] ); } /* Call NSQ */ if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) { - silk_NSQ_del_dec( &psEnc->sCmn, psNSQ, psIndices, x_Q3, pulses, PredCoef_Q12[ 0 ], LTPCoef_Q14, - AR2_Q13, HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, psEncCtrl->pitchL, Lambda_Q10, LTP_scale_Q14, psEnc->sCmn.arch ); + silk_NSQ_del_dec( &psEnc->sCmn, psNSQ, psIndices, x16, pulses, PredCoef_Q12[ 0 ], LTPCoef_Q14, + AR_Q13, HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, psEncCtrl->pitchL, Lambda_Q10, LTP_scale_Q14, psEnc->sCmn.arch ); } else { - silk_NSQ( &psEnc->sCmn, psNSQ, psIndices, x_Q3, pulses, PredCoef_Q12[ 0 ], LTPCoef_Q14, - AR2_Q13, HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, psEncCtrl->pitchL, Lambda_Q10, LTP_scale_Q14, psEnc->sCmn.arch ); + silk_NSQ( &psEnc->sCmn, psNSQ, psIndices, x16, pulses, PredCoef_Q12[ 0 ], LTPCoef_Q14, + AR_Q13, HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, psEncCtrl->pitchL, Lambda_Q10, LTP_scale_Q14, psEnc->sCmn.arch ); } } @@ -172,31 +173,35 @@ void silk_NSQ_wrapper_FLP( /* Floating-point Silk LTP quantiation wrapper */ /***********************************************/ void silk_quant_LTP_gains_FLP( - silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */ + silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* O Quantized LTP gains */ opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook index */ opus_int8 *periodicity_index, /* O Periodicity index */ opus_int32 *sum_log_gain_Q7, /* I/O Cumulative max prediction gain */ - const silk_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Error weights */ - const opus_int mu_Q10, /* I Mu value (R/D tradeoff) */ - const opus_int lowComplexity, /* I Flag for low complexity */ - const opus_int nb_subfr, /* I number of subframes */ + silk_float *pred_gain_dB, /* O LTP prediction gain */ + const silk_float XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Correlation matrix */ + const silk_float xX[ MAX_NB_SUBFR * LTP_ORDER ], /* I Correlation vector */ + const opus_int subfr_len, /* I Number of samples per subframe */ + const opus_int nb_subfr, /* I Number of subframes */ int arch /* I Run-time architecture */ ) { - opus_int i; + opus_int i, pred_gain_dB_Q7; opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ]; - opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ]; + opus_int32 XX_Q17[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ]; + opus_int32 xX_Q17[ MAX_NB_SUBFR * LTP_ORDER ]; - for( i = 0; i < nb_subfr * LTP_ORDER; i++ ) { - B_Q14[ i ] = (opus_int16)silk_float2int( B[ i ] * 16384.0f ); - } for( i = 0; i < nb_subfr * LTP_ORDER * LTP_ORDER; i++ ) { - W_Q18[ i ] = (opus_int32)silk_float2int( W[ i ] * 262144.0f ); + XX_Q17[ i ] = (opus_int32)silk_float2int( XX[ i ] * 131072.0f ); + } + for( i = 0; i < nb_subfr * LTP_ORDER; i++ ) { + xX_Q17[ i ] = (opus_int32)silk_float2int( xX[ i ] * 131072.0f ); } - silk_quant_LTP_gains( B_Q14, cbk_index, periodicity_index, sum_log_gain_Q7, W_Q18, mu_Q10, lowComplexity, nb_subfr, arch ); + silk_quant_LTP_gains( B_Q14, cbk_index, periodicity_index, sum_log_gain_Q7, &pred_gain_dB_Q7, XX_Q17, xX_Q17, subfr_len, nb_subfr, arch ); for( i = 0; i < nb_subfr * LTP_ORDER; i++ ) { B[ i ] = (silk_float)B_Q14[ i ] * ( 1.0f / 16384.0f ); } + + *pred_gain_dB = (silk_float)pred_gain_dB_Q7 * ( 1.0f / 128.0f ); } diff --git a/thirdparty/opus/silk/gain_quant.c b/thirdparty/opus/silk/gain_quant.c index 64ccd0611b..ee65245aa3 100644 --- a/thirdparty/opus/silk/gain_quant.c +++ b/thirdparty/opus/silk/gain_quant.c @@ -76,6 +76,7 @@ void silk_gains_quant( /* Accumulate deltas */ if( ind[ k ] > double_step_size_threshold ) { *prev_ind += silk_LSHIFT( ind[ k ], 1 ) - double_step_size_threshold; + *prev_ind = silk_min_int( *prev_ind, N_LEVELS_QGAIN - 1 ); } else { *prev_ind += ind[ k ]; } diff --git a/thirdparty/opus/silk/init_decoder.c b/thirdparty/opus/silk/init_decoder.c index f887c67886..16c03dcd1c 100644 --- a/thirdparty/opus/silk/init_decoder.c +++ b/thirdparty/opus/silk/init_decoder.c @@ -44,6 +44,7 @@ opus_int silk_init_decoder( /* Used to deactivate LSF interpolation */ psDec->first_frame_after_reset = 1; psDec->prev_gain_Q16 = 65536; + psDec->arch = opus_select_arch(); /* Reset CNG state */ silk_CNG_Reset( psDec ); diff --git a/thirdparty/opus/silk/interpolate.c b/thirdparty/opus/silk/interpolate.c index 1bd8ca4d53..833c28ef8e 100644 --- a/thirdparty/opus/silk/interpolate.c +++ b/thirdparty/opus/silk/interpolate.c @@ -42,8 +42,8 @@ void silk_interpolate( { opus_int i; - silk_assert( ifact_Q2 >= 0 ); - silk_assert( ifact_Q2 <= 4 ); + celt_assert( ifact_Q2 >= 0 ); + celt_assert( ifact_Q2 <= 4 ); for( i = 0; i < d; i++ ) { xi[ i ] = (opus_int16)silk_ADD_RSHIFT( x0[ i ], silk_SMULBB( x1[ i ] - x0[ i ], ifact_Q2 ), 2 ); diff --git a/thirdparty/opus/silk/lin2log.c b/thirdparty/opus/silk/lin2log.c index d4fe515321..0d5155aa86 100644 --- a/thirdparty/opus/silk/lin2log.c +++ b/thirdparty/opus/silk/lin2log.c @@ -41,6 +41,6 @@ opus_int32 silk_lin2log( silk_CLZ_FRAC( inLin, &lz, &frac_Q7 ); /* Piece-wise parabolic approximation */ - return silk_LSHIFT( 31 - lz, 7 ) + silk_SMLAWB( frac_Q7, silk_MUL( frac_Q7, 128 - frac_Q7 ), 179 ); + return silk_ADD_LSHIFT32( silk_SMLAWB( frac_Q7, silk_MUL( frac_Q7, 128 - frac_Q7 ), 179 ), 31 - lz, 7 ); } diff --git a/thirdparty/opus/silk/macros.h b/thirdparty/opus/silk/macros.h index d3ca347520..3c67b6e5d9 100644 --- a/thirdparty/opus/silk/macros.h +++ b/thirdparty/opus/silk/macros.h @@ -36,14 +36,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "opus_defines.h" #include "arch.h" -#if OPUS_GNUC_PREREQ(3, 0) -#define opus_likely(x) (__builtin_expect(!!(x), 1)) -#define opus_unlikely(x) (__builtin_expect(!!(x), 0)) -#else -#define opus_likely(x) (!!(x)) -#define opus_unlikely(x) (!!(x)) -#endif - /* This is an OPUS_INLINE header file for general platform. */ /* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */ diff --git a/thirdparty/opus/silk/main.h b/thirdparty/opus/silk/main.h index 2f90d68f7d..1a33eed549 100644 --- a/thirdparty/opus/silk/main.h +++ b/thirdparty/opus/silk/main.h @@ -42,6 +42,10 @@ POSSIBILITY OF SUCH DAMAGE. #include "x86/main_sse.h" #endif +#if (defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR)) +#include "arm/NSQ_del_dec_arm.h" +#endif + /* Convert Left/Right stereo signal to adaptive Mid/Side representation */ void silk_stereo_LR_to_MS( stereo_enc_state *state, /* I/O State */ @@ -109,22 +113,22 @@ void silk_stereo_decode_mid_only( /* Encodes signs of excitation */ void silk_encode_signs( - ec_enc *psRangeEnc, /* I/O Compressor data structure */ - const opus_int8 pulses[], /* I pulse signal */ - opus_int length, /* I length of input */ - const opus_int signalType, /* I Signal type */ - const opus_int quantOffsetType, /* I Quantization offset type */ - const opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ] /* I Sum of absolute pulses per block */ + ec_enc *psRangeEnc, /* I/O Compressor data structure */ + const opus_int8 pulses[], /* I pulse signal */ + opus_int length, /* I length of input */ + const opus_int signalType, /* I Signal type */ + const opus_int quantOffsetType, /* I Quantization offset type */ + const opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ] /* I Sum of absolute pulses per block */ ); /* Decodes signs of excitation */ void silk_decode_signs( - ec_dec *psRangeDec, /* I/O Compressor data structure */ - opus_int16 pulses[], /* I/O pulse signal */ - opus_int length, /* I length of input */ - const opus_int signalType, /* I Signal type */ - const opus_int quantOffsetType, /* I Quantization offset type */ - const opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ] /* I Sum of absolute pulses per block */ + ec_dec *psRangeDec, /* I/O Compressor data structure */ + opus_int16 pulses[], /* I/O pulse signal */ + opus_int length, /* I length of input */ + const opus_int signalType, /* I Signal type */ + const opus_int quantOffsetType, /* I Quantization offset type */ + const opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ] /* I Sum of absolute pulses per block */ ); /* Check encoder control struct */ @@ -205,37 +209,37 @@ void silk_interpolate( /* LTP tap quantizer */ void silk_quant_LTP_gains( - opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (un)quantized LTP gains */ + opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O Quantized LTP gains */ opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook Index */ opus_int8 *periodicity_index, /* O Periodicity Index */ opus_int32 *sum_gain_dB_Q7, /* I/O Cumulative max prediction gain */ - const opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Error Weights in Q18 */ - opus_int mu_Q9, /* I Mu value (R/D tradeoff) */ - opus_int lowComplexity, /* I Flag for low complexity */ - const opus_int nb_subfr, /* I number of subframes */ + opus_int *pred_gain_dB_Q7, /* O LTP prediction gain */ + const opus_int32 XX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Correlation matrix in Q18 */ + const opus_int32 xX_Q17[ MAX_NB_SUBFR*LTP_ORDER ], /* I Correlation vector in Q18 */ + const opus_int subfr_len, /* I Number of samples per subframe */ + const opus_int nb_subfr, /* I Number of subframes */ int arch /* I Run-time architecture */ ); /* Entropy constrained matrix-weighted VQ, for a single input data vector */ void silk_VQ_WMat_EC_c( opus_int8 *ind, /* O index of best codebook vector */ - opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */ + opus_int32 *res_nrg_Q15, /* O best residual energy */ + opus_int32 *rate_dist_Q8, /* O best total bitrate */ opus_int *gain_Q7, /* O sum of absolute LTP coefficients */ - const opus_int16 *in_Q14, /* I input vector to be quantized */ - const opus_int32 *W_Q18, /* I weighting matrix */ + const opus_int32 *XX_Q17, /* I correlation matrix */ + const opus_int32 *xX_Q17, /* I correlation vector */ const opus_int8 *cb_Q7, /* I codebook */ const opus_uint8 *cb_gain_Q7, /* I codebook effective gain */ const opus_uint8 *cl_Q5, /* I code length for each codebook vector */ - const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */ + const opus_int subfr_len, /* I number of samples per subframe */ const opus_int32 max_gain_Q7, /* I maximum sum of absolute LTP coefficients */ - opus_int L /* I number of vectors in codebook */ + const opus_int L /* I number of vectors in codebook */ ); #if !defined(OVERRIDE_silk_VQ_WMat_EC) -#define silk_VQ_WMat_EC(ind, rate_dist_Q14, gain_Q7, in_Q14, W_Q18, cb_Q7, cb_gain_Q7, cl_Q5, \ - mu_Q9, max_gain_Q7, L, arch) \ - ((void)(arch),silk_VQ_WMat_EC_c(ind, rate_dist_Q14, gain_Q7, in_Q14, W_Q18, cb_Q7, cb_gain_Q7, cl_Q5, \ - mu_Q9, max_gain_Q7, L)) +#define silk_VQ_WMat_EC(ind, res_nrg_Q15, rate_dist_Q8, gain_Q7, XX_Q17, xX_Q17, cb_Q7, cb_gain_Q7, cl_Q5, subfr_len, max_gain_Q7, L, arch) \ + ((void)(arch),silk_VQ_WMat_EC_c(ind, res_nrg_Q15, rate_dist_Q8, gain_Q7, XX_Q17, xX_Q17, cb_Q7, cb_gain_Q7, cl_Q5, subfr_len, max_gain_Q7, L)) #endif /************************************/ @@ -243,14 +247,14 @@ void silk_VQ_WMat_EC_c( /************************************/ void silk_NSQ_c( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3[], /* I Prefiltered input signal */ + const opus_int16 x16[], /* I Input */ opus_int8 pulses[], /* O Quantized pulse signal */ const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefs */ const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I Long term prediction coefs */ - const opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ + const opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I Long term shaping coefs */ const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I Spectral tilt */ const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I Low frequency shaping coefs */ @@ -261,22 +265,22 @@ void silk_NSQ_c( ); #if !defined(OVERRIDE_silk_NSQ) -#define silk_NSQ(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ +#define silk_NSQ(psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, LTPCoef_Q14, AR_Q13, \ HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14, arch) \ - ((void)(arch),silk_NSQ_c(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ + ((void)(arch),silk_NSQ_c(psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, LTPCoef_Q14, AR_Q13, \ HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14)) #endif /* Noise shaping using delayed decision */ void silk_NSQ_del_dec_c( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ - const opus_int32 x_Q3[], /* I Prefiltered input signal */ + const opus_int16 x16[], /* I Input */ opus_int8 pulses[], /* O Quantized pulse signal */ const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefs */ const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I Long term prediction coefs */ - const opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ + const opus_int16 AR_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I Noise shaping coefs */ const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I Long term shaping coefs */ const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I Spectral tilt */ const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I Low frequency shaping coefs */ @@ -287,9 +291,9 @@ void silk_NSQ_del_dec_c( ); #if !defined(OVERRIDE_silk_NSQ_del_dec) -#define silk_NSQ_del_dec(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ +#define silk_NSQ_del_dec(psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, LTPCoef_Q14, AR_Q13, \ HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14, arch) \ - ((void)(arch),silk_NSQ_del_dec_c(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14, AR2_Q13, \ + ((void)(arch),silk_NSQ_del_dec_c(psEncC, NSQ, psIndices, x16, pulses, PredCoef_Q12, LTPCoef_Q14, AR_Q13, \ HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14)) #endif @@ -346,6 +350,7 @@ void silk_NLSF_VQ( opus_int32 err_Q26[], /* O Quantization errors [K] */ const opus_int16 in_Q15[], /* I Input vectors to be quantized [LPC_order] */ const opus_uint8 pCB_Q8[], /* I Codebook vectors [K*LPC_order] */ + const opus_int16 pWght_Q9[], /* I Codebook weights [K*LPC_order] */ const opus_int K, /* I Number of codebook vectors */ const opus_int LPC_order /* I Number of LPCs */ ); diff --git a/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h b/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h index ad1cfe2a9b..cd70713a8f 100644 --- a/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h +++ b/thirdparty/opus/silk/mips/NSQ_del_dec_mipsr1.h @@ -61,7 +61,7 @@ static inline void silk_noise_shape_quantizer_del_dec( opus_int predictLPCOrder, /* I Prediction filter order */ opus_int warping_Q16, /* I */ opus_int nStatesDelayedDecision, /* I Number of states in decision tree */ - opus_int *smpl_buf_idx, /* I Index to newest samples in buffers */ + opus_int *smpl_buf_idx, /* I/O Index to newest samples in buffers */ opus_int decisionDelay, /* I */ int arch /* I */ ) @@ -323,8 +323,9 @@ static inline void silk_noise_shape_quantizer_del_dec( psSS[ 1 ].xq_Q14 = xq_Q14; } - *smpl_buf_idx = ( *smpl_buf_idx - 1 ) & DECISION_DELAY_MASK; /* Index to newest samples */ - last_smple_idx = ( *smpl_buf_idx + decisionDelay ) & DECISION_DELAY_MASK; /* Index to decisionDelay old samples */ + *smpl_buf_idx = ( *smpl_buf_idx - 1 ) % DECISION_DELAY; + if( *smpl_buf_idx < 0 ) *smpl_buf_idx += DECISION_DELAY; + last_smple_idx = ( *smpl_buf_idx + decisionDelay ) % DECISION_DELAY; /* Find winner */ RDmin_Q10 = psSampleState[ 0 ][ 0 ].RD_Q10; diff --git a/thirdparty/opus/silk/mips/sigproc_fix_mipsr1.h b/thirdparty/opus/silk/mips/sigproc_fix_mipsr1.h index 3b0a695365..51520c0a6f 100644 --- a/thirdparty/opus/silk/mips/sigproc_fix_mipsr1.h +++ b/thirdparty/opus/silk/mips/sigproc_fix_mipsr1.h @@ -28,11 +28,6 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef SILK_SIGPROC_FIX_MIPSR1_H #define SILK_SIGPROC_FIX_MIPSR1_H -#ifdef __cplusplus -extern "C" -{ -#endif - #undef silk_SAT16 static inline short int silk_SAT16(int a) { diff --git a/thirdparty/opus/silk/process_NLSFs.c b/thirdparty/opus/silk/process_NLSFs.c index 0ab71f0163..d130809541 100644 --- a/thirdparty/opus/silk/process_NLSFs.c +++ b/thirdparty/opus/silk/process_NLSFs.c @@ -48,7 +48,7 @@ void silk_process_NLSFs( silk_assert( psEncC->speech_activity_Q8 >= 0 ); silk_assert( psEncC->speech_activity_Q8 <= SILK_FIX_CONST( 1.0, 8 ) ); - silk_assert( psEncC->useInterpolatedNLSFs == 1 || psEncC->indices.NLSFInterpCoef_Q2 == ( 1 << 2 ) ); + celt_assert( psEncC->useInterpolatedNLSFs == 1 || psEncC->indices.NLSFInterpCoef_Q2 == ( 1 << 2 ) ); /***********************/ /* Calculate mu values */ @@ -60,7 +60,7 @@ void silk_process_NLSFs( NLSF_mu_Q20 = silk_ADD_RSHIFT( NLSF_mu_Q20, NLSF_mu_Q20, 1 ); } - silk_assert( NLSF_mu_Q20 > 0 ); + celt_assert( NLSF_mu_Q20 > 0 ); silk_assert( NLSF_mu_Q20 <= SILK_FIX_CONST( 0.005, 20 ) ); /* Calculate NLSF weights */ @@ -89,7 +89,7 @@ void silk_process_NLSFs( NLSF_mu_Q20, psEncC->NLSF_MSVQ_Survivors, psEncC->indices.signalType ); /* Convert quantized NLSFs back to LPC coefficients */ - silk_NLSF2A( PredCoef_Q12[ 1 ], pNLSF_Q15, psEncC->predictLPCOrder ); + silk_NLSF2A( PredCoef_Q12[ 1 ], pNLSF_Q15, psEncC->predictLPCOrder, psEncC->arch ); if( doInterpolate ) { /* Calculate the interpolated, quantized LSF vector for the first half */ @@ -97,11 +97,11 @@ void silk_process_NLSFs( psEncC->indices.NLSFInterpCoef_Q2, psEncC->predictLPCOrder ); /* Convert back to LPC coefficients */ - silk_NLSF2A( PredCoef_Q12[ 0 ], pNLSF0_temp_Q15, psEncC->predictLPCOrder ); + silk_NLSF2A( PredCoef_Q12[ 0 ], pNLSF0_temp_Q15, psEncC->predictLPCOrder, psEncC->arch ); } else { /* Copy LPC coefficients for first half from second half */ - silk_assert( psEncC->predictLPCOrder <= MAX_LPC_ORDER ); + celt_assert( psEncC->predictLPCOrder <= MAX_LPC_ORDER ); silk_memcpy( PredCoef_Q12[ 0 ], PredCoef_Q12[ 1 ], psEncC->predictLPCOrder * sizeof( opus_int16 ) ); } } diff --git a/thirdparty/opus/silk/quant_LTP_gains.c b/thirdparty/opus/silk/quant_LTP_gains.c index 513a8c4468..d6b8eff8d1 100644 --- a/thirdparty/opus/silk/quant_LTP_gains.c +++ b/thirdparty/opus/silk/quant_LTP_gains.c @@ -33,14 +33,15 @@ POSSIBILITY OF SUCH DAMAGE. #include "tuning_parameters.h" void silk_quant_LTP_gains( - opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (un)quantized LTP gains */ + opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O Quantized LTP gains */ opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook Index */ opus_int8 *periodicity_index, /* O Periodicity Index */ opus_int32 *sum_log_gain_Q7, /* I/O Cumulative max prediction gain */ - const opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Error Weights in Q18 */ - opus_int mu_Q9, /* I Mu value (R/D tradeoff) */ - opus_int lowComplexity, /* I Flag for low complexity */ - const opus_int nb_subfr, /* I number of subframes */ + opus_int *pred_gain_dB_Q7, /* O LTP prediction gain */ + const opus_int32 XX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Correlation matrix in Q18 */ + const opus_int32 xX_Q17[ MAX_NB_SUBFR*LTP_ORDER ], /* I Correlation vector in Q18 */ + const opus_int subfr_len, /* I Number of samples per subframe */ + const opus_int nb_subfr, /* I Number of subframes */ int arch /* I Run-time architecture */ ) { @@ -49,16 +50,16 @@ void silk_quant_LTP_gains( const opus_uint8 *cl_ptr_Q5; const opus_int8 *cbk_ptr_Q7; const opus_uint8 *cbk_gain_ptr_Q7; - const opus_int16 *b_Q14_ptr; - const opus_int32 *W_Q18_ptr; - opus_int32 rate_dist_Q14_subfr, rate_dist_Q14, min_rate_dist_Q14; - opus_int32 sum_log_gain_tmp_Q7, best_sum_log_gain_Q7, max_gain_Q7, gain_Q7; + const opus_int32 *XX_Q17_ptr, *xX_Q17_ptr; + opus_int32 res_nrg_Q15_subfr, res_nrg_Q15, rate_dist_Q7_subfr, rate_dist_Q7, min_rate_dist_Q7; + opus_int32 sum_log_gain_tmp_Q7, best_sum_log_gain_Q7, max_gain_Q7; + opus_int gain_Q7; /***************************************************/ /* iterate over different codebooks with different */ /* rates/distortions, and choose best */ /***************************************************/ - min_rate_dist_Q14 = silk_int32_MAX; + min_rate_dist_Q7 = silk_int32_MAX; best_sum_log_gain_Q7 = 0; for( k = 0; k < 3; k++ ) { /* Safety margin for pitch gain control, to take into account factors @@ -70,53 +71,47 @@ void silk_quant_LTP_gains( cbk_gain_ptr_Q7 = silk_LTP_vq_gain_ptrs_Q7[ k ]; cbk_size = silk_LTP_vq_sizes[ k ]; - /* Set up pointer to first subframe */ - W_Q18_ptr = W_Q18; - b_Q14_ptr = B_Q14; + /* Set up pointers to first subframe */ + XX_Q17_ptr = XX_Q17; + xX_Q17_ptr = xX_Q17; - rate_dist_Q14 = 0; + res_nrg_Q15 = 0; + rate_dist_Q7 = 0; sum_log_gain_tmp_Q7 = *sum_log_gain_Q7; for( j = 0; j < nb_subfr; j++ ) { max_gain_Q7 = silk_log2lin( ( SILK_FIX_CONST( MAX_SUM_LOG_GAIN_DB / 6.0, 7 ) - sum_log_gain_tmp_Q7 ) + SILK_FIX_CONST( 7, 7 ) ) - gain_safety; - silk_VQ_WMat_EC( &temp_idx[ j ], /* O index of best codebook vector */ - &rate_dist_Q14_subfr, /* O best weighted quantization error + mu * rate */ + &res_nrg_Q15_subfr, /* O residual energy */ + &rate_dist_Q7_subfr, /* O best weighted quantization error + mu * rate */ &gain_Q7, /* O sum of absolute LTP coefficients */ - b_Q14_ptr, /* I input vector to be quantized */ - W_Q18_ptr, /* I weighting matrix */ + XX_Q17_ptr, /* I correlation matrix */ + xX_Q17_ptr, /* I correlation vector */ cbk_ptr_Q7, /* I codebook */ cbk_gain_ptr_Q7, /* I codebook effective gains */ cl_ptr_Q5, /* I code length for each codebook vector */ - mu_Q9, /* I tradeoff between weighted error and rate */ + subfr_len, /* I number of samples per subframe */ max_gain_Q7, /* I maximum sum of absolute LTP coefficients */ cbk_size, /* I number of vectors in codebook */ arch /* I Run-time architecture */ ); - rate_dist_Q14 = silk_ADD_POS_SAT32( rate_dist_Q14, rate_dist_Q14_subfr ); + res_nrg_Q15 = silk_ADD_POS_SAT32( res_nrg_Q15, res_nrg_Q15_subfr ); + rate_dist_Q7 = silk_ADD_POS_SAT32( rate_dist_Q7, rate_dist_Q7_subfr ); sum_log_gain_tmp_Q7 = silk_max(0, sum_log_gain_tmp_Q7 + silk_lin2log( gain_safety + gain_Q7 ) - SILK_FIX_CONST( 7, 7 )); - b_Q14_ptr += LTP_ORDER; - W_Q18_ptr += LTP_ORDER * LTP_ORDER; + XX_Q17_ptr += LTP_ORDER * LTP_ORDER; + xX_Q17_ptr += LTP_ORDER; } - /* Avoid never finding a codebook */ - rate_dist_Q14 = silk_min( silk_int32_MAX - 1, rate_dist_Q14 ); - - if( rate_dist_Q14 < min_rate_dist_Q14 ) { - min_rate_dist_Q14 = rate_dist_Q14; + if( rate_dist_Q7 <= min_rate_dist_Q7 ) { + min_rate_dist_Q7 = rate_dist_Q7; *periodicity_index = (opus_int8)k; silk_memcpy( cbk_index, temp_idx, nb_subfr * sizeof( opus_int8 ) ); best_sum_log_gain_Q7 = sum_log_gain_tmp_Q7; } - - /* Break early in low-complexity mode if rate distortion is below threshold */ - if( lowComplexity && ( rate_dist_Q14 < silk_LTP_gain_middle_avg_RD_Q14 ) ) { - break; - } } cbk_ptr_Q7 = silk_LTP_vq_ptrs_Q7[ *periodicity_index ]; @@ -125,5 +120,13 @@ void silk_quant_LTP_gains( B_Q14[ j * LTP_ORDER + k ] = silk_LSHIFT( cbk_ptr_Q7[ cbk_index[ j ] * LTP_ORDER + k ], 7 ); } } + + if( nb_subfr == 2 ) { + res_nrg_Q15 = silk_RSHIFT32( res_nrg_Q15, 1 ); + } else { + res_nrg_Q15 = silk_RSHIFT32( res_nrg_Q15, 2 ); + } + *sum_log_gain_Q7 = best_sum_log_gain_Q7; + *pred_gain_dB_Q7 = (opus_int)silk_SMULBB( -3, silk_lin2log( res_nrg_Q15 ) - ( 15 << 7 ) ); } diff --git a/thirdparty/opus/silk/resampler.c b/thirdparty/opus/silk/resampler.c index 374fbb3722..1f11e50891 100644 --- a/thirdparty/opus/silk/resampler.c +++ b/thirdparty/opus/silk/resampler.c @@ -91,14 +91,14 @@ opus_int silk_resampler_init( if( forEnc ) { if( ( Fs_Hz_in != 8000 && Fs_Hz_in != 12000 && Fs_Hz_in != 16000 && Fs_Hz_in != 24000 && Fs_Hz_in != 48000 ) || ( Fs_Hz_out != 8000 && Fs_Hz_out != 12000 && Fs_Hz_out != 16000 ) ) { - silk_assert( 0 ); + celt_assert( 0 ); return -1; } S->inputDelay = delay_matrix_enc[ rateID( Fs_Hz_in ) ][ rateID( Fs_Hz_out ) ]; } else { if( ( Fs_Hz_in != 8000 && Fs_Hz_in != 12000 && Fs_Hz_in != 16000 ) || ( Fs_Hz_out != 8000 && Fs_Hz_out != 12000 && Fs_Hz_out != 16000 && Fs_Hz_out != 24000 && Fs_Hz_out != 48000 ) ) { - silk_assert( 0 ); + celt_assert( 0 ); return -1; } S->inputDelay = delay_matrix_dec[ rateID( Fs_Hz_in ) ][ rateID( Fs_Hz_out ) ]; @@ -151,7 +151,7 @@ opus_int silk_resampler_init( S->Coefs = silk_Resampler_1_6_COEFS; } else { /* None available */ - silk_assert( 0 ); + celt_assert( 0 ); return -1; } } else { @@ -181,9 +181,9 @@ opus_int silk_resampler( opus_int nSamples; /* Need at least 1 ms of input data */ - silk_assert( inLen >= S->Fs_in_kHz ); + celt_assert( inLen >= S->Fs_in_kHz ); /* Delay can't exceed the 1 ms of buffering */ - silk_assert( S->inputDelay <= S->Fs_in_kHz ); + celt_assert( S->inputDelay <= S->Fs_in_kHz ); nSamples = S->Fs_in_kHz - S->inputDelay; diff --git a/thirdparty/opus/silk/resampler_down2.c b/thirdparty/opus/silk/resampler_down2.c index cec3634640..971d7bfd4a 100644 --- a/thirdparty/opus/silk/resampler_down2.c +++ b/thirdparty/opus/silk/resampler_down2.c @@ -43,8 +43,8 @@ void silk_resampler_down2( opus_int32 k, len2 = silk_RSHIFT32( inLen, 1 ); opus_int32 in32, out32, Y, X; - silk_assert( silk_resampler_down2_0 > 0 ); - silk_assert( silk_resampler_down2_1 < 0 ); + celt_assert( silk_resampler_down2_0 > 0 ); + celt_assert( silk_resampler_down2_1 < 0 ); /* Internal variables and state are in Q10 format */ for( k = 0; k < len2; k++ ) { diff --git a/thirdparty/opus/silk/resampler_private_down_FIR.c b/thirdparty/opus/silk/resampler_private_down_FIR.c index 783e42b356..3e8735a35a 100644 --- a/thirdparty/opus/silk/resampler_private_down_FIR.c +++ b/thirdparty/opus/silk/resampler_private_down_FIR.c @@ -136,7 +136,7 @@ static OPUS_INLINE opus_int16 *silk_resampler_private_down_FIR_INTERPOL( } break; default: - silk_assert( 0 ); + celt_assert( 0 ); } return out; } diff --git a/thirdparty/opus/silk/sort.c b/thirdparty/opus/silk/sort.c index 7187c9efb1..4fba16f831 100644 --- a/thirdparty/opus/silk/sort.c +++ b/thirdparty/opus/silk/sort.c @@ -48,9 +48,9 @@ void silk_insertion_sort_increasing( opus_int i, j; /* Safety checks */ - silk_assert( K > 0 ); - silk_assert( L > 0 ); - silk_assert( L >= K ); + celt_assert( K > 0 ); + celt_assert( L > 0 ); + celt_assert( L >= K ); /* Write start indices in index vector */ for( i = 0; i < K; i++ ) { @@ -96,9 +96,9 @@ void silk_insertion_sort_decreasing_int16( opus_int value; /* Safety checks */ - silk_assert( K > 0 ); - silk_assert( L > 0 ); - silk_assert( L >= K ); + celt_assert( K > 0 ); + celt_assert( L > 0 ); + celt_assert( L >= K ); /* Write start indices in index vector */ for( i = 0; i < K; i++ ) { @@ -141,7 +141,7 @@ void silk_insertion_sort_increasing_all_values_int16( opus_int i, j; /* Safety checks */ - silk_assert( L > 0 ); + celt_assert( L > 0 ); /* Sort vector elements by value, increasing order */ for( i = 1; i < L; i++ ) { diff --git a/thirdparty/opus/silk/stereo_LR_to_MS.c b/thirdparty/opus/silk/stereo_LR_to_MS.c index dda0298de2..c8226663c8 100644 --- a/thirdparty/opus/silk/stereo_LR_to_MS.c +++ b/thirdparty/opus/silk/stereo_LR_to_MS.c @@ -109,7 +109,7 @@ void silk_stereo_LR_to_MS( if( total_rate_bps < 1 ) { total_rate_bps = 1; } - min_mid_rate_bps = silk_SMLABB( 2000, fs_kHz, 900 ); + min_mid_rate_bps = silk_SMLABB( 2000, fs_kHz, 600 ); silk_assert( min_mid_rate_bps < 32767 ); /* Default bitrate distribution: 8 parts for Mid and (5+3*frac) parts for Side. so: mid_rate = ( 8 / ( 13 + 3 * frac ) ) * total_ rate */ frac_3_Q16 = silk_MUL( 3, frac_Q16 ); diff --git a/thirdparty/opus/silk/stereo_encode_pred.c b/thirdparty/opus/silk/stereo_encode_pred.c index e6dd195066..03becb6736 100644 --- a/thirdparty/opus/silk/stereo_encode_pred.c +++ b/thirdparty/opus/silk/stereo_encode_pred.c @@ -41,11 +41,11 @@ void silk_stereo_encode_pred( /* Entropy coding */ n = 5 * ix[ 0 ][ 2 ] + ix[ 1 ][ 2 ]; - silk_assert( n < 25 ); + celt_assert( n < 25 ); ec_enc_icdf( psRangeEnc, n, silk_stereo_pred_joint_iCDF, 8 ); for( n = 0; n < 2; n++ ) { - silk_assert( ix[ n ][ 0 ] < 3 ); - silk_assert( ix[ n ][ 1 ] < STEREO_QUANT_SUB_STEPS ); + celt_assert( ix[ n ][ 0 ] < 3 ); + celt_assert( ix[ n ][ 1 ] < STEREO_QUANT_SUB_STEPS ); ec_enc_icdf( psRangeEnc, ix[ n ][ 0 ], silk_uniform3_iCDF, 8 ); ec_enc_icdf( psRangeEnc, ix[ n ][ 1 ], silk_uniform5_iCDF, 8 ); } diff --git a/thirdparty/opus/silk/structs.h b/thirdparty/opus/silk/structs.h index 827829dc6f..3380c757b2 100644 --- a/thirdparty/opus/silk/structs.h +++ b/thirdparty/opus/silk/structs.h @@ -48,6 +48,7 @@ typedef struct { opus_int32 sLPC_Q14[ MAX_SUB_FRAME_LENGTH + NSQ_LPC_BUF_LENGTH ]; opus_int32 sAR2_Q14[ MAX_SHAPE_LPC_ORDER ]; opus_int32 sLF_AR_shp_Q14; + opus_int32 sDiff_shp_Q14; opus_int lagPrev; opus_int sLTP_buf_idx; opus_int sLTP_shp_buf_idx; @@ -77,6 +78,7 @@ typedef struct { opus_int32 In_LP_State[ 2 ]; /* Low pass filter state */ opus_int32 transition_frame_no; /* Counter which is mapped to a cut-off frequency */ opus_int mode; /* Operating mode, <0: switch down, >0: switch up; 0: do nothing */ + opus_int32 saved_fs_kHz; /* If non-zero, holds the last sampling rate before a bandwidth switching reset. */ } silk_LP_state; /* Structure containing NLSF codebook */ @@ -86,6 +88,7 @@ typedef struct { const opus_int16 quantStepSize_Q16; const opus_int16 invQuantStepSize_Q6; const opus_uint8 *CB1_NLSF_Q8; + const opus_int16 *CB1_Wght_Q9; const opus_uint8 *CB1_iCDF; const opus_uint8 *pred_Q8; const opus_uint8 *ec_sel; @@ -169,8 +172,6 @@ typedef struct { opus_int pitchEstimationComplexity; /* Complexity level for pitch estimator */ opus_int pitchEstimationLPCOrder; /* Whitening filter order for pitch estimator */ opus_int32 pitchEstimationThreshold_Q16; /* Threshold for pitch estimator */ - opus_int LTPQuantLowComplexity; /* Flag for low complexity LTP quantization */ - opus_int mu_LTP_Q9; /* Rate-distortion tradeoff in LTP quantization */ opus_int32 sum_log_gain_Q7; /* Cumulative max prediction gain */ opus_int NLSF_MSVQ_Survivors; /* Number of survivors in NLSF MSVQ */ opus_int first_frame_after_reset; /* Flag for deactivating NLSF interpolation, pitch prediction */ @@ -301,6 +302,7 @@ typedef struct { /* Stuff used for PLC */ opus_int lossCnt; opus_int prevSignalType; + int arch; silk_PLC_struct sPLC; diff --git a/thirdparty/opus/silk/sum_sqr_shift.c b/thirdparty/opus/silk/sum_sqr_shift.c index 129df191d8..4fd0c3d7d5 100644 --- a/thirdparty/opus/silk/sum_sqr_shift.c +++ b/thirdparty/opus/silk/sum_sqr_shift.c @@ -41,43 +41,40 @@ void silk_sum_sqr_shift( ) { opus_int i, shft; - opus_int32 nrg_tmp, nrg; + opus_uint32 nrg_tmp; + opus_int32 nrg; - nrg = 0; - shft = 0; - len--; - for( i = 0; i < len; i += 2 ) { - nrg = silk_SMLABB_ovflw( nrg, x[ i ], x[ i ] ); - nrg = silk_SMLABB_ovflw( nrg, x[ i + 1 ], x[ i + 1 ] ); - if( nrg < 0 ) { - /* Scale down */ - nrg = (opus_int32)silk_RSHIFT_uint( (opus_uint32)nrg, 2 ); - shft = 2; - i+=2; - break; - } + /* Do a first run with the maximum shift we could have. */ + shft = 31-silk_CLZ32(len); + /* Let's be conservative with rounding and start with nrg=len. */ + nrg = len; + for( i = 0; i < len - 1; i += 2 ) { + nrg_tmp = silk_SMULBB( x[ i ], x[ i ] ); + nrg_tmp = silk_SMLABB_ovflw( nrg_tmp, x[ i + 1 ], x[ i + 1 ] ); + nrg = (opus_int32)silk_ADD_RSHIFT_uint( nrg, nrg_tmp, shft ); } - for( ; i < len; i += 2 ) { + if( i < len ) { + /* One sample left to process */ + nrg_tmp = silk_SMULBB( x[ i ], x[ i ] ); + nrg = (opus_int32)silk_ADD_RSHIFT_uint( nrg, nrg_tmp, shft ); + } + silk_assert( nrg >= 0 ); + /* Make sure the result will fit in a 32-bit signed integer with two bits + of headroom. */ + shft = silk_max_32(0, shft+3 - silk_CLZ32(nrg)); + nrg = 0; + for( i = 0 ; i < len - 1; i += 2 ) { nrg_tmp = silk_SMULBB( x[ i ], x[ i ] ); nrg_tmp = silk_SMLABB_ovflw( nrg_tmp, x[ i + 1 ], x[ i + 1 ] ); - nrg = (opus_int32)silk_ADD_RSHIFT_uint( nrg, (opus_uint32)nrg_tmp, shft ); - if( nrg < 0 ) { - /* Scale down */ - nrg = (opus_int32)silk_RSHIFT_uint( (opus_uint32)nrg, 2 ); - shft += 2; - } + nrg = (opus_int32)silk_ADD_RSHIFT_uint( nrg, nrg_tmp, shft ); } - if( i == len ) { + if( i < len ) { /* One sample left to process */ nrg_tmp = silk_SMULBB( x[ i ], x[ i ] ); nrg = (opus_int32)silk_ADD_RSHIFT_uint( nrg, nrg_tmp, shft ); } - /* Make sure to have at least one extra leading zero (two leading zeros in total) */ - if( nrg & 0xC0000000 ) { - nrg = silk_RSHIFT_uint( (opus_uint32)nrg, 2 ); - shft += 2; - } + silk_assert( nrg >= 0 ); /* Output arguments */ *shift = shft; diff --git a/thirdparty/opus/silk/tables.h b/thirdparty/opus/silk/tables.h index 7fea6fda39..95230c451a 100644 --- a/thirdparty/opus/silk/tables.h +++ b/thirdparty/opus/silk/tables.h @@ -76,10 +76,8 @@ extern const opus_uint8 silk_NLSF_EXT_iCDF[ 7 ]; extern const opus_uint8 silk_LTP_per_index_iCDF[ 3 ]; /* 3 */ extern const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[ NB_LTP_CBKS ]; /* 3 */ extern const opus_uint8 * const silk_LTP_gain_BITS_Q5_ptrs[ NB_LTP_CBKS ]; /* 3 */ -extern const opus_int16 silk_LTP_gain_middle_avg_RD_Q14; extern const opus_int8 * const silk_LTP_vq_ptrs_Q7[ NB_LTP_CBKS ]; /* 168 */ extern const opus_uint8 * const silk_LTP_vq_gain_ptrs_Q7[NB_LTP_CBKS]; - extern const opus_int8 silk_LTP_vq_sizes[ NB_LTP_CBKS ]; /* 3 */ extern const opus_uint8 silk_LTPscale_iCDF[ 3 ]; /* 4 */ @@ -99,12 +97,6 @@ extern const opus_uint8 silk_NLSF_interpolation_factor_iCDF[ 5 ]; extern const silk_NLSF_CB_struct silk_NLSF_CB_WB; /* 1040 */ extern const silk_NLSF_CB_struct silk_NLSF_CB_NB_MB; /* 728 */ -/* Piece-wise linear mapping from bitrate in kbps to coding quality in dB SNR */ -extern const opus_int32 silk_TargetRate_table_NB[ TARGET_RATE_TAB_SZ ]; /* 32 */ -extern const opus_int32 silk_TargetRate_table_MB[ TARGET_RATE_TAB_SZ ]; /* 32 */ -extern const opus_int32 silk_TargetRate_table_WB[ TARGET_RATE_TAB_SZ ]; /* 32 */ -extern const opus_int16 silk_SNR_table_Q1[ TARGET_RATE_TAB_SZ ]; /* 32 */ - /* Quantization offsets */ extern const opus_int16 silk_Quantization_Offsets_Q10[ 2 ][ 2 ]; /* 8 */ diff --git a/thirdparty/opus/silk/tables_LTP.c b/thirdparty/opus/silk/tables_LTP.c index 0e6a0254d5..5e12c8643e 100644 --- a/thirdparty/opus/silk/tables_LTP.c +++ b/thirdparty/opus/silk/tables_LTP.c @@ -51,8 +51,6 @@ static const opus_uint8 silk_LTP_gain_iCDF_2[32] = { 24, 20, 16, 12, 9, 5, 2, 0 }; -const opus_int16 silk_LTP_gain_middle_avg_RD_Q14 = 12304; - static const opus_uint8 silk_LTP_gain_BITS_Q5_0[8] = { 15, 131, 138, 138, 155, 155, 173, 173 }; diff --git a/thirdparty/opus/silk/tables_NLSF_CB_NB_MB.c b/thirdparty/opus/silk/tables_NLSF_CB_NB_MB.c index 8c59d207aa..195d5b95bd 100644 --- a/thirdparty/opus/silk/tables_NLSF_CB_NB_MB.c +++ b/thirdparty/opus/silk/tables_NLSF_CB_NB_MB.c @@ -74,6 +74,41 @@ static const opus_uint8 silk_NLSF_CB1_NB_MB_Q8[ 320 ] = { 64, 84, 104, 118, 156, 177, 201, 230 }; +static const opus_int16 silk_NLSF_CB1_Wght_Q9[ 320 ] = { + 2897, 2314, 2314, 2314, 2287, 2287, 2314, 2300, 2327, 2287, + 2888, 2580, 2394, 2367, 2314, 2274, 2274, 2274, 2274, 2194, + 2487, 2340, 2340, 2314, 2314, 2314, 2340, 2340, 2367, 2354, + 3216, 2766, 2340, 2340, 2314, 2274, 2221, 2207, 2261, 2194, + 2460, 2474, 2367, 2394, 2394, 2394, 2394, 2367, 2407, 2314, + 3479, 3056, 2127, 2207, 2274, 2274, 2274, 2287, 2314, 2261, + 3282, 3141, 2580, 2394, 2247, 2221, 2207, 2194, 2194, 2114, + 4096, 3845, 2221, 2620, 2620, 2407, 2314, 2394, 2367, 2074, + 3178, 3244, 2367, 2221, 2553, 2434, 2340, 2314, 2167, 2221, + 3338, 3488, 2726, 2194, 2261, 2460, 2354, 2367, 2207, 2101, + 2354, 2420, 2327, 2367, 2394, 2420, 2420, 2420, 2460, 2367, + 3779, 3629, 2434, 2527, 2367, 2274, 2274, 2300, 2207, 2048, + 3254, 3225, 2713, 2846, 2447, 2327, 2300, 2300, 2274, 2127, + 3263, 3300, 2753, 2806, 2447, 2261, 2261, 2247, 2127, 2101, + 2873, 2981, 2633, 2367, 2407, 2354, 2194, 2247, 2247, 2114, + 3225, 3197, 2633, 2580, 2274, 2181, 2247, 2221, 2221, 2141, + 3178, 3310, 2740, 2407, 2274, 2274, 2274, 2287, 2194, 2114, + 3141, 3272, 2460, 2061, 2287, 2500, 2367, 2487, 2434, 2181, + 3507, 3282, 2314, 2700, 2647, 2474, 2367, 2394, 2340, 2127, + 3423, 3535, 3038, 3056, 2300, 1950, 2221, 2274, 2274, 2274, + 3404, 3366, 2087, 2687, 2873, 2354, 2420, 2274, 2474, 2540, + 3760, 3488, 1950, 2660, 2897, 2527, 2394, 2367, 2460, 2261, + 3028, 3272, 2740, 2888, 2740, 2154, 2127, 2287, 2234, 2247, + 3695, 3657, 2025, 1969, 2660, 2700, 2580, 2500, 2327, 2367, + 3207, 3413, 2354, 2074, 2888, 2888, 2340, 2487, 2247, 2167, + 3338, 3366, 2846, 2780, 2327, 2154, 2274, 2287, 2114, 2061, + 2327, 2300, 2181, 2167, 2181, 2367, 2633, 2700, 2700, 2553, + 2407, 2434, 2221, 2261, 2221, 2221, 2340, 2420, 2607, 2700, + 3038, 3244, 2806, 2888, 2474, 2074, 2300, 2314, 2354, 2380, + 2221, 2154, 2127, 2287, 2500, 2793, 2793, 2620, 2580, 2367, + 3676, 3713, 2234, 1838, 2181, 2753, 2726, 2673, 2513, 2207, + 2793, 3160, 2726, 2553, 2846, 2513, 2181, 2394, 2221, 2181 +}; + static const opus_uint8 silk_NLSF_CB1_iCDF_NB_MB[ 64 ] = { 212, 178, 148, 129, 108, 96, 85, 82, 79, 77, 61, 59, 57, 56, 51, 49, @@ -150,6 +185,7 @@ const silk_NLSF_CB_struct silk_NLSF_CB_NB_MB = SILK_FIX_CONST( 0.18, 16 ), SILK_FIX_CONST( 1.0 / 0.18, 6 ), silk_NLSF_CB1_NB_MB_Q8, + silk_NLSF_CB1_Wght_Q9, silk_NLSF_CB1_iCDF_NB_MB, silk_NLSF_PRED_NB_MB_Q8, silk_NLSF_CB2_SELECT_NB_MB, diff --git a/thirdparty/opus/silk/tables_NLSF_CB_WB.c b/thirdparty/opus/silk/tables_NLSF_CB_WB.c index 50af87eb2e..5cc9f57bff 100644 --- a/thirdparty/opus/silk/tables_NLSF_CB_WB.c +++ b/thirdparty/opus/silk/tables_NLSF_CB_WB.c @@ -98,6 +98,41 @@ static const opus_uint8 silk_NLSF_CB1_WB_Q8[ 512 ] = { 110, 119, 129, 141, 175, 198, 218, 237 }; +static const opus_int16 silk_NLSF_CB1_WB_Wght_Q9[ 512 ] = { + 3657, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2963, 2963, 2925, 2846, + 3216, 3085, 2972, 3056, 3056, 3010, 3010, 3010, 2963, 2963, 3010, 2972, 2888, 2846, 2846, 2726, + 3920, 4014, 2981, 3207, 3207, 2934, 3056, 2846, 3122, 3244, 2925, 2846, 2620, 2553, 2780, 2925, + 3516, 3197, 3010, 3103, 3019, 2888, 2925, 2925, 2925, 2925, 2888, 2888, 2888, 2888, 2888, 2753, + 5054, 5054, 2934, 3573, 3385, 3056, 3085, 2793, 3160, 3160, 2972, 2846, 2513, 2540, 2753, 2888, + 4428, 4149, 2700, 2753, 2972, 3010, 2925, 2846, 2981, 3019, 2925, 2925, 2925, 2925, 2888, 2726, + 3620, 3019, 2972, 3056, 3056, 2873, 2806, 3056, 3216, 3047, 2981, 3291, 3291, 2981, 3310, 2991, + 5227, 5014, 2540, 3338, 3526, 3385, 3197, 3094, 3376, 2981, 2700, 2647, 2687, 2793, 2846, 2673, + 5081, 5174, 4615, 4428, 2460, 2897, 3047, 3207, 3169, 2687, 2740, 2888, 2846, 2793, 2846, 2700, + 3122, 2888, 2963, 2925, 2925, 2925, 2925, 2963, 2963, 2963, 2963, 2925, 2925, 2963, 2963, 2963, + 4202, 3207, 2981, 3103, 3010, 2888, 2888, 2925, 2972, 2873, 2916, 3019, 2972, 3010, 3197, 2873, + 3760, 3760, 3244, 3103, 2981, 2888, 2925, 2888, 2972, 2934, 2793, 2793, 2846, 2888, 2888, 2660, + 3854, 4014, 3207, 3122, 3244, 2934, 3047, 2963, 2963, 3085, 2846, 2793, 2793, 2793, 2793, 2580, + 3845, 4080, 3357, 3516, 3094, 2740, 3010, 2934, 3122, 3085, 2846, 2846, 2647, 2647, 2846, 2806, + 5147, 4894, 3225, 3845, 3441, 3169, 2897, 3413, 3451, 2700, 2580, 2673, 2740, 2846, 2806, 2753, + 4109, 3789, 3291, 3160, 2925, 2888, 2888, 2925, 2793, 2740, 2793, 2740, 2793, 2846, 2888, 2806, + 5081, 5054, 3047, 3545, 3244, 3056, 3085, 2944, 3103, 2897, 2740, 2740, 2740, 2846, 2793, 2620, + 4309, 4309, 2860, 2527, 3207, 3376, 3376, 3075, 3075, 3376, 3056, 2846, 2647, 2580, 2726, 2753, + 3056, 2916, 2806, 2888, 2740, 2687, 2897, 3103, 3150, 3150, 3216, 3169, 3056, 3010, 2963, 2846, + 4375, 3882, 2925, 2888, 2846, 2888, 2846, 2846, 2888, 2888, 2888, 2846, 2888, 2925, 2888, 2846, + 2981, 2916, 2916, 2981, 2981, 3056, 3122, 3216, 3150, 3056, 3010, 2972, 2972, 2972, 2925, 2740, + 4229, 4149, 3310, 3347, 2925, 2963, 2888, 2981, 2981, 2846, 2793, 2740, 2846, 2846, 2846, 2793, + 4080, 4014, 3103, 3010, 2925, 2925, 2925, 2888, 2925, 2925, 2846, 2846, 2846, 2793, 2888, 2780, + 4615, 4575, 3169, 3441, 3207, 2981, 2897, 3038, 3122, 2740, 2687, 2687, 2687, 2740, 2793, 2700, + 4149, 4269, 3789, 3657, 2726, 2780, 2888, 2888, 3010, 2972, 2925, 2846, 2687, 2687, 2793, 2888, + 4215, 3554, 2753, 2846, 2846, 2888, 2888, 2888, 2925, 2925, 2888, 2925, 2925, 2925, 2963, 2888, + 5174, 4921, 2261, 3432, 3789, 3479, 3347, 2846, 3310, 3479, 3150, 2897, 2460, 2487, 2753, 2925, + 3451, 3685, 3122, 3197, 3357, 3047, 3207, 3207, 2981, 3216, 3085, 2925, 2925, 2687, 2540, 2434, + 2981, 3010, 2793, 2793, 2740, 2793, 2846, 2972, 3056, 3103, 3150, 3150, 3150, 3103, 3010, 3010, + 2944, 2873, 2687, 2726, 2780, 3010, 3432, 3545, 3357, 3244, 3056, 3010, 2963, 2925, 2888, 2846, + 3019, 2944, 2897, 3010, 3010, 2972, 3019, 3103, 3056, 3056, 3010, 2888, 2846, 2925, 2925, 2888, + 3920, 3967, 3010, 3197, 3357, 3216, 3291, 3291, 3479, 3704, 3441, 2726, 2181, 2460, 2580, 2607 +}; + static const opus_uint8 silk_NLSF_CB1_iCDF_WB[ 64 ] = { 225, 204, 201, 184, 183, 175, 158, 154, 153, 135, 119, 115, 113, 110, 109, 99, @@ -188,6 +223,7 @@ const silk_NLSF_CB_struct silk_NLSF_CB_WB = SILK_FIX_CONST( 0.15, 16 ), SILK_FIX_CONST( 1.0 / 0.15, 6 ), silk_NLSF_CB1_WB_Q8, + silk_NLSF_CB1_WB_Wght_Q9, silk_NLSF_CB1_iCDF_WB, silk_NLSF_PRED_WB_Q8, silk_NLSF_CB2_SELECT_WB, diff --git a/thirdparty/opus/silk/tables_other.c b/thirdparty/opus/silk/tables_other.c index 398686bf26..e34d90777b 100644 --- a/thirdparty/opus/silk/tables_other.c +++ b/thirdparty/opus/silk/tables_other.c @@ -38,20 +38,6 @@ extern "C" { #endif -/* Piece-wise linear mapping from bitrate in kbps to coding quality in dB SNR */ -const opus_int32 silk_TargetRate_table_NB[ TARGET_RATE_TAB_SZ ] = { - 0, 8000, 9400, 11500, 13500, 17500, 25000, MAX_TARGET_RATE_BPS -}; -const opus_int32 silk_TargetRate_table_MB[ TARGET_RATE_TAB_SZ ] = { - 0, 9000, 12000, 14500, 18500, 24500, 35500, MAX_TARGET_RATE_BPS -}; -const opus_int32 silk_TargetRate_table_WB[ TARGET_RATE_TAB_SZ ] = { - 0, 10500, 14000, 17000, 21500, 28500, 42000, MAX_TARGET_RATE_BPS -}; -const opus_int16 silk_SNR_table_Q1[ TARGET_RATE_TAB_SZ ] = { - 18, 29, 38, 40, 46, 52, 62, 84 -}; - /* Tables for stereo predictor coding */ const opus_int16 silk_stereo_pred_quant_Q13[ STEREO_QUANT_TAB_SIZE ] = { -13732, -10050, -8266, -7526, -6500, -5000, -2950, -820, diff --git a/thirdparty/opus/silk/tuning_parameters.h b/thirdparty/opus/silk/tuning_parameters.h index 5b8f404235..d70275fd8f 100644 --- a/thirdparty/opus/silk/tuning_parameters.h +++ b/thirdparty/opus/silk/tuning_parameters.h @@ -53,19 +53,12 @@ extern "C" /* LPC analysis regularization */ #define FIND_LPC_COND_FAC 1e-5f -/* LTP analysis defines */ -#define FIND_LTP_COND_FAC 1e-5f -#define LTP_DAMPING 0.05f -#define LTP_SMOOTHING 0.1f - -/* LTP quantization settings */ -#define MU_LTP_QUANT_NB 0.03f -#define MU_LTP_QUANT_MB 0.025f -#define MU_LTP_QUANT_WB 0.02f - /* Max cumulative LTP gain */ #define MAX_SUM_LOG_GAIN_DB 250.0f +/* LTP analysis defines */ +#define LTP_CORR_INV_MAX 0.03f + /***********************/ /* High pass filtering */ /***********************/ @@ -103,25 +96,16 @@ extern "C" #define SPARSE_SNR_INCR_dB 2.0f /* threshold for sparseness measure above which to use lower quantization offset during unvoiced */ -#define SPARSENESS_THRESHOLD_QNT_OFFSET 0.75f +#define ENERGY_VARIATION_THRESHOLD_QNT_OFFSET 0.6f /* warping control */ #define WARPING_MULTIPLIER 0.015f /* fraction added to first autocorrelation value */ -#define SHAPE_WHITE_NOISE_FRACTION 5e-5f +#define SHAPE_WHITE_NOISE_FRACTION 3e-5f /* noise shaping filter chirp factor */ -#define BANDWIDTH_EXPANSION 0.95f - -/* difference between chirp factors for analysis and synthesis noise shaping filters at low bitrates */ -#define LOW_RATE_BANDWIDTH_EXPANSION_DELTA 0.01f - -/* extra harmonic boosting (signal shaping) at low bitrates */ -#define LOW_RATE_HARMONIC_BOOST 0.1f - -/* extra harmonic boosting (signal shaping) for noisy input signals */ -#define LOW_INPUT_QUALITY_HARMONIC_BOOST 0.1f +#define BANDWIDTH_EXPANSION 0.94f /* harmonic noise shaping */ #define HARMONIC_SHAPING 0.3f diff --git a/thirdparty/opus/silk/x86/NSQ_del_dec_sse.c b/thirdparty/opus/silk/x86/NSQ_del_dec_sse4_1.c index 21d4a8bc1e..2c75ede2dd 100644 --- a/thirdparty/opus/silk/x86/NSQ_del_dec_sse.c +++ b/thirdparty/opus/silk/x86/NSQ_del_dec_sse4_1.c @@ -107,12 +107,12 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1( opus_int predictLPCOrder, /* I Prediction filter order */ opus_int warping_Q16, /* I */ opus_int nStatesDelayedDecision, /* I Number of states in decision tree */ - opus_int *smpl_buf_idx, /* I Index to newest samples in buffers */ + opus_int *smpl_buf_idx, /* I/O Index to newest samples in buffers */ opus_int decisionDelay /* I */ ); void silk_NSQ_del_dec_sse4_1( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int32 x_Q3[], /* I Prefiltered input signal */ @@ -234,7 +234,8 @@ void silk_NSQ_del_dec_sse4_1( psDD = &psDelDec[ Winner_ind ]; last_smple_idx = smpl_buf_idx + decisionDelay; for( i = 0; i < decisionDelay; i++ ) { - last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK; + last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY; + if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY; pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10[ last_smple_idx ], 10 ); pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( psDD->Xq_Q14[ last_smple_idx ], Gains_Q16[ 1 ] ), 14 ) ); @@ -246,7 +247,7 @@ void silk_NSQ_del_dec_sse4_1( /* Rewhiten with new A coefs */ start_idx = psEncC->ltp_mem_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2; - silk_assert( start_idx > 0 ); + celt_assert( start_idx > 0 ); silk_LPC_analysis_filter( &sLTP[ start_idx ], &NSQ->xq[ start_idx + k * psEncC->subfr_length ], A_Q12, psEncC->ltp_mem_length - start_idx, psEncC->predictLPCOrder, psEncC->arch ); @@ -285,7 +286,8 @@ void silk_NSQ_del_dec_sse4_1( last_smple_idx = smpl_buf_idx + decisionDelay; Gain_Q10 = silk_RSHIFT32( Gains_Q16[ psEncC->nb_subfr - 1 ], 6 ); for( i = 0; i < decisionDelay; i++ ) { - last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK; + last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY; + if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY; pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10[ last_smple_idx ], 10 ); pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( psDD->Xq_Q14[ last_smple_idx ], Gain_Q10 ), 8 ) ); @@ -299,7 +301,6 @@ void silk_NSQ_del_dec_sse4_1( NSQ->lagPrev = pitchL[ psEncC->nb_subfr - 1 ]; /* Save quantized speech signal */ - /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[psEncC->ltp_mem_length], psEncC->frame_length * sizeof( opus_int16 ) ) */ silk_memmove( NSQ->xq, &NSQ->xq[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) ); silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) ); RESTORE_STACK; @@ -333,7 +334,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1( opus_int predictLPCOrder, /* I Prediction filter order */ opus_int warping_Q16, /* I */ opus_int nStatesDelayedDecision, /* I Number of states in decision tree */ - opus_int *smpl_buf_idx, /* I Index to newest samples in buffers */ + opus_int *smpl_buf_idx, /* I/O Index to newest samples in buffers */ opus_int decisionDelay /* I */ ) { @@ -352,7 +353,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1( __m128i b_Q12_0123, b_sr_Q12_0123; SAVE_STACK; - silk_assert( nStatesDelayedDecision > 0 ); + celt_assert( nStatesDelayedDecision > 0 ); ALLOC( psSampleState, nStatesDelayedDecision, NSQ_sample_pair ); shp_lag_ptr = &NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ]; @@ -638,8 +639,9 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1( psSS[ 1 ].xq_Q14 = xq_Q14; } } - *smpl_buf_idx = ( *smpl_buf_idx - 1 ) & DECISION_DELAY_MASK; /* Index to newest samples */ - last_smple_idx = ( *smpl_buf_idx + decisionDelay ) & DECISION_DELAY_MASK; /* Index to decisionDelay old samples */ + *smpl_buf_idx = ( *smpl_buf_idx - 1 ) % DECISION_DELAY; + if( *smpl_buf_idx < 0 ) *smpl_buf_idx += DECISION_DELAY; + last_smple_idx = ( *smpl_buf_idx + decisionDelay ) % DECISION_DELAY; /* Find winner */ RDmin_Q10 = psSampleState[ 0 ][ 0 ].RD_Q10; diff --git a/thirdparty/opus/silk/x86/NSQ_sse.c b/thirdparty/opus/silk/x86/NSQ_sse4_1.c index bb3c5f1955..b0315e35fc 100644 --- a/thirdparty/opus/silk/x86/NSQ_sse.c +++ b/thirdparty/opus/silk/x86/NSQ_sse4_1.c @@ -71,7 +71,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_10_16_sse4_1( ); void silk_NSQ_sse4_1( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int32 x_Q3[], /* I Prefiltered input signal */ @@ -199,7 +199,7 @@ void silk_NSQ_sse4_1( if( ( k & ( 3 - silk_LSHIFT( LSF_interpolation_flag, 1 ) ) ) == 0 ) { /* Rewhiten with new A coefs */ start_idx = psEncC->ltp_mem_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2; - silk_assert( start_idx > 0 ); + celt_assert( start_idx > 0 ); silk_LPC_analysis_filter( &sLTP[ start_idx ], &NSQ->xq[ start_idx + k * psEncC->subfr_length ], A_Q12, psEncC->ltp_mem_length - start_idx, psEncC->predictLPCOrder, psEncC->arch ); @@ -233,7 +233,6 @@ void silk_NSQ_sse4_1( NSQ->lagPrev = pitchL[ psEncC->nb_subfr - 1 ]; /* Save quantized speech and noise shaping signals */ - /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[ psEncC->ltp_mem_length ], psEncC->frame_length * sizeof( opus_int16 ) ) */ silk_memmove( NSQ->xq, &NSQ->xq[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) ); silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) ); RESTORE_STACK; diff --git a/thirdparty/opus/silk/x86/VAD_sse.c b/thirdparty/opus/silk/x86/VAD_sse4_1.c index 4e90f4410d..d02ddf4ad0 100644 --- a/thirdparty/opus/silk/x86/VAD_sse.c +++ b/thirdparty/opus/silk/x86/VAD_sse4_1.c @@ -65,9 +65,9 @@ opus_int silk_VAD_GetSA_Q8_sse4_1( /* O Return value, 0 if s /* Safety checks */ silk_assert( VAD_N_BANDS == 4 ); - silk_assert( MAX_FRAME_LENGTH >= psEncC->frame_length ); - silk_assert( psEncC->frame_length <= 512 ); - silk_assert( psEncC->frame_length == 8 * silk_RSHIFT( psEncC->frame_length, 3 ) ); + celt_assert( MAX_FRAME_LENGTH >= psEncC->frame_length ); + celt_assert( psEncC->frame_length <= 512 ); + celt_assert( psEncC->frame_length == 8 * silk_RSHIFT( psEncC->frame_length, 3 ) ); /***********************/ /* Filter and Decimate */ diff --git a/thirdparty/opus/silk/x86/VQ_WMat_EC_sse.c b/thirdparty/opus/silk/x86/VQ_WMat_EC_sse4_1.c index 74d6c6d0ec..74d6c6d0ec 100644 --- a/thirdparty/opus/silk/x86/VQ_WMat_EC_sse.c +++ b/thirdparty/opus/silk/x86/VQ_WMat_EC_sse4_1.c diff --git a/thirdparty/opus/silk/x86/main_sse.h b/thirdparty/opus/silk/x86/main_sse.h index d8d61310ed..2f15d44869 100644 --- a/thirdparty/opus/silk/x86/main_sse.h +++ b/thirdparty/opus/silk/x86/main_sse.h @@ -34,6 +34,7 @@ # if defined(OPUS_X86_MAY_HAVE_SSE4_1) +#if 0 /* FIXME: SSE disabled until silk_VQ_WMat_EC_sse4_1() gets updated. */ # define OVERRIDE_silk_VQ_WMat_EC void silk_VQ_WMat_EC_sse4_1( @@ -79,11 +80,13 @@ extern void (*const SILK_VQ_WMAT_EC_IMPL[OPUS_ARCHMASK + 1])( mu_Q9, max_gain_Q7, L)) #endif +#endif +#if 0 /* FIXME: SSE disabled until the NSQ code gets updated. */ # define OVERRIDE_silk_NSQ void silk_NSQ_sse4_1( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int32 x_Q3[], /* I Prefiltered input signal */ @@ -110,7 +113,7 @@ void silk_NSQ_sse4_1( #else extern void (*const SILK_NSQ_IMPL[OPUS_ARCHMASK + 1])( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int32 x_Q3[], /* I Prefiltered input signal */ @@ -137,7 +140,7 @@ extern void (*const SILK_NSQ_IMPL[OPUS_ARCHMASK + 1])( # define OVERRIDE_silk_NSQ_del_dec void silk_NSQ_del_dec_sse4_1( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int32 x_Q3[], /* I Prefiltered input signal */ @@ -164,7 +167,7 @@ void silk_NSQ_del_dec_sse4_1( #else extern void (*const SILK_NSQ_DEL_DEC_IMPL[OPUS_ARCHMASK + 1])( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int32 x_Q3[], /* I Prefiltered input signal */ @@ -187,6 +190,7 @@ extern void (*const SILK_NSQ_DEL_DEC_IMPL[OPUS_ARCHMASK + 1])( HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, Lambda_Q10, LTP_scale_Q14)) #endif +#endif void silk_noise_shape_quantizer( silk_nsq_state *NSQ, /* I/O NSQ state */ @@ -238,39 +242,6 @@ extern opus_int (*const SILK_VAD_GETSA_Q8_IMPL[OPUS_ARCHMASK + 1])( silk_encoder_state *psEnC, const opus_int16 pIn[]); -# define OVERRIDE_silk_warped_LPC_analysis_filter_FIX - -#endif - -void silk_warped_LPC_analysis_filter_FIX_sse4_1( - opus_int32 state[], /* I/O State [order + 1] */ - opus_int32 res_Q2[], /* O Residual signal [length] */ - const opus_int16 coef_Q13[], /* I Coefficients [order] */ - const opus_int16 input[], /* I Input signal [length] */ - const opus_int16 lambda_Q16, /* I Warping factor */ - const opus_int length, /* I Length of input signal */ - const opus_int order /* I Filter order (even) */ -); - -#if defined(OPUS_X86_PRESUME_SSE4_1) -#define silk_warped_LPC_analysis_filter_FIX(state, res_Q2, coef_Q13, input, lambda_Q16, length, order, arch) \ - ((void)(arch),silk_warped_LPC_analysis_filter_FIX_c(state, res_Q2, coef_Q13, input, lambda_Q16, length, order)) - -#else - -extern void (*const SILK_WARPED_LPC_ANALYSIS_FILTER_FIX_IMPL[OPUS_ARCHMASK + 1])( - opus_int32 state[], /* I/O State [order + 1] */ - opus_int32 res_Q2[], /* O Residual signal [length] */ - const opus_int16 coef_Q13[], /* I Coefficients [order] */ - const opus_int16 input[], /* I Input signal [length] */ - const opus_int16 lambda_Q16, /* I Warping factor */ - const opus_int length, /* I Length of input signal */ - const opus_int order /* I Filter order (even) */ -); - -# define silk_warped_LPC_analysis_filter_FIX(state, res_Q2, coef_Q13, input, lambda_Q16, length, order, arch) \ - ((*SILK_WARPED_LPC_ANALYSIS_FILTER_FIX_IMPL[(arch) & OPUS_ARCHMASK])(state, res_Q2, coef_Q13, input, lambda_Q16, length, order)) - #endif # endif diff --git a/thirdparty/opus/silk/x86/x86_silk_map.c b/thirdparty/opus/silk/x86/x86_silk_map.c index 818841f2c1..32dcc3cab7 100644 --- a/thirdparty/opus/silk/x86/x86_silk_map.c +++ b/thirdparty/opus/silk/x86/x86_silk_map.c @@ -66,8 +66,9 @@ opus_int (*const SILK_VAD_GETSA_Q8_IMPL[ OPUS_ARCHMASK + 1 ] )( MAY_HAVE_SSE4_1( silk_VAD_GetSA_Q8 ) /* avx */ }; +#if 0 /* FIXME: SSE disabled until the NSQ code gets updated. */ void (*const SILK_NSQ_IMPL[ OPUS_ARCHMASK + 1 ] )( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int32 x_Q3[], /* I Prefiltered input signal */ @@ -89,7 +90,9 @@ void (*const SILK_NSQ_IMPL[ OPUS_ARCHMASK + 1 ] )( MAY_HAVE_SSE4_1( silk_NSQ ), /* sse4.1 */ MAY_HAVE_SSE4_1( silk_NSQ ) /* avx */ }; +#endif +#if 0 /* FIXME: SSE disabled until silk_VQ_WMat_EC_sse4_1() gets updated. */ void (*const SILK_VQ_WMAT_EC_IMPL[ OPUS_ARCHMASK + 1 ] )( opus_int8 *ind, /* O index of best codebook vector */ opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */ @@ -109,9 +112,11 @@ void (*const SILK_VQ_WMAT_EC_IMPL[ OPUS_ARCHMASK + 1 ] )( MAY_HAVE_SSE4_1( silk_VQ_WMat_EC ), /* sse4.1 */ MAY_HAVE_SSE4_1( silk_VQ_WMat_EC ) /* avx */ }; +#endif +#if 0 /* FIXME: SSE disabled until the NSQ code gets updated. */ void (*const SILK_NSQ_DEL_DEC_IMPL[ OPUS_ARCHMASK + 1 ] )( - const silk_encoder_state *psEncC, /* I/O Encoder State */ + const silk_encoder_state *psEncC, /* I Encoder State */ silk_nsq_state *NSQ, /* I/O NSQ state */ SideInfoIndices *psIndices, /* I/O Quantization Indices */ const opus_int32 x_Q3[], /* I Prefiltered input signal */ @@ -133,25 +138,10 @@ void (*const SILK_NSQ_DEL_DEC_IMPL[ OPUS_ARCHMASK + 1 ] )( MAY_HAVE_SSE4_1( silk_NSQ_del_dec ), /* sse4.1 */ MAY_HAVE_SSE4_1( silk_NSQ_del_dec ) /* avx */ }; +#endif #if defined(FIXED_POINT) -void (*const SILK_WARPED_LPC_ANALYSIS_FILTER_FIX_IMPL[ OPUS_ARCHMASK + 1 ] )( - opus_int32 state[], /* I/O State [order + 1] */ - opus_int32 res_Q2[], /* O Residual signal [length] */ - const opus_int16 coef_Q13[], /* I Coefficients [order] */ - const opus_int16 input[], /* I Input signal [length] */ - const opus_int16 lambda_Q16, /* I Warping factor */ - const opus_int length, /* I Length of input signal */ - const opus_int order /* I Filter order (even) */ -) = { - silk_warped_LPC_analysis_filter_FIX_c, /* non-sse */ - silk_warped_LPC_analysis_filter_FIX_c, - silk_warped_LPC_analysis_filter_FIX_c, - MAY_HAVE_SSE4_1( silk_warped_LPC_analysis_filter_FIX ), /* sse4.1 */ - MAY_HAVE_SSE4_1( silk_warped_LPC_analysis_filter_FIX ) /* avx */ -}; - void (*const SILK_BURG_MODIFIED_IMPL[ OPUS_ARCHMASK + 1 ] )( opus_int32 *res_nrg, /* O Residual energy */ opus_int *res_nrg_Q, /* O Residual energy Q value */ diff --git a/thirdparty/opus/stream.c b/thirdparty/opus/stream.c index 0238a6b31b..6a85197a66 100644 --- a/thirdparty/opus/stream.c +++ b/thirdparty/opus/stream.c @@ -235,8 +235,7 @@ void *op_fopen(OpusFileCallbacks *_cb,const char *_path,const char *_mode){ fp=fopen(_path,_mode); #else fp=NULL; - if(_path==NULL||_mode==NULL)errno=EINVAL; - else{ + { wchar_t *wpath; wchar_t *wmode; wpath=op_utf8_to_utf16(_path); @@ -266,8 +265,7 @@ void *op_freopen(OpusFileCallbacks *_cb,const char *_path,const char *_mode, fp=freopen(_path,_mode,(FILE *)_stream); #else fp=NULL; - if(_path==NULL||_mode==NULL)errno=EINVAL; - else{ + { wchar_t *wpath; wchar_t *wmode; wpath=op_utf8_to_utf16(_path); diff --git a/thirdparty/tinyexr/tinyexr.h b/thirdparty/tinyexr/tinyexr.h index f22163738f..bfc52b51a5 100644 --- a/thirdparty/tinyexr/tinyexr.h +++ b/thirdparty/tinyexr/tinyexr.h @@ -111,13 +111,13 @@ extern "C" { #define TINYEXR_ERROR_INVALID_ARGUMENT (-3) #define TINYEXR_ERROR_INVALID_DATA (-4) #define TINYEXR_ERROR_INVALID_FILE (-5) -#define TINYEXR_ERROR_INVALID_PARAMETER (-5) -#define TINYEXR_ERROR_CANT_OPEN_FILE (-6) -#define TINYEXR_ERROR_UNSUPPORTED_FORMAT (-7) -#define TINYEXR_ERROR_INVALID_HEADER (-8) -#define TINYEXR_ERROR_UNSUPPORTED_FEATURE (-9) -#define TINYEXR_ERROR_CANT_WRITE_FILE (-10) -#define TINYEXR_ERROR_SERIALZATION_FAILED (-11) +#define TINYEXR_ERROR_INVALID_PARAMETER (-6) +#define TINYEXR_ERROR_CANT_OPEN_FILE (-7) +#define TINYEXR_ERROR_UNSUPPORTED_FORMAT (-8) +#define TINYEXR_ERROR_INVALID_HEADER (-9) +#define TINYEXR_ERROR_UNSUPPORTED_FEATURE (-10) +#define TINYEXR_ERROR_CANT_WRITE_FILE (-11) +#define TINYEXR_ERROR_SERIALZATION_FAILED (-12) // @note { OpenEXR file format: http://www.openexr.com/openexrfilelayout.pdf } @@ -554,6 +554,10 @@ namespace miniz { #pragma clang diagnostic ignored "-Wtautological-constant-compare" #endif +#if __has_warning("-Wextra-semi-stmt") +#pragma clang diagnostic ignored "-Wextra-semi-stmt" +#endif + #endif /* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP @@ -7625,6 +7629,9 @@ static bool DecompressZip(unsigned char *dst, #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wsign-conversion" +#if __has_warning("-Wextra-semi-stmt") +#pragma clang diagnostic ignored "-Wextra-semi-stmt" +#endif #endif #ifdef _MSC_VER @@ -7886,6 +7893,10 @@ static bool DecompressRle(unsigned char *dst, #pragma clang diagnostic ignored "-Wcast-qual" #endif +#if __has_warning("-Wextra-semi-stmt") +#pragma clang diagnostic ignored "-Wextra-semi-stmt" +#endif + #endif // diff --git a/thirdparty/vhacd/src/FloatMath.inl b/thirdparty/vhacd/src/FloatMath.inl index ce529e6f71..a30deba45d 100644 --- a/thirdparty/vhacd/src/FloatMath.inl +++ b/thirdparty/vhacd/src/FloatMath.inl @@ -7,6 +7,10 @@ // a quaternion is a 'float *' to 4 floats representing a quaternion x,y,z,w // +#ifdef _MSC_VER +#pragma warning(disable:4996) +#endif + namespace FLOAT_MATH { diff --git a/thirdparty/zstd/common/bitstream.h b/thirdparty/zstd/common/bitstream.h index d955bd677b..1c294b80d1 100644 --- a/thirdparty/zstd/common/bitstream.h +++ b/thirdparty/zstd/common/bitstream.h @@ -57,6 +57,8 @@ extern "C" { =========================================*/ #if defined(__BMI__) && defined(__GNUC__) # include <immintrin.h> /* support for bextr (experimental) */ +#elif defined(__ICCARM__) +# include <intrinsics.h> #endif #define STREAM_ACCUMULATOR_MIN_32 25 @@ -162,7 +164,9 @@ MEM_STATIC unsigned BIT_highbit32 (U32 val) _BitScanReverse ( &r, val ); return (unsigned) r; # elif defined(__GNUC__) && (__GNUC__ >= 3) /* Use GCC Intrinsic */ - return 31 - __builtin_clz (val); + return __builtin_clz (val) ^ 31; +# elif defined(__ICCARM__) /* IAR Intrinsic */ + return 31 - __CLZ(val); # else /* Software version */ static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, @@ -240,9 +244,9 @@ MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC) { size_t const nbBytes = bitC->bitPos >> 3; assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); + assert(bitC->ptr <= bitC->endPtr); MEM_writeLEST(bitC->ptr, bitC->bitContainer); bitC->ptr += nbBytes; - assert(bitC->ptr <= bitC->endPtr); bitC->bitPos &= 7; bitC->bitContainer >>= nbBytes*8; } @@ -256,6 +260,7 @@ MEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC) { size_t const nbBytes = bitC->bitPos >> 3; assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); + assert(bitC->ptr <= bitC->endPtr); MEM_writeLEST(bitC->ptr, bitC->bitContainer); bitC->ptr += nbBytes; if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr; diff --git a/thirdparty/zstd/common/compiler.h b/thirdparty/zstd/common/compiler.h index 87bf51ae8c..1877a0c1d9 100644 --- a/thirdparty/zstd/common/compiler.h +++ b/thirdparty/zstd/common/compiler.h @@ -23,7 +23,7 @@ # define INLINE_KEYWORD #endif -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__ICCARM__) # define FORCE_INLINE_ATTR __attribute__((always_inline)) #elif defined(_MSC_VER) # define FORCE_INLINE_ATTR __forceinline @@ -61,11 +61,18 @@ # define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR #endif +/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */ +#if defined(__GNUC__) +# define UNUSED_ATTR __attribute__((unused)) +#else +# define UNUSED_ATTR +#endif + /* force no inlining */ #ifdef _MSC_VER # define FORCE_NOINLINE static __declspec(noinline) #else -# ifdef __GNUC__ +# if defined(__GNUC__) || defined(__ICCARM__) # define FORCE_NOINLINE static __attribute__((__noinline__)) # else # define FORCE_NOINLINE static @@ -76,7 +83,7 @@ #ifndef __has_attribute #define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ #endif -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__ICCARM__) # define TARGET_ATTRIBUTE(target) __attribute__((__target__(target))) #else # define TARGET_ATTRIBUTE(target) @@ -127,9 +134,14 @@ } \ } -/* vectorization */ +/* vectorization + * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */ #if !defined(__clang__) && defined(__GNUC__) -# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) +# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5) +# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) +# else +# define DONT_VECTORIZE _Pragma("GCC optimize(\"no-tree-vectorize\")") +# endif #else # define DONT_VECTORIZE #endif diff --git a/thirdparty/zstd/common/fse.h b/thirdparty/zstd/common/fse.h index 811c670bdd..a7553e3721 100644 --- a/thirdparty/zstd/common/fse.h +++ b/thirdparty/zstd/common/fse.h @@ -308,7 +308,7 @@ If there is an error, the function will return an error code, which can be teste *******************************************/ /* FSE buffer bounds */ #define FSE_NCOUNTBOUND 512 -#define FSE_BLOCKBOUND(size) (size + (size>>7)) +#define FSE_BLOCKBOUND(size) (size + (size>>7) + 4 /* fse states */ + sizeof(size_t) /* bitContainer */) #define FSE_COMPRESSBOUND(size) (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size)) /* Macro version, useful for static allocation */ /* It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros */ diff --git a/thirdparty/zstd/common/fse_decompress.c b/thirdparty/zstd/common/fse_decompress.c index 72bbead5be..4f07378982 100644 --- a/thirdparty/zstd/common/fse_decompress.c +++ b/thirdparty/zstd/common/fse_decompress.c @@ -52,7 +52,9 @@ #define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */ /* check and forward error code */ +#ifndef CHECK_F #define CHECK_F(f) { size_t const e = f; if (FSE_isError(e)) return e; } +#endif /* ************************************************************** diff --git a/thirdparty/zstd/common/mem.h b/thirdparty/zstd/common/mem.h index 5da248756f..530d30c8f7 100644 --- a/thirdparty/zstd/common/mem.h +++ b/thirdparty/zstd/common/mem.h @@ -47,6 +47,79 @@ extern "C" { #define MEM_STATIC_ASSERT(c) { enum { MEM_static_assert = 1/(int)(!!(c)) }; } MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); } +/* detects whether we are being compiled under msan */ +#if defined (__has_feature) +# if __has_feature(memory_sanitizer) +# define MEMORY_SANITIZER 1 +# endif +#endif + +#if defined (MEMORY_SANITIZER) +/* Not all platforms that support msan provide sanitizers/msan_interface.h. + * We therefore declare the functions we need ourselves, rather than trying to + * include the header file... */ + +#include <stdint.h> /* intptr_t */ + +/* Make memory region fully initialized (without changing its contents). */ +void __msan_unpoison(const volatile void *a, size_t size); + +/* Make memory region fully uninitialized (without changing its contents). + This is a legacy interface that does not update origin information. Use + __msan_allocated_memory() instead. */ +void __msan_poison(const volatile void *a, size_t size); + +/* Returns the offset of the first (at least partially) poisoned byte in the + memory range, or -1 if the whole range is good. */ +intptr_t __msan_test_shadow(const volatile void *x, size_t size); +#endif + +/* detects whether we are being compiled under asan */ +#if defined (__has_feature) +# if __has_feature(address_sanitizer) +# define ADDRESS_SANITIZER 1 +# endif +#elif defined(__SANITIZE_ADDRESS__) +# define ADDRESS_SANITIZER 1 +#endif + +#if defined (ADDRESS_SANITIZER) +/* Not all platforms that support asan provide sanitizers/asan_interface.h. + * We therefore declare the functions we need ourselves, rather than trying to + * include the header file... */ + +/** + * Marks a memory region (<c>[addr, addr+size)</c>) as unaddressable. + * + * This memory must be previously allocated by your program. Instrumented + * code is forbidden from accessing addresses in this region until it is + * unpoisoned. This function is not guaranteed to poison the entire region - + * it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan + * alignment restrictions. + * + * \note This function is not thread-safe because no two threads can poison or + * unpoison memory in the same memory region simultaneously. + * + * \param addr Start of memory region. + * \param size Size of memory region. */ +void __asan_poison_memory_region(void const volatile *addr, size_t size); + +/** + * Marks a memory region (<c>[addr, addr+size)</c>) as addressable. + * + * This memory must be previously allocated by your program. Accessing + * addresses in this region is allowed until this region is poisoned again. + * This function could unpoison a super-region of <c>[addr, addr+size)</c> due + * to ASan alignment restrictions. + * + * \note This function is not thread-safe because no two threads can + * poison or unpoison memory in the same memory region simultaneously. + * + * \param addr Start of memory region. + * \param size Size of memory region. */ +void __asan_unpoison_memory_region(void const volatile *addr, size_t size); +#endif + /*-************************************************************** * Basic Types @@ -102,7 +175,7 @@ MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((sizeof(size_t)==4) || (size #ifndef MEM_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ # if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) # define MEM_FORCE_MEMORY_ACCESS 2 -# elif defined(__INTEL_COMPILER) || defined(__GNUC__) +# elif defined(__INTEL_COMPILER) || defined(__GNUC__) || defined(__ICCARM__) # define MEM_FORCE_MEMORY_ACCESS 1 # endif #endif diff --git a/thirdparty/zstd/common/pool.c b/thirdparty/zstd/common/pool.c index 7a82945432..f575935076 100644 --- a/thirdparty/zstd/common/pool.c +++ b/thirdparty/zstd/common/pool.c @@ -127,9 +127,13 @@ POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize, ctx->queueTail = 0; ctx->numThreadsBusy = 0; ctx->queueEmpty = 1; - (void)ZSTD_pthread_mutex_init(&ctx->queueMutex, NULL); - (void)ZSTD_pthread_cond_init(&ctx->queuePushCond, NULL); - (void)ZSTD_pthread_cond_init(&ctx->queuePopCond, NULL); + { + int error = 0; + error |= ZSTD_pthread_mutex_init(&ctx->queueMutex, NULL); + error |= ZSTD_pthread_cond_init(&ctx->queuePushCond, NULL); + error |= ZSTD_pthread_cond_init(&ctx->queuePopCond, NULL); + if (error) { POOL_free(ctx); return NULL; } + } ctx->shutdown = 0; /* Allocate space for the thread handles */ ctx->threads = (ZSTD_pthread_t*)ZSTD_malloc(numThreads * sizeof(ZSTD_pthread_t), customMem); diff --git a/thirdparty/zstd/common/threading.c b/thirdparty/zstd/common/threading.c index f3d4fa8418..482664bd9a 100644 --- a/thirdparty/zstd/common/threading.c +++ b/thirdparty/zstd/common/threading.c @@ -14,6 +14,8 @@ * This file will hold wrapper for systems, which do not support pthreads */ +#include "threading.h" + /* create fake symbol to avoid empty translation unit warning */ int g_ZSTD_threading_useless_symbol; @@ -28,7 +30,6 @@ int g_ZSTD_threading_useless_symbol; /* === Dependencies === */ #include <process.h> #include <errno.h> -#include "threading.h" /* === Implementation === */ @@ -73,3 +74,47 @@ int ZSTD_pthread_join(ZSTD_pthread_t thread, void **value_ptr) } #endif /* ZSTD_MULTITHREAD */ + +#if defined(ZSTD_MULTITHREAD) && DEBUGLEVEL >= 1 && !defined(_WIN32) + +#include <stdlib.h> + +int ZSTD_pthread_mutex_init(ZSTD_pthread_mutex_t* mutex, pthread_mutexattr_t const* attr) +{ + *mutex = (pthread_mutex_t*)malloc(sizeof(pthread_mutex_t)); + if (!*mutex) + return 1; + return pthread_mutex_init(*mutex, attr); +} + +int ZSTD_pthread_mutex_destroy(ZSTD_pthread_mutex_t* mutex) +{ + if (!*mutex) + return 0; + { + int const ret = pthread_mutex_destroy(*mutex); + free(*mutex); + return ret; + } +} + +int ZSTD_pthread_cond_init(ZSTD_pthread_cond_t* cond, pthread_condattr_t const* attr) +{ + *cond = (pthread_cond_t*)malloc(sizeof(pthread_cond_t)); + if (!*cond) + return 1; + return pthread_cond_init(*cond, attr); +} + +int ZSTD_pthread_cond_destroy(ZSTD_pthread_cond_t* cond) +{ + if (!*cond) + return 0; + { + int const ret = pthread_cond_destroy(*cond); + free(*cond); + return ret; + } +} + +#endif diff --git a/thirdparty/zstd/common/threading.h b/thirdparty/zstd/common/threading.h index d806c89d01..3193ca7db8 100644 --- a/thirdparty/zstd/common/threading.h +++ b/thirdparty/zstd/common/threading.h @@ -13,6 +13,8 @@ #ifndef THREADING_H_938743 #define THREADING_H_938743 +#include "debug.h" + #if defined (__cplusplus) extern "C" { #endif @@ -75,10 +77,12 @@ int ZSTD_pthread_join(ZSTD_pthread_t thread, void** value_ptr); */ -#elif defined(ZSTD_MULTITHREAD) /* posix assumed ; need a better detection method */ +#elif defined(ZSTD_MULTITHREAD) /* posix assumed ; need a better detection method */ /* === POSIX Systems === */ # include <pthread.h> +#if DEBUGLEVEL < 1 + #define ZSTD_pthread_mutex_t pthread_mutex_t #define ZSTD_pthread_mutex_init(a, b) pthread_mutex_init((a), (b)) #define ZSTD_pthread_mutex_destroy(a) pthread_mutex_destroy((a)) @@ -96,6 +100,33 @@ int ZSTD_pthread_join(ZSTD_pthread_t thread, void** value_ptr); #define ZSTD_pthread_create(a, b, c, d) pthread_create((a), (b), (c), (d)) #define ZSTD_pthread_join(a, b) pthread_join((a),(b)) +#else /* DEBUGLEVEL >= 1 */ + +/* Debug implementation of threading. + * In this implementation we use pointers for mutexes and condition variables. + * This way, if we forget to init/destroy them the program will crash or ASAN + * will report leaks. + */ + +#define ZSTD_pthread_mutex_t pthread_mutex_t* +int ZSTD_pthread_mutex_init(ZSTD_pthread_mutex_t* mutex, pthread_mutexattr_t const* attr); +int ZSTD_pthread_mutex_destroy(ZSTD_pthread_mutex_t* mutex); +#define ZSTD_pthread_mutex_lock(a) pthread_mutex_lock(*(a)) +#define ZSTD_pthread_mutex_unlock(a) pthread_mutex_unlock(*(a)) + +#define ZSTD_pthread_cond_t pthread_cond_t* +int ZSTD_pthread_cond_init(ZSTD_pthread_cond_t* cond, pthread_condattr_t const* attr); +int ZSTD_pthread_cond_destroy(ZSTD_pthread_cond_t* cond); +#define ZSTD_pthread_cond_wait(a, b) pthread_cond_wait(*(a), *(b)) +#define ZSTD_pthread_cond_signal(a) pthread_cond_signal(*(a)) +#define ZSTD_pthread_cond_broadcast(a) pthread_cond_broadcast(*(a)) + +#define ZSTD_pthread_t pthread_t +#define ZSTD_pthread_create(a, b, c, d) pthread_create((a), (b), (c), (d)) +#define ZSTD_pthread_join(a, b) pthread_join((a),(b)) + +#endif + #else /* ZSTD_MULTITHREAD not defined */ /* No multithreading support */ diff --git a/thirdparty/zstd/common/xxhash.c b/thirdparty/zstd/common/xxhash.c index 30599aaae4..99d2459621 100644 --- a/thirdparty/zstd/common/xxhash.c +++ b/thirdparty/zstd/common/xxhash.c @@ -53,7 +53,8 @@ # if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) # define XXH_FORCE_MEMORY_ACCESS 2 # elif (defined(__INTEL_COMPILER) && !defined(WIN32)) || \ - (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) )) + (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) )) || \ + defined(__ICCARM__) # define XXH_FORCE_MEMORY_ACCESS 1 # endif #endif @@ -120,7 +121,7 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcp # define INLINE_KEYWORD #endif -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__ICCARM__) # define FORCE_INLINE_ATTR __attribute__((always_inline)) #elif defined(_MSC_VER) # define FORCE_INLINE_ATTR __forceinline @@ -206,7 +207,12 @@ static U64 XXH_read64(const void* memPtr) # define XXH_rotl32(x,r) _rotl(x,r) # define XXH_rotl64(x,r) _rotl64(x,r) #else +#if defined(__ICCARM__) +# include <intrinsics.h> +# define XXH_rotl32(x,r) __ROR(x,(32 - r)) +#else # define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r))) +#endif # define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r))) #endif diff --git a/thirdparty/zstd/common/zstd_internal.h b/thirdparty/zstd/common/zstd_internal.h index 81b16eac2e..dcdcbdb81c 100644 --- a/thirdparty/zstd/common/zstd_internal.h +++ b/thirdparty/zstd/common/zstd_internal.h @@ -56,9 +56,9 @@ extern "C" { /** * Return the specified error if the condition evaluates to true. * - * In debug modes, prints additional information. In order to do that - * (particularly, printing the conditional that failed), this can't just wrap - * RETURN_ERROR(). + * In debug modes, prints additional information. + * In order to do that (particularly, printing the conditional that failed), + * this can't just wrap RETURN_ERROR(). */ #define RETURN_ERROR_IF(cond, err, ...) \ if (cond) { \ @@ -197,79 +197,56 @@ static void ZSTD_copy8(void* dst, const void* src) { memcpy(dst, src, 8); } static void ZSTD_copy16(void* dst, const void* src) { memcpy(dst, src, 16); } #define COPY16(d,s) { ZSTD_copy16(d,s); d+=16; s+=16; } -#define WILDCOPY_OVERLENGTH 8 -#define VECLEN 16 +#define WILDCOPY_OVERLENGTH 32 +#define WILDCOPY_VECLEN 16 typedef enum { ZSTD_no_overlap, - ZSTD_overlap_src_before_dst, + ZSTD_overlap_src_before_dst /* ZSTD_overlap_dst_before_src, */ } ZSTD_overlap_e; /*! ZSTD_wildcopy() : - * custom version of memcpy(), can overwrite up to WILDCOPY_OVERLENGTH bytes (if length==0) */ + * Custom version of memcpy(), can over read/write up to WILDCOPY_OVERLENGTH bytes (if length==0) + * @param ovtype controls the overlap detection + * - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart. + * - ZSTD_overlap_src_before_dst: The src and dst may overlap, but they MUST be at least 8 bytes apart. + * The src buffer must be before the dst buffer. + */ MEM_STATIC FORCE_INLINE_ATTR DONT_VECTORIZE -void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e ovtype) +void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e const ovtype) { ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src; const BYTE* ip = (const BYTE*)src; BYTE* op = (BYTE*)dst; BYTE* const oend = op + length; - assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff < -8)); - if (length < VECLEN || (ovtype == ZSTD_overlap_src_before_dst && diff < VECLEN)) { - do - COPY8(op, ip) - while (op < oend); - } - else { - if ((length & 8) == 0) - COPY8(op, ip); - do { + assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff <= -WILDCOPY_VECLEN)); + + if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) { + /* Handle short offset copies. */ + do { + COPY8(op, ip) + } while (op < oend); + } else { + assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN); + /* Separate out the first two COPY16() calls because the copy length is + * almost certain to be short, so the branches have different + * probabilities. + * On gcc-9 unrolling once is +1.6%, twice is +2%, thrice is +1.8%. + * On clang-8 unrolling once is +1.4%, twice is +3.3%, thrice is +3%. + */ COPY16(op, ip); - } - while (op < oend); - } -} - -/*! ZSTD_wildcopy_16min() : - * same semantics as ZSTD_wilcopy() except guaranteed to be able to copy 16 bytes at the start */ -MEM_STATIC FORCE_INLINE_ATTR DONT_VECTORIZE -void ZSTD_wildcopy_16min(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e ovtype) -{ - ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src; - const BYTE* ip = (const BYTE*)src; - BYTE* op = (BYTE*)dst; - BYTE* const oend = op + length; - - assert(length >= 8); - assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff < -8)); - - if (ovtype == ZSTD_overlap_src_before_dst && diff < VECLEN) { - do - COPY8(op, ip) - while (op < oend); - } - else { - if ((length & 8) == 0) - COPY8(op, ip); - do { COPY16(op, ip); - } - while (op < oend); + if (op >= oend) return; + do { + COPY16(op, ip); + COPY16(op, ip); + } + while (op < oend); } } -MEM_STATIC void ZSTD_wildcopy_e(void* dst, const void* src, void* dstEnd) /* should be faster for decoding, but strangely, not verified on all platform */ -{ - const BYTE* ip = (const BYTE*)src; - BYTE* op = (BYTE*)dst; - BYTE* const oend = (BYTE*)dstEnd; - do - COPY8(op, ip) - while (op < oend); -} - /*-******************************************* * Private declarations @@ -323,7 +300,9 @@ MEM_STATIC U32 ZSTD_highbit32(U32 val) /* compress, dictBuilder, decodeCorpus _BitScanReverse(&r, val); return (unsigned)r; # elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC Intrinsic */ - return 31 - __builtin_clz(val); + return __builtin_clz (val) ^ 31; +# elif defined(__ICCARM__) /* IAR Intrinsic */ + return 31 - __CLZ(val); # else /* Software version */ static const U32 DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; U32 v = val; diff --git a/thirdparty/zstd/compress/zstd_compress.c b/thirdparty/zstd/compress/zstd_compress.c index 1476512580..35346b92cb 100644 --- a/thirdparty/zstd/compress/zstd_compress.c +++ b/thirdparty/zstd/compress/zstd_compress.c @@ -21,6 +21,8 @@ #define HUF_STATIC_LINKING_ONLY #include "huf.h" #include "zstd_compress_internal.h" +#include "zstd_compress_sequences.h" +#include "zstd_compress_literals.h" #include "zstd_fast.h" #include "zstd_double_fast.h" #include "zstd_lazy.h" @@ -40,15 +42,15 @@ size_t ZSTD_compressBound(size_t srcSize) { * Context memory management ***************************************/ struct ZSTD_CDict_s { - void* dictBuffer; const void* dictContent; size_t dictContentSize; - void* workspace; - size_t workspaceSize; + U32* entropyWorkspace; /* entropy workspace of HUF_WORKSPACE_SIZE bytes */ + ZSTD_cwksp workspace; ZSTD_matchState_t matchState; ZSTD_compressedBlockState_t cBlockState; ZSTD_customMem customMem; U32 dictID; + int compressionLevel; /* 0 indicates that advanced API was used to select CDict params */ }; /* typedef'd to ZSTD_CDict within "zstd.h" */ ZSTD_CCtx* ZSTD_createCCtx(void) @@ -82,23 +84,26 @@ ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem) ZSTD_CCtx* ZSTD_initStaticCCtx(void *workspace, size_t workspaceSize) { - ZSTD_CCtx* const cctx = (ZSTD_CCtx*) workspace; + ZSTD_cwksp ws; + ZSTD_CCtx* cctx; if (workspaceSize <= sizeof(ZSTD_CCtx)) return NULL; /* minimum size */ if ((size_t)workspace & 7) return NULL; /* must be 8-aligned */ - memset(workspace, 0, workspaceSize); /* may be a bit generous, could memset be smaller ? */ + ZSTD_cwksp_init(&ws, workspace, workspaceSize); + + cctx = (ZSTD_CCtx*)ZSTD_cwksp_reserve_object(&ws, sizeof(ZSTD_CCtx)); + if (cctx == NULL) { + return NULL; + } + memset(cctx, 0, sizeof(ZSTD_CCtx)); + ZSTD_cwksp_move(&cctx->workspace, &ws); cctx->staticSize = workspaceSize; - cctx->workSpace = (void*)(cctx+1); - cctx->workSpaceSize = workspaceSize - sizeof(ZSTD_CCtx); /* statically sized space. entropyWorkspace never moves (but prev/next block swap places) */ - if (cctx->workSpaceSize < HUF_WORKSPACE_SIZE + 2 * sizeof(ZSTD_compressedBlockState_t)) return NULL; - assert(((size_t)cctx->workSpace & (sizeof(void*)-1)) == 0); /* ensure correct alignment */ - cctx->blockState.prevCBlock = (ZSTD_compressedBlockState_t*)cctx->workSpace; - cctx->blockState.nextCBlock = cctx->blockState.prevCBlock + 1; - { - void* const ptr = cctx->blockState.nextCBlock + 1; - cctx->entropyWorkspace = (U32*)ptr; - } + if (!ZSTD_cwksp_check_available(&cctx->workspace, HUF_WORKSPACE_SIZE + 2 * sizeof(ZSTD_compressedBlockState_t))) return NULL; + cctx->blockState.prevCBlock = (ZSTD_compressedBlockState_t*)ZSTD_cwksp_reserve_object(&cctx->workspace, sizeof(ZSTD_compressedBlockState_t)); + cctx->blockState.nextCBlock = (ZSTD_compressedBlockState_t*)ZSTD_cwksp_reserve_object(&cctx->workspace, sizeof(ZSTD_compressedBlockState_t)); + cctx->entropyWorkspace = (U32*)ZSTD_cwksp_reserve_object( + &cctx->workspace, HUF_WORKSPACE_SIZE); cctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid()); return cctx; } @@ -126,11 +131,11 @@ static void ZSTD_freeCCtxContent(ZSTD_CCtx* cctx) { assert(cctx != NULL); assert(cctx->staticSize == 0); - ZSTD_free(cctx->workSpace, cctx->customMem); cctx->workSpace = NULL; ZSTD_clearAllDicts(cctx); #ifdef ZSTD_MULTITHREAD ZSTDMT_freeCCtx(cctx->mtctx); cctx->mtctx = NULL; #endif + ZSTD_cwksp_free(&cctx->workspace, cctx->customMem); } size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx) @@ -138,8 +143,13 @@ size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx) if (cctx==NULL) return 0; /* support free on NULL */ RETURN_ERROR_IF(cctx->staticSize, memory_allocation, "not compatible with static CCtx"); - ZSTD_freeCCtxContent(cctx); - ZSTD_free(cctx, cctx->customMem); + { + int cctxInWorkspace = ZSTD_cwksp_owns_buffer(&cctx->workspace, cctx); + ZSTD_freeCCtxContent(cctx); + if (!cctxInWorkspace) { + ZSTD_free(cctx, cctx->customMem); + } + } return 0; } @@ -158,7 +168,9 @@ static size_t ZSTD_sizeof_mtctx(const ZSTD_CCtx* cctx) size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx) { if (cctx==NULL) return 0; /* support sizeof on NULL */ - return sizeof(*cctx) + cctx->workSpaceSize + /* cctx may be in the workspace */ + return (cctx->workspace.workspace == cctx ? 0 : sizeof(*cctx)) + + ZSTD_cwksp_sizeof(&cctx->workspace) + ZSTD_sizeof_localDict(cctx->localDict) + ZSTD_sizeof_mtctx(cctx); } @@ -227,23 +239,23 @@ size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_paramete RETURN_ERROR_IF(!cctxParams, GENERIC); FORWARD_IF_ERROR( ZSTD_checkCParams(params.cParams) ); memset(cctxParams, 0, sizeof(*cctxParams)); + assert(!ZSTD_checkCParams(params.cParams)); cctxParams->cParams = params.cParams; cctxParams->fParams = params.fParams; cctxParams->compressionLevel = ZSTD_CLEVEL_DEFAULT; /* should not matter, as all cParams are presumed properly defined */ - assert(!ZSTD_checkCParams(params.cParams)); return 0; } /* ZSTD_assignParamsToCCtxParams() : * params is presumed valid at this stage */ static ZSTD_CCtx_params ZSTD_assignParamsToCCtxParams( - ZSTD_CCtx_params cctxParams, ZSTD_parameters params) + const ZSTD_CCtx_params* cctxParams, ZSTD_parameters params) { - ZSTD_CCtx_params ret = cctxParams; + ZSTD_CCtx_params ret = *cctxParams; + assert(!ZSTD_checkCParams(params.cParams)); ret.cParams = params.cParams; ret.fParams = params.fParams; ret.compressionLevel = ZSTD_CLEVEL_DEFAULT; /* should not matter, as all cParams are presumed properly defined */ - assert(!ZSTD_checkCParams(params.cParams)); return ret; } @@ -376,7 +388,7 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) case ZSTD_c_forceAttachDict: ZSTD_STATIC_ASSERT(ZSTD_dictDefaultAttach < ZSTD_dictForceCopy); bounds.lowerBound = ZSTD_dictDefaultAttach; - bounds.upperBound = ZSTD_dictForceCopy; /* note : how to ensure at compile time that this is the highest value enum ? */ + bounds.upperBound = ZSTD_dictForceLoad; /* note : how to ensure at compile time that this is the highest value enum ? */ return bounds; case ZSTD_c_literalCompressionMode: @@ -390,6 +402,11 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) bounds.upperBound = ZSTD_TARGETCBLOCKSIZE_MAX; return bounds; + case ZSTD_c_srcSizeHint: + bounds.lowerBound = ZSTD_SRCSIZEHINT_MIN; + bounds.upperBound = ZSTD_SRCSIZEHINT_MAX; + return bounds; + default: { ZSTD_bounds const boundError = { ERROR(parameter_unsupported), 0, 0 }; return boundError; @@ -397,18 +414,6 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) } } -/* ZSTD_cParam_withinBounds: - * @return 1 if value is within cParam bounds, - * 0 otherwise */ -static int ZSTD_cParam_withinBounds(ZSTD_cParameter cParam, int value) -{ - ZSTD_bounds const bounds = ZSTD_cParam_getBounds(cParam); - if (ZSTD_isError(bounds.error)) return 0; - if (value < bounds.lowerBound) return 0; - if (value > bounds.upperBound) return 0; - return 1; -} - /* ZSTD_cParam_clampBounds: * Clamps the value into the bounded range. */ @@ -458,6 +463,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter param) case ZSTD_c_forceAttachDict: case ZSTD_c_literalCompressionMode: case ZSTD_c_targetCBlockSize: + case ZSTD_c_srcSizeHint: default: return 0; } @@ -504,6 +510,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value) case ZSTD_c_ldmMinMatch: case ZSTD_c_ldmBucketSizeLog: case ZSTD_c_targetCBlockSize: + case ZSTD_c_srcSizeHint: break; default: RETURN_ERROR(parameter_unsupported); @@ -527,33 +534,33 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams, if (value) { /* 0 : does not change current level */ CCtxParams->compressionLevel = value; } - if (CCtxParams->compressionLevel >= 0) return CCtxParams->compressionLevel; + if (CCtxParams->compressionLevel >= 0) return (size_t)CCtxParams->compressionLevel; return 0; /* return type (size_t) cannot represent negative values */ } case ZSTD_c_windowLog : if (value!=0) /* 0 => use default */ BOUNDCHECK(ZSTD_c_windowLog, value); - CCtxParams->cParams.windowLog = value; + CCtxParams->cParams.windowLog = (U32)value; return CCtxParams->cParams.windowLog; case ZSTD_c_hashLog : if (value!=0) /* 0 => use default */ BOUNDCHECK(ZSTD_c_hashLog, value); - CCtxParams->cParams.hashLog = value; + CCtxParams->cParams.hashLog = (U32)value; return CCtxParams->cParams.hashLog; case ZSTD_c_chainLog : if (value!=0) /* 0 => use default */ BOUNDCHECK(ZSTD_c_chainLog, value); - CCtxParams->cParams.chainLog = value; + CCtxParams->cParams.chainLog = (U32)value; return CCtxParams->cParams.chainLog; case ZSTD_c_searchLog : if (value!=0) /* 0 => use default */ BOUNDCHECK(ZSTD_c_searchLog, value); - CCtxParams->cParams.searchLog = value; - return value; + CCtxParams->cParams.searchLog = (U32)value; + return (size_t)value; case ZSTD_c_minMatch : if (value!=0) /* 0 => use default */ @@ -684,6 +691,12 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams, CCtxParams->targetCBlockSize = value; return CCtxParams->targetCBlockSize; + case ZSTD_c_srcSizeHint : + if (value!=0) /* 0 ==> default */ + BOUNDCHECK(ZSTD_c_srcSizeHint, value); + CCtxParams->srcSizeHint = value; + return CCtxParams->srcSizeHint; + default: RETURN_ERROR(parameter_unsupported, "unknown parameter"); } } @@ -789,6 +802,9 @@ size_t ZSTD_CCtxParams_getParameter( case ZSTD_c_targetCBlockSize : *value = (int)CCtxParams->targetCBlockSize; break; + case ZSTD_c_srcSizeHint : + *value = (int)CCtxParams->srcSizeHint; + break; default: RETURN_ERROR(parameter_unsupported, "unknown parameter"); } return 0; @@ -1039,7 +1055,11 @@ ZSTD_adjustCParams(ZSTD_compressionParameters cPar, ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams( const ZSTD_CCtx_params* CCtxParams, U64 srcSizeHint, size_t dictSize) { - ZSTD_compressionParameters cParams = ZSTD_getCParams(CCtxParams->compressionLevel, srcSizeHint, dictSize); + ZSTD_compressionParameters cParams; + if (srcSizeHint == ZSTD_CONTENTSIZE_UNKNOWN && CCtxParams->srcSizeHint > 0) { + srcSizeHint = CCtxParams->srcSizeHint; + } + cParams = ZSTD_getCParams(CCtxParams->compressionLevel, srcSizeHint, dictSize); if (CCtxParams->ldmParams.enableLdm) cParams.windowLog = ZSTD_LDM_DEFAULT_WINDOW_LOG; if (CCtxParams->cParams.windowLog) cParams.windowLog = CCtxParams->cParams.windowLog; if (CCtxParams->cParams.hashLog) cParams.hashLog = CCtxParams->cParams.hashLog; @@ -1059,10 +1079,19 @@ ZSTD_sizeof_matchState(const ZSTD_compressionParameters* const cParams, size_t const chainSize = (cParams->strategy == ZSTD_fast) ? 0 : ((size_t)1 << cParams->chainLog); size_t const hSize = ((size_t)1) << cParams->hashLog; U32 const hashLog3 = (forCCtx && cParams->minMatch==3) ? MIN(ZSTD_HASHLOG3_MAX, cParams->windowLog) : 0; - size_t const h3Size = ((size_t)1) << hashLog3; - size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); - size_t const optPotentialSpace = ((MaxML+1) + (MaxLL+1) + (MaxOff+1) + (1<<Litbits)) * sizeof(U32) - + (ZSTD_OPT_NUM+1) * (sizeof(ZSTD_match_t)+sizeof(ZSTD_optimal_t)); + size_t const h3Size = hashLog3 ? ((size_t)1) << hashLog3 : 0; + /* We don't use ZSTD_cwksp_alloc_size() here because the tables aren't + * surrounded by redzones in ASAN. */ + size_t const tableSpace = chainSize * sizeof(U32) + + hSize * sizeof(U32) + + h3Size * sizeof(U32); + size_t const optPotentialSpace = + ZSTD_cwksp_alloc_size((MaxML+1) * sizeof(U32)) + + ZSTD_cwksp_alloc_size((MaxLL+1) * sizeof(U32)) + + ZSTD_cwksp_alloc_size((MaxOff+1) * sizeof(U32)) + + ZSTD_cwksp_alloc_size((1<<Litbits) * sizeof(U32)) + + ZSTD_cwksp_alloc_size((ZSTD_OPT_NUM+1) * sizeof(ZSTD_match_t)) + + ZSTD_cwksp_alloc_size((ZSTD_OPT_NUM+1) * sizeof(ZSTD_optimal_t)); size_t const optSpace = (forCCtx && (cParams->strategy >= ZSTD_btopt)) ? optPotentialSpace : 0; @@ -1079,20 +1108,23 @@ size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params) size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << cParams.windowLog); U32 const divider = (cParams.minMatch==3) ? 3 : 4; size_t const maxNbSeq = blockSize / divider; - size_t const tokenSpace = WILDCOPY_OVERLENGTH + blockSize + 11*maxNbSeq; - size_t const entropySpace = HUF_WORKSPACE_SIZE; - size_t const blockStateSpace = 2 * sizeof(ZSTD_compressedBlockState_t); + size_t const tokenSpace = ZSTD_cwksp_alloc_size(WILDCOPY_OVERLENGTH + blockSize) + + ZSTD_cwksp_alloc_size(maxNbSeq * sizeof(seqDef)) + + 3 * ZSTD_cwksp_alloc_size(maxNbSeq * sizeof(BYTE)); + size_t const entropySpace = ZSTD_cwksp_alloc_size(HUF_WORKSPACE_SIZE); + size_t const blockStateSpace = 2 * ZSTD_cwksp_alloc_size(sizeof(ZSTD_compressedBlockState_t)); size_t const matchStateSize = ZSTD_sizeof_matchState(&cParams, /* forCCtx */ 1); size_t const ldmSpace = ZSTD_ldm_getTableSize(params->ldmParams); - size_t const ldmSeqSpace = ZSTD_ldm_getMaxNbSeq(params->ldmParams, blockSize) * sizeof(rawSeq); + size_t const ldmSeqSpace = ZSTD_cwksp_alloc_size(ZSTD_ldm_getMaxNbSeq(params->ldmParams, blockSize) * sizeof(rawSeq)); size_t const neededSpace = entropySpace + blockStateSpace + tokenSpace + matchStateSize + ldmSpace + ldmSeqSpace; + size_t const cctxSpace = ZSTD_cwksp_alloc_size(sizeof(ZSTD_CCtx)); - DEBUGLOG(5, "sizeof(ZSTD_CCtx) : %u", (U32)sizeof(ZSTD_CCtx)); - DEBUGLOG(5, "estimate workSpace : %u", (U32)neededSpace); - return sizeof(ZSTD_CCtx) + neededSpace; + DEBUGLOG(5, "sizeof(ZSTD_CCtx) : %u", (U32)cctxSpace); + DEBUGLOG(5, "estimate workspace : %u", (U32)neededSpace); + return cctxSpace + neededSpace; } } @@ -1128,7 +1160,8 @@ size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params) size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << cParams.windowLog); size_t const inBuffSize = ((size_t)1 << cParams.windowLog) + blockSize; size_t const outBuffSize = ZSTD_compressBound(blockSize) + 1; - size_t const streamingSize = inBuffSize + outBuffSize; + size_t const streamingSize = ZSTD_cwksp_alloc_size(inBuffSize) + + ZSTD_cwksp_alloc_size(outBuffSize); return CCtxSize + streamingSize; } @@ -1196,17 +1229,6 @@ size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx) return 0; /* over-simplification; could also check if context is currently running in streaming mode, and in which case, report how many bytes are left to be flushed within output buffer */ } - - -static U32 ZSTD_equivalentCParams(ZSTD_compressionParameters cParams1, - ZSTD_compressionParameters cParams2) -{ - return (cParams1.hashLog == cParams2.hashLog) - & (cParams1.chainLog == cParams2.chainLog) - & (cParams1.strategy == cParams2.strategy) /* opt parser space */ - & ((cParams1.minMatch==3) == (cParams2.minMatch==3)); /* hashlog3 space */ -} - static void ZSTD_assertEqualCParams(ZSTD_compressionParameters cParams1, ZSTD_compressionParameters cParams2) { @@ -1221,71 +1243,6 @@ static void ZSTD_assertEqualCParams(ZSTD_compressionParameters cParams1, assert(cParams1.strategy == cParams2.strategy); } -/** The parameters are equivalent if ldm is not enabled in both sets or - * all the parameters are equivalent. */ -static U32 ZSTD_equivalentLdmParams(ldmParams_t ldmParams1, - ldmParams_t ldmParams2) -{ - return (!ldmParams1.enableLdm && !ldmParams2.enableLdm) || - (ldmParams1.enableLdm == ldmParams2.enableLdm && - ldmParams1.hashLog == ldmParams2.hashLog && - ldmParams1.bucketSizeLog == ldmParams2.bucketSizeLog && - ldmParams1.minMatchLength == ldmParams2.minMatchLength && - ldmParams1.hashRateLog == ldmParams2.hashRateLog); -} - -typedef enum { ZSTDb_not_buffered, ZSTDb_buffered } ZSTD_buffered_policy_e; - -/* ZSTD_sufficientBuff() : - * check internal buffers exist for streaming if buffPol == ZSTDb_buffered . - * Note : they are assumed to be correctly sized if ZSTD_equivalentCParams()==1 */ -static U32 ZSTD_sufficientBuff(size_t bufferSize1, size_t maxNbSeq1, - size_t maxNbLit1, - ZSTD_buffered_policy_e buffPol2, - ZSTD_compressionParameters cParams2, - U64 pledgedSrcSize) -{ - size_t const windowSize2 = MAX(1, (size_t)MIN(((U64)1 << cParams2.windowLog), pledgedSrcSize)); - size_t const blockSize2 = MIN(ZSTD_BLOCKSIZE_MAX, windowSize2); - size_t const maxNbSeq2 = blockSize2 / ((cParams2.minMatch == 3) ? 3 : 4); - size_t const maxNbLit2 = blockSize2; - size_t const neededBufferSize2 = (buffPol2==ZSTDb_buffered) ? windowSize2 + blockSize2 : 0; - DEBUGLOG(4, "ZSTD_sufficientBuff: is neededBufferSize2=%u <= bufferSize1=%u", - (U32)neededBufferSize2, (U32)bufferSize1); - DEBUGLOG(4, "ZSTD_sufficientBuff: is maxNbSeq2=%u <= maxNbSeq1=%u", - (U32)maxNbSeq2, (U32)maxNbSeq1); - DEBUGLOG(4, "ZSTD_sufficientBuff: is maxNbLit2=%u <= maxNbLit1=%u", - (U32)maxNbLit2, (U32)maxNbLit1); - return (maxNbLit2 <= maxNbLit1) - & (maxNbSeq2 <= maxNbSeq1) - & (neededBufferSize2 <= bufferSize1); -} - -/** Equivalence for resetCCtx purposes */ -static U32 ZSTD_equivalentParams(ZSTD_CCtx_params params1, - ZSTD_CCtx_params params2, - size_t buffSize1, - size_t maxNbSeq1, size_t maxNbLit1, - ZSTD_buffered_policy_e buffPol2, - U64 pledgedSrcSize) -{ - DEBUGLOG(4, "ZSTD_equivalentParams: pledgedSrcSize=%u", (U32)pledgedSrcSize); - if (!ZSTD_equivalentCParams(params1.cParams, params2.cParams)) { - DEBUGLOG(4, "ZSTD_equivalentCParams() == 0"); - return 0; - } - if (!ZSTD_equivalentLdmParams(params1.ldmParams, params2.ldmParams)) { - DEBUGLOG(4, "ZSTD_equivalentLdmParams() == 0"); - return 0; - } - if (!ZSTD_sufficientBuff(buffSize1, maxNbSeq1, maxNbLit1, buffPol2, - params2.cParams, pledgedSrcSize)) { - DEBUGLOG(4, "ZSTD_sufficientBuff() == 0"); - return 0; - } - return 1; -} - static void ZSTD_reset_compressedBlockState(ZSTD_compressedBlockState_t* bs) { int i; @@ -1311,87 +1268,104 @@ static void ZSTD_invalidateMatchState(ZSTD_matchState_t* ms) ms->dictMatchState = NULL; } -/*! ZSTD_continueCCtx() : - * reuse CCtx without reset (note : requires no dictionary) */ -static size_t ZSTD_continueCCtx(ZSTD_CCtx* cctx, ZSTD_CCtx_params params, U64 pledgedSrcSize) -{ - size_t const windowSize = MAX(1, (size_t)MIN(((U64)1 << params.cParams.windowLog), pledgedSrcSize)); - size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, windowSize); - DEBUGLOG(4, "ZSTD_continueCCtx: re-use context in place"); +/** + * Indicates whether this compression proceeds directly from user-provided + * source buffer to user-provided destination buffer (ZSTDb_not_buffered), or + * whether the context needs to buffer the input/output (ZSTDb_buffered). + */ +typedef enum { + ZSTDb_not_buffered, + ZSTDb_buffered +} ZSTD_buffered_policy_e; - cctx->blockSize = blockSize; /* previous block size could be different even for same windowLog, due to pledgedSrcSize */ - cctx->appliedParams = params; - cctx->blockState.matchState.cParams = params.cParams; - cctx->pledgedSrcSizePlusOne = pledgedSrcSize+1; - cctx->consumedSrcSize = 0; - cctx->producedCSize = 0; - if (pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN) - cctx->appliedParams.fParams.contentSizeFlag = 0; - DEBUGLOG(4, "pledged content size : %u ; flag : %u", - (U32)pledgedSrcSize, cctx->appliedParams.fParams.contentSizeFlag); - cctx->stage = ZSTDcs_init; - cctx->dictID = 0; - if (params.ldmParams.enableLdm) - ZSTD_window_clear(&cctx->ldmState.window); - ZSTD_referenceExternalSequences(cctx, NULL, 0); - ZSTD_invalidateMatchState(&cctx->blockState.matchState); - ZSTD_reset_compressedBlockState(cctx->blockState.prevCBlock); - XXH64_reset(&cctx->xxhState, 0); - return 0; -} +/** + * Controls, for this matchState reset, whether the tables need to be cleared / + * prepared for the coming compression (ZSTDcrp_makeClean), or whether the + * tables can be left unclean (ZSTDcrp_leaveDirty), because we know that a + * subsequent operation will overwrite the table space anyways (e.g., copying + * the matchState contents in from a CDict). + */ +typedef enum { + ZSTDcrp_makeClean, + ZSTDcrp_leaveDirty +} ZSTD_compResetPolicy_e; -typedef enum { ZSTDcrp_continue, ZSTDcrp_noMemset } ZSTD_compResetPolicy_e; +/** + * Controls, for this matchState reset, whether indexing can continue where it + * left off (ZSTDirp_continue), or whether it needs to be restarted from zero + * (ZSTDirp_reset). + */ +typedef enum { + ZSTDirp_continue, + ZSTDirp_reset +} ZSTD_indexResetPolicy_e; -typedef enum { ZSTD_resetTarget_CDict, ZSTD_resetTarget_CCtx } ZSTD_resetTarget_e; +typedef enum { + ZSTD_resetTarget_CDict, + ZSTD_resetTarget_CCtx +} ZSTD_resetTarget_e; -static void* +static size_t ZSTD_reset_matchState(ZSTD_matchState_t* ms, - void* ptr, + ZSTD_cwksp* ws, const ZSTD_compressionParameters* cParams, - ZSTD_compResetPolicy_e const crp, ZSTD_resetTarget_e const forWho) + const ZSTD_compResetPolicy_e crp, + const ZSTD_indexResetPolicy_e forceResetIndex, + const ZSTD_resetTarget_e forWho) { size_t const chainSize = (cParams->strategy == ZSTD_fast) ? 0 : ((size_t)1 << cParams->chainLog); size_t const hSize = ((size_t)1) << cParams->hashLog; U32 const hashLog3 = ((forWho == ZSTD_resetTarget_CCtx) && cParams->minMatch==3) ? MIN(ZSTD_HASHLOG3_MAX, cParams->windowLog) : 0; - size_t const h3Size = ((size_t)1) << hashLog3; - size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); - - assert(((size_t)ptr & 3) == 0); + size_t const h3Size = hashLog3 ? ((size_t)1) << hashLog3 : 0; + + DEBUGLOG(4, "reset indices : %u", forceResetIndex == ZSTDirp_reset); + if (forceResetIndex == ZSTDirp_reset) { + memset(&ms->window, 0, sizeof(ms->window)); + ms->window.dictLimit = 1; /* start from 1, so that 1st position is valid */ + ms->window.lowLimit = 1; /* it ensures first and later CCtx usages compress the same */ + ms->window.nextSrc = ms->window.base + 1; /* see issue #1241 */ + ZSTD_cwksp_mark_tables_dirty(ws); + } ms->hashLog3 = hashLog3; - memset(&ms->window, 0, sizeof(ms->window)); - ms->window.dictLimit = 1; /* start from 1, so that 1st position is valid */ - ms->window.lowLimit = 1; /* it ensures first and later CCtx usages compress the same */ - ms->window.nextSrc = ms->window.base + 1; /* see issue #1241 */ + ZSTD_invalidateMatchState(ms); + assert(!ZSTD_cwksp_reserve_failed(ws)); /* check that allocation hasn't already failed */ + + ZSTD_cwksp_clear_tables(ws); + + DEBUGLOG(5, "reserving table space"); + /* table Space */ + ms->hashTable = (U32*)ZSTD_cwksp_reserve_table(ws, hSize * sizeof(U32)); + ms->chainTable = (U32*)ZSTD_cwksp_reserve_table(ws, chainSize * sizeof(U32)); + ms->hashTable3 = (U32*)ZSTD_cwksp_reserve_table(ws, h3Size * sizeof(U32)); + RETURN_ERROR_IF(ZSTD_cwksp_reserve_failed(ws), memory_allocation, + "failed a workspace allocation in ZSTD_reset_matchState"); + + DEBUGLOG(4, "reset table : %u", crp!=ZSTDcrp_leaveDirty); + if (crp!=ZSTDcrp_leaveDirty) { + /* reset tables only */ + ZSTD_cwksp_clean_tables(ws); + } + /* opt parser space */ if ((forWho == ZSTD_resetTarget_CCtx) && (cParams->strategy >= ZSTD_btopt)) { DEBUGLOG(4, "reserving optimal parser space"); - ms->opt.litFreq = (unsigned*)ptr; - ms->opt.litLengthFreq = ms->opt.litFreq + (1<<Litbits); - ms->opt.matchLengthFreq = ms->opt.litLengthFreq + (MaxLL+1); - ms->opt.offCodeFreq = ms->opt.matchLengthFreq + (MaxML+1); - ptr = ms->opt.offCodeFreq + (MaxOff+1); - ms->opt.matchTable = (ZSTD_match_t*)ptr; - ptr = ms->opt.matchTable + ZSTD_OPT_NUM+1; - ms->opt.priceTable = (ZSTD_optimal_t*)ptr; - ptr = ms->opt.priceTable + ZSTD_OPT_NUM+1; + ms->opt.litFreq = (unsigned*)ZSTD_cwksp_reserve_aligned(ws, (1<<Litbits) * sizeof(unsigned)); + ms->opt.litLengthFreq = (unsigned*)ZSTD_cwksp_reserve_aligned(ws, (MaxLL+1) * sizeof(unsigned)); + ms->opt.matchLengthFreq = (unsigned*)ZSTD_cwksp_reserve_aligned(ws, (MaxML+1) * sizeof(unsigned)); + ms->opt.offCodeFreq = (unsigned*)ZSTD_cwksp_reserve_aligned(ws, (MaxOff+1) * sizeof(unsigned)); + ms->opt.matchTable = (ZSTD_match_t*)ZSTD_cwksp_reserve_aligned(ws, (ZSTD_OPT_NUM+1) * sizeof(ZSTD_match_t)); + ms->opt.priceTable = (ZSTD_optimal_t*)ZSTD_cwksp_reserve_aligned(ws, (ZSTD_OPT_NUM+1) * sizeof(ZSTD_optimal_t)); } - /* table Space */ - DEBUGLOG(4, "reset table : %u", crp!=ZSTDcrp_noMemset); - assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */ - if (crp!=ZSTDcrp_noMemset) memset(ptr, 0, tableSpace); /* reset tables only */ - ms->hashTable = (U32*)(ptr); - ms->chainTable = ms->hashTable + hSize; - ms->hashTable3 = ms->chainTable + chainSize; - ptr = ms->hashTable3 + h3Size; - ms->cParams = *cParams; - assert(((size_t)ptr & 3) == 0); - return ptr; + RETURN_ERROR_IF(ZSTD_cwksp_reserve_failed(ws), memory_allocation, + "failed a workspace allocation in ZSTD_reset_matchState"); + + return 0; } /* ZSTD_indexTooCloseToMax() : @@ -1407,13 +1381,6 @@ static int ZSTD_indexTooCloseToMax(ZSTD_window_t w) return (size_t)(w.nextSrc - w.base) > (ZSTD_CURRENT_MAX - ZSTD_INDEXOVERFLOW_MARGIN); } -#define ZSTD_WORKSPACETOOLARGE_FACTOR 3 /* define "workspace is too large" as this number of times larger than needed */ -#define ZSTD_WORKSPACETOOLARGE_MAXDURATION 128 /* when workspace is continuously too large - * during at least this number of times, - * context's memory usage is considered wasteful, - * because it's sized to handle a worst case scenario which rarely happens. - * In which case, resize it down to free some memory */ - /*! ZSTD_resetCCtx_internal() : note : `params` are assumed fully validated at this stage */ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, @@ -1422,30 +1389,12 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, ZSTD_compResetPolicy_e const crp, ZSTD_buffered_policy_e const zbuff) { + ZSTD_cwksp* const ws = &zc->workspace; DEBUGLOG(4, "ZSTD_resetCCtx_internal: pledgedSrcSize=%u, wlog=%u", (U32)pledgedSrcSize, params.cParams.windowLog); assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams))); - if (crp == ZSTDcrp_continue) { - if (ZSTD_equivalentParams(zc->appliedParams, params, - zc->inBuffSize, - zc->seqStore.maxNbSeq, zc->seqStore.maxNbLit, - zbuff, pledgedSrcSize) ) { - DEBUGLOG(4, "ZSTD_equivalentParams()==1 -> consider continue mode"); - zc->workSpaceOversizedDuration += (zc->workSpaceOversizedDuration > 0); /* if it was too large, it still is */ - if (zc->workSpaceOversizedDuration <= ZSTD_WORKSPACETOOLARGE_MAXDURATION) { - DEBUGLOG(4, "continue mode confirmed (wLog1=%u, blockSize1=%zu)", - zc->appliedParams.cParams.windowLog, zc->blockSize); - if (ZSTD_indexTooCloseToMax(zc->blockState.matchState.window)) { - /* prefer a reset, faster than a rescale */ - ZSTD_reset_matchState(&zc->blockState.matchState, - zc->entropyWorkspace + HUF_WORKSPACE_SIZE_U32, - ¶ms.cParams, - crp, ZSTD_resetTarget_CCtx); - } - return ZSTD_continueCCtx(zc, params, pledgedSrcSize); - } } } - DEBUGLOG(4, "ZSTD_equivalentParams()==0 -> reset CCtx"); + zc->isFirstBlock = 1; if (params.ldmParams.enableLdm) { /* Adjust long distance matching parameters */ @@ -1459,58 +1408,74 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, windowSize); U32 const divider = (params.cParams.minMatch==3) ? 3 : 4; size_t const maxNbSeq = blockSize / divider; - size_t const tokenSpace = WILDCOPY_OVERLENGTH + blockSize + 11*maxNbSeq; + size_t const tokenSpace = ZSTD_cwksp_alloc_size(WILDCOPY_OVERLENGTH + blockSize) + + ZSTD_cwksp_alloc_size(maxNbSeq * sizeof(seqDef)) + + 3 * ZSTD_cwksp_alloc_size(maxNbSeq * sizeof(BYTE)); size_t const buffOutSize = (zbuff==ZSTDb_buffered) ? ZSTD_compressBound(blockSize)+1 : 0; size_t const buffInSize = (zbuff==ZSTDb_buffered) ? windowSize + blockSize : 0; size_t const matchStateSize = ZSTD_sizeof_matchState(¶ms.cParams, /* forCCtx */ 1); size_t const maxNbLdmSeq = ZSTD_ldm_getMaxNbSeq(params.ldmParams, blockSize); - void* ptr; /* used to partition workSpace */ - /* Check if workSpace is large enough, alloc a new one if needed */ - { size_t const entropySpace = HUF_WORKSPACE_SIZE; - size_t const blockStateSpace = 2 * sizeof(ZSTD_compressedBlockState_t); - size_t const bufferSpace = buffInSize + buffOutSize; + ZSTD_indexResetPolicy_e needsIndexReset = ZSTDirp_continue; + + if (ZSTD_indexTooCloseToMax(zc->blockState.matchState.window)) { + needsIndexReset = ZSTDirp_reset; + } + + ZSTD_cwksp_bump_oversized_duration(ws, 0); + + /* Check if workspace is large enough, alloc a new one if needed */ + { size_t const cctxSpace = zc->staticSize ? ZSTD_cwksp_alloc_size(sizeof(ZSTD_CCtx)) : 0; + size_t const entropySpace = ZSTD_cwksp_alloc_size(HUF_WORKSPACE_SIZE); + size_t const blockStateSpace = 2 * ZSTD_cwksp_alloc_size(sizeof(ZSTD_compressedBlockState_t)); + size_t const bufferSpace = ZSTD_cwksp_alloc_size(buffInSize) + ZSTD_cwksp_alloc_size(buffOutSize); size_t const ldmSpace = ZSTD_ldm_getTableSize(params.ldmParams); - size_t const ldmSeqSpace = maxNbLdmSeq * sizeof(rawSeq); + size_t const ldmSeqSpace = ZSTD_cwksp_alloc_size(maxNbLdmSeq * sizeof(rawSeq)); - size_t const neededSpace = entropySpace + blockStateSpace + ldmSpace + - ldmSeqSpace + matchStateSize + tokenSpace + - bufferSpace; + size_t const neededSpace = + cctxSpace + + entropySpace + + blockStateSpace + + ldmSpace + + ldmSeqSpace + + matchStateSize + + tokenSpace + + bufferSpace; - int const workSpaceTooSmall = zc->workSpaceSize < neededSpace; - int const workSpaceTooLarge = zc->workSpaceSize > ZSTD_WORKSPACETOOLARGE_FACTOR * neededSpace; - int const workSpaceWasteful = workSpaceTooLarge && (zc->workSpaceOversizedDuration > ZSTD_WORKSPACETOOLARGE_MAXDURATION); - zc->workSpaceOversizedDuration = workSpaceTooLarge ? zc->workSpaceOversizedDuration+1 : 0; + int const workspaceTooSmall = ZSTD_cwksp_sizeof(ws) < neededSpace; + int const workspaceWasteful = ZSTD_cwksp_check_wasteful(ws, neededSpace); DEBUGLOG(4, "Need %zuKB workspace, including %zuKB for match state, and %zuKB for buffers", neededSpace>>10, matchStateSize>>10, bufferSpace>>10); DEBUGLOG(4, "windowSize: %zu - blockSize: %zu", windowSize, blockSize); - if (workSpaceTooSmall || workSpaceWasteful) { - DEBUGLOG(4, "Resize workSpaceSize from %zuKB to %zuKB", - zc->workSpaceSize >> 10, + if (workspaceTooSmall || workspaceWasteful) { + DEBUGLOG(4, "Resize workspaceSize from %zuKB to %zuKB", + ZSTD_cwksp_sizeof(ws) >> 10, neededSpace >> 10); RETURN_ERROR_IF(zc->staticSize, memory_allocation, "static cctx : no resize"); - zc->workSpaceSize = 0; - ZSTD_free(zc->workSpace, zc->customMem); - zc->workSpace = ZSTD_malloc(neededSpace, zc->customMem); - RETURN_ERROR_IF(zc->workSpace == NULL, memory_allocation); - zc->workSpaceSize = neededSpace; - zc->workSpaceOversizedDuration = 0; + needsIndexReset = ZSTDirp_reset; + + ZSTD_cwksp_free(ws, zc->customMem); + FORWARD_IF_ERROR(ZSTD_cwksp_create(ws, neededSpace, zc->customMem)); + DEBUGLOG(5, "reserving object space"); /* Statically sized space. * entropyWorkspace never moves, * though prev/next block swap places */ - assert(((size_t)zc->workSpace & 3) == 0); /* ensure correct alignment */ - assert(zc->workSpaceSize >= 2 * sizeof(ZSTD_compressedBlockState_t)); - zc->blockState.prevCBlock = (ZSTD_compressedBlockState_t*)zc->workSpace; - zc->blockState.nextCBlock = zc->blockState.prevCBlock + 1; - ptr = zc->blockState.nextCBlock + 1; - zc->entropyWorkspace = (U32*)ptr; + assert(ZSTD_cwksp_check_available(ws, 2 * sizeof(ZSTD_compressedBlockState_t))); + zc->blockState.prevCBlock = (ZSTD_compressedBlockState_t*) ZSTD_cwksp_reserve_object(ws, sizeof(ZSTD_compressedBlockState_t)); + RETURN_ERROR_IF(zc->blockState.prevCBlock == NULL, memory_allocation, "couldn't allocate prevCBlock"); + zc->blockState.nextCBlock = (ZSTD_compressedBlockState_t*) ZSTD_cwksp_reserve_object(ws, sizeof(ZSTD_compressedBlockState_t)); + RETURN_ERROR_IF(zc->blockState.nextCBlock == NULL, memory_allocation, "couldn't allocate nextCBlock"); + zc->entropyWorkspace = (U32*) ZSTD_cwksp_reserve_object(ws, HUF_WORKSPACE_SIZE); + RETURN_ERROR_IF(zc->blockState.nextCBlock == NULL, memory_allocation, "couldn't allocate entropyWorkspace"); } } + ZSTD_cwksp_clear(ws); + /* init params */ zc->appliedParams = params; zc->blockState.matchState.cParams = params.cParams; @@ -1529,58 +1494,58 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, ZSTD_reset_compressedBlockState(zc->blockState.prevCBlock); - ptr = ZSTD_reset_matchState(&zc->blockState.matchState, - zc->entropyWorkspace + HUF_WORKSPACE_SIZE_U32, - ¶ms.cParams, - crp, ZSTD_resetTarget_CCtx); - - /* ldm hash table */ - /* initialize bucketOffsets table later for pointer alignment */ - if (params.ldmParams.enableLdm) { - size_t const ldmHSize = ((size_t)1) << params.ldmParams.hashLog; - memset(ptr, 0, ldmHSize * sizeof(ldmEntry_t)); - assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */ - zc->ldmState.hashTable = (ldmEntry_t*)ptr; - ptr = zc->ldmState.hashTable + ldmHSize; - zc->ldmSequences = (rawSeq*)ptr; - ptr = zc->ldmSequences + maxNbLdmSeq; - zc->maxNbLdmSequences = maxNbLdmSeq; - - memset(&zc->ldmState.window, 0, sizeof(zc->ldmState.window)); - } - assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */ - - /* sequences storage */ - zc->seqStore.maxNbSeq = maxNbSeq; - zc->seqStore.sequencesStart = (seqDef*)ptr; - ptr = zc->seqStore.sequencesStart + maxNbSeq; - zc->seqStore.llCode = (BYTE*) ptr; - zc->seqStore.mlCode = zc->seqStore.llCode + maxNbSeq; - zc->seqStore.ofCode = zc->seqStore.mlCode + maxNbSeq; - zc->seqStore.litStart = zc->seqStore.ofCode + maxNbSeq; /* ZSTD_wildcopy() is used to copy into the literals buffer, * so we have to oversize the buffer by WILDCOPY_OVERLENGTH bytes. */ + zc->seqStore.litStart = ZSTD_cwksp_reserve_buffer(ws, blockSize + WILDCOPY_OVERLENGTH); zc->seqStore.maxNbLit = blockSize; - ptr = zc->seqStore.litStart + blockSize + WILDCOPY_OVERLENGTH; + + /* buffers */ + zc->inBuffSize = buffInSize; + zc->inBuff = (char*)ZSTD_cwksp_reserve_buffer(ws, buffInSize); + zc->outBuffSize = buffOutSize; + zc->outBuff = (char*)ZSTD_cwksp_reserve_buffer(ws, buffOutSize); /* ldm bucketOffsets table */ if (params.ldmParams.enableLdm) { + /* TODO: avoid memset? */ size_t const ldmBucketSize = ((size_t)1) << (params.ldmParams.hashLog - params.ldmParams.bucketSizeLog); - memset(ptr, 0, ldmBucketSize); - zc->ldmState.bucketOffsets = (BYTE*)ptr; - ptr = zc->ldmState.bucketOffsets + ldmBucketSize; - ZSTD_window_clear(&zc->ldmState.window); + zc->ldmState.bucketOffsets = ZSTD_cwksp_reserve_buffer(ws, ldmBucketSize); + memset(zc->ldmState.bucketOffsets, 0, ldmBucketSize); } + + /* sequences storage */ ZSTD_referenceExternalSequences(zc, NULL, 0); + zc->seqStore.maxNbSeq = maxNbSeq; + zc->seqStore.llCode = ZSTD_cwksp_reserve_buffer(ws, maxNbSeq * sizeof(BYTE)); + zc->seqStore.mlCode = ZSTD_cwksp_reserve_buffer(ws, maxNbSeq * sizeof(BYTE)); + zc->seqStore.ofCode = ZSTD_cwksp_reserve_buffer(ws, maxNbSeq * sizeof(BYTE)); + zc->seqStore.sequencesStart = (seqDef*)ZSTD_cwksp_reserve_aligned(ws, maxNbSeq * sizeof(seqDef)); + + FORWARD_IF_ERROR(ZSTD_reset_matchState( + &zc->blockState.matchState, + ws, + ¶ms.cParams, + crp, + needsIndexReset, + ZSTD_resetTarget_CCtx)); - /* buffers */ - zc->inBuffSize = buffInSize; - zc->inBuff = (char*)ptr; - zc->outBuffSize = buffOutSize; - zc->outBuff = zc->inBuff + buffInSize; + /* ldm hash table */ + if (params.ldmParams.enableLdm) { + /* TODO: avoid memset? */ + size_t const ldmHSize = ((size_t)1) << params.ldmParams.hashLog; + zc->ldmState.hashTable = (ldmEntry_t*)ZSTD_cwksp_reserve_aligned(ws, ldmHSize * sizeof(ldmEntry_t)); + memset(zc->ldmState.hashTable, 0, ldmHSize * sizeof(ldmEntry_t)); + zc->ldmSequences = (rawSeq*)ZSTD_cwksp_reserve_aligned(ws, maxNbLdmSeq * sizeof(rawSeq)); + zc->maxNbLdmSequences = maxNbLdmSeq; + + memset(&zc->ldmState.window, 0, sizeof(zc->ldmState.window)); + ZSTD_window_clear(&zc->ldmState.window); + } + + DEBUGLOG(3, "wksp: finished allocating, %zd bytes remain available", ZSTD_cwksp_available_space(ws)); return 0; } @@ -1614,15 +1579,15 @@ static const size_t attachDictSizeCutoffs[ZSTD_STRATEGY_MAX+1] = { }; static int ZSTD_shouldAttachDict(const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, + const ZSTD_CCtx_params* params, U64 pledgedSrcSize) { size_t cutoff = attachDictSizeCutoffs[cdict->matchState.cParams.strategy]; return ( pledgedSrcSize <= cutoff || pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN - || params.attachDictPref == ZSTD_dictForceAttach ) - && params.attachDictPref != ZSTD_dictForceCopy - && !params.forceWindow; /* dictMatchState isn't correctly + || params->attachDictPref == ZSTD_dictForceAttach ) + && params->attachDictPref != ZSTD_dictForceCopy + && !params->forceWindow; /* dictMatchState isn't correctly * handled in _enforceMaxDist */ } @@ -1640,8 +1605,8 @@ ZSTD_resetCCtx_byAttachingCDict(ZSTD_CCtx* cctx, * has its own tables. */ params.cParams = ZSTD_adjustCParams_internal(*cdict_cParams, pledgedSrcSize, 0); params.cParams.windowLog = windowLog; - ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize, - ZSTDcrp_continue, zbuff); + FORWARD_IF_ERROR(ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize, + ZSTDcrp_makeClean, zbuff)); assert(cctx->appliedParams.cParams.strategy == cdict_cParams->strategy); } @@ -1689,30 +1654,36 @@ static size_t ZSTD_resetCCtx_byCopyingCDict(ZSTD_CCtx* cctx, /* Copy only compression parameters related to tables. */ params.cParams = *cdict_cParams; params.cParams.windowLog = windowLog; - ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize, - ZSTDcrp_noMemset, zbuff); + FORWARD_IF_ERROR(ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize, + ZSTDcrp_leaveDirty, zbuff)); assert(cctx->appliedParams.cParams.strategy == cdict_cParams->strategy); assert(cctx->appliedParams.cParams.hashLog == cdict_cParams->hashLog); assert(cctx->appliedParams.cParams.chainLog == cdict_cParams->chainLog); } + ZSTD_cwksp_mark_tables_dirty(&cctx->workspace); + /* copy tables */ { size_t const chainSize = (cdict_cParams->strategy == ZSTD_fast) ? 0 : ((size_t)1 << cdict_cParams->chainLog); size_t const hSize = (size_t)1 << cdict_cParams->hashLog; - size_t const tableSpace = (chainSize + hSize) * sizeof(U32); - assert((U32*)cctx->blockState.matchState.chainTable == (U32*)cctx->blockState.matchState.hashTable + hSize); /* chainTable must follow hashTable */ - assert((U32*)cctx->blockState.matchState.hashTable3 == (U32*)cctx->blockState.matchState.chainTable + chainSize); - assert((U32*)cdict->matchState.chainTable == (U32*)cdict->matchState.hashTable + hSize); /* chainTable must follow hashTable */ - assert((U32*)cdict->matchState.hashTable3 == (U32*)cdict->matchState.chainTable + chainSize); - memcpy(cctx->blockState.matchState.hashTable, cdict->matchState.hashTable, tableSpace); /* presumes all tables follow each other */ + + memcpy(cctx->blockState.matchState.hashTable, + cdict->matchState.hashTable, + hSize * sizeof(U32)); + memcpy(cctx->blockState.matchState.chainTable, + cdict->matchState.chainTable, + chainSize * sizeof(U32)); } /* Zero the hashTable3, since the cdict never fills it */ - { size_t const h3Size = (size_t)1 << cctx->blockState.matchState.hashLog3; + { int const h3log = cctx->blockState.matchState.hashLog3; + size_t const h3Size = h3log ? ((size_t)1 << h3log) : 0; assert(cdict->matchState.hashLog3 == 0); memset(cctx->blockState.matchState.hashTable3, 0, h3Size * sizeof(U32)); } + ZSTD_cwksp_mark_tables_clean(&cctx->workspace); + /* copy dictionary offsets */ { ZSTD_matchState_t const* srcMatchState = &cdict->matchState; ZSTD_matchState_t* dstMatchState = &cctx->blockState.matchState; @@ -1734,7 +1705,7 @@ static size_t ZSTD_resetCCtx_byCopyingCDict(ZSTD_CCtx* cctx, * in-place. We decide here which strategy to use. */ static size_t ZSTD_resetCCtx_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, + const ZSTD_CCtx_params* params, U64 pledgedSrcSize, ZSTD_buffered_policy_e zbuff) { @@ -1744,10 +1715,10 @@ static size_t ZSTD_resetCCtx_usingCDict(ZSTD_CCtx* cctx, if (ZSTD_shouldAttachDict(cdict, params, pledgedSrcSize)) { return ZSTD_resetCCtx_byAttachingCDict( - cctx, cdict, params, pledgedSrcSize, zbuff); + cctx, cdict, *params, pledgedSrcSize, zbuff); } else { return ZSTD_resetCCtx_byCopyingCDict( - cctx, cdict, params, pledgedSrcSize, zbuff); + cctx, cdict, *params, pledgedSrcSize, zbuff); } } @@ -1773,7 +1744,7 @@ static size_t ZSTD_copyCCtx_internal(ZSTD_CCtx* dstCCtx, params.cParams = srcCCtx->appliedParams.cParams; params.fParams = fParams; ZSTD_resetCCtx_internal(dstCCtx, params, pledgedSrcSize, - ZSTDcrp_noMemset, zbuff); + ZSTDcrp_leaveDirty, zbuff); assert(dstCCtx->appliedParams.cParams.windowLog == srcCCtx->appliedParams.cParams.windowLog); assert(dstCCtx->appliedParams.cParams.strategy == srcCCtx->appliedParams.cParams.strategy); assert(dstCCtx->appliedParams.cParams.hashLog == srcCCtx->appliedParams.cParams.hashLog); @@ -1781,16 +1752,27 @@ static size_t ZSTD_copyCCtx_internal(ZSTD_CCtx* dstCCtx, assert(dstCCtx->blockState.matchState.hashLog3 == srcCCtx->blockState.matchState.hashLog3); } + ZSTD_cwksp_mark_tables_dirty(&dstCCtx->workspace); + /* copy tables */ { size_t const chainSize = (srcCCtx->appliedParams.cParams.strategy == ZSTD_fast) ? 0 : ((size_t)1 << srcCCtx->appliedParams.cParams.chainLog); size_t const hSize = (size_t)1 << srcCCtx->appliedParams.cParams.hashLog; - size_t const h3Size = (size_t)1 << srcCCtx->blockState.matchState.hashLog3; - size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); - assert((U32*)dstCCtx->blockState.matchState.chainTable == (U32*)dstCCtx->blockState.matchState.hashTable + hSize); /* chainTable must follow hashTable */ - assert((U32*)dstCCtx->blockState.matchState.hashTable3 == (U32*)dstCCtx->blockState.matchState.chainTable + chainSize); - memcpy(dstCCtx->blockState.matchState.hashTable, srcCCtx->blockState.matchState.hashTable, tableSpace); /* presumes all tables follow each other */ + int const h3log = srcCCtx->blockState.matchState.hashLog3; + size_t const h3Size = h3log ? ((size_t)1 << h3log) : 0; + + memcpy(dstCCtx->blockState.matchState.hashTable, + srcCCtx->blockState.matchState.hashTable, + hSize * sizeof(U32)); + memcpy(dstCCtx->blockState.matchState.chainTable, + srcCCtx->blockState.matchState.chainTable, + chainSize * sizeof(U32)); + memcpy(dstCCtx->blockState.matchState.hashTable3, + srcCCtx->blockState.matchState.hashTable3, + h3Size * sizeof(U32)); } + ZSTD_cwksp_mark_tables_clean(&dstCCtx->workspace); + /* copy dictionary offsets */ { const ZSTD_matchState_t* srcMatchState = &srcCCtx->blockState.matchState; @@ -1841,6 +1823,20 @@ ZSTD_reduceTable_internal (U32* const table, U32 const size, U32 const reducerVa int rowNb; assert((size & (ZSTD_ROWSIZE-1)) == 0); /* multiple of ZSTD_ROWSIZE */ assert(size < (1U<<31)); /* can be casted to int */ + +#if defined (MEMORY_SANITIZER) && !defined (ZSTD_MSAN_DONT_POISON_WORKSPACE) + /* To validate that the table re-use logic is sound, and that we don't + * access table space that we haven't cleaned, we re-"poison" the table + * space every time we mark it dirty. + * + * This function however is intended to operate on those dirty tables and + * re-clean them. So when this function is used correctly, we can unpoison + * the memory it operated on. This introduces a blind spot though, since + * if we now try to operate on __actually__ poisoned memory, we will not + * detect that. */ + __msan_unpoison(table, size * sizeof(U32)); +#endif + for (rowNb=0 ; rowNb < nbRows ; rowNb++) { int column; for (column=0; column<ZSTD_ROWSIZE; column++) { @@ -1903,155 +1899,6 @@ static size_t ZSTD_noCompressBlock (void* dst, size_t dstCapacity, const void* s return ZSTD_blockHeaderSize + srcSize; } -static size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void* src, size_t srcSize) -{ - BYTE* const ostart = (BYTE* const)dst; - U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); - - RETURN_ERROR_IF(srcSize + flSize > dstCapacity, dstSize_tooSmall); - - switch(flSize) - { - case 1: /* 2 - 1 - 5 */ - ostart[0] = (BYTE)((U32)set_basic + (srcSize<<3)); - break; - case 2: /* 2 - 2 - 12 */ - MEM_writeLE16(ostart, (U16)((U32)set_basic + (1<<2) + (srcSize<<4))); - break; - case 3: /* 2 - 2 - 20 */ - MEM_writeLE32(ostart, (U32)((U32)set_basic + (3<<2) + (srcSize<<4))); - break; - default: /* not necessary : flSize is {1,2,3} */ - assert(0); - } - - memcpy(ostart + flSize, src, srcSize); - return srcSize + flSize; -} - -static size_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize) -{ - BYTE* const ostart = (BYTE* const)dst; - U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); - - (void)dstCapacity; /* dstCapacity already guaranteed to be >=4, hence large enough */ - - switch(flSize) - { - case 1: /* 2 - 1 - 5 */ - ostart[0] = (BYTE)((U32)set_rle + (srcSize<<3)); - break; - case 2: /* 2 - 2 - 12 */ - MEM_writeLE16(ostart, (U16)((U32)set_rle + (1<<2) + (srcSize<<4))); - break; - case 3: /* 2 - 2 - 20 */ - MEM_writeLE32(ostart, (U32)((U32)set_rle + (3<<2) + (srcSize<<4))); - break; - default: /* not necessary : flSize is {1,2,3} */ - assert(0); - } - - ostart[flSize] = *(const BYTE*)src; - return flSize+1; -} - - -/* ZSTD_minGain() : - * minimum compression required - * to generate a compress block or a compressed literals section. - * note : use same formula for both situations */ -static size_t ZSTD_minGain(size_t srcSize, ZSTD_strategy strat) -{ - U32 const minlog = (strat>=ZSTD_btultra) ? (U32)(strat) - 1 : 6; - ZSTD_STATIC_ASSERT(ZSTD_btultra == 8); - assert(ZSTD_cParam_withinBounds(ZSTD_c_strategy, strat)); - return (srcSize >> minlog) + 2; -} - -static size_t ZSTD_compressLiterals (ZSTD_hufCTables_t const* prevHuf, - ZSTD_hufCTables_t* nextHuf, - ZSTD_strategy strategy, int disableLiteralCompression, - void* dst, size_t dstCapacity, - const void* src, size_t srcSize, - void* workspace, size_t wkspSize, - const int bmi2) -{ - size_t const minGain = ZSTD_minGain(srcSize, strategy); - size_t const lhSize = 3 + (srcSize >= 1 KB) + (srcSize >= 16 KB); - BYTE* const ostart = (BYTE*)dst; - U32 singleStream = srcSize < 256; - symbolEncodingType_e hType = set_compressed; - size_t cLitSize; - - DEBUGLOG(5,"ZSTD_compressLiterals (disableLiteralCompression=%i)", - disableLiteralCompression); - - /* Prepare nextEntropy assuming reusing the existing table */ - memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); - - if (disableLiteralCompression) - return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); - - /* small ? don't even attempt compression (speed opt) */ -# define COMPRESS_LITERALS_SIZE_MIN 63 - { size_t const minLitSize = (prevHuf->repeatMode == HUF_repeat_valid) ? 6 : COMPRESS_LITERALS_SIZE_MIN; - if (srcSize <= minLitSize) return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); - } - - RETURN_ERROR_IF(dstCapacity < lhSize+1, dstSize_tooSmall, "not enough space for compression"); - { HUF_repeat repeat = prevHuf->repeatMode; - int const preferRepeat = strategy < ZSTD_lazy ? srcSize <= 1024 : 0; - if (repeat == HUF_repeat_valid && lhSize == 3) singleStream = 1; - cLitSize = singleStream ? HUF_compress1X_repeat(ostart+lhSize, dstCapacity-lhSize, src, srcSize, 255, 11, - workspace, wkspSize, (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2) - : HUF_compress4X_repeat(ostart+lhSize, dstCapacity-lhSize, src, srcSize, 255, 11, - workspace, wkspSize, (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2); - if (repeat != HUF_repeat_none) { - /* reused the existing table */ - hType = set_repeat; - } - } - - if ((cLitSize==0) | (cLitSize >= srcSize - minGain) | ERR_isError(cLitSize)) { - memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); - return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); - } - if (cLitSize==1) { - memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); - return ZSTD_compressRleLiteralsBlock(dst, dstCapacity, src, srcSize); - } - - if (hType == set_compressed) { - /* using a newly constructed table */ - nextHuf->repeatMode = HUF_repeat_check; - } - - /* Build header */ - switch(lhSize) - { - case 3: /* 2 - 2 - 10 - 10 */ - { U32 const lhc = hType + ((!singleStream) << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<14); - MEM_writeLE24(ostart, lhc); - break; - } - case 4: /* 2 - 2 - 14 - 14 */ - { U32 const lhc = hType + (2 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<18); - MEM_writeLE32(ostart, lhc); - break; - } - case 5: /* 2 - 2 - 18 - 18 */ - { U32 const lhc = hType + (3 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<22); - MEM_writeLE32(ostart, lhc); - ostart[4] = (BYTE)(cLitSize >> 10); - break; - } - default: /* not possible : lhSize is {3,4,5} */ - assert(0); - } - return lhSize+cLitSize; -} - - void ZSTD_seqToCodes(const seqStore_t* seqStorePtr) { const seqDef* const sequences = seqStorePtr->sequencesStart; @@ -2074,418 +1921,6 @@ void ZSTD_seqToCodes(const seqStore_t* seqStorePtr) mlCodeTable[seqStorePtr->longLengthPos] = MaxML; } - -/** - * -log2(x / 256) lookup table for x in [0, 256). - * If x == 0: Return 0 - * Else: Return floor(-log2(x / 256) * 256) - */ -static unsigned const kInverseProbabilityLog256[256] = { - 0, 2048, 1792, 1642, 1536, 1453, 1386, 1329, 1280, 1236, 1197, 1162, - 1130, 1100, 1073, 1047, 1024, 1001, 980, 960, 941, 923, 906, 889, - 874, 859, 844, 830, 817, 804, 791, 779, 768, 756, 745, 734, - 724, 714, 704, 694, 685, 676, 667, 658, 650, 642, 633, 626, - 618, 610, 603, 595, 588, 581, 574, 567, 561, 554, 548, 542, - 535, 529, 523, 517, 512, 506, 500, 495, 489, 484, 478, 473, - 468, 463, 458, 453, 448, 443, 438, 434, 429, 424, 420, 415, - 411, 407, 402, 398, 394, 390, 386, 382, 377, 373, 370, 366, - 362, 358, 354, 350, 347, 343, 339, 336, 332, 329, 325, 322, - 318, 315, 311, 308, 305, 302, 298, 295, 292, 289, 286, 282, - 279, 276, 273, 270, 267, 264, 261, 258, 256, 253, 250, 247, - 244, 241, 239, 236, 233, 230, 228, 225, 222, 220, 217, 215, - 212, 209, 207, 204, 202, 199, 197, 194, 192, 190, 187, 185, - 182, 180, 178, 175, 173, 171, 168, 166, 164, 162, 159, 157, - 155, 153, 151, 149, 146, 144, 142, 140, 138, 136, 134, 132, - 130, 128, 126, 123, 121, 119, 117, 115, 114, 112, 110, 108, - 106, 104, 102, 100, 98, 96, 94, 93, 91, 89, 87, 85, - 83, 82, 80, 78, 76, 74, 73, 71, 69, 67, 66, 64, - 62, 61, 59, 57, 55, 54, 52, 50, 49, 47, 46, 44, - 42, 41, 39, 37, 36, 34, 33, 31, 30, 28, 26, 25, - 23, 22, 20, 19, 17, 16, 14, 13, 11, 10, 8, 7, - 5, 4, 2, 1, -}; - - -/** - * Returns the cost in bits of encoding the distribution described by count - * using the entropy bound. - */ -static size_t ZSTD_entropyCost(unsigned const* count, unsigned const max, size_t const total) -{ - unsigned cost = 0; - unsigned s; - for (s = 0; s <= max; ++s) { - unsigned norm = (unsigned)((256 * count[s]) / total); - if (count[s] != 0 && norm == 0) - norm = 1; - assert(count[s] < total); - cost += count[s] * kInverseProbabilityLog256[norm]; - } - return cost >> 8; -} - - -/** - * Returns the cost in bits of encoding the distribution in count using the - * table described by norm. The max symbol support by norm is assumed >= max. - * norm must be valid for every symbol with non-zero probability in count. - */ -static size_t ZSTD_crossEntropyCost(short const* norm, unsigned accuracyLog, - unsigned const* count, unsigned const max) -{ - unsigned const shift = 8 - accuracyLog; - size_t cost = 0; - unsigned s; - assert(accuracyLog <= 8); - for (s = 0; s <= max; ++s) { - unsigned const normAcc = norm[s] != -1 ? norm[s] : 1; - unsigned const norm256 = normAcc << shift; - assert(norm256 > 0); - assert(norm256 < 256); - cost += count[s] * kInverseProbabilityLog256[norm256]; - } - return cost >> 8; -} - - -static unsigned ZSTD_getFSEMaxSymbolValue(FSE_CTable const* ctable) { - void const* ptr = ctable; - U16 const* u16ptr = (U16 const*)ptr; - U32 const maxSymbolValue = MEM_read16(u16ptr + 1); - return maxSymbolValue; -} - - -/** - * Returns the cost in bits of encoding the distribution in count using ctable. - * Returns an error if ctable cannot represent all the symbols in count. - */ -static size_t ZSTD_fseBitCost( - FSE_CTable const* ctable, - unsigned const* count, - unsigned const max) -{ - unsigned const kAccuracyLog = 8; - size_t cost = 0; - unsigned s; - FSE_CState_t cstate; - FSE_initCState(&cstate, ctable); - RETURN_ERROR_IF(ZSTD_getFSEMaxSymbolValue(ctable) < max, GENERIC, - "Repeat FSE_CTable has maxSymbolValue %u < %u", - ZSTD_getFSEMaxSymbolValue(ctable), max); - for (s = 0; s <= max; ++s) { - unsigned const tableLog = cstate.stateLog; - unsigned const badCost = (tableLog + 1) << kAccuracyLog; - unsigned const bitCost = FSE_bitCost(cstate.symbolTT, tableLog, s, kAccuracyLog); - if (count[s] == 0) - continue; - RETURN_ERROR_IF(bitCost >= badCost, GENERIC, - "Repeat FSE_CTable has Prob[%u] == 0", s); - cost += count[s] * bitCost; - } - return cost >> kAccuracyLog; -} - -/** - * Returns the cost in bytes of encoding the normalized count header. - * Returns an error if any of the helper functions return an error. - */ -static size_t ZSTD_NCountCost(unsigned const* count, unsigned const max, - size_t const nbSeq, unsigned const FSELog) -{ - BYTE wksp[FSE_NCOUNTBOUND]; - S16 norm[MaxSeq + 1]; - const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); - FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq, max)); - return FSE_writeNCount(wksp, sizeof(wksp), norm, max, tableLog); -} - - -typedef enum { - ZSTD_defaultDisallowed = 0, - ZSTD_defaultAllowed = 1 -} ZSTD_defaultPolicy_e; - -MEM_STATIC symbolEncodingType_e -ZSTD_selectEncodingType( - FSE_repeat* repeatMode, unsigned const* count, unsigned const max, - size_t const mostFrequent, size_t nbSeq, unsigned const FSELog, - FSE_CTable const* prevCTable, - short const* defaultNorm, U32 defaultNormLog, - ZSTD_defaultPolicy_e const isDefaultAllowed, - ZSTD_strategy const strategy) -{ - ZSTD_STATIC_ASSERT(ZSTD_defaultDisallowed == 0 && ZSTD_defaultAllowed != 0); - if (mostFrequent == nbSeq) { - *repeatMode = FSE_repeat_none; - if (isDefaultAllowed && nbSeq <= 2) { - /* Prefer set_basic over set_rle when there are 2 or less symbols, - * since RLE uses 1 byte, but set_basic uses 5-6 bits per symbol. - * If basic encoding isn't possible, always choose RLE. - */ - DEBUGLOG(5, "Selected set_basic"); - return set_basic; - } - DEBUGLOG(5, "Selected set_rle"); - return set_rle; - } - if (strategy < ZSTD_lazy) { - if (isDefaultAllowed) { - size_t const staticFse_nbSeq_max = 1000; - size_t const mult = 10 - strategy; - size_t const baseLog = 3; - size_t const dynamicFse_nbSeq_min = (((size_t)1 << defaultNormLog) * mult) >> baseLog; /* 28-36 for offset, 56-72 for lengths */ - assert(defaultNormLog >= 5 && defaultNormLog <= 6); /* xx_DEFAULTNORMLOG */ - assert(mult <= 9 && mult >= 7); - if ( (*repeatMode == FSE_repeat_valid) - && (nbSeq < staticFse_nbSeq_max) ) { - DEBUGLOG(5, "Selected set_repeat"); - return set_repeat; - } - if ( (nbSeq < dynamicFse_nbSeq_min) - || (mostFrequent < (nbSeq >> (defaultNormLog-1))) ) { - DEBUGLOG(5, "Selected set_basic"); - /* The format allows default tables to be repeated, but it isn't useful. - * When using simple heuristics to select encoding type, we don't want - * to confuse these tables with dictionaries. When running more careful - * analysis, we don't need to waste time checking both repeating tables - * and default tables. - */ - *repeatMode = FSE_repeat_none; - return set_basic; - } - } - } else { - size_t const basicCost = isDefaultAllowed ? ZSTD_crossEntropyCost(defaultNorm, defaultNormLog, count, max) : ERROR(GENERIC); - size_t const repeatCost = *repeatMode != FSE_repeat_none ? ZSTD_fseBitCost(prevCTable, count, max) : ERROR(GENERIC); - size_t const NCountCost = ZSTD_NCountCost(count, max, nbSeq, FSELog); - size_t const compressedCost = (NCountCost << 3) + ZSTD_entropyCost(count, max, nbSeq); - - if (isDefaultAllowed) { - assert(!ZSTD_isError(basicCost)); - assert(!(*repeatMode == FSE_repeat_valid && ZSTD_isError(repeatCost))); - } - assert(!ZSTD_isError(NCountCost)); - assert(compressedCost < ERROR(maxCode)); - DEBUGLOG(5, "Estimated bit costs: basic=%u\trepeat=%u\tcompressed=%u", - (unsigned)basicCost, (unsigned)repeatCost, (unsigned)compressedCost); - if (basicCost <= repeatCost && basicCost <= compressedCost) { - DEBUGLOG(5, "Selected set_basic"); - assert(isDefaultAllowed); - *repeatMode = FSE_repeat_none; - return set_basic; - } - if (repeatCost <= compressedCost) { - DEBUGLOG(5, "Selected set_repeat"); - assert(!ZSTD_isError(repeatCost)); - return set_repeat; - } - assert(compressedCost < basicCost && compressedCost < repeatCost); - } - DEBUGLOG(5, "Selected set_compressed"); - *repeatMode = FSE_repeat_check; - return set_compressed; -} - -MEM_STATIC size_t -ZSTD_buildCTable(void* dst, size_t dstCapacity, - FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type, - unsigned* count, U32 max, - const BYTE* codeTable, size_t nbSeq, - const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax, - const FSE_CTable* prevCTable, size_t prevCTableSize, - void* workspace, size_t workspaceSize) -{ - BYTE* op = (BYTE*)dst; - const BYTE* const oend = op + dstCapacity; - DEBUGLOG(6, "ZSTD_buildCTable (dstCapacity=%u)", (unsigned)dstCapacity); - - switch (type) { - case set_rle: - FORWARD_IF_ERROR(FSE_buildCTable_rle(nextCTable, (BYTE)max)); - RETURN_ERROR_IF(dstCapacity==0, dstSize_tooSmall); - *op = codeTable[0]; - return 1; - case set_repeat: - memcpy(nextCTable, prevCTable, prevCTableSize); - return 0; - case set_basic: - FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, defaultNorm, defaultMax, defaultNormLog, workspace, workspaceSize)); /* note : could be pre-calculated */ - return 0; - case set_compressed: { - S16 norm[MaxSeq + 1]; - size_t nbSeq_1 = nbSeq; - const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); - if (count[codeTable[nbSeq-1]] > 1) { - count[codeTable[nbSeq-1]]--; - nbSeq_1--; - } - assert(nbSeq_1 > 1); - FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max)); - { size_t const NCountSize = FSE_writeNCount(op, oend - op, norm, max, tableLog); /* overflow protected */ - FORWARD_IF_ERROR(NCountSize); - FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, norm, max, tableLog, workspace, workspaceSize)); - return NCountSize; - } - } - default: assert(0); RETURN_ERROR(GENERIC); - } -} - -FORCE_INLINE_TEMPLATE size_t -ZSTD_encodeSequences_body( - void* dst, size_t dstCapacity, - FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, - FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, - FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, - seqDef const* sequences, size_t nbSeq, int longOffsets) -{ - BIT_CStream_t blockStream; - FSE_CState_t stateMatchLength; - FSE_CState_t stateOffsetBits; - FSE_CState_t stateLitLength; - - RETURN_ERROR_IF( - ERR_isError(BIT_initCStream(&blockStream, dst, dstCapacity)), - dstSize_tooSmall, "not enough space remaining"); - DEBUGLOG(6, "available space for bitstream : %i (dstCapacity=%u)", - (int)(blockStream.endPtr - blockStream.startPtr), - (unsigned)dstCapacity); - - /* first symbols */ - FSE_initCState2(&stateMatchLength, CTable_MatchLength, mlCodeTable[nbSeq-1]); - FSE_initCState2(&stateOffsetBits, CTable_OffsetBits, ofCodeTable[nbSeq-1]); - FSE_initCState2(&stateLitLength, CTable_LitLength, llCodeTable[nbSeq-1]); - BIT_addBits(&blockStream, sequences[nbSeq-1].litLength, LL_bits[llCodeTable[nbSeq-1]]); - if (MEM_32bits()) BIT_flushBits(&blockStream); - BIT_addBits(&blockStream, sequences[nbSeq-1].matchLength, ML_bits[mlCodeTable[nbSeq-1]]); - if (MEM_32bits()) BIT_flushBits(&blockStream); - if (longOffsets) { - U32 const ofBits = ofCodeTable[nbSeq-1]; - int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); - if (extraBits) { - BIT_addBits(&blockStream, sequences[nbSeq-1].offset, extraBits); - BIT_flushBits(&blockStream); - } - BIT_addBits(&blockStream, sequences[nbSeq-1].offset >> extraBits, - ofBits - extraBits); - } else { - BIT_addBits(&blockStream, sequences[nbSeq-1].offset, ofCodeTable[nbSeq-1]); - } - BIT_flushBits(&blockStream); - - { size_t n; - for (n=nbSeq-2 ; n<nbSeq ; n--) { /* intentional underflow */ - BYTE const llCode = llCodeTable[n]; - BYTE const ofCode = ofCodeTable[n]; - BYTE const mlCode = mlCodeTable[n]; - U32 const llBits = LL_bits[llCode]; - U32 const ofBits = ofCode; - U32 const mlBits = ML_bits[mlCode]; - DEBUGLOG(6, "encoding: litlen:%2u - matchlen:%2u - offCode:%7u", - (unsigned)sequences[n].litLength, - (unsigned)sequences[n].matchLength + MINMATCH, - (unsigned)sequences[n].offset); - /* 32b*/ /* 64b*/ - /* (7)*/ /* (7)*/ - FSE_encodeSymbol(&blockStream, &stateOffsetBits, ofCode); /* 15 */ /* 15 */ - FSE_encodeSymbol(&blockStream, &stateMatchLength, mlCode); /* 24 */ /* 24 */ - if (MEM_32bits()) BIT_flushBits(&blockStream); /* (7)*/ - FSE_encodeSymbol(&blockStream, &stateLitLength, llCode); /* 16 */ /* 33 */ - if (MEM_32bits() || (ofBits+mlBits+llBits >= 64-7-(LLFSELog+MLFSELog+OffFSELog))) - BIT_flushBits(&blockStream); /* (7)*/ - BIT_addBits(&blockStream, sequences[n].litLength, llBits); - if (MEM_32bits() && ((llBits+mlBits)>24)) BIT_flushBits(&blockStream); - BIT_addBits(&blockStream, sequences[n].matchLength, mlBits); - if (MEM_32bits() || (ofBits+mlBits+llBits > 56)) BIT_flushBits(&blockStream); - if (longOffsets) { - int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); - if (extraBits) { - BIT_addBits(&blockStream, sequences[n].offset, extraBits); - BIT_flushBits(&blockStream); /* (7)*/ - } - BIT_addBits(&blockStream, sequences[n].offset >> extraBits, - ofBits - extraBits); /* 31 */ - } else { - BIT_addBits(&blockStream, sequences[n].offset, ofBits); /* 31 */ - } - BIT_flushBits(&blockStream); /* (7)*/ - DEBUGLOG(7, "remaining space : %i", (int)(blockStream.endPtr - blockStream.ptr)); - } } - - DEBUGLOG(6, "ZSTD_encodeSequences: flushing ML state with %u bits", stateMatchLength.stateLog); - FSE_flushCState(&blockStream, &stateMatchLength); - DEBUGLOG(6, "ZSTD_encodeSequences: flushing Off state with %u bits", stateOffsetBits.stateLog); - FSE_flushCState(&blockStream, &stateOffsetBits); - DEBUGLOG(6, "ZSTD_encodeSequences: flushing LL state with %u bits", stateLitLength.stateLog); - FSE_flushCState(&blockStream, &stateLitLength); - - { size_t const streamSize = BIT_closeCStream(&blockStream); - RETURN_ERROR_IF(streamSize==0, dstSize_tooSmall, "not enough space"); - return streamSize; - } -} - -static size_t -ZSTD_encodeSequences_default( - void* dst, size_t dstCapacity, - FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, - FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, - FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, - seqDef const* sequences, size_t nbSeq, int longOffsets) -{ - return ZSTD_encodeSequences_body(dst, dstCapacity, - CTable_MatchLength, mlCodeTable, - CTable_OffsetBits, ofCodeTable, - CTable_LitLength, llCodeTable, - sequences, nbSeq, longOffsets); -} - - -#if DYNAMIC_BMI2 - -static TARGET_ATTRIBUTE("bmi2") size_t -ZSTD_encodeSequences_bmi2( - void* dst, size_t dstCapacity, - FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, - FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, - FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, - seqDef const* sequences, size_t nbSeq, int longOffsets) -{ - return ZSTD_encodeSequences_body(dst, dstCapacity, - CTable_MatchLength, mlCodeTable, - CTable_OffsetBits, ofCodeTable, - CTable_LitLength, llCodeTable, - sequences, nbSeq, longOffsets); -} - -#endif - -static size_t ZSTD_encodeSequences( - void* dst, size_t dstCapacity, - FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, - FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, - FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, - seqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2) -{ - DEBUGLOG(5, "ZSTD_encodeSequences: dstCapacity = %u", (unsigned)dstCapacity); -#if DYNAMIC_BMI2 - if (bmi2) { - return ZSTD_encodeSequences_bmi2(dst, dstCapacity, - CTable_MatchLength, mlCodeTable, - CTable_OffsetBits, ofCodeTable, - CTable_LitLength, llCodeTable, - sequences, nbSeq, longOffsets); - } -#endif - (void)bmi2; - return ZSTD_encodeSequences_default(dst, dstCapacity, - CTable_MatchLength, mlCodeTable, - CTable_OffsetBits, ofCodeTable, - CTable_LitLength, llCodeTable, - sequences, nbSeq, longOffsets); -} - static int ZSTD_disableLiteralsCompression(const ZSTD_CCtx_params* cctxParams) { switch (cctxParams->literalCompressionMode) { @@ -2509,7 +1944,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, ZSTD_entropyCTables_t* nextEntropy, const ZSTD_CCtx_params* cctxParams, void* dst, size_t dstCapacity, - void* workspace, size_t wkspSize, + void* entropyWorkspace, size_t entropyWkspSize, const int bmi2) { const int longOffsets = cctxParams->cParams.windowLog > STREAM_ACCUMULATOR_MIN; @@ -2526,23 +1961,23 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, BYTE* const ostart = (BYTE*)dst; BYTE* const oend = ostart + dstCapacity; BYTE* op = ostart; - size_t const nbSeq = seqStorePtr->sequences - seqStorePtr->sequencesStart; + size_t const nbSeq = (size_t)(seqStorePtr->sequences - seqStorePtr->sequencesStart); BYTE* seqHead; BYTE* lastNCount = NULL; + DEBUGLOG(5, "ZSTD_compressSequences_internal (nbSeq=%zu)", nbSeq); ZSTD_STATIC_ASSERT(HUF_WORKSPACE_SIZE >= (1<<MAX(MLFSELog,LLFSELog))); - DEBUGLOG(5, "ZSTD_compressSequences_internal"); /* Compress literals */ { const BYTE* const literals = seqStorePtr->litStart; - size_t const litSize = seqStorePtr->lit - literals; + size_t const litSize = (size_t)(seqStorePtr->lit - literals); size_t const cSize = ZSTD_compressLiterals( &prevEntropy->huf, &nextEntropy->huf, cctxParams->cParams.strategy, ZSTD_disableLiteralsCompression(cctxParams), op, dstCapacity, literals, litSize, - workspace, wkspSize, + entropyWorkspace, entropyWkspSize, bmi2); FORWARD_IF_ERROR(cSize); assert(cSize <= dstCapacity); @@ -2552,17 +1987,22 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, /* Sequences Header */ RETURN_ERROR_IF((oend-op) < 3 /*max nbSeq Size*/ + 1 /*seqHead*/, dstSize_tooSmall); - if (nbSeq < 0x7F) + if (nbSeq < 128) { *op++ = (BYTE)nbSeq; - else if (nbSeq < LONGNBSEQ) - op[0] = (BYTE)((nbSeq>>8) + 0x80), op[1] = (BYTE)nbSeq, op+=2; - else - op[0]=0xFF, MEM_writeLE16(op+1, (U16)(nbSeq - LONGNBSEQ)), op+=3; + } else if (nbSeq < LONGNBSEQ) { + op[0] = (BYTE)((nbSeq>>8) + 0x80); + op[1] = (BYTE)nbSeq; + op+=2; + } else { + op[0]=0xFF; + MEM_writeLE16(op+1, (U16)(nbSeq - LONGNBSEQ)); + op+=3; + } assert(op <= oend); if (nbSeq==0) { /* Copy the old tables over as if we repeated them */ memcpy(&nextEntropy->fse, &prevEntropy->fse, sizeof(prevEntropy->fse)); - return op - ostart; + return (size_t)(op - ostart); } /* seqHead : flags for FSE encoding type */ @@ -2573,7 +2013,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, ZSTD_seqToCodes(seqStorePtr); /* build CTable for Literal Lengths */ { unsigned max = MaxLL; - size_t const mostFrequent = HIST_countFast_wksp(count, &max, llCodeTable, nbSeq, workspace, wkspSize); /* can't fail */ + size_t const mostFrequent = HIST_countFast_wksp(count, &max, llCodeTable, nbSeq, entropyWorkspace, entropyWkspSize); /* can't fail */ DEBUGLOG(5, "Building LL table"); nextEntropy->fse.litlength_repeatMode = prevEntropy->fse.litlength_repeatMode; LLtype = ZSTD_selectEncodingType(&nextEntropy->fse.litlength_repeatMode, @@ -2583,10 +2023,14 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, ZSTD_defaultAllowed, strategy); assert(set_basic < set_compressed && set_rle < set_compressed); assert(!(LLtype < set_compressed && nextEntropy->fse.litlength_repeatMode != FSE_repeat_none)); /* We don't copy tables */ - { size_t const countSize = ZSTD_buildCTable(op, oend - op, CTable_LitLength, LLFSELog, (symbolEncodingType_e)LLtype, - count, max, llCodeTable, nbSeq, LL_defaultNorm, LL_defaultNormLog, MaxLL, - prevEntropy->fse.litlengthCTable, sizeof(prevEntropy->fse.litlengthCTable), - workspace, wkspSize); + { size_t const countSize = ZSTD_buildCTable( + op, (size_t)(oend - op), + CTable_LitLength, LLFSELog, (symbolEncodingType_e)LLtype, + count, max, llCodeTable, nbSeq, + LL_defaultNorm, LL_defaultNormLog, MaxLL, + prevEntropy->fse.litlengthCTable, + sizeof(prevEntropy->fse.litlengthCTable), + entropyWorkspace, entropyWkspSize); FORWARD_IF_ERROR(countSize); if (LLtype == set_compressed) lastNCount = op; @@ -2595,7 +2039,8 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, } } /* build CTable for Offsets */ { unsigned max = MaxOff; - size_t const mostFrequent = HIST_countFast_wksp(count, &max, ofCodeTable, nbSeq, workspace, wkspSize); /* can't fail */ + size_t const mostFrequent = HIST_countFast_wksp( + count, &max, ofCodeTable, nbSeq, entropyWorkspace, entropyWkspSize); /* can't fail */ /* We can only use the basic table if max <= DefaultMaxOff, otherwise the offsets are too large */ ZSTD_defaultPolicy_e const defaultPolicy = (max <= DefaultMaxOff) ? ZSTD_defaultAllowed : ZSTD_defaultDisallowed; DEBUGLOG(5, "Building OF table"); @@ -2606,10 +2051,14 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, OF_defaultNorm, OF_defaultNormLog, defaultPolicy, strategy); assert(!(Offtype < set_compressed && nextEntropy->fse.offcode_repeatMode != FSE_repeat_none)); /* We don't copy tables */ - { size_t const countSize = ZSTD_buildCTable(op, oend - op, CTable_OffsetBits, OffFSELog, (symbolEncodingType_e)Offtype, - count, max, ofCodeTable, nbSeq, OF_defaultNorm, OF_defaultNormLog, DefaultMaxOff, - prevEntropy->fse.offcodeCTable, sizeof(prevEntropy->fse.offcodeCTable), - workspace, wkspSize); + { size_t const countSize = ZSTD_buildCTable( + op, (size_t)(oend - op), + CTable_OffsetBits, OffFSELog, (symbolEncodingType_e)Offtype, + count, max, ofCodeTable, nbSeq, + OF_defaultNorm, OF_defaultNormLog, DefaultMaxOff, + prevEntropy->fse.offcodeCTable, + sizeof(prevEntropy->fse.offcodeCTable), + entropyWorkspace, entropyWkspSize); FORWARD_IF_ERROR(countSize); if (Offtype == set_compressed) lastNCount = op; @@ -2618,7 +2067,8 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, } } /* build CTable for MatchLengths */ { unsigned max = MaxML; - size_t const mostFrequent = HIST_countFast_wksp(count, &max, mlCodeTable, nbSeq, workspace, wkspSize); /* can't fail */ + size_t const mostFrequent = HIST_countFast_wksp( + count, &max, mlCodeTable, nbSeq, entropyWorkspace, entropyWkspSize); /* can't fail */ DEBUGLOG(5, "Building ML table (remaining space : %i)", (int)(oend-op)); nextEntropy->fse.matchlength_repeatMode = prevEntropy->fse.matchlength_repeatMode; MLtype = ZSTD_selectEncodingType(&nextEntropy->fse.matchlength_repeatMode, @@ -2627,10 +2077,14 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, ML_defaultNorm, ML_defaultNormLog, ZSTD_defaultAllowed, strategy); assert(!(MLtype < set_compressed && nextEntropy->fse.matchlength_repeatMode != FSE_repeat_none)); /* We don't copy tables */ - { size_t const countSize = ZSTD_buildCTable(op, oend - op, CTable_MatchLength, MLFSELog, (symbolEncodingType_e)MLtype, - count, max, mlCodeTable, nbSeq, ML_defaultNorm, ML_defaultNormLog, MaxML, - prevEntropy->fse.matchlengthCTable, sizeof(prevEntropy->fse.matchlengthCTable), - workspace, wkspSize); + { size_t const countSize = ZSTD_buildCTable( + op, (size_t)(oend - op), + CTable_MatchLength, MLFSELog, (symbolEncodingType_e)MLtype, + count, max, mlCodeTable, nbSeq, + ML_defaultNorm, ML_defaultNormLog, MaxML, + prevEntropy->fse.matchlengthCTable, + sizeof(prevEntropy->fse.matchlengthCTable), + entropyWorkspace, entropyWkspSize); FORWARD_IF_ERROR(countSize); if (MLtype == set_compressed) lastNCount = op; @@ -2641,7 +2095,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, *seqHead = (BYTE)((LLtype<<6) + (Offtype<<4) + (MLtype<<2)); { size_t const bitstreamSize = ZSTD_encodeSequences( - op, oend - op, + op, (size_t)(oend - op), CTable_MatchLength, mlCodeTable, CTable_OffsetBits, ofCodeTable, CTable_LitLength, llCodeTable, @@ -2668,7 +2122,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, } DEBUGLOG(5, "compressed block size : %u", (unsigned)(op - ostart)); - return op - ostart; + return (size_t)(op - ostart); } MEM_STATIC size_t @@ -2678,13 +2132,13 @@ ZSTD_compressSequences(seqStore_t* seqStorePtr, const ZSTD_CCtx_params* cctxParams, void* dst, size_t dstCapacity, size_t srcSize, - void* workspace, size_t wkspSize, + void* entropyWorkspace, size_t entropyWkspSize, int bmi2) { size_t const cSize = ZSTD_compressSequences_internal( seqStorePtr, prevEntropy, nextEntropy, cctxParams, dst, dstCapacity, - workspace, wkspSize, bmi2); + entropyWorkspace, entropyWkspSize, bmi2); if (cSize == 0) return 0; /* When srcSize <= dstCapacity, there is enough space to write a raw uncompressed block. * Since we ran out of space, block must be not compressible, so fall back to raw uncompressed block. @@ -2835,19 +2289,113 @@ static size_t ZSTD_buildSeqStore(ZSTD_CCtx* zc, const void* src, size_t srcSize) return ZSTDbss_compress; } +static void ZSTD_copyBlockSequences(ZSTD_CCtx* zc) +{ + const seqStore_t* seqStore = ZSTD_getSeqStore(zc); + const seqDef* seqs = seqStore->sequencesStart; + size_t seqsSize = seqStore->sequences - seqs; + + ZSTD_Sequence* outSeqs = &zc->seqCollector.seqStart[zc->seqCollector.seqIndex]; + size_t i; size_t position; int repIdx; + + assert(zc->seqCollector.seqIndex + 1 < zc->seqCollector.maxSequences); + for (i = 0, position = 0; i < seqsSize; ++i) { + outSeqs[i].offset = seqs[i].offset; + outSeqs[i].litLength = seqs[i].litLength; + outSeqs[i].matchLength = seqs[i].matchLength + MINMATCH; + + if (i == seqStore->longLengthPos) { + if (seqStore->longLengthID == 1) { + outSeqs[i].litLength += 0x10000; + } else if (seqStore->longLengthID == 2) { + outSeqs[i].matchLength += 0x10000; + } + } + + if (outSeqs[i].offset <= ZSTD_REP_NUM) { + outSeqs[i].rep = outSeqs[i].offset; + repIdx = (unsigned int)i - outSeqs[i].offset; + + if (outSeqs[i].litLength == 0) { + if (outSeqs[i].offset < 3) { + --repIdx; + } else { + repIdx = (unsigned int)i - 1; + } + ++outSeqs[i].rep; + } + assert(repIdx >= -3); + outSeqs[i].offset = repIdx >= 0 ? outSeqs[repIdx].offset : repStartValue[-repIdx - 1]; + if (outSeqs[i].rep == 4) { + --outSeqs[i].offset; + } + } else { + outSeqs[i].offset -= ZSTD_REP_NUM; + } + + position += outSeqs[i].litLength; + outSeqs[i].matchPos = (unsigned int)position; + position += outSeqs[i].matchLength; + } + zc->seqCollector.seqIndex += seqsSize; +} + +size_t ZSTD_getSequences(ZSTD_CCtx* zc, ZSTD_Sequence* outSeqs, + size_t outSeqsSize, const void* src, size_t srcSize) +{ + const size_t dstCapacity = ZSTD_compressBound(srcSize); + void* dst = ZSTD_malloc(dstCapacity, ZSTD_defaultCMem); + SeqCollector seqCollector; + + RETURN_ERROR_IF(dst == NULL, memory_allocation); + + seqCollector.collectSequences = 1; + seqCollector.seqStart = outSeqs; + seqCollector.seqIndex = 0; + seqCollector.maxSequences = outSeqsSize; + zc->seqCollector = seqCollector; + + ZSTD_compress2(zc, dst, dstCapacity, src, srcSize); + ZSTD_free(dst, ZSTD_defaultCMem); + return zc->seqCollector.seqIndex; +} + +/* Returns true if the given block is a RLE block */ +static int ZSTD_isRLE(const BYTE *ip, size_t length) { + size_t i; + if (length < 2) return 1; + for (i = 1; i < length; ++i) { + if (ip[0] != ip[i]) return 0; + } + return 1; +} + static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, void* dst, size_t dstCapacity, - const void* src, size_t srcSize) + const void* src, size_t srcSize, U32 frame) { + /* This the upper bound for the length of an rle block. + * This isn't the actual upper bound. Finding the real threshold + * needs further investigation. + */ + const U32 rleMaxLength = 25; size_t cSize; + const BYTE* ip = (const BYTE*)src; + BYTE* op = (BYTE*)dst; DEBUGLOG(5, "ZSTD_compressBlock_internal (dstCapacity=%u, dictLimit=%u, nextToUpdate=%u)", - (unsigned)dstCapacity, (unsigned)zc->blockState.matchState.window.dictLimit, (unsigned)zc->blockState.matchState.nextToUpdate); + (unsigned)dstCapacity, (unsigned)zc->blockState.matchState.window.dictLimit, + (unsigned)zc->blockState.matchState.nextToUpdate); { const size_t bss = ZSTD_buildSeqStore(zc, src, srcSize); FORWARD_IF_ERROR(bss); if (bss == ZSTDbss_noCompress) { cSize = 0; goto out; } } + if (zc->seqCollector.collectSequences) { + ZSTD_copyBlockSequences(zc); + return 0; + } + /* encode sequences and literals */ cSize = ZSTD_compressSequences(&zc->seqStore, &zc->blockState.prevCBlock->entropy, &zc->blockState.nextCBlock->entropy, @@ -2857,8 +2405,21 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, zc->entropyWorkspace, HUF_WORKSPACE_SIZE /* statically allocated in resetCCtx */, zc->bmi2); + if (frame && + /* We don't want to emit our first block as a RLE even if it qualifies because + * doing so will cause the decoder (cli only) to throw a "should consume all input error." + * This is only an issue for zstd <= v1.4.3 + */ + !zc->isFirstBlock && + cSize < rleMaxLength && + ZSTD_isRLE(ip, srcSize)) + { + cSize = 1; + op[0] = ip[0]; + } + out: - if (!ZSTD_isError(cSize) && cSize != 0) { + if (!ZSTD_isError(cSize) && cSize > 1) { /* confirm repcodes and entropy tables when emitting a compressed block */ ZSTD_compressedBlockState_t* const tmp = zc->blockState.prevCBlock; zc->blockState.prevCBlock = zc->blockState.nextCBlock; @@ -2875,7 +2436,11 @@ out: } -static void ZSTD_overflowCorrectIfNeeded(ZSTD_matchState_t* ms, ZSTD_CCtx_params const* params, void const* ip, void const* iend) +static void ZSTD_overflowCorrectIfNeeded(ZSTD_matchState_t* ms, + ZSTD_cwksp* ws, + ZSTD_CCtx_params const* params, + void const* ip, + void const* iend) { if (ZSTD_window_needOverflowCorrection(ms->window, iend)) { U32 const maxDist = (U32)1 << params->cParams.windowLog; @@ -2884,7 +2449,9 @@ static void ZSTD_overflowCorrectIfNeeded(ZSTD_matchState_t* ms, ZSTD_CCtx_params ZSTD_STATIC_ASSERT(ZSTD_CHAINLOG_MAX <= 30); ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_32 <= 30); ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31); + ZSTD_cwksp_mark_tables_dirty(ws); ZSTD_reduceIndex(ms, params, correction); + ZSTD_cwksp_mark_tables_clean(ws); if (ms->nextToUpdate < correction) ms->nextToUpdate = 0; else ms->nextToUpdate -= correction; /* invalidate dictionaries on overflow correction */ @@ -2893,7 +2460,6 @@ static void ZSTD_overflowCorrectIfNeeded(ZSTD_matchState_t* ms, ZSTD_CCtx_params } } - /*! ZSTD_compress_frameChunk() : * Compress a chunk of data into one or multiple blocks. * All blocks will be terminated, all input will be consumed. @@ -2927,7 +2493,8 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, "not enough space to store compressed block"); if (remaining < blockSize) blockSize = remaining; - ZSTD_overflowCorrectIfNeeded(ms, &cctx->appliedParams, ip, ip + blockSize); + ZSTD_overflowCorrectIfNeeded( + ms, &cctx->workspace, &cctx->appliedParams, ip, ip + blockSize); ZSTD_checkDictValidity(&ms->window, ip + blockSize, maxDist, &ms->loadedDictEnd, &ms->dictMatchState); /* Ensure hash/chain table insertion resumes no sooner than lowlimit */ @@ -2935,15 +2502,16 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, { size_t cSize = ZSTD_compressBlock_internal(cctx, op+ZSTD_blockHeaderSize, dstCapacity-ZSTD_blockHeaderSize, - ip, blockSize); + ip, blockSize, 1 /* frame */); FORWARD_IF_ERROR(cSize); - if (cSize == 0) { /* block is not compressible */ cSize = ZSTD_noCompressBlock(op, dstCapacity, ip, blockSize, lastBlock); FORWARD_IF_ERROR(cSize); } else { - U32 const cBlockHeader24 = lastBlock + (((U32)bt_compressed)<<1) + (U32)(cSize << 3); - MEM_writeLE24(op, cBlockHeader24); + const U32 cBlockHeader = cSize == 1 ? + lastBlock + (((U32)bt_rle)<<1) + (U32)(blockSize << 3) : + lastBlock + (((U32)bt_compressed)<<1) + (U32)(cSize << 3); + MEM_writeLE24(op, cBlockHeader); cSize += ZSTD_blockHeaderSize; } @@ -2953,6 +2521,7 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, op += cSize; assert(dstCapacity >= cSize); dstCapacity -= cSize; + cctx->isFirstBlock = 0; DEBUGLOG(5, "ZSTD_compress_frameChunk: adding a block of size %u", (unsigned)cSize); } } @@ -2963,25 +2532,25 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, static size_t ZSTD_writeFrameHeader(void* dst, size_t dstCapacity, - ZSTD_CCtx_params params, U64 pledgedSrcSize, U32 dictID) + const ZSTD_CCtx_params* params, U64 pledgedSrcSize, U32 dictID) { BYTE* const op = (BYTE*)dst; U32 const dictIDSizeCodeLength = (dictID>0) + (dictID>=256) + (dictID>=65536); /* 0-3 */ - U32 const dictIDSizeCode = params.fParams.noDictIDFlag ? 0 : dictIDSizeCodeLength; /* 0-3 */ - U32 const checksumFlag = params.fParams.checksumFlag>0; - U32 const windowSize = (U32)1 << params.cParams.windowLog; - U32 const singleSegment = params.fParams.contentSizeFlag && (windowSize >= pledgedSrcSize); - BYTE const windowLogByte = (BYTE)((params.cParams.windowLog - ZSTD_WINDOWLOG_ABSOLUTEMIN) << 3); - U32 const fcsCode = params.fParams.contentSizeFlag ? + U32 const dictIDSizeCode = params->fParams.noDictIDFlag ? 0 : dictIDSizeCodeLength; /* 0-3 */ + U32 const checksumFlag = params->fParams.checksumFlag>0; + U32 const windowSize = (U32)1 << params->cParams.windowLog; + U32 const singleSegment = params->fParams.contentSizeFlag && (windowSize >= pledgedSrcSize); + BYTE const windowLogByte = (BYTE)((params->cParams.windowLog - ZSTD_WINDOWLOG_ABSOLUTEMIN) << 3); + U32 const fcsCode = params->fParams.contentSizeFlag ? (pledgedSrcSize>=256) + (pledgedSrcSize>=65536+256) + (pledgedSrcSize>=0xFFFFFFFFU) : 0; /* 0-3 */ BYTE const frameHeaderDescriptionByte = (BYTE)(dictIDSizeCode + (checksumFlag<<2) + (singleSegment<<5) + (fcsCode<<6) ); size_t pos=0; - assert(!(params.fParams.contentSizeFlag && pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN)); + assert(!(params->fParams.contentSizeFlag && pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN)); RETURN_ERROR_IF(dstCapacity < ZSTD_FRAMEHEADERSIZE_MAX, dstSize_tooSmall); DEBUGLOG(4, "ZSTD_writeFrameHeader : dictIDFlag : %u ; dictID : %u ; dictIDSizeCode : %u", - !params.fParams.noDictIDFlag, (unsigned)dictID, (unsigned)dictIDSizeCode); + !params->fParams.noDictIDFlag, (unsigned)dictID, (unsigned)dictIDSizeCode); - if (params.format == ZSTD_f_zstd1) { + if (params->format == ZSTD_f_zstd1) { MEM_writeLE32(dst, ZSTD_MAGICNUMBER); pos = 4; } @@ -3047,7 +2616,7 @@ static size_t ZSTD_compressContinue_internal (ZSTD_CCtx* cctx, "missing init (ZSTD_compressBegin)"); if (frame && (cctx->stage==ZSTDcs_init)) { - fhSize = ZSTD_writeFrameHeader(dst, dstCapacity, cctx->appliedParams, + fhSize = ZSTD_writeFrameHeader(dst, dstCapacity, &cctx->appliedParams, cctx->pledgedSrcSizePlusOne-1, cctx->dictID); FORWARD_IF_ERROR(fhSize); assert(fhSize <= dstCapacity); @@ -3067,13 +2636,15 @@ static size_t ZSTD_compressContinue_internal (ZSTD_CCtx* cctx, if (!frame) { /* overflow check and correction for block mode */ - ZSTD_overflowCorrectIfNeeded(ms, &cctx->appliedParams, src, (BYTE const*)src + srcSize); + ZSTD_overflowCorrectIfNeeded( + ms, &cctx->workspace, &cctx->appliedParams, + src, (BYTE const*)src + srcSize); } DEBUGLOG(5, "ZSTD_compressContinue_internal (blockSize=%u)", (unsigned)cctx->blockSize); { size_t const cSize = frame ? ZSTD_compress_frameChunk (cctx, dst, dstCapacity, src, srcSize, lastFrameChunk) : - ZSTD_compressBlock_internal (cctx, dst, dstCapacity, src, srcSize); + ZSTD_compressBlock_internal (cctx, dst, dstCapacity, src, srcSize, 0 /* frame */); FORWARD_IF_ERROR(cSize); cctx->consumedSrcSize += srcSize; cctx->producedCSize += (cSize + fhSize); @@ -3109,8 +2680,9 @@ size_t ZSTD_getBlockSize(const ZSTD_CCtx* cctx) size_t ZSTD_compressBlock(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize) { - size_t const blockSizeMax = ZSTD_getBlockSize(cctx); - RETURN_ERROR_IF(srcSize > blockSizeMax, srcSize_wrong); + DEBUGLOG(5, "ZSTD_compressBlock: srcSize = %u", (unsigned)srcSize); + { size_t const blockSizeMax = ZSTD_getBlockSize(cctx); + RETURN_ERROR_IF(srcSize > blockSizeMax, srcSize_wrong); } return ZSTD_compressContinue_internal(cctx, dst, dstCapacity, src, srcSize, 0 /* frame mode */, 0 /* last chunk */); } @@ -3119,6 +2691,7 @@ size_t ZSTD_compressBlock(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const * @return : 0, or an error code */ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms, + ZSTD_cwksp* ws, ZSTD_CCtx_params const* params, const void* src, size_t srcSize, ZSTD_dictTableLoadMethod_e dtlm) @@ -3135,11 +2708,11 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms, if (srcSize <= HASH_READ_SIZE) return 0; while (iend - ip > HASH_READ_SIZE) { - size_t const remaining = iend - ip; + size_t const remaining = (size_t)(iend - ip); size_t const chunk = MIN(remaining, ZSTD_CHUNKSIZE_MAX); const BYTE* const ichunk = ip + chunk; - ZSTD_overflowCorrectIfNeeded(ms, params, ip, ichunk); + ZSTD_overflowCorrectIfNeeded(ms, ws, params, ip, ichunk); switch(params->cParams.strategy) { @@ -3198,10 +2771,11 @@ static size_t ZSTD_checkDictNCount(short* normalizedCounter, unsigned dictMaxSym /*! ZSTD_loadZstdDictionary() : * @return : dictID, or an error code * assumptions : magic number supposed already checked - * dictSize supposed > 8 + * dictSize supposed >= 8 */ static size_t ZSTD_loadZstdDictionary(ZSTD_compressedBlockState_t* bs, ZSTD_matchState_t* ms, + ZSTD_cwksp* ws, ZSTD_CCtx_params const* params, const void* dict, size_t dictSize, ZSTD_dictTableLoadMethod_e dtlm, @@ -3214,7 +2788,7 @@ static size_t ZSTD_loadZstdDictionary(ZSTD_compressedBlockState_t* bs, size_t dictID; ZSTD_STATIC_ASSERT(HUF_WORKSPACE_SIZE >= (1<<MAX(MLFSELog,LLFSELog))); - assert(dictSize > 8); + assert(dictSize >= 8); assert(MEM_readLE32(dictPtr) == ZSTD_MAGIC_DICTIONARY); dictPtr += 4; /* skip magic number */ @@ -3297,7 +2871,8 @@ static size_t ZSTD_loadZstdDictionary(ZSTD_compressedBlockState_t* bs, bs->entropy.fse.offcode_repeatMode = FSE_repeat_valid; bs->entropy.fse.matchlength_repeatMode = FSE_repeat_valid; bs->entropy.fse.litlength_repeatMode = FSE_repeat_valid; - FORWARD_IF_ERROR(ZSTD_loadDictionaryContent(ms, params, dictPtr, dictContentSize, dtlm)); + FORWARD_IF_ERROR(ZSTD_loadDictionaryContent( + ms, ws, params, dictPtr, dictContentSize, dtlm)); return dictID; } } @@ -3307,6 +2882,7 @@ static size_t ZSTD_loadZstdDictionary(ZSTD_compressedBlockState_t* bs, static size_t ZSTD_compress_insertDictionary(ZSTD_compressedBlockState_t* bs, ZSTD_matchState_t* ms, + ZSTD_cwksp* ws, const ZSTD_CCtx_params* params, const void* dict, size_t dictSize, ZSTD_dictContentType_e dictContentType, @@ -3314,27 +2890,35 @@ ZSTD_compress_insertDictionary(ZSTD_compressedBlockState_t* bs, void* workspace) { DEBUGLOG(4, "ZSTD_compress_insertDictionary (dictSize=%u)", (U32)dictSize); - if ((dict==NULL) || (dictSize<=8)) return 0; + if ((dict==NULL) || (dictSize<8)) { + RETURN_ERROR_IF(dictContentType == ZSTD_dct_fullDict, dictionary_wrong); + return 0; + } ZSTD_reset_compressedBlockState(bs); /* dict restricted modes */ if (dictContentType == ZSTD_dct_rawContent) - return ZSTD_loadDictionaryContent(ms, params, dict, dictSize, dtlm); + return ZSTD_loadDictionaryContent(ms, ws, params, dict, dictSize, dtlm); if (MEM_readLE32(dict) != ZSTD_MAGIC_DICTIONARY) { if (dictContentType == ZSTD_dct_auto) { DEBUGLOG(4, "raw content dictionary detected"); - return ZSTD_loadDictionaryContent(ms, params, dict, dictSize, dtlm); + return ZSTD_loadDictionaryContent( + ms, ws, params, dict, dictSize, dtlm); } RETURN_ERROR_IF(dictContentType == ZSTD_dct_fullDict, dictionary_wrong); assert(0); /* impossible */ } /* dict as full zstd dictionary */ - return ZSTD_loadZstdDictionary(bs, ms, params, dict, dictSize, dtlm, workspace); + return ZSTD_loadZstdDictionary( + bs, ms, ws, params, dict, dictSize, dtlm, workspace); } +#define ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF (128 KB) +#define ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER (6) + /*! ZSTD_compressBegin_internal() : * @return : 0, or an error code */ static size_t ZSTD_compressBegin_internal(ZSTD_CCtx* cctx, @@ -3342,23 +2926,34 @@ static size_t ZSTD_compressBegin_internal(ZSTD_CCtx* cctx, ZSTD_dictContentType_e dictContentType, ZSTD_dictTableLoadMethod_e dtlm, const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, U64 pledgedSrcSize, + const ZSTD_CCtx_params* params, U64 pledgedSrcSize, ZSTD_buffered_policy_e zbuff) { - DEBUGLOG(4, "ZSTD_compressBegin_internal: wlog=%u", params.cParams.windowLog); + DEBUGLOG(4, "ZSTD_compressBegin_internal: wlog=%u", params->cParams.windowLog); /* params are supposed to be fully validated at this point */ - assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams))); + assert(!ZSTD_isError(ZSTD_checkCParams(params->cParams))); assert(!((dict) && (cdict))); /* either dict or cdict, not both */ - - if (cdict && cdict->dictContentSize>0) { + if ( (cdict) + && (cdict->dictContentSize > 0) + && ( pledgedSrcSize < ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF + || pledgedSrcSize < cdict->dictContentSize * ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER + || pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN + || cdict->compressionLevel == 0) + && (params->attachDictPref != ZSTD_dictForceLoad) ) { return ZSTD_resetCCtx_usingCDict(cctx, cdict, params, pledgedSrcSize, zbuff); } - FORWARD_IF_ERROR( ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize, - ZSTDcrp_continue, zbuff) ); - { size_t const dictID = ZSTD_compress_insertDictionary( - cctx->blockState.prevCBlock, &cctx->blockState.matchState, - ¶ms, dict, dictSize, dictContentType, dtlm, cctx->entropyWorkspace); + FORWARD_IF_ERROR( ZSTD_resetCCtx_internal(cctx, *params, pledgedSrcSize, + ZSTDcrp_makeClean, zbuff) ); + { size_t const dictID = cdict ? + ZSTD_compress_insertDictionary( + cctx->blockState.prevCBlock, &cctx->blockState.matchState, + &cctx->workspace, params, cdict->dictContent, cdict->dictContentSize, + dictContentType, dtlm, cctx->entropyWorkspace) + : ZSTD_compress_insertDictionary( + cctx->blockState.prevCBlock, &cctx->blockState.matchState, + &cctx->workspace, params, dict, dictSize, + dictContentType, dtlm, cctx->entropyWorkspace); FORWARD_IF_ERROR(dictID); assert(dictID <= UINT_MAX); cctx->dictID = (U32)dictID; @@ -3371,12 +2966,12 @@ size_t ZSTD_compressBegin_advanced_internal(ZSTD_CCtx* cctx, ZSTD_dictContentType_e dictContentType, ZSTD_dictTableLoadMethod_e dtlm, const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, + const ZSTD_CCtx_params* params, unsigned long long pledgedSrcSize) { - DEBUGLOG(4, "ZSTD_compressBegin_advanced_internal: wlog=%u", params.cParams.windowLog); + DEBUGLOG(4, "ZSTD_compressBegin_advanced_internal: wlog=%u", params->cParams.windowLog); /* compression parameters verification and optimization */ - FORWARD_IF_ERROR( ZSTD_checkCParams(params.cParams) ); + FORWARD_IF_ERROR( ZSTD_checkCParams(params->cParams) ); return ZSTD_compressBegin_internal(cctx, dict, dictSize, dictContentType, dtlm, cdict, @@ -3391,21 +2986,21 @@ size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, ZSTD_parameters params, unsigned long long pledgedSrcSize) { ZSTD_CCtx_params const cctxParams = - ZSTD_assignParamsToCCtxParams(cctx->requestedParams, params); + ZSTD_assignParamsToCCtxParams(&cctx->requestedParams, params); return ZSTD_compressBegin_advanced_internal(cctx, dict, dictSize, ZSTD_dct_auto, ZSTD_dtlm_fast, NULL /*cdict*/, - cctxParams, pledgedSrcSize); + &cctxParams, pledgedSrcSize); } size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel) { ZSTD_parameters const params = ZSTD_getParams(compressionLevel, ZSTD_CONTENTSIZE_UNKNOWN, dictSize); ZSTD_CCtx_params const cctxParams = - ZSTD_assignParamsToCCtxParams(cctx->requestedParams, params); + ZSTD_assignParamsToCCtxParams(&cctx->requestedParams, params); DEBUGLOG(4, "ZSTD_compressBegin_usingDict (dictSize=%u)", (unsigned)dictSize); return ZSTD_compressBegin_internal(cctx, dict, dictSize, ZSTD_dct_auto, ZSTD_dtlm_fast, NULL, - cctxParams, ZSTD_CONTENTSIZE_UNKNOWN, ZSTDb_not_buffered); + &cctxParams, ZSTD_CONTENTSIZE_UNKNOWN, ZSTDb_not_buffered); } size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel) @@ -3428,7 +3023,7 @@ static size_t ZSTD_writeEpilogue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity) /* special case : empty frame */ if (cctx->stage == ZSTDcs_init) { - fhSize = ZSTD_writeFrameHeader(dst, dstCapacity, cctx->appliedParams, 0, 0); + fhSize = ZSTD_writeFrameHeader(dst, dstCapacity, &cctx->appliedParams, 0, 0); FORWARD_IF_ERROR(fhSize); dstCapacity -= fhSize; op += fhSize; @@ -3489,13 +3084,13 @@ static size_t ZSTD_compress_internal (ZSTD_CCtx* cctx, ZSTD_parameters params) { ZSTD_CCtx_params const cctxParams = - ZSTD_assignParamsToCCtxParams(cctx->requestedParams, params); + ZSTD_assignParamsToCCtxParams(&cctx->requestedParams, params); DEBUGLOG(4, "ZSTD_compress_internal"); return ZSTD_compress_advanced_internal(cctx, dst, dstCapacity, src, srcSize, dict, dictSize, - cctxParams); + &cctxParams); } size_t ZSTD_compress_advanced (ZSTD_CCtx* cctx, @@ -3519,7 +3114,7 @@ size_t ZSTD_compress_advanced_internal( void* dst, size_t dstCapacity, const void* src, size_t srcSize, const void* dict,size_t dictSize, - ZSTD_CCtx_params params) + const ZSTD_CCtx_params* params) { DEBUGLOG(4, "ZSTD_compress_advanced_internal (srcSize:%u)", (unsigned)srcSize); FORWARD_IF_ERROR( ZSTD_compressBegin_internal(cctx, @@ -3535,9 +3130,9 @@ size_t ZSTD_compress_usingDict(ZSTD_CCtx* cctx, int compressionLevel) { ZSTD_parameters const params = ZSTD_getParams(compressionLevel, srcSize + (!srcSize), dict ? dictSize : 0); - ZSTD_CCtx_params cctxParams = ZSTD_assignParamsToCCtxParams(cctx->requestedParams, params); + ZSTD_CCtx_params cctxParams = ZSTD_assignParamsToCCtxParams(&cctx->requestedParams, params); assert(params.fParams.contentSizeFlag == 1); - return ZSTD_compress_advanced_internal(cctx, dst, dstCapacity, src, srcSize, dict, dictSize, cctxParams); + return ZSTD_compress_advanced_internal(cctx, dst, dstCapacity, src, srcSize, dict, dictSize, &cctxParams); } size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx, @@ -3572,8 +3167,11 @@ size_t ZSTD_estimateCDictSize_advanced( ZSTD_dictLoadMethod_e dictLoadMethod) { DEBUGLOG(5, "sizeof(ZSTD_CDict) : %u", (unsigned)sizeof(ZSTD_CDict)); - return sizeof(ZSTD_CDict) + HUF_WORKSPACE_SIZE + ZSTD_sizeof_matchState(&cParams, /* forCCtx */ 0) - + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize); + return ZSTD_cwksp_alloc_size(sizeof(ZSTD_CDict)) + + ZSTD_cwksp_alloc_size(HUF_WORKSPACE_SIZE) + + ZSTD_sizeof_matchState(&cParams, /* forCCtx */ 0) + + (dictLoadMethod == ZSTD_dlm_byRef ? 0 + : ZSTD_cwksp_alloc_size(ZSTD_cwksp_align(dictSize, sizeof(void *)))); } size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel) @@ -3586,7 +3184,9 @@ size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict) { if (cdict==NULL) return 0; /* support sizeof on NULL */ DEBUGLOG(5, "sizeof(*cdict) : %u", (unsigned)sizeof(*cdict)); - return cdict->workspaceSize + (cdict->dictBuffer ? cdict->dictContentSize : 0) + sizeof(*cdict); + /* cdict may be in the workspace */ + return (cdict->workspace.workspace == cdict ? 0 : sizeof(*cdict)) + + ZSTD_cwksp_sizeof(&cdict->workspace); } static size_t ZSTD_initCDict_internal( @@ -3600,28 +3200,29 @@ static size_t ZSTD_initCDict_internal( assert(!ZSTD_checkCParams(cParams)); cdict->matchState.cParams = cParams; if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dictBuffer) || (!dictSize)) { - cdict->dictBuffer = NULL; cdict->dictContent = dictBuffer; } else { - void* const internalBuffer = ZSTD_malloc(dictSize, cdict->customMem); - cdict->dictBuffer = internalBuffer; - cdict->dictContent = internalBuffer; + void *internalBuffer = ZSTD_cwksp_reserve_object(&cdict->workspace, ZSTD_cwksp_align(dictSize, sizeof(void*))); RETURN_ERROR_IF(!internalBuffer, memory_allocation); + cdict->dictContent = internalBuffer; memcpy(internalBuffer, dictBuffer, dictSize); } cdict->dictContentSize = dictSize; + cdict->entropyWorkspace = (U32*)ZSTD_cwksp_reserve_object(&cdict->workspace, HUF_WORKSPACE_SIZE); + + /* Reset the state to no dictionary */ ZSTD_reset_compressedBlockState(&cdict->cBlockState); - { void* const end = ZSTD_reset_matchState(&cdict->matchState, - (U32*)cdict->workspace + HUF_WORKSPACE_SIZE_U32, - &cParams, - ZSTDcrp_continue, ZSTD_resetTarget_CDict); - assert(end == (char*)cdict->workspace + cdict->workspaceSize); - (void)end; - } + FORWARD_IF_ERROR(ZSTD_reset_matchState( + &cdict->matchState, + &cdict->workspace, + &cParams, + ZSTDcrp_makeClean, + ZSTDirp_reset, + ZSTD_resetTarget_CDict)); /* (Maybe) load the dictionary - * Skips loading the dictionary if it is <= 8 bytes. + * Skips loading the dictionary if it is < 8 bytes. */ { ZSTD_CCtx_params params; memset(¶ms, 0, sizeof(params)); @@ -3629,9 +3230,9 @@ static size_t ZSTD_initCDict_internal( params.fParams.contentSizeFlag = 1; params.cParams = cParams; { size_t const dictID = ZSTD_compress_insertDictionary( - &cdict->cBlockState, &cdict->matchState, ¶ms, - cdict->dictContent, cdict->dictContentSize, - dictContentType, ZSTD_dtlm_full, cdict->workspace); + &cdict->cBlockState, &cdict->matchState, &cdict->workspace, + ¶ms, cdict->dictContent, cdict->dictContentSize, + dictContentType, ZSTD_dtlm_full, cdict->entropyWorkspace); FORWARD_IF_ERROR(dictID); assert(dictID <= (size_t)(U32)-1); cdict->dictID = (U32)dictID; @@ -3649,18 +3250,29 @@ ZSTD_CDict* ZSTD_createCDict_advanced(const void* dictBuffer, size_t dictSize, DEBUGLOG(3, "ZSTD_createCDict_advanced, mode %u", (unsigned)dictContentType); if (!customMem.customAlloc ^ !customMem.customFree) return NULL; - { ZSTD_CDict* const cdict = (ZSTD_CDict*)ZSTD_malloc(sizeof(ZSTD_CDict), customMem); - size_t const workspaceSize = HUF_WORKSPACE_SIZE + ZSTD_sizeof_matchState(&cParams, /* forCCtx */ 0); + { size_t const workspaceSize = + ZSTD_cwksp_alloc_size(sizeof(ZSTD_CDict)) + + ZSTD_cwksp_alloc_size(HUF_WORKSPACE_SIZE) + + ZSTD_sizeof_matchState(&cParams, /* forCCtx */ 0) + + (dictLoadMethod == ZSTD_dlm_byRef ? 0 + : ZSTD_cwksp_alloc_size(ZSTD_cwksp_align(dictSize, sizeof(void*)))); void* const workspace = ZSTD_malloc(workspaceSize, customMem); + ZSTD_cwksp ws; + ZSTD_CDict* cdict; - if (!cdict || !workspace) { - ZSTD_free(cdict, customMem); + if (!workspace) { ZSTD_free(workspace, customMem); return NULL; } + + ZSTD_cwksp_init(&ws, workspace, workspaceSize); + + cdict = (ZSTD_CDict*)ZSTD_cwksp_reserve_object(&ws, sizeof(ZSTD_CDict)); + assert(cdict != NULL); + ZSTD_cwksp_move(&cdict->workspace, &ws); cdict->customMem = customMem; - cdict->workspace = workspace; - cdict->workspaceSize = workspaceSize; + cdict->compressionLevel = 0; /* signals advanced API usage */ + if (ZSTD_isError( ZSTD_initCDict_internal(cdict, dictBuffer, dictSize, dictLoadMethod, dictContentType, @@ -3676,9 +3288,12 @@ ZSTD_CDict* ZSTD_createCDict_advanced(const void* dictBuffer, size_t dictSize, ZSTD_CDict* ZSTD_createCDict(const void* dict, size_t dictSize, int compressionLevel) { ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, 0, dictSize); - return ZSTD_createCDict_advanced(dict, dictSize, - ZSTD_dlm_byCopy, ZSTD_dct_auto, - cParams, ZSTD_defaultCMem); + ZSTD_CDict* cdict = ZSTD_createCDict_advanced(dict, dictSize, + ZSTD_dlm_byCopy, ZSTD_dct_auto, + cParams, ZSTD_defaultCMem); + if (cdict) + cdict->compressionLevel = compressionLevel == 0 ? ZSTD_CLEVEL_DEFAULT : compressionLevel; + return cdict; } ZSTD_CDict* ZSTD_createCDict_byReference(const void* dict, size_t dictSize, int compressionLevel) @@ -3693,9 +3308,11 @@ size_t ZSTD_freeCDict(ZSTD_CDict* cdict) { if (cdict==NULL) return 0; /* support free on NULL */ { ZSTD_customMem const cMem = cdict->customMem; - ZSTD_free(cdict->workspace, cMem); - ZSTD_free(cdict->dictBuffer, cMem); - ZSTD_free(cdict, cMem); + int cdictInWorkspace = ZSTD_cwksp_owns_buffer(&cdict->workspace, cdict); + ZSTD_cwksp_free(&cdict->workspace, cMem); + if (!cdictInWorkspace) { + ZSTD_free(cdict, cMem); + } return 0; } } @@ -3721,28 +3338,30 @@ const ZSTD_CDict* ZSTD_initStaticCDict( ZSTD_compressionParameters cParams) { size_t const matchStateSize = ZSTD_sizeof_matchState(&cParams, /* forCCtx */ 0); - size_t const neededSize = sizeof(ZSTD_CDict) + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize) - + HUF_WORKSPACE_SIZE + matchStateSize; - ZSTD_CDict* const cdict = (ZSTD_CDict*) workspace; - void* ptr; + size_t const neededSize = ZSTD_cwksp_alloc_size(sizeof(ZSTD_CDict)) + + (dictLoadMethod == ZSTD_dlm_byRef ? 0 + : ZSTD_cwksp_alloc_size(ZSTD_cwksp_align(dictSize, sizeof(void*)))) + + ZSTD_cwksp_alloc_size(HUF_WORKSPACE_SIZE) + + matchStateSize; + ZSTD_CDict* cdict; + if ((size_t)workspace & 7) return NULL; /* 8-aligned */ + + { + ZSTD_cwksp ws; + ZSTD_cwksp_init(&ws, workspace, workspaceSize); + cdict = (ZSTD_CDict*)ZSTD_cwksp_reserve_object(&ws, sizeof(ZSTD_CDict)); + if (cdict == NULL) return NULL; + ZSTD_cwksp_move(&cdict->workspace, &ws); + } + DEBUGLOG(4, "(workspaceSize < neededSize) : (%u < %u) => %u", (unsigned)workspaceSize, (unsigned)neededSize, (unsigned)(workspaceSize < neededSize)); if (workspaceSize < neededSize) return NULL; - if (dictLoadMethod == ZSTD_dlm_byCopy) { - memcpy(cdict+1, dict, dictSize); - dict = cdict+1; - ptr = (char*)workspace + sizeof(ZSTD_CDict) + dictSize; - } else { - ptr = cdict+1; - } - cdict->workspace = ptr; - cdict->workspaceSize = HUF_WORKSPACE_SIZE + matchStateSize; - if (ZSTD_isError( ZSTD_initCDict_internal(cdict, dict, dictSize, - ZSTD_dlm_byRef, dictContentType, + dictLoadMethod, dictContentType, cParams) )) return NULL; @@ -3764,7 +3383,15 @@ size_t ZSTD_compressBegin_usingCDict_advanced( DEBUGLOG(4, "ZSTD_compressBegin_usingCDict_advanced"); RETURN_ERROR_IF(cdict==NULL, dictionary_wrong); { ZSTD_CCtx_params params = cctx->requestedParams; - params.cParams = ZSTD_getCParamsFromCDict(cdict); + params.cParams = ( pledgedSrcSize < ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF + || pledgedSrcSize < cdict->dictContentSize * ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER + || pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN + || cdict->compressionLevel == 0 ) + && (params.attachDictPref != ZSTD_dictForceLoad) ? + ZSTD_getCParamsFromCDict(cdict) + : ZSTD_getCParams(cdict->compressionLevel, + pledgedSrcSize, + cdict->dictContentSize); /* Increase window log to fit the entire dictionary and source if the * source size is known. Limit the increase to 19, which is the * window log for compression level 1 with the largest source size. @@ -3778,7 +3405,7 @@ size_t ZSTD_compressBegin_usingCDict_advanced( return ZSTD_compressBegin_internal(cctx, NULL, 0, ZSTD_dct_auto, ZSTD_dtlm_fast, cdict, - params, pledgedSrcSize, + ¶ms, pledgedSrcSize, ZSTDb_not_buffered); } } @@ -3869,7 +3496,7 @@ static size_t ZSTD_resetCStream_internal(ZSTD_CStream* cctx, FORWARD_IF_ERROR( ZSTD_compressBegin_internal(cctx, dict, dictSize, dictContentType, ZSTD_dtlm_fast, cdict, - params, pledgedSrcSize, + ¶ms, pledgedSrcSize, ZSTDb_buffered) ); cctx->inToCompress = 0; @@ -3903,13 +3530,14 @@ size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pss) * Assumption 2 : either dict, or cdict, is defined, not both */ size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, const void* dict, size_t dictSize, const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, unsigned long long pledgedSrcSize) + const ZSTD_CCtx_params* params, + unsigned long long pledgedSrcSize) { DEBUGLOG(4, "ZSTD_initCStream_internal"); FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) ); FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) ); - assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams))); - zcs->requestedParams = params; + assert(!ZSTD_isError(ZSTD_checkCParams(params->cParams))); + zcs->requestedParams = *params; assert(!((dict) && (cdict))); /* either dict or cdict, not both */ if (dict) { FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) ); @@ -3948,7 +3576,7 @@ size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict) /* ZSTD_initCStream_advanced() : * pledgedSrcSize must be exact. * if srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN. - * dict is loaded with default parameters ZSTD_dm_auto and ZSTD_dlm_byCopy. */ + * dict is loaded with default parameters ZSTD_dct_auto and ZSTD_dlm_byCopy. */ size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pss) @@ -3962,7 +3590,7 @@ size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) ); FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) ); FORWARD_IF_ERROR( ZSTD_checkCParams(params.cParams) ); - zcs->requestedParams = ZSTD_assignParamsToCCtxParams(zcs->requestedParams, params); + zcs->requestedParams = ZSTD_assignParamsToCCtxParams(&zcs->requestedParams, params); FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) ); return 0; } @@ -4212,7 +3840,7 @@ size_t ZSTD_compressStream2( ZSTD_CCtx* cctx, if (cctx->mtctx == NULL) { DEBUGLOG(4, "ZSTD_compressStream2: creating new mtctx for nbWorkers=%u", params.nbWorkers); - cctx->mtctx = ZSTDMT_createCCtx_advanced(params.nbWorkers, cctx->customMem); + cctx->mtctx = ZSTDMT_createCCtx_advanced((U32)params.nbWorkers, cctx->customMem); RETURN_ERROR_IF(cctx->mtctx == NULL, memory_allocation); } /* mt compression */ @@ -4340,8 +3968,8 @@ static const ZSTD_compressionParameters ZSTD_defaultCParameters[4][ZSTD_MAX_CLEV { 19, 12, 13, 1, 6, 1, ZSTD_fast }, /* base for negative levels */ { 19, 13, 14, 1, 7, 0, ZSTD_fast }, /* level 1 */ { 20, 15, 16, 1, 6, 0, ZSTD_fast }, /* level 2 */ - { 21, 16, 17, 1, 5, 1, ZSTD_dfast }, /* level 3 */ - { 21, 18, 18, 1, 5, 1, ZSTD_dfast }, /* level 4 */ + { 21, 16, 17, 1, 5, 0, ZSTD_dfast }, /* level 3 */ + { 21, 18, 18, 1, 5, 0, ZSTD_dfast }, /* level 4 */ { 21, 18, 19, 2, 5, 2, ZSTD_greedy }, /* level 5 */ { 21, 19, 19, 3, 5, 4, ZSTD_greedy }, /* level 6 */ { 21, 19, 19, 3, 5, 8, ZSTD_lazy }, /* level 7 */ @@ -4365,8 +3993,8 @@ static const ZSTD_compressionParameters ZSTD_defaultCParameters[4][ZSTD_MAX_CLEV /* W, C, H, S, L, T, strat */ { 18, 12, 13, 1, 5, 1, ZSTD_fast }, /* base for negative levels */ { 18, 13, 14, 1, 6, 0, ZSTD_fast }, /* level 1 */ - { 18, 14, 14, 1, 5, 1, ZSTD_dfast }, /* level 2 */ - { 18, 16, 16, 1, 4, 1, ZSTD_dfast }, /* level 3 */ + { 18, 14, 14, 1, 5, 0, ZSTD_dfast }, /* level 2 */ + { 18, 16, 16, 1, 4, 0, ZSTD_dfast }, /* level 3 */ { 18, 16, 17, 2, 5, 2, ZSTD_greedy }, /* level 4.*/ { 18, 18, 18, 3, 5, 2, ZSTD_greedy }, /* level 5.*/ { 18, 18, 19, 3, 5, 4, ZSTD_lazy }, /* level 6.*/ @@ -4392,8 +4020,8 @@ static const ZSTD_compressionParameters ZSTD_defaultCParameters[4][ZSTD_MAX_CLEV { 17, 12, 12, 1, 5, 1, ZSTD_fast }, /* base for negative levels */ { 17, 12, 13, 1, 6, 0, ZSTD_fast }, /* level 1 */ { 17, 13, 15, 1, 5, 0, ZSTD_fast }, /* level 2 */ - { 17, 15, 16, 2, 5, 1, ZSTD_dfast }, /* level 3 */ - { 17, 17, 17, 2, 4, 1, ZSTD_dfast }, /* level 4 */ + { 17, 15, 16, 2, 5, 0, ZSTD_dfast }, /* level 3 */ + { 17, 17, 17, 2, 4, 0, ZSTD_dfast }, /* level 4 */ { 17, 16, 17, 3, 4, 2, ZSTD_greedy }, /* level 5 */ { 17, 17, 17, 3, 4, 4, ZSTD_lazy }, /* level 6 */ { 17, 17, 17, 3, 4, 8, ZSTD_lazy2 }, /* level 7 */ @@ -4418,7 +4046,7 @@ static const ZSTD_compressionParameters ZSTD_defaultCParameters[4][ZSTD_MAX_CLEV { 14, 12, 13, 1, 5, 1, ZSTD_fast }, /* base for negative levels */ { 14, 14, 15, 1, 5, 0, ZSTD_fast }, /* level 1 */ { 14, 14, 15, 1, 4, 0, ZSTD_fast }, /* level 2 */ - { 14, 14, 15, 2, 4, 1, ZSTD_dfast }, /* level 3 */ + { 14, 14, 15, 2, 4, 0, ZSTD_dfast }, /* level 3 */ { 14, 14, 14, 4, 4, 2, ZSTD_greedy }, /* level 4 */ { 14, 14, 14, 3, 4, 4, ZSTD_lazy }, /* level 5.*/ { 14, 14, 14, 4, 4, 8, ZSTD_lazy2 }, /* level 6 */ diff --git a/thirdparty/zstd/compress/zstd_compress_internal.h b/thirdparty/zstd/compress/zstd_compress_internal.h index 5495899be3..14036f873f 100644 --- a/thirdparty/zstd/compress/zstd_compress_internal.h +++ b/thirdparty/zstd/compress/zstd_compress_internal.h @@ -19,6 +19,7 @@ * Dependencies ***************************************/ #include "zstd_internal.h" +#include "zstd_cwksp.h" #ifdef ZSTD_MULTITHREAD # include "zstdmt_compress.h" #endif @@ -134,9 +135,15 @@ typedef struct { typedef struct ZSTD_matchState_t ZSTD_matchState_t; struct ZSTD_matchState_t { ZSTD_window_t window; /* State for window round buffer management */ - U32 loadedDictEnd; /* index of end of dictionary, within context's referential. When dict referential is copied into active context (i.e. not attached), effectively same value as dictSize, since referential starts from zero */ + U32 loadedDictEnd; /* index of end of dictionary, within context's referential. + * When loadedDictEnd != 0, a dictionary is in use, and still valid. + * This relies on a mechanism to set loadedDictEnd=0 when dictionary is no longer within distance. + * Such mechanism is provided within ZSTD_window_enforceMaxDist() and ZSTD_checkDictValidity(). + * When dict referential is copied into active context (i.e. not attached), + * loadedDictEnd == dictSize, since referential starts from zero. + */ U32 nextToUpdate; /* index from which to continue table update */ - U32 hashLog3; /* dispatch table : larger == faster, more memory */ + U32 hashLog3; /* dispatch table for matches of len==3 : larger == faster, more memory */ U32* hashTable; U32* hashTable3; U32* chainTable; @@ -186,6 +193,13 @@ typedef struct { size_t capacity; /* The capacity starting from `seq` pointer */ } rawSeqStore_t; +typedef struct { + int collectSequences; + ZSTD_Sequence* seqStart; + size_t seqIndex; + size_t maxSequences; +} SeqCollector; + struct ZSTD_CCtx_params_s { ZSTD_format_e format; ZSTD_compressionParameters cParams; @@ -197,6 +211,9 @@ struct ZSTD_CCtx_params_s { size_t targetCBlockSize; /* Tries to fit compressed block size to be around targetCBlockSize. * No target when targetCBlockSize == 0. * There is no guarantee on compressed block size */ + int srcSizeHint; /* User's best guess of source size. + * Hint is not valid when srcSizeHint == 0. + * There is no guarantee that hint is close to actual source size */ ZSTD_dictAttachPref_e attachDictPref; ZSTD_literalCompressionMode_e literalCompressionMode; @@ -222,9 +239,7 @@ struct ZSTD_CCtx_s { ZSTD_CCtx_params appliedParams; U32 dictID; - int workSpaceOversizedDuration; - void* workSpace; - size_t workSpaceSize; + ZSTD_cwksp workspace; /* manages buffer for dynamic allocations */ size_t blockSize; unsigned long long pledgedSrcSizePlusOne; /* this way, 0 (default) == unknown */ unsigned long long consumedSrcSize; @@ -232,6 +247,8 @@ struct ZSTD_CCtx_s { XXH64_state_t xxhState; ZSTD_customMem customMem; size_t staticSize; + SeqCollector seqCollector; + int isFirstBlock; seqStore_t seqStore; /* sequences storage ptrs */ ldmState_t ldmState; /* long distance matching state */ @@ -307,26 +324,81 @@ MEM_STATIC U32 ZSTD_MLcode(U32 mlBase) return (mlBase > 127) ? ZSTD_highbit32(mlBase) + ML_deltaCode : ML_Code[mlBase]; } +/* ZSTD_cParam_withinBounds: + * @return 1 if value is within cParam bounds, + * 0 otherwise */ +MEM_STATIC int ZSTD_cParam_withinBounds(ZSTD_cParameter cParam, int value) +{ + ZSTD_bounds const bounds = ZSTD_cParam_getBounds(cParam); + if (ZSTD_isError(bounds.error)) return 0; + if (value < bounds.lowerBound) return 0; + if (value > bounds.upperBound) return 0; + return 1; +} + +/* ZSTD_minGain() : + * minimum compression required + * to generate a compress block or a compressed literals section. + * note : use same formula for both situations */ +MEM_STATIC size_t ZSTD_minGain(size_t srcSize, ZSTD_strategy strat) +{ + U32 const minlog = (strat>=ZSTD_btultra) ? (U32)(strat) - 1 : 6; + ZSTD_STATIC_ASSERT(ZSTD_btultra == 8); + assert(ZSTD_cParam_withinBounds(ZSTD_c_strategy, strat)); + return (srcSize >> minlog) + 2; +} + +/*! ZSTD_safecopyLiterals() : + * memcpy() function that won't read beyond more than WILDCOPY_OVERLENGTH bytes past ilimit_w. + * Only called when the sequence ends past ilimit_w, so it only needs to be optimized for single + * large copies. + */ +static void ZSTD_safecopyLiterals(BYTE* op, BYTE const* ip, BYTE const* const iend, BYTE const* ilimit_w) { + assert(iend > ilimit_w); + if (ip <= ilimit_w) { + ZSTD_wildcopy(op, ip, ilimit_w - ip, ZSTD_no_overlap); + op += ilimit_w - ip; + ip = ilimit_w; + } + while (ip < iend) *op++ = *ip++; +} + /*! ZSTD_storeSeq() : - * Store a sequence (literal length, literals, offset code and match length code) into seqStore_t. - * `offsetCode` : distance to match + 3 (values 1-3 are repCodes). + * Store a sequence (litlen, litPtr, offCode and mlBase) into seqStore_t. + * `offCode` : distance to match + ZSTD_REP_MOVE (values <= ZSTD_REP_MOVE are repCodes). * `mlBase` : matchLength - MINMATCH + * Allowed to overread literals up to litLimit. */ -MEM_STATIC void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const void* literals, U32 offsetCode, size_t mlBase) +HINT_INLINE UNUSED_ATTR +void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const BYTE* literals, const BYTE* litLimit, U32 offCode, size_t mlBase) { + BYTE const* const litLimit_w = litLimit - WILDCOPY_OVERLENGTH; + BYTE const* const litEnd = literals + litLength; #if defined(DEBUGLEVEL) && (DEBUGLEVEL >= 6) static const BYTE* g_start = NULL; if (g_start==NULL) g_start = (const BYTE*)literals; /* note : index only works for compression within a single segment */ { U32 const pos = (U32)((const BYTE*)literals - g_start); DEBUGLOG(6, "Cpos%7u :%3u literals, match%4u bytes at offCode%7u", - pos, (U32)litLength, (U32)mlBase+MINMATCH, (U32)offsetCode); + pos, (U32)litLength, (U32)mlBase+MINMATCH, (U32)offCode); } #endif assert((size_t)(seqStorePtr->sequences - seqStorePtr->sequencesStart) < seqStorePtr->maxNbSeq); /* copy Literals */ assert(seqStorePtr->maxNbLit <= 128 KB); assert(seqStorePtr->lit + litLength <= seqStorePtr->litStart + seqStorePtr->maxNbLit); - ZSTD_wildcopy(seqStorePtr->lit, literals, litLength, ZSTD_no_overlap); + assert(literals + litLength <= litLimit); + if (litEnd <= litLimit_w) { + /* Common case we can use wildcopy. + * First copy 16 bytes, because literals are likely short. + */ + assert(WILDCOPY_OVERLENGTH >= 16); + ZSTD_copy16(seqStorePtr->lit, literals); + if (litLength > 16) { + ZSTD_wildcopy(seqStorePtr->lit+16, literals+16, (ptrdiff_t)litLength-16, ZSTD_no_overlap); + } + } else { + ZSTD_safecopyLiterals(seqStorePtr->lit, literals, litEnd, litLimit_w); + } seqStorePtr->lit += litLength; /* literal Length */ @@ -338,7 +410,7 @@ MEM_STATIC void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const v seqStorePtr->sequences[0].litLength = (U16)litLength; /* match offset */ - seqStorePtr->sequences[0].offset = offsetCode + 1; + seqStorePtr->sequences[0].offset = offCode + 1; /* match Length */ if (mlBase>0xFFFF) { @@ -739,24 +811,37 @@ ZSTD_window_enforceMaxDist(ZSTD_window_t* window, /* Similar to ZSTD_window_enforceMaxDist(), * but only invalidates dictionary - * when input progresses beyond window size. */ + * when input progresses beyond window size. + * assumption : loadedDictEndPtr and dictMatchStatePtr are valid (non NULL) + * loadedDictEnd uses same referential as window->base + * maxDist is the window size */ MEM_STATIC void -ZSTD_checkDictValidity(ZSTD_window_t* window, +ZSTD_checkDictValidity(const ZSTD_window_t* window, const void* blockEnd, U32 maxDist, U32* loadedDictEndPtr, const ZSTD_matchState_t** dictMatchStatePtr) { - U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base); - U32 const loadedDictEnd = (loadedDictEndPtr != NULL) ? *loadedDictEndPtr : 0; - DEBUGLOG(5, "ZSTD_checkDictValidity: blockEndIdx=%u, maxDist=%u, loadedDictEnd=%u", - (unsigned)blockEndIdx, (unsigned)maxDist, (unsigned)loadedDictEnd); - - if (loadedDictEnd && (blockEndIdx > maxDist + loadedDictEnd)) { - /* On reaching window size, dictionaries are invalidated */ - if (loadedDictEndPtr) *loadedDictEndPtr = 0; - if (dictMatchStatePtr) *dictMatchStatePtr = NULL; - } + assert(loadedDictEndPtr != NULL); + assert(dictMatchStatePtr != NULL); + { U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base); + U32 const loadedDictEnd = *loadedDictEndPtr; + DEBUGLOG(5, "ZSTD_checkDictValidity: blockEndIdx=%u, maxDist=%u, loadedDictEnd=%u", + (unsigned)blockEndIdx, (unsigned)maxDist, (unsigned)loadedDictEnd); + assert(blockEndIdx >= loadedDictEnd); + + if (blockEndIdx > loadedDictEnd + maxDist) { + /* On reaching window size, dictionaries are invalidated. + * For simplification, if window size is reached anywhere within next block, + * the dictionary is invalidated for the full block. + */ + DEBUGLOG(6, "invalidating dictionary for current block (distance > windowSize)"); + *loadedDictEndPtr = 0; + *dictMatchStatePtr = NULL; + } else { + if (*loadedDictEndPtr != 0) { + DEBUGLOG(6, "dictionary considered valid for current block"); + } } } } /** @@ -798,6 +883,17 @@ MEM_STATIC U32 ZSTD_window_update(ZSTD_window_t* window, return contiguous; } +MEM_STATIC U32 ZSTD_getLowestMatchIndex(const ZSTD_matchState_t* ms, U32 current, unsigned windowLog) +{ + U32 const maxDistance = 1U << windowLog; + U32 const lowestValid = ms->window.lowLimit; + U32 const withinWindow = (current - lowestValid > maxDistance) ? current - maxDistance : lowestValid; + U32 const isDictionary = (ms->loadedDictEnd != 0); + U32 const matchLowest = isDictionary ? lowestValid : withinWindow; + return matchLowest; +} + + /* debug functions */ #if (DEBUGLEVEL>=2) @@ -856,7 +952,7 @@ ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams( size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, const void* dict, size_t dictSize, const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, unsigned long long pledgedSrcSize); + const ZSTD_CCtx_params* params, unsigned long long pledgedSrcSize); void ZSTD_resetSeqStore(seqStore_t* ssPtr); @@ -871,7 +967,7 @@ size_t ZSTD_compressBegin_advanced_internal(ZSTD_CCtx* cctx, ZSTD_dictContentType_e dictContentType, ZSTD_dictTableLoadMethod_e dtlm, const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, + const ZSTD_CCtx_params* params, unsigned long long pledgedSrcSize); /* ZSTD_compress_advanced_internal() : @@ -880,7 +976,7 @@ size_t ZSTD_compress_advanced_internal(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, const void* dict,size_t dictSize, - ZSTD_CCtx_params params); + const ZSTD_CCtx_params* params); /* ZSTD_writeLastEmptyBlock() : diff --git a/thirdparty/zstd/compress/zstd_compress_literals.c b/thirdparty/zstd/compress/zstd_compress_literals.c new file mode 100644 index 0000000000..6c13331182 --- /dev/null +++ b/thirdparty/zstd/compress/zstd_compress_literals.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + /*-************************************* + * Dependencies + ***************************************/ +#include "zstd_compress_literals.h" + +size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void* src, size_t srcSize) +{ + BYTE* const ostart = (BYTE* const)dst; + U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); + + RETURN_ERROR_IF(srcSize + flSize > dstCapacity, dstSize_tooSmall); + + switch(flSize) + { + case 1: /* 2 - 1 - 5 */ + ostart[0] = (BYTE)((U32)set_basic + (srcSize<<3)); + break; + case 2: /* 2 - 2 - 12 */ + MEM_writeLE16(ostart, (U16)((U32)set_basic + (1<<2) + (srcSize<<4))); + break; + case 3: /* 2 - 2 - 20 */ + MEM_writeLE32(ostart, (U32)((U32)set_basic + (3<<2) + (srcSize<<4))); + break; + default: /* not necessary : flSize is {1,2,3} */ + assert(0); + } + + memcpy(ostart + flSize, src, srcSize); + return srcSize + flSize; +} + +size_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize) +{ + BYTE* const ostart = (BYTE* const)dst; + U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); + + (void)dstCapacity; /* dstCapacity already guaranteed to be >=4, hence large enough */ + + switch(flSize) + { + case 1: /* 2 - 1 - 5 */ + ostart[0] = (BYTE)((U32)set_rle + (srcSize<<3)); + break; + case 2: /* 2 - 2 - 12 */ + MEM_writeLE16(ostart, (U16)((U32)set_rle + (1<<2) + (srcSize<<4))); + break; + case 3: /* 2 - 2 - 20 */ + MEM_writeLE32(ostart, (U32)((U32)set_rle + (3<<2) + (srcSize<<4))); + break; + default: /* not necessary : flSize is {1,2,3} */ + assert(0); + } + + ostart[flSize] = *(const BYTE*)src; + return flSize+1; +} + +size_t ZSTD_compressLiterals (ZSTD_hufCTables_t const* prevHuf, + ZSTD_hufCTables_t* nextHuf, + ZSTD_strategy strategy, int disableLiteralCompression, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + void* entropyWorkspace, size_t entropyWorkspaceSize, + const int bmi2) +{ + size_t const minGain = ZSTD_minGain(srcSize, strategy); + size_t const lhSize = 3 + (srcSize >= 1 KB) + (srcSize >= 16 KB); + BYTE* const ostart = (BYTE*)dst; + U32 singleStream = srcSize < 256; + symbolEncodingType_e hType = set_compressed; + size_t cLitSize; + + DEBUGLOG(5,"ZSTD_compressLiterals (disableLiteralCompression=%i)", + disableLiteralCompression); + + /* Prepare nextEntropy assuming reusing the existing table */ + memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); + + if (disableLiteralCompression) + return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); + + /* small ? don't even attempt compression (speed opt) */ +# define COMPRESS_LITERALS_SIZE_MIN 63 + { size_t const minLitSize = (prevHuf->repeatMode == HUF_repeat_valid) ? 6 : COMPRESS_LITERALS_SIZE_MIN; + if (srcSize <= minLitSize) return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); + } + + RETURN_ERROR_IF(dstCapacity < lhSize+1, dstSize_tooSmall, "not enough space for compression"); + { HUF_repeat repeat = prevHuf->repeatMode; + int const preferRepeat = strategy < ZSTD_lazy ? srcSize <= 1024 : 0; + if (repeat == HUF_repeat_valid && lhSize == 3) singleStream = 1; + cLitSize = singleStream ? + HUF_compress1X_repeat( + ostart+lhSize, dstCapacity-lhSize, src, srcSize, + 255, 11, entropyWorkspace, entropyWorkspaceSize, + (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2) : + HUF_compress4X_repeat( + ostart+lhSize, dstCapacity-lhSize, src, srcSize, + 255, 11, entropyWorkspace, entropyWorkspaceSize, + (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2); + if (repeat != HUF_repeat_none) { + /* reused the existing table */ + hType = set_repeat; + } + } + + if ((cLitSize==0) | (cLitSize >= srcSize - minGain) | ERR_isError(cLitSize)) { + memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); + return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); + } + if (cLitSize==1) { + memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); + return ZSTD_compressRleLiteralsBlock(dst, dstCapacity, src, srcSize); + } + + if (hType == set_compressed) { + /* using a newly constructed table */ + nextHuf->repeatMode = HUF_repeat_check; + } + + /* Build header */ + switch(lhSize) + { + case 3: /* 2 - 2 - 10 - 10 */ + { U32 const lhc = hType + ((!singleStream) << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<14); + MEM_writeLE24(ostart, lhc); + break; + } + case 4: /* 2 - 2 - 14 - 14 */ + { U32 const lhc = hType + (2 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<18); + MEM_writeLE32(ostart, lhc); + break; + } + case 5: /* 2 - 2 - 18 - 18 */ + { U32 const lhc = hType + (3 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<22); + MEM_writeLE32(ostart, lhc); + ostart[4] = (BYTE)(cLitSize >> 10); + break; + } + default: /* not possible : lhSize is {3,4,5} */ + assert(0); + } + return lhSize+cLitSize; +} diff --git a/thirdparty/zstd/compress/zstd_compress_literals.h b/thirdparty/zstd/compress/zstd_compress_literals.h new file mode 100644 index 0000000000..97273d7cfd --- /dev/null +++ b/thirdparty/zstd/compress/zstd_compress_literals.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_COMPRESS_LITERALS_H +#define ZSTD_COMPRESS_LITERALS_H + +#include "zstd_compress_internal.h" /* ZSTD_hufCTables_t, ZSTD_minGain() */ + + +size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void* src, size_t srcSize); + +size_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize); + +size_t ZSTD_compressLiterals (ZSTD_hufCTables_t const* prevHuf, + ZSTD_hufCTables_t* nextHuf, + ZSTD_strategy strategy, int disableLiteralCompression, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + void* entropyWorkspace, size_t entropyWorkspaceSize, + const int bmi2); + +#endif /* ZSTD_COMPRESS_LITERALS_H */ diff --git a/thirdparty/zstd/compress/zstd_compress_sequences.c b/thirdparty/zstd/compress/zstd_compress_sequences.c new file mode 100644 index 0000000000..0ff7a26823 --- /dev/null +++ b/thirdparty/zstd/compress/zstd_compress_sequences.c @@ -0,0 +1,415 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + /*-************************************* + * Dependencies + ***************************************/ +#include "zstd_compress_sequences.h" + +/** + * -log2(x / 256) lookup table for x in [0, 256). + * If x == 0: Return 0 + * Else: Return floor(-log2(x / 256) * 256) + */ +static unsigned const kInverseProbabilityLog256[256] = { + 0, 2048, 1792, 1642, 1536, 1453, 1386, 1329, 1280, 1236, 1197, 1162, + 1130, 1100, 1073, 1047, 1024, 1001, 980, 960, 941, 923, 906, 889, + 874, 859, 844, 830, 817, 804, 791, 779, 768, 756, 745, 734, + 724, 714, 704, 694, 685, 676, 667, 658, 650, 642, 633, 626, + 618, 610, 603, 595, 588, 581, 574, 567, 561, 554, 548, 542, + 535, 529, 523, 517, 512, 506, 500, 495, 489, 484, 478, 473, + 468, 463, 458, 453, 448, 443, 438, 434, 429, 424, 420, 415, + 411, 407, 402, 398, 394, 390, 386, 382, 377, 373, 370, 366, + 362, 358, 354, 350, 347, 343, 339, 336, 332, 329, 325, 322, + 318, 315, 311, 308, 305, 302, 298, 295, 292, 289, 286, 282, + 279, 276, 273, 270, 267, 264, 261, 258, 256, 253, 250, 247, + 244, 241, 239, 236, 233, 230, 228, 225, 222, 220, 217, 215, + 212, 209, 207, 204, 202, 199, 197, 194, 192, 190, 187, 185, + 182, 180, 178, 175, 173, 171, 168, 166, 164, 162, 159, 157, + 155, 153, 151, 149, 146, 144, 142, 140, 138, 136, 134, 132, + 130, 128, 126, 123, 121, 119, 117, 115, 114, 112, 110, 108, + 106, 104, 102, 100, 98, 96, 94, 93, 91, 89, 87, 85, + 83, 82, 80, 78, 76, 74, 73, 71, 69, 67, 66, 64, + 62, 61, 59, 57, 55, 54, 52, 50, 49, 47, 46, 44, + 42, 41, 39, 37, 36, 34, 33, 31, 30, 28, 26, 25, + 23, 22, 20, 19, 17, 16, 14, 13, 11, 10, 8, 7, + 5, 4, 2, 1, +}; + +static unsigned ZSTD_getFSEMaxSymbolValue(FSE_CTable const* ctable) { + void const* ptr = ctable; + U16 const* u16ptr = (U16 const*)ptr; + U32 const maxSymbolValue = MEM_read16(u16ptr + 1); + return maxSymbolValue; +} + +/** + * Returns the cost in bytes of encoding the normalized count header. + * Returns an error if any of the helper functions return an error. + */ +static size_t ZSTD_NCountCost(unsigned const* count, unsigned const max, + size_t const nbSeq, unsigned const FSELog) +{ + BYTE wksp[FSE_NCOUNTBOUND]; + S16 norm[MaxSeq + 1]; + const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); + FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq, max)); + return FSE_writeNCount(wksp, sizeof(wksp), norm, max, tableLog); +} + +/** + * Returns the cost in bits of encoding the distribution described by count + * using the entropy bound. + */ +static size_t ZSTD_entropyCost(unsigned const* count, unsigned const max, size_t const total) +{ + unsigned cost = 0; + unsigned s; + for (s = 0; s <= max; ++s) { + unsigned norm = (unsigned)((256 * count[s]) / total); + if (count[s] != 0 && norm == 0) + norm = 1; + assert(count[s] < total); + cost += count[s] * kInverseProbabilityLog256[norm]; + } + return cost >> 8; +} + +/** + * Returns the cost in bits of encoding the distribution in count using ctable. + * Returns an error if ctable cannot represent all the symbols in count. + */ +static size_t ZSTD_fseBitCost( + FSE_CTable const* ctable, + unsigned const* count, + unsigned const max) +{ + unsigned const kAccuracyLog = 8; + size_t cost = 0; + unsigned s; + FSE_CState_t cstate; + FSE_initCState(&cstate, ctable); + RETURN_ERROR_IF(ZSTD_getFSEMaxSymbolValue(ctable) < max, GENERIC, + "Repeat FSE_CTable has maxSymbolValue %u < %u", + ZSTD_getFSEMaxSymbolValue(ctable), max); + for (s = 0; s <= max; ++s) { + unsigned const tableLog = cstate.stateLog; + unsigned const badCost = (tableLog + 1) << kAccuracyLog; + unsigned const bitCost = FSE_bitCost(cstate.symbolTT, tableLog, s, kAccuracyLog); + if (count[s] == 0) + continue; + RETURN_ERROR_IF(bitCost >= badCost, GENERIC, + "Repeat FSE_CTable has Prob[%u] == 0", s); + cost += count[s] * bitCost; + } + return cost >> kAccuracyLog; +} + +/** + * Returns the cost in bits of encoding the distribution in count using the + * table described by norm. The max symbol support by norm is assumed >= max. + * norm must be valid for every symbol with non-zero probability in count. + */ +static size_t ZSTD_crossEntropyCost(short const* norm, unsigned accuracyLog, + unsigned const* count, unsigned const max) +{ + unsigned const shift = 8 - accuracyLog; + size_t cost = 0; + unsigned s; + assert(accuracyLog <= 8); + for (s = 0; s <= max; ++s) { + unsigned const normAcc = norm[s] != -1 ? norm[s] : 1; + unsigned const norm256 = normAcc << shift; + assert(norm256 > 0); + assert(norm256 < 256); + cost += count[s] * kInverseProbabilityLog256[norm256]; + } + return cost >> 8; +} + +symbolEncodingType_e +ZSTD_selectEncodingType( + FSE_repeat* repeatMode, unsigned const* count, unsigned const max, + size_t const mostFrequent, size_t nbSeq, unsigned const FSELog, + FSE_CTable const* prevCTable, + short const* defaultNorm, U32 defaultNormLog, + ZSTD_defaultPolicy_e const isDefaultAllowed, + ZSTD_strategy const strategy) +{ + ZSTD_STATIC_ASSERT(ZSTD_defaultDisallowed == 0 && ZSTD_defaultAllowed != 0); + if (mostFrequent == nbSeq) { + *repeatMode = FSE_repeat_none; + if (isDefaultAllowed && nbSeq <= 2) { + /* Prefer set_basic over set_rle when there are 2 or less symbols, + * since RLE uses 1 byte, but set_basic uses 5-6 bits per symbol. + * If basic encoding isn't possible, always choose RLE. + */ + DEBUGLOG(5, "Selected set_basic"); + return set_basic; + } + DEBUGLOG(5, "Selected set_rle"); + return set_rle; + } + if (strategy < ZSTD_lazy) { + if (isDefaultAllowed) { + size_t const staticFse_nbSeq_max = 1000; + size_t const mult = 10 - strategy; + size_t const baseLog = 3; + size_t const dynamicFse_nbSeq_min = (((size_t)1 << defaultNormLog) * mult) >> baseLog; /* 28-36 for offset, 56-72 for lengths */ + assert(defaultNormLog >= 5 && defaultNormLog <= 6); /* xx_DEFAULTNORMLOG */ + assert(mult <= 9 && mult >= 7); + if ( (*repeatMode == FSE_repeat_valid) + && (nbSeq < staticFse_nbSeq_max) ) { + DEBUGLOG(5, "Selected set_repeat"); + return set_repeat; + } + if ( (nbSeq < dynamicFse_nbSeq_min) + || (mostFrequent < (nbSeq >> (defaultNormLog-1))) ) { + DEBUGLOG(5, "Selected set_basic"); + /* The format allows default tables to be repeated, but it isn't useful. + * When using simple heuristics to select encoding type, we don't want + * to confuse these tables with dictionaries. When running more careful + * analysis, we don't need to waste time checking both repeating tables + * and default tables. + */ + *repeatMode = FSE_repeat_none; + return set_basic; + } + } + } else { + size_t const basicCost = isDefaultAllowed ? ZSTD_crossEntropyCost(defaultNorm, defaultNormLog, count, max) : ERROR(GENERIC); + size_t const repeatCost = *repeatMode != FSE_repeat_none ? ZSTD_fseBitCost(prevCTable, count, max) : ERROR(GENERIC); + size_t const NCountCost = ZSTD_NCountCost(count, max, nbSeq, FSELog); + size_t const compressedCost = (NCountCost << 3) + ZSTD_entropyCost(count, max, nbSeq); + + if (isDefaultAllowed) { + assert(!ZSTD_isError(basicCost)); + assert(!(*repeatMode == FSE_repeat_valid && ZSTD_isError(repeatCost))); + } + assert(!ZSTD_isError(NCountCost)); + assert(compressedCost < ERROR(maxCode)); + DEBUGLOG(5, "Estimated bit costs: basic=%u\trepeat=%u\tcompressed=%u", + (unsigned)basicCost, (unsigned)repeatCost, (unsigned)compressedCost); + if (basicCost <= repeatCost && basicCost <= compressedCost) { + DEBUGLOG(5, "Selected set_basic"); + assert(isDefaultAllowed); + *repeatMode = FSE_repeat_none; + return set_basic; + } + if (repeatCost <= compressedCost) { + DEBUGLOG(5, "Selected set_repeat"); + assert(!ZSTD_isError(repeatCost)); + return set_repeat; + } + assert(compressedCost < basicCost && compressedCost < repeatCost); + } + DEBUGLOG(5, "Selected set_compressed"); + *repeatMode = FSE_repeat_check; + return set_compressed; +} + +size_t +ZSTD_buildCTable(void* dst, size_t dstCapacity, + FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type, + unsigned* count, U32 max, + const BYTE* codeTable, size_t nbSeq, + const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax, + const FSE_CTable* prevCTable, size_t prevCTableSize, + void* entropyWorkspace, size_t entropyWorkspaceSize) +{ + BYTE* op = (BYTE*)dst; + const BYTE* const oend = op + dstCapacity; + DEBUGLOG(6, "ZSTD_buildCTable (dstCapacity=%u)", (unsigned)dstCapacity); + + switch (type) { + case set_rle: + FORWARD_IF_ERROR(FSE_buildCTable_rle(nextCTable, (BYTE)max)); + RETURN_ERROR_IF(dstCapacity==0, dstSize_tooSmall); + *op = codeTable[0]; + return 1; + case set_repeat: + memcpy(nextCTable, prevCTable, prevCTableSize); + return 0; + case set_basic: + FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, defaultNorm, defaultMax, defaultNormLog, entropyWorkspace, entropyWorkspaceSize)); /* note : could be pre-calculated */ + return 0; + case set_compressed: { + S16 norm[MaxSeq + 1]; + size_t nbSeq_1 = nbSeq; + const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); + if (count[codeTable[nbSeq-1]] > 1) { + count[codeTable[nbSeq-1]]--; + nbSeq_1--; + } + assert(nbSeq_1 > 1); + FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max)); + { size_t const NCountSize = FSE_writeNCount(op, oend - op, norm, max, tableLog); /* overflow protected */ + FORWARD_IF_ERROR(NCountSize); + FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, norm, max, tableLog, entropyWorkspace, entropyWorkspaceSize)); + return NCountSize; + } + } + default: assert(0); RETURN_ERROR(GENERIC); + } +} + +FORCE_INLINE_TEMPLATE size_t +ZSTD_encodeSequences_body( + void* dst, size_t dstCapacity, + FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, + FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, + FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, + seqDef const* sequences, size_t nbSeq, int longOffsets) +{ + BIT_CStream_t blockStream; + FSE_CState_t stateMatchLength; + FSE_CState_t stateOffsetBits; + FSE_CState_t stateLitLength; + + RETURN_ERROR_IF( + ERR_isError(BIT_initCStream(&blockStream, dst, dstCapacity)), + dstSize_tooSmall, "not enough space remaining"); + DEBUGLOG(6, "available space for bitstream : %i (dstCapacity=%u)", + (int)(blockStream.endPtr - blockStream.startPtr), + (unsigned)dstCapacity); + + /* first symbols */ + FSE_initCState2(&stateMatchLength, CTable_MatchLength, mlCodeTable[nbSeq-1]); + FSE_initCState2(&stateOffsetBits, CTable_OffsetBits, ofCodeTable[nbSeq-1]); + FSE_initCState2(&stateLitLength, CTable_LitLength, llCodeTable[nbSeq-1]); + BIT_addBits(&blockStream, sequences[nbSeq-1].litLength, LL_bits[llCodeTable[nbSeq-1]]); + if (MEM_32bits()) BIT_flushBits(&blockStream); + BIT_addBits(&blockStream, sequences[nbSeq-1].matchLength, ML_bits[mlCodeTable[nbSeq-1]]); + if (MEM_32bits()) BIT_flushBits(&blockStream); + if (longOffsets) { + U32 const ofBits = ofCodeTable[nbSeq-1]; + int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); + if (extraBits) { + BIT_addBits(&blockStream, sequences[nbSeq-1].offset, extraBits); + BIT_flushBits(&blockStream); + } + BIT_addBits(&blockStream, sequences[nbSeq-1].offset >> extraBits, + ofBits - extraBits); + } else { + BIT_addBits(&blockStream, sequences[nbSeq-1].offset, ofCodeTable[nbSeq-1]); + } + BIT_flushBits(&blockStream); + + { size_t n; + for (n=nbSeq-2 ; n<nbSeq ; n--) { /* intentional underflow */ + BYTE const llCode = llCodeTable[n]; + BYTE const ofCode = ofCodeTable[n]; + BYTE const mlCode = mlCodeTable[n]; + U32 const llBits = LL_bits[llCode]; + U32 const ofBits = ofCode; + U32 const mlBits = ML_bits[mlCode]; + DEBUGLOG(6, "encoding: litlen:%2u - matchlen:%2u - offCode:%7u", + (unsigned)sequences[n].litLength, + (unsigned)sequences[n].matchLength + MINMATCH, + (unsigned)sequences[n].offset); + /* 32b*/ /* 64b*/ + /* (7)*/ /* (7)*/ + FSE_encodeSymbol(&blockStream, &stateOffsetBits, ofCode); /* 15 */ /* 15 */ + FSE_encodeSymbol(&blockStream, &stateMatchLength, mlCode); /* 24 */ /* 24 */ + if (MEM_32bits()) BIT_flushBits(&blockStream); /* (7)*/ + FSE_encodeSymbol(&blockStream, &stateLitLength, llCode); /* 16 */ /* 33 */ + if (MEM_32bits() || (ofBits+mlBits+llBits >= 64-7-(LLFSELog+MLFSELog+OffFSELog))) + BIT_flushBits(&blockStream); /* (7)*/ + BIT_addBits(&blockStream, sequences[n].litLength, llBits); + if (MEM_32bits() && ((llBits+mlBits)>24)) BIT_flushBits(&blockStream); + BIT_addBits(&blockStream, sequences[n].matchLength, mlBits); + if (MEM_32bits() || (ofBits+mlBits+llBits > 56)) BIT_flushBits(&blockStream); + if (longOffsets) { + int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); + if (extraBits) { + BIT_addBits(&blockStream, sequences[n].offset, extraBits); + BIT_flushBits(&blockStream); /* (7)*/ + } + BIT_addBits(&blockStream, sequences[n].offset >> extraBits, + ofBits - extraBits); /* 31 */ + } else { + BIT_addBits(&blockStream, sequences[n].offset, ofBits); /* 31 */ + } + BIT_flushBits(&blockStream); /* (7)*/ + DEBUGLOG(7, "remaining space : %i", (int)(blockStream.endPtr - blockStream.ptr)); + } } + + DEBUGLOG(6, "ZSTD_encodeSequences: flushing ML state with %u bits", stateMatchLength.stateLog); + FSE_flushCState(&blockStream, &stateMatchLength); + DEBUGLOG(6, "ZSTD_encodeSequences: flushing Off state with %u bits", stateOffsetBits.stateLog); + FSE_flushCState(&blockStream, &stateOffsetBits); + DEBUGLOG(6, "ZSTD_encodeSequences: flushing LL state with %u bits", stateLitLength.stateLog); + FSE_flushCState(&blockStream, &stateLitLength); + + { size_t const streamSize = BIT_closeCStream(&blockStream); + RETURN_ERROR_IF(streamSize==0, dstSize_tooSmall, "not enough space"); + return streamSize; + } +} + +static size_t +ZSTD_encodeSequences_default( + void* dst, size_t dstCapacity, + FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, + FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, + FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, + seqDef const* sequences, size_t nbSeq, int longOffsets) +{ + return ZSTD_encodeSequences_body(dst, dstCapacity, + CTable_MatchLength, mlCodeTable, + CTable_OffsetBits, ofCodeTable, + CTable_LitLength, llCodeTable, + sequences, nbSeq, longOffsets); +} + + +#if DYNAMIC_BMI2 + +static TARGET_ATTRIBUTE("bmi2") size_t +ZSTD_encodeSequences_bmi2( + void* dst, size_t dstCapacity, + FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, + FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, + FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, + seqDef const* sequences, size_t nbSeq, int longOffsets) +{ + return ZSTD_encodeSequences_body(dst, dstCapacity, + CTable_MatchLength, mlCodeTable, + CTable_OffsetBits, ofCodeTable, + CTable_LitLength, llCodeTable, + sequences, nbSeq, longOffsets); +} + +#endif + +size_t ZSTD_encodeSequences( + void* dst, size_t dstCapacity, + FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, + FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, + FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, + seqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2) +{ + DEBUGLOG(5, "ZSTD_encodeSequences: dstCapacity = %u", (unsigned)dstCapacity); +#if DYNAMIC_BMI2 + if (bmi2) { + return ZSTD_encodeSequences_bmi2(dst, dstCapacity, + CTable_MatchLength, mlCodeTable, + CTable_OffsetBits, ofCodeTable, + CTable_LitLength, llCodeTable, + sequences, nbSeq, longOffsets); + } +#endif + (void)bmi2; + return ZSTD_encodeSequences_default(dst, dstCapacity, + CTable_MatchLength, mlCodeTable, + CTable_OffsetBits, ofCodeTable, + CTable_LitLength, llCodeTable, + sequences, nbSeq, longOffsets); +} diff --git a/thirdparty/zstd/compress/zstd_compress_sequences.h b/thirdparty/zstd/compress/zstd_compress_sequences.h new file mode 100644 index 0000000000..57e8e367b0 --- /dev/null +++ b/thirdparty/zstd/compress/zstd_compress_sequences.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_COMPRESS_SEQUENCES_H +#define ZSTD_COMPRESS_SEQUENCES_H + +#include "fse.h" /* FSE_repeat, FSE_CTable */ +#include "zstd_internal.h" /* symbolEncodingType_e, ZSTD_strategy */ + +typedef enum { + ZSTD_defaultDisallowed = 0, + ZSTD_defaultAllowed = 1 +} ZSTD_defaultPolicy_e; + +symbolEncodingType_e +ZSTD_selectEncodingType( + FSE_repeat* repeatMode, unsigned const* count, unsigned const max, + size_t const mostFrequent, size_t nbSeq, unsigned const FSELog, + FSE_CTable const* prevCTable, + short const* defaultNorm, U32 defaultNormLog, + ZSTD_defaultPolicy_e const isDefaultAllowed, + ZSTD_strategy const strategy); + +size_t +ZSTD_buildCTable(void* dst, size_t dstCapacity, + FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type, + unsigned* count, U32 max, + const BYTE* codeTable, size_t nbSeq, + const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax, + const FSE_CTable* prevCTable, size_t prevCTableSize, + void* entropyWorkspace, size_t entropyWorkspaceSize); + +size_t ZSTD_encodeSequences( + void* dst, size_t dstCapacity, + FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, + FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, + FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, + seqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2); + +#endif /* ZSTD_COMPRESS_SEQUENCES_H */ diff --git a/thirdparty/zstd/compress/zstd_cwksp.h b/thirdparty/zstd/compress/zstd_cwksp.h new file mode 100644 index 0000000000..fc9765bd3f --- /dev/null +++ b/thirdparty/zstd/compress/zstd_cwksp.h @@ -0,0 +1,535 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_CWKSP_H +#define ZSTD_CWKSP_H + +/*-************************************* +* Dependencies +***************************************/ +#include "zstd_internal.h" + +#if defined (__cplusplus) +extern "C" { +#endif + +/*-************************************* +* Constants +***************************************/ + +/* define "workspace is too large" as this number of times larger than needed */ +#define ZSTD_WORKSPACETOOLARGE_FACTOR 3 + +/* when workspace is continuously too large + * during at least this number of times, + * context's memory usage is considered wasteful, + * because it's sized to handle a worst case scenario which rarely happens. + * In which case, resize it down to free some memory */ +#define ZSTD_WORKSPACETOOLARGE_MAXDURATION 128 + +/* Since the workspace is effectively its own little malloc implementation / + * arena, when we run under ASAN, we should similarly insert redzones between + * each internal element of the workspace, so ASAN will catch overruns that + * reach outside an object but that stay inside the workspace. + * + * This defines the size of that redzone. + */ +#ifndef ZSTD_CWKSP_ASAN_REDZONE_SIZE +#define ZSTD_CWKSP_ASAN_REDZONE_SIZE 128 +#endif + +/*-************************************* +* Structures +***************************************/ +typedef enum { + ZSTD_cwksp_alloc_objects, + ZSTD_cwksp_alloc_buffers, + ZSTD_cwksp_alloc_aligned +} ZSTD_cwksp_alloc_phase_e; + +/** + * Zstd fits all its internal datastructures into a single continuous buffer, + * so that it only needs to perform a single OS allocation (or so that a buffer + * can be provided to it and it can perform no allocations at all). This buffer + * is called the workspace. + * + * Several optimizations complicate that process of allocating memory ranges + * from this workspace for each internal datastructure: + * + * - These different internal datastructures have different setup requirements: + * + * - The static objects need to be cleared once and can then be trivially + * reused for each compression. + * + * - Various buffers don't need to be initialized at all--they are always + * written into before they're read. + * + * - The matchstate tables have a unique requirement that they don't need + * their memory to be totally cleared, but they do need the memory to have + * some bound, i.e., a guarantee that all values in the memory they've been + * allocated is less than some maximum value (which is the starting value + * for the indices that they will then use for compression). When this + * guarantee is provided to them, they can use the memory without any setup + * work. When it can't, they have to clear the area. + * + * - These buffers also have different alignment requirements. + * + * - We would like to reuse the objects in the workspace for multiple + * compressions without having to perform any expensive reallocation or + * reinitialization work. + * + * - We would like to be able to efficiently reuse the workspace across + * multiple compressions **even when the compression parameters change** and + * we need to resize some of the objects (where possible). + * + * To attempt to manage this buffer, given these constraints, the ZSTD_cwksp + * abstraction was created. It works as follows: + * + * Workspace Layout: + * + * [ ... workspace ... ] + * [objects][tables ... ->] free space [<- ... aligned][<- ... buffers] + * + * The various objects that live in the workspace are divided into the + * following categories, and are allocated separately: + * + * - Static objects: this is optionally the enclosing ZSTD_CCtx or ZSTD_CDict, + * so that literally everything fits in a single buffer. Note: if present, + * this must be the first object in the workspace, since ZSTD_free{CCtx, + * CDict}() rely on a pointer comparison to see whether one or two frees are + * required. + * + * - Fixed size objects: these are fixed-size, fixed-count objects that are + * nonetheless "dynamically" allocated in the workspace so that we can + * control how they're initialized separately from the broader ZSTD_CCtx. + * Examples: + * - Entropy Workspace + * - 2 x ZSTD_compressedBlockState_t + * - CDict dictionary contents + * + * - Tables: these are any of several different datastructures (hash tables, + * chain tables, binary trees) that all respect a common format: they are + * uint32_t arrays, all of whose values are between 0 and (nextSrc - base). + * Their sizes depend on the cparams. + * + * - Aligned: these buffers are used for various purposes that require 4 byte + * alignment, but don't require any initialization before they're used. + * + * - Buffers: these buffers are used for various purposes that don't require + * any alignment or initialization before they're used. This means they can + * be moved around at no cost for a new compression. + * + * Allocating Memory: + * + * The various types of objects must be allocated in order, so they can be + * correctly packed into the workspace buffer. That order is: + * + * 1. Objects + * 2. Buffers + * 3. Aligned + * 4. Tables + * + * Attempts to reserve objects of different types out of order will fail. + */ +typedef struct { + void* workspace; + void* workspaceEnd; + + void* objectEnd; + void* tableEnd; + void* tableValidEnd; + void* allocStart; + + int allocFailed; + int workspaceOversizedDuration; + ZSTD_cwksp_alloc_phase_e phase; +} ZSTD_cwksp; + +/*-************************************* +* Functions +***************************************/ + +MEM_STATIC size_t ZSTD_cwksp_available_space(ZSTD_cwksp* ws); + +MEM_STATIC void ZSTD_cwksp_assert_internal_consistency(ZSTD_cwksp* ws) { + (void)ws; + assert(ws->workspace <= ws->objectEnd); + assert(ws->objectEnd <= ws->tableEnd); + assert(ws->objectEnd <= ws->tableValidEnd); + assert(ws->tableEnd <= ws->allocStart); + assert(ws->tableValidEnd <= ws->allocStart); + assert(ws->allocStart <= ws->workspaceEnd); +} + +/** + * Align must be a power of 2. + */ +MEM_STATIC size_t ZSTD_cwksp_align(size_t size, size_t const align) { + size_t const mask = align - 1; + assert((align & mask) == 0); + return (size + mask) & ~mask; +} + +/** + * Use this to determine how much space in the workspace we will consume to + * allocate this object. (Normally it should be exactly the size of the object, + * but under special conditions, like ASAN, where we pad each object, it might + * be larger.) + * + * Since tables aren't currently redzoned, you don't need to call through this + * to figure out how much space you need for the matchState tables. Everything + * else is though. + */ +MEM_STATIC size_t ZSTD_cwksp_alloc_size(size_t size) { +#if defined (ADDRESS_SANITIZER) && !defined (ZSTD_ASAN_DONT_POISON_WORKSPACE) + return size + 2 * ZSTD_CWKSP_ASAN_REDZONE_SIZE; +#else + return size; +#endif +} + +MEM_STATIC void ZSTD_cwksp_internal_advance_phase( + ZSTD_cwksp* ws, ZSTD_cwksp_alloc_phase_e phase) { + assert(phase >= ws->phase); + if (phase > ws->phase) { + if (ws->phase < ZSTD_cwksp_alloc_buffers && + phase >= ZSTD_cwksp_alloc_buffers) { + ws->tableValidEnd = ws->objectEnd; + } + if (ws->phase < ZSTD_cwksp_alloc_aligned && + phase >= ZSTD_cwksp_alloc_aligned) { + /* If unaligned allocations down from a too-large top have left us + * unaligned, we need to realign our alloc ptr. Technically, this + * can consume space that is unaccounted for in the neededSpace + * calculation. However, I believe this can only happen when the + * workspace is too large, and specifically when it is too large + * by a larger margin than the space that will be consumed. */ + /* TODO: cleaner, compiler warning friendly way to do this??? */ + ws->allocStart = (BYTE*)ws->allocStart - ((size_t)ws->allocStart & (sizeof(U32)-1)); + if (ws->allocStart < ws->tableValidEnd) { + ws->tableValidEnd = ws->allocStart; + } + } + ws->phase = phase; + } +} + +/** + * Returns whether this object/buffer/etc was allocated in this workspace. + */ +MEM_STATIC int ZSTD_cwksp_owns_buffer(const ZSTD_cwksp* ws, const void* ptr) { + return (ptr != NULL) && (ws->workspace <= ptr) && (ptr <= ws->workspaceEnd); +} + +/** + * Internal function. Do not use directly. + */ +MEM_STATIC void* ZSTD_cwksp_reserve_internal( + ZSTD_cwksp* ws, size_t bytes, ZSTD_cwksp_alloc_phase_e phase) { + void* alloc; + void* bottom = ws->tableEnd; + ZSTD_cwksp_internal_advance_phase(ws, phase); + alloc = (BYTE *)ws->allocStart - bytes; + +#if defined (ADDRESS_SANITIZER) && !defined (ZSTD_ASAN_DONT_POISON_WORKSPACE) + /* over-reserve space */ + alloc = (BYTE *)alloc - 2 * ZSTD_CWKSP_ASAN_REDZONE_SIZE; +#endif + + DEBUGLOG(5, "cwksp: reserving %p %zd bytes, %zd bytes remaining", + alloc, bytes, ZSTD_cwksp_available_space(ws) - bytes); + ZSTD_cwksp_assert_internal_consistency(ws); + assert(alloc >= bottom); + if (alloc < bottom) { + DEBUGLOG(4, "cwksp: alloc failed!"); + ws->allocFailed = 1; + return NULL; + } + if (alloc < ws->tableValidEnd) { + ws->tableValidEnd = alloc; + } + ws->allocStart = alloc; + +#if defined (ADDRESS_SANITIZER) && !defined (ZSTD_ASAN_DONT_POISON_WORKSPACE) + /* Move alloc so there's ZSTD_CWKSP_ASAN_REDZONE_SIZE unused space on + * either size. */ + alloc = (BYTE *)alloc + ZSTD_CWKSP_ASAN_REDZONE_SIZE; + __asan_unpoison_memory_region(alloc, bytes); +#endif + + return alloc; +} + +/** + * Reserves and returns unaligned memory. + */ +MEM_STATIC BYTE* ZSTD_cwksp_reserve_buffer(ZSTD_cwksp* ws, size_t bytes) { + return (BYTE*)ZSTD_cwksp_reserve_internal(ws, bytes, ZSTD_cwksp_alloc_buffers); +} + +/** + * Reserves and returns memory sized on and aligned on sizeof(unsigned). + */ +MEM_STATIC void* ZSTD_cwksp_reserve_aligned(ZSTD_cwksp* ws, size_t bytes) { + assert((bytes & (sizeof(U32)-1)) == 0); + return ZSTD_cwksp_reserve_internal(ws, ZSTD_cwksp_align(bytes, sizeof(U32)), ZSTD_cwksp_alloc_aligned); +} + +/** + * Aligned on sizeof(unsigned). These buffers have the special property that + * their values remain constrained, allowing us to re-use them without + * memset()-ing them. + */ +MEM_STATIC void* ZSTD_cwksp_reserve_table(ZSTD_cwksp* ws, size_t bytes) { + const ZSTD_cwksp_alloc_phase_e phase = ZSTD_cwksp_alloc_aligned; + void* alloc = ws->tableEnd; + void* end = (BYTE *)alloc + bytes; + void* top = ws->allocStart; + + DEBUGLOG(5, "cwksp: reserving %p table %zd bytes, %zd bytes remaining", + alloc, bytes, ZSTD_cwksp_available_space(ws) - bytes); + assert((bytes & (sizeof(U32)-1)) == 0); + ZSTD_cwksp_internal_advance_phase(ws, phase); + ZSTD_cwksp_assert_internal_consistency(ws); + assert(end <= top); + if (end > top) { + DEBUGLOG(4, "cwksp: table alloc failed!"); + ws->allocFailed = 1; + return NULL; + } + ws->tableEnd = end; + +#if defined (ADDRESS_SANITIZER) && !defined (ZSTD_ASAN_DONT_POISON_WORKSPACE) + __asan_unpoison_memory_region(alloc, bytes); +#endif + + return alloc; +} + +/** + * Aligned on sizeof(void*). + */ +MEM_STATIC void* ZSTD_cwksp_reserve_object(ZSTD_cwksp* ws, size_t bytes) { + size_t roundedBytes = ZSTD_cwksp_align(bytes, sizeof(void*)); + void* alloc = ws->objectEnd; + void* end = (BYTE*)alloc + roundedBytes; + +#if defined (ADDRESS_SANITIZER) && !defined (ZSTD_ASAN_DONT_POISON_WORKSPACE) + /* over-reserve space */ + end = (BYTE *)end + 2 * ZSTD_CWKSP_ASAN_REDZONE_SIZE; +#endif + + DEBUGLOG(5, + "cwksp: reserving %p object %zd bytes (rounded to %zd), %zd bytes remaining", + alloc, bytes, roundedBytes, ZSTD_cwksp_available_space(ws) - roundedBytes); + assert(((size_t)alloc & (sizeof(void*)-1)) == 0); + assert((bytes & (sizeof(void*)-1)) == 0); + ZSTD_cwksp_assert_internal_consistency(ws); + /* we must be in the first phase, no advance is possible */ + if (ws->phase != ZSTD_cwksp_alloc_objects || end > ws->workspaceEnd) { + DEBUGLOG(4, "cwksp: object alloc failed!"); + ws->allocFailed = 1; + return NULL; + } + ws->objectEnd = end; + ws->tableEnd = end; + ws->tableValidEnd = end; + +#if defined (ADDRESS_SANITIZER) && !defined (ZSTD_ASAN_DONT_POISON_WORKSPACE) + /* Move alloc so there's ZSTD_CWKSP_ASAN_REDZONE_SIZE unused space on + * either size. */ + alloc = (BYTE *)alloc + ZSTD_CWKSP_ASAN_REDZONE_SIZE; + __asan_unpoison_memory_region(alloc, bytes); +#endif + + return alloc; +} + +MEM_STATIC void ZSTD_cwksp_mark_tables_dirty(ZSTD_cwksp* ws) { + DEBUGLOG(4, "cwksp: ZSTD_cwksp_mark_tables_dirty"); + +#if defined (MEMORY_SANITIZER) && !defined (ZSTD_MSAN_DONT_POISON_WORKSPACE) + /* To validate that the table re-use logic is sound, and that we don't + * access table space that we haven't cleaned, we re-"poison" the table + * space every time we mark it dirty. */ + { + size_t size = (BYTE*)ws->tableValidEnd - (BYTE*)ws->objectEnd; + assert(__msan_test_shadow(ws->objectEnd, size) == -1); + __msan_poison(ws->objectEnd, size); + } +#endif + + assert(ws->tableValidEnd >= ws->objectEnd); + assert(ws->tableValidEnd <= ws->allocStart); + ws->tableValidEnd = ws->objectEnd; + ZSTD_cwksp_assert_internal_consistency(ws); +} + +MEM_STATIC void ZSTD_cwksp_mark_tables_clean(ZSTD_cwksp* ws) { + DEBUGLOG(4, "cwksp: ZSTD_cwksp_mark_tables_clean"); + assert(ws->tableValidEnd >= ws->objectEnd); + assert(ws->tableValidEnd <= ws->allocStart); + if (ws->tableValidEnd < ws->tableEnd) { + ws->tableValidEnd = ws->tableEnd; + } + ZSTD_cwksp_assert_internal_consistency(ws); +} + +/** + * Zero the part of the allocated tables not already marked clean. + */ +MEM_STATIC void ZSTD_cwksp_clean_tables(ZSTD_cwksp* ws) { + DEBUGLOG(4, "cwksp: ZSTD_cwksp_clean_tables"); + assert(ws->tableValidEnd >= ws->objectEnd); + assert(ws->tableValidEnd <= ws->allocStart); + if (ws->tableValidEnd < ws->tableEnd) { + memset(ws->tableValidEnd, 0, (BYTE*)ws->tableEnd - (BYTE*)ws->tableValidEnd); + } + ZSTD_cwksp_mark_tables_clean(ws); +} + +/** + * Invalidates table allocations. + * All other allocations remain valid. + */ +MEM_STATIC void ZSTD_cwksp_clear_tables(ZSTD_cwksp* ws) { + DEBUGLOG(4, "cwksp: clearing tables!"); + +#if defined (ADDRESS_SANITIZER) && !defined (ZSTD_ASAN_DONT_POISON_WORKSPACE) + { + size_t size = (BYTE*)ws->tableValidEnd - (BYTE*)ws->objectEnd; + __asan_poison_memory_region(ws->objectEnd, size); + } +#endif + + ws->tableEnd = ws->objectEnd; + ZSTD_cwksp_assert_internal_consistency(ws); +} + +/** + * Invalidates all buffer, aligned, and table allocations. + * Object allocations remain valid. + */ +MEM_STATIC void ZSTD_cwksp_clear(ZSTD_cwksp* ws) { + DEBUGLOG(4, "cwksp: clearing!"); + +#if defined (MEMORY_SANITIZER) && !defined (ZSTD_MSAN_DONT_POISON_WORKSPACE) + /* To validate that the context re-use logic is sound, and that we don't + * access stuff that this compression hasn't initialized, we re-"poison" + * the workspace (or at least the non-static, non-table parts of it) + * every time we start a new compression. */ + { + size_t size = (BYTE*)ws->workspaceEnd - (BYTE*)ws->tableValidEnd; + __msan_poison(ws->tableValidEnd, size); + } +#endif + +#if defined (ADDRESS_SANITIZER) && !defined (ZSTD_ASAN_DONT_POISON_WORKSPACE) + { + size_t size = (BYTE*)ws->workspaceEnd - (BYTE*)ws->objectEnd; + __asan_poison_memory_region(ws->objectEnd, size); + } +#endif + + ws->tableEnd = ws->objectEnd; + ws->allocStart = ws->workspaceEnd; + ws->allocFailed = 0; + if (ws->phase > ZSTD_cwksp_alloc_buffers) { + ws->phase = ZSTD_cwksp_alloc_buffers; + } + ZSTD_cwksp_assert_internal_consistency(ws); +} + +/** + * The provided workspace takes ownership of the buffer [start, start+size). + * Any existing values in the workspace are ignored (the previously managed + * buffer, if present, must be separately freed). + */ +MEM_STATIC void ZSTD_cwksp_init(ZSTD_cwksp* ws, void* start, size_t size) { + DEBUGLOG(4, "cwksp: init'ing workspace with %zd bytes", size); + assert(((size_t)start & (sizeof(void*)-1)) == 0); /* ensure correct alignment */ + ws->workspace = start; + ws->workspaceEnd = (BYTE*)start + size; + ws->objectEnd = ws->workspace; + ws->tableValidEnd = ws->objectEnd; + ws->phase = ZSTD_cwksp_alloc_objects; + ZSTD_cwksp_clear(ws); + ws->workspaceOversizedDuration = 0; + ZSTD_cwksp_assert_internal_consistency(ws); +} + +MEM_STATIC size_t ZSTD_cwksp_create(ZSTD_cwksp* ws, size_t size, ZSTD_customMem customMem) { + void* workspace = ZSTD_malloc(size, customMem); + DEBUGLOG(4, "cwksp: creating new workspace with %zd bytes", size); + RETURN_ERROR_IF(workspace == NULL, memory_allocation); + ZSTD_cwksp_init(ws, workspace, size); + return 0; +} + +MEM_STATIC void ZSTD_cwksp_free(ZSTD_cwksp* ws, ZSTD_customMem customMem) { + void *ptr = ws->workspace; + DEBUGLOG(4, "cwksp: freeing workspace"); + memset(ws, 0, sizeof(ZSTD_cwksp)); + ZSTD_free(ptr, customMem); +} + +/** + * Moves the management of a workspace from one cwksp to another. The src cwksp + * is left in an invalid state (src must be re-init()'ed before its used again). + */ +MEM_STATIC void ZSTD_cwksp_move(ZSTD_cwksp* dst, ZSTD_cwksp* src) { + *dst = *src; + memset(src, 0, sizeof(ZSTD_cwksp)); +} + +MEM_STATIC size_t ZSTD_cwksp_sizeof(const ZSTD_cwksp* ws) { + return (size_t)((BYTE*)ws->workspaceEnd - (BYTE*)ws->workspace); +} + +MEM_STATIC int ZSTD_cwksp_reserve_failed(const ZSTD_cwksp* ws) { + return ws->allocFailed; +} + +/*-************************************* +* Functions Checking Free Space +***************************************/ + +MEM_STATIC size_t ZSTD_cwksp_available_space(ZSTD_cwksp* ws) { + return (size_t)((BYTE*)ws->allocStart - (BYTE*)ws->tableEnd); +} + +MEM_STATIC int ZSTD_cwksp_check_available(ZSTD_cwksp* ws, size_t additionalNeededSpace) { + return ZSTD_cwksp_available_space(ws) >= additionalNeededSpace; +} + +MEM_STATIC int ZSTD_cwksp_check_too_large(ZSTD_cwksp* ws, size_t additionalNeededSpace) { + return ZSTD_cwksp_check_available( + ws, additionalNeededSpace * ZSTD_WORKSPACETOOLARGE_FACTOR); +} + +MEM_STATIC int ZSTD_cwksp_check_wasteful(ZSTD_cwksp* ws, size_t additionalNeededSpace) { + return ZSTD_cwksp_check_too_large(ws, additionalNeededSpace) + && ws->workspaceOversizedDuration > ZSTD_WORKSPACETOOLARGE_MAXDURATION; +} + +MEM_STATIC void ZSTD_cwksp_bump_oversized_duration( + ZSTD_cwksp* ws, size_t additionalNeededSpace) { + if (ZSTD_cwksp_check_too_large(ws, additionalNeededSpace)) { + ws->workspaceOversizedDuration++; + } else { + ws->workspaceOversizedDuration = 0; + } +} + +#if defined (__cplusplus) +} +#endif + +#endif /* ZSTD_CWKSP_H */ diff --git a/thirdparty/zstd/compress/zstd_double_fast.c b/thirdparty/zstd/compress/zstd_double_fast.c index 5957255d90..a661a48534 100644 --- a/thirdparty/zstd/compress/zstd_double_fast.c +++ b/thirdparty/zstd/compress/zstd_double_fast.c @@ -65,6 +65,7 @@ size_t ZSTD_compressBlock_doubleFast_generic( const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); const U32 lowestValid = ms->window.dictLimit; const U32 maxDistance = 1U << cParams->windowLog; + /* presumes that, if there is a dictionary, it must be using Attach mode */ const U32 prefixLowestIndex = (endIndex - lowestValid > maxDistance) ? endIndex - maxDistance : lowestValid; const BYTE* const prefixLowest = base + prefixLowestIndex; const BYTE* const iend = istart + srcSize; @@ -147,7 +148,7 @@ size_t ZSTD_compressBlock_doubleFast_generic( const BYTE* repMatchEnd = repIndex < prefixLowestIndex ? dictEnd : iend; mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, prefixLowest) + 4; ip++; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, 0, mLength-MINMATCH); goto _match_stored; } @@ -156,7 +157,7 @@ size_t ZSTD_compressBlock_doubleFast_generic( && ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1)))) { mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4; ip++; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, 0, mLength-MINMATCH); goto _match_stored; } @@ -246,7 +247,7 @@ _match_found: offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, offset + ZSTD_REP_MOVE, mLength-MINMATCH); _match_stored: /* match found */ @@ -277,7 +278,7 @@ _match_stored: const BYTE* const repEnd2 = repIndex2 < prefixLowestIndex ? dictEnd : iend; size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, prefixLowest) + 4; U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */ - ZSTD_storeSeq(seqStore, 0, anchor, 0, repLength2-MINMATCH); + ZSTD_storeSeq(seqStore, 0, anchor, iend, 0, repLength2-MINMATCH); hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = current2; hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = current2; ip += repLength2; @@ -296,7 +297,7 @@ _match_stored: U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; /* swap offset_2 <=> offset_1 */ hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip-base); hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip-base); - ZSTD_storeSeq(seqStore, 0, anchor, 0, rLength-MINMATCH); + ZSTD_storeSeq(seqStore, 0, anchor, iend, 0, rLength-MINMATCH); ip += rLength; anchor = ip; continue; /* faster when present ... (?) */ @@ -369,9 +370,7 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( const BYTE* const ilimit = iend - 8; const BYTE* const base = ms->window.base; const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); - const U32 maxDistance = 1U << cParams->windowLog; - const U32 lowestValid = ms->window.lowLimit; - const U32 lowLimit = (endIndex - lowestValid > maxDistance) ? endIndex - maxDistance : lowestValid; + const U32 lowLimit = ZSTD_getLowestMatchIndex(ms, endIndex, cParams->windowLog); const U32 dictStartIndex = lowLimit; const U32 dictLimit = ms->window.dictLimit; const U32 prefixStartIndex = (dictLimit > lowLimit) ? dictLimit : lowLimit; @@ -412,7 +411,7 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( const BYTE* repMatchEnd = repIndex < prefixStartIndex ? dictEnd : iend; mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, prefixStart) + 4; ip++; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, 0, mLength-MINMATCH); } else { if ((matchLongIndex > dictStartIndex) && (MEM_read64(matchLong) == MEM_read64(ip))) { const BYTE* const matchEnd = matchLongIndex < prefixStartIndex ? dictEnd : iend; @@ -423,7 +422,7 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( while (((ip>anchor) & (matchLong>lowMatchPtr)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */ offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, offset + ZSTD_REP_MOVE, mLength-MINMATCH); } else if ((matchIndex > dictStartIndex) && (MEM_read32(match) == MEM_read32(ip))) { size_t const h3 = ZSTD_hashPtr(ip+1, hBitsL, 8); @@ -448,7 +447,7 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( } offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, offset + ZSTD_REP_MOVE, mLength-MINMATCH); } else { ip += ((ip-anchor) >> kSearchStrength) + 1; @@ -480,7 +479,7 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( const BYTE* const repEnd2 = repIndex2 < prefixStartIndex ? dictEnd : iend; size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, prefixStart) + 4; U32 const tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */ - ZSTD_storeSeq(seqStore, 0, anchor, 0, repLength2-MINMATCH); + ZSTD_storeSeq(seqStore, 0, anchor, iend, 0, repLength2-MINMATCH); hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = current2; hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = current2; ip += repLength2; diff --git a/thirdparty/zstd/compress/zstd_fast.c b/thirdparty/zstd/compress/zstd_fast.c index a05b8a47f1..6dbefee6b7 100644 --- a/thirdparty/zstd/compress/zstd_fast.c +++ b/thirdparty/zstd/compress/zstd_fast.c @@ -8,7 +8,7 @@ * You may select, at your option, one of the above-listed licenses. */ -#include "zstd_compress_internal.h" +#include "zstd_compress_internal.h" /* ZSTD_hashPtr, ZSTD_count, ZSTD_storeSeq */ #include "zstd_fast.h" @@ -43,8 +43,8 @@ void ZSTD_fillHashTable(ZSTD_matchState_t* ms, } -FORCE_INLINE_TEMPLATE -size_t ZSTD_compressBlock_fast_generic( +FORCE_INLINE_TEMPLATE size_t +ZSTD_compressBlock_fast_generic( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize, U32 const mls) @@ -71,10 +71,10 @@ size_t ZSTD_compressBlock_fast_generic( U32 offsetSaved = 0; /* init */ + DEBUGLOG(5, "ZSTD_compressBlock_fast_generic"); ip0 += (ip0 == prefixStart); ip1 = ip0 + 1; - { - U32 const maxRep = (U32)(ip0 - prefixStart); + { U32 const maxRep = (U32)(ip0 - prefixStart); if (offset_2 > maxRep) offsetSaved = offset_2, offset_2 = 0; if (offset_1 > maxRep) offsetSaved = offset_1, offset_1 = 0; } @@ -117,8 +117,7 @@ size_t ZSTD_compressBlock_fast_generic( match0 = match1; goto _offset; } - { - size_t const step = ((ip0-anchor) >> (kSearchStrength - 1)) + stepSize; + { size_t const step = ((size_t)(ip0-anchor) >> (kSearchStrength - 1)) + stepSize; assert(step >= 2); ip0 += step; ip1 += step; @@ -137,7 +136,7 @@ _offset: /* Requires: ip0, match0 */ _match: /* Requires: ip0, match0, offcode */ /* Count the forward length */ mLength += ZSTD_count(ip0+mLength+4, match0+mLength+4, iend) + 4; - ZSTD_storeSeq(seqStore, ip0-anchor, anchor, offcode, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip0-anchor), anchor, iend, offcode, mLength-MINMATCH); /* match found */ ip0 += mLength; anchor = ip0; @@ -149,16 +148,15 @@ _match: /* Requires: ip0, match0, offcode */ hashTable[ZSTD_hashPtr(base+current0+2, hlog, mls)] = current0+2; /* here because current+2 could be > iend-8 */ hashTable[ZSTD_hashPtr(ip0-2, hlog, mls)] = (U32)(ip0-2-base); - while ( (ip0 <= ilimit) - && ( (offset_2>0) - & (MEM_read32(ip0) == MEM_read32(ip0 - offset_2)) )) { + while ( ((ip0 <= ilimit) & (offset_2>0)) /* offset_2==0 means offset_2 is invalidated */ + && (MEM_read32(ip0) == MEM_read32(ip0 - offset_2)) ) { /* store sequence */ size_t const rLength = ZSTD_count(ip0+4, ip0+4-offset_2, iend) + 4; - U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; /* swap offset_2 <=> offset_1 */ + { U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */ hashTable[ZSTD_hashPtr(ip0, hlog, mls)] = (U32)(ip0-base); ip0 += rLength; ip1 = ip0 + 1; - ZSTD_storeSeq(seqStore, 0, anchor, 0, rLength-MINMATCH); + ZSTD_storeSeq(seqStore, 0 /*litLen*/, anchor, iend, 0 /*offCode*/, rLength-MINMATCH); anchor = ip0; continue; /* faster when present (confirmed on gcc-8) ... (?) */ } @@ -178,8 +176,7 @@ size_t ZSTD_compressBlock_fast( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - ZSTD_compressionParameters const* cParams = &ms->cParams; - U32 const mls = cParams->minMatch; + U32 const mls = ms->cParams.minMatch; assert(ms->dictMatchState == NULL); switch(mls) { @@ -239,6 +236,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( assert(prefixStartIndex >= (U32)(dictEnd - dictBase)); /* init */ + DEBUGLOG(5, "ZSTD_compressBlock_fast_dictMatchState_generic"); ip += (dictAndPrefixLength == 0); /* dictMatchState repCode checks don't currently handle repCode == 0 * disabling. */ @@ -263,7 +261,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( const BYTE* const repMatchEnd = repIndex < prefixStartIndex ? dictEnd : iend; mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, prefixStart) + 4; ip++; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, 0, mLength-MINMATCH); } else if ( (matchIndex <= prefixStartIndex) ) { size_t const dictHash = ZSTD_hashPtr(ip, dictHLog, mls); U32 const dictMatchIndex = dictHashTable[dictHash]; @@ -283,7 +281,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( } /* catch up */ offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, offset + ZSTD_REP_MOVE, mLength-MINMATCH); } } else if (MEM_read32(match) != MEM_read32(ip)) { /* it's not a match, and we're not going to check the dictionary */ @@ -298,7 +296,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, offset + ZSTD_REP_MOVE, mLength-MINMATCH); } /* match found */ @@ -323,7 +321,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( const BYTE* const repEnd2 = repIndex2 < prefixStartIndex ? dictEnd : iend; size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, prefixStart) + 4; U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */ - ZSTD_storeSeq(seqStore, 0, anchor, 0, repLength2-MINMATCH); + ZSTD_storeSeq(seqStore, 0, anchor, iend, 0, repLength2-MINMATCH); hashTable[ZSTD_hashPtr(ip, hlog, mls)] = current2; ip += repLength2; anchor = ip; @@ -346,8 +344,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - ZSTD_compressionParameters const* cParams = &ms->cParams; - U32 const mls = cParams->minMatch; + U32 const mls = ms->cParams.minMatch; assert(ms->dictMatchState != NULL); switch(mls) { @@ -379,9 +376,7 @@ static size_t ZSTD_compressBlock_fast_extDict_generic( const BYTE* ip = istart; const BYTE* anchor = istart; const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); - const U32 maxDistance = 1U << cParams->windowLog; - const U32 validLow = ms->window.lowLimit; - const U32 lowLimit = (endIndex - validLow > maxDistance) ? endIndex - maxDistance : validLow; + const U32 lowLimit = ZSTD_getLowestMatchIndex(ms, endIndex, cParams->windowLog); const U32 dictStartIndex = lowLimit; const BYTE* const dictStart = dictBase + dictStartIndex; const U32 dictLimit = ms->window.dictLimit; @@ -392,6 +387,8 @@ static size_t ZSTD_compressBlock_fast_extDict_generic( const BYTE* const ilimit = iend - 8; U32 offset_1=rep[0], offset_2=rep[1]; + DEBUGLOG(5, "ZSTD_compressBlock_fast_extDict_generic"); + /* switch to "regular" variant if extDict is invalidated due to maxDistance */ if (prefixStartIndex == dictStartIndex) return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, mls); @@ -406,16 +403,17 @@ static size_t ZSTD_compressBlock_fast_extDict_generic( const U32 repIndex = current + 1 - offset_1; const BYTE* const repBase = repIndex < prefixStartIndex ? dictBase : base; const BYTE* const repMatch = repBase + repIndex; - size_t mLength; hashTable[h] = current; /* update hash table */ assert(offset_1 <= current +1); /* check repIndex */ if ( (((U32)((prefixStartIndex-1) - repIndex) >= 3) /* intentional underflow */ & (repIndex > dictStartIndex)) && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) { - const BYTE* repMatchEnd = repIndex < prefixStartIndex ? dictEnd : iend; - mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, prefixStart) + 4; + const BYTE* const repMatchEnd = repIndex < prefixStartIndex ? dictEnd : iend; + size_t const rLength = ZSTD_count_2segments(ip+1 +4, repMatch +4, iend, repMatchEnd, prefixStart) + 4; ip++; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, 0, rLength-MINMATCH); + ip += rLength; + anchor = ip; } else { if ( (matchIndex < dictStartIndex) || (MEM_read32(match) != MEM_read32(ip)) ) { @@ -423,21 +421,17 @@ static size_t ZSTD_compressBlock_fast_extDict_generic( ip += ((ip-anchor) >> kSearchStrength) + stepSize; continue; } - { const BYTE* matchEnd = matchIndex < prefixStartIndex ? dictEnd : iend; - const BYTE* lowMatchPtr = matchIndex < prefixStartIndex ? dictStart : prefixStart; - U32 offset; - mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, prefixStart) + 4; + { const BYTE* const matchEnd = matchIndex < prefixStartIndex ? dictEnd : iend; + const BYTE* const lowMatchPtr = matchIndex < prefixStartIndex ? dictStart : prefixStart; + U32 const offset = current - matchIndex; + size_t mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, prefixStart) + 4; while (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ - offset = current - matchIndex; - offset_2 = offset_1; - offset_1 = offset; - ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + offset_2 = offset_1; offset_1 = offset; /* update offset history */ + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ip += mLength; + anchor = ip; } } - /* found a match : store it */ - ip += mLength; - anchor = ip; - if (ip <= ilimit) { /* Fill Table */ hashTable[ZSTD_hashPtr(base+current+2, hlog, mls)] = current+2; @@ -446,13 +440,13 @@ static size_t ZSTD_compressBlock_fast_extDict_generic( while (ip <= ilimit) { U32 const current2 = (U32)(ip-base); U32 const repIndex2 = current2 - offset_2; - const BYTE* repMatch2 = repIndex2 < prefixStartIndex ? dictBase + repIndex2 : base + repIndex2; + const BYTE* const repMatch2 = repIndex2 < prefixStartIndex ? dictBase + repIndex2 : base + repIndex2; if ( (((U32)((prefixStartIndex-1) - repIndex2) >= 3) & (repIndex2 > dictStartIndex)) /* intentional overflow */ && (MEM_read32(repMatch2) == MEM_read32(ip)) ) { const BYTE* const repEnd2 = repIndex2 < prefixStartIndex ? dictEnd : iend; size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, prefixStart) + 4; - U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */ - ZSTD_storeSeq(seqStore, 0, anchor, 0, repLength2-MINMATCH); + { U32 const tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; } /* swap offset_2 <=> offset_1 */ + ZSTD_storeSeq(seqStore, 0 /*litlen*/, anchor, iend, 0 /*offcode*/, repLength2-MINMATCH); hashTable[ZSTD_hashPtr(ip, hlog, mls)] = current2; ip += repLength2; anchor = ip; @@ -474,8 +468,7 @@ size_t ZSTD_compressBlock_fast_extDict( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - ZSTD_compressionParameters const* cParams = &ms->cParams; - U32 const mls = cParams->minMatch; + U32 const mls = ms->cParams.minMatch; switch(mls) { default: /* includes case 3 */ diff --git a/thirdparty/zstd/compress/zstd_lazy.c b/thirdparty/zstd/compress/zstd_lazy.c index 94d906c01f..9ad7e03b54 100644 --- a/thirdparty/zstd/compress/zstd_lazy.c +++ b/thirdparty/zstd/compress/zstd_lazy.c @@ -242,9 +242,7 @@ ZSTD_DUBT_findBestMatch(ZSTD_matchState_t* ms, const BYTE* const base = ms->window.base; U32 const current = (U32)(ip-base); - U32 const maxDistance = 1U << cParams->windowLog; - U32 const windowValid = ms->window.lowLimit; - U32 const windowLow = (current - windowValid > maxDistance) ? current - maxDistance : windowValid; + U32 const windowLow = ZSTD_getLowestMatchIndex(ms, current, cParams->windowLog); U32* const bt = ms->chainTable; U32 const btLog = cParams->chainLog - 1; @@ -497,8 +495,10 @@ size_t ZSTD_HcFindBestMatch_generic ( const BYTE* const dictEnd = dictBase + dictLimit; const U32 current = (U32)(ip-base); const U32 maxDistance = 1U << cParams->windowLog; - const U32 lowValid = ms->window.lowLimit; - const U32 lowLimit = (current - lowValid > maxDistance) ? current - maxDistance : lowValid; + const U32 lowestValid = ms->window.lowLimit; + const U32 withinMaxDistance = (current - lowestValid > maxDistance) ? current - maxDistance : lowestValid; + const U32 isDictionary = (ms->loadedDictEnd != 0); + const U32 lowLimit = isDictionary ? lowestValid : withinMaxDistance; const U32 minChain = current > chainSize ? current - chainSize : 0; U32 nbAttempts = 1U << cParams->searchLog; size_t ml=4-1; @@ -619,12 +619,14 @@ FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_extDict_selectMLS ( /* ******************************* * Common parser - lazy strategy *********************************/ -FORCE_INLINE_TEMPLATE -size_t ZSTD_compressBlock_lazy_generic( +typedef enum { search_hashChain, search_binaryTree } searchMethod_e; + +FORCE_INLINE_TEMPLATE size_t +ZSTD_compressBlock_lazy_generic( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], const void* src, size_t srcSize, - const U32 searchMethod, const U32 depth, + const searchMethod_e searchMethod, const U32 depth, ZSTD_dictMode_e const dictMode) { const BYTE* const istart = (const BYTE*)src; @@ -640,8 +642,10 @@ size_t ZSTD_compressBlock_lazy_generic( ZSTD_matchState_t* ms, const BYTE* ip, const BYTE* iLimit, size_t* offsetPtr); searchMax_f const searchMax = dictMode == ZSTD_dictMatchState ? - (searchMethod ? ZSTD_BtFindBestMatch_dictMatchState_selectMLS : ZSTD_HcFindBestMatch_dictMatchState_selectMLS) : - (searchMethod ? ZSTD_BtFindBestMatch_selectMLS : ZSTD_HcFindBestMatch_selectMLS); + (searchMethod==search_binaryTree ? ZSTD_BtFindBestMatch_dictMatchState_selectMLS + : ZSTD_HcFindBestMatch_dictMatchState_selectMLS) : + (searchMethod==search_binaryTree ? ZSTD_BtFindBestMatch_selectMLS + : ZSTD_HcFindBestMatch_selectMLS); U32 offset_1 = rep[0], offset_2 = rep[1], savedOffset=0; const ZSTD_matchState_t* const dms = ms->dictMatchState; @@ -806,7 +810,7 @@ size_t ZSTD_compressBlock_lazy_generic( /* store sequence */ _storeSequence: { size_t const litLength = start - anchor; - ZSTD_storeSeq(seqStore, litLength, anchor, (U32)offset, matchLength-MINMATCH); + ZSTD_storeSeq(seqStore, litLength, anchor, iend, (U32)offset, matchLength-MINMATCH); anchor = ip = start + matchLength; } @@ -824,7 +828,7 @@ _storeSequence: const BYTE* const repEnd2 = repIndex < prefixLowestIndex ? dictEnd : iend; matchLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd2, prefixLowest) + 4; offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap offset_2 <=> offset_1 */ - ZSTD_storeSeq(seqStore, 0, anchor, 0, matchLength-MINMATCH); + ZSTD_storeSeq(seqStore, 0, anchor, iend, 0, matchLength-MINMATCH); ip += matchLength; anchor = ip; continue; @@ -839,7 +843,7 @@ _storeSequence: /* store sequence */ matchLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4; offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap repcodes */ - ZSTD_storeSeq(seqStore, 0, anchor, 0, matchLength-MINMATCH); + ZSTD_storeSeq(seqStore, 0, anchor, iend, 0, matchLength-MINMATCH); ip += matchLength; anchor = ip; continue; /* faster when present ... (?) */ @@ -850,7 +854,7 @@ _storeSequence: rep[1] = offset_2 ? offset_2 : savedOffset; /* Return the last literals size */ - return iend - anchor; + return (size_t)(iend - anchor); } @@ -858,56 +862,56 @@ size_t ZSTD_compressBlock_btlazy2( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, 1, 2, ZSTD_noDict); + return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2, ZSTD_noDict); } size_t ZSTD_compressBlock_lazy2( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, 0, 2, ZSTD_noDict); + return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_noDict); } size_t ZSTD_compressBlock_lazy( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, 0, 1, ZSTD_noDict); + return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_noDict); } size_t ZSTD_compressBlock_greedy( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, 0, 0, ZSTD_noDict); + return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_noDict); } size_t ZSTD_compressBlock_btlazy2_dictMatchState( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, 1, 2, ZSTD_dictMatchState); + return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2, ZSTD_dictMatchState); } size_t ZSTD_compressBlock_lazy2_dictMatchState( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, 0, 2, ZSTD_dictMatchState); + return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_dictMatchState); } size_t ZSTD_compressBlock_lazy_dictMatchState( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, 0, 1, ZSTD_dictMatchState); + return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_dictMatchState); } size_t ZSTD_compressBlock_greedy_dictMatchState( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, 0, 0, ZSTD_dictMatchState); + return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_dictMatchState); } @@ -916,7 +920,7 @@ size_t ZSTD_compressBlock_lazy_extDict_generic( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], const void* src, size_t srcSize, - const U32 searchMethod, const U32 depth) + const searchMethod_e searchMethod, const U32 depth) { const BYTE* const istart = (const BYTE*)src; const BYTE* ip = istart; @@ -934,7 +938,7 @@ size_t ZSTD_compressBlock_lazy_extDict_generic( typedef size_t (*searchMax_f)( ZSTD_matchState_t* ms, const BYTE* ip, const BYTE* iLimit, size_t* offsetPtr); - searchMax_f searchMax = searchMethod ? ZSTD_BtFindBestMatch_extDict_selectMLS : ZSTD_HcFindBestMatch_extDict_selectMLS; + searchMax_f searchMax = searchMethod==search_binaryTree ? ZSTD_BtFindBestMatch_extDict_selectMLS : ZSTD_HcFindBestMatch_extDict_selectMLS; U32 offset_1 = rep[0], offset_2 = rep[1]; @@ -1047,7 +1051,7 @@ size_t ZSTD_compressBlock_lazy_extDict_generic( /* store sequence */ _storeSequence: { size_t const litLength = start - anchor; - ZSTD_storeSeq(seqStore, litLength, anchor, (U32)offset, matchLength-MINMATCH); + ZSTD_storeSeq(seqStore, litLength, anchor, iend, (U32)offset, matchLength-MINMATCH); anchor = ip = start + matchLength; } @@ -1062,7 +1066,7 @@ _storeSequence: const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; matchLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4; offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap offset history */ - ZSTD_storeSeq(seqStore, 0, anchor, 0, matchLength-MINMATCH); + ZSTD_storeSeq(seqStore, 0, anchor, iend, 0, matchLength-MINMATCH); ip += matchLength; anchor = ip; continue; /* faster when present ... (?) */ @@ -1075,7 +1079,7 @@ _storeSequence: rep[1] = offset_2; /* Return the last literals size */ - return iend - anchor; + return (size_t)(iend - anchor); } @@ -1083,7 +1087,7 @@ size_t ZSTD_compressBlock_greedy_extDict( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, 0, 0); + return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0); } size_t ZSTD_compressBlock_lazy_extDict( @@ -1091,7 +1095,7 @@ size_t ZSTD_compressBlock_lazy_extDict( void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, 0, 1); + return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1); } size_t ZSTD_compressBlock_lazy2_extDict( @@ -1099,7 +1103,7 @@ size_t ZSTD_compressBlock_lazy2_extDict( void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, 0, 2); + return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2); } size_t ZSTD_compressBlock_btlazy2_extDict( @@ -1107,5 +1111,5 @@ size_t ZSTD_compressBlock_btlazy2_extDict( void const* src, size_t srcSize) { - return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, 1, 2); + return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2); } diff --git a/thirdparty/zstd/compress/zstd_ldm.c b/thirdparty/zstd/compress/zstd_ldm.c index 3dcf86e6e8..c3312ad3e3 100644 --- a/thirdparty/zstd/compress/zstd_ldm.c +++ b/thirdparty/zstd/compress/zstd_ldm.c @@ -49,9 +49,9 @@ size_t ZSTD_ldm_getTableSize(ldmParams_t params) { size_t const ldmHSize = ((size_t)1) << params.hashLog; size_t const ldmBucketSizeLog = MIN(params.bucketSizeLog, params.hashLog); - size_t const ldmBucketSize = - ((size_t)1) << (params.hashLog - ldmBucketSizeLog); - size_t const totalSize = ldmBucketSize + ldmHSize * sizeof(ldmEntry_t); + size_t const ldmBucketSize = ((size_t)1) << (params.hashLog - ldmBucketSizeLog); + size_t const totalSize = ZSTD_cwksp_alloc_size(ldmBucketSize) + + ZSTD_cwksp_alloc_size(ldmHSize * sizeof(ldmEntry_t)); return params.enableLdm ? totalSize : 0; } @@ -583,7 +583,7 @@ size_t ZSTD_ldm_blockCompress(rawSeqStore_t* rawSeqStore, rep[i] = rep[i-1]; rep[0] = sequence.offset; /* Store the sequence */ - ZSTD_storeSeq(seqStore, newLitLength, ip - newLitLength, + ZSTD_storeSeq(seqStore, newLitLength, ip - newLitLength, iend, sequence.offset + ZSTD_REP_MOVE, sequence.matchLength - MINMATCH); ip += sequence.matchLength; diff --git a/thirdparty/zstd/compress/zstd_opt.c b/thirdparty/zstd/compress/zstd_opt.c index e32e542e02..2e50fca6ff 100644 --- a/thirdparty/zstd/compress/zstd_opt.c +++ b/thirdparty/zstd/compress/zstd_opt.c @@ -552,7 +552,6 @@ U32 ZSTD_insertBtAndGetAllMatches ( { const ZSTD_compressionParameters* const cParams = &ms->cParams; U32 const sufficient_len = MIN(cParams->targetLength, ZSTD_OPT_NUM -1); - U32 const maxDistance = 1U << cParams->windowLog; const BYTE* const base = ms->window.base; U32 const current = (U32)(ip-base); U32 const hashLog = cParams->hashLog; @@ -569,8 +568,7 @@ U32 ZSTD_insertBtAndGetAllMatches ( const BYTE* const dictEnd = dictBase + dictLimit; const BYTE* const prefixStart = base + dictLimit; U32 const btLow = (btMask >= current) ? 0 : current - btMask; - U32 const windowValid = ms->window.lowLimit; - U32 const windowLow = ((current - windowValid) > maxDistance) ? current - maxDistance : windowValid; + U32 const windowLow = ZSTD_getLowestMatchIndex(ms, current, cParams->windowLog); U32 const matchLow = windowLow ? windowLow : 1; U32* smallerPtr = bt + 2*(current&btMask); U32* largerPtr = bt + 2*(current&btMask) + 1; @@ -674,19 +672,21 @@ U32 ZSTD_insertBtAndGetAllMatches ( while (nbCompares-- && (matchIndex >= matchLow)) { U32* const nextPtr = bt + 2*(matchIndex & btMask); - size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */ const BYTE* match; + size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */ assert(current > matchIndex); if ((dictMode == ZSTD_noDict) || (dictMode == ZSTD_dictMatchState) || (matchIndex+matchLength >= dictLimit)) { assert(matchIndex+matchLength >= dictLimit); /* ensure the condition is correct when !extDict */ match = base + matchIndex; + if (matchIndex >= dictLimit) assert(memcmp(match, ip, matchLength) == 0); /* ensure early section of match is equal as expected */ matchLength += ZSTD_count(ip+matchLength, match+matchLength, iLimit); } else { match = dictBase + matchIndex; + assert(memcmp(match, ip, matchLength) == 0); /* ensure early section of match is equal as expected */ matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iLimit, dictEnd, prefixStart); if (matchIndex+matchLength >= dictLimit) - match = base + matchIndex; /* prepare for match[matchLength] */ + match = base + matchIndex; /* prepare for match[matchLength] read */ } if (matchLength > bestLength) { @@ -1098,7 +1098,7 @@ _shortestPath: /* cur, last_pos, best_mlen, best_off have to be set */ assert(anchor + llen <= iend); ZSTD_updateStats(optStatePtr, llen, anchor, offCode, mlen); - ZSTD_storeSeq(seqStore, llen, anchor, offCode, mlen-MINMATCH); + ZSTD_storeSeq(seqStore, llen, anchor, iend, offCode, mlen-MINMATCH); anchor += advance; ip = anchor; } } diff --git a/thirdparty/zstd/compress/zstdmt_compress.c b/thirdparty/zstd/compress/zstdmt_compress.c index 9e537b8848..bc3062b530 100644 --- a/thirdparty/zstd/compress/zstdmt_compress.c +++ b/thirdparty/zstd/compress/zstdmt_compress.c @@ -668,7 +668,7 @@ static void ZSTDMT_compressionJob(void* jobDescription) /* init */ if (job->cdict) { - size_t const initError = ZSTD_compressBegin_advanced_internal(cctx, NULL, 0, ZSTD_dct_auto, ZSTD_dtlm_fast, job->cdict, jobParams, job->fullFrameSize); + size_t const initError = ZSTD_compressBegin_advanced_internal(cctx, NULL, 0, ZSTD_dct_auto, ZSTD_dtlm_fast, job->cdict, &jobParams, job->fullFrameSize); assert(job->firstJob); /* only allowed for first job */ if (ZSTD_isError(initError)) JOB_ERROR(initError); } else { /* srcStart points at reloaded section */ @@ -680,7 +680,7 @@ static void ZSTDMT_compressionJob(void* jobDescription) job->prefix.start, job->prefix.size, ZSTD_dct_rawContent, /* load dictionary in "content-only" mode (no header analysis) */ ZSTD_dtlm_fast, NULL, /*cdict*/ - jobParams, pledgedSrcSize); + &jobParams, pledgedSrcSize); if (ZSTD_isError(initError)) JOB_ERROR(initError); } } @@ -927,12 +927,18 @@ static void ZSTDMT_releaseAllJobResources(ZSTDMT_CCtx* mtctx) unsigned jobID; DEBUGLOG(3, "ZSTDMT_releaseAllJobResources"); for (jobID=0; jobID <= mtctx->jobIDMask; jobID++) { + /* Copy the mutex/cond out */ + ZSTD_pthread_mutex_t const mutex = mtctx->jobs[jobID].job_mutex; + ZSTD_pthread_cond_t const cond = mtctx->jobs[jobID].job_cond; + DEBUGLOG(4, "job%02u: release dst address %08X", jobID, (U32)(size_t)mtctx->jobs[jobID].dstBuff.start); ZSTDMT_releaseBuffer(mtctx->bufPool, mtctx->jobs[jobID].dstBuff); - mtctx->jobs[jobID].dstBuff = g_nullBuffer; - mtctx->jobs[jobID].cSize = 0; + + /* Clear the job description, but keep the mutex/cond */ + memset(&mtctx->jobs[jobID], 0, sizeof(mtctx->jobs[jobID])); + mtctx->jobs[jobID].job_mutex = mutex; + mtctx->jobs[jobID].job_cond = cond; } - memset(mtctx->jobs, 0, (mtctx->jobIDMask+1)*sizeof(ZSTDMT_jobDescription)); mtctx->inBuff.buffer = g_nullBuffer; mtctx->inBuff.filled = 0; mtctx->allJobsCompleted = 1; @@ -1028,9 +1034,9 @@ size_t ZSTDMT_getMTCtxParameter(ZSTDMT_CCtx* mtctx, ZSTDMT_parameter parameter, /* Sets parameters relevant to the compression job, * initializing others to default values. */ -static ZSTD_CCtx_params ZSTDMT_initJobCCtxParams(ZSTD_CCtx_params const params) +static ZSTD_CCtx_params ZSTDMT_initJobCCtxParams(const ZSTD_CCtx_params* params) { - ZSTD_CCtx_params jobParams = params; + ZSTD_CCtx_params jobParams = *params; /* Clear parameters related to multithreading */ jobParams.forceWindow = 0; jobParams.nbWorkers = 0; @@ -1151,16 +1157,16 @@ size_t ZSTDMT_toFlushNow(ZSTDMT_CCtx* mtctx) /* ===== Multi-threaded compression ===== */ /* ------------------------------------------ */ -static unsigned ZSTDMT_computeTargetJobLog(ZSTD_CCtx_params const params) +static unsigned ZSTDMT_computeTargetJobLog(const ZSTD_CCtx_params* params) { unsigned jobLog; - if (params.ldmParams.enableLdm) { + if (params->ldmParams.enableLdm) { /* In Long Range Mode, the windowLog is typically oversized. * In which case, it's preferable to determine the jobSize * based on chainLog instead. */ - jobLog = MAX(21, params.cParams.chainLog + 4); + jobLog = MAX(21, params->cParams.chainLog + 4); } else { - jobLog = MAX(20, params.cParams.windowLog + 2); + jobLog = MAX(20, params->cParams.windowLog + 2); } return MIN(jobLog, (unsigned)ZSTDMT_JOBLOG_MAX); } @@ -1193,27 +1199,27 @@ static int ZSTDMT_overlapLog(int ovlog, ZSTD_strategy strat) return ovlog; } -static size_t ZSTDMT_computeOverlapSize(ZSTD_CCtx_params const params) +static size_t ZSTDMT_computeOverlapSize(const ZSTD_CCtx_params* params) { - int const overlapRLog = 9 - ZSTDMT_overlapLog(params.overlapLog, params.cParams.strategy); - int ovLog = (overlapRLog >= 8) ? 0 : (params.cParams.windowLog - overlapRLog); + int const overlapRLog = 9 - ZSTDMT_overlapLog(params->overlapLog, params->cParams.strategy); + int ovLog = (overlapRLog >= 8) ? 0 : (params->cParams.windowLog - overlapRLog); assert(0 <= overlapRLog && overlapRLog <= 8); - if (params.ldmParams.enableLdm) { + if (params->ldmParams.enableLdm) { /* In Long Range Mode, the windowLog is typically oversized. * In which case, it's preferable to determine the jobSize * based on chainLog instead. * Then, ovLog becomes a fraction of the jobSize, rather than windowSize */ - ovLog = MIN(params.cParams.windowLog, ZSTDMT_computeTargetJobLog(params) - 2) + ovLog = MIN(params->cParams.windowLog, ZSTDMT_computeTargetJobLog(params) - 2) - overlapRLog; } assert(0 <= ovLog && ovLog <= ZSTD_WINDOWLOG_MAX); - DEBUGLOG(4, "overlapLog : %i", params.overlapLog); + DEBUGLOG(4, "overlapLog : %i", params->overlapLog); DEBUGLOG(4, "overlap size : %i", 1 << ovLog); return (ovLog==0) ? 0 : (size_t)1 << ovLog; } static unsigned -ZSTDMT_computeNbJobs(ZSTD_CCtx_params params, size_t srcSize, unsigned nbWorkers) +ZSTDMT_computeNbJobs(const ZSTD_CCtx_params* params, size_t srcSize, unsigned nbWorkers) { assert(nbWorkers>0); { size_t const jobSizeTarget = (size_t)1 << ZSTDMT_computeTargetJobLog(params); @@ -1236,9 +1242,9 @@ static size_t ZSTDMT_compress_advanced_internal( const ZSTD_CDict* cdict, ZSTD_CCtx_params params) { - ZSTD_CCtx_params const jobParams = ZSTDMT_initJobCCtxParams(params); - size_t const overlapSize = ZSTDMT_computeOverlapSize(params); - unsigned const nbJobs = ZSTDMT_computeNbJobs(params, srcSize, params.nbWorkers); + ZSTD_CCtx_params const jobParams = ZSTDMT_initJobCCtxParams(¶ms); + size_t const overlapSize = ZSTDMT_computeOverlapSize(¶ms); + unsigned const nbJobs = ZSTDMT_computeNbJobs(¶ms, srcSize, params.nbWorkers); size_t const proposedJobSize = (srcSize + (nbJobs-1)) / nbJobs; size_t const avgJobSize = (((proposedJobSize-1) & 0x1FFFF) < 0x7FFF) ? proposedJobSize + 0xFFFF : proposedJobSize; /* avoid too small last block */ const char* const srcStart = (const char*)src; @@ -1256,7 +1262,7 @@ static size_t ZSTDMT_compress_advanced_internal( ZSTD_CCtx* const cctx = mtctx->cctxPool->cctx[0]; DEBUGLOG(4, "ZSTDMT_compress_advanced_internal: fallback to single-thread mode"); if (cdict) return ZSTD_compress_usingCDict_advanced(cctx, dst, dstCapacity, src, srcSize, cdict, jobParams.fParams); - return ZSTD_compress_advanced_internal(cctx, dst, dstCapacity, src, srcSize, NULL, 0, jobParams); + return ZSTD_compress_advanced_internal(cctx, dst, dstCapacity, src, srcSize, NULL, 0, &jobParams); } assert(avgJobSize >= 256 KB); /* condition for ZSTD_compressBound(A) + ZSTD_compressBound(B) <= ZSTD_compressBound(A+B), required to compress directly into Dst (no additional buffer) */ @@ -1404,12 +1410,12 @@ size_t ZSTDMT_initCStream_internal( mtctx->singleBlockingThread = (pledgedSrcSize <= ZSTDMT_JOBSIZE_MIN); /* do not trigger multi-threading when srcSize is too small */ if (mtctx->singleBlockingThread) { - ZSTD_CCtx_params const singleThreadParams = ZSTDMT_initJobCCtxParams(params); + ZSTD_CCtx_params const singleThreadParams = ZSTDMT_initJobCCtxParams(¶ms); DEBUGLOG(5, "ZSTDMT_initCStream_internal: switch to single blocking thread mode"); assert(singleThreadParams.nbWorkers == 0); return ZSTD_initCStream_internal(mtctx->cctxPool->cctx[0], dict, dictSize, cdict, - singleThreadParams, pledgedSrcSize); + &singleThreadParams, pledgedSrcSize); } DEBUGLOG(4, "ZSTDMT_initCStream_internal: %u workers", params.nbWorkers); @@ -1435,11 +1441,11 @@ size_t ZSTDMT_initCStream_internal( mtctx->cdict = cdict; } - mtctx->targetPrefixSize = ZSTDMT_computeOverlapSize(params); + mtctx->targetPrefixSize = ZSTDMT_computeOverlapSize(¶ms); DEBUGLOG(4, "overlapLog=%i => %u KB", params.overlapLog, (U32)(mtctx->targetPrefixSize>>10)); mtctx->targetSectionSize = params.jobSize; if (mtctx->targetSectionSize == 0) { - mtctx->targetSectionSize = 1ULL << ZSTDMT_computeTargetJobLog(params); + mtctx->targetSectionSize = 1ULL << ZSTDMT_computeTargetJobLog(¶ms); } assert(mtctx->targetSectionSize <= (size_t)ZSTDMT_JOBSIZE_MAX); diff --git a/thirdparty/zstd/decompress/huf_decompress.c b/thirdparty/zstd/decompress/huf_decompress.c index 3f8bd29732..bb2d0a96bc 100644 --- a/thirdparty/zstd/decompress/huf_decompress.c +++ b/thirdparty/zstd/decompress/huf_decompress.c @@ -61,7 +61,9 @@ * Error Management ****************************************************************/ #define HUF_isError ERR_isError +#ifndef CHECK_F #define CHECK_F(f) { size_t const err_ = (f); if (HUF_isError(err_)) return err_; } +#endif /* ************************************************************** diff --git a/thirdparty/zstd/decompress/zstd_decompress.c b/thirdparty/zstd/decompress/zstd_decompress.c index e42872ad96..dd4591b7be 100644 --- a/thirdparty/zstd/decompress/zstd_decompress.c +++ b/thirdparty/zstd/decompress/zstd_decompress.c @@ -88,10 +88,7 @@ size_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); } static size_t ZSTD_startingInputLength(ZSTD_format_e format) { - size_t const startingInputLength = (format==ZSTD_f_zstd1_magicless) ? - ZSTD_FRAMEHEADERSIZE_PREFIX - ZSTD_FRAMEIDSIZE : - ZSTD_FRAMEHEADERSIZE_PREFIX; - ZSTD_STATIC_ASSERT(ZSTD_FRAMEHEADERSIZE_PREFIX >= ZSTD_FRAMEIDSIZE); + size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format); /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */ assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) ); return startingInputLength; @@ -376,7 +373,7 @@ unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize) { unsigned long long totalDstSize = 0; - while (srcSize >= ZSTD_FRAMEHEADERSIZE_PREFIX) { + while (srcSize >= ZSTD_startingInputLength(ZSTD_f_zstd1)) { U32 const magicNumber = MEM_readLE32(src); if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { @@ -574,9 +571,10 @@ void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst) } /** ZSTD_insertBlock() : - insert `src` block into `dctx` history. Useful to track uncompressed blocks. */ + * insert `src` block into `dctx` history. Useful to track uncompressed blocks. */ size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize) { + DEBUGLOG(5, "ZSTD_insertBlock: %u bytes", (unsigned)blockSize); ZSTD_checkContinuity(dctx, blockStart); dctx->previousDstEnd = (const char*)blockStart + blockSize; return blockSize; @@ -628,11 +626,12 @@ static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx, /* check */ RETURN_ERROR_IF( - remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN+ZSTD_blockHeaderSize, + remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN(dctx->format)+ZSTD_blockHeaderSize, srcSize_wrong); /* Frame Header */ - { size_t const frameHeaderSize = ZSTD_frameHeaderSize(ip, ZSTD_FRAMEHEADERSIZE_PREFIX); + { size_t const frameHeaderSize = ZSTD_frameHeaderSize_internal( + ip, ZSTD_FRAMEHEADERSIZE_PREFIX(dctx->format), dctx->format); if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize; RETURN_ERROR_IF(remainingSrcSize < frameHeaderSize+ZSTD_blockHeaderSize, srcSize_wrong); @@ -713,7 +712,7 @@ static size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx, dictSize = ZSTD_DDict_dictSize(ddict); } - while (srcSize >= ZSTD_FRAMEHEADERSIZE_PREFIX) { + while (srcSize >= ZSTD_startingInputLength(dctx->format)) { #if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1) if (ZSTD_isLegacy(src, srcSize)) { @@ -909,6 +908,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c { blockProperties_t bp; size_t const cBlockSize = ZSTD_getcBlockSize(src, ZSTD_blockHeaderSize, &bp); if (ZSTD_isError(cBlockSize)) return cBlockSize; + RETURN_ERROR_IF(cBlockSize > dctx->fParams.blockSizeMax, corruption_detected, "Block Size Exceeds Maximum"); dctx->expected = cBlockSize; dctx->bType = bp.blockType; dctx->rleSize = bp.origSize; @@ -953,6 +953,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c RETURN_ERROR(corruption_detected); } if (ZSTD_isError(rSize)) return rSize; + RETURN_ERROR_IF(rSize > dctx->fParams.blockSizeMax, corruption_detected, "Decompressed Block Size Exceeds Maximum"); DEBUGLOG(5, "ZSTD_decompressContinue: decoded size from block : %u", (unsigned)rSize); dctx->decodedSize += rSize; if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, dst, rSize); @@ -1095,7 +1096,7 @@ ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy, size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12)); for (i=0; i<3; i++) { U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4; - RETURN_ERROR_IF(rep==0 || rep >= dictContentSize, + RETURN_ERROR_IF(rep==0 || rep > dictContentSize, dictionary_corrupted); entropy->rep[i] = rep; } } @@ -1264,7 +1265,7 @@ size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, { RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong); ZSTD_clearDict(dctx); - if (dict && dictSize >= 8) { + if (dict && dictSize != 0) { dctx->ddictLocal = ZSTD_createDDict_advanced(dict, dictSize, dictLoadMethod, dictContentType, dctx->customMem); RETURN_ERROR_IF(dctx->ddictLocal == NULL, memory_allocation); dctx->ddict = dctx->ddictLocal; @@ -1297,14 +1298,14 @@ size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSiz /* ZSTD_initDStream_usingDict() : - * return : expected size, aka ZSTD_FRAMEHEADERSIZE_PREFIX. + * return : expected size, aka ZSTD_startingInputLength(). * this function cannot fail */ size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize) { DEBUGLOG(4, "ZSTD_initDStream_usingDict"); FORWARD_IF_ERROR( ZSTD_DCtx_reset(zds, ZSTD_reset_session_only) ); FORWARD_IF_ERROR( ZSTD_DCtx_loadDictionary(zds, dict, dictSize) ); - return ZSTD_FRAMEHEADERSIZE_PREFIX; + return ZSTD_startingInputLength(zds->format); } /* note : this variant can't fail */ @@ -1321,16 +1322,16 @@ size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* dctx, const ZSTD_DDict* ddict) { FORWARD_IF_ERROR( ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only) ); FORWARD_IF_ERROR( ZSTD_DCtx_refDDict(dctx, ddict) ); - return ZSTD_FRAMEHEADERSIZE_PREFIX; + return ZSTD_startingInputLength(dctx->format); } /* ZSTD_resetDStream() : - * return : expected size, aka ZSTD_FRAMEHEADERSIZE_PREFIX. + * return : expected size, aka ZSTD_startingInputLength(). * this function cannot fail */ size_t ZSTD_resetDStream(ZSTD_DStream* dctx) { FORWARD_IF_ERROR(ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only)); - return ZSTD_FRAMEHEADERSIZE_PREFIX; + return ZSTD_startingInputLength(dctx->format); } @@ -1561,7 +1562,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB zds->lhSize += remainingInput; } input->pos = input->size; - return (MAX(ZSTD_FRAMEHEADERSIZE_MIN, hSize) - zds->lhSize) + ZSTD_blockHeaderSize; /* remaining header bytes + next block header */ + return (MAX((size_t)ZSTD_FRAMEHEADERSIZE_MIN(zds->format), hSize) - zds->lhSize) + ZSTD_blockHeaderSize; /* remaining header bytes + next block header */ } assert(ip != NULL); memcpy(zds->headerBuffer + zds->lhSize, ip, toLoad); zds->lhSize = hSize; ip += toLoad; diff --git a/thirdparty/zstd/decompress/zstd_decompress_block.c b/thirdparty/zstd/decompress/zstd_decompress_block.c index 24f4859c56..767e5f9a0b 100644 --- a/thirdparty/zstd/decompress/zstd_decompress_block.c +++ b/thirdparty/zstd/decompress/zstd_decompress_block.c @@ -79,6 +79,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, const void* src, size_t srcSize) /* note : srcSize < BLOCKSIZE */ { + DEBUGLOG(5, "ZSTD_decodeLiteralsBlock"); RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected); { const BYTE* const istart = (const BYTE*) src; @@ -87,6 +88,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, switch(litEncType) { case set_repeat: + DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block"); RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted); /* fall-through */ @@ -116,7 +118,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, /* 2 - 2 - 18 - 18 */ lhSize = 5; litSize = (lhc >> 4) & 0x3FFFF; - litCSize = (lhc >> 22) + (istart[4] << 10); + litCSize = (lhc >> 22) + ((size_t)istart[4] << 10); break; } RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected); @@ -391,7 +393,8 @@ ZSTD_buildFSETable(ZSTD_seqSymbol* dt, symbolNext[s] = 1; } else { if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0; - symbolNext[s] = normalizedCounter[s]; + assert(normalizedCounter[s]>=0); + symbolNext[s] = (U16)normalizedCounter[s]; } } } memcpy(dt, &DTableH, sizeof(DTableH)); } @@ -570,38 +573,118 @@ typedef struct { size_t pos; } seqState_t; +/*! ZSTD_overlapCopy8() : + * Copies 8 bytes from ip to op and updates op and ip where ip <= op. + * If the offset is < 8 then the offset is spread to at least 8 bytes. + * + * Precondition: *ip <= *op + * Postcondition: *op - *op >= 8 + */ +static void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) { + assert(*ip <= *op); + if (offset < 8) { + /* close range match, overlap */ + static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 }; /* added */ + static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 }; /* subtracted */ + int const sub2 = dec64table[offset]; + (*op)[0] = (*ip)[0]; + (*op)[1] = (*ip)[1]; + (*op)[2] = (*ip)[2]; + (*op)[3] = (*ip)[3]; + *ip += dec32table[offset]; + ZSTD_copy4(*op+4, *ip); + *ip -= sub2; + } else { + ZSTD_copy8(*op, *ip); + } + *ip += 8; + *op += 8; + assert(*op - *ip >= 8); +} + +/*! ZSTD_safecopy() : + * Specialized version of memcpy() that is allowed to READ up to WILDCOPY_OVERLENGTH past the input buffer + * and write up to 16 bytes past oend_w (op >= oend_w is allowed). + * This function is only called in the uncommon case where the sequence is near the end of the block. It + * should be fast for a single long sequence, but can be slow for several short sequences. + * + * @param ovtype controls the overlap detection + * - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart. + * - ZSTD_overlap_src_before_dst: The src and dst may overlap and may be any distance apart. + * The src buffer must be before the dst buffer. + */ +static void ZSTD_safecopy(BYTE* op, BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) { + ptrdiff_t const diff = op - ip; + BYTE* const oend = op + length; -/* ZSTD_execSequenceLast7(): - * exceptional case : decompress a match starting within last 7 bytes of output buffer. - * requires more careful checks, to ensure there is no overflow. - * performance does not matter though. - * note : this case is supposed to be never generated "naturally" by reference encoder, - * since in most cases it needs at least 8 bytes to look for a match. - * but it's allowed by the specification. */ + assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) || + (ovtype == ZSTD_overlap_src_before_dst && diff >= 0)); + + if (length < 8) { + /* Handle short lengths. */ + while (op < oend) *op++ = *ip++; + return; + } + if (ovtype == ZSTD_overlap_src_before_dst) { + /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */ + assert(length >= 8); + ZSTD_overlapCopy8(&op, &ip, diff); + assert(op - ip >= 8); + assert(op <= oend); + } + + if (oend <= oend_w) { + /* No risk of overwrite. */ + ZSTD_wildcopy(op, ip, length, ovtype); + return; + } + if (op <= oend_w) { + /* Wildcopy until we get close to the end. */ + assert(oend > oend_w); + ZSTD_wildcopy(op, ip, oend_w - op, ovtype); + ip += oend_w - op; + op = oend_w; + } + /* Handle the leftovers. */ + while (op < oend) *op++ = *ip++; +} + +/* ZSTD_execSequenceEnd(): + * This version handles cases that are near the end of the output buffer. It requires + * more careful checks to make sure there is no overflow. By separating out these hard + * and unlikely cases, we can speed up the common cases. + * + * NOTE: This function needs to be fast for a single long sequence, but doesn't need + * to be optimized for many small sequences, since those fall into ZSTD_execSequence(). + */ FORCE_NOINLINE -size_t ZSTD_execSequenceLast7(BYTE* op, - BYTE* const oend, seq_t sequence, - const BYTE** litPtr, const BYTE* const litLimit, - const BYTE* const base, const BYTE* const vBase, const BYTE* const dictEnd) +size_t ZSTD_execSequenceEnd(BYTE* op, + BYTE* const oend, seq_t sequence, + const BYTE** litPtr, const BYTE* const litLimit, + const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) { BYTE* const oLitEnd = op + sequence.litLength; size_t const sequenceLength = sequence.litLength + sequence.matchLength; BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */ const BYTE* const iLitEnd = *litPtr + sequence.litLength; const BYTE* match = oLitEnd - sequence.offset; + BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH; - /* check */ - RETURN_ERROR_IF(oMatchEnd>oend, dstSize_tooSmall, "last match must fit within dstBuffer"); + /* bounds checks */ + assert(oLitEnd < oMatchEnd); + RETURN_ERROR_IF(oMatchEnd > oend, dstSize_tooSmall, "last match must fit within dstBuffer"); RETURN_ERROR_IF(iLitEnd > litLimit, corruption_detected, "try to read beyond literal buffer"); /* copy literals */ - while (op < oLitEnd) *op++ = *(*litPtr)++; + ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap); + op = oLitEnd; + *litPtr = iLitEnd; /* copy Match */ - if (sequence.offset > (size_t)(oLitEnd - base)) { + if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { /* offset beyond prefix */ - RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - vBase),corruption_detected); - match = dictEnd - (base-match); + RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected); + match = dictEnd - (prefixStart-match); if (match + sequence.matchLength <= dictEnd) { memmove(oLitEnd, match, sequence.matchLength); return sequenceLength; @@ -611,13 +694,12 @@ size_t ZSTD_execSequenceLast7(BYTE* op, memmove(oLitEnd, match, length1); op = oLitEnd + length1; sequence.matchLength -= length1; - match = base; + match = prefixStart; } } - while (op < oMatchEnd) *op++ = *match++; + ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst); return sequenceLength; } - HINT_INLINE size_t ZSTD_execSequence(BYTE* op, BYTE* const oend, seq_t sequence, @@ -631,20 +713,29 @@ size_t ZSTD_execSequence(BYTE* op, const BYTE* const iLitEnd = *litPtr + sequence.litLength; const BYTE* match = oLitEnd - sequence.offset; - /* check */ - RETURN_ERROR_IF(oMatchEnd>oend, dstSize_tooSmall, "last match must start at a minimum distance of WILDCOPY_OVERLENGTH from oend"); - RETURN_ERROR_IF(iLitEnd > litLimit, corruption_detected, "over-read beyond lit buffer"); - if (oLitEnd>oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd); - - /* copy Literals */ - if (sequence.litLength > 8) - ZSTD_wildcopy_16min(op, (*litPtr), sequence.litLength, ZSTD_no_overlap); /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */ - else - ZSTD_copy8(op, *litPtr); + /* Errors and uncommon cases handled here. */ + assert(oLitEnd < oMatchEnd); + if (iLitEnd > litLimit || oMatchEnd > oend_w) + return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd); + + /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */ + assert(iLitEnd <= litLimit /* Literal length is in bounds */); + assert(oLitEnd <= oend_w /* Can wildcopy literals */); + assert(oMatchEnd <= oend_w /* Can wildcopy matches */); + + /* Copy Literals: + * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9. + * We likely don't need the full 32-byte wildcopy. + */ + assert(WILDCOPY_OVERLENGTH >= 16); + ZSTD_copy16(op, (*litPtr)); + if (sequence.litLength > 16) { + ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap); + } op = oLitEnd; *litPtr = iLitEnd; /* update for next sequence */ - /* copy Match */ + /* Copy Match */ if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { /* offset beyond prefix -> go into extDict */ RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected); @@ -659,123 +750,33 @@ size_t ZSTD_execSequence(BYTE* op, op = oLitEnd + length1; sequence.matchLength -= length1; match = prefixStart; - if (op > oend_w || sequence.matchLength < MINMATCH) { - U32 i; - for (i = 0; i < sequence.matchLength; ++i) op[i] = match[i]; - return sequenceLength; - } } } - /* Requirement: op <= oend_w && sequence.matchLength >= MINMATCH */ - - /* match within prefix */ - if (sequence.offset < 8) { - /* close range match, overlap */ - static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 }; /* added */ - static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 }; /* subtracted */ - int const sub2 = dec64table[sequence.offset]; - op[0] = match[0]; - op[1] = match[1]; - op[2] = match[2]; - op[3] = match[3]; - match += dec32table[sequence.offset]; - ZSTD_copy4(op+4, match); - match -= sub2; - } else { - ZSTD_copy8(op, match); - } - op += 8; match += 8; - - if (oMatchEnd > oend-(16-MINMATCH)) { - if (op < oend_w) { - ZSTD_wildcopy(op, match, oend_w - op, ZSTD_overlap_src_before_dst); - match += oend_w - op; - op = oend_w; - } - while (op < oMatchEnd) *op++ = *match++; - } else { - ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst); /* works even if matchLength < 8 */ + /* Match within prefix of 1 or more bytes */ + assert(op <= oMatchEnd); + assert(oMatchEnd <= oend_w); + assert(match >= prefixStart); + assert(sequence.matchLength >= 1); + + /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy + * without overlap checking. + */ + if (sequence.offset >= WILDCOPY_VECLEN) { + /* We bet on a full wildcopy for matches, since we expect matches to be + * longer than literals (in general). In silesia, ~10% of matches are longer + * than 16 bytes. + */ + ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap); + return sequenceLength; } - return sequenceLength; -} - - -HINT_INLINE -size_t ZSTD_execSequenceLong(BYTE* op, - BYTE* const oend, seq_t sequence, - const BYTE** litPtr, const BYTE* const litLimit, - const BYTE* const prefixStart, const BYTE* const dictStart, const BYTE* const dictEnd) -{ - BYTE* const oLitEnd = op + sequence.litLength; - size_t const sequenceLength = sequence.litLength + sequence.matchLength; - BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */ - BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH; - const BYTE* const iLitEnd = *litPtr + sequence.litLength; - const BYTE* match = sequence.match; + assert(sequence.offset < WILDCOPY_VECLEN); - /* check */ - RETURN_ERROR_IF(oMatchEnd > oend, dstSize_tooSmall, "last match must start at a minimum distance of WILDCOPY_OVERLENGTH from oend"); - RETURN_ERROR_IF(iLitEnd > litLimit, corruption_detected, "over-read beyond lit buffer"); - if (oLitEnd > oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, prefixStart, dictStart, dictEnd); - - /* copy Literals */ - if (sequence.litLength > 8) - ZSTD_wildcopy_16min(op, *litPtr, sequence.litLength, ZSTD_no_overlap); /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */ - else - ZSTD_copy8(op, *litPtr); /* note : op <= oLitEnd <= oend_w == oend - 8 */ + /* Copy 8 bytes and spread the offset to be >= 8. */ + ZSTD_overlapCopy8(&op, &match, sequence.offset); - op = oLitEnd; - *litPtr = iLitEnd; /* update for next sequence */ - - /* copy Match */ - if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { - /* offset beyond prefix */ - RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - dictStart), corruption_detected); - if (match + sequence.matchLength <= dictEnd) { - memmove(oLitEnd, match, sequence.matchLength); - return sequenceLength; - } - /* span extDict & currentPrefixSegment */ - { size_t const length1 = dictEnd - match; - memmove(oLitEnd, match, length1); - op = oLitEnd + length1; - sequence.matchLength -= length1; - match = prefixStart; - if (op > oend_w || sequence.matchLength < MINMATCH) { - U32 i; - for (i = 0; i < sequence.matchLength; ++i) op[i] = match[i]; - return sequenceLength; - } - } } - assert(op <= oend_w); - assert(sequence.matchLength >= MINMATCH); - - /* match within prefix */ - if (sequence.offset < 8) { - /* close range match, overlap */ - static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 }; /* added */ - static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 }; /* subtracted */ - int const sub2 = dec64table[sequence.offset]; - op[0] = match[0]; - op[1] = match[1]; - op[2] = match[2]; - op[3] = match[3]; - match += dec32table[sequence.offset]; - ZSTD_copy4(op+4, match); - match -= sub2; - } else { - ZSTD_copy8(op, match); - } - op += 8; match += 8; - - if (oMatchEnd > oend-(16-MINMATCH)) { - if (op < oend_w) { - ZSTD_wildcopy(op, match, oend_w - op, ZSTD_overlap_src_before_dst); - match += oend_w - op; - op = oend_w; - } - while (op < oMatchEnd) *op++ = *match++; - } else { - ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst); /* works even if matchLength < 8 */ + /* If the match length is > 8 bytes, then continue with the wildcopy. */ + if (sequence.matchLength > 8) { + assert(op < oMatchEnd); + ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst); } return sequenceLength; } @@ -1095,7 +1096,7 @@ ZSTD_decompressSequencesLong_body( /* decode and decompress */ for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && (seqNb<nbSeq) ; seqNb++) { seq_t const sequence = ZSTD_decodeSequenceLong(&seqState, isLongOffset); - size_t const oneSeqSize = ZSTD_execSequenceLong(op, oend, sequences[(seqNb-ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd); + size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb-ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd); if (ZSTD_isError(oneSeqSize)) return oneSeqSize; PREFETCH_L1(sequence.match); PREFETCH_L1(sequence.match + sequence.matchLength - 1); /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */ sequences[seqNb & STORED_SEQS_MASK] = sequence; @@ -1106,7 +1107,7 @@ ZSTD_decompressSequencesLong_body( /* finish queue */ seqNb -= seqAdvance; for ( ; seqNb<nbSeq ; seqNb++) { - size_t const oneSeqSize = ZSTD_execSequenceLong(op, oend, sequences[seqNb&STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd); + size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[seqNb&STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd); if (ZSTD_isError(oneSeqSize)) return oneSeqSize; op += oneSeqSize; } diff --git a/thirdparty/zstd/zstd.h b/thirdparty/zstd/zstd.h index a1910ee223..72080ea87e 100644 --- a/thirdparty/zstd/zstd.h +++ b/thirdparty/zstd/zstd.h @@ -15,6 +15,7 @@ extern "C" { #define ZSTD_H_235446 /* ====== Dependency ======*/ +#include <limits.h> /* INT_MAX */ #include <stddef.h> /* size_t */ @@ -71,7 +72,7 @@ extern "C" { /*------ Version ------*/ #define ZSTD_VERSION_MAJOR 1 #define ZSTD_VERSION_MINOR 4 -#define ZSTD_VERSION_RELEASE 1 +#define ZSTD_VERSION_RELEASE 4 #define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE) ZSTDLIB_API unsigned ZSTD_versionNumber(void); /**< to check runtime library version */ @@ -196,9 +197,13 @@ ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void); ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); /*! ZSTD_compressCCtx() : - * Same as ZSTD_compress(), using an explicit ZSTD_CCtx - * The function will compress at requested compression level, - * ignoring any other parameter */ + * Same as ZSTD_compress(), using an explicit ZSTD_CCtx. + * Important : in order to behave similarly to `ZSTD_compress()`, + * this function compresses at requested compression level, + * __ignoring any other parameter__ . + * If any advanced parameter was set using the advanced API, + * they will all be reset. Only `compressionLevel` remains. + */ ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, @@ -233,7 +238,7 @@ ZSTDLIB_API size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx, * using ZSTD_CCtx_set*() functions. * Pushed parameters are sticky : they are valid for next compressed frame, and any subsequent frame. * "sticky" parameters are applicable to `ZSTD_compress2()` and `ZSTD_compressStream*()` ! - * They do not apply to "simple" one-shot variants such as ZSTD_compressCCtx() + * __They do not apply to "simple" one-shot variants such as ZSTD_compressCCtx()__ . * * It's possible to reset all parameters to "default" using ZSTD_CCtx_reset(). * @@ -261,18 +266,26 @@ typedef enum { /* compression parameters * Note: When compressing with a ZSTD_CDict these parameters are superseded - * by the parameters used to construct the ZSTD_CDict. See ZSTD_CCtx_refCDict() - * for more info (superseded-by-cdict). */ - ZSTD_c_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table + * by the parameters used to construct the ZSTD_CDict. + * See ZSTD_CCtx_refCDict() for more info (superseded-by-cdict). */ + ZSTD_c_compressionLevel=100, /* Set compression parameters according to pre-defined cLevel table. + * Note that exact compression parameters are dynamically determined, + * depending on both compression level and srcSize (when known). * Default level is ZSTD_CLEVEL_DEFAULT==3. * Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT. * Note 1 : it's possible to pass a negative compression level. - * Note 2 : setting a level sets all default values of other compression parameters */ + * Note 2 : setting a level resets all other compression parameters to default */ + /* Advanced compression parameters : + * It's possible to pin down compression parameters to some specific values. + * In which case, these values are no longer dynamically selected by the compressor */ ZSTD_c_windowLog=101, /* Maximum allowed back-reference distance, expressed as power of 2. + * This will set a memory budget for streaming decompression, + * with larger values requiring more memory + * and typically compressing more. * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX. * Special: value 0 means "use default windowLog". * Note: Using a windowLog greater than ZSTD_WINDOWLOG_LIMIT_DEFAULT - * requires explicitly allowing such window size at decompression stage if using streaming. */ + * requires explicitly allowing such size at streaming decompression stage. */ ZSTD_c_hashLog=102, /* Size of the initial probe table, as a power of 2. * Resulting memory usage is (1 << (hashLog+2)). * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX. @@ -283,13 +296,13 @@ typedef enum { * Resulting memory usage is (1 << (chainLog+2)). * Must be clamped between ZSTD_CHAINLOG_MIN and ZSTD_CHAINLOG_MAX. * Larger tables result in better and slower compression. - * This parameter is useless when using "fast" strategy. + * This parameter is useless for "fast" strategy. * It's still useful when using "dfast" strategy, * in which case it defines a secondary probe table. * Special: value 0 means "use default chainLog". */ ZSTD_c_searchLog=104, /* Number of search attempts, as a power of 2. * More attempts result in better and slower compression. - * This parameter is useless when using "fast" and "dFast" strategies. + * This parameter is useless for "fast" and "dFast" strategies. * Special: value 0 means "use default searchLog". */ ZSTD_c_minMatch=105, /* Minimum size of searched matches. * Note that Zstandard can still find matches of smaller size, @@ -344,7 +357,7 @@ typedef enum { ZSTD_c_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1) * Content size must be known at the beginning of compression. * This is automatically the case when using ZSTD_compress2(), - * For streaming variants, content size must be provided with ZSTD_CCtx_setPledgedSrcSize() */ + * For streaming scenarios, content size must be provided with ZSTD_CCtx_setPledgedSrcSize() */ ZSTD_c_checksumFlag=201, /* A 32-bits checksum of content is written at end of frame (default:0) */ ZSTD_c_dictIDFlag=202, /* When applicable, dictionary's ID is written into frame header (default:1) */ @@ -363,7 +376,7 @@ typedef enum { * Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads. * 0 means default, which is dynamically determined based on compression parameters. * Job size must be a minimum of overlap size, or 1 MB, whichever is largest. - * The minimum size is automatically and transparently enforced */ + * The minimum size is automatically and transparently enforced. */ ZSTD_c_overlapLog=402, /* Control the overlap size, as a fraction of window size. * The overlap size is an amount of data reloaded from previous job at the beginning of a new job. * It helps preserve compression ratio, while each job is compressed in parallel. @@ -386,6 +399,7 @@ typedef enum { * ZSTD_c_forceAttachDict * ZSTD_c_literalCompressionMode * ZSTD_c_targetCBlockSize + * ZSTD_c_srcSizeHint * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them. * note : never ever use experimentalParam? names directly; * also, the enums values themselves are unstable and can still change. @@ -396,6 +410,7 @@ typedef enum { ZSTD_c_experimentalParam4=1001, ZSTD_c_experimentalParam5=1002, ZSTD_c_experimentalParam6=1003, + ZSTD_c_experimentalParam7=1004 } ZSTD_cParameter; typedef struct { @@ -793,12 +808,17 @@ ZSTDLIB_API size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx, typedef struct ZSTD_CDict_s ZSTD_CDict; /*! ZSTD_createCDict() : - * When compressing multiple messages / blocks using the same dictionary, it's recommended to load it only once. - * ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup cost. + * When compressing multiple messages or blocks using the same dictionary, + * it's recommended to digest the dictionary only once, since it's a costly operation. + * ZSTD_createCDict() will create a state from digesting a dictionary. + * The resulting state can be used for future compression operations with very limited startup cost. * ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. - * `dictBuffer` can be released after ZSTD_CDict creation, because its content is copied within CDict. - * Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate `dictBuffer` content. - * Note : A ZSTD_CDict can be created from an empty dictBuffer, but it is inefficient when used to compress small data. */ + * @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict. + * Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content. + * Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer, + * in which case the only thing that it transports is the @compressionLevel. + * This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively, + * expecting a ZSTD_CDict parameter with any data, including those without a known dictionary. */ ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize, int compressionLevel); @@ -925,7 +945,7 @@ ZSTDLIB_API size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); * Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters. * It's a CPU consuming operation, with non-negligible impact on latency. * If there is a need to use the same prefix multiple times, consider loadDictionary instead. - * Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dm_rawContent). + * Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent). * Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation. */ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize); @@ -969,7 +989,7 @@ ZSTDLIB_API size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); * Note 2 : Prefix buffer is referenced. It **must** outlive decompression. * Prefix buffer must remain unmodified up to the end of frame, * reached when ZSTD_decompressStream() returns 0. - * Note 3 : By default, the prefix is treated as raw content (ZSTD_dm_rawContent). + * Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent). * Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section) * Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. * A full dictionary is more costly, as it requires building tables. @@ -1014,8 +1034,8 @@ ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); * Some of them might be removed in the future (especially when redundant with existing stable functions) * ***************************************************************************************/ -#define ZSTD_FRAMEHEADERSIZE_PREFIX 5 /* minimum input size required to query frame header size */ -#define ZSTD_FRAMEHEADERSIZE_MIN 6 +#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1) /* minimum input size required to query frame header size */ +#define ZSTD_FRAMEHEADERSIZE_MIN(format) ((format) == ZSTD_f_zstd1 ? 6 : 2) #define ZSTD_FRAMEHEADERSIZE_MAX 18 /* can be useful for static allocation */ #define ZSTD_SKIPPABLEHEADERSIZE 8 @@ -1063,6 +1083,8 @@ ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); /* Advanced parameter bounds */ #define ZSTD_TARGETCBLOCKSIZE_MIN 64 #define ZSTD_TARGETCBLOCKSIZE_MAX ZSTD_BLOCKSIZE_MAX +#define ZSTD_SRCSIZEHINT_MIN 0 +#define ZSTD_SRCSIZEHINT_MAX INT_MAX /* internal */ #define ZSTD_HASHLOG3_MAX 17 @@ -1073,6 +1095,24 @@ ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); typedef struct ZSTD_CCtx_params_s ZSTD_CCtx_params; typedef struct { + unsigned int matchPos; /* Match pos in dst */ + /* If seqDef.offset > 3, then this is seqDef.offset - 3 + * If seqDef.offset < 3, then this is the corresponding repeat offset + * But if seqDef.offset < 3 and litLength == 0, this is the + * repeat offset before the corresponding repeat offset + * And if seqDef.offset == 3 and litLength == 0, this is the + * most recent repeat offset - 1 + */ + unsigned int offset; + unsigned int litLength; /* Literal length */ + unsigned int matchLength; /* Match length */ + /* 0 when seq not rep and seqDef.offset otherwise + * when litLength == 0 this will be <= 4, otherwise <= 3 like normal + */ + unsigned int rep; +} ZSTD_Sequence; + +typedef struct { unsigned windowLog; /**< largest match distance : larger == more compression, more memory needed during decompression */ unsigned chainLog; /**< fully searched segment : larger == more compression, slower, more memory (useless for fast) */ unsigned hashLog; /**< dispatch table : larger == faster, more memory */ @@ -1101,21 +1141,12 @@ typedef enum { typedef enum { ZSTD_dlm_byCopy = 0, /**< Copy dictionary content internally */ - ZSTD_dlm_byRef = 1, /**< Reference dictionary content -- the dictionary buffer must outlive its users. */ + ZSTD_dlm_byRef = 1 /**< Reference dictionary content -- the dictionary buffer must outlive its users. */ } ZSTD_dictLoadMethod_e; typedef enum { - /* Opened question : should we have a format ZSTD_f_auto ? - * Today, it would mean exactly the same as ZSTD_f_zstd1. - * But, in the future, should several formats become supported, - * on the compression side, it would mean "default format". - * On the decompression side, it would mean "automatic format detection", - * so that ZSTD_f_zstd1 would mean "accept *only* zstd frames". - * Since meaning is a little different, another option could be to define different enums for compression and decompression. - * This question could be kept for later, when there are actually multiple formats to support, - * but there is also the question of pinning enum values, and pinning value `0` is especially important */ ZSTD_f_zstd1 = 0, /* zstd frame format, specified in zstd_compression_format.md (default) */ - ZSTD_f_zstd1_magicless = 1, /* Variant of zstd frame format, without initial 4-bytes magic number. + ZSTD_f_zstd1_magicless = 1 /* Variant of zstd frame format, without initial 4-bytes magic number. * Useful to save 4 bytes per generated frame. * Decoder cannot recognise automatically this format, requiring this instruction. */ } ZSTD_format_e; @@ -1126,7 +1157,7 @@ typedef enum { * to evolve and should be considered only in the context of extremely * advanced performance tuning. * - * Zstd currently supports the use of a CDict in two ways: + * Zstd currently supports the use of a CDict in three ways: * * - The contents of the CDict can be copied into the working context. This * means that the compression can search both the dictionary and input @@ -1142,6 +1173,12 @@ typedef enum { * working context's tables can be reused). For small inputs, this can be * faster than copying the CDict's tables. * + * - The CDict's tables are not used at all, and instead we use the working + * context alone to reload the dictionary and use params based on the source + * size. See ZSTD_compress_insertDictionary() and ZSTD_compress_usingDict(). + * This method is effective when the dictionary sizes are very small relative + * to the input size, and the input size is fairly large to begin with. + * * Zstd has a simple internal heuristic that selects which strategy to use * at the beginning of a compression. However, if experimentation shows that * Zstd is making poor choices, it is possible to override that choice with @@ -1150,6 +1187,7 @@ typedef enum { ZSTD_dictDefaultAttach = 0, /* Use the default heuristic. */ ZSTD_dictForceAttach = 1, /* Never copy the dictionary. */ ZSTD_dictForceCopy = 2, /* Always copy the dictionary. */ + ZSTD_dictForceLoad = 3 /* Always reload the dictionary */ } ZSTD_dictAttachPref_e; typedef enum { @@ -1158,7 +1196,7 @@ typedef enum { * levels will be compressed. */ ZSTD_lcm_huffman = 1, /**< Always attempt Huffman compression. Uncompressed literals will still be * emitted if Huffman compression is not profitable. */ - ZSTD_lcm_uncompressed = 2, /**< Always emit uncompressed literals. */ + ZSTD_lcm_uncompressed = 2 /**< Always emit uncompressed literals. */ } ZSTD_literalCompressionMode_e; @@ -1210,20 +1248,38 @@ ZSTDLIB_API unsigned long long ZSTD_decompressBound(const void* src, size_t srcS * or an error code (if srcSize is too small) */ ZSTDLIB_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize); +/*! ZSTD_getSequences() : + * Extract sequences from the sequence store + * zc can be used to insert custom compression params. + * This function invokes ZSTD_compress2 + * @return : number of sequences extracted + */ +ZSTDLIB_API size_t ZSTD_getSequences(ZSTD_CCtx* zc, ZSTD_Sequence* outSeqs, + size_t outSeqsSize, const void* src, size_t srcSize); + /*************************************** * Memory management ***************************************/ /*! ZSTD_estimate*() : - * These functions make it possible to estimate memory usage - * of a future {D,C}Ctx, before its creation. - * ZSTD_estimateCCtxSize() will provide a budget large enough for any compression level up to selected one. - * It will also consider src size to be arbitrarily "large", which is worst case. - * If srcSize is known to always be small, ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation. - * ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. - * ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParams_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_c_nbWorkers is >= 1. - * Note : CCtx size estimation is only correct for single-threaded compression. */ + * These functions make it possible to estimate memory usage of a future + * {D,C}Ctx, before its creation. + * + * ZSTD_estimateCCtxSize() will provide a budget large enough for any + * compression level up to selected one. Unlike ZSTD_estimateCStreamSize*(), + * this estimate does not include space for a window buffer, so this estimate + * is guaranteed to be enough for single-shot compressions, but not streaming + * compressions. It will however assume the input may be arbitrarily large, + * which is the worst case. If srcSize is known to always be small, + * ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation. + * ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with + * ZSTD_getCParams() to create cParams from compressionLevel. + * ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with + * ZSTD_CCtxParams_setParameter(). + * + * Note: only single-threaded compression is supported. This function will + * return an error code if ZSTD_c_nbWorkers is >= 1. */ ZSTDLIB_API size_t ZSTD_estimateCCtxSize(int compressionLevel); ZSTDLIB_API size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams); ZSTDLIB_API size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params); @@ -1334,7 +1390,8 @@ ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictS * Create a digested dictionary for compression * Dictionary content is just referenced, not duplicated. * As a consequence, `dictBuffer` **must** outlive CDict, - * and its content must remain unmodified throughout the lifetime of CDict. */ + * and its content must remain unmodified throughout the lifetime of CDict. + * note: equivalent to ZSTD_createCDict_advanced(), with dictLoadMethod==ZSTD_dlm_byRef */ ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel); /*! ZSTD_getCParams() : @@ -1361,7 +1418,9 @@ ZSTDLIB_API size_t ZSTD_checkCParams(ZSTD_compressionParameters params); ZSTDLIB_API ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize); /*! ZSTD_compress_advanced() : - * Same as ZSTD_compress_usingDict(), with fine-tune control over compression parameters (by structure) */ + * Note : this function is now DEPRECATED. + * It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_setParameter() and other parameter setters. + * This prototype will be marked as deprecated and generate compilation warning on reaching v1.5.x */ ZSTDLIB_API size_t ZSTD_compress_advanced(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, @@ -1369,7 +1428,9 @@ ZSTDLIB_API size_t ZSTD_compress_advanced(ZSTD_CCtx* cctx, ZSTD_parameters params); /*! ZSTD_compress_usingCDict_advanced() : - * Same as ZSTD_compress_usingCDict(), with fine-tune control over frame parameters */ + * Note : this function is now REDUNDANT. + * It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_loadDictionary() and other parameter setters. + * This prototype will be marked as deprecated and generate compilation warning in some future version */ ZSTDLIB_API size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, @@ -1441,6 +1502,12 @@ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* pre * There is no guarantee on compressed block size (default:0) */ #define ZSTD_c_targetCBlockSize ZSTD_c_experimentalParam6 +/* User's best guess of source size. + * Hint is not valid when srcSizeHint == 0. + * There is no guarantee that hint is close to actual source size, + * but compression ratio may regress significantly if guess considerably underestimates */ +#define ZSTD_c_srcSizeHint ZSTD_c_experimentalParam7 + /*! ZSTD_CCtx_getParameter() : * Get the requested compression parameter value, selected by enum ZSTD_cParameter, * and store it into int* value. @@ -1613,8 +1680,13 @@ ZSTDLIB_API size_t ZSTD_decompressStream_simpleArgs ( * pledgedSrcSize must be correct. If it is not known at init time, use * ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs, * "0" also disables frame content size field. It may be enabled in the future. + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ -ZSTDLIB_API size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize); +ZSTDLIB_API size_t +ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, + int compressionLevel, + unsigned long long pledgedSrcSize); + /**! ZSTD_initCStream_usingDict() : * This function is deprecated, and is equivalent to: * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); @@ -1623,42 +1695,66 @@ ZSTDLIB_API size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLe * * Creates of an internal CDict (incompatible with static CCtx), except if * dict == NULL or dictSize < 8, in which case no dict is used. - * Note: dict is loaded with ZSTD_dm_auto (treated as a full zstd dictionary if + * Note: dict is loaded with ZSTD_dct_auto (treated as a full zstd dictionary if * it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy. + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ -ZSTDLIB_API size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); +ZSTDLIB_API size_t +ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, + const void* dict, size_t dictSize, + int compressionLevel); + /**! ZSTD_initCStream_advanced() : * This function is deprecated, and is approximately equivalent to: * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); - * ZSTD_CCtx_setZstdParams(zcs, params); // Set the zstd params and leave the rest as-is + * // Pseudocode: Set each zstd parameter and leave the rest as-is. + * for ((param, value) : params) { + * ZSTD_CCtx_setParameter(zcs, param, value); + * } * ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); * ZSTD_CCtx_loadDictionary(zcs, dict, dictSize); * - * pledgedSrcSize must be correct. If srcSize is not known at init time, use - * value ZSTD_CONTENTSIZE_UNKNOWN. dict is loaded with ZSTD_dm_auto and ZSTD_dlm_byCopy. + * dict is loaded with ZSTD_dct_auto and ZSTD_dlm_byCopy. + * pledgedSrcSize must be correct. + * If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN. + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ -ZSTDLIB_API size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize, - ZSTD_parameters params, unsigned long long pledgedSrcSize); +ZSTDLIB_API size_t +ZSTD_initCStream_advanced(ZSTD_CStream* zcs, + const void* dict, size_t dictSize, + ZSTD_parameters params, + unsigned long long pledgedSrcSize); + /**! ZSTD_initCStream_usingCDict() : * This function is deprecated, and equivalent to: * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); * ZSTD_CCtx_refCDict(zcs, cdict); * * note : cdict will just be referenced, and must outlive compression session + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ ZSTDLIB_API size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict); + /**! ZSTD_initCStream_usingCDict_advanced() : - * This function is deprecated, and is approximately equivalent to: + * This function is DEPRECATED, and is approximately equivalent to: * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); - * ZSTD_CCtx_setZstdFrameParams(zcs, fParams); // Set the zstd frame params and leave the rest as-is + * // Pseudocode: Set each zstd frame parameter and leave the rest as-is. + * for ((fParam, value) : fParams) { + * ZSTD_CCtx_setParameter(zcs, fParam, value); + * } * ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); * ZSTD_CCtx_refCDict(zcs, cdict); * * same as ZSTD_initCStream_usingCDict(), with control over frame parameters. * pledgedSrcSize must be correct. If srcSize is not known at init time, use * value ZSTD_CONTENTSIZE_UNKNOWN. + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ -ZSTDLIB_API size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize); +ZSTDLIB_API size_t +ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, + const ZSTD_CDict* cdict, + ZSTD_frameParameters fParams, + unsigned long long pledgedSrcSize); /*! ZSTD_resetCStream() : * This function is deprecated, and is equivalent to: @@ -1673,6 +1769,7 @@ ZSTDLIB_API size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const * For the time being, pledgedSrcSize==0 is interpreted as "srcSize unknown" for compatibility with older programs, * but it will change to mean "empty" in future version, so use macro ZSTD_CONTENTSIZE_UNKNOWN instead. * @return : 0, or an error code (which can be tested using ZSTD_isError()) + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ ZSTDLIB_API size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize); @@ -1718,8 +1815,10 @@ ZSTDLIB_API size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx); * ZSTD_DCtx_loadDictionary(zds, dict, dictSize); * * note: no dictionary will be used if dict == NULL or dictSize < 8 + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ ZSTDLIB_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); + /** * This function is deprecated, and is equivalent to: * @@ -1727,14 +1826,17 @@ ZSTDLIB_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dic * ZSTD_DCtx_refDDict(zds, ddict); * * note : ddict is referenced, it must outlive decompression session + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ ZSTDLIB_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict); + /** * This function is deprecated, and is equivalent to: * * ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); * * re-use decompression parameters from previous init; saves dictionary loading + * Note : this prototype will be marked as deprecated and generate compilation warnings on reaching v1.5.x */ ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); @@ -1908,8 +2010,8 @@ ZSTDLIB_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx); /*! Block functions produce and decode raw zstd blocks, without frame metadata. - Frame metadata cost is typically ~18 bytes, which can be non-negligible for very small blocks (< 100 bytes). - User will have to take in charge required information to regenerate data, such as compressed and content sizes. + Frame metadata cost is typically ~12 bytes, which can be non-negligible for very small blocks (< 100 bytes). + But users will have to take in charge needed metadata to regenerate data, such as compressed and content sizes. A few rules to respect : - Compressing and decompressing require a context structure @@ -1920,12 +2022,14 @@ ZSTDLIB_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx); + copyCCtx() and copyDCtx() can be used too - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB + If input is larger than a block size, it's necessary to split input data into multiple blocks - + For inputs larger than a single block, really consider using regular ZSTD_compress() instead. - Frame metadata is not that costly, and quickly becomes negligible as source size grows larger. - - When a block is considered not compressible enough, ZSTD_compressBlock() result will be zero. - In which case, nothing is produced into `dst` ! - + User must test for such outcome and deal directly with uncompressed data - + ZSTD_decompressBlock() doesn't accept uncompressed data as input !!! + + For inputs larger than a single block, consider using regular ZSTD_compress() instead. + Frame metadata is not that costly, and quickly becomes negligible as source size grows larger than a block. + - When a block is considered not compressible enough, ZSTD_compressBlock() result will be 0 (zero) ! + ===> In which case, nothing is produced into `dst` ! + + User __must__ test for such outcome and deal directly with uncompressed data + + A block cannot be declared incompressible if ZSTD_compressBlock() return value was != 0. + Doing so would mess up with statistics history, leading to potential data corruption. + + ZSTD_decompressBlock() _doesn't accept uncompressed data as input_ !! + In case of multiple successive blocks, should some of them be uncompressed, decoder must be informed of their existence in order to follow proper history. Use ZSTD_insertBlock() for such a case. diff --git a/version.py b/version.py index 45817ed69f..fee6809551 100644 --- a/version.py +++ b/version.py @@ -2,7 +2,7 @@ short_name = "godot" name = "Godot Engine" major = 3 minor = 2 -status = "alpha" +status = "beta" module_config = "" year = 2019 website = "https://godotengine.org" |