diff options
1091 files changed, 34360 insertions, 20908 deletions
diff --git a/.gitignore b/.gitignore index f43f68f25f..0ee2a8b382 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Godot auto generated files *.gen.* +.import/ # Documentation generated by doxygen or from classes.xml doc/_build/ diff --git a/.travis.yml b/.travis.yml index b52e40200f..305544d821 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,10 @@ language: cpp # OS config, depends on actual 'os' in build matrix dist: xenial -sudo: false + +stages: + - check + - build env: global: @@ -18,6 +21,7 @@ cache: matrix: include: - name: Static checks (clang-format) + stage: check env: STATIC_CHECKS=yes os: linux compiler: gcc @@ -29,6 +33,7 @@ matrix: - clang-format-8 - name: Linux editor (debug, GCC 9, with Mono) + stage: build env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes" os: linux compiler: gcc-9 @@ -52,6 +57,7 @@ matrix: branch_pattern: coverity_scan - name: Linux export template (release, Clang) + stage: build env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes" os: linux compiler: clang @@ -61,22 +67,26 @@ matrix: - *linux_deps - name: Android export template (release_debug, Clang) + stage: build env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes" os: linux compiler: clang - name: macOS editor (debug, Clang) + stage: build env: PLATFORM=osx TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-clang os: osx compiler: clang - name: iOS export template (debug, Clang) + stage: build env: PLATFORM=iphone TOOLS=no TARGET=debug CACHE_NAME=${PLATFORM}-clang os: osx compiler: clang - - name: Linux headless editor (release_debug, GCC 9) - env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="warnings=extra werror=yes" + - name: Linux headless editor (release_debug, GCC 9, testing project exporting and script running) + stage: build + env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="warnings=extra werror=yes" TEST_PROJECT=yes os: linux compiler: gcc-9 addons: @@ -88,6 +98,7 @@ matrix: - *linux_deps - name: Linux export template (release_debug, GCC 5, without 3D support) + stage: build env: PLATFORM=x11 TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-gcc-5 EXTRA_ARGS="disable_3d=yes" os: linux compiler: gcc @@ -125,4 +136,10 @@ script: sh ./misc/travis/clang-format.sh; else scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS; + + if [ "$TEST_PROJECT" = "yes" ]; then + git clone --depth 1 "https://github.com/godotengine/godot-tests.git"; + sed -i "s:custom_template/release=\"\":custom_template/release=\"$(readlink -e bin/godot_server.x11.opt.tools.64)\":" godot-tests/tests/project_export/export_presets.cfg; + godot-tests/tests/project_export/test_project.sh "bin/godot_server.x11.opt.tools.64"; + fi fi diff --git a/AUTHORS.md b/AUTHORS.md index 43b4917382..430bb2dcd4 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -36,6 +36,7 @@ name is available. Andy Moss (MillionOstrich) Anish Bhobe (KidRigger) Anton Yabchinskiy (a12n) + Anutrix Aren Villanueva (kurikaesu) Ariel Manzur (punto-) Bastiaan Olij (BastiaanOlij) @@ -68,6 +69,7 @@ name is available. Gerrit Großkopf (Grosskopf) Gilles Roudiere (groud) Guilherme Felipe de C. G. da Silva (guilhermefelipecgs) + Hanif A (hbina) Hein-Pieter van Braam (hpvb) Hiroshi Ogawa (hi-ogawa) homer666 @@ -128,6 +130,7 @@ name is available. romulox-x Ruslan Mustakov (endragor) Saniko (sanikoyes) + santouits SaracenOne sersoong Simon Wenner (swenner) @@ -20,8 +20,8 @@ generous deed immortalized in the next stable release of Godot Engine. ## Mini sponsors + AD Ford Alan Beauchamp - Aleksandar Kordic Anandarup Mallik Andrew Dunai Brandon Lamb @@ -30,8 +30,10 @@ generous deed immortalized in the next stable release of Godot Engine. Christoph Woinke Denis Malyavin Edward Flick + Gamechuck GameDev.net GameDev.tv + Grady Hein-Pieter van Braam Jacob McKenney Javary Co. @@ -46,7 +48,6 @@ generous deed immortalized in the next stable release of Godot Engine. Patrick Aarstad Slobodan Milnovic Stephan Lanfermann - Stephen Telford Steve VilliHaukka Xananax @@ -59,7 +60,6 @@ generous deed immortalized in the next stable release of Godot Engine. David Gehrig Ed Morley Florian Krick - Grady Jakub Grzesik K9Kraken Manuele Finocchiaro @@ -77,11 +77,14 @@ generous deed immortalized in the next stable release of Godot Engine. Carlo Cabanilla Daniel James David Giardi + David Snopek Edward E Florian Breisch Gero + GiulianoB Javier Roman Jay Horton + Jonathan Turner Jon Smith Jon Woodward Justo Delgado Baudà @@ -89,13 +92,12 @@ generous deed immortalized in the next stable release of Godot Engine. Kommentgames Krzysztof Dluzniewski Luke + Maciej Pendolski Moonwards Mored1984 - paul gruenbacher Paul LaMotte Péter Magyar Rob Messick - Ross Esmond Ryan Badour Scott Wadden Sergey @@ -103,7 +105,6 @@ generous deed immortalized in the next stable release of Godot Engine. Svenne Krap Tom Langwaldt William Wold - Wyatt Goodin Alex Khayrullin Chris Goddard @@ -115,6 +116,7 @@ generous deed immortalized in the next stable release of Godot Engine. Ian Richard Kunert Ivan Trombley Joan Fons + Joshua Flores Krzysztof Jankowski Lord Bloodhound Lucas Ferreira Franca @@ -135,7 +137,6 @@ generous deed immortalized in the next stable release of Godot Engine. Xavier PATRICELLI Adam Neumann - Alessandra Pereyra Alexander J Maynard Alexey Dyadchenko Andrew Bowen @@ -150,7 +151,6 @@ generous deed immortalized in the next stable release of Godot Engine. Daniel Daniel Eichler David White - Deadly Lampshade Eric Eric Monson Eugenio Hugo Salgüero Jáñez @@ -158,7 +158,6 @@ generous deed immortalized in the next stable release of Godot Engine. Francisco Javier Moreno Carracedo gavlig GGGames.org - Giles Montgomery Guilherme Felipe de C. G. da Silva Heath Hayes Hysteria @@ -166,14 +165,12 @@ generous deed immortalized in the next stable release of Godot Engine. Jared White Jesse Nave Jose Malheiro - Joshua Flores Joshua Lesperance Juan T Chen Juraj Móza Kasper Jeppesen Klaus The. Klavdij Voncina - Leandro Voltolino Maarten Elings Markus Fehr Markus Wiesner @@ -190,6 +187,7 @@ generous deed immortalized in the next stable release of Godot Engine. Paul Hocker Paul Von Zimmerman Pete Goodwin + pl Ranoller Samuel Judd Scott Pilet @@ -198,37 +196,37 @@ generous deed immortalized in the next stable release of Godot Engine. Thomas Krampl Tobias Bocanegra Urho - WytRabbit Xavier Fumado Beltran ## Silver donors 1D_Inc + Abby Jones Abraham Haskins Adam Brunnmeier Adam Carr Adam Nakonieczny Adam Smeltzer Adisibio + Adrian Demetrescu Agustinus Arya Aidan O'Flannagain + Albin Jonasson Svärdsby Alder Stefano Alessandro Senese - Alexander Gillberg Alexander Koppe Alex Davies-Moore - Alice Robinson Andreas Evers Andreas Krampitz + Andreas Lundmark Andreas Schüle - Andrew Peart + Andrés RodrÃguez + Andrzej Skalski Anthony Bongiovanni Anthony Staunton Antony K. Jones Arda Erol - Artem Bashev Arthur S. Muszynski - Artistofdeath Aubrey Falconer Avencherus B A @@ -238,8 +236,6 @@ generous deed immortalized in the next stable release of Godot Engine. Benedikt Ben Phelan Ben Vercammen - Ben Woodley - Berbank Bernd Jänichen Black Block Blair Allen @@ -261,9 +257,9 @@ generous deed immortalized in the next stable release of Godot Engine. Collin Shooltz Dag Sundin Söderström Daniel Johnson + DanielMaximiano Daniel Reed - Danny Welch - Dave Watts + Daniel Tebbutt David Bullock David Cravens David May @@ -330,20 +326,23 @@ generous deed immortalized in the next stable release of Godot Engine. Josh 'Cheeseness' Bush Juanfran Juan Negrier + Juan Velandia Judd Jueast Julian Murgia + Kamuna Kasier Bald0 KC Chan + Keedong Park kickmaniac Kiyohiro Kawamura (kyorohiro) + Kjetil Haugland Klagsam Klassix KR McGinley KsyTek Games Kuan Cheang kycho - Leviathan Hunter Levi Lindsey Linus Lind Lundgren Lionel Gaillard @@ -357,6 +356,7 @@ generous deed immortalized in the next stable release of Godot Engine. Malik Nejer Marc Urlus Marcus Richter + Markus Lohaus Markus Michael Egger Martin Holas Matthew Little @@ -365,6 +365,7 @@ generous deed immortalized in the next stable release of Godot Engine. mhilbrunner Michael Dürwald Michael Gringauz + Michael Haney Michael Labbe Mikael Olsson Mikayla Hutchinson @@ -372,7 +373,6 @@ generous deed immortalized in the next stable release of Godot Engine. Mitchell J. Wagner mlevin cantu MoM - Moritz Laass MuffinManKen Natrim nee @@ -382,9 +382,11 @@ generous deed immortalized in the next stable release of Godot Engine. Niclas Eriksen Nicolás Montaña Nicolas SAN AGUSTIN + Nima Farid Nithin Jino NZ Omar Delarosa + omzee Oscar Norlander Pafka Pan Ip @@ -393,16 +395,19 @@ generous deed immortalized in the next stable release of Godot Engine. Paul Gieske Paul Mason PaweÅ‚ Kowal - Philip O. Staiger Pierre-Igor Berthet Pietro Vertechi Pitsanu Tongprasin Point08 Poryg + Rafael Delboni Rafa Laguna Rafal Wyszomirski + rainerLinux Raphael Leroux + Remi Rampin Rémi Verschelde + Rezgi Ricardo Alcantara Robert Farr (Larington) Robert Hernandez @@ -410,6 +415,8 @@ generous deed immortalized in the next stable release of Godot Engine. Roger Smith Roland RzÄ…sa Roman Tinkov + Ryan + Ryan Brooks Ryan Groom Ryan Hentz Saad Khoudmi @@ -418,6 +425,7 @@ generous deed immortalized in the next stable release of Godot Engine. Sasori Olkof Scott D. Yelich Sebastian Michailidis + sgnsajgon Shane Sicienski Shane Spoor Simon Ledam @@ -425,16 +433,14 @@ generous deed immortalized in the next stable release of Godot Engine. SK Sootstone Stonepyre - Thibault Barbaroux + Taylor Fahlman thomas Thomas Bell Thomas Kelly Thomas Kurz tiansheng li - Tim Tim Drumheller Tim Gudex - Timo Schmidt Timothy B. MacDonald Tobbun Tom Larrow @@ -446,8 +452,6 @@ generous deed immortalized in the next stable release of Godot Engine. Tyler Stafos UltyX Vaiktorg - Valeria Viana Gusmao - Veodok Victor Vigilant Watch waka nya @@ -457,7 +461,8 @@ generous deed immortalized in the next stable release of Godot Engine. Will William Hogben Wout Standaert - Yeung Si Xiang + Wyatt Goodin + Yegor ## Bronze donors diff --git a/SConstruct b/SConstruct index 7b0c644aea..128c5b0e92 100644 --- a/SConstruct +++ b/SConstruct @@ -311,6 +311,10 @@ if selected_platform in platform_list: # must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11) detect.configure(env) + # Enable C++11 support + if not env.msvc: + env.Append(CXXFLAGS=['-std=c++11']) + # Configure compiler warnings if env.msvc: # Truncations, narrowing conversions, signed/unsigned comparisons... @@ -422,7 +426,7 @@ if selected_platform in platform_list: if (can_build): config.configure(env) env.module_list.append(x) - + # Get doc classes paths (if present) try: doc_classes = config.get_doc_classes() @@ -480,6 +484,13 @@ if selected_platform in platform_list: if env['minizip']: env.Append(CPPDEFINES=['MINIZIP_ENABLED']) + editor_module_list = ['regex'] + for x in editor_module_list: + if not env['module_' + x + '_enabled']: + if env['tools']: + print("Build option 'module_" + x + "_enabled=no' cannot be used with 'tools=yes' (editor), only with 'tools=no' (export template).") + sys.exit(255) + if not env['verbose']: methods.no_verbose(sys, env) @@ -522,13 +533,23 @@ if selected_platform in platform_list: env.AppendUnique(CPPDEFINES=[header[1]]) elif selected_platform != "": + if selected_platform == "list": + print("The following platforms are available:\n") + else: + print('Invalid target platform "' + selected_platform + '".') + print("The following platforms were detected:\n") - print("Invalid target platform: " + selected_platform) - print("The following platforms were detected:") for x in platform_list: print("\t" + x) + print("\nPlease run SCons again and select a valid platform: platform=<string>") + if selected_platform == "list": + # Exit early to suppress the rest of the built-in SCons messages + sys.exit(0) + else: + sys.exit(255) + # The following only makes sense when the env is defined, and assumes it is if 'env' in locals(): screen = sys.stdout diff --git a/core/SCsub b/core/SCsub index 85e5f1b089..ed9a0a231d 100644 --- a/core/SCsub +++ b/core/SCsub @@ -159,6 +159,7 @@ env.CommandNoCache('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"] # Chain load SCsubs SConscript('os/SCsub') SConscript('math/SCsub') +SConscript('crypto/SCsub') SConscript('io/SCsub') SConscript('bind/SCsub') diff --git a/core/array.cpp b/core/array.cpp index a334af2c04..108d9f7386 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -133,18 +133,12 @@ void Array::erase(const Variant &p_value) { } Variant Array::front() const { - if (_p->array.size() == 0) { - ERR_EXPLAIN("Can't take value from empty array"); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(_p->array.size() == 0, Variant(), "Can't take value from empty array."); return operator[](0); } Variant Array::back() const { - if (_p->array.size() == 0) { - ERR_EXPLAIN("Can't take value from empty array"); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(_p->array.size() == 0, Variant(), "Can't take value from empty array."); return operator[](_p->array.size() - 1); } diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 34bbdb2c75..8e0d156438 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -30,11 +30,11 @@ #include "core_bind.h" +#include "core/crypto/crypto_core.h" #include "core/io/file_access_compressed.h" #include "core/io/file_access_encrypted.h" #include "core/io/json.h" #include "core/io/marshalls.h" -#include "core/math/crypto_core.h" #include "core/math/geometry.h" #include "core/os/keyboard.h" #include "core/os/os.h" @@ -73,10 +73,7 @@ RES _ResourceLoader::load(const String &p_path, const String &p_type_hint, bool Error err = OK; RES ret = ResourceLoader::load(p_path, p_type_hint, p_no_cache, &err); - if (err != OK) { - ERR_EXPLAIN("Error loading resource: '" + p_path + "'"); - ERR_FAIL_V(ret); - } + ERR_FAIL_COND_V_MSG(err != OK, ret, "Error loading resource: '" + p_path + "'."); return ret; } @@ -148,10 +145,7 @@ _ResourceLoader::_ResourceLoader() { } Error _ResourceSaver::save(const String &p_path, const RES &p_resource, SaverFlags p_flags) { - if (p_resource.is_null()) { - ERR_EXPLAIN("Can't save empty resource to path: " + String(p_path)) - ERR_FAIL_V(ERR_INVALID_PARAMETER); - } + ERR_FAIL_COND_V_MSG(p_resource.is_null(), ERR_INVALID_PARAMETER, "Can't save empty resource to path: " + String(p_path) + "."); return ResourceSaver::save(p_path, p_resource, p_flags); } @@ -727,22 +721,16 @@ int64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const { { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; - ERR_EXPLAIN("Invalid second value of: " + itos(second)); - ERR_FAIL_COND_V(second > 59, 0); + ERR_FAIL_COND_V_MSG(second > 59, 0, "Invalid second value of: " + itos(second) + "."); - ERR_EXPLAIN("Invalid minute value of: " + itos(minute)); - ERR_FAIL_COND_V(minute > 59, 0); + ERR_FAIL_COND_V_MSG(minute > 59, 0, "Invalid minute value of: " + itos(minute) + "."); - ERR_EXPLAIN("Invalid hour value of: " + itos(hour)); - ERR_FAIL_COND_V(hour > 23, 0); + ERR_FAIL_COND_V_MSG(hour > 23, 0, "Invalid hour value of: " + itos(hour) + "."); - ERR_EXPLAIN("Invalid month value of: " + itos(month)); - ERR_FAIL_COND_V(month > 12 || month == 0, 0); + ERR_FAIL_COND_V_MSG(month > 12 || month == 0, 0, "Invalid month value of: " + itos(month) + "."); // Do this check after month is tested as valid - ERR_EXPLAIN("Invalid day value of: " + itos(day) + " which is larger than " + itos(MONTH_DAYS_TABLE[LEAPYEAR(year)][month - 1]) + " or 0"); - ERR_FAIL_COND_V(day > MONTH_DAYS_TABLE[LEAPYEAR(year)][month - 1] || day == 0, 0); - + ERR_FAIL_COND_V_MSG(day > MONTH_DAYS_TABLE[LEAPYEAR(year)][month - 1] || day == 0, 0, "Invalid day value of: " + itos(day) + " which is larger than " + itos(MONTH_DAYS_TABLE[LEAPYEAR(year)][month - 1]) + " or 0."); // Calculate all the seconds from months past in this year uint64_t SECONDS_FROM_MONTHS_PAST_THIS_YEAR = DAYS_PAST_THIS_YEAR_TABLE[LEAPYEAR(year)][month - 1] * SECONDS_PER_DAY; @@ -2621,8 +2609,7 @@ void _Thread::_start_func(void *ud) { } } - ERR_EXPLAIN("Could not call function '" + t->target_method.operator String() + "'' starting thread ID: " + t->get_id() + " Reason: " + reason); - ERR_FAIL(); + ERR_FAIL_MSG("Could not call function '" + t->target_method.operator String() + "'' starting thread ID: " + t->get_id() + " Reason: " + reason + "."); } } @@ -2704,10 +2691,7 @@ _Thread::_Thread() { _Thread::~_Thread() { - if (active) { - ERR_EXPLAIN("Reference to a Thread object object was lost while the thread is still running..."); - } - ERR_FAIL_COND(active); + ERR_FAIL_COND_MSG(active, "Reference to a Thread object object was lost while the thread is still running..."); } ///////////////////////////////////// @@ -2941,6 +2925,10 @@ float _Engine::get_physics_jitter_fix() const { return Engine::get_singleton()->get_physics_jitter_fix(); } +float _Engine::get_physics_interpolation_fraction() const { + return Engine::get_singleton()->get_physics_interpolation_fraction(); +} + void _Engine::set_target_fps(int p_fps) { Engine::get_singleton()->set_target_fps(p_fps); } @@ -3029,6 +3017,7 @@ void _Engine::_bind_methods() { ClassDB::bind_method(D_METHOD("get_iterations_per_second"), &_Engine::get_iterations_per_second); ClassDB::bind_method(D_METHOD("set_physics_jitter_fix", "physics_jitter_fix"), &_Engine::set_physics_jitter_fix); ClassDB::bind_method(D_METHOD("get_physics_jitter_fix"), &_Engine::get_physics_jitter_fix); + ClassDB::bind_method(D_METHOD("get_physics_interpolation_fraction"), &_Engine::get_physics_interpolation_fraction); ClassDB::bind_method(D_METHOD("set_target_fps", "target_fps"), &_Engine::set_target_fps); ClassDB::bind_method(D_METHOD("get_target_fps"), &_Engine::get_target_fps); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 3be5a08752..f0f86e003f 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -746,6 +746,7 @@ public: void set_physics_jitter_fix(float p_threshold); float get_physics_jitter_fix() const; + float get_physics_interpolation_fraction() const; void set_target_fps(int p_fps); int get_target_fps() const; diff --git a/core/class_db.cpp b/core/class_db.cpp index 794d990083..3ad59bc309 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -480,6 +480,7 @@ uint64_t ClassDB::get_api_hash(APIType p_api) { for (List<StringName>::Element *F = snames.front(); F; F = F->next()) { PropertySetGet *psg = t->property_setget.getptr(F->get()); + ERR_FAIL_COND_V(!psg, 0); hash = hash_djb2_one_64(F->get().hash(), hash); hash = hash_djb2_one_64(psg->setter.hash(), hash); @@ -835,10 +836,7 @@ void ClassDB::add_signal(StringName p_class, const MethodInfo &p_signal) { #ifdef DEBUG_METHODS_ENABLED ClassInfo *check = type; while (check) { - if (check->signal_map.has(sname)) { - ERR_EXPLAIN("Type " + String(p_class) + " already has signal: " + String(sname)); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(check->signal_map.has(sname), "Type " + String(p_class) + " already has signal: " + String(sname) + "."); check = check->inherits_ptr; } #endif @@ -923,16 +921,11 @@ void ClassDB::add_property(StringName p_class, const PropertyInfo &p_pinfo, cons if (p_setter) { mb_set = get_method(p_class, p_setter); #ifdef DEBUG_METHODS_ENABLED - if (!mb_set) { - ERR_EXPLAIN("Invalid Setter: " + p_class + "::" + p_setter + " for property: " + p_pinfo.name); - ERR_FAIL(); - } else { - int exp_args = 1 + (p_index >= 0 ? 1 : 0); - if (mb_set->get_argument_count() != exp_args) { - ERR_EXPLAIN("Invalid Function for Setter: " + p_class + "::" + p_setter + " for property: " + p_pinfo.name); - ERR_FAIL(); - } - } + + ERR_FAIL_COND_MSG(!mb_set, "Invalid setter: " + p_class + "::" + p_setter + " for property: " + p_pinfo.name + "."); + + int exp_args = 1 + (p_index >= 0 ? 1 : 0); + ERR_FAIL_COND_MSG(mb_set->get_argument_count() != exp_args, "Invalid function for setter: " + p_class + "::" + p_setter + " for property: " + p_pinfo.name + "."); #endif } @@ -942,25 +935,15 @@ void ClassDB::add_property(StringName p_class, const PropertyInfo &p_pinfo, cons mb_get = get_method(p_class, p_getter); #ifdef DEBUG_METHODS_ENABLED - if (!mb_get) { - ERR_EXPLAIN("Invalid Getter: " + p_class + "::" + p_getter + " for property: " + p_pinfo.name); - ERR_FAIL(); - } else { + ERR_FAIL_COND_MSG(!mb_get, "Invalid getter: " + p_class + "::" + p_getter + " for property: " + p_pinfo.name + "."); - int exp_args = 0 + (p_index >= 0 ? 1 : 0); - if (mb_get->get_argument_count() != exp_args) { - ERR_EXPLAIN("Invalid Function for Getter: " + p_class + "::" + p_getter + " for property: " + p_pinfo.name); - ERR_FAIL(); - } - } + int exp_args = 0 + (p_index >= 0 ? 1 : 0); + ERR_FAIL_COND_MSG(mb_get->get_argument_count() != exp_args, "Invalid function for getter: " + p_class + "::" + p_getter + " for property: " + p_pinfo.name + "."); #endif } #ifdef DEBUG_METHODS_ENABLED - if (type->property_setget.has(p_pinfo.name)) { - ERR_EXPLAIN("Object " + p_class + " already has property: " + p_pinfo.name); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(type->property_setget.has(p_pinfo.name), "Object " + p_class + " already has property: " + p_pinfo.name + "."); #endif OBJTYPE_WLOCK @@ -1239,32 +1222,26 @@ MethodBind *ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind, const c #ifdef DEBUG_ENABLED - if (has_method(instance_type, mdname)) { - ERR_EXPLAIN("Class " + String(instance_type) + " already has a method " + String(mdname)); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(has_method(instance_type, mdname), NULL, "Class " + String(instance_type) + " already has a method " + String(mdname) + "."); #endif ClassInfo *type = classes.getptr(instance_type); if (!type) { - ERR_PRINTS("Couldn't bind method '" + mdname + "' for instance: " + instance_type); memdelete(p_bind); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Couldn't bind method '" + mdname + "' for instance: " + instance_type + "."); } if (type->method_map.has(mdname)) { memdelete(p_bind); // overloading not supported - ERR_EXPLAIN("Method already bound: " + instance_type + "::" + mdname); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Method already bound: " + instance_type + "::" + mdname + "."); } #ifdef DEBUG_METHODS_ENABLED if (method_name.args.size() > p_bind->get_argument_count()) { memdelete(p_bind); - ERR_EXPLAIN("Method definition provides more arguments than the method actually has: " + instance_type + "::" + mdname); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Method definition provides more arguments than the method actually has: " + instance_type + "::" + mdname + "."); } p_bind->set_argument_names(method_name.args); diff --git a/core/class_db.h b/core/class_db.h index 3d9a695f02..092469beb7 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -35,10 +35,6 @@ #include "core/object.h" #include "core/print_string.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - /** To bind more then 6 parameters include this: * #include "core/method_bind_ext.gen.inc" */ @@ -310,8 +306,7 @@ public: if (type->method_map.has(p_name)) { memdelete(bind); // overloading not supported - ERR_EXPLAIN("Method already bound: " + instance_type + "::" + p_name); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Method already bound: " + instance_type + "::" + p_name + "."); } type->method_map[p_name] = bind; #ifdef DEBUG_METHODS_ENABLED diff --git a/core/color.cpp b/core/color.cpp index 1843532124..a54a3115cc 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -335,36 +335,23 @@ Color Color::html(const String &p_color) { } else if (color.length() == 6) { alpha = false; } else { - ERR_EXPLAIN("Invalid Color Code: " + p_color); - ERR_FAIL_V(Color()); + ERR_FAIL_V_MSG(Color(), "Invalid color code: " + p_color + "."); } int a = 255; if (alpha) { a = _parse_col(color, 0); - if (a < 0) { - ERR_EXPLAIN("Invalid Color Code: " + p_color); - ERR_FAIL_V(Color()); - } + ERR_FAIL_COND_V_MSG(a < 0, Color(), "Invalid color code: " + p_color + "."); } int from = alpha ? 2 : 0; int r = _parse_col(color, from + 0); - if (r < 0) { - ERR_EXPLAIN("Invalid Color Code: " + p_color); - ERR_FAIL_V(Color()); - } + ERR_FAIL_COND_V_MSG(r < 0, Color(), "Invalid color code: " + p_color + "."); int g = _parse_col(color, from + 2); - if (g < 0) { - ERR_EXPLAIN("Invalid Color Code: " + p_color); - ERR_FAIL_V(Color()); - } + ERR_FAIL_COND_V_MSG(g < 0, Color(), "Invalid color code: " + p_color + "."); int b = _parse_col(color, from + 4); - if (b < 0) { - ERR_EXPLAIN("Invalid Color Code: " + p_color); - ERR_FAIL_V(Color()); - } + ERR_FAIL_COND_V_MSG(b < 0, Color(), "Invalid color code: " + p_color + "."); return Color(r / 255.0, g / 255.0, b / 255.0, a / 255.0); } @@ -425,12 +412,8 @@ Color Color::named(const String &p_name) { name = name.to_lower(); const Map<String, Color>::Element *color = _named_colors.find(name); - if (color) { - return color->value(); - } else { - ERR_EXPLAIN("Invalid Color Name: " + p_name); - ERR_FAIL_V(Color()); - } + ERR_FAIL_NULL_V_MSG(color, Color(), "Invalid color name: " + p_name + "."); + return color->value(); } String _to_hex(float p_val) { @@ -523,8 +506,7 @@ Color Color::from_hsv(float p_h, float p_s, float p_v, float p_a) const { // FIXME: Remove once Godot 3.1 has been released float Color::gray() const { - ERR_EXPLAIN("Color.gray() is deprecated and will be removed in a future version. Use Color.get_v() for a better grayscale approximation."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("Color.gray() is deprecated and will be removed in a future version. Use Color.get_v() for a better grayscale approximation."); return (r + g + b) / 3.0; } diff --git a/core/color.h b/core/color.h index 77f95b5dc9..8fb78d1ced 100644 --- a/core/color.h +++ b/core/color.h @@ -33,9 +33,7 @@ #include "core/math/math_funcs.h" #include "core/ustring.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + struct Color { union { diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h index 3789eda5db..98f5bc56d7 100644 --- a/core/command_queue_mt.h +++ b/core/command_queue_mt.h @@ -37,10 +37,6 @@ #include "core/simple_type.h" #include "core/typedefs.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #define COMMA(N) _COMMA_##N #define _COMMA_0 #define _COMMA_1 , diff --git a/core/crypto/SCsub b/core/crypto/SCsub new file mode 100644 index 0000000000..0a3f05d87a --- /dev/null +++ b/core/crypto/SCsub @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +Import('env') + +env_crypto = env.Clone() + +is_builtin = env["builtin_mbedtls"] +has_module = env["module_mbedtls_enabled"] + +if is_builtin or not has_module: + # Use our headers for builtin or if the module is not going to be compiled. + # We decided not to depend on system mbedtls just for these few files that can + # be easily extracted. + env_crypto.Prepend(CPPPATH=["#thirdparty/mbedtls/include"]) + +# MbedTLS core functions (for CryptoCore). +# If the mbedtls module is compiled we don't need to add the .c files with our +# custom config since they will be built by the module itself. +# Only if the module is not enabled, we must compile here the required sources +# to make a "light" build with only the necessary mbedtls files. +if not has_module: + env_thirdparty = env_crypto.Clone() + env_thirdparty.disable_warnings() + # Custom config file + env_thirdparty.Append(CPPDEFINES=[('MBEDTLS_CONFIG_FILE', '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')]) + thirdparty_mbedtls_dir = "#thirdparty/mbedtls/library/" + thirdparty_mbedtls_sources = [ + "aes.c", + "base64.c", + "md5.c", + "sha1.c", + "sha256.c", + "godot_core_mbedtls_platform.c" + ] + thirdparty_mbedtls_sources = [thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources] + env_thirdparty.add_source_files(env.core_sources, thirdparty_mbedtls_sources) + +env_crypto.add_source_files(env.core_sources, "*.cpp") diff --git a/core/crypto/crypto.cpp b/core/crypto/crypto.cpp new file mode 100644 index 0000000000..925a01b36a --- /dev/null +++ b/core/crypto/crypto.cpp @@ -0,0 +1,170 @@ +/*************************************************************************/ +/* crypto.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "crypto.h" + +#include "core/engine.h" +#include "core/io/certs_compressed.gen.h" +#include "core/io/compression.h" + +/// Resources + +CryptoKey *(*CryptoKey::_create)() = NULL; +CryptoKey *CryptoKey::create() { + if (_create) + return _create(); + return NULL; +} + +void CryptoKey::_bind_methods() { + ClassDB::bind_method(D_METHOD("save", "path"), &CryptoKey::save); + ClassDB::bind_method(D_METHOD("load", "path"), &CryptoKey::load); +} + +X509Certificate *(*X509Certificate::_create)() = NULL; +X509Certificate *X509Certificate::create() { + if (_create) + return _create(); + return NULL; +} + +void X509Certificate::_bind_methods() { + ClassDB::bind_method(D_METHOD("save", "path"), &X509Certificate::save); + ClassDB::bind_method(D_METHOD("load", "path"), &X509Certificate::load); +} + +/// Crypto + +void (*Crypto::_load_default_certificates)(String p_path) = NULL; +Crypto *(*Crypto::_create)() = NULL; +Crypto *Crypto::create() { + if (_create) + return _create(); + return memnew(Crypto); +} + +void Crypto::load_default_certificates(String p_path) { + + if (_load_default_certificates) + _load_default_certificates(p_path); +} + +void Crypto::_bind_methods() { + ClassDB::bind_method(D_METHOD("generate_random_bytes", "size"), &Crypto::generate_random_bytes); + ClassDB::bind_method(D_METHOD("generate_rsa", "size"), &Crypto::generate_rsa); + ClassDB::bind_method(D_METHOD("generate_self_signed_certificate", "key", "issuer_name", "not_before", "not_after"), &Crypto::generate_self_signed_certificate, DEFVAL("CN=myserver,O=myorganisation,C=IT"), DEFVAL("20140101000000"), DEFVAL("20340101000000")); +} + +PoolByteArray Crypto::generate_random_bytes(int p_bytes) { + ERR_FAIL_V_MSG(PoolByteArray(), "generate_random_bytes is not available when mbedtls module is disabled."); +} + +Ref<CryptoKey> Crypto::generate_rsa(int p_bytes) { + ERR_FAIL_V_MSG(NULL, "generate_rsa is not available when mbedtls module is disabled."); +} + +Ref<X509Certificate> Crypto::generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after) { + ERR_FAIL_V_MSG(NULL, "generate_self_signed_certificate is not available when mbedtls module is disabled."); +} + +Crypto::Crypto() { +} + +/// Resource loader/saver + +RES ResourceFormatLoaderCrypto::load(const String &p_path, const String &p_original_path, Error *r_error) { + + String el = p_path.get_extension().to_lower(); + if (el == "crt") { + X509Certificate *cert = X509Certificate::create(); + if (cert) + cert->load(p_path); + return cert; + } else if (el == "key") { + CryptoKey *key = CryptoKey::create(); + if (key) + key->load(p_path); + return key; + } + return NULL; +} + +void ResourceFormatLoaderCrypto::get_recognized_extensions(List<String> *p_extensions) const { + + p_extensions->push_back("crt"); + p_extensions->push_back("key"); +} + +bool ResourceFormatLoaderCrypto::handles_type(const String &p_type) const { + + return p_type == "X509Certificate" || p_type == "CryptoKey"; +} + +String ResourceFormatLoaderCrypto::get_resource_type(const String &p_path) const { + + String el = p_path.get_extension().to_lower(); + if (el == "crt") + return "X509Certificate"; + else if (el == "key") + return "CryptoKey"; + return ""; +} + +Error ResourceFormatSaverCrypto::save(const String &p_path, const RES &p_resource, uint32_t p_flags) { + + Error err; + Ref<X509Certificate> cert = p_resource; + Ref<CryptoKey> key = p_resource; + if (cert.is_valid()) { + err = cert->save(p_path); + } else if (key.is_valid()) { + err = key->save(p_path); + } else { + ERR_FAIL_V(ERR_INVALID_PARAMETER); + } + ERR_FAIL_COND_V(err != OK, err); + return OK; +} + +void ResourceFormatSaverCrypto::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { + + const X509Certificate *cert = Object::cast_to<X509Certificate>(*p_resource); + const CryptoKey *key = Object::cast_to<CryptoKey>(*p_resource); + if (cert) { + p_extensions->push_back("crt"); + } + if (key) { + p_extensions->push_back("key"); + } +} +bool ResourceFormatSaverCrypto::recognize(const RES &p_resource) const { + + return Object::cast_to<X509Certificate>(*p_resource) || Object::cast_to<CryptoKey>(*p_resource); +} diff --git a/core/crypto/crypto.h b/core/crypto/crypto.h new file mode 100644 index 0000000000..2de81f5b57 --- /dev/null +++ b/core/crypto/crypto.h @@ -0,0 +1,105 @@ +/*************************************************************************/ +/* crypto.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef CRYPTO_H +#define CRYPTO_H + +#include "core/reference.h" +#include "core/resource.h" + +#include "core/io/resource_loader.h" +#include "core/io/resource_saver.h" + +class CryptoKey : public Resource { + GDCLASS(CryptoKey, Resource); + +protected: + static void _bind_methods(); + static CryptoKey *(*_create)(); + +public: + static CryptoKey *create(); + virtual Error load(String p_path) = 0; + virtual Error save(String p_path) = 0; +}; + +class X509Certificate : public Resource { + GDCLASS(X509Certificate, Resource); + +protected: + static void _bind_methods(); + static X509Certificate *(*_create)(); + +public: + static X509Certificate *create(); + virtual Error load(String p_path) = 0; + virtual Error load_from_memory(const uint8_t *p_buffer, int p_len) = 0; + virtual Error save(String p_path) = 0; +}; + +class Crypto : public Reference { + GDCLASS(Crypto, Reference); + +protected: + static void _bind_methods(); + static Crypto *(*_create)(); + static void (*_load_default_certificates)(String p_path); + +public: + static Crypto *create(); + static void load_default_certificates(String p_path); + + virtual PoolByteArray generate_random_bytes(int p_bytes); + virtual Ref<CryptoKey> generate_rsa(int p_bytes); + virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after); + + Crypto(); +}; + +class ResourceFormatLoaderCrypto : public ResourceFormatLoader { + GDCLASS(ResourceFormatLoaderCrypto, ResourceFormatLoader); + +public: + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL); + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual bool handles_type(const String &p_type) const; + virtual String get_resource_type(const String &p_path) const; +}; + +class ResourceFormatSaverCrypto : public ResourceFormatSaver { + GDCLASS(ResourceFormatSaverCrypto, ResourceFormatSaver); + +public: + virtual Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0); + virtual void get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const; + virtual bool recognize(const RES &p_resource) const; +}; + +#endif // CRYPTO_H diff --git a/core/math/crypto_core.cpp b/core/crypto/crypto_core.cpp index d7ba54e469..51c2e3c9e5 100644 --- a/core/math/crypto_core.cpp +++ b/core/crypto/crypto_core.cpp @@ -52,7 +52,7 @@ Error CryptoCore::MD5Context::start() { return ret ? FAILED : OK; } -Error CryptoCore::MD5Context::update(uint8_t *p_src, size_t p_len) { +Error CryptoCore::MD5Context::update(const uint8_t *p_src, size_t p_len) { int ret = mbedtls_md5_update_ret((mbedtls_md5_context *)ctx, p_src, p_len); return ret ? FAILED : OK; } @@ -62,6 +62,32 @@ Error CryptoCore::MD5Context::finish(unsigned char r_hash[16]) { return ret ? FAILED : OK; } +// SHA1 +CryptoCore::SHA1Context::SHA1Context() { + ctx = memalloc(sizeof(mbedtls_sha1_context)); + mbedtls_sha1_init((mbedtls_sha1_context *)ctx); +} + +CryptoCore::SHA1Context::~SHA1Context() { + mbedtls_sha1_free((mbedtls_sha1_context *)ctx); + memfree((mbedtls_sha1_context *)ctx); +} + +Error CryptoCore::SHA1Context::start() { + int ret = mbedtls_sha1_starts_ret((mbedtls_sha1_context *)ctx); + return ret ? FAILED : OK; +} + +Error CryptoCore::SHA1Context::update(const uint8_t *p_src, size_t p_len) { + int ret = mbedtls_sha1_update_ret((mbedtls_sha1_context *)ctx, p_src, p_len); + return ret ? FAILED : OK; +} + +Error CryptoCore::SHA1Context::finish(unsigned char r_hash[20]) { + int ret = mbedtls_sha1_finish_ret((mbedtls_sha1_context *)ctx, r_hash); + return ret ? FAILED : OK; +} + // SHA256 CryptoCore::SHA256Context::SHA256Context() { ctx = memalloc(sizeof(mbedtls_sha256_context)); @@ -78,12 +104,12 @@ Error CryptoCore::SHA256Context::start() { return ret ? FAILED : OK; } -Error CryptoCore::SHA256Context::update(uint8_t *p_src, size_t p_len) { +Error CryptoCore::SHA256Context::update(const uint8_t *p_src, size_t p_len) { int ret = mbedtls_sha256_update_ret((mbedtls_sha256_context *)ctx, p_src, p_len); return ret ? FAILED : OK; } -Error CryptoCore::SHA256Context::finish(unsigned char r_hash[16]) { +Error CryptoCore::SHA256Context::finish(unsigned char r_hash[32]) { int ret = mbedtls_sha256_finish_ret((mbedtls_sha256_context *)ctx, r_hash); return ret ? FAILED : OK; } diff --git a/core/math/crypto_core.h b/core/crypto/crypto_core.h index e28cb5a792..c859d612d4 100644 --- a/core/math/crypto_core.h +++ b/core/crypto/crypto_core.h @@ -46,10 +46,24 @@ public: ~MD5Context(); Error start(); - Error update(uint8_t *p_src, size_t p_len); + Error update(const uint8_t *p_src, size_t p_len); Error finish(unsigned char r_hash[16]); }; + class SHA1Context { + + private: + void *ctx; // To include, or not to include... + + public: + SHA1Context(); + ~SHA1Context(); + + Error start(); + Error update(const uint8_t *p_src, size_t p_len); + Error finish(unsigned char r_hash[20]); + }; + class SHA256Context { private: @@ -60,8 +74,8 @@ public: ~SHA256Context(); Error start(); - Error update(uint8_t *p_src, size_t p_len); - Error finish(unsigned char r_hash[16]); + Error update(const uint8_t *p_src, size_t p_len); + Error finish(unsigned char r_hash[32]); }; class AESContext { diff --git a/core/crypto/hashing_context.cpp b/core/crypto/hashing_context.cpp new file mode 100644 index 0000000000..bdccb258dd --- /dev/null +++ b/core/crypto/hashing_context.cpp @@ -0,0 +1,137 @@ +/*************************************************************************/ +/* hashing_context.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "hashing_context.h" + +#include "core/crypto/crypto_core.h" + +Error HashingContext::start(HashType p_type) { + ERR_FAIL_COND_V(ctx != NULL, ERR_ALREADY_IN_USE); + _create_ctx(p_type); + ERR_FAIL_COND_V(ctx == NULL, ERR_UNAVAILABLE); + switch (type) { + case HASH_MD5: + return ((CryptoCore::MD5Context *)ctx)->start(); + case HASH_SHA1: + return ((CryptoCore::SHA1Context *)ctx)->start(); + case HASH_SHA256: + return ((CryptoCore::SHA256Context *)ctx)->start(); + } + return ERR_UNAVAILABLE; +} + +Error HashingContext::update(PoolByteArray p_chunk) { + ERR_FAIL_COND_V(ctx == NULL, ERR_UNCONFIGURED); + size_t len = p_chunk.size(); + PoolByteArray::Read r = p_chunk.read(); + switch (type) { + case HASH_MD5: + return ((CryptoCore::MD5Context *)ctx)->update(&r[0], len); + case HASH_SHA1: + return ((CryptoCore::SHA1Context *)ctx)->update(&r[0], len); + case HASH_SHA256: + return ((CryptoCore::SHA256Context *)ctx)->update(&r[0], len); + } + return ERR_UNAVAILABLE; +} + +PoolByteArray HashingContext::finish() { + ERR_FAIL_COND_V(ctx == NULL, PoolByteArray()); + PoolByteArray out; + Error err = FAILED; + switch (type) { + case HASH_MD5: + out.resize(16); + err = ((CryptoCore::MD5Context *)ctx)->finish(out.write().ptr()); + break; + case HASH_SHA1: + out.resize(20); + err = ((CryptoCore::SHA1Context *)ctx)->finish(out.write().ptr()); + break; + case HASH_SHA256: + out.resize(32); + err = ((CryptoCore::SHA256Context *)ctx)->finish(out.write().ptr()); + break; + } + _delete_ctx(); + ERR_FAIL_COND_V(err != OK, PoolByteArray()); + return out; +} + +void HashingContext::_create_ctx(HashType p_type) { + type = p_type; + switch (type) { + case HASH_MD5: + ctx = memnew(CryptoCore::MD5Context); + break; + case HASH_SHA1: + ctx = memnew(CryptoCore::SHA1Context); + break; + case HASH_SHA256: + ctx = memnew(CryptoCore::SHA256Context); + break; + default: + ctx = NULL; + } +} + +void HashingContext::_delete_ctx() { + return; + switch (type) { + case HASH_MD5: + memdelete((CryptoCore::MD5Context *)ctx); + break; + case HASH_SHA1: + memdelete((CryptoCore::SHA1Context *)ctx); + break; + case HASH_SHA256: + memdelete((CryptoCore::SHA256Context *)ctx); + break; + } + ctx = NULL; +} + +void HashingContext::_bind_methods() { + ClassDB::bind_method(D_METHOD("start", "type"), &HashingContext::start); + ClassDB::bind_method(D_METHOD("update", "chunk"), &HashingContext::update); + ClassDB::bind_method(D_METHOD("finish"), &HashingContext::finish); + BIND_ENUM_CONSTANT(HASH_MD5); + BIND_ENUM_CONSTANT(HASH_SHA1); + BIND_ENUM_CONSTANT(HASH_SHA256); +} + +HashingContext::HashingContext() { + ctx = NULL; +} + +HashingContext::~HashingContext() { + if (ctx != NULL) + _delete_ctx(); +} diff --git a/core/crypto/hashing_context.h b/core/crypto/hashing_context.h new file mode 100644 index 0000000000..aa69636f2c --- /dev/null +++ b/core/crypto/hashing_context.h @@ -0,0 +1,66 @@ +/*************************************************************************/ +/* hashing_context.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef HASHING_CONTEXT_H +#define HASHING_CONTEXT_H + +#include "core/reference.h" + +class HashingContext : public Reference { + GDCLASS(HashingContext, Reference); + +public: + enum HashType { + HASH_MD5, + HASH_SHA1, + HASH_SHA256 + }; + +private: + void *ctx; + HashType type; + +protected: + static void _bind_methods(); + void _create_ctx(HashType p_type); + void _delete_ctx(); + +public: + Error start(HashType p_type); + Error update(PoolByteArray p_chunk); + PoolByteArray finish(); + + HashingContext(); + ~HashingContext(); +}; + +VARIANT_ENUM_CAST(HashingContext::HashType); + +#endif // HASHING_CONTEXT_H diff --git a/core/engine.cpp b/core/engine.cpp index 2d8473fbd9..937439faaf 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -197,10 +197,7 @@ void Engine::add_singleton(const Singleton &p_singleton) { Object *Engine::get_singleton_object(const String &p_name) const { const Map<StringName, Object *>::Element *E = singleton_ptrs.find(p_name); - if (!E) { - ERR_EXPLAIN("Failed to retrieve non-existent singleton '" + p_name + "'"); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!E, NULL, "Failed to retrieve non-existent singleton '" + p_name + "'."); return E->get(); }; @@ -227,6 +224,7 @@ Engine::Engine() { frames_drawn = 0; ips = 60; physics_jitter_fix = 0.5; + _physics_interpolation_fraction = 0.0f; _frame_delay = 0; _fps = 1; _target_fps = 0; diff --git a/core/engine.h b/core/engine.h index 15665fee29..192e8e67a0 100644 --- a/core/engine.h +++ b/core/engine.h @@ -63,6 +63,7 @@ private: float _time_scale; bool _pixel_snap; uint64_t _physics_frames; + float _physics_interpolation_fraction; uint64_t _idle_frames; bool _in_physics; @@ -95,6 +96,7 @@ public: bool is_in_physics_frame() const { return _in_physics; } uint64_t get_idle_frame_ticks() const { return _frame_ticks; } float get_idle_frame_step() const { return _frame_step; } + float get_physics_interpolation_fraction() const { return _physics_interpolation_fraction; } void set_time_scale(float p_scale); float get_time_scale() const; diff --git a/core/error_macros.h b/core/error_macros.h index 69874e280b..65802de9d2 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -140,6 +140,16 @@ extern bool _err_error_exists; _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; \ + } while (0); // (*) + /** An index has failed if m_index<0 or m_index >=m_size, the function exits. * This function returns an error value, if returning Error, please select the most * appropriate error condition from error_macros.h @@ -154,6 +164,16 @@ extern bool _err_error_exists; _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; \ + } while (0); // (*) + /** An index has failed if m_index >=m_size, the function exits. * This function returns an error value, if returning Error, please select the most * appropriate error condition from error_macros.h @@ -168,6 +188,16 @@ extern bool _err_error_exists; _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; \ + } 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. */ @@ -179,6 +209,15 @@ extern bool _err_error_exists; } \ } 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 \ + } \ + } while (0); // (*) + /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). * the function will exit. */ @@ -192,6 +231,16 @@ extern bool _err_error_exists; _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_V(m_param, m_retval) \ { \ if (unlikely(!m_param)) { \ @@ -201,6 +250,16 @@ extern bool _err_error_exists; _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; \ + } + /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). * the function will exit. */ @@ -214,6 +273,16 @@ extern bool _err_error_exists; _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; \ + } + /** Use this one if there is no sensible fallback, that is, the error is unrecoverable. */ @@ -225,6 +294,15 @@ 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 \ + } \ + } + /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). * the function will exit. * This function returns an error value, if returning Error, please select the most @@ -240,6 +318,16 @@ extern bool _err_error_exists; _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; \ + } + /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). * the loop will skip to the next iteration. */ @@ -253,6 +341,16 @@ extern bool _err_error_exists; _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; \ + } + /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). * the loop will break */ @@ -266,6 +364,16 @@ extern bool _err_error_exists; _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; \ + } + /** Print an error string and return */ @@ -276,6 +384,12 @@ extern bool _err_error_exists; return; \ } +#define ERR_FAIL_MSG(m_msg) \ + { \ + ERR_EXPLAIN(m_msg); \ + ERR_FAIL(); \ + } + /** Print an error string and return with value */ @@ -286,6 +400,12 @@ extern bool _err_error_exists; return m_value; \ } +#define ERR_FAIL_V_MSG(m_value, m_msg) \ + { \ + ERR_EXPLAIN(m_msg); \ + ERR_FAIL_V(m_value); \ + } + /** Use this one if there is no sensible fallback, that is, the error is unrecoverable. */ @@ -295,6 +415,12 @@ extern bool _err_error_exists; GENERATE_TRAP \ } +#define CRASH_NOW_MSG(m_msg) \ + { \ + ERR_EXPLAIN(m_msg); \ + CRASH_NOW(); \ + } + /** Print an error string. */ @@ -355,4 +481,15 @@ extern bool _err_error_exists; } \ } +#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; \ + } \ + } + #endif diff --git a/core/func_ref.cpp b/core/func_ref.cpp index 3d03137d09..66ef27f6b9 100644 --- a/core/func_ref.cpp +++ b/core/func_ref.cpp @@ -46,6 +46,17 @@ Variant FuncRef::call_func(const Variant **p_args, int p_argcount, Variant::Call return obj->call(function, p_args, p_argcount, r_error); } +Variant FuncRef::call_funcv(const Array &p_args) { + + ERR_FAIL_COND_V(id == 0, Variant()); + + Object *obj = ObjectDB::get_instance(id); + + ERR_FAIL_COND_V(!obj, Variant()); + + return obj->callv(function, p_args); +} + void FuncRef::set_instance(Object *p_obj) { ERR_FAIL_NULL(p_obj); @@ -77,6 +88,8 @@ void FuncRef::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_func", &FuncRef::call_func, mi, defargs); } + ClassDB::bind_method(D_METHOD("call_funcv", "arg_array"), &FuncRef::call_funcv); + ClassDB::bind_method(D_METHOD("set_instance", "instance"), &FuncRef::set_instance); ClassDB::bind_method(D_METHOD("set_function", "name"), &FuncRef::set_function); ClassDB::bind_method(D_METHOD("is_valid"), &FuncRef::is_valid); diff --git a/core/func_ref.h b/core/func_ref.h index a143b58bf0..af0bf63203 100644 --- a/core/func_ref.h +++ b/core/func_ref.h @@ -44,6 +44,7 @@ protected: public: Variant call_func(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant call_funcv(const Array &p_args); void set_instance(Object *p_obj); void set_function(const StringName &p_func); bool is_valid() const; diff --git a/core/hash_map.h b/core/hash_map.h index 1513d7a65b..81ddc376d0 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -151,11 +151,7 @@ private: return; Element **new_hash_table = memnew_arr(Element *, ((uint64_t)1 << new_hash_table_power)); - if (!new_hash_table) { - - ERR_PRINT("Out of Memory"); - return; - } + ERR_FAIL_COND_MSG(!new_hash_table, "Out of memory."); for (int i = 0; i < (1 << new_hash_table_power); i++) { @@ -208,10 +204,7 @@ private: /* if element doesn't exist, create it */ Element *e = memnew(Element); - if (!e) { - ERR_EXPLAIN("Out of memory"); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!e, NULL, "Out of memory."); uint32_t hash = Hasher::hash(p_key); uint32_t index = hash & ((1 << hash_table_power) - 1); e->next = hash_table[index]; @@ -498,10 +491,7 @@ public: } else { /* get the next key */ const Element *e = get_element(*p_key); - if (!e) { - ERR_EXPLAIN("Invalid key supplied") - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!e, NULL, "Invalid key supplied."); if (e->next) { /* if there is a "next" in the list, return that */ return &e->next->pair.key; diff --git a/core/image.cpp b/core/image.cpp index a88395204a..d8d667dbd5 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -83,6 +83,7 @@ const char *Image::format_names[Image::FORMAT_MAX] = { }; SavePNGFunc Image::save_png_func = NULL; +SaveEXRFunc Image::save_exr_func = NULL; void Image::_put_pixelb(int p_x, int p_y, uint32_t p_pixelsize, uint8_t *p_data, const uint8_t *p_pixel) { @@ -240,27 +241,27 @@ int Image::get_format_block_size(Format p_format) { case FORMAT_RGTC_RG: { //bc5 case case FORMAT_DXT1: return 4; - } break; + } case FORMAT_PVRTC2: case FORMAT_PVRTC2A: { return 4; - } break; + } case FORMAT_PVRTC4A: case FORMAT_PVRTC4: { return 4; - } break; + } case FORMAT_ETC: { return 4; - } break; + } case FORMAT_BPTC_RGBA: case FORMAT_BPTC_RGBF: case FORMAT_BPTC_RGBFU: { return 4; - } break; + } case FORMAT_ETC2_R11: //etc2 case FORMAT_ETC2_R11S: //signed: NOT srgb. case FORMAT_ETC2_RG11: @@ -270,7 +271,7 @@ int Image::get_format_block_size(Format p_format) { case FORMAT_ETC2_RGB8A1: { return 4; - } break; + } default: { } } @@ -422,8 +423,7 @@ void Image::convert(Format p_new_format) { if (format > FORMAT_RGBE9995 || p_new_format > FORMAT_RGBE9995) { - ERR_EXPLAIN("Cannot convert to <-> from compressed formats. Use compress() and decompress() instead."); - ERR_FAIL(); + ERR_FAIL_MSG("Cannot convert to <-> from compressed formats. Use compress() and decompress() instead."); } else if (format > FORMAT_RGBA8 || p_new_format > FORMAT_RGBA8) { @@ -753,15 +753,14 @@ static void _scale_lanczos(const uint8_t *__restrict p_src, uint8_t *__restrict for (int32_t buffer_x = 0; buffer_x < dst_width; buffer_x++) { - float src_real_x = buffer_x * x_scale; - int32_t src_x = src_real_x; - - int32_t start_x = MAX(0, src_x - half_kernel + 1); - int32_t end_x = MIN(src_width - 1, src_x + half_kernel); + // The corresponding point on the source image + float src_x = (buffer_x + 0.5f) * x_scale; // Offset by 0.5 so it uses the pixel's center + int32_t start_x = MAX(0, int32_t(src_x) - half_kernel + 1); + int32_t end_x = MIN(src_width - 1, int32_t(src_x) + half_kernel); // Create the kernel used by all the pixels of the column for (int32_t target_x = start_x; target_x <= end_x; target_x++) - kernel[target_x - start_x] = _lanczos((src_real_x - target_x) / scale_factor); + kernel[target_x - start_x] = _lanczos((target_x + 0.5f - src_x) / scale_factor); for (int32_t buffer_y = 0; buffer_y < src_height; buffer_y++) { @@ -804,14 +803,12 @@ static void _scale_lanczos(const uint8_t *__restrict p_src, uint8_t *__restrict for (int32_t dst_y = 0; dst_y < dst_height; dst_y++) { - float buffer_real_y = dst_y * y_scale; - int32_t buffer_y = buffer_real_y; - - int32_t start_y = MAX(0, buffer_y - half_kernel + 1); - int32_t end_y = MIN(src_height - 1, buffer_y + half_kernel); + float buffer_y = (dst_y + 0.5f) * y_scale; + int32_t start_y = MAX(0, int32_t(buffer_y) - half_kernel + 1); + int32_t end_y = MIN(src_height - 1, int32_t(buffer_y) + half_kernel); for (int32_t target_y = start_y; target_y <= end_y; target_y++) - kernel[target_y - start_y] = _lanczos((buffer_real_y - target_y) / scale_factor); + kernel[target_y - start_y] = _lanczos((target_y + 0.5f - buffer_y) / scale_factor); for (int32_t dst_x = 0; dst_x < dst_width; dst_x++) { @@ -852,7 +849,7 @@ static void _scale_lanczos(const uint8_t *__restrict p_src, uint8_t *__restrict static void _overlay(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, float p_alpha, uint32_t p_width, uint32_t p_height, uint32_t p_pixel_size) { - uint16_t alpha = CLAMP((uint16_t)(p_alpha * 256.0f), 0, 256); + uint16_t alpha = MIN((uint16_t)(p_alpha * 256.0f), 256); for (uint32_t i = 0; i < p_width * p_height * p_pixel_size; i++) { @@ -866,10 +863,7 @@ bool Image::is_size_po2() const { void Image::resize_to_po2(bool p_square) { - if (!_can_modify(format)) { - ERR_EXPLAIN("Cannot resize in indexed, compressed or custom image formats."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot resize in indexed, compressed or custom image formats."); int w = next_power_of_2(width); int h = next_power_of_2(height); @@ -885,15 +879,9 @@ void Image::resize_to_po2(bool p_square) { void Image::resize(int p_width, int p_height, Interpolation p_interpolation) { - if (data.size() == 0) { - ERR_EXPLAIN("Cannot resize image before creating it, use create() or create_from_data() first."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(data.size() == 0, "Cannot resize image before creating it, use create() or create_from_data() first."); - if (!_can_modify(format)) { - ERR_EXPLAIN("Cannot resize in indexed, compressed or custom image formats."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot resize in indexed, compressed or custom image formats."); bool mipmap_aware = p_interpolation == INTERPOLATE_TRILINEAR /* || p_interpolation == INTERPOLATE_TRICUBIC */; @@ -1106,10 +1094,8 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) { void Image::crop_from_point(int p_x, int p_y, int p_width, int p_height) { - if (!_can_modify(format)) { - ERR_EXPLAIN("Cannot crop in indexed, compressed or custom image formats."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot crop in indexed, compressed or custom image formats."); + ERR_FAIL_COND(p_x < 0); ERR_FAIL_COND(p_y < 0); ERR_FAIL_COND(p_width <= 0); @@ -1163,10 +1149,7 @@ void Image::crop(int p_width, int p_height) { void Image::flip_y() { - if (!_can_modify(format)) { - ERR_EXPLAIN("Cannot flip_y in indexed, compressed or custom image formats."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot flip_y in indexed, compressed or custom image formats."); bool used_mipmaps = has_mipmaps(); if (used_mipmaps) { @@ -1199,10 +1182,7 @@ void Image::flip_y() { void Image::flip_x() { - if (!_can_modify(format)) { - ERR_EXPLAIN("Cannot flip_x in indexed, compressed or custom image formats."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot flip_x in indexed, compressed or custom image formats."); bool used_mipmaps = has_mipmaps(); if (used_mipmaps) { @@ -1461,15 +1441,9 @@ void Image::normalize() { Error Image::generate_mipmaps(bool p_renormalize) { - if (!_can_modify(format)) { - ERR_EXPLAIN("Cannot generate mipmaps in indexed, compressed or custom image formats."); - ERR_FAIL_V(ERR_UNAVAILABLE); - } + ERR_FAIL_COND_V_MSG(!_can_modify(format), ERR_UNAVAILABLE, "Cannot generate mipmaps in indexed, compressed or custom image formats."); - if (width == 0 || height == 0) { - ERR_EXPLAIN("Cannot generate mipmaps with width or height equal to 0."); - ERR_FAIL_V(ERR_UNCONFIGURED); - } + ERR_FAIL_COND_V_MSG(width == 0 || height == 0, ERR_UNCONFIGURED, "Cannot generate mipmaps with width or height equal to 0."); int mmcount; @@ -1620,10 +1594,7 @@ void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_forma int mm; int size = _get_dst_image_size(p_width, p_height, p_format, mm, p_use_mipmaps ? -1 : 0); - if (size != p_data.size()) { - ERR_EXPLAIN("Expected data size of " + itos(size) + " bytes in Image::create(), got instead " + itos(p_data.size()) + " bytes."); - ERR_FAIL_COND(p_data.size() != size); - } + ERR_FAIL_COND_MSG(p_data.size() != size, "Expected data size of " + itos(size) + " bytes in Image::create(), got instead " + itos(p_data.size()) + " bytes."); height = p_height; width = p_width; @@ -1917,6 +1888,14 @@ Error Image::save_png(const String &p_path) const { return save_png_func(p_path, Ref<Image>((Image *)this)); } +Error Image::save_exr(const String &p_path, bool p_grayscale) const { + + if (save_exr_func == NULL) + return ERR_UNAVAILABLE; + + return save_exr_func(p_path, Ref<Image>((Image *)this), p_grayscale); +} + int Image::get_image_data_size(int p_width, int p_height, Format p_format, bool p_mipmaps) { int mm; @@ -2405,10 +2384,7 @@ Color Image::get_pixel(int p_x, int p_y) const { uint8_t *ptr = write_lock.ptr(); #ifdef DEBUG_ENABLED - if (!ptr) { - ERR_EXPLAIN("Image must be locked with 'lock()' before using get_pixel()"); - ERR_FAIL_V(Color()); - } + ERR_FAIL_COND_V_MSG(!ptr, Color(), "Image must be locked with 'lock()' before using get_pixel()."); ERR_FAIL_INDEX_V(p_x, width, Color()); ERR_FAIL_INDEX_V(p_y, height, Color()); @@ -2421,38 +2397,36 @@ Color Image::get_pixel(int p_x, int p_y) const { case FORMAT_L8: { float l = ptr[ofs] / 255.0; return Color(l, l, l, 1); - } break; + } case FORMAT_LA8: { float l = ptr[ofs * 2 + 0] / 255.0; float a = ptr[ofs * 2 + 1] / 255.0; return Color(l, l, l, a); - } break; + } case FORMAT_R8: { float r = ptr[ofs] / 255.0; return Color(r, 0, 0, 1); - } break; + } case FORMAT_RG8: { float r = ptr[ofs * 2 + 0] / 255.0; float g = ptr[ofs * 2 + 1] / 255.0; return Color(r, g, 0, 1); - } break; + } case FORMAT_RGB8: { float r = ptr[ofs * 3 + 0] / 255.0; float g = ptr[ofs * 3 + 1] / 255.0; float b = ptr[ofs * 3 + 2] / 255.0; return Color(r, g, b, 1); - - } break; + } case FORMAT_RGBA8: { float r = ptr[ofs * 4 + 0] / 255.0; float g = ptr[ofs * 4 + 1] / 255.0; float b = ptr[ofs * 4 + 2] / 255.0; float a = ptr[ofs * 4 + 3] / 255.0; return Color(r, g, b, a); - - } break; + } case FORMAT_RGBA4444: { uint16_t u = ((uint16_t *)ptr)[ofs]; float r = (u & 0xF) / 15.0; @@ -2460,8 +2434,7 @@ Color Image::get_pixel(int p_x, int p_y) const { float b = ((u >> 8) & 0xF) / 15.0; float a = ((u >> 12) & 0xF) / 15.0; return Color(r, g, b, a); - - } break; + } case FORMAT_RGBA5551: { uint16_t u = ((uint16_t *)ptr)[ofs]; @@ -2470,25 +2443,25 @@ Color Image::get_pixel(int p_x, int p_y) const { float b = ((u >> 10) & 0x1F) / 15.0; float a = ((u >> 15) & 0x1) / 1.0; return Color(r, g, b, a); - } break; + } case FORMAT_RF: { float r = ((float *)ptr)[ofs]; return Color(r, 0, 0, 1); - } break; + } case FORMAT_RGF: { float r = ((float *)ptr)[ofs * 2 + 0]; float g = ((float *)ptr)[ofs * 2 + 1]; return Color(r, g, 0, 1); - } break; + } case FORMAT_RGBF: { float r = ((float *)ptr)[ofs * 3 + 0]; float g = ((float *)ptr)[ofs * 3 + 1]; float b = ((float *)ptr)[ofs * 3 + 2]; return Color(r, g, b, 1); - } break; + } case FORMAT_RGBAF: { float r = ((float *)ptr)[ofs * 4 + 0]; @@ -2496,25 +2469,25 @@ Color Image::get_pixel(int p_x, int p_y) const { float b = ((float *)ptr)[ofs * 4 + 2]; float a = ((float *)ptr)[ofs * 4 + 3]; return Color(r, g, b, a); - } break; + } case FORMAT_RH: { uint16_t r = ((uint16_t *)ptr)[ofs]; return Color(Math::half_to_float(r), 0, 0, 1); - } break; + } case FORMAT_RGH: { uint16_t r = ((uint16_t *)ptr)[ofs * 2 + 0]; uint16_t g = ((uint16_t *)ptr)[ofs * 2 + 1]; return Color(Math::half_to_float(r), Math::half_to_float(g), 0, 1); - } break; + } case FORMAT_RGBH: { uint16_t r = ((uint16_t *)ptr)[ofs * 3 + 0]; uint16_t g = ((uint16_t *)ptr)[ofs * 3 + 1]; uint16_t b = ((uint16_t *)ptr)[ofs * 3 + 2]; return Color(Math::half_to_float(r), Math::half_to_float(g), Math::half_to_float(b), 1); - } break; + } case FORMAT_RGBAH: { uint16_t r = ((uint16_t *)ptr)[ofs * 4 + 0]; @@ -2522,18 +2495,14 @@ Color Image::get_pixel(int p_x, int p_y) const { uint16_t b = ((uint16_t *)ptr)[ofs * 4 + 2]; uint16_t a = ((uint16_t *)ptr)[ofs * 4 + 3]; return Color(Math::half_to_float(r), Math::half_to_float(g), Math::half_to_float(b), Math::half_to_float(a)); - } break; + } case FORMAT_RGBE9995: { return Color::from_rgbe9995(((uint32_t *)ptr)[ofs]); - - } break; + } default: { - ERR_EXPLAIN("Can't get_pixel() on compressed image, sorry."); - ERR_FAIL_V(Color()); + ERR_FAIL_V_MSG(Color(), "Can't get_pixel() on compressed image, sorry."); } } - - return Color(); } void Image::set_pixelv(const Point2 &p_dst, const Color &p_color) { @@ -2544,10 +2513,7 @@ void Image::set_pixel(int p_x, int p_y, const Color &p_color) { uint8_t *ptr = write_lock.ptr(); #ifdef DEBUG_ENABLED - if (!ptr) { - ERR_EXPLAIN("Image must be locked with 'lock()' before using set_pixel()"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!ptr, "Image must be locked with 'lock()' before using set_pixel()."); ERR_FAIL_INDEX(p_x, width); ERR_FAIL_INDEX(p_y, height); @@ -2659,8 +2625,7 @@ void Image::set_pixel(int p_x, int p_y, const Color &p_color) { } break; default: { - ERR_EXPLAIN("Can't set_pixel() on compressed image, sorry."); - ERR_FAIL(); + ERR_FAIL_MSG("Can't set_pixel() on compressed image, sorry."); } } } @@ -2752,6 +2717,7 @@ void Image::_bind_methods() { ClassDB::bind_method(D_METHOD("load", "path"), &Image::load); ClassDB::bind_method(D_METHOD("save_png", "path"), &Image::save_png); + ClassDB::bind_method(D_METHOD("save_exr", "path", "grayscale"), &Image::save_exr, DEFVAL(false)); ClassDB::bind_method(D_METHOD("detect_alpha"), &Image::detect_alpha); ClassDB::bind_method(D_METHOD("is_invisible"), &Image::is_invisible); diff --git a/core/image.h b/core/image.h index cc796789cd..d17571399d 100644 --- a/core/image.h +++ b/core/image.h @@ -49,11 +49,14 @@ class Image; typedef Error (*SavePNGFunc)(const String &p_path, const Ref<Image> &p_img); typedef Ref<Image> (*ImageMemLoadFunc)(const uint8_t *p_png, int p_size); +typedef Error (*SaveEXRFunc)(const String &p_path, const Ref<Image> &p_img, bool p_grayscale); + class Image : public Resource { GDCLASS(Image, Resource); public: static SavePNGFunc save_png_func; + static SaveEXRFunc save_exr_func; enum { MAX_WIDTH = 16384, // force a limit somehow @@ -258,6 +261,7 @@ public: Error load(const String &p_path); Error save_png(const String &p_path) const; + Error save_exr(const String &p_path, bool p_grayscale) const; /** * create an empty image diff --git a/core/input_map.cpp b/core/input_map.cpp index 04911787a8..2a8ac435fe 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -192,17 +192,14 @@ bool InputMap::event_is_action(const Ref<InputEvent> &p_event, const StringName bool InputMap::event_get_action_status(const Ref<InputEvent> &p_event, const StringName &p_action, bool *p_pressed, float *p_strength) const { Map<StringName, Action>::Element *E = input_map.find(p_action); - if (!E) { - ERR_EXPLAIN("Request for nonexistent InputMap action: " + String(p_action)); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(!E, false, "Request for nonexistent InputMap action: " + String(p_action) + "."); Ref<InputEventAction> input_event_action = p_event; if (input_event_action.is_valid()) { if (p_pressed != NULL) *p_pressed = input_event_action->is_pressed(); if (p_strength != NULL) - *p_strength = (*p_pressed) ? input_event_action->get_strength() : 0.0f; + *p_strength = (p_pressed != NULL && *p_pressed) ? input_event_action->get_strength() : 0.0f; return input_event_action->get_action() == p_action; } diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index f7fb72c089..9063e028be 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -86,10 +86,7 @@ void ConfigFile::set_value(const String &p_section, const String &p_key, const V Variant ConfigFile::get_value(const String &p_section, const String &p_key, Variant p_default) const { if (!values.has(p_section) || !values[p_section].has(p_key)) { - if (p_default.get_type() == Variant::NIL) { - ERR_EXPLAIN("Couldn't find the given section/key and no default was given"); - ERR_FAIL_V(p_default); - } + ERR_FAIL_COND_V_MSG(p_default.get_type() == Variant::NIL, p_default, "Couldn't find the given section/key and no default was given."); return p_default; } return values[p_section][p_key]; @@ -204,7 +201,7 @@ Error ConfigFile::load(const String &p_path) { FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); if (!f) - return ERR_CANT_OPEN; + return err; return _internal_load(p_path, f); } @@ -271,7 +268,7 @@ Error ConfigFile::_internal_load(const String &p_path, FileAccess *f) { memdelete(f); return OK; } else if (err != OK) { - ERR_PRINTS("ConfgFile::load - " + p_path + ":" + itos(lines) + " error: " + error_text); + ERR_PRINTS("ConfgFile::load - " + p_path + ":" + itos(lines) + " error: " + error_text + "."); memdelete(f); return err; } diff --git a/core/io/file_access_buffered.cpp b/core/io/file_access_buffered.cpp index 15523a49a9..f72ad61da6 100644 --- a/core/io/file_access_buffered.cpp +++ b/core/io/file_access_buffered.cpp @@ -87,10 +87,8 @@ bool FileAccessBuffered::eof_reached() const { } uint8_t FileAccessBuffered::get_8() const { - if (!file.open) { - ERR_EXPLAIN("Can't get data, when file is not opened."); - ERR_FAIL_V(0); - } + + ERR_FAIL_COND_V_MSG(!file.open, 0, "Can't get data, when file is not opened."); uint8_t byte = 0; if (cache_data_left() >= 1) { @@ -104,10 +102,8 @@ uint8_t FileAccessBuffered::get_8() const { } int FileAccessBuffered::get_buffer(uint8_t *p_dest, int p_length) const { - if (!file.open) { - ERR_EXPLAIN("Can't get buffer, when file is not opened."); - ERR_FAIL_V(-1); - } + + ERR_FAIL_COND_V_MSG(!file.open, -1, "Can't get buffer, when file is not opened."); if (p_length > cache_size) { diff --git a/core/io/file_access_buffered_fa.h b/core/io/file_access_buffered_fa.h index 6e806e7b3f..c8cee04208 100644 --- a/core/io/file_access_buffered_fa.h +++ b/core/io/file_access_buffered_fa.h @@ -40,10 +40,7 @@ class FileAccessBufferedFA : public FileAccessBuffered { int read_data_block(int p_offset, int p_size, uint8_t *p_dest = 0) const { - if (!f.is_open()) { - ERR_EXPLAIN("Can't read data block, when file is not opened."); - ERR_FAIL_V(-1); - } + ERR_FAIL_COND_V_MSG(!f.is_open(), -1, "Can't read data block when file is not opened."); ((T *)&f)->seek(p_offset); diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index 6c4310a572..102cd9cf6c 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -208,7 +208,8 @@ void FileAccessCompressed::seek(size_t p_position) { if (p_position == read_total) { at_end = true; } else { - + at_end = false; + read_eof = false; int block_idx = p_position / block_size; if (block_idx != read_block) { diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp index ccee6aeb15..77decc107d 100644 --- a/core/io/file_access_encrypted.cpp +++ b/core/io/file_access_encrypted.cpp @@ -30,7 +30,7 @@ #include "file_access_encrypted.h" -#include "core/math/crypto_core.h" +#include "core/crypto/crypto_core.h" #include "core/os/copymem.h" #include "core/print_string.h" #include "core/variant.h" @@ -94,8 +94,7 @@ Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8 unsigned char hash[16]; ERR_FAIL_COND_V(CryptoCore::md5(data.ptr(), data.size(), hash) != OK, ERR_BUG); - ERR_EXPLAIN("The MD5 sum of the decrypted file does not match the expected value. It could be that the file is corrupt, or that the provided decryption key is invalid."); - ERR_FAIL_COND_V(String::md5(hash) != String::md5(md5d), ERR_FILE_CORRUPT); + ERR_FAIL_COND_V_MSG(String::md5(hash) != String::md5(md5d), ERR_FILE_CORRUPT, "The MD5 sum of the decrypted file does not match the expected value. It could be that the file is corrupt, or that the provided decryption key is invalid."); file = p_base; } @@ -298,7 +297,7 @@ uint32_t FileAccessEncrypted::_get_unix_permissions(const String &p_file) { } Error FileAccessEncrypted::_set_unix_permissions(const String &p_file, uint32_t p_permissions) { - ERR_PRINT("Setting UNIX permissions on encrypted files is not implemented yet"); + ERR_PRINT("Setting UNIX permissions on encrypted files is not implemented yet."); return ERR_UNAVAILABLE; } diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index ca66b34e17..d49d36c2b9 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -90,7 +90,7 @@ void PackedData::add_path(const String &pkg_path, const String &path, uint64_t o } } String filename = path.get_file(); - // Don't add as a file if the path points to a directoryy + // Don't add as a file if the path points to a directory if (!filename.empty()) { cd->files.insert(filename); } @@ -171,10 +171,8 @@ bool PackedSourcePCK::try_open_pack(const String &p_path) { uint32_t ver_minor = f->get_32(); f->get_32(); // ver_rev - ERR_EXPLAIN("Pack version unsupported: " + itos(version)); - ERR_FAIL_COND_V(version != PACK_VERSION, false); - ERR_EXPLAIN("Pack created with a newer version of the engine: " + itos(ver_major) + "." + itos(ver_minor)); - ERR_FAIL_COND_V(ver_major > VERSION_MAJOR || (ver_major == VERSION_MAJOR && ver_minor > VERSION_MINOR), false); + ERR_FAIL_COND_V_MSG(version != PACK_VERSION, false, "Pack version unsupported: " + itos(version) + "."); + ERR_FAIL_COND_V_MSG(ver_major > VERSION_MAJOR || (ver_major == VERSION_MAJOR && ver_minor > VERSION_MINOR), false, "Pack created with a newer version of the engine: " + itos(ver_major) + "." + itos(ver_minor) + "."); for (int i = 0; i < 16; i++) { //reserved @@ -322,10 +320,9 @@ bool FileAccessPack::file_exists(const String &p_name) { FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) : pf(p_file), f(FileAccess::open(pf.pack, FileAccess::READ)) { - if (!f) { - ERR_EXPLAIN("Can't open pack-referenced file: " + String(pf.pack)); - ERR_FAIL_COND(!f); - } + + ERR_FAIL_COND_MSG(!f, "Can't open pack-referenced file: " + String(pf.pack) + "."); + f->seek(pf.offset); pos = 0; eof = false; @@ -463,11 +460,15 @@ String DirAccessPack::get_current_dir() { bool DirAccessPack::file_exists(String p_file) { + p_file = fix_path(p_file); + return current->files.has(p_file); } bool DirAccessPack::dir_exists(String p_dir) { + p_dir = fix_path(p_dir); + return current->subdirs.has(p_dir); } diff --git a/core/io/image_loader.h b/core/io/image_loader.h index ae4b72a534..af6b0551a3 100644 --- a/core/io/image_loader.h +++ b/core/io/image_loader.h @@ -37,24 +37,8 @@ #include "core/os/file_access.h" #include "core/ustring.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - -/** - * @class ImageScanLineLoader - * @author Juan Linietsky <reduzio@gmail.com> - * - - */ class ImageLoader; -/** - * @class ImageLoader - * Base Class and singleton for loading images from disk - * Can load images in one go, or by scanline - */ - class ImageFormatLoader { friend class ImageLoader; friend class ResourceFormatLoaderImage; diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp index 9305afac5f..df4be9b9fd 100644 --- a/core/io/ip_address.cpp +++ b/core/io/ip_address.cpp @@ -81,8 +81,7 @@ static void _parse_hex(const String &p_string, int p_start, uint8_t *p_dst) { } else if (c == ':') { break; } else { - ERR_EXPLAIN("Invalid character in ipv6 address: " + p_string); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid character in IPv6 address: " + p_string + "."); }; ret = ret << 4; ret += n; @@ -126,9 +125,7 @@ void IP_Address::_parse_ipv6(const String &p_string) { ++parts_count; }; } else { - - ERR_EXPLAIN("Invalid character in IPv6 address: " + p_string); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid character in IPv6 address: " + p_string + "."); }; }; @@ -166,10 +163,7 @@ void IP_Address::_parse_ipv4(const String &p_string, int p_start, uint8_t *p_ret }; int slices = ip.get_slice_count("."); - if (slices != 4) { - ERR_EXPLAIN("Invalid IP Address String: " + ip); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(slices != 4, "Invalid IP address string: " + ip + "."); for (int i = 0; i < 4; i++) { p_ret[i] = ip.get_slicec('.', i).to_int(); } @@ -229,7 +223,7 @@ IP_Address::IP_Address(const String &p_string) { valid = true; } else { - ERR_PRINT("Invalid IP address"); + ERR_PRINT("Invalid IP address."); } } diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index dc5581ea01..b386feb14c 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -377,11 +377,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int } } break; - /*case Variant::RESOURCE: { - - ERR_EXPLAIN("Can't marshallize resources"); - ERR_FAIL_V(ERR_INVALID_DATA); //no, i'm sorry, no go - } break;*/ case Variant::_RID: { r_variant = RID(); @@ -1066,11 +1061,6 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo r_len += 4 * 4; } break; - /*case Variant::RESOURCE: { - - ERR_EXPLAIN("Can't marshallize resources"); - ERR_FAIL_V(ERR_INVALID_DATA); //no, i'm sorry, no go - } break;*/ case Variant::_RID: { } break; diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index 33dc4dbde4..d20133642b 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -146,8 +146,7 @@ void MultiplayerAPI::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_pee network_peer = p_peer; - ERR_EXPLAIN("Supplied NetworkedNetworkPeer must be connecting or connected."); - ERR_FAIL_COND(p_peer.is_valid() && p_peer->get_connection_status() == NetworkedMultiplayerPeer::CONNECTION_DISCONNECTED); + ERR_FAIL_COND_MSG(p_peer.is_valid() && p_peer->get_connection_status() == NetworkedMultiplayerPeer::CONNECTION_DISCONNECTED, "Supplied NetworkedNetworkPeer must be connecting or connected."); if (network_peer.is_valid()) { network_peer->connect("peer_connected", this, "_add_peer"); @@ -164,10 +163,8 @@ Ref<NetworkedMultiplayerPeer> MultiplayerAPI::get_network_peer() const { void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_packet_len) { - ERR_EXPLAIN("Multiplayer root node was not initialized. If you are using custom multiplayer, remember to set the root node via MultiplayerAPI.set_root_node before using it"); - ERR_FAIL_COND(root_node == NULL); - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(p_packet_len < 1); + ERR_FAIL_COND_MSG(root_node == NULL, "Multiplayer root node was not initialized. If you are using custom multiplayer, remember to set the root node via MultiplayerAPI.set_root_node before using it."); + ERR_FAIL_COND_MSG(p_packet_len < 1, "Invalid packet received. Size too small."); uint8_t packet_type = p_packet[0]; @@ -186,13 +183,11 @@ void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_ case NETWORK_COMMAND_REMOTE_CALL: case NETWORK_COMMAND_REMOTE_SET: { - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(p_packet_len < 6); + ERR_FAIL_COND_MSG(p_packet_len < 6, "Invalid packet received. Size too small."); Node *node = _process_get_node(p_from, p_packet, p_packet_len); - ERR_EXPLAIN("Invalid packet received. Requested node was not found."); - ERR_FAIL_COND(node == NULL); + ERR_FAIL_COND_MSG(node == NULL, "Invalid packet received. Requested node was not found."); // Detect cstring end. int len_end = 5; @@ -202,8 +197,7 @@ void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_ } } - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(len_end >= p_packet_len); + ERR_FAIL_COND_MSG(len_end >= p_packet_len, "Invalid packet received. Size too small."); StringName name = String::utf8((const char *)&p_packet[5]); @@ -235,8 +229,7 @@ Node *MultiplayerAPI::_process_get_node(int p_from, const uint8_t *p_packet, int int ofs = target & 0x7FFFFFFF; - ERR_EXPLAIN("Invalid packet received. Size smaller than declared."); - ERR_FAIL_COND_V(ofs >= p_packet_len, NULL); + ERR_FAIL_COND_V_MSG(ofs >= p_packet_len, NULL, "Invalid packet received. Size smaller than declared."); String paths; paths.parse_utf8((const char *)&p_packet[ofs], p_packet_len - ofs); @@ -246,33 +239,30 @@ Node *MultiplayerAPI::_process_get_node(int p_from, const uint8_t *p_packet, int node = root_node->get_node(np); if (!node) - ERR_PRINTS("Failed to get path from RPC: " + String(np)); + ERR_PRINTS("Failed to get path from RPC: " + String(np) + "."); } else { // Use cached path. int id = target; Map<int, PathGetCache>::Element *E = path_get_cache.find(p_from); - ERR_EXPLAIN("Invalid packet received. Requests invalid peer cache."); - ERR_FAIL_COND_V(!E, NULL); + ERR_FAIL_COND_V_MSG(!E, NULL, "Invalid packet received. Requests invalid peer cache."); Map<int, PathGetCache::NodeInfo>::Element *F = E->get().nodes.find(id); - ERR_EXPLAIN("Invalid packet received. Unabled to find requested cached node."); - ERR_FAIL_COND_V(!F, NULL); + ERR_FAIL_COND_V_MSG(!F, NULL, "Invalid packet received. Unabled to find requested cached node."); PathGetCache::NodeInfo *ni = &F->get(); // Do proper caching later. node = root_node->get_node(ni->path); if (!node) - ERR_PRINTS("Failed to get cached path from RPC: " + String(ni->path)); + ERR_PRINTS("Failed to get cached path from RPC: " + String(ni->path) + "."); } return node; } void MultiplayerAPI::_process_rpc(Node *p_node, const StringName &p_name, int p_from, const uint8_t *p_packet, int p_packet_len, int p_offset) { - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(p_offset >= p_packet_len); + ERR_FAIL_COND_MSG(p_offset >= p_packet_len, "Invalid packet received. Size too small."); // Check that remote can call the RPC on this node. RPCMode rpc_mode = RPC_MODE_DISABLED; @@ -284,8 +274,7 @@ void MultiplayerAPI::_process_rpc(Node *p_node, const StringName &p_name, int p_ } bool can_call = _can_call_mode(p_node, rpc_mode, p_from); - ERR_EXPLAIN("RPC '" + String(p_name) + "' is not allowed on node " + p_node->get_path() + " from: " + itos(p_from) + ". Mode is " + itos((int)rpc_mode) + ", master is " + itos(p_node->get_network_master()) + "."); - ERR_FAIL_COND(!can_call); + ERR_FAIL_COND_MSG(!can_call, "RPC '" + String(p_name) + "' is not allowed on node " + p_node->get_path() + " from: " + itos(p_from) + ". Mode is " + itos((int)rpc_mode) + ", master is " + itos(p_node->get_network_master()) + "."); int argc = p_packet[p_offset]; Vector<Variant> args; @@ -297,13 +286,11 @@ void MultiplayerAPI::_process_rpc(Node *p_node, const StringName &p_name, int p_ for (int i = 0; i < argc; i++) { - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(p_offset >= p_packet_len); + ERR_FAIL_COND_MSG(p_offset >= p_packet_len, "Invalid packet received. Size too small."); int vlen; Error err = decode_variant(args.write[i], &p_packet[p_offset], p_packet_len - p_offset, &vlen, allow_object_decoding || network_peer->is_object_decoding_allowed()); - ERR_EXPLAIN("Invalid packet received. Unable to decode RPC argument."); - ERR_FAIL_COND(err != OK); + ERR_FAIL_COND_MSG(err != OK, "Invalid packet received. Unable to decode RPC argument."); argp.write[i] = &args[i]; p_offset += vlen; @@ -321,8 +308,7 @@ void MultiplayerAPI::_process_rpc(Node *p_node, const StringName &p_name, int p_ void MultiplayerAPI::_process_rset(Node *p_node, const StringName &p_name, int p_from, const uint8_t *p_packet, int p_packet_len, int p_offset) { - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(p_offset >= p_packet_len); + ERR_FAIL_COND_MSG(p_offset >= p_packet_len, "Invalid packet received. Size too small."); // Check that remote can call the RSET on this node. RPCMode rset_mode = RPC_MODE_DISABLED; @@ -334,28 +320,25 @@ void MultiplayerAPI::_process_rset(Node *p_node, const StringName &p_name, int p } bool can_call = _can_call_mode(p_node, rset_mode, p_from); - ERR_EXPLAIN("RSET '" + String(p_name) + "' is not allowed on node " + p_node->get_path() + " from: " + itos(p_from) + ". Mode is " + itos((int)rset_mode) + ", master is " + itos(p_node->get_network_master()) + "."); - ERR_FAIL_COND(!can_call); + ERR_FAIL_COND_MSG(!can_call, "RSET '" + String(p_name) + "' is not allowed on node " + p_node->get_path() + " from: " + itos(p_from) + ". Mode is " + itos((int)rset_mode) + ", master is " + itos(p_node->get_network_master()) + "."); Variant value; Error err = decode_variant(value, &p_packet[p_offset], p_packet_len - p_offset, NULL, allow_object_decoding || network_peer->is_object_decoding_allowed()); - ERR_EXPLAIN("Invalid packet received. Unable to decode RSET value."); - ERR_FAIL_COND(err != OK); + ERR_FAIL_COND_MSG(err != OK, "Invalid packet received. Unable to decode RSET value."); bool valid; p_node->set(p_name, value, &valid); if (!valid) { - String error = "Error setting remote property '" + String(p_name) + "', not found in object of type " + p_node->get_class(); + String error = "Error setting remote property '" + String(p_name) + "', not found in object of type " + p_node->get_class() + "."; ERR_PRINTS(error); } } void MultiplayerAPI::_process_simplify_path(int p_from, const uint8_t *p_packet, int p_packet_len) { - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(p_packet_len < 5); + ERR_FAIL_COND_MSG(p_packet_len < 5, "Invalid packet received. Size too small."); int id = decode_uint32(&p_packet[1]); String paths; @@ -390,8 +373,7 @@ void MultiplayerAPI::_process_simplify_path(int p_from, const uint8_t *p_packet, void MultiplayerAPI::_process_confirm_path(int p_from, const uint8_t *p_packet, int p_packet_len) { - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(p_packet_len < 2); + ERR_FAIL_COND_MSG(p_packet_len < 2, "Invalid packet received. Size too small."); String paths; paths.parse_utf8((const char *)&p_packet[1], p_packet_len - 1); @@ -399,12 +381,10 @@ void MultiplayerAPI::_process_confirm_path(int p_from, const uint8_t *p_packet, NodePath path = paths; PathSentCache *psc = path_send_cache.getptr(path); - ERR_EXPLAIN("Invalid packet received. Tries to confirm a path which was not found in cache."); - ERR_FAIL_COND(!psc); + ERR_FAIL_COND_MSG(!psc, "Invalid packet received. Tries to confirm a path which was not found in cache."); Map<int, bool>::Element *E = psc->confirmed_peers.find(p_from); - ERR_EXPLAIN("Invalid packet received. Source peer was not found in cache for the given path."); - ERR_FAIL_COND(!E); + ERR_FAIL_COND_MSG(!E, "Invalid packet received. Source peer was not found in cache for the given path."); E->get() = true; } @@ -460,39 +440,22 @@ bool MultiplayerAPI::_send_confirm_path(NodePath p_path, PathSentCache *psc, int void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p_set, const StringName &p_name, const Variant **p_arg, int p_argcount) { - if (network_peer.is_null()) { - ERR_EXPLAIN("Attempt to remote call/set when networking is not active in SceneTree."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(network_peer.is_null(), "Attempt to remote call/set when networking is not active in SceneTree."); - if (network_peer->get_connection_status() == NetworkedMultiplayerPeer::CONNECTION_CONNECTING) { - ERR_EXPLAIN("Attempt to remote call/set when networking is not connected yet in SceneTree."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(network_peer->get_connection_status() == NetworkedMultiplayerPeer::CONNECTION_CONNECTING, "Attempt to remote call/set when networking is not connected yet in SceneTree."); - if (network_peer->get_connection_status() == NetworkedMultiplayerPeer::CONNECTION_DISCONNECTED) { - ERR_EXPLAIN("Attempt to remote call/set when networking is disconnected."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(network_peer->get_connection_status() == NetworkedMultiplayerPeer::CONNECTION_DISCONNECTED, "Attempt to remote call/set when networking is disconnected."); - if (p_argcount > 255) { - ERR_EXPLAIN("Too many arguments >255."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(p_argcount > 255, "Too many arguments >255."); if (p_to != 0 && !connected_peers.has(ABS(p_to))) { - if (p_to == network_peer->get_unique_id()) { - ERR_EXPLAIN("Attempt to remote call/set yourself! unique ID: " + itos(network_peer->get_unique_id())); - } else { - ERR_EXPLAIN("Attempt to remote call unexisting ID: " + itos(p_to)); - } + ERR_FAIL_COND_MSG(p_to == network_peer->get_unique_id(), "Attempt to remote call/set yourself! unique ID: " + itos(network_peer->get_unique_id()) + "."); - ERR_FAIL(); + ERR_FAIL_MSG("Attempt to remote call unexisting ID: " + itos(p_to) + "."); } NodePath from_path = (root_node->get_path()).rel_path_to(p_from->get_path()); - ERR_EXPLAIN("Unable to send RPC. Relative path is empty. THIS IS LIKELY A BUG IN THE ENGINE!"); - ERR_FAIL_COND(from_path.is_empty()); + ERR_FAIL_COND_MSG(from_path.is_empty(), "Unable to send RPC. Relative path is empty. THIS IS LIKELY A BUG IN THE ENGINE!"); // See if the path is cached. PathSentCache *psc = path_send_cache.getptr(from_path); @@ -530,8 +493,7 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p if (p_set) { // Set argument. Error err = encode_variant(*p_arg[0], NULL, len, allow_object_decoding || network_peer->is_object_decoding_allowed()); - ERR_EXPLAIN("Unable to encode RSET value. THIS IS LIKELY A BUG IN THE ENGINE!"); - ERR_FAIL_COND(err != OK); + ERR_FAIL_COND_MSG(err != OK, "Unable to encode RSET value. THIS IS LIKELY A BUG IN THE ENGINE!"); MAKE_ROOM(ofs + len); encode_variant(*p_arg[0], &(packet_cache.write[ofs]), len, allow_object_decoding || network_peer->is_object_decoding_allowed()); ofs += len; @@ -543,8 +505,7 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p ofs += 1; for (int i = 0; i < p_argcount; i++) { Error err = encode_variant(*p_arg[i], NULL, len, allow_object_decoding || network_peer->is_object_decoding_allowed()); - ERR_EXPLAIN("Unable to encode RPC argument. THIS IS LIKELY A BUG IN THE ENGINE!"); - ERR_FAIL_COND(err != OK); + ERR_FAIL_COND_MSG(err != OK, "Unable to encode RPC argument. THIS IS LIKELY A BUG IN THE ENGINE!"); MAKE_ROOM(ofs + len); encode_variant(*p_arg[i], &(packet_cache.write[ofs]), len, allow_object_decoding || network_peer->is_object_decoding_allowed()); ofs += len; @@ -626,12 +587,9 @@ void MultiplayerAPI::_server_disconnected() { void MultiplayerAPI::rpcp(Node *p_node, int p_peer_id, bool p_unreliable, const StringName &p_method, const Variant **p_arg, int p_argcount) { - ERR_EXPLAIN("Trying to call an RPC while no network peer is active."); - ERR_FAIL_COND(!network_peer.is_valid()); - ERR_EXPLAIN("Trying to call an RPC on a node which is not inside SceneTree."); - ERR_FAIL_COND(!p_node->is_inside_tree()); - ERR_EXPLAIN("Trying to call an RPC via a network peer which is not connected."); - ERR_FAIL_COND(network_peer->get_connection_status() != NetworkedMultiplayerPeer::CONNECTION_CONNECTED); + ERR_FAIL_COND_MSG(!network_peer.is_valid(), "Trying to call an RPC while no network peer is active."); + ERR_FAIL_COND_MSG(!p_node->is_inside_tree(), "Trying to call an RPC on a node which is not inside SceneTree."); + ERR_FAIL_COND_MSG(network_peer->get_connection_status() != NetworkedMultiplayerPeer::CONNECTION_CONNECTED, "Trying to call an RPC via a network peer which is not connected."); int node_id = network_peer->get_unique_id(); bool skip_rpc = node_id == p_peer_id; @@ -668,7 +626,7 @@ void MultiplayerAPI::rpcp(Node *p_node, int p_peer_id, bool p_unreliable, const rpc_sender_id = temp_id; if (ce.error != Variant::CallError::CALL_OK) { String error = Variant::get_call_error_text(p_node, p_method, p_arg, p_argcount, ce); - error = "rpc() aborted in local call: - " + error; + error = "rpc() aborted in local call: - " + error + "."; ERR_PRINTS(error); return; } @@ -683,24 +641,20 @@ void MultiplayerAPI::rpcp(Node *p_node, int p_peer_id, bool p_unreliable, const rpc_sender_id = temp_id; if (ce.error != Variant::CallError::CALL_OK) { String error = Variant::get_call_error_text(p_node, p_method, p_arg, p_argcount, ce); - error = "rpc() aborted in script local call: - " + error; + error = "rpc() aborted in script local call: - " + error + "."; ERR_PRINTS(error); return; } } - ERR_EXPLAIN("RPC '" + p_method + "' on yourself is not allowed by selected mode"); - ERR_FAIL_COND(skip_rpc && !(call_local_native || call_local_script)); + ERR_FAIL_COND_MSG(skip_rpc && !(call_local_native || call_local_script), "RPC '" + p_method + "' on yourself is not allowed by selected mode."); } void MultiplayerAPI::rsetp(Node *p_node, int p_peer_id, bool p_unreliable, const StringName &p_property, const Variant &p_value) { - ERR_EXPLAIN("Trying to RSET while no network peer is active."); - ERR_FAIL_COND(!network_peer.is_valid()); - ERR_EXPLAIN("Trying to RSET on a node which is not inside SceneTree."); - ERR_FAIL_COND(!p_node->is_inside_tree()); - ERR_EXPLAIN("Trying to send an RSET via a network peer which is not connected."); - ERR_FAIL_COND(network_peer->get_connection_status() != NetworkedMultiplayerPeer::CONNECTION_CONNECTED); + ERR_FAIL_COND_MSG(!network_peer.is_valid(), "Trying to RSET while no network peer is active."); + ERR_FAIL_COND_MSG(!p_node->is_inside_tree(), "Trying to RSET on a node which is not inside SceneTree."); + ERR_FAIL_COND_MSG(network_peer->get_connection_status() != NetworkedMultiplayerPeer::CONNECTION_CONNECTED, "Trying to send an RSET via a network peer which is not connected."); int node_id = network_peer->get_unique_id(); bool is_master = p_node->is_network_master(); @@ -724,7 +678,7 @@ void MultiplayerAPI::rsetp(Node *p_node, int p_peer_id, bool p_unreliable, const rpc_sender_id = temp_id; if (!valid) { - String error = "rset() aborted in local set, property not found: - " + String(p_property); + String error = "rset() aborted in local set, property not found: - " + String(p_property) + "."; ERR_PRINTS(error); return; } @@ -742,7 +696,7 @@ void MultiplayerAPI::rsetp(Node *p_node, int p_peer_id, bool p_unreliable, const rpc_sender_id = temp_id; if (!valid) { - String error = "rset() aborted in local script set, property not found: - " + String(p_property); + String error = "rset() aborted in local script set, property not found: - " + String(p_property) + "."; ERR_PRINTS(error); return; } @@ -751,8 +705,7 @@ void MultiplayerAPI::rsetp(Node *p_node, int p_peer_id, bool p_unreliable, const } if (skip_rset) { - ERR_EXPLAIN("RSET for '" + p_property + "' on yourself is not allowed by selected mode"); - ERR_FAIL_COND(!set_local); + ERR_FAIL_COND_MSG(!set_local, "RSET for '" + p_property + "' on yourself is not allowed by selected mode."); return; } @@ -763,12 +716,9 @@ void MultiplayerAPI::rsetp(Node *p_node, int p_peer_id, bool p_unreliable, const Error MultiplayerAPI::send_bytes(PoolVector<uint8_t> p_data, int p_to, NetworkedMultiplayerPeer::TransferMode p_mode) { - ERR_EXPLAIN("Trying to send an empty raw packet."); - ERR_FAIL_COND_V(p_data.size() < 1, ERR_INVALID_DATA); - ERR_EXPLAIN("Trying to send a raw packet while no network peer is active."); - ERR_FAIL_COND_V(!network_peer.is_valid(), ERR_UNCONFIGURED); - ERR_EXPLAIN("Trying to send a raw packet via a network peer which is not connected."); - ERR_FAIL_COND_V(network_peer->get_connection_status() != NetworkedMultiplayerPeer::CONNECTION_CONNECTED, ERR_UNCONFIGURED); + ERR_FAIL_COND_V_MSG(p_data.size() < 1, ERR_INVALID_DATA, "Trying to send an empty raw packet."); + ERR_FAIL_COND_V_MSG(!network_peer.is_valid(), ERR_UNCONFIGURED, "Trying to send a raw packet while no network peer is active."); + ERR_FAIL_COND_V_MSG(network_peer->get_connection_status() != NetworkedMultiplayerPeer::CONNECTION_CONNECTED, ERR_UNCONFIGURED, "Trying to send a raw packet via a network peer which is not connected."); MAKE_ROOM(p_data.size() + 1); PoolVector<uint8_t>::Read r = p_data.read(); @@ -783,8 +733,7 @@ Error MultiplayerAPI::send_bytes(PoolVector<uint8_t> p_data, int p_to, Networked void MultiplayerAPI::_process_raw(int p_from, const uint8_t *p_packet, int p_packet_len) { - ERR_EXPLAIN("Invalid packet received. Size too small."); - ERR_FAIL_COND(p_packet_len < 2); + ERR_FAIL_COND_MSG(p_packet_len < 2, "Invalid packet received. Size too small."); PoolVector<uint8_t> out; int len = p_packet_len - 1; @@ -798,37 +747,32 @@ void MultiplayerAPI::_process_raw(int p_from, const uint8_t *p_packet, int p_pac int MultiplayerAPI::get_network_unique_id() const { - ERR_EXPLAIN("No network peer is assigned. Unable to get unique network ID."); - ERR_FAIL_COND_V(!network_peer.is_valid(), 0); + ERR_FAIL_COND_V_MSG(!network_peer.is_valid(), 0, "No network peer is assigned. Unable to get unique network ID."); return network_peer->get_unique_id(); } bool MultiplayerAPI::is_network_server() const { // XXX Maybe fail silently? Maybe should actually return true to make development of both local and online multiplayer easier? - ERR_EXPLAIN("No network peer is assigned. I can't be a server."); - ERR_FAIL_COND_V(!network_peer.is_valid(), false); + ERR_FAIL_COND_V_MSG(!network_peer.is_valid(), false, "No network peer is assigned. I can't be a server."); return network_peer->is_server(); } void MultiplayerAPI::set_refuse_new_network_connections(bool p_refuse) { - ERR_EXPLAIN("No network peer is assigned. Unable to set 'refuse_new_connections'."); - ERR_FAIL_COND(!network_peer.is_valid()); + ERR_FAIL_COND_MSG(!network_peer.is_valid(), "No network peer is assigned. Unable to set 'refuse_new_connections'."); network_peer->set_refuse_new_connections(p_refuse); } bool MultiplayerAPI::is_refusing_new_network_connections() const { - ERR_EXPLAIN("No network peer is assigned. Unable to get 'refuse_new_connections'."); - ERR_FAIL_COND_V(!network_peer.is_valid(), false); + ERR_FAIL_COND_V_MSG(!network_peer.is_valid(), false, "No network peer is assigned. Unable to get 'refuse_new_connections'."); return network_peer->is_refusing_new_connections(); } Vector<int> MultiplayerAPI::get_network_connected_peers() const { - ERR_EXPLAIN("No network peer is assigned. Assume no peers are connected."); - ERR_FAIL_COND_V(!network_peer.is_valid(), Vector<int>()); + ERR_FAIL_COND_V_MSG(!network_peer.is_valid(), Vector<int>(), "No network peer is assigned. Assume no peers are connected."); Vector<int> ret; for (Set<int>::Element *E = connected_peers.front(); E; E = E->next()) { diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index c77c81f9e2..1c792c43d1 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -110,10 +110,11 @@ Error PacketPeer::put_var(const Variant &p_packet, bool p_full_objects) { Variant PacketPeer::_bnd_get_var(bool p_allow_objects) { Variant var; - get_var(var, p_allow_objects); + Error err = get_var(var, p_allow_objects); + ERR_FAIL_COND_V(err != OK, Variant()); return var; -}; +} Error PacketPeer::_put_packet(const PoolVector<uint8_t> &p_buffer) { return put_packet_buffer(p_buffer); @@ -279,8 +280,7 @@ Ref<StreamPeer> PacketPeerStream::get_stream_peer() const { void PacketPeerStream::set_input_buffer_max_size(int p_max_size) { //warning may lose packets - ERR_EXPLAIN("Buffer in use, resizing would cause loss of data"); - ERR_FAIL_COND(ring_buffer.data_left()); + ERR_FAIL_COND_MSG(ring_buffer.data_left(), "Buffer in use, resizing would cause loss of data."); ring_buffer.resize(nearest_shift(p_max_size + 4)); input_buffer.resize(next_power_of_2(p_max_size + 4)); } diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index c16d89d695..1c89bc6268 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -64,10 +64,7 @@ Error PCKPacker::pck_start(const String &p_file, int p_alignment) { file = FileAccess::open(p_file, FileAccess::WRITE); - if (!file) { - ERR_EXPLAIN("Can't open file to write: " + String(p_file)); - ERR_FAIL_V(ERR_CANT_CREATE); - } + ERR_FAIL_COND_V_MSG(!file, ERR_CANT_CREATE, "Can't open file to write: " + String(p_file) + "."); alignment = p_alignment; diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 861e34e415..de10fe1376 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -490,8 +490,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { #endif } else { - ERR_EXPLAIN("Vector2 size is NOT 8!"); - ERR_FAIL_V(ERR_UNAVAILABLE); + ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "Vector2 size is NOT 8!"); } w.release(); r_v = array; @@ -518,8 +517,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { #endif } else { - ERR_EXPLAIN("Vector3 size is NOT 12!"); - ERR_FAIL_V(ERR_UNAVAILABLE); + ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "Vector3 size is NOT 12!"); } w.release(); r_v = array; @@ -546,8 +544,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { #endif } else { - ERR_EXPLAIN("Color size is NOT 16!"); - ERR_FAIL_V(ERR_UNAVAILABLE); + ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "Color size is NOT 16!"); } w.release(); r_v = array; @@ -571,7 +568,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { const uint32_t current_version = 0; if (format_version > current_version) { - ERR_PRINT("Format version for encoded binary image is too new"); + ERR_PRINT("Format version for encoded binary image is too new."); return ERR_PARSE_ERROR; } @@ -655,8 +652,7 @@ Error ResourceInteractiveLoaderBinary::poll() { } else { error = ERR_FILE_MISSING_DEPENDENCIES; - ERR_EXPLAIN("Can't load dependency: " + path); - ERR_FAIL_V(error); + ERR_FAIL_V_MSG(error, "Can't load dependency: " + path + "."); } } else { @@ -711,16 +707,15 @@ Error ResourceInteractiveLoaderBinary::poll() { Object *obj = ClassDB::instance(t); if (!obj) { error = ERR_FILE_CORRUPT; - ERR_EXPLAIN(local_path + ":Resource of unrecognized type in file: " + t); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, local_path + ":Resource of unrecognized type in file: " + t + "."); } - ERR_FAIL_COND_V(!obj, ERR_FILE_CORRUPT); Resource *r = Object::cast_to<Resource>(obj); if (!r) { + String obj_class = obj->get_class(); error = ERR_FILE_CORRUPT; memdelete(obj); //bye - ERR_EXPLAIN(local_path + ":Resource type in resource field not a resource, type is: " + obj->get_class()); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, local_path + ":Resource type in resource field not a resource, type is: " + obj_class + "."); } RES res = RES(r); @@ -850,8 +845,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { //not normal error = ERR_FILE_UNRECOGNIZED; - ERR_EXPLAIN("Unrecognized binary resource file: " + local_path); - ERR_FAIL(); + ERR_FAIL_MSG("Unrecognized binary resource file: " + local_path + "."); } bool big_endian = f->get_32(); @@ -877,8 +871,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) { f->close(); - ERR_EXPLAIN("File Format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a new engine version: " + local_path); - ERR_FAIL(); + ERR_FAIL_MSG("File format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a new engine version: " + local_path + "."); } type = get_unicode_string(); @@ -926,8 +919,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { if (f->eof_reached()) { error = ERR_FILE_CORRUPT; - ERR_EXPLAIN("Premature End Of File: " + local_path); - ERR_FAIL(); + ERR_FAIL_MSG("Premature end of file (EOF): " + local_path + "."); } } @@ -1084,8 +1076,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons //error=ERR_FILE_UNRECOGNIZED; memdelete(f); - ERR_EXPLAIN("Unrecognized binary resource file: " + local_path); - ERR_FAIL_V(ERR_FILE_UNRECOGNIZED); + ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "Unrecognized binary resource file: " + local_path + "."); } else { fw = FileAccess::open(p_path + ".depren", FileAccess::WRITE); if (!fw) { @@ -1122,7 +1113,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons memdelete(da); //use the old approach - WARN_PRINT(("This file is old, so it can't refactor dependencies, opening and resaving: " + p_path).utf8().get_data()); + WARN_PRINTS("This file is old, so it can't refactor dependencies, opening and resaving: " + p_path + "."); Error err; f = FileAccess::open(p_path, FileAccess::READ, &err); @@ -1153,8 +1144,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons memdelete(f); memdelete(fw); - ERR_EXPLAIN("File Format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a new engine version: " + local_path); - ERR_FAIL_V(ERR_FILE_UNRECOGNIZED); + ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "File format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a new engine version: " + local_path + "."); } // Since we're not actually converting the file contents, leave the version @@ -1477,7 +1467,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia case Variant::_RID: { f->store_32(VARIANT_RID); - WARN_PRINT("Can't save RIDs"); + WARN_PRINT("Can't save RIDs."); RID val = p_property; f->store_32(val.get_id()); } break; @@ -1497,8 +1487,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia if (!resource_set.has(res)) { f->store_32(OBJECT_EMPTY); - ERR_EXPLAIN("Resource was not pre cached for the resource section, most likely due to circular refedence."); - ERR_FAIL(); + ERR_FAIL_MSG("Resource was not pre cached for the resource section, most likely due to circular reference."); } f->store_32(OBJECT_INTERNAL_RESOURCE); @@ -1629,8 +1618,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia } break; default: { - ERR_EXPLAIN("Invalid variant"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid variant."); } } } diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index a29b9d1ddb..9e954890bc 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -275,12 +275,9 @@ RES ResourceLoader::_load(const String &p_path, const String &p_original_path, c return res; } - if (found) { - ERR_EXPLAIN("Failed loading resource: " + p_path); - } else { - ERR_EXPLAIN("No loader found for resource: " + p_path); - } - ERR_FAIL_V(RES()); + ERR_FAIL_COND_V_MSG(found, RES(), "Failed loading resource: " + p_path + "."); + + ERR_FAIL_V_MSG(RES(), "No loader found for resource: " + p_path + "."); } bool ResourceLoader::_add_to_loading_map(const String &p_path) { @@ -355,10 +352,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p { bool success = _add_to_loading_map(local_path); - if (!success) { - ERR_EXPLAIN("Resource: '" + local_path + "' is already being loaded. Cyclic reference?"); - ERR_FAIL_V(RES()); - } + ERR_FAIL_COND_V_MSG(!success, RES(), "Resource: '" + local_path + "' is already being loaded. Cyclic reference?"); } //lock first if possible @@ -395,8 +389,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p if (!p_no_cache) { _remove_from_loading_map(local_path); } - ERR_EXPLAIN("Remapping '" + local_path + "'failed."); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), "Remapping '" + local_path + "' failed."); } print_verbose("Loading resource: " + path); @@ -479,10 +472,7 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_ if (!p_no_cache) { bool success = _add_to_loading_map(local_path); - if (!success) { - ERR_EXPLAIN("Resource: '" + local_path + "' is already being loaded. Cyclic reference?"); - ERR_FAIL_V(RES()); - } + ERR_FAIL_COND_V_MSG(!success, RES(), "Resource: '" + local_path + "' is already being loaded. Cyclic reference?"); if (ResourceCache::has(local_path)) { @@ -503,8 +493,7 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_ if (!p_no_cache) { _remove_from_loading_map(local_path); } - ERR_EXPLAIN("Remapping '" + local_path + "'failed."); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), "Remapping '" + local_path + "' failed."); } print_verbose("Loading resource: " + path); @@ -534,12 +523,9 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_ _remove_from_loading_map(local_path); } - if (found) { - ERR_EXPLAIN("Failed loading resource: " + path); - } else { - ERR_EXPLAIN("No loader found for resource: " + path); - } - ERR_FAIL_V(Ref<ResourceInteractiveLoader>()); + ERR_FAIL_COND_V_MSG(found, Ref<ResourceInteractiveLoader>(), "Failed loading resource: " + path + "."); + + ERR_FAIL_V_MSG(Ref<ResourceInteractiveLoader>(), "No loader found for resource: " + path + "."); } void ResourceLoader::add_resource_format_loader(Ref<ResourceFormatLoader> p_format_loader, bool p_at_front) { @@ -801,7 +787,7 @@ String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_rem if (err == ERR_FILE_EOF) { break; } else if (err != OK) { - ERR_PRINTS("Parse error: " + p_path + ".remap:" + itos(lines) + " error: " + error_text); + ERR_PRINTS("Parse error: " + p_path + ".remap:" + itos(lines) + " error: " + error_text + "."); break; } @@ -932,16 +918,13 @@ bool ResourceLoader::add_custom_resource_format_loader(String script_path) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatLoader"); - ERR_EXPLAIN("Script does not inherit a CustomResourceLoader: " + script_path); - ERR_FAIL_COND_V(!valid_type, false); + ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceLoader: " + script_path + "."); Object *obj = ClassDB::instance(ibt); - ERR_EXPLAIN("Cannot instance script as custom resource loader, expected 'ResourceFormatLoader' inheritance, got: " + String(ibt)); - ERR_FAIL_COND_V(obj == NULL, false); + ERR_FAIL_COND_V_MSG(obj == NULL, false, "Cannot instance script as custom resource loader, expected 'ResourceFormatLoader' inheritance, got: " + String(ibt) + "."); - ResourceFormatLoader *crl = NULL; - crl = Object::cast_to<ResourceFormatLoader>(obj); + ResourceFormatLoader *crl = Object::cast_to<ResourceFormatLoader>(obj); crl->set_script(s.get_ref_ptr()); ResourceLoader::add_resource_format_loader(crl); diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index 70e7bdc224..93df8cadb0 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -33,9 +33,6 @@ #include "core/os/thread.h" #include "core/resource.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class ResourceInteractiveLoader : public Reference { diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 0cecca904d..a9ad62afe6 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -137,7 +137,6 @@ Error ResourceSaver::save(const String &p_path, const RES &p_resource, uint32_t save_callback(p_resource, p_path); return OK; - } else { } } @@ -215,16 +214,13 @@ bool ResourceSaver::add_custom_resource_format_saver(String script_path) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatSaver"); - ERR_EXPLAIN("Script does not inherit a CustomResourceSaver: " + script_path); - ERR_FAIL_COND_V(!valid_type, false); + ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceSaver: " + script_path + "."); Object *obj = ClassDB::instance(ibt); - ERR_EXPLAIN("Cannot instance script as custom resource saver, expected 'ResourceFormatSaver' inheritance, got: " + String(ibt)); - ERR_FAIL_COND_V(obj == NULL, false); + ERR_FAIL_COND_V_MSG(obj == NULL, false, "Cannot instance script as custom resource saver, expected 'ResourceFormatSaver' inheritance, got: " + String(ibt) + "."); - ResourceFormatSaver *crl = NULL; - crl = Object::cast_to<ResourceFormatSaver>(obj); + ResourceFormatSaver *crl = Object::cast_to<ResourceFormatSaver>(obj); crl->set_script(s.get_ref_ptr()); ResourceSaver::add_resource_format_saver(crl); diff --git a/core/io/resource_saver.h b/core/io/resource_saver.h index 0fba47a5e8..20e05d827a 100644 --- a/core/io/resource_saver.h +++ b/core/io/resource_saver.h @@ -33,10 +33,6 @@ #include "core/resource.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class ResourceFormatSaver : public Reference { GDCLASS(ResourceFormatSaver, Reference); diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index acf72dbba5..84b8554d54 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -369,7 +369,9 @@ Variant StreamPeer::get_var(bool p_allow_objects) { ERR_FAIL_COND_V(err != OK, Variant()); Variant ret; - decode_variant(ret, var.ptr(), len, NULL, p_allow_objects); + err = decode_variant(ret, var.ptr(), len, NULL, p_allow_objects); + ERR_FAIL_COND_V(err != OK, Variant()); + return ret; } diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index ccce48ccd7..f2eaf57acc 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -30,10 +30,7 @@ #include "stream_peer_ssl.h" -#include "core/io/certs_compressed.gen.h" -#include "core/io/compression.h" -#include "core/os/file_access.h" -#include "core/project_settings.h" +#include "core/engine.h" StreamPeerSSL *(*StreamPeerSSL::_create)() = NULL; @@ -44,22 +41,8 @@ StreamPeerSSL *StreamPeerSSL::create() { return NULL; } -StreamPeerSSL::LoadCertsFromMemory StreamPeerSSL::load_certs_func = NULL; bool StreamPeerSSL::available = false; -void StreamPeerSSL::load_certs_from_memory(const PoolByteArray &p_memory) { - if (load_certs_func) - load_certs_func(p_memory); -} - -void StreamPeerSSL::load_certs_from_file(String p_path) { - if (p_path != "") { - PoolByteArray certs = get_cert_file_as_array(p_path); - if (certs.size() > 0) - load_certs_func(certs); - } -} - bool StreamPeerSSL::is_available() { return available; } @@ -72,56 +55,11 @@ bool StreamPeerSSL::is_blocking_handshake_enabled() const { return blocking_handshake; } -PoolByteArray StreamPeerSSL::get_cert_file_as_array(String p_path) { - - PoolByteArray out; - FileAccess *f = FileAccess::open(p_path, FileAccess::READ); - if (f) { - int flen = f->get_len(); - out.resize(flen + 1); - PoolByteArray::Write w = out.write(); - f->get_buffer(w.ptr(), flen); - w[flen] = 0; // Make sure it ends with string terminator - memdelete(f); -#ifdef DEBUG_ENABLED - print_verbose(vformat("Loaded certs from '%s'.", p_path)); -#endif - } - - return out; -} - -PoolByteArray StreamPeerSSL::get_project_cert_array() { - - PoolByteArray out; - String certs_path = GLOBAL_DEF("network/ssl/certificates", ""); - ProjectSettings::get_singleton()->set_custom_property_info("network/ssl/certificates", PropertyInfo(Variant::STRING, "network/ssl/certificates", PROPERTY_HINT_FILE, "*.crt")); - - if (certs_path != "") { - // Use certs defined in project settings. - return get_cert_file_as_array(certs_path); - } -#ifdef BUILTIN_CERTS_ENABLED - else { - // Use builtin certs only if user did not override it in project settings. - out.resize(_certs_uncompressed_size + 1); - PoolByteArray::Write w = out.write(); - Compression::decompress(w.ptr(), _certs_uncompressed_size, _certs_compressed, _certs_compressed_size, Compression::MODE_DEFLATE); - w[_certs_uncompressed_size] = 0; // Make sure it ends with string terminator -#ifdef DEBUG_ENABLED - print_verbose("Loaded builtin certs"); -#endif - } -#endif - - return out; -} - void StreamPeerSSL::_bind_methods() { ClassDB::bind_method(D_METHOD("poll"), &StreamPeerSSL::poll); - ClassDB::bind_method(D_METHOD("accept_stream", "base"), &StreamPeerSSL::accept_stream); - ClassDB::bind_method(D_METHOD("connect_to_stream", "stream", "validate_certs", "for_hostname"), &StreamPeerSSL::connect_to_stream, DEFVAL(false), DEFVAL(String())); + ClassDB::bind_method(D_METHOD("accept_stream", "stream", "private_key", "certificate", "chain"), &StreamPeerSSL::accept_stream, DEFVAL(Ref<X509Certificate>())); + ClassDB::bind_method(D_METHOD("connect_to_stream", "stream", "validate_certs", "for_hostname", "valid_certificate"), &StreamPeerSSL::connect_to_stream, DEFVAL(false), DEFVAL(String()), DEFVAL(Ref<X509Certificate>())); ClassDB::bind_method(D_METHOD("get_status"), &StreamPeerSSL::get_status); ClassDB::bind_method(D_METHOD("disconnect_from_stream"), &StreamPeerSSL::disconnect_from_stream); ClassDB::bind_method(D_METHOD("set_blocking_handshake_enabled", "enabled"), &StreamPeerSSL::set_blocking_handshake_enabled); diff --git a/core/io/stream_peer_ssl.h b/core/io/stream_peer_ssl.h index 482576c4c6..dedc35b9ac 100644 --- a/core/io/stream_peer_ssl.h +++ b/core/io/stream_peer_ssl.h @@ -31,19 +31,16 @@ #ifndef STREAM_PEER_SSL_H #define STREAM_PEER_SSL_H +#include "core/crypto/crypto.h" #include "core/io/stream_peer.h" class StreamPeerSSL : public StreamPeer { GDCLASS(StreamPeerSSL, StreamPeer); -public: - typedef void (*LoadCertsFromMemory)(const PoolByteArray &p_certs); - protected: static StreamPeerSSL *(*_create)(); static void _bind_methods(); - static LoadCertsFromMemory load_certs_func; static bool available; bool blocking_handshake; @@ -61,18 +58,14 @@ public: bool is_blocking_handshake_enabled() const; virtual void poll() = 0; - virtual Error accept_stream(Ref<StreamPeer> p_base) = 0; - virtual Error connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs = false, const String &p_for_hostname = String()) = 0; + virtual Error accept_stream(Ref<StreamPeer> p_base, Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain = Ref<X509Certificate>()) = 0; + virtual Error connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs = false, const String &p_for_hostname = String(), Ref<X509Certificate> p_valid_cert = Ref<X509Certificate>()) = 0; virtual Status get_status() const = 0; virtual void disconnect_from_stream() = 0; static StreamPeerSSL *create(); - static PoolByteArray get_cert_file_as_array(String p_path); - static PoolByteArray get_project_cert_array(); - static void load_certs_from_file(String p_path); - static void load_certs_from_memory(const PoolByteArray &p_memory); static bool is_available(); StreamPeerSSL(); diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 67a0a905bd..e8e71c10ca 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -67,8 +67,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S if (status == STATUS_READING_ID) { memdelete(f); - ERR_EXPLAIN(p_path + ":" + itos(line) + " Unexpected EOF while reading 'msgid' at file: "); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), p_path + ":" + itos(line) + " Unexpected EOF while reading 'msgid' at file: "); } else { break; } @@ -79,8 +78,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S if (status == STATUS_READING_ID) { memdelete(f); - ERR_EXPLAIN(p_path + ":" + itos(line) + " Unexpected 'msgid', was expecting 'msgstr' while parsing: "); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), p_path + ":" + itos(line) + " Unexpected 'msgid', was expecting 'msgstr' while parsing: "); } if (msg_id != "") { @@ -102,8 +100,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S if (status != STATUS_READING_ID) { memdelete(f); - ERR_EXPLAIN(p_path + ":" + itos(line) + " Unexpected 'msgstr', was expecting 'msgid' while parsing: "); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), p_path + ":" + itos(line) + " Unexpected 'msgstr', was expecting 'msgid' while parsing: "); } l = l.substr(6, l.length()).strip_edges(); @@ -118,11 +115,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S continue; //nothing to read or comment } - if (!l.begins_with("\"") || status == STATUS_NONE) { - //not a string? failure! - ERR_EXPLAIN(p_path + ":" + itos(line) + " Invalid line '" + l + "' while parsing: "); - ERR_FAIL_V(RES()); - } + ERR_FAIL_COND_V_MSG(!l.begins_with("\"") || status == STATUS_NONE, RES(), p_path + ":" + itos(line) + " Invalid line '" + l + "' while parsing: "); l = l.substr(1, l.length()); //find final quote @@ -135,10 +128,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S } } - if (end_pos == -1) { - ERR_EXPLAIN(p_path + ":" + itos(line) + " Expected '\"' at end of message while parsing file: "); - ERR_FAIL_V(RES()); - } + ERR_FAIL_COND_V_MSG(end_pos == -1, RES(), p_path + ":" + itos(line) + " Expected '\"' at end of message while parsing file: "); l = l.substr(0, end_pos); l = l.c_unescape(); @@ -163,10 +153,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S config = msg_str; } - if (config == "") { - ERR_EXPLAIN("No config found in file: " + p_path); - ERR_FAIL_V(RES()); - } + ERR_FAIL_COND_V_MSG(config == "", RES(), "No config found in file: " + p_path + "."); Vector<String> configs = config.split("\n"); for (int i = 0; i < configs.size(); i++) { diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 82527d3f38..9487947365 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -443,10 +443,8 @@ String XMLParser::get_attribute_value(const String &p_name) const { } } - if (idx < 0) { - ERR_EXPLAIN("Attribute not found: " + p_name); - } - ERR_FAIL_COND_V(idx < 0, ""); + ERR_FAIL_COND_V_MSG(idx < 0, "", "Attribute not found: " + p_name + "."); + return attributes[idx].value; } diff --git a/core/make_binders.py b/core/make_binders.py index 24901c42a1..c38db5cef4 100644 --- a/core/make_binders.py +++ b/core/make_binders.py @@ -334,9 +334,6 @@ def make_version(template, nargs, argmax, const, ret): elif (cmd == "noarg"): for i in range(nargs + 1, argmax + 1): outtext += data.replace("@", str(i)) - elif (cmd == "noarg"): - for i in range(nargs + 1, argmax + 1): - outtext += data.replace("@", str(i)) from_pos = end + 1 diff --git a/core/map.h b/core/map.h index a701ba36f7..c87ee42e1b 100644 --- a/core/map.h +++ b/core/map.h @@ -33,12 +33,8 @@ #include "core/set.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - // based on the very nice implementation of rb-trees by: -// http://web.mit.edu/~emin/www/source_code/red_black_tree/index.html +// https://web.archive.org/web/20120507164830/http://web.mit.edu/~emin/www/source_code/red_black_tree/index.html template <class K, class V, class C = Comparator<K>, class A = DefaultAllocator> class Map { diff --git a/core/math/SCsub b/core/math/SCsub index 0995298a4b..be438fcfbe 100644 --- a/core/math/SCsub +++ b/core/math/SCsub @@ -2,37 +2,6 @@ Import('env') -env_math = env.Clone() # Maybe make one specific for crypto? - -is_builtin = env["builtin_mbedtls"] -has_module = env["module_mbedtls_enabled"] - -if is_builtin or not has_module: - # Use our headers for builtin or if the module is not going to be compiled. - # We decided not to depend on system mbedtls just for these few files that can - # be easily extracted. - env_math.Prepend(CPPPATH=["#thirdparty/mbedtls/include"]) - -# MbedTLS core functions (for CryptoCore). -# If the mbedtls module is compiled we don't need to add the .c files with our -# custom config since they will be built by the module itself. -# Only if the module is not enabled, we must compile here the required sources -# to make a "light" build with only the necessary mbedtls files. -if not has_module: - env_thirdparty = env_math.Clone() - env_thirdparty.disable_warnings() - # Custom config file - env_thirdparty.Append(CPPDEFINES=[('MBEDTLS_CONFIG_FILE', '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')]) - thirdparty_mbedtls_dir = "#thirdparty/mbedtls/library/" - thirdparty_mbedtls_sources = [ - "aes.c", - "base64.c", - "md5.c", - "sha1.c", - "sha256.c", - "godot_core_mbedtls_platform.c" - ] - thirdparty_mbedtls_sources = [thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources] - env_thirdparty.add_source_files(env.core_sources, thirdparty_mbedtls_sources) +env_math = env.Clone() env_math.add_source_files(env.core_sources, "*.cpp") diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index b61119d8df..aea42a1edf 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -40,7 +40,17 @@ int AStar::get_available_point_id() const { return 1; } - return points.back()->key() + 1; + // calculate our new next available point id if bigger than before or next id already contained in set of points. + if (points.has(last_free_id)) { + int cur_new_id = last_free_id; + while (points.has(cur_new_id)) { + cur_new_id++; + } + int &non_const = const_cast<int &>(last_free_id); + non_const = cur_new_id; + } + + return last_free_id; } void AStar::add_point(int p_id, const Vector3 &p_pos, real_t p_weight_scale) { @@ -48,7 +58,10 @@ void AStar::add_point(int p_id, const Vector3 &p_pos, real_t p_weight_scale) { ERR_FAIL_COND(p_id < 0); ERR_FAIL_COND(p_weight_scale < 1); - if (!points.has(p_id)) { + Point *found_pt; + bool p_exists = points.lookup(p_id, found_pt); + + if (!p_exists) { Point *pt = memnew(Point); pt->id = p_id; pt->pos = p_pos; @@ -57,84 +70,98 @@ void AStar::add_point(int p_id, const Vector3 &p_pos, real_t p_weight_scale) { pt->open_pass = 0; pt->closed_pass = 0; pt->enabled = true; - points[p_id] = pt; + points.set(p_id, pt); } else { - points[p_id]->pos = p_pos; - points[p_id]->weight_scale = p_weight_scale; + found_pt->pos = p_pos; + found_pt->weight_scale = p_weight_scale; } } Vector3 AStar::get_point_position(int p_id) const { - ERR_FAIL_COND_V(!points.has(p_id), Vector3()); + Point *p; + bool p_exists = points.lookup(p_id, p); + ERR_FAIL_COND_V(!p_exists, Vector3()); - return points[p_id]->pos; + return p->pos; } void AStar::set_point_position(int p_id, const Vector3 &p_pos) { - ERR_FAIL_COND(!points.has(p_id)); + Point *p; + bool p_exists = points.lookup(p_id, p); + ERR_FAIL_COND(!p_exists); - points[p_id]->pos = p_pos; + p->pos = p_pos; } real_t AStar::get_point_weight_scale(int p_id) const { - ERR_FAIL_COND_V(!points.has(p_id), 0); + Point *p; + bool p_exists = points.lookup(p_id, p); + ERR_FAIL_COND_V(!p_exists, 0); - return points[p_id]->weight_scale; + return p->weight_scale; } void AStar::set_point_weight_scale(int p_id, real_t p_weight_scale) { - ERR_FAIL_COND(!points.has(p_id)); + Point *p; + bool p_exists = points.lookup(p_id, p); + ERR_FAIL_COND(!p_exists); ERR_FAIL_COND(p_weight_scale < 1); - points[p_id]->weight_scale = p_weight_scale; + p->weight_scale = p_weight_scale; } void AStar::remove_point(int p_id) { - ERR_FAIL_COND(!points.has(p_id)); - - Point *p = points[p_id]; + Point *p; + bool p_exists = points.lookup(p_id, p); + ERR_FAIL_COND(!p_exists); - for (Set<Point *>::Element *E = p->neighbours.front(); E; E = E->next()) { + for (OAHashMap<int, Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) { - Segment s(p_id, E->get()->id); + Segment s(p_id, (*it.key)); segments.erase(s); - E->get()->neighbours.erase(p); - E->get()->unlinked_neighbours.erase(p); + (*it.value)->neighbours.remove(p->id); + (*it.value)->unlinked_neighbours.remove(p->id); } - for (Set<Point *>::Element *E = p->unlinked_neighbours.front(); E; E = E->next()) { + for (OAHashMap<int, Point *>::Iterator it = p->unlinked_neighbours.iter(); it.valid; it = p->unlinked_neighbours.next_iter(it)) { - Segment s(p_id, E->get()->id); + Segment s(p_id, (*it.key)); segments.erase(s); - E->get()->neighbours.erase(p); - E->get()->unlinked_neighbours.erase(p); + (*it.value)->neighbours.remove(p->id); + (*it.value)->unlinked_neighbours.remove(p->id); } memdelete(p); - points.erase(p_id); + points.remove(p_id); + last_free_id = p_id; } void AStar::connect_points(int p_id, int p_with_id, bool bidirectional) { - ERR_FAIL_COND(!points.has(p_id)); - ERR_FAIL_COND(!points.has(p_with_id)); ERR_FAIL_COND(p_id == p_with_id); - Point *a = points[p_id]; - Point *b = points[p_with_id]; - a->neighbours.insert(b); + Point *a; + bool from_exists = points.lookup(p_id, a); + ERR_FAIL_COND(!from_exists); - if (bidirectional) - b->neighbours.insert(a); - else - b->unlinked_neighbours.insert(a); + Point *b; + bool to_exists = points.lookup(p_with_id, b); + ERR_FAIL_COND(!to_exists); + + a->neighbours.set(b->id, b); + + if (bidirectional) { + b->neighbours.set(a->id, a); + } else { + b->unlinked_neighbours.set(a->id, a); + } Segment s(p_id, p_with_id); if (s.from == p_id) { @@ -147,6 +174,7 @@ void AStar::connect_points(int p_id, int p_with_id, bool bidirectional) { segments.insert(s); } + void AStar::disconnect_points(int p_id, int p_with_id) { Segment s(p_id, p_with_id); @@ -154,12 +182,18 @@ void AStar::disconnect_points(int p_id, int p_with_id) { segments.erase(s); - Point *a = points[p_id]; - Point *b = points[p_with_id]; - a->neighbours.erase(b); - a->unlinked_neighbours.erase(b); - b->neighbours.erase(a); - b->unlinked_neighbours.erase(a); + Point *a; + bool a_exists = points.lookup(p_id, a); + CRASH_COND(!a_exists); + + Point *b; + bool b_exists = points.lookup(p_with_id, b); + CRASH_COND(!b_exists); + + a->neighbours.remove(b->id); + a->unlinked_neighbours.remove(b->id); + b->neighbours.remove(a->id); + b->unlinked_neighbours.remove(a->id); } bool AStar::has_point(int p_id) const { @@ -171,8 +205,8 @@ Array AStar::get_points() { Array point_list; - for (const Map<int, Point *>::Element *E = points.front(); E; E = E->next()) { - point_list.push_back(E->key()); + for (OAHashMap<int, Point *>::Iterator it = points.iter(); it.valid; it = points.next_iter(it)) { + point_list.push_back(*(it.key)); } return point_list; @@ -180,14 +214,14 @@ Array AStar::get_points() { PoolVector<int> AStar::get_point_connections(int p_id) { - ERR_FAIL_COND_V(!points.has(p_id), PoolVector<int>()); + Point *p; + bool p_exists = points.lookup(p_id, p); + ERR_FAIL_COND_V(!p_exists, PoolVector<int>()); PoolVector<int> point_list; - Point *p = points[p_id]; - - for (Set<Point *>::Element *E = p->neighbours.front(); E; E = E->next()) { - point_list.push_back(E->get()->id); + for (OAHashMap<int, Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) { + point_list.push_back((*it.key)); } return point_list; @@ -201,9 +235,9 @@ bool AStar::are_points_connected(int p_id, int p_with_id) const { void AStar::clear() { - for (const Map<int, Point *>::Element *E = points.front(); E; E = E->next()) { - - memdelete(E->get()); + last_free_id = 0; + for (OAHashMap<int, Point *>::Iterator it = points.iter(); it.valid; it = points.next_iter(it)) { + memdelete(*(it.value)); } segments.clear(); points.clear(); @@ -214,14 +248,14 @@ int AStar::get_closest_point(const Vector3 &p_point) const { int closest_id = -1; real_t closest_dist = 1e20; - for (const Map<int, Point *>::Element *E = points.front(); E; E = E->next()) { + for (OAHashMap<int, Point *>::Iterator it = points.iter(); it.valid; it = points.next_iter(it)) { + + if (!(*it.value)->enabled) continue; // Disabled points should not be considered. - if (!E->get()->enabled) - continue; //Disabled points should not be considered - real_t d = p_point.distance_squared_to(E->get()->pos); + real_t d = p_point.distance_squared_to((*it.value)->pos); if (closest_id < 0 || d < closest_dist) { closest_dist = d; - closest_id = E->key(); + closest_id = *(it.key); } } @@ -230,8 +264,8 @@ int AStar::get_closest_point(const Vector3 &p_point) const { Vector3 AStar::get_closest_position_in_segment(const Vector3 &p_point) const { - real_t closest_dist = 1e20; bool found = false; + real_t closest_dist = 1e20; Vector3 closest_point; for (const Set<Segment>::Element *E = segments.front(); E; E = E->next()) { @@ -262,8 +296,7 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { pass++; - if (!end_point->enabled) - return false; + if (!end_point->enabled) return false; bool found_route = false; @@ -272,13 +305,9 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { begin_point->g_score = 0; begin_point->f_score = _estimate_cost(begin_point->id, end_point->id); - open_list.push_back(begin_point); - while (true) { - - if (open_list.size() == 0) // No path found - break; + while (!open_list.empty()) { Point *p = open_list[0]; // The currently processed point @@ -291,24 +320,23 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { open_list.remove(open_list.size() - 1); p->closed_pass = pass; // Mark the point as closed - for (Set<Point *>::Element *E = p->neighbours.front(); E; E = E->next()) { + for (OAHashMap<int, Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) { - Point *e = E->get(); // The neighbour point + Point *e = *(it.value); // The neighbour point - if (!e->enabled || e->closed_pass == pass) + if (!e->enabled || e->closed_pass == pass) { continue; + } real_t tentative_g_score = p->g_score + _compute_cost(p->id, e->id) * e->weight_scale; bool new_point = false; - if (e->open_pass != pass) { // The point wasn't inside the open list - + if (e->open_pass != pass) { // The point wasn't inside the open list. e->open_pass = pass; open_list.push_back(e); new_point = true; - } else if (tentative_g_score >= e->g_score) { // The new path is worse than the previous - + } else if (tentative_g_score >= e->g_score) { // The new path is worse than the previous. continue; } @@ -316,10 +344,11 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { e->g_score = tentative_g_score; e->f_score = e->g_score + _estimate_cost(e->id, end_point->id); - if (new_point) // The position of the new points is already known + if (new_point) { // The position of the new points is already known. sorter.push_heap(0, open_list.size() - 1, 0, e, open_list.ptrw()); - else + } else { sorter.push_heap(0, open_list.find(e), 0, e, open_list.ptrw()); + } } } @@ -331,7 +360,15 @@ float AStar::_estimate_cost(int p_from_id, int p_to_id) { if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_estimate_cost)) return get_script_instance()->call(SceneStringNames::get_singleton()->_estimate_cost, p_from_id, p_to_id); - return points[p_from_id]->pos.distance_to(points[p_to_id]->pos); + Point *from_point; + bool from_exists = points.lookup(p_from_id, from_point); + CRASH_COND(!from_exists); + + Point *to_point; + bool to_exists = points.lookup(p_to_id, to_point); + CRASH_COND(!to_exists); + + return from_point->pos.distance_to(to_point->pos); } float AStar::_compute_cost(int p_from_id, int p_to_id) { @@ -339,16 +376,26 @@ float AStar::_compute_cost(int p_from_id, int p_to_id) { if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_compute_cost)) return get_script_instance()->call(SceneStringNames::get_singleton()->_compute_cost, p_from_id, p_to_id); - return points[p_from_id]->pos.distance_to(points[p_to_id]->pos); + Point *from_point; + bool from_exists = points.lookup(p_from_id, from_point); + CRASH_COND(!from_exists); + + Point *to_point; + bool to_exists = points.lookup(p_to_id, to_point); + CRASH_COND(!to_exists); + + return from_point->pos.distance_to(to_point->pos); } PoolVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { - ERR_FAIL_COND_V(!points.has(p_from_id), PoolVector<Vector3>()); - ERR_FAIL_COND_V(!points.has(p_to_id), PoolVector<Vector3>()); + Point *a; + bool from_exists = points.lookup(p_from_id, a); + ERR_FAIL_COND_V(!from_exists, PoolVector<Vector3>()); - Point *a = points[p_from_id]; - Point *b = points[p_to_id]; + Point *b; + bool to_exists = points.lookup(p_to_id, b); + ERR_FAIL_COND_V(!to_exists, PoolVector<Vector3>()); if (a == b) { PoolVector<Vector3> ret; @@ -360,11 +407,8 @@ PoolVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { Point *end_point = b; bool found_route = _solve(begin_point, end_point); + if (!found_route) return PoolVector<Vector3>(); - if (!found_route) - return PoolVector<Vector3>(); - - // Midpoints Point *p = end_point; int pc = 1; // Begin point while (p != begin_point) { @@ -393,11 +437,13 @@ PoolVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { PoolVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { - ERR_FAIL_COND_V(!points.has(p_from_id), PoolVector<int>()); - ERR_FAIL_COND_V(!points.has(p_to_id), PoolVector<int>()); + Point *a; + bool from_exists = points.lookup(p_from_id, a); + ERR_FAIL_COND_V(!from_exists, PoolVector<int>()); - Point *a = points[p_from_id]; - Point *b = points[p_to_id]; + Point *b; + bool to_exists = points.lookup(p_to_id, b); + ERR_FAIL_COND_V(!to_exists, PoolVector<int>()); if (a == b) { PoolVector<int> ret; @@ -409,11 +455,8 @@ PoolVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { Point *end_point = b; bool found_route = _solve(begin_point, end_point); + if (!found_route) return PoolVector<int>(); - if (!found_route) - return PoolVector<int>(); - - // Midpoints Point *p = end_point; int pc = 1; // Begin point while (p != begin_point) { @@ -442,16 +485,20 @@ PoolVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { void AStar::set_point_disabled(int p_id, bool p_disabled) { - ERR_FAIL_COND(!points.has(p_id)); + Point *p; + bool p_exists = points.lookup(p_id, p); + ERR_FAIL_COND(!p_exists); - points[p_id]->enabled = !p_disabled; + p->enabled = !p_disabled; } bool AStar::is_point_disabled(int p_id) const { - ERR_FAIL_COND_V(!points.has(p_id), false); + Point *p; + bool p_exists = points.lookup(p_id, p); + ERR_FAIL_COND_V(!p_exists, false); - return !points[p_id]->enabled; + return !p->enabled; } void AStar::_bind_methods() { @@ -487,13 +534,11 @@ void AStar::_bind_methods() { } AStar::AStar() { - + last_free_id = 0; pass = 1; } AStar::~AStar() { - - pass = 1; clear(); } diff --git a/core/math/a_star.h b/core/math/a_star.h index ec333efc1d..53aaaa1f6c 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -31,8 +31,8 @@ #ifndef ASTAR_H #define ASTAR_H +#include "core/oa_hash_map.h" #include "core/reference.h" -#include "core/self_list.h" /** A* pathfinding algorithm @@ -44,8 +44,6 @@ class AStar : public Reference { GDCLASS(AStar, Reference); - uint64_t pass; - struct Point { int id; @@ -53,10 +51,10 @@ class AStar : public Reference { real_t weight_scale; bool enabled; - Set<Point *> neighbours; - Set<Point *> unlinked_neighbours; + OAHashMap<int, Point *> neighbours; + OAHashMap<int, Point *> unlinked_neighbours; - // Used for pathfinding + // Used for pathfinding. Point *prev_point; real_t g_score; real_t f_score; @@ -64,16 +62,15 @@ class AStar : public Reference { uint64_t closed_pass; }; - Map<int, Point *> points; - struct SortPoints { - _FORCE_INLINE_ bool operator()(const Point *A, const Point *B) const { // Returns true when the Point A is worse than Point B - if (A->f_score > B->f_score) + _FORCE_INLINE_ bool operator()(const Point *A, const Point *B) const { // Returns true when the Point A is worse than Point B. + if (A->f_score > B->f_score) { return true; - else if (A->f_score < B->f_score) + } else if (A->f_score < B->f_score) { return false; - else - return A->g_score < B->g_score; // If the f_costs are the same then prioritize the points that are further away from the start + } else { + return A->g_score < B->g_score; // If the f_costs are the same then prioritize the points that are further away from the start. + } } }; @@ -101,6 +98,10 @@ class AStar : public Reference { } }; + int last_free_id; + uint64_t pass; + + OAHashMap<int, Point *> points; Set<Segment> segments; bool _solve(Point *begin_point, Point *end_point); diff --git a/core/math/basis.cpp b/core/math/basis.cpp index 400f342018..2985959113 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -618,10 +618,7 @@ Basis::operator String() const { Quat Basis::get_quat() const { #ifdef MATH_CHECKS - if (!is_rotation()) { - ERR_EXPLAIN("Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quat() or call orthonormalized() instead."); - ERR_FAIL_V(Quat()); - } + ERR_FAIL_COND_V_MSG(!is_rotation(), Quat(), "Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quat() or call orthonormalized() instead."); #endif /* Allow getting a quaternion from an unnormalized transform */ Basis m = *this; diff --git a/core/math/basis.h b/core/math/basis.h index d3adad3d90..053effda69 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -36,10 +36,6 @@ #include "core/math/quat.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Basis { public: Vector3 elements[3]; diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index a12f9fee2e..cfa698282e 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -192,7 +192,7 @@ int BSP_Tree::get_points_inside(const Vector3 *p_points, int p_point_count) cons #ifdef DEBUG_ENABLED int plane_count = planes.size(); uint16_t plane = nodesptr[idx].plane; - ERR_FAIL_INDEX_V(plane, plane_count, false); + ERR_FAIL_UNSIGNED_INDEX_V(plane, plane_count, false); #endif idx = planesptr[nodesptr[idx].plane].is_point_over(point) ? nodes[idx].over : nodes[idx].under; @@ -258,7 +258,7 @@ bool BSP_Tree::point_is_inside(const Vector3 &p_point) const { #ifdef DEBUG_ENABLED int plane_count = planes.size(); uint16_t plane = nodesptr[idx].plane; - ERR_FAIL_INDEX_V(plane, plane_count, false); + ERR_FAIL_UNSIGNED_INDEX_V(plane, plane_count, false); #endif bool over = planesptr[nodesptr[idx].plane].is_point_over(p_point); diff --git a/core/math/bsp_tree.h b/core/math/bsp_tree.h index a7a3697990..90b5e8322a 100644 --- a/core/math/bsp_tree.h +++ b/core/math/bsp_tree.h @@ -38,9 +38,7 @@ #include "core/pool_vector.h" #include "core/variant.h" #include "core/vector.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class BSP_Tree { public: enum { diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 8b3b6c82f3..30c0cab909 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -302,8 +302,8 @@ Vector<Plane> CameraMatrix::get_projection_planes(const Transform &p_transform) /** Fast Plane Extraction from combined modelview/projection matrices. * References: - * http://www.markmorley.com/opengl/frustumculling.html - * http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf + * https://web.archive.org/web/20011221205252/http://www.markmorley.com/opengl/frustumculling.html + * https://web.archive.org/web/20061020020112/http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf */ Vector<Plane> planes; diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h index 3bcf48f5da..63cc88553d 100644 --- a/core/math/camera_matrix.h +++ b/core/math/camera_matrix.h @@ -34,10 +34,6 @@ #include "core/math/rect2.h" #include "core/math/transform.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - struct CameraMatrix { enum Planes { diff --git a/core/math/delaunay.h b/core/math/delaunay.h index ed52c506db..3f8013a3e6 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 (Math::is_zero_approx(p_vertices[p_a.edge[0]].distance_to(p_vertices[p_b.edge[0]])) && Math::is_zero_approx(p_vertices[p_a.edge[1]].distance_to(p_vertices[p_b.edge[1]]))) { + 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]]) { return true; } - if (Math::is_zero_approx(p_vertices[p_a.edge[0]].distance_to(p_vertices[p_b.edge[1]])) && Math::is_zero_approx(p_vertices[p_a.edge[1]].distance_to(p_vertices[p_b.edge[0]]))) { + 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]]) { return true; } diff --git a/core/math/expression.cpp b/core/math/expression.cpp index b52658e2cf..46f81ce5c3 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -52,6 +52,7 @@ const char *Expression::func_name[Expression::FUNC_MAX] = { "sqrt", "fmod", "fposmod", + "posmod", "floor", "ceil", "round", @@ -67,6 +68,7 @@ const char *Expression::func_name[Expression::FUNC_MAX] = { "step_decimals", "stepify", "lerp", + "lerp_angle", "inverse_lerp", "range_lerp", "smoothstep", @@ -175,6 +177,7 @@ int Expression::get_func_argument_count(BuiltinFunc p_func) { case MATH_ATAN2: case MATH_FMOD: case MATH_FPOSMOD: + case MATH_POSMOD: case MATH_POW: case MATH_EASE: case MATH_STEPIFY: @@ -188,6 +191,7 @@ int Expression::get_func_argument_count(BuiltinFunc p_func) { case COLORN: return 2; case MATH_LERP: + case MATH_LERP_ANGLE: case MATH_INVERSE_LERP: case MATH_SMOOTHSTEP: case MATH_MOVE_TOWARD: @@ -283,6 +287,12 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant VALIDATE_ARG_NUM(1); *r_return = Math::fposmod((double)*p_inputs[0], (double)*p_inputs[1]); } break; + case MATH_POSMOD: { + + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + *r_return = Math::posmod((int)*p_inputs[0], (int)*p_inputs[1]); + } break; case MATH_FLOOR: { VALIDATE_ARG_NUM(0); @@ -387,6 +397,13 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant VALIDATE_ARG_NUM(2); *r_return = Math::lerp((double)*p_inputs[0], (double)*p_inputs[1], (double)*p_inputs[2]); } break; + case MATH_LERP_ANGLE: { + + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + VALIDATE_ARG_NUM(2); + *r_return = Math::lerp_angle((double)*p_inputs[0], (double)*p_inputs[1], (double)*p_inputs[2]); + } break; case MATH_INVERSE_LERP: { VALIDATE_ARG_NUM(0); @@ -793,17 +810,13 @@ Error Expression::_get_token(Token &r_token) { #define GET_CHAR() (str_ofs >= expression.length() ? 0 : expression[str_ofs++]) CharType cchar = GET_CHAR(); - if (cchar == 0) { - r_token.type = TK_EOF; - return OK; - } switch (cchar) { case 0: { r_token.type = TK_EOF; return OK; - } break; + }; case '{': { r_token.type = TK_CURLY_BRACKET_OPEN; @@ -2148,10 +2161,8 @@ Error Expression::parse(const String &p_expression, const Vector<String> &p_inpu } Variant Expression::execute(Array p_inputs, Object *p_base, bool p_show_error) { - if (error_set) { - ERR_EXPLAIN("There was previously a parse error: " + error_str); - ERR_FAIL_V(Variant()); - } + + ERR_FAIL_COND_V_MSG(error_set, Variant(), "There was previously a parse error: " + error_str + "."); execution_error = false; Variant output; @@ -2160,10 +2171,7 @@ Variant Expression::execute(Array p_inputs, Object *p_base, bool p_show_error) { if (err) { execution_error = true; error_str = error_txt; - if (p_show_error) { - ERR_EXPLAIN(error_str); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(p_show_error, Variant(), error_str); } return output; diff --git a/core/math/expression.h b/core/math/expression.h index 1113bb6587..833220592c 100644 --- a/core/math/expression.h +++ b/core/math/expression.h @@ -51,6 +51,7 @@ public: MATH_SQRT, MATH_FMOD, MATH_FPOSMOD, + MATH_POSMOD, MATH_FLOOR, MATH_CEIL, MATH_ROUND, @@ -66,6 +67,7 @@ public: MATH_STEP_DECIMALS, MATH_STEPIFY, MATH_LERP, + MATH_LERP_ANGLE, MATH_INVERSE_LERP, MATH_RANGE_LERP, MATH_SMOOTHSTEP, diff --git a/core/math/geometry.h b/core/math/geometry.h index e4f3ff799e..82d9884e9b 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -41,10 +41,6 @@ #include "core/print_string.h" #include "core/vector.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Geometry { Geometry(); @@ -838,8 +834,7 @@ public: static Vector<Vector<Point2> > offset_polyline_2d(const Vector<Vector2> &p_polygon, real_t p_delta, PolyJoinType p_join_type, PolyEndType p_end_type) { - ERR_EXPLAIN("Attempt to offset a polyline like a polygon (use offset_polygon_2d instead)."); - ERR_FAIL_COND_V(p_end_type == END_POLYGON, Vector<Vector<Point2> >()); + ERR_FAIL_COND_V_MSG(p_end_type == END_POLYGON, Vector<Vector<Point2> >(), "Attempt to offset a polyline like a polygon (use offset_polygon_2d instead)."); return _polypath_offset(p_polygon, p_delta, p_join_type, p_end_type); } diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp index 7a2e74a413..f04e40cb6c 100644 --- a/core/math/math_funcs.cpp +++ b/core/math/math_funcs.cpp @@ -79,6 +79,15 @@ int Math::step_decimals(double p_step) { return 0; } +// Only meant for editor usage in float ranges, where a step of 0 +// means that decimal digits should not be limited in String::num. +int Math::range_step_decimals(double p_step) { + if (p_step < 0.0000000000001) { + return 16; // Max value hardcoded in String::num + } + return step_decimals(p_step); +} + double Math::dectime(double p_value, double p_amount, double p_step) { double sgn = p_value < 0 ? -1.0 : 1.0; double val = Math::abs(p_value); diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index 0e3bd8a318..af845ca01e 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -198,6 +198,13 @@ public: value += 0.0; return value; } + static _ALWAYS_INLINE_ int posmod(int p_x, int p_y) { + int value = p_x % p_y; + if ((value < 0 && p_y > 0) || (value > 0 && p_y < 0)) { + value += p_y; + } + return value; + } static _ALWAYS_INLINE_ double deg2rad(double p_y) { return p_y * Math_PI / 180.0; } static _ALWAYS_INLINE_ float deg2rad(float p_y) { return p_y * Math_PI / 180.0; } @@ -208,6 +215,17 @@ public: static _ALWAYS_INLINE_ double lerp(double p_from, double p_to, double p_weight) { return p_from + (p_to - p_from) * p_weight; } static _ALWAYS_INLINE_ float lerp(float p_from, float p_to, float p_weight) { return p_from + (p_to - p_from) * p_weight; } + static _ALWAYS_INLINE_ double lerp_angle(double p_from, double p_to, double p_weight) { + double difference = fmod(p_to - p_from, Math_TAU); + double distance = fmod(2.0 * difference, Math_TAU) - difference; + return p_from + distance * p_weight; + } + static _ALWAYS_INLINE_ float lerp_angle(float p_from, float p_to, float p_weight) { + float difference = fmod(p_to - p_from, (float)Math_TAU); + float distance = fmod(2.0f * difference, (float)Math_TAU) - difference; + return p_from + distance * p_weight; + } + static _ALWAYS_INLINE_ double inverse_lerp(double p_from, double p_to, double p_value) { return (p_value - p_from) / (p_to - p_from); } static _ALWAYS_INLINE_ float inverse_lerp(float p_from, float p_to, float p_value) { return (p_value - p_from) / (p_to - p_from); } @@ -237,21 +255,22 @@ public: static _ALWAYS_INLINE_ float round(float p_val) { return (p_val >= 0) ? Math::floor(p_val + 0.5) : -Math::floor(-p_val + 0.5); } static _ALWAYS_INLINE_ int64_t wrapi(int64_t value, int64_t min, int64_t max) { - int64_t rng = max - min; - return (rng != 0) ? min + ((((value - min) % rng) + rng) % rng) : min; + int64_t range = max - min; + return range == 0 ? min : min + ((((value - min) % range) + range) % range); } static _ALWAYS_INLINE_ double wrapf(double value, double min, double max) { - double rng = max - min; - return (!is_equal_approx(rng, 0.0)) ? value - (rng * Math::floor((value - min) / rng)) : min; + double range = max - min; + return is_zero_approx(range) ? min : value - (range * Math::floor((value - min) / range)); } static _ALWAYS_INLINE_ float wrapf(float value, float min, float max) { - float rng = max - min; - return (!is_equal_approx(rng, 0.0f)) ? value - (rng * Math::floor((value - min) / rng)) : min; + float range = max - min; + return is_zero_approx(range) ? min : value - (range * Math::floor((value - min) / range)); } // double only, as these functions are mainly used by the editor and not performance-critical, static double ease(double p_x, double p_c); static int step_decimals(double p_step); + static int range_step_decimals(double p_step); static double stepify(double p_value, double p_step); static double dectime(double p_value, double p_amount, double p_step); diff --git a/core/math/octree.h b/core/math/octree.h index d6fc9776bc..db15c8a1f8 100644 --- a/core/math/octree.h +++ b/core/math/octree.h @@ -38,10 +38,6 @@ #include "core/print_string.h" #include "core/variant.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - typedef uint32_t OctreeElementID; #define OCTREE_ELEMENT_INVALID_ID 0 @@ -568,10 +564,7 @@ void Octree<T, use_pairs, AL>::_ensure_valid_root(const AABB &p_aabb) { while (!base.encloses(p_aabb)) { - if (base.size.x > OCTREE_SIZE_LIMIT) { - ERR_EXPLAIN("Octree upper size limit reeached, does the AABB supplied contain NAN?"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(base.size.x > OCTREE_SIZE_LIMIT, "Octree upper size limit reached, does the AABB supplied contain NAN?"); Octant *gp = memnew_allocator(Octant, AL); octant_count++; diff --git a/core/math/quat.h b/core/math/quat.h index 8ed2fa7cc2..3d6602e466 100644 --- a/core/math/quat.h +++ b/core/math/quat.h @@ -38,10 +38,6 @@ #include "core/math/math_funcs.h" #include "core/ustring.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Quat { public: real_t x, y, z, w; diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 7ff7cac914..4056975da8 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -213,3 +213,8 @@ Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) : basis(p_basis), origin(p_origin) { } + +Transform::Transform(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz, real_t ox, real_t oy, real_t oz) { + basis = Basis(xx, xy, xz, yx, yy, yz, zx, zy, zz); + origin = Vector3(ox, oy, oz); +} diff --git a/core/math/transform.h b/core/math/transform.h index 2f43f6b035..4c8d915305 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -35,10 +35,6 @@ #include "core/math/basis.h" #include "core/math/plane.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Transform { public: Basis basis; @@ -108,6 +104,7 @@ public: operator String() const; + Transform(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz, real_t ox, real_t oy, real_t oz); Transform(const Basis &p_basis, const Vector3 &p_origin = Vector3()); Transform() {} }; diff --git a/core/message_queue.cpp b/core/message_queue.cpp index 32d2b805f6..390989ac91 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -52,8 +52,7 @@ Error MessageQueue::push_call(ObjectID p_id, const StringName &p_method, const V type = ObjectDB::get_instance(p_id)->get_class(); print_line("Failed method: " + type + ":" + p_method + " target ID: " + itos(p_id)); statistics(); - ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings."); - ERR_FAIL_V(ERR_OUT_OF_MEMORY); + ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings."); } Message *msg = memnew_placement(&buffer[buffer_end], Message); @@ -103,8 +102,7 @@ Error MessageQueue::push_set(ObjectID p_id, const StringName &p_prop, const Vari type = ObjectDB::get_instance(p_id)->get_class(); print_line("Failed set: " + type + ":" + p_prop + " target ID: " + itos(p_id)); statistics(); - ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings."); - ERR_FAIL_V(ERR_OUT_OF_MEMORY); + ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings."); } Message *msg = memnew_placement(&buffer[buffer_end], Message); @@ -136,8 +134,7 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) { type = ObjectDB::get_instance(p_id)->get_class(); print_line("Failed notification: " + itos(p_notification) + " target ID: " + itos(p_id)); statistics(); - ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings."); - ERR_FAIL_V(ERR_OUT_OF_MEMORY); + ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings."); } Message *msg = memnew_placement(&buffer[buffer_end], Message); @@ -256,7 +253,7 @@ void MessageQueue::_call_function(Object *p_target, const StringName &p_func, co p_target->call(p_func, argptrs, p_argcount, ce); if (p_show_error && ce.error != Variant::CallError::CALL_OK) { - ERR_PRINTS("Error calling deferred method: " + Variant::get_call_error_text(p_target, p_func, argptrs, p_argcount, ce)); + ERR_PRINTS("Error calling deferred method: " + Variant::get_call_error_text(p_target, p_func, argptrs, p_argcount, ce) + "."); } } diff --git a/core/method_bind.h b/core/method_bind.h index 1b0c3b27c0..7bb75e778f 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -38,10 +38,6 @@ #include <stdio.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #ifdef DEBUG_ENABLED #define DEBUG_METHODS_ENABLED #endif diff --git a/core/node_path.cpp b/core/node_path.cpp index a4b7cbe2eb..8244785d84 100644 --- a/core/node_path.cpp +++ b/core/node_path.cpp @@ -375,8 +375,7 @@ NodePath::NodePath(const String &p_path) { if (str == "") { if (path[i] == 0) continue; // Allow end-of-path : - ERR_EXPLAIN("Invalid NodePath: " + p_path); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid NodePath: " + p_path + "."); } subpath.push_back(str); diff --git a/core/node_path.h b/core/node_path.h index 24725123d6..1b21c4ef1c 100644 --- a/core/node_path.h +++ b/core/node_path.h @@ -34,10 +34,6 @@ #include "core/string_name.h" #include "core/ustring.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class NodePath { struct Data { diff --git a/core/oa_hash_map.h b/core/oa_hash_map.h index e52d36a859..83621bec14 100644 --- a/core/oa_hash_map.h +++ b/core/oa_hash_map.h @@ -62,7 +62,7 @@ private: static const uint32_t EMPTY_HASH = 0; static const uint32_t DELETED_HASH_BIT = 1 << 31; - _FORCE_INLINE_ uint32_t _hash(const TKey &p_key) { + _FORCE_INLINE_ uint32_t _hash(const TKey &p_key) const { uint32_t hash = Hasher::hash(p_key); if (hash == EMPTY_HASH) { @@ -74,7 +74,7 @@ private: return hash; } - _FORCE_INLINE_ uint32_t _get_probe_length(uint32_t p_pos, uint32_t p_hash) { + _FORCE_INLINE_ uint32_t _get_probe_length(uint32_t p_pos, uint32_t p_hash) const { p_hash = p_hash & ~DELETED_HASH_BIT; // we don't care if it was deleted or not uint32_t original_pos = p_hash % capacity; @@ -90,7 +90,7 @@ private: num_elements++; } - bool _lookup_pos(const TKey &p_key, uint32_t &r_pos) { + bool _lookup_pos(const TKey &p_key, uint32_t &r_pos) const { uint32_t hash = _hash(p_key); uint32_t pos = hash % capacity; uint32_t distance = 0; @@ -151,6 +151,7 @@ private: distance++; } } + void _resize_and_rehash() { TKey *old_keys = keys; @@ -190,6 +191,26 @@ public: _FORCE_INLINE_ uint32_t get_capacity() const { return capacity; } _FORCE_INLINE_ uint32_t get_num_elements() const { return num_elements; } + bool empty() const { + return num_elements == 0; + } + + void clear() { + + for (uint32_t i = 0; i < capacity; i++) { + + if (hashes[i] & DELETED_HASH_BIT) { + continue; + } + + hashes[i] |= DELETED_HASH_BIT; + values[i].~TValue(); + keys[i].~TKey(); + } + + num_elements = 0; + } + void insert(const TKey &p_key, const TValue &p_value) { if ((float)num_elements / (float)capacity > 0.9) { @@ -219,7 +240,7 @@ public: * if r_data is not NULL then the value will be written to the object * it points to. */ - bool lookup(const TKey &p_key, TValue &r_data) { + bool lookup(const TKey &p_key, TValue &r_data) const { uint32_t pos = 0; bool exists = _lookup_pos(p_key, pos); @@ -232,7 +253,7 @@ public: return false; } - _FORCE_INLINE_ bool has(const TKey &p_key) { + _FORCE_INLINE_ bool has(const TKey &p_key) const { uint32_t _pos = 0; return _lookup_pos(p_key, _pos); } @@ -302,6 +323,9 @@ public: return it; } + OAHashMap(const OAHashMap &) = delete; // Delete the copy constructor so we don't get unexpected copies and dangling pointers. + OAHashMap &operator=(const OAHashMap &) = delete; // Same for assignment operator. + OAHashMap(uint32_t p_initial_capacity = 64) { capacity = p_initial_capacity; diff --git a/core/object.cpp b/core/object.cpp index 3367d6b6c3..62bfa31480 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -709,20 +709,17 @@ static void _test_call_error(const StringName &p_func, const Variant::CallError break; case Variant::CallError::CALL_ERROR_INVALID_ARGUMENT: { - ERR_EXPLAIN("Error Calling Function: " + String(p_func) + " - Invalid type for argument " + itos(error.argument) + ", expected " + Variant::get_type_name(error.expected)); - ERR_FAIL(); + ERR_FAIL_MSG("Error calling function: " + String(p_func) + " - Invalid type for argument " + itos(error.argument) + ", expected " + Variant::get_type_name(error.expected) + "."); break; } case Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { - ERR_EXPLAIN("Error Calling Function: " + String(p_func) + " - Too many arguments, expected " + itos(error.argument)); - ERR_FAIL(); + ERR_FAIL_MSG("Error calling function: " + String(p_func) + " - Too many arguments, expected " + itos(error.argument) + "."); break; } case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { - ERR_EXPLAIN("Error Calling Function: " + String(p_func) + " - Too few arguments, expected " + itos(error.argument)); - ERR_FAIL(); + ERR_FAIL_MSG("Error calling function: " + String(p_func) + " - Too few arguments, expected " + itos(error.argument) + "."); break; } case Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL: @@ -739,15 +736,9 @@ void Object::call_multilevel(const StringName &p_method, const Variant **p_args, if (p_method == CoreStringNames::get_singleton()->_free) { #ifdef DEBUG_ENABLED - if (Object::cast_to<Reference>(this)) { - ERR_EXPLAIN("Can't 'free' a reference."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(Object::cast_to<Reference>(this), "Can't 'free' a reference."); - if (_lock_index.get() > 1) { - ERR_EXPLAIN("Object is locked and can't be freed."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(_lock_index.get() > 1, "Object is locked and can't be freed."); #endif //must be here, must be before everything, @@ -835,8 +826,7 @@ Variant Object::callv(const StringName &p_method, const Array &p_args) { Variant::CallError ce; Variant ret = call(p_method, argptrs, p_args.size(), ce); if (ce.error != Variant::CallError::CALL_OK) { - ERR_EXPLAIN("Error calling method from 'callv': " + Variant::get_call_error_text(this, p_method, argptrs, p_args.size(), ce)); - ERR_FAIL_V(Variant()); + ERR_FAIL_V_MSG(Variant(), "Error calling method from 'callv': " + Variant::get_call_error_text(this, p_method, argptrs, p_args.size(), ce) + "."); } return ret; } @@ -888,15 +878,13 @@ Variant Object::call(const StringName &p_method, const Variant **p_args, int p_a if (Object::cast_to<Reference>(this)) { r_error.argument = 0; r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; - ERR_EXPLAIN("Can't 'free' a reference."); - ERR_FAIL_V(Variant()); + ERR_FAIL_V_MSG(Variant(), "Can't 'free' a reference."); } if (_lock_index.get() > 1) { r_error.argument = 0; r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; - ERR_EXPLAIN("Object is locked and can't be freed."); - ERR_FAIL_V(Variant()); + ERR_FAIL_V_MSG(Variant(), "Object is locked and can't be freed."); } #endif @@ -1172,10 +1160,7 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int #ifdef DEBUG_ENABLED bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_name); //check in script - if (!signal_is_valid && !script.is_null() && !Ref<Script>(script)->has_script_signal(p_name)) { - ERR_EXPLAIN("Can't emit non-existing signal " + String("\"") + p_name + "\"."); - ERR_FAIL_V(ERR_UNAVAILABLE); - } + ERR_FAIL_COND_V_MSG(!signal_is_valid && !script.is_null() && !Ref<Script>(script)->has_script_signal(p_name), ERR_UNAVAILABLE, "Can't emit non-existing signal " + String("\"") + p_name + "\"."); #endif //not connected? just return return ERR_UNAVAILABLE; @@ -1240,7 +1225,7 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int if (ce.error == Variant::CallError::CALL_ERROR_INVALID_METHOD && !ClassDB::class_exists(target->get_class_name())) { //most likely object is not initialized yet, do not throw error. } else { - ERR_PRINTS("Error calling method from signal '" + String(p_name) + "': " + Variant::get_call_error_text(target, c.method, args, argc, ce)); + ERR_PRINTS("Error calling method from signal '" + String(p_name) + "': " + Variant::get_call_error_text(target, c.method, args, argc, ce) + "."); err = ERR_METHOD_NOT_FOUND; } } @@ -1415,8 +1400,9 @@ void Object::get_signal_connection_list(const StringName &p_signal, List<Connect p_connections->push_back(s->slot_map.getv(i).conn); } -bool Object::has_persistent_signal_connections() const { +int Object::get_persistent_signal_connection_count() const { + int count = 0; const StringName *S = NULL; while ((S = signal_map.next(S))) { @@ -1424,13 +1410,13 @@ bool Object::has_persistent_signal_connections() const { const Signal *s = &signal_map[*S]; for (int i = 0; i < s->slot_map.size(); i++) { - - if (s->slot_map.getv(i).conn.flags & CONNECT_PERSIST) - return true; + if (s->slot_map.getv(i).conn.flags & CONNECT_PERSIST) { + count += 1; + } } } - return false; + return count; } void Object::get_signals_connected_to_this(List<Connection> *p_connections) const { @@ -1463,10 +1449,8 @@ Error Object::connect(const StringName &p_signal, Object *p_to_object, const Str #endif } - if (!signal_is_valid) { - ERR_EXPLAIN("In Object of type '" + String(get_class()) + "': Attempt to connect nonexistent signal '" + p_signal + "' to method '" + p_to_object->get_class() + "." + p_to_method + "'"); - ERR_FAIL_V(ERR_INVALID_PARAMETER); - } + ERR_FAIL_COND_V_MSG(!signal_is_valid, ERR_INVALID_PARAMETER, "In Object of type '" + String(get_class()) + "': Attempt to connect nonexistent signal '" + p_signal + "' to method '" + p_to_object->get_class() + "." + p_to_method + "'."); + signal_map[p_signal] = Signal(); s = &signal_map[p_signal]; } @@ -1477,8 +1461,7 @@ Error Object::connect(const StringName &p_signal, Object *p_to_object, const Str s->slot_map[target].reference_count++; return OK; } else { - ERR_EXPLAIN("Signal '" + p_signal + "' is already connected to given method '" + p_to_method + "' in that object."); - ERR_FAIL_V(ERR_INVALID_PARAMETER); + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Signal '" + p_signal + "' is already connected to given method '" + p_to_method + "' in that object."); } } @@ -1514,8 +1497,7 @@ bool Object::is_connected(const StringName &p_signal, Object *p_to_object, const if (!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal)) return false; - ERR_EXPLAIN("Nonexistent signal: " + p_signal); - ERR_FAIL_V(false); + ERR_FAIL_V_MSG(false, "Nonexistent signal: " + p_signal + "."); } Signal::Target target(p_to_object->get_instance_id(), p_to_method); @@ -1533,21 +1515,13 @@ void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const ERR_FAIL_NULL(p_to_object); Signal *s = signal_map.getptr(p_signal); - if (!s) { - ERR_EXPLAIN("Nonexistent signal: " + p_signal); - ERR_FAIL(); - } - if (s->lock > 0) { - ERR_EXPLAIN("Attempt to disconnect signal '" + p_signal + "' while emitting (locks: " + itos(s->lock) + ")"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!s, "Nonexistent signal: " + p_signal + "."); + + ERR_FAIL_COND_MSG(s->lock > 0, "Attempt to disconnect signal '" + p_signal + "' while emitting (locks: " + itos(s->lock) + ")."); Signal::Target target(p_to_object->get_instance_id(), p_to_method); - if (!s->slot_map.has(target)) { - ERR_EXPLAIN("Disconnecting nonexistent signal '" + p_signal + "', slot: " + itos(target._id) + ":" + target.method); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!s->slot_map.has(target), "Disconnecting nonexistent signal '" + p_signal + "', slot: " + itos(target._id) + ":" + target.method + "."); Signal::Slot *slot = &s->slot_map[target]; @@ -1974,10 +1948,7 @@ Object::~Object() { Signal *s = &signal_map[*S]; - if (s->lock) { - ERR_EXPLAIN("Attempt to delete an object in the middle of a signal emission from it"); - ERR_CONTINUE(s->lock > 0); - } + ERR_CONTINUE_MSG(s->lock > 0, "Attempt to delete an object in the middle of a signal emission from it."); //brute force disconnect for performance int slot_count = s->slot_map.size(); diff --git a/core/object.h b/core/object.h index 1e0b22c086..ac8620757c 100644 --- a/core/object.h +++ b/core/object.h @@ -58,7 +58,7 @@ enum PropertyHint { PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc" PROPERTY_HINT_EXP_EASING, /// exponential easing function (Math::ease) use "attenuation" hint string to revert (flip h), "full" to also include in/out. (ie: "attenuation,inout") PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer) - PROPERTY_HINT_SPRITE_FRAME, + PROPERTY_HINT_SPRITE_FRAME, // FIXME: Obsolete: drop whenever we can break compat. Keeping now for GDNative compat. PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer) PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags) PROPERTY_HINT_LAYERS_2D_RENDER, @@ -104,7 +104,8 @@ enum PropertyUsageFlags { PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor PROPERTY_USAGE_CATEGORY = 256, - //those below are deprecated thanks to ClassDB's now class value cache + // FIXME: Drop in 4.0, possibly reorder other flags? + // Those below are deprecated thanks to ClassDB's now class value cache //PROPERTY_USAGE_STORE_IF_NONZERO = 512, //only store if nonzero //PROPERTY_USAGE_STORE_IF_NONONE = 1024, //only store if false PROPERTY_USAGE_NO_INSTANCE_STATE = 2048, @@ -121,6 +122,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_HIGH_END_GFX = 1 << 22, PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT = 1 << 23, PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT = 1 << 24, + PROPERTY_USAGE_KEYING_INCREMENTS = 1 << 25, // Used in inspector to increment property when keyed in animation player PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK, PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNATIONALIZED, @@ -179,6 +181,15 @@ struct PropertyInfo { usage(PROPERTY_USAGE_DEFAULT) { } + bool operator==(const PropertyInfo &p_info) const { + return ((type == p_info.type) && + (name == p_info.name) && + (class_name == p_info.class_name) && + (hint == p_info.hint) && + (hint_string == p_info.hint_string) && + (usage == p_info.usage)); + } + bool operator<(const PropertyInfo &p_info) const { return name < p_info.name; } @@ -696,7 +707,7 @@ public: void get_signal_list(List<MethodInfo> *p_signals) const; void get_signal_connection_list(const StringName &p_signal, List<Connection> *p_connections) const; void get_all_signal_connections(List<Connection> *p_connections) const; - bool has_persistent_signal_connections() const; + int get_persistent_signal_connection_count() const; void get_signals_connected_to_this(List<Connection> *p_connections) const; Error connect(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector<Variant> &p_binds = Vector<Variant>(), uint32_t p_flags = 0); @@ -783,8 +794,13 @@ public: static int get_object_count(); _FORCE_INLINE_ static bool instance_validate(Object *p_ptr) { + rw_lock->read_lock(); + + bool exists = instance_checks.has(p_ptr); + + rw_lock->read_unlock(); - return instance_checks.has(p_ptr); + return exists; } }; diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index 0cdb5b41b7..b444f0ae1e 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -179,14 +179,6 @@ Error DirAccess::make_dir_recursive(String p_dir) { return OK; } -String DirAccess::get_next(bool *p_is_dir) { - - String next = get_next(); - if (p_is_dir) - *p_is_dir = current_is_dir(); - return next; -} - String DirAccess::fix_path(String p_path) const { switch (_access_type) { diff --git a/core/os/dir_access.h b/core/os/dir_access.h index bde19bd5ae..d3eb1e13f6 100644 --- a/core/os/dir_access.h +++ b/core/os/dir_access.h @@ -34,10 +34,6 @@ #include "core/typedefs.h" #include "core/ustring.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - //@ TODO, excellent candidate for THREAD_SAFE MACRO, should go through all these and add THREAD_SAFE where it applies class DirAccess { public: @@ -71,7 +67,6 @@ protected: public: virtual Error list_dir_begin() = 0; ///< This starts dir listing - virtual String get_next(bool *p_is_dir); // compatibility virtual String get_next() = 0; virtual bool current_is_dir() const = 0; virtual bool current_is_hidden() const = 0; @@ -98,6 +93,18 @@ public: virtual Error rename(String p_from, String p_to) = 0; virtual Error remove(String p_name) = 0; + // Meant for editor code when we want to quickly remove a file without custom + // handling (e.g. removing a cache file). + static void remove_file_or_error(String p_path) { + DirAccess *da = create(ACCESS_FILESYSTEM); + if (da->file_exists(p_path)) { + if (da->remove(p_path) != OK) { + ERR_FAIL_MSG("Cannot remove file or directory: " + p_path); + } + } + memdelete(da); + } + virtual String get_filesystem_type() const = 0; static String get_full_path(const String &p_path, AccessType p_access); static DirAccess *create_for_path(const String &p_path); diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 7509050b2b..9a8315a3bb 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -30,9 +30,9 @@ #include "file_access.h" +#include "core/crypto/crypto_core.h" #include "core/io/file_access_pack.h" #include "core/io/marshalls.h" -#include "core/math/crypto_core.h" #include "core/os/os.h" #include "core/project_settings.h" @@ -599,8 +599,7 @@ Vector<uint8_t> FileAccess::get_file_as_array(const String &p_path, Error *r_err if (r_error) { // if error requested, do not throw error return Vector<uint8_t>(); } - ERR_EXPLAIN("Can't open file from path: " + String(p_path)); - ERR_FAIL_V(Vector<uint8_t>()); + ERR_FAIL_V_MSG(Vector<uint8_t>(), "Can't open file from path: " + String(p_path) + "."); } Vector<uint8_t> data; data.resize(f->get_len()); @@ -620,8 +619,7 @@ String FileAccess::get_file_as_string(const String &p_path, Error *r_error) { if (r_error) { return String(); } - ERR_EXPLAIN("Can't get file as string from path: " + String(p_path)); - ERR_FAIL_V(String()); + ERR_FAIL_V_MSG(String(), "Can't get file as string from path: " + String(p_path) + "."); } String ret; diff --git a/core/os/input.cpp b/core/os/input.cpp index f04d4a1b3e..51cb41b184 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -80,6 +80,7 @@ void Input::_bind_methods() { ClassDB::bind_method(D_METHOD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); ClassDB::bind_method(D_METHOD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); ClassDB::bind_method(D_METHOD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); + ClassDB::bind_method(D_METHOD("vibrate_handheld", "duration_ms"), &Input::vibrate_handheld, DEFVAL(500)); ClassDB::bind_method(D_METHOD("get_gravity"), &Input::get_gravity); ClassDB::bind_method(D_METHOD("get_accelerometer"), &Input::get_accelerometer); ClassDB::bind_method(D_METHOD("get_magnetometer"), &Input::get_magnetometer); diff --git a/core/os/input.h b/core/os/input.h index de04f239e6..a12ded176b 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -100,6 +100,7 @@ public: virtual uint64_t get_joy_vibration_timestamp(int p_device) = 0; virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration = 0) = 0; virtual void stop_joy_vibration(int p_device) = 0; + virtual void vibrate_handheld(int p_duration_ms = 500) = 0; virtual Point2 get_mouse_position() const = 0; virtual Point2 get_last_mouse_speed() const = 0; diff --git a/core/os/input_event.h b/core/os/input_event.h index 4f5762e756..28658e3865 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -38,10 +38,6 @@ #include "core/ustring.h" /** - @author Juan Linietsky <reduzio@gmail.com> -*/ - -/** * Input Event classes. These are used in the main loop. * The events are pretty obvious. */ diff --git a/core/os/keyboard.h b/core/os/keyboard.h index 58a0807579..5c8a2e90e9 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -33,10 +33,6 @@ #include "core/ustring.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - /* Special Key: diff --git a/core/os/main_loop.h b/core/os/main_loop.h index ad734d3fc8..6ddaf5bee7 100644 --- a/core/os/main_loop.h +++ b/core/os/main_loop.h @@ -35,10 +35,6 @@ #include "core/reference.h" #include "core/script_language.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class MainLoop : public Object { GDCLASS(MainLoop, Object); diff --git a/core/os/memory.h b/core/os/memory.h index e073b11e76..8778cb63ad 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -35,10 +35,6 @@ #include <stddef.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #ifndef PAD_ALIGN #define PAD_ALIGN 16 //must always be greater than this at much #endif diff --git a/core/os/os.cpp b/core/os/os.cpp index 925154af7d..7531900480 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -186,6 +186,11 @@ int OS::get_process_id() const { return -1; }; +void OS::vibrate_handheld(int p_duration_ms) { + + WARN_PRINTS("vibrate_handheld() only works with Android and iOS"); +} + bool OS::is_stdout_verbose() const { return _verbose_stdout; @@ -268,8 +273,7 @@ void OS::print_all_resources(String p_to_file) { _OSPRF = FileAccess::open(p_to_file, FileAccess::WRITE, &err); if (err != OK) { _OSPRF = NULL; - ERR_EXPLAIN("Can't print all resources to file: " + String(p_to_file)); - ERR_FAIL(); + ERR_FAIL_MSG("Can't print all resources to file: " + String(p_to_file) + "."); } } @@ -487,10 +491,7 @@ void OS::_ensure_user_data_dir() { da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); Error err = da->make_dir_recursive(dd); - if (err != OK) { - ERR_EXPLAIN("Error attempting to create data dir: " + dd); - } - ERR_FAIL_COND(err != OK); + ERR_FAIL_COND_MSG(err != OK, "Error attempting to create data dir: " + dd + "."); memdelete(da); } diff --git a/core/os/os.h b/core/os/os.h index 2224d3b006..e627773d88 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -41,10 +41,6 @@ #include <stdarg.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Mutex; class OS { @@ -269,6 +265,7 @@ public: virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL) = 0; virtual Error kill(const ProcessID &p_pid) = 0; virtual int get_process_id() const; + virtual void vibrate_handheld(int p_duration_ms = 500); virtual Error shell_open(String p_uri); virtual Error set_cwd(const String &p_cwd); diff --git a/core/os/semaphore.h b/core/os/semaphore.h index ccbba0dacd..a0862dce84 100644 --- a/core/os/semaphore.h +++ b/core/os/semaphore.h @@ -33,10 +33,6 @@ #include "core/error_list.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Semaphore { protected: static Semaphore *(*create_func)(); diff --git a/core/os/thread.h b/core/os/thread.h index e7a6e8cb1f..169280a208 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -34,10 +34,6 @@ #include "core/typedefs.h" #include "core/ustring.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - typedef void (*ThreadCreateCallback)(void *p_userdata); class Thread { diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index 094352b5cc..6c1f2756f2 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -204,10 +204,8 @@ PoolAllocator::ID PoolAllocator::alloc(int p_size) { /* Then search again */ if (!find_hole(&new_entry_indices_pos, size_to_alloc)) { - mt_unlock(); - ERR_EXPLAIN("Memory can't be compacted further"); - ERR_FAIL_V(POOL_ALLOCATOR_INVALID_ID); + ERR_FAIL_V_MSG(POOL_ALLOCATOR_INVALID_ID, "Memory can't be compacted further."); } } @@ -217,8 +215,7 @@ PoolAllocator::ID PoolAllocator::alloc(int p_size) { if (!found_free_entry) { mt_unlock(); - ERR_EXPLAIN("No free entry found in PoolAllocator"); - ERR_FAIL_V(POOL_ALLOCATOR_INVALID_ID); + ERR_FAIL_V_MSG(POOL_ALLOCATOR_INVALID_ID, "No free entry found in PoolAllocator."); } /* move all entry indices up, make room for this one */ @@ -539,6 +536,10 @@ void PoolAllocator::unlock(ID p_mem) { return; mt_lock(); Entry *e = get_entry(p_mem); + if (!e) { + mt_unlock(); + ERR_FAIL_COND(!e); + } if (e->lock == 0) { mt_unlock(); ERR_PRINT("e->lock == 0"); @@ -611,7 +612,7 @@ PoolAllocator::PoolAllocator(void *p_mem, int p_size, int p_align, bool p_needs_ PoolAllocator::PoolAllocator(int p_align, int p_size, bool p_needs_locking, int p_max_entries) { ERR_FAIL_COND(p_align < 1); - mem_ptr = Memory::alloc_static(p_size + p_align, "PoolAllocator()"); + mem_ptr = Memory::alloc_static(p_size + p_align, true); uint8_t *mem8 = (uint8_t *)mem_ptr; uint64_t ofs = (uint64_t)mem8; if (ofs % p_align) diff --git a/core/pool_vector.cpp b/core/pool_vector.cpp index b9d2316315..50ea898bef 100644 --- a/core/pool_vector.cpp +++ b/core/pool_vector.cpp @@ -66,6 +66,5 @@ void MemoryPool::cleanup() { memdelete_arr(allocs); memdelete(alloc_mutex); - ERR_EXPLAINC("There are still MemoryPool allocs in use at exit!"); - ERR_FAIL_COND(allocs_used > 0); + ERR_FAIL_COND_MSG(allocs_used > 0, "There are still MemoryPool allocs in use at exit!"); } diff --git a/core/pool_vector.h b/core/pool_vector.h index 98a52c6938..957a72483c 100644 --- a/core/pool_vector.h +++ b/core/pool_vector.h @@ -77,10 +77,6 @@ struct MemoryPool { static void cleanup(); }; -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - template <class T> class PoolVector { @@ -102,8 +98,7 @@ class PoolVector { MemoryPool::alloc_mutex->lock(); if (MemoryPool::allocs_used == MemoryPool::alloc_count) { MemoryPool::alloc_mutex->unlock(); - ERR_EXPLAINC("All memory pool allocations are in use, can't COW."); - ERR_FAIL(); + ERR_FAIL_MSG("All memory pool allocations are in use, can't COW."); } MemoryPool::Alloc *old_alloc = alloc; @@ -458,7 +453,7 @@ public: bool is_locked() const { return alloc && alloc->lock > 0; } - inline const T operator[](int p_index) const; + inline T operator[](int p_index) const; Error resize(int p_size); @@ -502,7 +497,7 @@ void PoolVector<T>::push_back(const T &p_val) { } template <class T> -const T PoolVector<T>::operator[](int p_index) const { +T PoolVector<T>::operator[](int p_index) const { CRASH_BAD_INDEX(p_index, size()); @@ -524,8 +519,7 @@ Error PoolVector<T>::resize(int p_size) { MemoryPool::alloc_mutex->lock(); if (MemoryPool::allocs_used == MemoryPool::alloc_count) { MemoryPool::alloc_mutex->unlock(); - ERR_EXPLAINC("All memory pool allocations are in use."); - ERR_FAIL_V(ERR_OUT_OF_MEMORY); + ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "All memory pool allocations are in use."); } //take one from the free list diff --git a/core/project_settings.cpp b/core/project_settings.cpp index c1d4967f55..eb88143db3 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -500,8 +500,7 @@ Error ProjectSettings::_load_settings_binary(const String &p_path) { if (hdr[0] != 'E' || hdr[1] != 'C' || hdr[2] != 'F' || hdr[3] != 'G') { memdelete(f); - ERR_EXPLAIN("Corrupted header in binary project.binary (not ECFG)"); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Corrupted header in binary project.binary (not ECFG)."); } uint32_t count = f->get_32(); @@ -522,8 +521,7 @@ Error ProjectSettings::_load_settings_binary(const String &p_path) { f->get_buffer(d.ptrw(), vlen); Variant value; err = decode_variant(value, d.ptr(), d.size(), NULL, true); - ERR_EXPLAIN("Error decoding property: " + key); - ERR_CONTINUE(err != OK); + ERR_CONTINUE_MSG(err != OK, "Error decoding property: " + key + "."); set(key, value); } @@ -577,8 +575,7 @@ Error ProjectSettings::_load_settings_text(const String &p_path) { config_version = value; if (config_version > CONFIG_VERSION) { memdelete(f); - ERR_EXPLAIN(vformat("Can't open project at '%s', its `config_version` (%d) is from a more recent and incompatible version of the engine. Expected config version: %d.", p_path, config_version, CONFIG_VERSION)); - ERR_FAIL_V(ERR_FILE_CANT_OPEN); + ERR_FAIL_V_MSG(ERR_FILE_CANT_OPEN, vformat("Can't open project at '%s', its `config_version` (%d) is from a more recent and incompatible version of the engine. Expected config version: %d.", p_path, config_version, CONFIG_VERSION)); } } else { if (section == String()) { @@ -645,11 +642,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str Error err; FileAccess *file = FileAccess::open(p_file, FileAccess::WRITE, &err); - if (err != OK) { - - ERR_EXPLAIN("Couldn't save project.binary at " + p_file); - ERR_FAIL_COND_V(err, err); - } + ERR_FAIL_COND_V_MSG(err != OK, err, "Couldn't save project.binary at " + p_file + "."); uint8_t hdr[4] = { 'E', 'C', 'F', 'G' }; file->store_buffer(hdr, 4); @@ -738,10 +731,7 @@ Error ProjectSettings::_save_settings_text(const String &p_file, const Map<Strin Error err; FileAccess *file = FileAccess::open(p_file, FileAccess::WRITE, &err); - if (err) { - ERR_EXPLAIN("Couldn't save project.godot - " + p_file); - ERR_FAIL_COND_V(err, err); - } + ERR_FAIL_COND_V_MSG(err != OK, err, "Couldn't save project.godot - " + p_file + "."); file->store_line("; Engine configuration file."); file->store_line("; It's best edited using the editor UI and not directly,"); @@ -872,8 +862,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust return _save_settings_binary(p_path, props, p_custom, custom_features); else { - ERR_EXPLAIN("Unknown config file format: " + p_path); - ERR_FAIL_V(ERR_FILE_UNRECOGNIZED); + ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "Unknown config file format: " + p_path + "."); } } @@ -1030,6 +1019,9 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF("editor/search_in_file_extensions", extensions); custom_prop_info["editor/search_in_file_extensions"] = PropertyInfo(Variant::POOL_STRING_ARRAY, "editor/search_in_file_extensions"); + GLOBAL_DEF("editor/script_templates_search_path", "res://script_templates"); + custom_prop_info["editor/script_templates_search_path"] = PropertyInfo(Variant::STRING, "editor/script_templates_search_path", PROPERTY_HINT_DIR); + action = Dictionary(); action["deadzone"] = Variant(0.5f); events = Array(); diff --git a/core/project_settings.h b/core/project_settings.h index d7651417d5..a8deab028c 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -35,10 +35,6 @@ #include "core/os/thread_safe.h" #include "core/set.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class ProjectSettings : public Object { GDCLASS(ProjectSettings, Object); diff --git a/core/reference.h b/core/reference.h index 8a19f846c7..20ee22ddfc 100644 --- a/core/reference.h +++ b/core/reference.h @@ -36,9 +36,6 @@ #include "core/ref_ptr.h" #include "core/safe_refcount.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Reference : public Object { GDCLASS(Reference, Object); diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index e442546124..efc77bde48 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -34,6 +34,8 @@ #include "core/class_db.h" #include "core/compressed_translation.h" #include "core/core_string_names.h" +#include "core/crypto/crypto.h" +#include "core/crypto/hashing_context.h" #include "core/engine.h" #include "core/func_ref.h" #include "core/input_map.h" @@ -70,6 +72,8 @@ static Ref<ResourceFormatLoaderBinary> resource_loader_binary; static Ref<ResourceFormatImporter> resource_format_importer; static Ref<ResourceFormatLoaderImage> resource_format_image; static Ref<TranslationLoaderPO> resource_format_po; +static Ref<ResourceFormatSaverCrypto> resource_format_saver_crypto; +static Ref<ResourceFormatLoaderCrypto> resource_format_loader_crypto; static _ResourceLoader *_resource_loader = NULL; static _ResourceSaver *_resource_saver = NULL; @@ -151,7 +155,19 @@ void register_core_types() { ClassDB::register_class<StreamPeerTCP>(); ClassDB::register_class<TCP_Server>(); ClassDB::register_class<PacketPeerUDP>(); + + // Crypto + ClassDB::register_class<HashingContext>(); + ClassDB::register_custom_instance_class<X509Certificate>(); + ClassDB::register_custom_instance_class<CryptoKey>(); + ClassDB::register_custom_instance_class<Crypto>(); ClassDB::register_custom_instance_class<StreamPeerSSL>(); + + resource_format_saver_crypto.instance(); + ResourceSaver::add_resource_format_saver(resource_format_saver_crypto); + resource_format_loader_crypto.instance(); + ResourceLoader::add_resource_format_loader(resource_format_loader_crypto); + ClassDB::register_virtual_class<IP>(); ClassDB::register_virtual_class<PacketPeer>(); ClassDB::register_class<PacketPeerStream>(); @@ -211,6 +227,9 @@ void register_core_settings() { ProjectSettings::get_singleton()->set_custom_property_info("network/limits/tcp/connect_timeout_seconds", PropertyInfo(Variant::INT, "network/limits/tcp/connect_timeout_seconds", PROPERTY_HINT_RANGE, "1,1800,1")); GLOBAL_DEF_RST("network/limits/packet_peer_stream/max_buffer_po2", (16)); ProjectSettings::get_singleton()->set_custom_property_info("network/limits/packet_peer_stream/max_buffer_po2", PropertyInfo(Variant::INT, "network/limits/packet_peer_stream/max_buffer_po2", PROPERTY_HINT_RANGE, "0,64,1,or_greater")); + + GLOBAL_DEF("network/ssl/certificates", ""); + ProjectSettings::get_singleton()->set_custom_property_info("network/ssl/certificates", PropertyInfo(Variant::STRING, "network/ssl/certificates", PROPERTY_HINT_FILE, "*.crt")); } void register_core_singletons() { @@ -272,6 +291,11 @@ void unregister_core_types() { ResourceLoader::remove_resource_format_loader(resource_format_po); resource_format_po.unref(); + ResourceSaver::remove_resource_format_saver(resource_format_saver_crypto); + resource_format_saver_crypto.unref(); + ResourceLoader::remove_resource_format_loader(resource_format_loader_crypto); + resource_format_loader_crypto.unref(); + if (ip) memdelete(ip); diff --git a/core/register_core_types.h b/core/register_core_types.h index b5a6aa985b..2d397b55f9 100644 --- a/core/register_core_types.h +++ b/core/register_core_types.h @@ -31,10 +31,6 @@ #ifndef REGISTER_CORE_TYPES_H #define REGISTER_CORE_TYPES_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - void register_core_types(); void register_core_settings(); void register_core_singletons(); diff --git a/core/resource.cpp b/core/resource.cpp index 74e2c1ed6b..5a5efa4644 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -75,8 +75,7 @@ void Resource::set_path(const String &p_path, bool p_take_over) { bool exists = ResourceCache::resources.has(p_path); ResourceCache::lock->read_unlock(); - ERR_EXPLAIN("Another resource is loaded from path: " + p_path + " (possible cyclic resource inclusion)"); - ERR_FAIL_COND(exists); + ERR_FAIL_COND_MSG(exists, "Another resource is loaded from path: " + p_path + " (possible cyclic resource inclusion)."); } } path_cache = p_path; @@ -277,8 +276,7 @@ void Resource::notify_change_to_owners() { for (Set<ObjectID>::Element *E = owners.front(); E; E = E->next()) { Object *obj = ObjectDB::get_instance(E->get()); - ERR_EXPLAIN("Object was deleted, while still owning a resource"); - ERR_CONTINUE(!obj); //wtf + ERR_CONTINUE_MSG(!obj, "Object was deleted, while still owning a resource."); //wtf //TODO store string obj->call("resource_changed", RES(this)); } @@ -427,7 +425,7 @@ Resource::~Resource() { ResourceCache::lock->write_unlock(); } if (owners.size()) { - WARN_PRINT("Resource is still owned"); + WARN_PRINT("Resource is still owned."); } } diff --git a/core/resource.h b/core/resource.h index 853b2859c7..038b4f6278 100644 --- a/core/resource.h +++ b/core/resource.h @@ -38,10 +38,6 @@ #include "core/safe_refcount.h" #include "core/self_list.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #define RES_BASE_EXTENSION(m_ext) \ public: \ static void register_custom_data_to_otdb() { ClassDB::add_resource_base_extension(m_ext, get_class_static()); } \ diff --git a/core/rid.h b/core/rid.h index c7a71a03a0..381eee645b 100644 --- a/core/rid.h +++ b/core/rid.h @@ -37,10 +37,6 @@ #include "core/set.h" #include "core/typedefs.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class RID_OwnerBase; class RID_Data { diff --git a/core/safe_refcount.h b/core/safe_refcount.h index 54f540b0c7..0b65ffb9ca 100644 --- a/core/safe_refcount.h +++ b/core/safe_refcount.h @@ -97,8 +97,8 @@ static _ALWAYS_INLINE_ T atomic_exchange_if_greater(volatile T *pw, volatile V v /* Implementation for GCC & Clang */ -// GCC guarantees atomic intrinsics for sizes of 1, 2, 4 and 8 bytes. -// Clang states it supports GCC atomic builtins. +#include <stdbool.h> +#include <atomic> template <class T> static _ALWAYS_INLINE_ T atomic_conditional_increment(volatile T *pw) { @@ -107,7 +107,7 @@ static _ALWAYS_INLINE_ T atomic_conditional_increment(volatile T *pw) { T tmp = static_cast<T const volatile &>(*pw); if (tmp == 0) return 0; // if zero, can't add to it anymore - if (__sync_val_compare_and_swap(pw, tmp, tmp + 1) == tmp) + if (__atomic_compare_exchange_n(pw, &tmp, tmp + 1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) == true) return tmp + 1; } } @@ -115,25 +115,25 @@ static _ALWAYS_INLINE_ T atomic_conditional_increment(volatile T *pw) { template <class T> static _ALWAYS_INLINE_ T atomic_decrement(volatile T *pw) { - return __sync_sub_and_fetch(pw, 1); + return __atomic_sub_fetch(pw, 1, __ATOMIC_SEQ_CST); } template <class T> static _ALWAYS_INLINE_ T atomic_increment(volatile T *pw) { - return __sync_add_and_fetch(pw, 1); + return __atomic_add_fetch(pw, 1, __ATOMIC_SEQ_CST); } template <class T, class V> static _ALWAYS_INLINE_ T atomic_sub(volatile T *pw, volatile V val) { - return __sync_sub_and_fetch(pw, val); + return __atomic_sub_fetch(pw, val, __ATOMIC_SEQ_CST); } template <class T, class V> static _ALWAYS_INLINE_ T atomic_add(volatile T *pw, volatile V val) { - return __sync_add_and_fetch(pw, val); + return __atomic_add_fetch(pw, val, __ATOMIC_SEQ_CST); } template <class T, class V> @@ -143,7 +143,7 @@ static _ALWAYS_INLINE_ T atomic_exchange_if_greater(volatile T *pw, volatile V v T tmp = static_cast<T const volatile &>(*pw); if (tmp >= val) return tmp; // already greater, or equal - if (__sync_val_compare_and_swap(pw, tmp, val) == tmp) + if (__atomic_compare_exchange_n(pw, &tmp, val, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) == true) return val; } } diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index e7ff7a3aef..2a061f0947 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -89,7 +89,7 @@ Error ScriptDebuggerRemote::connect_to_host(const String &p_host, uint16_t p_por if (tcp_client->get_status() != StreamPeerTCP::STATUS_CONNECTED) { - ERR_PRINTS("Remote Debugger: Unable to connect. Status: " + String::num(tcp_client->get_status())); + ERR_PRINTS("Remote Debugger: Unable to connect. Status: " + String::num(tcp_client->get_status()) + "."); return FAILED; }; @@ -110,7 +110,7 @@ void ScriptDebuggerRemote::_put_variable(const String &p_name, const Variant &p_ int len = 0; Error err = encode_variant(var, NULL, len, true); if (err != OK) - ERR_PRINT("Failed to encode variant"); + ERR_PRINT("Failed to encode variant."); if (len > packet_peer_stream->get_output_buffer_max_size()) { //limit to max size packet_peer_stream->put_var(Variant()); @@ -134,10 +134,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue) //this function is called when there is a debugger break (bug on script) //or when execution is paused from editor - if (!tcp_client->is_connected_to_host()) { - ERR_EXPLAIN("Script Debugger failed to connect, but being used anyway."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!tcp_client->is_connected_to_host(), "Script Debugger failed to connect, but being used anyway."); packet_peer_stream->put_var("debug_enter"); packet_peer_stream->put_var(2); @@ -357,10 +354,11 @@ void ScriptDebuggerRemote::_get_output() { locking = false; } - if (n_errors_dropped > 0) { + if (n_errors_dropped == 1) { + // Only print one message about dropping per second OutputError oe; oe.error = "TOO_MANY_ERRORS"; - oe.error_descr = "Too many errors! " + String::num_int64(n_errors_dropped) + " errors were dropped."; + oe.error_descr = "Too many errors! Ignoring errors for up to 1 second."; oe.warning = false; uint64_t time = OS::get_singleton()->get_ticks_msec(); oe.hr = time / 3600000; @@ -368,7 +366,20 @@ void ScriptDebuggerRemote::_get_output() { oe.sec = (time / 1000) % 60; oe.msec = time % 1000; errors.push_back(oe); - n_errors_dropped = 0; + } + + if (n_warnings_dropped == 1) { + // Only print one message about dropping per second + OutputError oe; + oe.error = "TOO_MANY_WARNINGS"; + oe.error_descr = "Too many warnings! Ignoring warnings for up to 1 second."; + oe.warning = true; + uint64_t time = OS::get_singleton()->get_ticks_msec(); + oe.hr = time / 3600000; + oe.min = (time / 60000) % 60; + oe.sec = (time / 1000) % 60; + oe.msec = time % 1000; + errors.push_back(oe); } while (errors.size()) { @@ -587,9 +598,19 @@ void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) { } } } + if (Node *node = Object::cast_to<Node>(obj)) { - PropertyInfo pi(Variant::NODE_PATH, String("Node/path")); - properties.push_front(PropertyDesc(pi, node->get_path())); + // in some cases node will not be in tree here + // for instance where it created as variable and not yet added to tree + // in such cases we can't ask for it's path + if (node->is_inside_tree()) { + PropertyInfo pi(Variant::NODE_PATH, String("Node/path")); + properties.push_front(PropertyDesc(pi, node->get_path())); + } else { + PropertyInfo pi(Variant::STRING, String("Node/path")); + properties.push_front(PropertyDesc(pi, "[Orphan]")); + } + } else if (Resource *res = Object::cast_to<Resource>(obj)) { if (Script *s = Object::cast_to<Script>(res)) { Map<StringName, Variant> constants; @@ -934,6 +955,19 @@ void ScriptDebuggerRemote::send_error(const String &p_func, const String &p_file oe.msec = time % 1000; Array cstack; + uint64_t ticks = OS::get_singleton()->get_ticks_usec() / 1000; + msec_count += ticks - last_msec; + last_msec = ticks; + + if (msec_count > 1000) { + msec_count = 0; + + err_count = 0; + n_errors_dropped = 0; + warn_count = 0; + n_warnings_dropped = 0; + } + cstack.resize(p_stack_info.size() * 3); for (int i = 0; i < p_stack_info.size(); i++) { cstack[i * 3 + 0] = p_stack_info[i].file; @@ -942,15 +976,28 @@ void ScriptDebuggerRemote::send_error(const String &p_func, const String &p_file } oe.callstack = cstack; + if (oe.warning) { + warn_count++; + } else { + err_count++; + } mutex->lock(); if (!locking && tcp_client->is_connected_to_host()) { - if (errors.size() >= max_errors_per_frame) { - n_errors_dropped++; + if (oe.warning) { + if (warn_count > max_warnings_per_second) { + n_warnings_dropped++; + } else { + errors.push_back(oe); + } } else { - errors.push_back(oe); + if (err_count > max_errors_per_second) { + n_errors_dropped++; + } else { + errors.push_back(oe); + } } } @@ -1070,10 +1117,13 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() : mutex(Mutex::create()), max_messages_per_frame(GLOBAL_GET("network/limits/debugger_stdout/max_messages_per_frame")), n_messages_dropped(0), - max_errors_per_frame(GLOBAL_GET("network/limits/debugger_stdout/max_errors_per_frame")), + max_errors_per_second(GLOBAL_GET("network/limits/debugger_stdout/max_errors_per_second")), + max_warnings_per_second(GLOBAL_GET("network/limits/debugger_stdout/max_warnings_per_second")), n_errors_dropped(0), max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), char_count(0), + err_count(0), + warn_count(0), last_msec(0), msec_count(0), locking(false), diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h index 1fc9d7c7f1..a5bfd7a32d 100644 --- a/core/script_debugger_remote.h +++ b/core/script_debugger_remote.h @@ -91,11 +91,15 @@ class ScriptDebuggerRemote : public ScriptDebugger { int max_messages_per_frame; int n_messages_dropped; List<OutputError> errors; - int max_errors_per_frame; + int max_errors_per_second; + int max_warnings_per_second; int n_errors_dropped; + int n_warnings_dropped; int max_cps; int char_count; + int err_count; + int warn_count; uint64_t last_msec; uint64_t msec_count; diff --git a/core/script_language.h b/core/script_language.h index 87f103bb33..dfb2e0ad31 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -36,10 +36,6 @@ #include "core/pair.h" #include "core/resource.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class ScriptLanguage; typedef void (*ScriptEditRequestFunction)(const String &p_path); diff --git a/core/set.h b/core/set.h index 81250068af..68431c294a 100644 --- a/core/set.h +++ b/core/set.h @@ -34,12 +34,8 @@ #include "core/os/memory.h" #include "core/typedefs.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - // based on the very nice implementation of rb-trees by: -// http://web.mit.edu/~emin/www/source_code/red_black_tree/index.html +// https://web.archive.org/web/20120507164830/http://web.mit.edu/~emin/www/source_code/red_black_tree/index.html template <class T, class C = Comparator<T>, class A = DefaultAllocator> class Set { diff --git a/core/string_name.cpp b/core/string_name.cpp index 10b71ad3ac..b1a8bfb849 100644 --- a/core/string_name.cpp +++ b/core/string_name.cpp @@ -205,7 +205,6 @@ StringName::StringName(const char *p_name) { // exists lock->unlock(); return; - } else { } } @@ -253,7 +252,6 @@ StringName::StringName(const StaticCString &p_static_string) { // exists lock->unlock(); return; - } else { } } @@ -301,7 +299,6 @@ StringName::StringName(const String &p_name) { // exists lock->unlock(); return; - } else { } } diff --git a/core/string_name.h b/core/string_name.h index 0984b0181f..6dd960abd5 100644 --- a/core/string_name.h +++ b/core/string_name.h @@ -34,9 +34,6 @@ #include "core/os/mutex.h" #include "core/safe_refcount.h" #include "core/ustring.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ struct StaticCString { diff --git a/core/translation.cpp b/core/translation.cpp index 0b55badc61..a0902d71fc 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -848,8 +848,7 @@ void Translation::set_locale(const String &p_locale) { if (!TranslationServer::is_locale_valid(univ_locale)) { String trimmed_locale = get_trimmed_locale(univ_locale); - ERR_EXPLAIN("Invalid locale: " + trimmed_locale); - ERR_FAIL_COND(!TranslationServer::is_locale_valid(trimmed_locale)); + ERR_FAIL_COND_MSG(!TranslationServer::is_locale_valid(trimmed_locale), "Invalid locale: " + trimmed_locale + "."); locale = trimmed_locale; } else { @@ -1044,6 +1043,13 @@ StringName TranslationServer::translate(const StringName &p_message) const { if (!enabled) return p_message; + // Locale can be of the form 'll_CC', i.e. language code and regional code, + // e.g. 'en_US', 'en_GB', etc. It might also be simply 'll', e.g. 'en'. + // To find the relevant translation, we look for those with locale starting + // with the language code, and then if any is an exact match for the long + // form. If not found, we fall back to a near match (another locale with + // same language code). + StringName res; bool near_match = false; const CharType *lptr = &locale[0]; @@ -1053,13 +1059,11 @@ StringName TranslationServer::translate(const StringName &p_message) const { const Ref<Translation> &t = E->get(); String l = t->get_locale(); if (lptr[0] != l[0] || lptr[1] != l[1]) - continue; // locale not match - - //near match - bool match = (l != locale); + continue; // Language code does not match. - if (near_match && !match) - continue; //only near-match once + bool exact_match = (l == locale); + if (!exact_match && near_match) + continue; // Only near-match once, but keep looking for exact matches. StringName r = t->get_message(p_message); @@ -1068,43 +1072,38 @@ StringName TranslationServer::translate(const StringName &p_message) const { res = r; - if (match) + if (exact_match) break; else near_match = true; } - if (!res) { - //try again with fallback - if (fallback.length() >= 2) { - - const CharType *fptr = &fallback[0]; - near_match = false; - for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) { + if (!res && fallback.length() >= 2) { + // Try again with the fallback locale. + const CharType *fptr = &fallback[0]; + near_match = false; + for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) { - const Ref<Translation> &t = E->get(); - String l = t->get_locale(); - if (fptr[0] != l[0] || fptr[1] != l[1]) - continue; // locale not match + const Ref<Translation> &t = E->get(); + String l = t->get_locale(); + if (fptr[0] != l[0] || fptr[1] != l[1]) + continue; // Language code does not match. - //near match - bool match = (l != fallback); + bool exact_match = (l == fallback); + if (!exact_match && near_match) + continue; // Only near-match once, but keep looking for exact matches. - if (near_match && !match) - continue; //only near-match once + StringName r = t->get_message(p_message); - StringName r = t->get_message(p_message); + if (!r) + continue; - if (!r) - continue; + res = r; - res = r; - - if (match) - break; - else - near_match = true; - } + if (exact_match) + break; + else + near_match = true; } } diff --git a/core/type_info.h b/core/type_info.h index d85a63ee42..61ec7b2f20 100644 --- a/core/type_info.h +++ b/core/type_info.h @@ -83,15 +83,13 @@ enum Metadata { }; } +// If the compiler fails because it's trying to instantiate the primary 'GetTypeInfo' template +// instead of one of the specializations, it's most likely because the type 'T' is not supported. +// If 'T' is a class that inherits 'Object', make sure it can see the actual class declaration +// instead of a forward declaration. You can always forward declare 'T' in a header file, and then +// include the actual declaration of 'T' in the source file where 'GetTypeInfo<T>' is instantiated. template <class T, typename = void> -struct GetTypeInfo { - static const Variant::Type VARIANT_TYPE = Variant::NIL; - static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; - static inline PropertyInfo get_class_info() { - ERR_PRINT("GetTypeInfo fallback. Bug!"); - return PropertyInfo(); // Not "Nil", this is an error - } -}; +struct GetTypeInfo; #define MAKE_TYPE_INFO(m_type, m_var_type) \ template <> \ @@ -283,10 +281,7 @@ inline StringName __constant_get_enum_name(T param, const String &p_constant) { return GetTypeInfo<T>::get_class_info().class_name; } -#define CLASS_INFO(m_type) \ - (GetTypeInfo<m_type *>::VARIANT_TYPE != Variant::NIL ? \ - GetTypeInfo<m_type *>::get_class_info() : \ - GetTypeInfo<m_type>::get_class_info()) +#define CLASS_INFO(m_type) (GetTypeInfo<m_type *>::get_class_info()) #else diff --git a/core/ustring.cpp b/core/ustring.cpp index 75e3b6f22e..4e9ab7be6b 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -31,7 +31,7 @@ #include "ustring.h" #include "core/color.h" -#include "core/math/crypto_core.h" +#include "core/crypto/crypto_core.h" #include "core/math/math_funcs.h" #include "core/os/memory.h" #include "core/print_string.h" @@ -2729,6 +2729,51 @@ bool String::is_quoted() const { return is_enclosed_in("\"") || is_enclosed_in("'"); } +int String::_count(const String &p_string, int p_from, int p_to, bool p_case_insensitive) const { + if (p_string.empty()) { + return 0; + } + int len = length(); + int slen = p_string.length(); + if (len < slen) { + return 0; + } + String str; + if (p_from >= 0 && p_to >= 0) { + if (p_to == 0) { + p_to = len; + } else if (p_from >= p_to) { + return 0; + } + if (p_from == 0 && p_to == len) { + str = String(); + str.copy_from_unchecked(&c_str()[0], len); + } else { + str = substr(p_from, p_to - p_from); + } + } else { + return 0; + } + int c = 0; + int idx = -1; + do { + idx = p_case_insensitive ? str.findn(p_string) : str.find(p_string); + if (idx != -1) { + str = str.substr(idx + slen, str.length() - slen); + ++c; + } + } while (idx != -1); + return c; +} + +int String::count(const String &p_string, int p_from, int p_to) const { + return _count(p_string, p_from, p_to, false); +} + +int String::countn(const String &p_string, int p_from, int p_to) const { + return _count(p_string, p_from, p_to, true); +} + bool String::_base_is_subsequence_of(const String &p_string, bool case_insensitive) const { int len = length(); diff --git a/core/ustring.h b/core/ustring.h index 8a52c53238..bbd0bcceb5 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -36,10 +36,6 @@ #include "core/typedefs.h" #include "core/vector.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - template <class T> class CharProxy { friend class CharString; @@ -137,6 +133,7 @@ class String { void copy_from(const CharType &p_char); void copy_from_unchecked(const CharType *p_char, const int p_length); bool _base_is_subsequence_of(const String &p_string, bool case_insensitive) const; + int _count(const String &p_string, int p_from, int p_to, bool p_case_insensitive) const; public: enum { @@ -279,6 +276,9 @@ public: String to_upper() const; String to_lower() const; + int count(const String &p_string, int p_from = 0, int p_to = 0) const; + int countn(const String &p_string, int p_from = 0, int p_to = 0) const; + String left(int p_pos) const; String right(int p_pos) const; String dedent() const; diff --git a/core/variant.cpp b/core/variant.cpp index fe9623d068..e7d0e58367 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1740,10 +1740,7 @@ Variant::operator RID() const { } else if (type == OBJECT && _get_obj().obj) { #ifdef DEBUG_ENABLED if (ScriptDebugger::get_singleton()) { - if (!ObjectDB::instance_validate(_get_obj().obj)) { - ERR_EXPLAIN("Invalid pointer (object was deleted)"); - ERR_FAIL_V(RID()); - }; + ERR_FAIL_COND_V_MSG(!ObjectDB::instance_validate(_get_obj().obj), RID(), "Invalid pointer (object was deleted)."); }; #endif Variant::CallError ce; @@ -1834,8 +1831,6 @@ inline DA _convert_array_from_variant(const Variant &p_variant) { return DA(); } } - - return DA(); } Variant::operator Array() const { @@ -2299,7 +2294,7 @@ Variant::Variant(const Object *p_object) { Variant::Variant(const Dictionary &p_dictionary) { type = DICTIONARY; - memnew_placement(_data._mem, (Dictionary)(p_dictionary)); + memnew_placement(_data._mem, Dictionary(p_dictionary)); } Variant::Variant(const Array &p_array) { diff --git a/core/variant.h b/core/variant.h index a8e99c13f1..c4f69c3e8d 100644 --- a/core/variant.h +++ b/core/variant.h @@ -31,10 +31,6 @@ #ifndef VARIANT_H #define VARIANT_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #include "core/array.h" #include "core/color.h" #include "core/dictionary.h" diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 3fdd18a630..3ab1386b13 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -32,8 +32,8 @@ #include "core/color_names.inc" #include "core/core_string_names.h" +#include "core/crypto/crypto_core.h" #include "core/io/compression.h" -#include "core/math/crypto_core.h" #include "core/object.h" #include "core/os/os.h" #include "core/script_language.h" @@ -70,7 +70,7 @@ struct _VariantCall { for (int i = 0; i < arg_count; i++) { - if (!tptr[i] || tptr[i] == p_args[i]->type) + if (tptr[i] == Variant::NIL || tptr[i] == p_args[i]->type) continue; // all good if (!Variant::can_convert(p_args[i]->type, tptr[i])) { r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; @@ -237,6 +237,8 @@ struct _VariantCall { VCALL_LOCALMEM1R(String, casecmp_to); VCALL_LOCALMEM1R(String, nocasecmp_to); VCALL_LOCALMEM0R(String, length); + VCALL_LOCALMEM3R(String, count); + VCALL_LOCALMEM3R(String, countn); VCALL_LOCALMEM2R(String, substr); VCALL_LOCALMEM2R(String, find); VCALL_LOCALMEM1R(String, find_last); @@ -582,8 +584,7 @@ struct _VariantCall { if (buffer_size < 0) { r_ret = decompressed; - ERR_EXPLAIN("Decompression buffer size is less than zero"); - ERR_FAIL(); + ERR_FAIL_MSG("Decompression buffer size is less than zero."); } decompressed.resize(buffer_size); @@ -595,13 +596,10 @@ struct _VariantCall { r_ret = decompressed; } - static void _call_PoolByteArray_sha256_string(Variant &r_ret, Variant &p_self, const Variant **p_args) { + static void _call_PoolByteArray_hex_encode(Variant &r_ret, Variant &p_self, const Variant **p_args) { PoolByteArray *ba = reinterpret_cast<PoolByteArray *>(p_self._data._mem); PoolByteArray::Read r = ba->read(); - String s; - unsigned char hash[32]; - CryptoCore::sha256((unsigned char *)r.ptr(), ba->size(), hash); - s = String::hex_encode_buffer(hash, 32); + String s = String::hex_encode_buffer(&r[0], ba->size()); r_ret = s; } @@ -912,7 +910,7 @@ struct _VariantCall { static void Quat_init2(Variant &r_ret, const Variant **p_args) { - r_ret = Quat(((Vector3)(*p_args[0])), ((float)(*p_args[1]))); + r_ret = Quat(((Vector3)(*p_args[0])), ((real_t)(*p_args[1]))); } static void Quat_init3(Variant &r_ret, const Variant **p_args) { @@ -1502,6 +1500,9 @@ void register_variant_methods() { ADDFUNC2R(STRING, INT, String, find, STRING, "what", INT, "from", varray(0)); + ADDFUNC3R(STRING, INT, String, count, STRING, "what", INT, "from", INT, "to", varray(0, 0)); + ADDFUNC3R(STRING, INT, String, countn, STRING, "what", INT, "from", INT, "to", varray(0, 0)); + ADDFUNC1R(STRING, INT, String, find_last, STRING, "what", varray()); ADDFUNC2R(STRING, INT, String, findn, STRING, "what", INT, "from", varray(0)); ADDFUNC2R(STRING, INT, String, rfind, STRING, "what", INT, "from", varray(-1)); @@ -1758,7 +1759,7 @@ void register_variant_methods() { ADDFUNC0R(POOL_BYTE_ARRAY, STRING, PoolByteArray, get_string_from_ascii, varray()); ADDFUNC0R(POOL_BYTE_ARRAY, STRING, PoolByteArray, get_string_from_utf8, varray()); - ADDFUNC0R(POOL_BYTE_ARRAY, STRING, PoolByteArray, sha256_string, varray()); + ADDFUNC0R(POOL_BYTE_ARRAY, STRING, PoolByteArray, hex_encode, varray()); ADDFUNC1R(POOL_BYTE_ARRAY, POOL_BYTE_ARRAY, PoolByteArray, compress, INT, "compression_mode", varray(0)); ADDFUNC2R(POOL_BYTE_ARRAY, POOL_BYTE_ARRAY, PoolByteArray, decompress, INT, "buffer_size", INT, "compression_mode", varray(0)); @@ -1950,19 +1951,27 @@ void register_variant_methods() { _VariantCall::add_variant_constant(Variant::VECTOR2, "UP", Vector2(0, -1)); _VariantCall::add_variant_constant(Variant::VECTOR2, "DOWN", Vector2(0, 1)); - _VariantCall::add_variant_constant(Variant::TRANSFORM2D, "IDENTITY", Transform2D(1, 0, 0, 1, 0, 0)); + _VariantCall::add_variant_constant(Variant::TRANSFORM2D, "IDENTITY", Transform2D()); _VariantCall::add_variant_constant(Variant::TRANSFORM2D, "FLIP_X", Transform2D(-1, 0, 0, 1, 0, 0)); _VariantCall::add_variant_constant(Variant::TRANSFORM2D, "FLIP_Y", Transform2D(1, 0, 0, -1, 0, 0)); - Transform identity_transform, transform_x, transform_y, transform_z; - identity_transform.set(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0); + Transform identity_transform = Transform(); + Transform flip_x_transform = Transform(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0); + Transform flip_y_transform = Transform(1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0); + Transform flip_z_transform = Transform(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0); _VariantCall::add_variant_constant(Variant::TRANSFORM, "IDENTITY", identity_transform); - transform_x.set(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0); - _VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_X", transform_x); - transform_y.set(1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0); - _VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Y", transform_y); - transform_z.set(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0); - _VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Z", transform_z); + _VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_X", flip_x_transform); + _VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Y", flip_y_transform); + _VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Z", flip_z_transform); + + Basis identity_basis = Basis(); + Basis flip_x_basis = Basis(-1, 0, 0, 0, 1, 0, 0, 0, 1); + Basis flip_y_basis = Basis(1, 0, 0, 0, -1, 0, 0, 0, 1); + Basis flip_z_basis = Basis(1, 0, 0, 0, 1, 0, 0, 0, -1); + _VariantCall::add_variant_constant(Variant::BASIS, "IDENTITY", identity_basis); + _VariantCall::add_variant_constant(Variant::BASIS, "FLIP_X", flip_x_basis); + _VariantCall::add_variant_constant(Variant::BASIS, "FLIP_Y", flip_y_basis); + _VariantCall::add_variant_constant(Variant::BASIS, "FLIP_Z", flip_z_basis); _VariantCall::add_variant_constant(Variant::PLANE, "PLANE_YZ", Plane(Vector3(1, 0, 0), 0)); _VariantCall::add_variant_constant(Variant::PLANE, "PLANE_XZ", Plane(Vector3(0, 1, 0), 0)); diff --git a/core/variant_op.cpp b/core/variant_op.cpp index d677c7776a..ea9e29e744 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -2613,7 +2613,7 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { if (r_valid) { *r_valid = false; } - return "Attempted get on stray pointer."; + return true; // Attempted get on stray pointer. } } #endif diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index d5513bc2d7..07212ec669 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -1537,8 +1537,6 @@ Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r Token token; get_token(p_stream, token, line, r_err_str); Error err = parse_value(token, r_value, p_stream, line, r_err_str, p_res_parser); - if (err) { - } return err; } } else if (c == '\n') { diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 0428140908..b25de3cf99 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1317,10 +1317,10 @@ No hint for the edited property. </constant> <constant name="PROPERTY_HINT_RANGE" value="1" enum="PropertyHint"> - Hints that an integer or float property should be within a range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"allow_greater"[/code] and/or [code]"allow_lesser"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"-360,360,1,allow_greater,allow_lesser"[/code]. + Hints that an integer or float property should be within a range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"or_greater"[/code] and/or [code]"or_lesser"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"-360,360,1,or_greater,or_lesser"[/code]. </constant> <constant name="PROPERTY_HINT_EXP_RANGE" value="2" enum="PropertyHint"> - Hints that an integer or float property should be within an exponential range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"allow_greater"[/code] and/or [code]"allow_lesser"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"0.01,100,0.01,allow_greater"[/code]. + Hints that an integer or float property should be within an exponential range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"or_greater"[/code] and/or [code]"or_lesser"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"0.01,100,0.01,or_greater"[/code]. </constant> <constant name="PROPERTY_HINT_ENUM" value="3" enum="PropertyHint"> Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string such as [code]"Hello,Something,Else"[/code]. diff --git a/doc/classes/ARVRServer.xml b/doc/classes/ARVRServer.xml index af1a1b0fff..b71a18858f 100644 --- a/doc/classes/ARVRServer.xml +++ b/doc/classes/ARVRServer.xml @@ -107,7 +107,7 @@ </method> </methods> <members> - <member name="primary_interface" type="ARVRInterface" setter="set_primary_interface" getter="get_primary_interface" default="null"> + <member name="primary_interface" type="ARVRInterface" setter="set_primary_interface" getter="get_primary_interface"> </member> <member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" default="1.0"> Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index 99e2db6d83..6d7adc9935 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -44,8 +44,8 @@ <description> Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger. [codeblock] - var as = AStar.new() - as.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1 + var astar = AStar.new() + astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1 [/codeblock] If there already exists a point for the given [code]id[/code], its position and weight scale are updated to the given values. </description> @@ -80,10 +80,10 @@ <description> Creates a 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 allowed, not the reverse direction. [codeblock] - var as = AStar.new() - as.add_point(1, Vector3(1, 1, 0)) - as.add_point(2, Vector3(0, 5, 0)) - as.connect_points(1, 2, false) + var astar = AStar.new() + astar.add_point(1, Vector3(1, 1, 0)) + astar.add_point(2, Vector3(0, 5, 0)) + astar.connect_points(1, 2, false) [/codeblock] </description> </method> @@ -122,11 +122,11 @@ <description> Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points. [codeblock] - var as = AStar.new() - as.add_point(1, Vector3(0, 0, 0)) - as.add_point(2, Vector3(0, 5, 0)) - as.connect_points(1, 2) - var res = as.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) + var astar = AStar.new() + astar.add_point(1, Vector3(0, 0, 0)) + astar.add_point(2, Vector3(0, 5, 0)) + astar.connect_points(1, 2) + var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) [/codeblock] The result is in the segment that goes from [code]y = 0[/code] to [code]y = 5[/code]. It's the closest position in the segment to the given point. </description> @@ -141,19 +141,18 @@ <description> Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. [codeblock] - var as = AStar.new() - as.add_point(1, Vector3(0, 0, 0)) - as.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1 - as.add_point(3, Vector3(1, 1, 0)) - as.add_point(4, Vector3(2, 0, 0)) + var astar = AStar.new() + astar.add_point(1, Vector3(0, 0, 0)) + astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1 + astar.add_point(3, Vector3(1, 1, 0)) + astar.add_point(4, Vector3(2, 0, 0)) - as.connect_points(1, 2, false) - as.connect_points(2, 3, false) - as.connect_points(4, 3, false) - as.connect_points(1, 4, false) - as.connect_points(5, 4, false) + astar.connect_points(1, 2, false) + astar.connect_points(2, 3, false) + astar.connect_points(4, 3, false) + astar.connect_points(1, 4, false) - var res = as.get_id_path(1, 3) # Returns [1, 2, 3] + var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] [/codeblock] If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. </description> @@ -166,16 +165,16 @@ <description> Returns an array with the IDs of the points that form the connection with the given point. [codeblock] - var as = AStar.new() - as.add_point(1, Vector3(0, 0, 0)) - as.add_point(2, Vector3(0, 1, 0)) - as.add_point(3, Vector3(1, 1, 0)) - as.add_point(4, Vector3(2, 0, 0)) + var astar = AStar.new() + astar.add_point(1, Vector3(0, 0, 0)) + astar.add_point(2, Vector3(0, 1, 0)) + astar.add_point(3, Vector3(1, 1, 0)) + astar.add_point(4, Vector3(2, 0, 0)) - as.connect_points(1, 2, true) - as.connect_points(1, 3, true) + astar.connect_points(1, 2, true) + astar.connect_points(1, 3, true) - var neighbors = as.get_point_connections(1) # Returns [2, 3] + var neighbors = astar.get_point_connections(1) # Returns [2, 3] [/codeblock] </description> </method> diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 526d1c16da..9d51330139 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -21,8 +21,8 @@ <description> Adds a new point at the given position with the given identifier. The algorithm prefers points with lower [code]weight_scale[/code] to form a path. The [code]id[/code] must be 0 or larger, and the [code]weight_scale[/code] must be 1 or larger. [codeblock] - var as = AStar2D.new() - as.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1 + var astar = AStar2D.new() + astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1 [/codeblock] If there already exists a point for the given [code]id[/code], its position and weight scale are updated to the given values. </description> @@ -57,10 +57,10 @@ <description> Creates a 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 allowed, not the reverse direction. [codeblock] - var as = AStar2D.new() - as.add_point(1, Vector2(1, 1)) - as.add_point(2, Vector2(0, 5)) - as.connect_points(1, 2, false) + var astar = AStar2D.new() + astar.add_point(1, Vector2(1, 1)) + astar.add_point(2, Vector2(0, 5)) + astar.connect_points(1, 2, false) [/codeblock] </description> </method> @@ -99,11 +99,11 @@ <description> Returns the closest position to [code]to_position[/code] that resides inside a segment between two connected points. [codeblock] - var as = AStar2D.new() - as.add_point(1, Vector2(0, 0)) - as.add_point(2, Vector2(0, 5)) - as.connect_points(1, 2) - var res = as.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3) + var astar = AStar2D.new() + astar.add_point(1, Vector2(0, 0)) + astar.add_point(2, Vector2(0, 5)) + astar.connect_points(1, 2) + var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3) [/codeblock] The result is in the segment that goes from [code]y = 0[/code] to [code]y = 5[/code]. It's the closest position in the segment to the given point. </description> @@ -118,19 +118,18 @@ <description> Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. [codeblock] - var as = AStar2D.new() - as.add_point(1, Vector2(0, 0)) - as.add_point(2, Vector2(0, 1), 1) # Default weight is 1 - as.add_point(3, Vector2(1, 1)) - as.add_point(4, Vector2(2, 0)) + var astar = AStar2D.new() + astar.add_point(1, Vector2(0, 0)) + astar.add_point(2, Vector2(0, 1), 1) # Default weight is 1 + astar.add_point(3, Vector2(1, 1)) + astar.add_point(4, Vector2(2, 0)) - as.connect_points(1, 2, false) - as.connect_points(2, 3, false) - as.connect_points(4, 3, false) - as.connect_points(1, 4, false) - as.connect_points(5, 4, false) + astar.connect_points(1, 2, false) + astar.connect_points(2, 3, false) + astar.connect_points(4, 3, false) + astar.connect_points(1, 4, false) - var res = as.get_id_path(1, 3) # Returns [1, 2, 3] + var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] [/codeblock] If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. </description> @@ -143,16 +142,16 @@ <description> Returns an array with the IDs of the points that form the connection with the given point. [codeblock] - var as = AStar2D.new() - as.add_point(1, Vector2(0, 0)) - as.add_point(2, Vector2(0, 1)) - as.add_point(3, Vector2(1, 1)) - as.add_point(4, Vector2(2, 0)) + var astar = AStar2D.new() + astar.add_point(1, Vector2(0, 0)) + astar.add_point(2, Vector2(0, 1)) + astar.add_point(3, Vector2(1, 1)) + astar.add_point(4, Vector2(2, 0)) - as.connect_points(1, 2, true) - as.connect_points(1, 3, true) + astar.connect_points(1, 2, true) + astar.connect_points(1, 3, true) - var neighbors = as.get_point_connections(1) # Returns [2, 3] + var neighbors = astar.get_point_connections(1) # Returns [2, 3] [/codeblock] </description> </method> diff --git a/doc/classes/AnimatedSprite.xml b/doc/classes/AnimatedSprite.xml index 72d1fa4881..10ee4222c8 100644 --- a/doc/classes/AnimatedSprite.xml +++ b/doc/classes/AnimatedSprite.xml @@ -51,7 +51,7 @@ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> The displayed animation frame's index. </member> - <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames" default="null"> + <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames"> The [SpriteFrames] resource containing the animation(s). </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml index ff7d2fb9eb..eac5822d53 100644 --- a/doc/classes/AnimatedSprite3D.xml +++ b/doc/classes/AnimatedSprite3D.xml @@ -40,7 +40,7 @@ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> The displayed animation frame's index. </member> - <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames" default="null"> + <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames"> The [SpriteFrames] resource containing the animation(s). </member> <member name="playing" type="bool" setter="_set_playing" getter="_is_playing" default="false"> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index b4c44fe8eb..e510603281 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -165,6 +165,7 @@ </argument> <description> Queues an animation for playback once the current one is done. + [b]Note:[/b] If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. </description> </method> <method name="remove_animation"> diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index 70c1b783df..d1c24e466d 100644 --- a/doc/classes/AnimationTree.xml +++ b/doc/classes/AnimationTree.xml @@ -43,7 +43,7 @@ </member> <member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath("")"> </member> - <member name="tree_root" type="AnimationNode" setter="set_tree_root" getter="get_tree_root" default="null"> + <member name="tree_root" type="AnimationNode" setter="set_tree_root" getter="get_tree_root"> </member> </members> <constants> diff --git a/doc/classes/AtlasTexture.xml b/doc/classes/AtlasTexture.xml index 1363287dc1..5b0a06a7fb 100644 --- a/doc/classes/AtlasTexture.xml +++ b/doc/classes/AtlasTexture.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="atlas" type="Texture" setter="set_atlas" getter="get_atlas" default="null"> + <member name="atlas" type="Texture" setter="set_atlas" getter="get_atlas"> The texture that contains the atlas. Can be any [Texture] subtype. </member> <member name="filter_clip" type="bool" setter="set_filter_clip" getter="has_filter_clip" default="false"> diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index 7581ae6935..2d3ceebed5 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -32,24 +32,25 @@ Adds an [AudioEffect] effect to the bus [code]bus_idx[/code] at [code]at_position[/code]. </description> </method> - <method name="capture_get_device"> - <return type="String"> + <method name="capture_get_device_list"> + <return type="Array"> </return> <description> + Returns the names of all audio input devices detected on the system. </description> </method> - <method name="capture_get_device_list"> - <return type="Array"> + <method name="capture_start"> + <return type="int" enum="Error"> </return> <description> + Attempts to start recording from the audio driver's capture device. On success, the return value is [constant OK]. </description> </method> - <method name="capture_set_device"> - <return type="void"> + <method name="capture_stop"> + <return type="int" enum="Error"> </return> - <argument index="0" name="name" type="String"> - </argument> <description> + Attempts to stop recording from the audio driver's capture device. On success, the return value is [constant OK]. </description> </method> <method name="generate_bus_layout" qualifiers="const"> @@ -158,11 +159,32 @@ Returns the volume of the bus at index [code]bus_idx[/code] in dB. </description> </method> + <method name="get_capture_buffer"> + <return type="PoolIntArray"> + </return> + <description> + Returns an [PoolIntArray] containing audio frames from the capture device. + </description> + </method> + <method name="get_capture_position"> + <return type="int"> + </return> + <description> + Returns the write position of the capture device buffer. + </description> + </method> + <method name="get_capture_size"> + <return type="int"> + </return> + <description> + Returns the size of the capture device buffer. + </description> + </method> <method name="get_device_list"> <return type="Array"> </return> <description> - Returns the names of all audio devices detected on the system. + Returns the names of all audio output devices detected on the system. </description> </method> <method name="get_mix_rate" qualifiers="const"> @@ -387,14 +409,25 @@ <member name="bus_count" type="int" setter="set_bus_count" getter="get_bus_count" default="1"> Number of available audio buses. </member> + <member name="capture_device" type="String" setter="capture_set_device" getter="capture_get_device" default=""""> + Name of the current device for audio input (see [method capture_get_device_list]). + </member> <member name="device" type="String" setter="set_device" getter="get_device" default=""Default""> - Name of the current device (see [method get_device_list]). + Name of the current device for audio output (see [method get_device_list]). </member> <member name="global_rate_scale" type="float" setter="set_global_rate_scale" getter="get_global_rate_scale" default="1.0"> Scales the rate at which audio is played (i.e. setting it to [code]0.5[/code] will make the audio be played twice as fast). </member> </members> <signals> + <signal name="audio_mix_callback"> + <description> + </description> + </signal> + <signal name="audio_update_callback"> + <description> + </description> + </signal> <signal name="bus_layout_changed"> <description> Emitted when the [AudioBusLayout] changes. diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 92f3a9bd73..4bc29335ff 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -65,7 +65,7 @@ <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false"> If [code]true[/code], audio is playing. </member> - <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" default="null"> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> The [AudioStream] object to be played. </member> <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false"> diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 362a096810..4734aff770 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -71,7 +71,7 @@ <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false"> If [code]true[/code], audio is playing. </member> - <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" default="null"> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> The [AudioStream] object to be played. </member> <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false"> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index d722f2164d..a73f96d082 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -95,7 +95,7 @@ <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false"> If [code]true[/code], audio is playing. </member> - <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" default="null"> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> The [AudioStream] object to be played. </member> <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false"> diff --git a/doc/classes/AudioStreamRandomPitch.xml b/doc/classes/AudioStreamRandomPitch.xml index 9c73a64537..a2ee314d92 100644 --- a/doc/classes/AudioStreamRandomPitch.xml +++ b/doc/classes/AudioStreamRandomPitch.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="audio_stream" type="AudioStream" setter="set_audio_stream" getter="get_audio_stream" default="null"> + <member name="audio_stream" type="AudioStream" setter="set_audio_stream" getter="get_audio_stream"> The current [AudioStream]. </member> <member name="random_pitch" type="float" setter="set_random_pitch" getter="get_random_pitch" default="1.1"> diff --git a/doc/classes/BakedLightmap.xml b/doc/classes/BakedLightmap.xml index 4baf3a6bb2..4a1381295f 100644 --- a/doc/classes/BakedLightmap.xml +++ b/doc/classes/BakedLightmap.xml @@ -18,12 +18,14 @@ <argument index="1" name="create_visual_debug" type="bool" default="false"> </argument> <description> + Bakes the lightmaps within the currently edited scene. </description> </method> <method name="debug_bake"> <return type="void"> </return> <description> + Executes a dry run bake of lightmaps within the currently edited scene. </description> </method> </methods> @@ -32,8 +34,10 @@ Grid subdivision size for lightmapper calculation. The default value will work for most cases. Increase for better lighting on small details or if your scene is very large. </member> <member name="bake_default_texels_per_unit" type="float" setter="set_bake_default_texels_per_unit" getter="get_bake_default_texels_per_unit" default="20.0"> + If a [member Mesh.lightmap_size_hint] isn't specified, the lightmap baker will dynamically set the lightmap size using this value. This value is measured in texels per world unit. The maximum lightmap texture size is 4096x4096. </member> <member name="bake_energy" type="float" setter="set_energy" getter="get_energy" default="1.0"> + Multiplies the light sources' intensity by this value. For instance, if the value is set to 2, lights will be twice as bright. If the value is set to 0.5, lights will be half as bright. </member> <member name="bake_extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 10, 10, 10 )"> The size of the affected area. @@ -45,6 +49,7 @@ Lightmapping mode. See [enum BakeMode]. </member> <member name="bake_propagation" type="float" setter="set_propagation" getter="get_propagation" default="1.0"> + Defines how far the light will travel before it is no longer effective. The higher the number, the farther the light will travel. For instance, if the value is set to 2, the light will go twice as far. If the value is set to 0.5, the light will only go half as far. </member> <member name="bake_quality" type="int" setter="set_bake_quality" getter="get_bake_quality" enum="BakedLightmap.BakeQuality" default="1"> Three quality modes are available. Higher quality requires more rendering time. See [enum BakeQuality]. @@ -55,7 +60,7 @@ <member name="image_path" type="String" setter="set_image_path" getter="get_image_path" default="".""> The location where lightmaps will be saved. </member> - <member name="light_data" type="BakedLightmapData" setter="set_light_data" getter="get_light_data" default="null"> + <member name="light_data" type="BakedLightmapData" setter="set_light_data" getter="get_light_data"> The calculated light data. </member> </members> diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index f306adced2..9d1c80d3be 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -54,7 +54,7 @@ <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" enum="Control.FocusMode" default="2"> Focus access mode to use when switching between enabled/disabled (see [member Control.focus_mode] and [member disabled]). </member> - <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group" default="null"> + <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group"> [ButtonGroup] associated to the button. </member> <member name="keep_pressed_outside" type="bool" setter="set_keep_pressed_outside" getter="is_keep_pressed_outside" default="false"> @@ -63,7 +63,7 @@ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false"> If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if toggle_mode is active). </member> - <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut" default="null"> + <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut"> [ShortCut] associated to the button. </member> <member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled" default="true"> diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 4d5c76a75c..df9438e695 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -208,5 +208,13 @@ </member> </members> <constants> + <constant name="IDENTITY" value="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )"> + </constant> + <constant name="FLIP_X" value="Basis( -1, 0, 0, 0, 1, 0, 0, 0, 1 )"> + </constant> + <constant name="FLIP_Y" value="Basis( 1, 0, 0, 0, -1, 0, 0, 0, 1 )"> + </constant> + <constant name="FLIP_Z" value="Basis( 1, 0, 0, 0, 1, 0, 0, 0, -1 )"> + </constant> </constants> </class> diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index 5ec4947f46..16a28978d5 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -110,7 +110,7 @@ <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint" default="false"> If [code]true[/code], distance field hint is enabled. </member> - <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback" default="null"> + <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback"> The fallback font. </member> <member name="height" type="float" setter="set_height" getter="get_height" default="1.0"> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index f92cf8fabc..adf826c26b 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -20,7 +20,7 @@ <member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false"> Flat buttons don't display decoration. </member> - <member name="icon" type="Texture" setter="set_button_icon" getter="get_button_icon" default="null"> + <member name="icon" type="Texture" setter="set_button_icon" getter="get_button_icon"> Button's icon, if text is present the icon will be placed before the text. </member> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> diff --git a/doc/classes/CPUParticles.xml b/doc/classes/CPUParticles.xml index 12e00be04a..e68b0feb2d 100644 --- a/doc/classes/CPUParticles.xml +++ b/doc/classes/CPUParticles.xml @@ -106,7 +106,7 @@ <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0"> Initial rotation applied to each particle, in degrees. </member> - <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's rotation will be animated along this [Curve]. </member> <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -115,7 +115,7 @@ <member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0"> Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. </member> - <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's angular velocity will vary along this [Curve]. </member> <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -124,7 +124,7 @@ <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation offset. </member> - <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation offset will vary along this [Curve]. </member> <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -133,7 +133,7 @@ <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation speed. </member> - <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation speed will vary along this [Curve]. </member> <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -142,13 +142,13 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> Unused for 3D particles. </member> - <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp" default="null"> + <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> Unused for 3D particles. </member> <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0"> The rate at which particles lose velocity. </member> - <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Damping will vary along this [Curve]. </member> <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -205,7 +205,7 @@ <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> Initial hue variation applied to each particle. </member> - <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's hue will vary along this [Curve]. </member> <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -220,10 +220,13 @@ <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0"> Amount of time each particle will exist. </member> + <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0"> + Particle lifetime randomness ratio. + </member> <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Linear acceleration applied to each particle in the direction of motion. </member> - <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's linear acceleration will vary along this [Curve]. </member> <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -232,7 +235,7 @@ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true"> If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. </member> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> The [Mesh] used for each particle. If [code]null[/code], particles will be spheres. </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false"> @@ -254,7 +257,7 @@ <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Radial acceleration applied to each particle. Makes particle accelerate away from origin. </member> - <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's radial acceleration will vary along this [Curve]. </member> <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -266,7 +269,7 @@ <member name="scale_amount" type="float" setter="set_param" getter="get_param" default="1.0"> Initial scale applied to each particle. </member> - <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's scale will vary along this [Curve]. </member> <member name="scale_amount_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -281,7 +284,7 @@ <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> - <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's tangential acceleration will vary along this [Curve]. </member> <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -299,52 +302,52 @@ Particles are drawn in order of depth. </constant> <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set initial velocity properties. </constant> <constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angular velocity properties. </constant> <constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set orbital velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set orbital velocity properties. </constant> <constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set linear acceleration properties. </constant> <constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set radial acceleration properties. </constant> <constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set tangential acceleration properties. </constant> <constant name="PARAM_DAMPING" value="6" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set damping properties. </constant> <constant name="PARAM_ANGLE" value="7" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angle properties. </constant> <constant name="PARAM_SCALE" value="8" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set scale properties. </constant> <constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue variation properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set hue variation properties. </constant> <constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation speed properties. </constant> <constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation offset properties. </constant> <constant name="PARAM_MAX" value="12" enum="Parameter"> Represents the size of the [enum Parameter] enum. </constant> <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags"> - Use with [method set_flag] to set [member flag_align_y]. + Use with [method set_particle_flag] to set [member flag_align_y]. </constant> <constant name="FLAG_ROTATE_Y" value="1" enum="Flags"> - Use with [method set_flag] to set [member flag_rotate_y]. + Use with [method set_particle_flag] to set [member flag_rotate_y]. </constant> <constant name="FLAG_DISABLE_Z" value="2" enum="Flags"> - Use with [method set_flag] to set [member flag_disable_z]. + Use with [method set_particle_flag] to set [member flag_disable_z]. </constant> <constant name="FLAG_MAX" value="3" enum="Flags"> Represents the size of the [enum Flags] enum. diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 7380014b96..c8dbffb4cb 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -107,7 +107,7 @@ <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0"> Initial rotation applied to each particle, in degrees. </member> - <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's rotation will be animated along this [Curve]. </member> <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -116,7 +116,7 @@ <member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0"> Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. </member> - <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's angular velocity will vary along this [Curve]. </member> <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -125,7 +125,7 @@ <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation offset. </member> - <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation offset will vary along this [Curve]. </member> <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -134,7 +134,7 @@ <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation speed. </member> - <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation speed will vary along this [Curve]. </member> <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -143,13 +143,13 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> Each particle's initial color. If [member texture] is defined, it will be multiplied by this color. </member> - <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp" default="null"> + <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> Each particle's color will vary along this [Gradient]. </member> <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0"> The rate at which particles lose velocity. </member> - <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Damping will vary along this [Curve]. </member> <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -199,7 +199,7 @@ <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> Initial hue variation applied to each particle. </member> - <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's hue will vary along this [Curve]. </member> <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -214,10 +214,13 @@ <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0"> Amount of time each particle will exist. </member> + <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0"> + Particle lifetime randomness ratio. + </member> <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Linear acceleration applied to each particle in the direction of motion. </member> - <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's linear acceleration will vary along this [Curve]. </member> <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -226,7 +229,7 @@ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true"> If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. </member> - <member name="normalmap" type="Texture" setter="set_normalmap" getter="get_normalmap" default="null"> + <member name="normalmap" type="Texture" setter="set_normalmap" getter="get_normalmap"> Normal map to be used for the [member texture] property. </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false"> @@ -235,7 +238,7 @@ <member name="orbit_velocity" type="float" setter="set_param" getter="get_param" default="0.0"> Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. </member> - <member name="orbit_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="orbit_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's orbital velocity will vary along this [Curve]. </member> <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -247,7 +250,7 @@ <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Radial acceleration applied to each particle. Makes particle accelerate away from origin. </member> - <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's radial acceleration will vary along this [Curve]. </member> <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -259,7 +262,7 @@ <member name="scale_amount" type="float" setter="set_param" getter="get_param" default="1.0"> Initial scale applied to each particle. </member> - <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's scale will vary along this [Curve]. </member> <member name="scale_amount_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -274,13 +277,13 @@ <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> - <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's tangential acceleration will vary along this [Curve]. </member> <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Tangential acceleration randomness ratio. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> Particle texture. If [code]null[/code], particles will be squares. </member> </members> @@ -292,46 +295,46 @@ Particles are drawn in order of remaining lifetime. </constant> <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set initial velocity properties. </constant> <constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angular velocity properties. </constant> <constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set orbital velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set orbital velocity properties. </constant> <constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set linear acceleration properties. </constant> <constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set radial acceleration properties. </constant> <constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set tangential acceleration properties. </constant> <constant name="PARAM_DAMPING" value="6" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set damping properties. </constant> <constant name="PARAM_ANGLE" value="7" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angle properties. </constant> <constant name="PARAM_SCALE" value="8" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set scale properties. </constant> <constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue variation properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set hue variation properties. </constant> <constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation speed properties. </constant> <constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation offset properties. </constant> <constant name="PARAM_MAX" value="12" enum="Parameter"> Represents the size of the [enum Parameter] enum. </constant> <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags"> - Use with [method set_flag] to set [member flag_align_y]. + Use with [method set_particle_flag] to set [member flag_align_y]. </constant> <constant name="FLAG_ROTATE_Y" value="1" enum="Flags"> Present for consistency with 3D particle nodes, not used in 2D. diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml index c22413ae7e..d410800141 100644 --- a/doc/classes/Camera.xml +++ b/doc/classes/Camera.xml @@ -171,7 +171,7 @@ <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="Camera.DopplerTracking" default="0"> If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the Doppler effect for objects changed in particular [code]_process[/code] methods. See [enum DopplerTracking] for possible values. </member> - <member name="environment" type="Environment" setter="set_environment" getter="get_environment" default="null"> + <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The [Environment] to use for this camera. </member> <member name="far" type="float" setter="set_zfar" getter="get_zfar" default="100.0"> diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 750b6851b6..16fb483249 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -110,7 +110,7 @@ <member name="drag_margin_bottom" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2"> Bottom margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the edge of the screen. </member> - <member name="drag_margin_h_enabled" type="bool" setter="set_h_drag_enabled" getter="is_h_drag_enabled" default="true"> + <member name="drag_margin_h_enabled" type="bool" setter="set_h_drag_enabled" getter="is_h_drag_enabled" default="false"> If [code]true[/code], the camera only moves when reaching the horizontal drag margins. If [code]false[/code], the camera moves horizontally regardless of margins. </member> <member name="drag_margin_left" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2"> @@ -122,7 +122,7 @@ <member name="drag_margin_top" type="float" setter="set_drag_margin" getter="get_drag_margin" default="0.2"> Top margin needed to drag the camera. A value of [code]1[/code] makes the camera move only when reaching the edge of the screen. </member> - <member name="drag_margin_v_enabled" type="bool" setter="set_v_drag_enabled" getter="is_v_drag_enabled" default="true"> + <member name="drag_margin_v_enabled" type="bool" setter="set_v_drag_enabled" getter="is_v_drag_enabled" default="false"> If [code]true[/code], the camera only moves when reaching the vertical drag margins. If [code]false[/code], the camera moves vertically regardless of margins. </member> <member name="editor_draw_drag_margin" type="bool" setter="set_margin_drawing_enabled" getter="is_margin_drawing_enabled" default="false"> @@ -154,9 +154,11 @@ </member> <member name="offset_h" type="float" setter="set_h_offset" getter="get_h_offset" default="0.0"> The horizontal offset of the camera, relative to the drag margins. + [b]Note:[/b] Offset H is used only to force offset relative to margins. It's not updated in any way if drag margins are enabled and can be used to set inital offset. </member> <member name="offset_v" type="float" setter="set_v_offset" getter="get_v_offset" default="0.0"> The vertical offset of the camera, relative to the drag margins. + [b]Note:[/b] Used the same as [member offset_h]. </member> <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Camera2D.Camera2DProcessMode" default="1"> </member> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 79e3676068..87b8f5c83d 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -519,7 +519,7 @@ <member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" default="1"> The rendering layers in which this [CanvasItem] responds to [Light2D] nodes. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material applied to textures on this [CanvasItem]. </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 80b5e90717..93c42a85a3 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -14,6 +14,7 @@ </constants> <theme_items> <theme_item name="check_vadjust" type="int" default="0"> + The vertical offset used when rendering the check icons. </theme_item> <theme_item name="checked" type="Texture"> </theme_item> diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index f4d0e0657b..4744894fc1 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -14,6 +14,7 @@ </constants> <theme_items> <theme_item name="check_vadjust" type="int" default="0"> + The vertical offset used when rendering the icons. </theme_item> <theme_item name="disabled" type="StyleBox"> </theme_item> diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml index b7b77bc02a..fd08643dd5 100644 --- a/doc/classes/ClassDB.xml +++ b/doc/classes/ClassDB.xml @@ -134,7 +134,7 @@ <argument index="2" name="no_inheritance" type="bool" default="false"> </argument> <description> - Returns whether [code]class[/code] (or its ancestry if [code]no_inheritance[/code] is false) has a method called [code]method[/code] or not. + Returns whether [code]class[/code] (or its ancestry if [code]no_inheritance[/code] is [code]false[/code]) has a method called [code]method[/code] or not. </description> </method> <method name="class_has_signal" qualifiers="const"> @@ -201,7 +201,7 @@ <argument index="0" name="class" type="String"> </argument> <description> - Returns whether this class is enabled or not. + Returns whether this [code]class[/code] is enabled or not. </description> </method> <method name="is_parent_class" qualifiers="const"> diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml index eb69a4aed4..b9ec9480cf 100644 --- a/doc/classes/CollisionObject2D.xml +++ b/doc/classes/CollisionObject2D.xml @@ -19,7 +19,7 @@ <argument index="2" name="shape_idx" type="int"> </argument> <description> - Accepts unhandled [InputEvent]s. [code]shape_idx[/code] is the child index of the clicked [Shape2D]. Connect to the [code]input_event[/code] signal to easily pick up these events. + Accepts unhandled [InputEvent]s. Requires [member input_pickable] to be [code]true[/code]. [code]shape_idx[/code] is the child index of the clicked [Shape2D]. Connect to the [code]input_event[/code] signal to easily pick up these events. </description> </method> <method name="create_shape_owner"> @@ -227,17 +227,17 @@ <argument index="2" name="shape_idx" type="int"> </argument> <description> - Emitted when an input event occurs. Requires [code]input_pickable[/code] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set. See [method _input_event] for details. + Emitted when an input event occurs. Requires [member input_pickable] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set. See [method _input_event] for details. </description> </signal> <signal name="mouse_entered"> <description> - Emitted when the mouse pointer enters any of this object's shapes. Requires [code]input_pickable[/code] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set. + Emitted when the mouse pointer enters any of this object's shapes. Requires [member input_pickable] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set. </description> </signal> <signal name="mouse_exited"> <description> - Emitted when the mouse pointer exits all this object's shapes. Requires [code]input_pickable[/code] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set. + Emitted when the mouse pointer exits all this object's shapes. Requires [member input_pickable] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set. </description> </signal> </signals> diff --git a/doc/classes/CollisionShape.xml b/doc/classes/CollisionShape.xml index bbbc07e6d3..c34c0be839 100644 --- a/doc/classes/CollisionShape.xml +++ b/doc/classes/CollisionShape.xml @@ -31,7 +31,7 @@ <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false"> A disabled collision shape has no effect in the world. </member> - <member name="shape" type="Shape" setter="set_shape" getter="get_shape" default="null"> + <member name="shape" type="Shape" setter="set_shape" getter="get_shape"> The actual shape owned by this collision shape. </member> </members> diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml index fa002bc881..5fd8826a98 100644 --- a/doc/classes/CollisionShape2D.xml +++ b/doc/classes/CollisionShape2D.xml @@ -20,7 +20,7 @@ </member> <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0"> </member> - <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" default="null"> + <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape"> The actual shape owned by this collision shape. </member> </members> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 8ca0bb0b9b..f263c12821 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Control" inherits="CanvasItem" category="Core" version="3.2"> <brief_description> - All User Interface nodes inherit from Control. A control's anchors and margins adapt its position and size relative to its parent. + All user interface nodes inherit from Control. A control's anchors and margins adapt its position and size relative to its parent. </brief_description> <description> Base class for all UI-related nodes. [Control] features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and margins that represent an offset to the anchor. The margins update automatically when the node, any of its parents, or the screen size change. @@ -21,13 +21,16 @@ <return type="bool"> </return> <description> + Virtual method to be implemented by the user. Returns whether [method _gui_input] should not be called for children controls outside this control's rectangle. Input will be clipped to the Rect of this [Control]. Similar to [member rect_clip_content], but doesn't affect visibility. + If not overriden, defaults to [code]false[/code]. </description> </method> <method name="_get_minimum_size" qualifiers="virtual"> <return type="Vector2"> </return> <description> - Returns the minimum size for this control. See [member rect_min_size]. + Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member rect_min_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). + If not overriden, defaults to [constant Vector2.ZERO]. </description> </method> <method name="_gui_input" qualifiers="virtual"> @@ -36,8 +39,20 @@ <argument index="0" name="event" type="InputEvent"> </argument> <description> - Use this method to process and accept inputs on UI elements. See [method accept_event]. - Replaces Godot 2's [code]_input_event[/code]. + Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event]. + Example: clicking a control. + [codeblock] + func _gui_input(event): + if event is InputEventMouseButton: + if event.button_index == BUTTON_LEFT and event.pressed: + print("I've been clicked D:") + [/codeblock] + The event won't trigger if: + * clicking outside the control (see [method has_point]); + * control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; + * control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; + * control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event; + * it happens outside parent's rectangle and the parent has either [member rect_clip_content] or [method _clips_input] enabled. </description> </method> <method name="_make_custom_tooltip" qualifiers="virtual"> @@ -46,6 +61,23 @@ <argument index="0" name="for_text" type="String"> </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. + [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] + func _make_custom_tooltip(for_text): + var label = Label.new() + label.text = for_text + return label + [/codeblock] + Example of usage with custom scene instance: + [codeblock] + func _make_custom_tooltip(for_text): + var tooltip = preload("SomeTooltipScene.tscn").instance() + tooltip.get_node("Label").text = for_text + return tooltip + [/codeblock] </description> </method> <method name="accept_event"> @@ -63,7 +95,7 @@ <argument index="1" name="color" type="Color"> </argument> <description> - Overrides the color in the [member theme] resource the node uses. + Overrides the [Color] with given [code]name[/code] in the [member theme] resource the control uses. If the [code]color[/code] is empty or invalid, the override is cleared and the color from assigned [Theme] is used. </description> </method> <method name="add_constant_override"> @@ -74,7 +106,7 @@ <argument index="1" name="constant" type="int"> </argument> <description> - Overrides an integer constant in the [member theme] resource the node uses. If the [code]constant[/code] is invalid, Godot clears the override. + Overrides an integer constant with given [code]name[/code] in the [member theme] resource the control uses. If the [code]constant[/code] is empty or invalid, the override is cleared and the constant from assigned [Theme] is used. </description> </method> <method name="add_font_override"> @@ -85,7 +117,7 @@ <argument index="1" name="font" type="Font"> </argument> <description> - Overrides the [code]name[/code] font in the [member theme] resource the node uses. If [code]font[/code] is empty, Godot clears the override. + Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is empty or invalid, the override is cleared and the font from assigned [Theme] is used. </description> </method> <method name="add_icon_override"> @@ -96,7 +128,7 @@ <argument index="1" name="texture" type="Texture"> </argument> <description> - Overrides the [code]name[/code] icon in the [member theme] resource the node uses. If [code]icon[/code] is empty, Godot clears the override. + Overrides the icon with given [code]name[/code] in the [member theme] resource the control uses. If [code]icon[/code] is empty or invalid, the override is cleared and the icon from assigned [Theme] is used. </description> </method> <method name="add_shader_override"> @@ -107,7 +139,7 @@ <argument index="1" name="shader" type="Shader"> </argument> <description> - Overrides the [code]name[/code] shader in the [member theme] resource the node uses. If [code]shader[/code] is empty, Godot clears the override. + Overrides the [Shader] with given [code]name[/code] in the [member theme] resource the control uses. If [code]shader[/code] is empty or invalid, the override is cleared and the shader from assigned [Theme] is used. </description> </method> <method name="add_stylebox_override"> @@ -118,7 +150,7 @@ <argument index="1" name="stylebox" type="StyleBox"> </argument> <description> - Overrides the [code]name[/code] [StyleBox] in the [member theme] resource the node uses. If [code]stylebox[/code] is empty, Godot clears the override. + Overrides the [StyleBox] with given [code]name[/code] in the [member theme] resource the control uses. If [code]stylebox[/code] is empty or invalid, the override is cleared and the [StyleBox] from assigned [Theme] is used. </description> </method> <method name="can_drop_data" qualifiers="virtual"> @@ -132,8 +164,6 @@ Godot calls this method to test if [code]data[/code] from a control's [method get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control. This method should only be used to test the data. Process the data in [method drop_data]. [codeblock] - extends Control - func can_drop_data(position, data): # Check position if it is relevant to you # Otherwise, just check data @@ -151,8 +181,6 @@ <description> Godot calls this method to pass you the [code]data[/code] from a control's [method get_drag_data] result. Godot first calls [method can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control. [codeblock] - extends ColorRect - func can_drop_data(position, data): return typeof(data) == TYPE_DICTIONARY and data.has("color") @@ -179,6 +207,7 @@ <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> + Returns the anchor identified by [code]margin[/code] constant from [enum Margin] enum. A getter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top]. </description> </method> <method name="get_begin" qualifiers="const"> @@ -196,12 +225,18 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. + [codeblock] + func _ready(): + modulate = get_color("font_color", "Button") #get the color defined for button fonts + [/codeblock] </description> </method> <method name="get_combined_minimum_size" qualifiers="const"> <return type="Vector2"> </return> <description> + Returns combined minimum size from [member rect_min_size] and [method get_minimum_size]. </description> </method> <method name="get_constant" qualifiers="const"> @@ -212,6 +247,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. </description> </method> <method name="get_cursor_shape" qualifiers="const"> @@ -232,8 +268,6 @@ Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method can_drop_data] and [method drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag]. A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method. [codeblock] - extends Control - func get_drag_data(position): var mydata = make_data() set_drag_preview(make_preview(mydata)) @@ -254,6 +288,7 @@ <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> + Returns the focus neighbour identified by [code]margin[/code] constant from [enum Margin] enum. A getter method for [member focus_neighbour_bottom], [member focus_neighbour_left], [member focus_neighbour_right] and [member focus_neighbour_top]. </description> </method> <method name="get_focus_owner" qualifiers="const"> @@ -271,6 +306,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. </description> </method> <method name="get_global_rect" qualifiers="const"> @@ -288,6 +324,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. </description> </method> <method name="get_margin" qualifiers="const"> @@ -296,6 +333,7 @@ <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> + Returns the anchor identified by [code]margin[/code] constant from [enum Margin] enum. A getter method for [member margin_bottom], [member margin_left], [member margin_right] and [member margin_top]. </description> </method> <method name="get_minimum_size" qualifiers="const"> @@ -341,6 +379,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. </description> </method> <method name="get_tooltip" qualifiers="const"> @@ -349,13 +388,18 @@ <argument index="0" name="at_position" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> - Returns the tooltip, which will appear when the cursor is resting over this control. + Returns the tooltip, which will appear when the cursor is resting over this control. See [member hint_tooltip]. </description> </method> <method name="grab_click_focus"> <return type="void"> </return> <description> + Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control aquires focus. + [codeblock] + func _process(delta): + grab_click_focus() #when clicking another Control node, this node will be clicked instead + [/codeblock] </description> </method> <method name="grab_focus"> @@ -373,6 +417,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. </description> </method> <method name="has_color_override" qualifiers="const"> @@ -381,6 +426,7 @@ <argument index="0" name="name" type="String"> </argument> <description> + Returns [code]true[/code] if [Color] with given [code]name[/code] has a valid override in this [Control] node. </description> </method> <method name="has_constant" qualifiers="const"> @@ -391,6 +437,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. </description> </method> <method name="has_constant_override" qualifiers="const"> @@ -399,6 +446,7 @@ <argument index="0" name="name" type="String"> </argument> <description> + Returns [code]true[/code] if constant with given [code]name[/code] has a valid override in this [Control] node. </description> </method> <method name="has_focus" qualifiers="const"> @@ -416,6 +464,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. </description> </method> <method name="has_font_override" qualifiers="const"> @@ -424,6 +473,7 @@ <argument index="0" name="name" type="String"> </argument> <description> + Returns [code]true[/code] if font with given [code]name[/code] has a valid override in this [Control] node. </description> </method> <method name="has_icon" qualifiers="const"> @@ -434,6 +484,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. </description> </method> <method name="has_icon_override" qualifiers="const"> @@ -442,6 +493,7 @@ <argument index="0" name="name" type="String"> </argument> <description> + Returns [code]true[/code] if icon with given [code]name[/code] has a valid override in this [Control] node. </description> </method> <method name="has_point" qualifiers="virtual"> @@ -450,6 +502,9 @@ <argument index="0" name="point" type="Vector2"> </argument> <description> + Virtual method to be implemented by the user. Returns whether the given [code]point[/code] is inside this control. + If not overriden, default behavior is checking if the point is within control's Rect. + [b]Node:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code]. </description> </method> <method name="has_shader_override" qualifiers="const"> @@ -458,6 +513,7 @@ <argument index="0" name="name" type="String"> </argument> <description> + Returns [code]true[/code] if [Shader] with given [code]name[/code] has a valid override in this [Control] node. </description> </method> <method name="has_stylebox" qualifiers="const"> @@ -468,6 +524,7 @@ <argument index="1" name="type" type="String" default=""""> </argument> <description> + Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. </description> </method> <method name="has_stylebox_override" qualifiers="const"> @@ -476,12 +533,14 @@ <argument index="0" name="name" type="String"> </argument> <description> + Returns [code]true[/code] if [StyleBox] with given [code]name[/code] has a valid override in this [Control] node. </description> </method> <method name="minimum_size_changed"> <return type="void"> </return> <description> + Invalidates the size cache in this node and in parent nodes up to toplevel. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member rect_min_size] directly calls this method automatically. </description> </method> <method name="release_focus"> @@ -503,6 +562,9 @@ <argument index="3" name="push_opposite_anchor" type="bool" default="true"> </argument> <description> + Sets the anchor identified by [code]margin[/code] constant from [enum Margin] enum to value [code]anchor[/code]. A setter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top]. + If [code]keep_margin[/code] is [code]true[/code], margins aren't updated after this operation. + If [code]push_opposite_anchor[/code] is [code]true[/code] and the opposite anchor overlaps this anchor, the opposite one will have its value overriden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If [code]push_opposite_anchor[/code] was [code]false[/code], the left anchor would get value 0.5. </description> </method> <method name="set_anchor_and_margin"> @@ -517,6 +579,7 @@ <argument index="3" name="push_opposite_anchor" type="bool" default="false"> </argument> <description> + Works the same as [method set_anchor], but instead of [code]keep_margin[/code] argument and automatic update of margin, it allows to set the margin offset yourself (see [method set_margin]). </description> </method> <method name="set_anchors_and_margins_preset"> @@ -529,6 +592,7 @@ <argument index="2" name="margin" type="int" default="0"> </argument> <description> + Sets both anchor preset and margin preset. See [method set_anchors_preset] and [method set_margins_preset]. </description> </method> <method name="set_anchors_preset"> @@ -539,6 +603,8 @@ <argument index="1" name="keep_margins" type="bool" default="false"> </argument> <description> + Sets the anchors to a [code]preset[/code] from [enum Control.LayoutPreset] enum. This is code equivalent of using the Layout menu in 2D editor. + If [code]keep_margins[/code] is [code]true[/code], control's position will also be updated. </description> </method> <method name="set_begin"> @@ -547,7 +613,7 @@ <argument index="0" name="position" type="Vector2"> </argument> <description> - Sets [member margin_left] and [member margin_top] at the same time. + Sets [member margin_left] and [member margin_top] at the same time. Equivalent of changing [member rect_position]. </description> </method> <method name="set_drag_forwarding"> @@ -606,6 +672,7 @@ <argument index="1" name="neighbour" type="NodePath"> </argument> <description> + Sets the anchor identified by [code]margin[/code] constant from [enum Margin] enum to [Control] at [code]neighbor[/code] node path. A setter method for [member focus_neighbour_bottom], [member focus_neighbour_left], [member focus_neighbour_right] and [member focus_neighbour_top]. </description> </method> <method name="set_global_position"> @@ -616,6 +683,8 @@ <argument index="1" name="keep_margins" type="bool" default="false"> </argument> <description> + Sets the [member rect_global_position] to given [code]position[/code]. + If [code]keep_margins[/code] is [code]true[/code], control's anchors will be updated instead of margins. </description> </method> <method name="set_margin"> @@ -626,6 +695,7 @@ <argument index="1" name="offset" type="float"> </argument> <description> + Sets the margin identified by [code]margin[/code] constant from [enum Margin] enum to given [code]offset[/code]. A setter method for [member margin_bottom], [member margin_left], [member margin_right] and [member margin_top]. </description> </method> <method name="set_margins_preset"> @@ -638,6 +708,9 @@ <argument index="2" name="margin" type="int" default="0"> </argument> <description> + Sets the margins to a [code]preset[/code] from [enum Control.LayoutPreset] enum. This is code equivalent of using the Layout menu in 2D editor. + Use parameter [code]resize_mode[/code] with constants from [enum Control.LayoutPresetMode] to better determine the resulting size of the [Control]. Constant size will be ignored if used with presets that change size, e.g. [code]PRESET_LEFT_WIDE[/code]. + Use parameter [code]margin[/code] to determine the gap between the [Control] and the edges. </description> </method> <method name="set_position"> @@ -648,6 +721,8 @@ <argument index="1" name="keep_margins" type="bool" default="false"> </argument> <description> + Sets the [member rect_position] to given [code]position[/code]. + If [code]keep_margins[/code] is [code]true[/code], control's anchors will be updated instead of margins. </description> </method> <method name="set_rotation"> @@ -667,6 +742,8 @@ <argument index="1" name="keep_margins" type="bool" default="false"> </argument> <description> + Sets the size (see [member rect_size]). + If [code]keep_margins[/code] is [code]true[/code], control's anchors will be updated instead of margins. </description> </method> <method name="show_modal"> @@ -676,6 +753,7 @@ </argument> <description> Displays a control as modal. Control must be a subwindow. Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus. + If [code]exclusive[/code] is [code]true[/code], other controls will not receive input and clicking outside this control will not close it. </description> </method> <method name="warp_mouse"> @@ -684,21 +762,22 @@ <argument index="0" name="to_position" type="Vector2"> </argument> <description> + Moves the mouse cursor to [code]to_position[/code], relative to [member rect_position] of this [Control]. </description> </method> </methods> <members> <member name="anchor_bottom" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> - Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom margin updates when the node moves or changes size. You can use one of the [code]ANCHOR_*[/code] constants for convenience. + Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="anchor_left" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> - Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left margin updates when the node moves or changes size. You can use one of the [code]ANCHOR_*[/code] constants for convenience. + Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="anchor_right" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> - Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right margin updates when the node moves or changes size. You can use one of the [code]ANCHOR_*[/code] constants for convenience. + Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="anchor_top" type="float" setter="_set_anchor" getter="get_anchor" default="0.0"> - Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the [code]ANCHOR_*[/code] constants for convenience. + Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0"> The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals. @@ -730,7 +809,7 @@ Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. </member> <member name="hint_tooltip" type="String" setter="set_tooltip" getter="_get_tooltip" default=""""> - Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. + Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. You can change the time required for the tooltip to appear with [code]gui/timers/tooltip_delay_sec[/code] option in Project Settings. </member> <member name="margin_bottom" type="float" setter="set_margin" getter="get_margin" default="0.0"> Distance between the node's bottom edge and its parent control, based on [member anchor_bottom]. @@ -780,15 +859,15 @@ The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically. </member> <member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" default="1"> - Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use one of the [code]SIZE_*[/code] constants to change the flags. See the constants to learn what each does. + Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. </member> <member name="size_flags_stretch_ratio" type="float" setter="set_stretch_ratio" getter="get_stretch_ratio" default="1.0"> If the node and at least one of its neighbours uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space. </member> <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" default="1"> - Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use one of the [code]SIZE_*[/code] constants to change the flags. See the constants to learn what each does. + Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. </member> - <member name="theme" type="Theme" setter="set_theme" getter="get_theme" default="null"> + <member name="theme" type="Theme" setter="set_theme" getter="get_theme"> Changing this property replaces the current [Theme] resource this node and all its [Control] children use. </member> </members> @@ -978,12 +1057,16 @@ Snap all 4 anchors to the respective corners of the parent control. Set all 4 margins to 0 after you applied this preset and the [Control] will fit its parent control. This is equivalent to the "Full Rect" layout option in the editor. Use with [method set_anchors_preset]. </constant> <constant name="PRESET_MODE_MINSIZE" value="0" enum="LayoutPresetMode"> + The control will be resized to its minimum size. </constant> <constant name="PRESET_MODE_KEEP_WIDTH" value="1" enum="LayoutPresetMode"> + The control's width will not change. </constant> <constant name="PRESET_MODE_KEEP_HEIGHT" value="2" enum="LayoutPresetMode"> + The control's height will not change. </constant> <constant name="PRESET_MODE_KEEP_SIZE" value="3" enum="LayoutPresetMode"> + The control's size will not change. </constant> <constant name="SIZE_FILL" value="1" enum="SizeFlags"> Tells the parent [Container] to expand the bounds of this node to fill all the available space without pushing any other node. Use with [member size_flags_horizontal] and [member size_flags_vertical]. diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml new file mode 100644 index 0000000000..bb852f5fff --- /dev/null +++ b/doc/classes/Crypto.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Crypto" inherits="Reference" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="generate_random_bytes"> + <return type="PoolByteArray"> + </return> + <argument index="0" name="size" type="int"> + </argument> + <description> + </description> + </method> + <method name="generate_rsa"> + <return type="CryptoKey"> + </return> + <argument index="0" name="size" type="int"> + </argument> + <description> + </description> + </method> + <method name="generate_self_signed_certificate"> + <return type="X509Certificate"> + </return> + <argument index="0" name="key" type="CryptoKey"> + </argument> + <argument index="1" name="issuer_name" type="String" default=""CN=myserver,O=myorganisation,C=IT""> + </argument> + <argument index="2" name="not_before" type="String" default=""20140101000000""> + </argument> + <argument index="3" name="not_after" type="String" default=""20340101000000""> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/CryptoKey.xml b/doc/classes/CryptoKey.xml new file mode 100644 index 0000000000..d3cd485a5f --- /dev/null +++ b/doc/classes/CryptoKey.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="CryptoKey" inherits="Resource" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="load"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <description> + </description> + </method> + <method name="save"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/CurveTexture.xml b/doc/classes/CurveTexture.xml index 666284138b..e8df560a4c 100644 --- a/doc/classes/CurveTexture.xml +++ b/doc/classes/CurveTexture.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="curve" type="Curve" setter="set_curve" getter="get_curve" default="null"> + <member name="curve" type="Curve" setter="set_curve" getter="get_curve"> The [code]curve[/code] rendered onto the texture. </member> <member name="width" type="int" setter="set_width" getter="get_width" default="2048"> diff --git a/doc/classes/DirectionalLight.xml b/doc/classes/DirectionalLight.xml index 4d0ff7f13b..687e7519b2 100644 --- a/doc/classes/DirectionalLight.xml +++ b/doc/classes/DirectionalLight.xml @@ -21,7 +21,7 @@ <member name="directional_shadow_depth_range" type="int" setter="set_shadow_depth_range" getter="get_shadow_depth_range" enum="DirectionalLight.ShadowDepthRange" default="0"> Optimizes shadow rendering for detail versus movement. See [enum ShadowDepthRange]. </member> - <member name="directional_shadow_max_distance" type="float" setter="set_param" getter="get_param" default="200.0"> + <member name="directional_shadow_max_distance" type="float" setter="set_param" getter="get_param" default="100.0"> The maximum distance for shadow splits. </member> <member name="directional_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" enum="DirectionalLight.ShadowMode" default="2"> diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index 9294a515d2..8aae85563a 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -127,8 +127,8 @@ </argument> <description> Initializes the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end]. - If you pass [code]skip_navigational[/code], then [code].[/code] and [code]..[/code] would be filtered out. - If you pass [code]skip_hidden[/code], then hidden files would be filtered out. + If [code]skip_navigational[/code] is [code]true[/code], [code].[/code] and [code]..[/code] are filtered out. + If [code]skip_hidden[/code] is [code]true[/code], hidden files are filtered out. </description> </method> <method name="list_dir_end"> diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml index ac707d09bc..0820d4e1b6 100644 --- a/doc/classes/DynamicFont.xml +++ b/doc/classes/DynamicFont.xml @@ -92,7 +92,7 @@ <member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0"> Extra spacing at the top in pixels. </member> - <member name="font_data" type="DynamicFontData" setter="set_font_data" getter="get_font_data" default="null"> + <member name="font_data" type="DynamicFontData" setter="set_font_data" getter="get_font_data"> The font data. </member> <member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color( 1, 1, 1, 1 )"> diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 6f07682b04..4f7a6d89a9 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -166,6 +166,23 @@ <argument index="0" name="file" type="String"> </argument> <description> + Selects the file, with the path provided by [code]file[/code], in the FileSystem dock. + </description> + </method> + <method name="set_distraction_free_mode"> + <return type="void"> + </return> + <argument index="0" name="enter" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_main_screen_editor"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> </description> </method> <method name="set_plugin_enabled"> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index bd9a100267..89e2f0580b 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -29,7 +29,7 @@ <argument index="1" name="title" type="String"> </argument> <description> - Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [code]queue_free()[/code]. + Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free]. </description> </method> <method name="add_control_to_container"> @@ -40,9 +40,9 @@ <argument index="1" name="control" type="Control"> </argument> <description> - Adds a custom control to a container (see [code]CONTAINER_*[/code] enum). There are many locations where custom controls can be added in the editor UI. + Adds a custom control to a container (see [enum CustomControlContainer]). There are many locations where custom controls can be added in the editor UI. Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it). - When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [code]queue_free()[/code]. + When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [method Node.queue_free]. </description> </method> <method name="add_control_to_dock"> @@ -53,9 +53,9 @@ <argument index="1" name="control" type="Control"> </argument> <description> - Adds the control to a specific dock slot (see [code]DOCK_*[/code] enum for options). + Adds the control to a specific dock slot (see [enum DockSlot] for options). If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. - When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [code]queue_free()[/code]. + When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [method Node.queue_free]. </description> </method> <method name="add_custom_type"> @@ -128,7 +128,7 @@ <argument index="3" name="ud" type="Variant" default="null"> </argument> <description> - Adds a custom menu to [b]Project > Tools[/b] as [code]name[/code] that calls [code]callback[/code] on an instance of [code]handler[/code] with a parameter [code]ud[/code] when user activates it. + Adds a custom menu item to [b]Project > Tools[/b] as [code]name[/code] that calls [code]callback[/code] on an instance of [code]handler[/code] with a parameter [code]ud[/code] when user activates it. </description> </method> <method name="add_tool_submenu_item"> @@ -139,7 +139,7 @@ <argument index="1" name="submenu" type="Object"> </argument> <description> - Like [method add_tool_menu_item] but adds the [code]submenu[/code] item inside the [code]name[/code] menu. + Adds a custom submenu under [b]Project > Tools >[/b] [code]name[/code]. [code]submenu[/code] should be an object of class [PopupMenu]. This submenu should be cleaned up using [code]remove_tool_menu_item(name)[/code]. </description> </method> <method name="apply_changes" qualifiers="virtual"> @@ -167,6 +167,7 @@ <return type="void"> </return> <description> + Called by the engine when the user disables the [EditorPlugin] in the Plugin tab of the project settings window. </description> </method> <method name="edit" qualifiers="virtual"> @@ -182,6 +183,7 @@ <return type="void"> </return> <description> + Called by the engine when the user enables the [EditorPlugin] in the Plugin tab of the project settings window. </description> </method> <method name="forward_canvas_draw_over_viewport" qualifiers="virtual"> @@ -190,12 +192,6 @@ <argument index="0" name="overlay" type="Control"> </argument> <description> - This method is called when there is an input event in the 2D viewport, e.g. the user clicks with the mouse in the 2D space (canvas GUI). Keep in mind that for this method to be called you have to first declare the virtual method [method handles] so the editor knows that you want to work with the workspace: - [codeblock] - func handles(object): - return true - [/codeblock] - Also note that the edited scene must have a root node. </description> </method> <method name="forward_canvas_force_draw_over_viewport" qualifiers="virtual"> @@ -212,6 +208,22 @@ <argument index="0" name="event" type="InputEvent"> </argument> <description> + Called when there is a root node in the current edited scene, [method handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: + [codeblock] + # Prevents the InputEvent to reach other Editor classes + func forward_canvas_gui_input(event): + var forward = true + return forward + [/codeblock] + Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example: + [codeblock] + # Consumes InputEventMouseMotion and forwards other InputEvent types + func forward_canvas_gui_input(event): + var forward = false + if event is InputEventMouseMotion: + forward = true + return forward + [/codeblock] </description> </method> <method name="forward_spatial_gui_input" qualifiers="virtual"> @@ -222,12 +234,22 @@ <argument index="1" name="event" type="InputEvent"> </argument> <description> - This method is called when there is an input event in the 3D viewport, e.g. the user clicks with the mouse in the 3D space (spatial GUI). Keep in mind that for this method to be called you have to first declare the virtual method [method handles] so the editor knows that you want to work with the workspace: + Called when there is a root node in the current edited scene, [method handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: + [codeblock] + # Prevents the InputEvent to reach other Editor classes + func forward_spatial_gui_input(camera, event): + var forward = true + return forward + [/codeblock] + Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example: [codeblock] - func handles(object): - return true + # Consumes InputEventMouseMotion and forwards other InputEvent types + func forward_spatial_gui_input(camera, event): + var forward = false + if event is InputEventMouseMotion: + forward = true + return forward [/codeblock] - Also note that the edited scene must have a root node. </description> </method> <method name="get_breakpoints" qualifiers="virtual"> @@ -349,7 +371,7 @@ <argument index="0" name="control" type="Control"> </argument> <description> - Removes the control from the bottom panel. You have to manually [code]queue_free()[/code] the control. + Removes the control from the bottom panel. You have to manually [method Node.queue_free] the control. </description> </method> <method name="remove_control_from_container"> @@ -360,7 +382,7 @@ <argument index="1" name="control" type="Control"> </argument> <description> - Removes the control from the specified container. You have to manually [code]queue_free()[/code] the control. + Removes the control from the specified container. You have to manually [method Node.queue_free] the control. </description> </method> <method name="remove_control_from_docks"> @@ -369,7 +391,7 @@ <argument index="0" name="control" type="Control"> </argument> <description> - Removes the control from the dock. You have to manually [code]queue_free()[/code] the control. + Removes the control from the dock. You have to manually [method Node.queue_free] the control. </description> </method> <method name="remove_custom_type"> diff --git a/doc/classes/EditorSceneImporter.xml b/doc/classes/EditorSceneImporter.xml index 4707543c91..96d8ce698d 100644 --- a/doc/classes/EditorSceneImporter.xml +++ b/doc/classes/EditorSceneImporter.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="EditorSceneImporter" inherits="Reference" category="Core" version="3.2"> <brief_description> + Imports scenes from third-parties' 3D files. </brief_description> <description> </description> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 60a807c304..187e13d7bd 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -72,6 +72,13 @@ Returns the main loop object (see [MainLoop] and [SceneTree]). </description> </method> + <method name="get_physics_interpolation_fraction" qualifiers="const"> + <return type="float"> + </return> + <description> + Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. + </description> + </method> <method name="get_singleton" qualifiers="const"> <return type="Object"> </return> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 613c5b6563..86c1002666 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -38,7 +38,7 @@ <member name="adjustment_brightness" type="float" setter="set_adjustment_brightness" getter="get_adjustment_brightness" default="1.0"> Global brightness value of the rendered scene (default value is 1). </member> - <member name="adjustment_color_correction" type="Texture" setter="set_adjustment_color_correction" getter="get_adjustment_color_correction" default="null"> + <member name="adjustment_color_correction" type="Texture" setter="set_adjustment_color_correction" getter="get_adjustment_color_correction"> Applies the provided [Texture] resource to affect the global color aspect of the rendered scene. </member> <member name="adjustment_contrast" type="float" setter="set_adjustment_contrast" getter="get_adjustment_contrast" default="1.0"> @@ -89,7 +89,7 @@ <member name="background_mode" type="int" setter="set_background" getter="get_background" enum="Environment.BGMode" default="0"> Defines the mode of background. </member> - <member name="background_sky" type="Sky" setter="set_sky" getter="get_sky" default="null"> + <member name="background_sky" type="Sky" setter="set_sky" getter="get_sky"> [Sky] resource defined as background. </member> <member name="background_sky_custom_fov" type="float" setter="set_sky_custom_fov" getter="get_sky_custom_fov" default="0.0"> @@ -157,11 +157,11 @@ <member name="fog_height_enabled" type="bool" setter="set_fog_height_enabled" getter="is_fog_height_enabled" default="false"> Enables the fog height. </member> - <member name="fog_height_max" type="float" setter="set_fog_height_max" getter="get_fog_height_max" default="100.0"> - Maximum height of fog. + <member name="fog_height_max" type="float" setter="set_fog_height_max" getter="get_fog_height_max" default="0.0"> + The Y coordinate where the height fog will be the most intense. If this value is greater than [member fog_height_min], fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom. </member> - <member name="fog_height_min" type="float" setter="set_fog_height_min" getter="get_fog_height_min" default="0.0"> - Minimum height of fog. + <member name="fog_height_min" type="float" setter="set_fog_height_min" getter="get_fog_height_min" default="10.0"> + The Y coordinate where the height fog will be the least intense. If this value is greater than [member fog_height_max], fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top. </member> <member name="fog_sun_amount" type="float" setter="set_fog_sun_amount" getter="get_fog_sun_amount" default="0.0"> Amount of sun that affects the fog rendering. diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index e78f21b274..4f1e8cc309 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -134,6 +134,8 @@ </theme_item> <theme_item name="folder" type="Texture"> </theme_item> + <theme_item name="folder_icon_modulate" type="Color" default="Color( 1, 1, 1, 1 )"> + </theme_item> <theme_item name="parent_folder" type="Texture"> </theme_item> <theme_item name="reload" type="Texture"> diff --git a/doc/classes/FuncRef.xml b/doc/classes/FuncRef.xml index e35d7a68c5..9803ae0838 100644 --- a/doc/classes/FuncRef.xml +++ b/doc/classes/FuncRef.xml @@ -17,10 +17,20 @@ Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref]. </description> </method> + <method name="call_funcv"> + <return type="Variant"> + </return> + <argument index="0" name="arg_array" type="Array"> + </argument> + <description> + Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref]. Contrarily to [method call_func], this method does not support a variable number of arguments but expects all parameters to be passed via a single [Array]. + </description> + </method> <method name="is_valid" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether the object still exists and has the function assigned. </description> </method> <method name="set_function"> diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml index 6f672bd01a..a9192d1942 100644 --- a/doc/classes/GIProbe.xml +++ b/doc/classes/GIProbe.xml @@ -30,7 +30,7 @@ </member> <member name="compress" type="bool" setter="set_compress" getter="is_compressed" default="false"> </member> - <member name="data" type="GIProbeData" setter="set_probe_data" getter="get_probe_data" default="null"> + <member name="data" type="GIProbeData" setter="set_probe_data" getter="get_probe_data"> </member> <member name="dynamic_range" type="int" setter="set_dynamic_range" getter="get_dynamic_range" default="4"> </member> diff --git a/doc/classes/GeometryInstance.xml b/doc/classes/GeometryInstance.xml index 49c1ce480f..02f2c27043 100644 --- a/doc/classes/GeometryInstance.xml +++ b/doc/classes/GeometryInstance.xml @@ -46,22 +46,26 @@ </member> <member name="lod_max_distance" type="float" setter="set_lod_max_distance" getter="get_lod_max_distance" default="0.0"> The GeometryInstance's max LOD distance. + [b]Note:[/b] This property currently has no effect. </member> <member name="lod_max_hysteresis" type="float" setter="set_lod_max_hysteresis" getter="get_lod_max_hysteresis" default="0.0"> The GeometryInstance's max LOD margin. + [b]Note:[/b] This property currently has no effect. </member> <member name="lod_min_distance" type="float" setter="set_lod_min_distance" getter="get_lod_min_distance" default="0.0"> The GeometryInstance's min LOD distance. + [b]Note:[/b] This property currently has no effect. </member> <member name="lod_min_hysteresis" type="float" setter="set_lod_min_hysteresis" getter="get_lod_min_hysteresis" default="0.0"> The GeometryInstance's min LOD margin. + [b]Note:[/b] This property currently has no effect. </member> - <member name="material_override" type="Material" setter="set_material_override" getter="get_material_override" default="null"> + <member name="material_override" type="Material" setter="set_material_override" getter="get_material_override"> The material override for the whole geometry. - If there is a material in [code]material_override[/code], it will be used instead of any material set in any material slot of the mesh. + If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh. </member> <member name="use_in_baked_light" type="bool" setter="set_flag" getter="get_flag" default="false"> - If [code]true[/code], this GeometryInstance will be used when baking lights using a [GIProbe] and/or any other form of baked lighting. + If [code]true[/code], this GeometryInstance will be used when baking lights using a [GIProbe] or [BakedLightmap]. </member> </members> <constants> @@ -78,10 +82,10 @@ </constant> <constant name="SHADOW_CASTING_SETTING_SHADOWS_ONLY" value="3" enum="ShadowCastingSetting"> Will only show the shadows casted from this object. - In other words: The actual mesh will not be visible, only the shadows casted from the mesh. + In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be. </constant> <constant name="FLAG_USE_BAKED_LIGHT" value="0" enum="Flags"> - Will allow the GeometryInstance to be used when baking lights using a [GIProbe] and/or any other form of baked lighting. + Will allow the GeometryInstance to be used when baking lights using a [GIProbe] or [BakedLightmap]. </constant> <constant name="FLAG_DRAW_NEXT_FRAME_IF_VISIBLE" value="1" enum="Flags"> Unused in this class, exposed for consistency with [enum VisualServer.InstanceFlags]. diff --git a/doc/classes/GradientTexture.xml b/doc/classes/GradientTexture.xml index ef46491e02..3492b2e261 100644 --- a/doc/classes/GradientTexture.xml +++ b/doc/classes/GradientTexture.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" default="null"> + <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient"> The [Gradient] that will be used to fill the texture. </member> <member name="width" type="int" setter="set_width" getter="get_width" default="2048"> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 111bf2109e..3cc40b7cef 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -233,6 +233,11 @@ Signal sent when user dragging connection from output port into empty space of the graph. </description> </signal> + <signal name="copy_nodes_request"> + <description> + Signal sent when the user presses [code]Ctrl + C[/code]. + </description> + </signal> <signal name="delete_nodes_request"> <description> Signal sent when a GraphNode is attempted to be removed from the GraphEdit. @@ -263,6 +268,11 @@ Emitted when a GraphNode is selected. </description> </signal> + <signal name="paste_nodes_request"> + <description> + Signal sent when the user presses [code]Ctrl + V[/code]. + </description> + </signal> <signal name="popup_request"> <argument index="0" name="position" type="Vector2"> </argument> diff --git a/doc/classes/HashingContext.xml b/doc/classes/HashingContext.xml new file mode 100644 index 0000000000..552a74eba4 --- /dev/null +++ b/doc/classes/HashingContext.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="HashingContext" inherits="Reference" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="finish"> + <return type="PoolByteArray"> + </return> + <description> + </description> + </method> + <method name="start"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="type" type="int" enum="HashingContext.HashType"> + </argument> + <description> + </description> + </method> + <method name="update"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="chunk" type="PoolByteArray"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + <constant name="HASH_MD5" value="0" enum="HashType"> + </constant> + <constant name="HASH_SHA1" value="1" enum="HashType"> + </constant> + <constant name="HASH_SHA256" value="2" enum="HashType"> + </constant> + </constants> +</class> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 65d5fbedc3..10be66feb8 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -406,6 +406,17 @@ <description> </description> </method> + <method name="save_exr" qualifiers="const"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <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 explicitely 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"> <return type="int" enum="Error"> </return> @@ -469,13 +480,7 @@ </method> </methods> <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{ -"data": PoolByteArray( ), -"format": "Lum8", -"height": 0, -"mipmaps": false, -"width": 0 -}"> + <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"data": PoolByteArray( ),"format": "Lum8","height": 0,"mipmaps": false,"width": 0}"> Holds all of the image's color data in a given format. See [code]FORMAT_*[/code] constants. </member> </members> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index bbf1ee186f..5fd5e8c3c0 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -20,6 +20,7 @@ <description> This will simulate pressing the specified action. The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action. + [b]Note:[/b] This method will not cause any [method Node._input] calls. It is intended to be used with [method is_action_pressed] and [method is_action_just_pressed]. If you want to simulate [code]_input[/code], use [method parse_input_event] instead. </description> </method> <method name="action_release"> @@ -222,7 +223,7 @@ <argument index="0" name="action" type="String"> </argument> <description> - Returns [code]true[/code] if you are pressing the action event. + Returns [code]true[/code] if you are pressing the action event. Note that if an action has multiple buttons asigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed. </description> </method> <method name="is_joy_button_pressed" qualifiers="const"> @@ -283,7 +284,14 @@ <argument index="0" name="event" type="InputEvent"> </argument> <description> - Feeds an [InputEvent] to the game. Can be used to artificially trigger input events from code. + Feeds an [InputEvent] to the game. Can be used to artificially trigger input events from code. Also generates [method Node._input] calls. + Example: + [codeblock] + var a = InputEventAction.new() + a.action = "ui_cancel" + a.pressed = true + Input.parse_input_event(a) + [/codeblock] </description> </method> <method name="remove_joy_mapping"> @@ -318,6 +326,7 @@ <description> Sets the default cursor shape to be used in the viewport instead of [constant CURSOR_ARROW]. [b]Note:[/b] If you want to change the default cursor shape for [Control]'s nodes, use [member Control.mouse_default_cursor_shape] instead. + [b]Note:[/b] This method generates an [InputEventMouseMotion] to update cursor immediately. </description> </method> <method name="set_mouse_mode"> @@ -363,6 +372,16 @@ Stops the vibration of the joypad. </description> </method> + <method name="vibrate_handheld"> + <return type="void"> + </return> + <argument index="0" name="duration_ms" type="int" default="500"> + </argument> + <description> + Vibrate Android and iOS devices. + [b]Note:[/b] It needs VIBRATE permission for Android at export settings. iOS does not support duration. + </description> + </method> <method name="warp_mouse_position"> <return type="void"> </return> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index f2c00908f6..4c8d83adba 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -17,6 +17,8 @@ <argument index="0" name="with_event" type="InputEvent"> </argument> <description> + Returns [code]true[/code] if the given input event and this input event can be added together (only for events of type [InputEventMouseMotion]). + The given input event's position, global position and speed will be copied. The resulting [code]relative[/code] is a sum of both events. Both events' modifiers have to be identical. </description> </method> <method name="as_text" qualifiers="const"> @@ -32,6 +34,7 @@ <argument index="0" name="action" type="String"> </argument> <description> + Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type [InputEventJoypadMotion]. </description> </method> <method name="is_action" qualifiers="const"> @@ -88,6 +91,7 @@ <argument index="0" name="event" type="InputEvent"> </argument> <description> + Returns [code]true[/code] if the given input event is checking for the same key ([InputEventKey]), button ([InputEventJoypadButton]) or action ([InputEventAction]). </description> </method> <method name="xformed_by" qualifiers="const"> @@ -98,6 +102,7 @@ <argument index="1" name="local_ofs" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> + Returns a copy of the given input event which has been offset by [code]local_ofs[/code] and transformed by [code]xform[/code]. Relevant for events of type [InputEventMouseButton], [InputEventMouseMotion], [InputEventScreenTouch], [InputEventScreenDrag], [InputEventMagnifyGesture] and [InputEventPanGesture]. </description> </method> </methods> diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml index b7c4200b95..2fab689f89 100644 --- a/doc/classes/KinematicBody.xml +++ b/doc/classes/KinematicBody.xml @@ -5,7 +5,7 @@ </brief_description> <description> Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses: - [b]Simulated motion:[/b] When these bodies are moved manually, either from code or from an AnimationPlayer (with process mode set to fixed), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). + [b]Simulated motion:[/b] When these bodies are moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). [b]Kinematic characters:[/b] KinematicBody also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <tutorials> diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 39d84c6e31..99a83765eb 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -5,7 +5,7 @@ </brief_description> <description> Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses: - [b]Simulated motion:[/b] When these bodies are moved manually, either from code or from an AnimationPlayer (with process mode set to fixed), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). + [b]Simulated motion:[/b] When these bodies are moved manually, either from code or from an [AnimationPlayer] (with [member AnimationPlayer.playback_process_mode] set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). [b]Kinematic characters:[/b] KinematicBody2D also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <tutorials> @@ -76,6 +76,7 @@ </argument> <description> Moves the body along the vector [code]rel_vec[/code]. The body will stop if it collides. Returns a [KinematicCollision2D], which contains information about the collision. + If [code]test_only[/code] is [code]true[/code], the body does not move but the would-be collision information is given. </description> </method> <method name="move_and_slide"> diff --git a/doc/classes/KinematicCollision.xml b/doc/classes/KinematicCollision.xml index 4ce28b25c9..44447c8fc8 100644 --- a/doc/classes/KinematicCollision.xml +++ b/doc/classes/KinematicCollision.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="collider" type="Object" setter="" getter="get_collider" default="null"> + <member name="collider" type="Object" setter="" getter="get_collider"> The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> @@ -21,7 +21,7 @@ <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. </member> - <member name="collider_shape" type="Object" setter="" getter="get_collider_shape" default="null"> + <member name="collider_shape" type="Object" setter="" getter="get_collider_shape"> The colliding body's shape. </member> <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" default="0"> @@ -30,7 +30,7 @@ <member name="collider_velocity" type="Vector3" setter="" getter="get_collider_velocity" default="Vector3( 0, 0, 0 )"> The colliding object's velocity. </member> - <member name="local_shape" type="Object" setter="" getter="get_local_shape" default="null"> + <member name="local_shape" type="Object" setter="" getter="get_local_shape"> The moving object's colliding shape. </member> <member name="normal" type="Vector3" setter="" getter="get_normal" default="Vector3( 0, 0, 0 )"> diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index 91cee3d05a..51c2277fb2 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="collider" type="Object" setter="" getter="get_collider" default="null"> + <member name="collider" type="Object" setter="" getter="get_collider"> The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> @@ -21,7 +21,7 @@ <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. </member> - <member name="collider_shape" type="Object" setter="" getter="get_collider_shape" default="null"> + <member name="collider_shape" type="Object" setter="" getter="get_collider_shape"> The colliding body's shape. </member> <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" default="0"> @@ -30,7 +30,7 @@ <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity" default="Vector2( 0, 0 )"> The colliding object's velocity. </member> - <member name="local_shape" type="Object" setter="" getter="get_local_shape" default="null"> + <member name="local_shape" type="Object" setter="" getter="get_local_shape"> The moving object's colliding shape. </member> <member name="normal" type="Vector2" setter="" getter="get_normal" default="Vector2( 0, 0 )"> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 88ad371983..f61be5a5af 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -70,7 +70,7 @@ <member name="shadow_item_cull_mask" type="int" setter="set_item_shadow_cull_mask" getter="get_item_shadow_cull_mask" default="1"> The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching shadow mask will cast shadows. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> [Texture] used for the Light2D's appearance. </member> <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" default="1.0"> diff --git a/doc/classes/LightOccluder2D.xml b/doc/classes/LightOccluder2D.xml index 55978aa0a1..c7d52e6ef4 100644 --- a/doc/classes/LightOccluder2D.xml +++ b/doc/classes/LightOccluder2D.xml @@ -15,7 +15,7 @@ <member name="light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" default="1"> The LightOccluder2D's light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). </member> - <member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon" default="null"> + <member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon"> The [OccluderPolygon2D] used to compute the shadow. </member> </members> diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml index 106c736147..3cb04b8b89 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -75,7 +75,7 @@ <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode" default="0"> Controls the style of the line's last point. Use [code]LINE_CAP_*[/code] constants. </member> - <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" default="null"> + <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient"> The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set. </member> <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="Line2D.LineJointMode" default="0"> @@ -90,7 +90,7 @@ <member name="sharp_limit" type="float" setter="set_sharp_limit" getter="get_sharp_limit" default="2.0"> The direction difference in radians between vector points. This value is only used if [code]joint mode[/code] is set to [constant LINE_JOINT_SHARP]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style. </member> <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode" default="0"> @@ -99,7 +99,7 @@ <member name="width" type="float" setter="set_width" getter="get_width" default="10.0"> The line's width. </member> - <member name="width_curve" type="Curve" setter="set_curve" getter="get_curve" default="null"> + <member name="width_curve" type="Curve" setter="set_curve" getter="get_curve"> The line's width varies with the curve. The original width is simply multiply by the value of the Curve. </member> </members> diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml index f5bf12a876..fedf77bfd2 100644 --- a/doc/classes/MainLoop.xml +++ b/doc/classes/MainLoop.xml @@ -4,7 +4,7 @@ Abstract base class for the game's main loop. </brief_description> <description> - [MainLoop] is the abstract base class for a Godot project's game loop. It in inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree. + [MainLoop] is the abstract base class for a Godot project's game loop. It is inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree. Upon the application start, a [MainLoop] implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree] is created) unless a main [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code], which should then be a [MainLoop] implementation. Here is an example script implementing a simple [MainLoop]: [codeblock] diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml index 80d8b674f3..f584c5207a 100644 --- a/doc/classes/Material.xml +++ b/doc/classes/Material.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="next_pass" type="Material" setter="set_next_pass" getter="get_next_pass" default="null"> + <member name="next_pass" type="Material" setter="set_next_pass" getter="get_next_pass"> </member> <member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" default="0"> </member> diff --git a/doc/classes/MeshInstance.xml b/doc/classes/MeshInstance.xml index e7dbb8e017..c577635c98 100644 --- a/doc/classes/MeshInstance.xml +++ b/doc/classes/MeshInstance.xml @@ -59,7 +59,7 @@ </method> </methods> <members> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> The [Mesh] resource for the instance. </member> <member name="skeleton" type="NodePath" setter="set_skeleton_path" getter="get_skeleton_path" default="NodePath("..")"> diff --git a/doc/classes/MeshInstance2D.xml b/doc/classes/MeshInstance2D.xml index a44b009fb6..4b38b9aa96 100644 --- a/doc/classes/MeshInstance2D.xml +++ b/doc/classes/MeshInstance2D.xml @@ -12,13 +12,13 @@ <methods> </methods> <members> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> The [Mesh] that will be drawn by the [MeshInstance2D]. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> The normal map that will be used if using the default [CanvasItemMaterial]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The [Texture] that will be used if using the default [CanvasItemMaterial]. Can be accessed as [code]TEXTURE[/code] in CanvasItem shader. </member> </members> diff --git a/doc/classes/MeshTexture.xml b/doc/classes/MeshTexture.xml index 4ec8268cc5..f8e02d1851 100644 --- a/doc/classes/MeshTexture.xml +++ b/doc/classes/MeshTexture.xml @@ -11,13 +11,13 @@ <methods> </methods> <members> - <member name="base_texture" type="Texture" setter="set_base_texture" getter="get_base_texture" default="null"> + <member name="base_texture" type="Texture" setter="set_base_texture" getter="get_base_texture"> Sets the base texture that the Mesh will use to draw. </member> <member name="image_size" type="Vector2" setter="set_image_size" getter="get_image_size" default="Vector2( 0, 0 )"> Sets the size of the image, needed for reference. </member> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> Sets the mesh used to draw. It must be a mesh using 2D vertices. </member> </members> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 295f23a92c..8a72aa155b 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -123,7 +123,7 @@ <member name="instance_count" type="int" setter="set_instance_count" getter="get_instance_count" default="0"> Number of instances that will get drawn. This clears and (re)sizes the buffers. By default, all instances are drawn but you can limit this with [member visible_instance_count]. </member> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> Mesh to be drawn. </member> <member name="transform_format" type="int" setter="set_transform_format" getter="get_transform_format" enum="MultiMesh.TransformFormat" default="0"> diff --git a/doc/classes/MultiMeshInstance.xml b/doc/classes/MultiMeshInstance.xml index 5e8cb83a39..16f16fdc8b 100644 --- a/doc/classes/MultiMeshInstance.xml +++ b/doc/classes/MultiMeshInstance.xml @@ -14,7 +14,7 @@ <methods> </methods> <members> - <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh" default="null"> + <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh"> The [MultiMesh] resource that will be used and shared among all instances of the [MultiMeshInstance]. </member> </members> diff --git a/doc/classes/MultiMeshInstance2D.xml b/doc/classes/MultiMeshInstance2D.xml index 28cee1aeba..8509986c3c 100644 --- a/doc/classes/MultiMeshInstance2D.xml +++ b/doc/classes/MultiMeshInstance2D.xml @@ -12,13 +12,13 @@ <methods> </methods> <members> - <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh" default="null"> + <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh"> The [MultiMesh] that will be drawn by the [MultiMeshInstance2D]. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> The normal map that will be used if using the default [CanvasItemMaterial]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The [Texture] that will be used if using the default [CanvasItemMaterial]. Can be accessed as [code]TEXTURE[/code] in CanvasItem shader. </member> </members> diff --git a/doc/classes/NavigationMeshInstance.xml b/doc/classes/NavigationMeshInstance.xml index a6266aac0a..2f9cc58aea 100644 --- a/doc/classes/NavigationMeshInstance.xml +++ b/doc/classes/NavigationMeshInstance.xml @@ -11,7 +11,7 @@ <members> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> </member> - <member name="navmesh" type="NavigationMesh" setter="set_navigation_mesh" getter="get_navigation_mesh" default="null"> + <member name="navmesh" type="NavigationMesh" setter="set_navigation_mesh" getter="get_navigation_mesh"> </member> </members> <constants> diff --git a/doc/classes/NavigationPolygonInstance.xml b/doc/classes/NavigationPolygonInstance.xml index 26cc7fbf31..83f3386af6 100644 --- a/doc/classes/NavigationPolygonInstance.xml +++ b/doc/classes/NavigationPolygonInstance.xml @@ -11,7 +11,7 @@ <members> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> </member> - <member name="navpoly" type="NavigationPolygon" setter="set_navigation_polygon" getter="get_navigation_polygon" default="null"> + <member name="navpoly" type="NavigationPolygon" setter="set_navigation_polygon" getter="get_navigation_polygon"> </member> </members> <constants> diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index c50c1b6079..f191b08d96 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -53,7 +53,7 @@ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The node's texture resource. </member> </members> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 889ce4d3eb..097fa1f6e5 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -122,6 +122,12 @@ <description> Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node. If [code]legible_unique_name[/code] is [code]true[/code], the child node will have an human-readable name based on the name of the node being instanced instead of its type. + [b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example: + [codeblock] + if child_node.get_parent(): + child_node.get_parent().remove_child(child_node) + add_child(child_node) + [/codeblock] </description> </method> <method name="add_child_below_node"> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index b87e912b45..4b77197e29 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -112,7 +112,7 @@ <argument index="1" name="arg_array" type="Array"> </argument> <description> - Calls the [code]method[/code] on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expected all parameters passed via a single [Array]. + Calls the [code]method[/code] on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expects all parameters to be via a single [Array]. [codeblock] callv("set", [ "position", Vector2(42.0, 0.0) ]) [/codeblock] diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index f01ef78c02..0400f2704b 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -65,17 +65,7 @@ </method> </methods> <members> - <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{ -"conn_count": 0, -"conns": PoolIntArray( ), -"editable_instances": [ ], -"names": PoolStringArray( ), -"node_count": 0, -"node_paths": [ ], -"nodes": PoolIntArray( ), -"variants": [ ], -"version": 2 -}"> + <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{"conn_count": 0,"conns": PoolIntArray( ),"editable_instances": [ ],"names": PoolStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PoolIntArray( ),"variants": [ ],"version": 2}"> A dictionary representation of the scene contents. Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for base scene children overrides, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. </member> diff --git a/doc/classes/PanoramaSky.xml b/doc/classes/PanoramaSky.xml index 93a8bc6166..96aefc0623 100644 --- a/doc/classes/PanoramaSky.xml +++ b/doc/classes/PanoramaSky.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="panorama" type="Texture" setter="set_panorama" getter="get_panorama" default="null"> + <member name="panorama" type="Texture" setter="set_panorama" getter="get_panorama"> [Texture] to be applied to the PanoramaSky. </member> </members> diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml index 3b9a0554e8..fb74c5a3d4 100644 --- a/doc/classes/Particles.xml +++ b/doc/classes/Particles.xml @@ -51,7 +51,7 @@ <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="Particles.DrawOrder" default="0"> Particle draw order. Uses [code]DRAW_ORDER_*[/code] values. </member> - <member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh" default="null"> + <member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh"> [Mesh] that is drawn for the first draw pass. </member> <member name="draw_pass_2" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh"> @@ -90,7 +90,7 @@ <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0"> Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting. </member> - <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material" default="null"> + <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material"> [Material] for processing particles. Can be a [ParticlesMaterial] or a [ShaderMaterial]. </member> <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" default="0.0"> diff --git a/doc/classes/Particles2D.xml b/doc/classes/Particles2D.xml index 52b0c846ca..7c7b42ce88 100644 --- a/doc/classes/Particles2D.xml +++ b/doc/classes/Particles2D.xml @@ -51,7 +51,7 @@ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true"> If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> Normal map to be used for the [member texture] property. </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false"> @@ -60,7 +60,7 @@ <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0"> Particle system starts as if it had already run for this many seconds. </member> - <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material" default="null"> + <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material"> [Material] for processing particles. Can be a [ParticlesMaterial] or a [ShaderMaterial]. </member> <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" default="0.0"> @@ -69,7 +69,7 @@ <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> Particle system's running speed scaling ratio. A value of [code]0[/code] can be used to pause the particles. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> Particle texture. If [code]null[/code], particles will be squares. </member> <member name="visibility_rect" type="Rect2" setter="set_visibility_rect" getter="get_visibility_rect" default="Rect2( -100, -100, 200, 200 )"> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index 624a8d4dc5..64751cdf76 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -89,7 +89,7 @@ Initial rotation applied to each particle, in degrees. Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [SpatialMaterial] being used to draw the particle is using [constant SpatialMaterial.BILLBOARD_PARTICLES]. </member> - <member name="angle_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="angle_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's rotation will be animated along this [CurveTexture]. </member> <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -99,7 +99,7 @@ Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [SpatialMaterial] being used to draw the particle is using [constant SpatialMaterial.BILLBOARD_PARTICLES]. </member> - <member name="angular_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="angular_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's angular velocity will vary along this [CurveTexture]. </member> <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -108,7 +108,7 @@ <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation offset. </member> - <member name="anim_offset_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="anim_offset_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's animation offset will vary along this [CurveTexture]. </member> <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -117,7 +117,7 @@ <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation speed. </member> - <member name="anim_speed_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="anim_speed_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's animation speed will vary along this [CurveTexture]. </member> <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -126,13 +126,13 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> Each particle's initial color. If the [Particles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [SpatialMaterial] make sure to set [member SpatialMaterial.vertex_color_use_as_albedo] to [code]true[/code]. </member> - <member name="color_ramp" type="Texture" setter="set_color_ramp" getter="get_color_ramp" default="null"> + <member name="color_ramp" type="Texture" setter="set_color_ramp" getter="get_color_ramp"> Each particle's color will vary along this [GradientTexture]. </member> <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0"> The rate at which particles lose velocity. </member> - <member name="damping_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="damping_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Damping will vary along this [CurveTexture]. </member> <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -180,7 +180,7 @@ <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> Initial hue variation applied to each particle. </member> - <member name="hue_variation_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="hue_variation_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's hue will vary along this [CurveTexture]. </member> <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -192,10 +192,13 @@ <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Initial velocity randomness ratio. </member> + <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0"> + Particle lifetime randomness ratio. + </member> <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Linear acceleration applied to each particle in the direction of motion. </member> - <member name="linear_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="linear_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's linear acceleration will vary along this [CurveTexture]. </member> <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -214,7 +217,7 @@ <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Radial acceleration applied to each particle. Makes particle accelerate away from origin. </member> - <member name="radial_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="radial_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's radial acceleration will vary along this [CurveTexture]. </member> <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -223,7 +226,7 @@ <member name="scale" type="float" setter="set_param" getter="get_param" default="1.0"> Initial scale applied to each particle. </member> - <member name="scale_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="scale_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's scale will vary along this [CurveTexture]. </member> <member name="scale_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -235,19 +238,19 @@ <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> - <member name="tangential_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="tangential_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's tangential acceleration will vary along this [CurveTexture]. </member> <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Tangential acceleration randomness ratio. </member> - <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier" default="null"> + <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier"> Trail particles' color will vary along this [GradientTexture]. </member> <member name="trail_divisor" type="int" setter="set_trail_divisor" getter="get_trail_divisor" default="1"> Emitter will emit [code]amount[/code] divided by [code]trail_divisor[/code] particles. The remaining particles will be used as trail(s). </member> - <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier" default="null"> + <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier"> Trail particles' size will vary along this [CurveTexture]. </member> </members> diff --git a/doc/classes/Path.xml b/doc/classes/Path.xml index 5c1100e670..12ae8fd3d5 100644 --- a/doc/classes/Path.xml +++ b/doc/classes/Path.xml @@ -12,11 +12,7 @@ <methods> </methods> <members> - <member name="curve" type="Curve3D" setter="set_curve" getter="get_curve" default="Object(Curve3D,"resource_local_to_scene":false,"resource_name":"","bake_interval":0.2,"_data":{ -"points": PoolVector3Array( ), -"tilts": PoolRealArray( ) -},"up_vector_enabled":true,"script":null) -"> + <member name="curve" type="Curve3D" setter="set_curve" getter="get_curve"> A [Curve3D] describing the path. </member> </members> diff --git a/doc/classes/Path2D.xml b/doc/classes/Path2D.xml index 960cd5163d..b49a3d928d 100644 --- a/doc/classes/Path2D.xml +++ b/doc/classes/Path2D.xml @@ -12,10 +12,7 @@ <methods> </methods> <members> - <member name="curve" type="Curve2D" setter="set_curve" getter="get_curve" default="Object(Curve2D,"resource_local_to_scene":false,"resource_name":"","bake_interval":5.0,"_data":{ -"points": PoolVector2Array( ) -},"script":null) -"> + <member name="curve" type="Curve2D" setter="set_curve" getter="get_curve"> A [Curve2D] describing the path. </member> </members> diff --git a/doc/classes/Physics2DTestMotionResult.xml b/doc/classes/Physics2DTestMotionResult.xml index 410bffc0f0..752b50922d 100644 --- a/doc/classes/Physics2DTestMotionResult.xml +++ b/doc/classes/Physics2DTestMotionResult.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="collider" type="Object" setter="" getter="get_collider" default="null"> + <member name="collider" type="Object" setter="" getter="get_collider"> </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> </member> diff --git a/doc/classes/PointMesh.xml b/doc/classes/PointMesh.xml new file mode 100644 index 0000000000..dc7dd065cf --- /dev/null +++ b/doc/classes/PointMesh.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PointMesh" inherits="PrimitiveMesh" category="Core" version="3.2"> + <brief_description> + Mesh with a single Point primitive. + </brief_description> + <description> + The PointMesh is made from a single point. Instead of relying on triangles, points are rendered as a single rectangle on the screen with a constant size. They are intended to be used with Particle systems, but can be used as a cheap way to render constant size billboarded sprites (for example in a point cloud). + PointMeshes, must be used with a material that has a point size. Point size can be accessed in a shader with [code]POINT_SIZE[/code], or in a [SpatialMaterial] by setting [member SpatialMaterial.flags_use_point_size] and the variable [member SpatialMaterial.params_point_size]. + When using PointMeshes, properties that normally alter vertices will be ignored, including billboard mode, grow, and cull face. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 6fc0d76d02..7c2aa468ab 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -104,7 +104,7 @@ </member> <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath("")"> </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The polygon's fill texture. Use [code]uv[/code] to set texture coordinates. </member> <member name="texture_offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )"> diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index 08848e789b..21bf078017 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -67,6 +67,12 @@ Returns a copy of the array's contents as [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. </description> </method> + <method name="hex_encode"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="insert"> <return type="int"> </return> @@ -113,13 +119,6 @@ Changes the byte at the given index. </description> </method> - <method name="sha256_string"> - <return type="String"> - </return> - <description> - Returns SHA-256 string of the PoolByteArray. - </description> - </method> <method name="size"> <return type="int"> </return> diff --git a/doc/classes/PoolIntArray.xml b/doc/classes/PoolIntArray.xml index 730833b097..28a28b2bba 100644 --- a/doc/classes/PoolIntArray.xml +++ b/doc/classes/PoolIntArray.xml @@ -6,6 +6,7 @@ <description> An [Array] specifically designed to hold integer values ([int]). Optimized for memory usage, does not fragment the memory. [b]Note:[/b] This type is passed by value and not by reference. + [b]Note:[/b] This type is limited to signed 32-bit integers, which means it can only take values in the interval [code][-2^31, 2^31 - 1][/code], i.e. [code][-2147483648, 2147483647][/code]. Exceeding those bounds will wrap around. In comparison, [int] uses signed 64-bit integers which can hold much larger values. </description> <tutorials> </tutorials> diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml index 1e24aadfd9..fb8168c344 100644 --- a/doc/classes/Popup.xml +++ b/doc/classes/Popup.xml @@ -56,6 +56,13 @@ Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, scaled at a ratio of size of the screen. </description> </method> + <method name="set_as_minsize"> + <return type="void"> + </return> + <description> + Shrink popup to keep to the minimum size of content. + </description> + </method> </methods> <members> <member name="popup_exclusive" type="bool" setter="set_exclusive" getter="is_exclusive" default="false"> diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index 83d4dea5b1..b0e69bd089 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -24,7 +24,7 @@ <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false"> If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. Result is the same as using *CULL_BACK* in [SpatialMaterial]. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The current [Material] of the primitive mesh. </member> </members> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 22dae4fe71..bf1835594b 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -434,92 +434,31 @@ <member name="gui/timers/text_edit_idle_detect_sec" type="float" setter="" getter="" default="3"> Timer for detecting idle in the editor (in seconds). </member> - <member name="input/ui_accept" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_cancel" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_down" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_end" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777230,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_focus_next" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_focus_prev" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_home" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777229,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_left" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_page_down" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777236,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_page_up" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777235,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_right" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_select" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_up" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) - ] -}"> + <member name="input/ui_accept" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null), Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null), Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_cancel" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_down" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_end" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777230,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_focus_next" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_focus_prev" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_home" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777229,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_left" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_page_down" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777236,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_page_up" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777235,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_right" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_select" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_up" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) ]}"> </member> <member name="input_devices/pointing/emulate_mouse_from_touch" type="bool" setter="" getter="" default="true"> If [code]true[/code], sends mouse input events when tapping or swiping on the touchscreen. @@ -711,17 +650,22 @@ <member name="network/limits/debugger_stdout/max_chars_per_second" type="int" setter="" getter="" default="2048"> Maximum amount of characters allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. </member> - <member name="network/limits/debugger_stdout/max_errors_per_frame" type="int" setter="" getter="" default="10"> - Maximum amount of errors allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. + <member name="network/limits/debugger_stdout/max_errors_per_second" type="int" setter="" getter="" default="100"> + Maximum number of errors allowed to be sent as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. </member> <member name="network/limits/debugger_stdout/max_messages_per_frame" type="int" setter="" getter="" default="10"> Maximum amount of messages allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. </member> + <member name="network/limits/debugger_stdout/max_warnings_per_second" type="int" setter="" getter="" default="100"> + Maximum number of warnings allowed to be sent as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. + </member> <member name="network/limits/packet_peer_stream/max_buffer_po2" type="int" setter="" getter="" default="16"> Default size of packet peer stream for deserializing Godot data. Over this size, data is dropped. </member> <member name="network/limits/tcp/connect_timeout_seconds" type="int" setter="" getter="" default="30"> </member> + <member name="network/limits/webrtc/max_channel_in_buffer_kb" type="int" setter="" getter="" default="64"> + </member> <member name="network/limits/websocket_client/max_in_buffer_kb" type="int" setter="" getter="" default="64"> </member> <member name="network/limits/websocket_client/max_in_packets" type="int" setter="" getter="" default="1024"> @@ -744,6 +688,8 @@ <member name="network/remote_fs/page_size" type="int" setter="" getter="" default="65536"> Page size used by remote filesystem (in bytes). </member> + <member name="network/ssl/certificates" type="String" setter="" getter="" default=""""> + </member> <member name="node/name_casing" type="int" setter="" getter="" default="0"> When creating node names automatically, set the type of casing in this project. This is mostly an editor setting. </member> @@ -788,6 +734,12 @@ <member name="rendering/limits/rendering/max_renderable_elements" type="int" setter="" getter="" default="65536"> Max amount of elements renderable in a frame. If more than this are visible per frame, they will be dropped. Keep in mind elements refer to mesh surfaces and not meshes themselves. </member> + <member name="rendering/limits/rendering/max_renderable_lights" type="int" setter="" getter="" default="4096"> + Max number of lights renderable in a frame. If more than this number are used, they will be ignored. On some systems (particularly web) setting this number as low as possible can increase the speed of shader compilation. + </member> + <member name="rendering/limits/rendering/max_renderable_reflections" type="int" setter="" getter="" default="1024"> + Max number of reflection probes renderable in a frame. If more than this number are used, they will be ignored. On some systems (particularly web) setting this number as low as possible can increase the speed of shader compilation. + </member> <member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600"> Shaders have a time variable that constantly increases. At some point, it needs to be rolled back to zero to avoid precision errors on shader animations. This setting specifies when (in seconds). </member> @@ -886,7 +838,7 @@ <member name="rendering/quality/subsurface_scattering/weight_samples" type="bool" setter="" getter="" default="true"> Weight subsurface scattering samples. Helps to avoid reading samples from unrelated parts of the screen. </member> - <member name="rendering/quality/voxel_cone_tracing/high_quality" type="bool" setter="" getter="" default="true"> + <member name="rendering/quality/voxel_cone_tracing/high_quality" type="bool" setter="" getter="" default="false"> Use high-quality voxel cone tracing. This results in better-looking reflections, but is much more expensive on the GPU. </member> <member name="rendering/threads/thread_model" type="int" setter="" getter="" default="1"> @@ -907,7 +859,7 @@ <member name="rendering/vram_compression/import_s3tc" type="bool" setter="" getter="" default="true"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles. </member> - <member name="script" type="Script" setter="" getter="" default="null"> + <member name="script" type="Script" setter="" getter=""> </member> </members> <constants> diff --git a/doc/classes/ProxyTexture.xml b/doc/classes/ProxyTexture.xml index d403196022..a36f670c42 100644 --- a/doc/classes/ProxyTexture.xml +++ b/doc/classes/ProxyTexture.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="base" type="Texture" setter="set_base" getter="get_base" default="null"> + <member name="base" type="Texture" setter="set_base" getter="get_base"> </member> </members> <constants> diff --git a/doc/classes/ResourceFormatLoaderCrypto.xml b/doc/classes/ResourceFormatLoaderCrypto.xml new file mode 100644 index 0000000000..8bc7d50c75 --- /dev/null +++ b/doc/classes/ResourceFormatLoaderCrypto.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ResourceFormatLoaderCrypto" inherits="ResourceFormatLoader" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/ResourceFormatSaverCrypto.xml b/doc/classes/ResourceFormatSaverCrypto.xml new file mode 100644 index 0000000000..2f7d224dab --- /dev/null +++ b/doc/classes/ResourceFormatSaverCrypto.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ResourceFormatSaverCrypto" inherits="ResourceFormatSaver" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/RigidBody.xml b/doc/classes/RigidBody.xml index 07eed6bb34..4378fc3ffe 100644 --- a/doc/classes/RigidBody.xml +++ b/doc/classes/RigidBody.xml @@ -182,7 +182,7 @@ <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidBody.Mode" default="0"> The body mode. See [enum Mode] for possible values. </member> - <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override" default="null"> + <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override"> </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false"> If [code]true[/code], the body is sleeping and will not calculate forces until woken up by a collision or the [code]apply_impulse[/code] method. diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 907a82d51d..32a1634f77 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -154,7 +154,7 @@ Multiplies the gravity applied to the body. The body's gravity is calculated from the [b]Default Gravity[/b] value in [b]Project > Project Settings > Physics > 2d[/b] and/or any additional gravity vector applied by [Area2D]s. </member> <member name="inertia" type="float" setter="set_inertia" getter="get_inertia"> - The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this function allows you to set a custom value. Set 0 (or negative) inertia to return to automatically computing it. + The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this function allows you to set a custom value. Set 0 inertia to return to automatically computing it. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="-1.0"> Damps the body's [member linear_velocity]. If [code]-1[/code], the body will use the [b]Default Linear Damp[/b] in [b]Project > Project Settings > Physics > 2d[/b]. @@ -168,7 +168,7 @@ <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidBody2D.Mode" default="0"> The body's mode. See [enum Mode] for possible values. </member> - <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override" default="null"> + <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override"> </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false"> If [code]true[/code], the body is sleeping and will not calculate forces until woken up by a collision or by using [method apply_impulse] or [method add_force]. diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml index 01d9055569..ef355c4417 100644 --- a/doc/classes/ShaderMaterial.xml +++ b/doc/classes/ShaderMaterial.xml @@ -48,7 +48,7 @@ </method> </methods> <members> - <member name="shader" type="Shader" setter="set_shader" getter="get_shader" default="null"> + <member name="shader" type="Shader" setter="set_shader" getter="get_shader"> The [Shader] program used to render this material. </member> </members> diff --git a/doc/classes/ShortCut.xml b/doc/classes/ShortCut.xml index 44a10ba598..4c5dc0e77b 100644 --- a/doc/classes/ShortCut.xml +++ b/doc/classes/ShortCut.xml @@ -35,7 +35,7 @@ </method> </methods> <members> - <member name="shortcut" type="InputEvent" setter="set_shortcut" getter="get_shortcut" default="null"> + <member name="shortcut" type="InputEvent" setter="set_shortcut" getter="get_shortcut"> The shortcut's [InputEvent]. Generally the [InputEvent] is a keyboard key, though it can be any [InputEvent]. </member> diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index f739fed733..df315d7430 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -69,7 +69,7 @@ <member name="albedo_color" type="Color" setter="set_albedo" getter="get_albedo" default="Color( 1, 1, 1, 1 )"> The material's base color. </member> - <member name="albedo_texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="albedo_texture" type="Texture" setter="set_texture" getter="get_texture"> </member> <member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy"> The strength of the anisotropy effect. @@ -190,9 +190,9 @@ General reflectivity amount. [b]Note:[/b] unlike [member metallic], this is not energy-conserving, so it should be left at [code]0.5[/code] in most cases. See also [member roughness]. </member> - <member name="metallic_texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="metallic_texture" type="Texture" setter="set_texture" getter="get_texture"> </member> - <member name="metallic_texture_channel" type="int" setter="set_metallic_texture_channel" getter="get_metallic_texture_channel" enum="SpatialMaterial.TextureChannel" default="2"> + <member name="metallic_texture_channel" type="int" setter="set_metallic_texture_channel" getter="get_metallic_texture_channel" enum="SpatialMaterial.TextureChannel" default="0"> </member> <member name="normal_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], normal mapping is enabled. @@ -275,9 +275,9 @@ <member name="roughness" type="float" setter="set_roughness" getter="get_roughness" default="1.0"> Surface reflection. A value of [code]0[/code] represents a perfect mirror while a value of [code]1[/code] completely blurs the reflection. See also [member metallic]. </member> - <member name="roughness_texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="roughness_texture" type="Texture" setter="set_texture" getter="get_texture"> </member> - <member name="roughness_texture_channel" type="int" setter="set_roughness_texture_channel" getter="get_roughness_texture_channel" enum="SpatialMaterial.TextureChannel" default="1"> + <member name="roughness_texture_channel" type="int" setter="set_roughness_texture_channel" getter="get_roughness_texture_channel" enum="SpatialMaterial.TextureChannel" default="0"> </member> <member name="subsurf_scatter_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. diff --git a/doc/classes/SpringArm.xml b/doc/classes/SpringArm.xml index 16b4b846e4..438d96f2b3 100644 --- a/doc/classes/SpringArm.xml +++ b/doc/classes/SpringArm.xml @@ -41,7 +41,7 @@ </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.01"> </member> - <member name="shape" type="Shape" setter="set_shape" getter="get_shape" default="null"> + <member name="shape" type="Shape" setter="set_shape" getter="get_shape"> </member> <member name="spring_length" type="float" setter="set_length" getter="get_length" default="1.0"> </member> diff --git a/doc/classes/Sprite.xml b/doc/classes/Sprite.xml index c14ae43f66..b77db1ce9a 100644 --- a/doc/classes/Sprite.xml +++ b/doc/classes/Sprite.xml @@ -46,10 +46,13 @@ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> Current frame to display from sprite sheet. [member vframes] or [member hframes] must be greater than 1. </member> + <member name="frame_coords" type="Vector2" setter="set_frame_coords" getter="get_frame_coords" default="Vector2( 0, 0 )"> + Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member vframes] or [member hframes] must be greater than 1. + </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> The number of columns in the sprite sheet. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> The normal map gives depth to the Sprite. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> @@ -64,7 +67,7 @@ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> [Texture] object to draw. </member> <member name="vframes" type="int" setter="set_vframes" getter="get_vframes" default="1"> diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index 78004c60ee..e458d4301e 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -14,6 +14,9 @@ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> Current frame to display from sprite sheet. [member vframes] or [member hframes] must be greater than 1. </member> + <member name="frame_coords" type="Vector2" setter="set_frame_coords" getter="get_frame_coords" default="Vector2( 0, 0 )"> + Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member vframes] or [member hframes] must be greater than 1. + </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> The number of columns in the sprite sheet. </member> @@ -23,7 +26,7 @@ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> [Texture] object to draw. </member> <member name="vframes" type="int" setter="set_vframes" getter="get_vframes" default="1"> diff --git a/doc/classes/StaticBody.xml b/doc/classes/StaticBody.xml index 878d76a2e3..a9709d00df 100644 --- a/doc/classes/StaticBody.xml +++ b/doc/classes/StaticBody.xml @@ -27,7 +27,7 @@ The body's friction, from 0 (frictionless) to 1 (full friction). Deprecated, use [member PhysicsMaterial.friction] instead via [member physics_material_override]. </member> - <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override" default="null"> + <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override"> </member> </members> <constants> diff --git a/doc/classes/StaticBody2D.xml b/doc/classes/StaticBody2D.xml index 4522a50557..4a7f71b667 100644 --- a/doc/classes/StaticBody2D.xml +++ b/doc/classes/StaticBody2D.xml @@ -26,7 +26,7 @@ The body's friction. Values range from [code]0[/code] (no friction) to [code]1[/code] (full friction). Deprecated, use [member PhysicsMaterial.friction] instead via [member physics_material_override]. </member> - <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override" default="null"> + <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override"> </member> </members> <constants> diff --git a/doc/classes/StreamPeerSSL.xml b/doc/classes/StreamPeerSSL.xml index 9b5f4e7580..c960a794e2 100644 --- a/doc/classes/StreamPeerSSL.xml +++ b/doc/classes/StreamPeerSSL.xml @@ -13,7 +13,13 @@ <method name="accept_stream"> <return type="int" enum="Error"> </return> - <argument index="0" name="base" type="StreamPeer"> + <argument index="0" name="stream" type="StreamPeer"> + </argument> + <argument index="1" name="private_key" type="CryptoKey"> + </argument> + <argument index="2" name="certificate" type="X509Certificate"> + </argument> + <argument index="3" name="chain" type="X509Certificate" default="null"> </argument> <description> </description> @@ -27,6 +33,8 @@ </argument> <argument index="2" name="for_hostname" type="String" default=""""> </argument> + <argument index="3" name="valid_certificate" type="X509Certificate" default="null"> + </argument> <description> Connects to a peer using an underlying [StreamPeer] [code]stream[/code]. If [code]validate_certs[/code] is [code]true[/code], [StreamPeerSSL] will validate that the certificate presented by the peer matches the [code]for_hostname[/code]. </description> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index e513a44b1d..f6ec85c87d 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -272,6 +272,32 @@ Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal. </description> </method> + <method name="count"> + <return type="int"> + </return> + <argument index="0" name="what" type="String"> + </argument> + <argument index="1" name="from" type="int" default="0"> + </argument> + <argument index="2" name="to" type="int" default="0"> + </argument> + <description> + Returns the number of occurrences of substring [code]what[/code] between [code]from[/code] and [code]to[/code] positions. If [code]from[/code] and [code]to[/code] equals 0 the whole string will be used. If only [code]to[/code] equals 0 the remained substring will be used. + </description> + </method> + <method name="countn"> + <return type="int"> + </return> + <argument index="0" name="what" type="String"> + </argument> + <argument index="1" name="from" type="int" default="0"> + </argument> + <argument index="2" name="to" type="int" default="0"> + </argument> + <description> + Returns the number of occurrences of substring [code]what[/code] (ignoring case) between [code]from[/code] and [code]to[/code] positions. If [code]from[/code] and [code]to[/code] equals 0 the whole string will be used. If only [code]to[/code] equals 0 the remained substring will be used. + </description> + </method> <method name="dedent"> <return type="String"> </return> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index f68d749d3b..d5efc80846 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -110,14 +110,14 @@ <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> Modulates the color of the texture when this style box is drawn. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> The normal map to use when drawing this style box. </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> Species a sub region of the texture to use. This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The texture to use when drawing this style box. </member> </members> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 22c769330d..fb5f20361b 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -418,6 +418,10 @@ <member name="highlight_current_line" type="bool" setter="set_highlight_current_line" getter="is_highlight_current_line_enabled" default="false"> If [code]true[/code], the line containing the cursor is highlighted. </member> + <member name="minimap_draw" type="bool" setter="draw_minimap" getter="is_drawing_minimap" default="false"> + </member> + <member name="minimap_width" type="int" setter="set_minimap_width" getter="get_minimap_width" default="80"> + </member> <member name="override_selected_font_color" type="bool" setter="set_override_selected_font_color" getter="is_overriding_selected_font_color" default="false"> </member> <member name="readonly" type="bool" setter="set_readonly" getter="is_readonly" default="false"> diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml index e3396a10c2..899ab8b875 100644 --- a/doc/classes/TextureButton.xml +++ b/doc/classes/TextureButton.xml @@ -18,22 +18,22 @@ <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureButton.StretchMode" default="0"> Controls the texture's behavior when you resize the node's bounding rectangle, [b]only if[/b] [member expand] is [code]true[/code]. Set it to one of the [code]STRETCH_*[/code] constants. See the constants to learn more. </member> - <member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask" default="null"> + <member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask"> Pure black and white [BitMap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes. </member> - <member name="texture_disabled" type="Texture" setter="set_disabled_texture" getter="get_disabled_texture" default="null"> + <member name="texture_disabled" type="Texture" setter="set_disabled_texture" getter="get_disabled_texture"> Texture to display when the node is disabled. See [member BaseButton.disabled]. </member> - <member name="texture_focused" type="Texture" setter="set_focused_texture" getter="get_focused_texture" default="null"> + <member name="texture_focused" type="Texture" setter="set_focused_texture" getter="get_focused_texture"> Texture to display when the node has mouse or keyboard focus. </member> - <member name="texture_hover" type="Texture" setter="set_hover_texture" getter="get_hover_texture" default="null"> + <member name="texture_hover" type="Texture" setter="set_hover_texture" getter="get_hover_texture"> Texture to display when the mouse hovers the node. </member> - <member name="texture_normal" type="Texture" setter="set_normal_texture" getter="get_normal_texture" default="null"> + <member name="texture_normal" type="Texture" setter="set_normal_texture" getter="get_normal_texture"> Texture to display by default, when the node is [b]not[/b] in the disabled, focused, hover or pressed state. </member> - <member name="texture_pressed" type="Texture" setter="set_pressed_texture" getter="get_pressed_texture" default="null"> + <member name="texture_pressed" type="Texture" setter="set_pressed_texture" getter="get_pressed_texture"> Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the Enter key or if the player presses the [member BaseButton.shortcut] key. </member> </members> diff --git a/doc/classes/TextureLayered.xml b/doc/classes/TextureLayered.xml index a9ad5c251d..232df8f59b 100644 --- a/doc/classes/TextureLayered.xml +++ b/doc/classes/TextureLayered.xml @@ -83,14 +83,7 @@ </method> </methods> <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{ -"depth": 0, -"flags": 4, -"format": 37, -"height": 0, -"layers": [ ], -"width": 0 -}"> + <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"depth": 0,"flags": 4,"format": 37,"height": 0,"layers": [ ],"width": 0}"> </member> <member name="flags" type="int" setter="set_flags" getter="get_flags" default="4"> </member> diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml index 3900b8bf45..4f8ea6438b 100644 --- a/doc/classes/TextureProgress.xml +++ b/doc/classes/TextureProgress.xml @@ -57,14 +57,14 @@ <member name="stretch_margin_top" type="int" setter="set_stretch_margin" getter="get_stretch_margin" default="0"> The height of the 9-patch's top row. </member> - <member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture" default="null"> + <member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture"> [Texture] that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of [member texture_progress]. </member> - <member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture" default="null"> + <member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture"> [Texture] that clips based on the node's [code]value[/code] and [member fill_mode]. As [code]value[/code] increased, the texture fills up. It shows entirely when [code]value[/code] reaches [code]max_value[/code]. It doesn't show at all if [code]value[/code] is equal to [code]min_value[/code]. The [code]value[/code] property comes from [Range]. See [member Range.value], [member Range.min_value], [member Range.max_value]. </member> - <member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture" default="null"> + <member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture"> [Texture] that draws under the progress bar. The bar's background. </member> <member name="tint_over" type="Color" setter="set_tint_over" getter="get_tint_over" default="Color( 1, 1, 1, 1 )"> diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml index 8320d535ea..be46459b21 100644 --- a/doc/classes/TextureRect.xml +++ b/doc/classes/TextureRect.xml @@ -23,7 +23,7 @@ <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureRect.StretchMode" default="0"> Controls the texture's behavior when resizing the node's bounding rectangle. See [enum StretchMode]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The node's [Texture] resource. </member> </members> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 9c2676a55a..e4db9243ef 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -335,7 +335,7 @@ </method> </methods> <members> - <member name="default_font" type="Font" setter="set_default_font" getter="get_default_font" default="null"> + <member name="default_font" type="Font" setter="set_default_font" getter="get_default_font"> The theme's default font. </member> </members> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 3f9c2e8647..efb7a0d900 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -306,7 +306,7 @@ <member name="occluder_light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" default="1"> The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s). </member> - <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset" default="null"> + <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset"> The assigned [TileSet]. </member> </members> diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index fd9f96a41e..fccfb4cd6d 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -21,19 +21,19 @@ <member name="action" type="String" setter="set_action" getter="get_action" default=""""> The button's action. Actions can be handled with [InputEventAction]. </member> - <member name="bitmask" type="BitMap" setter="set_bitmask" getter="get_bitmask" default="null"> + <member name="bitmask" type="BitMap" setter="set_bitmask" getter="get_bitmask"> The button's bitmask. </member> - <member name="normal" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="normal" type="Texture" setter="set_texture" getter="get_texture"> The button's texture for the normal state. </member> <member name="passby_press" type="bool" setter="set_passby_press" getter="is_passby_press_enabled" default="false"> If [code]true[/code], pass-by presses are enabled. </member> - <member name="pressed" type="Texture" setter="set_texture_pressed" getter="get_texture_pressed" default="null"> + <member name="pressed" type="Texture" setter="set_texture_pressed" getter="get_texture_pressed"> The button's texture for the pressed state. </member> - <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" default="null"> + <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape"> The button's shape. </member> <member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered" default="true"> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 22c74d4ca5..51d56c758e 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -16,6 +16,7 @@ var subchild1 = tree.create_item(child1) subchild1.set_text(0, "Subchild1") [/codeblock] + To iterate over all the [TreeItem] objects in a [Tree] object, use [method TreeItem.get_next] and [method TreeItem.get_children] after getting the root through [method get_root]. </description> <tutorials> </tutorials> @@ -182,7 +183,7 @@ <argument index="1" name="expand" type="bool"> </argument> <description> - If [code]true[/code], the column will have the "Expand" flag of [Control]. + If [code]true[/code], the column will have the "Expand" flag of [Control]. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [member Control.size_flags_stretch_ratio]. </description> </method> <method name="set_column_min_width"> @@ -193,7 +194,7 @@ <argument index="1" name="min_width" type="int"> </argument> <description> - Sets the minimum width of a column. + Sets the minimum width of a column. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [member Control.size_flags_stretch_ratio]. </description> </method> <method name="set_column_title"> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 3a4acb351d..56b4b21525 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -347,6 +347,7 @@ <argument index="2" name="disabled" type="bool"> </argument> <description> + If [code]true[/code], disables the button at index [code]button_idx[/code] in column [code]column[/code]. </description> </method> <method name="set_cell_mode"> diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml index eb07c70cc6..522e131b45 100644 --- a/doc/classes/Variant.xml +++ b/doc/classes/Variant.xml @@ -5,6 +5,19 @@ </brief_description> <description> 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. + A Variant: + - Can store almost any datatype. + - Can perform operations between many variants. GDScript uses Variant as its atomic/native datatype. + - Can be hashed, so it can be compared quickly to other variants. + - Can be used to convert safely between datatypes. + - Can be used to abstract calling methods and their arguments. Godot exports all its functions through variants. + - Can be used to defer calls or move data between threads. + - Can be serialized as binary and stored to disk, or transferred via network. + - 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. + 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> </tutorials> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 0c96c50c58..237b596fad 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -4,7 +4,7 @@ Vector used for 2D math. </brief_description> <description> - 2-element structure that can be used to represent positions in 2d space or any other pair of numeric values. + 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> diff --git a/doc/classes/VehicleWheel.xml b/doc/classes/VehicleWheel.xml index 6de6429531..ff6004bcba 100644 --- a/doc/classes/VehicleWheel.xml +++ b/doc/classes/VehicleWheel.xml @@ -13,6 +13,7 @@ <return type="float"> </return> <description> + Returns the rotational speed of the wheel in revolutions per minute. </description> </method> <method name="get_skidinfo" qualifiers="const"> @@ -31,12 +32,23 @@ </method> </methods> <members> + <member name="brake" type="float" setter="set_brake" getter="get_brake" default="0.0"> + Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [member RigidBody.mass] of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. + </member> <member name="damping_compression" type="float" setter="set_damping_compression" getter="get_damping_compression" default="0.83"> The damping applied to the spring when the spring is being compressed. This value should be between 0.0 (no damping) and 1.0. A value of 0.0 means the car will keep bouncing as the spring keeps its energy. A good value for this is around 0.3 for a normal car, 0.5 for a race car. </member> <member name="damping_relaxation" type="float" setter="set_damping_relaxation" getter="get_damping_relaxation" default="0.88"> The damping applied to the spring when relaxing. This value should be between 0.0 (no damping) and 1.0. This value should always be slightly higher than the [member damping_compression] property. For a [member damping_compression] value of 0.3, try a relaxation value of 0.5. </member> + <member name="engine_force" type="float" setter="set_engine_force" getter="get_engine_force" default="0.0"> + Accelerates the wheel by applying an engine force. The wheel is only speed up if it is in contact with a surface. The [member RigidBody.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. + [b]Note:[/b] The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. + A negative value will result in the wheel reversing. + </member> + <member name="steering" type="float" setter="set_steering" getter="get_steering" default="0.0"> + The steering angle for the wheel. Setting this to a non-zero value will result in the vehicle turning when it's moving. + </member> <member name="suspension_max_force" type="float" setter="set_suspension_max_force" getter="get_suspension_max_force" default="6000.0"> The maximum force the spring can resist. This value should be higher than a quarter of the [member RigidBody.mass] of the [VehicleBody] or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number. </member> @@ -47,10 +59,10 @@ This is the distance the suspension can travel. As Godot units are equivalent to meters, keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car. </member> <member name="use_as_steering" type="bool" setter="set_use_as_steering" getter="is_used_as_steering" default="false"> - If [code]true[/code], this wheel will be turned when the car steers. + If [code]true[/code], this wheel will be turned when the car steers. This value is used in conjunction with [member VehicleBody.steering] and ignored if you are using the per-wheel [member steering] value instead. </member> <member name="use_as_traction" type="bool" setter="set_use_as_traction" getter="is_used_as_traction" default="false"> - If [code]true[/code], this wheel transfers engine force to the ground to propel the vehicle forward. + If [code]true[/code], this wheel transfers engine force to the ground to propel the vehicle forward. This value is used in conjunction with [member VehicleBody.engine_force] and ignored if you are using the per-wheel [member engine_force] value instead. </member> <member name="wheel_friction_slip" type="float" setter="set_friction_slip" getter="get_friction_slip" default="10.5"> This determines how much grip this wheel has. It is combined with the friction setting of the surface the wheel is in contact with. 0.0 means no grip, 1.0 is normal grip. For a drift car setup, try setting the grip of the rear wheels slightly lower than the front wheels, or use a lower value to simulate tire wear. diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml index 45341cee74..18a85d496f 100644 --- a/doc/classes/VideoPlayer.xml +++ b/doc/classes/VideoPlayer.xml @@ -64,7 +64,7 @@ <member name="paused" type="bool" setter="set_paused" getter="is_paused" default="false"> If [code]true[/code], the video is paused. </member> - <member name="stream" type="VideoStream" setter="set_stream" getter="get_stream" default="null"> + <member name="stream" type="VideoStream" setter="set_stream" getter="get_stream"> </member> <member name="stream_position" type="float" setter="set_stream_position" getter="get_stream_position"> The current position of the stream, in seconds. diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 9b24aa1a86..117c4835eb 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -295,7 +295,7 @@ <member name="usage" type="int" setter="set_usage" getter="get_usage" enum="Viewport.Usage" default="2"> The rendering mode of viewport. </member> - <member name="world" type="World" setter="set_world" getter="get_world" default="null"> + <member name="world" type="World" setter="set_world" getter="get_world"> The custom [World] which can be used as 3D environment source. </member> <member name="world_2d" type="World2D" setter="set_world_2d" getter="get_world_2d"> diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml index 19495a8859..3e80349b13 100644 --- a/doc/classes/VisualShaderNode.xml +++ b/doc/classes/VisualShaderNode.xml @@ -39,5 +39,20 @@ </signal> </signals> <constants> + <constant name="PORT_TYPE_SCALAR" value="0" enum="PortType"> + Floating-point scalar. Translated to [code]float[/code] type in shader code. + </constant> + <constant name="PORT_TYPE_VECTOR" value="1" enum="PortType"> + 3D vector of floating-point values. Translated to [code]vec3[/code] type in shader code. + </constant> + <constant name="PORT_TYPE_BOOLEAN" value="2" enum="PortType"> + Boolean type. Translated to [code]bool[/code] type in shader code. + </constant> + <constant name="PORT_TYPE_TRANSFORM" value="3" enum="PortType"> + Transform type. Translated to [code]mat4[/code] type in shader code. + </constant> + <constant name="PORT_TYPE_ICON_COLOR" value="4" enum="PortType"> + Color type. Can be used for return icon type in members dialog (see [method VisualShaderNodeCustom._get_return_icon_type]) - do not use it in other cases! + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeCompare.xml b/doc/classes/VisualShaderNodeCompare.xml new file mode 100644 index 0000000000..7edad5294d --- /dev/null +++ b/doc/classes/VisualShaderNodeCompare.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeCompare" inherits="VisualShaderNode" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="condition" type="int" setter="set_condition" getter="get_condition" enum="VisualShaderNodeCompare.Condition" default="0"> + </member> + <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeCompare.Function" default="0"> + </member> + <member name="type" type="int" setter="set_comparsion_type" getter="get_comparsion_type" enum="VisualShaderNodeCompare.ComparsionType" default="0"> + </member> + </members> + <constants> + <constant name="CTYPE_SCALAR" value="0" enum="ComparsionType"> + </constant> + <constant name="CTYPE_VECTOR" value="1" enum="ComparsionType"> + </constant> + <constant name="CTYPE_BOOLEAN" value="2" enum="ComparsionType"> + </constant> + <constant name="CTYPE_TRANSFORM" value="3" enum="ComparsionType"> + </constant> + <constant name="FUNC_EQUAL" value="0" enum="Function"> + </constant> + <constant name="FUNC_NOT_EQUAL" value="1" enum="Function"> + </constant> + <constant name="FUNC_GREATER_THAN" value="2" enum="Function"> + </constant> + <constant name="FUNC_GREATER_THAN_EQUAL" value="3" enum="Function"> + </constant> + <constant name="FUNC_LESS_THAN" value="4" enum="Function"> + </constant> + <constant name="FUNC_LESS_THAN_EQUAL" value="5" enum="Function"> + </constant> + <constant name="COND_ALL" value="0" enum="Condition"> + </constant> + <constant name="COND_ANY" value="1" enum="Condition"> + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeCubeMap.xml b/doc/classes/VisualShaderNodeCubeMap.xml index 9a4cb5b17c..b695297f07 100644 --- a/doc/classes/VisualShaderNodeCubeMap.xml +++ b/doc/classes/VisualShaderNodeCubeMap.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="cube_map" type="CubeMap" setter="set_cube_map" getter="get_cube_map" default="null"> + <member name="cube_map" type="CubeMap" setter="set_cube_map" getter="get_cube_map"> </member> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeCubeMap.TextureType" default="0"> </member> diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml new file mode 100644 index 0000000000..9067097f0b --- /dev/null +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeCustom" inherits="VisualShaderNode" category="Core" version="3.2"> + <brief_description> + Virtual class to define custom [VisualShaderNode]s for use in the Visual Shader Editor. + </brief_description> + <description> + By inheriting this class you can create a custom [VisualShader] script addon which will be automatically added to the Visual Shader Editor. The [VisualShaderNode]'s behavior is defined by overriding the provided virtual methods. + In order for the node to be registered as an editor addon, you must use the [code]tool[/code] keyword and provide a [code]class_name[/code] for your custom script. For example: + [codeblock] + tool + extends VisualShaderNodeCustom + class_name VisualShaderNodeNoise + [/codeblock] + </description> + <tutorials> + </tutorials> + <methods> + <method name="_get_category" qualifiers="virtual"> + <return type="String"> + </return> + <description> + Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. + Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the "Custom" category. + </description> + </method> + <method name="_get_code" qualifiers="virtual"> + <return type="String"> + </return> + <argument index="0" name="input_vars" type="Array"> + </argument> + <argument index="1" name="output_vars" type="Array"> + </argument> + <argument index="2" name="mode" type="int"> + </argument> + <argument index="3" name="type" type="int"> + </argument> + <description> + Override this method to define the actual shader code of the associated custom node. The shader code should be returned as a string, which can have multiple lines (the [code]"""[/code] multiline string construct can be used for convenience). + The [code]input_vars[/code] and [code]output_vars[/code] arrays contain the string names of the various input and output variables, as defined by [code]_get_input_*[/code] and [code]_get_output_*[/code] virtual methods in this class. + The output ports can be assigned values in the shader code. For example, [code]return output_vars[0] + " = " + input_vars[0] + ";"[/code]. + You can customize the generated code based on the shader [code]mode[/code] (see [enum Shader.Mode]) and/or [code]type[/code] (see [enum VisualShader.Type]). + Defining this method is [b]required[/b]. + </description> + </method> + <method name="_get_description" qualifiers="virtual"> + <return type="String"> + </return> + <description> + Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog. + Defining this method is [b]optional[/b]. + </description> + </method> + <method name="_get_global_code" qualifiers="virtual"> + <return type="String"> + </return> + <argument index="0" name="mode" type="int"> + </argument> + <description> + Override this method to add shader code on top of the global shader, to define your own standard library of reusable methods, varyings, constants, uniforms, etc. The shader code should be returned as a string, which can have multiple lines (the [code]"""[/code] multiline string construct can be used for convenience). + Be careful with this functionality as it can cause name conflicts with other custom nodes, so be sure to give the defined entities unique names. + You can customize the generated code based on the shader [code]mode[/code] (see [enum Shader.Mode]). + Defining this method is [b]optional[/b]. + </description> + </method> + <method name="_get_input_port_count" qualifiers="virtual"> + <return type="int"> + </return> + <description> + Override this method to define the amount of input ports of the associated custom node. + Defining this method is [b]required[/b]. If not overridden, the node has no input ports. + </description> + </method> + <method name="_get_input_port_name" qualifiers="virtual"> + <return type="String"> + </return> + <argument index="0" name="port" type="int"> + </argument> + <description> + Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the [code]input_vars[/code] array in [method _get_code]. + Defining this method is [b]optional[/b], but recommended. If not overridden, input ports are named as [code]"in" + str(port)[/code]. + </description> + </method> + <method name="_get_input_port_type" qualifiers="virtual"> + <return type="int"> + </return> + <argument index="0" name="port" type="int"> + </argument> + <description> + Override this method to define the returned type of each input port of the associated custom node (see [enum VisualShaderNode.PortType] for possible types). + Defining this method is [b]optional[/b], but recommended. If not overridden, input ports will return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type. + </description> + </method> + <method name="_get_name" qualifiers="virtual"> + <return type="String"> + </return> + <description> + Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. + Defining this method is [b]optional[/b], but recommended. If not overridden, the node will be named as "Unnamed". + </description> + </method> + <method name="_get_output_port_count" qualifiers="virtual"> + <return type="int"> + </return> + <description> + Override this method to define the amount of output ports of the associated custom node. + Defining this method is [b]required[/b]. If not overridden, the node has no output ports. + </description> + </method> + <method name="_get_output_port_name" qualifiers="virtual"> + <return type="String"> + </return> + <argument index="0" name="port" type="int"> + </argument> + <description> + Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the [code]output_vars[/code] array in [method _get_code]. + Defining this method is [b]optional[/b], but recommended. If not overridden, output ports are named as [code]"out" + str(port)[/code]. + </description> + </method> + <method name="_get_output_port_type" qualifiers="virtual"> + <return type="int"> + </return> + <argument index="0" name="port" type="int"> + </argument> + <description> + Override this method to define the returned type of each output port of the associated custom node (see [enum VisualShaderNode.PortType] for possible types). + Defining this method is [b]optional[/b], but recommended. If not overridden, output ports will return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type. + </description> + </method> + <method name="_get_return_icon_type" qualifiers="virtual"> + <return type="int"> + </return> + <description> + Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog. + Defining this method is [b]optional[/b]. If not overridden, no return icon is shown. + </description> + </method> + <method name="_get_subcategory" qualifiers="virtual"> + <return type="String"> + </return> + <description> + Override this method to define the subcategory of the associated custom node in the Visual Shader Editor's members dialog. + Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the root of the main category (see [method _get_category]). + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeGlobalExpression.xml b/doc/classes/VisualShaderNodeGlobalExpression.xml new file mode 100644 index 0000000000..3c5a26bf47 --- /dev/null +++ b/doc/classes/VisualShaderNodeGlobalExpression.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeGlobalExpression" inherits="VisualShaderNodeExpression" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeGroupBase.xml b/doc/classes/VisualShaderNodeGroupBase.xml index c2e9b9503b..d32a63d605 100644 --- a/doc/classes/VisualShaderNodeGroupBase.xml +++ b/doc/classes/VisualShaderNodeGroupBase.xml @@ -208,6 +208,10 @@ </description> </method> </methods> + <members> + <member name="editable" type="bool" setter="set_editable" getter="is_editable" default="false"> + </member> + </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeIs.xml b/doc/classes/VisualShaderNodeIs.xml new file mode 100644 index 0000000000..8db64b7cde --- /dev/null +++ b/doc/classes/VisualShaderNodeIs.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeIs" inherits="VisualShaderNode" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeIs.Function" default="0"> + </member> + </members> + <constants> + <constant name="FUNC_IS_INF" value="0" enum="Function"> + </constant> + <constant name="FUNC_IS_NAN" value="1" enum="Function"> + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeTexture.xml b/doc/classes/VisualShaderNodeTexture.xml index b3b89eb29b..f3bade9303 100644 --- a/doc/classes/VisualShaderNodeTexture.xml +++ b/doc/classes/VisualShaderNodeTexture.xml @@ -11,7 +11,7 @@ <members> <member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeTexture.Source" default="0"> </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> </member> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeTexture.TextureType" default="0"> </member> diff --git a/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml b/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml new file mode 100644 index 0000000000..d4e142651e --- /dev/null +++ b/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeTextureUniformTriplanar" inherits="VisualShaderNodeTextureUniform" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeVectorScalarMix.xml b/doc/classes/VisualShaderNodeVectorScalarMix.xml new file mode 100644 index 0000000000..d83c2e7d44 --- /dev/null +++ b/doc/classes/VisualShaderNodeVectorScalarMix.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeVectorScalarMix" inherits="VisualShaderNode" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/World.xml b/doc/classes/World.xml index adb3286c51..c8e6944b83 100644 --- a/doc/classes/World.xml +++ b/doc/classes/World.xml @@ -15,10 +15,10 @@ <member name="direct_space_state" type="PhysicsDirectSpaceState" setter="" getter="get_direct_space_state"> The World's physics direct space state, used for making various queries. Might be used only during [code]_physics_process[/code]. </member> - <member name="environment" type="Environment" setter="set_environment" getter="get_environment" default="null"> + <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The World's [Environment]. </member> - <member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment" default="null"> + <member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment"> The World's fallback_environment will be used if the World's [Environment] fails or is missing. </member> <member name="scenario" type="RID" setter="" getter="get_scenario"> diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml index a2a454d1b3..b4524bfea0 100644 --- a/doc/classes/WorldEnvironment.xml +++ b/doc/classes/WorldEnvironment.xml @@ -14,7 +14,7 @@ <methods> </methods> <members> - <member name="environment" type="Environment" setter="set_environment" getter="get_environment" default="null"> + <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The [Environment] resource used by this [WorldEnvironment], defining the default properties. </member> </members> diff --git a/doc/classes/X509Certificate.xml b/doc/classes/X509Certificate.xml new file mode 100644 index 0000000000..013f768843 --- /dev/null +++ b/doc/classes/X509Certificate.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="X509Certificate" inherits="Resource" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="load"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <description> + </description> + </method> + <method name="save"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 763c29ab4e..b42ae3ce01 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -347,6 +347,7 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S f = open(os.path.join(output_dir, "class_" + class_name.lower() + '.rst'), 'w', encoding='utf-8') # Warn contributors not to edit this file directly + f.write(":github_url: hide\n\n") f.write(".. Generated automatically by doc/tools/makerst.py in Godot's source tree.\n") f.write(".. DO NOT EDIT THIS FILE, but the " + class_name + ".xml source instead.\n") f.write(".. The source is found in doc/classes or modules/<name>/doc_classes.\n\n") diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp index 97d16d3a6a..3b06c47244 100644 --- a/drivers/coreaudio/audio_driver_coreaudio.cpp +++ b/drivers/coreaudio/audio_driver_coreaudio.cpp @@ -233,11 +233,11 @@ OSStatus AudioDriverCoreAudio::input_callback(void *inRefCon, if (result == noErr) { for (int i = 0; i < inNumberFrames * ad->capture_channels; i++) { int32_t sample = ad->input_buf[i] << 16; - ad->input_buffer_write(sample); + ad->capture_buffer_write(sample); if (ad->capture_channels == 1) { - // In case input device is single channel convert it to Stereo - ad->input_buffer_write(sample); + // In case capture device is single channel convert it to Stereo + ad->capture_buffer_write(sample); } } } else { @@ -487,7 +487,7 @@ void AudioDriverCoreAudio::capture_finish() { Error AudioDriverCoreAudio::capture_start() { - input_buffer_init(buffer_frames); + capture_buffer_init(buffer_frames); OSStatus result = AudioOutputUnitStart(input_unit); if (result != noErr) { @@ -642,9 +642,9 @@ void AudioDriverCoreAudio::_set_device(const String &device, bool capture) { ERR_FAIL_COND(result != noErr); if (capture) { - // Reset audio input to keep synchronisation. - input_position = 0; - input_size = 0; + // Reset audio capture to keep synchronisation. + capture_position = 0; + capture_size = 0; } } } diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index b82186162d..6be48a4c58 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -498,7 +498,16 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur Vector2(line->to.x, line->to.y) }; +#ifdef GLES_OVER_GL + if (line->antialiased) + glEnable(GL_LINE_SMOOTH); +#endif _draw_gui_primitive(2, verts, NULL, NULL); + +#ifdef GLES_OVER_GL + if (line->antialiased) + glDisable(GL_LINE_SMOOTH); +#endif } else { Vector2 t = (line->from - line->to).normalized().tangent() * line->width * 0.5; @@ -510,6 +519,19 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur }; _draw_gui_primitive(4, verts, NULL, NULL); +#ifdef GLES_OVER_GL + if (line->antialiased) { + glEnable(GL_LINE_SMOOTH); + for (int j = 0; j < 4; j++) { + Vector2 vertsl[2] = { + verts[j], + verts[(j + 1) % 4], + }; + _draw_gui_primitive(2, vertsl, NULL, NULL); + } + glDisable(GL_LINE_SMOOTH); + } +#endif } } break; @@ -919,6 +941,13 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur } _draw_polygon(polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1, polygon->weights.ptr(), polygon->bones.ptr()); +#ifdef GLES_OVER_GL + if (polygon->antialiased) { + glEnable(GL_LINE_SMOOTH); + _draw_generic(GL_LINE_LOOP, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1); + glDisable(GL_LINE_SMOOTH); + } +#endif } break; case Item::Command::TYPE_MESH: { @@ -1120,7 +1149,22 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur if (pline->triangles.size()) { _draw_generic(GL_TRIANGLE_STRIP, pline->triangles.size(), pline->triangles.ptr(), NULL, pline->triangle_colors.ptr(), pline->triangle_colors.size() == 1); +#ifdef GLES_OVER_GL + glEnable(GL_LINE_SMOOTH); + if (pline->multiline) { + //needs to be different + } else { + _draw_generic(GL_LINE_LOOP, pline->lines.size(), pline->lines.ptr(), NULL, pline->line_colors.ptr(), pline->line_colors.size() == 1); + } + glDisable(GL_LINE_SMOOTH); +#endif } else { + +#ifdef GLES_OVER_GL + if (pline->antialiased) + glEnable(GL_LINE_SMOOTH); +#endif + if (pline->multiline) { int todo = pline->lines.size() / 2; int max_per_call = data.polygon_buffer_size / (sizeof(real_t) * 4); @@ -1135,6 +1179,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur } else { _draw_generic(GL_LINES, pline->lines.size(), pline->lines.ptr(), NULL, pline->line_colors.ptr(), pline->line_colors.size() == 1); } + +#ifdef GLES_OVER_GL + if (pline->antialiased) + glDisable(GL_LINE_SMOOTH); +#endif } } break; @@ -1216,14 +1265,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur void RasterizerCanvasGLES2::_copy_screen(const Rect2 &p_rect) { if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_DIRECT_TO_SCREEN]) { - ERR_PRINT_ONCE("Cannot use screen texture copying in render target set to render direct to screen"); + ERR_PRINT_ONCE("Cannot use screen texture copying in render target set to render direct to screen."); return; } - if (storage->frame.current_rt->copy_screen_effect.color == 0) { - ERR_EXPLAIN("Can't use screen texture copying in a render target configured without copy buffers"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(storage->frame.current_rt->copy_screen_effect.color == 0, "Can't use screen texture copying in a render target configured without copy buffers."); glDisable(GL_BLEND); @@ -1601,6 +1647,7 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons //always re-set uniforms, since light parameters changed _set_uniforms(); + state.canvas_shader.use_material((void *)material_ptr); glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 4); RasterizerStorageGLES2::Texture *t = storage->texture_owner.getornull(light->texture); diff --git a/drivers/gles2/rasterizer_canvas_gles2.h b/drivers/gles2/rasterizer_canvas_gles2.h index af41e91e0c..ab636dca71 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.h +++ b/drivers/gles2/rasterizer_canvas_gles2.h @@ -84,7 +84,7 @@ public: Transform2D skeleton_transform; Transform2D skeleton_transform_inverse; - Vector2i skeleton_texture_size; + Size2i skeleton_texture_size; RID current_tex; RID current_normal; diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index ea29af7d9e..cc414c26af 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -880,7 +880,10 @@ RID RasterizerSceneGLES2::light_instance_create(RID p_light) { light_instance->light_index = 0xFFFF; - ERR_FAIL_COND_V(!light_instance->light_ptr, RID()); + if (!light_instance->light_ptr) { + memdelete(light_instance); + ERR_FAIL_V_MSG(RID(), "Condition ' !light_instance->light_ptr ' is true."); + } light_instance->self = light_instance_owner.make_rid(light_instance); @@ -1133,8 +1136,8 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G LightInstance *li = light_instance_owner.getornull(e->instance->light_instances[i]); - if (li->light_index >= render_light_instance_count) { - continue; // too many + if (li->light_index >= render_light_instance_count || render_light_instances[li->light_index] != li) { + continue; // too many or light_index did not correspond to the light instances to be rendered } if (copy) { @@ -1906,14 +1909,14 @@ void RasterizerSceneGLES2::_setup_light_type(LightInstance *p_light, ShadowAtlas } } -void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shadow_atlas, const Transform &p_view_transform) { +void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shadow_atlas, const Transform &p_view_transform, bool accum_pass) { RasterizerStorageGLES2::Light *light_ptr = light->light_ptr; //common parameters float energy = light_ptr->param[VS::LIGHT_PARAM_ENERGY]; float specular = light_ptr->param[VS::LIGHT_PARAM_SPECULAR]; - float sign = light_ptr->negative ? -1 : 1; + float sign = (light_ptr->negative && !accum_pass) ? -1 : 1; //inverse color for base pass lights only state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_SPECULAR, specular); Color color = light_ptr->color * sign * energy * Math_PI; @@ -1963,9 +1966,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado width /= 2; height /= 2; - if (k == 0) { - - } else if (k == 1) { + if (k == 1) { x += width; } else if (k == 2) { y += height; @@ -1978,9 +1979,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado height /= 2; - if (k == 0) { - - } else { + if (k != 0) { y += height; } } @@ -2287,19 +2286,6 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements, prev_unshaded = unshaded; } - bool depth_prepass = false; - - if (!p_alpha_pass && material->shader->spatial.depth_draw_mode == RasterizerStorageGLES2::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { - depth_prepass = true; - } - - if (depth_prepass != prev_depth_prepass) { - - state.scene_shader.set_conditional(SceneShaderGLES2::USE_DEPTH_PREPASS, depth_prepass); - prev_depth_prepass = depth_prepass; - rebind = true; - } - bool base_pass = !accum_pass && !unshaded; //conditions for a base pass if (base_pass != prev_base_pass) { @@ -2323,6 +2309,11 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements, if (accum_pass) { //accum pass force pass blend_mode = RasterizerStorageGLES2::Shader::Spatial::BLEND_MODE_ADD; + if (rebind_light && light && light->light_ptr->negative) { + glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + blend_mode = RasterizerStorageGLES2::Shader::Spatial::BLEND_MODE_SUB; + } } if (prev_blend_mode != blend_mode) { @@ -2434,6 +2425,19 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements, } } + bool depth_prepass = false; + + if (!p_alpha_pass && material->shader->spatial.depth_draw_mode == RasterizerStorageGLES2::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { + depth_prepass = true; + } + + if (depth_prepass != prev_depth_prepass) { + + state.scene_shader.set_conditional(SceneShaderGLES2::USE_DEPTH_PREPASS, depth_prepass); + prev_depth_prepass = depth_prepass; + rebind = true; + } + bool instancing = e->instance->base_type == VS::INSTANCE_MULTIMESH; if (instancing != prev_instancing) { @@ -2553,7 +2557,7 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements, } if (rebind_light && light) { - _setup_light(light, shadow_atlas, p_view_transform); + _setup_light(light, shadow_atlas, p_view_transform, accum_pass); } if (rebind_reflection && (refprobe_1 || refprobe_2)) { @@ -3171,9 +3175,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_ width /= 2; height /= 2; - if (p_pass == 0) { - - } else if (p_pass == 1) { + if (p_pass == 1) { x += width; } else if (p_pass == 2) { y += height; diff --git a/drivers/gles2/rasterizer_scene_gles2.h b/drivers/gles2/rasterizer_scene_gles2.h index c95385eb24..69a2295fc1 100644 --- a/drivers/gles2/rasterizer_scene_gles2.h +++ b/drivers/gles2/rasterizer_scene_gles2.h @@ -398,8 +398,8 @@ public: fog_transmit_enabled(true), fog_transmit_curve(1), fog_height_enabled(false), - fog_height_min(0), - fog_height_max(100), + fog_height_min(10), + fog_height_max(0), fog_height_curve(1) { } }; @@ -694,7 +694,7 @@ public: _FORCE_INLINE_ bool _setup_material(RasterizerStorageGLES2::Material *p_material, bool p_alpha_pass, Size2i p_skeleton_tex_size = Size2i(0, 0)); _FORCE_INLINE_ void _setup_geometry(RenderList::Element *p_element, RasterizerStorageGLES2::Skeleton *p_skeleton); _FORCE_INLINE_ void _setup_light_type(LightInstance *p_light, ShadowAtlas *shadow_atlas); - _FORCE_INLINE_ void _setup_light(LightInstance *p_light, ShadowAtlas *shadow_atlas, const Transform &p_view_transform); + _FORCE_INLINE_ void _setup_light(LightInstance *p_light, ShadowAtlas *shadow_atlas, const Transform &p_view_transform, bool accum_pass); _FORCE_INLINE_ void _setup_refprobes(ReflectionProbeInstance *p_refprobe1, ReflectionProbeInstance *p_refprobe2, const Transform &p_view_transform, Environment *p_env); _FORCE_INLINE_ void _render_geometry(RenderList::Element *p_element); diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index c591db4f3d..8e026b96ce 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -2171,8 +2171,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS: //must have index and bones, both. { uint32_t bones_weight = VS::ARRAY_FORMAT_BONES | VS::ARRAY_FORMAT_WEIGHTS; - ERR_EXPLAIN("Array must have both bones and weights in format or none."); - ERR_FAIL_COND((p_format & bones_weight) && (p_format & bones_weight) != bones_weight); + ERR_FAIL_COND_MSG((p_format & bones_weight) && (p_format & bones_weight) != bones_weight, "Array must have both bones and weights in format or none."); } //bool has_morph = p_blend_shapes.size(); @@ -3497,6 +3496,8 @@ RID RasterizerStorageGLES2::skeleton_create() { Skeleton *skeleton = memnew(Skeleton); + glGenTextures(1, &skeleton->tex_id); + return skeleton_owner.make_rid(skeleton); } @@ -3514,7 +3515,6 @@ void RasterizerStorageGLES2::skeleton_allocate(RID p_skeleton, int p_bones, bool skeleton->use_2d = p_2d_skeleton; if (config.float_texture_supported) { - glGenTextures(1, &skeleton->tex_id); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, skeleton->tex_id); @@ -3976,20 +3976,19 @@ AABB RasterizerStorageGLES2::light_get_aabb(RID p_light) const { float len = light->param[VS::LIGHT_PARAM_RANGE]; float size = Math::tan(Math::deg2rad(light->param[VS::LIGHT_PARAM_SPOT_ANGLE])) * len; return AABB(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len)); - } break; + }; case VS::LIGHT_OMNI: { float r = light->param[VS::LIGHT_PARAM_RANGE]; return AABB(-Vector3(r, r, r), Vector3(r, r, r) * 2); - } break; + }; case VS::LIGHT_DIRECTIONAL: { return AABB(); - } break; + }; } ERR_FAIL_V(AABB()); - return AABB(); } /* PROBE API */ @@ -5692,21 +5691,49 @@ void RasterizerStorageGLES2::initialize() { GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + glBindFramebuffer(GL_FRAMEBUFFER, system_fbo); + glDeleteFramebuffers(1, &fbo); + 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 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 + config.depth_internalformat = GL_DEPTH_COMPONENT16; config.depth_type = GL_UNSIGNED_SHORT; - } - glBindFramebuffer(GL_FRAMEBUFFER, system_fbo); - glDeleteFramebuffers(1, &fbo); - glBindTexture(GL_TEXTURE_2D, 0); - glDeleteTextures(1, &depth); + glGenFramebuffers(1, &fbo); + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + + glGenTextures(1, &depth); + glBindTexture(GL_TEXTURE_2D, depth); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, 32, 32, 0, GL_DEPTH_COMPONENT16, GL_UNSIGNED_SHORT, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depth, 0); + + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + //if it fails again depth textures aren't supported, use rgba shadows and renderbuffer for depth + config.support_depth_texture = false; + config.use_rgba_3d_shadows = true; + } + + glBindFramebuffer(GL_FRAMEBUFFER, system_fbo); + glDeleteFramebuffers(1, &fbo); + glBindTexture(GL_TEXTURE_2D, 0); + glDeleteTextures(1, &depth); + } } else { - // Will use renderbuffer for depth + // 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; diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index ee34a478b1..40574d8c77 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -449,7 +449,9 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener SL::VariableDeclarationNode *var_dec_node = (SL::VariableDeclarationNode *)p_node; StringBuffer<> declaration; - + if (var_dec_node->is_const) { + declaration += "const "; + } declaration += _prestr(var_dec_node->precision); declaration += _typestr(var_dec_node->datatype); @@ -510,7 +512,99 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener } } } break; + case SL::Node::TYPE_ARRAY_DECLARATION: { + + SL::ArrayDeclarationNode *arr_dec_node = (SL::ArrayDeclarationNode *)p_node; + + StringBuffer<> declaration; + if (arr_dec_node->is_const) { + declaration += "const "; + } + declaration += _prestr(arr_dec_node->precision); + declaration += _typestr(arr_dec_node->datatype); + + for (int i = 0; i < arr_dec_node->declarations.size(); i++) { + + if (i > 0) { + declaration += ","; + } + + declaration += " "; + + declaration += _mkid(arr_dec_node->declarations[i].name); + declaration += "["; + declaration += itos(arr_dec_node->declarations[i].size); + declaration += "]"; + int sz = arr_dec_node->declarations[i].initializer.size(); + if (sz > 0) { + declaration += "="; + declaration += _typestr(arr_dec_node->datatype); + declaration += "["; + declaration += itos(sz); + declaration += "]"; + declaration += "("; + for (int j = 0; j < sz; j++) { + declaration += _dump_node_code(arr_dec_node->declarations[i].initializer[j], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + if (j != sz - 1) { + declaration += ", "; + } + } + declaration += ")"; + } + } + + code += declaration.as_string(); + } break; + case SL::Node::TYPE_ARRAY: { + SL::ArrayNode *arr_node = (SL::ArrayNode *)p_node; + + if (p_assigning && p_actions.write_flag_pointers.has(arr_node->name)) { + *p_actions.write_flag_pointers[arr_node->name] = true; + } + + if (p_default_actions.usage_defines.has(arr_node->name) && !used_name_defines.has(arr_node->name)) { + String define = p_default_actions.usage_defines[arr_node->name]; + if (define.begins_with("@")) { + define = p_default_actions.usage_defines[define.substr(1, define.length())]; + } + + r_gen_code.custom_defines.push_back(define.utf8()); + used_name_defines.insert(arr_node->name); + } + + if (p_actions.usage_flag_pointers.has(arr_node->name) && !used_flag_pointers.has(arr_node->name)) { + *p_actions.usage_flag_pointers[arr_node->name] = true; + used_flag_pointers.insert(arr_node->name); + } + + if (p_default_actions.renames.has(arr_node->name)) { + code += p_default_actions.renames[arr_node->name]; + } else { + code += _mkid(arr_node->name); + } + + if (arr_node->call_expression != NULL) { + code += "."; + code += _dump_node_code(arr_node->call_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + } + + if (arr_node->index_expression != NULL) { + code += "["; + code += _dump_node_code(arr_node->index_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + code += "]"; + } + + if (arr_node->name == time_name) { + if (current_func_name == vertex_name) { + r_gen_code.uses_vertex_time = true; + } + if (current_func_name == fragment_name || current_func_name == light_name) { + r_gen_code.uses_fragment_time = true; + } + } + + } break; case SL::Node::TYPE_CONSTANT: { SL::ConstantNode *const_node = (SL::ConstantNode *)p_node; @@ -643,6 +737,17 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener code += ")"; + if (p_default_actions.usage_defines.has(var_node->name) && !used_name_defines.has(var_node->name)) { + String define = p_default_actions.usage_defines[var_node->name]; + + if (define.begins_with("@")) { + define = p_default_actions.usage_defines[define.substr(1, define.length())]; + } + + r_gen_code.custom_defines.push_back(define.utf8()); + used_name_defines.insert(var_node->name); + } + } break; case SL::OP_INDEX: { @@ -653,11 +758,13 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener } break; case SL::OP_SELECT_IF: { + code += "("; code += _dump_node_code(op_node->arguments[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); code += " ? "; code += _dump_node_code(op_node->arguments[1], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); code += " : "; code += _dump_node_code(op_node->arguments[2], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + code += ")"; } break; case SL::OP_MOD: { @@ -697,6 +804,14 @@ 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_DO) { + code += _mktab(p_level); + code += "do"; + code += _dump_node_code(cf_node->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning); + code += _mktab(p_level); + code += "while ("; + code += _dump_node_code(cf_node->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + code += ");"; } else if (cf_node->flow_op == SL::FLOW_OP_WHILE) { code += _mktab(p_level); code += "while ("; @@ -829,6 +944,23 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { actions[VS::SHADER_CANVAS_ITEM].usage_defines["LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n"; actions[VS::SHADER_CANVAS_ITEM].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n"; + // Ported from GLES3 + + actions[VS::SHADER_CANVAS_ITEM].usage_defines["sinh"] = "#define SINH_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["cosh"] = "#define COSH_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["tanh"] = "#define TANH_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["asinh"] = "#define ASINH_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["acosh"] = "#define ACOSH_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["atanh"] = "#define ATANH_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["determinant"] = "#define DETERMINANT_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["transpose"] = "#define TRANSPOSE_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["outerProduct"] = "#define OUTER_PRODUCT_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["round"] = "#define ROUND_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["roundEven"] = "#define ROUND_EVEN_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["isinf"] = "#define IS_INF_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["isnan"] = "#define IS_NAN_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["trunc"] = "#define TRUNC_USED\n"; + /** SPATIAL SHADER **/ actions[VS::SHADER_SPATIAL].renames["WORLD_MATRIX"] = "world_transform"; @@ -921,6 +1053,23 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { actions[VS::SHADER_SPATIAL].usage_defines["DIFFUSE_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n"; actions[VS::SHADER_SPATIAL].usage_defines["SPECULAR_LIGHT"] = "#define USE_LIGHT_SHADER_CODE\n"; + // Ported from GLES3 + + actions[VS::SHADER_SPATIAL].usage_defines["sinh"] = "#define SINH_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["cosh"] = "#define COSH_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["tanh"] = "#define TANH_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["asinh"] = "#define ASINH_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["acosh"] = "#define ACOSH_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["atanh"] = "#define ATANH_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["determinant"] = "#define DETERMINANT_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["transpose"] = "#define TRANSPOSE_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["outerProduct"] = "#define OUTER_PRODUCT_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["round"] = "#define ROUND_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["roundEven"] = "#define ROUND_EVEN_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["isinf"] = "#define IS_INF_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["isnan"] = "#define IS_NAN_USED\n"; + actions[VS::SHADER_SPATIAL].usage_defines["trunc"] = "#define TRUNC_USED\n"; + actions[VS::SHADER_SPATIAL].render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["world_vertex_coords"] = "#define VERTEX_WORLD_COORDS_USED\n"; diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index 0818942b0a..fa0b315e29 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -258,6 +258,8 @@ precision mediump int; #endif #endif +#include "stdlib.glsl" + uniform sampler2D color_texture; // texunit:-1 /* clang-format on */ uniform highp vec2 color_texpixel_size; @@ -489,8 +491,7 @@ FRAGMENT_SHADER_CODE highp float shadow_attenuation = 0.0; #ifdef USE_RGBA_SHADOWS - -#define SHADOW_DEPTH(m_tex, m_uv) dot(texture2D((m_tex), (m_uv)), vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) +#define SHADOW_DEPTH(m_tex, m_uv) dot(texture2D((m_tex), (m_uv)), vec4(1.0 / (255.0 * 255.0 * 255.0), 1.0 / (255.0 * 255.0), 1.0 / 255.0, 1.0)) #else diff --git a/drivers/gles2/shaders/canvas_shadow.glsl b/drivers/gles2/shaders/canvas_shadow.glsl index 01b2c59325..dcb43d523f 100644 --- a/drivers/gles2/shaders/canvas_shadow.glsl +++ b/drivers/gles2/shaders/canvas_shadow.glsl @@ -47,8 +47,8 @@ void main() { #ifdef USE_RGBA_SHADOWS - highp vec4 comp = fract(depth * vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0)); - comp -= comp.xxyz * vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0); + highp vec4 comp = fract(depth * vec4(255.0 * 255.0 * 255.0, 255.0 * 255.0, 255.0, 1.0)); + comp -= comp.xxyz * vec4(0.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0); gl_FragColor = comp; #else diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index ca222362e7..8a9387f0b3 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -10,7 +10,9 @@ precision highp float; precision highp int; #endif +/* clang-format on */ #include "stdlib.glsl" +/* clang-format off */ #define SHADER_IS_SRGB true @@ -1365,7 +1367,7 @@ LIGHT_SHADER_CODE #ifdef USE_RGBA_SHADOWS -#define SHADOW_DEPTH(m_val) dot(m_val, vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) +#define SHADOW_DEPTH(m_val) dot(m_val, vec4(1.0 / (255.0 * 255.0 * 255.0), 1.0 / (255.0 * 255.0), 1.0 / 255.0, 1.0)) #else @@ -1549,7 +1551,7 @@ FRAGMENT_SHADER_CODE #endif // ALPHA_SCISSOR_USED #ifdef USE_DEPTH_PREPASS - if (alpha < 0.99) { + if (alpha < 0.1) { discard; } #endif // USE_DEPTH_PREPASS @@ -2112,7 +2114,7 @@ FRAGMENT_SHADER_CODE #endif // ALPHA_SCISSOR_USED #ifdef USE_DEPTH_PREPASS - if (alpha < 0.99) { + if (alpha < 0.1) { discard; } #endif // USE_DEPTH_PREPASS @@ -2207,8 +2209,8 @@ FRAGMENT_SHADER_CODE #ifdef USE_RGBA_SHADOWS highp float depth = ((position_interp.z / position_interp.w) + 1.0) * 0.5 + 0.0; // bias - highp vec4 comp = fract(depth * vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0)); - comp -= comp.xxyz * vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0); + highp vec4 comp = fract(depth * vec4(255.0 * 255.0 * 255.0, 255.0 * 255.0, 255.0, 1.0)); + comp -= comp.xxyz * vec4(0.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0); gl_FragColor = comp; #endif diff --git a/drivers/gles2/shaders/stdlib.glsl b/drivers/gles2/shaders/stdlib.glsl index 3674d70c9f..96421fcb4a 100644 --- a/drivers/gles2/shaders/stdlib.glsl +++ b/drivers/gles2/shaders/stdlib.glsl @@ -36,12 +36,310 @@ highp vec4 texel2DFetch(highp sampler2D tex, ivec2 size, ivec2 coord) { return texture2DLod(tex, vec2(x_coord, y_coord), 0.0); } +#if defined(SINH_USED) + +highp float sinh(highp float x) { + return 0.5 * (exp(x) - exp(-x)); +} + +highp vec2 sinh(highp vec2 x) { + return 0.5 * vec2(exp(x.x) - exp(-x.x), exp(x.y) - exp(-x.y)); +} + +highp vec3 sinh(highp vec3 x) { + return 0.5 * vec3(exp(x.x) - exp(-x.x), exp(x.y) - exp(-x.y), exp(x.z) - exp(-x.z)); +} + +highp vec4 sinh(highp vec4 x) { + return 0.5 * vec4(exp(x.x) - exp(-x.x), exp(x.y) - exp(-x.y), exp(x.z) - exp(-x.z), exp(x.w) - exp(-x.w)); +} + +#endif + +#if defined(COSH_USED) + +highp float cosh(highp float x) { + return 0.5 * (exp(x) + exp(-x)); +} + +highp vec2 cosh(highp vec2 x) { + return 0.5 * vec2(exp(x.x) + exp(-x.x), exp(x.y) + exp(-x.y)); +} + +highp vec3 cosh(highp vec3 x) { + return 0.5 * vec3(exp(x.x) + exp(-x.x), exp(x.y) + exp(-x.y), exp(x.z) + exp(-x.z)); +} + +highp vec4 cosh(highp vec4 x) { + return 0.5 * vec4(exp(x.x) + exp(-x.x), exp(x.y) + exp(-x.y), exp(x.z) + exp(-x.z), exp(x.w) + exp(-x.w)); +} + +#endif + +#if defined(TANH_USED) + +highp float tanh(highp float x) { + highp float exp2x = exp(2.0 * x); + return (exp2x - 1.0) / (exp2x + 1.0); +} + +highp vec2 tanh(highp vec2 x) { + highp float exp2x = exp(2.0 * x.x); + highp float exp2y = exp(2.0 * x.y); + return vec2((exp2x - 1.0) / (exp2x + 1.0), (exp2y - 1.0) / (exp2y + 1.0)); +} + +highp vec3 tanh(highp vec3 x) { + highp float exp2x = exp(2.0 * x.x); + highp float exp2y = exp(2.0 * x.y); + highp float exp2z = exp(2.0 * x.z); + return vec3((exp2x - 1.0) / (exp2x + 1.0), (exp2y - 1.0) / (exp2y + 1.0), (exp2z - 1.0) / (exp2z + 1.0)); +} + +highp vec4 tanh(highp vec4 x) { + highp float exp2x = exp(2.0 * x.x); + highp float exp2y = exp(2.0 * x.y); + highp float exp2z = exp(2.0 * x.z); + highp float exp2w = exp(2.0 * x.w); + return vec4((exp2x - 1.0) / (exp2x + 1.0), (exp2y - 1.0) / (exp2y + 1.0), (exp2z - 1.0) / (exp2z + 1.0), (exp2w - 1.0) / (exp2w + 1.0)); +} + +#endif + +#if defined(ASINH_USED) + +highp float asinh(highp float x) { + return sign(x) * log(abs(x) + sqrt(1.0 + x * x)); +} + +highp vec2 asinh(highp vec2 x) { + return vec2(sign(x.x) * log(abs(x.x) + sqrt(1.0 + x.x * x.x)), sign(x.y) * log(abs(x.y) + sqrt(1.0 + x.y * x.y))); +} + +highp vec3 asinh(highp vec3 x) { + return vec3(sign(x.x) * log(abs(x.x) + sqrt(1.0 + x.x * x.x)), sign(x.y) * log(abs(x.y) + sqrt(1.0 + x.y * x.y)), sign(x.z) * log(abs(x.z) + sqrt(1.0 + x.z * x.z))); +} + +highp vec4 asinh(highp vec4 x) { + return vec4(sign(x.x) * log(abs(x.x) + sqrt(1.0 + x.x * x.x)), sign(x.y) * log(abs(x.y) + sqrt(1.0 + x.y * x.y)), sign(x.z) * log(abs(x.z) + sqrt(1.0 + x.z * x.z)), sign(x.w) * log(abs(x.w) + sqrt(1.0 + x.w * x.w))); +} + +#endif + +#if defined(ACOSH_USED) + +highp float acosh(highp float x) { + return log(x + sqrt(x * x - 1.0)); +} + +highp vec2 acosh(highp vec2 x) { + return vec2(log(x.x + sqrt(x.x * x.x - 1.0)), log(x.y + sqrt(x.y * x.y - 1.0))); +} + +highp vec3 acosh(highp vec3 x) { + return vec3(log(x.x + sqrt(x.x * x.x - 1.0)), log(x.y + sqrt(x.y * x.y - 1.0)), log(x.z + sqrt(x.z * x.z - 1.0))); +} + +highp vec4 acosh(highp vec4 x) { + return vec4(log(x.x + sqrt(x.x * x.x - 1.0)), log(x.y + sqrt(x.y * x.y - 1.0)), log(x.z + sqrt(x.z * x.z - 1.0)), log(x.w + sqrt(x.w * x.w - 1.0))); +} + +#endif + +#if defined(ATANH_USED) + +highp float atanh(highp float x) { + return 0.5 * log((1.0 + x) / (1.0 - x)); +} + +highp vec2 atanh(highp vec2 x) { + return 0.5 * vec2(log((1.0 + x.x) / (1.0 - x.x)), log((1.0 + x.y) / (1.0 - x.y))); +} + +highp vec3 atanh(highp vec3 x) { + return 0.5 * vec3(log((1.0 + x.x) / (1.0 - x.x)), log((1.0 + x.y) / (1.0 - x.y)), log((1.0 + x.z) / (1.0 - x.z))); +} + +highp vec4 atanh(highp vec4 x) { + return 0.5 * vec4(log((1.0 + x.x) / (1.0 - x.x)), log((1.0 + x.y) / (1.0 - x.y)), log((1.0 + x.z) / (1.0 - x.z)), log((1.0 + x.w) / (1.0 - x.w))); +} + +#endif + +#if defined(ROUND_USED) + +highp float round(highp float x) { + return floor(x + 0.5); +} + +highp vec2 round(highp vec2 x) { + return floor(x + vec2(0.5)); +} + +highp vec3 round(highp vec3 x) { + return floor(x + vec3(0.5)); +} + +highp vec4 round(highp vec4 x) { + return floor(x + vec4(0.5)); +} + +#endif + +#if defined(ROUND_EVEN_USED) + +highp float roundEven(highp float x) { + highp float t = x + 0.5; + highp float f = floor(t); + highp float r; + if (t == f) { + if (x > 0) + r = f - mod(f, 2); + else + r = f + mod(f, 2); + } else + r = f; + return r; +} + +highp vec2 roundEven(highp vec2 x) { + return vec2(roundEven(x.x), roundEven(x.y)); +} + +highp vec3 roundEven(highp vec3 x) { + return vec3(roundEven(x.x), roundEven(x.y), roundEven(x.z)); +} + +highp vec4 roundEven(highp vec4 x) { + return vec4(roundEven(x.x), roundEven(x.y), roundEven(x.z), roundEven(x.w)); +} + +#endif + +#if defined(IS_INF_USED) + +bool isinf(highp float x) { + return (2 * x == x) && (x != 0); +} + +bvec2 isinf(highp vec2 x) { + return bvec2((2 * x.x == x.x) && (x.x != 0), (2 * x.y == x.y) && (x.y != 0)); +} + +bvec3 isinf(highp vec3 x) { + return bvec3((2 * x.x == x.x) && (x.x != 0), (2 * x.y == x.y) && (x.y != 0), (2 * x.z == x.z) && (x.z != 0)); +} + +bvec4 isinf(highp vec4 x) { + return bvec4((2 * x.x == x.x) && (x.x != 0), (2 * x.y == x.y) && (x.y != 0), (2 * x.z == x.z) && (x.z != 0), (2 * x.w == x.w) && (x.w != 0)); +} + +#endif + +#if defined(IS_NAN_USED) + +bool isnan(highp float x) { + return x != x; +} + +bvec2 isnan(highp vec2 x) { + return bvec2(x.x != x.x, x.y != x.y); +} + +bvec3 isnan(highp vec3 x) { + return bvec3(x.x != x.x, x.y != x.y, x.z != x.z); +} + +bvec4 isnan(highp vec4 x) { + return bvec4(x.x != x.x, x.y != x.y, x.z != x.z, x.w != x.w); +} + +#endif + +#if defined(TRUNC_USED) + +highp float trunc(highp float x) { + return x < 0 ? -floor(-x) : floor(x); +} + +highp vec2 trunc(highp vec2 x) { + return vec2(x.x < 0 ? -floor(-x.x) : floor(x.x), x.y < 0 ? -floor(-x.y) : floor(x.y)); +} + +highp vec3 trunc(highp vec3 x) { + return vec3(x.x < 0 ? -floor(-x.x) : floor(x.x), x.y < 0 ? -floor(-x.y) : floor(x.y), x.z < 0 ? -floor(-x.z) : floor(x.z)); +} + +highp vec4 trunc(highp vec4 x) { + return vec4(x.x < 0 ? -floor(-x.x) : floor(x.x), x.y < 0 ? -floor(-x.y) : floor(x.y), x.z < 0 ? -floor(-x.z) : floor(x.z), x.w < 0 ? -floor(-x.w) : floor(x.w)); +} + +#endif + +#if defined(DETERMINANT_USED) + +highp float determinant(highp mat2 m) { + return m[0].x * m[1].y - m[1].x * m[0].y; +} + +highp float determinant(highp mat3 m) { + return m[0].x * (m[1].y * m[2].z - m[2].y * m[1].z) - m[1].x * (m[0].y * m[2].z - m[2].y * m[0].z) + m[2].x * (m[0].y * m[1].z - m[1].y * m[0].z); +} + +highp float determinant(highp mat4 m) { + highp float s00 = m[2].z * m[3].w - m[3].z * m[2].w; + highp float s01 = m[2].y * m[3].w - m[3].y * m[2].w; + highp float s02 = m[2].y * m[3].z - m[3].y * m[2].z; + highp float s03 = m[2].x * m[3].w - m[3].x * m[2].w; + highp float s04 = m[2].x * m[3].z - m[3].x * m[2].z; + highp float s05 = m[2].x * m[3].y - m[3].x * m[2].y; + highp vec4 c = vec4((m[1].y * s00 - m[1].z * s01 + m[1].w * s02), -(m[1].x * s00 - m[1].z * s03 + m[1].w * s04), (m[1].x * s01 - m[1].y * s03 + m[1].w * s05), -(m[1].x * s02 - m[1].y * s04 + m[1].z * s05)); + return m[0].x * c.x + m[0].y * c.y + m[0].z * c.z + m[0].w * c.w; +} + +#endif + #ifndef USE_GLES_OVER_GL -highp mat4 transpose(highp mat4 src) { + +#if defined(TRANSPOSE_USED) + +highp mat2 transpose(highp mat2 m) { + return mat2( + vec2(m[0].x, m[1].x), + vec2(m[0].y, m[1].y)); +} + +highp mat3 transpose(highp mat3 m) { + return mat3( + vec3(m[0].x, m[1].x, m[2].x), + vec3(m[0].y, m[1].y, m[2].y), + vec3(m[0].z, m[1].z, m[2].z)); +} + +#endif + +highp mat4 transpose(highp mat4 m) { return mat4( - vec4(src[0].x, src[1].x, src[2].x, src[3].x), - vec4(src[0].y, src[1].y, src[2].y, src[3].y), - vec4(src[0].z, src[1].z, src[2].z, src[3].z), - vec4(src[0].w, src[1].w, src[2].w, src[3].w)); + vec4(m[0].x, m[1].x, m[2].x, m[3].x), + vec4(m[0].y, m[1].y, m[2].y, m[3].y), + vec4(m[0].z, m[1].z, m[2].z, m[3].z), + vec4(m[0].w, m[1].w, m[2].w, m[3].w)); +} + +#if defined(OUTER_PRODUCT_USED) + +highp mat2 outerProduct(highp vec2 c, highp vec2 r) { + return mat2(c * r.x, c * r.y); } + +highp mat3 outerProduct(highp vec3 c, highp vec3 r) { + return mat3(c * r.x, c * r.y, c * r.z); +} + +highp mat4 outerProduct(highp vec4 c, highp vec4 r) { + return mat4(c * r.x, c * r.y, c * r.z, c * r.w); +} + +#endif + #endif diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index eb5ab53421..edffe852a2 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -200,6 +200,8 @@ void RasterizerCanvasGLES3::canvas_end() { glBindBufferBase(GL_UNIFORM_BUFFER, 0, 0); glColorMask(1, 1, 1, 1); + glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1); + state.using_texture_rect = false; state.using_ninepatch = false; } @@ -1154,10 +1156,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur void RasterizerCanvasGLES3::_copy_texscreen(const Rect2 &p_rect) { - if (storage->frame.current_rt->effects.mip_maps[0].sizes.size() == 0) { - ERR_EXPLAIN("Can't use screen texture copying in a render target configured without copy buffers"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(storage->frame.current_rt->effects.mip_maps[0].sizes.size() == 0, "Can't use screen texture copying in a render target configured without copy buffers."); glDisable(GL_BLEND); @@ -1585,6 +1584,11 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE, state.canvas_item_modulate); state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX, state.final_transform); state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX, Transform2D()); + if (storage->frame.current_rt) { + state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0 / storage->frame.current_rt->width, 1.0 / storage->frame.current_rt->height)); + } else { + state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0, 1.0)); + } } glBindBufferBase(GL_UNIFORM_BUFFER, 1, static_cast<LightInternal *>(light->light_internal.get_data())->ubo); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index fb3d154a7a..1472954ebc 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1008,7 +1008,7 @@ RID RasterizerSceneGLES3::light_instance_create(RID p_light) { if (!light_instance->light_ptr) { memdelete(light_instance); - ERR_FAIL_COND_V(!light_instance->light_ptr, RID()); + ERR_FAIL_V_MSG(RID(), "Condition ' !light_instance->light_ptr ' is true."); } light_instance->self = light_instance_owner.make_rid(light_instance); @@ -1120,13 +1120,23 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m if (state.current_depth_draw != p_material->shader->spatial.depth_draw_mode) { switch (p_material->shader->spatial.depth_draw_mode) { - case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS: + case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS: { + glDepthMask(GL_TRUE); + // If some transparent objects write to depth, we need to re-copy depth texture when we need it + if (p_alpha_pass && !state.used_depth_prepass) { + state.prepared_depth_texture = false; + } + } break; case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_OPAQUE: { glDepthMask(!p_alpha_pass); } break; case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALWAYS: { glDepthMask(GL_TRUE); + // If some transparent objects write to depth, we need to re-copy depth texture when we need it + if (p_alpha_pass) { + state.prepared_depth_texture = false; + } } break; case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER: { glDepthMask(GL_FALSE); @@ -2364,7 +2374,7 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G if (p_depth_pass) { - if (has_blend_alpha || p_material->shader->spatial.uses_depth_texture || (has_base_alpha && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) || p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER || p_material->shader->spatial.no_depth_test) + if (has_blend_alpha || p_material->shader->spatial.uses_depth_texture || (has_base_alpha && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) || p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER || p_material->shader->spatial.no_depth_test || p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_OFF) return; //bye if (!p_material->shader->spatial.uses_alpha_scissor && !p_material->shader->spatial.writes_modelview_or_projection && !p_material->shader->spatial.uses_vertex && !p_material->shader->spatial.uses_discard && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { @@ -2763,9 +2773,7 @@ void RasterizerSceneGLES3::_setup_directional_light(int p_index, const Transform width /= 2; height /= 2; - if (j == 0) { - - } else if (j == 1) { + if (j == 1) { x += width; } else if (j == 2) { y += height; @@ -2778,9 +2786,7 @@ void RasterizerSceneGLES3::_setup_directional_light(int p_index, const Transform height /= 2; - if (j == 0) { - - } else { + if (j != 0) { y += height; } } @@ -2827,7 +2833,7 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c for (int i = 0; i < p_light_cull_count; i++) { - ERR_BREAK(i >= RenderList::MAX_LIGHTS); + ERR_BREAK(i >= render_list.max_lights); LightInstance *li = light_instance_owner.getptr(p_light_cull_result[i]); @@ -4192,7 +4198,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const for (int i = 0; i < p_light_cull_count; i++) { - ERR_BREAK(i >= RenderList::MAX_LIGHTS); + ERR_BREAK(i >= render_list.max_lights); LightInstance *li = light_instance_owner.getptr(p_light_cull_result[i]); if (li->light_ptr->param[VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE] > CMP_EPSILON) { @@ -4619,6 +4625,8 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const return; } + if (env && (env->dof_blur_far_enabled || env->dof_blur_near_enabled) && storage->frame.current_rt && storage->frame.current_rt->buffers.active) + _prepare_depth_texture(); _post_process(env, p_cam_projection); // Needed only for debugging /* if (shadow_atlas && storage->frame.current_rt) { @@ -4741,9 +4749,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_ width /= 2; height /= 2; - if (p_pass == 0) { - - } else if (p_pass == 1) { + if (p_pass == 1) { x += width; } else if (p_pass == 2) { y += height; @@ -5069,6 +5075,10 @@ void RasterizerSceneGLES3::initialize() { render_list.max_elements = GLOBAL_DEF_RST("rendering/limits/rendering/max_renderable_elements", (int)RenderList::DEFAULT_MAX_ELEMENTS); ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/rendering/max_renderable_elements", PropertyInfo(Variant::INT, "rendering/limits/rendering/max_renderable_elements", PROPERTY_HINT_RANGE, "1024,1000000,1")); + render_list.max_lights = GLOBAL_DEF("rendering/limits/rendering/max_renderable_lights", (int)RenderList::DEFAULT_MAX_LIGHTS); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/rendering/max_renderable_lights", PropertyInfo(Variant::INT, "rendering/limits/rendering/max_renderable_lights", PROPERTY_HINT_RANGE, "16,4096,1")); + render_list.max_reflections = GLOBAL_DEF("rendering/limits/rendering/max_renderable_reflections", (int)RenderList::DEFAULT_MAX_REFLECTIONS); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/rendering/max_renderable_reflections", PropertyInfo(Variant::INT, "rendering/limits/rendering/max_renderable_reflections", PROPERTY_HINT_RANGE, "8,1024,1")); { //quad buffers @@ -5163,7 +5173,7 @@ void RasterizerSceneGLES3::initialize() { glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &max_ubo_size); const int ubo_light_size = 160; state.ubo_light_size = ubo_light_size; - state.max_ubo_lights = MIN(RenderList::MAX_LIGHTS, max_ubo_size / ubo_light_size); + state.max_ubo_lights = MIN(render_list.max_lights, max_ubo_size / ubo_light_size); state.spot_array_tmp = (uint8_t *)memalloc(ubo_light_size * state.max_ubo_lights); state.omni_array_tmp = (uint8_t *)memalloc(ubo_light_size * state.max_ubo_lights); @@ -5188,7 +5198,7 @@ void RasterizerSceneGLES3::initialize() { state.scene_shader.add_custom_define("#define MAX_LIGHT_DATA_STRUCTS " + itos(state.max_ubo_lights) + "\n"); state.scene_shader.add_custom_define("#define MAX_FORWARD_LIGHTS " + itos(state.max_forward_lights_per_object) + "\n"); - state.max_ubo_reflections = MIN((int)RenderList::MAX_REFLECTIONS, max_ubo_size / sizeof(ReflectionProbeDataUBO)); + state.max_ubo_reflections = MIN(render_list.max_reflections, max_ubo_size / (int)sizeof(ReflectionProbeDataUBO)); state.reflection_array_tmp = (uint8_t *)memalloc(sizeof(ReflectionProbeDataUBO) * state.max_ubo_reflections); @@ -5301,7 +5311,7 @@ void RasterizerSceneGLES3::initialize() { GLOBAL_DEF("rendering/quality/subsurface_scattering/follow_surface", false); GLOBAL_DEF("rendering/quality/subsurface_scattering/weight_samples", true); - GLOBAL_DEF("rendering/quality/voxel_cone_tracing/high_quality", true); + GLOBAL_DEF("rendering/quality/voxel_cone_tracing/high_quality", false); } exposure_shrink_size = 243; diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 910f90edc2..3d09adcfeb 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -527,8 +527,8 @@ public: fog_transmit_enabled(true), fog_transmit_curve(1), fog_height_enabled(false), - fog_height_min(0), - fog_height_max(100), + fog_height_min(10), + fog_height_max(0), fog_height_curve(1) { } }; @@ -669,8 +669,8 @@ public: SORT_FLAG_SKELETON = 1, SORT_FLAG_INSTANCING = 2, MAX_DIRECTIONAL_LIGHTS = 16, - MAX_LIGHTS = 4096, - MAX_REFLECTIONS = 1024, + DEFAULT_MAX_LIGHTS = 4096, + DEFAULT_MAX_REFLECTIONS = 1024, SORT_KEY_PRIORITY_SHIFT = 56, SORT_KEY_PRIORITY_MASK = 0xFF, @@ -701,6 +701,8 @@ public: }; int max_elements; + int max_lights; + int max_reflections; struct Element { @@ -813,6 +815,8 @@ public: RenderList() { max_elements = DEFAULT_MAX_ELEMENTS; + max_lights = DEFAULT_MAX_LIGHTS; + max_reflections = DEFAULT_MAX_REFLECTIONS; } ~RenderList() { diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 994ed25f01..a54064e4c8 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2522,8 +2522,8 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy int v = value; GLuint *gui = (GLuint *)data; - gui[0] = v & 1 ? GL_TRUE : GL_FALSE; - gui[1] = v & 2 ? GL_TRUE : GL_FALSE; + gui[0] = (v & 1) ? GL_TRUE : GL_FALSE; + gui[1] = (v & 2) ? GL_TRUE : GL_FALSE; } break; case ShaderLanguage::TYPE_BVEC3: { @@ -3191,8 +3191,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS: //must have index and bones, both. { uint32_t bones_weight = VS::ARRAY_FORMAT_BONES | VS::ARRAY_FORMAT_WEIGHTS; - ERR_EXPLAIN("Array must have both bones and weights in format or none."); - ERR_FAIL_COND((p_format & bones_weight) && (p_format & bones_weight) != bones_weight); + ERR_FAIL_COND_MSG((p_format & bones_weight) && (p_format & bones_weight) != bones_weight, "Array must have both bones and weights in format or none."); } //bool has_morph = p_blend_shapes.size(); @@ -5471,22 +5470,19 @@ AABB RasterizerStorageGLES3::light_get_aabb(RID p_light) const { float len = light->param[VS::LIGHT_PARAM_RANGE]; float size = Math::tan(Math::deg2rad(light->param[VS::LIGHT_PARAM_SPOT_ANGLE])) * len; return AABB(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len)); - } break; + }; case VS::LIGHT_OMNI: { float r = light->param[VS::LIGHT_PARAM_RANGE]; return AABB(-Vector3(r, r, r), Vector3(r, r, r) * 2); - } break; + }; case VS::LIGHT_DIRECTIONAL: { return AABB(); - } break; - default: { - } + }; } ERR_FAIL_V(AABB()); - return AABB(); } /* PROBE API */ @@ -8096,7 +8092,7 @@ void RasterizerStorageGLES3::initialize() { glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &config.max_texture_image_units); glGetIntegerv(GL_MAX_TEXTURE_SIZE, &config.max_texture_size); - config.use_rgba_2d_shadows = config.framebuffer_float_supported; + config.use_rgba_2d_shadows = !config.framebuffer_float_supported; //generic quadie for copying diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index b0f0a71d56..85ace4b4f0 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -555,7 +555,12 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener case SL::Node::TYPE_VARIABLE_DECLARATION: { SL::VariableDeclarationNode *vdnode = (SL::VariableDeclarationNode *)p_node; - String declaration = _prestr(vdnode->precision) + _typestr(vdnode->datatype); + String declaration; + if (vdnode->is_const) { + declaration += "const "; + } + declaration += _prestr(vdnode->precision); + declaration += _typestr(vdnode->datatype); for (int i = 0; i < vdnode->declarations.size(); i++) { if (i > 0) { declaration += ","; @@ -607,6 +612,93 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener } } break; + case SL::Node::TYPE_ARRAY_DECLARATION: { + + SL::ArrayDeclarationNode *adnode = (SL::ArrayDeclarationNode *)p_node; + + String declaration; + if (adnode->is_const) { + declaration += "const "; + } + declaration += _prestr(adnode->precision); + declaration += _typestr(adnode->datatype); + for (int i = 0; i < adnode->declarations.size(); i++) { + if (i > 0) { + declaration += ","; + } else { + declaration += " "; + } + declaration += _mkid(adnode->declarations[i].name); + declaration += "["; + declaration += itos(adnode->declarations[i].size); + declaration += "]"; + int sz = adnode->declarations[i].initializer.size(); + if (sz > 0) { + declaration += "="; + declaration += _typestr(adnode->datatype); + declaration += "["; + declaration += itos(sz); + declaration += "]"; + declaration += "("; + for (int j = 0; j < sz; j++) { + declaration += _dump_node_code(adnode->declarations[i].initializer[j], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + if (j != sz - 1) { + declaration += ", "; + } + } + declaration += ")"; + } + } + + code += declaration; + } break; + case SL::Node::TYPE_ARRAY: { + SL::ArrayNode *anode = (SL::ArrayNode *)p_node; + + if (p_assigning && p_actions.write_flag_pointers.has(anode->name)) { + *p_actions.write_flag_pointers[anode->name] = true; + } + + if (p_default_actions.usage_defines.has(anode->name) && !used_name_defines.has(anode->name)) { + String define = p_default_actions.usage_defines[anode->name]; + if (define.begins_with("@")) { + define = p_default_actions.usage_defines[define.substr(1, define.length())]; + } + r_gen_code.defines.push_back(define.utf8()); + used_name_defines.insert(anode->name); + } + + if (p_actions.usage_flag_pointers.has(anode->name) && !used_flag_pointers.has(anode->name)) { + *p_actions.usage_flag_pointers[anode->name] = true; + used_flag_pointers.insert(anode->name); + } + + if (p_default_actions.renames.has(anode->name)) + code = p_default_actions.renames[anode->name]; + else + code = _mkid(anode->name); + + if (anode->call_expression != NULL) { + code += "."; + code += _dump_node_code(anode->call_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + } + + if (anode->index_expression != NULL) { + code += "["; + code += _dump_node_code(anode->index_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + code += "]"; + } + + if (anode->name == time_name) { + if (current_func_name == vertex_name) { + r_gen_code.uses_vertex_time = true; + } + if (current_func_name == fragment_name || current_func_name == light_name) { + r_gen_code.uses_fragment_time = true; + } + } + + } break; case SL::Node::TYPE_CONSTANT: { SL::ConstantNode *cnode = (SL::ConstantNode *)p_node; return get_constant_text(cnode->datatype, cnode->values); @@ -680,11 +772,13 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener } break; case SL::OP_SELECT_IF: { + code += "("; code += _dump_node_code(onode->arguments[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); code += "?"; code += _dump_node_code(onode->arguments[1], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); code += ":"; code += _dump_node_code(onode->arguments[2], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + code += ")"; } break; @@ -707,6 +801,11 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener code += _mktab(p_level) + "else\n"; code += _dump_node_code(cfnode->blocks[1], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning); } + } else if (cfnode->flow_op == SL::FLOW_OP_DO) { + code += _mktab(p_level) + "do"; + code += _dump_node_code(cfnode->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions, p_assigning); + code += _mktab(p_level) + "while (" + _dump_node_code(cfnode->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + ");"; + } else if (cfnode->flow_op == SL::FLOW_OP_WHILE) { code += _mktab(p_level) + "while (" + _dump_node_code(cfnode->expressions[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + ")\n"; diff --git a/drivers/gles3/shader_gles3.h b/drivers/gles3/shader_gles3.h index be2c34ba07..d8d49868f4 100644 --- a/drivers/gles3/shader_gles3.h +++ b/drivers/gles3/shader_gles3.h @@ -45,10 +45,6 @@ #include <stdio.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class ShaderGLES3 { protected: struct Enum { diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index a46b31c92e..10c8764b8e 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -597,7 +597,7 @@ FRAGMENT_SHADER_CODE #ifdef USE_RGBA_SHADOWS -#define SHADOW_DEPTH(m_tex, m_uv) dot(texture((m_tex), (m_uv)), vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) +#define SHADOW_DEPTH(m_tex, m_uv) dot(texture((m_tex), (m_uv)), vec4(1.0 / (255.0 * 255.0 * 255.0), 1.0 / (255.0 * 255.0), 1.0 / 255.0, 1.0)) #else diff --git a/drivers/gles3/shaders/canvas_shadow.glsl b/drivers/gles3/shaders/canvas_shadow.glsl index 13fff7f4d1..4f706c5505 100644 --- a/drivers/gles3/shaders/canvas_shadow.glsl +++ b/drivers/gles3/shaders/canvas_shadow.glsl @@ -35,8 +35,8 @@ void main() { #ifdef USE_RGBA_SHADOWS - highp vec4 comp = fract(depth * vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0)); - comp -= comp.xxyz * vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0); + highp vec4 comp = fract(depth * vec4(255.0 * 255.0 * 255.0, 255.0 * 255.0, 255.0, 1.0)); + comp -= comp.xxyz * vec4(0.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0); distance_buf = comp; #else diff --git a/drivers/gles3/shaders/copy.glsl b/drivers/gles3/shaders/copy.glsl index 232b9ce7c0..1952e201aa 100644 --- a/drivers/gles3/shaders/copy.glsl +++ b/drivers/gles3/shaders/copy.glsl @@ -165,11 +165,11 @@ void main() { #elif defined(USE_ASYM_PANO) // When an asymmetrical projection matrix is used (applicable for stereoscopic rendering i.e. VR) we need to do this calculation per fragment to get a perspective correct result. - // Note that we're ignoring the x-offset for IPD, with Z sufficiently in the distance it becomes neglectible, as a result we could probably just set cube_normal.z to -1. + // Asymmetrical projection means the center of projection is no longer in the center of the screen but shifted. // The Matrix[2][0] (= asym_proj.x) and Matrix[2][1] (= asym_proj.z) values are what provide the right shift in the image. vec3 cube_normal; - cube_normal.z = -1000000.0; + cube_normal.z = -1.0; cube_normal.x = (cube_normal.z * (-uv_interp.x - asym_proj.x)) / asym_proj.y; cube_normal.y = (cube_normal.z * (-uv_interp.y - asym_proj.z)) / asym_proj.a; cube_normal = mat3(sky_transform) * mat3(pano_transform) * cube_normal; diff --git a/drivers/png/image_loader_png.h b/drivers/png/image_loader_png.h index cc789f95d6..c910c31f1e 100644 --- a/drivers/png/image_loader_png.h +++ b/drivers/png/image_loader_png.h @@ -33,9 +33,6 @@ #include "core/io/image_loader.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class ImageLoaderPNG : public ImageFormatLoader { private: static PoolVector<uint8_t> lossless_pack_png(const Ref<Image> &p_image); diff --git a/drivers/png/png_driver_common.cpp b/drivers/png/png_driver_common.cpp index 0e849bf2fe..7deac1d118 100644 --- a/drivers/png/png_driver_common.cpp +++ b/drivers/png/png_driver_common.cpp @@ -97,7 +97,7 @@ Error png_to_image(const uint8_t *p_source, size_t p_size, Ref<Image> p_image) { break; default: png_image_free(&png_img); // only required when we return before finish_read - ERR_PRINT("Unsupported png format"); + ERR_PRINT("Unsupported png format."); return ERR_UNAVAILABLE; } @@ -179,10 +179,9 @@ Error image_to_png(const Ref<Image> &p_image, PoolVector<uint8_t> &p_buffer) { ERR_FAIL_COND_V(check_error(png_img), FAILED); } if (!success) { - if (compressed_size <= png_size_estimate) { - // buffer was big enough, must be some other error - ERR_FAIL_V(FAILED); - } + + // buffer was big enough, must be some other error + ERR_FAIL_COND_V(compressed_size <= png_size_estimate, FAILED); // write failed due to buffer size, resize and retry Error err = p_buffer.resize(buffer_offset + compressed_size); diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index 89e8ee32cc..7a2eeafdc3 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -39,9 +39,8 @@ Error ResourceSaverPNG::save(const String &p_path, const RES &p_resource, uint32 Ref<ImageTexture> texture = p_resource; - ERR_FAIL_COND_V(!texture.is_valid(), ERR_INVALID_PARAMETER); - ERR_EXPLAIN("Can't save empty texture as PNG"); - ERR_FAIL_COND_V(!texture->get_width() || !texture->get_height(), ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V_MSG(!texture.is_valid(), ERR_INVALID_PARAMETER, "Can't save invalid texture as PNG."); + ERR_FAIL_COND_V_MSG(!texture->get_width(), ERR_INVALID_PARAMETER, "Can't save empty texture as PNG."); Ref<Image> img = texture->get_data(); @@ -79,7 +78,7 @@ bool ResourceSaverPNG::recognize(const RES &p_resource) const { void ResourceSaverPNG::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { - if (Object::cast_to<Texture>(*p_resource)) { + if (Object::cast_to<ImageTexture>(*p_resource)) { p_extensions->push_back("png"); } } diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index a61fa449f1..7ba2175652 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -227,8 +227,8 @@ Error AudioDriverPulseAudio::init_device() { samples_out.resize(pa_buffer_size); // Reset audio input to keep synchronisation. - input_position = 0; - input_size = 0; + capture_position = 0; + capture_size = 0; return OK; } @@ -266,7 +266,10 @@ Error AudioDriverPulseAudio::init() { } while (pa_ready == 0) { - pa_mainloop_iterate(pa_ml, 1, NULL); + ret = pa_mainloop_iterate(pa_ml, 1, NULL); + if (ret < 0) { + ERR_PRINT("pa_mainloop_iterate error"); + } } if (pa_ready < 0) { @@ -460,7 +463,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) { size_t bytes = pa_stream_readable_size(ad->pa_rec_str); if (bytes > 0) { const void *ptr = NULL; - size_t maxbytes = ad->input_buffer.size() * sizeof(int16_t); + size_t maxbytes = ad->capture_buffer.size() * sizeof(int16_t); bytes = MIN(bytes, maxbytes); ret = pa_stream_peek(ad->pa_rec_str, &ptr, &bytes); @@ -470,11 +473,11 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) { int16_t *srcptr = (int16_t *)ptr; for (size_t i = bytes >> 1; i > 0; i--) { int32_t sample = int32_t(*srcptr++) << 16; - ad->input_buffer_write(sample); + ad->capture_buffer_write(sample); if (ad->pa_rec_map.channels == 1) { - // In case input device is single channel convert it to Stereo - ad->input_buffer_write(sample); + // In case capture device is single channel convert it to Stereo + ad->capture_buffer_write(sample); } } @@ -661,7 +664,7 @@ Error AudioDriverPulseAudio::capture_init_device() { break; default: - WARN_PRINTS("PulseAudio: Unsupported number of input channels: " + itos(pa_rec_map.channels)); + WARN_PRINTS("PulseAudio: Unsupported number of capture channels: " + itos(pa_rec_map.channels)); pa_channel_map_init_stereo(&pa_rec_map); break; } @@ -693,10 +696,10 @@ Error AudioDriverPulseAudio::capture_init_device() { ERR_FAIL_V(ERR_CANT_OPEN); } - input_buffer_init(input_buffer_frames); + capture_buffer_init(input_buffer_frames); - print_verbose("PulseAudio: detected " + itos(pa_rec_map.channels) + " input channels"); - print_verbose("PulseAudio: input buffer frames: " + itos(input_buffer_frames) + " calculated latency: " + itos(input_buffer_frames * 1000 / mix_rate) + "ms"); + print_verbose("PulseAudio: detected " + itos(pa_rec_map.channels) + " capture channels"); + print_verbose("PulseAudio: capture buffer frames: " + itos(input_buffer_frames) + " calculated latency: " + itos(input_buffer_frames * 1000 / mix_rate) + "ms"); return OK; } diff --git a/drivers/register_driver_types.h b/drivers/register_driver_types.h index 3fdf802c9f..a3398964dd 100644 --- a/drivers/register_driver_types.h +++ b/drivers/register_driver_types.h @@ -31,10 +31,6 @@ #ifndef REGISTER_DRIVER_TYPES_H #define REGISTER_DRIVER_TYPES_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - void register_core_driver_types(); void unregister_core_driver_types(); diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 251bab5783..6817137a94 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -126,37 +126,32 @@ String DirAccessUnix::get_next() { if (!dir_stream) return ""; - dirent *entry; - entry = readdir(dir_stream); + dirent *entry = readdir(dir_stream); if (entry == NULL) { - list_dir_end(); return ""; } - //typedef struct stat Stat; - struct stat flags; - String fname = fix_unicode_name(entry->d_name); - String f = current_dir.plus_file(fname); - - if (stat(f.utf8().get_data(), &flags) == 0) { - - if (S_ISDIR(flags.st_mode)) { - - _cisdir = true; - + // Look at d_type to determine if the entry is a directory, unless + // its type is unknown (the file system does not support it) or if + // the type is a link, in that case we want to resolve the link to + // known if it points to a directory. stat() will resolve the link + // for us. + if (entry->d_type == DT_UNKNOWN || entry->d_type == DT_LNK) { + String f = current_dir.plus_file(fname); + + struct stat flags; + if (stat(f.utf8().get_data(), &flags) == 0) { + _cisdir = S_ISDIR(flags.st_mode); } else { - _cisdir = false; } - } else { - - _cisdir = false; + _cisdir = (entry->d_type == DT_DIR); } _cishidden = (fname != "." && fname != ".." && fname.begins_with(".")); diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h index 579cb0e798..88674d2769 100644 --- a/drivers/unix/dir_access_unix.h +++ b/drivers/unix/dir_access_unix.h @@ -40,10 +40,6 @@ #include <sys/types.h> #include <unistd.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class DirAccessUnix : public DirAccess { DIR *dir_stream; diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index a285b3b65f..071734eb48 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -38,6 +38,8 @@ #include <sys/stat.h> #include <sys/types.h> +#include <errno.h> + #if defined(UNIX_ENABLED) #include <unistd.h> #endif @@ -112,8 +114,15 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) { f = fopen(path.utf8().get_data(), mode_string); if (f == NULL) { - last_error = ERR_FILE_CANT_OPEN; - return ERR_FILE_CANT_OPEN; + switch (errno) { + case ENOENT: { + last_error = ERR_FILE_NOT_FOUND; + } break; + default: { + last_error = ERR_FILE_CANT_OPEN; + } break; + } + return last_error; } else { last_error = OK; flags = p_mode_flags; @@ -288,8 +297,7 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) { if (!err) { return flags.st_mtime; } else { - ERR_EXPLAIN("Failed to get modified time for: " + p_file); - ERR_FAIL_V(0); + ERR_FAIL_V_MSG(0, "Failed to get modified time for: " + p_file + "."); }; } @@ -302,8 +310,7 @@ uint32_t FileAccessUnix::_get_unix_permissions(const String &p_file) { if (!err) { return flags.st_mode & 0x7FF; //only permissions } else { - ERR_EXPLAIN("Failed to get unix permissions for: " + p_file); - ERR_FAIL_V(0); + ERR_FAIL_V_MSG(0, "Failed to get unix permissions for: " + p_file + "."); }; } diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index 2a369048a4..e26591e3e8 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -38,10 +38,6 @@ #if defined(UNIX_ENABLED) || defined(LIBC_FILEIO_ENABLED) -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - typedef void (*CloseNotificationFunc)(const String &p_file, int p_flags); class FileAccessUnix : public FileAccess { diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index ce66f07a19..ac7195abc1 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -184,9 +184,7 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co continue; // will go back and alloc the right size }; - ERR_EXPLAIN("Call to GetAdaptersAddresses failed with error " + itos(err)); - ERR_FAIL(); - return; + ERR_FAIL_MSG("Call to GetAdaptersAddresses failed with error " + itos(err) + "."); }; IP_ADAPTER_ADDRESSES *adapter = addrs; diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index aa61cf5dcc..ab5590dba4 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -72,8 +72,7 @@ static double _clock_scale = 0; static void _setup_clock() { mach_timebase_info_data_t info; kern_return_t ret = mach_timebase_info(&info); - ERR_EXPLAIN("OS CLOCK IS NOT WORKING!"); - ERR_FAIL_COND(ret != 0); + ERR_FAIL_COND_MSG(ret != 0, "OS CLOCK IS NOT WORKING!"); _clock_scale = ((double)info.numer / (double)info.denom) / 1000.0; _clock_start = mach_absolute_time() * _clock_scale; } @@ -85,8 +84,7 @@ static void _setup_clock() { #endif static void _setup_clock() { struct timespec tv_now = { 0, 0 }; - ERR_EXPLAIN("OS CLOCK IS NOT WORKING!"); - ERR_FAIL_COND(clock_gettime(GODOT_CLOCK, &tv_now) != 0); + ERR_FAIL_COND_MSG(clock_gettime(GODOT_CLOCK, &tv_now) != 0, "OS CLOCK IS NOT WORKING!"); _clock_start = ((uint64_t)tv_now.tv_nsec / 1000L) + (uint64_t)tv_now.tv_sec * 1000000L; } #endif @@ -420,10 +418,7 @@ Error OS_Unix::open_dynamic_library(const String p_path, void *&p_library_handle } p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW); - if (!p_library_handle) { - ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror()); - ERR_FAIL_V(ERR_CANT_OPEN); - } + ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ". Error: " + dlerror()); return OK; } @@ -442,12 +437,9 @@ Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const S error = dlerror(); if (error != NULL) { - if (!p_optional) { - ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + error); - ERR_FAIL_V(ERR_CANT_RESOLVE); - } else { - return ERR_CANT_RESOLVE; - } + ERR_FAIL_COND_V_MSG(!p_optional, ERR_CANT_RESOLVE, "Can't resolve symbol " + p_name + ". Error: " + error + "."); + + return ERR_CANT_RESOLVE; } return OK; } diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index 53446a6b6f..a263147e23 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -31,10 +31,6 @@ #ifndef OS_UNIX_H #define OS_UNIX_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #ifdef UNIX_ENABLED #include "core/os/os.h" diff --git a/drivers/unix/semaphore_posix.h b/drivers/unix/semaphore_posix.h index 089f088d33..83e75c9a82 100644 --- a/drivers/unix/semaphore_posix.h +++ b/drivers/unix/semaphore_posix.h @@ -36,9 +36,7 @@ #if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED) #include <semaphore.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class SemaphorePosix : public Semaphore { mutable sem_t sem; diff --git a/drivers/unix/thread_posix.h b/drivers/unix/thread_posix.h index d6b6267c49..5edacd3a0c 100644 --- a/drivers/unix/thread_posix.h +++ b/drivers/unix/thread_posix.h @@ -31,10 +31,6 @@ #ifndef THREAD_POSIX_H #define THREAD_POSIX_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #if (defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)) && !defined(NO_THREADS) #include "core/os/thread.h" diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index fea38ee95d..adc3cc8d65 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -296,8 +296,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_c } hr = p_device->audio_client->Initialize(AUDCLNT_SHAREMODE_SHARED, streamflags, p_capture ? REFTIMES_PER_SEC : 0, 0, pwfex, NULL); - ERR_EXPLAIN("WASAPI: Initialize failed with error 0x" + String::num_uint64(hr, 16)); - ERR_FAIL_COND_V(hr != S_OK, ERR_CANT_OPEN); + ERR_FAIL_COND_V_MSG(hr != S_OK, ERR_CANT_OPEN, "WASAPI: Initialize failed with error 0x" + String::num_uint64(hr, 16) + "."); if (p_capture) { hr = p_device->audio_client->GetService(IID_IAudioCaptureClient, (void **)&p_device->capture_client); @@ -343,8 +342,8 @@ Error AudioDriverWASAPI::init_render_device(bool reinit) { // Sample rate is independent of channels (ref: https://stackoverflow.com/questions/11048825/audio-sample-frequency-rely-on-channels) samples_in.resize(buffer_frames * channels); - input_position = 0; - input_size = 0; + capture_position = 0; + capture_size = 0; print_verbose("WASAPI: detected " + itos(channels) + " channels"); print_verbose("WASAPI: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms"); @@ -363,7 +362,7 @@ Error AudioDriverWASAPI::init_capture_device(bool reinit) { HRESULT hr = audio_input.audio_client->GetBufferSize(&max_frames); ERR_FAIL_COND_V(hr != S_OK, ERR_CANT_OPEN); - input_buffer_init(max_frames); + capture_buffer_init(max_frames); return OK; } @@ -716,8 +715,8 @@ void AudioDriverWASAPI::thread_func(void *p_udata) { } } - ad->input_buffer_write(l); - ad->input_buffer_write(r); + ad->capture_buffer_write(l); + ad->capture_buffer_write(r); } read_frames += num_frames_available; diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 646e744248..fb21c0c5a1 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -38,6 +38,7 @@ #include <shlwapi.h> #include <windows.h> +#include <errno.h> #include <sys/stat.h> #include <sys/types.h> #include <tchar.h> @@ -114,17 +115,25 @@ Error FileAccessWindows::_open(const String &p_path, int p_mode_flags) { path = path + ".tmp"; } - _wfopen_s(&f, path.c_str(), mode_string); + errno_t errcode = _wfopen_s(&f, path.c_str(), mode_string); if (f == NULL) { - last_error = ERR_FILE_CANT_OPEN; - return ERR_FILE_CANT_OPEN; + switch (errcode) { + case ENOENT: { + last_error = ERR_FILE_NOT_FOUND; + } break; + default: { + last_error = ERR_FILE_CANT_OPEN; + } break; + } + return last_error; } else { last_error = OK; flags = p_mode_flags; return OK; } } + void FileAccessWindows::close() { if (!f) @@ -167,13 +176,11 @@ void FileAccessWindows::close() { if (close_fail_notify) { close_fail_notify(save_path); } - - ERR_EXPLAIN("Safe save failed. This may be a permissions problem, but also may happen because you are running a paranoid antivirus. If this is the case, please switch to Windows Defender or disable the 'safe save' option in editor settings. This makes it work, but increases the risk of file corruption in a crash."); } save_path = ""; - ERR_FAIL_COND(rename_error); + ERR_FAIL_COND_MSG(rename_error, "Safe save failed. This may be a permissions problem, but also may happen because you are running a paranoid antivirus. If this is the case, please switch to Windows Defender or disable the 'safe save' option in editor settings. This makes it work, but increases the risk of file corruption in a crash."); } } @@ -334,8 +341,7 @@ uint64_t FileAccessWindows::_get_modified_time(const String &p_file) { return st.st_mtime; } else { - ERR_EXPLAIN("Failed to get modified time for: " + file); - ERR_FAIL_V(0); + ERR_FAIL_V_MSG(0, "Failed to get modified time for: " + file + "."); } } diff --git a/drivers/windows/file_access_windows.h b/drivers/windows/file_access_windows.h index 2848ed5279..e7f9fc690d 100644 --- a/drivers/windows/file_access_windows.h +++ b/drivers/windows/file_access_windows.h @@ -38,10 +38,6 @@ #include <stdio.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class FileAccessWindows : public FileAccess { FILE *f; diff --git a/drivers/windows/mutex_windows.h b/drivers/windows/mutex_windows.h index 6d3b641a26..582d26029c 100644 --- a/drivers/windows/mutex_windows.h +++ b/drivers/windows/mutex_windows.h @@ -37,10 +37,6 @@ #include <windows.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class MutexWindows : public Mutex { #ifdef WINDOWS_USE_MUTEX diff --git a/drivers/windows/semaphore_windows.h b/drivers/windows/semaphore_windows.h index 8adeffbb7f..cfd33d033a 100644 --- a/drivers/windows/semaphore_windows.h +++ b/drivers/windows/semaphore_windows.h @@ -37,10 +37,6 @@ #include <windows.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class SemaphoreWindows : public Semaphore { mutable HANDLE semaphore; diff --git a/drivers/windows/thread_windows.h b/drivers/windows/thread_windows.h index a74d4e46f3..b47452838c 100644 --- a/drivers/windows/thread_windows.h +++ b/drivers/windows/thread_windows.h @@ -38,10 +38,6 @@ #include <windows.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class ThreadWindows : public Thread { ThreadCreateCallback callback; diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp index 8674d24af6..6d729c50ab 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.cpp +++ b/drivers/xaudio2/audio_driver_xaudio2.cpp @@ -63,15 +63,10 @@ Error AudioDriverXAudio2::init() { HRESULT hr; hr = XAudio2Create(&xaudio, 0, XAUDIO2_DEFAULT_PROCESSOR); - if (hr != S_OK) { - ERR_EXPLAIN("Error creating XAudio2 engine."); - ERR_FAIL_V(ERR_UNAVAILABLE); - } + ERR_FAIL_COND_V_MSG(hr != S_OK, ERR_UNAVAILABLE, "Error creating XAudio2 engine."); + hr = xaudio->CreateMasteringVoice(&mastering_voice); - if (hr != S_OK) { - ERR_EXPLAIN("Error creating XAudio2 mastering voice."); - ERR_FAIL_V(ERR_UNAVAILABLE); - } + ERR_FAIL_COND_V_MSG(hr != S_OK, ERR_UNAVAILABLE, "Error creating XAudio2 mastering voice."); wave_format.nChannels = channels; wave_format.cbSize = 0; @@ -82,10 +77,7 @@ Error AudioDriverXAudio2::init() { wave_format.nAvgBytesPerSec = mix_rate * wave_format.nBlockAlign; hr = xaudio->CreateSourceVoice(&source_voice, &wave_format, 0, XAUDIO2_MAX_FREQ_RATIO, &voice_callback); - if (hr != S_OK) { - ERR_EXPLAIN("Error creating XAudio2 source voice. " + itos(hr)); - ERR_FAIL_V(ERR_UNAVAILABLE); - } + ERR_FAIL_COND_V_MSG(hr != S_OK, ERR_UNAVAILABLE, "Error creating XAudio2 source voice. Error code: " + itos(hr) + "."); mutex = Mutex::create(); thread = Thread::create(AudioDriverXAudio2::thread_func, this); @@ -140,10 +132,7 @@ void AudioDriverXAudio2::start() { active = true; HRESULT hr = source_voice->Start(0); - if (hr != S_OK) { - ERR_EXPLAIN("XAudio2 start error " + itos(hr)); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(hr != S_OK, "Error starting XAudio2 driver. Error code: " + itos(hr) + "."); } int AudioDriverXAudio2::get_mix_rate() const { diff --git a/editor/SCsub b/editor/SCsub index 7d48e47c9f..2b560f68e8 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -31,7 +31,7 @@ if env['tools']: reg_exporters_inc = '#include "register_exporters.h"\n' reg_exporters = 'void register_exporters() {\n' for e in env.platform_exporters: - env.editor_sources.append("#platform/" + e + "/export/export.cpp") + env.add_source_files(env.editor_sources, "#platform/" + e + "/export/export.cpp") reg_exporters += '\tregister_' + e + '_exporter();\n' reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n' reg_exporters += '}\n' diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index f5b5cfa848..c93dc2b340 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -31,6 +31,7 @@ #include "animation_track_editor.h" #include "animation_track_editor_plugins.h" +#include "core/os/input.h" #include "core/os/keyboard.h" #include "editor/animation_bezier_editor.h" #include "editor/plugins/animation_player_editor_plugin.h" @@ -82,22 +83,23 @@ public: } void _update_obj(const Ref<Animation> &p_anim) { - if (setting) - return; - if (!(animation == p_anim)) + + if (setting || animation != p_anim) return; notify_change(); } void _key_ofs_changed(const Ref<Animation> &p_anim, float from, float to) { - if (!(animation == p_anim)) - return; - if (from != key_ofs) + + if (animation != p_anim || from != key_ofs) return; + key_ofs = to; + if (setting) return; + notify_change(); } @@ -118,6 +120,7 @@ public: } new_time /= fps; } + if (new_time == key_ofs) return true; @@ -141,12 +144,13 @@ public: trans = animation->track_get_key_transition(track, existing); undo_redo->add_undo_method(animation.ptr(), "track_insert_key", track, new_time, v, trans); } - undo_redo->commit_action(); - setting = false; + setting = false; return true; - } else if (name == "easing") { + } + + if (name == "easing") { float val = p_value; float prev_val = animation->track_get_key_transition(track, key); @@ -157,6 +161,7 @@ public: undo_redo->add_do_method(this, "_update_obj", animation); undo_redo->add_undo_method(this, "_update_obj", animation); undo_redo->commit_action(); + setting = false; return true; } @@ -166,7 +171,7 @@ public: case Animation::TYPE_TRANSFORM: { Dictionary d_old = animation->track_get_key_value(track, key); - Dictionary d_new = d_old; + Dictionary d_new = d_old.duplicate(); d_new[p_name] = p_value; setting = true; undo_redo->create_action(TTR("Anim Change Transform")); @@ -178,7 +183,6 @@ public: setting = false; return true; - } break; case Animation::TYPE_VALUE: { @@ -187,7 +191,6 @@ public: Variant value = p_value; if (value.get_type() == Variant::NODE_PATH) { - _fix_node_path(value); } @@ -203,12 +206,11 @@ public: setting = false; return true; } - } break; case Animation::TYPE_METHOD: { Dictionary d_old = animation->track_get_key_value(track, key); - Dictionary d_new = d_old; + Dictionary d_new = d_old.duplicate(); bool change_notify_deserved = false; bool mergeable = false; @@ -216,17 +218,13 @@ public: if (name == "name") { d_new["method"] = p_value; - } - - if (name == "arg_count") { + } else if (name == "arg_count") { Vector<Variant> args = d_old["args"]; args.resize(p_value); d_new["args"] = args; change_notify_deserved = true; - } - - if (name.begins_with("args/")) { + } else if (name.begins_with("args/")) { Vector<Variant> args = d_old["args"]; int idx = name.get_slice("/", 1).to_int(); @@ -249,8 +247,7 @@ public: change_notify_deserved = true; d_new["args"] = args; } - } - if (what == "value") { + } else if (what == "value") { Variant value = p_value; if (value.get_type() == Variant::NODE_PATH) { @@ -300,6 +297,7 @@ public: setting = false; return true; } + if (name == "in_handle") { const Variant &value = p_value; @@ -316,6 +314,7 @@ public: setting = false; return true; } + if (name == "out_handle") { const Variant &value = p_value; @@ -332,7 +331,6 @@ public: setting = false; return true; } - } break; case Animation::TYPE_AUDIO: { @@ -352,6 +350,7 @@ public: setting = false; return true; } + if (name == "start_offset") { float value = p_value; @@ -368,6 +367,7 @@ public: setting = false; return true; } + if (name == "end_offset") { float value = p_value; @@ -384,7 +384,6 @@ public: setting = false; return true; } - } break; case Animation::TYPE_ANIMATION: { @@ -400,10 +399,10 @@ public: undo_redo->add_do_method(this, "_update_obj", animation); undo_redo->add_undo_method(this, "_update_obj", animation); undo_redo->commit_action(); + setting = false; return true; } - } break; } @@ -419,20 +418,24 @@ public: if (name == "time") { r_ret = key_ofs; return true; - } else if (name == "frame") { + } + + if (name == "frame") { + float fps = animation->get_step(); if (fps > 0) { fps = 1.0 / fps; } r_ret = key_ofs * fps; return true; - } else if (name == "easing") { + } + + if (name == "easing") { r_ret = animation->track_get_key_transition(track, key); return true; } switch (animation->track_get_type(track)) { - case Animation::TYPE_TRANSFORM: { Dictionary d = animation->track_get_key_value(track, key); @@ -465,7 +468,6 @@ public: Vector<Variant> args = d["args"]; if (name == "arg_count") { - r_ret = args.size(); return true; } @@ -480,6 +482,7 @@ public: r_ret = args[idx].get_type(); return true; } + if (what == "value") { r_ret = args[idx]; return true; @@ -493,10 +496,12 @@ public: r_ret = animation->bezier_track_get_key_value(track, key); return true; } + if (name == "in_handle") { r_ret = animation->bezier_track_get_key_in_handle(track, key); return true; } + if (name == "out_handle") { r_ret = animation->bezier_track_get_key_out_handle(track, key); return true; @@ -509,10 +514,12 @@ public: r_ret = animation->audio_track_get_key_stream(track, key); return true; } + if (name == "start_offset") { r_ret = animation->audio_track_get_key_start_offset(track, key); return true; } + if (name == "end_offset") { r_ret = animation->audio_track_get_key_end_offset(track, key); return true; @@ -691,6 +698,702 @@ public: } }; +class AnimationMultiTrackKeyEdit : public Object { + + GDCLASS(AnimationMultiTrackKeyEdit, Object); + +public: + bool setting; + + bool _hide_script_from_inspector() { + return true; + } + + bool _dont_undo_redo() { + return true; + } + + static void _bind_methods() { + + ClassDB::bind_method("_update_obj", &AnimationMultiTrackKeyEdit::_update_obj); + ClassDB::bind_method("_key_ofs_changed", &AnimationMultiTrackKeyEdit::_key_ofs_changed); + ClassDB::bind_method("_hide_script_from_inspector", &AnimationMultiTrackKeyEdit::_hide_script_from_inspector); + ClassDB::bind_method("get_root_path", &AnimationMultiTrackKeyEdit::get_root_path); + ClassDB::bind_method("_dont_undo_redo", &AnimationMultiTrackKeyEdit::_dont_undo_redo); + } + + void _fix_node_path(Variant &value, NodePath &base) { + + NodePath np = value; + + if (np == NodePath()) + return; + + Node *root = EditorNode::get_singleton()->get_tree()->get_root(); + + Node *np_node = root->get_node(np); + ERR_FAIL_COND(!np_node); + + Node *edited_node = root->get_node(base); + ERR_FAIL_COND(!edited_node); + + value = edited_node->get_path_to(np_node); + } + + void _update_obj(const Ref<Animation> &p_anim) { + + if (setting || animation != p_anim) + return; + + notify_change(); + } + + void _key_ofs_changed(const Ref<Animation> &p_anim, float from, float to) { + + if (animation != p_anim) + return; + + for (Map<int, List<float> >::Element *E = key_ofs_map.front(); E; E = E->next()) { + + for (List<float>::Element *F = E->value().front(); F; F = F->next()) { + + float key_ofs = F->get(); + if (from != key_ofs) + continue; + + int track = E->key(); + key_ofs_map[track][key_ofs] = to; + + if (setting) + return; + + notify_change(); + + return; + } + } + } + + bool _set(const StringName &p_name, const Variant &p_value) { + + bool update_obj = false; + bool change_notify_deserved = false; + for (Map<int, List<float> >::Element *E = key_ofs_map.front(); E; E = E->next()) { + + int track = E->key(); + for (List<float>::Element *F = E->value().front(); F; F = F->next()) { + + float key_ofs = F->get(); + int key = animation->track_find_key(track, key_ofs, true); + ERR_FAIL_COND_V(key == -1, false); + + String name = p_name; + if (name == "time" || name == "frame") { + + float new_time = p_value; + + if (name == "frame") { + float fps = animation->get_step(); + if (fps > 0) { + fps = 1.0 / fps; + } + new_time /= fps; + } + + int existing = animation->track_find_key(track, new_time, true); + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Time"), UndoRedo::MERGE_ENDS); + } + + Variant val = animation->track_get_key_value(track, key); + float trans = animation->track_get_key_transition(track, key); + + undo_redo->add_do_method(animation.ptr(), "track_remove_key", track, key); + undo_redo->add_do_method(animation.ptr(), "track_insert_key", track, new_time, val, trans); + undo_redo->add_do_method(this, "_key_ofs_changed", animation, key_ofs, new_time); + undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", track, new_time); + undo_redo->add_undo_method(animation.ptr(), "track_insert_key", track, key_ofs, val, trans); + undo_redo->add_undo_method(this, "_key_ofs_changed", animation, new_time, key_ofs); + + if (existing != -1) { + Variant v = animation->track_get_key_value(track, existing); + trans = animation->track_get_key_transition(track, existing); + undo_redo->add_undo_method(animation.ptr(), "track_insert_key", track, new_time, v, trans); + } + } else if (name == "easing") { + + float val = p_value; + float prev_val = animation->track_get_key_transition(track, key); + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Transition"), UndoRedo::MERGE_ENDS); + } + undo_redo->add_do_method(animation.ptr(), "track_set_key_transition", track, key, val); + undo_redo->add_undo_method(animation.ptr(), "track_set_key_transition", track, key, prev_val); + update_obj = true; + } + + switch (animation->track_get_type(track)) { + + case Animation::TYPE_TRANSFORM: { + + Dictionary d_old = animation->track_get_key_value(track, key); + Dictionary d_new = d_old.duplicate(); + d_new[p_name] = p_value; + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Transform")); + } + undo_redo->add_do_method(animation.ptr(), "track_set_key_value", track, key, d_new); + undo_redo->add_undo_method(animation.ptr(), "track_set_key_value", track, key, d_old); + update_obj = true; + } break; + case Animation::TYPE_VALUE: { + + if (name == "value") { + + Variant value = p_value; + + if (value.get_type() == Variant::NODE_PATH) { + _fix_node_path(value, base_map[track]); + } + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); + } + Variant prev = animation->track_get_key_value(track, key); + undo_redo->add_do_method(animation.ptr(), "track_set_key_value", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "track_set_key_value", track, key, prev); + update_obj = true; + } + } break; + case Animation::TYPE_METHOD: { + + Dictionary d_old = animation->track_get_key_value(track, key); + Dictionary d_new = d_old.duplicate(); + + bool mergeable = false; + + if (name == "name") { + + d_new["method"] = p_value; + } else if (name == "arg_count") { + + Vector<Variant> args = d_old["args"]; + args.resize(p_value); + d_new["args"] = args; + change_notify_deserved = true; + } else if (name.begins_with("args/")) { + + Vector<Variant> args = d_old["args"]; + int idx = name.get_slice("/", 1).to_int(); + ERR_FAIL_INDEX_V(idx, args.size(), false); + + String what = name.get_slice("/", 2); + if (what == "type") { + Variant::Type t = Variant::Type(int(p_value)); + + if (t != args[idx].get_type()) { + Variant::CallError err; + if (Variant::can_convert(args[idx].get_type(), t)) { + Variant old = args[idx]; + Variant *ptrs[1] = { &old }; + args.write[idx] = Variant::construct(t, (const Variant **)ptrs, 1, err); + } else { + + args.write[idx] = Variant::construct(t, NULL, 0, err); + } + change_notify_deserved = true; + d_new["args"] = args; + } + } else if (what == "value") { + + Variant value = p_value; + if (value.get_type() == Variant::NODE_PATH) { + + _fix_node_path(value, base_map[track]); + } + + args.write[idx] = value; + d_new["args"] = args; + mergeable = true; + } + } + + Variant prev = animation->track_get_key_value(track, key); + + if (!setting) { + if (mergeable) + undo_redo->create_action(TTR("Anim Multi Change Call"), UndoRedo::MERGE_ENDS); + else + undo_redo->create_action(TTR("Anim Multi Change Call")); + + setting = true; + } + + undo_redo->add_do_method(animation.ptr(), "track_set_key_value", track, key, d_new); + undo_redo->add_undo_method(animation.ptr(), "track_set_key_value", track, key, d_old); + update_obj = true; + } break; + case Animation::TYPE_BEZIER: { + + if (name == "value") { + + const Variant &value = p_value; + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); + } + float prev = animation->bezier_track_get_key_value(track, key); + undo_redo->add_do_method(animation.ptr(), "bezier_track_set_key_value", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_value", track, key, prev); + update_obj = true; + } else if (name == "in_handle") { + + const Variant &value = p_value; + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); + } + Vector2 prev = animation->bezier_track_get_key_in_handle(track, key); + undo_redo->add_do_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, prev); + update_obj = true; + } else if (name == "out_handle") { + + const Variant &value = p_value; + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); + } + Vector2 prev = animation->bezier_track_get_key_out_handle(track, key); + undo_redo->add_do_method(animation.ptr(), "bezier_track_set_key_out_handle", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_out_handle", track, key, prev); + update_obj = true; + } + } break; + case Animation::TYPE_AUDIO: { + + if (name == "stream") { + + Ref<AudioStream> stream = p_value; + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); + } + RES prev = animation->audio_track_get_key_stream(track, key); + undo_redo->add_do_method(animation.ptr(), "audio_track_set_key_stream", track, key, stream); + undo_redo->add_undo_method(animation.ptr(), "audio_track_set_key_stream", track, key, prev); + update_obj = true; + } else if (name == "start_offset") { + + float value = p_value; + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); + } + float prev = animation->audio_track_get_key_start_offset(track, key); + undo_redo->add_do_method(animation.ptr(), "audio_track_set_key_start_offset", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "audio_track_set_key_start_offset", track, key, prev); + update_obj = true; + } else if (name == "end_offset") { + + float value = p_value; + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); + } + float prev = animation->audio_track_get_key_end_offset(track, key); + undo_redo->add_do_method(animation.ptr(), "audio_track_set_key_end_offset", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "audio_track_set_key_end_offset", track, key, prev); + update_obj = true; + } + } break; + case Animation::TYPE_ANIMATION: { + + if (name == "animation") { + + StringName anim_name = p_value; + + if (!setting) { + setting = true; + undo_redo->create_action(TTR("Anim Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); + } + StringName prev = animation->animation_track_get_key_animation(track, key); + undo_redo->add_do_method(animation.ptr(), "animation_track_set_key_animation", track, key, anim_name); + undo_redo->add_undo_method(animation.ptr(), "animation_track_set_key_animation", track, key, prev); + update_obj = true; + } + } break; + } + } + } + + if (setting) { + + if (update_obj) { + undo_redo->add_do_method(this, "_update_obj", animation); + undo_redo->add_undo_method(this, "_update_obj", animation); + } + + undo_redo->commit_action(); + setting = false; + + if (change_notify_deserved) + notify_change(); + + return true; + } + + return false; + } + + bool _get(const StringName &p_name, Variant &r_ret) const { + + for (Map<int, List<float> >::Element *E = key_ofs_map.front(); E; E = E->next()) { + + int track = E->key(); + for (List<float>::Element *F = E->value().front(); F; F = F->next()) { + + float key_ofs = F->get(); + int key = animation->track_find_key(track, key_ofs, true); + ERR_CONTINUE(key == -1); + + String name = p_name; + if (name == "time") { + r_ret = key_ofs; + return true; + } + + if (name == "frame") { + + float fps = animation->get_step(); + if (fps > 0) { + fps = 1.0 / fps; + } + r_ret = key_ofs * fps; + return true; + } + + if (name == "easing") { + r_ret = animation->track_get_key_transition(track, key); + return true; + } + + switch (animation->track_get_type(track)) { + + case Animation::TYPE_TRANSFORM: { + + Dictionary d = animation->track_get_key_value(track, key); + ERR_FAIL_COND_V(!d.has(name), false); + r_ret = d[p_name]; + return true; + + } break; + case Animation::TYPE_VALUE: { + + if (name == "value") { + r_ret = animation->track_get_key_value(track, key); + return true; + } + + } break; + case Animation::TYPE_METHOD: { + + Dictionary d = animation->track_get_key_value(track, key); + + if (name == "name") { + + ERR_FAIL_COND_V(!d.has("method"), false); + r_ret = d["method"]; + return true; + } + + ERR_FAIL_COND_V(!d.has("args"), false); + + Vector<Variant> args = d["args"]; + + if (name == "arg_count") { + + r_ret = args.size(); + return true; + } + + if (name.begins_with("args/")) { + + int idx = name.get_slice("/", 1).to_int(); + ERR_FAIL_INDEX_V(idx, args.size(), false); + + String what = name.get_slice("/", 2); + if (what == "type") { + r_ret = args[idx].get_type(); + return true; + } + + if (what == "value") { + r_ret = args[idx]; + return true; + } + } + + } break; + case Animation::TYPE_BEZIER: { + + if (name == "value") { + r_ret = animation->bezier_track_get_key_value(track, key); + return true; + } + + if (name == "in_handle") { + r_ret = animation->bezier_track_get_key_in_handle(track, key); + return true; + } + + if (name == "out_handle") { + r_ret = animation->bezier_track_get_key_out_handle(track, key); + return true; + } + + } break; + case Animation::TYPE_AUDIO: { + + if (name == "stream") { + r_ret = animation->audio_track_get_key_stream(track, key); + return true; + } + + if (name == "start_offset") { + r_ret = animation->audio_track_get_key_start_offset(track, key); + return true; + } + + if (name == "end_offset") { + r_ret = animation->audio_track_get_key_end_offset(track, key); + return true; + } + + } break; + case Animation::TYPE_ANIMATION: { + + if (name == "animation") { + r_ret = animation->animation_track_get_key_animation(track, key); + return true; + } + + } break; + } + } + } + + return false; + } + void _get_property_list(List<PropertyInfo> *p_list) const { + + if (animation.is_null()) + return; + + int first_track = -1; + float first_key = -1.0; + + bool show_time = true; + bool same_track_type = true; + bool same_key_type = true; + for (Map<int, List<float> >::Element *E = key_ofs_map.front(); E; E = E->next()) { + + int track = E->key(); + ERR_FAIL_INDEX(track, animation->get_track_count()); + + if (first_track < 0) + first_track = track; + + if (show_time && E->value().size() > 1) + show_time = false; + + if (same_track_type) { + + if (animation->track_get_type(first_track) != animation->track_get_type(track)) { + same_track_type = false; + same_key_type = false; + } + + for (List<float>::Element *F = E->value().front(); F; F = F->next()) { + + int key = animation->track_find_key(track, F->get(), true); + ERR_FAIL_COND(key == -1); + if (first_key < 0) + first_key = key; + + if (animation->track_get_key_value(first_track, first_key).get_type() != animation->track_get_key_value(track, key).get_type()) + same_key_type = false; + } + } + } + + if (show_time) { + + if (use_fps && animation->get_step() > 0) { + float max_frame = animation->get_length() / animation->get_step(); + p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); + } else { + p_list->push_back(PropertyInfo(Variant::REAL, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); + } + } + + if (same_track_type) { + switch (animation->track_get_type(first_track)) { + + case Animation::TYPE_TRANSFORM: { + + p_list->push_back(PropertyInfo(Variant::VECTOR3, "location")); + p_list->push_back(PropertyInfo(Variant::QUAT, "rotation")); + p_list->push_back(PropertyInfo(Variant::VECTOR3, "scale")); + } break; + case Animation::TYPE_VALUE: { + + if (!same_key_type) + break; + + Variant v = animation->track_get_key_value(first_track, first_key); + + if (hint.type != Variant::NIL) { + + PropertyInfo pi = hint; + pi.name = "value"; + p_list->push_back(pi); + } else { + + PropertyHint hint = PROPERTY_HINT_NONE; + String hint_string; + + if (v.get_type() == Variant::OBJECT) { + //could actually check the object property if exists..? yes i will! + Ref<Resource> res = v; + if (res.is_valid()) { + + hint = PROPERTY_HINT_RESOURCE_TYPE; + hint_string = res->get_class(); + } + } + + if (v.get_type() != Variant::NIL) + p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string)); + } + + p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING)); + } break; + case Animation::TYPE_METHOD: { + + p_list->push_back(PropertyInfo(Variant::STRING, "name")); + p_list->push_back(PropertyInfo(Variant::INT, "arg_count", PROPERTY_HINT_RANGE, "0,5,1")); + + Dictionary d = animation->track_get_key_value(first_track, first_key); + ERR_FAIL_COND(!d.has("args")); + Vector<Variant> args = d["args"]; + String vtypes; + for (int i = 0; i < Variant::VARIANT_MAX; i++) { + + if (i > 0) + vtypes += ","; + vtypes += Variant::get_type_name(Variant::Type(i)); + } + + for (int i = 0; i < args.size(); i++) { + + p_list->push_back(PropertyInfo(Variant::INT, "args/" + itos(i) + "/type", PROPERTY_HINT_ENUM, vtypes)); + if (args[i].get_type() != Variant::NIL) + p_list->push_back(PropertyInfo(args[i].get_type(), "args/" + itos(i) + "/value")); + } + } break; + case Animation::TYPE_BEZIER: { + + p_list->push_back(PropertyInfo(Variant::REAL, "value")); + p_list->push_back(PropertyInfo(Variant::VECTOR2, "in_handle")); + p_list->push_back(PropertyInfo(Variant::VECTOR2, "out_handle")); + } break; + case Animation::TYPE_AUDIO: { + + p_list->push_back(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream")); + p_list->push_back(PropertyInfo(Variant::REAL, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::REAL, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + } break; + case Animation::TYPE_ANIMATION: { + + if (key_ofs_map.size() > 1) + break; + + String animations; + + if (root_path && root_path->has_node(animation->track_get_path(first_track))) { + + AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(root_path->get_node(animation->track_get_path(first_track))); + if (ap) { + List<StringName> anims; + ap->get_animation_list(&anims); + for (List<StringName>::Element *G = anims.front(); G; G = G->next()) { + if (animations != String()) { + animations += ","; + } + + animations += String(G->get()); + } + } + } + + if (animations != String()) { + animations += ","; + } + animations += "[stop]"; + + p_list->push_back(PropertyInfo(Variant::STRING, "animation", PROPERTY_HINT_ENUM, animations)); + } break; + } + } + } + + Ref<Animation> animation; + + Map<int, List<float> > key_ofs_map; + Map<int, NodePath> base_map; + PropertyInfo hint; + + Node *root_path; + + bool use_fps; + + UndoRedo *undo_redo; + + void notify_change() { + + _change_notify(); + } + + Node *get_root_path() { + return root_path; + } + + void set_use_fps(bool p_enable) { + use_fps = p_enable; + _change_notify(); + } + + AnimationMultiTrackKeyEdit() { + use_fps = false; + setting = false; + root_path = NULL; + } +}; + void AnimationTimelineEdit::_zoom_changed(double) { update(); @@ -1045,7 +1748,11 @@ void AnimationTimelineEdit::_play_position_draw() { if (px >= get_name_limit() && px < (play_position->get_size().width - get_buttons_width())) { Color color = get_color("accent_color", "Editor"); - play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(EDSCALE)); + play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE)); + play_position->draw_texture( + get_icon("TimelineIndicator", "EditorIcons"), + Point2(px - get_icon("TimelineIndicator", "EditorIcons")->get_width() * 0.5, 0), + color); } } @@ -1274,12 +1981,7 @@ void AnimationTrackEdit::_notification(int p_what) { } text_color.a *= 0.7; } else if (node) { - Ref<Texture> icon; - if (has_icon(node->get_class(), "EditorIcons")) { - icon = get_icon(node->get_class(), "EditorIcons"); - } else { - icon = get_icon("Node", "EditorIcons"); - } + Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(node, "Node"); draw_texture(icon, Point2(ofs, int(get_size().height - icon->get_height()) / 2)); icon_cache = icon; @@ -1740,7 +2442,7 @@ void AnimationTrackEdit::_play_position_draw() { if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { Color color = get_color("accent_color", "Editor"); - play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(EDSCALE)); + play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE)); } } @@ -2486,7 +3188,7 @@ void AnimationTrackEditGroup::_notification(int p_what) { if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { Color accent = get_color("accent_color", "Editor"); - draw_line(Point2(px, 0), Point2(px, get_size().height), accent, Math::round(EDSCALE)); + draw_line(Point2(px, 0), Point2(px, get_size().height), accent, Math::round(2 * EDSCALE)); } } } @@ -3385,6 +4087,10 @@ bool AnimationTrackEditor::is_selection_active() const { return selection.size(); } +bool AnimationTrackEditor::is_snap_enabled() const { + return snap->is_pressed() ^ Input::get_singleton()->is_key_pressed(KEY_CONTROL); +} + void AnimationTrackEditor::_update_tracks() { int selected = _get_track_selected(); @@ -3500,9 +4206,7 @@ void AnimationTrackEditor::_update_tracks() { if (root && root->has_node(base_path)) { Node *n = root->get_node(base_path); if (n) { - if (has_icon(n->get_class(), "EditorIcons")) { - icon = get_icon(n->get_class(), "EditorIcons"); - } + icon = EditorNode::get_singleton()->get_object_icon(n, "Node"); name = n->get_name(); tooltip = root->get_path_to(n); } @@ -4140,12 +4844,19 @@ void AnimationTrackEditor::_clear_key_edit() { } #else //if key edit is the object being inspected, remove it first - if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit) { + if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit || + EditorNode::get_singleton()->get_inspector()->get_edited_object() == multi_key_edit) { EditorNode::get_singleton()->push_item(NULL); } + //then actually delete it - memdelete(key_edit); - key_edit = NULL; + if (key_edit) { + memdelete(key_edit); + key_edit = NULL; + } else if (multi_key_edit) { + memdelete(multi_key_edit); + multi_key_edit = NULL; + } #endif } } @@ -4163,38 +4874,70 @@ void AnimationTrackEditor::_update_key_edit() { _clear_key_edit(); if (!animation.is_valid()) return; - if (selection.size() != 1) { - return; - } - key_edit = memnew(AnimationTrackKeyEdit); - key_edit->animation = animation; - key_edit->track = selection.front()->key().track; - key_edit->use_fps = timeline->is_using_fps(); + if (selection.size() == 1) { + + key_edit = memnew(AnimationTrackKeyEdit); + key_edit->animation = animation; + key_edit->track = selection.front()->key().track; + key_edit->use_fps = timeline->is_using_fps(); + + float ofs = animation->track_get_key_time(key_edit->track, selection.front()->key().key); + key_edit->key_ofs = ofs; + key_edit->root_path = root; + + NodePath np; + key_edit->hint = _find_hint_for_track(key_edit->track, np); + key_edit->undo_redo = undo_redo; + key_edit->base = np; - float ofs = animation->track_get_key_time(key_edit->track, selection.front()->key().key); - key_edit->key_ofs = ofs; - key_edit->root_path = root; + EditorNode::get_singleton()->push_item(key_edit); + } else if (selection.size() > 1) { - NodePath np; - key_edit->hint = _find_hint_for_track(key_edit->track, np); - key_edit->undo_redo = undo_redo; - key_edit->base = np; + multi_key_edit = memnew(AnimationMultiTrackKeyEdit); + multi_key_edit->animation = animation; - EditorNode::get_singleton()->push_item(key_edit); + Map<int, List<float> > key_ofs_map; + Map<int, NodePath> base_map; + int first_track = -1; + for (Map<SelectedKey, KeyInfo>::Element *E = selection.front(); E; E = E->next()) { + + int track = E->key().track; + if (first_track < 0) + first_track = track; + + if (!key_ofs_map.has(track)) { + key_ofs_map[track] = List<float>(); + base_map[track] = *memnew(NodePath); + } + + key_ofs_map[track].push_back(animation->track_get_key_time(track, E->key().key)); + } + multi_key_edit->key_ofs_map = key_ofs_map; + multi_key_edit->base_map = base_map; + multi_key_edit->hint = _find_hint_for_track(first_track, base_map[first_track]); + + multi_key_edit->use_fps = timeline->is_using_fps(); + + multi_key_edit->root_path = root; + + multi_key_edit->undo_redo = undo_redo; + + EditorNode::get_singleton()->push_item(multi_key_edit); + } } void AnimationTrackEditor::_clear_selection_for_anim(const Ref<Animation> &p_anim) { - if (!(animation == p_anim)) + if (animation != p_anim) return; - //selection.clear(); + _clear_selection(); } void AnimationTrackEditor::_select_at_anim(const Ref<Animation> &p_anim, int p_track, float p_pos) { - if (!(animation == p_anim)) + if (animation != p_anim) return; int idx = animation->track_find_key(p_track, p_pos, true); @@ -4216,12 +4959,12 @@ void AnimationTrackEditor::_move_selection_commit() { List<_AnimMoveRestore> to_restore; float motion = moving_selection_offset; - // 1-remove the keys + // 1 - remove the keys for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) { undo_redo->add_do_method(animation.ptr(), "track_remove_key", E->key().track, E->key().key); } - // 2- remove overlapped keys + // 2 - remove overlapped keys for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) { float newtime = snap_time(E->get().pos + motion); @@ -4245,35 +4988,27 @@ void AnimationTrackEditor::_move_selection_commit() { to_restore.push_back(amr); } - // 3-move the keys (re insert them) + // 3 - move the keys (re insert them) for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) { float newpos = snap_time(E->get().pos + motion); - /* - if (newpos<0) - continue; //no add at the beginning - */ undo_redo->add_do_method(animation.ptr(), "track_insert_key", E->key().track, newpos, animation->track_get_key_value(E->key().track, E->key().key), animation->track_get_key_transition(E->key().track, E->key().key)); } - // 4-(undo) remove inserted keys + // 4 - (undo) remove inserted keys for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) { float newpos = snap_time(E->get().pos + motion); - /* - if (newpos<0) - continue; //no remove what no inserted - */ undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", E->key().track, newpos); } - // 5-(undo) reinsert keys + // 5 - (undo) reinsert keys for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) { undo_redo->add_undo_method(animation.ptr(), "track_insert_key", E->key().track, E->get().pos, animation->track_get_key_value(E->key().track, E->key().key), animation->track_get_key_transition(E->key().track, E->key().key)); } - // 6-(undo) reinsert overlapped keys + // 6 - (undo) reinsert overlapped keys for (List<_AnimMoveRestore>::Element *E = to_restore.front(); E; E = E->next()) { _AnimMoveRestore &amr = E->get(); @@ -4283,12 +5018,12 @@ void AnimationTrackEditor::_move_selection_commit() { undo_redo->add_do_method(this, "_clear_selection_for_anim", animation); undo_redo->add_undo_method(this, "_clear_selection_for_anim", animation); - // 7-reselect + // 7 - reselect for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) { float oldpos = E->get().pos; float newpos = snap_time(oldpos + motion); - //if (newpos>=0) + undo_redo->add_do_method(this, "_select_at_anim", animation, E->key().track, newpos); undo_redo->add_undo_method(this, "_select_at_anim", animation, E->key().track, oldpos); } @@ -4319,10 +5054,9 @@ float AnimationTrackEditor::get_moving_selection_offset() const { void AnimationTrackEditor::_box_selection_draw() { - Color color = get_color("accent_color", "Editor"); - color.a = 0.2; - Rect2 rect = Rect2(Point2(), box_selection->get_size()); - box_selection->draw_rect(rect, color); + const Rect2 selection_rect = Rect2(Point2(), box_selection->get_size()); + box_selection->draw_rect(selection_rect, get_color("box_selection_fill_color", "Editor")); + box_selection->draw_rect(selection_rect, get_color("box_selection_stroke_color", "Editor"), false, Math::round(EDSCALE)); } void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) { @@ -4953,7 +5687,7 @@ void AnimationTrackEditor::_selection_changed() { float AnimationTrackEditor::snap_time(float p_value) { - if (snap->is_pressed()) { + if (is_snap_enabled()) { double snap_increment; if (timeline->is_using_fps() && step->get_value() > 0) @@ -5131,7 +5865,7 @@ AnimationTrackEditor::AnimationTrackEditor() { step = memnew(EditorSpinSlider); step->set_min(0); step->set_max(1000000); - step->set_step(0.01); + step->set_step(0.001); step->set_hide_slider(true); step->set_custom_minimum_size(Size2(100, 0) * EDSCALE); step->set_tooltip(TTR("Animation step value.")); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 8dc2304a95..96fd10effd 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -246,6 +246,7 @@ public: }; class AnimationTrackKeyEdit; +class AnimationMultiTrackKeyEdit; class AnimationBezierTrackEdit; class AnimationTrackEditGroup : public Control { @@ -415,6 +416,7 @@ class AnimationTrackEditor : public VBoxContainer { void _move_selection_cancel(); AnimationTrackKeyEdit *key_edit; + AnimationMultiTrackKeyEdit *multi_key_edit; void _update_key_edit(); void _clear_key_edit(); @@ -518,8 +520,8 @@ public: bool is_key_selected(int p_track, int p_key) const; bool is_selection_active() const; bool is_moving_selection() const; + bool is_snap_enabled() const; float get_moving_selection_offset() const; - bool is_snap_enabled(); float snap_time(float p_value); bool is_grouping_tracks(); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 4862d4bb5b..61adff7c9c 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -152,6 +152,7 @@ bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col) text_edit->cursor_set_line(line, false); text_edit->cursor_set_column(col + text.length(), false); text_edit->center_viewport_to_cursor(); + text_edit->select(line, col, line, col + text.length()); } text_edit->set_search_text(text); @@ -162,16 +163,17 @@ bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col) result_col = col; _update_results_count(); - set_error(vformat(TTR("Found %d match(es)."), results_count)); } else { + results_count = 0; result_line = -1; result_col = -1; text_edit->set_search_text(""); text_edit->set_search_flags(p_flags); text_edit->set_current_search_result(line, col); - set_error(text.empty() ? "" : TTR("No Matches")); } + _update_matches_label(); + return found; } @@ -195,7 +197,7 @@ void FindReplaceBar::_replace() { void FindReplaceBar::_replace_all() { text_edit->disconnect("text_changed", this, "_editor_text_changed"); - // line as x so it gets priority in comparison, column as y + // Line as x so it gets priority in comparison, column as y. Point2i orig_cursor(text_edit->cursor_get_line(), text_edit->cursor_get_column()); Point2i prev_match = Point2(-1, -1); @@ -227,7 +229,7 @@ void FindReplaceBar::_replace_all() { Point2i match_to(result_line, result_col + search_text_len); if (match_from < prev_match) { - break; // done + break; // Done. } prev_match = Point2i(result_line, result_col + replace_text.length()); @@ -240,14 +242,14 @@ void FindReplaceBar::_replace_all() { continue; } - // replace but adjust selection bounds + // Replace but adjust selection bounds. text_edit->insert_text_at_cursor(replace_text); if (match_to.x == selection_end.x) { selection_end.y += replace_text.length() - search_text_len; } } else { - // just replace + // Just replace. text_edit->insert_text_at_cursor(replace_text); } @@ -259,12 +261,12 @@ void FindReplaceBar::_replace_all() { replace_all_mode = false; - // restore editor state (selection, cursor, scroll) + // Restore editor state (selection, cursor, scroll). text_edit->cursor_set_line(orig_cursor.x); text_edit->cursor_set_column(orig_cursor.y); if (selection_enabled && is_selection_only()) { - // reselect + // Reselect. text_edit->select(selection_begin.x, selection_begin.y, selection_end.x, selection_end.y); } else { text_edit->deselect(); @@ -282,20 +284,6 @@ void FindReplaceBar::_get_search_from(int &r_line, int &r_col) { r_line = text_edit->cursor_get_line(); r_col = text_edit->cursor_get_column(); - if (text_edit->is_selection_active() && !replace_all_mode) { - - int selection_line = text_edit->get_selection_from_line(); - - if (text_edit->get_selection_text() == get_search_text() && r_line == selection_line) { - - int selection_from_col = text_edit->get_selection_from_column(); - - if (r_col >= selection_from_col && r_col <= text_edit->get_selection_to_column()) { - r_col = selection_from_col; - } - } - } - if (r_line == result_line && r_col >= result_col && r_col <= result_col + get_search_text().length()) { r_col = result_col; } @@ -331,6 +319,18 @@ void FindReplaceBar::_update_results_count() { } } +void FindReplaceBar::_update_matches_label() { + + if (search_text->get_text().empty() || results_count == -1) { + matches_label->hide(); + } else { + matches_label->show(); + + matches_label->add_color_override("font_color", results_count > 0 ? Color(1, 1, 1) : EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count)); + } +} + bool FindReplaceBar::search_current() { uint32_t flags = 0; @@ -348,6 +348,9 @@ bool FindReplaceBar::search_current() { bool FindReplaceBar::search_prev() { + if (!is_visible()) + popup_search(true); + uint32_t flags = 0; String text = get_search_text(); @@ -360,13 +363,17 @@ bool FindReplaceBar::search_prev() { int line, col; _get_search_from(line, col); + if (text_edit->is_selection_active()) + col--; // Skip currently selected word. - col -= text.length(); - if (col < 0) { - line -= 1; - if (line < 0) - line = text_edit->get_line_count() - 1; - col = text_edit->get_line(line).length(); + if (line == result_line && col == result_col) { + col -= text.length(); + if (col < 0) { + line -= 1; + if (line < 0) + line = text_edit->get_line_count() - 1; + col = text_edit->get_line(line).length(); + } } return _search(flags, line, col); @@ -374,6 +381,9 @@ bool FindReplaceBar::search_prev() { bool FindReplaceBar::search_next() { + if (!is_visible()) + popup_search(true); + uint32_t flags = 0; String text; if (replace_all_mode) @@ -410,38 +420,54 @@ void FindReplaceBar::_hide_bar() { text_edit->set_search_text(""); result_line = -1; result_col = -1; - set_error(""); hide(); } -void FindReplaceBar::_show_search() { +void FindReplaceBar::_show_search(bool p_focus_replace, bool p_show_only) { show(); - search_text->call_deferred("grab_focus"); + if (p_show_only) + return; + + if (p_focus_replace) { + search_text->deselect(); + replace_text->call_deferred("grab_focus"); + } else { + replace_text->deselect(); + search_text->call_deferred("grab_focus"); + } if (text_edit->is_selection_active() && !selection_only->is_pressed()) { search_text->set_text(text_edit->get_selection_text()); } if (!get_search_text().empty()) { - search_text->select_all(); - search_text->set_cursor_position(search_text->get_text().length()); - search_current(); + if (p_focus_replace) { + replace_text->select_all(); + replace_text->set_cursor_position(replace_text->get_text().length()); + } else { + search_text->select_all(); + search_text->set_cursor_position(search_text->get_text().length()); + } + + results_count = -1; + _update_results_count(); + _update_matches_label(); } } -void FindReplaceBar::popup_search() { +void FindReplaceBar::popup_search(bool p_show_only) { - replace_text->hide(); + if (!is_visible()) + replace_text->hide(); hbc_button_replace->hide(); hbc_option_replace->hide(); - _show_search(); + _show_search(false, p_show_only); } void FindReplaceBar::popup_replace() { if (!replace_text->is_visible_in_tree()) { - replace_text->clear(); replace_text->show(); hbc_button_replace->show(); hbc_option_replace->show(); @@ -449,7 +475,7 @@ void FindReplaceBar::popup_replace() { selection_only->set_pressed((text_edit->is_selection_active() && text_edit->get_selection_from_line() < text_edit->get_selection_to_line())); - _show_search(); + _show_search(is_visible() || text_edit->is_selection_active()); } void FindReplaceBar::_search_options_changed(bool p_pressed) { @@ -556,6 +582,7 @@ FindReplaceBar::FindReplaceBar() { vbc_lineedit = memnew(VBoxContainer); add_child(vbc_lineedit); + vbc_lineedit->set_alignment(ALIGN_CENTER); vbc_lineedit->set_h_size_flags(SIZE_EXPAND_FILL); VBoxContainer *vbc_button = memnew(VBoxContainer); add_child(vbc_button); @@ -564,8 +591,10 @@ FindReplaceBar::FindReplaceBar() { HBoxContainer *hbc_button_search = memnew(HBoxContainer); vbc_button->add_child(hbc_button_search); + hbc_button_search->set_alignment(ALIGN_END); hbc_button_replace = memnew(HBoxContainer); vbc_button->add_child(hbc_button_replace); + hbc_button_replace->set_alignment(ALIGN_END); HBoxContainer *hbc_option_search = memnew(HBoxContainer); vbc_option->add_child(hbc_option_search); @@ -579,6 +608,10 @@ FindReplaceBar::FindReplaceBar() { search_text->connect("text_changed", this, "_search_text_changed"); search_text->connect("text_entered", this, "_search_text_entered"); + matches_label = memnew(Label); + hbc_button_search->add_child(matches_label); + matches_label->hide(); + find_prev = memnew(ToolButton); hbc_button_search->add_child(find_prev); find_prev->set_focus_mode(FOCUS_NONE); @@ -719,7 +752,7 @@ void CodeTextEditor::_zoom_changed() { } void CodeTextEditor::_reset_zoom() { - Ref<DynamicFont> font = text_editor->get_font("font"); // reset source font size to default + Ref<DynamicFont> font = text_editor->get_font("font"); // Reset source font size to default. if (font.is_valid()) { EditorSettings::get_singleton()->set("interface/editor/code_font_size", 14); @@ -875,6 +908,8 @@ void CodeTextEditor::update_editor_settings() { text_editor->set_hiding_enabled(EditorSettings::get_singleton()->get("text_editor/line_numbers/code_folding")); text_editor->set_draw_fold_gutter(EditorSettings::get_singleton()->get("text_editor/line_numbers/code_folding")); text_editor->set_wrap_enabled(EditorSettings::get_singleton()->get("text_editor/line_numbers/word_wrap")); + text_editor->set_draw_minimap(EditorSettings::get_singleton()->get("text_editor/line_numbers/draw_minimap")); + text_editor->set_minimap_width(EditorSettings::get_singleton()->get("text_editor/line_numbers/minimap_width")); text_editor->set_draw_info_gutter(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_info_gutter")); text_editor->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/cursor/block_caret")); text_editor->set_smooth_scroll_enabled(EditorSettings::get_singleton()->get("text_editor/open_scripts/smooth_scrolling")); @@ -1229,7 +1264,7 @@ void CodeTextEditor::toggle_inline_comment(const String &delimiter) { int col_to = text_editor->get_selection_to_column(); int cursor_pos = text_editor->cursor_get_column(); - // Check if all lines in the selected block are commented + // Check if all lines in the selected block are commented. bool is_commented = true; for (int i = begin; i <= end; i++) { if (!text_editor->get_line(i).begins_with(delimiter)) { @@ -1424,19 +1459,19 @@ void CodeTextEditor::_on_settings_change() { font_size = EditorSettings::get_singleton()->get("interface/editor/code_font_size"); - // AUTO BRACE COMPLETION + // Auto brace completion. text_editor->set_auto_brace_completion( - EDITOR_DEF("text_editor/completion/auto_brace_complete", true)); + EDITOR_GET("text_editor/completion/auto_brace_complete")); code_complete_timer->set_wait_time( - EDITOR_DEF("text_editor/completion/code_complete_delay", .3f)); + EDITOR_GET("text_editor/completion/code_complete_delay")); - // call hint settings + // Call hint settings. text_editor->set_callhint_settings( - EDITOR_DEF("text_editor/completion/put_callhint_tooltip_below_current_line", true), - EDITOR_DEF("text_editor/completion/callhint_tooltip_offset", Vector2())); + EDITOR_GET("text_editor/completion/put_callhint_tooltip_below_current_line"), + EDITOR_GET("text_editor/completion/callhint_tooltip_offset")); - idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay", 2.0)); + idle->set_wait_time(EDITOR_GET("text_editor/completion/idle_parse_delay")); } void CodeTextEditor::_text_changed_idle_timeout() { @@ -1622,12 +1657,12 @@ CodeTextEditor::CodeTextEditor() { idle = memnew(Timer); add_child(idle); idle->set_one_shot(true); - idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay", 2.0)); + idle->set_wait_time(EDITOR_GET("text_editor/completion/idle_parse_delay")); code_complete_timer = memnew(Timer); add_child(code_complete_timer); code_complete_timer->set_one_shot(true); - code_complete_timer->set_wait_time(EDITOR_DEF("text_editor/completion/code_complete_delay", .3f)); + code_complete_timer->set_wait_time(EDITOR_GET("text_editor/completion/code_complete_delay")); error_line = 0; error_column = 0; diff --git a/editor/code_editor.h b/editor/code_editor.h index 700e72627c..f2a55cfb70 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -64,6 +64,7 @@ class FindReplaceBar : public HBoxContainer { GDCLASS(FindReplaceBar, HBoxContainer); LineEdit *search_text; + Label *matches_label; ToolButton *find_prev; ToolButton *find_next; CheckBox *case_sensitive; @@ -90,8 +91,9 @@ class FindReplaceBar : public HBoxContainer { void _get_search_from(int &r_line, int &r_col); void _update_results_count(); + void _update_matches_label(); - void _show_search(); + void _show_search(bool p_focus_replace = false, bool p_show_only = false); void _hide_bar(); void _editor_text_changed(); @@ -123,7 +125,7 @@ public: void set_text_edit(TextEdit *p_text_edit); - void popup_search(); + void popup_search(bool p_show_only = false); void popup_replace(); bool search_current(); diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp index 57c00e1bef..aea7f461f1 100644 --- a/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -1696,7 +1696,7 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { } } - } else if (section == "node") { + } else { /* Found a child node!! what to do..*/ @@ -1903,8 +1903,7 @@ void Collada::_parse_animation(XMLParser &parser) { Vector<float> &output = float_sources[output_id]; - ERR_EXPLAIN("Wrong number of keys in output"); - ERR_CONTINUE((output.size() / stride) != key_count); + ERR_CONTINUE_MSG((output.size() / stride) != key_count, "Wrong number of keys in output."); for (int j = 0; j < key_count; j++) { track.keys.write[j].data.resize(output_len); @@ -2447,8 +2446,7 @@ void Collada::_find_morph_nodes(VisualScene *p_vscene, Node *p_node) { state.morph_ownership_map[base] = nj->id; break; } else { - ERR_EXPLAIN("Invalid scene"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid scene."); } } } diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 48bc409b73..c5b81c4685 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -881,7 +881,6 @@ void ConnectionsDock::update_tree() { icon = get_icon(scr->get_class(), "EditorIcons"); } } - } else { ClassDB::get_signal_list(base, &node_signals2, true); @@ -891,6 +890,10 @@ void ConnectionsDock::update_tree() { name = base; } + if (!icon.is_valid()) { + icon = get_icon("Object", "EditorIcons"); + } + TreeItem *pitem = NULL; if (node_signals2.size()) { @@ -939,7 +942,7 @@ void ConnectionsDock::update_tree() { item->set_metadata(0, sinfo); item->set_icon(0, get_icon("Signal", "EditorIcons")); - // Set tooltip with the signal's documentation + // Set tooltip with the signal's documentation. { String descr; bool found = false; diff --git a/editor/create_dialog.h b/editor/create_dialog.h index f6c3b57589..f3ed1d7af6 100644 --- a/editor/create_dialog.h +++ b/editor/create_dialog.h @@ -38,9 +38,6 @@ #include "scene/gui/label.h" #include "scene/gui/line_edit.h" #include "scene/gui/tree.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class CreateDialog : public ConfirmationDialog { diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index a8ba54d4f8..0f99e2ba1e 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -266,8 +266,8 @@ void DocData::generate(bool p_basic_types) { } } - if (default_value_valid) { - prop.default_value = default_value.get_construct_string(); + if (default_value_valid && default_value.get_type() != Variant::OBJECT) { + prop.default_value = default_value.get_construct_string().replace("\n", ""); } bool found_type = false; @@ -720,8 +720,7 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> & methods.push_back(method); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + parser->get_node_name()); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + parser->get_node_name() + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == section) @@ -741,10 +740,9 @@ Error DocData::load_classes(const String &p_dir) { da->list_dir_begin(); String path; - bool isdir; - path = da->get_next(&isdir); + path = da->get_next(); while (path != String()) { - if (!isdir && path.ends_with("xml")) { + if (!da->current_is_dir() && path.ends_with("xml")) { Ref<XMLParser> parser = memnew(XMLParser); Error err2 = parser->open(p_dir.plus_file(path)); if (err2) @@ -752,7 +750,7 @@ Error DocData::load_classes(const String &p_dir) { _load(parser); } - path = da->get_next(&isdir); + path = da->get_next(); } da->list_dir_end(); @@ -771,13 +769,12 @@ Error DocData::erase_classes(const String &p_dir) { da->list_dir_begin(); String path; - bool isdir; - path = da->get_next(&isdir); + path = da->get_next(); while (path != String()) { - if (!isdir && path.ends_with("xml")) { + if (!da->current_is_dir() && path.ends_with("xml")) { to_erase.push_back(path); } - path = da->get_next(&isdir); + path = da->get_next(); } da->list_dir_end(); @@ -843,8 +840,7 @@ Error DocData::_load(Ref<XMLParser> parser) { if (parser->get_node_type() == XMLParser::NODE_TEXT) c.tutorials.push_back(parser->get_node_data().strip_edges()); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name3); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "tutorials") break; //end of <tutorials> @@ -885,8 +881,7 @@ Error DocData::_load(Ref<XMLParser> parser) { prop2.description = parser->get_node_data(); c.properties.push_back(prop2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name3); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "members") @@ -914,8 +909,7 @@ Error DocData::_load(Ref<XMLParser> parser) { prop2.description = parser->get_node_data(); c.theme_properties.push_back(prop2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name3); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "theme_items") @@ -945,8 +939,7 @@ Error DocData::_load(Ref<XMLParser> parser) { constant2.description = parser->get_node_data(); c.constants.push_back(constant2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name3); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "constants") @@ -955,8 +948,7 @@ Error DocData::_load(Ref<XMLParser> parser) { } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name2); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name2 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "class") @@ -993,10 +985,8 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri Error err; String save_file = save_path.plus_file(c.name + ".xml"); FileAccessRef f = FileAccess::open(save_file, FileAccess::WRITE, &err); - if (err) { - ERR_EXPLAIN("Can't write doc file: " + save_file); - ERR_CONTINUE(err); - } + + ERR_CONTINUE_MSG(err != OK, "Can't write doc file: " + save_file + "."); _write_string(f, 0, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index bea1980b09..b2567249d8 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -181,14 +181,14 @@ EditorAbout::EditorAbout() { // Thirdparty License VBoxContainer *license_thirdparty = memnew(VBoxContainer); - license_thirdparty->set_name(TTR("Thirdparty License")); + license_thirdparty->set_name(TTR("Third-party Licenses")); license_thirdparty->set_h_size_flags(Control::SIZE_EXPAND_FILL); tc->add_child(license_thirdparty); Label *tpl_label = memnew(Label); tpl_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); tpl_label->set_autowrap(true); - tpl_label->set_text(TTR("Godot Engine relies on a number of thirdparty free and open source libraries, all compatible with the terms of its MIT license. The following is an exhaustive list of all such thirdparty components with their respective copyright statements and license terms.")); + tpl_label->set_text(TTR("Godot Engine relies on a number of third-party free and open source libraries, all compatible with the terms of its MIT license. The following is an exhaustive list of all such third-party components with their respective copyright statements and license terms.")); tpl_label->set_size(Size2(630, 1) * EDSCALE); license_thirdparty->add_child(tpl_label); diff --git a/editor/editor_about.h b/editor/editor_about.h index 87e824083e..e2ba366c65 100644 --- a/editor/editor_about.h +++ b/editor/editor_about.h @@ -43,9 +43,6 @@ #include "scene/gui/tree.h" #include "editor_scale.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class EditorAbout : public AcceptDialog { diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 12df91a501..98e670f952 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -90,7 +90,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { unzFile pkg = unzOpen2(p_path.utf8().get_data(), &io); if (!pkg) { - error->set_text(TTR("Error opening package file, not in zip format.")); + error->set_text(TTR("Error opening package file, not in ZIP format.")); return; } @@ -111,18 +111,14 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { Map<String, Ref<Texture> > extension_guess; { - extension_guess["png"] = get_icon("Texture", "EditorIcons"); - extension_guess["jpg"] = get_icon("Texture", "EditorIcons"); - extension_guess["tex"] = get_icon("Texture", "EditorIcons"); - extension_guess["atlastex"] = get_icon("Texture", "EditorIcons"); - extension_guess["dds"] = get_icon("Texture", "EditorIcons"); + extension_guess["png"] = get_icon("ImageTexture", "EditorIcons"); + extension_guess["jpg"] = get_icon("ImageTexture", "EditorIcons"); + extension_guess["atlastex"] = get_icon("AtlasTexture", "EditorIcons"); extension_guess["scn"] = get_icon("PackedScene", "EditorIcons"); extension_guess["tscn"] = get_icon("PackedScene", "EditorIcons"); - extension_guess["xml"] = get_icon("PackedScene", "EditorIcons"); - extension_guess["xscn"] = get_icon("PackedScene", "EditorIcons"); - extension_guess["material"] = get_icon("Material", "EditorIcons"); - extension_guess["shd"] = get_icon("Shader", "EditorIcons"); + extension_guess["shader"] = get_icon("Shader", "EditorIcons"); extension_guess["gd"] = get_icon("GDScript", "EditorIcons"); + extension_guess["vs"] = get_icon("VisualScript", "EditorIcons"); } Ref<Texture> generic_extension = get_icon("Object", "EditorIcons"); @@ -221,7 +217,7 @@ void EditorAssetInstaller::ok_pressed() { unzFile pkg = unzOpen2(package_path.utf8().get_data(), &io); if (!pkg) { - error->set_text(TTR("Error opening package file, not in zip format.")); + error->set_text(TTR("Error opening package file, not in ZIP format.")); return; } diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 7210211d90..f44e1b7b14 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -315,8 +315,7 @@ void EditorAutoloadSettings::_autoload_file_callback(const String &p_path) { Node *EditorAutoloadSettings::_create_autoload(const String &p_path) { RES res = ResourceLoader::load(p_path); - ERR_EXPLAIN("Can't autoload: " + p_path); - ERR_FAIL_COND_V(res.is_null(), NULL); + ERR_FAIL_COND_V_MSG(res.is_null(), NULL, "Can't autoload: " + p_path + "."); Node *n = NULL; if (res->is_class("PackedScene")) { Ref<PackedScene> ps = res; @@ -325,20 +324,17 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); - ERR_EXPLAIN("Script does not inherit a Node: " + p_path); - ERR_FAIL_COND_V(!valid_type, NULL); + ERR_FAIL_COND_V_MSG(!valid_type, NULL, "Script does not inherit a Node: " + p_path + "."); Object *obj = ClassDB::instance(ibt); - ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt)); - ERR_FAIL_COND_V(obj == NULL, NULL); + ERR_FAIL_COND_V_MSG(obj == NULL, NULL, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + "."); n = Object::cast_to<Node>(obj); n->set_script(s.get_ref_ptr()); } - ERR_EXPLAIN("Path in autoload not a node or script: " + p_path); - ERR_FAIL_COND_V(!n, NULL); + ERR_FAIL_COND_V_MSG(!n, NULL, "Path in autoload not a node or script: " + p_path + "."); return n; } @@ -443,11 +439,11 @@ void EditorAutoloadSettings::update_autoload() { } if (info.in_editor) { ERR_CONTINUE(!info.node); - get_tree()->get_root()->remove_child(info.node); + get_tree()->get_root()->call_deferred("remove_child", info.node); } if (info.node) { - memdelete(info.node); + info.node->queue_delete(); info.node = NULL; } } diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h index 76ce020d8a..1ea2950df4 100644 --- a/editor/editor_autoload_settings.h +++ b/editor/editor_autoload_settings.h @@ -56,7 +56,7 @@ class EditorAutoloadSettings : public VBoxContainer { int order; Node *node; - bool operator==(const AutoLoadInfo &p_info) { + bool operator==(const AutoLoadInfo &p_info) const { return order == p_info.order; } diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 38f30df169..c98635d16b 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -499,7 +499,6 @@ Object *EditorData::instance_custom_type(const String &p_type, const String &p_i for (int i = 0; i < get_custom_types()[p_inherits].size(); i++) { if (get_custom_types()[p_inherits][i].name == p_type) { - Ref<Texture> icon = get_custom_types()[p_inherits][i].icon; Ref<Script> script = get_custom_types()[p_inherits][i].script; Object *ob = ClassDB::instance(p_inherits); @@ -508,8 +507,6 @@ Object *EditorData::instance_custom_type(const String &p_type, const String &p_i ob->call("set_name", p_type); } ob->set_script(script.get_ref_ptr()); - if (icon.is_valid()) - ob->set_meta("_editor_icon", icon); return ob; } } @@ -540,6 +537,7 @@ int EditorData::add_edited_scene(int p_at_pos) { p_at_pos = edited_scene.size(); EditedScene es; es.root = NULL; + es.path = String(); es.history_current = -1; es.version = 0; es.live_edit_root = NodePath(String("/root")); @@ -656,6 +654,8 @@ bool EditorData::check_and_update_scene(int p_idx) { memdelete(edited_scene[p_idx].root); edited_scene.write[p_idx].root = new_scene; + if (new_scene->get_filename() != "") + edited_scene.write[p_idx].path = new_scene->get_filename(); edited_scene.write[p_idx].selection = new_selection; return true; @@ -687,6 +687,12 @@ void EditorData::set_edited_scene_root(Node *p_root) { ERR_FAIL_INDEX(current_edited_scene, edited_scene.size()); edited_scene.write[current_edited_scene].root = p_root; + if (p_root) { + if (p_root->get_filename() != "") + edited_scene.write[current_edited_scene].path = p_root->get_filename(); + else + p_root->set_filename(edited_scene[current_edited_scene].path); + } } int EditorData::get_edited_scene_count() const { @@ -776,6 +782,7 @@ String EditorData::get_scene_title(int p_idx) const { void EditorData::set_scene_path(int p_idx, const String &p_path) { ERR_FAIL_INDEX(p_idx, edited_scene.size()); + edited_scene.write[p_idx].path = p_path; if (!edited_scene[p_idx].root) return; @@ -786,9 +793,14 @@ String EditorData::get_scene_path(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), String()); - if (!edited_scene[p_idx].root) - return ""; - return edited_scene[p_idx].root->get_filename(); + if (edited_scene[p_idx].root) { + if (edited_scene[p_idx].root->get_filename() == "") + edited_scene[p_idx].root->set_filename(edited_scene[p_idx].path); + else + return edited_scene[p_idx].root->get_filename(); + } + + return edited_scene[p_idx].path; } void EditorData::set_edited_scene_live_edit_root(const NodePath &p_root) { diff --git a/editor/editor_data.h b/editor/editor_data.h index 845878e070..df83135942 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -117,6 +117,7 @@ public: struct EditedScene { Node *root; + String path; Dictionary editor_states; List<Node *> selection; Vector<EditorHistory::History> history_stored; diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 7c42f9f56d..e58c7c992a 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -30,11 +30,12 @@ #include "editor_export.h" +#include "core/crypto/crypto_core.h" #include "core/io/config_file.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/io/zip_io.h" -#include "core/math/crypto_core.h" +#include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/project_settings.h" #include "core/script_language.h" @@ -890,6 +891,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & String engine_cfb = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp" + config_file); ProjectSettings::get_singleton()->save_custom(engine_cfb, custom_map, custom_list); Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb); + DirAccess::remove_file_or_error(engine_cfb); p_func(p_udata, "res://" + config_file, data, idx, total); @@ -922,8 +924,10 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, c memdelete(ftmp); //close tmp file - if (err) + if (err != OK) { + DirAccess::remove_file_or_error(tmppath); return err; + } pd.file_ofs.sort(); //do sort, so we can do binary search later @@ -932,11 +936,17 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, c if (!p_embed) { // Regular output to separate PCK file f = FileAccess::open(p_path, FileAccess::WRITE); - ERR_FAIL_COND_V(!f, ERR_CANT_CREATE); + if (!f) { + DirAccess::remove_file_or_error(tmppath); + ERR_FAIL_V(ERR_CANT_CREATE); + } } else { // Append to executable f = FileAccess::open(p_path, FileAccess::READ_WRITE); - ERR_FAIL_COND_V(!f, ERR_FILE_CANT_OPEN); + if (!f) { + DirAccess::remove_file_or_error(tmppath); + ERR_FAIL_V(ERR_FILE_CANT_OPEN); + } f->seek_end(); embed_pos = f->get_position(); @@ -1001,13 +1011,13 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, c f->store_8(0); } - //save the rest of the data + // Save the rest of the data. ftmp = FileAccess::open(tmppath, FileAccess::READ); if (!ftmp) { memdelete(f); - ERR_EXPLAIN("Can't open file to read from path: " + String(tmppath)); - ERR_FAIL_V(ERR_CANT_CREATE); + DirAccess::remove_file_or_error(tmppath); + ERR_FAIL_V_MSG(ERR_CANT_CREATE, "Can't open file to read from path: " + String(tmppath) + "."); } const int bufsize = 16384; @@ -1041,6 +1051,7 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, c } memdelete(f); + DirAccess::remove_file_or_error(tmppath); return OK; } @@ -1049,8 +1060,6 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co EditorProgress ep("savezip", TTR("Packing"), 102, true); - //FileAccess *tmp = FileAccess::open(tmppath,FileAccess::WRITE); - FileAccess *src_f; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); zipFile zip = zipOpen2(p_path.utf8().get_data(), APPEND_STATUS_CREATE, NULL, &io); @@ -1700,11 +1709,18 @@ void EditorExportTextSceneToBinaryPlugin::_export_file(const String &p_path, con bool convert = GLOBAL_GET("editor/convert_text_resources_to_binary_on_export"); if (!convert) return; - String tmp_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("file.res"); + String tmp_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpfile.res"); Error err = ResourceFormatLoaderText::convert_file_to_binary(p_path, tmp_path); - ERR_FAIL_COND(err != OK); + if (err != OK) { + DirAccess::remove_file_or_error(tmp_path); + ERR_FAIL(); + } Vector<uint8_t> data = FileAccess::get_file_as_array(tmp_path); - ERR_FAIL_COND(data.size() == 0); + if (data.size() == 0) { + DirAccess::remove_file_or_error(tmp_path); + ERR_FAIL(); + } + DirAccess::remove_file_or_error(tmp_path); add_file(p_path + ".converted.res", data, true); } diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 24c5a788b6..80aeeef868 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "editor_file_dialog.h" + #include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" @@ -256,6 +257,7 @@ void EditorFileDialog::_post_popup() { if (is_visible_in_tree()) { Ref<Texture> folder = get_icon("folder", "FileDialog"); + const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); recent->clear(); bool res = access == ACCESS_RESOURCES; @@ -273,6 +275,7 @@ void EditorFileDialog::_post_popup() { recent->add_item(name, folder); recent->set_item_metadata(recent->get_item_count() - 1, recentd[i]); + recent->set_item_icon_modulate(recent->get_item_count() - 1, folder_color); } local_history.clear(); @@ -679,7 +682,12 @@ void EditorFileDialog::update_file_name() { String filter_str = filters[idx]; String file_str = file->get_text(); String base_name = file_str.get_basename(); - file_str = base_name + "." + filter_str.split(";")[1].strip_edges().to_lower(); + Vector<String> filter_substr = filter_str.split(";"); + if (filter_substr.size() >= 2) { + file_str = base_name + "." + filter_substr[1].strip_edges().to_lower(); + } else { + file_str = base_name + "." + filter_str.get_extension().strip_edges().to_lower(); + } file->set_text(file_str); } } @@ -728,22 +736,19 @@ void EditorFileDialog::update_file_list() { dir_access->list_dir_begin(); Ref<Texture> folder = get_icon("folder", "FileDialog"); + const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); List<String> files; List<String> dirs; - bool is_dir; - bool is_hidden; String item; - while ((item = dir_access->get_next(&is_dir)) != "") { + while ((item = dir_access->get_next()) != "") { if (item == "." || item == "..") continue; - is_hidden = dir_access->current_is_hidden(); - - if (show_hidden_files || !is_hidden) { - if (!is_dir) + if (show_hidden_files || !dir_access->current_is_hidden()) { + if (!dir_access->current_is_dir()) files.push_back(item); else dirs.push_back(item); @@ -772,6 +777,7 @@ void EditorFileDialog::update_file_list() { d["dir"] = true; item_list->set_item_metadata(item_list->get_item_count() - 1, d); + item_list->set_item_icon_modulate(item_list->get_item_count() - 1, folder_color); dirs.pop_front(); } @@ -1198,6 +1204,7 @@ void EditorFileDialog::_update_favorites() { String current = get_current_dir(); Ref<Texture> folder_icon = get_icon("Folder", "EditorIcons"); + const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); favorites->clear(); favorite->set_pressed(false); @@ -1228,6 +1235,7 @@ void EditorFileDialog::_update_favorites() { } favorites->set_item_metadata(favorites->get_item_count() - 1, favorited[i]); + favorites->set_item_icon_modulate(favorites->get_item_count() - 1, folder_color); if (setthis) { favorite->set_pressed(true); @@ -1507,9 +1515,9 @@ EditorFileDialog::EditorFileDialog() { HBoxContainer *pathhb = memnew(HBoxContainer); dir_prev = memnew(ToolButton); - dir_prev->set_tooltip(TTR("Previous Folder")); + dir_prev->set_tooltip(TTR("Go to previous folder.")); dir_next = memnew(ToolButton); - dir_next->set_tooltip(TTR("Next Folder")); + dir_next->set_tooltip(TTR("Go to next folder.")); dir_up = memnew(ToolButton); dir_up->set_tooltip(TTR("Go to parent folder.")); @@ -1528,7 +1536,7 @@ EditorFileDialog::EditorFileDialog() { dir->set_h_size_flags(SIZE_EXPAND_FILL); refresh = memnew(ToolButton); - refresh->set_tooltip(TTR("Refresh")); + refresh->set_tooltip(TTR("Refresh files.")); refresh->connect("pressed", this, "_update_file_list"); pathhb->add_child(refresh); @@ -1541,7 +1549,7 @@ EditorFileDialog::EditorFileDialog() { show_hidden = memnew(ToolButton); show_hidden->set_toggle_mode(true); show_hidden->set_pressed(is_showing_hidden_files()); - show_hidden->set_tooltip(TTR("Toggle visibility of hidden files.")); + show_hidden->set_tooltip(TTR("Toggle the visibility of hidden files.")); show_hidden->connect("toggled", this, "set_show_hidden_files"); pathhb->add_child(show_hidden); diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 86bf0f0eb3..2ecfa7db15 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -44,9 +44,6 @@ class DependencyRemoveDialog; -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class EditorFileDialog : public ConfirmationDialog { GDCLASS(EditorFileDialog, ConfirmationDialog); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 87a37acac6..6d3377a85b 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -673,12 +673,11 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess da->list_dir_begin(); while (true) { - bool isdir; - String f = da->get_next(&isdir); + String f = da->get_next(); if (f == "") break; - if (isdir) { + if (da->current_is_dir()) { if (f.begins_with(".")) //ignore hidden and . / .. continue; @@ -870,12 +869,11 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const da->list_dir_begin(); while (true) { - bool isdir; - String f = da->get_next(&isdir); + String f = da->get_next(); if (f == "") break; - if (isdir) { + if (da->current_is_dir()) { if (f.begins_with(".")) //ignore hidden and . / .. continue; @@ -1932,8 +1930,7 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) { Error err = da->make_dir(".import"); if (err) { memdelete(da); - ERR_EXPLAIN("Failed to create 'res://.import' folder."); - ERR_FAIL(); + ERR_FAIL_MSG("Failed to create 'res://.import' folder."); } } memdelete(da); diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 40ecffbb3b..55cae35a4a 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -93,8 +93,32 @@ void editor_register_fonts(Ref<Theme> p_theme) { /* Custom font */ - bool font_antialiased = (bool)EditorSettings::get_singleton()->get("interface/editor/main_font_antialiased"); - DynamicFontData::Hinting font_hinting = (DynamicFontData::Hinting)(int)EditorSettings::get_singleton()->get("interface/editor/main_font_hinting"); + bool font_antialiased = (bool)EditorSettings::get_singleton()->get("interface/editor/font_antialiased"); + int font_hinting_setting = (int)EditorSettings::get_singleton()->get("interface/editor/font_hinting"); + + DynamicFontData::Hinting font_hinting; + switch (font_hinting_setting) { + case 0: + // The "Auto" setting uses the setting that best matches the OS' font rendering: + // - macOS doesn't use font hinting. + // - Windows uses ClearType, which is in between "Light" and "Normal" hinting. + // - Linux has configurable font hinting, but most distributions including Ubuntu default to "Light". +#ifdef OSX_ENABLED + font_hinting = DynamicFontData::HINTING_NONE; +#else + font_hinting = DynamicFontData::HINTING_LIGHT; +#endif + break; + case 1: + font_hinting = DynamicFontData::HINTING_NONE; + break; + case 2: + font_hinting = DynamicFontData::HINTING_LIGHT; + break; + default: + font_hinting = DynamicFontData::HINTING_NORMAL; + break; + } String custom_font_path = EditorSettings::get_singleton()->get("interface/editor/main_font"); Ref<DynamicFontData> CustomFont; @@ -125,13 +149,11 @@ void editor_register_fonts(Ref<Theme> p_theme) { /* Custom source code font */ String custom_font_path_source = EditorSettings::get_singleton()->get("interface/editor/code_font"); - bool font_source_antialiased = (bool)EditorSettings::get_singleton()->get("interface/editor/code_font_antialiased"); - DynamicFontData::Hinting font_source_hinting = (DynamicFontData::Hinting)(int)EditorSettings::get_singleton()->get("interface/editor/code_font_hinting"); Ref<DynamicFontData> CustomFontSource; if (custom_font_path_source.length() > 0 && dir->file_exists(custom_font_path_source)) { CustomFontSource.instance(); - CustomFontSource->set_antialiased(font_source_antialiased); - CustomFontSource->set_hinting(font_source_hinting); + CustomFontSource->set_antialiased(font_antialiased); + CustomFontSource->set_hinting(font_hinting); CustomFontSource->set_font_path(custom_font_path_source); } else { EditorSettings::get_singleton()->set_manually("interface/editor/code_font", ""); @@ -201,8 +223,8 @@ void editor_register_fonts(Ref<Theme> p_theme) { Ref<DynamicFontData> dfmono; dfmono.instance(); - dfmono->set_antialiased(font_source_antialiased); - dfmono->set_hinting(font_source_hinting); + dfmono->set_antialiased(font_antialiased); + dfmono->set_hinting(font_hinting); dfmono->set_font_ptr(_font_Hack_Regular, _font_Hack_Regular_size); int default_font_size = int(EDITOR_GET("interface/editor/main_font_size")) * EDSCALE; diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index cd5d26e577..385b6924df 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -444,6 +444,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->add_newline(); + class_desc->push_font(doc_code_font); class_desc->push_indent(1); class_desc->push_table(2); class_desc->set_table_column_expand(1, 1); @@ -509,6 +510,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); //table class_desc->pop(); + class_desc->pop(); // font class_desc->add_newline(); class_desc->add_newline(); } @@ -1425,11 +1427,10 @@ void EditorHelp::generate_doc() { void EditorHelp::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_READY: case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - _update_doc(); + _update_doc(); } break; default: break; } @@ -1571,7 +1572,6 @@ void EditorHelpBit::_notification(int p_what) { rich_text->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); } break; - default: break; } } @@ -1601,6 +1601,10 @@ FindBar::FindBar() { search_text->connect("text_changed", this, "_search_text_changed"); search_text->connect("text_entered", this, "_search_text_entered"); + matches_label = memnew(Label); + add_child(matches_label); + matches_label->hide(); + find_prev = memnew(ToolButton); add_child(find_prev); find_prev->set_focus_mode(FOCUS_NONE); @@ -1611,9 +1615,9 @@ FindBar::FindBar() { find_next->set_focus_mode(FOCUS_NONE); find_next->connect("pressed", this, "_search_next"); - error_label = memnew(Label); - add_child(error_label); - error_label->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + Control *space = memnew(Control); + add_child(space); + space->set_custom_minimum_size(Size2(4, 0) * EDSCALE); hide_button = memnew(TextureButton); add_child(hide_button); @@ -1643,25 +1647,21 @@ void FindBar::popup_search() { void FindBar::_notification(int p_what) { - if (p_what == NOTIFICATION_READY) { - - find_prev->set_icon(get_icon("MoveUp", "EditorIcons")); - find_next->set_icon(get_icon("MoveDown", "EditorIcons")); - hide_button->set_normal_texture(get_icon("Close", "EditorIcons")); - hide_button->set_hover_texture(get_icon("Close", "EditorIcons")); - hide_button->set_pressed_texture(get_icon("Close", "EditorIcons")); - hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); - } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - - set_process_unhandled_input(is_visible_in_tree()); - } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - - find_prev->set_icon(get_icon("MoveUp", "EditorIcons")); - find_next->set_icon(get_icon("MoveDown", "EditorIcons")); - hide_button->set_normal_texture(get_icon("Close", "EditorIcons")); - hide_button->set_hover_texture(get_icon("Close", "EditorIcons")); - hide_button->set_pressed_texture(get_icon("Close", "EditorIcons")); - hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + + find_prev->set_icon(get_icon("MoveUp", "EditorIcons")); + find_next->set_icon(get_icon("MoveDown", "EditorIcons")); + hide_button->set_normal_texture(get_icon("Close", "EditorIcons")); + hide_button->set_hover_texture(get_icon("Close", "EditorIcons")); + hide_button->set_pressed_texture(get_icon("Close", "EditorIcons")); + hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); + } break; + case NOTIFICATION_VISIBILITY_CHANGED: { + + set_process_unhandled_input(is_visible_in_tree()); + } break; } } @@ -1706,17 +1706,46 @@ bool FindBar::_search(bool p_search_previous) { prev_search = stext; if (ret) { - set_error(""); + _update_results_count(); } else { - set_error(stext.empty() ? "" : TTR("No Matches")); + results_count = 0; } + _update_matches_label(); return ret; } -void FindBar::set_error(const String &p_label) { +void FindBar::_update_results_count() { + + results_count = 0; + + String searched = search_text->get_text(); + if (searched.empty()) return; + + String full_text = rich_text_label->get_text(); + + int from_pos = 0; + + while (true) { + int pos = full_text.find(searched, from_pos); + if (pos == -1) + break; + + results_count++; + from_pos = pos + searched.length(); + } +} + +void FindBar::_update_matches_label() { - error_label->set_text(p_label); + if (search_text->get_text().empty() || results_count == -1) { + matches_label->hide(); + } else { + matches_label->show(); + + matches_label->add_color_override("font_color", results_count > 0 ? Color(1, 1, 1) : EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count)); + } } void FindBar::_hide_bar() { diff --git a/editor/editor_help.h b/editor/editor_help.h index a50ab8a9f9..3824ba231e 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -49,18 +49,23 @@ class FindBar : public HBoxContainer { LineEdit *search_text; ToolButton *find_prev; ToolButton *find_next; - Label *error_label; + Label *matches_label; TextureButton *hide_button; String prev_search; RichTextLabel *rich_text_label; + int results_count; + void _show_search(); void _hide_bar(); void _search_text_changed(const String &p_text); void _search_text_entered(const String &p_text); + void _update_results_count(); + void _update_matches_label(); + void _update_size(); protected: @@ -72,8 +77,6 @@ protected: static void _bind_methods(); public: - void set_error(const String &p_label); - void set_rich_text_label(RichTextLabel *p_rich_text_label); void popup_search(); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index fbfc999dbf..af79c21f85 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -354,7 +354,7 @@ bool EditorHelpSearch::Runner::_phase_match_classes() { match.constants.push_back(const_cast<DocData::ConstantDoc *>(&class_doc.constants[i])); if (search_flags & SEARCH_PROPERTIES) for (int i = 0; i < class_doc.properties.size(); i++) - if (_match_string(term, class_doc.properties[i].name)) + if (_match_string(term, class_doc.properties[i].name) || _match_string(term, class_doc.properties[i].getter) || _match_string(term, class_doc.properties[i].setter)) match.properties.push_back(const_cast<DocData::PropertyDoc *>(&class_doc.properties[i])); if (search_flags & SEARCH_THEME_ITEMS) for (int i = 0; i < class_doc.theme_properties.size(); i++) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e4ddf44bc4..8b3e108690 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -378,7 +378,7 @@ bool EditorPropertyRevert::get_instanced_node_original_property(Node *p_node, co node = node->get_owner(); } - if (!found) { + if (!found && node) { //if not found, try default class value Variant attempt = ClassDB::class_get_default_property_value(node->get_class_name(), p_prop); if (attempt.get_type() != Variant::NIL) { @@ -504,7 +504,7 @@ bool EditorProperty::use_keying_next() const { PropertyInfo &p = I->get(); if (p.name == property) { - return p.hint == PROPERTY_HINT_SPRITE_FRAME; + return (p.usage & PROPERTY_USAGE_KEYING_INCREMENTS); } } @@ -1302,6 +1302,7 @@ void EditorInspector::remove_inspector_plugin(const Ref<EditorInspectorPlugin> & } } + ERR_FAIL_COND(idx == -1); for (int i = idx; i < inspector_plugin_count - 1; i++) { inspector_plugins[i] = inspector_plugins[i + 1]; } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3431930b8b..3e97dbd96c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -238,185 +238,190 @@ void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) { void EditorNode::_notification(int p_what) { - if (p_what == NOTIFICATION_EXIT_TREE) { + switch (p_what) { + case NOTIFICATION_PROCESS: { + if (opening_prev && !confirmation->is_visible()) + opening_prev = false; - editor_data.save_editor_external_data(); - FileAccess::set_file_close_fail_notify_callback(NULL); - log->deinit(); // do not get messages anymore - } - if (p_what == NOTIFICATION_PROCESS) { + if (unsaved_cache != (saved_version != editor_data.get_undo_redo().get_version())) { - if (opening_prev && !confirmation->is_visible()) - opening_prev = false; + unsaved_cache = (saved_version != editor_data.get_undo_redo().get_version()); + _update_title(); + } - if (unsaved_cache != (saved_version != editor_data.get_undo_redo().get_version())) { + if (last_checked_version != editor_data.get_undo_redo().get_version()) { + _update_scene_tabs(); + last_checked_version = editor_data.get_undo_redo().get_version(); + } - unsaved_cache = (saved_version != editor_data.get_undo_redo().get_version()); - _update_title(); - } + // update the animation frame of the update spinner + uint64_t frame = Engine::get_singleton()->get_frames_drawn(); + uint32_t tick = OS::get_singleton()->get_ticks_msec(); - if (last_checked_version != editor_data.get_undo_redo().get_version()) { - _update_scene_tabs(); - last_checked_version = editor_data.get_undo_redo().get_version(); - } + if (frame != update_spinner_step_frame && (tick - update_spinner_step_msec) > (1000 / 8)) { - // update the animation frame of the update spinner - uint64_t frame = Engine::get_singleton()->get_frames_drawn(); - uint32_t tick = OS::get_singleton()->get_ticks_msec(); + update_spinner_step++; + if (update_spinner_step >= 8) + update_spinner_step = 0; - if (frame != update_spinner_step_frame && (tick - update_spinner_step_msec) > (1000 / 8)) { + update_spinner_step_msec = tick; + update_spinner_step_frame = frame + 1; - update_spinner_step++; - if (update_spinner_step >= 8) - update_spinner_step = 0; + // update the icon itself only when the spinner is visible + if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) { + update_spinner->set_icon(gui_base->get_icon("Progress" + itos(update_spinner_step + 1), "EditorIcons")); + } + } - update_spinner_step_msec = tick; - update_spinner_step_frame = frame + 1; + editor_selection->update(); - // update the icon itself only when the spinner is visible - if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) { - update_spinner->set_icon(gui_base->get_icon("Progress" + itos(update_spinner_step + 1), "EditorIcons")); - } - } + scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"))); - editor_selection->update(); + ResourceImporterTexture::get_singleton()->update_imports(); + } break; - scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"))); + case NOTIFICATION_ENTER_TREE: { + Engine::get_singleton()->set_editor_hint(true); - ResourceImporterTexture::get_singleton()->update_imports(); - } - if (p_what == NOTIFICATION_ENTER_TREE) { + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); + get_tree()->get_root()->set_usage(Viewport::USAGE_2D_NO_SAMPLING); //reduce memory usage + get_tree()->get_root()->set_disable_3d(true); + get_tree()->get_root()->set_as_audio_listener(false); + get_tree()->get_root()->set_as_audio_listener_2d(false); + get_tree()->set_auto_accept_quit(false); + get_tree()->connect("files_dropped", this, "_dropped_files"); - Engine::get_singleton()->set_editor_hint(true); + /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ + } break; - OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); - get_tree()->get_root()->set_usage(Viewport::USAGE_2D_NO_SAMPLING); //reduce memory usage - get_tree()->get_root()->set_disable_3d(true); - get_tree()->get_root()->set_as_audio_listener(false); - get_tree()->get_root()->set_as_audio_listener_2d(false); - get_tree()->set_auto_accept_quit(false); - get_tree()->connect("files_dropped", this, "_dropped_files"); + case NOTIFICATION_EXIT_TREE: { + editor_data.save_editor_external_data(); + FileAccess::set_file_close_fail_notify_callback(NULL); + log->deinit(); // do not get messages anymore + editor_data.clear_edited_scenes(); + } break; - /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ - } + case NOTIFICATION_READY: { - if (p_what == NOTIFICATION_EXIT_TREE) { + VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true); + VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true); + VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true); - editor_data.clear_edited_scenes(); - } - if (p_what == NOTIFICATION_READY) { + feature_profile_manager->notify_changed(); - VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true); - VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true); - VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true); + if (!main_editor_buttons[EDITOR_3D]->is_visible()) { //may be hidden due to feature profile + _editor_select(EDITOR_2D); + } else { + _editor_select(EDITOR_3D); + } - feature_profile_manager->notify_changed(); + _update_debug_options(); - if (!main_editor_buttons[EDITOR_3D]->is_visible()) { //may be hidden due to feature profile - _editor_select(EDITOR_2D); - } else { - _editor_select(EDITOR_3D); - } + /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ + } break; - _update_debug_options(); + case MainLoop::NOTIFICATION_WM_FOCUS_IN: { - /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ - } + // Restore the original FPS cap after focusing back on the editor + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN) { + EditorFileSystem::get_singleton()->scan_changes(); + } break; - // Restore the original FPS cap after focusing back on the editor - OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); + case MainLoop::NOTIFICATION_WM_FOCUS_OUT: { - EditorFileSystem::get_singleton()->scan_changes(); - } + // Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/unfocused_low_processor_mode_sleep_usec"))); + } break; - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_OUT) { + case MainLoop::NOTIFICATION_WM_ABOUT: { - // Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused - OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/unfocused_low_processor_mode_sleep_usec"))); - } + show_about(); + } break; - if (p_what == MainLoop::NOTIFICATION_WM_QUIT_REQUEST) { + case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: { - _menu_option_confirm(FILE_QUIT, false); - } + _menu_option_confirm(FILE_QUIT, false); + } break; - if (p_what == 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()); + 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_base->set_theme(theme); - gui_base->set_theme(theme); + theme_base->set_theme(theme); + gui_base->set_theme(theme); - gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); - scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles")); - bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); - scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles")); - scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles")); + gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); + scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles")); + bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); + scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles")); + scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles")); - file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) { - scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); - } else { - scene_tabs->set_min_width(0); - } - _update_scene_tabs(); + if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) { + scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); + } else { + scene_tabs->set_min_width(0); + } + _update_scene_tabs(); - recent_scenes->set_as_minsize(); + recent_scenes->set_as_minsize(); - // debugger area - if (ScriptEditor::get_singleton()->get_debugger()->is_visible()) - bottom_panel->add_style_override("panel", gui_base->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); + // debugger area + if (ScriptEditor::get_singleton()->get_debugger()->is_visible()) + bottom_panel->add_style_override("panel", gui_base->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); - // update_icons - for (int i = 0; i < singleton->main_editor_buttons.size(); i++) { + // update_icons + for (int i = 0; i < singleton->main_editor_buttons.size(); i++) { - ToolButton *tb = singleton->main_editor_buttons[i]; - EditorPlugin *p_editor = singleton->editor_table[i]; - Ref<Texture> icon = p_editor->get_icon(); + ToolButton *tb = singleton->main_editor_buttons[i]; + EditorPlugin *p_editor = singleton->editor_table[i]; + Ref<Texture> icon = p_editor->get_icon(); - if (icon.is_valid()) { - tb->set_icon(icon); - } else if (singleton->gui_base->has_icon(p_editor->get_name(), "EditorIcons")) { - tb->set_icon(singleton->gui_base->get_icon(p_editor->get_name(), "EditorIcons")); + if (icon.is_valid()) { + tb->set_icon(icon); + } else if (singleton->gui_base->has_icon(p_editor->get_name(), "EditorIcons")) { + tb->set_icon(singleton->gui_base->get_icon(p_editor->get_name(), "EditorIcons")); + } } - } - _build_icon_type_cache(); + _build_icon_type_cache(); - play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); - play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); - play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); - pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons")); - stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons")); + play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); + play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); + play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); + pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons")); + stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons")); - prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons")); - distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons")); - scene_tab_add->set_icon(gui_base->get_icon("Add", "EditorIcons")); + prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons")); + distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons")); + scene_tab_add->set_icon(gui_base->get_icon("Add", "EditorIcons")); - // clear_button->set_icon(gui_base->get_icon("Close", "EditorIcons")); don't have access to that node. needs to become a class property - dock_tab_move_left->set_icon(theme->get_icon("Back", "EditorIcons")); - dock_tab_move_right->set_icon(theme->get_icon("Forward", "EditorIcons")); + bottom_panel_raise->set_icon(gui_base->get_icon("ExpandBottomDock", "EditorIcons")); - PopupMenu *p = help_menu->get_popup(); - p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_icon("HelpSearch", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_DOCS), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_QA), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_ISSUES), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_icon("Godot", "EditorIcons")); + // clear_button->set_icon(gui_base->get_icon("Close", "EditorIcons")); don't have access to that node. needs to become a class property + dock_tab_move_left->set_icon(theme->get_icon("Back", "EditorIcons")); + dock_tab_move_right->set_icon(theme->get_icon("Forward", "EditorIcons")); - _update_update_spinner(); - } + PopupMenu *p = help_menu->get_popup(); + p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_icon("HelpSearch", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_DOCS), gui_base->get_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_QA), gui_base->get_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_ISSUES), gui_base->get_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_icon("Godot", "EditorIcons")); - if (p_what == Control::NOTIFICATION_RESIZED) { - _update_scene_tabs(); + _update_update_spinner(); + } break; + + case Control::NOTIFICATION_RESIZED: { + _update_scene_tabs(); + } break; } } @@ -834,7 +839,7 @@ void EditorNode::_get_scene_metadata(const String &p_file) { for (List<String>::Element *E = esl.front(); E; E = E->next()) { Variant st = cf->get_value("editor_states", E->get()); - if (st.get_type()) { + if (st.get_type() != Variant::NIL) { md[E->get()] = st; } } @@ -1576,6 +1581,7 @@ void EditorNode::push_item(Object *p_object, const String &p_property, bool p_in get_inspector()->edit(NULL); node_dock->set_node(NULL); scene_tree_dock->set_selected(NULL); + inspector_dock->update(NULL); return; } @@ -1664,9 +1670,10 @@ void EditorNode::_edit_current() { Resource *current_res = Object::cast_to<Resource>(current_obj); ERR_FAIL_COND(!current_res); - scene_tree_dock->set_selected(NULL); get_inspector()->edit(current_res); + scene_tree_dock->set_selected(NULL); node_dock->set_node(NULL); + inspector_dock->update(NULL); EditorNode::get_singleton()->get_import_dock()->set_edit_path(current_res->get_path()); int subr_idx = current_res->get_path().find("::"); @@ -1693,9 +1700,11 @@ void EditorNode::_edit_current() { if (current_node->is_inside_tree()) { node_dock->set_node(current_node); scene_tree_dock->set_selected(current_node); + inspector_dock->update(current_node); } else { node_dock->set_node(NULL); scene_tree_dock->set_selected(NULL); + inspector_dock->update(NULL); } if (get_edited_scene() && get_edited_scene()->get_filename() != String()) { @@ -1715,6 +1724,8 @@ void EditorNode::_edit_current() { get_inspector()->edit(current_obj); node_dock->set_node(NULL); + scene_tree_dock->set_selected(NULL); + inspector_dock->update(NULL); } inspector_dock->set_warning(editable_warning); @@ -1915,10 +1926,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { switch (p_option) { case FILE_NEW_SCENE: { - int idx = editor_data.add_edited_scene(-1); - _scene_tab_changed(idx); - editor_data.clear_editor_states(); - _update_scene_tabs(); + new_scene(); } break; case FILE_NEW_INHERITED_SCENE: @@ -1965,6 +1973,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { break; opening_prev = true; open_request(previous_scenes.back()->get()); + previous_scenes.pop_back(); } break; case FILE_CLOSE_OTHERS: @@ -2490,12 +2499,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { screenshot_timer->start(); } break; - case EDITOR_OPEN_SCREENSHOT: { - - bool is_checked = settings_menu->get_popup()->is_item_checked(settings_menu->get_popup()->get_item_index(EDITOR_OPEN_SCREENSHOT)); - settings_menu->get_popup()->set_item_checked(settings_menu->get_popup()->get_item_index(EDITOR_OPEN_SCREENSHOT), !is_checked); - EditorSettings::get_singleton()->set_project_metadata("screenshot_options", "open_screenshot", !is_checked); - } break; case SETTINGS_PICK_MAIN_SCENE: { file->set_mode(EditorFileDialog::MODE_OPEN_FILE); @@ -2543,8 +2546,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { restart_editor(); } break; default: { - if (p_option >= IMPORT_PLUGIN_BASE) { - } } } } @@ -2557,7 +2558,7 @@ void EditorNode::_screenshot(bool p_use_utc) { String name = "editor_screenshot_" + OS::get_singleton()->get_iso_date_time(p_use_utc).replace(":", "") + ".png"; NodePath path = String("user://") + name; _save_screenshot(path); - if (EditorSettings::get_singleton()->get_project_metadata("screenshot_options", "open_screenshot", true)) { + if (EditorSettings::get_singleton()->get("interface/editor/automatically_open_screenshots")) { OS::get_singleton()->shell_open(String("file://") + ProjectSettings::get_singleton()->globalize_path(path)); } } @@ -2625,7 +2626,7 @@ void EditorNode::_exit_editor() { // Dim the editor window while it's quitting to make it clearer that it's busy. // No transition is applied, as the effect needs to be visible immediately - float c = 1.0f - float(EDITOR_GET("interface/editor/dim_amount")); + float c = 0.4f; Color dim_color = Color(c, c, c); gui_base->set_modulate(dim_color); @@ -2644,6 +2645,14 @@ void EditorNode::_discard_changes(const String &p_str) { case FILE_CLOSE_ALL: case SCENE_TAB_CLOSE: { + Node *scene = editor_data.get_edited_scene_root(tab_closing); + if (scene != NULL) { + String scene_filename = scene->get_filename(); + if (scene_filename != "") { + previous_scenes.push_back(scene_filename); + } + } + _remove_scene(tab_closing); _update_scene_tabs(); @@ -2709,6 +2718,21 @@ void EditorNode::_update_debug_options() { if (check_reload_scripts) _menu_option_confirm(RUN_RELOAD_SCRIPTS, true); } +void EditorNode::_update_file_menu_opened() { + + Ref<ShortCut> close_scene_sc = ED_GET_SHORTCUT("editor/close_scene"); + close_scene_sc->set_name(TTR("Close Scene")); + Ref<ShortCut> reopen_closed_scene_sc = ED_GET_SHORTCUT("editor/reopen_closed_scene"); + reopen_closed_scene_sc->set_name(TTR("Reopen Closed Scene")); + PopupMenu *pop = file_menu->get_popup(); + pop->set_item_disabled(pop->get_item_index(FILE_OPEN_PREV), previous_scenes.empty()); +} + +void EditorNode::_update_file_menu_closed() { + PopupMenu *pop = file_menu->get_popup(); + pop->set_item_disabled(pop->get_item_index(FILE_OPEN_PREV), false); +} + Control *EditorNode::get_viewport() { return viewport; @@ -2761,6 +2785,19 @@ void EditorNode::_editor_select(int p_which) { } } +void EditorNode::select_editor_by_name(const String &p_name) { + ERR_FAIL_COND(p_name == ""); + + for (int i = 0; i < main_editor_buttons.size(); i++) { + if (main_editor_buttons[i]->get_text() == p_name) { + _editor_select(i); + return; + } + } + + ERR_FAIL_MSG("The editor name '" + p_name + "' was not found."); +} + void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed) { if (p_editor->has_main_screen()) { @@ -2884,36 +2921,39 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled, return; } - String path = cf->get_value("plugin", "script"); - path = String("res://addons").plus_file(p_addon).plus_file(path); + String script_path = cf->get_value("plugin", "script"); + Ref<Script> script; // We need to save it for creating "ep" below. - Ref<Script> script = ResourceLoader::load(path); + // Only try to load the script if it has a name. Else, the plugin has no init script. + if (script_path.length() > 0) { + script_path = String("res://addons").plus_file(p_addon).plus_file(script_path); + script = ResourceLoader::load(script_path); - if (script.is_null()) { - show_warning(vformat(TTR("Unable to load addon script from path: '%s'."), path)); - return; - } + if (script.is_null()) { + show_warning(vformat(TTR("Unable to load addon script from path: '%s'."), script_path)); + return; + } - //errors in the script cause the base_type to be "" - if (String(script->get_instance_base_type()) == "") { - show_warning(vformat(TTR("Unable to load addon script from path: '%s' There seems to be an error in the code, please check the syntax."), path)); - return; - } + // Errors in the script cause the base_type to be an empty string. + if (String(script->get_instance_base_type()) == "") { + show_warning(vformat(TTR("Unable to load addon script from path: '%s' There seems to be an error in the code, please check the syntax."), script_path)); + return; + } - //could check inheritance.. - if (String(script->get_instance_base_type()) != "EditorPlugin") { - show_warning(vformat(TTR("Unable to load addon script from path: '%s' Base type is not EditorPlugin."), path)); - return; - } + // Plugin init scripts must inherit from EditorPlugin and be tools. + if (String(script->get_instance_base_type()) != "EditorPlugin") { + show_warning(vformat(TTR("Unable to load addon script from path: '%s' Base type is not EditorPlugin."), script_path)); + return; + } - if (!script->is_tool()) { - show_warning(vformat(TTR("Unable to load addon script from path: '%s' Script is not in tool mode."), path)); - return; + if (!script->is_tool()) { + show_warning(vformat(TTR("Unable to load addon script from path: '%s' Script is not in tool mode."), script_path)); + return; + } } EditorPlugin *ep = memnew(EditorPlugin); ep->set_script(script.get_ref_ptr()); - ep->set_dir_cache(p_addon); plugin_addons[p_addon] = ep; add_editor_plugin(ep, p_config_changed); @@ -3121,6 +3161,14 @@ void EditorNode::fix_dependencies(const String &p_for_file) { dependency_fixer->edit(p_for_file); } +int EditorNode::new_scene() { + int idx = editor_data.add_edited_scene(-1); + _scene_tab_changed(idx); + editor_data.clear_editor_states(); + _update_scene_tabs(); + return idx; +} + Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, bool p_set_inherited, bool p_clear_errors, bool p_force_open_imported) { if (!is_inside_tree()) { @@ -3281,6 +3329,13 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b void EditorNode::open_request(const String &p_path) { + if (!opening_prev) { + List<String>::Element *prev_scene = previous_scenes.find(p_path); + if (prev_scene != NULL) { + prev_scene->erase(); + } + } + load_scene(p_path); // as it will be opened in separate tab } @@ -3490,6 +3545,69 @@ void EditorNode::stop_child_process() { _menu_option_confirm(RUN_STOP, false); } +Ref<Script> EditorNode::get_object_custom_type_base(const Object *p_object) const { + ERR_FAIL_COND_V(!p_object, NULL); + + Ref<Script> script = p_object->get_script(); + + if (script.is_valid()) { + // Uncommenting would break things! Consider adding a parameter if you need it. + // StringName name = EditorNode::get_editor_data().script_class_get_name(base_script->get_path()); + // if (name != StringName()) + // return name; + + // should probably be deprecated in 4.x + StringName base = script->get_instance_base_type(); + if (base != StringName() && EditorNode::get_editor_data().get_custom_types().has(base)) { + const Vector<EditorData::CustomType> &types = EditorNode::get_editor_data().get_custom_types()[base]; + + Ref<Script> base_script = script; + while (base_script.is_valid()) { + for (int i = 0; i < types.size(); ++i) { + if (types[i].script == base_script) { + return types[i].script; + } + } + base_script = base_script->get_base_script(); + } + } + } + + return NULL; +} + +StringName EditorNode::get_object_custom_type_name(const Object *p_object) const { + ERR_FAIL_COND_V(!p_object, StringName()); + + Ref<Script> script = p_object->get_script(); + if (script.is_null() && p_object->is_class("Script")) { + script = p_object; + } + + if (script.is_valid()) { + Ref<Script> base_script = script; + while (base_script.is_valid()) { + StringName name = EditorNode::get_editor_data().script_class_get_name(base_script->get_path()); + if (name != StringName()) + return name; + + // should probably be deprecated in 4.x + StringName base = base_script->get_instance_base_type(); + if (base != StringName() && EditorNode::get_editor_data().get_custom_types().has(base)) { + const Vector<EditorData::CustomType> &types = EditorNode::get_editor_data().get_custom_types()[base]; + for (int i = 0; i < types.size(); ++i) { + if (types[i].script == base_script) { + return types[i].name; + } + } + } + base_script = base_script->get_base_script(); + } + } + + return StringName(); +} + Ref<Texture> EditorNode::get_object_icon(const Object *p_object, const String &p_fallback) const { ERR_FAIL_COND_V(!p_object || !gui_base, NULL); @@ -3499,23 +3617,24 @@ Ref<Texture> EditorNode::get_object_icon(const Object *p_object, const String &p } if (script.is_valid()) { - StringName name = EditorNode::get_editor_data().script_class_get_name(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); - - // should probably be deprecated in 4.x - StringName base = script->get_instance_base_type(); - if (base != StringName()) { - const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types(); - for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) { - const Vector<EditorData::CustomType> &ct = E->value(); - for (int i = 0; i < ct.size(); ++i) { - if (ct[i].name == base && ct[i].icon.is_valid()) { - return ct[i].icon; + Ref<Script> base_script = script; + 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); + + // should probably be deprecated in 4.x + StringName base = base_script->get_instance_base_type(); + if (base != StringName() && EditorNode::get_editor_data().get_custom_types().has(base)) { + const Vector<EditorData::CustomType> &types = EditorNode::get_editor_data().get_custom_types()[base]; + for (int i = 0; i < types.size(); ++i) { + if (types[i].script == base_script && types[i].icon.is_valid()) { + return types[i].icon; } } } + base_script = base_script->get_base_script(); } } @@ -3708,9 +3827,13 @@ void EditorNode::show_accept(const String &p_text, const String &p_title) { void EditorNode::show_warning(const String &p_text, const String &p_title) { - warning->set_text(p_text); - warning->set_title(p_title); - warning->popup_centered_minsize(); + if (warning->is_inside_tree()) { + warning->set_text(p_text); + warning->set_title(p_title); + warning->popup_centered_minsize(); + } else { + WARN_PRINTS(p_title + " " + p_text); + } } void EditorNode::_copy_warning(const String &p_str) { @@ -4254,6 +4377,15 @@ bool EditorNode::ensure_main_scene(bool p_from_native) { return true; } +void EditorNode::run_play() { + _menu_option_confirm(RUN_STOP, true); + _run(false); +} + +void EditorNode::run_stop() { + _menu_option_confirm(RUN_STOP, false); +} + int EditorNode::get_current_tab() { return scene_tabs->get_current_tab(); } @@ -4417,8 +4549,17 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) { scene_tabs_context_menu->add_separator(); scene_tabs_context_menu->add_item(TTR("Show in FileSystem"), FILE_SHOW_IN_FILESYSTEM); scene_tabs_context_menu->add_item(TTR("Play This Scene"), RUN_PLAY_SCENE); + scene_tabs_context_menu->add_separator(); - scene_tabs_context_menu->add_item(TTR("Close Tab"), FILE_CLOSE); + Ref<ShortCut> close_tab_sc = ED_GET_SHORTCUT("editor/close_scene"); + close_tab_sc->set_name(TTR("Close Tab")); + scene_tabs_context_menu->add_shortcut(close_tab_sc, FILE_CLOSE); + Ref<ShortCut> undo_close_tab_sc = ED_GET_SHORTCUT("editor/reopen_closed_scene"); + undo_close_tab_sc->set_name(TTR("Undo Close Tab")); + scene_tabs_context_menu->add_shortcut(undo_close_tab_sc, FILE_OPEN_PREV); + if (previous_scenes.empty()) { + scene_tabs_context_menu->set_item_disabled(scene_tabs_context_menu->get_item_index(FILE_OPEN_PREV), true); + } scene_tabs_context_menu->add_item(TTR("Close Other Tabs"), FILE_CLOSE_OTHERS); scene_tabs_context_menu->add_item(TTR("Close Tabs to the Right"), FILE_CLOSE_RIGHT); scene_tabs_context_menu->add_item(TTR("Close All Tabs"), FILE_CLOSE_ALL); @@ -4662,8 +4803,7 @@ void EditorNode::remove_control_from_dock(Control *p_control) { } } - ERR_EXPLAIN("Control was not in dock"); - ERR_FAIL_COND(!dock); + ERR_FAIL_COND_MSG(!dock, "Control was not in dock."); dock->remove_child(p_control); _update_dock_slots_visibility(); @@ -4997,9 +5137,8 @@ void EditorNode::_start_dimming(bool p_dimming) { void EditorNode::_dim_timeout() { _dim_time += _dim_timer->get_wait_time(); - float wait_time = EditorSettings::get_singleton()->get("interface/editor/dim_transition_time"); - - float c = 1.0f - (float)EditorSettings::get_singleton()->get("interface/editor/dim_amount"); + float wait_time = 0.08f; + float c = 0.4f; Color base = _dimming ? Color(1, 1, 1) : Color(c, c, c); Color final = _dimming ? Color(c, c, c) : Color(1, 1, 1); @@ -5040,18 +5179,12 @@ Vector<Ref<EditorResourceConversionPlugin> > EditorNode::find_resource_conversio void EditorNode::_bottom_panel_raise_toggled(bool p_pressed) { - if (p_pressed) { - top_split->hide(); - bottom_panel_raise->set_icon(gui_base->get_icon("ShrinkBottomDock", "EditorIcons")); - } else { - top_split->show(); - bottom_panel_raise->set_icon(gui_base->get_icon("ExpandBottomDock", "EditorIcons")); - } + top_split->set_visible(!p_pressed); } void EditorNode::_update_video_driver_color() { - //todo probably should de-harcode this and add to editor settings + // TODO: Probably should de-hardcode this and add to editor settings. if (video_driver->get_text() == "GLES2") { video_driver->add_color_override("font_color", Color::hex(0x5586a4ff)); } else if (video_driver->get_text() == "GLES3") { @@ -5136,6 +5269,8 @@ void EditorNode::_bind_methods() { ClassDB::bind_method("_node_renamed", &EditorNode::_node_renamed); ClassDB::bind_method("edit_node", &EditorNode::edit_node); ClassDB::bind_method("_unhandled_input", &EditorNode::_unhandled_input); + ClassDB::bind_method("_update_file_menu_opened", &EditorNode::_update_file_menu_opened); + ClassDB::bind_method("_update_file_menu_closed", &EditorNode::_update_file_menu_closed); ClassDB::bind_method(D_METHOD("push_item", "object", "property", "inspector_only"), &EditorNode::push_item, DEFVAL(""), DEFVAL(false)); @@ -5380,6 +5515,9 @@ EditorNode::EditorNode() { } } + // Define a minimum window size to prevent UI elements from overlapping or being cut off + OS::get_singleton()->set_min_window_size(Size2(1024, 600) * EDSCALE); + ResourceLoader::set_abort_on_missing_resources(false); FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); @@ -5503,6 +5641,8 @@ EditorNode::EditorNode() { EDITOR_DEF_RST("interface/scene_tabs/restore_scenes_on_load", false); EDITOR_DEF_RST("interface/scene_tabs/show_thumbnail_on_hover", true); EDITOR_DEF_RST("interface/inspector/capitalize_properties", true); + EDITOR_DEF_RST("interface/inspector/default_float_step", 0.001); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::REAL, "interface/inspector/default_float_step", PROPERTY_HINT_EXP_RANGE, "0,1,0")); EDITOR_DEF_RST("interface/inspector/disable_folding", false); EDITOR_DEF_RST("interface/inspector/auto_unfold_foreign_scenes", true); EDITOR_DEF("interface/inspector/horizontal_vector2_editing", false); @@ -5810,23 +5950,25 @@ EditorNode::EditorNode() { PopupMenu *p; file_menu->set_tooltip(TTR("Operations with scene files.")); + p = file_menu->get_popup(); p->set_hide_on_window_lose_focus(true); p->add_shortcut(ED_SHORTCUT("editor/new_scene", TTR("New Scene")), FILE_NEW_SCENE); p->add_shortcut(ED_SHORTCUT("editor/new_inherited_scene", TTR("New Inherited Scene...")), FILE_NEW_INHERITED_SCENE); p->add_shortcut(ED_SHORTCUT("editor/open_scene", TTR("Open Scene..."), KEY_MASK_CMD + KEY_O), FILE_OPEN_SCENE); + p->add_shortcut(ED_SHORTCUT("editor/reopen_closed_scene", TTR("Reopen Closed Scene"), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_T), FILE_OPEN_PREV); + p->add_submenu_item(TTR("Open Recent"), "RecentScenes", FILE_OPEN_RECENT); + p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/save_scene", TTR("Save Scene"), KEY_MASK_CMD + KEY_S), FILE_SAVE_SCENE); p->add_shortcut(ED_SHORTCUT("editor/save_scene_as", TTR("Save Scene As..."), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_S), FILE_SAVE_AS_SCENE); p->add_shortcut(ED_SHORTCUT("editor/save_all_scenes", TTR("Save All Scenes"), KEY_MASK_ALT + KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_S), FILE_SAVE_ALL_SCENES); - p->add_separator(); - p->add_shortcut(ED_SHORTCUT("editor/close_scene", TTR("Close Scene"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_W), FILE_CLOSE); - p->add_separator(); - p->add_submenu_item(TTR("Open Recent"), "RecentScenes", FILE_OPEN_RECENT); + p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/quick_open", TTR("Quick Open..."), KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_O), FILE_QUICK_OPEN); p->add_shortcut(ED_SHORTCUT("editor/quick_open_scene", TTR("Quick Open Scene..."), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCENE); p->add_shortcut(ED_SHORTCUT("editor/quick_open_script", TTR("Quick Open Script..."), KEY_MASK_ALT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCRIPT); + p->add_separator(); PopupMenu *pm_export = memnew(PopupMenu); pm_export->set_name("Export"); @@ -5839,8 +5981,10 @@ EditorNode::EditorNode() { p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/undo", TTR("Undo"), KEY_MASK_CMD + KEY_Z), EDIT_UNDO, true); p->add_shortcut(ED_SHORTCUT("editor/redo", TTR("Redo"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Z), EDIT_REDO, true); + p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/revert_scene", TTR("Revert Scene")), EDIT_REVERT); + p->add_shortcut(ED_SHORTCUT("editor/close_scene", TTR("Close Scene"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_W), FILE_CLOSE); recent_scenes = memnew(PopupMenu); recent_scenes->set_name("RecentScenes"); @@ -5848,7 +5992,7 @@ EditorNode::EditorNode() { recent_scenes->connect("id_pressed", this, "_open_recent_scene"); p->add_separator(); - p->add_item(TTR("Quit"), FILE_QUIT, KEY_MASK_CMD + KEY_Q); + p->add_shortcut(ED_SHORTCUT("editor/file_quit", TTR("Quit"), KEY_MASK_CMD + KEY_Q), FILE_QUIT, true); project_menu = memnew(MenuButton); project_menu->set_flat(false); @@ -5860,31 +6004,31 @@ EditorNode::EditorNode() { p = project_menu->get_popup(); p->set_hide_on_window_lose_focus(true); - p->add_shortcut(ED_SHORTCUT("editor/project_settings", TTR("Project Settings")), RUN_SETTINGS); - p->add_separator(); + p->add_shortcut(ED_SHORTCUT("editor/project_settings", TTR("Project Settings...")), RUN_SETTINGS); p->connect("id_pressed", this, "_menu_option"); - p->add_shortcut(ED_SHORTCUT("editor/export", TTR("Export")), FILE_EXPORT_PROJECT); + + p->add_separator(); + p->add_shortcut(ED_SHORTCUT("editor/export", TTR("Export...")), FILE_EXPORT_PROJECT); + p->add_item(TTR("Install Android Build Template..."), FILE_INSTALL_ANDROID_SOURCE); + p->add_item(TTR("Open Project Data Folder"), RUN_PROJECT_DATA_FOLDER); plugin_config_dialog = memnew(PluginConfigDialog); plugin_config_dialog->connect("plugin_ready", this, "_on_plugin_ready"); gui_base->add_child(plugin_config_dialog); + p->add_separator(); tool_menu = memnew(PopupMenu); tool_menu->set_name("Tools"); tool_menu->connect("index_pressed", this, "_tool_menu_option"); - p->add_separator(); p->add_child(tool_menu); p->add_submenu_item(TTR("Tools"), "Tools"); - tool_menu->add_item(TTR("Orphan Resource Explorer"), TOOLS_ORPHAN_RESOURCES); - tool_menu->add_item(TTR("Open Project Data Folder"), RUN_PROJECT_DATA_FOLDER); - p->add_separator(); - p->add_item(TTR("Install Android Build Template"), FILE_INSTALL_ANDROID_SOURCE); - p->add_separator(); + tool_menu->add_item(TTR("Orphan Resource Explorer..."), TOOLS_ORPHAN_RESOURCES); + p->add_separator(); #ifdef OSX_ENABLED - p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_Q); + p->add_shortcut(ED_SHORTCUT("editor/quit_to_project_list", TTR("Quit to Project List"), KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_Q), RUN_PROJECT_MANAGER, true); #else - p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Q); + p->add_shortcut(ED_SHORTCUT("editor/quit_to_project_list", TTR("Quit to Project List"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Q), RUN_PROJECT_MANAGER, true); #endif menu_hb->add_spacer(); @@ -5932,7 +6076,7 @@ EditorNode::EditorNode() { p = settings_menu->get_popup(); p->set_hide_on_window_lose_focus(true); - p->add_shortcut(ED_SHORTCUT("editor/editor_settings", TTR("Editor Settings")), SETTINGS_PREFERENCES); + p->add_shortcut(ED_SHORTCUT("editor/editor_settings", TTR("Editor Settings...")), SETTINGS_PREFERENCES); p->add_separator(); editor_layouts = memnew(PopupMenu); @@ -5940,16 +6084,13 @@ EditorNode::EditorNode() { p->add_child(editor_layouts); editor_layouts->connect("id_pressed", this, "_layout_menu_option"); p->add_submenu_item(TTR("Editor Layout"), "Layouts"); + p->add_separator(); #ifdef OSX_ENABLED p->add_shortcut(ED_SHORTCUT("editor/take_screenshot", TTR("Take Screenshot"), KEY_MASK_CMD | KEY_F12), EDITOR_SCREENSHOT); #else p->add_shortcut(ED_SHORTCUT("editor/take_screenshot", TTR("Take Screenshot"), KEY_MASK_CTRL | KEY_F12), EDITOR_SCREENSHOT); #endif p->set_item_tooltip(p->get_item_count() - 1, TTR("Screenshots are stored in the Editor Data/Settings Folder.")); - p->add_check_shortcut(ED_SHORTCUT("editor/open_screenshot", TTR("Automatically Open Screenshots")), EDITOR_OPEN_SCREENSHOT); - bool is_open_screenshot = EditorSettings::get_singleton()->get_project_metadata("screenshot_options", "open_screenshot", true); - p->set_item_checked(p->get_item_count() - 1, is_open_screenshot); - p->set_item_tooltip(p->get_item_count() - 1, TTR("Open in an external image editor.")); #ifdef OSX_ENABLED p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_CMD | KEY_MASK_CTRL | KEY_F), SETTINGS_TOGGLE_FULLSCREEN); #else @@ -5970,11 +6111,8 @@ EditorNode::EditorNode() { } p->add_separator(); - p->add_item(TTR("Manage Editor Features"), SETTINGS_MANAGE_FEATURE_PROFILES); - - p->add_separator(); - - p->add_item(TTR("Manage Export Templates"), SETTINGS_MANAGE_EXPORT_TEMPLATES); + p->add_item(TTR("Manage Editor Features..."), SETTINGS_MANAGE_FEATURE_PROFILES); + p->add_item(TTR("Manage Export Templates..."), SETTINGS_MANAGE_EXPORT_TEMPLATES); // Help Menu help_menu = memnew(MenuButton); @@ -6202,6 +6340,13 @@ EditorNode::EditorNode() { bottom_panel_hb_editors = memnew(HBoxContainer); bottom_panel_hb_editors->set_h_size_flags(Control::SIZE_EXPAND_FILL); bottom_panel_hb->add_child(bottom_panel_hb_editors); + + version_label = memnew(Label); + version_label->set_text(VERSION_FULL_CONFIG); + // Fade out the version label to be less prominent, but still readable + version_label->set_self_modulate(Color(1, 1, 1, 0.6)); + bottom_panel_hb->add_child(version_label); + bottom_panel_raise = memnew(ToolButton); bottom_panel_raise->set_icon(gui_base->get_icon("ExpandBottomDock", "EditorIcons")); @@ -6298,6 +6443,8 @@ EditorNode::EditorNode() { file_script->connect("file_selected", this, "_dialog_action"); file_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + file_menu->connect("about_to_show", this, "_update_file_menu_opened"); + file_menu->get_popup()->connect("popup_hide", this, "_update_file_menu_closed"); settings_menu->get_popup()->connect("id_pressed", this, "_menu_option"); diff --git a/editor/editor_node.h b/editor/editor_node.h index 5dabe529f9..a8443549ed 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -86,10 +86,6 @@ #include "scene/gui/tree.h" #include "scene/gui/viewport_container.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - typedef void (*EditorNodeInitCallback)(); typedef void (*EditorPluginInitializeCallback)(); typedef bool (*EditorBuildCallback)(); @@ -431,6 +427,7 @@ private: HBoxContainer *bottom_panel_hb; HBoxContainer *bottom_panel_hb_editors; VBoxContainer *bottom_panel_vb; + Label *version_label; ToolButton *bottom_panel_raise; void _bottom_panel_raise_toggled(bool); @@ -460,6 +457,8 @@ private: void _tool_menu_option(int p_idx); void _update_debug_options(); + void _update_file_menu_opened(); + void _update_file_menu_closed(); void _on_plugin_ready(Object *p_script, const String &p_activate_name); @@ -729,6 +728,8 @@ public: bool item_has_editor(Object *p_object); void hide_top_editors(); + void select_editor_by_name(const String &p_name); + void open_request(const String &p_path); bool is_changing_scene() const; @@ -744,6 +745,7 @@ public: void fix_dependencies(const String &p_for_file); void clear_scene() { _cleanup_scene(); } + int new_scene(); Error load_scene(const String &p_scene, bool p_ignore_broken_deps = false, bool p_set_inherited = false, bool p_clear_errors = true, bool p_force_open_imported = false); Error load_resource(const String &p_resource, bool p_ignore_broken_deps = false); @@ -776,6 +778,8 @@ public: void stop_child_process(); Ref<Theme> get_editor_theme() const { return theme; } + Ref<Script> get_object_custom_type_base(const Object *p_object) const; + StringName get_object_custom_type_name(const Object *p_object) const; Ref<Texture> get_object_icon(const Object *p_object, const String &p_fallback = "Object") const; Ref<Texture> get_class_icon(const String &p_class, const String &p_fallback = "Object") const; @@ -862,6 +866,9 @@ public: static void add_build_callback(EditorBuildCallback p_callback); bool ensure_main_scene(bool p_from_native); + + void run_play(); + void run_stop(); }; struct EditorProgress { diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index c2a845653e..e27f1ab9eb 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -149,6 +149,10 @@ Vector<Ref<Texture> > EditorInterface::make_mesh_previews(const Vector<Ref<Mesh> return textures; } +void EditorInterface::set_main_screen_editor(const String &p_name) { + EditorNode::get_singleton()->select_editor_by_name(p_name); +} + Control *EditorInterface::get_editor_viewport() { return EditorNode::get_singleton()->get_viewport(); @@ -260,6 +264,10 @@ void EditorInterface::save_scene_as(const String &p_scene, bool p_with_preview) EditorNode::get_singleton()->save_scene_to_path(p_scene, p_with_preview); } +void EditorInterface::set_distraction_free_mode(bool p_enter) { + EditorNode::get_singleton()->set_distraction_free_mode(p_enter); +} + EditorInterface *EditorInterface::singleton = NULL; void EditorInterface::_bind_methods() { @@ -288,6 +296,9 @@ void EditorInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene); ClassDB::bind_method(D_METHOD("save_scene_as", "path", "with_preview"), &EditorInterface::save_scene_as, DEFVAL(true)); + + ClassDB::bind_method(D_METHOD("set_main_screen_editor", "name"), &EditorInterface::set_main_screen_editor); + ClassDB::bind_method(D_METHOD("set_distraction_free_mode", "enter"), &EditorInterface::set_distraction_free_mode); } EditorInterface::EditorInterface() { @@ -313,12 +324,6 @@ void EditorPlugin::remove_autoload_singleton(const String &p_name) { EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_remove(p_name); } -Ref<ConfigFile> EditorPlugin::get_config() { - Ref<ConfigFile> cf = memnew(ConfigFile); - cf->load(_dir_cache.plus_file("plugin.cfg")); - return cf; -} - ToolButton *EditorPlugin::add_control_to_bottom_panel(Control *p_control, const String &p_title) { ERR_FAIL_NULL_V(p_control, NULL); return EditorNode::get_singleton()->add_bottom_panel_item(p_title, p_control); diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 75c230adb7..8941dfa28c 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -41,10 +41,6 @@ #include "scene/main/node.h" #include "scene/resources/texture.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class EditorNode; class Spatial; class Camera; @@ -103,6 +99,9 @@ public: Vector<Ref<Texture> > make_mesh_previews(const Vector<Ref<Mesh> > &p_meshes, Vector<Transform> *p_transforms, int p_preview_size); + void set_main_screen_editor(const String &p_name); + void set_distraction_free_mode(bool p_enter); + EditorInterface(); }; @@ -118,7 +117,6 @@ class EditorPlugin : public Node { bool force_draw_over_forwarding_enabled; String last_main_screen_name; - String _dir_cache; protected: static void _bind_methods(); @@ -237,10 +235,6 @@ public: void add_autoload_singleton(const String &p_name, const String &p_path); void remove_autoload_singleton(const String &p_name); - void set_dir_cache(const String &p_dir) { _dir_cache = p_dir; } - String get_dir_cache() { return _dir_cache; } - Ref<ConfigFile> get_config(); - void enable_plugin(); void disable_plugin(); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 659893a1b6..378dd34e39 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -112,12 +112,13 @@ void EditorPropertyMultilineText::_open_big_text() { big_text->set_wrap_enabled(true); big_text_dialog = memnew(AcceptDialog); big_text_dialog->add_child(big_text); - big_text_dialog->set_title("Edit Text:"); + big_text_dialog->set_title(TTR("Edit Text:")); add_child(big_text_dialog); } - big_text_dialog->popup_centered_ratio(); + big_text_dialog->popup_centered_clamped(Size2(1000, 900) * EDSCALE, 0.8); big_text->set_text(text->get_text()); + big_text->grab_focus(); } void EditorPropertyMultilineText::update_property() { @@ -376,7 +377,7 @@ void EditorPropertyMember::_property_select() { type = Variant::Type(i); } } - if (type) + if (type != Variant::NIL) selector->select_method_from_basic_type(type, current); } else if (hint == MEMBER_METHOD_OF_BASE_TYPE) { @@ -2399,7 +2400,6 @@ void EditorPropertyResource::_update_menu_items() { menu->add_separator(); menu->add_item(TTR("Show in FileSystem"), OBJ_MENU_SHOW_IN_FILE_SYSTEM); } - } else { } RES cb = EditorSettings::get_singleton()->get_resource_clipboard(); @@ -2891,6 +2891,8 @@ 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) { + float default_float_step = EDITOR_GET("interface/inspector/default_float_step"); + switch (p_type) { // atomic types @@ -2997,7 +2999,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } else { EditorPropertyFloat *editor = memnew(EditorPropertyFloat); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; bool exp_range = false; bool greater = true, lesser = true; @@ -3094,7 +3096,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ case Variant::VECTOR2: { EditorPropertyVector2 *editor = memnew(EditorPropertyVector2); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3112,7 +3114,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; // 5 case Variant::RECT2: { EditorPropertyRect2 *editor = memnew(EditorPropertyRect2); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3129,7 +3131,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::VECTOR3: { EditorPropertyVector3 *editor = memnew(EditorPropertyVector3); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3147,7 +3149,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::TRANSFORM2D: { EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3165,7 +3167,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::PLANE: { EditorPropertyPlane *editor = memnew(EditorPropertyPlane); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3182,7 +3184,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::QUAT: { EditorPropertyQuat *editor = memnew(EditorPropertyQuat); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3199,7 +3201,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; // 10 case Variant::AABB: { EditorPropertyAABB *editor = memnew(EditorPropertyAABB); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3216,7 +3218,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::BASIS: { EditorPropertyBasis *editor = memnew(EditorPropertyBasis); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3233,7 +3235,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::TRANSFORM: { EditorPropertyTransform *editor = memnew(EditorPropertyTransform); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 347699c632..d1371a04b1 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -312,7 +312,8 @@ void EditorPropertyArray::update_property() { } else { //bye bye children of the box while (vbox->get_child_count() > 2) { - memdelete(vbox->get_child(2)); + vbox->get_child(2)->queue_delete(); // button still needed after pressed is called + vbox->remove_child(vbox->get_child(2)); } } @@ -414,8 +415,6 @@ void EditorPropertyArray::_remove_pressed(int p_index) { } void EditorPropertyArray::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - } } void EditorPropertyArray::_edit_pressed() { @@ -968,9 +967,6 @@ void EditorPropertyDictionary::_object_id_selected(const String &p_property, Obj } void EditorPropertyDictionary::_notification(int p_what) { - - if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - } } void EditorPropertyDictionary::_edit_pressed() { diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 327e61cea3..4a7a9fb863 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -46,8 +46,7 @@ bool EditorResourcePreviewGenerator::handles(const String &p_type) const { if (get_script_instance() && get_script_instance()->has_method("handles")) { return get_script_instance()->call("handles", p_type); } - ERR_EXPLAIN("EditorResourcePreviewGenerator::handles needs to be overridden"); - ERR_FAIL_V(false); + ERR_FAIL_V_MSG(false, "EditorResourcePreviewGenerator::handles needs to be overridden."); } Ref<Texture> EditorResourcePreviewGenerator::generate(const RES &p_from, const Size2 &p_size) const { @@ -55,8 +54,7 @@ Ref<Texture> EditorResourcePreviewGenerator::generate(const RES &p_from, const S if (get_script_instance() && get_script_instance()->has_method("generate")) { return get_script_instance()->call("generate", p_from, p_size); } - ERR_EXPLAIN("EditorResourcePreviewGenerator::generate needs to be overridden"); - ERR_FAIL_V(Ref<Texture>()); + ERR_FAIL_V_MSG(Ref<Texture>(), "EditorResourcePreviewGenerator::generate needs to be overridden."); } Ref<Texture> EditorResourcePreviewGenerator::generate_from_path(const String &p_path, const Size2 &p_size) const { diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index e7019e4ef6..ad6b280b6d 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -144,8 +144,9 @@ void SectionedInspector::_section_selected() { if (!sections->get_selected()) return; - filter->set_section(sections->get_selected()->get_metadata(0), sections->get_selected()->get_children() == NULL); - inspector->set_property_prefix(String(sections->get_selected()->get_metadata(0)) + "/"); + selected_category = sections->get_selected()->get_metadata(0); + filter->set_section(selected_category, sections->get_selected()->get_children() == NULL); + inspector->set_property_prefix(selected_category + "/"); } void SectionedInspector::set_current_section(const String &p_section) { @@ -197,8 +198,13 @@ void SectionedInspector::edit(Object *p_object) { filter->set_edited(p_object); inspector->edit(filter); - if (sections->get_root()->get_children()) { - sections->get_root()->get_children()->select(0); + TreeItem *first_item = sections->get_root(); + if (first_item) { + while (first_item->get_children()) + first_item = first_item->get_children(); + + first_item->select(0); + selected_category = first_item->get_metadata(0); } } else { @@ -208,7 +214,6 @@ void SectionedInspector::edit(Object *p_object) { void SectionedInspector::update_category_list() { - String selected_category = get_current_section(); sections->clear(); Object *o = ObjectDB::get_instance(obj); @@ -224,6 +229,10 @@ void SectionedInspector::update_category_list() { TreeItem *root = sections->create_item(); section_map[""] = root; + String filter; + if (search_box) + filter = search_box->get_text(); + for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) { PropertyInfo pi = E->get(); @@ -236,9 +245,6 @@ void SectionedInspector::update_category_list() { if (pi.name.find(":") != -1 || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene" || pi.name.begins_with("_global_script")) continue; - if (search_box && search_box->get_text() != String() && pi.name.findn(search_box->get_text()) == -1) - continue; - int sp = pi.name.find("/"); if (sp == -1) pi.name = "global/" + pi.name; @@ -246,6 +252,9 @@ void SectionedInspector::update_category_list() { Vector<String> sectionarr = pi.name.split("/"); String metasection; + if (!filter.empty() && !filter.is_subsequence_ofi(sectionarr[sectionarr.size() - 1].capitalize())) + continue; + int sc = MIN(2, sectionarr.size() - 1); for (int i = 0; i < sc; i++) { diff --git a/editor/editor_sectioned_inspector.h b/editor/editor_sectioned_inspector.h index c32f23890f..4395e9bb27 100644 --- a/editor/editor_sectioned_inspector.h +++ b/editor/editor_sectioned_inspector.h @@ -50,6 +50,8 @@ class SectionedInspector : public HSplitContainer { EditorInspector *inspector; LineEdit *search_box; + String selected_category; + static void _bind_methods(); void _section_selected(); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 2c0449398e..db353c0dfc 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -321,30 +321,24 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["interface/editor/custom_display_scale"] = PropertyInfo(Variant::REAL, "interface/editor/custom_display_scale", PROPERTY_HINT_RANGE, "0.5,3,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/main_font_size", 14); hints["interface/editor/main_font_size"] = PropertyInfo(Variant::INT, "interface/editor/main_font_size", PROPERTY_HINT_RANGE, "8,48,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - _initial_set("interface/editor/main_font_antialiased", true); - _initial_set("interface/editor/main_font_hinting", 2); - hints["interface/editor/main_font_hinting"] = PropertyInfo(Variant::INT, "interface/editor/main_font_hinting", PROPERTY_HINT_ENUM, "None,Light,Normal", PROPERTY_USAGE_DEFAULT); + _initial_set("interface/editor/code_font_size", 14); + hints["interface/editor/code_font_size"] = PropertyInfo(Variant::INT, "interface/editor/code_font_size", PROPERTY_HINT_RANGE, "8,48,1", PROPERTY_USAGE_DEFAULT); + _initial_set("interface/editor/font_antialiased", true); + _initial_set("interface/editor/font_hinting", 0); + hints["interface/editor/font_hinting"] = PropertyInfo(Variant::INT, "interface/editor/font_hinting", PROPERTY_HINT_ENUM, "Auto,None,Light,Normal", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/main_font", ""); hints["interface/editor/main_font"] = PropertyInfo(Variant::STRING, "interface/editor/main_font", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/main_font_bold", ""); hints["interface/editor/main_font_bold"] = PropertyInfo(Variant::STRING, "interface/editor/main_font_bold", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT); - _initial_set("interface/editor/code_font_size", 14); - hints["interface/editor/code_font_size"] = PropertyInfo(Variant::INT, "interface/editor/code_font_size", PROPERTY_HINT_RANGE, "8,48,1", PROPERTY_USAGE_DEFAULT); - _initial_set("interface/editor/code_font_antialiased", true); - _initial_set("interface/editor/code_font_hinting", 2); - hints["interface/editor/code_font_hinting"] = PropertyInfo(Variant::INT, "interface/editor/code_font_hinting", PROPERTY_HINT_ENUM, "None,Light,Normal", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/code_font", ""); hints["interface/editor/code_font"] = PropertyInfo(Variant::STRING, "interface/editor/code_font", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/dim_editor_on_dialog_popup", true); - _initial_set("interface/editor/dim_amount", 0.6f); - hints["interface/editor/dim_amount"] = PropertyInfo(Variant::REAL, "interface/editor/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT); - _initial_set("interface/editor/dim_transition_time", 0.08f); - hints["interface/editor/dim_transition_time"] = PropertyInfo(Variant::REAL, "interface/editor/dim_transition_time", PROPERTY_HINT_RANGE, "0,1,0.001", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/low_processor_mode_sleep_usec", 6900); // ~144 FPS - hints["interface/editor/low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT); + hints["interface/editor/low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/unfocused_low_processor_mode_sleep_usec", 50000); // 20 FPS - hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT); + hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/separate_distraction_mode", false); + _initial_set("interface/editor/automatically_open_screenshots", true); _initial_set("interface/editor/hide_console_window", false); _initial_set("interface/editor/save_each_scene_on_quit", true); // Regression _initial_set("interface/editor/quit_confirmation", true); @@ -454,6 +448,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("text_editor/line_numbers/show_info_gutter", true); _initial_set("text_editor/line_numbers/code_folding", true); _initial_set("text_editor/line_numbers/word_wrap", false); + _initial_set("text_editor/line_numbers/draw_minimap", false); + _initial_set("text_editor/line_numbers/minimap_width", 80); + hints["text_editor/line_numbers/minimap_width"] = PropertyInfo(Variant::INT, "text_editor/line_numbers/minimap_width", PROPERTY_HINT_RANGE, "50,250,1"); _initial_set("text_editor/line_numbers/show_line_length_guideline", false); _initial_set("text_editor/line_numbers/line_length_guideline_column", 80); hints["text_editor/line_numbers/line_length_guideline_column"] = PropertyInfo(Variant::INT, "text_editor/line_numbers/line_length_guideline_column", PROPERTY_HINT_RANGE, "20, 160, 1"); @@ -483,7 +480,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Completion _initial_set("text_editor/completion/idle_parse_delay", 2.0); hints["text_editor/completion/idle_parse_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/idle_parse_delay", PROPERTY_HINT_RANGE, "0.1, 10, 0.01"); - _initial_set("text_editor/completion/auto_brace_complete", false); + _initial_set("text_editor/completion/auto_brace_complete", true); + _initial_set("text_editor/completion/code_complete_delay", 0.3); + hints["text_editor/completion/code_complete_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/code_complete_delay", PROPERTY_HINT_RANGE, "0.01, 5, 0.01"); _initial_set("text_editor/completion/put_callhint_tooltip_below_current_line", true); _initial_set("text_editor/completion/callhint_tooltip_offset", Vector2()); _initial_set("text_editor/completion/complete_file_paths", true); @@ -565,6 +564,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // 2D _initial_set("editors/2d/grid_color", Color(1.0, 1.0, 1.0, 0.07)); _initial_set("editors/2d/guides_color", Color(0.6, 0.0, 0.8)); + _initial_set("editors/2d/smart_snapping_line_color", Color(0.9, 0.1, 0.1)); _initial_set("editors/2d/bone_width", 5); _initial_set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.9)); _initial_set("editors/2d/bone_color2", Color(0.6, 0.6, 0.6, 0.9)); @@ -612,10 +612,22 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("run/output/always_open_output_on_play", true); _initial_set("run/output/always_close_output_on_stop", false); + /* Network */ + + // Debug + _initial_set("network/debug/remote_host", "127.0.0.1"); // Hints provided in setup_network + + _initial_set("network/debug/remote_port", 6007); + hints["network/debug/remote_port"] = PropertyInfo(Variant::INT, "network/debug/remote_port", PROPERTY_HINT_RANGE, "1,65535,1"); + + // SSL + _initial_set("network/ssl/editor_ssl_certificates", _SYSTEM_CERTS_PATH); + hints["network/ssl/editor_ssl_certificates"] = PropertyInfo(Variant::STRING, "network/ssl/editor_ssl_certificates", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem"); + /* Extra config */ _initial_set("project_manager/sorting_order", 0); - hints["project_manager/sorting_order"] = PropertyInfo(Variant::INT, "project_manager/sorting_order", PROPERTY_HINT_ENUM, "Name,Last Modified"); + hints["project_manager/sorting_order"] = PropertyInfo(Variant::INT, "project_manager/sorting_order", PROPERTY_HINT_ENUM, "Name,Path,Last Modified"); if (p_extra_config.is_valid()) { @@ -777,10 +789,16 @@ void EditorSettings::create() { if (d->file_exists(exe_path + "/._sc_")) { self_contained = true; - extra_config->load(exe_path + "/._sc_"); + Error err = extra_config->load(exe_path + "/._sc_"); + if (err != OK) { + ERR_PRINTS("Can't load config from path: " + exe_path + "/._sc_"); + } } else if (d->file_exists(exe_path + "/_sc_")) { self_contained = true; - extra_config->load(exe_path + "/_sc_"); + Error err = extra_config->load(exe_path + "/_sc_"); + if (err != OK) { + ERR_PRINTS("Can't load config from path: " + exe_path + "/_sc_"); + } } memdelete(d); @@ -991,11 +1009,11 @@ void EditorSettings::setup_network() { List<IP_Address> local_ip; IP::get_singleton()->get_local_addresses(&local_ip); - String lip = "127.0.0.1"; String hint; String current = has_setting("network/debug/remote_host") ? get("network/debug/remote_host") : ""; - int port = has_setting("network/debug/remote_port") ? (int)get("network/debug/remote_port") : 6007; + String selected = "127.0.0.1"; + // Check that current remote_host is a valid interface address and populate hints. for (List<IP_Address>::Element *E = local_ip.front(); E; E = E->next()) { String ip = E->get(); @@ -1006,22 +1024,18 @@ void EditorSettings::setup_network() { // Same goes for IPv4 link-local (APIPA) addresses. if (ip.begins_with("169.254.")) // 169.254.0.0/16 continue; + // Select current IP (found) if (ip == current) - lip = current; //so it saves + selected = ip; if (hint != "") hint += ","; hint += ip; } - _initial_set("network/debug/remote_host", lip); + // Add hints with valid IP addresses to remote_host property. add_property_hint(PropertyInfo(Variant::STRING, "network/debug/remote_host", PROPERTY_HINT_ENUM, hint)); - - _initial_set("network/debug/remote_port", port); - add_property_hint(PropertyInfo(Variant::INT, "network/debug/remote_port", PROPERTY_HINT_RANGE, "1,65535,1")); - - // Editor SSL certificates override - _initial_set("network/ssl/editor_ssl_certificates", _SYSTEM_CERTS_PATH); - add_property_hint(PropertyInfo(Variant::STRING, "network/ssl/editor_ssl_certificates", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem")); + // Fix potentially invalid remote_host due to network change. + set("network/debug/remote_host", selected); } void EditorSettings::save() { @@ -1195,6 +1209,11 @@ String EditorSettings::get_script_templates_dir() const { return get_settings_dir().plus_file("script_templates"); } +String EditorSettings::get_project_script_templates_dir() const { + + return ProjectSettings::get_singleton()->get("editor/script_templates_search_path"); +} + // Cache directory String EditorSettings::get_cache_dir() const { @@ -1212,9 +1231,12 @@ String EditorSettings::get_feature_profiles_dir() const { void EditorSettings::set_project_metadata(const String &p_section, const String &p_key, Variant p_data) { Ref<ConfigFile> cf = memnew(ConfigFile); String path = get_project_settings_dir().plus_file("project_metadata.cfg"); - cf->load(path); + Error err; + err = cf->load(path); + ERR_FAIL_COND(err != OK && err != ERR_FILE_NOT_FOUND); cf->set_value(p_section, p_key, p_data); - cf->save(path); + err = cf->save(path); + ERR_FAIL_COND(err != OK); } Variant EditorSettings::get_project_metadata(const String &p_section, const String &p_key, Variant p_default) const { @@ -1412,10 +1434,14 @@ bool EditorSettings::is_default_text_editor_theme() { return _is_default_text_editor_theme(p_file.get_file().to_lower()); } -Vector<String> EditorSettings::get_script_templates(const String &p_extension) { +Vector<String> EditorSettings::get_script_templates(const String &p_extension, const String &p_custom_path) { Vector<String> templates; - DirAccess *d = DirAccess::open(get_script_templates_dir()); + String template_dir = get_script_templates_dir(); + if (!p_custom_path.empty()) { + template_dir = p_custom_path; + } + DirAccess *d = DirAccess::open(template_dir); if (d) { d->list_dir_begin(); String file = d->get_next(); @@ -1446,10 +1472,7 @@ void EditorSettings::add_shortcut(const String &p_name, Ref<ShortCut> &p_shortcu bool EditorSettings::is_shortcut(const String &p_name, const Ref<InputEvent> &p_event) const { const Map<String, Ref<ShortCut> >::Element *E = shortcuts.find(p_name); - if (!E) { - ERR_EXPLAIN("Unknown Shortcut: " + p_name); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(!E, false, "Unknown Shortcut: " + p_name + "."); return E->get()->is_shortcut(p_event); } @@ -1478,10 +1501,8 @@ Ref<ShortCut> ED_GET_SHORTCUT(const String &p_path) { } Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(p_path); - if (!sc.is_valid()) { - ERR_EXPLAIN("Used ED_GET_SHORTCUT with invalid shortcut: " + p_path); - ERR_FAIL_COND_V(!sc.is_valid(), sc); - } + + ERR_FAIL_COND_V_MSG(!sc.is_valid(), sc, "Used ED_GET_SHORTCUT with invalid shortcut: " + p_path + "."); return sc; } diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 890850629e..0738185e95 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -166,6 +166,7 @@ public: String get_project_settings_dir() const; String get_text_editor_themes_dir() const; String get_script_templates_dir() const; + String get_project_script_templates_dir() const; String get_cache_dir() const; String get_feature_profiles_dir() const; @@ -187,7 +188,7 @@ public: bool save_text_editor_theme_as(String p_file); bool is_default_text_editor_theme(); - Vector<String> get_script_templates(const String &p_extension); + Vector<String> get_script_templates(const String &p_extension, const String &p_custom_path = String()); String get_editor_layouts_config() const; void add_shortcut(const String &p_name, Ref<ShortCut> &p_shortcut); diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index dcb106899e..46a30b7554 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -38,51 +38,57 @@ String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const { } String EditorSpinSlider::get_text_value() const { - int zeros = Math::step_decimals(get_step()); - return String::num(get_value(), zeros); + return String::num(get_value(), Math::range_step_decimals(get_step())); } + void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { if (read_only) return; Ref<InputEventMouseButton> mb = p_event; - if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT) { + if (mb.is_valid()) { - if (mb->is_pressed()) { + if (mb->get_button_index() == BUTTON_LEFT) { + if (mb->is_pressed()) { - if (updown_offset != -1 && mb->get_position().x > updown_offset) { - //there is an updown, so use it. - if (mb->get_position().y < get_size().height / 2) { - set_value(get_value() + get_step()); + if (updown_offset != -1 && mb->get_position().x > updown_offset) { + //there is an updown, so use it. + if (mb->get_position().y < get_size().height / 2) { + set_value(get_value() + get_step()); + } else { + set_value(get_value() - get_step()); + } + return; } else { - set_value(get_value() - get_step()); + + grabbing_spinner_attempt = true; + grabbing_spinner_dist_cache = 0; + pre_grab_value = get_value(); + grabbing_spinner = false; + grabbing_spinner_mouse_pos = Input::get_singleton()->get_mouse_position(); } - return; } else { - grabbing_spinner_attempt = true; - grabbing_spinner_dist_cache = 0; - pre_grab_value = get_value(); - grabbing_spinner = false; - grabbing_spinner_mouse_pos = Input::get_singleton()->get_mouse_position(); - } - } else { + if (grabbing_spinner_attempt) { - if (grabbing_spinner_attempt) { + if (grabbing_spinner) { - if (grabbing_spinner) { + Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); + Input::get_singleton()->warp_mouse_position(grabbing_spinner_mouse_pos); + update(); + } else { + _focus_entered(); + } - Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); - Input::get_singleton()->warp_mouse_position(grabbing_spinner_mouse_pos); - update(); - } else { - _focus_entered(); + grabbing_spinner = false; + grabbing_spinner_attempt = false; } - - grabbing_spinner = false; - grabbing_spinner_attempt = false; } + } else if (mb->get_button_index() == BUTTON_WHEEL_UP || mb->get_button_index() == BUTTON_WHEEL_DOWN) { + + if (grabber->is_visible()) + call_deferred("update"); } } @@ -347,6 +353,11 @@ void EditorSpinSlider::_value_input_closed() { //focus_exited signal void EditorSpinSlider::_value_focus_exited() { + + // discontinue because the focus_exit was caused by right-click context menu + if (value_input->get_menu()->is_visible()) + return; + _evaluate_input_text(); // focus is not on the same element after the vlalue_input was exited // -> focus is on next element diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 4eceb09792..56eed96e31 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -113,11 +113,11 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme = ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffffff", "#000000"); // white ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#b4b4b4", "#000000"); // script darker color - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#cea4f1", "#bb6dff"); // animation - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#fc9c9c", "#ff5f5f"); // spatial - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5b7f3", "#6d90ff"); // 2d - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#708cea", "#0843ff"); // 2d dark - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5efac", "#29d739"); // control + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#cea4f1", "#a85de9"); // animation + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#fc9c9c", "#cd3838"); // spatial + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5b7f3", "#3d64dd"); // 2d + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#708cea", "#1a3eac"); // 2d dark + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5efac", "#2aa235"); // control // rainbow ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff7070", "#ff2929"); // red @@ -140,7 +140,13 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme = ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84ffb1", "#00db50"); // add (green) ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84c2ff", "#5caeff"); // selection (blue) - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ea686c", "#e3383d"); // key xform (red) + // Animation editor tracks + // The property track icon color is set by the common icon color + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ea9568", "#bd5e2c"); // 3D Transform track + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#66f376", "#16a827"); // Call Method track + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#5792f6", "#236be6"); // Bezier Curve track + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#eae668", "#aea923"); // Audio Playback track + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#b76ef0", "#9853ce"); // Animation Playback track ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#69ecbd", "#25e3a0"); // VS variant ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#8da6f0", "#6d8eeb"); // VS bool @@ -345,6 +351,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("dark_color_3", "Editor", dark_color_3); theme->set_color("contrast_color_1", "Editor", contrast_color_1); theme->set_color("contrast_color_2", "Editor", contrast_color_2); + theme->set_color("box_selection_fill_color", "Editor", accent_color * Color(1, 1, 1, 0.3)); + theme->set_color("box_selection_stroke_color", "Editor", accent_color * Color(1, 1, 1, 0.8)); theme->set_color("font_color", "Editor", font_color); theme->set_color("highlighted_font_color", "Editor", font_color_hl); @@ -1058,6 +1066,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // FileDialog theme->set_icon("folder", "FileDialog", theme->get_icon("Folder", "EditorIcons")); + // Use a different color for folder icons to make them easier to distinguish from files. + // On a light theme, the icon will be dark, so we need to lighten it before blending it with the accent color. + theme->set_color("folder_icon_modulate", "FileDialog", (dark_theme ? Color(1, 1, 1) : Color(5, 5, 5)).linear_interpolate(accent_color, 0.7)); theme->set_color("files_disabled", "FileDialog", font_color_disabled); // color picker diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index bd61e6182c..1447a143d4 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -52,18 +52,16 @@ void ExportTemplateManager::_update_template_list() { DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); Error err = d->change_dir(EditorSettings::get_singleton()->get_templates_dir()); - d->list_dir_begin(); Set<String> templates; - + d->list_dir_begin(); if (err == OK) { - bool isdir; - String c = d->get_next(&isdir); + String c = d->get_next(); while (c != String()) { - if (isdir && !c.begins_with(".")) { + if (d->current_is_dir() && !c.begins_with(".")) { templates.insert(c); } - c = d->get_next(&isdir); + c = d->get_next(); } } d->list_dir_end(); @@ -71,6 +69,9 @@ 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. + // Therefore, don't display download-related features when using a development version + const bool downloads_available = String(VERSION_STATUS) != String("dev"); Label *current = memnew(Label); current->set_h_size_flags(SIZE_EXPAND_FILL); @@ -78,10 +79,14 @@ void ExportTemplateManager::_update_template_list() { if (templates.has(current_version)) { current->add_color_override("font_color", get_color("success_color", "Editor")); - Button *redownload = memnew(Button); - redownload->set_text(TTR("Re-Download")); - current_hb->add_child(redownload); - redownload->connect("pressed", this, "_download_template", varray(current_version)); + + // Only display a redownload button if it can be downloaded in the first place + if (downloads_available) { + Button *redownload = memnew(Button); + redownload->set_text(TTR("Redownload")); + current_hb->add_child(redownload); + redownload->connect("pressed", this, "_download_template", varray(current_version)); + } Button *uninstall = memnew(Button); uninstall->set_text(TTR("Uninstall")); @@ -93,6 +98,12 @@ void ExportTemplateManager::_update_template_list() { current->add_color_override("font_color", get_color("error_color", "Editor")); Button *redownload = memnew(Button); redownload->set_text(TTR("Download")); + + if (!downloads_available) { + redownload->set_disabled(true); + redownload->set_tooltip(TTR("Official export templates aren't available for development builds.")); + } + redownload->connect("pressed", this, "_download_template", varray(current_version)); current_hb->add_child(redownload); current->set_text(current_version + " " + TTR("(Missing)")); @@ -154,18 +165,14 @@ void ExportTemplateManager::_uninstall_template_confirm() { ERR_FAIL_COND(err != OK); Vector<String> files; - d->list_dir_begin(); - - bool isdir; - String c = d->get_next(&isdir); + String c = d->get_next(); while (c != String()) { - if (!isdir) { + if (!d->current_is_dir()) { files.push_back(c); } - c = d->get_next(&isdir); + c = d->get_next(); } - d->list_dir_end(); for (int i = 0; i < files.size(); i++) { @@ -314,8 +321,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ if (!f) { ret = unzGoToNextFile(pkg); fc++; - ERR_EXPLAIN("Can't open file from path: " + String(to_write)); - ERR_CONTINUE(true); + ERR_CONTINUE_MSG(true, "Can't open file from path: " + String(to_write) + "."); } f->store_buffer(data.ptr(), data.size()); @@ -428,14 +434,16 @@ void ExportTemplateManager::_http_download_templates_completed(int p_status, int String path = download_templates->get_download_file(); template_list_state->set_text(TTR("Download Complete.")); template_downloader->hide(); - int ret = _install_from_file(path, false); + bool ret = _install_from_file(path, false); if (ret) { - Error err = OS::get_singleton()->move_to_trash(path); + // Clean up downloaded file. + DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + Error err = da->remove(path); if (err != OK) { - EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + path + "\n"); + EditorNode::get_singleton()->add_io_error(TTR("Cannot remove temporary file:") + "\n" + path + "\n"); } } else { - WARN_PRINTS(vformat(TTR("Templates installation failed. The problematic templates archives can be found at '%s'."), path)); + EditorNode::get_singleton()->add_io_error(vformat(TTR("Templates installation failed.\nThe problematic templates archives can be found at '%s'."), path)); } } } break; @@ -464,7 +472,7 @@ void ExportTemplateManager::_begin_template_download(const String &p_url) { Error err = download_templates->request(p_url); if (err != OK) { - EditorNode::get_singleton()->show_warning(TTR("Error requesting url: ") + p_url); + EditorNode::get_singleton()->show_warning(TTR("Error requesting URL:") + " " + p_url); return; } @@ -582,8 +590,7 @@ Error ExportTemplateManager::install_android_template() { zlib_filefunc_def io = zipio_create_io_from_file(&src_f); unzFile pkg = unzOpen2(source_zip.utf8().get_data(), &io); - ERR_EXPLAIN("Android sources not in zip format"); - ERR_FAIL_COND_V(!pkg, ERR_CANT_OPEN); + ERR_FAIL_COND_V_MSG(!pkg, ERR_CANT_OPEN, "Android sources not in ZIP format."); int ret = unzGoToFirstFile(pkg); diff --git a/editor/file_type_cache.cpp b/editor/file_type_cache.cpp index 1bcbc45d3b..746d38f2b5 100644 --- a/editor/file_type_cache.cpp +++ b/editor/file_type_cache.cpp @@ -83,11 +83,8 @@ void FileTypeCache::save() { GLOBAL_LOCK_FUNCTION String project = ProjectSettings::get_singleton()->get_resource_path(); FileAccess *f = FileAccess::open(project + "/file_type_cache.cch", FileAccess::WRITE); - if (!f) { - ERR_EXPLAIN(TTR("Can't open file_type_cache.cch for writing, not saving file type cache!")); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!f, "Can't open file_type_cache.cch for writing, not saving file type cache!"); const String *K = NULL; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 947d96f897..84631f3e38 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -39,6 +39,7 @@ #include "editor_node.h" #include "editor_settings.h" #include "scene/main/viewport.h" +#include "scene/resources/packed_scene.h" Ref<Texture> FileSystemDock::_get_tree_item_icon(EditorFileSystemDirectory *p_dir, int p_idx) { Ref<Texture> file_icon; @@ -52,10 +53,9 @@ Ref<Texture> FileSystemDock::_get_tree_item_icon(EditorFileSystemDirectory *p_di } bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector<String> &uncollapsed_paths, bool p_select_in_favorites) { - bool parent_should_expand = false; - // Create a tree item for the subdirectory + // Create a tree item for the subdirectory. TreeItem *subdirectory_item = tree->create_item(p_parent); String dname = p_dir->get_name(); if (dname == "") @@ -63,6 +63,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory subdirectory_item->set_text(0, dname); subdirectory_item->set_icon(0, get_icon("Folder", "EditorIcons")); + subdirectory_item->set_icon_color(0, get_color("folder_icon_modulate", "FileDialog")); subdirectory_item->set_selectable(0, true); String lpath = p_dir->get_path(); subdirectory_item->set_metadata(0, lpath); @@ -79,28 +80,28 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory parent_should_expand = true; } - // Create items for all subdirectories + // Create items for all subdirectories. for (int i = 0; i < p_dir->get_subdir_count(); i++) parent_should_expand = (_create_tree(subdirectory_item, p_dir->get_subdir(i), uncollapsed_paths, p_select_in_favorites) || parent_should_expand); - // Create all items for the files in the subdirectory + // Create all items for the files in the subdirectory. if (display_mode == DISPLAY_MODE_TREE_ONLY) { for (int i = 0; i < p_dir->get_file_count(); i++) { String file_type = p_dir->get_file_type(i); if (_is_file_type_disabled_by_feature_profile(file_type)) { - //if type is disabled, file won't be displayed. + // If type is disabled, file won't be displayed. continue; } String file_name = p_dir->get_file(i); if (searched_string.length() > 0) { if (file_name.to_lower().find(searched_string) < 0) { - // The searched string is not in the file name, we skip it + // The searched string is not in the file name, we skip it. continue; } else { - // We expand all parents + // We expand all parents. parent_should_expand = true; } } @@ -133,7 +134,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory } Vector<String> FileSystemDock::_compute_uncollapsed_paths() { - // Register currently collapsed paths + // Register currently collapsed paths. Vector<String> uncollapsed_paths; TreeItem *root = tree->get_root(); if (root) { @@ -164,14 +165,13 @@ Vector<String> FileSystemDock::_compute_uncollapsed_paths() { } void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, bool p_uncollapse_root, bool p_select_in_favorites) { - - // Recreate the tree + // Recreate the tree. tree->clear(); tree_update_id++; updating_tree = true; TreeItem *root = tree->create_item(); - // Handles the favorites + // Handles the favorites. TreeItem *favorites = tree->create_item(root); favorites->set_icon(0, get_icon("Favorites", "EditorIcons")); favorites->set_text(0, TTR("Favorites:")); @@ -185,15 +185,19 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo continue; Ref<Texture> folder_icon = get_icon("Folder", "EditorIcons"); + const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); String text; Ref<Texture> icon; + Color color; if (fave == "res://") { text = "/"; icon = folder_icon; + color = folder_color; } else if (fave.ends_with("/")) { text = fave.substr(0, fave.length() - 1).get_file(); icon = folder_icon; + color = folder_color; } else { text = fave.get_file(); int index; @@ -203,12 +207,14 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo } else { icon = get_icon("File", "EditorIcons"); } + color = Color(1, 1, 1); } if (searched_string.length() == 0 || text.to_lower().find(searched_string) >= 0) { TreeItem *ti = tree->create_item(favorites); ti->set_text(0, text); ti->set_icon(0, icon); + ti->set_icon_color(0, color); ti->set_tooltip(0, fave); ti->set_selectable(0, true); ti->set_metadata(0, fave); @@ -230,7 +236,7 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo uncollapsed_paths.push_back("res://"); } - // Create the remaining of the tree + // Create the remaining of the tree. _create_tree(root, EditorFileSystem::get_singleton()->get_filesystem(), uncollapsed_paths, p_select_in_favorites); tree->ensure_cursor_is_visible(); updating_tree = false; @@ -242,7 +248,7 @@ void FileSystemDock::set_display_mode(DisplayMode p_display_mode) { } void FileSystemDock::_update_display_mode(bool p_force) { - // Compute the new display mode + // Compute the new display mode. if (p_force || old_display_mode != display_mode) { button_toggle_display_mode->set_pressed(display_mode == DISPLAY_MODE_SPLIT); switch (display_mode) { @@ -275,11 +281,8 @@ void FileSystemDock::_update_display_mode(bool p_force) { } void FileSystemDock::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - if (initialized) return; initialized = true; @@ -319,18 +322,15 @@ void FileSystemDock::_notification(int p_what) { } else { _update_tree(Vector<String>(), true); } - } break; + case NOTIFICATION_PROCESS: { if (EditorFileSystem::get_singleton()->is_scanning()) { scanning_progress->set_value(EditorFileSystem::get_singleton()->get_scanning_progress() * 100); } } break; - case NOTIFICATION_EXIT_TREE: { - } break; 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")) { @@ -339,20 +339,20 @@ void FileSystemDock::_notification(int p_what) { tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN); } } - } break; - case NOTIFICATION_DRAG_END: { + case NOTIFICATION_DRAG_END: { tree->set_drop_mode_flags(0); - } break; + case NOTIFICATION_THEME_CHANGED: { if (is_visible_in_tree()) { _update_display_mode(true); } } break; + case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - // Update icons + // Update icons. String ei = "EditorIcons"; button_reload->set_icon(get_icon("Reload", ei)); button_toggle_display_mode->set_icon(get_icon("Panels2", ei)); @@ -369,48 +369,47 @@ void FileSystemDock::_notification(int p_what) { file_list_search_box->set_right_icon(get_icon("Search", ei)); file_list_search_box->set_clear_button_enabled(true); - // Update always showfolders + // Update always show folders. bool new_always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders")); if (new_always_show_folders != always_show_folders) { always_show_folders = new_always_show_folders; _update_file_list(true); } - // Change full tree mode + // Change full tree mode. _update_display_mode(); - } break; } } void FileSystemDock::_tree_multi_selected(Object *p_item, int p_column, bool p_selected) { - // Update the import dock + // Update the import dock. import_dock_needs_update = true; call_deferred("_update_import_dock"); - // Return if we don't select something new + // Return if we don't select something new. if (!p_selected) return; - // Tree item selected + // Tree item selected. TreeItem *selected = tree->get_selected(); if (!selected) return; TreeItem *favorites_item = tree->get_root()->get_children(); if (selected->get_parent() == favorites_item && !String(selected->get_metadata(0)).ends_with("/")) { - // Go to the favorites if we click in the favorites and the path has changed + // Go to the favorites if we click in the favorites and the path has changed. path = "Favorites"; } else { path = selected->get_metadata(0); - // Note: the "Favorites" item also leads to this path + // Note: the "Favorites" item also leads to this path. } - // Set the current path + // Set the current path. _set_current_path_text(path); _push_to_history(); - // Update the file list + // Update the file list. if (!updating_tree && display_mode == DISPLAY_MODE_SPLIT) { _update_file_list(false); } @@ -424,7 +423,6 @@ String FileSystemDock::get_selected_path() const { } String FileSystemDock::get_current_path() const { - return path; } @@ -452,8 +450,7 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa path = target_path + "/"; } else { memdelete(dirAccess); - ERR_EXPLAIN(vformat(TTR("Cannot navigate to '%s' as it has not been found in the file system!"), p_path)); - ERR_FAIL(); + ERR_FAIL_MSG(vformat("Cannot navigate to '%s' as it has not been found in the file system!", p_path)); } memdelete(dirAccess); } @@ -484,7 +481,6 @@ void FileSystemDock::navigate_to_path(const String &p_path) { } void FileSystemDock::_file_list_thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Ref<Texture> &p_small_preview, const Variant &p_udata) { - if ((file_list_vb->is_visible_in_tree() || path == p_path.get_base_dir()) && p_preview.is_valid()) { Array uarr = p_udata; int idx = uarr[0]; @@ -532,7 +528,6 @@ void FileSystemDock::_set_file_display(bool p_active) { } bool FileSystemDock::_is_file_type_disabled_by_feature_profile(const StringName &p_class) { - Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton()->get_current_profile(); if (profile.is_null()) { return false; @@ -552,7 +547,6 @@ bool FileSystemDock::_is_file_type_disabled_by_feature_profile(const StringName } void FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> *matches, int p_max_items) { - if (matches->size() > p_max_items) return; @@ -570,10 +564,9 @@ void FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> * fi.type = p_path->get_file_type(i); fi.path = p_path->get_file_path(i); fi.import_broken = !p_path->get_file_import_is_valid(i); - fi.import_status = 0; if (_is_file_type_disabled_by_feature_profile(fi.type)) { - //this type is disabled, will not appear here + // This type is disabled, will not appear here. continue; } @@ -585,8 +578,7 @@ void FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> * } void FileSystemDock::_update_file_list(bool p_keep_selection) { - - // Register the previously selected items + // Register the previously selected items. Set<String> cselection; if (p_keep_selection) { for (int i = 0; i < files->get_item_count(); i++) { @@ -612,7 +604,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { bool use_thumbnails = (file_list_display_mode == FILE_LIST_DISPLAY_THUMBNAILS); if (use_thumbnails) { - // Thumbnails mode + // Thumbnails mode. files->set_max_columns(0); files->set_icon_mode(ItemList::ICON_MODE_TOP); files->set_fixed_column_width(thumbnail_size * 3 / 2); @@ -629,8 +621,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { file_thumbnail_broken = get_icon("FileDeadBigThumb", ei); } } else { - - // No thumbnails + // No thumbnails. files->set_icon_mode(ItemList::ICON_MODE_LEFT); files->set_max_columns(1); files->set_max_text_lines(1); @@ -639,11 +630,12 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { } Ref<Texture> folder_icon = (use_thumbnails) ? folder_thumbnail : get_icon("folder", "FileDialog"); + const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); - // Build the FileInfo list + // Build the FileInfo list. List<FileInfo> filelist; if (path == "Favorites") { - // Display the favorites + // Display the favorites. Vector<String> favorites = EditorSettings::get_singleton()->get_favorites(); for (int i = 0; i < favorites.size(); i++) { String favorite = favorites[i]; @@ -677,7 +669,6 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { fi.type = ""; fi.import_broken = true; } - fi.import_status = 0; if (searched_string.length() == 0 || fi.name.to_lower().find(searched_string) >= 0) { filelist.push_back(fi); @@ -685,8 +676,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { } } } else { - - // Get infos on the directory + file + // Get infos on the directory + file. if (directory.ends_with("/") && directory != "res://") { directory = directory.substr(0, directory.length() - 1); } @@ -700,13 +690,11 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { return; if (searched_string.length() > 0) { - // Display the search results + // Display the search results. _search(EditorFileSystem::get_singleton()->get_filesystem(), &filelist, 128); } else { - if (display_mode == DISPLAY_MODE_TREE_ONLY || always_show_folders) { - // Display folders in the list - + // Display folders in the list. if (directory != "res://") { files->add_item("..", folder_icon, true); @@ -716,14 +704,15 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { files->set_item_metadata(files->get_item_count() - 1, bd); files->set_item_selectable(files->get_item_count() - 1, false); + files->set_item_icon_modulate(files->get_item_count() - 1, folder_color); } for (int i = 0; i < efd->get_subdir_count(); i++) { - String dname = efd->get_subdir(i)->get_name(); files->add_item(dname, folder_icon, true); files->set_item_metadata(files->get_item_count() - 1, directory.plus_file(dname) + "/"); + files->set_item_icon_modulate(files->get_item_count() - 1, folder_color); if (cselection.has(dname)) { files->select(files->get_item_count() - 1, false); @@ -731,15 +720,13 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { } } - // Display the folder content + // Display the folder content. for (int i = 0; i < efd->get_file_count(); i++) { - FileInfo fi; fi.name = efd->get_file(i); fi.path = directory.plus_file(fi.name); fi.type = efd->get_file_type(i); fi.import_broken = !efd->get_file_import_is_valid(i); - fi.import_status = 0; filelist.push_back(fi); } @@ -747,7 +734,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { filelist.sort(); } - // Fills the ItemList control node from the FileInfos + // Fills the ItemList control node from the FileInfos. String oi = "Object"; for (List<FileInfo>::Element *E = filelist.front(); E; E = E->next()) { FileInfo *finfo = &(E->get()); @@ -760,7 +747,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { String tooltip = fpath; - // Select the icons + // Select the icons. if (!finfo->import_broken) { type_icon = (has_icon(ftype, ei)) ? get_icon(ftype, ei) : get_icon(oi, ei); big_icon = file_thumbnail; @@ -770,7 +757,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { tooltip += "\n" + TTR("Status: Import of file failed. Please fix file and reimport manually."); } - // Add the item to the ItemList + // Add the item to the ItemList. int item_index; if (use_thumbnails) { files->add_item(fname, big_icon, true); @@ -784,7 +771,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { files->set_item_metadata(item_index, fpath); } - // Generate the preview + // Generate the preview. if (!finfo->import_broken) { Array udata; udata.resize(2); @@ -793,7 +780,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { EditorResourcePreview::get_singleton()->queue_resource_preview(fpath, this, "_file_list_thumbnail_done", udata); } - // Select the items + // Select the items. if (cselection.has(fname)) files->select(item_index, false); @@ -802,7 +789,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { files->ensure_current_is_visible(); } - // Tooltip + // Tooltip. if (finfo->sources.size()) { for (int j = 0; j < finfo->sources.size(); j++) { tooltip += "\nSource: " + finfo->sources[j]; @@ -849,13 +836,12 @@ void FileSystemDock::_file_list_activate_file(int p_idx) { } void FileSystemDock::_preview_invalidated(const String &p_path) { - if (file_list_display_mode == FILE_LIST_DISPLAY_THUMBNAILS && p_path.get_base_dir() == path && searched_string.length() == 0 && file_list_vb->is_visible_in_tree()) { for (int i = 0; i < files->get_item_count(); i++) { if (files->get_item_metadata(i) == p_path) { - //re-request preview + // Re-request preview. Array udata; udata.resize(2); udata[0] = i; @@ -868,7 +854,6 @@ void FileSystemDock::_preview_invalidated(const String &p_path) { } void FileSystemDock::_fs_changed() { - button_hist_prev->set_disabled(history_pos == 0); button_hist_next->set_disabled(history_pos == history.size() - 1); scanning_vb->hide(); @@ -886,7 +871,6 @@ void FileSystemDock::_fs_changed() { } void FileSystemDock::_set_scanning_mode() { - button_hist_prev->set_disabled(true); button_hist_next->set_disabled(true); split_box->hide(); @@ -900,7 +884,6 @@ void FileSystemDock::_set_scanning_mode() { } void FileSystemDock::_fw_history() { - if (history_pos < history.size() - 1) history_pos++; @@ -978,7 +961,7 @@ void FileSystemDock::_find_remaps(EditorFileSystemDirectory *efsd, const Map<Str void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_new_path, Map<String, String> &p_file_renames, Map<String, String> &p_folder_renames) { - //Ensure folder paths end with "/" + // Ensure folder paths end with "/". String old_path = (p_item.is_file || p_item.path.ends_with("/")) ? p_item.path : (p_item.path + "/"); String new_path = (p_item.is_file || p_new_path.ends_with("/")) ? p_new_path : (p_new_path + "/"); @@ -988,12 +971,12 @@ void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_ EditorNode::get_singleton()->add_io_error(TTR("Cannot move/rename resources root.")); return; } else if (!p_item.is_file && new_path.begins_with(old_path)) { - //This check doesn't erroneously catch renaming to a longer name as folder paths always end with "/" + // This check doesn't erroneously catch renaming to a longer name as folder paths always end with "/". EditorNode::get_singleton()->add_io_error(TTR("Cannot move a folder into itself.") + "\n" + old_path + "\n"); return; } - //Build a list of files which will have new paths as a result of this operation + // Build a list of files which will have new paths as a result of this operation. Vector<String> file_changed_paths; Vector<String> folder_changed_paths; if (p_item.is_file) { @@ -1007,8 +990,7 @@ void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_ print_verbose("Moving " + old_path + " -> " + new_path); Error err = da->rename(old_path, new_path); if (err == OK) { - - //Move/Rename any corresponding import settings too + // Move/Rename any corresponding import settings too. if (p_item.is_file && FileAccess::exists(old_path + ".import")) { err = da->rename(old_path + ".import", new_path + ".import"); if (err != OK) { @@ -1016,7 +998,7 @@ void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_ } } - // update scene if it is open + // Update scene if it is open. for (int i = 0; i < file_changed_paths.size(); ++i) { String new_item_path = p_item.is_file ? new_path : file_changed_paths[i].replace_first(old_path, new_path); if (ResourceLoader::get_resource_type(new_item_path) == "PackedScene" && editor->is_scene_open(file_changed_paths[i])) { @@ -1031,7 +1013,7 @@ void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_ } } - //Only treat as a changed dependency if it was successfully moved + // Only treat as a changed dependency if it was successfully moved. for (int i = 0; i < file_changed_paths.size(); ++i) { p_file_renames[file_changed_paths[i]] = file_changed_paths[i].replace_first(old_path, new_path); print_verbose(" Remap: " + file_changed_paths[i] + " -> " + p_file_renames[file_changed_paths[i]]); @@ -1048,7 +1030,7 @@ void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_ } void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const String &p_new_path) const { - //Ensure folder paths end with "/" + // Ensure folder paths end with "/". String old_path = (p_item.is_file || p_item.path.ends_with("/")) ? p_item.path : (p_item.path + "/"); String new_path = (p_item.is_file || p_new_path.ends_with("/")) ? p_new_path : (p_new_path + "/"); @@ -1058,7 +1040,7 @@ void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const Strin EditorNode::get_singleton()->add_io_error(TTR("Cannot move/rename resources root.")); return; } else if (!p_item.is_file && new_path.begins_with(old_path)) { - //This check doesn't erroneously catch renaming to a longer name as folder paths always end with "/" + // This check doesn't erroneously catch renaming to a longer name as folder paths always end with "/". EditorNode::get_singleton()->add_io_error(TTR("Cannot move a folder into itself.") + "\n" + old_path + "\n"); return; } @@ -1067,7 +1049,7 @@ void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const Strin print_verbose("Duplicating " + old_path + " -> " + new_path); Error err = p_item.is_file ? da->copy(old_path, new_path) : da->copy_dir(old_path, new_path); if (err == OK) { - //Move/Rename any corresponding import settings too + // Move/Rename any corresponding import settings too. if (p_item.is_file && FileAccess::exists(old_path + ".import")) { err = da->copy(old_path + ".import", new_path + ".import"); if (err != OK) { @@ -1081,13 +1063,11 @@ void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const Strin } void FileSystemDock::_update_resource_paths_after_move(const Map<String, String> &p_renames) const { - - //Rename all resources loaded, be it subresources or actual resources + // Rename all resources loaded, be it subresources or actual resources. List<Ref<Resource> > cached; ResourceCache::get_cached_resources(&cached); for (List<Ref<Resource> >::Element *E = cached.front(); E; E = E->next()) { - Ref<Resource> r = E->get(); String base_path = r->get_path(); @@ -1106,7 +1086,6 @@ void FileSystemDock::_update_resource_paths_after_move(const Map<String, String> } for (int i = 0; i < EditorNode::get_editor_data().get_edited_scene_count(); i++) { - String path; if (i == EditorNode::get_editor_data().get_edited_scene()) { if (!get_tree()->get_edited_scene_root()) @@ -1114,7 +1093,6 @@ void FileSystemDock::_update_resource_paths_after_move(const Map<String, String> path = get_tree()->get_edited_scene_root()->get_filename(); } else { - path = EditorNode::get_editor_data().get_scene_path(i); } @@ -1123,23 +1101,21 @@ void FileSystemDock::_update_resource_paths_after_move(const Map<String, String> } if (i == EditorNode::get_editor_data().get_edited_scene()) { - get_tree()->get_edited_scene_root()->set_filename(path); } else { - EditorNode::get_editor_data().set_scene_path(i, path); } } } void FileSystemDock::_update_dependencies_after_move(const Map<String, String> &p_renames) const { - //The following code assumes that the following holds: + // The following code assumes that the following holds: // 1) EditorFileSystem contains the old paths/folder structure from before the rename/move. // 2) ResourceLoader can use the new paths without needing to call rescan. Vector<String> remaps; _find_remaps(EditorFileSystem::get_singleton()->get_filesystem(), p_renames, remaps); for (int i = 0; i < remaps.size(); ++i) { - //Because we haven't called a rescan yet the found remap might still be an old path itself. + // Because we haven't called a rescan yet the found remap might still be an old path itself. String file = p_renames.has(remaps[i]) ? p_renames[remaps[i]] : remaps[i]; print_verbose("Remapping dependencies for: " + file); Error err = ResourceLoader::rename_dependencies(file, p_renames); @@ -1153,8 +1129,7 @@ void FileSystemDock::_update_dependencies_after_move(const Map<String, String> & } void FileSystemDock::_update_project_settings_after_move(const Map<String, String> &p_renames) const { - - // Find all project settings of type FILE and replace them if needed + // Find all project settings of type FILE and replace them if needed. const Map<StringName, PropertyInfo> prop_info = ProjectSettings::get_singleton()->get_custom_property_info(); for (const Map<StringName, PropertyInfo>::Element *E = prop_info.front(); E; E = E->next()) { if (E->get().hint == PROPERTY_HINT_FILE) { @@ -1185,7 +1160,6 @@ void FileSystemDock::_update_project_settings_after_move(const Map<String, Strin } void FileSystemDock::_update_favorites_list_after_move(const Map<String, String> &p_files_renames, const Map<String, String> &p_folders_renames) const { - Vector<String> favorites = EditorSettings::get_singleton()->get_favorites(); Vector<String> new_favorites; @@ -1250,6 +1224,48 @@ void FileSystemDock::_make_dir_confirm() { } } +void FileSystemDock::_make_scene_confirm() { + String scene_name = make_scene_dialog_text->get_text().strip_edges(); + + if (scene_name.length() == 0) { + EditorNode::get_singleton()->show_warning(TTR("No name provided.")); + return; + } + + String directory = path; + if (!directory.ends_with("/")) { + directory = directory.get_base_dir(); + } + + String extension = scene_name.get_extension(); + List<String> extensions; + Ref<PackedScene> sd = memnew(PackedScene); + ResourceSaver::get_recognized_extensions(sd, &extensions); + + bool extension_correct = false; + for (List<String>::Element *E = extensions.front(); E; E = E->next()) { + if (E->get() == extension) { + extension_correct = true; + break; + } + } + if (!extension_correct) + scene_name = scene_name.get_basename() + ".tscn"; + + scene_name = directory.plus_file(scene_name); + + DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + if (da->file_exists(scene_name)) { + EditorNode::get_singleton()->show_warning(TTR("A file or folder with this name already exists.")); + memdelete(da); + return; + } + memdelete(da); + + int idx = editor->new_scene(); + editor->get_editor_data().set_scene_path(idx, scene_name); +} + void FileSystemDock::_file_deleted(String p_file) { emit_signal("file_deleted", p_file); } @@ -1259,7 +1275,6 @@ void FileSystemDock::_folder_deleted(String p_folder) { } void FileSystemDock::_rename_operation_confirm() { - String new_name = rename_dialog_text->get_text().strip_edges(); if (new_name.length() == 0) { EditorNode::get_singleton()->show_warning(TTR("No name provided.")); @@ -1279,10 +1294,10 @@ void FileSystemDock::_rename_operation_confirm() { EditorFileSystem::get_singleton()->move_group_file(old_path, new_path); } - //Present a more user friendly warning for name conflict + // Present a more user friendly warning for name conflict. DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); #if defined(WINDOWS_ENABLED) || defined(UWP_ENABLED) - // Workaround case insensitivity on Windows + // Workaround case insensitivity on Windows. if ((da->file_exists(new_path) || da->dir_exists(new_path)) && new_path.to_lower() != old_path.to_lower()) { #else if (da->file_exists(new_path) || da->dir_exists(new_path)) { @@ -1298,7 +1313,7 @@ void FileSystemDock::_rename_operation_confirm() { _try_move_item(to_rename, new_path, file_renames, folder_renames); int current_tab = editor->get_current_tab(); - + _save_scenes_after_move(file_renames); // save scenes before updating _update_dependencies_after_move(file_renames); _update_resource_paths_after_move(file_renames); _update_project_settings_after_move(file_renames); @@ -1314,7 +1329,6 @@ void FileSystemDock::_rename_operation_confirm() { } void FileSystemDock::_duplicate_operation_confirm() { - String new_name = duplicate_dialog_text->get_text().strip_edges(); if (new_name.length() == 0) { EditorNode::get_singleton()->show_warning(TTR("No name provided.")); @@ -1332,7 +1346,7 @@ void FileSystemDock::_duplicate_operation_confirm() { String new_path = base_dir.plus_file(new_name); - //Present a more user friendly warning for name conflict + // Present a more user friendly warning for name conflict DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); if (da->file_exists(new_path) || da->dir_exists(new_path)) { EditorNode::get_singleton()->show_warning(TTR("A file or folder with this name already exists.")); @@ -1343,7 +1357,7 @@ void FileSystemDock::_duplicate_operation_confirm() { _try_duplicate_item(to_duplicate, new_path); - //Rescan everything + // Rescan everything. print_verbose("FileSystem: calling rescan."); _rescan(); } @@ -1376,14 +1390,14 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool overw to_move_path = p_to_path; bool can_move = _check_existing(); if (!can_move) { - //ask to do something + // Ask to do something. overwrite_dialog->popup_centered_minsize(); overwrite_dialog->grab_focus(); return; } } - //check groups + // Check groups. for (int i = 0; i < to_move.size(); i++) { print_line("is group: " + to_move[i].path + ": " + itos(EditorFileSystem::get_singleton()->is_group_file(to_move[i].path))); @@ -1407,7 +1421,7 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool overw if (is_moved) { int current_tab = editor->get_current_tab(); - + _save_scenes_after_move(file_renames); //save scenes before updating _update_dependencies_after_move(file_renames); _update_resource_paths_after_move(file_renames); _update_project_settings_after_move(file_renames); @@ -1424,7 +1438,7 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool overw } Vector<String> FileSystemDock::_tree_get_selected(bool remove_self_inclusion) { - // Build a list of selected items with the active one at the first position + // Build a list of selected items with the active one at the first position. Vector<String> selected_strings; TreeItem *favorites_item = tree->get_root()->get_children(); @@ -1442,8 +1456,15 @@ Vector<String> FileSystemDock::_tree_get_selected(bool remove_self_inclusion) { selected = tree->get_next_selected(selected); } - // Remove paths or files that are included into another - if (remove_self_inclusion && selected_strings.size() > 1) { + if (remove_self_inclusion) { + selected_strings = _remove_self_included_paths(selected_strings); + } + return selected_strings; +} + +Vector<String> FileSystemDock::_remove_self_included_paths(Vector<String> selected_strings) { + // Remove paths or files that are included into another. + if (selected_strings.size() > 1) { selected_strings.sort_custom<NaturalNoCaseComparator>(); String last_path = ""; for (int i = 0; i < selected_strings.size(); i++) { @@ -1460,10 +1481,9 @@ Vector<String> FileSystemDock::_tree_get_selected(bool remove_self_inclusion) { } void FileSystemDock::_tree_rmb_option(int p_option) { + Vector<String> selected_strings = _tree_get_selected(false); - Vector<String> selected_strings = _tree_get_selected(); - - // Execute the current option + // Execute the current option. switch (p_option) { case FOLDER_EXPAND_ALL: case FOLDER_COLLAPSE_ALL: { @@ -1503,11 +1523,11 @@ void FileSystemDock::_file_list_rmb_option(int p_option) { } void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected) { - // The first one should be the active item + // The first one should be the active item. switch (p_option) { case FILE_SHOW_IN_EXPLORER: { - // Show the file / folder in the OS explorer + // Show the file/folder in the OS explorer. String fpath = path; if (path == "Favorites") { fpath = p_selected[0]; @@ -1521,7 +1541,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_OPEN: { - // Open folders + // Open folders. TreeItem *selected = tree->get_root(); selected = tree->get_next_selected(selected); while (selected) { @@ -1530,21 +1550,21 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } selected = tree->get_next_selected(selected); } - // Open the file + // Open the file. for (int i = 0; i < p_selected.size(); i++) { _select_file(p_selected[i]); } } break; case FILE_INHERIT: { - // Create a new scene inherited from the selected one + // Create a new scene inherited from the selected one. if (p_selected.size() == 1) { emit_signal("inherit", p_selected[0]); } } break; case FILE_INSTANCE: { - // Instance all selected scenes + // Instance all selected scenes. Vector<String> paths; for (int i = 0; i < p_selected.size(); i++) { String fpath = p_selected[i]; @@ -1558,7 +1578,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_ADD_FAVORITE: { - // Add the files from favorites + // Add the files from favorites. Vector<String> favorites = EditorSettings::get_singleton()->get_favorites(); for (int i = 0; i < p_selected.size(); i++) { if (favorites.find(p_selected[i]) == -1) { @@ -1570,7 +1590,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_REMOVE_FAVORITE: { - // Remove the files from favorites + // Remove the files from favorites. Vector<String> favorites = EditorSettings::get_singleton()->get_favorites(); for (int i = 0; i < p_selected.size(); i++) { favorites.erase(p_selected[i]); @@ -1582,7 +1602,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_DEPENDENCIES: { - // Checkout the file dependencies + // Checkout the file dependencies. if (!p_selected.empty()) { String fpath = p_selected[0]; deps_editor->edit(fpath); @@ -1590,7 +1610,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_OWNERS: { - // Checkout the file owners + // Checkout the file owners. if (!p_selected.empty()) { String fpath = p_selected[0]; owners_editor->show(fpath); @@ -1598,10 +1618,11 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_MOVE: { - // Move the files to a given location + // Move the files to a given location. to_move.clear(); - for (int i = 0; i < p_selected.size(); i++) { - String fpath = p_selected[i]; + Vector<String> collapsed_paths = _remove_self_included_paths(p_selected); + for (int i = collapsed_paths.size() - 1; i >= 0; i--) { + String fpath = collapsed_paths[i]; if (fpath != "res://") { to_move.push_back(FileOrFolder(fpath, !fpath.ends_with("/"))); } @@ -1612,7 +1633,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_RENAME: { - // Rename the active file + // Rename the active file. if (!p_selected.empty()) { to_rename.path = p_selected[0]; if (to_rename.path != "res://") { @@ -1635,12 +1656,13 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_REMOVE: { - // Remove the selected files + // Remove the selected files. Vector<String> remove_files; Vector<String> remove_folders; + Vector<String> collapsed_paths = _remove_self_included_paths(p_selected); - for (int i = 0; i < p_selected.size(); i++) { - String fpath = p_selected[i]; + for (int i = 0; i < collapsed_paths.size(); i++) { + String fpath = collapsed_paths[i]; if (fpath != "res://") { if (fpath.ends_with("/")) { remove_folders.push_back(fpath); @@ -1656,7 +1678,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_DUPLICATE: { - // Duplicate the selected files + // Duplicate the selected files. for (int i = 0; i < p_selected.size(); i++) { to_duplicate.path = p_selected[i]; to_duplicate.is_file = !to_duplicate.path.ends_with("/"); @@ -1681,7 +1703,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_REIMPORT: { - // Reimport all selected files + // Reimport all selected files. Vector<String> reimport; for (int i = 0; i < p_selected.size(); i++) { reimport.push_back(p_selected[i]); @@ -1691,15 +1713,20 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_NEW_FOLDER: { - // Create a new folder make_dir_dialog_text->set_text("new folder"); make_dir_dialog_text->select_all(); make_dir_dialog->popup_centered_minsize(Size2(250, 80) * EDSCALE); make_dir_dialog_text->grab_focus(); } break; + case FILE_NEW_SCENE: { + make_scene_dialog_text->set_text("new scene"); + make_scene_dialog_text->select_all(); + make_scene_dialog->popup_centered_minsize(Size2(250, 80) * EDSCALE); + make_scene_dialog_text->grab_focus(); + } break; + case FILE_NEW_SCRIPT: { - // Create a new script String fpath = path; if (!fpath.ends_with("/")) { fpath = fpath.get_base_dir(); @@ -1709,7 +1736,6 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_COPY_PATH: { - // Copy the file path if (!p_selected.empty()) { String fpath = p_selected[0]; OS::get_singleton()->set_clipboard(fpath); @@ -1717,7 +1743,6 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } break; case FILE_NEW_RESOURCE: { - // Create a new resource new_resource_dialog->popup_create(true); } break; } @@ -1745,7 +1770,7 @@ void FileSystemDock::_resource_created() const { void FileSystemDock::_search_changed(const String &p_text, const Control *p_from) { if (searched_string.length() == 0 && p_text.length() > 0) { - // Register the uncollapsed paths before they change + // Register the uncollapsed paths before they change. uncollapsed_paths_before_search = _compute_uncollapsed_paths(); } @@ -1753,7 +1778,7 @@ void FileSystemDock::_search_changed(const String &p_text, const Control *p_from if (p_from == tree_search_box) file_list_search_box->set_text(searched_string); - else // file_list_search_box + else // File_list_search_box. tree_search_box->set_text(searched_string); switch (display_mode) { @@ -1768,7 +1793,6 @@ void FileSystemDock::_search_changed(const String &p_text, const Control *p_from } void FileSystemDock::_rescan() { - _set_scanning_mode(); EditorFileSystem::get_singleton()->scan(); } @@ -1783,12 +1807,10 @@ void FileSystemDock::fix_dependencies(const String &p_for_file) { } void FileSystemDock::focus_on_filter() { - file_list_search_box->grab_focus(); } void FileSystemDock::set_file_list_display_mode(FileListDisplayMode p_mode) { - if (p_mode == file_list_display_mode) return; @@ -1802,12 +1824,12 @@ Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) Vector<String> paths; if (p_from == tree) { - // Check if the first selected is in favorite + // Check if the first selected is in favorite. TreeItem *selected = tree->get_next_selected(tree->get_root()); while (selected) { TreeItem *favorites_item = tree->get_root()->get_children(); if (selected == favorites_item) { - // The "Favorites" item is not draggable + // The "Favorites" item is not draggable. return Variant(); } @@ -1845,12 +1867,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") { - // Moving favorite around + // Moving favorite around. TreeItem *ti = tree->get_item_at_position(p_point); if (!ti) return false; @@ -1861,20 +1882,20 @@ bool FileSystemDock::can_drop_data_fw(const Point2 &p_point, const Variant &p_da TreeItem *resources_item = favorites_item->get_next(); if (ti == favorites_item) { - return (drop_section == 1); // The parent, first fav + return (drop_section == 1); // The parent, first fav. } if (ti->get_parent() && favorites_item == ti->get_parent()) { return true; // A favorite } if (ti == resources_item) { - return (drop_section == -1); // The tree, last fav + return (drop_section == -1); // The tree, last fav. } return false; } if (drag_data.has("type") && String(drag_data["type"]) == "resource") { - // Move resources + // Move resources. String to_dir; bool favorite; _get_drag_target_folder(to_dir, favorite, p_point, p_from); @@ -1882,7 +1903,7 @@ bool FileSystemDock::can_drop_data_fw(const Point2 &p_point, const Variant &p_da } if (drag_data.has("type") && (String(drag_data["type"]) == "files" || String(drag_data["type"]) == "files_and_dirs")) { - // Move files or dir + // Move files or dir. String to_dir; bool favorite; _get_drag_target_folder(to_dir, favorite, p_point, p_from); @@ -1893,8 +1914,8 @@ bool FileSystemDock::can_drop_data_fw(const Point2 &p_point, const Variant &p_da if (to_dir.empty()) return false; - //Attempting to move a folder into itself will fail later - //Rather than bring up a message don't try to do it in the first place + // Attempting to move a folder into itself will fail later, + // rather than bring up a message don't try to do it in the first place to_dir = to_dir.ends_with("/") ? to_dir : (to_dir + "/"); Vector<String> fnames = drag_data["files"]; for (int i = 0; i < fnames.size(); ++i) { @@ -1909,7 +1930,6 @@ bool FileSystemDock::can_drop_data_fw(const Point2 &p_point, const Variant &p_da } void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { - if (!can_drop_data_fw(p_point, p_data, p_from)) return; Dictionary drag_data = p_data; @@ -1917,7 +1937,7 @@ 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") { - // Moving favorite around + // Moving favorite around. TreeItem *ti = tree->get_item_at_position(p_point); if (!ti) return; @@ -1929,20 +1949,20 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, TreeItem *resources_item = favorites_item->get_next(); if (ti == favorites_item) { - // Drop on the favorite folder + // Drop on the favorite folder. drop_position = 0; } else if (ti == resources_item) { - // Drop on the resource item + // Drop on the resource item. drop_position = dirs.size(); } else { - // Drop in the list + // Drop in the list. drop_position = dirs.find(ti->get_metadata(0)); if (drop_section == 1) { drop_position++; } } - // Remove dragged favorites + // Remove dragged favorites. Vector<int> to_remove; int offset = 0; for (int i = 0; i < files.size(); i++) { @@ -1958,7 +1978,7 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, dirs.remove(to_remove[i] - i); } - // Re-add them at the right position + // Re-add them at the right position. for (int i = 0; i < files.size(); i++) { dirs.insert(drop_position, files[i]); drop_position++; @@ -1973,7 +1993,7 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, } if (drag_data.has("type") && String(drag_data["type"]) == "resource") { - // Moving resource + // Moving resource. Ref<Resource> res = drag_data["resource"]; String to_dir; bool favorite; @@ -1985,7 +2005,7 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, } if (drag_data.has("type") && (String(drag_data["type"]) == "files" || String(drag_data["type"]) == "files_and_dirs")) { - // Move files or add to favorites + // Move files or add to favorites. String to_dir; bool favorite; _get_drag_target_folder(to_dir, favorite, p_point, p_from); @@ -2015,7 +2035,7 @@ void FileSystemDock::_get_drag_target_folder(String &target, bool &target_favori target = String(); target_favorites = false; - // In the file list + // In the file list. if (p_from == files) { int pos = files->get_item_at_position(p_point, true); if (pos == -1) { @@ -2027,12 +2047,12 @@ void FileSystemDock::_get_drag_target_folder(String &target, bool &target_favori return; } - // In the tree + // In the tree. if (p_from == tree) { TreeItem *ti = tree->get_item_at_position(p_point); int section = tree->get_drop_section_at_position(p_point); if (ti) { - // Check the favorites first + // Check the favorites first. if (ti == tree->get_root()->get_children() && section >= 0) { target_favorites = true; return; @@ -2043,13 +2063,13 @@ void FileSystemDock::_get_drag_target_folder(String &target, bool &target_favori String fpath = ti->get_metadata(0); if (section == 0) { if (fpath.ends_with("/")) { - // We drop on a folder + // We drop on a folder. target = fpath; return; } } else { if (ti->get_parent() != tree->get_root()->get_children()) { - // Not in the favorite section + // Not in the favorite section. if (fpath != "res://") { // We drop between two files if (fpath.ends_with("/")) { @@ -2066,7 +2086,7 @@ void FileSystemDock::_get_drag_target_folder(String &target, bool &target_favori } void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<String> p_paths, bool p_display_path_dependent_options) { - // Add options for files and folders + // Add options for files and folders. ERR_FAIL_COND(p_paths.empty()); Vector<String> filenames; @@ -2090,7 +2110,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str all_files_scenes &= (EditorFileSystem::get_singleton()->get_file_type(fpath) == "PackedScene"); } - // Check if in favorites + // Check if in favorites. bool found = false; for (int j = 0; j < favorites.size(); j++) { if (favorites[j] == fpath) { @@ -2106,7 +2126,6 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str } if (all_files) { - if (all_files_scenes) { if (filenames.size() == 1) { p_popup->add_item(TTR("Open Scene"), FILE_OPEN); @@ -2146,19 +2165,25 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str if (p_paths.size() == 1) { p_popup->add_item(TTR("Copy Path"), FILE_COPY_PATH); - p_popup->add_item(TTR("Rename..."), FILE_RENAME); - p_popup->add_item(TTR("Duplicate..."), FILE_DUPLICATE); + if (p_paths[0] != "res://") { + p_popup->add_item(TTR("Rename..."), FILE_RENAME); + p_popup->add_item(TTR("Duplicate..."), FILE_DUPLICATE); + } } - p_popup->add_item(TTR("Move To..."), FILE_MOVE); - p_popup->add_item(TTR("Delete"), FILE_REMOVE); + if (p_paths.size() > 1 || p_paths[0] != "res://") { + p_popup->add_item(TTR("Move To..."), FILE_MOVE); + p_popup->add_item(TTR("Delete"), FILE_REMOVE); + } if (p_paths.size() == 1) { p_popup->add_separator(); if (p_display_path_dependent_options) { p_popup->add_item(TTR("New Folder..."), FILE_NEW_FOLDER); + p_popup->add_item(TTR("New Scene..."), FILE_NEW_SCENE); p_popup->add_item(TTR("New Script..."), FILE_NEW_SCRIPT); p_popup->add_item(TTR("New Resource..."), FILE_NEW_RESOURCE); + p_popup->add_separator(); } String fpath = p_paths[0]; @@ -2168,8 +2193,8 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str } void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) { - // Right click is pressed in the tree - Vector<String> paths = _tree_get_selected(); + // Right click is pressed in the tree. + Vector<String> paths = _tree_get_selected(false); if (paths.size() == 1) { if (paths[0].ends_with("/")) { @@ -2179,7 +2204,7 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) { } } - // Popup + // Popup. if (!paths.empty()) { tree_popup->clear(); tree_popup->set_size(Size2(1, 1)); @@ -2190,11 +2215,12 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) { } void FileSystemDock::_tree_rmb_empty(const Vector2 &p_pos) { - // Right click is pressed in the empty space of the tree + // Right click is pressed in the empty space of the tree. path = "res://"; tree_popup->clear(); tree_popup->set_size(Size2(1, 1)); tree_popup->add_item(TTR("New Folder..."), FILE_NEW_FOLDER); + tree_popup->add_item(TTR("New Scene..."), FILE_NEW_SCENE); tree_popup->add_item(TTR("New Script..."), FILE_NEW_SCRIPT); tree_popup->add_item(TTR("New Resource..."), FILE_NEW_RESOURCE); tree_popup->set_position(tree->get_global_position() + p_pos); @@ -2206,7 +2232,7 @@ void FileSystemDock::_tree_empty_selected() { } void FileSystemDock::_file_list_rmb_select(int p_item, const Vector2 &p_pos) { - // Right click is pressed in the file list + // Right click is pressed in the file list. Vector<String> paths; for (int i = 0; i < files->get_item_count(); i++) { if (!files->is_selected(i)) @@ -2218,7 +2244,7 @@ void FileSystemDock::_file_list_rmb_select(int p_item, const Vector2 &p_pos) { paths.push_back(files->get_item_metadata(i)); } - // Popup + // Popup. if (!paths.empty()) { file_list_popup->clear(); file_list_popup->set_size(Size2(1, 1)); @@ -2229,7 +2255,7 @@ void FileSystemDock::_file_list_rmb_select(int p_item, const Vector2 &p_pos) { } void FileSystemDock::_file_list_rmb_pressed(const Vector2 &p_pos) { - // Right click on empty space for file list + // Right click on empty space for file list. if (searched_string.length() > 0) return; @@ -2237,21 +2263,21 @@ void FileSystemDock::_file_list_rmb_pressed(const Vector2 &p_pos) { file_list_popup->set_size(Size2(1, 1)); file_list_popup->add_item(TTR("New Folder..."), FILE_NEW_FOLDER); + file_list_popup->add_item(TTR("New Scene..."), FILE_NEW_SCENE); file_list_popup->add_item(TTR("New Script..."), FILE_NEW_SCRIPT); file_list_popup->add_item(TTR("New Resource..."), FILE_NEW_RESOURCE); - file_list_popup->add_item(TTR("Show in File Manager"), FILE_SHOW_IN_EXPLORER); + file_list_popup->add_separator(); + file_list_popup->add_item(TTR("Open in File Manager"), FILE_SHOW_IN_EXPLORER); file_list_popup->set_position(files->get_global_position() + p_pos); file_list_popup->popup(); } void FileSystemDock::select_file(const String &p_file) { - _navigate_to_path(p_file); } void FileSystemDock::_file_multi_selected(int p_index, bool p_selected) { - - // Set the path to the current focused item + // Set the path to the current focused item. int current = files->get_current(); if (current == p_index) { String fpath = files->get_item_metadata(current); @@ -2263,15 +2289,14 @@ void FileSystemDock::_file_multi_selected(int p_index, bool p_selected) { } } - // Update the import dock + // Update the import dock. import_dock_needs_update = true; call_deferred("_update_import_dock"); } void FileSystemDock::_tree_gui_input(Ref<InputEvent> p_event) { - if (get_viewport()->get_modal_stack_top()) - return; //ignore because of modal window + return; // Ignore because of modal window. Ref<InputEventKey> key = p_event; if (key.is_valid() && key->is_pressed() && !key->is_echo()) { @@ -2288,9 +2313,8 @@ void FileSystemDock::_tree_gui_input(Ref<InputEvent> p_event) { } void FileSystemDock::_file_list_gui_input(Ref<InputEvent> p_event) { - if (get_viewport()->get_modal_stack_top()) - return; //ignore because of modal window + return; // Ignore because of modal window. Ref<InputEventKey> key = p_event; if (key.is_valid() && key->is_pressed() && !key->is_echo()) { @@ -2307,18 +2331,17 @@ void FileSystemDock::_file_list_gui_input(Ref<InputEvent> p_event) { } void FileSystemDock::_update_import_dock() { - if (!import_dock_needs_update) return; - // List selected + // List selected. Vector<String> selected; if (display_mode == DISPLAY_MODE_TREE_ONLY) { // Use the tree selected = _tree_get_selected(); } else { - // Use the file list + // Use the file list. for (int i = 0; i < files->get_item_count(); i++) { if (!files->is_selected(i)) continue; @@ -2327,7 +2350,7 @@ void FileSystemDock::_update_import_dock() { } } - // Check import + // Check import. Vector<String> imports; String import_type; for (int i = 0; i < selected.size(); i++) { @@ -2354,7 +2377,7 @@ void FileSystemDock::_update_import_dock() { if (import_type == "") { import_type = type; } else if (import_type != type) { - //all should be the same type + // All should be the same type. imports.clear(); break; } @@ -2373,12 +2396,10 @@ void FileSystemDock::_update_import_dock() { } void FileSystemDock::_feature_profile_changed() { - _update_display_mode(true); } void FileSystemDock::_bind_methods() { - ClassDB::bind_method(D_METHOD("_file_list_gui_input"), &FileSystemDock::_file_list_gui_input); ClassDB::bind_method(D_METHOD("_tree_gui_input"), &FileSystemDock::_tree_gui_input); @@ -2411,6 +2432,7 @@ void FileSystemDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_fs_changed"), &FileSystemDock::_fs_changed); ClassDB::bind_method(D_METHOD("_tree_multi_selected"), &FileSystemDock::_tree_multi_selected); ClassDB::bind_method(D_METHOD("_make_dir_confirm"), &FileSystemDock::_make_dir_confirm); + ClassDB::bind_method(D_METHOD("_make_scene_confirm"), &FileSystemDock::_make_scene_confirm); ClassDB::bind_method(D_METHOD("_resource_created"), &FileSystemDock::_resource_created); ClassDB::bind_method(D_METHOD("_move_operation_confirm", "to_path", "overwrite"), &FileSystemDock::_move_operation_confirm, DEFVAL(false)); ClassDB::bind_method(D_METHOD("_move_with_overwrite"), &FileSystemDock::_move_with_overwrite); @@ -2442,7 +2464,6 @@ void FileSystemDock::_bind_methods() { } FileSystemDock::FileSystemDock(EditorNode *p_editor) { - set_name("FileSystem"); editor = p_editor; path = "res://"; @@ -2523,7 +2544,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { tree->set_custom_minimum_size(Size2(0, 15 * EDSCALE)); split_box->add_child(tree); - tree->connect("item_edited", this, "_favorite_toggled"); tree->connect("item_activated", this, "_tree_activate_file"); tree->connect("multi_selected", this, "_tree_multi_selected"); tree->connect("item_rmb_selected", this, "_tree_rmb_select"); @@ -2626,6 +2646,17 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { make_dir_dialog->register_text_enter(make_dir_dialog_text); make_dir_dialog->connect("confirmed", this, "_make_dir_confirm"); + make_scene_dialog = memnew(ConfirmationDialog); + make_scene_dialog->set_title(TTR("Create Scene")); + VBoxContainer *make_scene_dialog_vb = memnew(VBoxContainer); + make_scene_dialog->add_child(make_scene_dialog_vb); + + make_scene_dialog_text = memnew(LineEdit); + make_scene_dialog_vb->add_margin_child(TTR("Name:"), make_scene_dialog_text); + add_child(make_scene_dialog); + make_scene_dialog->register_text_enter(make_scene_dialog_text); + make_scene_dialog->connect("confirmed", this, "_make_scene_confirm"); + make_script_dialog_text = memnew(ScriptCreateDialog); make_script_dialog_text->set_title(TTR("Create Script")); add_child(make_script_dialog_text); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 6de370ad29..49eb31e330 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -87,6 +87,7 @@ private: FILE_INFO, FILE_NEW_FOLDER, FILE_NEW_SCRIPT, + FILE_NEW_SCENE, FILE_SHOW_IN_EXPLORER, FILE_COPY_PATH, FILE_NEW_RESOURCE, @@ -135,6 +136,8 @@ private: LineEdit *duplicate_dialog_text; ConfirmationDialog *make_dir_dialog; LineEdit *make_dir_dialog_text; + ConfirmationDialog *make_scene_dialog; + LineEdit *make_scene_dialog_text; ConfirmationDialog *overwrite_dialog; ScriptCreateDialog *make_script_dialog_text; CreateDialog *new_resource_dialog; @@ -168,7 +171,7 @@ private: bool updating_tree; int tree_update_id; - Tree *tree; //directories + Tree *tree; ItemList *files; bool import_dock_needs_update; @@ -213,6 +216,7 @@ private: void _resource_created() const; void _make_dir_confirm(); + void _make_scene_confirm(); void _rename_operation_confirm(); void _duplicate_operation_confirm(); void _move_with_overwrite(); @@ -246,7 +250,6 @@ private: String name; String path; StringName type; - int import_status; //0 not imported, 1 - ok, 2- must reimport, 3- broken Vector<String> sources; bool import_broken; @@ -275,6 +278,7 @@ private: bool _is_file_type_disabled_by_feature_profile(const StringName &p_class); void _feature_profile_changed(); + Vector<String> _remove_self_included_paths(Vector<String> selected_strings); protected: void _notification(int p_what); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index e1ab5c62a7..cc2efb92ae 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -524,6 +524,7 @@ FindInFilesPanel::FindInFilesPanel() { _progress_bar = memnew(ProgressBar); _progress_bar->set_h_size_flags(SIZE_EXPAND_FILL); + _progress_bar->set_v_size_flags(SIZE_SHRINK_CENTER); hbc->add_child(_progress_bar); set_progress_visible(false); @@ -546,6 +547,7 @@ FindInFilesPanel::FindInFilesPanel() { _results_display->connect("item_edited", this, "_on_item_edited"); _results_display->set_hide_root(true); _results_display->set_select_mode(Tree::SELECT_ROW); + _results_display->set_allow_rmb_select(true); _results_display->create_item(); // Root vbc->add_child(_results_display); diff --git a/editor/icons/icon_editor_curve_handle.svg b/editor/icons/icon_editor_curve_handle.svg new file mode 100644 index 0000000000..c405ceab9d --- /dev/null +++ b/editor/icons/icon_editor_curve_handle.svg @@ -0,0 +1 @@ +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><circle cx="5" cy="5" fill="#fefefe" r="2.75" stroke="#000" stroke-linecap="square"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_editor_path_sharp_handle.svg b/editor/icons/icon_editor_path_sharp_handle.svg new file mode 100644 index 0000000000..db160dfeae --- /dev/null +++ b/editor/icons/icon_editor_path_sharp_handle.svg @@ -0,0 +1 @@ +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><path d="m-3.035534-10.106602h6.071068v6.071068h-6.071068z" fill="#fefefe" stroke="#000" stroke-linecap="square" transform="matrix(-.70710678 .70710678 -.70710678 -.70710678 0 0)"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_editor_path_smooth_handle.svg b/editor/icons/icon_editor_path_smooth_handle.svg new file mode 100644 index 0000000000..34f3d290bd --- /dev/null +++ b/editor/icons/icon_editor_path_smooth_handle.svg @@ -0,0 +1 @@ +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><path d="m1.5-8.5h7v7h-7z" fill="#fefefe" stroke="#000" stroke-linecap="square" transform="rotate(90)"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_gizmo_c_p_u_particles.svg b/editor/icons/icon_gizmo_c_p_u_particles.svg new file mode 100644 index 0000000000..a6f0eaef5b --- /dev/null +++ b/editor/icons/icon_gizmo_c_p_u_particles.svg @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="128" + height="128" + version="1.1" + viewBox="0 0 128 128" + id="svg6" + sodipodi:docname="icon_gizmo_c_p_u_particles.svg" + inkscape:version="0.92.4 5da689c313, 2019-01-14"> + <metadata + id="metadata12"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs10" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1606" + inkscape:window-height="821" + id="namedview8" + showgrid="false" + inkscape:zoom="2.6074563" + inkscape:cx="101.29539" + inkscape:cy="83.191634" + inkscape:window-x="295" + inkscape:window-y="81" + inkscape:window-maximized="0" + inkscape:current-layer="svg6" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /> + <path + style="display:inline;opacity:1;fill:#f7f5cf;fill-opacity:1;stroke:#b4b4b4;stroke-width:2.56380486;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 35.503779,1.2819066 c -3.570424,0 -6.435164,2.9483368 -6.435164,6.6019028 v 4.3900146 c 0,0.889114 0.169457,1.726301 0.478513,2.49893 H 19.465369 c -3.570424,0 -6.435167,2.931453 -6.435167,6.585021 v 7.969562 c -0.341543,-0.0568 -0.648813,-0.202614 -1.006525,-0.202614 H 7.7335674 c -3.5704232,0 -6.451665,2.948338 -6.451665,6.601904 v 3.224972 c 0,3.653568 2.8812418,6.585016 6.451665,6.585016 h 4.2901096 c 0.358169,0 0.664563,-0.14568 1.006525,-0.202618 V 83.83104 C 12.688659,83.77398 12.381388,83.628424 12.023677,83.628424 H 7.7335674 c -3.5704232,0 -6.451665,2.948332 -6.451665,6.601908 v 3.224971 c 0,3.653575 2.8812418,6.585017 6.451665,6.585017 h 4.2901096 c 0.358169,0 0.664563,-0.145692 1.006525,-0.202612 v 9.725542 c 0,3.6536 2.864743,6.60193 6.435167,6.60193 h 9.603246 v 3.951 c 0,3.65357 2.86474,6.60192 6.435164,6.60192 h 3.15158 c 3.57042,0 6.451663,-2.94836 6.451663,-6.60192 v -3.95104 h 37.224955 v 3.951 c 0,3.65358 2.86474,6.60193 6.435166,6.60193 h 3.151583 c 3.570418,0 6.451653,-2.94836 6.451653,-6.60193 v -3.951 h 10.725281 c 3.57043,0 6.45166,-2.94833 6.45166,-6.60191 v -9.607372 c 0.14985,0.0105 0.27643,0.0846 0.42899,0.0846 h 4.29014 c 3.5704,0 6.45165,-2.931432 6.45165,-6.585011 v -3.224992 c 0,-3.653565 -2.88125,-6.601906 -6.45165,-6.601906 h -4.29014 c -0.15231,0 -0.27938,0.07348 -0.42899,0.08472 V 45.452198 c 0.14985,0.01042 0.27643,0.08445 0.42899,0.08445 h 4.29014 c 3.5704,0 6.45165,-2.931451 6.45165,-6.585023 v -3.224986 c 0,-3.653566 -2.88125,-6.601906 -6.45165,-6.601906 h -4.29014 c -0.15231,0 -0.27938,0.07392 -0.42899,0.08446 v -7.851429 c 0,-3.653567 -2.88123,-6.585019 -6.45166,-6.585021 H 97.875379 c 0.309043,-0.772641 0.494982,-1.609791 0.494982,-2.498929 V 7.8838054 c 0,-3.6535651 -2.881246,-6.601903 -6.451662,-6.601903 h -3.15158 c -3.570428,0 -6.435167,2.9483379 -6.435167,6.601903 V 12.27382 c 0,0.889115 0.16948,1.726301 0.478507,2.49893 H 44.612011 c 0.309083,-0.772642 0.495011,-1.609792 0.495011,-2.49893 V 7.8838054 c 0,-3.6535651 -2.881243,-6.601903 -6.451663,-6.601903 z" + id="path4542" + inkscape:connector-curvature="0" /> + <path + style="opacity:1;fill:#b4b4b4;fill-opacity:1;stroke-width:8.54601765" + d="M 62.861474,21.661698 A 27.707285,31.502779 0 0 1 90.004671,47.07312 18.471523,18.901669 0 0 1 105.96058,65.764449 18.471523,18.901669 0 0 1 87.480108,84.658396 H 38.226348 A 18.471523,18.901669 0 0 1 19.762375,65.764449 18.471523,18.901669 0 0 1 35.685283,47.056234 27.707285,31.502779 0 0 1 62.861474,21.661698 Z" + id="path4540" + inkscape:connector-curvature="0" /> + <path + style="opacity:1;fill:#b4b4b4;fill-opacity:1;stroke-width:8.54601765" + d="m 38.226348,90.956369 a 6.1571744,6.3005562 0 0 1 6.154657,6.297979 6.1571744,6.3005562 0 0 1 -6.154657,6.314882 6.1571744,6.3005562 0 0 1 -6.154657,-6.314882 6.1571744,6.3005562 0 0 1 6.154657,-6.297979 z" + id="path4538" + inkscape:connector-curvature="0" /> + <path + style="opacity:1;fill:#b4b4b4;fill-opacity:1;stroke-width:8.54601765" + d="m 87.480108,90.956369 a 6.1571744,6.3005562 0 0 1 6.171159,6.297979 6.1571744,6.3005562 0 0 1 -6.171159,6.314882 6.1571744,6.3005562 0 0 1 -6.154656,-6.314882 6.1571744,6.3005562 0 0 1 6.154656,-6.297979 z" + id="path4536" + inkscape:connector-curvature="0" /> + <path + style="opacity:1;fill:#b4b4b4;fill-opacity:1;stroke-width:8.54601765" + d="m 62.861474,97.254348 a 6.1571744,6.3005562 0 0 1 6.154662,6.314882 6.1571744,6.3005562 0 0 1 -6.154662,6.29797 6.1571744,6.3005562 0 0 1 -6.154651,-6.29797 6.1571744,6.3005562 0 0 1 6.154651,-6.314882 z" + id="rect822" + inkscape:connector-curvature="0" /> + <g + inkscape:groupmode="layer" + id="layer1" + inkscape:label="Layer 1" + transform="translate(-0.35794507,-5.5049216)" /> +</svg> diff --git a/editor/icons/icon_key_animation.svg b/editor/icons/icon_key_animation.svg index a09567498f..6db513ca26 100644 --- a/editor/icons/icon_key_animation.svg +++ b/editor/icons/icon_key_animation.svg @@ -1,65 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="8" - version="1.1" - viewBox="0 0 8 8" - id="svg6" - sodipodi:docname="icon_key_animation.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata12"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs10" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1852" - inkscape:window-height="781" - id="namedview8" - showgrid="false" - inkscape:zoom="29.5" - inkscape:cx="-10.271186" - inkscape:cy="3.4149032" - inkscape:window-x="68" - inkscape:window-y="117" - inkscape:window-maximized="0" - inkscape:current-layer="g4" /> - <g - transform="translate(0 -1044.4)" - id="g4"> - <rect - transform="rotate(-45)" - x="-741.53" - y="741.08" - width="6.1027" - height="6.1027" - ry=".76286" - fill="#ea686c" - id="rect2" - style="fill:#b76ef0;fill-opacity:1" /> - </g> -</svg> +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#b76ef0" height="6.1027" ry=".76286" transform="matrix(.70710678 -.70710678 .70710678 .70710678 0 -1042.4)" width="6.1027" x="-740.13947" y="741.10779"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_key_audio.svg b/editor/icons/icon_key_audio.svg index 7c728bfd01..75576885ec 100644 --- a/editor/icons/icon_key_audio.svg +++ b/editor/icons/icon_key_audio.svg @@ -1,65 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="8" - version="1.1" - viewBox="0 0 8 8" - id="svg6" - sodipodi:docname="icon_key_audio.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata12"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs10" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1053" - inkscape:window-height="591" - id="namedview8" - showgrid="false" - inkscape:zoom="29.5" - inkscape:cx="4" - inkscape:cy="4" - inkscape:window-x="67" - inkscape:window-y="27" - inkscape:window-maximized="0" - inkscape:current-layer="g4" /> - <g - transform="translate(0 -1044.4)" - id="g4"> - <rect - transform="rotate(-45)" - x="-741.53" - y="741.08" - width="6.1027" - height="6.1027" - ry=".76286" - fill="#ea686c" - id="rect2" - style="fill:#eae668;fill-opacity:1" /> - </g> -</svg> +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#eae668" height="6.1027" ry=".76286" transform="matrix(.70710678 -.70710678 .70710678 .70710678 0 -1042.4)" width="6.1027" x="-740.13947" y="741.10779"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_key_bezier.svg b/editor/icons/icon_key_bezier.svg index 62af6fdb34..dc5800fd5a 100644 --- a/editor/icons/icon_key_bezier.svg +++ b/editor/icons/icon_key_bezier.svg @@ -1,65 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="8" - version="1.1" - viewBox="0 0 8 8" - id="svg6" - sodipodi:docname="icon_key_bezier.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata12"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs10" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1852" - inkscape:window-height="781" - id="namedview8" - showgrid="false" - inkscape:zoom="29.5" - inkscape:cx="-17.152542" - inkscape:cy="3.4149032" - inkscape:window-x="67" - inkscape:window-y="27" - inkscape:window-maximized="0" - inkscape:current-layer="g4" /> - <g - transform="translate(0 -1044.4)" - id="g4"> - <rect - transform="rotate(-45)" - x="-741.53" - y="741.08" - width="6.1027" - height="6.1027" - ry=".76286" - fill="#ea686c" - id="rect2" - style="fill:#5792f6;fill-opacity:1" /> - </g> -</svg> +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#5792f6" height="6.1027" ry=".76286" transform="matrix(.70710678 -.70710678 .70710678 .70710678 0 -1042.4)" width="6.1027" x="-740.13947" y="741.10779"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_key_call.svg b/editor/icons/icon_key_call.svg index e702898288..6cc442c391 100644 --- a/editor/icons/icon_key_call.svg +++ b/editor/icons/icon_key_call.svg @@ -1,64 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="8" - version="1.1" - viewBox="0 0 8 8" - id="svg6" - sodipodi:docname="icon_key_call.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata12"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs10" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="836" - inkscape:window-height="480" - id="namedview8" - showgrid="false" - inkscape:zoom="29.5" - inkscape:cx="4" - inkscape:cy="4" - inkscape:window-x="67" - inkscape:window-y="27" - inkscape:window-maximized="0" - inkscape:current-layer="g4" /> - <g - transform="translate(0 -1044.4)" - id="g4"> - <rect - transform="rotate(-45)" - x="-741.53" - y="741.08" - width="6.1027" - height="6.1027" - ry=".76286" - fill="#adf18f" - id="rect2" - style="fill:#66f376;fill-opacity:1" /> - </g> -</svg> +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#66f376" height="6.1027" ry=".76286" transform="matrix(.70710678 -.70710678 .70710678 .70710678 0 -1042.4)" width="6.1027" x="-740.13947" y="741.10779"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_key_selected.svg b/editor/icons/icon_key_selected.svg index 2842fd93eb..6594aec6ee 100644 --- a/editor/icons/icon_key_selected.svg +++ b/editor/icons/icon_key_selected.svg @@ -1,76 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="8" - version="1.1" - viewBox="0 0 8 8" - id="svg6" - sodipodi:docname="icon_key_selected.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata12"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs10" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1568" - inkscape:window-height="767" - id="namedview8" - showgrid="false" - inkscape:zoom="41.7193" - inkscape:cx="-0.48848775" - inkscape:cy="3.5639274" - inkscape:window-x="67" - inkscape:window-y="27" - inkscape:window-maximized="0" - inkscape:current-layer="g4-3" /> - <g - transform="translate(0 -1044.4)" - id="g4"> - <rect - transform="rotate(-45)" - x="-741.53" - y="741.08" - width="6.1027" - height="6.1027" - ry=".76286" - fill="#84c2ff" - id="rect2" /> - </g> - <g - transform="translate(0,-1044.4)" - id="g4-3"> - <rect - style="fill:#003e7a;fill-opacity:1;stroke-width:0.56281364" - transform="matrix(0.71728847,-0.69677633,0.71728847,0.69677633,0,0)" - x="-751.20953" - y="753.42743" - width="3.4346831" - height="3.4346831" - ry="0.42934799" - id="rect2-6" /> - </g> -</svg> +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#84c2ff" height="6.1027" ry=".76286" transform="matrix(.87871827 -.87871827 .87871827 .87871827 .03288 -1297.7965)" width="6.1027" x="-741.53003" y="741.08002"/><rect fill="#003e7a" height="3.434683" ry=".429348" stroke-width=".562814" transform="matrix(.89137101 -.86588067 .89137101 .86588067 -.038545 -1297.8361)" width="3.434683" x="-751.20953" y="753.42743"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_key_value.svg b/editor/icons/icon_key_value.svg index 61032a1e16..8a4787d6ed 100644 --- a/editor/icons/icon_key_value.svg +++ b/editor/icons/icon_key_value.svg @@ -1,5 +1 @@ -<svg width="8" height="8" version="1.1" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1044.4)"> -<rect transform="rotate(-45)" x="-741.53" y="741.08" width="6.1027" height="6.1027" ry=".76286" fill="#e0e0e0"/> -</g> -</svg> +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#e0e0e0" height="6.1027" ry=".76286" transform="matrix(.70710678 -.70710678 .70710678 .70710678 1.002946 -1043.3636)" width="6.1027" x="-741.53003" y="741.08002"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_key_xform.svg b/editor/icons/icon_key_xform.svg index fd22b67f52..4a567075a7 100644 --- a/editor/icons/icon_key_xform.svg +++ b/editor/icons/icon_key_xform.svg @@ -1,64 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="8" - version="1.1" - viewBox="0 0 8 8" - id="svg6" - sodipodi:docname="icon_key_xform.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata12"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs10" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="836" - inkscape:window-height="480" - id="namedview8" - showgrid="false" - inkscape:zoom="29.5" - inkscape:cx="4" - inkscape:cy="4" - inkscape:window-x="67" - inkscape:window-y="27" - inkscape:window-maximized="0" - inkscape:current-layer="g4" /> - <g - transform="translate(0 -1044.4)" - id="g4"> - <rect - transform="rotate(-45)" - x="-741.53" - y="741.08" - width="6.1027" - height="6.1027" - ry=".76286" - fill="#ea686c" - id="rect2" - style="fill:#ea9568;fill-opacity:1" /> - </g> -</svg> +<svg height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg"><rect fill="#ea9568" height="6.1027" ry=".76286" transform="matrix(.70710678 -.70710678 .70710678 .70710678 0 -1042.4)" width="6.1027" x="-740.13947" y="741.10779"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_point_mesh.svg b/editor/icons/icon_point_mesh.svg new file mode 100644 index 0000000000..8da7759daf --- /dev/null +++ b/editor/icons/icon_point_mesh.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"> +<g fill="#ffd684" stroke="#000" stroke-dasharray="null" stroke-linecap="null" stroke-linejoin="null" stroke-opacity="0" stroke-width="0"> +<ellipse cx="3.7237" cy="3.0268" rx="2.0114" ry="1.9956"/> +<ellipse cx="11.717" cy="6.1734" rx="2.0114" ry="1.9956"/> +<ellipse cx="6.5219" cy="12.477" rx="2.0114" ry="1.9956"/> +</g> +</svg> diff --git a/editor/icons/icon_reparent_to_new_node.svg b/editor/icons/icon_reparent_to_new_node.svg new file mode 100644 index 0000000000..29db56279c --- /dev/null +++ b/editor/icons/icon_reparent_to_new_node.svg @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + version="1.1" + viewBox="0 0 16 16" + id="svg8" + sodipodi:docname="icon_reparent_to_new_node.svg" + inkscape:version="0.92.1 r15371"> + <metadata + id="metadata14"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs12" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1023" + id="namedview10" + showgrid="false" + inkscape:zoom="29.5" + inkscape:cx="2.2588225" + inkscape:cy="3.6882199" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="g6" /> + <g + transform="translate(0 -1036.4)" + id="g6"> + <path + transform="translate(0,1036.4)" + d="m 1.4915254,13 c 0,1.104569 0.8954305,2 2,2 0.7139771,-5.54e-4 1.3735116,-0.381677 1.7305,-1 H 11.2715 c 0.356631,0.617705 1.015238,0.998733 1.7285,1 1.104569,0 2,-0.895431 2,-2 0,-1.104569 -0.895431,-2 -2,-2 -0.713977,5.54e-4 -1.373512,0.381677 -1.7305,1 H 5.2200254 c -0.1747809,-0.30301 -0.8483719,-1 -1.7285,-1 -0.9027301,0 -2,0.891221 -2,2 z" + id="path2" + inkscape:connector-curvature="0" + style="fill:#e0e0e0" + sodipodi:nodetypes="cccccsccccc" /> + <path + d="m 10.421845,1038.2814 -2.7947264,2.096 2.7947264,2.0961 v -1.3974 c 2.716918,0 2.180792,1.4469 2.180792,3.9265 V 1046.4 H 14 v -1.3974 c 0,-3.863 0.13086,-5.3239 -3.578155,-5.3239 z" + id="path4" + inkscape:connector-curvature="0" + style="fill:#84ffb1;stroke-width:0.69868171" + sodipodi:nodetypes="cccccccccc" /> + <g + transform="translate(-8.5,-8)" + id="g6-7"> + <path + style="fill:#84ffb1" + inkscape:connector-curvature="0" + transform="translate(0,1036.4)" + d="m 11,9 v 2 H 9 v 2 h 2 v 2 h 2 v -2 h 2 V 11 H 13 V 9 Z" + id="path4-5" /> + </g> + <path + d="m 4.5,1047.7968 v -3.1171 H 2.4999995 v 3.1171 z" + id="path2-3" + inkscape:connector-curvature="0" + style="fill:#e0e0e0;stroke-width:0.7178387" + sodipodi:nodetypes="ccccc" /> + </g> +</svg> diff --git a/editor/icons/icon_shrink_bottom_dock.svg b/editor/icons/icon_shrink_bottom_dock.svg deleted file mode 100644 index c1e8c1bfdb..0000000000 --- a/editor/icons/icon_shrink_bottom_dock.svg +++ /dev/null @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - version="1.1" - viewBox="0 0 16 16" - id="svg6" - sodipodi:docname="icon_shrink_bottom_dock.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata12"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs10" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1853" - inkscape:window-height="1016" - id="namedview8" - showgrid="false" - inkscape:zoom="20.85965" - inkscape:cx="9.4509357" - inkscape:cy="6.016355" - inkscape:window-x="67" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:current-layer="svg6" /> - <path - style="fill:#e0e0e0" - d="M 11.907447,9.9752038 15.442981,6.4396699 H 12.907296 V 1.4659528 h -1.999839 l 0,4.9737171 -2.5356852,0 3.5355342,3.5355339 z" - id="path829" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ccccccccc" /> - <path - inkscape:connector-curvature="0" - id="path831" - d="M 4.2131662,9.8793249 7.7487004,6.343791 H 5.2130152 V 1.3700738 H 3.2131762 V 6.343791 h -2.535685 l 3.535534,3.5355339 z" - style="fill:#e0e0e0" - sodipodi:nodetypes="ccccccccc" /> - <rect - style="fill:#e0e0e0;fill-opacity:1" - id="rect855" - width="14" - height="1.8305085" - x="-14.832336" - y="-13.121187" - transform="scale(-1)" /> -</svg> diff --git a/editor/icons/icon_timeline_indicator.svg b/editor/icons/icon_timeline_indicator.svg new file mode 100644 index 0000000000..fd18192705 --- /dev/null +++ b/editor/icons/icon_timeline_indicator.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 0h10l-4 4h-2z" fill="#fefefe"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_vulkan.svg b/editor/icons/icon_vulkan.svg deleted file mode 100644 index 1d5fed0305..0000000000 --- a/editor/icons/icon_vulkan.svg +++ /dev/null @@ -1,127 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.1" - id="svg2" - width="48" - height="16" - viewBox="0 0 47.999999 16" - sodipodi:docname="icon_vulkan.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata8"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs6" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1853" - inkscape:window-height="1016" - id="namedview4" - showgrid="false" - inkscape:zoom="10.24" - inkscape:cx="9.4970674" - inkscape:cy="11.192118" - inkscape:window-x="67" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:current-layer="g8" /> - <path - style="fill:#000000;stroke-width:1.06666672" - d="" - id="path819" - inkscape:connector-curvature="0" /> - <path - style="fill:#000000;stroke-width:1.06666672" - d="" - id="path817" - inkscape:connector-curvature="0" /> - <g - transform="matrix(0.04333868,0,0,0.04333868,-4.0493236,-3.7704963)" - id="g8"> - <path - inkscape:connector-curvature="0" - d="m 724.1,432.41989 h -40.6 c 0,0 0,-99 0,-129.7 13,7.2 30.1,20.5 40.6,33.3 z" - id="path10" - style="fill:#e6555a;fill-opacity:1" /> - <g - id="g12" - style="fill:#e6555a;fill-opacity:1" - transform="translate(0,47.319882)"> - <path - inkscape:connector-curvature="0" - d="m 381.8,385.1 h -50.6 l -66,-204 h 46 l 45.4,143.5 h 0.6 l 46,-143.5 h 46.3 z" - id="path14" - style="fill:#e6555a;fill-opacity:1" /> - <path - inkscape:connector-curvature="0" - d="M 585.5,385.1 H 546.9 V 364.5 H 546 c -5.1,8.6 -11.8,14.8 -20,18.6 -8.2,3.8 -16.6,5.7 -25.1,5.7 -10.9,0 -19.8,-1.4 -26.7,-4.3 -7,-2.9 -12.4,-6.9 -16.4,-12.1 -4,-5.2 -6.8,-11.6 -8.4,-19.1 -1.6,-7.5 -2.4,-15.9 -2.4,-25 v -90.9 h 40.6 v 83.4 c 0,12.2 1.9,21.3 5.7,27.3 3.8,6 10.6,9 20.3,9 11,0 19.1,-3.3 24,-9.9 5,-6.6 7.4,-17.4 7.4,-32.4 v -77.4 h 40.6 v 147.7 z" - id="path16" - style="fill:#e6555a;fill-opacity:1" /> - </g> - <polygon - points="730.8,296.2 730.7,290.5 781.9,237.3 829.9,237.3 774.2,291.6 836.2,385.1 787,385.1 " - id="polygon18" - style="fill:#e6555a;fill-opacity:1" - transform="translate(0,47.319882)" /> - <path - inkscape:connector-curvature="0" - d="m 843.6,330.11989 c 0.6,-9.5 3,-17.4 7.2,-23.7 4.2,-6.3 9.5,-11.3 16,-15.1 6.5,-3.8 13.8,-6.5 21.9,-8.1 8.1,-1.6 16.2,-2.4 24.4,-2.4 7.4,0 15,0.5 22.6,1.6 7.6,1.1 14.6,3.1 20.9,6.1 6.3,3.1 11.4,7.3 15.4,12.7 4,5.4 6,12.6 6,21.6 v 76.9 c 0,6.7 0.4,13.1 1.1,19.1 0.8,6.1 2.1,10.7 4,13.7 h -41.2 c -0.8,-2.3 -1.4,-4.6 -1.9,-7 -0.5,-2.4 -0.8,-4.8 -1,-7.3 -6.5,6.7 -14.1,11.3 -22.9,14 -8.8,2.7 -17.7,4 -26.9,4 -7,0 -13.6,-0.9 -19.7,-2.6 -6.1,-1.7 -11.4,-4.4 -16,-8 -4.6,-3.6 -8.2,-8.2 -10.7,-13.7 -2.6,-5.5 -3.9,-12.1 -3.9,-19.7 0,-8.4 1.5,-15.3 4.4,-20.7 3,-5.4 6.8,-9.8 11.4,-13 4.7,-3.2 10,-5.7 16,-7.3 6,-1.6 12,-2.9 18.1,-3.9 6.1,-0.9 12.1,-1.7 18,-2.3 5.9,-0.6 11.1,-1.4 15.7,-2.6 4.6,-1.1 8.2,-2.8 10.9,-5 2.7,-2.2 3.9,-5.4 3.7,-9.6 0,-4.4 -0.7,-7.9 -2.2,-10.4 -1.4,-2.6 -3.3,-4.6 -5.7,-6 -2.4,-1.4 -5.1,-2.4 -8.3,-2.9 -3.1,-0.5 -6.5,-0.7 -10.1,-0.7 -8,0 -14.3,1.7 -18.9,5.1 -4.6,3.4 -7.2,9.1 -8,17.1 h -40.3 z m 93.8,30 c -1.7,1.5 -3.9,2.7 -6.4,3.6 -2.6,0.9 -5.3,1.6 -8.3,2.2 -2.9,0.6 -6,1 -9.3,1.4 -3.2,0.4 -6.5,0.9 -9.7,1.4 -3,0.6 -6,1.3 -9,2.3 -3,1 -5.5,2.2 -7.7,3.9 -2.2,1.6 -4,3.7 -5.3,6.1 -1.3,2.5 -2,5.6 -2,9.4 0,3.6 0.7,6.7 2,9.1 1.3,2.5 3.1,4.4 5.4,5.9 2.3,1.4 5,2.4 8,3 3.1,0.6 6.2,0.9 9.4,0.9 8,0 14.2,-1.3 18.6,-4 4.4,-2.7 7.6,-5.9 9.7,-9.6 2.1,-3.7 3.4,-7.5 3.9,-11.3 0.5,-3.8 0.7,-6.9 0.7,-9.1 z" - id="path20" - style="fill:#e6555a;fill-opacity:1" /> - <path - inkscape:connector-curvature="0" - d="m 1004.2,284.61989 h 38.6 v 20.6 h 0.9 c 5.1,-8.6 11.8,-14.8 20,-18.7 8.2,-3.9 16.6,-5.9 25.1,-5.9 10.9,0 19.8,1.5 26.7,4.4 7,3 12.4,7.1 16.4,12.3 4,5.2 6.8,11.6 8.4,19.1 1.6,7.5 2.4,15.9 2.4,25 v 90.9 h -40.6 v -83.4 c 0,-12.2 -1.9,-21.3 -5.7,-27.3 -3.8,-6 -10.6,-9 -20.3,-9 -11,0 -19,3.3 -24,9.9 -5,6.6 -7.4,17.4 -7.4,32.4 v 77.4 h -40.6 v -147.7 z" - id="path22" - style="fill:#e6555a;fill-opacity:1" /> - <g - id="g24" - style="fill:#e6555a;fill-opacity:1" - transform="translate(0,47.319882)"> - <path - inkscape:connector-curvature="0" - d="M 612.4,211.8 V 385 H 653 V 234.2 c -13.1,-8 -26.6,-15.5 -40.6,-22.4 z" - id="path26" - style="fill:#e6555a;fill-opacity:1" /> - </g> - <path - inkscape:connector-curvature="0" - d="m 198.4,266.51989 c 23.5,-68.9 164.2,-94.2 314.1,-56.4 90,22.6 163.5,66.5 211.5,109.9 -21.7,-57.6 -127.3,-139.6 -272.8,-167.7 -164.5,-31.8 -326.7,-3.9 -346.8,69.1 -14.5,52.7 49.2,114.5 147.7,156.7 -44.3,-35.8 -65.8,-76 -53.7,-111.6 z" - id="path28" - style="fill:#e6555a;fill-opacity:1" /> - <g - id="g30" - style="fill:#e6555a;fill-opacity:1" - transform="translate(0,47.319882)"> - <path - inkscape:connector-curvature="0" - d="M 724.2,247.6 V 181 h -40.6 v 20.2 c 17.3,15.5 31,31.2 40.6,46.4 z" - id="path32" - style="fill:#e6555a;fill-opacity:1" /> - </g> - </g> -</svg> diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index e152827c63..449124acec 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -692,16 +692,6 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me pre_weights[w_i] = weights; - /* - for(Set<int>::Element *E=vertex_map[w_i].front();E;E=E->next()) { - - int dst = E->get(); - ERR_EXPLAIN("invalid vertex index in array"); - ERR_FAIL_INDEX_V(dst,vertex_array.size(),ERR_INVALID_DATA); - vertex_array[dst].weights=weights; - - }*/ - index_ofs += wstride * amount; } @@ -711,7 +701,6 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me Set<Collada::Vertex> vertex_set; //vertex set will be the vertices List<int> indices_list; //indices will be the indices - //Map<int,Set<int> > vertex_map; //map vertices (for setting skinning/morph) /**************************/ /* CREATE PRIMITIVE ARRAY */ @@ -834,9 +823,6 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me vertex_set.insert(vertex); } - /* if (!vertex_map.has(vertex_index)) - vertex_map[vertex_index]=Set<int>(); - vertex_map[vertex_index].insert(index); //should be outside..*/ //build triangles if needed if (j == 0) prev2[0] = index; @@ -1175,41 +1161,36 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres morph = &collada.state.morph_controller_data_map[ngsource]; meshid = morph->mesh; - Vector<String> targets; - - morph->targets.has("MORPH_TARGET"); - String target = morph->targets["MORPH_TARGET"]; - bool valid = false; - if (morph->sources.has(target)) { - valid = true; - Vector<String> names = morph->sources[target].sarray; - for (int i = 0; i < names.size(); i++) { - - String meshid2 = names[i]; - if (collada.state.mesh_data_map.has(meshid2)) { - Ref<ArrayMesh> mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); - const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid2]; - mesh->set_name(meshdata.name); - Error err = _create_mesh_surfaces(false, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector<Ref<ArrayMesh> >(), false); - ERR_FAIL_COND_V(err, err); - - morphs.push_back(mesh); - } else { - valid = false; + if (morph->targets.has("MORPH_TARGET")) { + String target = morph->targets["MORPH_TARGET"]; + bool valid = false; + if (morph->sources.has(target)) { + valid = true; + Vector<String> names = morph->sources[target].sarray; + for (int i = 0; i < names.size(); i++) { + + String meshid2 = names[i]; + if (collada.state.mesh_data_map.has(meshid2)) { + Ref<ArrayMesh> mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); + const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid2]; + mesh->set_name(meshdata.name); + Error err = _create_mesh_surfaces(false, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector<Ref<ArrayMesh> >(), false); + ERR_FAIL_COND_V(err, err); + + morphs.push_back(mesh); + } else { + valid = false; + } } } - } - if (!valid) - morphs.clear(); - - ngsource = ""; + if (!valid) + morphs.clear(); + ngsource = ""; + } } - if (ngsource != "") { - ERR_EXPLAIN("Controller Instance Source '" + ngsource + "' is neither skin or morph!"); - ERR_FAIL_V(ERR_INVALID_DATA); - } + ERR_FAIL_COND_V_MSG(ngsource != "", ERR_INVALID_DATA, "Controller instance source '" + ngsource + "' is neither skin or morph!"); } else { meshid = ng2->source; @@ -1610,7 +1591,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones } if (xform_idx == -1) { - WARN_PRINTS("Collada: Couldn't find matching node " + at.target + " xform for track " + at.param); + WARN_PRINTS("Collada: Couldn't find matching node " + at.target + " xform for track " + at.param + "."); continue; } @@ -1632,8 +1613,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones } else if (data.size() == xf.data.size()) { xf.data = data; } else { - ERR_EXPLAIN("Component " + at.component + " has datasize " + itos(data.size()) + ", xfdatasize " + itos(xf.data.size())); - ERR_CONTINUE(data.size() != xf.data.size()); + ERR_CONTINUE_MSG(data.size() != xf.data.size(), "Component " + at.component + " has datasize " + itos(data.size()) + ", xfdatasize " + itos(xf.data.size()) + "."); } } diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index bc507e91b2..9ea7c86e0c 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -29,8 +29,8 @@ /*************************************************************************/ #include "editor_scene_importer_gltf.h" +#include "core/crypto/crypto_core.h" #include "core/io/json.h" -#include "core/math/crypto_core.h" #include "core/math/math_defs.h" #include "core/os/file_access.h" #include "core/os/os.h" @@ -986,7 +986,7 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) { Ref<SurfaceTool> st; st.instance(); st->create_from_triangle_arrays(array); - if (p.has("targets")) { + if (!p.has("targets")) { //morph targets should not be reindexed, as array size might differ //removing indices is the best bet here st->deindex(); @@ -1327,7 +1327,9 @@ Error EditorSceneImporterGLTF::_parse_materials(GLTFState &state) { if (bct.has("index")) { Ref<Texture> t = _get_texture(state, bct["index"]); material->set_texture(SpatialMaterial::TEXTURE_METALLIC, t); + material->set_metallic_texture_channel(SpatialMaterial::TEXTURE_CHANNEL_BLUE); material->set_texture(SpatialMaterial::TEXTURE_ROUGHNESS, t); + material->set_roughness_texture_channel(SpatialMaterial::TEXTURE_CHANNEL_GREEN); if (!mr.has("metallicFactor")) { material->set_metallic(1); } @@ -1352,6 +1354,7 @@ Error EditorSceneImporterGLTF::_parse_materials(GLTFState &state) { Dictionary bct = d["occlusionTexture"]; if (bct.has("index")) { material->set_texture(SpatialMaterial::TEXTURE_AMBIENT_OCCLUSION, _get_texture(state, bct["index"])); + material->set_ao_texture_channel(SpatialMaterial::TEXTURE_CHANNEL_RED); material->set_feature(SpatialMaterial::FEATURE_AMBIENT_OCCLUSION, true); } } @@ -1541,8 +1544,7 @@ Error EditorSceneImporterGLTF::_parse_cameras(GLTFState &state) { camera.fov_size = 10; } } else { - ERR_EXPLAIN("Camera should be in 'orthographic' or 'perspective'"); - ERR_FAIL_V(ERR_PARSE_ERROR); + ERR_FAIL_V_MSG(ERR_PARSE_ERROR, "Camera should be in 'orthographic' or 'perspective'"); } state.cameras.push_back(camera); diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index cfcdbc8de4..301422a25a 100644 --- a/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -101,8 +101,7 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const for (int i = 1; i < line.size(); i++) { String locale = line[i]; - ERR_EXPLAIN("Error importing CSV translation: '" + locale + "' is not a valid locale"); - ERR_FAIL_COND_V(!TranslationServer::is_locale_valid(locale), ERR_PARSE_ERROR); + ERR_FAIL_COND_V_MSG(!TranslationServer::is_locale_valid(locale), ERR_PARSE_ERROR, "Error importing CSV translation: '" + locale + "' is not a valid locale."); locales.push_back(locale); Ref<Translation> translation; diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 868f67fd77..9061c92f6e 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -45,8 +45,7 @@ uint32_t EditorOBJImporter::get_import_flags() const { static Error _parse_material_library(const String &p_path, Map<String, Ref<SpatialMaterial> > &material_map, List<String> *r_missing_deps) { FileAccessRef f = FileAccess::open(p_path, FileAccess::READ); - ERR_EXPLAIN(vformat("Couldn't open MTL file '%s', it may not exist or not be readable.", p_path)); - ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); + ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Couldn't open MTL file '%s', it may not exist or not be readable.", p_path)); Ref<SpatialMaterial> current; String current_name; @@ -207,8 +206,7 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati static Error _parse_obj(const String &p_path, List<Ref<Mesh> > &r_meshes, bool p_single_mesh, bool p_generate_tangents, bool p_optimize, Vector3 p_scale_mesh, List<String> *r_missing_deps) { FileAccessRef f = FileAccess::open(p_path, FileAccess::READ); - ERR_EXPLAIN(vformat("Couldn't open OBJ file '%s', it may not exist or not be readable.", p_path)); - ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); + ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Couldn't open OBJ file '%s', it may not exist or not be readable.", p_path)); Ref<ArrayMesh> mesh; mesh.instance(); diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index a8197ec2a2..8e6a56a929 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -435,6 +435,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> Object::cast_to<Spatial>(sb)->set_transform(Object::cast_to<Spatial>(p_node)->get_transform()); p_node->replace_by(sb); memdelete(p_node); + p_node = NULL; CollisionShape *colshape = memnew(CollisionShape); if (empty_draw_type == "CUBE") { BoxShape *boxShape = memnew(BoxShape); @@ -893,7 +894,6 @@ void ResourceImporterScene::_filter_tracks(Node *scene, const String &p_text) { keep.insert(F->get()); } _filter_anim_tracks(anim->get_animation(name), keep); - } else { } } } diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index e728dbac31..4fd4ab2f2e 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -123,8 +123,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s file->close(); memdelete(file); - ERR_EXPLAIN("Not a WAV file (no WAVE RIFF Header)"); - ERR_FAIL_V(ERR_FILE_UNRECOGNIZED); + ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "Not a WAV file (no WAVE RIFF header)."); } int format_bits = 0; @@ -166,16 +165,14 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s if (compression_code != 1 && compression_code != 3) { file->close(); memdelete(file); - ERR_EXPLAIN("Format not supported for WAVE file (not PCM). Save WAVE files as uncompressed PCM instead."); - ERR_FAIL_V(ERR_INVALID_DATA); + ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Format not supported for WAVE file (not PCM). Save WAVE files as uncompressed PCM instead."); } format_channels = file->get_16(); if (format_channels != 1 && format_channels != 2) { file->close(); memdelete(file); - ERR_EXPLAIN("Format not supported for WAVE file (not stereo or mono)."); - ERR_FAIL_V(ERR_INVALID_DATA); + ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Format not supported for WAVE file (not stereo or mono)."); } format_freq = file->get_32(); //sampling rate @@ -187,8 +184,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s if (format_bits % 8 || format_bits == 0) { file->close(); memdelete(file); - ERR_EXPLAIN("Invalid amount of bits in the sample (should be one of 8, 16, 24 or 32)."); - ERR_FAIL_V(ERR_INVALID_DATA); + ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Invalid amount of bits in the sample (should be one of 8, 16, 24 or 32)."); } /* Don't need anything else, continue */ @@ -206,6 +202,11 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s frames = chunksize; + if (format_channels == 0) { + file->close(); + memdelete(file); + ERR_FAIL_COND_V(format_channels == 0, ERR_INVALID_DATA); + } frames /= format_channels; frames /= (format_bits >> 3); @@ -253,8 +254,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s if (file->eof_reached()) { file->close(); memdelete(file); - ERR_EXPLAIN("Premature end of file."); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Premature end of file."); } } diff --git a/editor/multi_node_edit.cpp b/editor/multi_node_edit.cpp index 6af7e4bd00..85e47594a8 100644 --- a/editor/multi_node_edit.cpp +++ b/editor/multi_node_edit.cpp @@ -152,7 +152,9 @@ void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const { datas.push_back(usage.getptr(F->get().name)); } - usage[F->get().name].uses++; + // Make sure only properties with the same exact PropertyInfo data will appear + if (usage[F->get().name].info == F->get()) + usage[F->get().name].uses++; } nc++; diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index 1c0151ed0a..d6df3bd369 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -56,10 +56,7 @@ void NodeDock::_bind_methods() { void NodeDock::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - connections_button->set_icon(get_icon("Signals", "EditorIcons")); - groups_button->set_icon(get_icon("Groups", "EditorIcons")); - } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { + if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { connections_button->set_icon(get_icon("Signals", "EditorIcons")); groups_button->set_icon(get_icon("Groups", "EditorIcons")); } @@ -131,7 +128,7 @@ NodeDock::NodeDock() { groups->hide(); select_a_node = memnew(Label); - select_a_node->set_text(TTR("Select a Node to edit Signals and Groups.")); + select_a_node->set_text(TTR("Select a single node to edit its signals and groups.")); 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/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 12bf544357..23056d25c0 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -130,7 +130,8 @@ void PluginConfigDialog::_notification(int p_what) { void PluginConfigDialog::config(const String &p_config_path) { if (p_config_path.length()) { Ref<ConfigFile> cf = memnew(ConfigFile); - cf->load(p_config_path); + Error err = cf->load(p_config_path); + ERR_FAIL_COND(err != OK); name_edit->set_text(cf->get_value("plugin", "name", "")); subfolder_edit->set_text(p_config_path.get_base_dir().get_basename().get_file()); diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 574b47d770..7f023af848 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -571,7 +571,8 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl return; Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform(); - const Ref<Texture> handle = get_icon("EditorHandle", "EditorIcons"); + // All polygon points are sharp, so use the sharp handle icon + const Ref<Texture> handle = get_icon("EditorPathSharpHandle", "EditorIcons"); const Vertex active_point = get_active_point(); const int n_polygons = _get_polygon_count(); diff --git a/editor/plugins/abstract_polygon_2d_editor.h b/editor/plugins/abstract_polygon_2d_editor.h index 97244fa4e9..a00cdd0cf6 100644 --- a/editor/plugins/abstract_polygon_2d_editor.h +++ b/editor/plugins/abstract_polygon_2d_editor.h @@ -36,9 +36,6 @@ #include "scene/2d/polygon_2d.h" #include "scene/gui/tool_button.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class CanvasItemEditor; class AbstractPolygon2DEditor : public HBoxContainer { diff --git a/editor/plugins/animation_blend_space_2d_editor.h b/editor/plugins/animation_blend_space_2d_editor.h index 74186791e1..850a6201bb 100644 --- a/editor/plugins/animation_blend_space_2d_editor.h +++ b/editor/plugins/animation_blend_space_2d_editor.h @@ -40,9 +40,6 @@ #include "scene/gui/graph_edit.h" #include "scene/gui/popup.h" #include "scene/gui/tree.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin { diff --git a/editor/plugins/animation_blend_tree_editor_plugin.h b/editor/plugins/animation_blend_tree_editor_plugin.h index cb40159a40..77b57a50d0 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.h +++ b/editor/plugins/animation_blend_tree_editor_plugin.h @@ -40,9 +40,6 @@ #include "scene/gui/graph_edit.h" #include "scene/gui/popup.h" #include "scene/gui/tree.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin { diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 5163b372b2..f42716c827 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -32,6 +32,7 @@ #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" +#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/animation_track_editor.h" @@ -293,10 +294,6 @@ void AnimationPlayerEditor::_animation_selected(int p_which) { } } frame->set_max(anim->get_length()); - if (anim->get_step()) - frame->set_step(anim->get_step()); - else - frame->set_step(0.00001); } else { track_editor->set_animation(Ref<Animation>()); @@ -1008,7 +1005,7 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_set) { }; updating = true; - String current = player->get_assigned_animation(); //animation->get_item_text( animation->get_selected() ); + String current = player->get_assigned_animation(); if (current == "" || !player->has_animation(current)) { updating = false; current = ""; @@ -1018,14 +1015,9 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_set) { Ref<Animation> anim; anim = player->get_animation(current); - float pos = anim->get_length() * (p_value / frame->get_max()); - float step = anim->get_step(); - if (step) { - pos = Math::stepify(pos, step); - if (pos < 0) - pos = 0; - if (pos >= anim->get_length()) - pos = anim->get_length(); + float pos = CLAMP(anim->get_length() * (p_value / frame->get_max()), 0, anim->get_length()); + if (track_editor->is_snap_enabled()) { + pos = Math::stepify(pos, anim->get_step()); } if (player->is_valid() && !p_set) { @@ -1063,14 +1055,6 @@ void AnimationPlayerEditor::_animation_key_editor_anim_len_changed(float p_len) frame->set_max(p_len); } -void AnimationPlayerEditor::_animation_key_editor_anim_step_changed(float p_len) { - - if (p_len) - frame->set_step(p_len); - else - frame->set_step(0.00001); -} - void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag) { if (!is_visible_in_tree()) @@ -1081,8 +1065,10 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag) if (player->is_playing()) return; + Ref<Animation> anim = player->get_animation(player->get_assigned_animation()); + updating = true; - frame->set_value(p_pos); + frame->set_value(Math::stepify(p_pos, track_editor->is_snap_enabled() ? anim->get_step() : 0)); updating = false; _seek_value_changed(p_pos, !p_drag); @@ -1558,7 +1544,6 @@ void AnimationPlayerEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_list_changed"), &AnimationPlayerEditor::_list_changed); ClassDB::bind_method(D_METHOD("_animation_key_editor_seek"), &AnimationPlayerEditor::_animation_key_editor_seek); ClassDB::bind_method(D_METHOD("_animation_key_editor_anim_len_changed"), &AnimationPlayerEditor::_animation_key_editor_anim_len_changed); - ClassDB::bind_method(D_METHOD("_animation_key_editor_anim_step_changed"), &AnimationPlayerEditor::_animation_key_editor_anim_step_changed); ClassDB::bind_method(D_METHOD("_hide_anim_editors"), &AnimationPlayerEditor::_hide_anim_editors); ClassDB::bind_method(D_METHOD("_animation_duplicate"), &AnimationPlayerEditor::_animation_duplicate); ClassDB::bind_method(D_METHOD("_blend_editor_next_changed"), &AnimationPlayerEditor::_blend_editor_next_changed); @@ -1621,6 +1606,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay hb->add_child(frame); frame->set_custom_minimum_size(Size2(60, 0)); frame->set_stretch_ratio(2); + frame->set_step(0.0001); frame->set_tooltip(TTR("Animation position (in seconds).")); hb->add_child(memnew(VSeparator)); @@ -1774,7 +1760,6 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay track_editor->set_v_size_flags(SIZE_EXPAND_FILL); track_editor->connect("timeline_changed", this, "_animation_key_editor_seek"); track_editor->connect("animation_len_changed", this, "_animation_key_editor_anim_len_changed"); - track_editor->connect("animation_step_changed", this, "_animation_key_editor_anim_step_changed"); _update_player(); diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h index 398ef6ff14..2ab2df68e6 100644 --- a/editor/plugins/animation_player_editor_plugin.h +++ b/editor/plugins/animation_player_editor_plugin.h @@ -39,9 +39,6 @@ #include "scene/gui/spin_box.h" #include "scene/gui/texture_button.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class AnimationTrackEditor; class AnimationPlayerEditorPlugin; @@ -203,7 +200,6 @@ class AnimationPlayerEditor : public VBoxContainer { void _animation_key_editor_seek(float p_pos, bool p_drag); void _animation_key_editor_anim_len_changed(float p_len); - void _animation_key_editor_anim_step_changed(float p_len); void _unhandled_key_input(const Ref<InputEvent> &p_ev); void _animation_tool_menu(int p_option); diff --git a/editor/plugins/animation_tree_player_editor_plugin.h b/editor/plugins/animation_tree_player_editor_plugin.h index f4bfe58909..03bc559b86 100644 --- a/editor/plugins/animation_tree_player_editor_plugin.h +++ b/editor/plugins/animation_tree_player_editor_plugin.h @@ -38,9 +38,6 @@ #include "scene/gui/button.h" #include "scene/gui/popup.h" #include "scene/gui/tree.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class AnimationTreePlayerEditor : public Control { diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 1503258ff5..132bf3973e 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -177,6 +177,8 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const tex->create_from_image(thumbnail); preview_images[i].button->set_icon(tex); + // Make it clearer that clicking it will open an external link + preview_images[i].button->set_default_cursor_shape(CURSOR_POINTING_HAND); } else { preview_images[i].button->set_icon(p_image); } @@ -268,10 +270,10 @@ void EditorAssetLibraryItemDescription::add_preview(int p_id, bool p_video, cons if (!p_video) { preview.image = get_icon("ThumbnailWait", "EditorIcons"); } - if (preview_images.size() == 0 && !p_video) { + preview_images.push_back(preview); + if (preview_images.size() == 1 && !p_video) { _preview_click(p_id); } - preview_images.push_back(preview); } EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { @@ -331,18 +333,14 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int switch (p_status) { - case HTTPRequest::RESULT_CANT_RESOLVE: { - error_text = TTR("Can't resolve hostname:") + " " + host; - status->set_text(TTR("Can't resolve.")); - } break; - case HTTPRequest::RESULT_BODY_SIZE_LIMIT_EXCEEDED: + case HTTPRequest::RESULT_CHUNKED_BODY_SIZE_MISMATCH: case HTTPRequest::RESULT_CONNECTION_ERROR: - case HTTPRequest::RESULT_CHUNKED_BODY_SIZE_MISMATCH: { + case HTTPRequest::RESULT_BODY_SIZE_LIMIT_EXCEEDED: { error_text = TTR("Connection error, please try again."); status->set_text(TTR("Can't connect.")); } break; - case HTTPRequest::RESULT_SSL_HANDSHAKE_ERROR: - case HTTPRequest::RESULT_CANT_CONNECT: { + case HTTPRequest::RESULT_CANT_CONNECT: + case HTTPRequest::RESULT_SSL_HANDSHAKE_ERROR: { error_text = TTR("Can't connect to host:") + " " + host; status->set_text(TTR("Can't connect.")); } break; @@ -350,13 +348,26 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int error_text = TTR("No response from host:") + " " + host; status->set_text(TTR("No response.")); } break; + case HTTPRequest::RESULT_CANT_RESOLVE: { + error_text = TTR("Can't resolve hostname:") + " " + host; + status->set_text(TTR("Can't resolve.")); + } break; case HTTPRequest::RESULT_REQUEST_FAILED: { error_text = TTR("Request failed, return code:") + " " + itos(p_code); - status->set_text(TTR("Request Failed.")); + status->set_text(TTR("Request failed.")); + } break; + case HTTPRequest::RESULT_DOWNLOAD_FILE_CANT_OPEN: + case HTTPRequest::RESULT_DOWNLOAD_FILE_WRITE_ERROR: { + error_text = TTR("Cannot save response to:") + " " + download->get_download_file(); + status->set_text(TTR("Write error.")); } break; case HTTPRequest::RESULT_REDIRECT_LIMIT_REACHED: { error_text = TTR("Request failed, too many redirects"); - status->set_text(TTR("Redirect Loop.")); + status->set_text(TTR("Redirect loop.")); + } break; + case HTTPRequest::RESULT_TIMEOUT: { + error_text = TTR("Request failed, timeout"); + status->set_text(TTR("Timeout.")); } break; default: { if (p_code != 200) { @@ -396,68 +407,73 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse icon->set_texture(get_icon("DefaultProjectIcon", "EditorIcons")); host = p_download_url; sha256 = p_sha256_hash; - asset_installer->connect("confirmed", this, "_close"); - dismiss->set_normal_texture(get_icon("Close", "EditorIcons")); _make_request(); } void EditorAssetLibraryItemDownload::_notification(int p_what) { - if (p_what == NOTIFICATION_PROCESS) { + switch (p_what) { - // Make the progress bar visible again when retrying the download - progress->set_modulate(Color(1, 1, 1, 1)); + // FIXME: The editor crashes if 'NOTICATION_THEME_CHANGED' is used. + case NOTIFICATION_ENTER_TREE: { - if (download->get_downloaded_bytes() > 0) { - progress->set_max(download->get_body_size()); - progress->set_value(download->get_downloaded_bytes()); - } + add_style_override("panel", get_stylebox("panel", "TabContainer")); + dismiss->set_normal_texture(get_icon("Close", "EditorIcons")); + } break; + case NOTIFICATION_PROCESS: { - int cstatus = download->get_http_client_status(); + // Make the progress bar visible again when retrying the download. + progress->set_modulate(Color(1, 1, 1, 1)); - if (cstatus == HTTPClient::STATUS_BODY) { - if (download->get_body_size() > 0) { - status->set_text( - vformat( - TTR("Downloading (%s / %s)..."), - String::humanize_size(download->get_downloaded_bytes()), - String::humanize_size(download->get_body_size()))); - } else { - // Total file size is unknown, so it cannot be displayed - status->set_text(TTR("Downloading...")); + if (download->get_downloaded_bytes() > 0) { + progress->set_max(download->get_body_size()); + progress->set_value(download->get_downloaded_bytes()); } - } - if (cstatus != prev_status) { - switch (cstatus) { + int cstatus = download->get_http_client_status(); + + if (cstatus == HTTPClient::STATUS_BODY) { + if (download->get_body_size() > 0) { + status->set_text(vformat( + TTR("Downloading (%s / %s)..."), + String::humanize_size(download->get_downloaded_bytes()), + String::humanize_size(download->get_body_size()))); + } else { + // Total file size is unknown, so it cannot be displayed. + status->set_text(TTR("Downloading...")); + } + } - case HTTPClient::STATUS_RESOLVING: { - status->set_text(TTR("Resolving...")); - progress->set_max(1); - progress->set_value(0); - } break; - case HTTPClient::STATUS_CONNECTING: { - status->set_text(TTR("Connecting...")); - progress->set_max(1); - progress->set_value(0); - } break; - case HTTPClient::STATUS_REQUESTING: { - status->set_text(TTR("Requesting...")); - progress->set_max(1); - progress->set_value(0); - } break; - default: { + if (cstatus != prev_status) { + switch (cstatus) { + + case HTTPClient::STATUS_RESOLVING: { + status->set_text(TTR("Resolving...")); + progress->set_max(1); + progress->set_value(0); + } break; + case HTTPClient::STATUS_CONNECTING: { + status->set_text(TTR("Connecting...")); + progress->set_max(1); + progress->set_value(0); + } break; + case HTTPClient::STATUS_REQUESTING: { + status->set_text(TTR("Requesting...")); + progress->set_max(1); + progress->set_value(0); + } break; + default: { + } } + prev_status = cstatus; } - prev_status = cstatus; - } + } break; } } void EditorAssetLibraryItemDownload::_close() { - DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - da->remove(download->get_download_file()); //clean up removed file - memdelete(da); + // Clean up downloaded file. + DirAccess::remove_file_or_error(download->get_download_file()); queue_delete(); } @@ -531,7 +547,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { hb2->add_spacer(); install = memnew(Button); - install->set_text(TTR("Install")); + install->set_text(TTR("Install...")); install->set_disabled(true); install->connect("pressed", this, "_install"); @@ -554,6 +570,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { asset_installer = memnew(EditorAssetInstaller); add_child(asset_installer); + asset_installer->connect("confirmed", this, "_close"); prev_status = -1; @@ -564,6 +581,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { void EditorAssetLibrary::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_READY: { error_tr->set_texture(get_icon("Error", "EditorIcons")); @@ -573,14 +591,12 @@ void EditorAssetLibrary::_notification(int p_what) { error_label->raise(); } break; - case NOTIFICATION_VISIBILITY_CHANGED: { if (is_visible()) { - _repository_changed(0); // Update when shown for the first time + _repository_changed(0); // Update when shown for the first time. } } break; - case NOTIFICATION_PROCESS: { HTTPClient::Status s = request->get_http_client_status(); @@ -619,6 +635,7 @@ void EditorAssetLibrary::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { library_scroll_bg->add_style_override("panel", get_stylebox("bg", "Tree")); + downloads_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); error_tr->set_texture(get_icon("Error", "EditorIcons")); reverse->set_icon(get_icon("Sort", "EditorIcons")); filter->set_right_icon(get_icon("Search", "EditorIcons")); @@ -741,7 +758,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt switch (image_queue[p_queue_id].image_type) { case IMAGE_QUEUE_ICON: - image->resize(64 * EDSCALE, 64 * EDSCALE, Image::INTERPOLATE_CUBIC); + image->resize(64 * EDSCALE, 64 * EDSCALE, Image::INTERPOLATE_LANCZOS); break; case IMAGE_QUEUE_THUMBNAIL: { @@ -749,7 +766,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt float scale_ratio = max_height / (image->get_height() * EDSCALE); if (scale_ratio < 1) { - image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_CUBIC); + image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_LANCZOS); } } break; case IMAGE_QUEUE_SCREENSHOT: { @@ -757,7 +774,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt float scale_ratio = max_height / (image->get_height() * EDSCALE); if (scale_ratio < 1) { - image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_CUBIC); + image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_LANCZOS); } } break; } @@ -1238,9 +1255,6 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const description->connect("confirmed", this, "_install_asset"); description->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"], r["version"], r["version_string"], r["description"], r["download_url"], r["browse_url"], r["download_hash"]); - /*item->connect("asset_selected",this,"_select_asset"); - item->connect("author_selected",this,"_select_author"); - item->connect("category_selected",this,"_category_selected");*/ if (r.has("icon_url") && r["icon_url"] != "") { _request_image(description->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0); @@ -1267,9 +1281,8 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const if (p.has("thumbnail")) { _request_image(description->get_instance_id(), p["thumbnail"], IMAGE_QUEUE_THUMBNAIL, i); } - if (is_video) { - //_request_image(description->get_instance_id(),p["link"],IMAGE_QUEUE_SCREENSHOT,i); - } else { + + if (!is_video) { _request_image(description->get_instance_id(), p["link"], IMAGE_QUEUE_SCREENSHOT, i); } } @@ -1390,19 +1403,16 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { reverse = memnew(ToolButton); reverse->set_toggle_mode(true); reverse->connect("toggled", this, "_rerun_search"); - //reverse->set_text(TTR("Reverse")); + reverse->set_tooltip(TTR("Reverse sorting.")); search_hb2->add_child(reverse); search_hb2->add_child(memnew(VSeparator)); - //search_hb2->add_spacer(); - search_hb2->add_child(memnew(Label(TTR("Category:") + " "))); categories = memnew(OptionButton); categories->add_item(TTR("All")); search_hb2->add_child(categories); categories->set_h_size_flags(SIZE_EXPAND_FILL); - //search_hb2->add_spacer(); categories->connect("item_selected", this, "_rerun_search"); search_hb2->add_child(memnew(VSeparator)); diff --git a/editor/plugins/camera_editor_plugin.h b/editor/plugins/camera_editor_plugin.h index eac9acab93..400aee132d 100644 --- a/editor/plugins/camera_editor_plugin.h +++ b/editor/plugins/camera_editor_plugin.h @@ -35,10 +35,6 @@ #include "editor/editor_plugin.h" #include "scene/3d/camera.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class CameraEditor : public Control { GDCLASS(CameraEditor, Control); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 1f601e64fa..785a1c107a 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -174,15 +174,6 @@ public: } }; -void CanvasItemEditor::_snap_if_closer_float(float p_value, float p_target_snap, float &r_current_snap, bool &r_snapped, float p_radius) { - float radius = p_radius / zoom; - float dist = Math::abs(p_value - p_target_snap); - if ((p_radius < 0 || dist < radius) && (!r_snapped || dist < Math::abs(r_current_snap - p_value))) { - r_current_snap = p_target_snap; - r_snapped = true; - } -} - bool CanvasItemEditor::_is_node_locked(const Node *p_node) { return p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_"); } @@ -200,108 +191,174 @@ bool CanvasItemEditor::_is_node_movable(const Node *p_node, bool p_popup_warning return true; } -void CanvasItemEditor::_snap_if_closer_point(Point2 p_value, Point2 p_target_snap, Point2 &r_current_snap, bool (&r_snapped)[2], real_t rotation, float p_radius) { +void CanvasItemEditor::_snap_if_closer_float( + float p_value, + float &r_current_snap, SnapTarget &r_current_snap_target, + float p_target_value, SnapTarget p_snap_target, + float p_radius) { + + float radius = p_radius / zoom; + float dist = Math::abs(p_value - p_target_value); + if ((p_radius < 0 || dist < radius) && (r_current_snap_target == SNAP_TARGET_NONE || dist < Math::abs(r_current_snap - p_value))) { + r_current_snap = p_target_value; + r_current_snap_target = p_snap_target; + } +} + +void CanvasItemEditor::_snap_if_closer_point( + Point2 p_value, + Point2 &r_current_snap, SnapTarget (&r_current_snap_target)[2], + Point2 p_target_value, SnapTarget p_snap_target, + real_t rotation, + float p_radius) { + Transform2D rot_trans = Transform2D(rotation, Point2()); p_value = rot_trans.inverse().xform(p_value); - p_target_snap = rot_trans.inverse().xform(p_target_snap); + p_target_value = rot_trans.inverse().xform(p_target_value); r_current_snap = rot_trans.inverse().xform(r_current_snap); - _snap_if_closer_float(p_value.x, p_target_snap.x, r_current_snap.x, r_snapped[0], p_radius); - _snap_if_closer_float(p_value.y, p_target_snap.y, r_current_snap.y, r_snapped[1], p_radius); + _snap_if_closer_float( + p_value.x, + r_current_snap.x, + r_current_snap_target[0], + p_target_value.x, + p_snap_target, + p_radius); + + _snap_if_closer_float( + p_value.y, + r_current_snap.y, + r_current_snap_target[1], + p_target_value.y, + p_snap_target, + p_radius); r_current_snap = rot_trans.xform(r_current_snap); } -void CanvasItemEditor::_snap_other_nodes(Point2 p_value, Point2 &r_current_snap, bool (&r_snapped)[2], const Node *p_current, const CanvasItem *p_to_snap) { +void CanvasItemEditor::_snap_other_nodes( + const Point2 p_value, + const Transform2D p_transform_to_snap, + Point2 &r_current_snap, SnapTarget (&r_current_snap_target)[2], + const SnapTarget p_snap_target, List<const CanvasItem *> p_exceptions, + const Node *p_current) { const CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_current); - if (canvas_item && (!p_to_snap || p_current != p_to_snap)) { + + // Check if the element is in the exception + bool exception = false; + for (List<const CanvasItem *>::Element *E = p_exceptions.front(); E; E = E->next()) { + if (E->get() == p_current) { + exception = true; + break; + } + }; + + if (canvas_item && !exception) { Transform2D ci_transform = canvas_item->get_global_transform_with_canvas(); - Transform2D to_snap_transform = p_to_snap ? p_to_snap->get_global_transform_with_canvas() : Transform2D(); - if (fmod(ci_transform.get_rotation() - to_snap_transform.get_rotation(), (real_t)360.0) == 0.0) { + if (fmod(ci_transform.get_rotation() - p_transform_to_snap.get_rotation(), (real_t)360.0) == 0.0) { if (canvas_item->_edit_use_rect()) { Point2 begin = ci_transform.xform(canvas_item->_edit_get_rect().get_position()); Point2 end = ci_transform.xform(canvas_item->_edit_get_rect().get_position() + canvas_item->_edit_get_rect().get_size()); - _snap_if_closer_point(p_value, begin, r_current_snap, r_snapped, ci_transform.get_rotation()); - _snap_if_closer_point(p_value, end, r_current_snap, r_snapped, ci_transform.get_rotation()); + + _snap_if_closer_point(p_value, r_current_snap, r_current_snap_target, begin, p_snap_target, ci_transform.get_rotation()); + _snap_if_closer_point(p_value, r_current_snap, r_current_snap_target, end, p_snap_target, ci_transform.get_rotation()); } else { Point2 position = ci_transform.xform(Point2()); - _snap_if_closer_point(p_value, position, r_current_snap, r_snapped, ci_transform.get_rotation()); + _snap_if_closer_point(p_value, r_current_snap, r_current_snap_target, position, p_snap_target, ci_transform.get_rotation()); } } } for (int i = 0; i < p_current->get_child_count(); i++) { - _snap_other_nodes(p_value, r_current_snap, r_snapped, p_current->get_child(i), p_to_snap); + _snap_other_nodes(p_value, p_transform_to_snap, r_current_snap, r_current_snap_target, p_snap_target, p_exceptions, p_current->get_child(i)); } } -Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, const CanvasItem *p_canvas_item, unsigned int p_forced_modes) { - bool snapped[2] = { false, false }; +Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, unsigned int p_forced_modes, const CanvasItem *p_self_canvas_item, List<CanvasItem *> p_other_nodes_exceptions) { + + snap_target[0] = SNAP_TARGET_NONE; + snap_target[1] = SNAP_TARGET_NONE; + bool is_snap_active = snap_active ^ Input::get_singleton()->is_key_pressed(KEY_CONTROL); // Smart snap using the canvas position Vector2 output = p_target; real_t rotation = 0.0; - if (p_canvas_item) { - rotation = p_canvas_item->get_global_transform_with_canvas().get_rotation(); + if (p_self_canvas_item) { + rotation = p_self_canvas_item->get_global_transform_with_canvas().get_rotation(); // Parent sides and center if ((is_snap_active && snap_node_parent && (p_modes & SNAP_NODE_PARENT)) || (p_forced_modes & SNAP_NODE_PARENT)) { - if (const Control *c = Object::cast_to<Control>(p_canvas_item)) { - Point2 begin = p_canvas_item->get_global_transform_with_canvas().xform(_anchor_to_position(c, Point2(0, 0))); - Point2 end = p_canvas_item->get_global_transform_with_canvas().xform(_anchor_to_position(c, Point2(1, 1))); - _snap_if_closer_point(p_target, begin, output, snapped, rotation); - _snap_if_closer_point(p_target, (begin + end) / 2.0, output, snapped, rotation); - _snap_if_closer_point(p_target, end, output, snapped, rotation); - } else if (const CanvasItem *parent_ci = Object::cast_to<CanvasItem>(p_canvas_item->get_parent())) { + if (const Control *c = Object::cast_to<Control>(p_self_canvas_item)) { + Point2 begin = p_self_canvas_item->get_global_transform_with_canvas().xform(_anchor_to_position(c, Point2(0, 0))); + Point2 end = p_self_canvas_item->get_global_transform_with_canvas().xform(_anchor_to_position(c, Point2(1, 1))); + _snap_if_closer_point(p_target, output, snap_target, begin, SNAP_TARGET_PARENT, rotation); + _snap_if_closer_point(p_target, output, snap_target, (begin + end) / 2.0, SNAP_TARGET_PARENT, rotation); + _snap_if_closer_point(p_target, output, snap_target, end, SNAP_TARGET_PARENT, rotation); + } else if (const CanvasItem *parent_ci = Object::cast_to<CanvasItem>(p_self_canvas_item->get_parent())) { if (parent_ci->_edit_use_rect()) { - Point2 begin = p_canvas_item->get_transform().affine_inverse().xform(parent_ci->_edit_get_rect().get_position()); - Point2 end = p_canvas_item->get_transform().affine_inverse().xform(parent_ci->_edit_get_rect().get_position() + parent_ci->_edit_get_rect().get_size()); - _snap_if_closer_point(p_target, begin, output, snapped, rotation); - _snap_if_closer_point(p_target, (begin + end) / 2.0, output, snapped, rotation); - _snap_if_closer_point(p_target, end, output, snapped, rotation); + Point2 begin = p_self_canvas_item->get_transform().affine_inverse().xform(parent_ci->_edit_get_rect().get_position()); + Point2 end = p_self_canvas_item->get_transform().affine_inverse().xform(parent_ci->_edit_get_rect().get_position() + parent_ci->_edit_get_rect().get_size()); + _snap_if_closer_point(p_target, output, snap_target, begin, SNAP_TARGET_PARENT, rotation); + _snap_if_closer_point(p_target, output, snap_target, (begin + end) / 2.0, SNAP_TARGET_PARENT, rotation); + _snap_if_closer_point(p_target, output, snap_target, end, SNAP_TARGET_PARENT, rotation); } else { - Point2 position = p_canvas_item->get_transform().affine_inverse().xform(Point2()); - _snap_if_closer_point(p_target, position, output, snapped, rotation); + Point2 position = p_self_canvas_item->get_transform().affine_inverse().xform(Point2()); + _snap_if_closer_point(p_target, output, snap_target, position, SNAP_TARGET_PARENT, rotation); } } } // Self anchors if ((is_snap_active && snap_node_anchors && (p_modes & SNAP_NODE_ANCHORS)) || (p_forced_modes & SNAP_NODE_ANCHORS)) { - if (const Control *c = Object::cast_to<Control>(p_canvas_item)) { - Point2 begin = p_canvas_item->get_global_transform_with_canvas().xform(_anchor_to_position(c, Point2(c->get_anchor(MARGIN_LEFT), c->get_anchor(MARGIN_TOP)))); - Point2 end = p_canvas_item->get_global_transform_with_canvas().xform(_anchor_to_position(c, Point2(c->get_anchor(MARGIN_RIGHT), c->get_anchor(MARGIN_BOTTOM)))); - _snap_if_closer_point(p_target, begin, output, snapped, rotation); - _snap_if_closer_point(p_target, end, output, snapped, rotation); + if (const Control *c = Object::cast_to<Control>(p_self_canvas_item)) { + Point2 begin = p_self_canvas_item->get_global_transform_with_canvas().xform(_anchor_to_position(c, Point2(c->get_anchor(MARGIN_LEFT), c->get_anchor(MARGIN_TOP)))); + Point2 end = p_self_canvas_item->get_global_transform_with_canvas().xform(_anchor_to_position(c, Point2(c->get_anchor(MARGIN_RIGHT), c->get_anchor(MARGIN_BOTTOM)))); + _snap_if_closer_point(p_target, output, snap_target, begin, SNAP_TARGET_SELF_ANCHORS, rotation); + _snap_if_closer_point(p_target, output, snap_target, end, SNAP_TARGET_SELF_ANCHORS, rotation); } } // Self sides if ((is_snap_active && snap_node_sides && (p_modes & SNAP_NODE_SIDES)) || (p_forced_modes & SNAP_NODE_SIDES)) { - if (p_canvas_item->_edit_use_rect()) { - Point2 begin = p_canvas_item->get_global_transform_with_canvas().xform(p_canvas_item->_edit_get_rect().get_position()); - Point2 end = p_canvas_item->get_global_transform_with_canvas().xform(p_canvas_item->_edit_get_rect().get_position() + p_canvas_item->_edit_get_rect().get_size()); - _snap_if_closer_point(p_target, begin, output, snapped, rotation); - _snap_if_closer_point(p_target, end, output, snapped, rotation); + if (p_self_canvas_item->_edit_use_rect()) { + Point2 begin = p_self_canvas_item->get_global_transform_with_canvas().xform(p_self_canvas_item->_edit_get_rect().get_position()); + Point2 end = p_self_canvas_item->get_global_transform_with_canvas().xform(p_self_canvas_item->_edit_get_rect().get_position() + p_self_canvas_item->_edit_get_rect().get_size()); + _snap_if_closer_point(p_target, output, snap_target, begin, SNAP_TARGET_SELF, rotation); + _snap_if_closer_point(p_target, output, snap_target, end, SNAP_TARGET_SELF, rotation); } } // Self center if ((is_snap_active && snap_node_center && (p_modes & SNAP_NODE_CENTER)) || (p_forced_modes & SNAP_NODE_CENTER)) { - if (p_canvas_item->_edit_use_rect()) { - Point2 center = p_canvas_item->get_global_transform_with_canvas().xform(p_canvas_item->_edit_get_rect().get_position() + p_canvas_item->_edit_get_rect().get_size() / 2.0); - _snap_if_closer_point(p_target, center, output, snapped, rotation); + if (p_self_canvas_item->_edit_use_rect()) { + Point2 center = p_self_canvas_item->get_global_transform_with_canvas().xform(p_self_canvas_item->_edit_get_rect().get_position() + p_self_canvas_item->_edit_get_rect().get_size() / 2.0); + _snap_if_closer_point(p_target, output, snap_target, center, SNAP_TARGET_SELF, rotation); } else { - Point2 position = p_canvas_item->get_global_transform_with_canvas().xform(Point2()); - _snap_if_closer_point(p_target, position, output, snapped, rotation); + Point2 position = p_self_canvas_item->get_global_transform_with_canvas().xform(Point2()); + _snap_if_closer_point(p_target, output, snap_target, position, SNAP_TARGET_SELF, rotation); } } } // Other nodes sides if ((is_snap_active && snap_other_nodes && (p_modes & SNAP_OTHER_NODES)) || (p_forced_modes & SNAP_OTHER_NODES)) { - _snap_other_nodes(p_target, output, snapped, get_tree()->get_edited_scene_root(), p_canvas_item); + Transform2D to_snap_transform = Transform2D(); + List<const CanvasItem *> exceptions = List<const CanvasItem *>(); + for (List<CanvasItem *>::Element *E = p_other_nodes_exceptions.front(); E; E = E->next()) { + exceptions.push_back(E->get()); + } + if (p_self_canvas_item) { + exceptions.push_back(p_self_canvas_item); + to_snap_transform = p_self_canvas_item->get_global_transform_with_canvas(); + } + + _snap_other_nodes( + p_target, to_snap_transform, + output, snap_target, + SNAP_TARGET_OTHER_NODE, + exceptions, + get_tree()->get_edited_scene_root()); } if (((is_snap_active && snap_guides && (p_modes & SNAP_GUIDES)) || (p_forced_modes & SNAP_GUIDES)) && fmod(rotation, (real_t)360.0) == 0.0) { @@ -309,14 +366,14 @@ Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, const if (EditorNode::get_singleton()->get_edited_scene() && EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_vertical_guides_")) { Array vguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_vertical_guides_"); for (int i = 0; i < vguides.size(); i++) { - _snap_if_closer_float(p_target.x, vguides[i], output.x, snapped[0]); + _snap_if_closer_float(p_target.x, output.x, snap_target[0], vguides[i], SNAP_TARGET_GUIDE); } } if (EditorNode::get_singleton()->get_edited_scene() && EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_horizontal_guides_")) { Array hguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_horizontal_guides_"); for (int i = 0; i < hguides.size(); i++) { - _snap_if_closer_float(p_target.y, hguides[i], output.y, snapped[1]); + _snap_if_closer_float(p_target.y, output.y, snap_target[1], hguides[i], SNAP_TARGET_GUIDE); } } } @@ -335,7 +392,7 @@ Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, const Point2 grid_output; grid_output.x = Math::stepify(p_target.x - offset.x, grid_step.x * Math::pow(2.0, grid_step_multiplier)) + offset.x; grid_output.y = Math::stepify(p_target.y - offset.y, grid_step.y * Math::pow(2.0, grid_step_multiplier)) + offset.y; - _snap_if_closer_point(p_target, grid_output, output, snapped, 0.0, -1.0); + _snap_if_closer_point(p_target, output, snap_target, grid_output, SNAP_TARGET_GRID, 0.0, -1.0); } if (((snap_pixel && (p_modes & SNAP_PIXEL)) || (p_forced_modes & SNAP_PIXEL)) && rotation == 0.0) { @@ -343,6 +400,8 @@ Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, const output = output.snapped(Size2(1, 1)); } + snap_transform = Transform2D(rotation, output); + return output; } @@ -860,20 +919,47 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve Ref<InputEventMouseButton> b = p_event; Ref<InputEventMouseMotion> m = p_event; - // Start dragging a guide if (drag_type == DRAG_NONE) { - if (b.is_valid() && b->get_button_index() == BUTTON_LEFT && b->is_pressed()) { - if (show_guides && show_rulers && EditorNode::get_singleton()->get_edited_scene()) { - Transform2D xform = viewport_scrollable->get_transform() * transform; - // Retrieve the guide lists - Array vguides; - if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_vertical_guides_")) { - vguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_vertical_guides_"); + if (show_guides && show_rulers && EditorNode::get_singleton()->get_edited_scene()) { + Transform2D xform = viewport_scrollable->get_transform() * transform; + // Retrieve the guide lists + Array vguides; + if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_vertical_guides_")) { + vguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_vertical_guides_"); + } + Array hguides; + if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_horizontal_guides_")) { + hguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_horizontal_guides_"); + } + + // Hover over guides + float minimum = 1e20; + is_hovering_h_guide = false; + is_hovering_v_guide = false; + + if (m.is_valid() && m->get_position().x < RULER_WIDTH) { + // Check if we are hovering an existing horizontal guide + for (int i = 0; i < hguides.size(); i++) { + if (ABS(xform.xform(Point2(0, hguides[i])).y - m->get_position().y) < MIN(minimum, 8)) { + is_hovering_h_guide = true; + is_hovering_v_guide = false; + break; + } } - Array hguides; - if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_horizontal_guides_")) { - hguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_horizontal_guides_"); + + } else if (m.is_valid() && m->get_position().y < RULER_WIDTH) { + // Check if we are hovering an existing vertical guide + for (int i = 0; i < vguides.size(); i++) { + if (ABS(xform.xform(Point2(vguides[i], 0)).x - m->get_position().x) < MIN(minimum, 8)) { + is_hovering_v_guide = true; + is_hovering_h_guide = false; + break; + } } + } + + // Start dragging a guide + if (b.is_valid() && b->get_button_index() == BUTTON_LEFT && b->is_pressed()) { // Press button if (b->get_position().x < RULER_WIDTH && b->get_position().y < RULER_WIDTH) { @@ -883,7 +969,6 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve return true; } else if (b->get_position().x < RULER_WIDTH) { // Check if we drag an existing horizontal guide - float minimum = 1e20; dragged_guide_index = -1; for (int i = 0; i < hguides.size(); i++) { if (ABS(xform.xform(Point2(0, hguides[i])).y - b->get_position().y) < MIN(minimum, 8)) { @@ -901,7 +986,6 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve return true; } else if (b->get_position().y < RULER_WIDTH) { // Check if we drag an existing vertical guide - float minimum = 1e20; dragged_guide_index = -1; for (int i = 0; i < vguides.size(); i++) { if (ABS(xform.xform(Point2(vguides[i], 0)).x - b->get_position().x) < MIN(minimum, 8)) { @@ -956,14 +1040,14 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve // Adds a new vertical guide if (dragged_guide_index >= 0) { vguides[dragged_guide_index] = edited.x; - undo_redo->create_action(TTR("Move vertical guide")); + undo_redo->create_action(TTR("Move Vertical Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); } else { vguides.push_back(edited.x); - undo_redo->create_action(TTR("Create new vertical guide")); + undo_redo->create_action(TTR("Create Vertical Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); undo_redo->add_undo_method(viewport, "update"); @@ -972,7 +1056,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve } else { if (dragged_guide_index >= 0) { vguides.remove(dragged_guide_index); - undo_redo->create_action(TTR("Remove vertical guide")); + undo_redo->create_action(TTR("Remove Vertical Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); undo_redo->add_undo_method(viewport, "update"); @@ -985,14 +1069,14 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve // Adds a new horizontal guide if (dragged_guide_index >= 0) { hguides[dragged_guide_index] = edited.y; - undo_redo->create_action(TTR("Move horizontal guide")); + undo_redo->create_action(TTR("Move Horizontal Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides); undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); } else { hguides.push_back(edited.y); - undo_redo->create_action(TTR("Create new horizontal guide")); + undo_redo->create_action(TTR("Create Horizontal Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides); undo_redo->add_undo_method(viewport, "update"); @@ -1001,7 +1085,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve } else { if (dragged_guide_index >= 0) { hguides.remove(dragged_guide_index); - undo_redo->create_action(TTR("Remove horizontal guide")); + undo_redo->create_action(TTR("Remove Horizontal Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides); undo_redo->add_undo_method(viewport, "update"); @@ -1015,7 +1099,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve // Adds a new horizontal guide a new vertical guide vguides.push_back(edited.x); hguides.push_back(edited.y); - undo_redo->create_action(TTR("Create new horizontal and vertical guides")); + undo_redo->create_action(TTR("Create Horizontal and Vertical Guides")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); @@ -1033,12 +1117,14 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve return false; } -bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { +bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bool p_already_accepted) { Ref<InputEventMouseButton> b = p_event; - if (b.is_valid()) { + if (b.is_valid() && !p_already_accepted) { + bool pan_on_scroll = bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan")) && !b->get_control(); + if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_DOWN) { // Scroll or pan down - if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) { + if (pan_on_scroll) { view_offset.y += int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor(); update_viewport(); } else { @@ -1049,7 +1135,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_UP) { // Scroll or pan up - if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) { + if (pan_on_scroll) { view_offset.y -= int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor(); update_viewport(); } else { @@ -1060,7 +1146,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_LEFT) { // Pan left - if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) { + if (pan_on_scroll) { view_offset.x -= int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor(); update_viewport(); return true; @@ -1069,7 +1155,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_RIGHT) { // Pan right - if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) { + if (pan_on_scroll) { view_offset.x += int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor(); update_viewport(); return true; @@ -1079,6 +1165,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { if (!panning) { if (b->is_pressed() && (b->get_button_index() == BUTTON_MIDDLE || + b->get_button_index() == BUTTON_RIGHT || (b->get_button_index() == BUTTON_LEFT && tool == TOOL_PAN) || (b->get_button_index() == BUTTON_LEFT && !EditorSettings::get_singleton()->get("editors/2d/simple_panning") && pan_pressed))) { // Pan the viewport @@ -1134,14 +1221,14 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) { } Ref<InputEventMagnifyGesture> magnify_gesture = p_event; - if (magnify_gesture.is_valid()) { + if (magnify_gesture.is_valid() && !p_already_accepted) { // Zoom gesture _zoom_on_position(zoom * magnify_gesture->get_factor(), magnify_gesture->get_position()); return true; } Ref<InputEventPanGesture> pan_gesture = p_event; - if (pan_gesture.is_valid()) { + if (pan_gesture.is_valid() && !p_already_accepted) { // Pan gesture const Vector2 delta = (int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom) * pan_gesture->get_delta(); view_offset.x += delta.x; @@ -1177,10 +1264,11 @@ bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) { if (drag_selection.size() > 0) { 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) - new_pos = snap_point(drag_from, SNAP_NODE_SIDES | SNAP_NODE_CENTER | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, drag_selection[0]); - else - new_pos = snap_point(drag_from, SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL); + if (drag_selection.size() == 1) { + new_pos = snap_point(drag_from, SNAP_NODE_SIDES | SNAP_NODE_CENTER | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, drag_selection[0]); + } else { + new_pos = snap_point(drag_from, SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, NULL, drag_selection); + } for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) { CanvasItem *canvas_item = E->get(); canvas_item->_edit_set_pivot(canvas_item->get_global_transform_with_canvas().affine_inverse().xform(new_pos)); @@ -1200,7 +1288,7 @@ bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) { _restore_canvas_item_state(drag_selection); Vector2 new_pos; if (drag_selection.size() == 1) - new_pos = snap_point(drag_to, SNAP_NODE_SIDES | SNAP_NODE_CENTER | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, drag_selection[0]); + new_pos = snap_point(drag_to, SNAP_NODE_SIDES | SNAP_NODE_CENTER | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, drag_selection[0]); else new_pos = snap_point(drag_to, SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL); for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) { @@ -1406,7 +1494,7 @@ bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) { for (int i = 0; i < 4; i++) { anchor_pos[i] = (transform * control->get_global_transform_with_canvas()).xform(_anchor_to_position(control, anchor_pos[i])); anchor_rects[i] = Rect2(anchor_pos[i], anchor_handle->get_size()); - anchor_rects[i].position -= anchor_handle->get_size() * Vector2(i == 0 || i == 3, i <= 1); + anchor_rects[i].position -= anchor_handle->get_size() * Vector2(float(i == 0 || i == 3), float(i <= 1)); } DragType dragger[] = { @@ -1450,7 +1538,7 @@ bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) { previous_anchor.y = (drag_type == DRAG_ANCHOR_TOP_LEFT || drag_type == DRAG_ANCHOR_TOP_RIGHT) ? control->get_anchor(MARGIN_TOP) : control->get_anchor(MARGIN_BOTTOM); previous_anchor = xform.affine_inverse().xform(_anchor_to_position(control, previous_anchor)); - Vector2 new_anchor = xform.xform(snap_point(previous_anchor + (drag_to - drag_from), SNAP_GRID | SNAP_OTHER_NODES, control, SNAP_NODE_PARENT | SNAP_NODE_SIDES | SNAP_NODE_CENTER)); + Vector2 new_anchor = xform.xform(snap_point(previous_anchor + (drag_to - drag_from), SNAP_GRID | SNAP_OTHER_NODES, SNAP_NODE_PARENT | SNAP_NODE_SIDES | SNAP_NODE_CENTER, control)); new_anchor = _position_to_anchor(control, new_anchor).snapped(Vector2(0.001, 0.001)); bool use_single_axis = m->get_shift(); @@ -1596,8 +1684,8 @@ bool CanvasItemEditor::_gui_input_resize(const Ref<InputEvent> &p_event) { Transform2D xform = canvas_item->get_global_transform_with_canvas().affine_inverse(); - Point2 drag_to_snapped_begin = snap_point(xform.affine_inverse().xform(current_begin) + (drag_to - drag_from), SNAP_NODE_ANCHORS | SNAP_NODE_PARENT | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, canvas_item); - Point2 drag_to_snapped_end = snap_point(xform.affine_inverse().xform(current_end) + (drag_to - drag_from), SNAP_NODE_ANCHORS | SNAP_NODE_PARENT | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, canvas_item); + Point2 drag_to_snapped_begin = snap_point(xform.affine_inverse().xform(current_begin) + (drag_to - drag_from), SNAP_NODE_ANCHORS | SNAP_NODE_PARENT | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, canvas_item); + Point2 drag_to_snapped_end = snap_point(xform.affine_inverse().xform(current_end) + (drag_to - drag_from), SNAP_NODE_ANCHORS | SNAP_NODE_PARENT | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, canvas_item); Point2 drag_begin = xform.xform(drag_to_snapped_begin); Point2 drag_end = xform.xform(drag_to_snapped_end); @@ -1838,7 +1926,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { } else { previous_pos = _get_encompassing_rect_from_list(drag_selection).position; } - Point2 new_pos = snap_point(previous_pos + (drag_to - drag_from), SNAP_GRID | SNAP_GUIDES | SNAP_PIXEL | SNAP_NODE_PARENT | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES); + Point2 new_pos = snap_point(previous_pos + (drag_to - drag_from), SNAP_GRID | SNAP_GUIDES | SNAP_PIXEL | SNAP_NODE_PARENT | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES, 0, NULL, drag_selection); bool single_axis = m->get_shift(); if (single_axis) { if (ABS(new_pos.x - previous_pos.x) > ABS(new_pos.y - previous_pos.y)) { @@ -2221,8 +2309,6 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { //printf("Plugin\n"); } else if ((accepted = _gui_input_open_scene_on_double_click(p_event))) { //printf("Open scene on double click\n"); - } else if ((accepted = _gui_input_anchors(p_event))) { - //printf("Anchors\n"); } else if ((accepted = _gui_input_scale(p_event))) { //printf("Set scale\n"); } else if ((accepted = _gui_input_pivot(p_event))) { @@ -2233,6 +2319,8 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { //printf("Rotate\n"); } else if ((accepted = _gui_input_move(p_event))) { //printf("Move\n"); + } else if ((accepted = _gui_input_anchors(p_event))) { + //printf("Anchors\n"); } else if ((accepted = _gui_input_select(p_event))) { //printf("Selection\n"); } else { @@ -2240,7 +2328,7 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { } } - accepted = (_gui_input_zoom_or_pan(p_event) || accepted); + accepted = (_gui_input_zoom_or_pan(p_event, accepted) || accepted); if (accepted) accept_event(); @@ -2268,14 +2356,17 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { break; case DRAG_LEFT: case DRAG_RIGHT: + case DRAG_V_GUIDE: c = CURSOR_HSIZE; break; case DRAG_TOP: case DRAG_BOTTOM: + case DRAG_H_GUIDE: c = CURSOR_VSIZE; break; case DRAG_TOP_LEFT: case DRAG_BOTTOM_RIGHT: + case DRAG_DOUBLE_GUIDE: c = CURSOR_FDIAGSIZE; break; case DRAG_TOP_RIGHT: @@ -2288,6 +2379,12 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { default: break; } + + if (is_hovering_h_guide) + c = CURSOR_VSIZE; + else if (is_hovering_v_guide) + c = CURSOR_HSIZE; + viewport->set_default_cursor_shape(c); // Grab focus @@ -2384,6 +2481,20 @@ void CanvasItemEditor::_draw_guides() { } } +void CanvasItemEditor::_draw_smart_snapping() { + Color line_color = EditorSettings::get_singleton()->get("editors/2d/smart_snapping_line_color"); + if (snap_target[0] != SNAP_TARGET_NONE && snap_target[0] != SNAP_TARGET_GRID) { + viewport->draw_set_transform_matrix(viewport->get_transform() * transform * snap_transform); + viewport->draw_line(Point2(0, -1.0e+10F), Point2(0, 1.0e+10F), line_color); + viewport->draw_set_transform_matrix(viewport->get_transform()); + } + if (snap_target[1] != SNAP_TARGET_NONE && snap_target[1] != SNAP_TARGET_GRID) { + viewport->draw_set_transform_matrix(viewport->get_transform() * transform * snap_transform); + viewport->draw_line(Point2(-1.0e+10F, 0), Point2(1.0e+10F, 0), line_color); + viewport->draw_set_transform_matrix(viewport->get_transform()); + } +} + void CanvasItemEditor::_draw_rulers() { Color bg_color = get_color("dark_color_2", "Editor"); Color graduation_color = get_color("font_color", "Editor").linear_interpolate(bg_color, 0.5); @@ -2468,6 +2579,8 @@ void CanvasItemEditor::_draw_rulers() { } } } + + // Draw the top left corner viewport->draw_rect(Rect2(Point2(), Size2(RULER_WIDTH, RULER_WIDTH)), graduation_color); } @@ -2586,7 +2699,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { if (dragged_anchor >= 0) { // Draw the 4 lines when dragged - bool snapped; + bool anchor_snapped; Color color_snapped = Color(0.64, 0.93, 0.67, 0.5); Vector2 corners_pos[4]; @@ -2600,14 +2713,8 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { float anchor_val = (i >= 2) ? ANCHOR_END - anchors_values[i] : anchors_values[i]; line_starts[i] = Vector2::linear_interpolate(corners_pos[i], corners_pos[(i + 1) % 4], anchor_val); line_ends[i] = Vector2::linear_interpolate(corners_pos[(i + 3) % 4], corners_pos[(i + 2) % 4], anchor_val); - snapped = anchors_values[i] == 0.0 || anchors_values[i] == 0.5 || anchors_values[i] == 1.0; - int line_width; - if (i == dragged_anchor || (i + 3) % 4 == dragged_anchor) { - line_width = 2; - } else { - line_width = 1; - } - viewport->draw_line(line_starts[i], line_ends[i], snapped ? color_snapped : color_base, Math::round(line_width * EDSCALE)); + anchor_snapped = anchors_values[i] == 0.0 || anchors_values[i] == 0.5 || anchors_values[i] == 1.0; + viewport->draw_line(line_starts[i], line_ends[i], anchor_snapped ? color_snapped : color_base, (i == dragged_anchor || (i + 3) % 4 == dragged_anchor) ? 2 : 1); } // Display the percentages next to the lines @@ -2881,10 +2988,15 @@ void CanvasItemEditor::_draw_selection() { Point2 bsfrom = transform.xform(drag_from); Point2 bsto = transform.xform(box_selecting_to); - VisualServer::get_singleton()->canvas_item_add_rect( - ci, + viewport->draw_rect( Rect2(bsfrom, bsto - bsfrom), - get_color("accent_color", "Editor") * Color(1, 1, 1, 0.375)); + get_color("box_selection_fill_color", "Editor")); + + viewport->draw_rect( + Rect2(bsfrom, bsto - bsfrom), + get_color("box_selection_stroke_color", "Editor"), + false, + Math::round(EDSCALE)); } if (drag_type == DRAG_ROTATE) { @@ -3270,6 +3382,7 @@ void CanvasItemEditor::_draw_viewport() { _draw_rulers(); if (show_guides) _draw_guides(); + _draw_smart_snapping(); _draw_focus(); _draw_hover(); } @@ -3279,6 +3392,10 @@ void CanvasItemEditor::update_viewport() { viewport->update(); } +void CanvasItemEditor::set_current_tool(Tool p_tool) { + _button_tool_select(p_tool); +} + void CanvasItemEditor::_notification(int p_what) { if (p_what == NOTIFICATION_PHYSICS_PROCESS) { @@ -3805,7 +3922,7 @@ void CanvasItemEditor::_zoom_on_position(float p_zoom, Point2 p_position) { } void CanvasItemEditor::_button_zoom_minus() { - _zoom_on_position(zoom / 1.5, viewport_scrollable->get_size() / 2.0); + _zoom_on_position(zoom / Math_SQRT2, viewport_scrollable->get_size() / 2.0); } void CanvasItemEditor::_button_zoom_reset() { @@ -3813,7 +3930,7 @@ void CanvasItemEditor::_button_zoom_reset() { } void CanvasItemEditor::_button_zoom_plus() { - _zoom_on_position(zoom * 1.5, viewport_scrollable->get_size() / 2.0); + _zoom_on_position(zoom * Math_SQRT2, viewport_scrollable->get_size() / 2.0); } void CanvasItemEditor::_button_toggle_snap(bool p_status) { @@ -4961,11 +5078,13 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p->set_hide_on_checkable_item_selection(false); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_grid", TTR("Snap to Grid")), SNAP_USE_GRID); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_rotation_snap", TTR("Use Rotation Snap")), SNAP_USE_ROTATION); - p->add_shortcut(ED_SHORTCUT("canvas_item_editor/configure_snap", TTR("Configure Snap...")), SNAP_CONFIGURE); 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"); + p->add_separator(); + p->add_shortcut(ED_SHORTCUT("canvas_item_editor/configure_snap", TTR("Configure Snap...")), SNAP_CONFIGURE); + smartsnap_config_popup = memnew(PopupMenu); p->add_child(smartsnap_config_popup); smartsnap_config_popup->set_name("SmartSnapping"); diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index a46682d494..a16d07599a 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -39,9 +39,6 @@ #include "scene/gui/label.h" #include "scene/gui/panel_container.h" #include "scene/gui/spin_box.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class CanvasItemEditorViewport; @@ -89,6 +86,17 @@ public: private: EditorNode *editor; + enum SnapTarget { + SNAP_TARGET_NONE = 0, + SNAP_TARGET_PARENT, + SNAP_TARGET_SELF_ANCHORS, + SNAP_TARGET_SELF, + SNAP_TARGET_OTHER_NODE, + SNAP_TARGET_GUIDE, + SNAP_TARGET_GRID, + SNAP_TARGET_PIXEL + }; + enum MenuOption { SNAP_USE, SNAP_USE_NODE_PARENT, @@ -371,6 +379,8 @@ private: List<CanvasItem *> drag_selection; int dragged_guide_index; Point2 dragged_guide_pos; + bool is_hovering_h_guide; + bool is_hovering_v_guide; bool updating_value_dialog; @@ -441,6 +451,7 @@ private: void _draw_percentage_at_position(float p_value, Point2 p_position, Margin p_side); void _draw_straight_line(Point2 p_from, Point2 p_to, Color p_color); + void _draw_smart_snapping(); void _draw_rulers(); void _draw_guides(); void _draw_focus(); @@ -464,7 +475,7 @@ private: bool _gui_input_resize(const Ref<InputEvent> &p_event); bool _gui_input_rotate(const Ref<InputEvent> &p_event); bool _gui_input_select(const Ref<InputEvent> &p_event); - bool _gui_input_zoom_or_pan(const Ref<InputEvent> &p_event); + bool _gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bool p_already_accepted); bool _gui_input_rulers_and_guides(const Ref<InputEvent> &p_event); bool _gui_input_hover(const Ref<InputEvent> &p_event); @@ -476,9 +487,25 @@ private: void _solve_IK(Node2D *leaf_node, Point2 target_position); - void _snap_if_closer_float(float p_value, float p_target_snap, float &r_current_snap, bool &r_snapped, float p_radius = 10.0); - void _snap_if_closer_point(Point2 p_value, Point2 p_target_snap, Point2 &r_current_snap, bool (&r_snapped)[2], real_t rotation = 0.0, float p_radius = 10.0); - void _snap_other_nodes(Point2 p_value, Point2 &r_current_snap, bool (&r_snapped)[2], const Node *p_current, const CanvasItem *p_to_snap = NULL); + SnapTarget snap_target[2]; + Transform2D snap_transform; + void _snap_if_closer_float( + float p_value, + float &r_current_snap, SnapTarget &r_current_snap_target, + float p_target_value, SnapTarget p_snap_target, + float p_radius = 10.0); + void _snap_if_closer_point( + Point2 p_value, + Point2 &r_current_snap, SnapTarget (&r_current_snap_target)[2], + Point2 p_target_value, SnapTarget p_snap_target, + real_t rotation = 0.0, + float p_radius = 10.0); + void _snap_other_nodes( + const Point2 p_value, + const Transform2D p_transform_to_snap, + Point2 &r_current_snap, SnapTarget (&r_current_snap_target)[2], + const SnapTarget p_snap_target, List<const CanvasItem *> p_exceptions, + const Node *p_current); void _set_anchors_preset(Control::LayoutPreset p_preset); void _set_margins_preset(Control::LayoutPreset p_preset); @@ -559,7 +586,7 @@ public: SNAP_DEFAULT = SNAP_GRID | SNAP_GUIDES | SNAP_PIXEL, }; - Point2 snap_point(Point2 p_target, unsigned int p_modes = SNAP_DEFAULT, const CanvasItem *p_canvas_item = NULL, unsigned int p_forced_modes = 0); + Point2 snap_point(Point2 p_target, unsigned int p_modes = SNAP_DEFAULT, unsigned int p_forced_modes = 0, const CanvasItem *p_self_canvas_item = NULL, List<CanvasItem *> p_other_nodes_exceptions = List<CanvasItem *>()); float snap_angle(float p_target, float p_start = 0) const; Transform2D get_canvas_transform() const { return transform; } @@ -582,6 +609,7 @@ public: void update_viewport(); Tool get_current_tool() { return tool; } + void set_current_tool(Tool p_tool); void set_undo_redo(UndoRedo *p_undo_redo) { undo_redo = p_undo_redo; } void edit(CanvasItem *p_canvas_item); diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.h b/editor/plugins/collision_polygon_2d_editor_plugin.h index e15360d4e5..3f0734fb19 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.h +++ b/editor/plugins/collision_polygon_2d_editor_plugin.h @@ -34,9 +34,6 @@ #include "editor/plugins/abstract_polygon_2d_editor.h" #include "scene/2d/collision_polygon_2d.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class CollisionPolygon2DEditor : public AbstractPolygon2DEditor { GDCLASS(CollisionPolygon2DEditor, AbstractPolygon2DEditor); diff --git a/editor/plugins/collision_polygon_editor_plugin.h b/editor/plugins/collision_polygon_editor_plugin.h index a699641aba..2a904a53ba 100644 --- a/editor/plugins/collision_polygon_editor_plugin.h +++ b/editor/plugins/collision_polygon_editor_plugin.h @@ -38,10 +38,6 @@ #include "scene/3d/mesh_instance.h" #include "scene/gui/tool_button.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class CanvasItemEditor; class Polygon3DEditor : public HBoxContainer { diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp index 7c2116f06b..9d625af959 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp @@ -87,8 +87,7 @@ void CPUParticles2DEditorPlugin::_generate_emission_mask() { Ref<Image> img; img.instance(); Error err = ImageLoader::load_image(source_emission_file, img); - ERR_EXPLAIN(TTR("Error loading image:") + " " + source_emission_file); - ERR_FAIL_COND(err != OK); + ERR_FAIL_COND_MSG(err != OK, "Error loading image: " + source_emission_file + "."); if (img->is_compressed()) { img->decompress(); @@ -196,8 +195,7 @@ void CPUParticles2DEditorPlugin::_generate_emission_mask() { valid_normals.resize(vpc); } - ERR_EXPLAIN(TTR("No pixels with transparency > 128 in image...")); - ERR_FAIL_COND(valid_positions.size() == 0); + ERR_FAIL_COND_MSG(valid_positions.size() == 0, "No pixels with transparency > 128 in image..."); if (capture_colors) { PoolColorArray pca; diff --git a/editor/plugins/item_list_editor_plugin.h b/editor/plugins/item_list_editor_plugin.h index 701632e576..78b176620e 100644 --- a/editor/plugins/item_list_editor_plugin.h +++ b/editor/plugins/item_list_editor_plugin.h @@ -39,10 +39,6 @@ #include "scene/gui/option_button.h" #include "scene/gui/popup_menu.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class ItemListPlugin : public Object { GDCLASS(ItemListPlugin, Object); diff --git a/editor/plugins/light_occluder_2d_editor_plugin.h b/editor/plugins/light_occluder_2d_editor_plugin.h index 633fda7091..95fa0df2c1 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.h +++ b/editor/plugins/light_occluder_2d_editor_plugin.h @@ -34,9 +34,6 @@ #include "editor/plugins/abstract_polygon_2d_editor.h" #include "scene/2d/light_occluder_2d.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class LightOccluder2DEditor : public AbstractPolygon2DEditor { GDCLASS(LightOccluder2DEditor, AbstractPolygon2DEditor); diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index ebacccb03c..e125c18ef1 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -34,9 +34,6 @@ void MaterialEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 6203035e25..442110cc84 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -48,9 +48,6 @@ void MeshEditor::_gui_input(Ref<InputEvent> p_event) { void MeshEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index e582f6ded2..1fc6dae978 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -201,6 +201,8 @@ void MeshLibraryEditor::_import_scene_cbk(const String &p_str) { ERR_FAIL_COND(ps.is_null()); Node *scene = ps->instance(); + ERR_FAIL_COND(!scene); + _import_scene(scene, mesh_library, option == MENU_OPTION_UPDATE_FROM_SCENE); memdelete(scene); diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index d59efe49e7..3ea014a38d 100644 --- a/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp @@ -147,9 +147,8 @@ void MultiMeshEditor::_populate() { w.release(); PoolVector<Face3> faces = geometry; - ERR_EXPLAIN(TTR("Parent has no solid faces to populate.")); int facecount = faces.size(); - ERR_FAIL_COND(!facecount); + ERR_FAIL_COND_MSG(!facecount, "Parent has no solid faces to populate."); PoolVector<Face3>::Read r = faces.read(); @@ -164,10 +163,8 @@ void MultiMeshEditor::_populate() { area_accum += area; } - ERR_EXPLAIN(TTR("Couldn't map area.")); - ERR_FAIL_COND(triangle_area_map.size() == 0); - ERR_EXPLAIN(TTR("Couldn't map area.")); - ERR_FAIL_COND(area_accum == 0); + ERR_FAIL_COND_MSG(triangle_area_map.size() == 0, "Couldn't map area."); + ERR_FAIL_COND_MSG(area_accum == 0, "Couldn't map area."); Ref<MultiMesh> multimesh = memnew(MultiMesh); multimesh->set_mesh(mesh); diff --git a/editor/plugins/multimesh_editor_plugin.h b/editor/plugins/multimesh_editor_plugin.h index fe87a2b9cb..5323441bd8 100644 --- a/editor/plugins/multimesh_editor_plugin.h +++ b/editor/plugins/multimesh_editor_plugin.h @@ -36,10 +36,6 @@ #include "scene/3d/multimesh_instance.h" #include "scene/gui/spin_box.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class MultiMeshEditor : public Control { GDCLASS(MultiMeshEditor, Control); diff --git a/editor/plugins/navigation_polygon_editor_plugin.h b/editor/plugins/navigation_polygon_editor_plugin.h index 336c28d642..2a387a8b1e 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.h +++ b/editor/plugins/navigation_polygon_editor_plugin.h @@ -34,9 +34,6 @@ #include "editor/plugins/abstract_polygon_2d_editor.h" #include "scene/2d/navigation_polygon.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class NavigationPolygonEditor : public AbstractPolygon2DEditor { GDCLASS(NavigationPolygonEditor, AbstractPolygon2DEditor); diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp index e68bca55cb..8025e12885 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/particles_2d_editor_plugin.cpp @@ -160,8 +160,7 @@ void Particles2DEditorPlugin::_generate_emission_mask() { Ref<Image> img; img.instance(); Error err = ImageLoader::load_image(source_emission_file, img); - ERR_EXPLAIN(TTR("Error loading image:") + " " + source_emission_file); - ERR_FAIL_COND(err != OK); + ERR_FAIL_COND_MSG(err != OK, "Error loading image: " + source_emission_file + "."); if (img->is_compressed()) { img->decompress(); @@ -269,8 +268,7 @@ void Particles2DEditorPlugin::_generate_emission_mask() { valid_normals.resize(vpc); } - ERR_EXPLAIN(TTR("No pixels with transparency > 128 in image...")); - ERR_FAIL_COND(valid_positions.size() == 0); + ERR_FAIL_COND_MSG(valid_positions.size() == 0, "No pixels with transparency > 128 in image..."); PoolVector<uint8_t> texdata; diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index 75d31459e8..31b0539bfe 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -55,8 +55,7 @@ bool ParticlesEditorBase::_generate(PoolVector<Vector3> &points, PoolVector<Vect if (!triangle_area_map.size() || area_accum == 0) { - err_dialog->set_text(TTR("Faces contain no area!")); - err_dialog->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(TTR("The geometry's faces don't contain any area.")); return false; } @@ -90,8 +89,7 @@ bool ParticlesEditorBase::_generate(PoolVector<Vector3> &points, PoolVector<Vect if (gcount == 0) { - err_dialog->set_text(TTR("No faces!")); - err_dialog->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(TTR("The geometry doesn't contain any faces.")); return false; } @@ -169,11 +167,16 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) { if (!sel) return; + if (!sel->is_class("Spatial")) { + + EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't inherit from Spatial."), sel->get_name())); + return; + } + VisualInstance *vi = Object::cast_to<VisualInstance>(sel); if (!vi) { - err_dialog->set_text(TTR("Node does not contain geometry.")); - err_dialog->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't contain geometry."), sel->get_name())); return; } @@ -181,8 +184,7 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) { if (geometry.size() == 0) { - err_dialog->set_text(TTR("Node does not contain geometry (faces).")); - err_dialog->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't contain face geometry."), sel->get_name())); return; } @@ -231,9 +233,6 @@ ParticlesEditorBase::ParticlesEditorBase() { emission_dialog->get_ok()->set_text(TTR("Create")); emission_dialog->connect("confirmed", this, "_generate_emission_points"); - err_dialog = memnew(ConfirmationDialog); - add_child(err_dialog); - emission_file_dialog = memnew(EditorFileDialog); add_child(emission_file_dialog); emission_file_dialog->connect("file_selected", this, "_resource_seleted"); diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h index 5d05fbd4ac..1b3a1877a4 100644 --- a/editor/plugins/particles_editor_plugin.h +++ b/editor/plugins/particles_editor_plugin.h @@ -36,10 +36,6 @@ #include "scene/3d/particles.h" #include "scene/gui/spin_box.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class ParticlesEditorBase : public Control { GDCLASS(ParticlesEditorBase, Control); @@ -53,8 +49,6 @@ protected: EditorFileDialog *emission_file_dialog; SceneTreeDialog *emission_tree_dialog; - ConfirmationDialog *err_dialog; - ConfirmationDialog *emission_dialog; SpinBox *emission_amount; OptionButton *emission_fill; diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index b87bd29cbd..f02dc0bd6d 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -367,18 +367,18 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { void Path2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { - if (!node) + if (!node || !node->is_visible_in_tree() || !node->get_curve().is_valid()) return; - if (!node->is_visible_in_tree()) - return; + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); - if (!node->get_curve().is_valid()) - return; + const Ref<Texture> path_sharp_handle = get_icon("EditorPathSharpHandle", "EditorIcons"); + const Ref<Texture> path_smooth_handle = get_icon("EditorPathSmoothHandle", "EditorIcons"); + // Both handle icons must be of the same size + const Size2 handle_size = path_sharp_handle->get_size(); - Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); - Ref<Texture> handle = get_icon("EditorHandle", "EditorIcons"); - Size2 handle_size = handle->get_size(); + const Ref<Texture> curve_handle = get_icon("EditorCurveHandle", "EditorIcons"); + const Size2 curve_handle_size = curve_handle->get_size(); Ref<Curve2D> curve = node->get_curve(); @@ -387,19 +387,35 @@ void Path2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { for (int i = 0; i < len; i++) { Vector2 point = xform.xform(curve->get_point_position(i)); - vpc->draw_texture_rect(handle, Rect2(point - handle_size * 0.5, handle_size), false, Color(1, 1, 1, 1)); + // Determines the point icon to be used + bool smooth = false; if (i < len - 1) { Vector2 pointout = xform.xform(curve->get_point_position(i) + curve->get_point_out(i)); - vpc->draw_line(point, pointout, Color(0.5, 0.5, 1.0, 0.8), 1.0); - vpc->draw_texture_rect(handle, Rect2(pointout - handle_size * 0.5, handle_size), false, Color(1, 0.5, 1, 0.3)); + if (point != pointout) { + smooth = true; + // Draw the line with a dark and light color to be visible on all backgrounds + vpc->draw_line(point, pointout, Color(0, 0, 0, 0.5), Math::round(EDSCALE), true); + vpc->draw_line(point, pointout, Color(1, 1, 1, 0.5), Math::round(EDSCALE), true); + vpc->draw_texture_rect(curve_handle, Rect2(pointout - curve_handle_size * 0.5, curve_handle_size), false, Color(1, 1, 1, 0.75)); + } } if (i > 0) { Vector2 pointin = xform.xform(curve->get_point_position(i) + curve->get_point_in(i)); - vpc->draw_line(point, pointin, Color(0.5, 0.5, 1.0, 0.8), 1.0); - vpc->draw_texture_rect(handle, Rect2(pointin - handle_size * 0.5, handle_size), false, Color(1, 0.5, 1, 0.3)); + if (point != pointin) { + smooth = true; + // Draw the line with a dark and light color to be visible on all backgrounds + vpc->draw_line(point, pointin, Color(0, 0, 0, 0.5), Math::round(EDSCALE), true); + vpc->draw_line(point, pointin, Color(1, 1, 1, 0.5), Math::round(EDSCALE), true); + vpc->draw_texture_rect(curve_handle, Rect2(pointin - curve_handle_size * 0.5, curve_handle_size), false, Color(1, 1, 1, 0.75)); + } } + + vpc->draw_texture_rect( + smooth ? path_smooth_handle : path_sharp_handle, + Rect2(point - handle_size * 0.5, handle_size), + false); } if (on_edge) { diff --git a/editor/plugins/path_2d_editor_plugin.h b/editor/plugins/path_2d_editor_plugin.h index 44472f7a81..ecec5f5253 100644 --- a/editor/plugins/path_2d_editor_plugin.h +++ b/editor/plugins/path_2d_editor_plugin.h @@ -36,9 +36,6 @@ #include "scene/2d/path_2d.h" #include "scene/gui/tool_button.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class CanvasItemEditor; class Path2DEditor : public HBoxContainer { diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp index 1ae5acc5ff..2493380585 100644 --- a/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_editor_plugin.cpp @@ -652,7 +652,6 @@ PathSpatialGizmoPlugin::PathSpatialGizmoPlugin() { Color path_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.8)); create_material("path_material", path_color); - path_color.a = 0.4; - create_material("path_thin_material", path_color); + create_material("path_thin_material", Color(0.5, 0.5, 0.5)); create_handle_material("handles"); } diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 59004a08c0..bd532a6418 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -1045,8 +1045,8 @@ void Polygon2DEditor::_uv_draw() { } } - Ref<Texture> handle = get_icon("EditorHandle", "EditorIcons"); - Ref<Texture> internal_handle = get_icon("EditorInternalHandle", "EditorIcons"); + // All UV points are sharp, so use the sharp handle icon + Ref<Texture> handle = get_icon("EditorPathSharpHandle", "EditorIcons"); Color poly_line_color = Color(0.9, 0.5, 0.5); if (polygons.size() || polygon_create.size()) { @@ -1120,7 +1120,8 @@ void Polygon2DEditor::_uv_draw() { if (i < uv_draw_max) { uv_edit_draw->draw_texture(handle, mtx.xform(uvs[i]) - handle->get_size() * 0.5); } else { - uv_edit_draw->draw_texture(internal_handle, mtx.xform(uvs[i]) - internal_handle->get_size() * 0.5); + // Internal vertex + uv_edit_draw->draw_texture(handle, mtx.xform(uvs[i]) - handle->get_size() * 0.5, Color(0.6, 0.8, 1)); } } } diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h index 24ca2ea3f4..009501a70c 100644 --- a/editor/plugins/polygon_2d_editor_plugin.h +++ b/editor/plugins/polygon_2d_editor_plugin.h @@ -33,9 +33,7 @@ #include "editor/plugins/abstract_polygon_2d_editor.h" #include "scene/gui/scroll_container.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class Polygon2DEditor : public AbstractPolygon2DEditor { GDCLASS(Polygon2DEditor, AbstractPolygon2DEditor); diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index b8d95efd49..620bf28415 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -39,9 +39,6 @@ void ResourcePreloaderEditor::_gui_input(Ref<InputEvent> p_event) { void ResourcePreloaderEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_ENTER_TREE) { load->set_icon(get_icon("Folder", "EditorIcons")); } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index d999f3189e..76c7545874 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -44,6 +44,7 @@ #include "editor/script_editor_debugger.h" #include "scene/main/viewport.h" #include "script_text_editor.h" +#include "text_editor.h" /*** SCRIPT EDITOR ****/ @@ -55,7 +56,7 @@ void ScriptEditorBase::_bind_methods() { ADD_SIGNAL(MethodInfo("request_open_script_at_line", PropertyInfo(Variant::OBJECT, "script"), PropertyInfo(Variant::INT, "line"))); ADD_SIGNAL(MethodInfo("request_save_history")); ADD_SIGNAL(MethodInfo("go_to_help", PropertyInfo(Variant::STRING, "what"))); - // TODO This signal is no use for VisualScript... + // TODO: This signal is no use for VisualScript. ADD_SIGNAL(MethodInfo("search_in_files_requested", PropertyInfo(Variant::STRING, "text"))); } @@ -204,11 +205,13 @@ void ScriptEditorQuickOpen::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_confirmed"); - search_box->set_right_icon(get_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); + FALLTHROUGH; + } + case NOTIFICATION_THEME_CHANGED: { + search_box->set_right_icon(get_icon("Search", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { disconnect("confirmed", this, "_confirmed"); @@ -241,6 +244,8 @@ ScriptEditorQuickOpen::ScriptEditorQuickOpen() { set_hide_on_ok(false); search_options->connect("item_activated", this, "_confirmed"); search_options->set_hide_root(true); + search_options->set_hide_folding(true); + search_options->add_constant_override("draw_guides", 1); } ///////////////////////////////// @@ -485,9 +490,6 @@ void ScriptEditor::_update_recent_scripts() { Array rc = EditorSettings::get_singleton()->get_project_metadata("recent_files", "scripts", Array()); recent_scripts->clear(); - recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/open_recent", TTR("Open Recent"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T)); - recent_scripts->add_separator(); - String path; for (int i = 0; i < rc.size(); i++) { @@ -510,11 +512,6 @@ void ScriptEditor::_open_recent_script(int p_idx) { return; } - // take two for the open recent button - if (p_idx > 0) { - p_idx -= 2; - } - Array rc = EditorSettings::get_singleton()->get_project_metadata("recent_files", "scripts", Array()); ERR_FAIL_INDEX(p_idx, rc.size()); @@ -579,6 +576,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { Ref<Script> script = current->get_edited_resource(); if (script != NULL) { + previous_scripts.push_back(script->get_path()); notify_script_close(script); } } @@ -907,7 +905,7 @@ void ScriptEditor::_file_dialog_action(String p_file) { if (extensions.find(p_file.get_extension())) { Ref<Script> scr = ResourceLoader::load(p_file); if (!scr.is_valid()) { - editor->show_warning(TTR("Error: could not load file."), TTR("Error!")); + editor->show_warning(TTR("Could not load file at:") + "\n\n" + p_file, TTR("Error!")); file_dialog_option = -1; return; } @@ -920,7 +918,7 @@ void ScriptEditor::_file_dialog_action(String p_file) { Error error; Ref<TextFile> text_file = _load_text_file(p_file, &error); if (error != OK) { - editor->show_warning(TTR("Error could not load file."), TTR("Error!")); + editor->show_warning(TTR("Could not load file at:") + "\n\n" + p_file, TTR("Error!")); } if (text_file.is_valid()) { @@ -994,7 +992,7 @@ void ScriptEditor::_menu_option(int p_option) { file_dialog->clear_filters(); file_dialog->popup_centered_ratio(); - file_dialog->set_title(TTR("New TextFile...")); + file_dialog->set_title(TTR("New Text File...")); } break; case FILE_OPEN: { file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); @@ -1012,6 +1010,52 @@ void ScriptEditor::_menu_option(int p_option) { file_dialog->set_title(TTR("Open File")); return; } break; + case FILE_REOPEN_CLOSED: { + + if (previous_scripts.empty()) + return; + + String path = previous_scripts.back()->get(); + previous_scripts.pop_back(); + + List<String> extensions; + ResourceLoader::get_recognized_extensions_for_type("Script", &extensions); + bool built_in = !path.is_resource_file(); + + if (extensions.find(path.get_extension()) || built_in) { + if (built_in) { + String scene_path = path.get_slice("::", 0); + if (!EditorNode::get_singleton()->is_scene_open(scene_path)) { + EditorNode::get_singleton()->load_scene(scene_path); + script_editor->call_deferred("_menu_option", p_option); + previous_scripts.push_back(path); //repeat the operation + return; + } + } + + Ref<Script> scr = ResourceLoader::load(path); + if (!scr.is_valid()) { + editor->show_warning(TTR("Could not load file at:") + "\n\n" + path, TTR("Error!")); + file_dialog_option = -1; + return; + } + + edit(scr); + file_dialog_option = -1; + return; + } else { + Error error; + Ref<TextFile> text_file = _load_text_file(path, &error); + if (error != OK) + editor->show_warning(TTR("Could not load file at:") + "\n\n" + path, TTR("Error!")); + + if (text_file.is_valid()) { + edit(text_file); + file_dialog_option = -1; + return; + } + } + } break; case FILE_SAVE_ALL: { if (_test_script_times_on_disk()) @@ -1020,6 +1064,7 @@ void ScriptEditor::_menu_option(int p_option) { save_all_scripts(); } break; case SEARCH_IN_FILES: { + _on_find_in_files_requested(""); } break; case SEARCH_HELP: { @@ -1372,15 +1417,25 @@ void ScriptEditor::_notification(int p_what) { } EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); + FALLTHROUGH; + } + case NOTIFICATION_THEME_CHANGED: { + help_search->set_icon(get_icon("HelpSearch", "EditorIcons")); site_search->set_icon(get_icon("Instance", "EditorIcons")); request_docs->set_icon(get_icon("Issue", "EditorIcons")); script_forward->set_icon(get_icon("Forward", "EditorIcons")); script_back->set_icon(get_icon("Back", "EditorIcons")); + members_overview_alphabeta_sort_button->set_icon(get_icon("Sort", "EditorIcons")); + filter_scripts->set_right_icon(get_icon("Search", "EditorIcons")); filter_methods->set_right_icon(get_icon("Search", "EditorIcons")); + + filename->add_style_override("normal", editor->get_gui_base()->get_stylebox("normal", "LineEdit")); + + recent_scripts->set_as_minsize(); } break; case NOTIFICATION_READY: { @@ -1403,20 +1458,6 @@ void ScriptEditor::_notification(int p_what) { _update_modified_scripts_for_external_editor(); } break; - case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - - help_search->set_icon(get_icon("HelpSearch", "EditorIcons")); - site_search->set_icon(get_icon("Instance", "EditorIcons")); - - script_forward->set_icon(get_icon("Forward", "EditorIcons")); - script_back->set_icon(get_icon("Back", "EditorIcons")); - - members_overview_alphabeta_sort_button->set_icon(get_icon("Sort", "EditorIcons")); - filename->add_style_override("normal", editor->get_gui_base()->get_stylebox("normal", "LineEdit")); - - recent_scripts->set_as_minsize(); - } break; - case CanvasItem::NOTIFICATION_VISIBILITY_CHANGED: { if (is_visible()) { @@ -1894,6 +1935,8 @@ void ScriptEditor::_update_script_names() { _update_members_overview_visibility(); _update_help_overview_visibility(); _update_script_colors(); + + file_menu->get_popup()->set_item_disabled(file_menu->get_popup()->get_item_index(FILE_REOPEN_CLOSED), previous_scripts.empty()); } void ScriptEditor::_update_script_connections() { @@ -2088,16 +2131,18 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra } ERR_FAIL_COND_V(!se, false); - bool highlighter_set = false; - for (int i = 0; i < syntax_highlighters_func_count; i++) { - SyntaxHighlighter *highlighter = syntax_highlighters_funcs[i](); - se->add_syntax_highlighter(highlighter); - - if (script != NULL && !highlighter_set) { - List<String> languages = highlighter->get_supported_languages(); - if (languages.find(script->get_language()->get_name())) { - se->set_syntax_highlighter(highlighter); - highlighter_set = true; + if (p_resource->get_class_name() != StringName("VisualScript")) { + bool highlighter_set = false; + for (int i = 0; i < syntax_highlighters_func_count; i++) { + SyntaxHighlighter *highlighter = syntax_highlighters_funcs[i](); + se->add_syntax_highlighter(highlighter); + + if (script != NULL && !highlighter_set) { + List<String> languages = highlighter->get_supported_languages(); + if (languages.find(script->get_language()->get_name())) { + se->set_syntax_highlighter(highlighter); + highlighter_set = true; + } } } } @@ -2937,18 +2982,38 @@ void ScriptEditor::_on_find_in_files_requested(String text) { void ScriptEditor::_on_find_in_files_result_selected(String fpath, int line_number, int begin, int end) { - RES res = ResourceLoader::load(fpath); - if (fpath.get_extension() == "shader") { - ShaderEditorPlugin *shader_editor = Object::cast_to<ShaderEditorPlugin>(EditorNode::get_singleton()->get_editor_data().get_editor("Shader")); - shader_editor->edit(res.ptr()); - shader_editor->make_visible(true); - shader_editor->get_shader_editor()->goto_line_selection(line_number - 1, begin, end); - } else { - edit(res); + if (ResourceLoader::exists(fpath)) { + RES res = ResourceLoader::load(fpath); + + if (fpath.get_extension() == "shader") { + ShaderEditorPlugin *shader_editor = Object::cast_to<ShaderEditorPlugin>(EditorNode::get_singleton()->get_editor_data().get_editor("Shader")); + shader_editor->edit(res.ptr()); + shader_editor->make_visible(true); + shader_editor->get_shader_editor()->goto_line_selection(line_number - 1, begin, end); + return; + } else { + Ref<Script> script = res; + if (script.is_valid()) { + edit(script); + + ScriptTextEditor *ste = Object::cast_to<ScriptTextEditor>(_get_current_editor()); + if (ste) { + ste->goto_line_selection(line_number - 1, begin, end); + } + return; + } + } + } + + // If the file is not a valid resource/script, load it as a text file. + Error err; + Ref<TextFile> text_file = _load_text_file(fpath, &err); + if (text_file.is_valid()) { + edit(text_file); - ScriptTextEditor *ste = Object::cast_to<ScriptTextEditor>(_get_current_editor()); - if (ste) { - ste->goto_line_selection(line_number - 1, begin, end); + TextEditor *te = Object::cast_to<TextEditor>(_get_current_editor()); + if (te) { + te->goto_line_selection(line_number - 1, begin, end); } } } @@ -3168,8 +3233,9 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->set_switch_on_hover(true); file_menu->get_popup()->set_hide_on_window_lose_focus(true); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New Script...")), FILE_NEW); - file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new_textfile", TTR("New TextFile...")), FILE_NEW_TEXTFILE); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new_textfile", TTR("New Text File...")), FILE_NEW_TEXTFILE); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open...")), FILE_OPEN); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reopen_closed_script", TTR("Reopen Closed Script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T), FILE_REOPEN_CLOSED); file_menu->get_popup()->add_submenu_item(TTR("Open Recent"), "RecentScripts", FILE_OPEN_RECENT); recent_scripts = memnew(PopupMenu); @@ -3200,17 +3266,20 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { theme_submenu->connect("id_pressed", this, "_theme_option"); theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/import_theme", TTR("Import Theme...")), THEME_IMPORT); theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/reload_theme", TTR("Reload Theme")), THEME_RELOAD); + theme_submenu->add_separator(); theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/save_theme", TTR("Save Theme")), THEME_SAVE); theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/save_theme_as", TTR("Save Theme As...")), THEME_SAVE_AS); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_other_tabs", TTR("Close Other Tabs")), CLOSE_OTHER_TABS); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS); + file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/run_file", TTR("Run"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_X), FILE_RUN); + file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH), TOGGLE_SCRIPTS_PANEL); file_menu->get_popup()->connect("id_pressed", this, "_menu_option"); @@ -3498,8 +3567,8 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EDITOR_DEF("text_editor/external/exec_flags", "{file}"); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "text_editor/external/exec_flags", PROPERTY_HINT_PLACEHOLDER_TEXT, "Call flags with placeholders: {project}, {file}, {col}, {line}.")); - ED_SHORTCUT("script_editor/open_recent", TTR("Open Recent"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T); - ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files")); + ED_SHORTCUT("script_editor/reopen_closed_script", TTR("Reopen Closed Script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T); + ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Scripts")); } ScriptEditorPlugin::~ScriptEditorPlugin() { diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 4ad2156779..0c876108a5 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -139,6 +139,7 @@ class ScriptEditor : public PanelContainer { FILE_NEW, FILE_NEW_TEXTFILE, FILE_OPEN, + FILE_REOPEN_CLOSED, FILE_OPEN_RECENT, FILE_SAVE, FILE_SAVE_AS, @@ -265,7 +266,7 @@ class ScriptEditor : public PanelContainer { Vector<ScriptHistory> history; int history_pos; - Vector<String> previous_scripts; + List<String> previous_scripts; void _tab_changed(int p_which); void _menu_option(int p_option); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 438621115b..bded590351 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -30,6 +30,7 @@ #include "script_text_editor.h" +#include "core/math/expression.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" #include "editor/editor_settings.h" @@ -1147,6 +1148,32 @@ void ScriptTextEditor::_edit_option(int p_op) { _convert_case(CodeTextEditor::CAPITALIZE); } break; + case EDIT_EVALUATE: { + + Expression expression; + Vector<String> lines = code_editor->get_text_edit()->get_selection_text().split("\n"); + PoolStringArray results; + + for (int i = 0; i < lines.size(); i++) { + String line = lines[i]; + String whitespace = line.substr(0, line.size() - line.strip_edges(true, false).size()); //extract the whitespace at the beginning + + if (expression.parse(line) == OK) { + Variant result = expression.execute(Array(), Variant(), false); + if (expression.get_error_text() == "") { + results.append(whitespace + (String)result); + } else { + results.append(line); + } + } else { + results.append(line); + } + } + + code_editor->get_text_edit()->begin_complex_operation(); //prevents creating a two-step undo + code_editor->get_text_edit()->insert_text_at_cursor(results.join("\n")); + code_editor->get_text_edit()->end_complex_operation(); + } break; case SEARCH_FIND: { code_editor->get_find_replace_bar()->popup_search(); @@ -1170,7 +1197,6 @@ void ScriptTextEditor::_edit_option(int p_op) { // Yep, because it doesn't make sense to instance this dialog for every single script open... // So this will be delegated to the ScriptEditor. emit_signal("search_in_files_requested", selected_text); - } break; case SEARCH_LOCATE_FUNCTION: { @@ -1572,7 +1598,9 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { if (has_color) { String line = tx->get_line(row); - color_line = row; + color_position.x = row; + color_position.y = col; + int begin = 0; int end = 0; bool valid = false; @@ -1612,25 +1640,33 @@ void ScriptTextEditor::_color_changed(const Color &p_color) { new_args = String("(" + rtos(p_color.r) + ", " + rtos(p_color.g) + ", " + rtos(p_color.b) + ", " + rtos(p_color.a) + ")"); } - String line = code_editor->get_text_edit()->get_line(color_line); - String new_line = line.replace(color_args, new_args); + String line = code_editor->get_text_edit()->get_line(color_position.x); + int color_args_pos = line.find(color_args, color_position.y); + String line_with_replaced_args = line; + line_with_replaced_args.erase(color_args_pos, color_args.length()); + line_with_replaced_args = line_with_replaced_args.insert(color_args_pos, new_args); + color_args = new_args; - code_editor->get_text_edit()->set_line(color_line, new_line); + code_editor->get_text_edit()->begin_complex_operation(); + code_editor->get_text_edit()->set_line(color_position.x, line_with_replaced_args); + code_editor->get_text_edit()->end_complex_operation(); + code_editor->get_text_edit()->update(); } void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color, bool p_foldable, bool p_open_docs, bool p_goto_definition) { context_menu->clear(); - if (p_selection) { - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); - } + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + context_menu->add_separator(); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + context_menu->add_separator(); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + context_menu->add_separator(); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT); @@ -1641,6 +1677,7 @@ void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color, bool p context_menu->add_separator(); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_to_uppercase"), EDIT_TO_UPPERCASE); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_to_lowercase"), EDIT_TO_LOWERCASE); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/evaluate_selection"), EDIT_EVALUATE); } if (p_foldable) context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_fold_line"), EDIT_TOGGLE_FOLD_LINE); @@ -1710,6 +1747,7 @@ ScriptTextEditor::ScriptTextEditor() { color_panel = memnew(PopupPanel); add_child(color_panel); color_picker = memnew(ColorPicker); + color_picker->set_deferred_mode(true); color_panel->add_child(color_picker); color_picker->connect("color_changed", this, "_color_changed"); @@ -1740,6 +1778,7 @@ ScriptTextEditor::ScriptTextEditor() { edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/evaluate_selection"), EDIT_EVALUATE); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/trim_trailing_whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_spaces"), EDIT_CONVERT_INDENT_TO_SPACES); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_tabs"), EDIT_CONVERT_INDENT_TO_TABS); @@ -1776,11 +1815,7 @@ ScriptTextEditor::ScriptTextEditor() { search_menu->get_popup()->add_separator(); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_in_files"), SEARCH_IN_FILES); search_menu->get_popup()->add_separator(); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_function"), SEARCH_LOCATE_FUNCTION); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); - search_menu->get_popup()->add_separator(); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/contextual_help"), HELP_CONTEXTUAL); - search_menu->get_popup()->connect("id_pressed", this, "_edit_option"); edit_hb->add_child(edit_menu); @@ -1789,6 +1824,11 @@ ScriptTextEditor::ScriptTextEditor() { edit_hb->add_child(goto_menu); goto_menu->set_text(TTR("Go To")); goto_menu->set_switch_on_hover(true); + goto_menu->get_popup()->connect("id_pressed", this, "_edit_option"); + + goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_function"), SEARCH_LOCATE_FUNCTION); + goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); + goto_menu->get_popup()->add_separator(); bookmarks_menu = memnew(PopupMenu); bookmarks_menu->set_name("Bookmarks"); @@ -1819,6 +1859,15 @@ ScriptTextEditor::ScriptTextEditor() { code_editor->get_text_edit()->set_drag_forwarding(this); } +ScriptTextEditor::~ScriptTextEditor() { + for (const Map<String, SyntaxHighlighter *>::Element *E = highlighters.front(); E; E = E->next()) { + if (E->get() != NULL) { + memdelete(E->get()); + } + } + highlighters.clear(); +} + static ScriptEditorBase *create_editor(const RES &p_resource) { if (Object::cast_to<Script>(*p_resource)) { @@ -1839,16 +1888,12 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/move_down", TTR("Move Down"), KEY_MASK_ALT | KEY_DOWN); ED_SHORTCUT("script_text_editor/delete_line", TTR("Delete Line"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_K); - //leave these at zero, same can be accomplished with tab/shift-tab, including selection - //the next/previous in history shortcut in this case makes a lot more sene. + // Leave these at zero, same can be accomplished with tab/shift-tab, including selection. + // The next/previous in history shortcut in this case makes a lot more sense. ED_SHORTCUT("script_text_editor/indent_left", TTR("Indent Left"), 0); ED_SHORTCUT("script_text_editor/indent_right", TTR("Indent Right"), 0); ED_SHORTCUT("script_text_editor/toggle_comment", TTR("Toggle Comment"), KEY_MASK_CMD | KEY_K); - ED_SHORTCUT("script_text_editor/toggle_bookmark", TTR("Toggle Bookmark"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_B); - ED_SHORTCUT("script_text_editor/goto_next_bookmark", TTR("Go to Next Bookmark"), KEY_MASK_CMD | KEY_B); - ED_SHORTCUT("script_text_editor/goto_previous_bookmark", TTR("Go to Previous Bookmark"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B); - ED_SHORTCUT("script_text_editor/remove_all_bookmarks", TTR("Remove All Bookmarks"), 0); ED_SHORTCUT("script_text_editor/toggle_fold_line", TTR("Fold/Unfold Line"), KEY_MASK_ALT | KEY_F); ED_SHORTCUT("script_text_editor/fold_all_lines", TTR("Fold All Lines"), 0); ED_SHORTCUT("script_text_editor/unfold_all_lines", TTR("Unfold All Lines"), 0); @@ -1859,20 +1904,12 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_CMD | KEY_D); ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CMD | KEY_SPACE); #endif + ED_SHORTCUT("script_text_editor/evaluate_selection", TTR("Evaluate Selection"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_E); ED_SHORTCUT("script_text_editor/trim_trailing_whitespace", TTR("Trim Trailing Whitespace"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_T); ED_SHORTCUT("script_text_editor/convert_indent_to_spaces", TTR("Convert Indent to Spaces"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Y); ED_SHORTCUT("script_text_editor/convert_indent_to_tabs", TTR("Convert Indent to Tabs"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_I); ED_SHORTCUT("script_text_editor/auto_indent", TTR("Auto Indent"), KEY_MASK_CMD | KEY_I); -#ifdef OSX_ENABLED - ED_SHORTCUT("script_text_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B); -#else - ED_SHORTCUT("script_text_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9); -#endif - ED_SHORTCUT("script_text_editor/remove_all_breakpoints", TTR("Remove All Breakpoints"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F9); - ED_SHORTCUT("script_text_editor/goto_next_breakpoint", TTR("Go to Next Breakpoint"), KEY_MASK_CMD | KEY_PERIOD); - ED_SHORTCUT("script_text_editor/goto_previous_breakpoint", TTR("Go to Previous Breakpoint"), KEY_MASK_CMD | KEY_COMMA); - ED_SHORTCUT("script_text_editor/find", TTR("Find..."), KEY_MASK_CMD | KEY_F); #ifdef OSX_ENABLED ED_SHORTCUT("script_text_editor/find_next", TTR("Find Next"), KEY_MASK_CMD | KEY_G); @@ -1887,6 +1924,17 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/find_in_files", TTR("Find in Files..."), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F); #ifdef OSX_ENABLED + ED_SHORTCUT("script_text_editor/contextual_help", TTR("Contextual Help"), KEY_MASK_ALT | KEY_MASK_SHIFT | KEY_SPACE); +#else + ED_SHORTCUT("script_text_editor/contextual_help", TTR("Contextual Help"), KEY_MASK_ALT | KEY_F1); +#endif + + ED_SHORTCUT("script_text_editor/toggle_bookmark", TTR("Toggle Bookmark"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_B); + ED_SHORTCUT("script_text_editor/goto_next_bookmark", TTR("Go to Next Bookmark"), KEY_MASK_CMD | KEY_B); + ED_SHORTCUT("script_text_editor/goto_previous_bookmark", TTR("Go to Previous Bookmark"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B); + ED_SHORTCUT("script_text_editor/remove_all_bookmarks", TTR("Remove All Bookmarks"), 0); + +#ifdef OSX_ENABLED ED_SHORTCUT("script_text_editor/goto_function", TTR("Go to Function..."), KEY_MASK_CTRL | KEY_MASK_CMD | KEY_J); #else ED_SHORTCUT("script_text_editor/goto_function", TTR("Go to Function..."), KEY_MASK_ALT | KEY_MASK_CMD | KEY_F); @@ -1894,10 +1942,13 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/goto_line", TTR("Go to Line..."), KEY_MASK_CMD | KEY_L); #ifdef OSX_ENABLED - ED_SHORTCUT("script_text_editor/contextual_help", TTR("Contextual Help"), KEY_MASK_ALT | KEY_MASK_SHIFT | KEY_SPACE); + ED_SHORTCUT("script_text_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B); #else - ED_SHORTCUT("script_text_editor/contextual_help", TTR("Contextual Help"), KEY_MASK_ALT | KEY_F1); + ED_SHORTCUT("script_text_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9); #endif + ED_SHORTCUT("script_text_editor/remove_all_breakpoints", TTR("Remove All Breakpoints"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F9); + ED_SHORTCUT("script_text_editor/goto_next_breakpoint", TTR("Go to Next Breakpoint"), KEY_MASK_CMD | KEY_PERIOD); + ED_SHORTCUT("script_text_editor/goto_previous_breakpoint", TTR("Go to Previous Breakpoint"), KEY_MASK_CMD | KEY_COMMA); ScriptEditor::register_create_script_editor_function(create_editor); } diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index 9a2a514a6e..38c6da5c33 100644 --- a/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h @@ -81,7 +81,7 @@ class ScriptTextEditor : public ScriptEditorBase { PopupPanel *color_panel; ColorPicker *color_picker; - int color_line; + Vector2 color_position; String color_args; void _update_member_keywords(); @@ -120,6 +120,7 @@ class ScriptTextEditor : public ScriptEditorBase { EDIT_TO_UPPERCASE, EDIT_TO_LOWERCASE, EDIT_CAPITALIZE, + EDIT_EVALUATE, EDIT_TOGGLE_FOLD_LINE, EDIT_FOLD_ALL_LINES, EDIT_UNFOLD_ALL_LINES, @@ -231,6 +232,7 @@ public: virtual void validate(); ScriptTextEditor(); + ~ScriptTextEditor(); }; #endif // SCRIPT_TEXT_EDITOR_H diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 994c542187..04820b8a8f 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -342,6 +342,9 @@ void ShaderEditor::_menu_option(int p_option) { shader_editor->remove_all_bookmarks(); } break; + case HELP_DOCS: { + OS::get_singleton()->shell_open("https://docs.godotengine.org/en/stable/tutorials/shading/shading_reference/index.html"); + } break; } if (p_option != SEARCH_FIND && p_option != SEARCH_REPLACE && p_option != SEARCH_GOTO_LINE) { shader_editor->get_text_edit()->call_deferred("grab_focus"); @@ -526,19 +529,19 @@ void ShaderEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { void ShaderEditor::_update_bookmark_list() { - bookmarks_menu->get_popup()->clear(); + bookmarks_menu->clear(); - bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_bookmark"), BOOKMARK_TOGGLE); - bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_bookmarks"), BOOKMARK_REMOVE_ALL); - bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT); - bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV); + bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_bookmark"), BOOKMARK_TOGGLE); + bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_bookmarks"), BOOKMARK_REMOVE_ALL); + bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT); + bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV); Array bookmark_list = shader_editor->get_text_edit()->get_bookmarks_array(); if (bookmark_list.size() == 0) { return; } - bookmarks_menu->get_popup()->add_separator(); + bookmarks_menu->add_separator(); for (int i = 0; i < bookmark_list.size(); i++) { String line = shader_editor->get_text_edit()->get_line(bookmark_list[i]).strip_edges(); @@ -547,17 +550,17 @@ void ShaderEditor::_update_bookmark_list() { line = line.substr(0, 50); } - bookmarks_menu->get_popup()->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\""); - bookmarks_menu->get_popup()->set_item_metadata(bookmarks_menu->get_popup()->get_item_count() - 1, bookmark_list[i]); + bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\""); + bookmarks_menu->set_item_metadata(bookmarks_menu->get_item_count() - 1, bookmark_list[i]); } } void ShaderEditor::_bookmark_item_pressed(int p_idx) { if (p_idx < 4) { // Any item before the separator. - _menu_option(bookmarks_menu->get_popup()->get_item_id(p_idx)); + _menu_option(bookmarks_menu->get_item_id(p_idx)); } else { - shader_editor->goto_line(bookmarks_menu->get_popup()->get_item_metadata(p_idx)); + shader_editor->goto_line(bookmarks_menu->get_item_metadata(p_idx)); } } @@ -646,22 +649,36 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE); - search_menu->get_popup()->add_separator(); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); search_menu->get_popup()->connect("id_pressed", this, "_menu_option"); - bookmarks_menu = memnew(MenuButton); - bookmarks_menu->set_text(TTR("Bookmarks")); - bookmarks_menu->set_switch_on_hover(true); + MenuButton *goto_menu = memnew(MenuButton); + goto_menu->set_text(TTR("Go To")); + goto_menu->set_switch_on_hover(true); + goto_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + + goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); + goto_menu->get_popup()->add_separator(); + + bookmarks_menu = memnew(PopupMenu); + bookmarks_menu->set_name("Bookmarks"); + goto_menu->get_popup()->add_child(bookmarks_menu); + goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks"); _update_bookmark_list(); bookmarks_menu->connect("about_to_show", this, "_update_bookmark_list"); - bookmarks_menu->get_popup()->connect("index_pressed", this, "_bookmark_item_pressed"); + bookmarks_menu->connect("index_pressed", this, "_bookmark_item_pressed"); + + help_menu = memnew(MenuButton); + help_menu->set_text(TTR("Help")); + help_menu->set_switch_on_hover(true); + help_menu->get_popup()->add_icon_item(p_node->get_gui_base()->get_icon("Instance", "EditorIcons"), TTR("Online Docs"), HELP_DOCS); + help_menu->get_popup()->connect("id_pressed", this, "_menu_option"); add_child(main_container); main_container->add_child(hbc); hbc->add_child(search_menu); hbc->add_child(edit_menu); - hbc->add_child(bookmarks_menu); + hbc->add_child(goto_menu); + hbc->add_child(help_menu); hbc->add_style_override("panel", p_node->get_gui_base()->get_stylebox("ScriptEditorPanel", "EditorStyles")); main_container->add_child(shader_editor); diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h index 8e55a1ad70..8d3f4d4fe8 100644 --- a/editor/plugins/shader_editor_plugin.h +++ b/editor/plugins/shader_editor_plugin.h @@ -94,13 +94,13 @@ class ShaderEditor : public PanelContainer { BOOKMARK_GOTO_NEXT, BOOKMARK_GOTO_PREV, BOOKMARK_REMOVE_ALL, - + HELP_DOCS, }; MenuButton *edit_menu; MenuButton *search_menu; - MenuButton *bookmarks_menu; - MenuButton *settings_menu; + PopupMenu *bookmarks_menu; + MenuButton *help_menu; PopupMenu *context_menu; uint64_t idle; diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 9fd694ee0d..2eb3ce1ec3 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -69,7 +69,7 @@ #define FREELOOK_SPEED_MULTIPLIER 1.08 #define MIN_Z 0.01 -#define MAX_Z 10000 +#define MAX_Z 1000000.0 #define MIN_FOV 0.01 #define MAX_FOV 179 @@ -250,15 +250,7 @@ Vector3 SpatialEditorViewport::_get_ray(const Vector2 &p_pos) const { return camera->project_ray_normal(p_pos / viewport_container->get_stretch_shrink()); } -/* -void SpatialEditorViewport::_clear_id(Spatial *p_node) { - - editor_selection->remove_node(p_node); - - -} -*/ void SpatialEditorViewport::_clear_selected() { editor_selection->clear(); @@ -283,7 +275,8 @@ void SpatialEditorViewport::_select_clicked(bool p_append, bool p_single) { node = node->get_parent(); } - _select(selected, clicked_wants_append, true); + if (!_is_node_locked(selected)) + _select(selected, clicked_wants_append, true); } void SpatialEditorViewport::_select(Node *p_node, bool p_append, bool p_single) { @@ -513,7 +506,7 @@ void SpatialEditorViewport::_select_region() { for (int i = 0; i < instances.size(); i++) { Spatial *sp = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i])); - if (!sp) + if (!sp || _is_node_locked(sp)) continue; Node *item = Object::cast_to<Node>(sp); @@ -536,6 +529,8 @@ void SpatialEditorViewport::_select_region() { if (selected.find(item) != -1) continue; + if (_is_node_locked(Object::cast_to<Spatial>(item))) continue; + Ref<EditorSpatialGizmo> seg = sp->get_gizmo(); if (!seg.is_valid()) @@ -642,7 +637,7 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig Vector3 r; - if (Geometry::segment_intersects_sphere(ray_pos, ray_pos + ray * 10000.0, grabber_pos, grabber_radius, &r)) { + if (Geometry::segment_intersects_sphere(ray_pos, ray_pos + ray * MAX_Z, grabber_pos, grabber_radius, &r)) { float d = r.distance_to(ray_pos); if (d < col_d) { col_d = d; @@ -750,7 +745,7 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig Vector3 r; - if (Geometry::segment_intersects_sphere(ray_pos, ray_pos + ray * 10000.0, grabber_pos, grabber_radius, &r)) { + if (Geometry::segment_intersects_sphere(ray_pos, ray_pos + ray * MAX_Z, grabber_pos, grabber_radius, &r)) { float d = r.distance_to(ray_pos); if (d < col_d) { col_d = d; @@ -833,7 +828,9 @@ void SpatialEditorViewport::_surface_focus_exit() { view_menu->set_disable_shortcuts(true); } - +bool SpatialEditorViewport ::_is_node_locked(const Node *p_node) { + return p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_"); +} void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->get_shift()); @@ -1286,6 +1283,8 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Vector3 ray_pos = _get_ray_pos(m->get_position()); Vector3 ray = _get_ray(m->get_position()); + float snap = EDITOR_GET("interface/inspector/default_float_step"); + int snap_step_decimals = Math::range_step_decimals(snap); switch (_edit.mode) { @@ -1367,18 +1366,14 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { // Disable local transformation for TRANSFORM_VIEW bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); - float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { - snap = spatial_editor->get_scale_snap() / 100; - - Vector3 motion_snapped = motion; - motion_snapped.snap(Vector3(snap, snap, snap)); - set_message(TTR("Scaling: ") + motion_snapped); - - } else { - set_message(TTR("Scaling: ") + motion); } + Vector3 motion_snapped = motion; + motion_snapped.snap(Vector3(snap, snap, snap)); + // This might not be necessary anymore after issue #288 is solved (in 4.0?). + set_message(TTR("Scaling: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " + + String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -1497,17 +1492,13 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { // Disable local transformation for TRANSFORM_VIEW bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); - float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { - snap = spatial_editor->get_translate_snap(); - - Vector3 motion_snapped = motion; - motion_snapped.snap(Vector3(snap, snap, snap)); - set_message(TTR("Translating: ") + motion_snapped); - } else { - set_message(TTR("Translating: ") + motion); } + Vector3 motion_snapped = motion; + motion_snapped.snap(Vector3(snap, snap, snap)); + set_message(TTR("Translating: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " + + String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -1596,20 +1587,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { float angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center)); if (_edit.snap || spatial_editor->is_snap_enabled()) { - - float snap = spatial_editor->get_rotate_snap(); - - if (snap) { - angle = Math::rad2deg(angle) + snap * 0.5; //else it won't reach +180 - angle -= Math::fmod(angle, snap); - set_message(vformat(TTR("Rotating %s degrees."), rtos(angle))); - angle = Math::deg2rad(angle); - } else - set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle)))); - - } else { - set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle)))); + snap = spatial_editor->get_rotate_snap(); } + angle = Math::rad2deg(angle) + snap * 0.5; //else it won't reach +180 + angle -= Math::fmod(angle, snap); + set_message(vformat(TTR("Rotating %s degrees."), String::num(angle, snap_step_decimals))); + angle = Math::deg2rad(angle); List<Node *> &selection = editor_selection->get_selected_node_list(); @@ -1830,8 +1813,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { _menu_option(orthogonal ? VIEW_PERSPECTIVE : VIEW_ORTHOGONAL); _update_name(); } - if (ED_IS_SHORTCUT("spatial_editor/align_selection_with_view", p_event)) { - _menu_option(VIEW_ALIGN_SELECTION_WITH_VIEW); + if (ED_IS_SHORTCUT("spatial_editor/align_transform_with_view", p_event)) { + _menu_option(VIEW_ALIGN_TRANSFORM_WITH_VIEW); + } + if (ED_IS_SHORTCUT("spatial_editor/align_rotation_with_view", p_event)) { + _menu_option(VIEW_ALIGN_ROTATION_WITH_VIEW); } if (ED_IS_SHORTCUT("spatial_editor/insert_anim_key", p_event)) { if (!get_selected_count() || _edit.mode != TRANSFORM_NONE) @@ -2387,16 +2373,22 @@ void SpatialEditorViewport::_draw() { get_stylebox("Focus", "EditorStyles")->draw(surface->get_canvas_item(), r); } - RID ci = surface->get_canvas_item(); - if (cursor.region_select) { + const Rect2 selection_rect = Rect2(cursor.region_begin, cursor.region_end - cursor.region_begin); - VisualServer::get_singleton()->canvas_item_add_rect( - ci, - Rect2(cursor.region_begin, cursor.region_end - cursor.region_begin), - get_color("accent_color", "Editor") * Color(1, 1, 1, 0.375)); + surface->draw_rect( + selection_rect, + get_color("box_selection_fill_color", "Editor")); + + surface->draw_rect( + selection_rect, + get_color("box_selection_stroke_color", "Editor"), + false, + Math::round(EDSCALE)); } + RID ci = surface->get_canvas_item(); + if (message_time > 0) { Ref<Font> font = get_font("font", "Label"); Point2 msgpos = Point2(5, get_size().y - 20); @@ -2557,7 +2549,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { focus_selection(); } break; - case VIEW_ALIGN_SELECTION_WITH_VIEW: { + case VIEW_ALIGN_TRANSFORM_WITH_VIEW: { if (!get_selected_count()) break; @@ -2566,7 +2558,8 @@ void SpatialEditorViewport::_menu_option(int p_option) { List<Node *> &selection = editor_selection->get_selected_node_list(); - undo_redo->create_action(TTR("Align with View")); + undo_redo->create_action(TTR("Align Transform with View")); + for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { Spatial *sp = Object::cast_to<Spatial>(E->get()); @@ -2590,6 +2583,34 @@ void SpatialEditorViewport::_menu_option(int p_option) { undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_gizmo_transform()); } undo_redo->commit_action(); + focus_selection(); + + } break; + case VIEW_ALIGN_ROTATION_WITH_VIEW: { + + if (!get_selected_count()) + break; + + Transform camera_transform = camera->get_global_transform(); + + List<Node *> &selection = editor_selection->get_selected_node_list(); + + undo_redo->create_action(TTR("Align Rotation with View")); + for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { + + Spatial *sp = Object::cast_to<Spatial>(E->get()); + if (!sp) + continue; + + SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + if (!se) + continue; + + undo_redo->add_do_method(sp, "set_rotation", camera_transform.basis.get_rotation()); + undo_redo->add_undo_method(sp, "set_rotation", sp->get_rotation()); + } + undo_redo->commit_action(); + } break; case VIEW_ENVIRONMENT: { @@ -2907,8 +2928,14 @@ void SpatialEditorViewport::update_transform_gizmo_view() { if (dd == 0) dd = 0.0001; - float gsize = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size"); - gizmo_scale = (gsize / Math::abs(dd)) * MAX(1, EDSCALE) / viewport_container->get_stretch_shrink(); + float gizmo_size = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size"); + // At low viewport heights, multiply the gizmo scale based on the viewport height. + // This prevents the gizmo from growing very large and going outside the viewport. + const int viewport_base_height = 400 * MAX(1, EDSCALE); + gizmo_scale = + (gizmo_size / Math::abs(dd)) * MAX(1, EDSCALE) * + MIN(viewport_base_height, viewport_container->get_size().height) / viewport_base_height / + viewport_container->get_stretch_shrink(); Vector3 scale = Vector3(1, 1, 1) * gizmo_scale; xform.basis.scale(scale); @@ -3530,7 +3557,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_half_resolution", TTR("Half Resolution")), VIEW_HALF_RESOLUTION); view_menu->get_popup()->add_separator(); view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_audio_listener", TTR("Audio Listener")), VIEW_AUDIO_LISTENER); - view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_audio_doppler", TTR("Doppler Enable")), VIEW_AUDIO_DOPPLER); + view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_audio_doppler", TTR("Enable Doppler")), VIEW_AUDIO_DOPPLER); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_GIZMOS), true); view_menu->get_popup()->add_separator(); @@ -3539,7 +3566,8 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->get_popup()->add_separator(); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_origin"), VIEW_CENTER_TO_ORIGIN); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_selection"), VIEW_CENTER_TO_SELECTION); - view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_selection_with_view"), VIEW_ALIGN_SELECTION_WITH_VIEW); + view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_transform_with_view"), VIEW_ALIGN_TRANSFORM_WITH_VIEW); + view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_rotation_with_view"), VIEW_ALIGN_ROTATION_WITH_VIEW); view_menu->get_popup()->connect("id_pressed", this, "_menu_option"); view_menu->set_disable_shortcuts(true); @@ -3977,11 +4005,11 @@ void SpatialEditor::select_gizmo_highlight_axis(int p_axis) { for (int i = 0; i < 3; i++) { - move_gizmo[i]->surface_set_material(0, i == p_axis ? gizmo_hl : gizmo_color[i]); - move_plane_gizmo[i]->surface_set_material(0, (i + 6) == p_axis ? gizmo_hl : plane_gizmo_color[i]); - rotate_gizmo[i]->surface_set_material(0, (i + 3) == p_axis ? gizmo_hl : gizmo_color[i]); - scale_gizmo[i]->surface_set_material(0, (i + 9) == p_axis ? gizmo_hl : gizmo_color[i]); - scale_plane_gizmo[i]->surface_set_material(0, (i + 12) == p_axis ? gizmo_hl : plane_gizmo_color[i]); + move_gizmo[i]->surface_set_material(0, i == p_axis ? gizmo_color_hl[i] : gizmo_color[i]); + move_plane_gizmo[i]->surface_set_material(0, (i + 6) == p_axis ? plane_gizmo_color_hl[i] : plane_gizmo_color[i]); + rotate_gizmo[i]->surface_set_material(0, (i + 3) == p_axis ? gizmo_color_hl[i] : gizmo_color[i]); + scale_gizmo[i]->surface_set_material(0, (i + 9) == p_axis ? gizmo_color_hl[i] : gizmo_color[i]); + scale_plane_gizmo[i]->surface_set_material(0, (i + 12) == p_axis ? plane_gizmo_color_hl[i] : plane_gizmo_color[i]); } } @@ -4060,6 +4088,23 @@ Object *SpatialEditor::_get_editor_data(Object *p_what) { return si; } +Color SpatialEditor::_get_axis_color(int axis) { + + switch (axis) { + case 0: + // X axis + return Color(0.96, 0.20, 0.32); + case 1: + // Y axis + return Color(0.53, 0.84, 0.01); + case 2: + // Z axis + return Color(0.16, 0.55, 0.96); + default: + return Color(0, 0, 0); + } +} + void SpatialEditor::_generate_selection_box() { AABB aabb(Vector3(), Vector3(1, 1, 1)); @@ -4073,11 +4118,6 @@ void SpatialEditor::_generate_selection_box() { Vector3 a, b; aabb.get_edge(i, a, b); - /*Vector<Vector3> points; - Vector<Color> colors; - points.push_back(a); - points.push_back(b);*/ - st->add_color(Color(1.0, 1.0, 0.8, 0.8)); st->add_vertex(a); st->add_color(Color(1.0, 1.0, 0.8, 0.4)); @@ -4616,12 +4656,13 @@ void SpatialEditor::_init_indicators() { for (int i = 0; i < 3; i++) { Vector3 axis; axis[i] = 1; + Color origin_color = _get_axis_color(i); grid_enable[i] = false; grid_visible[i] = false; - origin_colors.push_back(Color(axis.x, axis.y, axis.z)); - origin_colors.push_back(Color(axis.x, axis.y, axis.z)); + origin_colors.push_back(origin_color); + origin_colors.push_back(origin_color); origin_points.push_back(axis * 4096); origin_points.push_back(axis * -4096); } @@ -4650,17 +4691,11 @@ void SpatialEditor::_init_indicators() { //move gizmo - float gizmo_alph = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_opacity"); - - gizmo_hl = Ref<SpatialMaterial>(memnew(SpatialMaterial)); - gizmo_hl->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - gizmo_hl->set_on_top_of_alpha(); - gizmo_hl->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); - gizmo_hl->set_albedo(Color(1, 1, 1, gizmo_alph + 0.2f)); - gizmo_hl->set_cull_mode(SpatialMaterial::CULL_DISABLED); - for (int i = 0; i < 3; i++) { + Color col = _get_axis_color(i); + col.a = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_opacity"); + move_gizmo[i] = Ref<ArrayMesh>(memnew(ArrayMesh)); move_plane_gizmo[i] = Ref<ArrayMesh>(memnew(ArrayMesh)); rotate_gizmo[i] = Ref<ArrayMesh>(memnew(ArrayMesh)); @@ -4671,13 +4706,13 @@ void SpatialEditor::_init_indicators() { mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); mat->set_on_top_of_alpha(); mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); - Color col; - col[i] = 1.0; - col.a = gizmo_alph; mat->set_albedo(col); - gizmo_color[i] = mat; + Ref<SpatialMaterial> mat_hl = mat->duplicate(); + mat_hl->set_albedo(Color(col.r, col.g, col.b, 1.0)); + gizmo_color_hl[i] = mat_hl; + Vector3 ivec; ivec[i] = 1; Vector3 nivec; @@ -4767,13 +4802,14 @@ void SpatialEditor::_init_indicators() { plane_mat->set_on_top_of_alpha(); plane_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); plane_mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); - Color col2; - col2[i] = 1.0; - col2.a = gizmo_alph; - plane_mat->set_albedo(col2); + plane_mat->set_albedo(col); plane_gizmo_color[i] = plane_mat; // needed, so we can draw planes from both sides surftool->set_material(plane_mat); surftool->commit(move_plane_gizmo[i]); + + Ref<SpatialMaterial> plane_mat_hl = plane_mat->duplicate(); + plane_mat_hl->set_albedo(Color(col.r, col.g, col.b, 1.0)); + plane_gizmo_color_hl[i] = plane_mat_hl; // needed, so we can draw planes from both sides } // Rotate @@ -4896,13 +4932,14 @@ void SpatialEditor::_init_indicators() { plane_mat->set_on_top_of_alpha(); plane_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); plane_mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); - Color col2; - col2[i] = 1.0; - col2.a = gizmo_alph; - plane_mat->set_albedo(col2); + plane_mat->set_albedo(col); plane_gizmo_color[i] = plane_mat; // needed, so we can draw planes from both sides surftool->set_material(plane_mat); surftool->commit(scale_plane_gizmo[i]); + + Ref<SpatialMaterial> plane_mat_hl = plane_mat->duplicate(); + plane_mat_hl->set_albedo(Color(col.r, col.g, col.b, 1.0)); + plane_gizmo_color_hl[i] = plane_mat_hl; // needed, so we can draw planes from both sides } } } @@ -5139,7 +5176,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() { // We add a bit of margin to the from position to avoid it from snapping // when the spatial is already on a floor and there's another floor under // it - from = from + Vector3(0.0, 0.1, 0.0); + from = from + Vector3(0.0, 0.2, 0.0); Dictionary d; @@ -5154,31 +5191,56 @@ void SpatialEditor::snap_selected_nodes_to_floor() { Array keys = snap_data.keys(); - if (keys.size()) { - undo_redo->create_action(TTR("Snap Nodes To Floor")); + // The maximum height an object can travel to be snapped + const float max_snap_height = 20.0; + // Will be set to `true` if at least one node from the selection was sucessfully snapped + bool snapped_to_floor = false; + + if (keys.size()) { + // For snapping to be performed, there must be solid geometry under at least one of the selected nodes. + // We need to check this before snapping to register the undo/redo action only if needed. for (int i = 0; i < keys.size(); i++) { Node *node = keys[i]; Spatial *sp = Object::cast_to<Spatial>(node); - Dictionary d = snap_data[node]; Vector3 from = d["from"]; - Vector3 position_offset = d["position_offset"]; - - Vector3 to = from - Vector3(0.0, 10.0, 0.0); + Vector3 to = from - Vector3(0.0, max_snap_height, 0.0); Set<RID> excluded = _get_physics_bodies_rid(sp); if (ss->intersect_ray(from, to, result, excluded)) { - Transform new_transform = sp->get_global_transform(); - new_transform.origin.y = result.position.y; - new_transform.origin = new_transform.origin - position_offset; - - undo_redo->add_do_method(sp, "set_global_transform", new_transform); - undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_transform()); + snapped_to_floor = true; } } - undo_redo->commit_action(); + if (snapped_to_floor) { + undo_redo->create_action(TTR("Snap Nodes To Floor")); + + // Perform snapping if at least one node can be snapped + for (int i = 0; i < keys.size(); i++) { + Node *node = keys[i]; + Spatial *sp = Object::cast_to<Spatial>(node); + Dictionary d = snap_data[node]; + Vector3 from = d["from"]; + Vector3 to = from - Vector3(0.0, max_snap_height, 0.0); + Set<RID> excluded = _get_physics_bodies_rid(sp); + + if (ss->intersect_ray(from, to, result, excluded)) { + Vector3 position_offset = d["position_offset"]; + Transform new_transform = sp->get_global_transform(); + + new_transform.origin.y = result.position.y; + new_transform.origin = new_transform.origin - position_offset; + + undo_redo->add_do_method(sp, "set_global_transform", new_transform); + undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_transform()); + } + } + + undo_redo->commit_action(); + } else { + EditorNode::get_singleton()->show_warning(TTR("Couldn't find a solid floor to snap the selection to.")); + } } } @@ -5188,42 +5250,6 @@ void SpatialEditor::_unhandled_key_input(Ref<InputEvent> p_event) { return; snap_key_enabled = Input::get_singleton()->is_key_pressed(KEY_CONTROL); - - Ref<InputEventKey> k = p_event; - - if (k.is_valid()) { - - // Note: need to check is_echo because first person movement keys might still be held - if (!is_any_freelook_active() && !p_event->is_echo()) { - - if (!k->is_pressed()) - return; - - if (ED_IS_SHORTCUT("spatial_editor/tool_select", p_event)) { - _menu_item_pressed(MENU_TOOL_SELECT); - } else if (ED_IS_SHORTCUT("spatial_editor/tool_move", p_event)) { - _menu_item_pressed(MENU_TOOL_MOVE); - } else if (ED_IS_SHORTCUT("spatial_editor/tool_rotate", p_event)) { - _menu_item_pressed(MENU_TOOL_ROTATE); - } else if (ED_IS_SHORTCUT("spatial_editor/tool_scale", p_event)) { - _menu_item_pressed(MENU_TOOL_SCALE); - } else if (ED_IS_SHORTCUT("spatial_editor/snap_to_floor", p_event)) { - snap_selected_nodes_to_floor(); - } else if (ED_IS_SHORTCUT("spatial_editor/local_coords", p_event)) { - if (are_local_coords_enabled()) { - _menu_item_toggled(false, MENU_TOOL_LOCAL_COORDS); - } else { - _menu_item_toggled(true, MENU_TOOL_LOCAL_COORDS); - } - } else if (ED_IS_SHORTCUT("spatial_editor/snap", p_event)) { - if (is_snap_enabled()) { - _menu_item_toggled(false, MENU_TOOL_USE_SNAP); - } else { - _menu_item_toggled(true, MENU_TOOL_USE_SNAP); - } - } - } - } } void SpatialEditor::_notification(int p_what) { @@ -5407,6 +5433,7 @@ void SpatialEditor::_register_all_gizmos() { add_gizmo_plugin(Ref<VehicleWheelSpatialGizmoPlugin>(memnew(VehicleWheelSpatialGizmoPlugin))); add_gizmo_plugin(Ref<VisibilityNotifierGizmoPlugin>(memnew(VisibilityNotifierGizmoPlugin))); add_gizmo_plugin(Ref<ParticlesGizmoPlugin>(memnew(ParticlesGizmoPlugin))); + add_gizmo_plugin(Ref<CPUParticlesGizmoPlugin>(memnew(CPUParticlesGizmoPlugin))); add_gizmo_plugin(Ref<ReflectionProbeGizmoPlugin>(memnew(ReflectionProbeGizmoPlugin))); add_gizmo_plugin(Ref<GIProbeGizmoPlugin>(memnew(GIProbeGizmoPlugin))); add_gizmo_plugin(Ref<BakedIndirectLightGizmoPlugin>(memnew(BakedIndirectLightGizmoPlugin))); @@ -5496,7 +5523,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_SELECT]->set_pressed(true); button_binds.write[0] = MENU_TOOL_SELECT; tool_button[TOOL_MODE_SELECT]->connect("pressed", this, "_menu_item_pressed", button_binds); - tool_button[TOOL_MODE_SELECT]->set_tooltip(TTR("Select Mode (Q)") + "\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection")); + tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), KEY_Q)); + tool_button[TOOL_MODE_SELECT]->set_tooltip(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection")); hbc_menu->add_child(memnew(VSeparator)); @@ -5506,7 +5534,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_MOVE]->set_flat(true); button_binds.write[0] = MENU_TOOL_MOVE; tool_button[TOOL_MODE_MOVE]->connect("pressed", this, "_menu_item_pressed", button_binds); - tool_button[TOOL_MODE_MOVE]->set_tooltip(TTR("Move Mode (W)")); + tool_button[TOOL_MODE_MOVE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_move", TTR("Move Mode"), KEY_W)); tool_button[TOOL_MODE_ROTATE] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_MODE_ROTATE]); @@ -5514,7 +5542,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_ROTATE]->set_flat(true); button_binds.write[0] = MENU_TOOL_ROTATE; tool_button[TOOL_MODE_ROTATE]->connect("pressed", this, "_menu_item_pressed", button_binds); - tool_button[TOOL_MODE_ROTATE]->set_tooltip(TTR("Rotate Mode (E)")); + tool_button[TOOL_MODE_ROTATE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Rotate Mode"), KEY_E)); tool_button[TOOL_MODE_SCALE] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_MODE_SCALE]); @@ -5522,7 +5550,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_SCALE]->set_flat(true); button_binds.write[0] = MENU_TOOL_SCALE; tool_button[TOOL_MODE_SCALE]->connect("pressed", this, "_menu_item_pressed", button_binds); - tool_button[TOOL_MODE_SCALE]->set_tooltip(TTR("Scale Mode (R)")); + tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTR("Scale Mode"), KEY_R)); hbc_menu->add_child(memnew(VSeparator)); @@ -5566,9 +5594,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_flat(true); button_binds.write[0] = MENU_TOOL_LOCAL_COORDS; tool_option_button[TOOL_OPT_LOCAL_COORDS]->connect("toggled", this, "_menu_item_toggled", button_binds); - ED_SHORTCUT("spatial_editor/local_coords", TTR("Local Coords"), KEY_T); - sct = ED_GET_SHORTCUT("spatial_editor/local_coords").ptr()->get_as_text(); - tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_tooltip(vformat(TTR("Local Space Mode (%s)"), sct)); + tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_shortcut(ED_SHORTCUT("spatial_editor/local_coords", TTR("Use Local Space"), KEY_T)); tool_option_button[TOOL_OPT_USE_SNAP] = memnew(ToolButton); hbc_menu->add_child(tool_option_button[TOOL_OPT_USE_SNAP]); @@ -5576,9 +5602,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_option_button[TOOL_OPT_USE_SNAP]->set_flat(true); button_binds.write[0] = MENU_TOOL_USE_SNAP; tool_option_button[TOOL_OPT_USE_SNAP]->connect("toggled", this, "_menu_item_toggled", button_binds); - ED_SHORTCUT("spatial_editor/snap", TTR("Snap"), KEY_Y); - sct = ED_GET_SHORTCUT("spatial_editor/snap").ptr()->get_as_text(); - tool_option_button[TOOL_OPT_USE_SNAP]->set_tooltip(vformat(TTR("Snap Mode (%s)"), sct)); + tool_option_button[TOOL_OPT_USE_SNAP]->set_shortcut(ED_SHORTCUT("spatial_editor/snap", TTR("Use Snap"), KEY_Y)); hbc_menu->add_child(memnew(VSeparator)); @@ -5596,13 +5620,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { ED_SHORTCUT("spatial_editor/insert_anim_key", TTR("Insert Animation Key"), KEY_K); ED_SHORTCUT("spatial_editor/focus_origin", TTR("Focus Origin"), KEY_O); ED_SHORTCUT("spatial_editor/focus_selection", TTR("Focus Selection"), KEY_F); - ED_SHORTCUT("spatial_editor/align_selection_with_view", TTR("Align Selection With View"), KEY_MASK_ALT + KEY_MASK_CMD + KEY_F); - - ED_SHORTCUT("spatial_editor/tool_select", TTR("Tool Select"), KEY_Q); - ED_SHORTCUT("spatial_editor/tool_move", TTR("Tool Move"), KEY_W); - ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Tool Rotate"), KEY_E); - ED_SHORTCUT("spatial_editor/tool_scale", TTR("Tool Scale"), KEY_R); - + ED_SHORTCUT("spatial_editor/align_transform_with_view", TTR("Align Transform with View"), KEY_MASK_ALT + KEY_MASK_CMD + KEY_M); + ED_SHORTCUT("spatial_editor/align_rotation_with_view", TTR("Align Rotation with View"), KEY_MASK_ALT + KEY_MASK_CMD + KEY_F); ED_SHORTCUT("spatial_editor/freelook_toggle", TTR("Toggle Freelook"), KEY_MASK_SHIFT + KEY_F); PopupMenu *p; @@ -5614,10 +5633,11 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p = transform_menu->get_popup(); p->add_shortcut(ED_SHORTCUT("spatial_editor/snap_to_floor", TTR("Snap Object to Floor"), KEY_PAGEDOWN), MENU_SNAP_TO_FLOOR); - p->add_shortcut(ED_SHORTCUT("spatial_editor/configure_snap", TTR("Configure Snap...")), MENU_TRANSFORM_CONFIGURE_SNAP); - p->add_separator(); p->add_shortcut(ED_SHORTCUT("spatial_editor/transform_dialog", TTR("Transform Dialog...")), MENU_TRANSFORM_DIALOG); + p->add_separator(); + p->add_shortcut(ED_SHORTCUT("spatial_editor/configure_snap", TTR("Configure Snap...")), MENU_TRANSFORM_CONFIGURE_SNAP); + p->connect("id_pressed", this, "_menu_item_pressed"); view_menu = memnew(MenuButton); @@ -5641,11 +5661,11 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->add_submenu_item(TTR("Gizmos"), "GizmosMenu"); p->add_separator(); - p->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_origin", TTR("View Origin")), MENU_VIEW_ORIGIN); p->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_grid", TTR("View Grid")), MENU_VIEW_GRID); + p->add_separator(); - p->add_shortcut(ED_SHORTCUT("spatial_editor/settings", TTR("Settings")), MENU_VIEW_CAMERA_SETTINGS); + p->add_shortcut(ED_SHORTCUT("spatial_editor/settings", TTR("Settings...")), MENU_VIEW_CAMERA_SETTINGS); p->set_item_checked(p->get_item_index(MENU_VIEW_ORIGIN), true); p->set_item_checked(p->get_item_index(MENU_VIEW_GRID), true); @@ -5799,7 +5819,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { EDITOR_DEF("editors/3d/manipulator_gizmo_size", 80); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/3d/manipulator_gizmo_size", PROPERTY_HINT_RANGE, "16,1024,1")); - EDITOR_DEF("editors/3d/manipulator_gizmo_opacity", 0.2); + EDITOR_DEF("editors/3d/manipulator_gizmo_opacity", 0.4); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::REAL, "editors/3d/manipulator_gizmo_opacity", PROPERTY_HINT_RANGE, "0,1,0.01")); over_gizmo_handle = -1; } diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index b4e2f028d2..728b67f6fa 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -37,9 +37,6 @@ #include "scene/3d/light.h" #include "scene/3d/visual_instance.h" #include "scene/gui/panel_container.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Camera; class SpatialEditor; @@ -153,7 +150,8 @@ class SpatialEditorViewport : public Control { VIEW_REAR, VIEW_CENTER_TO_ORIGIN, VIEW_CENTER_TO_SELECTION, - VIEW_ALIGN_SELECTION_WITH_VIEW, + VIEW_ALIGN_TRANSFORM_WITH_VIEW, + VIEW_ALIGN_ROTATION_WITH_VIEW, VIEW_PERSPECTIVE, VIEW_ENVIRONMENT, VIEW_ORTHOGONAL, @@ -364,7 +362,7 @@ private: Camera *preview; bool previewing_cinema; - + bool _is_node_locked(const Node *p_node); void _preview_exited_scene(); void _toggle_camera_preview(bool); void _toggle_cinema_preview(bool); @@ -527,7 +525,8 @@ private: Ref<ArrayMesh> move_gizmo[3], move_plane_gizmo[3], rotate_gizmo[3], scale_gizmo[3], scale_plane_gizmo[3]; Ref<SpatialMaterial> gizmo_color[3]; Ref<SpatialMaterial> plane_gizmo_color[3]; - Ref<SpatialMaterial> gizmo_hl; + Ref<SpatialMaterial> gizmo_color_hl[3]; + Ref<SpatialMaterial> plane_gizmo_color_hl[3]; int over_gizmo_handle; @@ -634,6 +633,7 @@ private: Node *custom_camera; Object *_get_editor_data(Object *p_what); + Color _get_axis_color(int axis); Ref<Environment> viewport_environment; diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index fae88f4eb7..89e419ede8 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -221,19 +221,19 @@ void TextEditor::_validate_script() { void TextEditor::_update_bookmark_list() { - bookmarks_menu->get_popup()->clear(); + bookmarks_menu->clear(); - bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_bookmark"), BOOKMARK_TOGGLE); - bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_bookmarks"), BOOKMARK_REMOVE_ALL); - bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT); - bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV); + bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_bookmark"), BOOKMARK_TOGGLE); + bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_bookmarks"), BOOKMARK_REMOVE_ALL); + bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT); + bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV); Array bookmark_list = code_editor->get_text_edit()->get_bookmarks_array(); if (bookmark_list.size() == 0) { return; } - bookmarks_menu->get_popup()->add_separator(); + bookmarks_menu->add_separator(); for (int i = 0; i < bookmark_list.size(); i++) { String line = code_editor->get_text_edit()->get_line(bookmark_list[i]).strip_edges(); @@ -242,17 +242,17 @@ void TextEditor::_update_bookmark_list() { line = line.substr(0, 50); } - bookmarks_menu->get_popup()->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\""); - bookmarks_menu->get_popup()->set_item_metadata(bookmarks_menu->get_popup()->get_item_count() - 1, bookmark_list[i]); + bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\""); + bookmarks_menu->set_item_metadata(bookmarks_menu->get_item_count() - 1, bookmark_list[i]); } } void TextEditor::_bookmark_item_pressed(int p_idx) { if (p_idx < 4) { // Any item before the separator. - _edit_option(bookmarks_menu->get_popup()->get_item_id(p_idx)); + _edit_option(bookmarks_menu->get_item_id(p_idx)); } else { - code_editor->goto_line(bookmarks_menu->get_popup()->get_item_metadata(p_idx)); + code_editor->goto_line(bookmarks_menu->get_item_metadata(p_idx)); } } @@ -313,6 +313,11 @@ void TextEditor::goto_line(int p_line, bool p_with_error) { code_editor->goto_line(p_line); } +void TextEditor::goto_line_selection(int p_line, int p_begin, int p_end) { + + code_editor->goto_line_selection(p_line, p_begin, p_end); +} + void TextEditor::set_executing_line(int p_line) { code_editor->set_executing_line(p_line); @@ -477,6 +482,14 @@ void TextEditor::_edit_option(int p_op) { code_editor->get_find_replace_bar()->popup_replace(); } break; + case SEARCH_IN_FILES: { + + String selected_text = code_editor->get_text_edit()->get_selection_text(); + + // Yep, because it doesn't make sense to instance this dialog for every single script open... + // So this will be delegated to the ScriptEditor. + emit_signal("search_in_files_requested", selected_text); + } break; case SEARCH_GOTO_LINE: { goto_line_dialog->popup_find_line(tx); @@ -553,7 +566,7 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { int to_column = tx->get_selection_to_column(); if (row < from_line || row > to_line || (row == from_line && col < from_column) || (row == to_line && col > to_column)) { - // Right click is outside the selected text + // Right click is outside the selected text. tx->deselect(); } } @@ -632,17 +645,14 @@ TextEditor::TextEditor() { search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE); search_menu->get_popup()->add_separator(); - search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); - - goto_line_dialog = memnew(GotoLineDialog); - add_child(goto_line_dialog); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_in_files"), SEARCH_IN_FILES); edit_menu = memnew(MenuButton); + edit_hb->add_child(edit_menu); edit_menu->set_text(TTR("Edit")); edit_menu->set_switch_on_hover(true); edit_menu->get_popup()->connect("id_pressed", this, "_edit_option"); - edit_hb->add_child(edit_menu); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); edit_menu->get_popup()->add_separator(); @@ -684,16 +694,37 @@ TextEditor::TextEditor() { highlighter_menu->add_radio_check_item(TTR("Standard")); highlighter_menu->connect("id_pressed", this, "_change_syntax_highlighter"); - bookmarks_menu = memnew(MenuButton); - edit_hb->add_child(bookmarks_menu); - bookmarks_menu->set_text(TTR("Bookmarks")); - bookmarks_menu->set_switch_on_hover(true); + MenuButton *goto_menu = memnew(MenuButton); + edit_hb->add_child(goto_menu); + goto_menu->set_text(TTR("Go To")); + goto_menu->set_switch_on_hover(true); + goto_menu->get_popup()->connect("id_pressed", this, "_edit_option"); + + goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); + goto_menu->get_popup()->add_separator(); + + bookmarks_menu = memnew(PopupMenu); + bookmarks_menu->set_name(TTR("Bookmarks")); + goto_menu->get_popup()->add_child(bookmarks_menu); + goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks"); _update_bookmark_list(); bookmarks_menu->connect("about_to_show", this, "_update_bookmark_list"); - bookmarks_menu->get_popup()->connect("index_pressed", this, "_bookmark_item_pressed"); + bookmarks_menu->connect("index_pressed", this, "_bookmark_item_pressed"); + + goto_line_dialog = memnew(GotoLineDialog); + add_child(goto_line_dialog); code_editor->get_text_edit()->set_drag_forwarding(this); } +TextEditor::~TextEditor() { + for (const Map<String, SyntaxHighlighter *>::Element *E = highlighters.front(); E; E = E->next()) { + if (E->get() != NULL) { + memdelete(E->get()); + } + } + highlighters.clear(); +} + void TextEditor::validate() { } diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h index ae0c0bcf93..c8b49a61e0 100644 --- a/editor/plugins/text_editor.h +++ b/editor/plugins/text_editor.h @@ -46,7 +46,7 @@ private: MenuButton *edit_menu; PopupMenu *highlighter_menu; MenuButton *search_menu; - MenuButton *bookmarks_menu; + PopupMenu *bookmarks_menu; PopupMenu *context_menu; GotoLineDialog *goto_line_dialog; @@ -87,6 +87,7 @@ private: SEARCH_FIND_NEXT, SEARCH_FIND_PREV, SEARCH_REPLACE, + SEARCH_IN_FILES, SEARCH_GOTO_LINE, BOOKMARK_TOGGLE, BOOKMARK_GOTO_NEXT, @@ -131,6 +132,7 @@ public: virtual Vector<String> get_functions(); virtual void get_breakpoints(List<int> *p_breakpoints); virtual void goto_line(int p_line, bool p_with_error = false); + void goto_line_selection(int p_line, int p_begin, int p_end); virtual void set_executing_line(int p_line); virtual void clear_executing_line(); virtual void trim_trailing_whitespace(); @@ -154,6 +156,7 @@ public: static void register_editor(); TextEditor(); + ~TextEditor(); }; #endif // TEXT_EDITOR_H diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 0aa4a7662c..6d71c56ead 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -39,9 +39,6 @@ void TextureEditor::_gui_input(Ref<InputEvent> p_event) { void TextureEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 8f58fbd6ab..4d349f06b7 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -193,7 +193,7 @@ void TextureRegionEditor::_region_draw() { updating_scroll = false; if (node_ninepatch || obj_styleBox.is_valid()) { - float margins[4]; + float margins[4] = { 0 }; if (node_ninepatch) { margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); @@ -204,12 +204,8 @@ void TextureRegionEditor::_region_draw() { margins[1] = obj_styleBox->get_margin_size(MARGIN_BOTTOM); margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT); margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT); - } else { - margins[0] = 0; - margins[1] = 0; - margins[2] = 0; - margins[3] = 0; } + Vector2 pos[4] = { mtx.basis_xform(Vector2(0, margins[0])) + Vector2(0, endpoints[0].y - draw_ofs.y * draw_zoom), -mtx.basis_xform(Vector2(0, margins[1])) + Vector2(0, endpoints[2].y - draw_ofs.y * draw_zoom), @@ -248,7 +244,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (mb->is_pressed()) { if (node_ninepatch || obj_styleBox.is_valid()) { edited_margin = -1; - float margins[4]; + float margins[4] = { 0 }; if (node_ninepatch) { margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); @@ -260,6 +256,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT); margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT); } + Vector2 pos[4] = { mtx.basis_xform(rect.position + Vector2(0, margins[0])) - draw_ofs * draw_zoom, mtx.basis_xform(rect.position + rect.size - Vector2(0, margins[1])) - draw_ofs * draw_zoom, @@ -1021,15 +1018,21 @@ bool TextureRegionEditorPlugin::handles(Object *p_object) const { return p_object->is_class("Sprite") || p_object->is_class("Sprite3D") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture"); } +void TextureRegionEditorPlugin::_editor_visiblity_changed() { + manually_hidden = !region_editor->is_visible_in_tree(); +} + void TextureRegionEditorPlugin::make_visible(bool p_visible) { if (p_visible) { texture_region_button->show(); - if (region_editor->is_stylebox() || region_editor->is_atlas_texture() || region_editor->is_ninepatch() || (region_editor->get_sprite() && region_editor->get_sprite()->is_region()) || (region_editor->get_sprite_3d() && region_editor->get_sprite_3d()->is_region()) || texture_region_button->is_pressed()) { + bool is_node_configured = region_editor->is_stylebox() || region_editor->is_atlas_texture() || region_editor->is_ninepatch() || (region_editor->get_sprite() && region_editor->get_sprite()->is_region()) || (region_editor->get_sprite_3d() && region_editor->get_sprite_3d()->is_region()); + if ((is_node_configured && !manually_hidden) || texture_region_button->is_pressed()) { editor->make_bottom_panel_item_visible(region_editor); } } else { if (region_editor->is_visible_in_tree()) { editor->hide_bottom_panel(); + manually_hidden = false; } texture_region_button->hide(); region_editor->edit(NULL); @@ -1076,12 +1079,18 @@ void TextureRegionEditorPlugin::set_state(const Dictionary &p_state) { } } +void TextureRegionEditorPlugin::_bind_methods() { + ClassDB::bind_method(D_METHOD("_editor_visiblity_changed"), &TextureRegionEditorPlugin::_editor_visiblity_changed); +} + TextureRegionEditorPlugin::TextureRegionEditorPlugin(EditorNode *p_node) { + manually_hidden = false; editor = p_node; - region_editor = memnew(TextureRegionEditor(p_node)); + region_editor = memnew(TextureRegionEditor(p_node)); region_editor->set_custom_minimum_size(Size2(0, 200) * EDSCALE); region_editor->hide(); + region_editor->connect("visibility_changed", this, "_editor_visiblity_changed"); texture_region_button = p_node->add_bottom_panel_item(TTR("TextureRegion"), region_editor); texture_region_button->hide(); diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h index a49e0fb96c..4eb84ae176 100644 --- a/editor/plugins/texture_region_editor_plugin.h +++ b/editor/plugins/texture_region_editor_plugin.h @@ -145,10 +145,16 @@ public: class TextureRegionEditorPlugin : public EditorPlugin { GDCLASS(TextureRegionEditorPlugin, EditorPlugin); + bool manually_hidden; Button *texture_region_button; TextureRegionEditor *region_editor; EditorNode *editor; +protected: + static void _bind_methods(); + + void _editor_visiblity_changed(); + public: virtual String get_name() const { return "TextureRegion"; } bool has_main_screen() const { return false; } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 5b67d259ba..3055a9382c 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -36,6 +36,7 @@ void ThemeEditor::edit(const Ref<Theme> &p_theme) { theme = p_theme; + main_panel->set_theme(p_theme); main_container->set_theme(p_theme); } @@ -53,6 +54,7 @@ void ThemeEditor::_propagate_redraw(Control *p_at) { void ThemeEditor::_refresh_interval() { + _propagate_redraw(main_panel); _propagate_redraw(main_container); } @@ -130,14 +132,14 @@ void ThemeEditor::_save_template_cbk(String fname) { Map<String, _TECategory> categories; - //fill types + // Fill types. List<StringName> type_list; Theme::get_default()->get_type_list(&type_list); for (List<StringName>::Element *E = type_list.front(); E; E = E->next()) { categories.insert(E->get(), _TECategory()); } - //fill default theme + // Fill default theme. for (Map<String, _TECategory>::Element *E = categories.front(); E; E = E->next()) { _TECategory &tc = E->get(); @@ -189,11 +191,9 @@ void ThemeEditor::_save_template_cbk(String fname) { } FileAccess *file = FileAccess::open(filename, FileAccess::WRITE); - if (!file) { - ERR_EXPLAIN(TTR("Can't save theme to file:") + " " + filename); - return; - } + ERR_FAIL_COND_MSG(!file, "Can't save theme to file: " + filename + "."); + file->store_line("; ******************* "); file->store_line("; Template Theme File "); file->store_line("; ******************* "); @@ -256,7 +256,7 @@ void ThemeEditor::_save_template_cbk(String fname) { file->store_line(""); file->store_line(""); - //write default theme + // Write default theme. for (Map<String, _TECategory>::Element *E = categories.front(); E; E = E->next()) { _TECategory &tc = E->get(); @@ -501,7 +501,7 @@ void ThemeEditor::_theme_menu_cbk(int p_option) { type_select_label->show(); type_select->show(); - if (p_option == POPUP_ADD) { //add + if (p_option == POPUP_ADD) { // Add. add_del_dialog->set_title(TTR("Add Item")); add_del_dialog->get_ok()->set_text(TTR("Add")); @@ -509,7 +509,7 @@ void ThemeEditor::_theme_menu_cbk(int p_option) { base_theme = Theme::get_default(); - } else if (p_option == POPUP_CLASS_ADD) { //add + } else if (p_option == POPUP_CLASS_ADD) { // Add. add_del_dialog->set_title(TTR("Add All Items")); add_del_dialog->get_ok()->set_text(TTR("Add All")); @@ -552,12 +552,10 @@ void ThemeEditor::_theme_menu_cbk(int p_option) { type_menu->get_popup()->clear(); - if (p_option == 0 || p_option == 1) { //add + if (p_option == 0 || p_option == 1) { // Add. List<StringName> new_types; theme->get_type_list(&new_types); - - //uh kind of sucks for (List<StringName>::Element *F = new_types.front(); F; F = F->next()) { bool found = false; @@ -583,15 +581,17 @@ void ThemeEditor::_theme_menu_cbk(int p_option) { void ThemeEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PROCESS) { - - time_left -= get_process_delta_time(); - if (time_left < 0) { - time_left = 1.5; - _refresh_interval(); - } - } else if (p_what == NOTIFICATION_THEME_CHANGED) { - theme_menu->set_icon(get_icon("Theme", "EditorIcons")); + switch (p_what) { + case NOTIFICATION_PROCESS: { + time_left -= get_process_delta_time(); + if (time_left < 0) { + time_left = 1.5; + _refresh_interval(); + } + } break; + case NOTIFICATION_THEME_CHANGED: { + theme_menu->set_icon(get_icon("Theme", "EditorIcons")); + } break; } } @@ -629,35 +629,34 @@ ThemeEditor::ThemeEditor() { top_menu->add_child(theme_menu); theme_menu->get_popup()->connect("id_pressed", this, "_theme_menu_cbk"); - scroll = memnew(ScrollContainer); + ScrollContainer *scroll = memnew(ScrollContainer); add_child(scroll); - scroll->set_theme(Theme::get_default()); scroll->set_enable_v_scroll(true); scroll->set_enable_h_scroll(false); scroll->set_v_size_flags(SIZE_EXPAND_FILL); - main_container = memnew(MarginContainer); - scroll->add_child(main_container); - main_container->set_theme(Theme::get_default()); - main_container->set_clip_contents(true); - main_container->set_custom_minimum_size(Size2(700, 0) * EDSCALE); - main_container->set_v_size_flags(SIZE_EXPAND_FILL); - main_container->set_h_size_flags(SIZE_EXPAND_FILL); + MarginContainer *root_container = memnew(MarginContainer); + scroll->add_child(root_container); + root_container->set_theme(Theme::get_default()); + root_container->set_clip_contents(true); + root_container->set_custom_minimum_size(Size2(700, 0) * EDSCALE); + root_container->set_v_size_flags(SIZE_EXPAND_FILL); + root_container->set_h_size_flags(SIZE_EXPAND_FILL); //// Preview Controls //// - Panel *panel = memnew(Panel); - main_container->add_child(panel); + main_panel = memnew(Panel); + root_container->add_child(main_panel); - MarginContainer *mc = memnew(MarginContainer); - main_container->add_child(mc); - mc->add_constant_override("margin_right", 4 * EDSCALE); - mc->add_constant_override("margin_top", 4 * EDSCALE); - mc->add_constant_override("margin_left", 4 * EDSCALE); - mc->add_constant_override("margin_bottom", 4 * EDSCALE); + main_container = memnew(MarginContainer); + root_container->add_child(main_container); + main_container->add_constant_override("margin_right", 4 * EDSCALE); + main_container->add_constant_override("margin_top", 4 * EDSCALE); + main_container->add_constant_override("margin_left", 4 * EDSCALE); + main_container->add_constant_override("margin_bottom", 4 * EDSCALE); HBoxContainer *main_hb = memnew(HBoxContainer); - mc->add_child(main_hb); + main_container->add_child(main_hb); VBoxContainer *first_vb = memnew(VBoxContainer); main_hb->add_child(first_vb); @@ -695,19 +694,19 @@ ThemeEditor::ThemeEditor() { test_menu_button->get_popup()->add_separator(); test_menu_button->get_popup()->add_check_item(TTR("Check Item")); test_menu_button->get_popup()->add_check_item(TTR("Checked Item")); - test_menu_button->get_popup()->set_item_checked(3, true); + test_menu_button->get_popup()->set_item_checked(4, true); test_menu_button->get_popup()->add_separator(); test_menu_button->get_popup()->add_radio_check_item(TTR("Radio Item")); test_menu_button->get_popup()->add_radio_check_item(TTR("Checked Radio Item")); - test_menu_button->get_popup()->set_item_checked(6, true); + test_menu_button->get_popup()->set_item_checked(7, true); test_menu_button->get_popup()->add_separator(TTR("Named Sep.")); PopupMenu *test_submenu = memnew(PopupMenu); test_menu_button->get_popup()->add_child(test_submenu); test_submenu->set_name("submenu"); test_menu_button->get_popup()->add_submenu_item(TTR("Submenu"), "submenu"); - test_submenu->add_item(TTR("Item 1")); - test_submenu->add_item(TTR("Item 2")); + test_submenu->add_item(TTR("Subitem 1")); + test_submenu->add_item(TTR("Subitem 2")); first_vb->add_child(test_menu_button); OptionButton *test_option_button = memnew(OptionButton); diff --git a/editor/plugins/theme_editor_plugin.h b/editor/plugins/theme_editor_plugin.h index cc236907a9..6ffee46569 100644 --- a/editor/plugins/theme_editor_plugin.h +++ b/editor/plugins/theme_editor_plugin.h @@ -45,7 +45,7 @@ class ThemeEditor : public VBoxContainer { GDCLASS(ThemeEditor, VBoxContainer); - ScrollContainer *scroll; + Panel *main_panel; MarginContainer *main_container; Ref<Theme> theme; diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 25e812e31c..26fae96025 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -521,7 +521,13 @@ void TileMapEditor::_update_palette() { for (const Map<Vector2, uint32_t>::Element *E = tiles2.front(); E; E = E->next()) { entries2.push_back(E->key()); } - entries2.sort(); + // Sort tiles in row-major order + struct SwapComparator { + _FORCE_INLINE_ bool operator()(const Vector2 &v_l, const Vector2 &v_r) const { + return v_l.y != v_r.y ? v_l.y < v_r.y : v_l.x < v_r.x; + } + }; + entries2.sort_custom<SwapComparator>(); Ref<Texture> tex = tileset->tile_get_texture(sel_tile); @@ -966,7 +972,7 @@ static inline Vector<Point2i> line(int x0, int x1, int y0, int y1) { bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { - if (!node || !node->get_tileset().is_valid() || !node->is_visible_in_tree()) + if (!node || !node->get_tileset().is_valid() || !node->is_visible_in_tree() || CanvasItemEditor::get_singleton()->get_current_tool() != CanvasItemEditor::TOOL_SELECT) return false; Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform(); @@ -1467,15 +1473,28 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { return true; } - if (ED_IS_SHORTCUT("tile_map_editor/mirror_x", p_event)) { - flip_h = !flip_h; - _update_palette(); + if (ED_IS_SHORTCUT("tile_map_editor/rotate_left", p_event)) { + _rotate(-1); CanvasItemEditor::get_singleton()->update_viewport(); return true; } - if (ED_IS_SHORTCUT("tile_map_editor/mirror_y", p_event)) { - flip_v = !flip_v; - _update_palette(); + if (ED_IS_SHORTCUT("tile_map_editor/rotate_right", p_event)) { + _rotate(1); + CanvasItemEditor::get_singleton()->update_viewport(); + return true; + } + if (ED_IS_SHORTCUT("tile_map_editor/flip_horizontal", p_event)) { + _flip_horizontal(); + CanvasItemEditor::get_singleton()->update_viewport(); + return true; + } + if (ED_IS_SHORTCUT("tile_map_editor/flip_vertical", p_event)) { + _flip_vertical(); + CanvasItemEditor::get_singleton()->update_viewport(); + return true; + } + if (ED_IS_SHORTCUT("tile_map_editor/clear_transform", p_event)) { + _clear_transform(); CanvasItemEditor::get_singleton()->update_viewport(); return true; } @@ -1514,7 +1533,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { void TileMapEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { - if (!node) + if (!node || CanvasItemEditor::get_singleton()->get_current_tool() != CanvasItemEditor::TOOL_SELECT) return; Transform2D cell_xf = node->get_cell_transform(); @@ -1917,8 +1936,6 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { ED_SHORTCUT("tile_map_editor/erase_selection", TTR("Erase Selection"), KEY_DELETE); ED_SHORTCUT("tile_map_editor/find_tile", TTR("Find Tile"), KEY_MASK_CMD + KEY_F); ED_SHORTCUT("tile_map_editor/transpose", TTR("Transpose"), KEY_T); - ED_SHORTCUT("tile_map_editor/mirror_x", TTR("Mirror X"), KEY_A); - ED_SHORTCUT("tile_map_editor/mirror_y", TTR("Mirror Y"), KEY_S); HBoxContainer *tool_hb = memnew(HBoxContainer); add_child(tool_hb); @@ -1989,7 +2006,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { // Tools paint_button = memnew(ToolButton); paint_button->set_shortcut(ED_SHORTCUT("tile_map_editor/paint_tile", TTR("Paint Tile"), KEY_P)); - paint_button->set_tooltip(TTR("Shift+RMB: Line Draw\nShift+Ctrl+RMB: Rectangle Paint")); + paint_button->set_tooltip(TTR("Shift+LMB: Line Draw\nShift+Ctrl+LMB: Rectangle Paint")); paint_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_NONE)); paint_button->set_toggle_mode(true); toolbar->add_child(paint_button); @@ -2044,30 +2061,35 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { rotate_left_button->set_tooltip(TTR("Rotate Left")); rotate_left_button->set_focus_mode(FOCUS_NONE); rotate_left_button->connect("pressed", this, "_rotate", varray(-1)); + rotate_left_button->set_shortcut(ED_SHORTCUT("tile_map_editor/rotate_left", TTR("Rotate Left"), KEY_A)); tool_hb->add_child(rotate_left_button); rotate_right_button = memnew(ToolButton); rotate_right_button->set_tooltip(TTR("Rotate Right")); rotate_right_button->set_focus_mode(FOCUS_NONE); rotate_right_button->connect("pressed", this, "_rotate", varray(1)); + rotate_right_button->set_shortcut(ED_SHORTCUT("tile_map_editor/rotate_right", TTR("Rotate Right"), KEY_S)); tool_hb->add_child(rotate_right_button); flip_horizontal_button = memnew(ToolButton); flip_horizontal_button->set_tooltip(TTR("Flip Horizontally")); flip_horizontal_button->set_focus_mode(FOCUS_NONE); flip_horizontal_button->connect("pressed", this, "_flip_horizontal"); + flip_horizontal_button->set_shortcut(ED_SHORTCUT("tile_map_editor/flip_horizontal", TTR("Flip Horizontally"), KEY_X)); tool_hb->add_child(flip_horizontal_button); flip_vertical_button = memnew(ToolButton); flip_vertical_button->set_tooltip(TTR("Flip Vertically")); flip_vertical_button->set_focus_mode(FOCUS_NONE); flip_vertical_button->connect("pressed", this, "_flip_vertical"); + flip_vertical_button->set_shortcut(ED_SHORTCUT("tile_map_editor/flip_vertical", TTR("Flip Vertically"), KEY_Z)); tool_hb->add_child(flip_vertical_button); clear_transform_button = memnew(ToolButton); clear_transform_button->set_tooltip(TTR("Clear Transform")); clear_transform_button->set_focus_mode(FOCUS_NONE); clear_transform_button->connect("pressed", this, "_clear_transform"); + clear_transform_button->set_shortcut(ED_SHORTCUT("tile_map_editor/clear_transform", TTR("Clear Transform"), KEY_W)); tool_hb->add_child(clear_transform_button); clear_transform_button->set_disabled(true); @@ -2114,6 +2136,7 @@ void TileMapEditorPlugin::make_visible(bool p_visible) { tile_map_editor->show(); tile_map_editor->get_toolbar()->show(); tile_map_editor->get_toolbar_right()->show(); + CanvasItemEditor::get_singleton()->set_current_tool(CanvasItemEditor::TOOL_SELECT); //Change to TOOL_SELECT when TileMap node is selected, to prevent accidental movement. } else { tile_map_editor->hide(); diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index 3331fb971f..c841eb1f98 100644 --- a/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -41,10 +41,6 @@ #include "scene/gui/menu_button.h" #include "scene/gui/tool_button.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class TileMapEditor : public VBoxContainer { GDCLASS(TileMapEditor, VBoxContainer); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index f135becf5f..c1e85788f8 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -646,8 +646,7 @@ void TileSetEditor::_on_textures_added(const PoolStringArray &p_paths) { for (int i = 0; i < p_paths.size(); i++) { Ref<Texture> t = Ref<Texture>(ResourceLoader::load(p_paths[i])); - ERR_EXPLAIN("'" + p_paths[i] + "' is not a valid texture."); - ERR_CONTINUE(!t.is_valid()); + ERR_CONTINUE_MSG(!t.is_valid(), "'" + p_paths[i] + "' is not a valid texture."); if (texture_map.has(t->get_rid())) { invalid_count++; @@ -924,8 +923,7 @@ void TileSetEditor::_on_workspace_draw() { case EDITMODE_OCCLUSION: case EDITMODE_NAVIGATION: { if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) { - Vector2 coord = edited_shape_coord; - draw_highlight_subtile(coord); + draw_highlight_subtile(edited_shape_coord); } draw_polygon_shapes(); draw_grid_snap(); @@ -1519,6 +1517,8 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { undo_redo->create_action(TTR("Edit Navigation Polygon")); undo_redo->add_do_method(edited_navigation_shape.ptr(), "set_vertices", polygon); undo_redo->add_undo_method(edited_navigation_shape.ptr(), "set_vertices", edited_navigation_shape->get_vertices()); + undo_redo->add_do_method(edited_navigation_shape.ptr(), "clear_polygons"); + undo_redo->add_undo_method(edited_navigation_shape.ptr(), "clear_polygons"); undo_redo->add_do_method(edited_navigation_shape.ptr(), "add_polygon", indices); undo_redo->add_undo_method(edited_navigation_shape.ptr(), "add_polygon", edited_navigation_shape->get_polygon(0)); undo_redo->add_do_method(this, "_select_edited_shape_coord"); @@ -1872,7 +1872,7 @@ void TileSetEditor::_update_tile_data() { } else { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; - Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); for (int y = 0; y < cell_count.y; y++) { for (int x = 0; x < cell_count.x; x++) { SubtileData data; @@ -1974,7 +1974,7 @@ void TileSetEditor::_select_previous_tile() { case EDITMODE_Z_INDEX: { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; - Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); cell_count -= Vector2(1, 1); edited_shape_coord = cell_count; _select_edited_shape_coord(); @@ -2031,7 +2031,7 @@ void TileSetEditor::_select_next_subtile() { } else { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; - Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); if (edited_shape_coord.x >= cell_count.x - 1 && edited_shape_coord.y >= cell_count.y - 1) { _select_next_tile(); } else { @@ -2057,7 +2057,7 @@ void TileSetEditor::_select_previous_subtile() { } else { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; - Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); if (edited_shape_coord.x <= 0 && edited_shape_coord.y <= 0) { _select_previous_tile(); } else { @@ -2077,9 +2077,9 @@ void TileSetEditor::_select_next_shape() { } else if (edit_mode != EDITMODE_COLLISION) { _select_next_subtile(); } else { - Vector2i edited_coord = Vector2(); + Vector2i edited_coord = Vector2i(); if (tileset->tile_get_tile_mode(get_current_tile()) != TileSet::SINGLE_TILE) { - edited_coord = edited_shape_coord; + edited_coord = Vector2i(edited_shape_coord); } SubtileData data = current_tile_data[edited_coord]; if (data.collisions.size() == 0) { @@ -2130,9 +2130,9 @@ void TileSetEditor::_select_previous_shape() { } else if (edit_mode != EDITMODE_COLLISION) { _select_previous_subtile(); } else { - Vector2i edited_coord = Vector2(); + Vector2i edited_coord = Vector2i(); if (tileset->tile_get_tile_mode(get_current_tile()) != TileSet::SINGLE_TILE) { - edited_coord = edited_shape_coord; + edited_coord = Vector2i(edited_shape_coord); } SubtileData data = current_tile_data[edited_coord]; if (data.collisions.size() == 0) { diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 7ecceaed1d..589964f620 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -42,17 +42,17 @@ #include "scene/main/viewport.h" #include "scene/resources/visual_shader_nodes.h" -Control *VisualShaderNodePlugin::create_editor(const Ref<VisualShaderNode> &p_node) { +Control *VisualShaderNodePlugin::create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node) { if (get_script_instance()) { - return get_script_instance()->call("create_editor", p_node); + return get_script_instance()->call("create_editor", p_parent_resource, p_node); } return NULL; } void VisualShaderNodePlugin::_bind_methods() { - BIND_VMETHOD(MethodInfo(Variant::OBJECT, "create_editor", PropertyInfo(Variant::OBJECT, "for_node", PROPERTY_HINT_RESOURCE_TYPE, "VisualShaderNode"))); + BIND_VMETHOD(MethodInfo(Variant::OBJECT, "create_editor", PropertyInfo(Variant::OBJECT, "parent_resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), PropertyInfo(Variant::OBJECT, "for_node", PROPERTY_HINT_RESOURCE_TYPE, "VisualShaderNode"))); } /////////////////// @@ -69,8 +69,16 @@ void VisualShaderEditor::edit(VisualShader *p_visual_shader) { } } visual_shader = Ref<VisualShader>(p_visual_shader); + if (!visual_shader->is_connected("changed", this, "_update_preview")) { + visual_shader->connect("changed", this, "_update_preview"); + } visual_shader->set_graph_offset(graph->get_scroll_ofs() / EDSCALE); } else { + if (visual_shader.is_valid()) { + if (visual_shader->is_connected("changed", this, "")) { + visual_shader->disconnect("changed", this, "_update_preview"); + } + } visual_shader.unref(); } @@ -78,7 +86,10 @@ void VisualShaderEditor::edit(VisualShader *p_visual_shader) { hide(); } else { if (changed) { // to avoid tree collapse + _clear_buffer(); + _update_custom_nodes(); _update_options_menu(); + _update_preview(); } _update_graph(); } @@ -94,31 +105,36 @@ void VisualShaderEditor::remove_plugin(const Ref<VisualShaderNodePlugin> &p_plug plugins.erase(p_plugin); } -void VisualShaderEditor::add_custom_type(const String &p_name, const String &p_category, const Ref<Script> &p_script) { - +void VisualShaderEditor::clear_custom_types() { for (int i = 0; i < add_options.size(); i++) { - ERR_FAIL_COND(add_options[i].script == p_script); + if (add_options[i].is_custom) { + add_options.remove(i); + } } - - AddOption ao; - ao.name = p_name; - ao.script = p_script; - ao.category = p_category; - add_options.push_back(ao); - - _update_options_menu(); } -void VisualShaderEditor::remove_custom_type(const Ref<Script> &p_script) { +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) { + + ERR_FAIL_COND(!p_name.is_valid_identifier()); + ERR_FAIL_COND(!p_script.is_valid()); for (int i = 0; i < add_options.size(); i++) { - if (add_options[i].script == p_script) { - add_options.remove(i); - return; + if (add_options[i].is_custom) { + if (add_options[i].script == p_script) + return; } } - _update_options_menu(); + AddOption ao; + ao.name = p_name; + ao.script = p_script; + ao.return_type = p_return_icon_type; + ao.description = p_description; + ao.category = p_category; + ao.sub_category = p_sub_category; + ao.is_custom = true; + + add_options.push_back(ao); } bool VisualShaderEditor::_is_available(int p_mode) { @@ -161,6 +177,58 @@ bool VisualShaderEditor::_is_available(int p_mode) { return (p_mode == -1 || (p_mode & current_mode) != 0); } +void VisualShaderEditor::_update_custom_nodes() { + clear_custom_types(); + List<StringName> class_list; + ScriptServer::get_global_class_list(&class_list); + for (int i = 0; i < class_list.size(); i++) { + if (ScriptServer::get_global_class_native_base(class_list[i]) == "VisualShaderNodeCustom") { + + String script_path = ScriptServer::get_global_class_path(class_list[i]); + Ref<Resource> res = ResourceLoader::load(script_path); + ERR_FAIL_COND(res.is_null()); + ERR_FAIL_COND(!res->is_class("Script")); + Ref<Script> script = Ref<Script>(res); + + Ref<VisualShaderNodeCustom> ref; + ref.instance(); + ref->set_script(script.get_ref_ptr()); + + String name; + if (ref->has_method("_get_name")) { + name = (String)ref->call("_get_name"); + } else { + name = "Unnamed"; + } + + String description = ""; + if (ref->has_method("_get_description")) { + description = (String)ref->call("_get_description"); + } + + int return_icon_type = -1; + if (ref->has_method("_get_return_icon_type")) { + return_icon_type = (int)ref->call("_get_return_icon_type"); + } + + String category = ""; + if (ref->has_method("_get_category")) { + category = (String)ref->call("_get_category"); + } + if (category == "") { + category = "Custom"; + } + + String sub_category = ""; + if (ref->has_method("_get_subcategory")) { + sub_category = (String)ref->call("_get_subcategory"); + } + + add_custom_type(name, script, description, return_icon_type, category, sub_category); + } + } +} + void VisualShaderEditor::_update_options_menu() { node_desc->set_text(""); @@ -184,6 +252,11 @@ void VisualShaderEditor::_update_options_menu() { int item_count2 = 0; bool is_first_item = true; + Color unsupported_color = get_color("error_color", "Editor"); + Color supported_color = get_color("warning_color", "Editor"); + + static bool low_driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES2"; + int current_func = -1; if (!visual_shader.is_null()) { @@ -205,6 +278,9 @@ void VisualShaderEditor::_update_options_menu() { if (!use_filter || add_options[i].name.findn(filter) != -1) { + if ((add_options[i].func != current_func && add_options[i].func != -1) || !_is_available(add_options[i].mode)) + continue; + if (prev_category != add_options[i].category) { if (category != NULL && item_count == 0) { memdelete(category); @@ -235,65 +311,53 @@ void VisualShaderEditor::_update_options_menu() { sub_category->set_collapsed(true); } } - if (sub_category != NULL) { - if ((add_options[i].func == current_func || add_options[i].func == -1) && _is_available(add_options[i].mode)) { - ++item_count2; - TreeItem *item = members->create_item(sub_category); - item->set_text(0, add_options[i].name); - if (is_first_item) { - item->select(0); - is_first_item = false; - } - switch (add_options[i].return_type) { - case VisualShaderNode::PORT_TYPE_SCALAR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_VECTOR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_BOOLEAN: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_TRANSFORM: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_COLOR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Color", "EditorIcons")); - break; - default: - break; - } - item->set_meta("id", i); - } - } } else { - if (category != NULL) { - if ((add_options[i].func == current_func || add_options[i].func == -1) && _is_available(add_options[i].mode)) { - ++item_count; - TreeItem *item = members->create_item(category); - item->set_text(0, add_options[i].name); - switch (add_options[i].return_type) { - case VisualShaderNode::PORT_TYPE_SCALAR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_VECTOR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_BOOLEAN: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_TRANSFORM: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_COLOR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Color", "EditorIcons")); - break; - default: - break; - } - item->set_meta("id", i); + sub_category = NULL; + } + + TreeItem *p_category = NULL; + + if (sub_category != NULL) { + p_category = sub_category; + ++item_count2; + } else if (category != NULL) { + p_category = category; + ++item_count; + } + + if (p_category != NULL) { + TreeItem *item = members->create_item(p_category); + if (add_options[i].highend && low_driver) + item->set_custom_color(0, unsupported_color); + else if (add_options[i].highend) + item->set_custom_color(0, supported_color); + item->set_text(0, add_options[i].name); + if (p_category == sub_category) { + if (is_first_item) { + item->select(0); + is_first_item = false; } } + switch (add_options[i].return_type) { + case VisualShaderNode::PORT_TYPE_SCALAR: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_VECTOR: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_BOOLEAN: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_TRANSFORM: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_ICON_COLOR: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Color", "EditorIcons")); + break; + default: + break; + } + item->set_meta("id", i); } prev_sub_category = add_options[i].sub_category; @@ -425,7 +489,7 @@ void VisualShaderEditor::_update_graph() { int port_offset = 0; if (is_group) { - port_offset++; + port_offset += 2; } Ref<VisualShaderNodeUniform> uniform = vsnode; @@ -449,7 +513,7 @@ void VisualShaderEditor::_update_graph() { } for (int i = 0; i < plugins.size(); i++) { - custom_editor = plugins.write[i]->create_editor(vsnode); + custom_editor = plugins.write[i]->create_editor(visual_shader, vsnode); if (custom_editor) { break; } @@ -464,21 +528,28 @@ void VisualShaderEditor::_update_graph() { } if (is_group) { - HBoxContainer *hb2 = memnew(HBoxContainer); - Button *add_input_btn = memnew(Button); - add_input_btn->set_text(TTR("Add input +")); - add_input_btn->connect("pressed", this, "_add_input_port", varray(nodes[n_i], group_node->get_free_input_port_id(), VisualShaderNode::PORT_TYPE_VECTOR, "input" + itos(group_node->get_free_input_port_id())), CONNECT_DEFERRED); - hb2->add_child(add_input_btn); + offset = memnew(Control); + offset->set_custom_minimum_size(Size2(0, 6 * EDSCALE)); + node->add_child(offset); + + if (group_node->is_editable()) { + HBoxContainer *hb2 = memnew(HBoxContainer); + + Button *add_input_btn = memnew(Button); + add_input_btn->set_text(TTR("Add input +")); + add_input_btn->connect("pressed", this, "_add_input_port", varray(nodes[n_i], group_node->get_free_input_port_id(), VisualShaderNode::PORT_TYPE_VECTOR, "input" + itos(group_node->get_free_input_port_id())), CONNECT_DEFERRED); + hb2->add_child(add_input_btn); - hb2->add_spacer(); + hb2->add_spacer(); - Button *add_output_btn = memnew(Button); - add_output_btn->set_text(TTR("Add output +")); - add_output_btn->connect("pressed", this, "_add_output_port", varray(nodes[n_i], group_node->get_free_output_port_id(), VisualShaderNode::PORT_TYPE_VECTOR, "output" + itos(group_node->get_free_output_port_id())), CONNECT_DEFERRED); - hb2->add_child(add_output_btn); + Button *add_output_btn = memnew(Button); + add_output_btn->set_text(TTR("Add output +")); + add_output_btn->connect("pressed", this, "_add_output_port", varray(nodes[n_i], group_node->get_free_output_port_id(), VisualShaderNode::PORT_TYPE_VECTOR, "output" + itos(group_node->get_free_output_port_id())), CONNECT_DEFERRED); + hb2->add_child(add_output_btn); - node->add_child(hb2); + node->add_child(hb2); + } } for (int i = 0; i < MAX(vsnode->get_input_port_count(), vsnode->get_output_port_count()); i++) { @@ -511,6 +582,7 @@ void VisualShaderEditor::_update_graph() { } HBoxContainer *hb = memnew(HBoxContainer); + hb->add_constant_override("separation", 7 * EDSCALE); Variant default_value; @@ -529,6 +601,9 @@ void VisualShaderEditor::_update_graph() { button->set_custom_minimum_size(Size2(30, 0) * EDSCALE); button->connect("draw", this, "_draw_color_over_button", varray(button, default_value)); } break; + case Variant::BOOL: { + button->set_text(((bool)default_value) ? "true" : "false"); + } break; case Variant::INT: case Variant::REAL: { button->set_text(String::num(default_value, 4)); @@ -543,7 +618,6 @@ void VisualShaderEditor::_update_graph() { } if (i == 0 && custom_editor) { - hb->add_child(custom_editor); custom_editor->set_h_size_flags(SIZE_EXPAND_FILL); } else { @@ -551,7 +625,6 @@ void VisualShaderEditor::_update_graph() { if (valid_left) { if (is_group) { - OptionButton *type_box = memnew(OptionButton); hb->add_child(type_box); type_box->add_item(TTR("Scalar")); @@ -564,9 +637,9 @@ void VisualShaderEditor::_update_graph() { LineEdit *name_box = memnew(LineEdit); hb->add_child(name_box); - name_box->set_custom_minimum_size(Size2(60 * EDSCALE, 0)); + name_box->set_custom_minimum_size(Size2(65 * EDSCALE, 0)); + name_box->set_h_size_flags(SIZE_EXPAND_FILL); name_box->set_text(name_left); - name_box->set_expand_to_text_length(true); name_box->connect("text_entered", this, "_change_input_port_name", varray(name_box, nodes[n_i], i)); name_box->connect("focus_exited", this, "_port_name_focus_out", varray(name_box, nodes[n_i], i, false)); @@ -584,7 +657,9 @@ void VisualShaderEditor::_update_graph() { } } - hb->add_spacer(); + if (!is_group) { + hb->add_spacer(); + } if (valid_right) { if (is_group) { @@ -596,9 +671,9 @@ void VisualShaderEditor::_update_graph() { LineEdit *name_box = memnew(LineEdit); hb->add_child(name_box); - name_box->set_custom_minimum_size(Size2(60 * EDSCALE, 0)); + name_box->set_custom_minimum_size(Size2(65 * EDSCALE, 0)); + name_box->set_h_size_flags(SIZE_EXPAND_FILL); name_box->set_text(name_right); - name_box->set_expand_to_text_length(true); name_box->connect("text_entered", this, "_change_output_port_name", varray(name_box, nodes[n_i], i)); name_box->connect("focus_exited", this, "_port_name_focus_out", varray(name_box, nodes[n_i], i, true)); @@ -659,7 +734,7 @@ void VisualShaderEditor::_update_graph() { } offset = memnew(Control); - offset->set_custom_minimum_size(Size2(0, 5 * EDSCALE)); + offset->set_custom_minimum_size(Size2(0, 4 * EDSCALE)); node->add_child(offset); String error = vsnode->get_warning(visual_shader->get_mode(), type); @@ -676,12 +751,14 @@ void VisualShaderEditor::_update_graph() { expression_node->set_control(expression_box, 0); node->add_child(expression_box); + Color background_color = EDITOR_GET("text_editor/highlighting/background_color"); Color text_color = EDITOR_GET("text_editor/highlighting/text_color"); Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color"); Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color"); Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color"); expression_box->set_syntax_coloring(true); + expression_box->add_color_override("background_color", background_color); for (List<String>::Element *E = keyword_list.front(); E; E = E->next()) { @@ -934,8 +1011,10 @@ void VisualShaderEditor::_expression_focus_out(Object *text_edit, int p_node) { } void VisualShaderEditor::_rebuild() { - EditorNode::get_singleton()->get_log()->clear(); - visual_shader->rebuild(); + if (visual_shader != NULL) { + EditorNode::get_singleton()->get_log()->clear(); + visual_shader->rebuild(); + } } void VisualShaderEditor::_set_node_size(int p_type, int p_node, const Vector2 &p_size) { @@ -994,7 +1073,7 @@ void VisualShaderEditor::_node_resized(const Vector2 &p_new_size, int p_type, in } undo_redo->create_action(TTR("Resize VisualShader node"), UndoRedo::MERGE_ENDS); - undo_redo->add_do_method(this, "_set_node_size", p_type, p_node, p_new_size / EDSCALE); + undo_redo->add_do_method(this, "_set_node_size", p_type, p_node, p_new_size); undo_redo->add_undo_method(this, "_set_node_size", p_type, p_node, node->get_size()); undo_redo->commit_action(); } @@ -1131,7 +1210,9 @@ void VisualShaderEditor::_add_node(int p_idx, int p_op_idx) { Ref<VisualShaderNode> vsnode; - if (add_options[p_idx].type != String()) { + bool is_custom = add_options[p_idx].is_custom; + + if (!is_custom && add_options[p_idx].type != String()) { VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instance(add_options[p_idx].type)); ERR_FAIL_COND(!vsn); @@ -1363,6 +1444,9 @@ void VisualShaderEditor::_delete_request(int which) { undo_redo->add_do_method(visual_shader.ptr(), "remove_node", type, which); undo_redo->add_undo_method(visual_shader.ptr(), "add_node", type, node, visual_shader->get_node_position(type, which), which); + undo_redo->add_do_method(this, "_clear_buffer"); + undo_redo->add_undo_method(this, "_clear_buffer"); + // restore size, inputs and outputs if node is group VisualShaderNodeGroupBase *group = Object::cast_to<VisualShaderNodeGroupBase>(node.ptr()); if (group) { @@ -1493,11 +1577,33 @@ void VisualShaderEditor::_notification(int p_what) { node_filter->set_right_icon(Control::get_icon("Search", "EditorIcons")); + preview_shader->set_icon(Control::get_icon("Shader", "EditorIcons")); + + { + Color background_color = EDITOR_GET("text_editor/highlighting/background_color"); + Color text_color = EDITOR_GET("text_editor/highlighting/text_color"); + Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color"); + Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color"); + Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color"); + + preview_text->add_color_override("background_color", background_color); + + for (List<String>::Element *E = keyword_list.front(); E; E = E->next()) { + + preview_text->add_keyword_color(E->get(), keyword_color); + } + + preview_text->add_font_override("font", get_font("expression", "EditorFonts")); + preview_text->add_color_override("font_color", text_color); + preview_text->add_color_override("symbol_color", symbol_color); + preview_text->add_color_region("/*", "*/", comment_color, false); + preview_text->add_color_region("//", "", comment_color, false); + } + tools->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Tools", "EditorIcons")); if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) _update_graph(); - } else if (p_what == NOTIFICATION_PROCESS) { } } @@ -1518,12 +1624,32 @@ void VisualShaderEditor::_node_changed(int p_id) { } } -void VisualShaderEditor::_duplicate_nodes() { +void VisualShaderEditor::_dup_update_excluded(int p_type, Set<int> &r_excluded) { + r_excluded.clear(); + VisualShader::Type type = (VisualShader::Type)p_type; - VisualShader::Type type = VisualShader::Type(edit_type->get_selected()); + for (int i = 0; i < graph->get_child_count(); i++) { - List<int> nodes; - Set<int> excluded; + GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i)); + if (gn) { + int id = String(gn->get_name()).to_int(); + Ref<VisualShaderNode> node = visual_shader->get_node(type, id); + Ref<VisualShaderNodeOutput> output = node; + if (output.is_valid()) { + r_excluded.insert(id); + continue; + } + r_excluded.insert(id); + } + } +} + +void VisualShaderEditor::_dup_copy_nodes(int p_type, List<int> &r_nodes, Set<int> &r_excluded) { + + VisualShader::Type type = (VisualShader::Type)p_type; + + selection_center.x = 0.0f; + selection_center.y = 0.0f; for (int i = 0; i < graph->get_child_count(); i++) { @@ -1533,33 +1659,53 @@ void VisualShaderEditor::_duplicate_nodes() { Ref<VisualShaderNode> node = visual_shader->get_node(type, id); Ref<VisualShaderNodeOutput> output = node; if (output.is_valid()) { // can't duplicate output - excluded.insert(id); + r_excluded.insert(id); continue; } if (node.is_valid() && gn->is_selected()) { - nodes.push_back(id); + Vector2 pos = visual_shader->get_node_position(type, id); + selection_center += pos; + r_nodes.push_back(id); } - excluded.insert(id); + r_excluded.insert(id); } } - if (nodes.empty()) - return; + selection_center /= (float)r_nodes.size(); +} - undo_redo->create_action(TTR("Duplicate Nodes")); +void VisualShaderEditor::_dup_paste_nodes(int p_type, int p_pasted_type, List<int> &r_nodes, Set<int> &r_excluded, const Vector2 &p_offset, bool p_select) { + + VisualShader::Type type = (VisualShader::Type)p_type; + VisualShader::Type pasted_type = (VisualShader::Type)p_pasted_type; int base_id = visual_shader->get_valid_node_id(type); int id_from = base_id; Map<int, int> connection_remap; + Set<int> unsupported_set; - for (List<int>::Element *E = nodes.front(); E; E = E->next()) { + for (List<int>::Element *E = r_nodes.front(); E; E = E->next()) { connection_remap[E->get()] = id_from; - Ref<VisualShaderNode> node = visual_shader->get_node(type, E->get()); + Ref<VisualShaderNode> node = visual_shader->get_node(pasted_type, E->get()); + + bool unsupported = false; + for (int i = 0; i < add_options.size(); i++) { + if (add_options[i].type == node->get_class_name()) { + if (!_is_available(add_options[i].mode)) { + unsupported = true; + } + break; + } + } + if (unsupported) { + unsupported_set.insert(E->get()); + continue; + } Ref<VisualShaderNode> dupli = node->duplicate(); - undo_redo->add_do_method(visual_shader.ptr(), "add_node", type, dupli, visual_shader->get_node_position(type, E->get()) + Vector2(10, 10) * EDSCALE, id_from); + undo_redo->add_do_method(visual_shader.ptr(), "add_node", type, dupli, visual_shader->get_node_position(pasted_type, E->get()) + p_offset, id_from); undo_redo->add_undo_method(visual_shader.ptr(), "remove_node", type, id_from); // duplicate size, inputs and outputs if node is group @@ -1579,9 +1725,12 @@ void VisualShaderEditor::_duplicate_nodes() { } List<VisualShader::Connection> conns; - visual_shader->get_node_connections(type, &conns); + visual_shader->get_node_connections(pasted_type, &conns); for (List<VisualShader::Connection>::Element *E = conns.front(); E; E = E->next()) { + if (unsupported_set.has(E->get().from_node) || unsupported_set.has(E->get().to_node)) { + continue; + } if (connection_remap.has(E->get().from_node) && connection_remap.has(E->get().to_node)) { undo_redo->add_do_method(visual_shader.ptr(), "connect_nodes_forced", type, connection_remap[E->get().from_node], E->get().from_port, connection_remap[E->get().to_node], E->get().to_port); } @@ -1591,21 +1740,71 @@ void VisualShaderEditor::_duplicate_nodes() { undo_redo->add_undo_method(this, "_update_graph"); undo_redo->commit_action(); - // reselect duplicated nodes by excluding the other ones - for (int i = 0; i < graph->get_child_count(); i++) { - - GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i)); - if (gn) { - int id = String(gn->get_name()).to_int(); - if (!excluded.has(id)) { - gn->set_selected(true); - } else { - gn->set_selected(false); + if (p_select) { + // reselect duplicated nodes by excluding the other ones + for (int i = 0; i < graph->get_child_count(); i++) { + + GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i)); + if (gn) { + int id = String(gn->get_name()).to_int(); + if (!r_excluded.has(id)) { + gn->set_selected(true); + } else { + gn->set_selected(false); + } } } } } +void VisualShaderEditor::_clear_buffer() { + + copy_nodes_buffer.clear(); + copy_nodes_excluded_buffer.clear(); +} + +void VisualShaderEditor::_duplicate_nodes() { + + int type = edit_type->get_selected(); + + List<int> nodes; + Set<int> excluded; + + _dup_copy_nodes(type, nodes, excluded); + + if (nodes.empty()) + return; + + undo_redo->create_action(TTR("Duplicate Nodes")); + + _dup_paste_nodes(type, type, nodes, excluded, Vector2(10, 10) * EDSCALE, true); +} + +void VisualShaderEditor::_copy_nodes() { + + copy_type = edit_type->get_selected(); + + _clear_buffer(); + + _dup_copy_nodes(copy_type, copy_nodes_buffer, copy_nodes_excluded_buffer); +} + +void VisualShaderEditor::_paste_nodes() { + + if (copy_nodes_buffer.empty()) + return; + + int type = edit_type->get_selected(); + + undo_redo->create_action(TTR("Paste Nodes")); + + float scale = graph->get_zoom(); + + _dup_paste_nodes(type, copy_type, copy_nodes_buffer, copy_nodes_excluded_buffer, (graph->get_scroll_ofs() / scale + graph->get_local_mouse_position() / scale - selection_center), false); + + _dup_update_excluded(type, copy_nodes_excluded_buffer); // to prevent selection of previous copies at new paste +} + void VisualShaderEditor::_on_nodes_delete() { VisualShader::Type type = VisualShader::Type(edit_type->get_selected()); @@ -1632,6 +1831,9 @@ void VisualShaderEditor::_on_nodes_delete() { undo_redo->add_do_method(visual_shader.ptr(), "remove_node", type, F->get()); undo_redo->add_undo_method(visual_shader.ptr(), "add_node", type, node, visual_shader->get_node_position(type, F->get()), F->get()); + undo_redo->add_do_method(this, "_clear_buffer"); + undo_redo->add_undo_method(this, "_clear_buffer"); + // restore size, inputs and outputs if node is group VisualShaderNodeGroupBase *group = Object::cast_to<VisualShaderNodeGroupBase>(node.ptr()); if (group) { @@ -1676,6 +1878,7 @@ void VisualShaderEditor::_on_nodes_delete() { } void VisualShaderEditor::_mode_selected(int p_id) { + _update_options_menu(); _update_graph(); } @@ -1723,7 +1926,11 @@ void VisualShaderEditor::_member_selected() { if (item != NULL && item->has_meta("id")) { members_dialog->get_ok()->set_disabled(false); - node_desc->set_text(add_options[item->get_meta("id")].description); + if (add_options[item->get_meta("id")].highend) { + node_desc->set_text(TTR("(GLES3 only)") + " " + add_options[item->get_meta("id")].description); // TODO: change it to (Vulkan Only) when its ready + } else { + node_desc->set_text(add_options[item->get_meta("id")].description); + } } else { members_dialog->get_ok()->set_disabled(true); node_desc->set_text(""); @@ -1843,6 +2050,15 @@ void VisualShaderEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da } } +void VisualShaderEditor::_show_preview_text() { + preview_showed = !preview_showed; + preview_text->set_visible(preview_showed); +} + +void VisualShaderEditor::_update_preview() { + preview_text->set_text(visual_shader->get_code()); +} + void VisualShaderEditor::_bind_methods() { ClassDB::bind_method("_rebuild", &VisualShaderEditor::_rebuild); ClassDB::bind_method("_update_graph", &VisualShaderEditor::_update_graph); @@ -1865,6 +2081,8 @@ void VisualShaderEditor::_bind_methods() { ClassDB::bind_method("_line_edit_changed", &VisualShaderEditor::_line_edit_changed); ClassDB::bind_method("_port_name_focus_out", &VisualShaderEditor::_port_name_focus_out); ClassDB::bind_method("_duplicate_nodes", &VisualShaderEditor::_duplicate_nodes); + ClassDB::bind_method("_copy_nodes", &VisualShaderEditor::_copy_nodes); + ClassDB::bind_method("_paste_nodes", &VisualShaderEditor::_paste_nodes); ClassDB::bind_method("_mode_selected", &VisualShaderEditor::_mode_selected); ClassDB::bind_method("_input_select_item", &VisualShaderEditor::_input_select_item); ClassDB::bind_method("_preview_select_port", &VisualShaderEditor::_preview_select_port); @@ -1879,6 +2097,9 @@ void VisualShaderEditor::_bind_methods() { ClassDB::bind_method("_remove_output_port", &VisualShaderEditor::_remove_output_port); ClassDB::bind_method("_node_resized", &VisualShaderEditor::_node_resized); ClassDB::bind_method("_set_node_size", &VisualShaderEditor::_set_node_size); + ClassDB::bind_method("_clear_buffer", &VisualShaderEditor::_clear_buffer); + ClassDB::bind_method("_show_preview_text", &VisualShaderEditor::_show_preview_text); + ClassDB::bind_method("_update_preview", &VisualShaderEditor::_update_preview); ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &VisualShaderEditor::get_drag_data_fw); ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &VisualShaderEditor::can_drop_data_fw); @@ -1905,13 +2126,23 @@ VisualShaderEditor::VisualShaderEditor() { saved_node_pos = Point2(0, 0); ShaderLanguage::get_keyword_list(&keyword_list); + preview_showed = false; + to_node = -1; to_slot = -1; from_node = -1; from_slot = -1; + main_box = memnew(HSplitContainer); + main_box->set_v_size_flags(SIZE_EXPAND_FILL); + main_box->set_h_size_flags(SIZE_EXPAND_FILL); + add_child(main_box); + graph = memnew(GraphEdit); - add_child(graph); + graph->get_zoom_hbox()->set_h_size_flags(SIZE_EXPAND_FILL); + graph->set_v_size_flags(SIZE_EXPAND_FILL); + graph->set_h_size_flags(SIZE_EXPAND_FILL); + main_box->add_child(graph); graph->set_drag_forwarding(this); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_BOOLEAN); @@ -1924,6 +2155,8 @@ VisualShaderEditor::VisualShaderEditor() { graph->connect("node_selected", this, "_node_selected"); graph->connect("scroll_offset_changed", this, "_scroll_changed"); graph->connect("duplicate_nodes_request", this, "_duplicate_nodes"); + graph->connect("copy_nodes_request", this, "_copy_nodes"); + graph->connect("paste_nodes_request", this, "_paste_nodes"); graph->connect("delete_nodes_request", this, "_on_nodes_delete"); graph->connect("gui_input", this, "_graph_gui_input"); graph->connect("connection_to_empty", this, "_connection_to_empty"); @@ -1958,6 +2191,25 @@ VisualShaderEditor::VisualShaderEditor() { graph->get_zoom_hbox()->move_child(add_node, 0); add_node->connect("pressed", this, "_show_members_dialog", varray(false)); + preview_shader = memnew(ToolButton); + preview_shader->set_toggle_mode(true); + preview_shader->set_tooltip(TTR("Show resulted shader code.")); + graph->get_zoom_hbox()->add_child(preview_shader); + preview_shader->connect("pressed", this, "_show_preview_text"); + + /////////////////////////////////////// + // PREVIEW PANEL + /////////////////////////////////////// + + preview_text = memnew(TextEdit); + main_box->add_child(preview_text); + preview_text->set_h_size_flags(SIZE_EXPAND_FILL); + preview_text->set_v_size_flags(SIZE_EXPAND_FILL); + preview_text->set_visible(preview_showed); + preview_text->set_custom_minimum_size(Size2(400 * EDSCALE, 0)); + preview_text->set_syntax_coloring(true); + preview_text->set_readonly(true); + /////////////////////////////////////// // SHADER NODES TREE /////////////////////////////////////// @@ -2048,12 +2300,12 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Screen", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Screen operator."), VisualShaderNodeColorOp::OP_SCREEN, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("SoftLight", "Color", "Operators", "VisualShaderNodeColorOp", TTR("SoftLight operator."), VisualShaderNodeColorOp::OP_SOFT_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("ColorConstant", "Color", "Variables", "VisualShaderNodeColorConstant", TTR("Color constant."), -1, VisualShaderNode::PORT_TYPE_COLOR)); - add_options.push_back(AddOption("ColorUniform", "Color", "Variables", "VisualShaderNodeColorUniform", TTR("Color uniform."), -1, VisualShaderNode::PORT_TYPE_COLOR)); + add_options.push_back(AddOption("ColorConstant", "Color", "Variables", "VisualShaderNodeColorConstant", TTR("Color constant."), -1, VisualShaderNode::PORT_TYPE_ICON_COLOR)); + add_options.push_back(AddOption("ColorUniform", "Color", "Variables", "VisualShaderNodeColorUniform", TTR("Color uniform."), -1, VisualShaderNode::PORT_TYPE_ICON_COLOR)); // CONDITIONAL - const String &compare_func_desc = TTR("Returns the boolean result of %s comparison between two parameters."); + const String &compare_func_desc = TTR("Returns the boolean result of the %s comparison between two parameters."); add_options.push_back(AddOption("Equal", "Conditional", "Functions", "VisualShaderNodeCompare", vformat(compare_func_desc, TTR("Equal (==)")), VisualShaderNodeCompare::FUNC_EQUAL, VisualShaderNode::PORT_TYPE_BOOLEAN)); add_options.push_back(AddOption("GreaterThan", "Conditional", "Functions", "VisualShaderNodeCompare", vformat(compare_func_desc, TTR("Greater Than (>)")), VisualShaderNodeCompare::FUNC_GREATER_THAN, VisualShaderNode::PORT_TYPE_BOOLEAN)); @@ -2066,7 +2318,7 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("NotEqual", "Conditional", "Functions", "VisualShaderNodeCompare", vformat(compare_func_desc, TTR("Not Equal (!=)")), VisualShaderNodeCompare::FUNC_NOT_EQUAL, VisualShaderNode::PORT_TYPE_BOOLEAN)); add_options.push_back(AddOption("Switch", "Conditional", "Functions", "VisualShaderNodeSwitch", TTR("Returns an associated vector if the provided boolean value is true or false."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("Compare", "Conditional", "Common", "VisualShaderNodeCompare", TTR("Returns the boolean result of the contains the result of comparison between two parameters."), -1, VisualShaderNode::PORT_TYPE_BOOLEAN)); + add_options.push_back(AddOption("Compare", "Conditional", "Common", "VisualShaderNodeCompare", TTR("Returns the boolean result of the comparison between two parameters."), -1, VisualShaderNode::PORT_TYPE_BOOLEAN)); add_options.push_back(AddOption("Is", "Conditional", "Common", "VisualShaderNodeIs", TTR("Returns the boolean result of the comparison between INF (or NaN) and a scalar parameter."), -1, VisualShaderNode::PORT_TYPE_BOOLEAN)); add_options.push_back(AddOption("BooleanConstant", "Conditional", "Variables", "VisualShaderNodeBooleanConstant", TTR("Boolean constant."), -1, VisualShaderNode::PORT_TYPE_BOOLEAN)); @@ -2202,16 +2454,16 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Abs", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the absolute value of the parameter."), VisualShaderNodeScalarFunc::FUNC_ABS, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("ACos", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the arc-cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ACOS, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ACosH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Returns the inverse hyperbolic cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ACOSH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ACosH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the inverse hyperbolic cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ACOSH, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("ASin", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the arc-sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ASIN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ASinH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Returns the inverse hyperbolic sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ASINH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ASinH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the inverse hyperbolic sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ASINH, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("ATan", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the arc-tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_ATAN, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("ATan2", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Returns the arc-tangent of the parameters."), VisualShaderNodeScalarOp::OP_ATAN2, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ATanH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Returns the inverse hyperbolic tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_ATANH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ATanH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the inverse hyperbolic tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_ATANH, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Ceil", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), VisualShaderNodeScalarFunc::FUNC_CEIL, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Clamp", "Scalar", "Functions", "VisualShaderNodeScalarClamp", TTR("Constrains a value to lie between two further values."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Cos", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_COS, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("CosH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Returns the hyperbolic cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_COSH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("CosH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the hyperbolic cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_COSH, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Degrees", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Converts a quantity in radians to degrees."), VisualShaderNodeScalarFunc::FUNC_DEGREES, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Exp", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Base-e Exponential."), VisualShaderNodeScalarFunc::FUNC_EXP, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Exp2", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Base-2 Exponential."), VisualShaderNodeScalarFunc::FUNC_EXP2, VisualShaderNode::PORT_TYPE_SCALAR)); @@ -2228,18 +2480,18 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Pow", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Returns the value of the first parameter raised to the power of the second."), VisualShaderNodeScalarOp::OP_POW, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Radians", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Converts a quantity in degrees to radians."), VisualShaderNodeScalarFunc::FUNC_RADIANS, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Reciprocal", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("1.0 / scalar"), VisualShaderNodeScalarFunc::FUNC_RECIPROCAL, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Round", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Finds the nearest integer to the parameter."), VisualShaderNodeScalarFunc::FUNC_ROUND, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("RoundEven", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Finds the nearest even integer to the parameter."), VisualShaderNodeScalarFunc::FUNC_ROUNDEVEN, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Round", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the nearest integer to the parameter."), VisualShaderNodeScalarFunc::FUNC_ROUND, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("RoundEven", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the nearest even integer to the parameter."), VisualShaderNodeScalarFunc::FUNC_ROUNDEVEN, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Saturate", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Clamps the value between 0.0 and 1.0."), VisualShaderNodeScalarFunc::FUNC_SATURATE, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Sign", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Extracts the sign of the parameter."), VisualShaderNodeScalarFunc::FUNC_SIGN, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Sin", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_SIN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("SinH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Returns the hyperbolic sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_SINH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("SinH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the hyperbolic sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_SINH, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Sqrt", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the square root of the parameter."), VisualShaderNodeScalarFunc::FUNC_SQRT, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("SmoothStep", "Scalar", "Functions", "VisualShaderNodeScalarSmoothStep", TTR("SmoothStep function( scalar(edge0), scalar(edge1), scalar(x) ).\n\nReturns 0.0 if 'x' is smaller then 'edge0' and 1.0 if x is larger than 'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Step", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Step function( scalar(edge), scalar(x) ).\n\nReturns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0."), VisualShaderNodeScalarOp::OP_STEP, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("SmoothStep", "Scalar", "Functions", "VisualShaderNodeScalarSmoothStep", TTR("SmoothStep function( scalar(edge0), scalar(edge1), scalar(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge0' and 1.0 if x is larger than 'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Step", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Step function( scalar(edge), scalar(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0."), VisualShaderNodeScalarOp::OP_STEP, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Tan", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_TAN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("TanH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Returns the hyperbolic tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_TANH, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Trunc", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("(GLES3 only) Finds the truncated value of the parameter."), VisualShaderNodeScalarFunc::FUNC_TRUNC, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("TanH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the hyperbolic tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_TANH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Trunc", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the truncated value of the parameter."), VisualShaderNodeScalarFunc::FUNC_TRUNC, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Add", "Scalar", "Operators", "VisualShaderNodeScalarOp", TTR("Adds scalar to scalar."), VisualShaderNodeScalarOp::OP_ADD, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Divide", "Scalar", "Operators", "VisualShaderNodeScalarOp", TTR("Divides scalar by scalar."), VisualShaderNodeScalarOp::OP_DIV, VisualShaderNode::PORT_TYPE_SCALAR)); @@ -2252,23 +2504,24 @@ VisualShaderEditor::VisualShaderEditor() { // TEXTURES - add_options.push_back(AddOption("CubeMap", "Textures", "Functions", "VisualShaderNodeCubeMap", TTR("Perform the cubic texture lookup."), -1, VisualShaderNode::PORT_TYPE_COLOR)); - add_options.push_back(AddOption("Texture", "Textures", "Functions", "VisualShaderNodeTexture", TTR("Perform the texture lookup."), -1, VisualShaderNode::PORT_TYPE_COLOR)); + add_options.push_back(AddOption("CubeMap", "Textures", "Functions", "VisualShaderNodeCubeMap", TTR("Perform the cubic texture lookup."), -1, VisualShaderNode::PORT_TYPE_ICON_COLOR)); + add_options.push_back(AddOption("Texture", "Textures", "Functions", "VisualShaderNodeTexture", TTR("Perform the texture lookup."), -1, VisualShaderNode::PORT_TYPE_ICON_COLOR)); - add_options.push_back(AddOption("CubeMapUniform", "Textures", "Variables", "VisualShaderNodeCubeMapUniform", TTR("Cubic texture uniform."), -1, VisualShaderNode::PORT_TYPE_COLOR)); - add_options.push_back(AddOption("TextureUniform", "Textures", "Variables", "VisualShaderNodeTextureUniform", TTR("2D texture uniform."), -1, VisualShaderNode::PORT_TYPE_COLOR)); + add_options.push_back(AddOption("CubeMapUniform", "Textures", "Variables", "VisualShaderNodeCubeMapUniform", TTR("Cubic texture uniform lookup."), -1, VisualShaderNode::PORT_TYPE_ICON_COLOR)); + add_options.push_back(AddOption("TextureUniform", "Textures", "Variables", "VisualShaderNodeTextureUniform", TTR("2D texture uniform lookup."), -1, VisualShaderNode::PORT_TYPE_ICON_COLOR)); + add_options.push_back(AddOption("TextureUniformTriplanar", "Textures", "Variables", "VisualShaderNodeTextureUniformTriplanar", TTR("2D texture uniform lookup with triplanar."), -1, VisualShaderNode::PORT_TYPE_ICON_COLOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, Shader::MODE_SPATIAL)); // TRANSFORM add_options.push_back(AddOption("TransformFunc", "Transform", "Common", "VisualShaderNodeTransformFunc", TTR("Transform function."), -1, VisualShaderNode::PORT_TYPE_TRANSFORM)); - add_options.push_back(AddOption("OuterProduct", "Transform", "Composition", "VisualShaderNodeOuterProduct", TTR("(GLES3 only) Calculate the outer product of a pair of vectors.\n\nOuterProduct treats the first parameter 'c' as a column vector (matrix with one column) and the second parameter 'r' as a row vector (matrix with one row) and does a linear algebraic matrix multiply 'c * r', yielding a matrix whose number of rows is the number of components in 'c' and whose number of columns is the number of components in 'r'."), -1, VisualShaderNode::PORT_TYPE_TRANSFORM)); + add_options.push_back(AddOption("OuterProduct", "Transform", "Composition", "VisualShaderNodeOuterProduct", TTR("Calculate the outer product of a pair of vectors.\n\nOuterProduct treats the first parameter 'c' as a column vector (matrix with one column) and the second parameter 'r' as a row vector (matrix with one row) and does a linear algebraic matrix multiply 'c * r', yielding a matrix whose number of rows is the number of components in 'c' and whose number of columns is the number of components in 'r'."), -1, VisualShaderNode::PORT_TYPE_TRANSFORM)); add_options.push_back(AddOption("TransformCompose", "Transform", "Composition", "VisualShaderNodeTransformCompose", TTR("Composes transform from four vectors."), -1, VisualShaderNode::PORT_TYPE_TRANSFORM)); add_options.push_back(AddOption("TransformDecompose", "Transform", "Composition", "VisualShaderNodeTransformDecompose", TTR("Decomposes transform to four vectors."))); - add_options.push_back(AddOption("Determinant", "Transform", "Functions", "VisualShaderNodeDeterminant", TTR("(GLES3 only) Calculates the determinant of a transform."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Inverse", "Transform", "Functions", "VisualShaderNodeTransformFunc", TTR("(GLES3 only) Calculates the inverse of a transform."), VisualShaderNodeTransformFunc::FUNC_INVERSE, VisualShaderNode::PORT_TYPE_TRANSFORM)); - add_options.push_back(AddOption("Transpose", "Transform", "Functions", "VisualShaderNodeTransformFunc", TTR("(GLES3 only) Calculates the transpose of a transform."), VisualShaderNodeTransformFunc::FUNC_TRANSPOSE, VisualShaderNode::PORT_TYPE_TRANSFORM)); + add_options.push_back(AddOption("Determinant", "Transform", "Functions", "VisualShaderNodeDeterminant", TTR("Calculates the determinant of a transform."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Inverse", "Transform", "Functions", "VisualShaderNodeTransformFunc", TTR("Calculates the inverse of a transform."), VisualShaderNodeTransformFunc::FUNC_INVERSE, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, -1, -1, true)); + add_options.push_back(AddOption("Transpose", "Transform", "Functions", "VisualShaderNodeTransformFunc", TTR("Calculates the transpose of a transform."), VisualShaderNodeTransformFunc::FUNC_TRANSPOSE, VisualShaderNode::PORT_TYPE_TRANSFORM)); add_options.push_back(AddOption("TransformMult", "Transform", "Operators", "VisualShaderNodeTransformMult", TTR("Multiplies transform by transform."), -1, VisualShaderNode::PORT_TYPE_TRANSFORM)); add_options.push_back(AddOption("TransformVectorMult", "Transform", "Operators", "VisualShaderNodeTransformVecMult", TTR("Multiplies vector by transform."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); @@ -2286,16 +2539,16 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Abs", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the absolute value of the parameter."), VisualShaderNodeVectorFunc::FUNC_ABS, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("ACos", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the arc-cosine of the parameter."), VisualShaderNodeVectorFunc::FUNC_ACOS, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("ACosH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Returns the inverse hyperbolic cosine of the parameter."), VisualShaderNodeVectorFunc::FUNC_ACOSH, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("ACosH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the inverse hyperbolic cosine of the parameter."), VisualShaderNodeVectorFunc::FUNC_ACOSH, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("ASin", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the arc-sine of the parameter."), VisualShaderNodeVectorFunc::FUNC_ASIN, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("ASinH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Returns the inverse hyperbolic sine of the parameter."), VisualShaderNodeVectorFunc::FUNC_ASINH, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("ASinH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the inverse hyperbolic sine of the parameter."), VisualShaderNodeVectorFunc::FUNC_ASINH, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("ATan", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the arc-tangent of the parameter."), VisualShaderNodeVectorFunc::FUNC_ATAN, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("ATan2", "Vector", "Functions", "VisualShaderNodeVectorOp", TTR("Returns the arc-tangent of the parameters."), VisualShaderNodeVectorOp::OP_ATAN2, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("ATanH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Returns the inverse hyperbolic tangent of the parameter."), VisualShaderNodeVectorFunc::FUNC_ATANH, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("ATanH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the inverse hyperbolic tangent of the parameter."), VisualShaderNodeVectorFunc::FUNC_ATANH, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Ceil", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), VisualShaderNodeVectorFunc::FUNC_CEIL, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Clamp", "Vector", "Functions", "VisualShaderNodeVectorClamp", TTR("Constrains a value to lie between two further values."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Cos", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the cosine of the parameter."), VisualShaderNodeVectorFunc::FUNC_COS, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("CosH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Returns the hyperbolic cosine of the parameter."), VisualShaderNodeVectorFunc::FUNC_COSH, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("CosH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the hyperbolic cosine of the parameter."), VisualShaderNodeVectorFunc::FUNC_COSH, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Cross", "Vector", "Functions", "VisualShaderNodeVectorOp", TTR("Calculates the cross product of two vectors."), VisualShaderNodeVectorOp::OP_CROSS, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Degrees", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Converts a quantity in radians to degrees."), VisualShaderNodeVectorFunc::FUNC_DEGREES, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Distance", "Vector", "Functions", "VisualShaderNodeVectorDistance", TTR("Returns the distance between two points."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); @@ -2312,6 +2565,7 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Max", "Vector", "Functions", "VisualShaderNodeVectorOp", TTR("Returns the greater of two values."), VisualShaderNodeVectorOp::OP_MAX, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Min", "Vector", "Functions", "VisualShaderNodeVectorOp", TTR("Returns the lesser of two values."), VisualShaderNodeVectorOp::OP_MIN, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Mix", "Vector", "Functions", "VisualShaderNodeVectorInterp", TTR("Linear interpolation between two vectors."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("MixS", "Vector", "Functions", "VisualShaderNodeVectorScalarMix", TTR("Linear interpolation between two vectors using scalar."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Negate", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the opposite value of the parameter."), VisualShaderNodeVectorFunc::FUNC_NEGATE, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Normalize", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Calculates the normalize product of vector."), VisualShaderNodeVectorFunc::FUNC_NORMALIZE, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("OneMinus", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("1.0 - vector"), VisualShaderNodeVectorFunc::FUNC_ONEMINUS, VisualShaderNode::PORT_TYPE_VECTOR)); @@ -2320,20 +2574,20 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Reciprocal", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("1.0 / vector"), VisualShaderNodeVectorFunc::FUNC_RECIPROCAL, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Reflect", "Vector", "Functions", "VisualShaderNodeVectorOp", TTR("Returns the vector that points in the direction of reflection ( a : incident vector, b : normal vector )."), VisualShaderNodeVectorOp::OP_REFLECT, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Refract", "Vector", "Functions", "VisualShaderNodeVectorRefract", TTR("Returns the vector that points in the direction of refraction."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("Round", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Finds the nearest integer to the parameter."), VisualShaderNodeVectorFunc::FUNC_ROUND, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("RoundEven", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Finds the nearest even integer to the parameter."), VisualShaderNodeVectorFunc::FUNC_ROUNDEVEN, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("Round", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Finds the nearest integer to the parameter."), VisualShaderNodeVectorFunc::FUNC_ROUND, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("RoundEven", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Finds the nearest even integer to the parameter."), VisualShaderNodeVectorFunc::FUNC_ROUNDEVEN, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Saturate", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Clamps the value between 0.0 and 1.0."), VisualShaderNodeVectorFunc::FUNC_SATURATE, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Sign", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Extracts the sign of the parameter."), VisualShaderNodeVectorFunc::FUNC_SIGN, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Sin", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the sine of the parameter."), VisualShaderNodeVectorFunc::FUNC_SIN, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("SinH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Returns the hyperbolic sine of the parameter."), VisualShaderNodeVectorFunc::FUNC_SINH, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("SinH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the hyperbolic sine of the parameter."), VisualShaderNodeVectorFunc::FUNC_SINH, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Sqrt", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the square root of the parameter."), VisualShaderNodeVectorFunc::FUNC_SQRT, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("SmoothStep", "Vector", "Functions", "VisualShaderNodeVectorSmoothStep", TTR("SmoothStep function( vector(edge0), vector(edge1), vector(x) ).\n\nReturns 0.0 if 'x' is smaller then 'edge0' and 1.0 if 'x' is larger than 'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("SmoothStepS", "Vector", "Functions", "VisualShaderNodeVectorScalarSmoothStep", TTR("SmoothStep function( scalar(edge0), scalar(edge1), vector(x) ).\n\nReturns 0.0 if 'x' is smaller then 'edge0' and 1.0 if 'x' is larger than 'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("Step", "Vector", "Functions", "VisualShaderNodeVectorOp", TTR("Step function( vector(edge), vector(x) ).\n\nReturns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0."), VisualShaderNodeVectorOp::OP_STEP, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("StepS", "Vector", "Functions", "VisualShaderNodeVectorScalarStep", TTR("Step function( scalar(edge), vector(x) ).\n\nReturns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("SmoothStep", "Vector", "Functions", "VisualShaderNodeVectorSmoothStep", TTR("SmoothStep function( vector(edge0), vector(edge1), vector(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge0' and 1.0 if 'x' is larger than 'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("SmoothStepS", "Vector", "Functions", "VisualShaderNodeVectorScalarSmoothStep", TTR("SmoothStep function( scalar(edge0), scalar(edge1), vector(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge0' and 1.0 if 'x' is larger than 'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("Step", "Vector", "Functions", "VisualShaderNodeVectorOp", TTR("Step function( vector(edge), vector(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0."), VisualShaderNodeVectorOp::OP_STEP, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("StepS", "Vector", "Functions", "VisualShaderNodeVectorScalarStep", TTR("Step function( scalar(edge), vector(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0."), -1, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Tan", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the tangent of the parameter."), VisualShaderNodeVectorFunc::FUNC_TAN, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("TanH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Returns the hyperbolic tangent of the parameter."), VisualShaderNodeVectorFunc::FUNC_TANH, VisualShaderNode::PORT_TYPE_VECTOR)); - add_options.push_back(AddOption("Trunc", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("(GLES3 only) Finds the truncated value of the parameter."), VisualShaderNodeVectorFunc::FUNC_TRUNC, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("TanH", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Returns the hyperbolic tangent of the parameter."), VisualShaderNodeVectorFunc::FUNC_TANH, VisualShaderNode::PORT_TYPE_VECTOR)); + add_options.push_back(AddOption("Trunc", "Vector", "Functions", "VisualShaderNodeVectorFunc", TTR("Finds the truncated value of the parameter."), VisualShaderNodeVectorFunc::FUNC_TRUNC, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Add", "Vector", "Operators", "VisualShaderNodeVectorOp", TTR("Adds vector to vector."), VisualShaderNodeVectorOp::OP_ADD, VisualShaderNode::PORT_TYPE_VECTOR)); add_options.push_back(AddOption("Divide", "Vector", "Operators", "VisualShaderNodeVectorOp", TTR("Divides vector by vector."), VisualShaderNodeVectorOp::OP_DIV, VisualShaderNode::PORT_TYPE_VECTOR)); @@ -2348,16 +2602,17 @@ 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("ScalarDerivativeFunc", "Special", "Common", "VisualShaderNodeScalarDerivativeFunc", TTR("(GLES3 only) (Fragment/Light mode only) Scalar derivative function."), -1, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT)); - add_options.push_back(AddOption("VectorDerivativeFunc", "Special", "Common", "VisualShaderNodeVectorDerivativeFunc", TTR("(GLES3 only) (Fragment/Light mode only) Vector derivative function."), -1, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT)); + 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)); - add_options.push_back(AddOption("DdX", "Special", "Derivative", "VisualShaderNodeVectorDerivativeFunc", TTR("(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using local differencing."), VisualShaderNodeVectorDerivativeFunc::FUNC_X, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT)); - add_options.push_back(AddOption("DdXS", "Special", "Derivative", "VisualShaderNodeScalarDerivativeFunc", TTR("(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using local differencing."), VisualShaderNodeScalarDerivativeFunc::FUNC_X, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT)); - add_options.push_back(AddOption("DdY", "Special", "Derivative", "VisualShaderNodeVectorDerivativeFunc", TTR("(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using local differencing."), VisualShaderNodeVectorDerivativeFunc::FUNC_Y, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT)); - add_options.push_back(AddOption("DdYS", "Special", "Derivative", "VisualShaderNodeScalarDerivativeFunc", TTR("(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using local differencing."), VisualShaderNodeScalarDerivativeFunc::FUNC_Y, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT)); - add_options.push_back(AddOption("Sum", "Special", "Derivative", "VisualShaderNodeVectorDerivativeFunc", TTR("(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and 'y'."), VisualShaderNodeVectorDerivativeFunc::FUNC_SUM, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT)); - add_options.push_back(AddOption("SumS", "Special", "Derivative", "VisualShaderNodeScalarDerivativeFunc", TTR("(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and 'y'."), VisualShaderNodeScalarDerivativeFunc::FUNC_SUM, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT)); + add_options.push_back(AddOption("DdX", "Special", "Derivative", "VisualShaderNodeVectorDerivativeFunc", TTR("(Fragment/Light mode only) (Vector) Derivative in 'x' using local differencing."), VisualShaderNodeVectorDerivativeFunc::FUNC_X, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true)); + add_options.push_back(AddOption("DdXS", "Special", "Derivative", "VisualShaderNodeScalarDerivativeFunc", TTR("(Fragment/Light mode only) (Scalar) Derivative in 'x' using local differencing."), VisualShaderNodeScalarDerivativeFunc::FUNC_X, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true)); + add_options.push_back(AddOption("DdY", "Special", "Derivative", "VisualShaderNodeVectorDerivativeFunc", TTR("(Fragment/Light mode only) (Vector) Derivative in 'y' using local differencing."), VisualShaderNodeVectorDerivativeFunc::FUNC_Y, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true)); + add_options.push_back(AddOption("DdYS", "Special", "Derivative", "VisualShaderNodeScalarDerivativeFunc", TTR("(Fragment/Light mode only) (Scalar) Derivative in 'y' using local differencing."), VisualShaderNodeScalarDerivativeFunc::FUNC_Y, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true)); + add_options.push_back(AddOption("Sum", "Special", "Derivative", "VisualShaderNodeVectorDerivativeFunc", TTR("(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and 'y'."), VisualShaderNodeVectorDerivativeFunc::FUNC_SUM, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true)); + add_options.push_back(AddOption("SumS", "Special", "Derivative", "VisualShaderNodeScalarDerivativeFunc", TTR("(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and 'y'."), VisualShaderNodeScalarDerivativeFunc::FUNC_SUM, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true)); ///////////////////////////////////////////////////////////////////// @@ -2473,6 +2728,7 @@ public: class VisualShaderNodePluginDefaultEditor : public VBoxContainer { GDCLASS(VisualShaderNodePluginDefaultEditor, VBoxContainer); + Ref<Resource> parent_resource; public: void _property_changed(const String &prop, const Variant &p_value, const String &p_field, bool p_changing = false) { @@ -2486,7 +2742,27 @@ public: undo_redo->create_action(TTR("Edit Visual Property") + ": " + prop, UndoRedo::MERGE_ENDS); undo_redo->add_do_property(node.ptr(), prop, p_value); undo_redo->add_undo_property(node.ptr(), prop, node->get(prop)); + + if (p_value.get_type() == Variant::OBJECT) { + + RES prev_res = node->get(prop); + RES curr_res = p_value; + + if (curr_res.is_null()) { + undo_redo->add_do_method(this, "_open_inspector", (RES)parent_resource.ptr()); + } else { + undo_redo->add_do_method(this, "_open_inspector", (RES)curr_res.ptr()); + } + if (!prev_res.is_null()) { + undo_redo->add_undo_method(this, "_open_inspector", (RES)prev_res.ptr()); + } else { + undo_redo->add_undo_method(this, "_open_inspector", (RES)parent_resource.ptr()); + } + undo_redo->add_do_method(this, "_refresh_request"); + undo_redo->add_undo_method(this, "_refresh_request"); + } undo_redo->commit_action(); + updating = false; } @@ -2502,11 +2778,20 @@ public: VisualShaderEditor::get_singleton()->call_deferred("_update_graph"); } + void _resource_selected(const String &p_path, RES p_resource) { + _open_inspector(p_resource); + } + + void _open_inspector(RES p_resource) { + EditorNode::get_singleton()->get_inspector()->edit(p_resource.ptr()); + } + bool updating; Ref<VisualShaderNode> node; Vector<EditorProperty *> properties; - void setup(Vector<EditorProperty *> p_properties, const Vector<StringName> &p_names, Ref<VisualShaderNode> p_node) { + void setup(Ref<Resource> p_parent_resource, Vector<EditorProperty *> p_properties, const Vector<StringName> &p_names, Ref<VisualShaderNode> p_node) { + parent_resource = p_parent_resource; updating = false; node = p_node; properties = p_properties; @@ -2515,6 +2800,11 @@ public: add_child(p_properties[i]); + bool res_prop = Object::cast_to<EditorPropertyResource>(p_properties[i]); + if (res_prop) { + p_properties[i]->connect("resource_selected", this, "_resource_selected"); + } + properties[i]->connect("property_changed", this, "_property_changed"); properties[i]->set_object_and_property(node.ptr(), p_names[i]); properties[i]->update_property(); @@ -2528,10 +2818,12 @@ public: ClassDB::bind_method("_property_changed", &VisualShaderNodePluginDefaultEditor::_property_changed, DEFVAL(String()), DEFVAL(false)); ClassDB::bind_method("_node_changed", &VisualShaderNodePluginDefaultEditor::_node_changed); ClassDB::bind_method("_refresh_request", &VisualShaderNodePluginDefaultEditor::_refresh_request); + ClassDB::bind_method("_resource_selected", &VisualShaderNodePluginDefaultEditor::_resource_selected); + ClassDB::bind_method("_open_inspector", &VisualShaderNodePluginDefaultEditor::_open_inspector); } }; -Control *VisualShaderNodePluginDefault::create_editor(const Ref<VisualShaderNode> &p_node) { +Control *VisualShaderNodePluginDefault::create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node) { if (p_node->is_class("VisualShaderNodeInput")) { //create input @@ -2589,7 +2881,7 @@ Control *VisualShaderNodePluginDefault::create_editor(const Ref<VisualShaderNode properties.push_back(pinfo[i].name); } VisualShaderNodePluginDefaultEditor *editor = memnew(VisualShaderNodePluginDefaultEditor); - editor->setup(editors, properties, p_node); + editor->setup(p_parent_resource, editors, properties, p_node); return editor; } diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index 4274cc3d76..1556c7cd43 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -48,7 +48,7 @@ protected: static void _bind_methods(); public: - virtual Control *create_editor(const Ref<VisualShaderNode> &p_node); + virtual Control *create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node); }; class VisualShaderEditor : public VBoxContainer { @@ -60,14 +60,18 @@ class VisualShaderEditor : public VBoxContainer { int editing_port; Ref<VisualShader> visual_shader; + HSplitContainer *main_box; GraphEdit *graph; ToolButton *add_node; + ToolButton *preview_shader; OptionButton *edit_type; PanelContainer *error_panel; Label *error_label; + TextEdit *preview_text; + UndoRedo *undo_redo; Point2 saved_node_pos; bool saved_node_pos_dirty; @@ -75,6 +79,8 @@ class VisualShaderEditor : public VBoxContainer { ConfirmationDialog *members_dialog; MenuButton *tools; + bool preview_showed; + enum ToolsMenuOptions { EXPAND_ALL, COLLAPSE_ALL @@ -103,8 +109,10 @@ class VisualShaderEditor : public VBoxContainer { int return_type; int func; float value; + bool highend; + bool is_custom; - AddOption(const String &p_name = String(), const String &p_category = String(), const String &p_sub_category = String(), const String &p_type = String(), const String &p_description = String(), int p_sub_func = -1, int p_return_type = -1, int p_mode = -1, int p_func = -1, float p_value = -1) { + AddOption(const String &p_name = String(), const String &p_category = String(), const String &p_sub_category = String(), const String &p_type = String(), const String &p_description = String(), int p_sub_func = -1, int p_return_type = -1, int p_mode = -1, int p_func = -1, float p_value = -1, bool p_highend = false) { name = p_name; type = p_type; category = p_category; @@ -115,9 +123,11 @@ class VisualShaderEditor : public VBoxContainer { mode = p_mode; func = p_func; value = p_value; + highend = p_highend; + is_custom = false; } - AddOption(const String &p_name, const String &p_category, const String &p_sub_category, const String &p_type, const String &p_description, const String &p_sub_func, int p_return_type = -1, int p_mode = -1, int p_func = -1, float p_value = -1) { + AddOption(const String &p_name, const String &p_category, const String &p_sub_category, const String &p_type, const String &p_description, const String &p_sub_func, int p_return_type = -1, int p_mode = -1, int p_func = -1, float p_value = -1, bool p_highend = false) { name = p_name; type = p_type; category = p_category; @@ -128,6 +138,8 @@ class VisualShaderEditor : public VBoxContainer { mode = p_mode; func = p_func; value = p_value; + highend = p_highend; + is_custom = false; } }; @@ -137,8 +149,12 @@ class VisualShaderEditor : public VBoxContainer { void _draw_color_over_button(Object *obj, Color p_color); void _add_node(int p_idx, int p_op_idx = -1); + void _update_custom_nodes(); void _update_options_menu(); + void _show_preview_text(); + void _update_preview(); + static VisualShaderEditor *singleton; void _node_dragged(const Vector2 &p_from, const Vector2 &p_to, int p_node); @@ -173,8 +189,21 @@ class VisualShaderEditor : public VBoxContainer { void _port_name_focus_out(Object *line_edit, int p_node_id, int p_port_id, bool p_output); + void _dup_copy_nodes(int p_type, List<int> &r_nodes, Set<int> &r_excluded); + void _dup_update_excluded(int p_type, Set<int> &r_excluded); + void _dup_paste_nodes(int p_type, int p_pasted_type, List<int> &r_nodes, Set<int> &r_excluded, const Vector2 &p_offset, bool p_select); + void _duplicate_nodes(); + Vector2 selection_center; + int copy_type; // shader type + List<int> copy_nodes_buffer; + Set<int> copy_nodes_excluded_buffer; + + void _clear_buffer(); + void _copy_nodes(); + void _paste_nodes(); + Vector<Ref<VisualShaderNodePlugin> > plugins; void _mode_selected(int p_id); @@ -224,8 +253,8 @@ public: static VisualShaderEditor *get_singleton() { return singleton; } - void add_custom_type(const String &p_name, const String &p_category, const Ref<Script> &p_script); - void remove_custom_type(const Ref<Script> &p_script); + 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); virtual Size2 get_minimum_size() const; void edit(VisualShader *p_visual_shader); @@ -256,7 +285,7 @@ class VisualShaderNodePluginDefault : public VisualShaderNodePlugin { GDCLASS(VisualShaderNodePluginDefault, VisualShaderNodePlugin); public: - virtual Control *create_editor(const Ref<VisualShaderNode> &p_node); + virtual Control *create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node); }; class EditorPropertyShaderMode : public EditorProperty { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index e013aae164..5709bdc3fa 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -52,6 +52,10 @@ #include "scene/gui/texture_rect.h" #include "scene/gui/tool_button.h" +static inline String get_project_key_from_path(const String &dir) { + return dir.replace("/", "::"); +} + class ProjectDialog : public ConfirmationDialog { GDCLASS(ProjectDialog, ConfirmationDialog); @@ -191,7 +195,7 @@ private: unzFile pkg = unzOpen2(valid_path.utf8().get_data(), &io); if (!pkg) { - set_message(TTR("Error opening package file, not in zip format."), MESSAGE_ERROR); + set_message(TTR("Error opening package file, not in ZIP format."), MESSAGE_ERROR); memdelete(d); get_ok()->set_disabled(true); unzClose(pkg); @@ -515,7 +519,7 @@ private: unzFile pkg = unzOpen2(zip_path.utf8().get_data(), &io); if (!pkg) { - dialog_error->set_text(TTR("Error opening package file, not in zip format.")); + dialog_error->set_text(TTR("Error opening package file, not in ZIP format.")); dialog_error->popup_centered_minsize(); return; } @@ -606,7 +610,7 @@ private: dir = dir.replace("\\", "/"); if (dir.ends_with("/")) dir = dir.substr(0, dir.length() - 1); - String proj = dir.replace("/", "::"); + String proj = get_project_key_from_path(dir); EditorSettings::get_singleton()->set("projects/" + proj, dir); EditorSettings::get_singleton()->save(); @@ -918,596 +922,987 @@ public: } }; -struct ProjectItem { - String project; - String project_name; - String path; - String conf; - String icon; - String main_scene; - uint64_t last_modified; - bool favorite; - bool grayed; - ProjectListFilter::FilterOption filter_order_option; - ProjectItem() {} - ProjectItem(const String &p_project, const String &p_name, const String &p_path, const String &p_conf, const String &p_icon, const String &p_main_scene, uint64_t p_last_modified, bool p_favorite = false, bool p_grayed = false, const ProjectListFilter::FilterOption p_filter_order_option = ProjectListFilter::FILTER_NAME) { - project = p_project; - project_name = p_name; - path = p_path; - conf = p_conf; - icon = p_icon; - main_scene = p_main_scene; - last_modified = p_last_modified; - favorite = p_favorite; - grayed = p_grayed; - filter_order_option = p_filter_order_option; - } - _FORCE_INLINE_ bool operator<(const ProjectItem &l) const { - switch (filter_order_option) { +class ProjectListItemControl : public HBoxContainer { + GDCLASS(ProjectListItemControl, HBoxContainer) +public: + TextureButton *favorite_button; + TextureRect *icon; + bool icon_needs_reload; + + ProjectListItemControl() { + favorite_button = NULL; + icon = NULL; + icon_needs_reload = true; + } + + void set_is_favorite(bool fav) { + favorite_button->set_modulate(fav ? Color(1, 1, 1, 1) : Color(1, 1, 1, 0.2)); + } +}; + +class ProjectList : public ScrollContainer { + GDCLASS(ProjectList, ScrollContainer) +public: + static const char *SIGNAL_SELECTION_CHANGED; + static const char *SIGNAL_PROJECT_ASK_OPEN; + + // Can often be passed by copy + struct Item { + String project_key; + String project_name; + String path; + String icon; + String main_scene; + uint64_t last_modified; + bool favorite; + bool grayed; + bool missing; + int version; + + ProjectListItemControl *control; + + Item() {} + + Item(const String &p_project, + const String &p_name, + const String &p_path, + const String &p_icon, + const String &p_main_scene, + uint64_t p_last_modified, + bool p_favorite, + bool p_grayed, + bool p_missing, + int p_version) { + + project_key = p_project; + project_name = p_name; + path = p_path; + icon = p_icon; + main_scene = p_main_scene; + last_modified = p_last_modified; + favorite = p_favorite; + grayed = p_grayed; + missing = p_missing; + version = p_version; + control = NULL; + } + + _FORCE_INLINE_ bool operator==(const Item &l) const { + return project_key == l.project_key; + } + }; + + ProjectList(); + ~ProjectList(); + + void load_projects(); + void set_search_term(String p_search_term); + void set_order_option(ProjectListFilter::FilterOption p_option); + void sort_projects(); + int get_project_count() const; + void select_project(int p_index); + void erase_selected_projects(); + Vector<Item> get_selected_projects() const; + const Set<String> &get_selected_project_keys() const; + void ensure_project_visible(int p_index); + int get_single_selected_index() const; + bool is_any_project_missing() const; + void erase_missing_projects(); + int refresh_project(const String &dir_path); + +private: + static void _bind_methods(); + void _notification(int p_what); + + void _panel_draw(Node *p_hb); + void _panel_input(const Ref<InputEvent> &p_ev, Node *p_hb); + void _favorite_pressed(Node *p_hb); + void _show_project(const String &p_path); + + void select_range(int p_begin, int p_end); + void toggle_select(int p_index); + void create_project_item_control(int p_index); + void remove_project(int p_index, bool p_update_settings); + void update_icons_async(); + void load_project_icon(int p_index); + + static void load_project_data(const String &p_property_key, Item &p_item, bool p_favorite); + + String _search_term; + ProjectListFilter::FilterOption _order_option; + Set<String> _selected_project_keys; + String _last_clicked; // Project key + VBoxContainer *_scroll_children; + int _icon_load_index; + + Vector<Item> _projects; +}; + +struct ProjectListComparator { + ProjectListFilter::FilterOption order_option; + + // operator< + _FORCE_INLINE_ bool operator()(const ProjectList::Item &a, const ProjectList::Item &b) const { + if (a.favorite && !b.favorite) { + return true; + } + if (b.favorite && !a.favorite) { + return false; + } + switch (order_option) { case ProjectListFilter::FILTER_PATH: - return project < l.project; + return a.project_key < b.project_key; case ProjectListFilter::FILTER_MODIFIED: - return last_modified > l.last_modified; + return a.last_modified > b.last_modified; default: - return project_name < l.project_name; + return a.project_name < b.project_name; } } - _FORCE_INLINE_ bool operator==(const ProjectItem &l) const { return project == l.project; } }; -void ProjectManager::_notification(int p_what) { +ProjectList::ProjectList() { + _order_option = ProjectListFilter::FILTER_MODIFIED; - switch (p_what) { - case NOTIFICATION_ENTER_TREE: { + _scroll_children = memnew(VBoxContainer); + _scroll_children->set_h_size_flags(SIZE_EXPAND_FILL); + add_child(_scroll_children); - Engine::get_singleton()->set_editor_hint(false); - } break; - case NOTIFICATION_READY: { + _icon_load_index = 0; +} - if (scroll_children->get_child_count() == 0 && StreamPeerSSL::is_available()) - open_templates->popup_centered_minsize(); - } break; - case NOTIFICATION_VISIBILITY_CHANGED: { +ProjectList::~ProjectList() { +} - set_process_unhandled_input(is_visible_in_tree()); - } break; - case NOTIFICATION_WM_QUIT_REQUEST: { +void ProjectList::update_icons_async() { + _icon_load_index = 0; + set_process(true); +} - _dim_window(); - } break; +void ProjectList::_notification(int p_what) { + if (p_what == NOTIFICATION_PROCESS) { + + // Load icons as a coroutine to speed up launch when you have hundreds of projects + if (_icon_load_index < _projects.size()) { + Item &item = _projects.write[_icon_load_index]; + if (item.control->icon_needs_reload) { + load_project_icon(_icon_load_index); + } + _icon_load_index++; + + } else { + set_process(false); + } } } -void ProjectManager::_dim_window() { - - // This method must be called before calling `get_tree()->quit()`. - // Otherwise, its effect won't be visible +void ProjectList::load_project_icon(int p_index) { + Item &item = _projects.write[p_index]; + + Ref<Texture> default_icon = get_icon("DefaultProjectIcon", "EditorIcons"); + Ref<Texture> icon; + if (item.icon != "") { + Ref<Image> img; + img.instance(); + Error err = img->load(item.icon.replace_first("res://", item.path + "/")); + if (err == OK) { + + img->resize(default_icon->get_width(), default_icon->get_height(), Image::INTERPOLATE_LANCZOS); + Ref<ImageTexture> it = memnew(ImageTexture); + it->create_from_image(img); + icon = it; + } + } + if (icon.is_null()) { + icon = default_icon; + } - // Dim the project manager window while it's quitting to make it clearer that it's busy. - // No transition is applied, as the effect needs to be visible immediately - float c = 1.0f - float(EDITOR_GET("interface/editor/dim_amount")); - Color dim_color = Color(c, c, c); - gui_base->set_modulate(dim_color); + item.control->icon->set_texture(icon); + item.control->icon_needs_reload = false; } -void ProjectManager::_panel_draw(Node *p_hb) { +void ProjectList::load_project_data(const String &p_property_key, Item &p_item, bool p_favorite) { - HBoxContainer *hb = Object::cast_to<HBoxContainer>(p_hb); + String path = EditorSettings::get_singleton()->get(p_property_key); + String conf = path.plus_file("project.godot"); + bool grayed = false; + bool missing = false; - hb->draw_line(Point2(0, hb->get_size().y + 1), Point2(hb->get_size().x - 10, hb->get_size().y + 1), get_color("guide_color", "Tree")); + Ref<ConfigFile> cf = memnew(ConfigFile); + Error cf_err = cf->load(conf); + + int config_version = 0; + String project_name = TTR("Unnamed Project"); + if (cf_err == OK) { + String cf_project_name = static_cast<String>(cf->get_value("application", "config/name", "")); + if (cf_project_name != "") + project_name = cf_project_name.xml_unescape(); + config_version = (int)cf->get_value("", "config_version", 0); + } - if (selected_list.has(hb->get_meta("name"))) { - hb->draw_style_box(gui_base->get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0) * EDSCALE)); + if (config_version > ProjectSettings::CONFIG_VERSION) { + // Comes from an incompatible (more recent) Godot version, grey it out + grayed = true; } + + String icon = cf->get_value("application", "config/icon", ""); + String main_scene = cf->get_value("application", "run/main_scene", ""); + + uint64_t last_modified = 0; + if (FileAccess::exists(conf)) { + last_modified = FileAccess::get_modified_time(conf); + + String fscache = path.plus_file(".fscache"); + if (FileAccess::exists(fscache)) { + uint64_t cache_modified = FileAccess::get_modified_time(fscache); + if (cache_modified > last_modified) + last_modified = cache_modified; + } + } else { + grayed = true; + missing = true; + print_line("Project is missing: " + conf); + } + + String project_key = p_property_key.get_slice("/", 1); + + p_item = Item(project_key, project_name, path, icon, main_scene, last_modified, p_favorite, grayed, missing, config_version); } -void ProjectManager::_update_project_buttons() { - for (int i = 0; i < scroll_children->get_child_count(); i++) { +void ProjectList::load_projects() { + // This is a full, hard reload of the list. Don't call this unless really required, it's expensive. + // If you have 150 projects, it may read through 150 files on your disk at once + load 150 icons. - CanvasItem *item = Object::cast_to<CanvasItem>(scroll_children->get_child(i)); - item->update(); + // Clear whole list + for (int i = 0; i < _projects.size(); ++i) { + Item &project = _projects.write[i]; + CRASH_COND(project.control == NULL); + memdelete(project.control); // Why not queue_free()? } + _projects.clear(); + _last_clicked = ""; + _selected_project_keys.clear(); - bool empty_selection = selected_list.empty(); - erase_btn->set_disabled(empty_selection); - open_btn->set_disabled(empty_selection); - rename_btn->set_disabled(empty_selection); - run_btn->set_disabled(empty_selection); - - bool missing_projects = false; - Map<String, String> list_all_projects; - for (int i = 0; i < scroll_children->get_child_count(); i++) { - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - if (hb) { - list_all_projects.insert(hb->get_meta("name"), hb->get_meta("main_scene")); + // Load data + // TODO Would be nice to change how projects and favourites are stored... it complicates things a bit. + // Use a dictionary associating project path to metadata (like is_favorite). + + List<PropertyInfo> properties; + EditorSettings::get_singleton()->get_property_list(&properties); + + Set<String> favorites; + // Find favourites... + for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) { + String property_key = E->get().name; + if (property_key.begins_with("favorite_projects/")) { + favorites.insert(property_key); } } - for (Map<String, String>::Element *E = list_all_projects.front(); E; E = E->next()) { - String project_name = E->key().replace(":::", ":/").replace("::", "/") + "/project.godot"; - if (!FileAccess::exists(project_name)) { - missing_projects = true; - break; - } + + for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) { + // This is actually something like "projects/C:::Documents::Godot::Projects::MyGame" + String property_key = E->get().name; + if (!property_key.begins_with("projects/")) + continue; + + String project_key = property_key.get_slice("/", 1); + bool favorite = favorites.has("favorite_projects/" + project_key); + + Item item; + load_project_data(property_key, item, favorite); + + _projects.push_back(item); } - erase_missing_btn->set_visible(missing_projects); + // Create controls + for (int i = 0; i < _projects.size(); ++i) { + create_project_item_control(i); + } + + sort_projects(); + + set_v_scroll(0); + + update_icons_async(); } -void ProjectManager::_panel_input(const Ref<InputEvent> &p_ev, Node *p_hb) { +void ProjectList::create_project_item_control(int p_index) { - Ref<InputEventMouseButton> mb = p_ev; + // Will be added last in the list, so make sure indexes match + ERR_FAIL_COND(p_index != _scroll_children->get_child_count()); - if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { + Item &item = _projects.write[p_index]; + ERR_FAIL_COND(item.control != NULL); // Already created - String clicked = p_hb->get_meta("name"); - String clicked_main_scene = p_hb->get_meta("main_scene"); + Ref<Texture> favorite_icon = get_icon("Favorites", "EditorIcons"); + Color font_color = get_color("font_color", "Tree"); + + ProjectListItemControl *hb = memnew(ProjectListItemControl); + hb->connect("draw", this, "_panel_draw", varray(hb)); + hb->connect("gui_input", this, "_panel_input", varray(hb)); + hb->add_constant_override("separation", 10 * EDSCALE); + + VBoxContainer *favorite_box = memnew(VBoxContainer); + favorite_box->set_name("FavoriteBox"); + TextureButton *favorite = memnew(TextureButton); + favorite->set_name("FavoriteButton"); + favorite->set_normal_texture(favorite_icon); + favorite->connect("pressed", this, "_favorite_pressed", varray(hb)); + favorite_box->add_child(favorite); + favorite_box->set_alignment(BoxContainer::ALIGN_CENTER); + hb->add_child(favorite_box); + hb->favorite_button = favorite; + hb->set_is_favorite(item.favorite); + + TextureRect *tf = memnew(TextureRect); + tf->set_texture(get_icon("DefaultProjectIcon", "EditorIcons")); + if (item.missing) { + tf->set_modulate(Color(1, 1, 1, 0.5)); + } + hb->add_child(tf); + hb->icon = tf; - if (mb->get_shift() && selected_list.size() > 0 && last_clicked != "" && clicked != last_clicked) { + VBoxContainer *vb = memnew(VBoxContainer); + if (item.grayed) + vb->set_modulate(Color(1, 1, 1, 0.5)); + vb->set_h_size_flags(SIZE_EXPAND_FILL); + hb->add_child(vb); + Control *ec = memnew(Control); + ec->set_custom_minimum_size(Size2(0, 1)); + ec->set_mouse_filter(MOUSE_FILTER_PASS); + vb->add_child(ec); + Label *title = memnew(Label(!item.missing ? item.project_name : TTR("Missing Project"))); + title->add_font_override("font", get_font("title", "EditorFonts")); + title->add_color_override("font_color", font_color); + title->set_clip_text(true); + vb->add_child(title); + + HBoxContainer *path_hb = memnew(HBoxContainer); + path_hb->set_h_size_flags(SIZE_EXPAND_FILL); + vb->add_child(path_hb); + + Button *show = memnew(Button); + // Display a folder icon if the project directory can be opened, or a "broken file" icon if it can't + show->set_icon(get_icon(!item.missing ? "Load" : "FileBroken", "EditorIcons")); + show->set_flat(true); + if (!item.grayed) { + // Don't make the icon less prominent if the parent is already grayed out + show->set_modulate(Color(1, 1, 1, 0.5)); + } + path_hb->add_child(show); - int clicked_id = -1; - int last_clicked_id = -1; - for (int i = 0; i < scroll_children->get_child_count(); i++) { - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - if (!hb) continue; - if (hb->get_meta("name") == clicked) clicked_id = i; - if (hb->get_meta("name") == last_clicked) last_clicked_id = i; - } + if (!item.missing) { + show->connect("pressed", this, "_show_project", varray(item.path)); + show->set_tooltip(TTR("Show in File Manager")); + } else { + show->set_tooltip(TTR("Error: Project is missing on the filesystem.")); + } - if (last_clicked_id != -1 && clicked_id != -1) { - int min = clicked_id < last_clicked_id ? clicked_id : last_clicked_id; - int max = clicked_id > last_clicked_id ? clicked_id : last_clicked_id; - for (int i = 0; i < scroll_children->get_child_count(); ++i) { - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - if (!hb) continue; - if (i != clicked_id && (i < min || i > max) && !mb->get_control()) { - selected_list.erase(hb->get_meta("name")); - } else if (i >= min && i <= max) { - selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene")); - } - } - } + Label *fpath = memnew(Label(item.path)); + path_hb->add_child(fpath); + fpath->set_h_size_flags(SIZE_EXPAND_FILL); + fpath->set_modulate(Color(1, 1, 1, 0.5)); + fpath->add_color_override("font_color", font_color); + fpath->set_clip_text(true); - } else if (selected_list.has(clicked) && mb->get_control()) { + _scroll_children->add_child(hb); + item.control = hb; +} - selected_list.erase(clicked); +void ProjectList::set_search_term(String p_search_term) { + _search_term = p_search_term; +} - } else { +void ProjectList::set_order_option(ProjectListFilter::FilterOption p_option) { + if (_order_option != p_option) { + _order_option = p_option; + EditorSettings::get_singleton()->set("project_manager/sorting_order", (int)_order_option); + EditorSettings::get_singleton()->save(); + } +} - last_clicked = clicked; - if (mb->get_control() || selected_list.size() == 0) { - selected_list.insert(clicked, clicked_main_scene); +void ProjectList::sort_projects() { + + SortArray<Item, ProjectListComparator> sorter; + sorter.compare.order_option = _order_option; + sorter.sort(_projects.ptrw(), _projects.size()); + + for (int i = 0; i < _projects.size(); ++i) { + Item &item = _projects.write[i]; + + bool visible = true; + if (_search_term != "") { + + String search_path; + if (_search_term.find("/") != -1) { + // Search path will match the whole path + search_path = item.path; } else { - selected_list.clear(); - selected_list.insert(clicked, clicked_main_scene); + // Search path will only match the last path component to make searching more strict + search_path = item.path.get_file(); } + + // When searching, display projects whose name or path contain the search term + visible = item.project_name.findn(_search_term) != -1 || search_path.findn(_search_term) != -1; + } + + item.control->set_visible(visible); + } + + for (int i = 0; i < _projects.size(); ++i) { + Item &item = _projects.write[i]; + if (item.control->is_visible()) { + item.control->get_parent()->move_child(item.control, i); } + } + + // Rewind the coroutine because order of projects changed + update_icons_async(); +} - _update_project_buttons(); +const Set<String> &ProjectList::get_selected_project_keys() const { + // Faster if that's all you need + return _selected_project_keys; +} - if (mb->is_doubleclick()) - _open_selected_projects_ask(); //open if doubleclicked +Vector<ProjectList::Item> ProjectList::get_selected_projects() const { + Vector<Item> items; + if (_selected_project_keys.size() == 0) { + return items; + } + items.resize(_selected_project_keys.size()); + int j = 0; + for (int i = 0; i < _projects.size(); ++i) { + const Item &item = _projects[i]; + if (_selected_project_keys.has(item.project_key)) { + items.write[j++] = item; + } } + ERR_FAIL_COND_V(j != items.size(), items); + return items; } -void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) { +void ProjectList::ensure_project_visible(int p_index) { + const Item &item = _projects[p_index]; - Ref<InputEventKey> k = p_ev; + int item_top = item.control->get_position().y; + int item_bottom = item.control->get_position().y + item.control->get_size().y; - if (k.is_valid()) { + if (item_top < get_v_scroll()) { + set_v_scroll(item_top); - if (!k->is_pressed()) - return; + } else if (item_bottom > get_v_scroll() + get_size().y) { + set_v_scroll(item_bottom - get_size().y); + } +} - if (tabs->get_current_tab() != 0) - return; +int ProjectList::get_single_selected_index() const { + if (_selected_project_keys.size() == 0) { + // Default selection + return 0; + } + String key; + if (_selected_project_keys.size() == 1) { + // Only one selected + key = _selected_project_keys.front()->get(); + } else { + // Multiple selected, consider the last clicked one as "main" + key = _last_clicked; + } + for (int i = 0; i < _projects.size(); ++i) { + if (_projects[i].project_key == key) { + return i; + } + } + return 0; +} - bool scancode_handled = true; +void ProjectList::remove_project(int p_index, bool p_update_settings) { + const Item item = _projects[p_index]; // Take a copy - switch (k->get_scancode()) { + _selected_project_keys.erase(item.project_key); - case KEY_ENTER: { + if (_last_clicked == item.project_key) { + _last_clicked = ""; + } - _open_selected_projects_ask(); - } break; - case KEY_DELETE: { + memdelete(item.control); + _projects.remove(p_index); - _erase_project(); - } break; - case KEY_HOME: { + if (p_update_settings) { + EditorSettings::get_singleton()->erase("projects/" + item.project_key); + EditorSettings::get_singleton()->erase("favorite_projects/" + item.project_key); + // Not actually saving the file, in case you are doing more changes to settings + } +} - for (int i = 0; i < scroll_children->get_child_count(); i++) { +bool ProjectList::is_any_project_missing() const { + for (int i = 0; i < _projects.size(); ++i) { + if (_projects[i].missing) { + return true; + } + } + return false; +} - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - if (hb) { - selected_list.clear(); - selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene")); - scroll->set_v_scroll(0); - _update_project_buttons(); - break; - } - } +void ProjectList::erase_missing_projects() { - } break; - case KEY_END: { + if (_projects.empty()) { + return; + } - for (int i = scroll_children->get_child_count() - 1; i >= 0; i--) { + int deleted_count = 0; + int remaining_count = 0; - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - if (hb) { - selected_list.clear(); - selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene")); - scroll->set_v_scroll(scroll_children->get_size().y); - _update_project_buttons(); - break; - } - } + for (int i = 0; i < _projects.size(); ++i) { + const Item &item = _projects[i]; - } break; - case KEY_UP: { + if (item.missing) { + remove_project(i, true); + --i; + ++deleted_count; - if (k->get_shift()) - break; + } else { + ++remaining_count; + } + } - if (selected_list.size()) { + print_line("Removed " + itos(deleted_count) + " projects from the list, remaining " + itos(remaining_count) + " projects"); - bool found = false; + EditorSettings::get_singleton()->save(); +} - for (int i = scroll_children->get_child_count() - 1; i >= 0; i--) { +int ProjectList::refresh_project(const String &dir_path) { + // Reads editor settings and reloads information about a specific project. + // If it wasn't loaded and should be in the list, it is added (i.e new project). + // If it isn't in the list anymore, it is removed. + // If it is in the list but doesn't exist anymore, it is marked as missing. - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - if (!hb) continue; + String project_key = get_project_key_from_path(dir_path); - String current = hb->get_meta("name"); + // Read project manager settings + bool is_favourite = false; + bool should_be_in_list = false; + String property_key = "projects/" + project_key; + { + List<PropertyInfo> properties; + EditorSettings::get_singleton()->get_property_list(&properties); + String favorite_property_key = "favorite_projects/" + project_key; + + bool found = false; + for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) { + String prop = E->get().name; + if (!found && prop == property_key) { + found = true; + } else if (!is_favourite && prop == favorite_property_key) { + is_favourite = true; + } + } - if (found) { - selected_list.clear(); - selected_list.insert(current, hb->get_meta("main_scene")); + should_be_in_list = found; + } - int offset_diff = scroll->get_v_scroll() - hb->get_position().y; + bool was_selected = _selected_project_keys.has(project_key); - if (offset_diff > 0) - scroll->set_v_scroll(scroll->get_v_scroll() - offset_diff); + // Remove item in any case + for (int i = 0; i < _projects.size(); ++i) { + const Item &existing_item = _projects[i]; + if (existing_item.path == dir_path) { + remove_project(i, false); + break; + } + } - _update_project_buttons(); + int index = -1; + if (should_be_in_list) { + // Recreate it with updated info - break; + Item item; + load_project_data(property_key, item, is_favourite); - } else if (current == selected_list.back()->key()) { + _projects.push_back(item); + create_project_item_control(_projects.size() - 1); - found = true; - } - } + sort_projects(); - break; + for (int i = 0; i < _projects.size(); ++i) { + if (_projects[i].project_key == project_key) { + if (was_selected) { + select_project(i); + ensure_project_visible(i); } - FALLTHROUGH; + load_project_icon(i); + index = i; + break; } - case KEY_DOWN: { + } + } - if (k->get_shift()) - break; + return index; +} - bool found = selected_list.empty(); +int ProjectList::get_project_count() const { + return _projects.size(); +} - for (int i = 0; i < scroll_children->get_child_count(); i++) { +void ProjectList::select_project(int p_index) { - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - if (!hb) continue; + Vector<Item> previous_selected_items = get_selected_projects(); + _selected_project_keys.clear(); - String current = hb->get_meta("name"); + for (int i = 0; i < previous_selected_items.size(); ++i) { + previous_selected_items[i].control->update(); + } - if (found) { - selected_list.clear(); - selected_list.insert(current, hb->get_meta("main_scene")); + toggle_select(p_index); +} + +inline void sort(int &a, int &b) { + if (a > b) { + int temp = a; + a = b; + b = temp; + } +} + +void ProjectList::select_range(int p_begin, int p_end) { + sort(p_begin, p_end); + select_project(p_begin); + for (int i = p_begin + 1; i <= p_end; ++i) { + toggle_select(i); + } +} - int last_y_visible = scroll->get_v_scroll() + scroll->get_size().y; - int offset_diff = (hb->get_position().y + hb->get_size().y) - last_y_visible; +void ProjectList::toggle_select(int p_index) { + Item &item = _projects.write[p_index]; + if (_selected_project_keys.has(item.project_key)) { + _selected_project_keys.erase(item.project_key); + } else { + _selected_project_keys.insert(item.project_key); + } + item.control->update(); +} - if (offset_diff > 0) - scroll->set_v_scroll(scroll->get_v_scroll() + offset_diff); +void ProjectList::erase_selected_projects() { - _update_project_buttons(); + if (_selected_project_keys.size() == 0) { + return; + } - break; + for (int i = 0; i < _projects.size(); ++i) { + Item &item = _projects.write[i]; + if (_selected_project_keys.has(item.project_key) && item.control->is_visible()) { - } else if (current == selected_list.back()->key()) { + EditorSettings::get_singleton()->erase("projects/" + item.project_key); + EditorSettings::get_singleton()->erase("favorite_projects/" + item.project_key); - found = true; - } + memdelete(item.control); + _projects.remove(i); + --i; + } + } + + EditorSettings::get_singleton()->save(); + + _selected_project_keys.clear(); + _last_clicked = ""; +} + +// Draws selected project highlight +void ProjectList::_panel_draw(Node *p_hb) { + Control *hb = Object::cast_to<Control>(p_hb); + + hb->draw_line(Point2(0, hb->get_size().y + 1), Point2(hb->get_size().x - 10, hb->get_size().y + 1), get_color("guide_color", "Tree")); + + String key = _projects[p_hb->get_index()].project_key; + + if (_selected_project_keys.has(key)) { + hb->draw_style_box(get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0) * EDSCALE)); + } +} + +// Input for each item in the list +void ProjectList::_panel_input(const Ref<InputEvent> &p_ev, Node *p_hb) { + + Ref<InputEventMouseButton> mb = p_ev; + int clicked_index = p_hb->get_index(); + const Item &clicked_project = _projects[clicked_index]; + + if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { + + if (mb->get_shift() && _selected_project_keys.size() > 0 && _last_clicked != "" && clicked_project.project_key != _last_clicked) { + + int anchor_index = -1; + for (int i = 0; i < _projects.size(); ++i) { + const Item &p = _projects[i]; + if (p.project_key == _last_clicked) { + anchor_index = p.control->get_index(); + break; } + } + CRASH_COND(anchor_index == -1); + select_range(anchor_index, clicked_index); - } break; - case KEY_F: { - if (k->get_command()) - this->project_filter->search_box->grab_focus(); - else - scancode_handled = false; - } break; - default: { - scancode_handled = false; - } break; + } else if (mb->get_control()) { + toggle_select(clicked_index); + + } else { + _last_clicked = clicked_project.project_key; + select_project(clicked_index); } - if (scancode_handled) { - accept_event(); + emit_signal(SIGNAL_SELECTION_CHANGED); + + if (mb->is_doubleclick()) { + emit_signal(SIGNAL_PROJECT_ASK_OPEN); } } } -void ProjectManager::_favorite_pressed(Node *p_hb) { +void ProjectList::_favorite_pressed(Node *p_hb) { - String clicked = p_hb->get_meta("name"); - bool favorite = !p_hb->get_meta("favorite"); - String proj = clicked.replace(":::", ":/"); - proj = proj.replace("::", "/"); + ProjectListItemControl *control = Object::cast_to<ProjectListItemControl>(p_hb); - if (favorite) { - EditorSettings::get_singleton()->set("favorite_projects/" + clicked, proj); + int index = control->get_index(); + Item item = _projects.write[index]; // Take copy + + item.favorite = !item.favorite; + + if (item.favorite) { + EditorSettings::get_singleton()->set("favorite_projects/" + item.project_key, item.path); } else { - EditorSettings::get_singleton()->erase("favorite_projects/" + clicked); + EditorSettings::get_singleton()->erase("favorite_projects/" + item.project_key); } EditorSettings::get_singleton()->save(); - call_deferred("_load_recent_projects"); + + _projects.write[index] = item; + + control->set_is_favorite(item.favorite); + + sort_projects(); + + if (item.favorite) { + for (int i = 0; i < _projects.size(); ++i) { + if (_projects[i].project_key == item.project_key) { + ensure_project_visible(i); + break; + } + } + } } -void ProjectManager::_load_recent_projects() { +void ProjectList::_show_project(const String &p_path) { + + OS::get_singleton()->shell_open(String("file://") + p_path); +} + +const char *ProjectList::SIGNAL_SELECTION_CHANGED = "selection_changed"; +const char *ProjectList::SIGNAL_PROJECT_ASK_OPEN = "project_ask_open"; - ProjectListFilter::FilterOption filter_option = project_filter->get_filter_option(); - String search_term = project_filter->get_search_term(); +void ProjectList::_bind_methods() { - while (scroll_children->get_child_count() > 0) { - memdelete(scroll_children->get_child(0)); + ClassDB::bind_method("_panel_draw", &ProjectList::_panel_draw); + ClassDB::bind_method("_panel_input", &ProjectList::_panel_input); + ClassDB::bind_method("_favorite_pressed", &ProjectList::_favorite_pressed); + ClassDB::bind_method("_show_project", &ProjectList::_show_project); + + ADD_SIGNAL(MethodInfo(SIGNAL_SELECTION_CHANGED)); + ADD_SIGNAL(MethodInfo(SIGNAL_PROJECT_ASK_OPEN)); +} + +void ProjectManager::_notification(int p_what) { + + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { + + Engine::get_singleton()->set_editor_hint(false); + } break; + case NOTIFICATION_READY: { + + if (_project_list->get_project_count() == 0 && StreamPeerSSL::is_available()) + open_templates->popup_centered_minsize(); + } break; + case NOTIFICATION_VISIBILITY_CHANGED: { + + set_process_unhandled_input(is_visible_in_tree()); + } break; + case NOTIFICATION_WM_QUIT_REQUEST: { + + _dim_window(); + } break; } +} - Map<String, String> selected_list_copy = selected_list; +void ProjectManager::_dim_window() { - List<PropertyInfo> properties; - EditorSettings::get_singleton()->get_property_list(&properties); + // This method must be called before calling `get_tree()->quit()`. + // Otherwise, its effect won't be visible - Color font_color = gui_base->get_color("font_color", "Tree"); + // Dim the project manager window while it's quitting to make it clearer that it's busy. + // No transition is applied, as the effect needs to be visible immediately + float c = 0.4f; + Color dim_color = Color(c, c, c); + gui_base->set_modulate(dim_color); +} - ProjectListFilter::FilterOption filter_order_option = project_order_filter->get_filter_option(); - EditorSettings::get_singleton()->set("project_manager/sorting_order", (int)filter_order_option); +void ProjectManager::_update_project_buttons() { - List<ProjectItem> projects; - List<ProjectItem> favorite_projects; + Vector<ProjectList::Item> selected_projects = _project_list->get_selected_projects(); + bool empty_selection = selected_projects.empty(); - for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) { + bool is_missing_project_selected = false; + for (int i = 0; i < selected_projects.size(); ++i) { + if (selected_projects[i].missing) { + is_missing_project_selected = true; + break; + } + } - String _name = E->get().name; - if (!_name.begins_with("projects/") && !_name.begins_with("favorite_projects/")) - continue; + erase_btn->set_disabled(empty_selection); + open_btn->set_disabled(empty_selection || is_missing_project_selected); + rename_btn->set_disabled(empty_selection || is_missing_project_selected); + run_btn->set_disabled(empty_selection || is_missing_project_selected); - String path = EditorSettings::get_singleton()->get(_name); - if (filter_option == ProjectListFilter::FILTER_PATH && search_term != "" && path.findn(search_term) == -1) - continue; + erase_missing_btn->set_visible(_project_list->is_any_project_missing()); +} - String project = _name.get_slice("/", 1); - String conf = path.plus_file("project.godot"); - bool favorite = (_name.begins_with("favorite_projects/")) ? true : false; - bool grayed = false; +void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) { - Ref<ConfigFile> cf = memnew(ConfigFile); - Error cf_err = cf->load(conf); + Ref<InputEventKey> k = p_ev; - int config_version = 0; - String project_name = TTR("Unnamed Project"); - if (cf_err == OK) { + if (k.is_valid()) { - String cf_project_name = static_cast<String>(cf->get_value("application", "config/name", "")); - if (cf_project_name != "") - project_name = cf_project_name.xml_unescape(); - config_version = (int)cf->get_value("", "config_version", 0); + if (!k->is_pressed()) { + return; } - if (config_version > ProjectSettings::CONFIG_VERSION) { - // Comes from an incompatible (more recent) Godot version, grey it out - grayed = true; + // Pressing Command + Q quits the Project Manager + // This is handled by the platform implementation on macOS, + // so only define the shortcut on other platforms +#ifndef OSX_ENABLED + if (k->get_scancode_with_modifiers() == (KEY_MASK_CMD | KEY_Q)) { + _dim_window(); + get_tree()->quit(); } +#endif - String icon = cf->get_value("application", "config/icon", ""); - String main_scene = cf->get_value("application", "run/main_scene", ""); + if (tabs->get_current_tab() != 0) + return; - uint64_t last_modified = 0; - if (FileAccess::exists(conf)) { - last_modified = FileAccess::get_modified_time(conf); + bool scancode_handled = true; - String fscache = path.plus_file(".fscache"); - if (FileAccess::exists(fscache)) { - uint64_t cache_modified = FileAccess::get_modified_time(fscache); - if (cache_modified > last_modified) - last_modified = cache_modified; - } - } else { - grayed = true; - } + switch (k->get_scancode()) { - ProjectItem item(project, project_name, path, conf, icon, main_scene, last_modified, favorite, grayed, filter_order_option); - if (favorite) - favorite_projects.push_back(item); - else - projects.push_back(item); - } - projects.sort(); - favorite_projects.sort(); + case KEY_ENTER: { - for (List<ProjectItem>::Element *E = projects.front(); E;) { - List<ProjectItem>::Element *next = E->next(); - if (favorite_projects.find(E->get()) != NULL) - projects.erase(E->get()); - E = next; - } - for (List<ProjectItem>::Element *E = favorite_projects.back(); E; E = E->prev()) { - projects.push_front(E->get()); - } + _open_selected_projects_ask(); + } break; + case KEY_DELETE: { - Ref<Texture> favorite_icon = get_icon("Favorites", "EditorIcons"); + _erase_project(); + } break; + case KEY_HOME: { - for (List<ProjectItem>::Element *E = projects.front(); E; E = E->next()) { + if (_project_list->get_project_count() > 0) { + _project_list->select_project(0); + _update_project_buttons(); + } - ProjectItem &item = E->get(); - String project = item.project; - String path = item.path; - String conf = item.conf; + } break; + case KEY_END: { - if (filter_option == ProjectListFilter::FILTER_NAME && search_term != "" && item.project_name.findn(search_term) == -1) - continue; + if (_project_list->get_project_count() > 0) { + _project_list->select_project(_project_list->get_project_count() - 1); + _update_project_buttons(); + } - Ref<Texture> icon; + } break; + case KEY_UP: { - if (item.icon != "") { - Ref<Image> img; - img.instance(); - Error err = img->load(item.icon.replace_first("res://", path + "/")); - if (err == OK) { + if (k->get_shift()) + break; - Ref<Texture> default_icon = get_icon("DefaultProjectIcon", "EditorIcons"); - img->resize(default_icon->get_width(), default_icon->get_height()); - Ref<ImageTexture> it = memnew(ImageTexture); - it->create_from_image(img); - icon = it; - } - } + int index = _project_list->get_single_selected_index(); + if (index - 1 > 0) { + _project_list->select_project(index - 1); + _project_list->ensure_project_visible(index - 1); + _update_project_buttons(); + } - if (icon.is_null()) { - icon = get_icon("DefaultProjectIcon", "EditorIcons"); - } + break; + } + case KEY_DOWN: { - selected_list_copy.erase(project); - - bool is_favorite = item.favorite; - bool is_grayed = item.grayed; - - HBoxContainer *hb = memnew(HBoxContainer); - hb->set_meta("name", project); - hb->set_meta("main_scene", item.main_scene); - hb->set_meta("favorite", is_favorite); - hb->connect("draw", this, "_panel_draw", varray(hb)); - hb->connect("gui_input", this, "_panel_input", varray(hb)); - hb->add_constant_override("separation", 10 * EDSCALE); - - VBoxContainer *favorite_box = memnew(VBoxContainer); - TextureButton *favorite = memnew(TextureButton); - favorite->set_normal_texture(favorite_icon); - if (!is_favorite) - favorite->set_modulate(Color(1, 1, 1, 0.2)); - favorite->connect("pressed", this, "_favorite_pressed", varray(hb)); - favorite_box->add_child(favorite); - favorite_box->set_alignment(BoxContainer::ALIGN_CENTER); - hb->add_child(favorite_box); - - TextureRect *tf = memnew(TextureRect); - tf->set_texture(icon); - hb->add_child(tf); + if (k->get_shift()) + break; - VBoxContainer *vb = memnew(VBoxContainer); - if (is_grayed) - vb->set_modulate(Color(0.5, 0.5, 0.5)); - vb->set_name("project"); - vb->set_h_size_flags(SIZE_EXPAND_FILL); - hb->add_child(vb); - Control *ec = memnew(Control); - ec->set_custom_minimum_size(Size2(0, 1)); - ec->set_mouse_filter(MOUSE_FILTER_PASS); - vb->add_child(ec); - Label *title = memnew(Label(item.project_name)); - title->add_font_override("font", gui_base->get_font("title", "EditorFonts")); - title->add_color_override("font_color", font_color); - title->set_clip_text(true); - vb->add_child(title); - - HBoxContainer *path_hb = memnew(HBoxContainer); - path_hb->set_name("path_box"); - path_hb->set_h_size_flags(SIZE_EXPAND_FILL); - vb->add_child(path_hb); - - Button *show = memnew(Button); - show->set_name("show"); - show->set_icon(get_icon("Filesystem", "EditorIcons")); - show->set_flat(true); - show->set_modulate(Color(1, 1, 1, 0.5)); - path_hb->add_child(show); - show->connect("pressed", this, "_show_project", varray(path)); - show->set_tooltip(TTR("Show in File Manager")); + int index = _project_list->get_single_selected_index(); + if (index + 1 < _project_list->get_project_count()) { + _project_list->select_project(index + 1); + _project_list->ensure_project_visible(index + 1); + _update_project_buttons(); + } - Label *fpath = memnew(Label(path)); - fpath->set_name("path"); - path_hb->add_child(fpath); - fpath->set_h_size_flags(SIZE_EXPAND_FILL); - fpath->set_modulate(Color(1, 1, 1, 0.5)); - fpath->add_color_override("font_color", font_color); - fpath->set_clip_text(true); + } break; + case KEY_F: { + if (k->get_command()) + this->project_filter->search_box->grab_focus(); + else + scancode_handled = false; + } break; + default: { + scancode_handled = false; + } break; + } - scroll_children->add_child(hb); + if (scancode_handled) { + accept_event(); + } } +} - for (Map<String, String>::Element *E = selected_list_copy.front(); E; E = E->next()) { - String key = E->key(); - selected_list.erase(key); - } +void ProjectManager::_load_recent_projects() { - scroll->set_v_scroll(0); + _project_list->set_order_option(project_order_filter->get_filter_option()); + _project_list->set_search_term(project_filter->get_search_term()); + _project_list->load_projects(); _update_project_buttons(); - EditorSettings::get_singleton()->save(); - tabs->set_current_tab(0); } void ProjectManager::_on_projects_updated() { - _load_recent_projects(); + Vector<ProjectList::Item> selected_projects = _project_list->get_selected_projects(); + int index = 0; + for (int i = 0; i < selected_projects.size(); ++i) { + index = _project_list->refresh_project(selected_projects[i].path); + } + if (index != -1) { + _project_list->ensure_project_visible(index); + } } void ProjectManager::_on_project_created(const String &dir) { project_filter->clear(); - bool has_already = false; - for (int i = 0; i < scroll_children->get_child_count(); i++) { - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - Label *fpath = Object::cast_to<Label>(hb->get_node(NodePath("project/path_box/path"))); - if (fpath->get_text() == dir) { - has_already = true; - break; - } - } - if (has_already) { - _update_scroll_position(dir); - } else { - _load_recent_projects(); - _update_scroll_position(dir); - } + int i = _project_list->refresh_project(dir); + _project_list->select_project(i); + _project_list->ensure_project_visible(i); _open_selected_projects_ask(); } -void ProjectManager::_update_scroll_position(const String &dir) { - for (int i = 0; i < scroll_children->get_child_count(); i++) { - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - Label *fpath = Object::cast_to<Label>(hb->get_node(NodePath("project/path_box/path"))); - if (fpath->get_text() == dir) { - last_clicked = hb->get_meta("name"); - selected_list.clear(); - selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene")); - _update_project_buttons(); - int last_y_visible = scroll->get_v_scroll() + scroll->get_size().y; - int offset_diff = (hb->get_position().y + hb->get_size().y) - last_y_visible; - - if (offset_diff > 0) - scroll->set_v_scroll(scroll->get_v_scroll() + offset_diff); - break; - } - } -} - void ProjectManager::_confirm_update_settings() { _open_selected_projects(); } void ProjectManager::_open_selected_projects() { - for (const Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) { - const String &selected = E->key(); + const Set<String> &selected_list = _project_list->get_selected_project_keys(); + + for (const Set<String>::Element *E = selected_list.front(); E; E = E->next()) { + const String &selected = E->get(); String path = EditorSettings::get_singleton()->get("projects/" + selected); String conf = path.plus_file("project.godot"); + if (!FileAccess::exists(conf)) { dialog_error->set_text(vformat(TTR("Can't open project at '%s'."), path)); dialog_error->popup_centered_minsize(); @@ -1540,6 +1935,8 @@ void ProjectManager::_open_selected_projects() { void ProjectManager::_open_selected_projects_ask() { + const Set<String> &selected_list = _project_list->get_selected_project_keys(); + if (selected_list.size() < 1) { return; } @@ -1550,22 +1947,14 @@ void ProjectManager::_open_selected_projects_ask() { return; } - // Update the project settings or don't open - String path = EditorSettings::get_singleton()->get("projects/" + selected_list.front()->key()); - String conf = path.plus_file("project.godot"); - - // FIXME: We already parse those in _load_recent_projects, we could instead make - // its `projects` list global and reuse its parsed metadata here. - Ref<ConfigFile> cf = memnew(ConfigFile); - Error cf_err = cf->load(conf); - - if (cf_err != OK) { - dialog_error->set_text(vformat(TTR("Can't open project at '%s'."), path)); - dialog_error->popup_centered_minsize(); + ProjectList::Item project = _project_list->get_selected_projects()[0]; + if (project.missing) { return; } - int config_version = (int)cf->get_value("", "config_version", 0); + // Update the project settings or don't open + String conf = project.path.plus_file("project.godot"); + int config_version = project.version; // Check if the config_version property was empty or 0 if (config_version == 0) { @@ -1581,7 +1970,7 @@ void ProjectManager::_open_selected_projects_ask() { } // Check if the file was generated by a newer, incompatible engine version if (config_version > ProjectSettings::CONFIG_VERSION) { - dialog_error->set_text(vformat(TTR("Can't open project at '%s'.") + "\n" + TTR("The project settings were created by a newer engine version, whose settings are not compatible with this version."), path)); + dialog_error->set_text(vformat(TTR("Can't open project at '%s'.") + "\n" + TTR("The project settings were created by a newer engine version, whose settings are not compatible with this version."), project.path)); dialog_error->popup_centered_minsize(); return; } @@ -1592,16 +1981,18 @@ void ProjectManager::_open_selected_projects_ask() { void ProjectManager::_run_project_confirm() { - for (Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) { + Vector<ProjectList::Item> selected_list = _project_list->get_selected_projects(); - const String &selected_main = E->get(); + for (int i = 0; i < selected_list.size(); ++i) { + + const String &selected_main = selected_list[i].main_scene; if (selected_main == "") { run_error_diag->set_text(TTR("Can't run project: no main scene defined.\nPlease edit the project and set the main scene in the Project Settings under the \"Application\" category.")); run_error_diag->popup_centered(); return; } - const String &selected = E->key(); + const String &selected = selected_list[i].project_key; String path = EditorSettings::get_singleton()->get("projects/" + selected); if (!DirAccess::exists(path + "/.import")) { @@ -1629,8 +2020,11 @@ void ProjectManager::_run_project_confirm() { } } +// When you press the "Run" button void ProjectManager::_run_project() { + const Set<String> &selected_list = _project_list->get_selected_project_keys(); + if (selected_list.size() < 1) { return; } @@ -1643,11 +2037,6 @@ void ProjectManager::_run_project() { } } -void ProjectManager::_show_project(const String &p_path) { - - OS::get_singleton()->shell_open(String("file://") + p_path); -} - void ProjectManager::_scan_dir(const String &path, List<String> *r_projects) { DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); da->change_dir(path); @@ -1673,7 +2062,7 @@ void ProjectManager::_scan_begin(const String &p_base) { print_line("Found " + itos(projects.size()) + " projects."); for (List<String>::Element *E = projects.front(); E; E = E->next()) { - String proj = E->get().replace("/", "::"); + String proj = get_project_key_from_path(E->get()); EditorSettings::get_singleton()->set("projects/" + proj, E->get()); } EditorSettings::get_singleton()->save(); @@ -1699,12 +2088,14 @@ void ProjectManager::_import_project() { void ProjectManager::_rename_project() { + const Set<String> &selected_list = _project_list->get_selected_project_keys(); + if (selected_list.size() == 0) { return; } - for (Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) { - const String &selected = E->key(); + for (Set<String>::Element *E = selected_list.front(); E; E = E->next()) { + const String &selected = E->get(); String path = EditorSettings::get_singleton()->get("projects/" + selected); npdialog->set_project_path(path); npdialog->set_mode(ProjectDialog::MODE_RENAME); @@ -1713,55 +2104,19 @@ void ProjectManager::_rename_project() { } void ProjectManager::_erase_project_confirm() { - - if (selected_list.size() == 0) { - return; - } - for (Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) { - EditorSettings::get_singleton()->erase("projects/" + E->key()); - EditorSettings::get_singleton()->erase("favorite_projects/" + E->key()); - } - EditorSettings::get_singleton()->save(); - selected_list.clear(); - last_clicked = ""; - _load_recent_projects(); + _project_list->erase_selected_projects(); + _update_project_buttons(); } void ProjectManager::_erase_missing_projects_confirm() { - - Map<String, String> list_all_projects; - for (int i = 0; i < scroll_children->get_child_count(); i++) { - HBoxContainer *hb = Object::cast_to<HBoxContainer>(scroll_children->get_child(i)); - if (hb) { - list_all_projects.insert(hb->get_meta("name"), hb->get_meta("main_scene")); - } - } - - if (list_all_projects.size() == 0) { - return; - } - - int deleted_projects = 0; - int remaining_projects = 0; - for (Map<String, String>::Element *E = list_all_projects.front(); E; E = E->next()) { - String project_name = E->key().replace(":::", ":/").replace("::", "/") + "/project.godot"; - if (!FileAccess::exists(project_name)) { - deleted_projects++; - EditorSettings::get_singleton()->erase("projects/" + E->key()); - EditorSettings::get_singleton()->erase("favorite_projects/" + E->key()); - } else { - remaining_projects++; - } - } - print_line("Deleted " + itos(deleted_projects) + " projects, remaining " + itos(remaining_projects) + " projects"); - EditorSettings::get_singleton()->save(); - selected_list.clear(); - last_clicked = ""; - _load_recent_projects(); + _project_list->erase_missing_projects(); + _update_project_buttons(); } void ProjectManager::_erase_project() { + const Set<String> &selected_list = _project_list->get_selected_project_keys(); + if (selected_list.size() == 0) return; @@ -1778,7 +2133,7 @@ void ProjectManager::_erase_project() { void ProjectManager::_erase_missing_projects() { - erase_missing_ask->set_text(TTR("Remove all missing projects from the list? (Folders contents will not be modified)")); + erase_missing_ask->set_text(TTR("Remove all missing projects from the list?\nThe project folders' contents won't be modified.")); erase_missing_ask->popup_centered_minsize(); } @@ -1867,13 +2222,22 @@ void ProjectManager::_scan_multiple_folders(PoolStringArray p_files) { } } +void ProjectManager::_on_order_option_changed() { + _project_list->set_order_option(project_order_filter->get_filter_option()); + _project_list->sort_projects(); +} + +void ProjectManager::_on_filter_option_changed() { + _project_list->set_search_term(project_filter->get_search_term()); + _project_list->sort_projects(); +} + void ProjectManager::_bind_methods() { ClassDB::bind_method("_open_selected_projects_ask", &ProjectManager::_open_selected_projects_ask); ClassDB::bind_method("_open_selected_projects", &ProjectManager::_open_selected_projects); ClassDB::bind_method("_run_project", &ProjectManager::_run_project); ClassDB::bind_method("_run_project_confirm", &ProjectManager::_run_project_confirm); - ClassDB::bind_method("_show_project", &ProjectManager::_show_project); ClassDB::bind_method("_scan_projects", &ProjectManager::_scan_projects); ClassDB::bind_method("_scan_begin", &ProjectManager::_scan_begin); ClassDB::bind_method("_import_project", &ProjectManager::_import_project); @@ -1886,18 +2250,16 @@ void ProjectManager::_bind_methods() { ClassDB::bind_method("_language_selected", &ProjectManager::_language_selected); ClassDB::bind_method("_restart_confirm", &ProjectManager::_restart_confirm); ClassDB::bind_method("_exit_dialog", &ProjectManager::_exit_dialog); - ClassDB::bind_method("_load_recent_projects", &ProjectManager::_load_recent_projects); + ClassDB::bind_method("_on_order_option_changed", &ProjectManager::_on_order_option_changed); + ClassDB::bind_method("_on_filter_option_changed", &ProjectManager::_on_filter_option_changed); ClassDB::bind_method("_on_projects_updated", &ProjectManager::_on_projects_updated); ClassDB::bind_method("_on_project_created", &ProjectManager::_on_project_created); - ClassDB::bind_method("_update_scroll_position", &ProjectManager::_update_scroll_position); - ClassDB::bind_method("_panel_draw", &ProjectManager::_panel_draw); - ClassDB::bind_method("_panel_input", &ProjectManager::_panel_input); ClassDB::bind_method("_unhandled_input", &ProjectManager::_unhandled_input); - ClassDB::bind_method("_favorite_pressed", &ProjectManager::_favorite_pressed); ClassDB::bind_method("_install_project", &ProjectManager::_install_project); ClassDB::bind_method("_files_dropped", &ProjectManager::_files_dropped); ClassDB::bind_method("_open_asset_library", &ProjectManager::_open_asset_library); ClassDB::bind_method("_confirm_update_settings", &ProjectManager::_confirm_update_settings); + ClassDB::bind_method("_update_project_buttons", &ProjectManager::_update_project_buttons); ClassDB::bind_method(D_METHOD("_scan_multiple_folders", "files"), &ProjectManager::_scan_multiple_folders); } @@ -1925,35 +2287,21 @@ ProjectManager::ProjectManager() { editor_set_scale(OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).x > 2000 ? 2.0 : 1.0); } break; - case 1: { - editor_set_scale(0.75); - } break; - - case 2: { - editor_set_scale(1.0); - } break; - - case 3: { - editor_set_scale(1.25); - } break; - - case 4: { - editor_set_scale(1.5); - } break; - - case 5: { - editor_set_scale(1.75); - } break; - - case 6: { - editor_set_scale(2.0); - } break; + case 1: editor_set_scale(0.75); break; + case 2: editor_set_scale(1.0); break; + case 3: editor_set_scale(1.25); break; + case 4: editor_set_scale(1.5); break; + case 5: editor_set_scale(1.75); break; + case 6: editor_set_scale(2.0); break; default: { editor_set_scale(custom_display_scale); } break; } + // Define a minimum window size to prevent UI elements from overlapping or being cut off + OS::get_singleton()->set_min_window_size(Size2(750, 420) * EDSCALE); + #ifndef OSX_ENABLED // The macOS platform implementation uses its own hiDPI window resizing code // TODO: Resize windows on hiDPI displays on Windows and Linux and remove the line below @@ -1979,26 +2327,11 @@ ProjectManager::ProjectManager() { VBoxContainer *vb = memnew(VBoxContainer); panel->add_child(vb); vb->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8 * EDSCALE); - vb->add_constant_override("separation", 8 * EDSCALE); String cp; cp += 0xA9; OS::get_singleton()->set_window_title(VERSION_NAME + String(" - ") + TTR("Project Manager") + " - " + cp + " 2007-2019 Juan Linietsky, Ariel Manzur & Godot Contributors"); - HBoxContainer *top_hb = memnew(HBoxContainer); - vb->add_child(top_hb); - Label *l = memnew(Label); - l->set_text(VERSION_NAME + String(" - ") + TTR("Project Manager")); - top_hb->add_child(l); - top_hb->add_spacer(); - l = memnew(Label); - String hash = String(VERSION_HASH); - if (hash.length() != 0) - hash = "." + hash.left(9); - l->set_text("v" VERSION_FULL_BUILD "" + hash); - l->set_align(Label::ALIGN_CENTER); - top_hb->add_child(l); - Control *center_box = memnew(Control); center_box->set_v_size_flags(SIZE_EXPAND_FILL); vb->add_child(center_box); @@ -2006,11 +2339,12 @@ ProjectManager::ProjectManager() { tabs = memnew(TabContainer); center_box->add_child(tabs); tabs->set_anchors_and_margins_preset(Control::PRESET_WIDE); + tabs->set_tab_align(TabContainer::ALIGN_LEFT); HBoxContainer *tree_hb = memnew(HBoxContainer); projects_hb = tree_hb; - projects_hb->set_name(TTR("Project List")); + projects_hb->set_name(TTR("Projects")); tabs->add_child(tree_hb); @@ -2027,31 +2361,23 @@ ProjectManager::ProjectManager() { sort_filter_titles.push_back("Path"); sort_filter_titles.push_back("Last Modified"); project_order_filter = memnew(ProjectListFilter); + project_order_filter->add_filter_option(); project_order_filter->_setup_filters(sort_filter_titles); project_order_filter->set_filter_size(150); sort_filters->add_child(project_order_filter); - project_order_filter->connect("filter_changed", this, "_load_recent_projects"); + project_order_filter->connect("filter_changed", this, "_on_order_option_changed"); project_order_filter->set_custom_minimum_size(Size2(180, 10) * EDSCALE); int projects_sorting_order = (int)EditorSettings::get_singleton()->get("project_manager/sorting_order"); project_order_filter->set_filter_option((ProjectListFilter::FilterOption)projects_sorting_order); sort_filters->add_spacer(true); - Label *search_label = memnew(Label); - search_label->set_text(TTR("Search:")); - sort_filters->add_child(search_label); - - HBoxContainer *search_filters = memnew(HBoxContainer); - Vector<String> vec2; - vec2.push_back("Name"); - vec2.push_back("Path"); + project_filter = memnew(ProjectListFilter); - project_filter->_setup_filters(vec2); project_filter->add_search_box(); - search_filters->add_child(project_filter); - project_filter->connect("filter_changed", this, "_load_recent_projects"); + project_filter->connect("filter_changed", this, "_on_filter_option_changed"); project_filter->set_custom_minimum_size(Size2(280, 10) * EDSCALE); - sort_filters->add_child(search_filters); + sort_filters->add_child(project_filter); search_tree_vb->add_child(sort_filters); @@ -2060,15 +2386,14 @@ ProjectManager::ProjectManager() { search_tree_vb->add_child(pc); pc->set_v_size_flags(SIZE_EXPAND_FILL); - scroll = memnew(ScrollContainer); - pc->add_child(scroll); - scroll->set_enable_h_scroll(false); + _project_list = memnew(ProjectList); + _project_list->connect(ProjectList::SIGNAL_SELECTION_CHANGED, this, "_update_project_buttons"); + _project_list->connect(ProjectList::SIGNAL_PROJECT_ASK_OPEN, this, "_open_selected_projects_ask"); + pc->add_child(_project_list); + _project_list->set_enable_h_scroll(false); VBoxContainer *tree_vb = memnew(VBoxContainer); tree_hb->add_child(tree_vb); - scroll_children = memnew(VBoxContainer); - scroll_children->set_h_size_flags(SIZE_EXPAND_FILL); - scroll->add_child(scroll_children); Button *open = memnew(Button); open->set_text(TTR("Edit")); @@ -2142,6 +2467,17 @@ ProjectManager::ProjectManager() { settings_hb->set_alignment(BoxContainer::ALIGN_END); settings_hb->set_h_grow_direction(Control::GROW_DIRECTION_BEGIN); + Label *version_label = memnew(Label); + String hash = String(VERSION_HASH); + if (hash.length() != 0) { + hash = "." + hash.left(9); + } + version_label->set_text("v" VERSION_FULL_BUILD "" + hash); + // Fade out the version label to be less prominent, but still readable + version_label->set_self_modulate(Color(1, 1, 1, 0.6)); + version_label->set_align(Label::ALIGN_CENTER); + settings_hb->add_child(version_label); + language_btn = memnew(OptionButton); language_btn->set_flat(true); language_btn->set_focus_mode(Control::FOCUS_NONE); @@ -2174,27 +2510,6 @@ ProjectManager::ProjectManager() { center_box->add_child(settings_hb); settings_hb->set_anchors_and_margins_preset(Control::PRESET_TOP_RIGHT); - CenterContainer *cc = memnew(CenterContainer); - Button *cancel = memnew(Button); - cancel->set_text(TTR("Exit")); - cancel->set_custom_minimum_size(Size2(100, 1) * EDSCALE); - -#ifndef OSX_ENABLED - // Pressing Command + Q quits the Project Manager - // This is handled by the platform implementation on macOS, - // so only define the shortcut on other platforms - InputEventKey *quit_key = memnew(InputEventKey); - quit_key->set_command(true); - quit_key->set_scancode(KEY_Q); - ShortCut *quit_shortcut = memnew(ShortCut); - quit_shortcut->set_shortcut(quit_key); - cancel->set_shortcut(quit_shortcut); -#endif - - cc->add_child(cancel); - cancel->connect("pressed", this, "_exit_dialog"); - vb->add_child(cc); - ////////////////////////////////////////////////////////////// language_restart_ask = memnew(ConfirmationDialog); @@ -2238,14 +2553,13 @@ ProjectManager::ProjectManager() { npdialog->connect("projects_updated", this, "_on_projects_updated"); npdialog->connect("project_created", this, "_on_project_created"); + _load_recent_projects(); if (EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path")) { _scan_begin(EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path")); } - last_clicked = ""; - SceneTree::get_singleton()->connect("files_dropped", this, "_files_dropped"); run_error_diag = memnew(AcceptDialog); @@ -2316,11 +2630,20 @@ void ProjectListFilter::_bind_methods() { ADD_SIGNAL(MethodInfo("filter_changed")); } +void ProjectListFilter::add_filter_option() { + filter_option = memnew(OptionButton); + filter_option->set_clip_text(true); + filter_option->connect("item_selected", this, "_filter_option_selected"); + add_child(filter_option); +} + void ProjectListFilter::add_search_box() { search_box = memnew(LineEdit); + search_box->set_placeholder(TTR("Search")); search_box->connect("text_changed", this, "_search_text_changed"); search_box->set_h_size_flags(SIZE_EXPAND_FILL); add_child(search_box); + has_search_box = true; } @@ -2331,13 +2654,6 @@ void ProjectListFilter::set_filter_size(int h_size) { ProjectListFilter::ProjectListFilter() { _current_filter = FILTER_NAME; - - filter_option = memnew(OptionButton); - set_filter_size(80); - filter_option->set_clip_text(true); - filter_option->connect("item_selected", this, "_filter_option_selected"); - add_child(filter_option); - has_search_box = false; } diff --git a/editor/project_manager.h b/editor/project_manager.h index d75d7164cc..2a5fd02892 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -39,6 +39,7 @@ #include "scene/gui/tree.h" class ProjectDialog; +class ProjectList; class ProjectListFilter; class ProjectManager : public Control { @@ -68,16 +69,13 @@ class ProjectManager : public Control { AcceptDialog *dialog_error; ProjectDialog *npdialog; - ScrollContainer *scroll; - VBoxContainer *scroll_children; HBoxContainer *projects_hb; TabContainer *tabs; + ProjectList *_project_list; OptionButton *language_btn; Control *gui_base; - Map<String, String> selected_list; // name -> main_scene - String last_clicked; bool importing; void _open_asset_library(); @@ -86,7 +84,6 @@ class ProjectManager : public Control { void _run_project_confirm(); void _open_selected_projects(); void _open_selected_projects_ask(); - void _show_project(const String &p_path); void _import_project(); void _new_project(); void _rename_project(); @@ -111,13 +108,13 @@ class ProjectManager : public Control { void _install_project(const String &p_zip_path, const String &p_title); void _dim_window(); - void _panel_draw(Node *p_hb); - void _panel_input(const Ref<InputEvent> &p_ev, Node *p_hb); void _unhandled_input(const Ref<InputEvent> &p_ev); - void _favorite_pressed(Node *p_hb); void _files_dropped(PoolStringArray p_files, int p_screen); void _scan_multiple_folders(PoolStringArray p_files); + void _on_order_option_changed(); + void _on_filter_option_changed(); + protected: void _notification(int p_what); static void _bind_methods(); @@ -155,6 +152,7 @@ protected: public: void _setup_filters(Vector<String> options); + void add_filter_option(); void add_search_box(); void set_filter_size(int h_size); String get_search_term(); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 001846604c..1c588a45f1 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -52,8 +52,8 @@ static const char *_button_names[JOY_BUTTON_MAX] = { "R2", "L3", "R3", - "Select, Nintendo -", - "Start, Nintendo +", + "Select, DualShock Share, Nintendo -", + "Start, DualShock Options, Nintendo +", "D-Pad Up", "D-Pad Down", "D-Pad Left", @@ -965,8 +965,6 @@ void ProjectSettingsEditor::_action_add() { while (r->get_next()) r = r->get_next(); - if (!r) - return; r->select(0); input_editor->ensure_cursor_is_visible(); action_add_error->hide(); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 82d974cae3..899343c0f8 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -614,7 +614,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: type = Variant::Type(i); } } - if (type) + if (type != Variant::NIL) property_select->select_method_from_basic_type(type, v); updating = false; return false; @@ -971,7 +971,6 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: menu->add_separator(); menu->add_item(TTR("Show in FileSystem"), OBJ_MENU_SHOW_IN_FILE_SYSTEM); } - } else { } RES cb = EditorSettings::get_singleton()->get_resource_clipboard(); diff --git a/editor/property_editor.h b/editor/property_editor.h index a8ef1d6fc1..029c2211d5 100644 --- a/editor/property_editor.h +++ b/editor/property_editor.h @@ -46,10 +46,6 @@ #include "scene/gui/texture_rect.h" #include "scene/gui/tree.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class PropertyValueEvaluator; class CreateDialog; class PropertySelector; diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index 813e24bd61..3bc93c3900 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -337,7 +337,7 @@ void PropertySelector::_item_selected() { String name = item->get_metadata(0); String class_type; - if (type) { + if (type != Variant::NIL) { class_type = Variant::get_type_name(type); } else { diff --git a/editor/pvrtc_compress.cpp b/editor/pvrtc_compress.cpp index 84cd6da3d9..7cdd900d25 100644 --- a/editor/pvrtc_compress.cpp +++ b/editor/pvrtc_compress.cpp @@ -32,6 +32,7 @@ #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" +#include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" #include "editor_settings.h" @@ -52,57 +53,75 @@ static void _compress_image(Image::CompressMode p_mode, Image *p_image) { _base_image_compress_pvrtc2_func(p_image); else if (_base_image_compress_pvrtc4_func) _base_image_compress_pvrtc4_func(p_image); - break; case Image::COMPRESS_PVRTC4: if (_base_image_compress_pvrtc4_func) _base_image_compress_pvrtc4_func(p_image); - break; - default: ERR_FAIL(); + default: + ERR_FAIL_MSG("Unsupported Image compress mode used in PVRTC module."); } return; } - String tmppath = EditorSettings::get_singleton()->get_cache_dir(); - - List<String> args; + String tmppath = EditorSettings::get_singleton()->get_cache_dir(); String src_img = tmppath.plus_file("_tmp_src_img.png"); String dst_img = tmppath.plus_file("_tmp_dst_img.pvr"); + List<String> args; args.push_back("-i"); args.push_back(src_img); args.push_back("-o"); args.push_back(dst_img); args.push_back("-f"); - switch (p_mode) { - case Image::COMPRESS_PVRTC2: args.push_back("PVRTC2"); break; - case Image::COMPRESS_PVRTC4: args.push_back("PVRTC4"); break; - case Image::COMPRESS_ETC: args.push_back("ETC"); break; - default: ERR_FAIL(); + switch (p_mode) { + case Image::COMPRESS_PVRTC2: + args.push_back("PVRTC2"); + break; + case Image::COMPRESS_PVRTC4: + args.push_back("PVRTC4"); + break; + case Image::COMPRESS_ETC: + args.push_back("ETC"); + break; + default: + ERR_FAIL_MSG("Unsupported Image compress mode used in PVRTC module."); } if (EditorSettings::get_singleton()->get("filesystem/import/pvrtc_fast_conversion").operator bool()) { args.push_back("-pvrtcfast"); } - if (p_image->has_mipmaps()) + if (p_image->has_mipmaps()) { args.push_back("-m"); + } + // Save source PNG. Ref<ImageTexture> t = memnew(ImageTexture); t->create_from_image(Ref<Image>(p_image), 0); ResourceSaver::save(src_img, t); Error err = OS::get_singleton()->execute(ttpath, args, true); - ERR_EXPLAIN(TTR("Could not execute PVRTC tool:") + " " + ttpath); - ERR_FAIL_COND(err != OK); + if (err != OK) { + // Clean up generated files. + DirAccess::remove_file_or_error(src_img); + DirAccess::remove_file_or_error(dst_img); + ERR_FAIL_MSG("Could not execute PVRTC tool: " + ttpath); + } t = ResourceLoader::load(dst_img, "Texture"); - - ERR_EXPLAIN(TTR("Can't load back converted image using PVRTC tool:") + " " + dst_img); - ERR_FAIL_COND(t.is_null()); + if (t.is_null()) { + // Clean up generated files. + DirAccess::remove_file_or_error(src_img); + DirAccess::remove_file_or_error(dst_img); + ERR_FAIL_MSG("Can't load back converted image using PVRTC tool."); + } p_image->copy_internals_from(t->get_data()); + + // Clean up generated files. + DirAccess::remove_file_or_error(src_img); + DirAccess::remove_file_or_error(dst_img); } static void _compress_pvrtc2(Image *p_image) { diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index dc2f098333..4e1c900ee4 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -256,16 +256,16 @@ void EditorQuickOpen::_confirmed() { void EditorQuickOpen::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_confirmed"); - search_box->set_right_icon(get_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); + FALLTHROUGH; + } + case NOTIFICATION_THEME_CHANGED: { + search_box->set_right_icon(get_icon("Search", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", this, "_confirmed"); } break; } @@ -289,7 +289,6 @@ EditorQuickOpen::EditorQuickOpen() { VBoxContainer *vbc = memnew(VBoxContainer); add_child(vbc); - //set_child_rect(vbc); search_box = memnew(LineEdit); vbc->add_margin_child(TTR("Search:"), search_box); search_box->connect("text_changed", this, "_text_changed"); @@ -302,6 +301,7 @@ EditorQuickOpen::EditorQuickOpen() { set_hide_on_ok(false); search_options->connect("item_activated", this, "_confirmed"); search_options->set_hide_root(true); + search_options->set_hide_folding(true); search_options->add_constant_override("draw_guides", 1); ei = "EditorIcons"; ot = "Object"; diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 935946bf24..f0114b393d 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -301,6 +301,8 @@ bool SceneTreeDock::_track_inherit(const String &p_target_scene_path, Node *p_de Ref<PackedScene> data = ResourceLoader::load(path); if (data.is_valid()) { p = data->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); + if (!p) + continue; instances.push_back(p); } else break; @@ -338,7 +340,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { tree->edit_selected(); } } break; - case TOOL_NEW: { + case TOOL_NEW: + case TOOL_REPARENT_TO_NEW_NODE: { if (!profile_allow_editing) { break; @@ -394,7 +397,14 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!profile_allow_editing) { break; } - create_dialog->popup_create(false, true, scene_tree->get_selected()->get_class()); + + Node *selected = scene_tree->get_selected(); + if (!selected && !editor_selection->get_selected_node_list().empty()) + selected = editor_selection->get_selected_node_list().front()->get(); + + if (selected) + create_dialog->popup_create(false, true, selected->get_class()); + } break; case TOOL_ATTACH_SCRIPT: { @@ -462,8 +472,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { Node *n = Object::cast_to<Node>(selection[i]); Ref<Script> existing = n->get_script(); - if (existing.is_valid()) { - const RefPtr empty; + Ref<Script> empty = EditorNode::get_singleton()->get_object_custom_type_base(n); + if (existing != empty) { editor_data->get_undo_redo().add_do_method(n, "set_script", empty); editor_data->get_undo_redo().add_undo_method(n, "set_script", existing); } @@ -976,9 +986,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } else { new_node = Object::cast_to<Node>(ClassDB::instance(selected_favorite_root)); } + if (!new_node) { - ERR_EXPLAIN("Creating root from favorite '" + selected_favorite_root + "' failed. Creating 'Node' instead."); new_node = memnew(Node); + ERR_PRINTS("Creating root from favorite '" + selected_favorite_root + "' failed. Creating 'Node' instead."); } } else { switch (p_tool) { @@ -1527,10 +1538,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V Node *validate = new_parent; while (validate) { - if (p_nodes.find(validate) != -1) { - ERR_EXPLAIN("Selection changed at some point.. can't reparent"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(p_nodes.find(validate) != -1, "Selection changed at some point.. can't reparent."); validate = validate->get_parent(); } //ok all valid @@ -1905,6 +1913,54 @@ Node *SceneTreeDock::_get_selection_group_tail(Node *p_node, List<Node *> p_list return tail; } +void SceneTreeDock::_do_create(Node *p_parent) { + Object *c = create_dialog->instance_selected(); + + ERR_FAIL_COND(!c); + Node *child = Object::cast_to<Node>(c); + ERR_FAIL_COND(!child); + + editor_data->get_undo_redo().create_action(TTR("Create Node")); + + if (edited_scene) { + + editor_data->get_undo_redo().add_do_method(p_parent, "add_child", child); + editor_data->get_undo_redo().add_do_method(child, "set_owner", edited_scene); + editor_data->get_undo_redo().add_do_method(editor_selection, "clear"); + editor_data->get_undo_redo().add_do_method(editor_selection, "add_node", child); + editor_data->get_undo_redo().add_do_reference(child); + editor_data->get_undo_redo().add_undo_method(p_parent, "remove_child", child); + + String new_name = p_parent->validate_child_name(child); + ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); + editor_data->get_undo_redo().add_do_method(sed, "live_debug_create_node", edited_scene->get_path_to(p_parent), child->get_class(), new_name); + editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(p_parent)).plus_file(new_name))); + + } else { + + editor_data->get_undo_redo().add_do_method(editor, "set_edited_scene", child); + editor_data->get_undo_redo().add_do_method(scene_tree, "update_tree"); + editor_data->get_undo_redo().add_do_reference(child); + editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)NULL); + } + + editor_data->get_undo_redo().commit_action(); + editor->push_item(c); + editor_selection->clear(); + editor_selection->add_node(child); + if (Object::cast_to<Control>(c)) { + //make editor more comfortable, so some controls don't appear super shrunk + Control *ct = Object::cast_to<Control>(c); + + Size2 ms = ct->get_minimum_size(); + if (ms.width < 4) + ms.width = 40; + if (ms.height < 4) + ms.height = 40; + ct->set_size(ms); + } +} + void SceneTreeDock::_create() { if (current_option == TOOL_NEW) { @@ -1923,67 +1979,78 @@ void SceneTreeDock::_create() { ERR_FAIL_COND(!parent); } - Object *c = create_dialog->instance_selected(); + _do_create(parent); - ERR_FAIL_COND(!c); - Node *child = Object::cast_to<Node>(c); - ERR_FAIL_COND(!child); - - editor_data->get_undo_redo().create_action(TTR("Create Node")); - - if (edited_scene) { + } else if (current_option == TOOL_REPLACE) { + List<Node *> selection = editor_selection->get_selected_node_list(); + ERR_FAIL_COND(selection.size() <= 0); - editor_data->get_undo_redo().add_do_method(parent, "add_child", child); - editor_data->get_undo_redo().add_do_method(child, "set_owner", edited_scene); - editor_data->get_undo_redo().add_do_method(editor_selection, "clear"); - editor_data->get_undo_redo().add_do_method(editor_selection, "add_node", child); - editor_data->get_undo_redo().add_do_reference(child); - editor_data->get_undo_redo().add_undo_method(parent, "remove_child", child); + UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); + ur->create_action(TTR("Change type of node(s)")); - String new_name = parent->validate_child_name(child); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_create_node", edited_scene->get_path_to(parent), child->get_class(), new_name); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(parent)).plus_file(new_name))); + for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { + Node *n = E->get(); + ERR_FAIL_COND(!n); - } else { + Object *c = create_dialog->instance_selected(); - editor_data->get_undo_redo().add_do_method(editor, "set_edited_scene", child); - editor_data->get_undo_redo().add_do_method(scene_tree, "update_tree"); - editor_data->get_undo_redo().add_do_reference(child); - editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)NULL); - } + ERR_FAIL_COND(!c); + Node *newnode = Object::cast_to<Node>(c); + ERR_FAIL_COND(!newnode); - editor_data->get_undo_redo().commit_action(); - editor->push_item(c); - editor_selection->clear(); - editor_selection->add_node(child); - if (Object::cast_to<Control>(c)) { - //make editor more comfortable, so some controls don't appear super shrunk - Control *ct = Object::cast_to<Control>(c); - - Size2 ms = ct->get_minimum_size(); - if (ms.width < 4) - ms.width = 40; - if (ms.height < 4) - ms.height = 40; - ct->set_size(ms); + ur->add_do_method(this, "replace_node", n, newnode, true, false); + ur->add_do_reference(newnode); + ur->add_undo_method(this, "replace_node", newnode, n, false, false); + ur->add_undo_reference(n); } - } else if (current_option == TOOL_REPLACE) { + ur->commit_action(); + } else if (current_option == TOOL_REPARENT_TO_NEW_NODE) { List<Node *> selection = editor_selection->get_selected_node_list(); ERR_FAIL_COND(selection.size() <= 0); - for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { + + // Find top level node in selection + bool only_one_top_node = true; + + Node *first = selection.front()->get(); + ERR_FAIL_COND(!first); + int smaller_path_to_top = first->get_path_to(scene_root).get_name_count(); + Node *top_node = first; + + for (List<Node *>::Element *E = selection.front()->next(); E; E = E->next()) { Node *n = E->get(); ERR_FAIL_COND(!n); - Object *c = create_dialog->instance_selected(); + int path_length = n->get_path_to(scene_root).get_name_count(); - ERR_FAIL_COND(!c); - Node *newnode = Object::cast_to<Node>(c); - ERR_FAIL_COND(!newnode); + if (top_node != n) { + if (smaller_path_to_top > path_length) { + top_node = n; + smaller_path_to_top = path_length; + only_one_top_node = true; + } else if (smaller_path_to_top == path_length) { + if (only_one_top_node && top_node->get_parent() != n->get_parent()) + only_one_top_node = false; + } + } + } - replace_node(n, newnode); + Node *parent = NULL; + if (only_one_top_node) + parent = top_node->get_parent(); + else + parent = top_node->get_parent()->get_parent(); + + _do_create(parent); + + Vector<Node *> nodes; + for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { + nodes.push_back(E->get()); } + + // This works because editor_selection was cleared and populated with last created node in _do_create() + Node *last_created = editor_selection->get_selected_node_list().front()->get(); + _do_reparent(last_created, -1, nodes, true); } scene_tree->get_scene_tree()->call_deferred("grab_focus"); @@ -2184,8 +2251,7 @@ void SceneTreeDock::_normalize_drop(Node *&to_node, int &to_pos, int p_type) { //drop at above selected node if (to_node == EditorNode::get_singleton()->get_edited_scene()) { to_node = NULL; - ERR_EXPLAIN("Cannot perform drop above the root node!"); - ERR_FAIL(); + ERR_FAIL_MSG("Cannot perform drop above the root node!"); } to_pos = to_node->get_index(); @@ -2325,6 +2391,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->clear(); Ref<Script> existing_script; + bool exisiting_script_removable = true; if (selection.size() == 1) { Node *selected = selection[0]; @@ -2344,6 +2411,10 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->add_separator(); existing_script = selected->get_script(); + + if (EditorNode::get_singleton()->get_object_custom_type_base(selected) == existing_script) { + exisiting_script_removable = false; + } } if (profile_allow_script_editing) { @@ -2355,7 +2426,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->add_icon_shortcut(get_icon("ScriptExtend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_ATTACH_SCRIPT); } } - if (selection.size() > 1 || existing_script.is_valid()) { + if (selection.size() > 1 || (existing_script.is_valid() && exisiting_script_removable)) { menu->add_icon_shortcut(get_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT); } menu->add_separator(); @@ -2373,6 +2444,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->add_icon_shortcut(get_icon("MoveDown", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/move_down"), TOOL_MOVE_DOWN); 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); } } @@ -2637,6 +2709,7 @@ void SceneTreeDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_feature_profile_changed"), &SceneTreeDock::_feature_profile_changed); ClassDB::bind_method(D_METHOD("instance"), &SceneTreeDock::instance); + ClassDB::bind_method(D_METHOD("get_tree_editor"), &SceneTreeDock::get_tree_editor); ClassDB::bind_method(D_METHOD("replace_node"), &SceneTreeDock::replace_node); ADD_SIGNAL(MethodInfo("remote_tree_selected")); @@ -2669,6 +2742,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel ED_SHORTCUT("scene_tree/move_down", TTR("Move Down"), KEY_MASK_CMD | KEY_DOWN); ED_SHORTCUT("scene_tree/duplicate", TTR("Duplicate"), KEY_MASK_CMD | KEY_D); ED_SHORTCUT("scene_tree/reparent", TTR("Reparent")); + ED_SHORTCUT("scene_tree/reparent_to_new_node", TTR("Reparent to New Node")); ED_SHORTCUT("scene_tree/make_root", TTR("Make Scene Root")); ED_SHORTCUT("scene_tree/merge_from_scene", TTR("Merge From Scene")); ED_SHORTCUT("scene_tree/save_branch_as_scene", TTR("Save Branch as Scene")); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 8a2b237b8b..cd582fdf57 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -70,6 +70,7 @@ class SceneTreeDock : public VBoxContainer { TOOL_MOVE_DOWN, TOOL_DUPLICATE, TOOL_REPARENT, + TOOL_REPARENT_TO_NEW_NODE, TOOL_MAKE_ROOT, TOOL_NEW_SCENE_FROM, TOOL_MERGE_FROM_SCENE, @@ -142,6 +143,7 @@ class SceneTreeDock : public VBoxContainer { bool first_enter; void _create(); + void _do_create(Node *p_parent); Node *scene_root; Node *edited_scene; EditorNode *editor; diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 445ca3a792..43f540e688 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -70,7 +70,8 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i } } else if (p_id == BUTTON_SCRIPT) { RefPtr script = n->get_script(); - if (!script.is_null()) + Ref<Script> script_typed = script; + if (!script_typed.is_null()) emit_signal("open_script", script); } else if (p_id == BUTTON_VISIBILITY) { @@ -210,13 +211,20 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (connect_to_script_mode) { Color accent = get_color("accent_color", "Editor"); - if (!p_node->get_script().is_null()) { + Ref<Script> script = p_node->get_script(); + if (!script.is_null() && EditorNode::get_singleton()->get_object_custom_type_base(p_node) != script) { //has script item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT); } else { - //has no script + //has no script (or script is a custom type) item->set_custom_color(0, get_color("disabled_font_color", "Editor")); item->set_selectable(0, false); + + if (!script.is_null()) { // make sure to mark the script if a custom type + item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT); + item->set_button_disabled(0, item->get_button_count(0) - 1, true); + } + accent.a *= 0.7; } @@ -262,15 +270,30 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { item->add_button(0, get_icon("NodeWarning", "EditorIcons"), BUTTON_WARNING, false, TTR("Node configuration warning:") + "\n" + p_node->get_configuration_warning()); } - bool has_connections = p_node->has_persistent_signal_connections(); - bool has_groups = p_node->has_persistent_groups(); - - if (has_connections && has_groups) { - item->add_button(0, get_icon("SignalsAndGroups", "EditorIcons"), BUTTON_SIGNALS, false, TTR("Node has connection(s) and group(s).\nClick to show signals dock.")); - } else if (has_connections) { - item->add_button(0, get_icon("Signals", "EditorIcons"), BUTTON_SIGNALS, false, TTR("Node has connections.\nClick to show signals dock.")); - } else if (has_groups) { - item->add_button(0, get_icon("Groups", "EditorIcons"), BUTTON_GROUPS, false, TTR("Node is in group(s).\nClick to show groups dock.")); + int num_connections = p_node->get_persistent_signal_connection_count(); + int num_groups = p_node->get_persistent_group_count(); + + if (num_connections >= 1 && num_groups >= 1) { + item->add_button( + 0, + get_icon("SignalsAndGroups", "EditorIcons"), + BUTTON_SIGNALS, + false, + vformat(TTR("Node has %s connection(s) and %s group(s).\nClick to show signals dock."), num_connections, num_groups)); + } else if (num_connections >= 1) { + item->add_button( + 0, + get_icon("Signals", "EditorIcons"), + BUTTON_SIGNALS, + false, + vformat(TTR("Node has %s connection(s).\nClick to show signals dock."), num_connections)); + } else if (num_groups >= 1) { + item->add_button( + 0, + get_icon("Groups", "EditorIcons"), + BUTTON_GROUPS, + false, + vformat(TTR("Node is in %s group(s).\nClick to show groups dock."), num_groups)); } } @@ -282,7 +305,10 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor")); item->set_tooltip(0, TTR("Instance:") + " " + p_node->get_filename() + "\n" + TTR("Type:") + " " + p_node->get_class()); } else { - item->set_tooltip(0, String(p_node->get_name()) + "\n" + TTR("Type:") + " " + p_node->get_class()); + StringName type = EditorNode::get_singleton()->get_object_custom_type_name(p_node); + if (type == StringName()) + type = p_node->get_class(); + item->set_tooltip(0, String(p_node->get_name()) + "\n" + TTR("Type:") + " " + type); } if (can_open_instance && undo_redo) { //Show buttons only when necessary(SceneTreeDock) to avoid crashes @@ -290,9 +316,12 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (!p_node->is_connected("script_changed", this, "_node_script_changed")) p_node->connect("script_changed", this, "_node_script_changed", varray(p_node)); - if (!p_node->get_script().is_null()) { - Ref<Script> script = p_node->get_script(); + Ref<Script> script = p_node->get_script(); + if (!script.is_null()) { item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + script->get_path()); + if (EditorNode::get_singleton()->get_object_custom_type_base(p_node) == script) { + item->set_button_color(0, item->get_button_count(0) - 1, Color(1, 1, 1, 0.5)); + } } if (p_node->is_class("CanvasItem")) { @@ -981,6 +1010,17 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_d return true; } + if (String(d["type"]) == "script_list_element") { + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(d["script_list_element"]); + if (se) { + String sp = se->get_edited_resource()->get_path(); + if (_is_script_type(EditorFileSystem::get_singleton()->get_file_type(sp))) { + tree->set_drop_mode_flags(Tree::DROP_MODE_ON_ITEM); + return true; + } + } + } + return String(d["type"]) == "nodes"; } void SceneTreeEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { @@ -1018,6 +1058,16 @@ void SceneTreeEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, emit_signal("files_dropped", files, np, section); } } + + if (String(d["type"]) == "script_list_element") { + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(d["script_list_element"]); + if (se) { + String sp = se->get_edited_resource()->get_path(); + if (_is_script_type(EditorFileSystem::get_singleton()->get_file_type(sp))) { + emit_signal("script_dropped", sp, np); + } + } + } } void SceneTreeEditor::_rmb_select(const Vector2 &p_pos) { diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index 61cb59ce6f..b216be3b59 100644 --- a/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h @@ -37,9 +37,7 @@ #include "scene/gui/button.h" #include "scene/gui/dialogs.h" #include "scene/gui/tree.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class SceneTreeEditor : public Control { GDCLASS(SceneTreeEditor, Control); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index ed9a24311d..ffb3f5feab 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -34,6 +34,7 @@ #include "core/os/file_access.h" #include "core/project_settings.h" #include "core/script_language.h" +#include "core/string_builder.h" #include "editor/create_dialog.h" #include "editor/editor_node.h" #include "editor/editor_scale.h" @@ -44,6 +45,23 @@ void ScriptCreateDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_ENTER_TREE: { + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + String lang = ScriptServer::get_language(i)->get_name(); + Ref<Texture> lang_icon = get_icon(lang, "EditorIcons"); + if (lang_icon.is_valid()) { + language_menu->set_item_icon(i, lang_icon); + } + } + String last_lang = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_language", ""); + Ref<Texture> last_lang_icon; + if (!last_lang.empty()) { + last_lang_icon = get_icon(last_lang, "EditorIcons"); + } else { + last_lang_icon = language_menu->get_item_icon(default_language); + } + if (last_lang_icon.is_valid()) { + language_menu->set_icon(last_lang_icon); + } path_button->set_icon(get_icon("Folder", "EditorIcons")); parent_browse_button->set_icon(get_icon("Folder", "EditorIcons")); parent_search_button->set_icon(get_icon("ClassList", "EditorIcons")); @@ -221,16 +239,22 @@ void ScriptCreateDialog::_parent_name_changed(const String &p_parent) { void ScriptCreateDialog::_template_changed(int p_template) { - String selected_template = p_template == 0 ? "" : template_menu->get_item_text(template_menu->get_selected()); + String selected_template = p_template == 0 ? "" : template_menu->get_item_text(p_template); EditorSettings::get_singleton()->set_project_metadata("script_setup", "last_selected_template", selected_template); if (p_template == 0) { //default script_template = ""; return; } - String ext = ScriptServer::get_language(language_menu->get_selected())->get_extension(); - String name = template_list[p_template - 1] + "." + ext; - script_template = EditorSettings::get_singleton()->get_script_templates_dir().plus_file(name); + int selected_id = template_menu->get_selected_id(); + + for (int i = 0; i < template_list.size(); i++) { + const ScriptTemplateInfo &sinfo = template_list[i]; + if (sinfo.id == selected_id) { + script_template = sinfo.dir.plus_file(sinfo.name + "." + sinfo.extension); + break; + } + } } void ScriptCreateDialog::ok_pressed() { @@ -351,23 +375,77 @@ void ScriptCreateDialog::_lang_changed(int l) { bool use_templates = language->is_using_templates(); template_menu->set_disabled(!use_templates); template_menu->clear(); - if (use_templates) { - template_list = EditorSettings::get_singleton()->get_script_templates(language->get_extension()); + if (use_templates) { + _update_script_templates(language->get_extension()); String last_lang = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_language", ""); String last_template = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_template", ""); template_menu->add_item(TTR("Default")); + + ScriptTemplateInfo *templates = template_list.ptrw(); + + Vector<String> origin_names; + origin_names.push_back(TTR("Project")); + origin_names.push_back(TTR("Editor")); + int cur_origin = -1; + + // Populate script template items previously sorted and now grouped by origin for (int i = 0; i < template_list.size(); i++) { - String s = template_list[i].capitalize(); - template_menu->add_item(s); - if (language_menu->get_item_text(language_menu->get_selected()) == last_lang && last_template == s) { - template_menu->select(i + 1); + + if (int(templates[i].origin) != cur_origin) { + template_menu->add_separator(); + + String origin_name = origin_names[templates[i].origin]; + + int last_index = template_menu->get_item_count() - 1; + template_menu->set_item_text(last_index, origin_name); + + cur_origin = templates[i].origin; } + String item_name = templates[i].name.capitalize(); + template_menu->add_item(item_name); + + int new_id = template_menu->get_item_count() - 1; + templates[i].id = new_id; } - } else { + // Disable overridden + for (Map<String, Vector<int> >::Element *E = template_overrides.front(); E; E = E->next()) { + const Vector<int> &overrides = E->get(); + + if (overrides.size() == 1) { + continue; // doesn't override anything + } + const ScriptTemplateInfo &extended = template_list[overrides[0]]; + + StringBuilder override_info; + override_info += TTR("Overrides"); + override_info += ": "; + for (int i = 1; i < overrides.size(); i++) { + const ScriptTemplateInfo &overridden = template_list[overrides[i]]; + + int disable_index = template_menu->get_item_index(overridden.id); + template_menu->set_item_disabled(disable_index, true); + + override_info += origin_names[overridden.origin]; + if (i < overrides.size() - 1) { + override_info += ", "; + } + } + template_menu->set_item_icon(extended.id, get_icon("Override", "EditorIcons")); + template_menu->get_popup()->set_item_tooltip(extended.id, override_info.as_string()); + } + // Reselect last selected template + for (int i = 0; i < template_menu->get_item_count(); i++) { + const String &ti = template_menu->get_item_text(i); + if (language_menu->get_item_text(language_menu->get_selected()) == last_lang && last_template == ti) { + template_menu->select(i); + break; + } + } + } else { template_menu->add_item(TTR("N/A")); script_template = ""; } @@ -379,6 +457,41 @@ void ScriptCreateDialog::_lang_changed(int l) { _update_dialog(); } +void ScriptCreateDialog::_update_script_templates(const String &p_extension) { + + template_list.clear(); + template_overrides.clear(); + + Vector<String> dirs; + + // Ordered from local to global for correct override mechanism + dirs.push_back(EditorSettings::get_singleton()->get_project_script_templates_dir()); + dirs.push_back(EditorSettings::get_singleton()->get_script_templates_dir()); + + for (int i = 0; i < dirs.size(); i++) { + + Vector<String> list = EditorSettings::get_singleton()->get_script_templates(p_extension, dirs[i]); + + for (int j = 0; j < list.size(); j++) { + ScriptTemplateInfo sinfo; + sinfo.origin = ScriptOrigin(i); + sinfo.dir = dirs[i]; + sinfo.name = list[j]; + sinfo.extension = p_extension; + template_list.push_back(sinfo); + + if (!template_overrides.has(sinfo.name)) { + Vector<int> overrides; + overrides.push_back(template_list.size() - 1); // first one + template_overrides.insert(sinfo.name, overrides); + } else { + Vector<int> &overrides = template_overrides[sinfo.name]; + overrides.push_back(template_list.size() - 1); + } + } + } +} + void ScriptCreateDialog::_built_in_pressed() { if (internal->is_pressed()) { @@ -671,13 +784,13 @@ ScriptCreateDialog::ScriptCreateDialog() { gc->add_child(l); gc->add_child(language_menu); - int default_lang = 0; + default_language = 0; for (int i = 0; i < ScriptServer::get_language_count(); i++) { String lang = ScriptServer::get_language(i)->get_name(); language_menu->add_item(lang); if (lang == "GDScript") { - default_lang = i; + default_language = i; } } @@ -691,8 +804,8 @@ ScriptCreateDialog::ScriptCreateDialog() { } } } else { - language_menu->select(default_lang); - current_language = default_lang; + language_menu->select(default_language); + current_language = default_language; } language_menu->connect("item_selected", this, "_lang_changed"); diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index 288b8f604b..31cf2478cf 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -76,9 +76,27 @@ class ScriptCreateDialog : public ConfirmationDialog { bool is_built_in; bool built_in_enabled; int current_language; + int default_language; bool re_check_path; + + enum ScriptOrigin { + SCRIPT_ORIGIN_PROJECT, + SCRIPT_ORIGIN_EDITOR, + }; + struct ScriptTemplateInfo { + int id; + ScriptOrigin origin; + String dir; + String name; + String extension; + }; + String script_template; - Vector<String> template_list; + Vector<ScriptTemplateInfo> template_list; + Map<String, Vector<int> > template_overrides; // name : indices + + void _update_script_templates(const String &p_extension); + String base_type; void _path_hbox_sorted(); diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 8fd1064427..f7ff754a0b 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -383,6 +383,74 @@ void ScriptEditorDebugger::_scene_tree_request() { ppeer->put_var(msg); } +/// Populates inspect_scene_tree recursively given data in nodes. +/// Nodes is an array containing 4 elements for each node, it follows this pattern: +/// nodes[i] == number of direct children of this node +/// nodes[i + 1] == node name +/// nodes[i + 2] == node class +/// nodes[i + 3] == node instance id +/// +/// Returns the number of items parsed in nodes from current_index. +/// +/// Given a nodes array like [R,A,B,C,D,E] the following Tree will be generated, assuming +/// filter is an empty String, R and A child count are 2, B is 1 and C, D and E are 0. +/// +/// R +/// |-A +/// | |-B +/// | | |-C +/// | | +/// | |-D +/// | +/// |-E +/// +int ScriptEditorDebugger::_update_scene_tree(TreeItem *parent, const Array &nodes, int current_index) { + String filter = EditorNode::get_singleton()->get_scene_tree_dock()->get_filter(); + String item_text = nodes[current_index + 1]; + bool keep = filter.is_subsequence_ofi(item_text); + + TreeItem *item = inspect_scene_tree->create_item(parent); + item->set_text(0, item_text); + ObjectID id = ObjectID(nodes[current_index + 3]); + Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(nodes[current_index + 2], ""); + if (icon.is_valid()) { + item->set_icon(0, icon); + } + item->set_metadata(0, id); + + // Set current item as collapsed if necessary + if (parent) { + if (!unfold_cache.has(id)) { + item->set_collapsed(true); + } + } + + int children_count = nodes[current_index]; + // Tracks the total number of items parsed in nodes, this is used to skips nodes that + // are not direct children of the current node since we can't know in advance the total + // number of children, direct and not, of a node without traversing the nodes array previously. + // Keeping track of this allows us to build our remote scene tree by traversing the node + // array just once. + int items_count = 1; + for (int i = 0; i < children_count; i++) { + // Called for each direct child of item. + // Direct children of current item might not be adjacent so items_count must + // be incremented by the number of items parsed until now, otherwise we would not + // be able to access the next child of the current item. + // items_count is multiplied by 4 since that's the number of elements in the nodes + // array needed to represent a single node. + items_count += _update_scene_tree(item, nodes, current_index + items_count * 4); + } + + // If item has not children and should not be kept delete it + if (!keep && !item->get_children() && parent) { + parent->remove_child(item); + memdelete(item); + } + + return items_count; +} + void ScriptEditorDebugger::_video_mem_request() { ERR_FAIL_COND(connection.is_null()); @@ -455,48 +523,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da updating_scene_tree = true; - for (int i = 0; i < p_data.size(); i += 4) { - - TreeItem *p; - int level = p_data[i]; - if (level == 0) { - p = NULL; - } else { - ERR_CONTINUE(!lv.has(level - 1)); - p = lv[level - 1]; - } - - TreeItem *it = inspect_scene_tree->create_item(p); + _update_scene_tree(NULL, p_data, 0); - ObjectID id = ObjectID(p_data[i + 3]); - - it->set_text(0, p_data[i + 1]); - Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(p_data[i + 2], ""); - if (icon.is_valid()) - it->set_icon(0, icon); - it->set_metadata(0, id); - - if (id == inspected_object_id) { - TreeItem *cti = it->get_parent(); //ensure selected is always uncollapsed - while (cti) { - cti->set_collapsed(false); - cti = cti->get_parent(); - } - it->select(0); - } - - if (p) { - if (!unfold_cache.has(id)) { - it->set_collapsed(true); - } - } else { - if (unfold_cache.has(id)) { //reverse for root - it->set_collapsed(true); - } - } - - lv[level] = it; - } updating_scene_tree = false; le_clear->set_disabled(false); @@ -988,7 +1016,10 @@ void ScriptEditorDebugger::_performance_draw() { Ref<Font> graph_font = get_font("font", "TextEdit"); if (which.empty()) { - perf_draw->draw_string(graph_font, Point2(0, graph_font->get_ascent()), TTR("Pick one or more items from the list to display the graph."), get_color("font_color", "Label"), perf_draw->get_size().x); + String text = TTR("Pick one or more items from the list to display the graph."); + + perf_draw->draw_string(graph_font, Point2i(MAX(0, perf_draw->get_size().x - graph_font->get_string_size(text).x), perf_draw->get_size().y + graph_font->get_ascent()) / 2, text, get_color("font_color", "Label"), perf_draw->get_size().x); + return; } diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index 05dcab0f80..947b0cca52 100644 --- a/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h @@ -173,6 +173,7 @@ class ScriptEditorDebugger : public Control { void _set_reason_text(const String &p_reason, MessageType p_type); void _scene_tree_property_select_object(ObjectID p_object); void _scene_tree_property_value_edited(const String &p_prop, const Variant &p_value); + int _update_scene_tree(TreeItem *parent, const Array &nodes, int current_index); void _video_mem_request(); diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index cbfd0f3742..4c5371769f 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -36,6 +36,7 @@ #include "scene/3d/baked_lightmap.h" #include "scene/3d/collision_polygon.h" #include "scene/3d/collision_shape.h" +#include "scene/3d/cpu_particles.h" #include "scene/3d/gi_probe.h" #include "scene/3d/light.h" #include "scene/3d/listener.h" @@ -2036,8 +2037,11 @@ PortalSpatialGizmo::PortalSpatialGizmo(Portal *p_portal) { RayCastSpatialGizmoPlugin::RayCastSpatialGizmoPlugin() { - Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); + const float gizmo_value = gizmo_color.get_v(); + const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); + create_material("shape_material_disabled", gizmo_color_disabled); } bool RayCastSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { @@ -2063,7 +2067,8 @@ void RayCastSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { lines.push_back(Vector3()); lines.push_back(raycast->get_cast_to()); - Ref<SpatialMaterial> material = get_material("shape_material", p_gizmo); + const Ref<SpatialMaterial> material = + get_material(raycast->is_enabled() ? "shape_material" : "shape_material_disabled", p_gizmo); p_gizmo->add_lines(lines, material); p_gizmo->add_collision_segments(lines); @@ -2415,6 +2420,33 @@ void VisibilityNotifierGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { //// +CPUParticlesGizmoPlugin::CPUParticlesGizmoPlugin() { + create_icon_material("particles_icon", SpatialEditor::get_singleton()->get_icon("GizmoCPUParticles", "EditorIcons")); +} + +bool CPUParticlesGizmoPlugin::has_gizmo(Spatial *p_spatial) { + return Object::cast_to<CPUParticles>(p_spatial) != NULL; +} + +String CPUParticlesGizmoPlugin::get_name() const { + return "CPUParticles"; +} + +int CPUParticlesGizmoPlugin::get_priority() const { + return -1; +} + +bool CPUParticlesGizmoPlugin::is_selectable_when_hidden() const { + return true; +} + +void CPUParticlesGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { + Ref<Material> icon = get_material("particles_icon", p_gizmo); + p_gizmo->add_unscaled_billboard(icon, 0.05); +} + +//// + ParticlesGizmoPlugin::ParticlesGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4)); create_material("particles_material", gizmo_color); @@ -3080,8 +3112,11 @@ void BakedIndirectLightGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { //// CollisionShapeSpatialGizmoPlugin::CollisionShapeSpatialGizmoPlugin() { - Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); + const float gizmo_value = gizmo_color.get_v(); + const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); + create_material("shape_material_disabled", gizmo_color_disabled); create_handle_material("handles"); } @@ -3404,7 +3439,8 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { if (s.is_null()) return; - Ref<Material> material = get_material("shape_material", p_gizmo); + const Ref<Material> material = + get_material(!cs->is_disabled() ? "shape_material" : "shape_material_disabled", p_gizmo); Ref<Material> handles_material = get_material("handles"); if (Object::cast_to<SphereShape>(*s)) { @@ -3705,8 +3741,11 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ///// CollisionPolygonSpatialGizmoPlugin::CollisionPolygonSpatialGizmoPlugin() { - Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); + const float gizmo_value = gizmo_color.get_v(); + const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); + create_material("shape_material_disabled", gizmo_color_disabled); } bool CollisionPolygonSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { @@ -3742,7 +3781,8 @@ void CollisionPolygonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { lines.push_back(Vector3(points[i].x, points[i].y, -depth)); } - Ref<Material> material = get_material("shape_material", p_gizmo); + const Ref<Material> material = + get_material(!polygon->is_disabled() ? "shape_material" : "shape_material_disabled", p_gizmo); p_gizmo->add_lines(lines, material); p_gizmo->add_collision_segments(lines); diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h index 3661df4bad..317ea0c570 100644 --- a/editor/spatial_editor_gizmos.h +++ b/editor/spatial_editor_gizmos.h @@ -249,6 +249,18 @@ public: VisibilityNotifierGizmoPlugin(); }; +class CPUParticlesGizmoPlugin : public EditorSpatialGizmoPlugin { + GDCLASS(CPUParticlesGizmoPlugin, EditorSpatialGizmoPlugin); + +public: + bool has_gizmo(Spatial *p_spatial); + String get_name() const; + int get_priority() const; + bool is_selectable_when_hidden() const; + void redraw(EditorSpatialGizmo *p_gizmo); + CPUParticlesGizmoPlugin(); +}; + class ParticlesGizmoPlugin : public EditorSpatialGizmoPlugin { GDCLASS(ParticlesGizmoPlugin, EditorSpatialGizmoPlugin); diff --git a/editor/translations/af.po b/editor/translations/af.po index 9cce062127..e220906bcb 100644 --- a/editor/translations/af.po +++ b/editor/translations/af.po @@ -137,6 +137,31 @@ msgstr "Anim Verander Roep" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Verander Waarde" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim Verander Oorgang" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Verander Transform" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Verander Waarde" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Verander Roep" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "Verander Anim Lente" @@ -1176,7 +1201,6 @@ msgid "Success!" msgstr "Sukses!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Installeer" @@ -1741,7 +1765,7 @@ msgstr "Open 'n Lêer" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Verfris" @@ -1792,7 +1816,7 @@ msgstr "Gaan Vorentoe" msgid "Go Up" msgstr "Gaan Op" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Wissel Versteekte Lêers" @@ -1818,27 +1842,32 @@ msgstr "Skuif Gunsteling Af" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "Voorskou:" +msgid "Go to previous folder." +msgstr "Gaan na ouer vouer" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Skep Vouer" +msgid "Go to next folder." +msgstr "Gaan na ouer vouer" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "Gaan na ouer vouer" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Deursoek Klasse" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "Kon nie vouer skep nie." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Wissel Versteekte Lêers" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2543,6 +2572,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Verwyder Seleksie" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2736,14 +2770,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -3058,6 +3084,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Lede" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4755,6 +4786,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Installeer" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4784,7 +4820,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4798,7 +4833,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4873,31 +4908,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "Skep Vouer" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Verwyder ongeldige sleutels" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "Skep Vouer" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Verwyder ongeldige sleutels" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6816,7 +6855,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7001,10 +7044,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7585,14 +7624,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8000,6 +8031,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8090,6 +8125,22 @@ msgid "Color uniform." msgstr "Anim Verander Transform" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8097,10 +8148,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8190,7 +8275,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8198,7 +8283,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8210,7 +8295,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8227,7 +8312,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8296,11 +8381,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8316,7 +8401,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8344,11 +8429,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8389,11 +8474,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8403,7 +8492,7 @@ msgstr "Skep Intekening" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8421,15 +8510,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8481,7 +8570,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8509,12 +8598,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8591,47 +8680,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9802,6 +9891,11 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Skep Nuwe" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -10012,7 +10106,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11554,6 +11648,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11571,6 +11669,14 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "Voorskou:" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Skep Vouer" + +#, fuzzy #~ msgid "Failed to create solution." #~ msgstr "Kon nie vouer skep nie." diff --git a/editor/translations/ar.po b/editor/translations/ar.po index 5f9f0aee4c..21d1f3e745 100644 --- a/editor/translations/ar.po +++ b/editor/translations/ar.po @@ -28,12 +28,13 @@ # DiscoverSquishy <noaimi@discoversquishy.me>, 2019. # ButterflyOfFire <ButterflyOfFire@protonmail.com>, 2019. # PhoenixHO <oussamahaddouche0@gmail.com>, 2019. +# orcstudio <orcstudio@orcstudio.org>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-09 10:47+0000\n" -"Last-Translator: PhoenixHO <oussamahaddouche0@gmail.com>\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" +"Last-Translator: orcstudio <orcstudio@orcstudio.org>\n" "Language-Team: Arabic <https://hosted.weblate.org/projects/godot-engine/" "godot/ar/>\n" "Language: ar\n" @@ -154,6 +155,31 @@ msgid "Anim Change Call" msgstr "نداء تغيير Ø§Ù„ØªØØ±ÙŠÙƒ" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "تغيير وقت الإطار الرئيسي Ù„Ù„ØØ±ÙƒØ©" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "تغيير المقطع الإنتقالي" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "تØÙˆÙŠÙ„ تغيير Ø§Ù„ØªØØ±ÙŠÙƒ" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "تغيير قيمة الإطار الأساسي Ù„Ù„ØØ±ÙƒØ©" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "نداء تغيير Ø§Ù„ØªØØ±ÙŠÙƒ" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "تعديل طول عرض Ø§Ù„ØØ±ÙƒØ©" @@ -469,7 +495,7 @@ 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 "" +msgstr "ØªØØ¯ÙŠØ¯ الكل" #: editor/animation_track_editor.cpp #, fuzzy @@ -733,9 +759,8 @@ msgid "Connect to Node:" msgstr "صلها بالعقدة:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect to Script:" -msgstr "لا يمكن الإتصال Ø¨Ø§Ù„Ù…ÙØ¶ÙŠÙ:" +msgstr "الإتصال بالمخطوطة:" #: editor/connections_dialog.cpp #, fuzzy @@ -773,9 +798,8 @@ msgid "Extra Call Arguments:" msgstr "وسائط إستدعاء إضاÙية :" #: editor/connections_dialog.cpp -#, fuzzy msgid "Advanced" -msgstr "إعدادات الكبس" +msgstr "إعدادات متقدمة" #: editor/connections_dialog.cpp msgid "Deferred" @@ -1173,7 +1197,6 @@ msgid "Success!" msgstr "تم بشكل ناجØ!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "تثبيت" @@ -1743,7 +1766,7 @@ msgstr "أظهر ÙÙŠ مدير Ø§Ù„Ù…Ù„ÙØ§Øª" msgid "New Folder..." msgstr "مجلد جديد..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "ØªØØ¯ÙŠØ«" @@ -1794,7 +1817,7 @@ msgstr "إذهب للأمام" msgid "Go Up" msgstr "إذهب للأعلي" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "أظهر Ø§Ù„Ù…Ù„ÙØ§Øª المخÙية" @@ -1819,27 +1842,33 @@ msgid "Move Favorite Down" msgstr "ØØ±Ùƒ المÙÙØ¶Ù„Ø© للأسÙÙ„" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "المجلد السابق" +#, fuzzy +msgid "Go to previous folder." +msgstr "إذهب إلي المجلد السابق" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "المجلد اللاØÙ‚" +msgid "Go to next folder." +msgstr "إذهب إلي المجلد السابق" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "إذهب إلي المجلد السابق" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Ø¥Ø¨ØØ« ÙÙŠ الأصناÙ" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "لا يمكن إنشاء المجلد." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "أظهر Ø§Ù„Ù…Ù„ÙØ§Øª المخÙية" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2576,6 +2605,11 @@ msgid "Go to previously opened scene." msgstr "اذهب الي المشهد Ø§Ù„Ù…ÙØªÙˆØ مسبقا." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "نسخ المسار" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "التبويب التالي" @@ -2788,15 +2822,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "إعدادات Ø§Ù„Ù…ÙØ¹Ø¯Ù„" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "ÙØªØ ÙÙŠ Ø§Ù„Ù…ÙØ¹Ø¯Ù„ التالي" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "إلغاء/ØªÙØ¹ÙŠÙ„ وضع الشاشة الكاملة" @@ -3123,6 +3148,11 @@ msgstr "الوقت" msgid "Calls" msgstr "ندائات" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "الأعضاء" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4852,6 +4882,11 @@ msgid "Idle" msgstr "عاطل" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "تثبيت" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "إعادة Ø§Ù„Ù…ØØ§ÙˆÙ„Ø©" @@ -4882,7 +4917,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "الكل" @@ -4896,8 +4930,9 @@ msgid "Sort:" msgstr "ترتيب:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "عكس" +#, fuzzy +msgid "Reverse sorting." +msgstr "جار الطلب..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4976,31 +5011,38 @@ msgid "Rotation Step:" msgstr "خطوة الدوران:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "ØªØØ±ÙŠÙƒ الموجه العمودي" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "إنشاء موجه عمودي جديد" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Ù…Ø³Ø Ø§Ù„Ù…ÙˆØ¬Ù‡ العمودي" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "ØªØØ±ÙŠÙƒ الموجه الأÙقي" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "إنشاء موجه Ø£Ùقي جديد" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Ù…Ø³Ø Ø§Ù„Ù…ÙˆØ¬Ù‡ الأÙقي" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "إنشاء موجه عمودي وأÙقي جديد" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6964,7 +7006,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7151,10 +7197,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7751,14 +7793,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8191,6 +8225,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8283,6 +8321,22 @@ msgid "Color uniform." msgstr "تØÙˆÙŠÙ„ تغيير Ø§Ù„ØªØØ±ÙŠÙƒ" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8290,10 +8344,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8384,7 +8472,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8392,7 +8480,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8404,7 +8492,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8421,7 +8509,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8490,11 +8578,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8510,7 +8598,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8538,11 +8626,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8583,11 +8671,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8597,7 +8689,7 @@ msgstr "إنشاء بولي" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8615,15 +8707,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8675,7 +8767,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8703,12 +8795,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8786,47 +8878,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10015,6 +10107,11 @@ msgstr "ÙØªØ الكود" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "إنشاء %s جديد" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "ØÙظ المشهد" @@ -10233,7 +10330,7 @@ msgid "Script is valid." msgstr "شجرة Ø§Ù„ØØ±ÙƒØ© صØÙŠØØ©." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11801,6 +11898,11 @@ msgstr "مصدر غير ØµØ§Ù„Ø Ù„ØªØ¸Ù„ÙŠÙ„." msgid "Invalid source for shader." msgstr "مصدر غير ØµØ§Ù„Ø Ù„ØªØ¸Ù„ÙŠÙ„." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "مصدر غير ØµØ§Ù„Ø Ù„ØªØ¸Ù„ÙŠÙ„." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "التعيين لتعمل." @@ -11817,6 +11919,20 @@ msgstr "يمكن تعيين المتغيرات Ùقط ÙÙŠ الذروة ." msgid "Constants cannot be modified." msgstr "" +#~ msgid "Previous Folder" +#~ msgstr "المجلد السابق" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "المجلد اللاØÙ‚" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "ÙØªØ ÙÙŠ Ø§Ù„Ù…ÙØ¹Ø¯Ù„ التالي" + +#~ msgid "Reverse" +#~ msgstr "عكس" + #~ msgid "Generating solution..." #~ msgstr "إنشاء الØÙ„..." diff --git a/editor/translations/bg.po b/editor/translations/bg.po index 7e37605159..848408b8f3 100644 --- a/editor/translations/bg.po +++ b/editor/translations/bg.po @@ -139,6 +139,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp #, fuzzy msgid "Change Animation Length" msgstr "Промени Името на ÐнимациÑта:" @@ -1155,7 +1175,6 @@ msgid "Success!" msgstr "Готово!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "ИнÑталиране" @@ -1714,7 +1733,7 @@ msgstr "Покажи във Файлов Мениджър" msgid "New Folder..." msgstr "Ðова папка..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1765,7 +1784,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Покажи Скрити Файлове" @@ -1791,27 +1810,32 @@ msgstr "" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "Предишен подпрозорец" +msgid "Go to previous folder." +msgstr "Към горната папка" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Създаване на папка" +msgid "Go to next folder." +msgstr "Към горната папка" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "Към горната папка" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "ТърÑене" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "ÐеуÑпешно Ñъздаване на папка." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Покажи Скрити Файлове" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2516,6 +2540,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Копиране" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Следващ подпрозорец" @@ -2711,14 +2740,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "ÐаÑтройки на редактора" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -3038,6 +3059,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Файл:" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4769,6 +4795,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "ИнÑталиране" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Опитай пак" @@ -4798,7 +4829,6 @@ msgid "Last" msgstr "ПоÑледна" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Ð’Ñички" @@ -4812,8 +4842,9 @@ msgid "Sort:" msgstr "Подреждане:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Ð’ обратен ред" +#, fuzzy +msgid "Reverse sorting." +msgstr "Запитване..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4888,33 +4919,38 @@ msgid "Rotation Step:" msgstr "Съпка при Завъртане:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "ПемеÑти вертикална помощна линиÑ" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "Създай нова вертикална помощна линиÑ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Премахни вертикална помощна линиÑ" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "ПремеÑти хоризонтална помощна линиÑ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Създай нова хоризонтална помощна линиÑ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Премахни хоризонтална помощна линиÑ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Създай нова хоризонтална и вертикална помощна линиÑ" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6842,7 +6878,12 @@ msgstr "" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" +msgstr "Изглед ОтдÑÑно." + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" msgstr "Изглед ОтдÑÑно." #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7029,10 +7070,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7619,14 +7656,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8059,6 +8088,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8147,6 +8180,22 @@ msgid "Color uniform." msgstr "ИзнаÑÑне към платформа" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8154,10 +8203,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8246,7 +8329,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8254,7 +8337,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8266,7 +8349,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8283,7 +8366,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8352,11 +8435,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8372,7 +8455,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8400,11 +8483,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8445,11 +8528,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8459,7 +8546,7 @@ msgstr "Създаване на папка" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8477,15 +8564,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8537,7 +8624,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8565,12 +8652,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8647,47 +8734,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9886,6 +9973,11 @@ msgstr "Ðова Ñцена" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Създай нови възли." + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Запазване на Ñцената" @@ -10104,7 +10196,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11709,6 +11801,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11726,6 +11822,17 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "Предишен подпрозорец" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Създаване на папка" + +#~ msgid "Reverse" +#~ msgstr "Ð’ обратен ред" + +#, fuzzy #~ msgid "Failed to create solution." #~ msgstr "ÐеуÑпешно Ñъздаване на папка." diff --git a/editor/translations/bn.po b/editor/translations/bn.po index 00182447f2..97f6925f1d 100644 --- a/editor/translations/bn.po +++ b/editor/translations/bn.po @@ -144,6 +144,31 @@ msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨ (Anim) কল পরিবরà§à¦¤à¦¨ ঠ#: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨ (Anim) à¦à§à¦¯à¦¾à¦²à§ পরিবরà§à¦¤à¦¨ করà§à¦¨" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨ (Anim) টà§à¦°à§à¦¯à¦¾à¦¨à¦œà¦¿à¦¶à¦¨ পরিবরà§à¦¤à¦¨ করà§à¦¨" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨ (Anim) টà§à¦°à¦¾à¦¨à§à¦¸à¦«à¦°à§à¦® পরিবরà§à¦¤à¦¨ করà§à¦¨" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨ (Anim) à¦à§à¦¯à¦¾à¦²à§ পরিবরà§à¦¤à¦¨ করà§à¦¨" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨ (Anim) কল পরিবরà§à¦¤à¦¨ করà§à¦¨" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "অà§à¦¯à¦¾à¦¨à¦¿à¦®à§‡à¦¶à¦¨à§‡à¦° লà§à¦ª পরিবরà§à¦¤à¦¨ করà§à¦¨" @@ -1199,7 +1224,6 @@ msgid "Success!" msgstr "সমà§à¦ªà¦¨à§à¦¨ হয়েছে!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "ইনà§à¦¸à¦Ÿà¦²" @@ -1784,7 +1808,7 @@ msgstr "ফাইল-মà§à¦¯à¦¾à¦¨à§‡à¦œà¦¾à¦°à§‡ দেখà§à¦¨" msgid "New Folder..." msgstr "ফোলà§à¦¡à¦¾à¦° তৈরি করà§à¦¨" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "রিফà§à¦°à§‡à¦¸ করà§à¦¨" @@ -1835,7 +1859,7 @@ msgstr "সামনের দিকে যান" msgid "Go Up" msgstr "উপরের দিকে যান" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "অদৃশà§à¦¯ ফাইলসমূহ অদলবদল/টগল করà§à¦¨" @@ -1861,27 +1885,32 @@ msgstr "ফেবরিট/পà§à¦°à¦¿à¦¯à¦¼à¦•ে নিচের দিকে #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "পূরà§à¦¬à§‡à¦° টà§à¦¯à¦¾à¦¬" +msgid "Go to previous folder." +msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦à¦¬ হয়নি।" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "ফোলà§à¦¡à¦¾à¦° তৈরি করà§à¦¨" +msgid "Go to next folder." +msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦à¦¬ হয়নি।" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦à¦¬ হয়নি।" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "কà§à¦²à¦¾à¦¸à§‡à¦° অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦à¦¬ হয়নি।" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "অদৃশà§à¦¯ ফাইলসমূহ অদলবদল/টগল করà§à¦¨" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2659,6 +2688,11 @@ msgid "Go to previously opened scene." msgstr "পূরà§à¦¬à§‡ খোলা দৃশà§à¦¯à§‡ যান।" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "পথ পà§à¦°à¦¤à¦¿à¦²à¦¿à¦ªà¦¿/কপি করà§à¦¨" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "পরের টà§à¦¯à¦¾à¦¬" @@ -2877,15 +2911,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡à¦° সেটিংস" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "পূরà§à¦£-পরà§à¦¦à¦¾ অদলবদল/টগল করà§à¦¨" @@ -3225,6 +3250,11 @@ msgstr "সময়:" msgid "Calls" msgstr "ডাকà§à¦¨ (Call)" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "থিম à¦à¦¡à¦¿à¦Ÿ করà§à¦¨..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "চালà§" @@ -5039,6 +5069,11 @@ msgid "Idle" msgstr "অনিয়োজিত" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "ইনà§à¦¸à¦Ÿà¦²" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "পà§à¦¨à¦°à¦¾à¦¯à¦¼ চেষà§à¦Ÿà¦¾ করà§à¦¨" @@ -5070,7 +5105,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "সকল" @@ -5084,8 +5118,9 @@ msgid "Sort:" msgstr "সাজান:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "উলà§à¦Ÿà¦¾à¦¨/বিপরীত দিকে ফিরান" +#, fuzzy +msgid "Reverse sorting." +msgstr "পরীকà§à¦·à¦¾à¦®à§‚লক উৎস" #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -5160,36 +5195,38 @@ msgid "Rotation Step:" msgstr "ঘূরà§à¦£à¦¾à§Ÿà¦¨à§‡à¦° পদকà§à¦·à§‡à¦ª:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "à¦à¦¾à¦°à§à¦Ÿà¦¿à¦•à§à¦¯à¦¾à¦² গাইড সরান" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "নতà§à¦¨ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ তৈরি করà§à¦¨" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "চলক/à¦à§‡à¦°à¦¿à§Ÿà§‡à¦¬à¦² অপসারণ করà§à¦¨" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "বকà§à¦°à¦°à§‡à¦–ায় বিনà§à¦¦à§ সরান" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "নতà§à¦¨ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ তৈরি করà§à¦¨" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "অগà§à¦°à¦¹à¦¨à¦¯à§‹à¦—à§à¦¯ চাবিসমূহ অপসারণ করà§à¦¨" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "নতà§à¦¨ হরাইজনà§à¦Ÿà¦¾à¦² à¦à¦¬à¦‚ à¦à¦¾à¦°à§à¦Ÿà¦¿à¦•à§à¦¯à¦¾à¦² গাইড তৈরী করà§à¦¨" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -7220,9 +7257,14 @@ msgstr "পশà§à¦šà¦¾à§Ž" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" msgstr "দরà§à¦¶à¦¨à§‡à¦° সাথে সারিবদà§à¦§ করà§à¦¨" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "নিরà§à¦¬à¦¾à¦šà¦¨à¦•ে দরà§à¦¶à¦¨à§‡à¦° সাথে সারিবদà§à¦§ করà§à¦¨" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "ইনসà§à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করার জনà§à¦¯ পà§à¦°à§Ÿà§‹à¦œà¦¨à§€à§Ÿ ধারক উপসà§à¦¥à¦¿à¦¤ নেই।" @@ -7423,10 +7465,6 @@ msgid "Focus Selection" msgstr "নিরà§à¦¬à¦¾à¦šà¦¨à§‡ ফোকাস করà§à¦¨" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "নিরà§à¦¬à¦¾à¦šà¦¨à¦•ে দরà§à¦¶à¦¨à§‡à¦° সাথে সারিবদà§à¦§ করà§à¦¨" - -#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Tool Select" msgstr "নিরà§à¦¬à¦¾à¦šà¦¨ করà§à¦¨" @@ -8044,14 +8082,6 @@ msgid "Transpose" msgstr "পকà§à¦·à¦¾à¦¨à§à¦¤à¦°à¦¿à¦¤ করà§à¦¨" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "পà§à¦°à¦¤à¦¿à¦¬à¦¿à¦®à§à¦¬ X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "পà§à¦°à¦¤à¦¿à¦¬à¦¿à¦®à§à¦¬ Y" - -#: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy msgid "Disable Autotile" msgstr "সà§à¦¬à§Ÿà¦‚কà§à¦°à¦¿à§Ÿ টà§à¦•রো" @@ -8493,6 +8523,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Vertex" msgstr "à¦à¦¾à¦°à¦Ÿà§‡à¦•à§à¦¸" @@ -8585,6 +8619,22 @@ msgid "Color uniform." msgstr "রà§à¦ªà¦¾à¦¨à§à¦¤à¦°" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8592,10 +8642,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." msgstr "à¦à§‡à¦•à§à¦Ÿà¦° ধà§à¦°à§à¦¬à¦• পরিবরà§à¦¤à¦¨ করà§à¦¨" @@ -8688,7 +8772,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8696,7 +8780,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8708,7 +8792,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8725,7 +8809,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8794,11 +8878,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8814,7 +8898,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8842,11 +8926,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8889,12 +8973,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "টেকà§à¦¸à¦¾à¦° ইউনিফরà§à¦® পরিবরà§à¦¤à¦¨ করà§à¦¨" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup." msgstr "টেকà§à¦¸à¦¾à¦° ইউনিফরà§à¦® পরিবরà§à¦¤à¦¨ করà§à¦¨" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "টেকà§à¦¸à¦¾à¦° ইউনিফরà§à¦® পরিবরà§à¦¤à¦¨ করà§à¦¨" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8904,7 +8993,7 @@ msgstr "রà§à¦ªà¦¾à¦¨à§à¦¤à¦°à§‡à¦° à¦à¦° সংলাপ..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8922,15 +9011,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8983,7 +9072,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -9011,12 +9100,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9095,47 +9184,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10403,6 +10492,11 @@ msgstr "পরবরà§à¦¤à§€ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "নোডের নতà§à¦¨ অà¦à¦¿à¦à¦¾à¦¬à¦• দান করà§à¦¨" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "অরà§à¦¥à¦ªà§‚রà§à¦¨!" @@ -10645,7 +10739,8 @@ msgid "Script is valid." msgstr "সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "অনà§à¦®à§‹à¦¦à¦¿à¦¤: a-z, A-Z, 0-9 à¦à¦¬à¦‚ _" #: editor/script_create_dialog.cpp @@ -12337,6 +12432,11 @@ msgstr "অকারà§à¦¯à¦•র উৎস!" msgid "Invalid source for shader." msgstr "অকারà§à¦¯à¦•র উৎস!" +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "অকারà§à¦¯à¦•র উৎস!" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -12354,6 +12454,27 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "পূরà§à¦¬à§‡à¦° টà§à¦¯à¦¾à¦¬" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "ফোলà§à¦¡à¦¾à¦° তৈরি করà§à¦¨" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "à¦à¦¡à¦¿à¦Ÿà¦°à§‡ খà§à¦²à§à¦¨" + +#~ msgid "Reverse" +#~ msgstr "উলà§à¦Ÿà¦¾à¦¨/বিপরীত দিকে ফিরান" + +#~ msgid "Mirror X" +#~ msgstr "পà§à¦°à¦¤à¦¿à¦¬à¦¿à¦®à§à¦¬ X" + +#~ msgid "Mirror Y" +#~ msgstr "পà§à¦°à¦¤à¦¿à¦¬à¦¿à¦®à§à¦¬ Y" + +#, fuzzy #~ msgid "Generating solution..." #~ msgstr "ওকটà§à¦°à§€ (octree) গঠনবিনà§à¦¯à¦¾à¦¸ তৈরি করা হচà§à¦›à§‡" diff --git a/editor/translations/ca.po b/editor/translations/ca.po index 4f12d5f02e..2ef6d44e3e 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-07-09 10:46+0000\n" +"PO-Revision-Date: 2019-07-19 13:41+0000\n" "Last-Translator: roger <616steam@gmail.com>\n" "Language-Team: Catalan <https://hosted.weblate.org/projects/godot-engine/" "godot/ca/>\n" @@ -132,6 +132,31 @@ msgid "Anim Change Call" msgstr "Canviar crida d'animació" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Modifica el temps de la clau" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Modifica la Transició d'Animació" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Modifica la Transformació de l'Animació" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Modifica el valor de la clau" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Canviar crida d'animació" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Canviar la durada de l'Animació" @@ -450,7 +475,7 @@ msgstr "Selecciona-ho Tot" #: editor/animation_track_editor.cpp #, fuzzy msgid "Select None" -msgstr "Selecciona un Node" +msgstr "No seleccionar-ne cap" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -628,7 +653,7 @@ msgstr "LÃnia:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "S'han trobat %d coincidències." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -786,9 +811,8 @@ msgid "Connect" msgstr "Connecta" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Senyals:" +msgstr "Senyal:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -954,10 +978,8 @@ msgid "Owners Of:" msgstr "Propietaris de:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "" -"Voleu Eliminar els fitxers seleccionats del projecte? (No es pot desfer!)" +msgstr "Eliminar els fitxers seleccionats del projecte? (No es pot restaurar)" #: editor/dependency_editor.cpp msgid "" @@ -1138,7 +1160,6 @@ msgid "Success!" msgstr "Èxit!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Instal·la" @@ -1689,7 +1710,7 @@ msgstr "Mostrar en el Gestor de Fitxers" msgid "New Folder..." msgstr "Nou Directori..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Refresca" @@ -1740,7 +1761,7 @@ msgstr "Endavant" msgid "Go Up" msgstr "Puja" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Commuta Fitxers Ocults" @@ -1765,23 +1786,31 @@ msgid "Move Favorite Down" msgstr "Mou Favorit Avall" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Directori Anterior" +#, fuzzy +msgid "Go to previous folder." +msgstr "Anar al directori pare." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Directori Següent" +#, fuzzy +msgid "Go to next folder." +msgstr "Anar al directori pare." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Anar al directori pare." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Cerca Fitxers" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Eliminar carpeta actual de preferits." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Commutar visibilitat dels fitxers ocults." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2514,6 +2543,11 @@ msgid "Go to previously opened scene." msgstr "Vés a l'escena oberta anteriorment." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Copia CamÃ" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Pestanya Següent" @@ -2727,14 +2761,6 @@ msgstr "" "l'editor." #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "Obrir automà ticament captures de pantalla" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "Obrir en un editor d'imatges extern." - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Mode Pantalla Completa" @@ -3055,6 +3081,11 @@ msgstr "Temps" msgid "Calls" msgstr "Crides" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Editar Tema" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Activat" @@ -4715,6 +4746,11 @@ msgid "Idle" msgstr "Inactiu" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Instal·la" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Torneu a provar" @@ -4743,7 +4779,6 @@ msgid "Last" msgstr "Últim" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Tot" @@ -4757,8 +4792,9 @@ msgid "Sort:" msgstr "Ordena:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Inverteix" +#, fuzzy +msgid "Reverse sorting." +msgstr "Sol·licitud en marxa..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4840,31 +4876,38 @@ msgid "Rotation Step:" msgstr "Pas de la Rotació:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Mou la guia vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Crea una nova guia vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Elimina la guia vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Mou la guia horitzontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Crea una nova guia horitzontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Elimina la guia horitzontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Crea una guia horitzontal i vertical noves" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6794,9 +6837,15 @@ msgid "Rear" msgstr "Darrere" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Alinear amb la Vista" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Alinea la Selecció amb la Vista" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "No hi ha cap node Pare per instanciar-li un fill." @@ -6985,10 +7034,6 @@ msgid "Focus Selection" msgstr "Focalitza't en la Selecció" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Alinea la Selecció amb la Vista" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Selecciona una Eina" @@ -7576,14 +7621,6 @@ msgid "Transpose" msgstr "Transposa" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Replica en l'eix X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Replica en l'Eix Y" - -#: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy msgid "Disable Autotile" msgstr "AutoTiles" @@ -8018,6 +8055,10 @@ msgid "Visual Shader Input Type Changed" msgstr "El tipus d'entrada VisualShader ha canviat" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vèrtex" @@ -8107,6 +8148,23 @@ msgid "Color uniform." msgstr "Transforma" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Retorna l'invers de l'arrel quadrada del parà metre." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8116,12 +8174,47 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" "Retorna un vector associat si el valor booleà proporcionat és cert o fals." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Retorna la tangent del parà metre." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Boolean constant." msgstr "Modificar una constant vectorial" @@ -8220,7 +8313,8 @@ msgid "Returns the arc-cosine of the parameter." msgstr "Retorna el l'arc cosinus del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "(Només GLES3) Retorna el cosinus hiperbòlic invers del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8228,7 +8322,8 @@ msgid "Returns the arc-sine of the parameter." msgstr "Retorna l'arc sinus del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "(Només GLES3) Retorna el sinus hiperbòlic invers del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8240,7 +8335,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Retorna l'arc tangent dels parà metres." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "(Només GLES3) Retorna la tangent hiperbòlica inversa del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8257,7 +8353,8 @@ msgid "Returns the cosine of the parameter." msgstr "Retorna el cosinus del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +#, fuzzy +msgid "Returns the hyperbolic cosine of the parameter." msgstr "(Només GLES3) Retorna el cosinus hiperbòlic del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8326,11 +8423,13 @@ msgid "1.0 / scalar" msgstr "1.0 / escalar" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +#, fuzzy +msgid "Finds the nearest integer to the parameter." msgstr "(Només GLES3) Troba l'enter més proper al parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +#, fuzzy +msgid "Finds the nearest even integer to the parameter." msgstr "(Només GLES3) Troba l'enter parell més proper al parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8346,7 +8445,8 @@ msgid "Returns the sine of the parameter." msgstr "Retorna el sinus del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +#, fuzzy +msgid "Returns the hyperbolic sine of the parameter." msgstr "(Només GLES3) Retorna el sinus hiperbòlic del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8374,11 +8474,13 @@ msgid "Returns the tangent of the parameter." msgstr "Retorna la tangent del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the hyperbolic tangent of the parameter." msgstr "(Només GLES3) Retorna la tangent hiperbòlica del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +#, fuzzy +msgid "Finds the truncated value of the parameter." msgstr "(Només GLES3) Troba el valor truncat del parà metre." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8423,12 +8525,17 @@ msgstr "Realitza la cerca de textures." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "Modifica un Uniforme Textura" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "Modifica un Uniforme Textura" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup with triplanar." msgstr "Modifica un Uniforme Textura" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8438,7 +8545,7 @@ msgstr "Funció de transformació." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8456,15 +8563,18 @@ msgid "Decomposes transform to four vectors." msgstr "Descompon una transformació en quatre vectors." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +#, fuzzy +msgid "Calculates the determinant of a transform." msgstr "(Només GLES3) Calcula el determinant d'una transformació." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +#, fuzzy +msgid "Calculates the inverse of a transform." msgstr "(Només GLES3) Calcula l'invers d'una transformació." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +#, fuzzy +msgid "Calculates the transpose of a transform." msgstr "(Només GLES3) Calcula la transposició d'una transformació." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8515,12 +8625,18 @@ msgid "Calculates the dot product of two vectors." msgstr "Calcula el producte escalar de dos vectors." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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 "" +"Retorna un vector que apunta en la mateixa direcció que un vector de " +"referència. La funció té tres parà metres vectorials: N, el vector a " +"orientar, I, el vector incident, i Nref, el vector de referència. Si el " +"producte de punt d'I i Nref és més petit que zero, el valor retornat és N. " +"en cas contrari es retorna -N." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." @@ -8543,13 +8659,17 @@ msgid "1.0 / vector" msgstr "1.0 / vector" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" +"Retorna un vector que apunta en la direcció de la reflexió (a: vector " +"d'incident, b: vector normal)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +#, fuzzy +msgid "Returns the vector that points in the direction of refraction." msgstr "Retorna un vector que apunta en la direcció de la refracció." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8633,47 +8753,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8821,8 +8941,9 @@ msgid "Compiled" msgstr "Compilat" #: editor/project_export.cpp +#, fuzzy msgid "Encrypted (Provide Key Below)" -msgstr "" +msgstr "Encriptat (Proporcioneu la clau a sota)" #: editor/project_export.cpp msgid "Invalid Encryption Key (must be 64 characters long)" @@ -9015,6 +9136,7 @@ msgid "Are you sure to open more than one project?" msgstr "Esteu segur que voleu obrir més d'un projecte de cop?" #: editor/project_manager.cpp +#, fuzzy msgid "" "The following project settings file does not specify the version of Godot " "through which it was created.\n" @@ -9026,8 +9148,17 @@ msgid "" "Warning: You won't be able to open the project with previous versions of the " "engine anymore." msgstr "" +"El següent fitxer de configuració del projecte següent no especifica la " +"versió de Godot amb la que s'ha creat.\n" +"\n" +"% s\n" +"\n" +"Si continueu amb l'obertura, es convertirà al format de fitxer de " +"configuració actual de Godot.\n" +"Advertiment: Ja no podreu obrir el projecte amb versions anteriors del motor." #: editor/project_manager.cpp +#, fuzzy msgid "" "The following project settings file was generated by an older engine " "version, and needs to be converted for this version:\n" @@ -9038,6 +9169,13 @@ msgid "" "Warning: You won't be able to open the project with previous versions of the " "engine anymore." msgstr "" +"El següent fitxer de configuració del projecte va ser generat per una versió " +"anterior del motor, i necessita ser convertit per a aquesta versió:\n" +"\n" +"% s\n" +"\n" +"Voleu convertir-lo?\n" +"Advertiment: ja no podreu obrir el projecte amb versions anteriors del motor." #: editor/project_manager.cpp msgid "" @@ -9638,8 +9776,9 @@ msgid "Post-Process" msgstr "Post-Processat" #: editor/rename_dialog.cpp +#, fuzzy msgid "Keep" -msgstr "" +msgstr "Mantenir" #: editor/rename_dialog.cpp msgid "CamelCase to under_scored" @@ -9890,6 +10029,11 @@ msgstr "Estendre el script" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Torna a Parentar el Node" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Entesos!" @@ -10109,7 +10253,8 @@ msgid "Script is valid." msgstr "El script és và lid." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "Permesos: a-z, a-Z, 0-9 i _" #: editor/script_create_dialog.cpp @@ -10254,8 +10399,9 @@ msgid "Set From Tree" msgstr "Estableix des de l'Arbre" #: editor/script_editor_debugger.cpp +#, fuzzy msgid "Export measures as CSV" -msgstr "" +msgstr "Exporta les mesures com a CSV" #: editor/settings_config_dialog.cpp msgid "Erase Shortcut" @@ -10979,8 +11125,9 @@ msgid "Package name is missing." msgstr "El nom del paquet falta." #: platform/android/export/export.cpp +#, fuzzy msgid "Package segments must be of non-zero length." -msgstr "" +msgstr "Els segments de paquets han de ser de longitud no zero." #: platform/android/export/export.cpp msgid "The character '%s' is not allowed in Android application package names." @@ -11008,25 +11155,35 @@ msgid "ADB executable not configured in the Editor Settings." msgstr "L'executable ADB no està configurat a la configuració de l'editor." #: platform/android/export/export.cpp +#, fuzzy msgid "OpenJDK jarsigner not configured in the Editor Settings." -msgstr "" +msgstr "OpenJDK Jarsigner no està configurat en la configuració de l'editor." #: platform/android/export/export.cpp msgid "Debug keystore not configured in the Editor Settings nor in the preset." msgstr "" #: platform/android/export/export.cpp +#, fuzzy msgid "Custom build requires a valid Android SDK path in Editor Settings." msgstr "" +"La compilació personalitzada requereix un camà d'Android SDK và lid en la " +"configuració de l'editor." #: platform/android/export/export.cpp +#, fuzzy msgid "Invalid Android SDK path for custom build in Editor Settings." msgstr "" +"El camà de l'SDK d'Android no és và lid per a la compilació personalitzada en " +"la configuració de l'editor." #: platform/android/export/export.cpp +#, fuzzy msgid "" "Android project is not installed for compiling. Install from Editor menu." msgstr "" +"El projecte Android no està instal·lat per a la compilació. Instal·leu-lo " +"des del menú Editor." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11037,32 +11194,47 @@ msgid "Invalid package name:" msgstr "El nom del paquet no és và lid:" #: platform/android/export/export.cpp +#, fuzzy msgid "" "Trying to build from a custom built template, but no version info for it " "exists. Please reinstall from the 'Project' menu." msgstr "" +"Intentant construir des d'una plantilla personalitzada, però no existeix " +"informació de versió per a això. Torneu a instal·lar des del menú 'projecte'." #: platform/android/export/export.cpp +#, fuzzy msgid "" "Android build version mismatch:\n" " Template installed: %s\n" " Godot Version: %s\n" "Please reinstall Android build template from 'Project' menu." msgstr "" +"La versió de compilació d'Android no coincideix:\n" +" Plantilla instal·lada:% s\n" +" Versió de Godot:% s\n" +"Torneu a instal·lar la plantilla de compilació d'Android des del menú " +"'Projecte'." #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" msgstr "" #: platform/android/export/export.cpp +#, fuzzy msgid "" "Building of Android project failed, check output for the error.\n" "Alternatively visit docs.godotengine.org for Android build documentation." msgstr "" +"La construcció del projecte Android ha fallat, comproveu la sortida per " +"l'error.\n" +"Alternativament visiteu docs.godotengine.org per a la documentació de " +"compilació d'Android." #: platform/android/export/export.cpp +#, fuzzy msgid "No build apk generated at: " -msgstr "" +msgstr "No s'ha generat cap compilació apk a: " #: platform/iphone/export/export.cpp msgid "Identifier is missing." @@ -11342,9 +11514,12 @@ msgid "A Bone2D only works with a Skeleton2D or another Bone2D as parent node." msgstr "" #: scene/2d/skeleton_2d.cpp +#, fuzzy msgid "" "This bone lacks a proper REST pose. Go to the Skeleton2D node and set one." msgstr "" +"Aquest OS no té una postura de descans adequada. Aneu al node Skeleton2D i " +"definiu-ne una." #: scene/2d/tile_map.cpp #, fuzzy @@ -11495,14 +11670,19 @@ msgid "Plotting Meshes" msgstr "S'està n traçant les Malles" #: scene/3d/gi_probe.cpp +#, fuzzy msgid "" "GIProbes are not supported by the GLES2 video driver.\n" "Use a BakedLightmap instead." msgstr "" +"Les GIProbes no estan suportades pel controlador de vÃdeo GLES2.\n" +"Utilitzeu un BakedLightmap en el seu lloc." #: scene/3d/light.cpp +#, fuzzy msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." msgstr "" +"Un SpotLight amb un angle més ample que 90 graus no pot projectar ombres." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11672,7 +11852,7 @@ msgstr "Trieu un color de la pantalla." #: scene/gui/color_picker.cpp msgid "HSV" -msgstr "" +msgstr "HSV" #: scene/gui/color_picker.cpp msgid "Raw" @@ -11722,6 +11902,7 @@ msgstr "" #: scene/gui/range.cpp msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." msgstr "" +"Si l'opció \"Exp Edit\" està habilitada, \"Min Value\" ha de ser major que 0." #: scene/gui/scroll_container.cpp #, fuzzy @@ -11787,6 +11968,11 @@ msgstr "Font no và lida pel Shader." msgid "Invalid source for shader." msgstr "Font no và lida pel Shader." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Font no và lida pel Shader." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Assignació a funció." @@ -11801,7 +11987,28 @@ msgstr "" #: servers/visual/shader_language.cpp msgid "Constants cannot be modified." -msgstr "" +msgstr "Les constants no es poden modificar." + +#~ msgid "Previous Folder" +#~ msgstr "Directori Anterior" + +#~ msgid "Next Folder" +#~ msgstr "Directori Següent" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Obrir automà ticament captures de pantalla" + +#~ msgid "Open in an external image editor." +#~ msgstr "Obrir en un editor d'imatges extern." + +#~ msgid "Reverse" +#~ msgstr "Inverteix" + +#~ msgid "Mirror X" +#~ msgstr "Replica en l'eix X" + +#~ msgid "Mirror Y" +#~ msgstr "Replica en l'Eix Y" #~ msgid "Generating solution..." #~ msgstr "S'està generant la solució..." diff --git a/editor/translations/cs.po b/editor/translations/cs.po index c9fbafaf13..f3eaafab33 100644 --- a/editor/translations/cs.po +++ b/editor/translations/cs.po @@ -136,6 +136,31 @@ msgid "Anim Change Call" msgstr "Animace: zmÄ›na volánÃ" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Animace: ZmÄ›nit Äas klÃÄového snÃmku" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animace: zmÄ›na pÅ™echodu" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animace: zmÄ›na transformace" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Animace: ZmÄ›nit hodnotu klÃÄového snÃmku" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animace: zmÄ›na volánÃ" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "ZmÄ›nit délku animace" @@ -1158,7 +1183,6 @@ msgid "Success!" msgstr "ÚspÄ›ch!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Instalovat" @@ -1729,7 +1753,7 @@ msgstr "Zobrazit ve správci souborů" msgid "New Folder..." msgstr "Nová složka..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Obnovit" @@ -1780,7 +1804,7 @@ msgstr "Jit dopÅ™edu" msgid "Go Up" msgstr "JÃt o úroveň výš" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Zobrazit skryté soubory" @@ -1805,26 +1829,33 @@ msgid "Move Favorite Down" msgstr "PÅ™esunout oblÃbenou položku dolů" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "PÅ™edchozà složka" +#, fuzzy +msgid "Go to previous folder." +msgstr "JÃt na nadÅ™azenou složku" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Dalšà složka" +#, fuzzy +msgid "Go to next folder." +msgstr "JÃt na nadÅ™azenou složku" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "JÃt na nadÅ™azenou složku" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Hledat soubory" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "Nelze vytvoÅ™it složku." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Zobrazit skryté soubory" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2549,6 +2580,11 @@ msgid "Go to previously opened scene." msgstr "PÅ™ejÃt na pÅ™edchozà scénu." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "KopÃrovat cestu" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Dalšà záložka" @@ -2760,15 +2796,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "OtevÅ™Ãt složku s daty a nastavenÃm editoru" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "OtevÅ™Ãt dalšà editor" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Celá obrazovka" @@ -3087,6 +3114,11 @@ msgstr "ÄŒas" msgid "Calls" msgstr "VolánÃ" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Editovat téma..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4753,6 +4785,11 @@ msgid "Idle" msgstr "NeÄinný" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Instalovat" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Opakovat" @@ -4781,7 +4818,6 @@ msgid "Last" msgstr "PoslednÃ" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "VÅ¡echny" @@ -4795,8 +4831,9 @@ msgid "Sort:" msgstr "Řadit:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Naopak" +#, fuzzy +msgid "Reverse sorting." +msgstr "PosÃlá se žádost..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4871,31 +4908,38 @@ msgid "Rotation Step:" msgstr "Krok rotace:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "PÅ™esunout svislé vodÃtko" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "VytvoÅ™it nové svislé vodÃtko" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Odstranit svislé vodÃtko" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "PÅ™esunout vodorovné vodÃtko" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "VytvoÅ™it nové vodorovné vodÃtko" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Odstranit vodorovné vodÃtko" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "VytvoÅ™it nové vodorovné a svislé vodÃtka" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6815,9 +6859,14 @@ msgstr "ZadnÃ" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" msgstr "Zarovnat s výhledem" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Zarovnat výbÄ›r s pohledem" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "" @@ -7008,10 +7057,6 @@ msgid "Focus Selection" msgstr "Zaměřit výbÄ›r" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Zarovnat výbÄ›r s pohledem" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Nástroj VýbÄ›r" @@ -7602,14 +7647,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Zrcadlit X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Zrcadlit Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8039,6 +8076,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vrchol" @@ -8130,6 +8171,23 @@ msgid "Color uniform." msgstr "Animace: zmÄ›na transformace" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Vrátà inverznà odmocninu z parametru." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8137,10 +8195,45 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Vrátà tangens parametru." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8232,7 +8325,8 @@ msgid "Returns the arc-cosine of the parameter." msgstr "Vrátà arkus kosinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "(Pouze GLES3) Vrátà inverznà hyperbolický kosinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8240,7 +8334,8 @@ msgid "Returns the arc-sine of the parameter." msgstr "Vrátà arkus sinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "(Pouze GLES3) Vrátà inverznà hyperbolický sinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8252,7 +8347,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Vrátà arkus tangent parametrů." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "(Pouze GLES3) Vrátà inverznà hyperbolický tangent parametru." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8270,7 +8366,8 @@ msgid "Returns the cosine of the parameter." msgstr "Vrátà kosinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +#, fuzzy +msgid "Returns the hyperbolic cosine of the parameter." msgstr "(Pouze GLES3) Vrátà hyperbolický kosinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8339,11 +8436,13 @@ msgid "1.0 / scalar" msgstr "1.0 / skalár" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +#, fuzzy +msgid "Finds the nearest integer to the parameter." msgstr "(Pouze GLES3) Nalezne nejbližšà celé ÄÃslo k parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +#, fuzzy +msgid "Finds the nearest even integer to the parameter." msgstr "(Pouze GLES3) Nalezne nejbližšà sudé celé ÄÃslo k parametru." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8359,7 +8458,8 @@ msgid "Returns the sine of the parameter." msgstr "Vrátà sinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +#, fuzzy +msgid "Returns the hyperbolic sine of the parameter." msgstr "(Pouze GLES3) Vrátà hyperbolický sinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8387,12 +8487,14 @@ msgid "Returns the tangent of the parameter." msgstr "Vrátà tangens parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the hyperbolic tangent of the parameter." msgstr "(Pouze GLES3) Vrátà hyperbolický tangens parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "" +#, fuzzy +msgid "Finds the truncated value of the parameter." +msgstr "Vrátà absolutnà hodnotu parametru." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." @@ -8433,11 +8535,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8447,7 +8553,7 @@ msgstr "Transformovat polygon" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8465,15 +8571,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8525,7 +8631,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8553,12 +8659,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8635,47 +8741,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9864,6 +9970,11 @@ msgstr "OtevÅ™Ãt skript" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "PÅ™idat/VytvoÅ™it nový uzel" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Dává smysl!" @@ -10084,7 +10195,8 @@ msgid "Script is valid." msgstr "Skript je validnÃ" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "Povoleno: a-z, A-Z, 0-9 a _" #: editor/script_create_dialog.cpp @@ -11733,6 +11845,11 @@ msgstr "Neplatný zdroj pro shader." msgid "Invalid source for shader." msgstr "Neplatný zdroj pro shader." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Neplatný zdroj pro shader." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11749,6 +11866,25 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Konstanty nenà možné upravovat." +#~ msgid "Previous Folder" +#~ msgstr "PÅ™edchozà složka" + +#~ msgid "Next Folder" +#~ msgstr "Dalšà složka" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "OtevÅ™Ãt dalšà editor" + +#~ msgid "Reverse" +#~ msgstr "Naopak" + +#~ msgid "Mirror X" +#~ msgstr "Zrcadlit X" + +#~ msgid "Mirror Y" +#~ msgstr "Zrcadlit Y" + #~ msgid "Generating solution..." #~ msgstr "Generovánà řeÅ¡enÃ..." diff --git a/editor/translations/da.po b/editor/translations/da.po index 103fc7ef35..33b763b7ee 100644 --- a/editor/translations/da.po +++ b/editor/translations/da.po @@ -139,6 +139,31 @@ msgstr "Anim Skift Call" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Skift Keyframetid" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim Skift Overgang" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Skift Transformering" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Skift Keyframeværdi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Skift Call" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "Ændre Animation Navn:" @@ -1165,7 +1190,6 @@ msgid "Success!" msgstr "Succes!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Installér" @@ -1735,7 +1759,7 @@ msgstr "Vis i FilhÃ¥ndtering" msgid "New Folder..." msgstr "Opret mappe..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Opdater" @@ -1786,7 +1810,7 @@ msgstr "GÃ¥ Fremad" msgid "Go Up" msgstr "GÃ¥ Op" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Skifter Skjulte Filer" @@ -1812,27 +1836,32 @@ msgstr "Flyt Favorit Ned" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "Forrige fane" +msgid "Go to previous folder." +msgstr "GÃ¥ til overliggende mappe" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Opret Mappe" +msgid "Go to next folder." +msgstr "GÃ¥ til overliggende mappe" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "GÃ¥ til overliggende mappe" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Søg Classes" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "Kunne ikke oprette mappe." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Skifter Skjulte Filer" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2563,6 +2592,11 @@ msgid "Go to previously opened scene." msgstr "GÃ¥ til den forrige Ã¥bnede scene." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Kopier Sti" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Næste fane" @@ -2775,15 +2809,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Ã…bn redaktør Data/Indstillinger-mappe" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Ã…bn næste Editor" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Skifter fuldskærm" @@ -3103,6 +3128,11 @@ msgstr "Tid" msgid "Calls" msgstr "Kald" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Medlemmer" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4836,6 +4866,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Installér" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4865,7 +4900,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Alle" @@ -4879,8 +4913,9 @@ msgid "Sort:" msgstr "Sorter:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Omvendt" +#, fuzzy +msgid "Reverse sorting." +msgstr "Anmoder..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4954,32 +4989,39 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "" +#, fuzzy +msgid "Move Vertical Guide" +msgstr "Fjern vertikal guide" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Opret ny vertikal guide" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Fjern vertikal guide" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "" +#, fuzzy +msgid "Move Horizontal Guide" +msgstr "Fjern horisontal guide" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Opret ny horisontal guide" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Fjern horisontal guide" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" +msgstr "Opret ny vertikal guide" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -6926,7 +6968,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7114,10 +7160,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Vælg værktøj" @@ -7703,14 +7745,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8140,6 +8174,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8231,6 +8269,22 @@ msgid "Color uniform." msgstr "Anim Skift Transformering" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8238,10 +8292,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8331,7 +8419,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8339,7 +8427,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8351,7 +8439,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8368,7 +8456,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8437,11 +8525,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8457,7 +8545,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8485,11 +8573,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8530,11 +8618,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8544,7 +8636,7 @@ msgstr "Opret Poly" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8562,15 +8654,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8622,7 +8714,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8650,12 +8742,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8732,47 +8824,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9972,6 +10064,11 @@ msgstr "Ã…ben script" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Opret Ny %s" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Gem Scene" @@ -10192,7 +10289,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11823,6 +11920,11 @@ msgstr "Ugyldig skriftstørrelse." msgid "Invalid source for shader." msgstr "Ugyldig skriftstørrelse." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Ugyldig skriftstørrelse." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11840,6 +11942,21 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "Forrige fane" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Opret Mappe" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Ã…bn næste Editor" + +#~ msgid "Reverse" +#~ msgstr "Omvendt" + +#, fuzzy #~ msgid "Failed to create solution." #~ msgstr "Fejler med at indlæse ressource." diff --git a/editor/translations/de.po b/editor/translations/de.po index eac561c855..0816cf1a85 100644 --- a/editor/translations/de.po +++ b/editor/translations/de.po @@ -43,12 +43,13 @@ # Marcus Naschke <marcus.naschke@gmail.com>, 2019. # datenbauer <d-vaupel@web.de>, 2019. # Alexander Hausmann <alexander-hausmann+weblate@posteo.de>, 2019. +# Nicolas Mohr <81moni1bif@hft-stuttgart.de>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-09 10:46+0000\n" -"Last-Translator: So Wieso <sowieso@dukun.de>\n" +"PO-Revision-Date: 2019-07-21 11:06+0000\n" +"Last-Translator: Nicolas Mohr <81moni1bif@hft-stuttgart.de>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/" "godot/de/>\n" "Language: de\n" @@ -169,6 +170,31 @@ msgid "Anim Change Call" msgstr "Aufruf ändern" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Schlüsselbildzeit ändern" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Übergang bearbeiten" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Transformation bearbeiten" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Schlüsselbildwert ändern" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Aufruf ändern" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Animationslänge ändern" @@ -672,7 +698,7 @@ msgstr "Zeilennummer:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "%d Übereinstimmung(en) gefunden." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -830,9 +856,8 @@ msgid "Connect" msgstr "Verbinden" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Signale:" +msgstr "Signal:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -997,11 +1022,10 @@ msgid "Owners Of:" msgstr "Besitzer von:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" msgstr "" -"Ausgewählte Dateien aus dem Projekt löschen? (Kann nicht rückgängig gemacht " -"werden)" +"Ausgewählte Dateien aus dem Projekt entfernen? (Kann nicht rückgängig " +"gemacht werden)" #: editor/dependency_editor.cpp msgid "" @@ -1185,7 +1209,6 @@ msgid "Success!" msgstr "Geschafft!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Installieren" @@ -1554,6 +1577,7 @@ msgstr "Vorlagendatei nicht gefunden:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"In 32-bit-Exporten kann das eingebettete PCK nicht größer als 4 GiB sein." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1728,7 +1752,7 @@ msgstr "Im Dateimanager anzeigen" msgid "New Folder..." msgstr "Neuer Ordner..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Aktualisieren" @@ -1779,7 +1803,7 @@ msgstr "Vor" msgid "Go Up" msgstr "Hoch" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Versteckte Dateien ein- und ausblenden" @@ -1804,23 +1828,31 @@ msgid "Move Favorite Down" msgstr "Favorit nach unten schieben" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Vorheriger Ordner" +#, fuzzy +msgid "Go to previous folder." +msgstr "Gehe zu übergeordnetem Ordner." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Nächster Ordner" +#, fuzzy +msgid "Go to next folder." +msgstr "Gehe zu übergeordnetem Ordner." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Gehe zu übergeordnetem Ordner." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Dateien suchen" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Gegenwärtigen Ordner (de)favorisieren." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Versteckte Dateien ein- oder ausblenden." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2561,6 +2593,10 @@ msgid "Go to previously opened scene." msgstr "Gehe zu vorher geöffneter Szene." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Text kopieren" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Nächster Tab" @@ -2773,14 +2809,6 @@ msgstr "" "Bildschirmfotos werden im „Editor Data/Settings“-Verzeichnis gespeichert." #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "Bildschirmfotos automatisch öffnen" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "In externem Bildbearbeitungsprogramm öffnen." - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Vollbildmodus umschalten" @@ -3101,6 +3129,11 @@ msgstr "Zeit" msgid "Calls" msgstr "Aufrufe" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Thema bearbeiten" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "An" @@ -4771,6 +4804,11 @@ msgid "Idle" msgstr "Leerlauf" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Installieren" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Erneut versuchen" @@ -4799,7 +4837,6 @@ msgid "Last" msgstr "Letzte" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Alle" @@ -4813,8 +4850,9 @@ msgid "Sort:" msgstr "Sortiere:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Umkehren" +#, fuzzy +msgid "Reverse sorting." +msgstr "Frage an..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4896,31 +4934,38 @@ msgid "Rotation Step:" msgstr "Rotationsabstand:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Vertikale Hilfslinie verschieben" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Neue vertikale Hilfslinie erstellen" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Vertikale Hilfslinie löschen" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Horizontale Hilfslinie verschieben" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Neue horizontale Hilfslinie erstellen" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Horizontale Hilfslinie löschen" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Neue horizontale und vertikale Hilfslinien erstellen" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6515,7 +6560,7 @@ msgstr "Syntaxhervorhebung" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Springe zu" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6523,9 +6568,8 @@ msgid "Bookmarks" msgstr "Lesezeichen" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Punkte erstellen." +msgstr "Haltepunkte" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6816,9 +6860,15 @@ msgid "Rear" msgstr "Hinten" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Mit Sicht ausrichten" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Auswahl auf Ansicht ausrichten" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "" @@ -7007,10 +7057,6 @@ msgid "Focus Selection" msgstr "Auswahl fokussieren" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Auswahl auf Ansicht ausrichten" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Werkzeugauswahl" @@ -7573,14 +7619,6 @@ msgid "Transpose" msgstr "Transponieren" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "X-Koordinaten spiegeln" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Y-Koordinaten spiegeln" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "Autokacheln deaktivieren" @@ -7979,6 +8017,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Visual-Shader-Eingabetyp geändert" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vertex" @@ -8063,6 +8105,23 @@ msgid "Color uniform." msgstr "Farb-Uniform." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Gibt die inverse Quadratwurzel des Parameters zurück." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8072,12 +8131,47 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector 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." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Gibt den Tangens des Parameters zurück." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "Boolean-Konstante." @@ -8166,7 +8260,8 @@ msgid "Returns the arc-cosine of the parameter." msgstr "Gibt den Arkuskosinus des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" "(Nur GLES3) Gibt den inversen hyperbolischen Kosinus des Parameters zurück." @@ -8175,7 +8270,8 @@ msgid "Returns the arc-sine of the parameter." msgstr "Gibt den Arkussinus des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" "(Nur GLES3) Gibt den inversen hyperbolischen Sinus des Parameters zurück." @@ -8188,7 +8284,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Gibt den Arkuskosinus2 der Parameter zurück." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" "(Nur GLES3) Gibt den inversen hyperbolischen Tangens des Parameters zurück." @@ -8206,7 +8303,8 @@ msgid "Returns the cosine of the parameter." msgstr "Gibt den Kosinus des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +#, fuzzy +msgid "Returns the hyperbolic cosine of the parameter." msgstr "(Nur GLES3) Gibt den hyperbolischen Kosinus des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8275,11 +8373,13 @@ msgid "1.0 / scalar" msgstr "1.0 / Skalar" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +#, fuzzy +msgid "Finds the nearest integer to the parameter." msgstr "(nur GLES3) Gibt die nächste Ganzzahl vom Parameter zurück." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +#, fuzzy +msgid "Finds the nearest even integer to the parameter." msgstr "(nur GLES3) Gibt die nächste gerade Ganzzahl vom Parameter zurück." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8295,7 +8395,8 @@ msgid "Returns the sine of the parameter." msgstr "Gibt den Sinus des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +#, fuzzy +msgid "Returns the hyperbolic sine of the parameter." msgstr "(nur GLES3) Gibt den hyperbolischen Sinus des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8331,11 +8432,13 @@ msgid "Returns the tangent of the parameter." msgstr "Gibt den Tangens des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the hyperbolic tangent of the parameter." msgstr "(nur GLES3) Gibt den hyperbolischen Tangens des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +#, fuzzy +msgid "Finds the truncated value of the parameter." msgstr "(Nur GLES3) Gibt den abgeschnittenen Wert des Parameters zurück." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8375,11 +8478,18 @@ msgid "Perform the texture lookup." msgstr "Texturfinden ausführen." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +#, fuzzy +msgid "Cubic texture uniform lookup." msgstr "Kubisches Textur-Uniform." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +#, fuzzy +msgid "2D texture uniform lookup." +msgstr "2D-Textur-Uniform." + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup with triplanar." msgstr "2D-Textur-Uniform." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8387,8 +8497,9 @@ msgid "Transform function." msgstr "Transformierungsfunktion." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8413,15 +8524,18 @@ msgid "Decomposes transform to four vectors." msgstr "Extrahiert vier Vektoren aus Transform." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +#, fuzzy +msgid "Calculates the determinant of a transform." msgstr "(nur GLES3) Berechnet die Determinante eines Transforms." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +#, fuzzy +msgid "Calculates the inverse of a transform." msgstr "(nur GLES3) Invertiert ein Transform." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +#, fuzzy +msgid "Calculates the transpose of a transform." msgstr "(nur GLES3) Transponiert ein Transform." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8469,8 +8583,9 @@ msgid "Calculates the dot product of two vectors." msgstr "Berechnet das Skalarprodukt aus zwei Vektoren." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8502,15 +8617,17 @@ msgid "1.0 / vector" msgstr "1.0 / Vektor" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" "Berechnet den Vektor der in die Richtung einer Reflektion zeigt (a: " "Einfallsvektor, b: Normalenvektor)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +#, fuzzy +msgid "Returns the vector that points in the direction of refraction." msgstr "Berechnet den Vektor der in Richtung einer Brechung zeigt." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8610,59 +8727,67 @@ msgstr "" "Eingänge müssen übergeben werden)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +#, fuzzy +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" "(nur GLES3) (nur für Fragment-/Light-Modus) Skalare Ableitungsfunktion." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +#, fuzzy +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" "(nur GLES3) (nur für Fragment-/Light-Modus) Vektorielle Ableitungsfunktion." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" "(nur GLES3) (nur für Fragment-/Light-Modus) (Vektor) Lokale differenzielle " "Ableitung in ‚x‘-Richtung." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" "(nur GLES3) (nur für Fragment-/Light-Modus) (Skalar) Lokale differenzielle " "Ableitung in ‚x‘-Richtung." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" "(nur GLES3) (nur für Fragment-/Light-Modus) (Vektor) Lokale differenzielle " "Ableitung in ‚y‘-Richtung." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" "(nur GLES3) (nur für Fragment-/Light-Modus) (Skalar) Lokale differenzielle " "Ableitung in ‚y‘-Richtung." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" "(nur GLES3) (nur für Fragment-/Light-Modus) (Vektor) Summe der absoluten " "Ableitungen in ‚x‘- und ‚y‘-Richtung." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" "(nur GLES3) (nur für Fragment-/Light-Modus) (Skalar) Summe der absoluten " "Ableitungen in ‚x‘- und ‚y‘-Richtung." @@ -9897,6 +10022,11 @@ msgid "Extend Script" msgstr "Skript erweitern" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Node umhängen" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Szenen-Wurzel erstellen" @@ -10114,7 +10244,8 @@ msgid "Script is valid." msgstr "Skript ist gültig." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "Erlaubt: a-z, A-Z, 0-9 und _" #: editor/script_create_dialog.cpp @@ -11185,7 +11316,6 @@ msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "Ungültige Abmessungen für Startbildschirm (sollte 620x300 sein)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." @@ -11256,12 +11386,11 @@ msgstr "" "Eigenschaft „Particles Animation“ aktiviert." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." msgstr "" -"Eine Textur mit der Form des Lichtkegels muss in der ‚Texture‘-Eigenschaft " +"Eine Textur mit der Form des Lichtkegels muss in der „Texture“-Eigenschaft " "angegeben werden." #: scene/2d/light_occluder_2d.cpp @@ -11272,10 +11401,10 @@ msgstr "" "Occluder funktioniert." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." msgstr "" -"Das Occluder-Polygon für diesen Occluder ist leer. Bitte zeichne ein Polygon!" +"Das Occluder-Polygon für diesen Occluder ist leer. Zum Fortfahren Polygon " +"zeichnen." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11380,18 +11509,16 @@ msgstr "" "verwendet werden um ihnen eine Form zu geben." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." msgstr "" -"VisibilityEnable2D funktioniert am besten, wenn es ein Unterobjekt erster " -"Ordnung der bearbeiteten Szene ist." +"VisibilityEnable2D funktioniert am besten, wenn die Wurzel der bearbeiteten " +"Szene das Elternobjekt ist." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera braucht ein ARVROrigin-Node als Überobjekt" +msgstr "ARVRCamera braucht ein ARVROrigin-Node als Überobjekt." #: scene/3d/arvr_nodes.cpp msgid "ARVRController must have an ARVROrigin node as its parent." @@ -11481,13 +11608,12 @@ msgstr "" "RigidBody, KinematicBody usw. eingehängt werden um diesen eine Form zu geben." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" -"Damit CollisionShape funktionieren kann, muss eine Form vorhanden sein. " -"Bitte erzeuge eine shape Ressource dafür!" +"Zum Funktionieren eines CollisionShape benötigt es eine zugeordnete Form. " +"Zum Fortfahren ist eine Shape-Ressource dafür zu erzeugen." #: scene/3d/collision_shape.cpp msgid "" @@ -11524,6 +11650,8 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." msgstr "" +"Ein SpotLight mit einem Winkel von mehr als 90 Grad kann keine Schatten " +"werfen." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11570,13 +11698,12 @@ msgstr "" "gesetzt wird." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED erfordert die Aktivierung von „Up Vector“ in " -"der Curve-Ressource des übergeordneten Pfades." +"PathFollow mit aktiviertem ROTATION_ORIENTED erfordert die Aktivierung von " +"„Up Vector“ in der Curve-Ressource des übergeordneten Pfades." #: scene/3d/physics_body.cpp msgid "" @@ -11590,11 +11717,12 @@ msgstr "" "geändert werden." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." -msgstr "Die Pfad-Eigenschaft muss auf ein gültiges Spatial-Node verweisen." +msgstr "" +"Die „Remote Path“-Eigenschaft muss auf ein gültiges Spatial-Node oder ein " +"von Spatial-Node abgeleitetes Node verweisen." #: scene/3d/soft_body.cpp msgid "This body will be ignored until you set a mesh." @@ -11612,13 +11740,12 @@ msgstr "" "geändert werden." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" -"Eine SpriteFrames-Ressource muss in der ‚Frames‘-Eigenschaft erzeugt oder " -"definiert werden, damit AnimatedSprite3D Einzelbilder anzeigen kann." +"Eine SpriteFrames-Ressource muss in der „Frames“-Eigenschaft erzeugt oder " +"gesetzt werden, damit AnimatedSprite3D Einzelbilder anzeigen kann." #: scene/3d/vehicle_body.cpp msgid "" @@ -11634,6 +11761,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"WorldEnvironment benötigt dass die Eigenschaft „Environment“ auf ein " +"Environment mit einem sichtbaren Effekt verweist." #: scene/3d/world_environment.cpp msgid "" @@ -11672,9 +11801,8 @@ msgid "Nothing connected to input '%s' of node '%s'." msgstr "Nichts ist mit dem Eingang ‚%s‘ von Node ‚%s‘ verbunden." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." -msgstr "Für diesen Graphen wurde kein Wurzel-Animation-Node festgelegt." +msgstr "Für diesen Graphen wurde kein Wurzel-AnimationNode festgelegt." #: scene/animation/animation_tree.cpp msgid "Path to an AnimationPlayer node containing animations is not set." @@ -11689,9 +11817,8 @@ msgstr "" "AnimationPlayer-Node." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." -msgstr "Die Wurzel des Animationsspieler ist kein gültiges Node." +msgstr "Die Wurzel des Animationsspielers ist kein gültiges Node." #: scene/animation/animation_tree_player.cpp msgid "This node has been deprecated. Use AnimationTree instead." @@ -11720,14 +11847,13 @@ msgid "Add current color as a preset." msgstr "Aktuelle Farbe als Vorlage hinzufügen." #: scene/gui/container.cpp -#, fuzzy msgid "" "Container by itself serves no purpose unless a script configures its " "children placement behavior.\n" "If you don't intend to add a script, use a plain Control node instead." msgstr "" -"Einfache Container sind unnötig solange kein Skript die Platzierung der " -"Inhalte vornimmt.\n" +"Container sind unnötig solange kein Skript die Platzierung der Inhalte " +"vornimmt.\n" "Falls kein Skript angehängt werden soll wird empfohlen ein einfaches " "‚Control‘-Node zu verwenden." @@ -11749,24 +11875,21 @@ msgid "Please Confirm..." msgstr "Bitte bestätigen..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " "running." msgstr "" -"Popups werden standardmäßig versteckt, es sei denn Sie rufen popup() oder " -"irgendeine der popup*() Funktionen auf. Sie für die Bearbeitung sichtbar zu " -"machen ist in Ordnung, aber sie werden zur Laufzeit automatisch wieder " -"versteckt." +"Popups werden standardmäßig nicht angezeigt, es sei denn sie werden durch " +"popup() oder andere popup*()-Funktionen aufgerufen. Sie als sichtbar zu " +"markieren kann für die Bearbeitung nützlich sein, zur Laufzeit werden sie " +"allerdings nicht automatisch angezeigt." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "Wenn exp_edit true ist muss min_value größer als null sein." +msgstr "Wenn „Exp Edit“ aktiviert ist muss „Min Value“ größer als null sein." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " @@ -11824,14 +11947,18 @@ msgid "Input" msgstr "Eingang" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "Ungültige Quelle für Shader." +msgstr "Ungültige Quelle für Vorschau." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "Ungültige Quelle für Shader." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Ungültige Quelle für Shader." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Zuweisung an Funktion." @@ -11848,6 +11975,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 "Previous Folder" +#~ msgstr "Vorheriger Ordner" + +#~ msgid "Next Folder" +#~ msgstr "Nächster Ordner" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Bildschirmfotos automatisch öffnen" + +#~ msgid "Open in an external image editor." +#~ msgstr "In externem Bildbearbeitungsprogramm öffnen." + +#~ msgid "Reverse" +#~ msgstr "Umkehren" + +#~ msgid "Mirror X" +#~ msgstr "X-Koordinaten spiegeln" + +#~ msgid "Mirror Y" +#~ msgstr "Y-Koordinaten spiegeln" + #~ msgid "Generating solution..." #~ msgstr "Lösungen erzeugen..." diff --git a/editor/translations/de_CH.po b/editor/translations/de_CH.po index d1d0c1ade8..9b3fdf7b02 100644 --- a/editor/translations/de_CH.po +++ b/editor/translations/de_CH.po @@ -134,6 +134,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp #, fuzzy msgid "Change Animation Length" msgstr "Typ ändern" @@ -1151,7 +1171,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1709,7 +1728,7 @@ msgstr "Datei öffnen" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1760,7 +1779,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1786,12 +1805,12 @@ msgstr "" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "Node(s) löschen" +msgid "Go to previous folder." +msgstr "Node erstellen" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" +msgid "Go to next folder." msgstr "Node erstellen" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp @@ -1799,12 +1818,16 @@ msgstr "Node erstellen" msgid "Go to parent folder." msgstr "Node erstellen" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2503,6 +2526,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Script hinzufügen" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2700,14 +2728,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -3028,6 +3048,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Node Filter editieren" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4741,6 +4766,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4769,7 +4798,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4783,7 +4811,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4858,36 +4886,39 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "" +#, fuzzy +msgid "Move Vertical Guide" +msgstr "Ungültige Bilder löschen" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "Neues Projekt erstellen" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "Ungültige Bilder löschen" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "" +#, fuzzy +msgid "Move Horizontal Guide" +msgstr "Ungültige Bilder löschen" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "Neues Projekt erstellen" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "Ungültige Bilder löschen" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" +msgstr "Neues Projekt erstellen" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -6817,7 +6848,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7006,10 +7041,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7593,14 +7624,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8029,6 +8052,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8115,6 +8142,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8122,10 +8165,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8214,7 +8291,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8222,7 +8299,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8234,7 +8311,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8251,7 +8328,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8320,11 +8397,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8340,7 +8417,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8368,11 +8445,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8412,11 +8489,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8426,7 +8507,7 @@ msgstr "Transformationstyp" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8444,15 +8525,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8503,7 +8584,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8531,12 +8612,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8613,47 +8694,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9847,6 +9928,11 @@ msgid "Extend Script" msgstr "Script hinzufügen" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Node erstellen" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -10062,7 +10148,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11654,6 +11740,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11671,6 +11761,14 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "Node(s) löschen" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Node erstellen" + +#, fuzzy #~ msgid "Build Project" #~ msgstr "Projektname:" diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot index 5f4f2ae64b..d239d252ac 100644 --- a/editor/translations/editor.pot +++ b/editor/translations/editor.pot @@ -121,6 +121,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1098,7 +1118,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1631,7 +1650,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1682,7 +1701,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1707,23 +1726,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2398,6 +2421,10 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2589,14 +2616,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2909,6 +2928,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4531,6 +4554,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4559,7 +4586,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4573,7 +4599,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4648,31 +4674,31 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6528,7 +6554,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6713,10 +6743,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7277,14 +7303,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7662,6 +7680,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7746,6 +7768,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7753,10 +7791,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7845,7 +7917,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7853,7 +7925,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7865,7 +7937,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7882,7 +7954,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7951,11 +8023,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7971,7 +8043,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7999,11 +8071,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8043,11 +8115,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8056,7 +8132,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8074,15 +8150,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8131,7 +8207,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8159,12 +8235,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8241,47 +8317,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9432,6 +9508,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9634,7 +9714,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11153,6 +11233,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/el.po b/editor/translations/el.po index ed1e0493b4..e0be979450 100644 --- a/editor/translations/el.po +++ b/editor/translations/el.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-02 10:48+0000\n" +"PO-Revision-Date: 2019-07-15 13:10+0000\n" "Last-Translator: George Tsiamasiotis <gtsiam@windowslive.com>\n" "Language-Team: Greek <https://hosted.weblate.org/projects/godot-engine/godot/" "el/>\n" @@ -131,6 +131,31 @@ msgid "Anim Change Call" msgstr "Anim Αλλαγή κλήσης" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Αλλαγή χÏόνου στιγμιοτÏπου" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim Αλλαγή μετάβασης" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Αλλαγή μετασχηματισμοÏ" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Αλλαγή τιμής στιγμιοτÏπου" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Αλλαγή κλήσης" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Αλλαγή Μήκους Κίνησης" @@ -455,9 +480,8 @@ msgid "Select All" msgstr "Επιλογή όλων" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select None" -msgstr "Επιλογή κόμβου" +msgstr "Αποεπιλογή Όλων" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -635,7 +659,7 @@ msgstr "ΑÏ. γÏαμμής:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Î’ÏÎθηκαν %d αποτελÎσματα." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -793,9 +817,8 @@ msgid "Connect" msgstr "ΣÏνδεση" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Σήματα:" +msgstr "Σήμα:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -962,9 +985,8 @@ msgid "Owners Of:" msgstr "Ιδιοκτήτες του:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "Îα αφαιÏεθοÏν τα επιλεγμÎνα αÏχεία από το ÎÏγο; (ΑδÏνατη η αναίÏεση)" +msgstr "ΑφαίÏεση επιλεγμÎνων αÏχείων από το ÎÏγο; (Αδυναμία αναίÏεσης)" #: editor/dependency_editor.cpp msgid "" @@ -1146,7 +1168,6 @@ msgid "Success!" msgstr "Επιτυχία!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Εγκατάσταση" @@ -1334,7 +1355,6 @@ msgid "Must not collide with an existing engine class name." msgstr "Δεν μποÏεί να συγχÎεται με υπαÏκτό όνομα κλάσης της μηχανής." #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing built-in type name." msgstr "Δεν μποÏεί να συγχÎεται με υπαÏκτό ενσωματωμÎνο όνομα Ï„Ïπου." @@ -1518,6 +1538,7 @@ msgstr "Δεν βÏÎθηκε αÏχείο Ï€ÏοτÏπου:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"Σε εξαγωγÎÏ‚ 32-bit, το ενσωματωμÎνο PCK δεν μποÏεί να υπεÏβαίνει τα 4 GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1544,9 +1565,8 @@ msgid "Node Dock" msgstr "ΠλατφόÏμα Κόμβου" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "FileSystem and Import Docks" -msgstr "ΠλατφόÏμα Συστήματος ΑÏχείων" +msgstr "ΠλατφόÏμες Συστήματος ΑÏχείων και Εισαγωγής" #: editor/editor_feature_profile.cpp msgid "Erase profile '%s'? (no undo)" @@ -1597,12 +1617,11 @@ msgid "File '%s' format is invalid, import aborted." msgstr "ΆκυÏη μοÏφή αÏχείου «%s», ακÏÏωση εισαγωγής." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." msgstr "" -"ΥπαÏκτό Ï€Ïοφίλ «%s». ΑφαιÏÎστε το Ï€Ïιν την εισαγωγή, ακÏÏωση εισαγωγής." +"ΥπαÏκτό Ï€Ïοφίλ «%s». ΑφαιÏÎστε το Ï€Ïιν την εισαγωγή. Ματαίωση εισαγωγής." #: editor/editor_feature_profile.cpp msgid "Error saving profile to path: '%s'." @@ -1613,9 +1632,8 @@ msgid "Unset" msgstr "ΚατάÏγηση" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Current Profile:" -msgstr "ΤÏÎχων Î Ïοφίλ" +msgstr "ΤÏÎχων Î Ïοφίλ:" #: editor/editor_feature_profile.cpp msgid "Make Current" @@ -1637,9 +1655,8 @@ msgid "Export" msgstr "Εξαγωγή" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Available Profiles:" -msgstr "ΔιαθÎσιμα Î Ïοφίλ" +msgstr "ΔιαθÎσιμα Î Ïοφίλ:" #: editor/editor_feature_profile.cpp msgid "Class Options" @@ -1694,7 +1711,7 @@ msgstr "Εμφάνιση στη διαχείÏιση αÏχείων" msgid "New Folder..." msgstr "ÎÎος φάκελος..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Αναναίωση" @@ -1745,7 +1762,7 @@ msgstr "Πήγαινε μπÏοστά" msgid "Go Up" msgstr "Πήγαινε πάνω" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Εναλλαγή κÏυμμÎνων αÏχείων" @@ -1770,23 +1787,31 @@ msgid "Move Favorite Down" msgstr "Μετακίνηση αγαπημÎνου κάτω" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Î ÏοηγοÏμενος φάκελος" +#, fuzzy +msgid "Go to previous folder." +msgstr "Πήγαινε στον γονικό φάκελο." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Επόμενος φάκελος" +#, fuzzy +msgid "Go to next folder." +msgstr "Πήγαινε στον γονικό φάκελο." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Πήγαινε στον γονικό φάκελο." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Αναζήτηση αÏχείων" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Εναλλαγή αγαπημÎνου Ï„ÏÎχοντος φακÎλου." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Εναλλαγή οÏατότητας κÏυμÎνων αÏχείων." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2529,6 +2554,11 @@ msgid "Go to previously opened scene." msgstr "ΕπιστÏοφή στην Ï€ÏοηγουμÎνως ανοιγμÎνη σκηνή." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "ΑντιγÏαφή διαδÏομής" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Επόμενη καÏÏ„Îλα" @@ -2732,32 +2762,22 @@ msgid "Editor Layout" msgstr "Διάταξη επεξεÏγαστή" #: editor/editor_node.cpp -#, fuzzy msgid "Take Screenshot" -msgstr "Βγάζει νόημα!" +msgstr "Λήψη Στιγμιότυπου Οθόνης" #: editor/editor_node.cpp -#, fuzzy msgid "Screenshots are stored in the Editor Data/Settings Folder." -msgstr "Άνοιγμα φακÎλου δεδομÎνων/Ïυθμίσεων επεξεÏγαστή" - -#: editor/editor_node.cpp -msgid "Automatically Open Screenshots" msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Άνοιγμα του επόμενου επεξεÏγαστή" +"Τα στιγμιότυπα οθόνης αποθηκεÏονται στον φάκελο δεδομÎνων/Ïυθμίσεων του " +"επεξεÏγαστή." #: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Εναλλαγή πλήÏους οθόνης" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle System Console" -msgstr "Εναλλαγή οÏατότητας CanvasItem" +msgstr "Εναλλαγή Κονσόλας Συστήματος" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -2866,19 +2886,16 @@ msgid "Spins when the editor window redraws." msgstr "ΠεÏιστÏÎφεται όταν το παÏάθυÏο του επεξεÏγαστή επαναχÏωματίζεται." #: editor/editor_node.cpp -#, fuzzy msgid "Update Continuously" -msgstr "Συνεχόμενη" +msgstr "Συνεχόμενη ΑνανÎωση" #: editor/editor_node.cpp -#, fuzzy msgid "Update When Changed" -msgstr "ΕνημÎÏωση αλλαγών" +msgstr "ΑνανÎωση στην Αλλαγή" #: editor/editor_node.cpp -#, fuzzy msgid "Hide Update Spinner" -msgstr "ΑπενεÏγοποίηση δείκτη ενημÎÏωσης" +msgstr "ΑπόκÏυψη Δείκτη ΕνημÎÏωσης" #: editor/editor_node.cpp msgid "FileSystem" @@ -3075,6 +3092,11 @@ msgstr "ΧÏόνος" msgid "Calls" msgstr "Κλήσεις" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "ΕπεξεÏγασία ΘÎματος" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Îαι" @@ -4745,6 +4767,11 @@ msgid "Idle" msgstr "ΑνενεÏγό" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Εγκατάσταση" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Ξαναδοκίμασε" @@ -4773,7 +4800,6 @@ msgid "Last" msgstr "Τελευταίο" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Όλα" @@ -4787,8 +4813,9 @@ msgid "Sort:" msgstr "Ταξινόμηση:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "ΑντιστÏοφή" +#, fuzzy +msgid "Reverse sorting." +msgstr "Γίνεται αίτημα..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4870,31 +4897,38 @@ msgid "Rotation Step:" msgstr "Βήμα πεÏιστÏοφής:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Μετακίνηση κάθετου οδηγοÏ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "ΔημιουÏγία νÎου κάθετου οδηγοÏ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "ΑφαίÏεση κάθετου οδηγοÏ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Μετακίνηση οÏιζόντιου οδηγοÏ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "ΔημιουÏγία νÎου οÏιζόντιου οδηγοÏ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "ΑφαίÏεση οÏιζόντιου οδηγοÏ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "ΔημιουÏγία νÎων οÏιζοντίων και κάθετων οδηγών" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -5327,9 +5361,8 @@ msgstr "ΦόÏτωση μάσκας εκπομπής" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Restart" -msgstr "Επανεκκίνηση τώÏα" +msgstr "Επανεκκίνηση" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -6244,18 +6277,16 @@ msgid "Find Next" msgstr "ΕÏÏεση επόμενου" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter scripts" -msgstr "ΦιλτÏάÏισμα ιδιοτήτων" +msgstr "ΦιλτÏάÏισμα δεσμών ενεÏγειών" #: editor/plugins/script_editor_plugin.cpp msgid "Toggle alphabetical sorting of the method list." msgstr "Εναλλαγή αλφαβητικής ταξινόμησης λίστας μεθόδων." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter methods" -msgstr "ΛειτουÏγία φιλτÏαÏίσματος:" +msgstr "ΦιλτÏάÏισμα μεθόδων" #: editor/plugins/script_editor_plugin.cpp msgid "Sort" @@ -6490,7 +6521,7 @@ msgstr "Επισημαντής ΣÏνταξης" #: editor/plugins/script_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 @@ -6498,9 +6529,8 @@ msgid "Bookmarks" msgstr "ΑγαπημÎνα" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "ΔημιουÏγία σημείων." +msgstr "Σημεία Διακοπής" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6791,9 +6821,15 @@ msgid "Rear" msgstr "Πίσω" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Στοίχιση με Î Ïοβολή" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Στοίχηση επιλογής με την Ï€Ïοβολή" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "" @@ -6983,10 +7019,6 @@ msgid "Focus Selection" msgstr "Εστίαση στην επιλογή" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Στοίχηση επιλογής με την Ï€Ïοβολή" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "ΕÏγαλείο επιλογής" @@ -7547,14 +7579,6 @@ msgid "Transpose" msgstr "Μετατόπιση" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "ΣυμμετÏία στον άξονα Χ" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "ΣυμμετÏία στον άξονα Î¥" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "ΑπενεÏγοποίηση Αυτόματων Πλακιδίων" @@ -7951,6 +7975,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Αλλαγή ΤÏπου Εισόδου ÎŸÏ€Ï„Î¹ÎºÎ¿Ï Î ÏογÏάμματος Σκίασης" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "ΚοÏυφή" @@ -8035,6 +8063,23 @@ msgid "Color uniform." msgstr "Ενιαία μεταβλητή χÏώματος." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "ΕπιστÏÎφει το αντίστÏοφο της τετÏαγωνικής Ïίζας της παÏαμÎÏ„Ïου." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8044,11 +8089,46 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" "ΕπιστÏÎφει Îνα συσχετισμÎνο διάνυσμα εάν η λογική τιμή είναι αληθής ή ψευδής." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "ΕπιστÏÎφει την εφαπτομÎνη της παÏαμÎÏ„Ïου." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "Λογική σταθεÏά." @@ -8057,43 +8137,36 @@ msgid "Boolean uniform." msgstr "Λογική ενιαία μεταβλητή." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for all shader modes." -msgstr "ΠαÏάμετÏος εισόδου «uv» για όλες τις λειτουÏγίες σκίασης." +msgstr "ΠαÏάμετÏος εισόδου «%s» για όλες τις λειτουÏγίες σκίασης." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Input parameter." msgstr "ΠαÏάμετÏος εισόδου." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for vertex and fragment shader modes." -msgstr "ΠαÏάμετÏος εισόδου «uv» για σκίαση κοÏυφής και τμήματος." +msgstr "ΠαÏάμετÏος εισόδου «%s» για σκίαση κοÏυφής και τμήματος." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for fragment and light shader modes." -msgstr "ΠαÏάμετÏος εισόδου «view» για σκίαση τμήματος και φωτός." +msgstr "ΠαÏάμετÏος εισόδου «%s» για σκίαση τμήματος και φωτός." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for fragment shader mode." -msgstr "ΠαÏάμετÏος εισόδου «side» για σκίαση τμήματος." +msgstr "ΠαÏάμετÏος εισόδου «%s» για σκίαση τμήματος." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for light shader mode." -msgstr "ΠαÏάμετÏος εισόδου «diffuse» για σκίαση φωτός." +msgstr "ΠαÏάμετÏος εισόδου «%s» για σκίαση φωτός." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for vertex shader mode." -msgstr "ΠαÏάμετÏος εισόδου «custom» για σκίαση κοÏυφής." +msgstr "ΠαÏάμετÏος εισόδου «%s» για σκίαση κοÏυφής." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for vertex and fragment shader mode." -msgstr "ΠαÏάμετÏος εισόδου «uv» για σκίαση κοÏυφής και τμήματος." +msgstr "ΠαÏάμετÏος εισόδου «%s» για σκίαση κοÏυφής και τμήματος." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar function." @@ -8144,7 +8217,8 @@ msgid "Returns the arc-cosine of the parameter." msgstr "ΕπιστÏÎφει το τόξο συνημιτόνου της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" "(Μόνο GLES3) ΕπιστÏÎφει το αντίστÏοφο υπεÏβολικό συνημίτονο της παÏαμÎÏ„Ïου." @@ -8153,7 +8227,8 @@ msgid "Returns the arc-sine of the parameter." msgstr "ΕπιστÏÎφει το τόξο ημιτόνου της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" "(Μόνο GLES3) ΕπιστÏÎφει το αντίστÏοφο υπεÏβολικό ημίτονο της παÏαμÎÏ„Ïου." @@ -8166,7 +8241,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "ΕπιστÏÎφει το τόξο εφαπτομÎνης των παÏαμÎÏ„Ïων." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" "(Μόνο GLES3) ΕπιστÏÎφει την αντίστÏοφη υπεÏβολική εφαπτομÎνη της παÏαμÎÏ„Ïου." @@ -8184,7 +8260,8 @@ msgid "Returns the cosine of the parameter." msgstr "ΕπιστÏÎφει το συνημίτονο της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +#, fuzzy +msgid "Returns the hyperbolic cosine of the parameter." msgstr "(Μόνο GLES3) ΕπιστÏÎφει το υπεÏβολικό συνημίτονο της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8254,11 +8331,13 @@ msgid "1.0 / scalar" msgstr "1.0 / βαθμωτό μÎγεθος" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +#, fuzzy +msgid "Finds the nearest integer to the parameter." msgstr "(Μόνο GLES3) Î’Ïίσκει τον κοντινότεÏο ακÎÏαιο στην παÏάμετÏο." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +#, fuzzy +msgid "Finds the nearest even integer to the parameter." msgstr "(Μόνο GLES3) Î’Ïίσκει τον κοντινότεÏο άÏτιο ακÎÏαιο στην παÏάμετÏο." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8274,7 +8353,8 @@ msgid "Returns the sine of the parameter." msgstr "ΕπιστÏÎφει το ημίτονο της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +#, fuzzy +msgid "Returns the hyperbolic sine of the parameter." msgstr "(Μόνο GLES3) ΕπιστÏÎφει το υπεÏβολικό ημίτονο της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8292,7 +8372,7 @@ msgstr "" "ΣυνάÏτηση SmoothStep( βαθμωτό(ÏŒÏιο0), βαθμωτό(ÏŒÏιο1), βαθμωτό(x) ).\n" "\n" "ΕπιστÏÎφει 0.0 αν x < ÏŒÏιο0 και 1.0 αν x > ÏŒÏιο1. Αλλιώς επιστÏÎφει μια " -"παÏεμβεβλημÎνη τιμή ανάμεσα στο 0.0 και το 1.0 χÏησιμοποιώντας πολυώνυμα " +"παÏεμβλημÎνη τιμή ανάμεσα στο 0.0 και το 1.0 χÏησιμοποιώντας πολυώνυμα " "Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8310,11 +8390,13 @@ msgid "Returns the tangent of the parameter." msgstr "ΕπιστÏÎφει την εφαπτομÎνη της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the hyperbolic tangent of the parameter." msgstr "(Μόνο GLES3) ΕπιστÏÎφει την υπεÏβολική εφαπτομÎνη της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +#, fuzzy +msgid "Finds the truncated value of the parameter." msgstr "(Μόνο GLES3) Î’Ïίσκει την πεÏικομμÎνη τιμή της παÏαμÎÏ„Ïου." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8354,11 +8436,18 @@ msgid "Perform the texture lookup." msgstr "ΕκτÎλεση αντιστοιχίας υφής." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +#, fuzzy +msgid "Cubic texture uniform lookup." msgstr "Ενιαία μεταβλητή κυβικής υφής." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +#, fuzzy +msgid "2D texture uniform lookup." +msgstr "Ενιαία μεταβλητή 2D υφής." + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup with triplanar." msgstr "Ενιαία μεταβλητή 2D υφής." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8366,8 +8455,9 @@ msgid "Transform function." msgstr "ΣυνάÏτηση μετασχηματισμοÏ." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8375,112 +8465,127 @@ 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 "" +"(Μόνο GLES3) Υπολογισμός Ï„Î±Î½Ï…ÏƒÏ„Î¹ÎºÎ¿Ï Î³Î¹Î½Î¿Î¼Îνου δÏο διανυσμάτων.\n" +"\n" +"Το OuterProduct αντιμετωπίζει την Ï€Ïώτη παÏάμετÏο «c» σαν διάνυσμα στήλης " +"και την δεÏτεÏη παÏάμετÏο «r» σαν διάνυσμα γÏαμμής και κάνει τον αλγεβÏικό " +"πολλαπλασιασμό πινάκων «c * r», παÏάγοντας Îναν πίνακα με στήλες όσα και τα " +"στοιχεία του «c», και γÏαμμÎÏ‚ όσα και τα στοιχεία του «r»." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes transform from four vectors." -msgstr "" +msgstr "ΣυνθÎτει μετασχηματισμό από Ï„ÎσσεÏα διανÏσματα." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes transform to four vectors." -msgstr "" +msgstr "ΑποσυνθÎτει μετασχηματισμό σε Ï„ÎσσεÏα διανÏσματα." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "" +#, fuzzy +msgid "Calculates the determinant of a transform." +msgstr "(Μόνο GLES3) Υπολογίζει την οÏίζουσα ενός μετασχηματισμοÏ." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "" +#, fuzzy +msgid "Calculates the inverse of a transform." +msgstr "(Μόνο GLES3) Υπολογίζει το αντίστÏοφο ενός μετασχηματισμοÏ." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "" +#, fuzzy +msgid "Calculates the transpose of a transform." +msgstr "(Μόνο GLES3) Υπολογίζει το ανάστÏοφο ενός μετασχηματισμοÏ." #: 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 msgid "Transform constant." -msgstr "Ο μετασχηματισμός ματαιώθηκε." +msgstr "ΣταθεÏά μετασχηματισμοÏ." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform uniform." -msgstr "Ο μετασχηματισμός ματαιώθηκε." +msgstr "Ενιαία μεταβλητή μετασχηματισμοÏ." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector function." -msgstr "Πήγαινε σε συνάÏτηση..." +msgstr "ΣυνάÏτηση διανÏσματος." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector operator." -msgstr "Αλλαγή Î´Î¹Î±Î½Ï…ÏƒÎ¼Î±Ï„Î¹ÎºÎ¿Ï Ï„ÎµÎ»ÎµÏƒÏ„Î®" +msgstr "Τελεστής διανÏσματος." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes vector from three scalars." -msgstr "" +msgstr "ΣυνθÎτει διάνυσμα από 3 βαθμωτά μεγÎθη." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes vector to three scalars." -msgstr "" +msgstr "ΑποσυνθÎτει διάνυσμα σε 3 βαθμωτά μεγÎθη." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the cross product of two vectors." -msgstr "" +msgstr "Υπολογίζει το εξωτεÏικό γινόμενο 2 διανυσμάτων." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the distance between two points." -msgstr "" +msgstr "ΕπιστÏÎφει την απόσταση 2 σημείων." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the dot product of two vectors." -msgstr "" +msgstr "Υπολογίζει το εσωτεÏικό γινόμενο 2 διανυσμάτων." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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 "" +"ΕπιστÏÎφει Îνα διάνυσμα ίδιας κατεÏθυνσης με Îνα διάνυσμα αναφοÏάς. Η " +"συνάÏτηση Îχει 3 διανυσματικÎÏ‚ παÏαμÎÏ„Ïους: N, το διάνυσμα για " +"ανακατεÏθυνση, I, το διάνυσμα συμβάτος, και Nref, το διάνυσμα αναφοÏάς. Αν " +"το εσωτεÏικό γινόμενο των I και Nref εναι αÏνητικό, επιστÏÎφει N, αλλιώς " +"επιστÏÎφει -N." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." -msgstr "" +msgstr "Υπολογίζει το μήκος ενός διανÏσματος." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two vectors." -msgstr "" +msgstr "ΓÏαμμική παÏεμβολή Î¼ÎµÏ„Î±Î¾Ï 2 διανυσμάτων." #: 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 +#, fuzzy msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"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 a vector that points in the direction of refraction." -msgstr "" +#, fuzzy +msgid "Returns the vector that points in the direction of refraction." +msgstr "ΕπιστÏÎφει Îνα διάνυσμα που δείχνει Ï€Ïος την κατεÏθυνση διάθλασης." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8490,6 +8595,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"ΣυνάÏτηση SmoothStep( διάνυσμα(ÏŒÏιο0), διάνυσμα(ÏŒÏιο1), διάνυσμα(x) ).\n" +"\n" +"ΕπιστÏÎφει 0.0 αν x < ÏŒÏιο0 και 1.0 αν x > ÏŒÏιο1. Αλλιώς επιστÏÎφει μια " +"παÏεμβλημÎνη τιμή ανάμεσα στο 0.0 και το 1.0 χÏησιμοποιώντας πολυώνυμα " +"Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8499,6 +8609,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"ΣυνάÏτηση SmoothStep( βαθμωτό(ÏŒÏιο0), βαθμωτό(ÏŒÏιο1), διάνυσμα(x) ).\n" +"\n" +"ΕπιστÏÎφει 0.0 αν x < ÏŒÏιο0 και 1.0 αν x > ÏŒÏιο1. Αλλιώς επιστÏÎφει μια " +"παÏεμβλημÎνη τιμή ανάμεσα στο 0.0 και το 1.0 χÏησιμοποιώντας πολυώνυμα " +"Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8506,6 +8621,9 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"ΣυνάÏτηση Step( διάνυσμα(ÏŒÏιο), διάνυσμα(x) ).\n" +"\n" +"ΕπιστÏÎφει 0.0 αν x < ÏŒÏιο αλλιώς 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8513,36 +8631,37 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"ΣυνάÏτηση Step( βαθμωτό(ÏŒÏιο), διάνυσμα(x) ).\n" +"\n" +"ΕπιστÏÎφει 0.0 αν x < ÏŒÏιο αλλιώς 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds vector to vector." -msgstr "" +msgstr "Î ÏοσθÎτει 2 διανÏσματα." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides vector by vector." -msgstr "" +msgstr "ΔιαιÏεί 2 διανÏσματα." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by vector." -msgstr "" +msgstr "Πολλαπλασιάζει 2 διανÏσματα." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two vectors." -msgstr "" +msgstr "ΕπιστÏÎφει το υπόλοιπο των 2 διανυσμάτων." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts vector from vector." -msgstr "" +msgstr "ΑφαίÏεση 2 διανυσμάτων." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector constant." -msgstr "Αλλαγή διανυσματικής σταθεÏάς" +msgstr "Διανυσματική σταθεÏά." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector uniform." -msgstr "Αλλαγή διανυσματικής ομοιόμοÏφης μεταβλητής" +msgstr "Διανυσματικής ενιαία μεταβλητή." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8550,70 +8669,93 @@ 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 "" "Returns falloff based on the dot product of surface normal and view " "direction of camera (pass associated inputs to it)." msgstr "" +"ΕπιστÏÎφει μείωση βάση του εσωτεÏÎ¹ÎºÎ¿Ï Î³Î¹Î½Î¿Î¼Îνου του διανÏσματος επιφάνειας " +"και της κατεÏθυνσης της κάμεÏας (δώστε τις σχετικÎÏ‚ εισόδους)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "" +#, fuzzy +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(Μόνο GLES3 σε σκίαση Τμήματος/Φωτός) Βαθμωτή παÏάγωγη συνάÏτηση." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "" +#, fuzzy +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(Μόνο GLES3 σε σκίαση Τμήματος/Φωτός) Διανυσματική παÏάγωγη συνάÏτηση." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" +"(Μόνο GLES3 σε σκίαση Τμήματος/Φωτός) (Διανυσματικά) ΠαÏάγωγος στο «x» με " +"τοπική διαφόÏιση." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" +"(Μόνο GLES3 σε σκίαση Τμήματος/Φωτός) (Βαθμωτά) ΠαÏάγωγος στο «x» με τοπική " +"διαφόÏιση." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" +"(Μόνο GLES3 σε σκίαση Τμήματος/Φωτός) (Διανυσματικά) ΠαÏάγωγος στο «y» με " +"τοπική διαφόÏιση." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" +"(Μόνο GLES3 σε σκίαση Τμήματος/Φωτός) (Βαθμωτά) ΠαÏάγωγος στο «y» με τοπική " +"διαφόÏιση." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" +"(Μόνο GLES3 σε σκίαση Τμήματος/Φωτός) (Διανυσματικά) ΆθÏοισμα απόλυτης " +"παÏαγώγου σε «x» και «y»." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" +"(Μόνο GLES3 σε σκίαση Τμήματος/Φωτός) (Βαθμωτά) ΆθÏοισμα απόλυτης παÏαγώγου " +"σε «x» και «y»." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" msgstr "Οπτικό Î ÏόγÏαμμα Σκίασης" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "ΕπεξεÏγασία φίλτÏων" +msgstr "ΕπεξεÏγασία Οπτικής Ιδιότητας" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "ΑλλαγÎÏ‚ Ï€ÏογÏάμματος σκίασης" +msgstr "Αλλαγή ΛειτουÏγίας ÎŸÏ€Ï„Î¹ÎºÎ¿Ï Î ÏογÏάμματος Σκίασης" #: editor/project_export.cpp msgid "Runnable" @@ -8632,6 +8774,8 @@ msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"Αποτυχία εξαγωγής ÎÏγου στην πλατφόÏμα «%s».\n" +"Τα Ï€Ïότυπα εξαγωγής λείπουν ή είναι άκυÏα." #: editor/project_export.cpp msgid "" @@ -8639,21 +8783,21 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"Αποτυχία εξαγωγής ÎÏγου στην πλατφόÏμα «%s».\n" +"Αυτό μποÏεί να οφείλεται σε λάθος της διαμόÏφωσης εξαγωγής ή στις Ïυθμίσεις " +"εξαγωγής σας." #: editor/project_export.cpp -#, fuzzy msgid "Release" -msgstr "μόλις απελευθεÏώθηκε" +msgstr "ΚυκλοφοÏία" #: editor/project_export.cpp -#, fuzzy msgid "Exporting All" -msgstr "Εξαγωγή για %s" +msgstr "Εξαγωγή Όλων" #: editor/project_export.cpp -#, fuzzy msgid "The given export path doesn't exist:" -msgstr "Η διαδÏομή δεν υπάÏχει." +msgstr "Η δεδομÎνη διαδÏομή εξαγωγής δεν υπάÏχει:" #: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" @@ -8669,9 +8813,8 @@ msgid "Add..." msgstr "Î Ïοσθήκη..." #: editor/project_export.cpp -#, fuzzy msgid "Export Path" -msgstr "Εξαγωγή ÎÏγου" +msgstr "ΔιαδÏομή Εξαγωγής" #: editor/project_export.cpp msgid "Resources" @@ -8732,50 +8875,44 @@ msgid "Feature List:" msgstr "Λίστα δυνατοτήτων:" #: editor/project_export.cpp -#, fuzzy msgid "Script" -msgstr "Îεα δεσμή ενεÏγειών" +msgstr "ΔÎσμες ΕνεÏγειών" #: editor/project_export.cpp -#, fuzzy msgid "Script Export Mode:" -msgstr "ΛειτουÏγία εξαγωγής:" +msgstr "ΛειτουÏγία Εξαγωγής Δεσμών ΕνεÏγειών:" #: editor/project_export.cpp -#, fuzzy msgid "Text" -msgstr "Υφή" +msgstr "Κείμενο" #: editor/project_export.cpp -#, fuzzy msgid "Compiled" -msgstr "Συμπίεση" +msgstr "ΜεταγλωτισμÎνες" #: editor/project_export.cpp msgid "Encrypted (Provide Key Below)" -msgstr "" +msgstr "ΚÏυπτογÏαφημÎνες (Δώστε Κλειδί ΠαÏακάτω)" #: editor/project_export.cpp msgid "Invalid Encryption Key (must be 64 characters long)" -msgstr "" +msgstr "ΆκυÏο Κλειδί ΚÏυπτογÏάφησης (Ï€ÏÎπει να Îχει 64 χαÏακτήÏες)" #: editor/project_export.cpp msgid "Script Encryption Key (256-bits as hex):" -msgstr "" +msgstr "Κλειδί ΚÏυπτογÏάφησης Δεσμών ΕνεÏγειών (256-bit σε δεκαεξαδικό):" #: editor/project_export.cpp msgid "Export PCK/Zip" msgstr "Εξαγωγή PCK/ZIP" #: editor/project_export.cpp -#, fuzzy msgid "Export mode?" -msgstr "ΛειτουÏγία εξαγωγής:" +msgstr "ΛειτουÏγία εξαγωγής;" #: editor/project_export.cpp -#, fuzzy msgid "Export All" -msgstr "Εξαγωγή" +msgstr "Εξαγωγή Όλων" #: editor/project_export.cpp msgid "Export templates for this platform are missing:" @@ -8790,23 +8927,20 @@ msgid "The path does not exist." msgstr "Η διαδÏομή δεν υπάÏχει." #: editor/project_manager.cpp -#, fuzzy msgid "Invalid '.zip' project file, does not contain a 'project.godot' file." -msgstr "" -"ΠαÏακαλοÏμε επιλÎξτε Îναν φάκελο που δεν πεÏιÎχει Îνα αÏχείο 'project.godot'." +msgstr "ΆκυÏο αÏχείο ÎÏγου «.zip», δεν πεÏιÎχει αÏχείο «project.godot»." #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "ΠαÏακαλοÏμε επιλÎξτε Îναν άδειο φάκελο." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a 'project.godot' or '.zip' file." -msgstr "ΠαÏακαλοÏμε επιλÎκτε Îνα αÏχείο 'project.godot'." +msgstr "ΠαÏακαλοÏμε επιλÎξτε Îνα αÏχείο «project.godot» ή «.zip»." #: editor/project_manager.cpp msgid "Directory already contains a Godot project." -msgstr "" +msgstr "Ο κατάλογος πεÏιÎχει ήδη Îνα ÎÏγο της Godot." #: editor/project_manager.cpp msgid "New Game Project" @@ -8894,17 +9028,16 @@ msgid "Project Path:" msgstr "ΔιαδÏομή ÎÏγου:" #: editor/project_manager.cpp -#, fuzzy msgid "Project Installation Path:" -msgstr "ΔιαδÏομή ÎÏγου:" +msgstr "ΔιαδÏομή Εγκατάστασης ΕÏγου:" #: editor/project_manager.cpp msgid "Renderer:" -msgstr "" +msgstr "ΜÎθοδος Απόδοσης:" #: editor/project_manager.cpp msgid "OpenGL ES 3.0" -msgstr "" +msgstr "OpenGL ES 3.0" #: editor/project_manager.cpp msgid "" @@ -8913,10 +9046,14 @@ msgid "" "Incompatible with older hardware\n" "Not recommended for web games" msgstr "" +"ΥψηλότεÏη οπτική ποιότητα\n" +"Διάθεση όλων των δυνατοτήτων\n" +"Μη-συμβατό με παλαιότεÏο υλικό\n" +"Δεν Ï€Ïοτείνεται για διαδικτυακά παιχνίδια" #: editor/project_manager.cpp msgid "OpenGL ES 2.0" -msgstr "" +msgstr "OpenGL ES 2.0" #: editor/project_manager.cpp msgid "" @@ -8925,19 +9062,24 @@ msgid "" "Works on most hardware\n" "Recommended for web games" msgstr "" +"ΧαμηλότεÏη οπτική ποιότητα\n" +"ΜεÏική διάθεση δυνατοτήτων\n" +"ΔουλεÏει στο πεÏισσότεÏο υλικό\n" +"Î Ïοτείνεται για διαδικτυακά παιχνίδια" #: editor/project_manager.cpp msgid "Renderer can be changed later, but scenes may need to be adjusted." msgstr "" +"Η μÎθοδος απόδοσης μποÏεί να αλλάξει αÏγότεÏα, αλλά οι σκηνÎÏ‚ μποÏεί να " +"απαιτοÏν αναπÏοσαÏμογή." #: editor/project_manager.cpp msgid "Unnamed Project" msgstr "Ανώνυμο ÎÏγο" #: editor/project_manager.cpp -#, fuzzy msgid "Can't open project at '%s'." -msgstr "Δεν ήταν δυνατό το άνοιγμα του ÎÏγου" +msgstr "Αδυνατό το άνοιγμα του ÎÏγου στο «%s»." #: editor/project_manager.cpp msgid "Are you sure to open more than one project?" @@ -8955,6 +9097,15 @@ msgid "" "Warning: You won't be able to open the project with previous versions of the " "engine anymore." msgstr "" +"Το ακόλουθο αÏχείο Ïυθμίσεων ÎÏγου δεν οÏίζει την Îκδοση της Godot με την " +"οποία δημιουÏγήθηκε.\n" +"\n" +"%s\n" +"\n" +"Εάν συνεχίσετε με το άνοιγμα του, θα μετατÏαπεί στην Ï„ÏÎχουσα μοÏφή " +"Ïυθμίσεων της Godot.\n" +"Î Ïοσοχή: Δεν θα μποÏείτε να ανοίξετε το ÎÏγο με Ï€ÏοηγοÏμενες εκδόσεις της " +"μηχανής στο μÎλλον." #: editor/project_manager.cpp msgid "" @@ -8967,23 +9118,32 @@ msgid "" "Warning: You won't be able to open the project with previous versions of the " "engine anymore." msgstr "" +"Το ακόλουθο αÏχείο Ïυθμίσεων ÎÏγου δημιουÏγήθηκε από παλαιότεÏη Îκδοση της " +"μηχανής, και Ï€ÏÎπει να μετατÏαπεί στην νÎα Îκδοση:\n" +"\n" +"%s\n" +"\n" +"ΘÎλετε να το μετατÏÎψετε;\n" +"Î Ïοσοχή: Δεν θα μποÏείτε να ανοίξετε το ÎÏγο με Ï€ÏοηγοÏμενες εκδόσεις της " +"μηχανής στο μÎλλον." #: editor/project_manager.cpp msgid "" "The project settings were created by a newer engine version, whose settings " "are not compatible with this version." msgstr "" +"Οι Ïυθμίσεις ÎÏγου δημιουÏγήθηκαν από μια νεότεÏη Îκδοση της μηχανής, που " +"δεν Îχει συμβατÎÏ‚ Ïυθμίσεις με αυτήν την Îκδοση." #: editor/project_manager.cpp -#, fuzzy msgid "" "Can't run project: no main scene defined.\n" "Please edit the project and set the main scene in the Project Settings under " "the \"Application\" category." msgstr "" -"Δεν είναι δυνατή η εκτÎλεση του ÎÏγου: Δεν Îχει καθοÏιστεί κÏÏια σκηνή.\n" -"ΠαÏακαλώ επεξεÏγαστείτε το ÎÏγο και οÏίστε την κÏÏια σκηνή στις «Ρυθμίσεις " -"ÎÏγου» κάτω από την κατηγοÏία «ΕφαÏμογή»." +"Αδυναμία εκτÎλεσης ÎÏγου: Δεν Îχει καθοÏιστεί κÏÏια σκηνή.\n" +"ΕπεξεÏγαστείτε το ÎÏγο και οÏίστε την κÏÏια σκηνή στις «Ρυθμίσεις ÎÏγου» " +"κάτω από την κατηγοÏία «Application»." #: editor/project_manager.cpp msgid "" @@ -8994,27 +9154,24 @@ msgstr "" "ΠαÏακαλώ επεξεÏγαστείτε το ÎÏγο για να γίνει η αÏχική εισαγωγή." #: editor/project_manager.cpp -#, fuzzy msgid "Are you sure to run %d projects at once?" -msgstr "Είστε σίγουÏοι πως θÎλετε να Ï„ÏÎξετε πεÏισσότεÏα από Îνα ÎÏγα;" +msgstr "Είστε σίγουÏοι πως θÎλετε να Ï„ÏÎξετε %d ÎÏγα ταυτόχÏονα;" #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove %d projects from the list?\n" "The project folders' contents won't be modified." msgstr "" -"ΑφαίÏεση ÎÏγου από την λίστα; (Τα πεÏιεχόμενα το φακÎλου δεν θα " -"Ï„ÏοποποιηθοÏν)" +"ΑφαίÏεση %d ÎÏγων από την λίστα;\n" +"Τα πεÏιεχόμενα των καταλόγων των ÎÏγων δεν θα Ï„ÏοποποιηθοÏν." #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove this project from the list?\n" "The project folder's contents won't be modified." msgstr "" -"ΑφαίÏεση ÎÏγου από την λίστα; (Τα πεÏιεχόμενα το φακÎλου δεν θα " -"Ï„ÏοποποιηθοÏν)" +"ΑφαίÏεση ÎÏγου από την λίστα;\n" +"Τα πεÏιεχόμενα του καταλόγου του ÎÏγου δεν θα Ï„ÏοποποιηθοÏν." #: editor/project_manager.cpp #, fuzzy @@ -9847,6 +10004,11 @@ msgstr "Άνοιγμα δεσμής ενεÏγειών" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "ΕπαναπÏοσδιοÏισμός γονÎα κόμβου" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Βγάζει νόημα!" @@ -10084,7 +10246,8 @@ msgid "Script is valid." msgstr "ΈγκυÏη δεσμή ενεÏγειών" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "ΕπιτÏεπόμενα: a-z, A-Z, 0-9 και _" #: editor/script_create_dialog.cpp @@ -11748,7 +11911,7 @@ msgid "" "obtain a size. Otherwise, make it a RenderTarget and assign its internal " "texture to some node for display." msgstr "" -"Το Viewport δεν Îχει οÏισθεί ως «render target». Αν σκοπεÏετε να δείχνει τα " +"Το Viewport δεν Îχει οÏισθεί ως στόχος απόδοσης. Αν σκοπεÏετε να δείχνει τα " "πεÏιεχόμενα του, κάντε το να κληÏονομεί Îνα Control, ώστε να αποκτήσει " "μÎγεθος. Αλλιώς, κάντε το Îνα RenderTarget και οÏίστε το internal texture σε " "Îναν κόμβο για απεικόνιση." @@ -11783,6 +11946,11 @@ msgstr "Μη ÎγκυÏη πηγή!" msgid "Invalid source for shader." msgstr "Μη ÎγκυÏη πηγή!" +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Μη ÎγκυÏη πηγή!" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11799,6 +11967,27 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Previous Folder" +#~ msgstr "Î ÏοηγοÏμενος φάκελος" + +#~ msgid "Next Folder" +#~ msgstr "Επόμενος φάκελος" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Αυτόματο Άνοιγμα ΣτιγμιοτÏπων Οθόνης" + +#~ msgid "Open in an external image editor." +#~ msgstr "Άνοιγμα σε εξωτεÏικό επεξεÏγαστή εικόνων." + +#~ msgid "Reverse" +#~ msgstr "ΑντιστÏοφή" + +#~ msgid "Mirror X" +#~ msgstr "ΣυμμετÏία στον άξονα Χ" + +#~ msgid "Mirror Y" +#~ msgstr "ΣυμμετÏία στον άξονα Î¥" + #~ msgid "Generating solution..." #~ msgstr "Επίλυση..." diff --git a/editor/translations/eo.po b/editor/translations/eo.po index 2289770903..c3b755c31e 100644 --- a/editor/translations/eo.po +++ b/editor/translations/eo.po @@ -126,6 +126,31 @@ msgid "Anim Change Call" msgstr "Animado Aliigi Alvokon" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Animado Aliigi Kernakadron Fojon" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animado Aliigi Transiron" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animado Aliigi Transformon" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Animado Aliigi Kernakadron Valoron" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animado Aliigi Alvokon" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Aliigi Animadon Longecon" @@ -1118,7 +1143,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1651,7 +1675,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1702,7 +1726,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1727,23 +1751,29 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "" +#, fuzzy +msgid "Go to previous folder." +msgstr "Iri al AntaÅa PaÅo" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "" +#, fuzzy +msgid "Go to next folder." +msgstr "Iri al Neksta PaÅo" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2418,6 +2448,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Duplikati" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2609,14 +2644,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2930,6 +2957,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4552,6 +4583,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4580,7 +4615,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4594,7 +4628,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4669,31 +4703,33 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Forigi Nevalidajn Åœlosilojn" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Forigi Nevalidajn Åœlosilojn" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6549,7 +6585,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6734,10 +6774,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7298,14 +7334,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7683,6 +7711,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7767,6 +7799,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7774,10 +7822,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7866,7 +7948,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7874,7 +7956,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7886,7 +7968,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7903,7 +7985,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7972,11 +8054,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7992,7 +8074,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8020,11 +8102,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8064,11 +8146,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8077,7 +8163,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8095,15 +8181,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8152,7 +8238,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8180,12 +8266,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8262,47 +8348,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9453,6 +9539,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9655,7 +9745,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11175,6 +11265,11 @@ msgstr "Nevalida fonto por ombrigilo." msgid "Invalid source for shader." msgstr "Nevalida fonto por ombrigilo." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Nevalida fonto por ombrigilo." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/es.po b/editor/translations/es.po index 10f46b198c..2450229f9a 100644 --- a/editor/translations/es.po +++ b/editor/translations/es.po @@ -44,7 +44,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-09 10:47+0000\n" +"PO-Revision-Date: 2019-07-21 11:06+0000\n" "Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot/es/>\n" @@ -165,6 +165,31 @@ msgid "Anim Change Call" msgstr "Cambiar Llamada de Animación" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Cambiar Tiempo del Fotograma Clave de Animación" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Cambiar Transición de Animación" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Cambiar Transformación de la Animación" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Cambiar Valor de la Clave de Animación" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Cambiar Llamada de Animación" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Cambiar Duración de la Animación" @@ -671,7 +696,7 @@ msgstr "Número de LÃnea:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Se encontraron %d coincidencias." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -829,9 +854,8 @@ msgid "Connect" msgstr "Conectar" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Señales:" +msgstr "Señal:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -998,9 +1022,9 @@ msgid "Owners Of:" msgstr "Propietarios De:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "¿Eliminar los archivos seleccionados del proyecto? (irreversible)" +msgstr "" +"¿Eliminar los archivos seleccionados del proyecto? (No puede ser restaurado)" #: editor/dependency_editor.cpp msgid "" @@ -1182,7 +1206,6 @@ msgid "Success!" msgstr "¡Éxito!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Instalar" @@ -1553,6 +1576,7 @@ msgstr "Archivo de plantilla no encontrado:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"En la exportación de 32 bits el PCK embebido no puede ser mayor de 4 GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1728,7 +1752,7 @@ msgstr "Mostrar en Explorador de Archivos" msgid "New Folder..." msgstr "Nueva Carpeta..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Recargar" @@ -1779,7 +1803,7 @@ msgstr "Avanzar" msgid "Go Up" msgstr "Subir" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Act./Desact. Archivos Ocultos" @@ -1804,23 +1828,31 @@ msgid "Move Favorite Down" msgstr "Bajar Favorito" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Carpeta Anterior" +#, fuzzy +msgid "Go to previous folder." +msgstr "Ir a la carpeta padre." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Carpeta Siguiente" +#, fuzzy +msgid "Go to next folder." +msgstr "Ir a la carpeta padre." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Ir a la carpeta padre." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Buscar archivos" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Eliminar carpeta actual de favoritos." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Ver/Ocultar archivos ocultos." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2562,6 +2594,10 @@ msgid "Go to previously opened scene." msgstr "Ir a la escena abierta previamente." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Copiar Texto" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Pestaña siguiente" @@ -2774,14 +2810,6 @@ msgstr "" "Configuración." #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "Abrir Capturas de Pantalla Automáticamente" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "Abrir en un editor de imágenes externo." - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Cambiar a Pantalla Completa" @@ -3102,6 +3130,11 @@ msgstr "Tiempo" msgid "Calls" msgstr "Llamadas" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Editar Tema" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Activado" @@ -4776,6 +4809,10 @@ msgid "Idle" msgstr "Inactivo" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "Instalar..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Reintentar" @@ -4804,7 +4841,6 @@ msgid "Last" msgstr "Último" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Todos" @@ -4818,8 +4854,8 @@ msgid "Sort:" msgstr "Ordenar:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Invertir" +msgid "Reverse sorting." +msgstr "Orden inverso." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4900,32 +4936,32 @@ msgid "Rotation Step:" msgstr "Step de Rotación:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "Mover guÃa vertical" +msgid "Move Vertical Guide" +msgstr "Mover GuÃa Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "Crear nueva guÃa vertical" +msgid "Create Vertical Guide" +msgstr "Crear GuÃa Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "Eliminar guÃa vertical" +msgid "Remove Vertical Guide" +msgstr "Eliminar GuÃa Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "Mover guÃa horizontal" +msgid "Move Horizontal Guide" +msgstr "Mover GuÃa Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "Crear nueva guÃa horizontal" +msgid "Create Horizontal Guide" +msgstr "Crear GuÃa Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "Eliminar guÃa horizontal" +msgid "Remove Horizontal Guide" +msgstr "Eliminar GuÃa Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "Crear nuevas guÃas horizontales y verticales" +msgid "Create Horizontal and Vertical Guides" +msgstr "Crear GuÃas Horizontales y Verticales" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -6516,7 +6552,7 @@ msgstr "Resaltador de Sintaxis" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Ir A" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6524,9 +6560,8 @@ msgid "Bookmarks" msgstr "Marcadores" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Crear puntos." +msgstr "Puntos de interrupción" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6815,9 +6850,15 @@ msgid "Rear" msgstr "Detrás" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Alinear con Vista" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Alinear Selección Con Vista" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "No hay padre al que instanciarle un hijo." @@ -7005,10 +7046,6 @@ msgid "Focus Selection" msgstr "Foco en Selección" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Alinear Selección Con Vista" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Seleccionar Herramienta" @@ -7569,14 +7606,6 @@ msgid "Transpose" msgstr "Transponer" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Voltear X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Voltear Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "Desactivar Autotile" @@ -7973,6 +8002,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Cambiar Tipo de Entrada del Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(Sólo GLES3)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vértice" @@ -8057,6 +8090,23 @@ msgid "Color uniform." msgstr "Color uniforme." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" +"Devuelve el resultado booleano de la comparación de %s entre dos parámetros." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "Igual (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "Mayor Que (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "Mayor o Igual Que (>=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8066,12 +8116,52 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" +"Devuelve el resultado booleano de la comparación entre INF y un parámetro " +"escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" +"Devuelve el resultado booleano de la comparación entre NaN y un parámetro " +"escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "Menor Que (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "Menor o Igual Que (<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "Diferente (!=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" "Devuelve un vector asociado si el valor booleano proporcionado es verdadero " "o falso." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Devuelve el resultado booleano de la comparación entre dos parámetros." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" +"Devuelve el resultado booleano de la comparación entre INF (o NaN) y un " +"parámetro escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "Constante booleana." @@ -8160,16 +8250,16 @@ msgid "Returns the arc-cosine of the parameter." msgstr "Devuelve el arcocoseno del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "(Sólo GLES3) Devuelve el coseno hiperbólico inverso del parámetro." +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "Devuelve el coseno hiperbólico inverso del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." msgstr "Devuelve el arcoseno del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "(Sólo GLES3) Devuelve el seno hiperbólico inverso del parámetro." +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "Devuelve el seno hiperbólico inverso del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." @@ -8180,8 +8270,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Devuelve el arcotangente de los parámetros." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "(Sólo GLES3) Devuelve la tangente hiperbólica inversa del parámetro." +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "Devuelve la tangente hiperbólica inversa del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8197,8 +8287,8 @@ msgid "Returns the cosine of the parameter." msgstr "Devuelve el coseno del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "(Sólo GLES3) Devuelve el coseno hiperbólico del parámetro." +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "Devuelve el coseno hiperbólico del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." @@ -8267,12 +8357,12 @@ msgid "1.0 / scalar" msgstr "1.0 / escalar" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "(Sólo GLES3) Encuentra el entero más cercano al parámetro." +msgid "Finds the nearest integer to the parameter." +msgstr "Encuentra el entero más cercano al parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "(Sólo GLES3) Encuentra el entero más cercano al parámetro." +msgid "Finds the nearest even integer to the parameter." +msgstr "Encuentra el entero más cercano al parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." @@ -8287,8 +8377,8 @@ msgid "Returns the sine of the parameter." msgstr "Devuelve el seno del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "(Sólo GLES3) Devuelve el seno hiperbólico del parámetro." +msgid "Returns the hyperbolic sine of the parameter." +msgstr "Devuelve el seno hiperbólico del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." @@ -8323,12 +8413,12 @@ msgid "Returns the tangent of the parameter." msgstr "Devuelve la tangente del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "(Sólo GLES3) Devuelve la tangente hiperbólica del parámetro." +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "Devuelve la tangente hiperbólica del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "(Sólo GLES3) Encuentra el valor truncado del parámetro." +msgid "Finds the truncated value of the parameter." +msgstr "Encuentra el valor truncado del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." @@ -8367,12 +8457,16 @@ msgid "Perform the texture lookup." msgstr "Realiza una búsqueda de texturas." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." -msgstr "Textura cúbica uniforme." +msgid "Cubic texture uniform lookup." +msgstr "Búsqueda de textura cúbica uniforme." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." +msgstr "Búsqueda de textura uniforme 2D." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." -msgstr "Textura 2D uniforme." +msgid "2D texture uniform lookup with triplanar." +msgstr "Búsqueda de textura uniforme 2D con triplanar." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Transform function." @@ -8380,7 +8474,7 @@ msgstr "Función Transform." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8388,7 +8482,7 @@ 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 "" -"(GLES3 solamente) Calcula el producto exterior de un par de vectores.\n" +"Calcular el producto exterior de un par de vectores.\n" "\n" "OuterProduct trata el primer parámetro 'c' como un vector de columna (matriz " "con una columna) y el segundo parámetro 'r' como un vector de fila (matriz " @@ -8405,16 +8499,16 @@ msgid "Decomposes transform to four vectors." msgstr "Se descompone y transforma en cuatro vectores." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "(Sólo GLES3) Calcula el determinante de una transformación." +msgid "Calculates the determinant of a transform." +msgstr "Calcula el determinante de una transformación." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "(Sólo GLES3) Calcula el inverso de una transformación." +msgid "Calculates the inverse of a transform." +msgstr "Calcula el inverso de una transformación." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "(Sólo GLES3) Calcula la transposición de una transformación." +msgid "Calculates the transpose of a transform." +msgstr "Calcula la transposición de una transformación." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." @@ -8462,16 +8556,16 @@ msgstr "Calcula el producto punto de dos vectores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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 "" -"Devuelve un vector que apunta en la misma dirección que un vector de " +"Devuelve el vector que apunta en la misma dirección que un vector de " "referencia. La función tiene tres parámetros vectoriales: N, el vector a " "orientar, I, el vector incidente, y Nref, el vector de referencia. Si el " -"producto punto de I y Nref es menor que cero, el valor de retorno es N. De " -"lo contrario, se devuelve -N." +"producto de punto de I y Nref es menor que cero, el valor de retorno es N. " +"De lo contrario, se devuelve -N." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." @@ -8495,15 +8589,15 @@ msgstr "1.0 / vector" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" -"Devuelve un vector que apunta en dirección a su reflexión ( a : vector " +"Devuelve el vector que apunta en la dirección de reflexión ( a : vector " "incidente, b : vector normal)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." -msgstr "Devuelve un vector que apunta en dirección a su refracción." +msgid "Returns the vector that points in the direction of refraction." +msgstr "Devuelve el vector que apunta en la dirección de refracción." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8602,61 +8696,58 @@ msgstr "" "esta)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "(Sólo GLES3) (Sólo modo Fragmento/Luz) Función de derivación escalar." +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(Sólo modo Fragmento/Luz) Función de derivación escalar." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "" -"(Sólo GLES3) (Sólo modo Fragmento/Luz) Función de derivación vectorial." +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(Sólo modo Fragmento/Luz) Función de derivación vectorial." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" -"(Sólo GLES3) (Sólo modo Fragmento/Luz) (Vector) Derivado en 'x' utilizando " -"diferenciación local." +"(Sólo modo Fragmento/Luz) (Vector) Derivado en 'x' utilizando diferenciación " +"local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" -"(Sólo GLES3) (Sólo modo Fragmento/Luz) (Escalar) Derivado en 'x' utilizando " +"(Sólo modo Fragmento/Luz) (Escalar) Derivado en 'x' utilizando " "diferenciación local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" -"(Sólo GLES3) (Sólo modo Fragmento/Luz) (Vector) Derivado en 'y' utilizando " -"diferenciación local." +"(Sólo modo Fragmento/Luz) (Vector) Derivado en 'y' utilizando diferenciación " +"local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" -"(Sólo GLES3) (Sólo modo Fragmento/Luz) (Escalar) Derivado en 'y' utilizando " +"(Sólo modo Fragmento/Luz) (Escalar) Derivado en 'y' utilizando " "diferenciación local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(Sólo GLES3) (Sólo modo Fragmento/Luz) (Vector) Suma de la derivada absoluta " -"en 'x' e 'y'." +"(Sólo modo Fragmento/Luz) (Vector) Suma de la derivada absoluta en 'x' e 'y'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(Sólo GLES3) (Sólo modo Fragmento/Luz) (Escalar) Suma del derivado absoluto " -"en 'x' e 'y'." +"(Sólo modo Fragmento/Luz) (Escalar) Suma del derivado absoluto en 'x' e 'y'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -9884,6 +9975,11 @@ msgid "Extend Script" msgstr "Extender Script" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Reemparentar nodo" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Convertir en RaÃz de Escena" @@ -10101,8 +10197,8 @@ msgid "Script is valid." msgstr "El script es válido." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" -msgstr "Permitido: a-z, A-Z, 0-9 y _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." +msgstr "Permitido: a-z, A-Z, 0-9, _ y ." #: editor/script_create_dialog.cpp msgid "Built-in script (into scene file)." @@ -10166,7 +10262,7 @@ msgstr "Proceso Hijo Conectado" #: editor/script_editor_debugger.cpp msgid "Copy Error" -msgstr "Error de Copia" +msgstr "Copiar Error" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -11189,13 +11285,12 @@ msgstr "" "Las dimensiones de la imagen del splash son inválidas (deberÃa ser 620x300)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." msgstr "" -"Se debe crear o establecer un recurso SpriteFrames en la propiedad 'Frames' " -"para que AnimatedSprite pueda mostrar frames." +"Se debe crear o establecer un recurso SpriteFrames en la propiedad \"Frames" +"\" para que AnimatedSprite pueda mostrar frames." #: scene/2d/canvas_modulate.cpp msgid "" @@ -11259,12 +11354,12 @@ msgstr "" "\"Particles Animation\" activado." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." msgstr "" -"Se debe asignar una textura con la forma de la luz a la propiedad 'texture'." +"Se debe proporcionar una textura con la forma de la luz a la propiedad \" " +"Texture\"." #: scene/2d/light_occluder_2d.cpp msgid "" @@ -11274,11 +11369,10 @@ msgstr "" "tenga efecto." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." msgstr "" -"El polÃgono oclusor para este oclusor esta vacÃo. Por favor, ¡dibuja un " -"polÃgono!" +"El polÃgono oclusor para este oclusor está vacÃo. Por favor, dibuja un " +"polÃgono." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11377,18 +11471,16 @@ msgstr "" "RigidBody2D, KinematicBody2D, etc. para que puedan tener forma." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." msgstr "" -"VisibilityEnable2D funciona mejor cuando se usa directamente con la raÃz de " -"la escena editada como padre." +"VisibilityEnabler2D funciona mejor cuando se usa con la raÃz de la escena " +"editada directamente como padre." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera tiene que tener un nodo ARVROrigin como padre" +msgstr "ARVRCamera tiene que tener un nodo ARVROrigin como padre." #: scene/3d/arvr_nodes.cpp msgid "ARVRController must have an ARVROrigin node as its parent." @@ -11478,13 +11570,12 @@ msgstr "" "RigidBody, KinematicBody, etc. para darles dicha forma." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" -"Se debe proveer de una forma a CollisionShape para que funcione. Por favor, " -"¡crea un recurso \"shape\"!" +"Se debe proporcionar un shape para que CollisionShape funcione. Por favor, " +"crea un recurso de shape para ello." #: scene/3d/collision_shape.cpp msgid "" @@ -11521,6 +11612,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." msgstr "" +"Un SpotLight con un ángulo superior a 90 grados no puede proyectar sombras." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11567,13 +11659,12 @@ msgstr "" "PathFollow solo funciona cuando está asignado como hijo de un nodo Path." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED requiere que \"Up Vector\" esté activo en el " -"recurso Curve de su Path padre." +"PathFollow's ROTATION_ORIENTED requiere que \"Up Vector\" esté activado en " +"el recurso Curve de su Path padre." #: scene/3d/physics_body.cpp msgid "" @@ -11586,12 +11677,12 @@ msgstr "" "En lugar de esto, cambie el tamaño en las formas de colisión hijas." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." msgstr "" -"La propiedad Path debe apuntar a un nodo Spatial válido para funcionar." +"La propiedad \"Remote Path\" debe apuntar a un nodo Spatial o derivado de " +"Spatial válido para que funcione." #: scene/3d/soft_body.cpp msgid "This body will be ignored until you set a mesh." @@ -11608,13 +11699,12 @@ msgstr "" "En su lugar, cambia el tamaño de los collision shapes hijos." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" -"Se debe crear o establecer un recurso SpriteFrames en la propiedad 'Frames' " -"para que AnimatedSprite3D pueda mostrar frames." +"Se debe crear o establecer un recurso SpriteFrames en la propiedad \"Frames" +"\" para que AnimatedSprite3D pueda mostrar frames." #: scene/3d/vehicle_body.cpp msgid "" @@ -11629,6 +11719,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"WorldEnvironment requiere que su propiedad \"Environment\" contenga un " +"Environment para que tenga un efecto visible." #: scene/3d/world_environment.cpp msgid "" @@ -11667,9 +11759,8 @@ msgid "Nothing connected to input '%s' of node '%s'." msgstr "Nada conectado a la entrada '%s' del nodo '%s'." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." -msgstr "No hay asignado ningún nodo AnimationNode raÃz para el gráfico." +msgstr "No se ha establecido ningún nodo AnimationNode raÃz para el gráfico." #: scene/animation/animation_tree.cpp msgid "Path to an AnimationPlayer node containing animations is not set." @@ -11682,9 +11773,8 @@ msgstr "" "La ruta asignada al AnimationPlayer no apunta a un nodo AnimationPlayer." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." -msgstr "La raÃz del AnimationPlayer no es un nodo válido." +msgstr "La raÃz del nodo AnimationPlayer no es un nodo válido." #: scene/animation/animation_tree_player.cpp msgid "This node has been deprecated. Use AnimationTree instead." @@ -11711,7 +11801,6 @@ msgid "Add current color as a preset." msgstr "Añadir el color actual como preset." #: scene/gui/container.cpp -#, fuzzy msgid "" "Container by itself serves no purpose unless a script configures its " "children placement behavior.\n" @@ -11719,7 +11808,7 @@ msgid "" msgstr "" "Container por sà mismo no sirve para nada a menos que un script defina el " "comportamiento de colocación de sus hijos.\n" -"Si no tienes intención de añadir un script, utiliza un nodo 'Control' " +"Si no tienes intención de añadir un script, utiliza un nodo de Control " "sencillo." #: scene/gui/control.cpp @@ -11740,31 +11829,28 @@ msgid "Please Confirm..." msgstr "Por favor, Confirma..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " "running." msgstr "" -"Los popups se esconderán por defecto a menos que llames a popup() o " -"cualquiera de las funciones popup*(). Sin embargo, no hay problema con " -"hacerlos visibles para editar, aunque se esconderán al ejecutar." +"Los popups se ocultarán por defecto a menos que llames a popup() o a " +"cualquiera de las funciones popup*(). Puedes hacerlos visibles para su " +"edición, pero se esconderán al iniciar." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "Si exp_edit es `true` min_value debe ser > 0." +msgstr "Si \"Exp Edit\" está activado, \"Min Value\" debe ser mayor que 0." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " "minimum size manually." msgstr "" -"ScrollContainer está pensado para funcionar con un control hijo únicamente.\n" -"Usa un contenedor como hijo (VBox,HBox,etc), o un Control y ajusta el tamaño " -"mÃnimo manualmente." +"ScrollContainer está pensado para funcionar con un solo control hijo.\n" +"Utiliza un container como hijo (VBox, HBox, etc.), o un Control y establece " +"manualmente el tamaño mÃnimo personalizado." #: scene/gui/tree.cpp msgid "(Other)" @@ -11811,14 +11897,17 @@ msgid "Input" msgstr "Entrada" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "Fuente inválida para el shader." +msgstr "Fuente inválida para la vista previa." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "Fuente inválida para el shader." +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "Función de comparación inválida para este tipo." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Asignación a función." @@ -11835,6 +11924,27 @@ msgstr "Solo se pueden asignar variaciones en funciones de vértice." msgid "Constants cannot be modified." msgstr "Las constantes no pueden modificarse." +#~ msgid "Previous Folder" +#~ msgstr "Carpeta Anterior" + +#~ msgid "Next Folder" +#~ msgstr "Carpeta Siguiente" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Abrir Capturas de Pantalla Automáticamente" + +#~ msgid "Open in an external image editor." +#~ msgstr "Abrir en un editor de imágenes externo." + +#~ msgid "Reverse" +#~ msgstr "Invertir" + +#~ msgid "Mirror X" +#~ msgstr "Voltear X" + +#~ msgid "Mirror Y" +#~ msgstr "Voltear Y" + #~ msgid "Generating solution..." #~ msgstr "Generando solución..." diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po index 185b50f0c6..0b03b5517a 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-07-09 10:47+0000\n" -"Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n" +"PO-Revision-Date: 2019-07-29 19:21+0000\n" +"Last-Translator: Lisandro Lorea <lisandrolorea@gmail.com>\n" "Language-Team: Spanish (Argentina) <https://hosted.weblate.org/projects/" "godot-engine/godot/es_AR/>\n" "Language: es_AR\n" @@ -137,6 +137,31 @@ msgid "Anim Change Call" msgstr "Cambiar Call de Anim" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Cambiar Tiempo de Keyframe de Anim" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Cambio de transición Anim" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Cambiar Transform de Anim" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Cambiar Valor de Keyframe de Anim" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Cambiar Call de Anim" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Cambiar Duración de la Animación" @@ -641,7 +666,7 @@ msgstr "Numero de LÃnea:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Se encontraron %d coincidencias." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -799,9 +824,8 @@ msgid "Connect" msgstr "Conectar" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Señales:" +msgstr "Señal:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -967,9 +991,9 @@ msgid "Owners Of:" msgstr "Dueños De:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "Quitar los archivos seleccionados del proyecto? (imposible deshacer)" +msgstr "" +"¿Eliminar los archivos seleccionados del proyecto? (No puede ser restaurado)" #: editor/dependency_editor.cpp msgid "" @@ -1151,7 +1175,6 @@ msgid "Success!" msgstr "¡Éxito!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Instalar" @@ -1521,6 +1544,7 @@ msgstr "Plantilla no encontrada:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"En la exportación de 32 bits el PCK embebido no puede ser mayor de 4 GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1696,7 +1720,7 @@ msgstr "Mostrar en Explorador de Archivos" msgid "New Folder..." msgstr "Nueva Carpeta..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Refrescar" @@ -1747,7 +1771,7 @@ msgstr "Avanzar" msgid "Go Up" msgstr "Subir" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Act/Desact. Archivos Ocultos" @@ -1772,23 +1796,31 @@ msgid "Move Favorite Down" msgstr "Bajar Favorito" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Carpeta Anterior" +#, fuzzy +msgid "Go to previous folder." +msgstr "Ir a la carpeta padre." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Carpeta Siguiente" +#, fuzzy +msgid "Go to next folder." +msgstr "Ir a la carpeta padre." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Ir a la carpeta padre." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Buscar archivos" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Quitar carpeta actual de favoritos." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Ver/Ocultar archivos ocultos." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2527,6 +2559,10 @@ msgid "Go to previously opened scene." msgstr "Ir a la escena abierta previamente." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Copiar Texto" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Pestaña siguiente" @@ -2738,14 +2774,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Las capturas se almacenan en la carpeta Editor Datta/Settings." #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "Abrir Capturas de Pantalla Automaticamente" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "Abrir en editor de imagenes externo." - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Act./Desact. Pantalla Completa" @@ -3067,6 +3095,11 @@ msgstr "Tiempo" msgid "Calls" msgstr "Llamadas" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Editar Tema" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "On" @@ -4740,6 +4773,10 @@ msgid "Idle" msgstr "Desocupado" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "Instalar..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Reintentar" @@ -4768,7 +4805,6 @@ msgid "Last" msgstr "Ultimo" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Todos" @@ -4782,8 +4818,8 @@ msgid "Sort:" msgstr "Ordenar:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Invertir" +msgid "Reverse sorting." +msgstr "Orden inverso." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4864,32 +4900,32 @@ msgid "Rotation Step:" msgstr "Step de Rotación:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "Mover guÃa vertical" +msgid "Move Vertical Guide" +msgstr "Mover GuÃa Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "Crear nueva guÃa vertical" +msgid "Create Vertical Guide" +msgstr "Crear GuÃa Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "Quitar guÃa vertical" +msgid "Remove Vertical Guide" +msgstr "Eliminar GuÃa Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "Mover guÃa horizontal" +msgid "Move Horizontal Guide" +msgstr "Mover GuÃa Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "Crear nueva guÃa horizontal" +msgid "Create Horizontal Guide" +msgstr "Crear GuÃa Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "Quitar guÃa horizontal" +msgid "Remove Horizontal Guide" +msgstr "Eliminar GuÃa Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "Crear nuevas guÃas horizontales y verticales" +msgid "Create Horizontal and Vertical Guides" +msgstr "Crear GuÃas Horizontales y Verticales" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -4972,9 +5008,8 @@ msgid "Paste Pose" msgstr "Pegar Pose" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Create Custom Bone(s) from Node(s)" -msgstr "Crear Hueso(s) Personalizados a partir de Nodo(s)" +msgstr "Crear Hueso(s) Personalizado(s) a partir de Nodo(s)" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear Bones" @@ -6428,10 +6463,11 @@ msgid "Target" msgstr "Objetivo" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "" "Missing connected method '%s' for signal '%s' from node '%s' to node '%s'." -msgstr "Nada conectado a la entrada '%s' del nodo '%s'." +msgstr "" +"No se encuentra el método conectado '%s' para la señal '%s' del nodo '%s' al " +"nodo '%s'." #: editor/plugins/script_text_editor.cpp msgid "Line" @@ -6479,7 +6515,7 @@ msgstr "Resaltador de Sintaxis" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Ir A" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6487,9 +6523,8 @@ msgid "Bookmarks" msgstr "Marcadores" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Crear puntos." +msgstr "Puntos de interrupción" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6778,9 +6813,15 @@ msgid "Rear" msgstr "Detrás" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Alinear con Vista" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Alinear Selección Con Vista" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "No hay padre al que instanciarle un hijo." @@ -6968,10 +7009,6 @@ msgid "Focus Selection" msgstr "Foco en Selección" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Alinear Selección Con Vista" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Seleccionar Herramienta" @@ -7532,14 +7569,6 @@ msgid "Transpose" msgstr "Transponer" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Espejar X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Espejar Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "Desactivar Autotile" @@ -7935,6 +7964,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Se cambió el Tipo de Entrada de Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(Sólo GLES3)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vértice" @@ -7951,315 +7984,367 @@ msgid "Create Shader Node" msgstr "Crear Nodo Shader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Color function." -msgstr "Ir a Función" +msgstr "Función Color." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color operator." -msgstr "" +msgstr "Operador Color." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Grayscale function." -msgstr "Crear Función" +msgstr "Función Escala de Grises." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts HSV vector to RGB equivalent." -msgstr "" +msgstr "Convertir vector HSV a equivalente RGB." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts RGB vector to HSV equivalent." -msgstr "" +msgstr "Convertir vector RGB a equivalente HSV." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Sepia function." -msgstr "Renombrar Función" +msgstr "Función Sepia." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Burn operator." -msgstr "" +msgstr "Operador Burn(subexponer)." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Darken operator." -msgstr "" +msgstr "Operador Darken(oscurecer)." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Difference operator." -msgstr "Solo Diferencias" +msgstr "Operador Difference(diferencia)." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Dodge operator." -msgstr "" +msgstr "Operador Dodge(sobreexponer)." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "HardLight operator" -msgstr "" +msgstr "Operador HardLight(luz fuerte)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Lighten operator." -msgstr "" +msgstr "Operador Lighten(aclarar)." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Overlay operator." -msgstr "" +msgstr "Operador Overlay(superponer)." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Screen operator." -msgstr "" +msgstr "Operador Screen(trama)." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "SoftLight operator." -msgstr "" +msgstr "Operador SoftLight(luz suave)." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Color constant." -msgstr "Constante" +msgstr "Constante de color." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Color uniform." -msgstr "Reestablecer transform" +msgstr "Color uniforme." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" +"Devuelve el resultado booleano de la comparación de %s entre dos parámetros." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "Igual (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "Mayor Que (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "Mayor o Igual Que (>=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." msgstr "" +"Devuelve un vector asociado si los escalares proporcionados son iguales, " +"mayores o menores." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" +"Devuelve el resultado booleano de la comparación entre INF y un parámetro " +"escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" +"Devuelve el resultado booleano de la comparación entre NaN y un parámetro " +"escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "Menor Que (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "Menor o Igual Que (<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "No igual (!=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" +"Devuelve un vector asociado si el valor booleano proporcionado es verdadero " +"o falso." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Devuelve el resultado booleano de la comparación entre dos parámetros." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" +"Devuelve el resultado booleano de la comparación entre INF (o NaN) y un " +"parámetro escalar." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Boolean constant." -msgstr "Cambiar Constante Vec." +msgstr "Constante booleana." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean uniform." -msgstr "" +msgstr "Uniform booleano." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for all shader modes." -msgstr "" +msgstr "Parámetro de entrada %s' para todos los modos de shader." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Input parameter." -msgstr "Alinear al Padre" +msgstr "Parámetro de entrada." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader modes." -msgstr "" +msgstr "Parámetro de entrada '%s' para modos vertex y fragment shader." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for fragment and light shader modes." -msgstr "" +msgstr "Parámetro de entrada '%s' para modos fragment y light shader." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for fragment shader mode." -msgstr "" +msgstr "Parámetro de entrada '%s' para modo fragment shader." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for light shader mode." -msgstr "" +msgstr "Parámetro de entrada '%s' para modo light shader." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex shader mode." -msgstr "" +msgstr "Parámetro de entrada '%s' para modo vertex shader." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader mode." -msgstr "" +msgstr "Parámetro de entrada '%s' para modos vertex y fragment shader." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar function." -msgstr "Cambiar Función Escalar" +msgstr "Función Escalar." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar operator." -msgstr "Cambiar Operador Escalar" +msgstr "Operador Escalar." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "E constant (2.718282). Represents the base of the natural logarithm." -msgstr "" +msgstr "Constante E (2.718282). Representa la base del logaritmo natural." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Epsilon constant (0.00001). Smallest possible scalar number." -msgstr "" +msgstr "Constante de Épsilon (0.00001). El número escalar más pequeño posible." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Phi constant (1.618034). Golden ratio." -msgstr "" +msgstr "Constante Phi (1.618034). Proporcion áurea." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/4 constant (0.785398) or 45 degrees." -msgstr "" +msgstr "Constante Pi/4 (0.785398) o 45 grados." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/2 constant (1.570796) or 90 degrees." -msgstr "" +msgstr "Constante Pi/2 (1.570796) o 90 grados." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi constant (3.141593) or 180 degrees." -msgstr "" +msgstr "Constante Pi (3.141593) o 180 grados." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Tau constant (6.283185) or 360 degrees." -msgstr "" +msgstr "Constante Tau (6.283185) o 360 grados." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Sqrt2 constant (1.414214). Square root of 2." -msgstr "" +msgstr "Constante Sqrt2 (1.414214). RaÃz cuadrada de 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the absolute value of the parameter." -msgstr "" +msgstr "Devuelve el valor absoluto del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-cosine of the parameter." -msgstr "" +msgstr "Devuelve el arcocoseno del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "" +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "Devuelve el coseno hiperbólico inverso del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." -msgstr "" +msgstr "Devuelve el arcoseno del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "" +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "Devuelve el seno hiperbólico inverso del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." -msgstr "" +msgstr "Devuelve el arcotangente del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameters." -msgstr "" +msgstr "Devuelve el arcotangente de los parámetros." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "" +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "Devuelve la tangente hiperbólica inversa del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Finds the nearest integer that is greater than or equal to the parameter." -msgstr "" +msgstr "Encuentra el entero más cercano mayor o igual que el parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Constrains a value to lie between two further values." -msgstr "" +msgstr "Limita un valor a estar entre dos valores más." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the cosine of the parameter." -msgstr "" +msgstr "Devuelve el coseno del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "" +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "Devuelve el coseno hiperbólico del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." -msgstr "" +msgstr "Convierte una cantidad en radianes a grados." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-e Exponential." -msgstr "" +msgstr "Exponencial en base e." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-2 Exponential." -msgstr "" +msgstr "Exponencial en base 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Finds the nearest integer less than or equal to the parameter." -msgstr "" +msgstr "Encuentra el número entero más cercano menor o igual que el parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Computes the fractional part of the argument." -msgstr "" +msgstr "Calcula la parte fraccional del argumento." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse of the square root of the parameter." -msgstr "" +msgstr "Devuelve el inverso de la raÃz cuadrada del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Natural logarithm." -msgstr "" +msgstr "Logaritmo natural." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-2 logarithm." -msgstr "" +msgstr "Logaritmo de la base 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the greater of two values." -msgstr "" +msgstr "Devuelve el mayor de dos valores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the lesser of two values." -msgstr "" +msgstr "Devuelve el menor de dos valores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two scalars." -msgstr "" +msgstr "Interpolación lineal entre dos escalares." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the opposite value of the parameter." -msgstr "" +msgstr "Devuelve el valor opuesto del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - scalar" -msgstr "" +msgstr "1.0 - escalar" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns the value of the first parameter raised to the power of the second." msgstr "" +"Devuelve el valor del primer parámetro elevado a la potencia del segundo." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in degrees to radians." -msgstr "" +msgstr "Convierte una cantidad de grados a radianes." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / scalar" -msgstr "" +msgstr "1.0 / escalar" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "" +msgid "Finds the nearest integer to the parameter." +msgstr "Encuentra el entero más cercano al parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "" +msgid "Finds the nearest even integer to the parameter." +msgstr "Encuentra el entero más cercano al parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." -msgstr "" +msgstr "Ajusta el valor entre 0.0 y 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Extracts the sign of the parameter." -msgstr "" +msgstr "Extrae el signo del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the sine of the parameter." -msgstr "" +msgstr "Devuelve el seno del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "" +msgid "Returns the hyperbolic sine of the parameter." +msgstr "Devuelve el seno hiperbólico del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." -msgstr "" +msgstr "Devuelve la raÃz cuadrada del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8269,6 +8354,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( scalar(edge0), scalar(edge1), scalar(x) ).\n" +"\n" +"Devuelve 0.0 si 'x' es menor que 'edge0' y 1.0 si x es mayor que 'edge1'. De " +"lo contrario, el valor de retorno se interpola entre 0.0 y 1.0 utilizando " +"polinomios de Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8276,75 +8366,77 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Step function( scalar(edge), scalar(x) ).\n" +"\n" +"Devuelve 0.0 si 'x' es menor que 'edge' y en caso contrario devuelve 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the tangent of the parameter." -msgstr "" +msgstr "Devuelve la tangente del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "" +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "Devuelve la tangente hiperbólica del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "" +msgid "Finds the truncated value of the parameter." +msgstr "Encuentra el valor truncado del parámetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." -msgstr "" +msgstr "Añade escalar a escalar." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides scalar by scalar." -msgstr "" +msgstr "Divide escalar por escalar." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies scalar by scalar." -msgstr "" +msgstr "Multiplica escalar por escalar." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two scalars." -msgstr "" +msgstr "Devuelve el resto de dos escalares." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts scalar from scalar." -msgstr "" +msgstr "Resta escalar de escalar." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar constant." -msgstr "Cambiar Constante Escalar" +msgstr "Constante escalar." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar uniform." -msgstr "Cambiar Uniforme Escalar" +msgstr "Uniform escalar." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the cubic texture lookup." -msgstr "" +msgstr "Realiza una búsqueda de texturas cúbicas." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the texture lookup." -msgstr "" +msgstr "Realiza una búsqueda de texturas." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Cubic texture uniform." -msgstr "Cambiar Uniforme Textura" +msgid "Cubic texture uniform lookup." +msgstr "Búsqueda en uniform de textura cúbica." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "2D texture uniform." -msgstr "Cambiar Uniforme Textura" +msgid "2D texture uniform lookup." +msgstr "Búsqueda en uniform de textura 2D." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." +msgstr "Búsqueda en uniform de textura 2D con triplanar." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform function." -msgstr "Cuadro de diálogo de Transform..." +msgstr "Función Transform." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8352,112 +8444,122 @@ 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 "" +"Calcula el producto exterior de un par de vectores.\n" +"\n" +"OuterProduct trata el primer parámetro 'c' como un vector de columna (matriz " +"con una columna) y el segundo parámetro 'r' como un vector de fila (matriz " +"con una fila) y multiplica una matriz algebraica lineal 'c * r', dando como " +"resultado una matriz cuyo número de filas es el número de componentes en 'c' " +"y cuyo número de columnas es el número de componentes en 'r'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes transform from four vectors." -msgstr "" +msgstr "Compone un transform a partir de cuatro vectores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes transform to four vectors." -msgstr "" +msgstr "Descompone un transform en cuatro vectores." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "" +msgid "Calculates the determinant of a transform." +msgstr "Calcula la determinante de un transform." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "" +msgid "Calculates the inverse of a transform." +msgstr "Calcula el inverso de un transform." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "" +msgid "Calculates the transpose of a transform." +msgstr "Calcula la transposición de un transform." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." -msgstr "" +msgstr "Multiplica transform por transform." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by transform." -msgstr "" +msgstr "Multiplica vector por transform." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform constant." -msgstr "Transformación Abortada." +msgstr "Constante transform." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform uniform." -msgstr "Transformación Abortada." +msgstr "Uniform de transform." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector function." -msgstr "Asignación a función." +msgstr "Función Vector." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector operator." -msgstr "Cambiar Operador Vec." +msgstr "Operador vector." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes vector from three scalars." -msgstr "" +msgstr "Compone vector a partir de tres escalares." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes vector to three scalars." -msgstr "" +msgstr "Descompone vector a tres escalares." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the cross product of two vectors." -msgstr "" +msgstr "Calcula el producto cruzado de dos vectores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the distance between two points." -msgstr "" +msgstr "Devuelve la distancia entre dos puntos." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the dot product of two vectors." -msgstr "" +msgstr "Calcula el producto punto de dos vectores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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 "" +"Devuelve el vector que apunta en la misma dirección que un vector de " +"referencia. La función tiene tres parámetros vectoriales: N, el vector a " +"orientar, I, el vector incidente, y Nref, el vector de referencia. Si el " +"producto de punto de I y Nref es menor que cero, el valor de retorno es N. " +"De lo contrario, se devuelve -N." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." -msgstr "" +msgstr "Calcula la longitud de un vector." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two vectors." -msgstr "" +msgstr "Interpolación lineal entre dos vectores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the normalize product of vector." -msgstr "" +msgstr "Calcula el producto normalizado del vector." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - vector" -msgstr "" +msgstr "1.0 - vector" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / vector" -msgstr "" +msgstr "1.0 / vector" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" +"Devuelve el vector que apunta en la dirección de reflexión ( a : vector " +"incidente, b : vector normal)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." -msgstr "" +msgid "Returns the vector that points in the direction of refraction." +msgstr "Devuelve el vector que apunta en la dirección de refracción." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8467,6 +8569,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( vector(edge0), vector(edge1), vector(x) ).\n" +"\n" +"Devuelve 0.0 si 'x' es menor que 'edge0' y 1.0 si 'x' es mayor que 'edge1'. " +"De lo contrario, el valor de retorno se interpola entre 0.0 y 1.0 utilizando " +"polinomios de Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8476,6 +8583,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( scalar(edge0), scalar(edge1), vector(x) ).\n" +"\n" +"Devuelve 0.0 si 'x' es menor que 'edge0' y 1.0 si 'x' es mayor que 'edge1'. " +"De lo contrario, el valor de retorno se interpola entre 0.0 y 1.0 utilizando " +"polinomios de Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8483,6 +8595,9 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Step function( vector(edge), vector(x) ).\n" +"\n" +"Devuelve 0.0 si 'x' es menor que 'edge' y 1.0 en caso contrario." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8490,36 +8605,37 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Step function( scalar(edge), vector(x) ).\n" +"\n" +"Devuelve 0.0 si 'x' es menor que 'edge' y 1.0 en caso contrario." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds vector to vector." -msgstr "" +msgstr "Suma vector a vector." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides vector by vector." -msgstr "" +msgstr "Divide vector por vector." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by vector." -msgstr "" +msgstr "Multiplica vector por vector." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two vectors." -msgstr "" +msgstr "Devuelve el resto de los dos vectores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts vector from vector." -msgstr "" +msgstr "Sustrae vector de vector." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector constant." -msgstr "Cambiar Constante Vec." +msgstr "Constante vectorial." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector uniform." -msgstr "Asignación a uniform." +msgstr "Uniform vectorial." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8527,56 +8643,73 @@ 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 "" +"Expresión personalizada del lenguaje de shaders de Godot, con una cantidad " +"determinada de puertos de entrada y salida. Esta es una inyección directa de " +"código en la función vertex/fragment/light, no la uses para escribir " +"declaraciones de funciones en su interior." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns falloff based on the dot product of surface normal and view " "direction of camera (pass associated inputs to it)." msgstr "" +"Devuelve el falloff en base al producto punto de la superficie normal y la " +"dirección de vista de la camara ( pasale los puntos asociados)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "" +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(Sólo modo Fragmento/Luz) Función derivada escalar." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "" +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(Sólo modo Fragmento/Luz) Función derivada vectorial." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" +"(Sólo modo Fragmento/Luz) (Vector) Derivada en 'x' utilizando diferenciación " +"local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" +"(Sólo modo Fragmento/Luz) (Escalar) Derivada en 'x' utilizando " +"diferenciación local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" +"(Sólo modo Fragmento/Luz) (Vector) Derivada en 'y' utilizando diferenciación " +"local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" +"(Sólo modo Fragmento/Luz) (Escalar) Derivada en 'y' utilizando " +"diferenciación local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" +"(Sólo modo Fragmento/Luz) (Vector) Suma de la derivada absoluta en 'x' e 'y'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" +"(Sólo modo Fragmento/Luz) (Escalar) Suma de la derivada absoluta en 'x' e " +"'y'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -8920,7 +9053,6 @@ msgid "Are you sure to open more than one project?" msgstr "¿Estás seguro/a que quieres abrir más de un proyecto?" #: editor/project_manager.cpp -#, fuzzy msgid "" "The following project settings file does not specify the version of Godot " "through which it was created.\n" @@ -8943,7 +9075,6 @@ msgstr "" "anteriores del motor." #: editor/project_manager.cpp -#, fuzzy msgid "" "The following project settings file was generated by an older engine " "version, and needs to be converted for this version:\n" @@ -8954,12 +9085,12 @@ msgid "" "Warning: You won't be able to open the project with previous versions of the " "engine anymore." msgstr "" -"Las siguientes configuraciones de proyecto fueron generadas para una versión " -"anterior del motor, y deben ser convertidas para esta versión:\n" +"El siguiente archivo de configuración de proyecto fue generado por una " +"versión anterior del motor, y debe se convertido para esta versión:\n" "\n" "%s\n" "\n" -"¿Querés convertirlas?\n" +"¿Querés convertirlo?\n" "Advertencia: No vas a poder volver a abrir el proyecto con versiones " "anteriores del motor." @@ -8972,15 +9103,14 @@ msgstr "" "del motor y no son compatibles con esta versión." #: editor/project_manager.cpp -#, fuzzy msgid "" "Can't run project: no main scene defined.\n" "Please edit the project and set the main scene in the Project Settings under " "the \"Application\" category." msgstr "" -"No sé puede ejecutar el proyecto: No se ha definido ninguna escena " +"No se puede ejecutar el proyecto: No se ha definido ninguna escena " "principal.\n" -"Por favor editá el proyecto y seteá la escena principal en \"Ajustes de " +"Por favor editá el proyecto y asigná la escena principal en \"Ajustes de " "Proyecto\" bajo la categorÃa 'Aplicación'." #: editor/project_manager.cpp @@ -8992,55 +9122,50 @@ msgstr "" "Por favor editá el proyecto para provocar la importación inicial." #: editor/project_manager.cpp -#, fuzzy msgid "Are you sure to run %d projects at once?" -msgstr "¿Estás seguro/a que quieres ejecutar más de un proyecto?" +msgstr "¿Estás seguro/a que querés ejecutar %d proyectos a la vez?" #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove %d projects from the list?\n" "The project folders' contents won't be modified." msgstr "" -"¿Quitar proyecto de la lista? (Los contenidos de la carpeta no serán " -"modificados)" +"¿Quitar %d proyectos de la lista?\n" +"El contenido de las carpetas de proyecto no será modificado." #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove this project from the list?\n" "The project folder's contents won't be modified." msgstr "" -"¿Quitar proyecto de la lista? (Los contenidos de la carpeta no serán " -"modificados)" +"¿Quitar este proyecto de la lista?\n" +"El contenido de la carpeta de proyecto no será modificado." #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove all missing projects from the list? (Folders contents will not be " "modified)" msgstr "" -"¿Quitar proyecto de la lista? (Los contenidos de la carpeta no serán " -"modificados)" +"¿Eliminar todos los proyectos faltantes de la lista? (El contenido de las " +"carpetas no se modificará)" #: editor/project_manager.cpp -#, fuzzy msgid "" "Language changed.\n" "The interface will update after restarting the editor or project manager." msgstr "" "Lenguaje cambiado.\n" -"La interfaz de usuario se actualizara la próxima vez que el editor o gestor " -"de proyectos inicie." +"La interfaz de usuario se actualizara luego de reiniciar el editor o gestor " +"de proyectos." #: editor/project_manager.cpp -#, fuzzy msgid "" "Are you sure to scan %s folders for existing Godot projects?\n" "This could take a while." msgstr "" -"Estás a punto de examinar %s carpetas en busca de proyectos de Godot. " -"¿Confirmar?" +"¿Estás seguro de querer examinar %s carpetas en busca de proyectos de Godot " +"existentes?\n" +"PodrÃa demorar un rato." #: editor/project_manager.cpp msgid "Project Manager" @@ -9063,9 +9188,8 @@ msgid "New Project" msgstr "Proyecto Nuevo" #: editor/project_manager.cpp -#, fuzzy msgid "Remove Missing" -msgstr "Quitar punto" +msgstr "Eliminar Faltantes" #: editor/project_manager.cpp msgid "Templates" @@ -9084,13 +9208,12 @@ msgid "Can't run project" msgstr "No se puede ejecutar el proyecto" #: editor/project_manager.cpp -#, fuzzy msgid "" "You currently don't have any projects.\n" "Would you like to explore official example projects in the Asset Library?" msgstr "" -"Actualmente no tenés ningun proyecto.\n" -"Te gustarÃa explorar los ejemplos oficiales en la Biblioteca de Assets?" +"Actualmente no tenés ningún proyecto.\n" +"¿Te gustarÃa explorar los ejemplos oficiales en la Biblioteca de Assets?" #: editor/project_settings_editor.cpp msgid "Key " @@ -9117,9 +9240,8 @@ msgstr "" "'\\' o '\"'" #: editor/project_settings_editor.cpp -#, fuzzy msgid "An action with the name '%s' already exists." -msgstr "La acción '%s' ya existe!" +msgstr "Ya existe una acción con el nombre '%s'." #: editor/project_settings_editor.cpp msgid "Rename Input Action Event" @@ -9338,9 +9460,8 @@ msgid "Override For..." msgstr "Sobreescribir Para..." #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp -#, fuzzy msgid "The editor must be restarted for changes to take effect." -msgstr "Se debe reiniciar el editor para que los cambios surtan efecto" +msgstr "Debe reiniciarse el editor para que los cambios surtan efecto." #: editor/project_settings_editor.cpp msgid "Input Map" @@ -9399,14 +9520,12 @@ msgid "Locales Filter" msgstr "Filtro de Locales" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show All Locales" -msgstr "Mostrar todos los locales" +msgstr "Mostrar Todas las Localizaciones" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show Selected Locales Only" -msgstr "Mostrar solo los locales seleccionados" +msgstr "Mostrar Sólo las Localizaciones Seleccionadas" #: editor/project_settings_editor.cpp msgid "Filter mode:" @@ -9494,9 +9613,8 @@ msgid "Suffix" msgstr "Sufijo" #: editor/rename_dialog.cpp -#, fuzzy msgid "Advanced Options" -msgstr "Opciones avanzadas" +msgstr "Opciones Avanzadas" #: editor/rename_dialog.cpp msgid "Substitute" @@ -9757,9 +9875,8 @@ msgid "User Interface" msgstr "Interfaz de Usuario" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Other Node" -msgstr "Eliminar Nodo" +msgstr "Otro Nodo" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" @@ -9803,18 +9920,16 @@ msgid "Clear Inheritance" msgstr "Limpiar Herencia" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Open Documentation" -msgstr "Abrir documentación" +msgstr "Abrir Documentación" #: editor/scene_tree_dock.cpp msgid "Add Child Node" msgstr "Agregar Nodo Hijo" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Expand/Collapse All" -msgstr "Colapsar Todos" +msgstr "Expandir/Colapsar Todo" #: editor/scene_tree_dock.cpp msgid "Change Type" @@ -9825,6 +9940,11 @@ msgid "Extend Script" msgstr "Extender Script" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Reemparentar Nodo" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Convertir en RaÃz de Escena" @@ -9845,9 +9965,8 @@ msgid "Delete (No Confirm)" msgstr "Eliminar (Sin Confirmación)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Add/Create a New Node." -msgstr "Agregar/Crear un Nuevo Nodo" +msgstr "Añadir/Crear un Nuevo Nodo." #: editor/scene_tree_dock.cpp msgid "" @@ -9882,19 +10001,16 @@ msgid "Toggle Visible" msgstr "Act/Desact. Visible" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Unlock Node" -msgstr "Seleccionar Nodo" +msgstr "Desbloquear Nodo" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Button Group" -msgstr "Botón 7" +msgstr "Grupo de Botones" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "(Connecting From)" -msgstr "Error de Conexión" +msgstr "(Conectando Desde)" #: editor/scene_tree_editor.cpp msgid "Node configuration warning:" @@ -9925,9 +10041,8 @@ msgstr "" "Click para mostrar el panel de grupos." #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Open Script:" -msgstr "Abrir Script" +msgstr "Abrir Script:" #: editor/scene_tree_editor.cpp msgid "" @@ -9979,39 +10094,32 @@ msgid "Select a Node" msgstr "Seleccionar un Nodo" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is empty." -msgstr "La ruta está vacÃa" +msgstr "La ruta está vacÃa." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Filename is empty." -msgstr "Nombre de archivo vacio" +msgstr "El nombre del archivo está vacÃo." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is not local." -msgstr "La ruta no es local" +msgstr "La ruta no es local." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid base path." -msgstr "Ruta base inválida" +msgstr "Ruta base inválida." #: editor/script_create_dialog.cpp -#, fuzzy msgid "A directory with the same name exists." -msgstr "Existe un directorio con el mismo nombre" +msgstr "Existe un directorio con el mismo nombre." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid extension." -msgstr "Extensión invalida" +msgstr "Extensión inválida." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Wrong extension chosen." -msgstr "Extensión incorrecta elegida" +msgstr "Extensión incorrecta elegida." #: editor/script_create_dialog.cpp msgid "Error loading template '%s'" @@ -10030,52 +10138,44 @@ msgid "N/A" msgstr "N/A" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Open Script / Choose Location" -msgstr "Abrir Script/Elegir Ubicación" +msgstr "Abrir Script / Seleccionar Ubicación" #: editor/script_create_dialog.cpp msgid "Open Script" msgstr "Abrir Script" #: editor/script_create_dialog.cpp -#, fuzzy msgid "File exists, it will be reused." -msgstr "El archivo existe, será reutilizado" +msgstr "El archivo existe, será reutilizado." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid class name." -msgstr "Nombre de clase inválido" +msgstr "Nombre de clase inválido." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid inherited parent name or path." -msgstr "Ruta o nombre del padre heredado inválido" +msgstr "Ruta o nombre del padre heredado inválido." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script is valid." -msgstr "Script válido" +msgstr "El script es válido." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" -msgstr "Permitidos: a-z, A-Z, 0-9 y _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." +msgstr "Permitido: a-z, A-Z, 0-9, _ y ." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Built-in script (into scene file)." -msgstr "Script Integrado (dentro del archivo de escena)" +msgstr "Script Integrado (dentro del archivo de escena)." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will create a new script file." -msgstr "Crear script nuevo" +msgstr "Se creará un nuevo archivo de script." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will load an existing script file." -msgstr "Cargar script existente" +msgstr "Se cargará un archivo de script existente." #: editor/script_create_dialog.cpp msgid "Language" @@ -10207,7 +10307,7 @@ msgstr "Setear Desde Arbol" #: editor/script_editor_debugger.cpp msgid "Export measures as CSV" -msgstr "" +msgstr "Exportar medidas como CSV" #: editor/settings_config_dialog.cpp msgid "Erase Shortcut" @@ -10339,12 +10439,11 @@ msgstr "GDNativeLibrary" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Enabled GDNative Singleton" -msgstr "" +msgstr "Activar Singleton GDNative" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Disabled GDNative Singleton" -msgstr "Desactivar Update Spinner" +msgstr "GDNative Singleton desactivado" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Library" @@ -10434,9 +10533,8 @@ msgid "GridMap Fill Selection" msgstr "Llenar Selección en GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paste Selection" -msgstr "Eliminar Seleccionados en GridMap" +msgstr "Pegar lo Seleccionado en GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "GridMap Paint" @@ -10816,9 +10914,8 @@ msgid "Available Nodes:" msgstr "Nodos Disponibles:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Select or create a function to edit its graph." -msgstr "Seleccioná o creá una función para editar el grafo" +msgstr "Selecciona o crea una función para editar el gráfico." #: modules/visual_script/visual_script_editor.cpp msgid "Delete Selected" @@ -10957,15 +11054,21 @@ msgstr "" #: platform/android/export/export.cpp msgid "Custom build requires a valid Android SDK path in Editor Settings." msgstr "" +"La compilación personalizada requiere una ruta de Android SDK válida en " +"Configuración del Editor." #: platform/android/export/export.cpp msgid "Invalid Android SDK path for custom build in Editor Settings." msgstr "" +"Ruta del SDK de Android inválida para la compilación personalizada en " +"Configuración del Editor." #: platform/android/export/export.cpp msgid "" "Android project is not installed for compiling. Install from Editor menu." msgstr "" +"El proyecto Android no está instalado para la compilación. Instálalo desde " +"el menú Editor." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -10980,6 +11083,9 @@ msgid "" "Trying to build from a custom built template, but no version info for it " "exists. Please reinstall from the 'Project' menu." msgstr "" +"Intentando construir a partir de una plantilla personalizada, pero no existe " +"información de la versión para ello. Por favor, reinstalá desde el menú " +"'Proyecto'." #: platform/android/export/export.cpp msgid "" @@ -10988,20 +11094,28 @@ msgid "" " Godot Version: %s\n" "Please reinstall Android build template from 'Project' menu." msgstr "" +"La versión de compilación de Android no coincide:\n" +" Plantilla instalada: %s\n" +" Versión de Godot: %s\n" +"Por favor, reinstalá la plantilla de compilación de Android desde el menú " +"'Proyecto'." #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" -msgstr "" +msgstr "Construir Proyecto 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 "" +"La construcción del proyecto Android falló, comprueba la salida del error.\n" +"También podés visitar docs.godotengine.org para consultar la documentación " +"de compilación de Android." #: platform/android/export/export.cpp msgid "No build apk generated at: " -msgstr "" +msgstr "No se ha generado ninguna compilación apk en: " #: platform/iphone/export/export.cpp msgid "Identifier is missing." @@ -11132,13 +11246,12 @@ msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "Dimensiones de la imagen del splash inválidas (deberÃa ser 620x300)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." msgstr "" -"Un recurso SpriteFrames debe ser creado o seteado en la propiedad 'Frames' " -"para que AnimatedSprite pueda mostrar frames." +"Se debe crear o establecer un recurso SpriteFrames en la propiedad \"Frames" +"\" para que AnimatedSprite pueda mostrar frames." #: scene/2d/canvas_modulate.cpp msgid "" @@ -11201,12 +11314,12 @@ msgstr "" "\"Particles Animation\" activado." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." msgstr "" -"Se debe proveer una textura con la forma de la luz a la propiedad 'texture'." +"Se debe proporcionar una textura con la forma de la luz a la propiedad " +"\"Texture\"." #: scene/2d/light_occluder_2d.cpp msgid "" @@ -11216,9 +11329,10 @@ msgstr "" "efecto." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." -msgstr "El polÃgono de este oclusor está vacÃo. ¡Dibuja un polÃgono!" +msgstr "" +"El polÃgono oclusor para este oclusor está vacÃo. Por favor, dibujá un " +"polÃgono." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11316,51 +11430,44 @@ msgstr "" "RigidBody2D, KinematicBody2D, etc. para que puedan tener forma." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." msgstr "" -"VisibilityEnable2D funciona mejor cuando se usa con la raÃz de escena " +"VisibilityEnabler2D funciona mejor cuando se usa con la raÃz de la escena " "editada directamente como padre." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera debe tener un nodo ARVROrigin como su padre" +msgstr "ARVRCamera tiene que tener un nodo ARVROrigin como padre." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRController must have an ARVROrigin node as its parent." -msgstr "ARVRController debe tener un nodo ARVROrigin como su padre" +msgstr "ARVRController debe tener un nodo ARVROrigin como padre." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "" "The controller ID must not be 0 or this controller won't be bound to an " "actual controller." msgstr "" -"El id de controlador no debe ser 0 o este controlador no será vinculado a un " -"controlador real" +"El ID del controlador no debe ser 0 o este controlador no estará asociado a " +"un controlador real." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRAnchor must have an ARVROrigin node as its parent." -msgstr "ARVRAnchor debe tener un nodo ARVROrigin como su padre" +msgstr "ARVRAnchor debe tener un nodo ARVROrigin como su padre." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "" "The anchor ID must not be 0 or this anchor won't be bound to an actual " "anchor." msgstr "" -"El id de anclaje no debe ser 0 o este anclaje no podrá ser vinculado a un " -"anclaje real" +"El ID del ancla no puede ser 0 o este ancla no estará asociada a una ancla " +"real." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVROrigin requires an ARVRCamera child node." -msgstr "ARVROrigin requiere un nodo hijo ARVRCamera" +msgstr "ARVROrigin requiere un nodo hijo ARVRCamera." #: scene/3d/baked_lightmap.cpp msgid "%d%%" @@ -11422,13 +11529,12 @@ msgstr "" "RigidBody, KinematicBody, etc. para darles un shape." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" -"Se debe proveer un shape para que CollisionShape funcione. Creale un recurso " -"shape!" +"Se debe proporcionar un shape para que CollisionShape funcione. Por favor, " +"crea un recurso de shape para ello." #: scene/3d/collision_shape.cpp msgid "" @@ -11443,13 +11549,12 @@ msgid "Nothing is visible because no mesh has been assigned." msgstr "Nada visible ya que no se asignó ningún mesh." #: scene/3d/cpu_particles.cpp -#, fuzzy msgid "" "CPUParticles animation requires the usage of a SpatialMaterial whose " "Billboard Mode is set to \"Particle Billboard\"." msgstr "" -"Animar CPUParticles requiere el uso de un SpatialMaterial con \"Billboard " -"Particles\" activado." +"La animación de CPUParticles requiere el uso de un SpatialMaterial cuyo Modo " +"Billboard esté ajustado a \"Particle Billboard\"." #: scene/3d/gi_probe.cpp msgid "Plotting Meshes" @@ -11466,6 +11571,8 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." msgstr "" +"Un SpotLight con un ángulo mas ancho que 90 grados no puede proyectar " +"sombras." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11497,13 +11604,12 @@ msgid "" msgstr "Nada visible ya que no se asigno pasadas de dibujado a los meshes." #: scene/3d/particles.cpp -#, fuzzy msgid "" "Particles animation requires the usage of a SpatialMaterial whose Billboard " "Mode is set to \"Particle Billboard\"." msgstr "" -"Animar Particles requiere el uso de un SpatialMaterial con \"Billboard " -"Particles\" activado." +"La animación de partÃculas requiere el uso de un SpatialMaterial cuyo Modo " +"Billboard esté ajustado a \"Particle Billboard\"." #: scene/3d/path.cpp msgid "PathFollow only works when set as a child of a Path node." @@ -11511,13 +11617,12 @@ msgstr "" "PathFollow solo funciona cuando está asignado como hijo de un nodo Path." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED requiere que \"Up Vector\" esté activo en el " -"recurso Curve de su Path padre." +"PathFollow's ROTATION_ORIENTED requiere que \"Up Vector\" esté activado en " +"el recurso Curve de su Path padre." #: scene/3d/physics_body.cpp msgid "" @@ -11530,17 +11635,16 @@ msgstr "" "Cambiá el tamaño de los collision shapes hijos." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." msgstr "" -"La propiedad Path debe apuntar a un nodo Spatial valido para funcionar." +"La propiedad \"Remote Path\" debe apuntar a un nodo Spatial o derivado de " +"Spatial válido para que funcione." #: scene/3d/soft_body.cpp -#, fuzzy msgid "This body will be ignored until you set a mesh." -msgstr "Este cuerpo sera ignorado hasta que le asignes un mesh" +msgstr "Este cuerpo será ignorado hasta que se establezca un mesh." #: scene/3d/soft_body.cpp msgid "" @@ -11553,13 +11657,12 @@ msgstr "" "En su lugar, cambiá el tamaño de los collision shapes hijos." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" -"Un recurso SpriteFrames debe ser creado o asignado en la propiedad 'Frames' " -"para que AnimatedSprite3D pueda mostrar frames." +"Se debe crear o establecer un recurso SpriteFrames en la propiedad \"Frames" +"\" para que AnimatedSprite3D pueda mostrar frames." #: scene/3d/vehicle_body.cpp msgid "" @@ -11574,6 +11677,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"WorldEnvironment requiere que su propiedad \"Environment\" contenga un " +"Environment para que tenga un efecto visible." #: scene/3d/world_environment.cpp msgid "" @@ -11612,9 +11717,8 @@ msgid "Nothing connected to input '%s' of node '%s'." msgstr "Nada conectado a la entrada '%s' del nodo '%s'." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." -msgstr "No hay asignado ningún nodo AnimationNode raÃz para el gráfico." +msgstr "No se ha establecido ningún nodo AnimationNode raÃz para el gráfico." #: scene/animation/animation_tree.cpp msgid "Path to an AnimationPlayer node containing animations is not set." @@ -11627,9 +11731,8 @@ msgstr "" "La ruta asignada al AnimationPlayer no apunta a un nodo AnimationPlayer." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." -msgstr "La raÃz del AnimationPlayer no es un nodo válido." +msgstr "La raÃz del nodo AnimationPlayer no es un nodo válido." #: scene/animation/animation_tree_player.cpp msgid "This node has been deprecated. Use AnimationTree instead." @@ -11641,12 +11744,11 @@ msgstr "Elegir un color de la pantalla." #: scene/gui/color_picker.cpp msgid "HSV" -msgstr "" +msgstr "HSV" #: scene/gui/color_picker.cpp -#, fuzzy msgid "Raw" -msgstr "Yaw" +msgstr "Raw" #: scene/gui/color_picker.cpp msgid "Switch between hexadecimal and code values." @@ -11657,22 +11759,24 @@ msgid "Add current color as a preset." msgstr "Agregar color actual como preset." #: scene/gui/container.cpp -#, fuzzy msgid "" "Container by itself serves no purpose unless a script configures its " "children placement behavior.\n" "If you don't intend to add a script, use a plain Control node instead." msgstr "" -"El contenedor en sà mismo no sirve ningún propósito a menos que un script " -"configure el comportamiento de posicionamiento de sus hijos.\n" -"Si no tenés pensado usar un script, entonces simplemente usá un nodo " -"'Control' en su lugar." +"Container por sà mismo no sirve para nada a menos que un script defina el " +"comportamiento de colocación de sus hijos.\n" +"Si no tenés intención de añadir un script, utilizá un nodo de Control " +"sencillo." #: scene/gui/control.cpp 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 "" +"Los Tooltip de Ayuda no se mostrarán cuando los controles del Filtro del " +"Mouse estén configurados en \"Ignore\". Para solucionarlo, establece el " +"Filtro del Mouse en \"Stop\" o \"Pass\"." #: scene/gui/dialogs.cpp msgid "Alert!" @@ -11683,31 +11787,28 @@ msgid "Please Confirm..." msgstr "Confirmá, por favor..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " "running." msgstr "" -"Los popups se esconderán por defecto a menos que llames a popup() o " -"cualquiera de las funciones popup*(). Sin embargo, no hay problema con " -"hacerlos visibles para editar, aunque se esconderán al ejecutar." +"Los popups se ocultarán por defecto a menos que llames a popup() o a " +"cualquiera de las funciones popup*(). Puedes hacerlos visibles para su " +"edición, pero se esconderán al iniciar." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "Si exp_edit es verdadero min_value debe ser > 0." +msgstr "Si \"Exp Edit\" está activado, \"Min Value\" debe ser mayor que 0." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " "minimum size manually." msgstr "" -"ScrollContainer está diseñado para trabajar con un único control hijo.\n" -"Usa un container como hijo (VBox, HBox, etc), o un Control y setea el tamaño " -"mÃnimo personalizado de forma manual." +"ScrollContainer está pensado para funcionar con un solo control hijo.\n" +"Utilizá un container como hijo (VBox, HBox, etc.), o un Control y establecé " +"manualmente el tamaño mÃnimo personalizado." #: scene/gui/tree.cpp msgid "(Other)" @@ -11754,14 +11855,17 @@ msgid "Input" msgstr "Entrada" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "Fuente inválida para el shader." +msgstr "Fuente inválida para la vista previa." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "Fuente inválida para el shader." +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "Función de comparación inválida para este tipo." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Asignación a función." @@ -11776,7 +11880,28 @@ msgstr "Solo se pueden asignar variaciones en funciones de vértice." #: servers/visual/shader_language.cpp msgid "Constants cannot be modified." -msgstr "" +msgstr "Las constantes no pueden modificarse." + +#~ msgid "Previous Folder" +#~ msgstr "Carpeta Anterior" + +#~ msgid "Next Folder" +#~ msgstr "Carpeta Siguiente" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Abrir Capturas de Pantalla Automaticamente" + +#~ msgid "Open in an external image editor." +#~ msgstr "Abrir en editor de imagenes externo." + +#~ msgid "Reverse" +#~ msgstr "Invertir" + +#~ msgid "Mirror X" +#~ msgstr "Espejar X" + +#~ msgid "Mirror Y" +#~ msgstr "Espejar Y" #~ msgid "Generating solution..." #~ msgstr "Generando solución..." diff --git a/editor/translations/et.po b/editor/translations/et.po index 5e5c7e153b..18b8252b94 100644 --- a/editor/translations/et.po +++ b/editor/translations/et.po @@ -3,94 +3,100 @@ # Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) # This file is distributed under the same license as the Godot source code. # Jens <arrkiin@gmail.com>, 2019. +# Mattias Aabmets <mattias.aabmets@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" +"PO-Revision-Date: 2019-07-19 13:41+0000\n" +"Last-Translator: Mattias Aabmets <mattias.aabmets@gmail.com>\n" "Language-Team: Estonian <https://hosted.weblate.org/projects/godot-engine/" "godot/et/>\n" "Language: et\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.8-dev\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 "" +"Kehtetu argument sisestatud convert() funktsiooni, kasuta TYPE_* konstante." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: 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 "Ebapiisav kogus baite nende dekodeerimiseks või kehtetu formaat." #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "" +msgstr "Väljendis on kehtetu sisend %i (mitte edastatud)" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" -msgstr "" +msgstr "'self' märksõna ei saa kasutada, sest loode puudub (mitte edastatud)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." -msgstr "" +msgstr "Kehtetud väärtused operaatorisse %s, %s ja %s." #: core/math/expression.cpp msgid "Invalid index of type %s for base type %s" -msgstr "" +msgstr "Kehtetu %s tüübi indeks %s põhitüübi jaoks" #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" -msgstr "" +msgstr "Kehtetu '%s' nimega indeks %s põhitüübi jaoks" #: core/math/expression.cpp msgid "Invalid arguments to construct '%s'" -msgstr "" +msgstr "Kehtetud argumendid '%s' ehitamise jaoks" #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "" +msgstr "'%' kutsudes:" #: editor/animation_bezier_editor.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Free" -msgstr "" +msgstr "Vaba" #: editor/animation_bezier_editor.cpp msgid "Balanced" -msgstr "" +msgstr "Tasakaalustatud" #: editor/animation_bezier_editor.cpp msgid "Mirror" -msgstr "" +msgstr "Peegel" #: editor/animation_bezier_editor.cpp editor/editor_profiler.cpp msgid "Time:" -msgstr "" +msgstr "Aeg:" #: editor/animation_bezier_editor.cpp msgid "Value:" -msgstr "" +msgstr "Väärtus:" #: editor/animation_bezier_editor.cpp msgid "Insert Key Here" -msgstr "" +msgstr "Sisesta Võti Siia" #: editor/animation_bezier_editor.cpp msgid "Duplicate Selected Key(s)" -msgstr "" +msgstr "Kopeeri Valitud Võti (Võtmed)" #: editor/animation_bezier_editor.cpp msgid "Delete Selected Key(s)" -msgstr "" +msgstr "Kustuta Valitud Võti (Võtmed)" #: editor/animation_bezier_editor.cpp msgid "Add Bezier Point" -msgstr "" +msgstr "Lisa Bezieri Punkt" #: editor/animation_bezier_editor.cpp msgid "Move Bezier Points" -msgstr "" +msgstr "Liiguta Bezieri Punkte" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -121,13 +127,33 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp -msgid "Change Animation Length" +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Change Animation Length" +msgstr "Muuda Animatsiooni Pikkust" + +#: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "" +msgstr "Muuda Animatsiooni Silmust" #: editor/animation_track_editor.cpp msgid "Property Track" @@ -172,15 +198,15 @@ msgstr "" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Functions:" -msgstr "" +msgstr "Funktsioonid:" #: editor/animation_track_editor.cpp msgid "Audio Clips:" -msgstr "" +msgstr "Heliklipid:" #: editor/animation_track_editor.cpp msgid "Anim Clips:" -msgstr "" +msgstr "Animatsiooni Klipid:" #: editor/animation_track_editor.cpp msgid "Change Track Path" @@ -208,7 +234,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Time (s): " -msgstr "" +msgstr "Aeg (Ajad): " #: editor/animation_track_editor.cpp msgid "Toggle Track Enabled" @@ -216,15 +242,15 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Continuous" -msgstr "" +msgstr "Pidev" #: editor/animation_track_editor.cpp msgid "Discrete" -msgstr "" +msgstr "Mittepidev" #: editor/animation_track_editor.cpp msgid "Trigger" -msgstr "" +msgstr "Päästik" #: editor/animation_track_editor.cpp msgid "Capture" @@ -232,16 +258,16 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Nearest" -msgstr "" +msgstr "Lähim" #: editor/animation_track_editor.cpp editor/plugins/curve_editor_plugin.cpp #: editor/property_editor.cpp msgid "Linear" -msgstr "" +msgstr "Sirgjooneline" #: editor/animation_track_editor.cpp msgid "Cubic" -msgstr "" +msgstr "Kuupmõõtmeline" #: editor/animation_track_editor.cpp msgid "Clamp Loop Interp" @@ -254,27 +280,27 @@ msgstr "" #: editor/animation_track_editor.cpp #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key" -msgstr "" +msgstr "Sisesta Võti" #: editor/animation_track_editor.cpp msgid "Duplicate Key(s)" -msgstr "" +msgstr "Kopeeri Võti (Võtmed)" #: editor/animation_track_editor.cpp msgid "Delete Key(s)" -msgstr "" +msgstr "Kustuta Võti (Võtmed)" #: editor/animation_track_editor.cpp msgid "Change Animation Update Mode" -msgstr "" +msgstr "Muuda Animatsiooni Uuendamise Töörežiimi" #: editor/animation_track_editor.cpp msgid "Change Animation Interpolation Mode" -msgstr "" +msgstr "Muuda Animatsiooni Interpolatsiooni Töörežiimi" #: editor/animation_track_editor.cpp msgid "Change Animation Loop Mode" -msgstr "" +msgstr "Muuda Animatsiooni Silmuse Töörežiimi" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -297,7 +323,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #: editor/script_create_dialog.cpp msgid "Create" -msgstr "" +msgstr "Loo" #: editor/animation_track_editor.cpp msgid "Anim Insert" @@ -321,7 +347,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Change Animation Step" -msgstr "" +msgstr "Muuda Animatsiooni Sammu" #: editor/animation_track_editor.cpp msgid "Rearrange Tracks" @@ -341,23 +367,24 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Animation tracks can only point to AnimationPlayer nodes." -msgstr "" +msgstr "Animatsiooni rajad võivad osutada ainult AnimationPlayer sõlmedele." #: editor/animation_track_editor.cpp msgid "An animation player can't animate itself, only other players." msgstr "" +"Animatsiooni mängija ei saa animeerida iseennast, ainult teisi mängijaid." #: editor/animation_track_editor.cpp msgid "Not possible to add a new track without a root" -msgstr "" +msgstr "Ei saa lisada uut rada ilma tüveta" #: editor/animation_track_editor.cpp msgid "Add Bezier Track" -msgstr "" +msgstr "Lisa Bezieri Rada" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." -msgstr "" +msgstr "Raja tee on kehtetu, mistõttu ei sa lisada võtit." #: editor/animation_track_editor.cpp msgid "Track is not of type Spatial, can't insert key" @@ -369,19 +396,19 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Add Track Key" -msgstr "" +msgstr "Lisa Raja Võti" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." -msgstr "" +msgstr "Raja tee on kehtetu, mistõttu ei saa lisada meetodi võtit." #: editor/animation_track_editor.cpp msgid "Add Method Track Key" -msgstr "" +msgstr "Lisa Meetodi Raja Võti" #: editor/animation_track_editor.cpp msgid "Method not found in object: " -msgstr "" +msgstr "Meetod ei ole leitud objektis: " #: editor/animation_track_editor.cpp msgid "Anim Move Keys" @@ -389,11 +416,11 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Clipboard is empty" -msgstr "" +msgstr "Lõikelaud on tühi" #: editor/animation_track_editor.cpp msgid "Paste Tracks" -msgstr "" +msgstr "Kleebi Rajad" #: editor/animation_track_editor.cpp msgid "Anim Scale Keys" @@ -424,11 +451,11 @@ 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 "" +msgstr "Vali Kõik" #: editor/animation_track_editor.cpp msgid "Select None" -msgstr "" +msgstr "Tühista Valik" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -448,11 +475,11 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Seconds" -msgstr "" +msgstr "Sekundid" #: editor/animation_track_editor.cpp msgid "FPS" -msgstr "" +msgstr "Kaadrit/Sekundis" #: editor/animation_track_editor.cpp editor/editor_properties.cpp #: editor/plugins/polygon_2d_editor_plugin.cpp @@ -461,7 +488,7 @@ msgstr "" #: editor/project_manager.cpp editor/project_settings_editor.cpp #: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp msgid "Edit" -msgstr "" +msgstr "Muuda" #: editor/animation_track_editor.cpp msgid "Animation properties." @@ -469,7 +496,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Copy Tracks" -msgstr "" +msgstr "Kopeeri Rajad" #: editor/animation_track_editor.cpp msgid "Scale Selection" @@ -489,31 +516,31 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Delete Selection" -msgstr "" +msgstr "Kustuta Valim" #: editor/animation_track_editor.cpp msgid "Go to Next Step" -msgstr "" +msgstr "Mine Järgmisele Sammule" #: editor/animation_track_editor.cpp msgid "Go to Previous Step" -msgstr "" +msgstr "Mine Eelmisele Sammule" #: editor/animation_track_editor.cpp msgid "Optimize Animation" -msgstr "" +msgstr "Optimiseeri Animatsiooni" #: editor/animation_track_editor.cpp msgid "Clean-Up Animation" -msgstr "" +msgstr "Korrasta Animatsiooni" #: editor/animation_track_editor.cpp msgid "Pick the node that will be animated:" -msgstr "" +msgstr "Vali sõlm mida animeerida:" #: editor/animation_track_editor.cpp msgid "Use Bezier Curves" -msgstr "" +msgstr "Kasuta Bezieri Kurve" #: editor/animation_track_editor.cpp msgid "Anim. Optimizer" @@ -533,27 +560,27 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Optimize" -msgstr "" +msgstr "Optimiseeri" #: editor/animation_track_editor.cpp msgid "Remove invalid keys" -msgstr "" +msgstr "Eemalda kehtetud võtmed" #: editor/animation_track_editor.cpp msgid "Remove unresolved and empty tracks" -msgstr "" +msgstr "Eemalda lahenduseta ja tühjad rajad" #: editor/animation_track_editor.cpp msgid "Clean-up all animations" -msgstr "" +msgstr "Korrasta kõik animatsioonid" #: editor/animation_track_editor.cpp msgid "Clean-Up Animation(s) (NO UNDO!)" -msgstr "" +msgstr "Korrasta Animatsioon(id) (EI SAA TAGASI VÕTTA!)" #: editor/animation_track_editor.cpp msgid "Clean-Up" -msgstr "" +msgstr "Korrasta" #: editor/animation_track_editor.cpp msgid "Scale Ratio:" @@ -570,7 +597,7 @@ msgstr "" #: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp msgid "Copy" -msgstr "" +msgstr "Kopeeri" #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" @@ -1098,7 +1125,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1631,7 +1657,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1682,7 +1708,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1707,23 +1733,29 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "" +#, fuzzy +msgid "Go to previous folder." +msgstr "Mine Eelmisele Sammule" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "" +#, fuzzy +msgid "Go to next folder." +msgstr "Mine Järgmisele Sammule" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2398,6 +2430,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Kopeeri" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2589,14 +2626,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2909,6 +2938,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4531,6 +4564,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4559,7 +4596,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4573,7 +4609,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4648,31 +4684,33 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Eemalda kehtetud võtmed" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Eemalda kehtetud võtmed" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6528,7 +6566,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6713,10 +6755,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7277,14 +7315,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7662,6 +7692,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7746,6 +7780,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7753,10 +7803,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7845,7 +7929,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7853,7 +7937,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7865,7 +7949,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7882,7 +7966,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7951,11 +8035,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7971,7 +8055,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7999,11 +8083,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8043,11 +8127,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8056,7 +8144,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8074,15 +8162,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8131,7 +8219,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8159,12 +8247,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8241,47 +8329,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9432,6 +9520,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9634,7 +9726,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11153,6 +11245,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/fa.po b/editor/translations/fa.po index fb41413eb2..60e6216f01 100644 --- a/editor/translations/fa.po +++ b/editor/translations/fa.po @@ -146,6 +146,31 @@ msgstr "ÙØ±Ø§Ø®ÙˆØ§Ù†ÛŒ را در انیمیشن تغییر بده" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "تغییر زمان ÙØ±ÛŒÙ… کلید در انیمیشن" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "انتقال را در انیمیشن تغییر بده" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "انتقال را در انیمیشن تغییر بده" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "تغییر مقدار ÙØ±ÛŒÙ… کلید در انیمیشن" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "ÙØ±Ø§Ø®ÙˆØ§Ù†ÛŒ را در انیمیشن تغییر بده" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "طول انیمیشن را تغییر بده" @@ -1179,7 +1204,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "نصب کردن" @@ -1751,7 +1775,7 @@ msgstr "باز شدن مدیر پروژه؟" msgid "New Folder..." msgstr "ساختن پوشه..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1802,7 +1826,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1828,26 +1852,31 @@ msgstr "" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "زبانه قبلی" +msgid "Go to previous folder." +msgstr "Ø±ÙØªÙ† به پوشه والد" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "ساختن پوشه" +msgid "Go to next folder." +msgstr "Ø±ÙØªÙ† به پوشه والد" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "Ø±ÙØªÙ† به پوشه والد" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "جستجوی کلاسها" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "ناتوان در ساختن پوشه." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2550,6 +2579,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Ú©Ù¾ÛŒ کردن" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "زبانه بعدی" @@ -2744,15 +2778,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "ویرایشگر ØªØ±Ø¬ÛŒØØ§Øª" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "گشودن ویرایشگر متن" - -#: editor/editor_node.cpp #, fuzzy msgid "Toggle Fullscreen" msgstr "ØØ§Ù„ت تمام ØµÙØÙ‡" @@ -3078,6 +3103,11 @@ msgstr "زمان:" msgid "Calls" msgstr "ÙØ±Ø§Ø®ÙˆØ§Ù†ÛŒ" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "عضوها" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4799,6 +4829,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "نصب کردن" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4828,7 +4863,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "همه" @@ -4842,8 +4876,9 @@ msgid "Sort:" msgstr "مرتب‌سازی:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "معکوس" +#, fuzzy +msgid "Reverse sorting." +msgstr "در ØØ§Ù„ درخواست..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4917,34 +4952,39 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "" +#, fuzzy +msgid "Move Vertical Guide" +msgstr "برداشتن متغیر" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "ساختن راهنمای عمودی" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "برداشتن متغیر" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "" +#, fuzzy +msgid "Move Horizontal Guide" +msgstr "کلیدهای نامعتبر را ØØ°Ù Ú©Ù†" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "ساختن راهنمای اÙÙ‚ÛŒ" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "کلیدهای نامعتبر را ØØ°Ù Ú©Ù†" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" +msgstr "ساختن راهنمای عمودی" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -6895,7 +6935,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7088,10 +7132,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Tool Select" msgstr "همه‌ی انتخاب ها" @@ -7685,14 +7725,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8119,6 +8151,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8210,6 +8246,22 @@ msgid "Color uniform." msgstr "انتقال را در انیمیشن تغییر بده" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8217,10 +8269,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8310,7 +8396,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8318,7 +8404,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8330,7 +8416,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8347,7 +8433,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8416,11 +8502,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8436,7 +8522,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8464,11 +8550,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8509,11 +8595,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8523,7 +8613,7 @@ msgstr "انتخاب شده را تغییر مقیاس بده" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8541,15 +8631,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8601,7 +8691,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8629,12 +8719,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8711,47 +8801,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9961,6 +10051,11 @@ msgid "Extend Script" msgstr "باز کردن Ùˆ اجرای یک اسکریپت" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "گره تغییر والد" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -10182,7 +10277,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11843,6 +11938,11 @@ msgstr "اندازهٔ قلم نامعتبر." msgid "Invalid source for shader." msgstr "اندازهٔ قلم نامعتبر." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "اندازهٔ قلم نامعتبر." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11860,6 +11960,21 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "زبانه قبلی" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "ساختن پوشه" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "گشودن ویرایشگر متن" + +#~ msgid "Reverse" +#~ msgstr "معکوس" + +#, fuzzy #~ msgid "Failed to create solution." #~ msgstr "ناتوان در ساختن پوشه." diff --git a/editor/translations/fi.po b/editor/translations/fi.po index c62d874f1b..e6a6e101b8 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-07-09 10:47+0000\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" "Last-Translator: Tapani Niemi <tapani.niemi@kapsi.fi>\n" "Language-Team: Finnish <https://hosted.weblate.org/projects/godot-engine/" "godot/fi/>\n" @@ -134,6 +134,31 @@ msgid "Anim Change Call" msgstr "Animaatio: muuta kutsua" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Animaatio: muuta avainruudun aikaa" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animaatio: muuta siirtymää" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animaatio: muuta muunnosta" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Animaatio: muuta avainruudun arvoa" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animaatio: muuta kutsua" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Muuta animaation pituutta" @@ -452,9 +477,8 @@ msgid "Select All" msgstr "Valitse kaikki" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select None" -msgstr "Valitse solmu" +msgstr "Tyhjennä valinta" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -632,7 +656,7 @@ msgstr "Rivinumero:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Löydettiin %d osuma(a)." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -789,9 +813,8 @@ msgid "Connect" msgstr "Yhdistä" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Signaalit:" +msgstr "Signaali:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -956,9 +979,8 @@ msgid "Owners Of:" msgstr "Omistajat kohteelle:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "Poista valitut tiedostot projektista? (ei voi kumota)" +msgstr "Poista valitut tiedostot projektista? (Ei voida palauttaa)" #: editor/dependency_editor.cpp msgid "" @@ -1140,7 +1162,6 @@ msgid "Success!" msgstr "Onnistui!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Asenna" @@ -1328,7 +1349,6 @@ msgid "Must not collide with an existing engine class name." msgstr "Ei saa mennä päällekkäin olemassa olevan engine-luokkanimen kanssa." #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing built-in type name." msgstr "" "Ei saa mennä päällekkäin olemassa olevan sisäänrakennetun tyypin nimen " @@ -1513,6 +1533,7 @@ msgstr "Mallitiedostoa ei löytynyt:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"32-bittisissä vienneissä sisällytetty PCK ei voi olla suurempi kuin 4 Gt." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1539,9 +1560,8 @@ msgid "Node Dock" msgstr "Solmutelakka" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "FileSystem and Import Docks" -msgstr "Tiedostojärjestelmätelakka" +msgstr "Tiedostojärjestelmä- ja tuontitelakat" #: editor/editor_feature_profile.cpp msgid "Erase profile '%s'? (no undo)" @@ -1594,7 +1614,6 @@ msgid "File '%s' format is invalid, import aborted." msgstr "Tiedoston '%s' tiedostomuoto on virheellinen, tuonti keskeytetty." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." @@ -1611,9 +1630,8 @@ msgid "Unset" msgstr "Poista asetus" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Current Profile:" -msgstr "Nykyinen profiili" +msgstr "Nykyinen profiili:" #: editor/editor_feature_profile.cpp msgid "Make Current" @@ -1635,9 +1653,8 @@ msgid "Export" msgstr "Vie" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Available Profiles:" -msgstr "Saatavilla olevat profiilit" +msgstr "Saatavilla olevat profiilit:" #: editor/editor_feature_profile.cpp msgid "Class Options" @@ -1692,7 +1709,7 @@ msgstr "Näytä tiedostonhallinnassa" msgid "New Folder..." msgstr "Uusi kansio..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Päivitä" @@ -1743,7 +1760,7 @@ msgstr "Mene eteenpäin" msgid "Go Up" msgstr "Mene ylös" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Näytä piilotiedostot" @@ -1768,23 +1785,31 @@ msgid "Move Favorite Down" msgstr "Siirrä suosikkia alas" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Edellinen kansio" +#, fuzzy +msgid "Go to previous folder." +msgstr "Siirry yläkansioon." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Seuraava kansio" +#, fuzzy +msgid "Go to next folder." +msgstr "Siirry yläkansioon." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Siirry yläkansioon." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Etsi tiedostoista" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Kansio suosikkeihin." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Aseta piilotiedostojen näyttäminen." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2506,6 +2531,10 @@ msgid "Go to previously opened scene." msgstr "Mene aiemmin avattuun skeneen." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Kopioi teksti" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Seuraava välilehti" @@ -2707,32 +2736,20 @@ msgid "Editor Layout" msgstr "Editorin ulkoasu" #: editor/editor_node.cpp -#, fuzzy msgid "Take Screenshot" -msgstr "Tee skenen juuri" +msgstr "Ota kuvakaappaus" #: editor/editor_node.cpp -#, fuzzy msgid "Screenshots are stored in the Editor Data/Settings Folder." -msgstr "Avaa editorin data/asetuskansio" - -#: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Avaa seuraava editori" +msgstr "Kuvakaappaukset tallennetaan editorin data/asetuskansioon." #: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Siirry koko näytön tilaan" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle System Console" -msgstr "Aseta CanvasItem näkyvyys päälle/pois" +msgstr "Aseta järjestelmäkonsolin näkyvyys päälle/pois" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -2841,19 +2858,16 @@ msgid "Spins when the editor window redraws." msgstr "Pyörii kun editorin ikkuna päivittyy." #: editor/editor_node.cpp -#, fuzzy msgid "Update Continuously" -msgstr "Jatkuva" +msgstr "Päivitä jatkuvasti" #: editor/editor_node.cpp -#, fuzzy msgid "Update When Changed" -msgstr "Päivitä muutokset" +msgstr "Päivitä kun muuttuu" #: editor/editor_node.cpp -#, fuzzy msgid "Hide Update Spinner" -msgstr "Poista päivitysanimaatio" +msgstr "Piilota päivitysanimaatio" #: editor/editor_node.cpp msgid "FileSystem" @@ -3048,6 +3062,11 @@ msgstr "Aika" msgid "Calls" msgstr "Kutsuja" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Muokkaa teemaa" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Päällä" @@ -4717,6 +4736,10 @@ msgid "Idle" msgstr "Toimeton" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "Asenna..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Yritä uudelleen" @@ -4745,7 +4768,6 @@ msgid "Last" msgstr "Viimeinen" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Kaikki" @@ -4759,8 +4781,8 @@ msgid "Sort:" msgstr "Lajittele:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Käänteinen" +msgid "Reverse sorting." +msgstr "Käännä lajittelu." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4841,32 +4863,32 @@ msgid "Rotation Step:" msgstr "Kierron välistys:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "Siirrä pystysuoraa apuviivaa" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "Luo uusi pystysuora apuviiva" +msgid "Create Vertical Guide" +msgstr "Luo pystysuora apuviiva" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "Poista pystysuora apuviiva" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "Siirrä vaakasuoraa apuviivaa" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "Luo uusi vaakasuora apuviiva" +msgid "Create Horizontal Guide" +msgstr "Luo vaakasuora apuviiva" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "Poista vaakasuora apuviiva" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "Luo uudet vaaka- ja pystysuorat apuviivat" +msgid "Create Horizontal and Vertical Guides" +msgstr "Luo vaaka- ja pystysuorat apuviivat" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -5298,9 +5320,8 @@ msgstr "Lataa emissiomaski" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Restart" -msgstr "Käynnistä uudelleen nyt" +msgstr "Käynnistä uudelleen" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5321,7 +5342,7 @@ msgstr "Luotujen pisteiden määrä:" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Emission Mask" -msgstr "Emission maski" +msgstr "Emissiomaski" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5331,7 +5352,7 @@ msgstr "Nappaa pikselistä" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Emission Colors" -msgstr "Emission väri" +msgstr "Emissiovärit" #: editor/plugins/cpu_particles_editor_plugin.cpp msgid "CPUParticles" @@ -6213,18 +6234,16 @@ msgid "Find Next" msgstr "Etsi seuraava" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter scripts" -msgstr "Suodata ominaisuuksia" +msgstr "Suodata skriptejä" #: editor/plugins/script_editor_plugin.cpp msgid "Toggle alphabetical sorting of the method list." msgstr "Käytä metodilistalla aakkosellista järjestystä." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter methods" -msgstr "Suodatustila:" +msgstr "Suodata metodeja" #: editor/plugins/script_editor_plugin.cpp msgid "Sort" @@ -6458,7 +6477,7 @@ msgstr "Syntaksin korostaja" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Mene" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6466,9 +6485,8 @@ msgid "Bookmarks" msgstr "Kirjanmerkit" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Luo pisteitä." +msgstr "Keskeytyskohdat" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6757,9 +6775,15 @@ msgid "Rear" msgstr "Taka" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Kohdista näkymään" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Kohdista valinta näkymään" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Isäntää, jonka alle ilmentymä luodaan, ei ole valittu." @@ -6947,10 +6971,6 @@ msgid "Focus Selection" msgstr "Kohdista valintaan" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Kohdista valinta näkymään" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Valintatyökalu" @@ -7511,14 +7531,6 @@ msgid "Transpose" msgstr "Transponoi" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Peilaa X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Peilaa Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "Poista automaattiruudutus käytöstä" @@ -7895,7 +7907,7 @@ msgstr "Aseta uniformin nimi" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Input Default Port" -msgstr "Aseta syötteen oletusportti" +msgstr "Aseta oletustuloportti" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add Node to Visual Shader" @@ -7914,6 +7926,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Visual Shaderin syötteen tyyppi vaihdettu" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(Vain GLES3)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Kärkipiste" @@ -7970,9 +7986,8 @@ msgid "Dodge operator." msgstr "Värinväistöoperaattori." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "HardLight operator" -msgstr "HardLight-operaattori." +msgstr "Kovavalo-operaattori" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Lighten operator." @@ -7999,64 +8014,109 @@ msgid "Color uniform." msgstr "Väri-uniform." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Palauttaa kahden parametrin %s vertailun totuusarvon." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "Yhtä suuri (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "Suurempi kuin (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "Yhtä suuri tai suurempi kuin (>=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." msgstr "" +"Palauttaa liitetyn vektorin, jos annetut skalaarit ovat yhtä suuria, " +"suurempia tai pienempiä." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "Palauttaa INF ja skalaarin parametrien vertailun totuusarvon." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "Palauttaa NaN- ja skalaariparametrien vertailun totuusarvon." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "Pienempi kuin (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "Yhtä suuri tai pienempi kuin (<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "Erisuuri (!=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" +"Palauttaa liitetyn vektorin, 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." +msgstr "Palauttaa kahden parametrin vertailun totuusarvon." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" +"Palauttaa INF- (tai NaN-) ja skalaariparametrien vertailun totuusarvon." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Boolean constant." -msgstr "Muuta vektorivakiota" +msgstr "Totuusarvovakio." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean uniform." -msgstr "" +msgstr "Totuusarvo-uniform." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for all shader modes." -msgstr "'normal' syöteparametri valosävytintilaan." +msgstr "'%s' syöteparametri kaikille sävytintiloille." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Input parameter." -msgstr "Tartu isäntään" +msgstr "Syöteparametri." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for vertex and fragment shader modes." -msgstr "'custom' syöteparametri kärkipistesävytintilaan." +msgstr "'%s' syöteparametri kärkipiste- ja kuvapistesävytintiloille." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for fragment and light shader modes." -msgstr "'normal' syöteparametri valosävytintilaan." +msgstr "'%s' syöteparametri kuvapiste- ja valosävytintiloille." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for fragment shader mode." -msgstr "'custom' syöteparametri kärkipistesävytintilaan." +msgstr "'%s' syöteparametri kuvapistesävytintilaan." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for light shader mode." -msgstr "'normal' syöteparametri valosävytintilaan." +msgstr "'%s' syöteparametri valosävytintilaan." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for vertex shader mode." -msgstr "'custom' syöteparametri kärkipistesävytintilaan." +msgstr "'%s' syöteparametri kärkipistesävytintilaan." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "'%s' input parameter for vertex and fragment shader mode." -msgstr "'custom' syöteparametri kärkipistesävytintilaan." +msgstr "'%s' syöteparametri kärkipiste- ja kuvapistesävytintilaan." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar function." @@ -8100,23 +8160,23 @@ msgstr "Sqrt2-vakio (1.414214). Kahden neliöjuuri." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the absolute value of the parameter." -msgstr "Palauttaa parametrin absoluuttisen arvon." +msgstr "Palauttaa parametrin itseisarvon." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-cosine of the parameter." msgstr "Palauttaa parametrin arkuskosinin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "(Vain GLES3) Palauttaa parametrin käänteisen hyperbolisen kosinin." +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "Palauttaa parametrin käänteisen hyperbolisen kosinin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." msgstr "Palauttaa parametrin arkussinin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "(Vain GLES3) Palauttaa parametrin käänteisen hyperbolisen sinin." +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "Palauttaa parametrin käänteisen hyperbolisen sinin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." @@ -8127,8 +8187,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Palauttaa parametrien arkustangentin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "(Vain GLES3) Palauttaa parametrin käänteisen hyperbolisen tangentin." +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "Palauttaa parametrin käänteisen hyperbolisen tangentin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8145,8 +8205,8 @@ msgid "Returns the cosine of the parameter." msgstr "Palauttaa parametrin kosinin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "(Vain GLES3) Palauttaa parametrin hyperbolisen kosinin." +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "Palauttaa parametrin hyperbolisen kosinin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." @@ -8217,12 +8277,12 @@ msgid "1.0 / scalar" msgstr "1.0 / skalaari" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "(Vain GLES3) Etsii parametria lähinnä olevan kokonaisluvun." +msgid "Finds the nearest integer to the parameter." +msgstr "Etsii parametria lähinnä olevan kokonaisluvun." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "(Vain GLES3) Etsii parametria lähinnä olevan parillisen kokonaisluvun." +msgid "Finds the nearest even integer to the parameter." +msgstr "Etsii parametria lähinnä olevan parillisen kokonaisluvun." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." @@ -8237,8 +8297,8 @@ msgid "Returns the sine of the parameter." msgstr "Palauttaa parametrin sinin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "(Vain GLES3) Palauttaa parametrin hyperbolisen sinin." +msgid "Returns the hyperbolic sine of the parameter." +msgstr "Palauttaa parametrin hyperbolisen sinin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." @@ -8252,6 +8312,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep-funktio( skalaari(edge0), skalaari(edge1), skalaari(x) ).\n" +"\n" +"Palauttaa 0.0, jos 'x' on pienempi kuin 'edge0', ja 1.0, jos 'x' on suurempi " +"kuin 'edge1'. Muutoin paluuarvo interpoloidaan 0.0 ja 1.0 väliltä Hermiten " +"polynomeilla." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8259,75 +8324,77 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Step function( scalar(edge), scalar(x) ).\n" +"\n" +"Palauttaa 0.0, jos 'x' on pienempi kuin 'edge', ja muuten 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the tangent of the parameter." -msgstr "" +msgstr "Palauttaa parametrin tangentin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "" +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "Palauttaa parametrin hyperbolisen tangentin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "" +msgid "Finds the truncated value of the parameter." +msgstr "Hakee parametrin katkaistun arvon." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." -msgstr "" +msgstr "Lisää skalaarin skalaariin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides scalar by scalar." -msgstr "" +msgstr "Jakaa skalaarin skalaarilla." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies scalar by scalar." -msgstr "" +msgstr "Kertoo skalaarin skalaarilla." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two scalars." -msgstr "" +msgstr "Palauttaa kahden skalaarin jäännöksen." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts scalar from scalar." -msgstr "" +msgstr "Vähentää skalaarin skalaarista." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar constant." -msgstr "Muuta skalaarivakiota" +msgstr "Skalaarivakio." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar uniform." -msgstr "Muuta skalaariuniformia" +msgstr "Skalaariuniformi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the cubic texture lookup." -msgstr "" +msgstr "Suorittaa kuutiollisen tekstuurin haun." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the texture lookup." -msgstr "" +msgstr "Suorittaa tekstuurin haun." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "Cubic texture uniform." -msgstr "Muuta tekstuuriuniformia" +msgid "Cubic texture uniform lookup." +msgstr "Kuutiollisen tekstuuriuniformin haku." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "2D texture uniform." -msgstr "Muuta tekstuuriuniformia" +msgid "2D texture uniform lookup." +msgstr "2D-tekstuuriuniformin haku." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." +msgstr "2D-tekstuuriuniformin haku kolmitasolla." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform function." -msgstr "Muunnosikkuna..." +msgstr "Muunnosfunktio." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8335,112 +8402,121 @@ 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 "" +"Laskee vektoriparin ulkotulon.\n" +"\n" +"Ulkotulo ottaa ensimmäisen parametrin 'c' sarakevektorina (matriisi, jolla " +"on yksi sarake) ja toisen parametrin 'r' rivivektorina (matriisi, jolla on " +"yksi rivi) ja suorittaa lineaarialgebrallisen matriisitulon 'c * r', antaen " +"tulokseksi matriisin, jolla on 'c' vektorin komponenttien verran rivejä ja " +"'r' vektorin komponenttien verran sarakkeita." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes transform from four vectors." -msgstr "" +msgstr "Muodostaa muunnoksen neljästä vektorista." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes transform to four vectors." -msgstr "" +msgstr "Hajoittaa muunnoksen neljään vektoriin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "" +msgid "Calculates the determinant of a transform." +msgstr "Laskee muunnoksen determinantin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "" +msgid "Calculates the inverse of a transform." +msgstr "Laskee muunnoksen käänteismatriisin." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "" +msgid "Calculates the transpose of a transform." +msgstr "Laskee muunnoksen transpoosin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." -msgstr "" +msgstr "Kertoo muunnoksen muunnoksella." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by transform." -msgstr "" +msgstr "Kertoo vektorin muunnoksella." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform constant." -msgstr "Muunnos keskeytetty." +msgstr "Muunnosvakio." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform uniform." -msgstr "Muunnos keskeytetty." +msgstr "Muunnosuniformi." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector function." -msgstr "Sijoitus funktiolle." +msgstr "Vektorifunktio." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector operator." -msgstr "Muuta vektorioperaattoria" +msgstr "Vektorioperaattori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes vector from three scalars." -msgstr "" +msgstr "Koostaa vektorin kolmesta skalaarista." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes vector to three scalars." -msgstr "" +msgstr "Purkaa vektorin kolmeksi skalaariksi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the cross product of two vectors." -msgstr "" +msgstr "Laskee kahden vektorin ristitulon." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the distance between two points." -msgstr "" +msgstr "Palauttaa kahden pisteen välisen etäisyyden." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the dot product of two vectors." -msgstr "" +msgstr "Laskee kahden vektorin pistetulon." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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 "" +"Palauttaa vektorin, joka osoittaa samaan suuntaan kuin viitevektori. Funktio " +"ottaa kolme vektoriparametria: N eli suunnattava vektori, I eli tulovektori, " +"ja Nref eli viitevektori. Jos I ja Nref pistetulo on pienempi kuin nolla, " +"paluuarvo on N. Muutoin palautetaan -N." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." -msgstr "" +msgstr "Laskee vektorin pituuden." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two vectors." -msgstr "" +msgstr "Kahden vektorin välinen lineaari-interpolaatio." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the normalize product of vector." -msgstr "" +msgstr "Laskee ja palauttaa vektorin normaalin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - vector" -msgstr "" +msgstr "1.0 - vektori" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / vector" -msgstr "" +msgstr "1.0 / vektori" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" +"Palauttaa vektorin, joka osoittaa heijastuksen suuntaan ( a : tulovektori, " +"b : normaalivektori )." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." -msgstr "" +msgid "Returns the vector that points in the direction of refraction." +msgstr "Palauttaa vektorin, joka osoittaa taittumisen suuntaan." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8450,6 +8526,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep-funktio( vektori(edge0), vektori(edge1), vektori(x) ).\n" +"\n" +"Palauttaa 0.0, jos 'x' on pienempi kuin 'edge0', ja 1.0, jos 'x' on suurempi " +"kuin 'edge1'. Muutoin paluuarvo interpoloidaan 0.0 ja 1.0 väliltä Hermiten " +"polynomeilla." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8459,6 +8540,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep-funktio( skalaari(edge0), skalaari(edge1), vektori(x) ).\n" +"\n" +"Palauttaa 0.0, jos 'x' on pienempi kuin 'edge0', ja 1.0, jos 'x' on suurempi " +"kuin 'edge1'. Muutoin paluuarvo interpoloidaan 0.0 ja 1.0 väliltä Hermiten " +"polynomeilla." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8466,6 +8552,9 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Askelfunktio( vektori(edge), vektori(x) ).\n" +"\n" +"Palauttaa 0.0, jos 'x' on pienempi kuin 'edge', ja muutoin 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8473,36 +8562,37 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Askelfunktio( skalaari(edge), vektori(x) ).\n" +"\n" +"Palauttaa 0.0, jos 'x' on pienempi kuin 'edge', ja muutoin 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds vector to vector." -msgstr "" +msgstr "Lisää vektorin vektoriin." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides vector by vector." -msgstr "" +msgstr "Jakaa vektorin vektorilla." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by vector." -msgstr "" +msgstr "Kertoo vektorin vektorilla." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two vectors." -msgstr "" +msgstr "Palauttaa kahden vektorin jäännöksen." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts vector from vector." -msgstr "" +msgstr "Vähentää vektorin vektorista." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector constant." -msgstr "Muuta vektorivakiota" +msgstr "Vektorivakio." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector uniform." -msgstr "Sijoitus uniformille." +msgstr "Vektoriuniformi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8510,56 +8600,73 @@ 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 "" +"Mukautettu Godot Shader Language lauseke, jolla on haluttu määrä tulo- ja " +"lähtöportteja. Tämä tarkoittaa koodin lisäämistä suoraan vertex/fragment/" +"light funktioiden sisään, älä käytä sitä kirjoittaaksesi funktioesittelyitä." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns falloff based on the dot product of surface normal and view " "direction of camera (pass associated inputs to it)." msgstr "" +"Palauttaa valovähentymän perustuen pinnan normaalivektorin ja kameran " +"suuntavektorin pistetuloon (välitä nämä syötteinä)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "" +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(Vain Fragment/Light tilat) Skalaariderivaattafunktio." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "" +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(Vain Fragment/Light tilat) Vektoriderivaattafunktio." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" +"(Vain Fragment/Light tilat) (Vektori) 'x' derivaatta käyttäen " +"paikallisdifferentiaalia." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" +"(Vain Fragment/Light tilat) (Skalaari) 'x' derivaatta käyttäen " +"paikallisdifferentiaalia." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" +"(Vain Fragment/Light tilat) (Vektori) 'y' derivaatta käyttäen " +"paikallisdifferentiaalia." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" +"(Vain Fragment/Light tilat) (Skalaari) 'y' derivaatta käyttäen " +"paikallisdifferentiaalia." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" +"(Vain Fragment/Light tilat) (Vektori) 'x' ja 'y' derivaattojen itseisarvojen " +"summa." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" +"(Vain Fragment/Light tilat) (Skalaari) 'x' ja 'y' derivaattojen " +"itseisarvojen summa." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -8901,7 +9008,6 @@ msgid "Are you sure to open more than one project?" msgstr "Haluatko varmasti avata useamman kuin yhden projektin?" #: editor/project_manager.cpp -#, fuzzy msgid "" "The following project settings file does not specify the version of Godot " "through which it was created.\n" @@ -8918,12 +9024,11 @@ msgstr "" "\n" "%s\n" "\n" -"Jos haluat jatkaa sen avaamista, se muunnetaan nykyiseen Godotin " +"Jos jatkat sen avaamista, se muunnetaan nykyiseen Godotin " "asetustiedostomuotoon.\n" "Varoitus: et voi avata projektia tämän jälkeen enää vanhemmilla versioilla." #: editor/project_manager.cpp -#, fuzzy msgid "" "The following project settings file was generated by an older engine " "version, and needs to be converted for this version:\n" @@ -8951,7 +9056,6 @@ msgstr "" "yhteensopivia tämän version kanssa." #: editor/project_manager.cpp -#, fuzzy msgid "" "Can't run project: no main scene defined.\n" "Please edit the project and set the main scene in the Project Settings under " @@ -8970,47 +9074,48 @@ msgstr "" "Muokkaa projektia käynnistääksesi uudelleentuonnin." #: editor/project_manager.cpp -#, fuzzy msgid "Are you sure to run %d projects at once?" -msgstr "Haluatko varmasti suorittaa usemman projektin?" +msgstr "Haluatko varmasti suorittaa %d projektia yhdenaikaisesti?" #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove %d projects from the list?\n" "The project folders' contents won't be modified." -msgstr "Poista projekti listalta? (Kansion sisältöä ei muuteta)" +msgstr "" +"Poista %d projektia listalta?\n" +"Projektikansioiden sisältöjä ei muuteta." #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove this project from the list?\n" "The project folder's contents won't be modified." -msgstr "Poista projekti listalta? (Kansion sisältöä ei muuteta)" +msgstr "" +"Poista tämä projekti listalta?\n" +"Projektikansion sisältöä ei muuteta." #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove all missing projects from the list? (Folders contents will not be " "modified)" -msgstr "Poista projekti listalta? (Kansion sisältöä ei muuteta)" +msgstr "" +"Poista kaikki puuttuvat projektit listalta? (Kansioiden sisältöjä ei muuteta)" #: editor/project_manager.cpp -#, fuzzy msgid "" "Language changed.\n" "The interface will update after restarting the editor or project manager." msgstr "" "Kieli vaihdettu.\n" -"Muutokset astuvat voimaan kun editori tai projektinhallinta käynnistetään " +"Käyttöliittymä päivittyy, kun editori tai projektinhallinta käynnistetään " "uudelleen." #: editor/project_manager.cpp -#, fuzzy msgid "" "Are you sure to scan %s folders for existing Godot projects?\n" "This could take a while." -msgstr "Olet aikeissa etsiä hakemistosta %s Godot projekteja. Oletko varma?" +msgstr "" +"Haluatko varmasti etsiä %s kansiosta olemassa olevia Godot-projekteja?\n" +"Tämä saattaa kestää hetken." #: editor/project_manager.cpp msgid "Project Manager" @@ -9033,9 +9138,8 @@ msgid "New Project" msgstr "Uusi projekti" #: editor/project_manager.cpp -#, fuzzy msgid "Remove Missing" -msgstr "Poista piste" +msgstr "Poista puuttuva" #: editor/project_manager.cpp msgid "Templates" @@ -9054,13 +9158,12 @@ msgid "Can't run project" msgstr "Projektia ei voida käynnistää" #: editor/project_manager.cpp -#, fuzzy msgid "" "You currently don't have any projects.\n" "Would you like to explore official example projects in the Asset Library?" msgstr "" "Sinulla ei ole tällä hetkellä yhtään projekteja.\n" -"Haluaisitko selata virallisia malliprojekteja Asset-kirjastosta?" +"Haluaisitko selata virallisia esimerkkiprojekteja Asset-kirjastosta?" #: editor/project_settings_editor.cpp msgid "Key " @@ -9087,9 +9190,8 @@ msgstr "" "'/', ':', '=', '\\' tai '\"'" #: editor/project_settings_editor.cpp -#, fuzzy msgid "An action with the name '%s' already exists." -msgstr "Tapahtuma '%s' on jo olemassa!" +msgstr "Toiminto nimellä '%s' on jo olemassa." #: editor/project_settings_editor.cpp msgid "Rename Input Action Event" @@ -9308,9 +9410,8 @@ msgid "Override For..." msgstr "Ohita alustalle..." #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp -#, fuzzy msgid "The editor must be restarted for changes to take effect." -msgstr "Editori täytyy käynnistää uudelleen, jotta muutokset tulevat voimaan" +msgstr "Editori täytyy käynnistää uudelleen, jotta muutokset tulevat voimaan." #: editor/project_settings_editor.cpp msgid "Input Map" @@ -9369,14 +9470,12 @@ msgid "Locales Filter" msgstr "Kielten suodatus" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show All Locales" -msgstr "Näytä kaikki kielet" +msgstr "Näytä kaikki kielialueet" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show Selected Locales Only" -msgstr "Näytä vain valitut kielet" +msgstr "Näytä vain valitut kielialueet" #: editor/project_settings_editor.cpp msgid "Filter mode:" @@ -9463,7 +9562,6 @@ msgid "Suffix" msgstr "Pääte" #: editor/rename_dialog.cpp -#, fuzzy msgid "Advanced Options" msgstr "Edistyneet asetukset" @@ -9728,9 +9826,8 @@ msgid "User Interface" msgstr "Käyttöliittymä" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Other Node" -msgstr "Poista solmu" +msgstr "Toinen solmu" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" @@ -9773,7 +9870,6 @@ msgid "Clear Inheritance" msgstr "Poista perintä" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Open Documentation" msgstr "Avaa dokumentaatio" @@ -9782,9 +9878,8 @@ msgid "Add Child Node" msgstr "Lisää alisolmu" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Expand/Collapse All" -msgstr "Tiivistä kaikki" +msgstr "Laajenna/tiivistä kaikki" #: editor/scene_tree_dock.cpp msgid "Change Type" @@ -9795,6 +9890,11 @@ msgid "Extend Script" msgstr "Laajenna skriptiä" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Vaihda solmun isäntää" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Tee skenen juuri" @@ -9815,9 +9915,8 @@ msgid "Delete (No Confirm)" msgstr "Poista (ei varmistusta)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Add/Create a New Node." -msgstr "Lisää/Luo uusi solmu" +msgstr "Lisää/Luo uusi solmu." #: editor/scene_tree_dock.cpp msgid "" @@ -9852,19 +9951,16 @@ msgid "Toggle Visible" msgstr "Aseta näkyvyys" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Unlock Node" -msgstr "Valitse solmu" +msgstr "Poista solmun lukitus" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Button Group" -msgstr "Painike 7" +msgstr "Painikeryhmä" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "(Connecting From)" -msgstr "Yhteysvirhe" +msgstr "(Yhdistetään paikasta)" #: editor/scene_tree_editor.cpp msgid "Node configuration warning:" @@ -9895,9 +9991,8 @@ msgstr "" "Napsauta näyttääksesi ryhmätelakan." #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Open Script:" -msgstr "Avaa skripti" +msgstr "Avaa skripti:" #: editor/scene_tree_editor.cpp msgid "" @@ -9948,39 +10043,32 @@ msgid "Select a Node" msgstr "Valitse solmu" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is empty." -msgstr "Polku on tyhjä" +msgstr "Polku on tyhjä." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Filename is empty." -msgstr "Tiedostonimi on tyhjä" +msgstr "Tiedostonimi on tyhjä." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is not local." -msgstr "Polku ei ole paikallinen" +msgstr "Polku ei ole paikallinen." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid base path." -msgstr "Virheellinen kantapolku" +msgstr "Virheellinen kantapolku." #: editor/script_create_dialog.cpp -#, fuzzy msgid "A directory with the same name exists." -msgstr "Samanniminen hakemisto on jo olemassa" +msgstr "Samanniminen hakemisto on jo olemassa." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid extension." -msgstr "Virheellinen laajennus" +msgstr "Virheellinen tiedostopääte." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Wrong extension chosen." -msgstr "Valittu väärä tiedostopääte" +msgstr "Valittu väärä tiedostopääte." #: editor/script_create_dialog.cpp msgid "Error loading template '%s'" @@ -9999,7 +10087,6 @@ msgid "N/A" msgstr "Ei mitään" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Open Script / Choose Location" msgstr "Avaa skripti / Valitse sijainti" @@ -10008,43 +10095,36 @@ msgid "Open Script" msgstr "Avaa skripti" #: editor/script_create_dialog.cpp -#, fuzzy msgid "File exists, it will be reused." -msgstr "Tiedosto on jo olemassa, käytetään uudelleen" +msgstr "Tiedosto on jo olemassa, se käytetään uudelleen." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid class name." -msgstr "Virheellinen luokan nimi" +msgstr "Virheellinen luokan nimi." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid inherited parent name or path." -msgstr "Virheellinen peritty isännän nimi tai polku" +msgstr "Virheellinen peritty isännän nimi tai polku." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script is valid." -msgstr "Skripti kelpaa" +msgstr "Skripti kelpaa." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" -msgstr "Sallittu: a-z, A-Z, 0-9 ja _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." +msgstr "Sallittu: a-z, A-Z, 0-9, _ ja ." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Built-in script (into scene file)." -msgstr "Sisäänrakennettu skripti (skenetiedostoon)" +msgstr "Sisäänrakennettu skripti (skenetiedostoon)." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will create a new script file." -msgstr "Luo uusi skriptitiedosto" +msgstr "Luo uuden skriptitiedoston." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will load an existing script file." -msgstr "Lataa olemassaoleva skriptitiedosto" +msgstr "Lataa olemassaolevan skriptitiedoston." #: editor/script_create_dialog.cpp msgid "Language" @@ -10176,7 +10256,7 @@ msgstr "Aseta puusta" #: editor/script_editor_debugger.cpp msgid "Export measures as CSV" -msgstr "" +msgstr "Vie mittaustulokset CSV-tiedostoon" #: editor/settings_config_dialog.cpp msgid "Erase Shortcut" @@ -10308,12 +10388,11 @@ msgstr "GDNativeLibrary" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Enabled GDNative Singleton" -msgstr "" +msgstr "GDNative singleton on otettu käyttöön" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Disabled GDNative Singleton" -msgstr "Poista päivitysanimaatio" +msgstr "GDNative singleton on poistettu käytöstä" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Library" @@ -10404,9 +10483,8 @@ msgid "GridMap Fill Selection" msgstr "Täytä valinta" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paste Selection" -msgstr "Poista valinta" +msgstr "Liitä valinta" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "GridMap Paint" @@ -10786,9 +10864,8 @@ msgid "Available Nodes:" msgstr "Saatavilla olevat solmut:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Select or create a function to edit its graph." -msgstr "Valitse tai luo funktio graafin muokkaamiseksi" +msgstr "Valitse tai luo funktio graafin muokkaamiseksi." #: modules/visual_script/visual_script_editor.cpp msgid "Delete Selected" @@ -10923,15 +11000,21 @@ msgstr "" #: platform/android/export/export.cpp msgid "Custom build requires a valid Android SDK path in Editor Settings." msgstr "" +"Mukautettu käännös edellyttää kelvollista Android SDK -polkua editorin " +"asetuksissa." #: platform/android/export/export.cpp msgid "Invalid Android SDK path for custom build in Editor Settings." msgstr "" +"Virheellinen Android SDK -polku mukautettu käännöstä varten editorin " +"asetuksissa." #: platform/android/export/export.cpp msgid "" "Android project is not installed for compiling. Install from Editor menu." msgstr "" +"Android-projektia ei ole asennettu kääntämistä varten. Asenna se Editori-" +"valikosta." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -10946,6 +11029,8 @@ msgid "" "Trying to build from a custom built template, but no version info for it " "exists. Please reinstall from the 'Project' menu." msgstr "" +"Yritetään kääntää mukautetulla käännösmallilla, mutta sillä ei ole " +"versiotietoa. Ole hyvä ja uudelleenasenna se 'Projekti'-valikosta." #: platform/android/export/export.cpp msgid "" @@ -10954,20 +11039,27 @@ msgid "" " Godot Version: %s\n" "Please reinstall Android build template from 'Project' menu." msgstr "" +"Androidin käännösversion epäyhteensopivuus:\n" +" Malli asennettu: %s\n" +" Godotin versio: %s\n" +"Ole hyvä ja uudelleenasenna Androidin käännösmalli 'Projekti'-valikosta." #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" -msgstr "" +msgstr "Käännetään Android-projektia (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-projektin käännös epäonnistui, tarkista virhe tulosteesta.\n" +"Vaihtoehtoisesti, lue docs.godotengine.org sivustolta Androidin " +"käännösdokumentaatio." #: platform/android/export/export.cpp msgid "No build apk generated at: " -msgstr "" +msgstr "Käännöksen apk:ta ei generoitu: " #: platform/iphone/export/export.cpp msgid "Identifier is missing." @@ -11085,12 +11177,11 @@ msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "Virheellinen käynnistyskuvan kuvakoko (pitäisi olla 620x300)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." msgstr "" -"SpriteFrames resurssi on luotava tai asetettava 'Frames' ominaisuudelle, " +"SpriteFrames resurssi on luotava tai asetettava \"Frames\" ominaisuudelle, " "jotta AnimatedSprite voi näyttää ruutuja." #: scene/2d/canvas_modulate.cpp @@ -11153,12 +11244,11 @@ msgstr "" "\"Particles Animation\" on kytketty päälle." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." msgstr "" -"Tekstuuri, jolta löytyy valon muoto, täytyy antaa 'texture' ominaisuudella." +"Tekstuuri, jolta löytyy valon muoto, täytyy antaa \"texture\" ominaisuudelle." #: scene/2d/light_occluder_2d.cpp msgid "" @@ -11168,9 +11258,8 @@ msgstr "" "peittopolygoni." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." -msgstr "Tämän peittäjän peittopolygoni on tyhjä. Ole hyvä ja piirrä polygoni!" +msgstr "Tämän peittäjän peittopolygoni on tyhjä. Ole hyvä ja piirrä polygoni." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11258,62 +11347,55 @@ msgstr "" "ja aseta sellainen." #: scene/2d/tile_map.cpp -#, fuzzy msgid "" "TileMap with Use Parent on needs a parent CollisionObject2D to give shapes " "to. Please use it as a child of Area2D, StaticBody2D, RigidBody2D, " "KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionShape2D toimii törmäysmuotona ainoastaan CollisionObject2D solmusta " -"perityille solmuille. Käytä sitä ainoastaan Area2D, StaticBody2D, " -"RigidBody2D, KinematicBody2D, jne. alla antaaksesi niille muodon." +"TileMap, jolla on \"Use Parent on\", tarvitsee CollisionObject2D " +"isäntäsolmun, jolle voi antaa muotoja. Käytä sitä ainoastaan Area2D, " +"StaticBody2D, RigidBody2D, KinematicBody2D, jne. alla antaaksesi niille " +"muodon." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." msgstr "" -"VisibilityEnable2D toimii parhaiten, kun sitä käytetään suoraan muokatun " +"VisibilityEnabler2D toimii parhaiten, kun sitä käytetään suoraan muokatun " "skenen juuren isäntänä." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera solmun isännän täytyy olla ARVROrigin solmu" +msgstr "ARVRCamera solmun isännän täytyy olla ARVROrigin solmu." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRController must have an ARVROrigin node as its parent." -msgstr "ARVRController solmun isännän täytyy olla ARVROrigin solmu" +msgstr "ARVRController solmun isännän täytyy olla ARVROrigin solmu." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "" "The controller ID must not be 0 or this controller won't be bound to an " "actual controller." msgstr "" "Ohjaimen tunnus ei saa olla 0, tai tämä ohjain ei ole sidottu oikeaan " -"ohjaimeen" +"ohjaimeen." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRAnchor must have an ARVROrigin node as its parent." -msgstr "ARVRAnchor solmun isännän täytyy olla ARVROrigin solmu" +msgstr "ARVRAnchor solmun isännän täytyy olla ARVROrigin solmu." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "" "The anchor ID must not be 0 or this anchor won't be bound to an actual " "anchor." msgstr "" "Ankkurin tunnus ei saa olla 0, tai tämä ankkuri ei ole sidottu oikeaan " -"ankkuriin" +"ankkuriin." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVROrigin requires an ARVRCamera child node." -msgstr "ARVROrigin solmu tarvitsee ARVRCamera alisolmun" +msgstr "ARVROrigin solmu tarvitsee ARVRCamera alisolmun." #: scene/3d/baked_lightmap.cpp msgid "%d%%" @@ -11375,13 +11457,12 @@ msgstr "" "KinematicBody, jne. solmujen alla antaaksesi niille muodon." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" "CollisionShape solmulle täytyy antaa muoto, jotta se toimisi. Ole hyvä ja " -"luo sille muotoresurssi!" +"luo sille muotoresurssi." #: scene/3d/collision_shape.cpp msgid "" @@ -11396,13 +11477,12 @@ msgid "Nothing is visible because no mesh has been assigned." msgstr "Mitään ei näy, koska meshiä ei ole asetettu." #: scene/3d/cpu_particles.cpp -#, fuzzy msgid "" "CPUParticles animation requires the usage of a SpatialMaterial whose " "Billboard Mode is set to \"Particle Billboard\"." msgstr "" -"CPUParticles animaatio edellyttää SpatialMaterial käyttöä niin että " -"\"Billboard Particles\" on kytketty päälle." +"CPUParticles animaatio edellyttää SpatialMaterial käyttöä niin, että " +"Billboard Mode tilaksi on asetettu \"Particle Billboard\"." #: scene/3d/gi_probe.cpp msgid "Plotting Meshes" @@ -11419,6 +11499,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." msgstr "" +"SpotLight, jonka kulma on suurempi kuin 90 astetta, ei voi heittää varjoja." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11452,20 +11533,18 @@ msgstr "" "passes)." #: scene/3d/particles.cpp -#, fuzzy msgid "" "Particles animation requires the usage of a SpatialMaterial whose Billboard " "Mode is set to \"Particle Billboard\"." msgstr "" -"Particles animaatio edellyttää SpatialMaterial käyttöä niin että \"Billboard " -"Particles\" on kytketty päälle." +"Particles animaatio edellyttää SpatialMaterial käyttöä niin, että Billboard " +"Mode tilaksi on asetettu \"Particle Billboard\"." #: scene/3d/path.cpp msgid "PathFollow only works when set as a child of a Path node." msgstr "PathFollow toimii ainoastaan ollessaan asetettuna Path solmun alle." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." @@ -11484,16 +11563,16 @@ msgstr "" "Muuta sen sijaan solmun alla olevia törmäysmuotoja." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." -msgstr "Polkuominaisuuden täytyy osoittaa Spatial solmuun toimiakseen." +msgstr "" +"\"Remote Path\" etäpolkuominaisuuden täytyy osoittaa kelvolliseen Spatial " +"tai Spatial-perittyyn solmuun toimiakseen." #: scene/3d/soft_body.cpp -#, fuzzy msgid "This body will be ignored until you set a mesh." -msgstr "Tämä kappale sivuutetaan, kunnes asetat meshin" +msgstr "Tämä kappale sivuutetaan, kunnes asetat meshin." #: scene/3d/soft_body.cpp msgid "" @@ -11505,12 +11584,11 @@ msgstr "" "Muuta kokoa sen sijaan alisolmujen törmäysmuodoissa." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" -"AnimatedSprite3D solmulle täytyy luoda tai asettaa 'Frames' ominaisuudeksi " +"AnimatedSprite3D solmulle täytyy luoda tai asettaa \"Frames\" ominaisuudeksi " "SpriteFrames resurssi ruutujen näyttämiseksi." #: scene/3d/vehicle_body.cpp @@ -11526,6 +11604,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"WorldEnvironment solmun \"Environment\" ominaisuuden tulee sisältää " +"Environment, jotta sillä olisi näkyviä vaikutuksia." #: scene/3d/world_environment.cpp msgid "" @@ -11564,7 +11644,6 @@ msgid "Nothing connected to input '%s' of node '%s'." msgstr "Mitään ei ole yhdistetty syötteeseen '%s' solmussa '%s'." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." msgstr "Graafille ei ole asetettu AnimationNode juurisolmua." @@ -11577,9 +11656,8 @@ msgid "Path set for AnimationPlayer does not lead to an AnimationPlayer node." msgstr "AnimationPlayerille asetettu polku ei johda AnimationPlayer solmuun." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." -msgstr "AnimationPlayer juuri ei ole kelvollinen solmu." +msgstr "AnimationPlayer solmun juurisolmu ei ole kelvollinen." #: scene/animation/animation_tree_player.cpp msgid "This node has been deprecated. Use AnimationTree instead." @@ -11592,12 +11670,11 @@ msgstr "Valitse väri ruudulta." #: scene/gui/color_picker.cpp msgid "HSV" -msgstr "" +msgstr "HSV" #: scene/gui/color_picker.cpp -#, fuzzy msgid "Raw" -msgstr "Käännös (yaw)" +msgstr "Raaka" #: scene/gui/color_picker.cpp msgid "Switch between hexadecimal and code values." @@ -11608,22 +11685,24 @@ msgid "Add current color as a preset." msgstr "Lisää nykyinen väri esiasetukseksi." #: scene/gui/container.cpp -#, fuzzy msgid "" "Container by itself serves no purpose unless a script configures its " "children placement behavior.\n" "If you don't intend to add a script, use a plain Control node instead." msgstr "" -"Säilöllä ei ole itsessään mitään merkitystä ellei jokin skripti säädä sen " +"Säilöllä ei ole itsessään mitään merkitystä, ellei jokin skripti säädä sen " "alisolmujen sijoitustapaa.\n" -"Jos et aio lisätä skriptiä, ole hyvä ja käytä sen sijaan tavallista " -"'Control' solmua." +"Jos et aio lisätä skriptiä, ole hyvä ja käytä sen sijaan tavallista Control " +"solmua." #: scene/gui/control.cpp 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 "" +"Työkaluvihjettä ei näytettä, sillä ohjaimen Mouse Filter asetus on \"Ignore" +"\". Ratkaistaksesi tämän, laita Mouse Filter asetukseksi \"Stop\" tai \"Pass" +"\"." #: scene/gui/dialogs.cpp msgid "Alert!" @@ -11634,31 +11713,28 @@ msgid "Please Confirm..." msgstr "Ole hyvä ja vahvista..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " "running." msgstr "" -"Pop-upit piilotetaan oletusarvoisesti ellet kutsu popup() tai jotain muuta " -"popup*() -funktiota. Ne saadaan näkyville muokatessa, mutta eivät näy " -"suoritettaessa." +"Ponnahdusikkunat piilotetaan oletusarvoisesti ellet kutsu popup()-funktiota " +"tai jotain muuta popup*() -funktiota. Ne saadaan näkyville muokattaessa, " +"mutta eivät näy suoritettaessa." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "Jos exp_edit on tosi, min_value täytyy olla > 0." +msgstr "Jos \"Exp Edit\" on päällä, \"Min Value\" täytyy olla suurempi kuin 0." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " "minimum size manually." msgstr "" -"ScrollContainer on tarkoitettu toimimaan yhdellä lapsikontrollilla.\n" -"Käytä containeria lapsena (VBox, HBox, jne), tai Control:ia ja aseta haluttu " -"minimikoko manuaalisesti." +"ScrollContainer on tarkoitettu toimimaan yhdellä alikontrollilla.\n" +"Käytä alisolmuna jotakin säilöä (VBox, HBox, jne), tai Control solmua ja " +"aseta haluttu minimikoko käsin." #: scene/gui/tree.cpp msgid "(Other)" @@ -11705,14 +11781,17 @@ msgid "Input" msgstr "Syöte" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "Virheellinen lähde sävyttimelle." +msgstr "Virheellinen lähde esikatselulle." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "Virheellinen lähde sävyttimelle." +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "Virheellinen vertailufunktio tälle tyypille." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Sijoitus funktiolle." @@ -11727,7 +11806,28 @@ msgstr "Varying tyypin voi sijoittaa vain vertex-funktiossa." #: servers/visual/shader_language.cpp msgid "Constants cannot be modified." -msgstr "" +msgstr "Vakioita ei voi muokata." + +#~ msgid "Previous Folder" +#~ msgstr "Edellinen kansio" + +#~ msgid "Next Folder" +#~ msgstr "Seuraava kansio" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Avaa kuvakaappaukset automaattisesti" + +#~ msgid "Open in an external image editor." +#~ msgstr "Avaa ulkoisessa kuvankäsittelyohjelmassa." + +#~ msgid "Reverse" +#~ msgstr "Käänteinen" + +#~ msgid "Mirror X" +#~ msgstr "Peilaa X" + +#~ msgid "Mirror Y" +#~ msgstr "Peilaa Y" #~ msgid "Generating solution..." #~ msgstr "Luodaan ratkaisua..." diff --git a/editor/translations/fil.po b/editor/translations/fil.po index 81f6a159a4..c863ce1071 100644 --- a/editor/translations/fil.po +++ b/editor/translations/fil.po @@ -127,6 +127,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1104,7 +1124,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1637,7 +1656,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1688,7 +1707,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1713,23 +1732,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2404,6 +2427,10 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2595,14 +2622,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2916,6 +2935,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4538,6 +4561,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4566,7 +4593,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4580,7 +4606,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4655,31 +4681,32 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Ilipat Ang Mga Bezier Points" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6538,7 +6565,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6723,10 +6754,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7287,14 +7314,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7673,6 +7692,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7757,6 +7780,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7764,10 +7803,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7856,7 +7929,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7864,7 +7937,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7876,7 +7949,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7893,7 +7966,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7962,11 +8035,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7982,7 +8055,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8010,11 +8083,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8054,11 +8127,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8067,7 +8144,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8085,15 +8162,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8143,7 +8220,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8171,12 +8248,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8253,47 +8330,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9444,6 +9521,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9646,7 +9727,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11165,6 +11246,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/fr.po b/editor/translations/fr.po index 587a8b078a..d5798892a5 100644 --- a/editor/translations/fr.po +++ b/editor/translations/fr.po @@ -56,12 +56,15 @@ # Peter Kent <0.peter.kent@gmail.com>, 2019. # jef dered <themen098s@vivaldi.net>, 2019. # Patrick Zoch Alves <patrickzochalves@gmail.com>, 2019. +# Alexis Comte <comtealexis@gmail.com>, 2019. +# Julian Murgia <the.straton@gmail.com>, 2019. +# Ducoté <Raphalielle@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-02 10:50+0000\n" -"Last-Translator: Chenebel Dorian <LoubiTek54@gmail.com>\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" +"Last-Translator: Hugo Locurcio <hugo.locurcio@hugo.pro>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot/fr/>\n" "Language: fr\n" @@ -181,6 +184,31 @@ msgid "Anim Change Call" msgstr "Changer l'appel de l'animation" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Modifier le temps de l'image-clé" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Changer la transition de l'animation" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Changer la transformation de l'animation" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Changer la valeur de l'image-clé de l'animation" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Changer l'appel de l'animation" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Modifier la longueur de l'animation" @@ -509,9 +537,8 @@ msgid "Select All" msgstr "Tout sélectionner" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select None" -msgstr "Sélectionner un nÅ“ud" +msgstr "Tout désélectionner" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -691,7 +718,7 @@ msgstr "Numéro de ligne :" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "%d correspondance(s) trouvée(s)" #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -1157,7 +1184,7 @@ msgstr "Licence" #: editor/editor_about.cpp msgid "Thirdparty License" -msgstr "Licence tierce partie" +msgstr "Licences tierce partie" #: editor/editor_about.cpp msgid "" @@ -1201,7 +1228,6 @@ msgid "Success!" msgstr "Succès !" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Installer" @@ -1574,7 +1600,7 @@ msgstr "Fichier modèle introuvable :" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." -msgstr "" +msgstr "Le PCK inclus dans un export 32-bits ne peut dépasser 4 Go." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1659,6 +1685,8 @@ msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." msgstr "" +"Le profil '%s' existe déjà . Veuillez le supprimer avant d'importer. Import " +"interrompu." #: editor/editor_feature_profile.cpp msgid "Error saving profile to path: '%s'." @@ -1752,7 +1780,7 @@ msgstr "Montrer dans le gestionnaire de fichiers" msgid "New Folder..." msgstr "Nouveau dossier..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Rafraîchir" @@ -1803,7 +1831,7 @@ msgstr "Avancer" msgid "Go Up" msgstr "Monter" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Basculer les fichiers cachés" @@ -1828,23 +1856,31 @@ msgid "Move Favorite Down" msgstr "Déplacer le favori vers le bas" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Dossier précédent" +#, fuzzy +msgid "Go to previous folder." +msgstr "Aller au dossier parent." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Dossier suivant" +#, fuzzy +msgid "Go to next folder." +msgstr "Aller au dossier parent." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Aller au dossier parent." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Rechercher des fichiers" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Ajouter ou supprimer des favoris le dossier courant." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Activer / désactiver la visibilité des fichiers cachés." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2012,7 +2048,7 @@ msgstr "" #: editor/editor_help_search.cpp editor/editor_node.cpp #: editor/plugins/script_editor_plugin.cpp msgid "Search Help" -msgstr "Chercher dans l'aide" +msgstr "Rechercher dans l'aide" #: editor/editor_help_search.cpp msgid "Display All" @@ -2540,8 +2576,9 @@ msgid "Close Other Tabs" msgstr "Fermer les autres onglets" #: editor/editor_node.cpp +#, fuzzy msgid "Close Tabs to the Right" -msgstr "" +msgstr "Fermer la fenêtre à droite" #: editor/editor_node.cpp msgid "Close All Tabs" @@ -2588,6 +2625,11 @@ msgid "Go to previously opened scene." msgstr "Aller à la scène ouverte précédemment." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Copier le chemin" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Onglet suivant" @@ -2679,7 +2721,7 @@ msgstr "Ouvrir le dossier de données du projets" #: editor/editor_node.cpp msgid "Install Android Build Template" -msgstr "" +msgstr "Installer un modèle de compilation Android" #: editor/editor_node.cpp msgid "Quit to Project List" @@ -2792,9 +2834,8 @@ msgid "Editor Layout" msgstr "Disposition de l'éditeur" #: editor/editor_node.cpp -#, fuzzy msgid "Take Screenshot" -msgstr "Choisir comme racine de scène" +msgstr "Prendre une capture d'écran" #: editor/editor_node.cpp #, fuzzy @@ -2802,15 +2843,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Ouvrir le dossier de données/paramètres de l'éditeur" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Ouvrir l'éditeur suivant" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Activer/Désactiver le plein écran" @@ -2858,7 +2890,7 @@ msgstr "Documentation en ligne" #: editor/editor_node.cpp msgid "Q&A" -msgstr "Q & R" +msgstr "Questions et réponses" #: editor/editor_node.cpp msgid "Issue Tracker" @@ -2967,6 +2999,8 @@ msgstr "Ne pas enregistrer" #: editor/editor_node.cpp msgid "Android build template is missing, please install relevant templates." msgstr "" +"Le modèle de compilation Android est manquant, veuillez installer les " +"modèles appropriés." #: editor/editor_node.cpp msgid "Manage Templates" @@ -2977,6 +3011,9 @@ msgid "" "This will install the Android project for custom builds.\n" "Note that, in order to use it, it needs to be enabled per export preset." msgstr "" +"Ceci va installer le projet Android pour des compilations personnalisées.\n" +"Notez que pour l'utiliser, vous devez l'activer pour chaque préréglage " +"d'exportation." #: editor/editor_node.cpp msgid "" @@ -3127,6 +3164,11 @@ msgstr "Temps" msgid "Calls" msgstr "Appels" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Modifier le thème" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Activé" @@ -4807,6 +4849,11 @@ msgid "Idle" msgstr "Inactif" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Installer" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Réessayer" @@ -4835,7 +4882,6 @@ msgid "Last" msgstr "Dernier" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Tout" @@ -4849,8 +4895,9 @@ msgid "Sort:" msgstr "Trier :" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Inverser" +#, fuzzy +msgid "Reverse sorting." +msgstr "Envoi d'une requête..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4871,7 +4918,7 @@ msgstr "Officiel" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Testing" -msgstr "Tester" +msgstr "En période de test" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Assets ZIP File" @@ -4932,31 +4979,38 @@ msgid "Rotation Step:" msgstr "Pas de la rotation :" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Déplacer le guide vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Créer un nouveau guide vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Supprimer le guide vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Déplacer le guide horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Créer un nouveau guide horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Supprimer le guide horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Créer de nouveaux guides horizontaux et verticaux" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6447,7 +6501,7 @@ msgstr "Aider à améliorer la documentation de Godot en donnant vos réactions. #: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." -msgstr "Chercher dans la documentation de référence." +msgstr "Rechercher dans la documentation de référence." #: editor/plugins/script_editor_plugin.cpp msgid "Go to previous edited document." @@ -6858,9 +6912,15 @@ msgid "Rear" msgstr "Arrière" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Aligner avec la vue" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Aligner la sélection avec la vue" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Pas de parent dans lequel instancier l'enfant." @@ -7051,10 +7111,6 @@ msgid "Focus Selection" msgstr "Focaliser la sélection" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Aligner la sélection avec la vue" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Outil sélection" @@ -7624,14 +7680,6 @@ msgid "Transpose" msgstr "Transposer" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Miroir X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Miroir Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8040,6 +8088,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Type d’entrée Visual Shader changée" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vertex" @@ -8131,6 +8183,22 @@ msgid "Color uniform." msgstr "Supprimer la transformation" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8138,10 +8206,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8233,7 +8335,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8241,7 +8343,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8253,7 +8355,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8270,7 +8372,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8339,11 +8441,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8359,7 +8461,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8387,11 +8489,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8432,11 +8534,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8446,7 +8552,7 @@ msgstr "Dialogue de transformation…" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8464,15 +8570,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8524,7 +8630,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8552,12 +8658,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8635,47 +8741,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9121,7 +9227,6 @@ msgstr "" "Supprimer le projet de la liste ? (Le contenu du dossier ne sera pas modifié)" #: editor/project_manager.cpp -#, fuzzy msgid "" "Language changed.\n" "The interface will update after restarting the editor or project manager." @@ -9160,9 +9265,8 @@ msgid "New Project" msgstr "Nouveau projet" #: editor/project_manager.cpp -#, fuzzy msgid "Remove Missing" -msgstr "Supprimer point" +msgstr "Nettoyer la liste" #: editor/project_manager.cpp msgid "Templates" @@ -9496,14 +9600,12 @@ msgid "Locales Filter" msgstr "Filtre de langues" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show All Locales" -msgstr "Montrer toutes les langues" +msgstr "Afficher toutes les langues" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show Selected Locales Only" -msgstr "Montrer uniquement les langues sélectionnées" +msgstr "Afficher uniquement les langues sélectionnées" #: editor/project_settings_editor.cpp msgid "Filter mode:" @@ -9921,6 +10023,11 @@ msgid "Extend Script" msgstr "Hériter d'un script" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Re-parenter le nÅ“ud" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Choisir comme racine de scène" @@ -10155,7 +10262,8 @@ msgid "Script is valid." msgstr "Script valide" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "Autorisé : a-z, A-Z, 0-9 et _" #: editor/script_create_dialog.cpp @@ -11069,6 +11177,8 @@ msgstr "" msgid "" "Android project is not installed for compiling. Install from Editor menu." msgstr "" +"Le projet Android n'est pas installé et ne peut donc pas être compilé. " +"Installez-le depuis le menu Éditeur." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11880,6 +11990,11 @@ msgstr "Source invalide pour la forme." msgid "Invalid source for shader." msgstr "Source invalide pour la forme." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Source invalide pour la forme." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Affectation à la fonction." @@ -11896,6 +12011,25 @@ msgstr "Les variations ne peuvent être affectées que dans la fonction vertex." msgid "Constants cannot be modified." msgstr "" +#~ msgid "Previous Folder" +#~ msgstr "Dossier précédent" + +#~ msgid "Next Folder" +#~ msgstr "Dossier suivant" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Ouvrir l'éditeur suivant" + +#~ msgid "Reverse" +#~ msgstr "Inverser" + +#~ msgid "Mirror X" +#~ msgstr "Miroir X" + +#~ msgid "Mirror Y" +#~ msgstr "Miroir Y" + #~ msgid "Generating solution..." #~ msgstr "Génération de la solution en cours..." diff --git a/editor/translations/he.po b/editor/translations/he.po index eadb7cad94..e5c3c37588 100644 --- a/editor/translations/he.po +++ b/editor/translations/he.po @@ -142,6 +142,31 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "×©×™× ×•×™ זמן פריי×-מפתח ×× ×™×ž×¦×™×”" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "×©×™× ×•×™ ×ž×™×§×•× ×× ×™×ž×¦×™×”" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "×©×™× ×•×™ ×ž×™×§×•× ×× ×™×ž×¦×™×”" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "×©×™× ×•×™ ערך ×§×™×¤×¨×™×™× ×× ×™×ž×¦×™×”" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "×©×™× ×•×™ ×ž×™×§×•× ×× ×™×ž×¦×™×”" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "×©× ×” ×ורך ×× ×™×ž×¦×™×”" @@ -1168,7 +1193,6 @@ msgid "Success!" msgstr "הצלחה!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "×”×ª×§× ×”" @@ -1734,7 +1758,7 @@ msgstr "הצגה ×‘×ž× ×”×œ הקבצי×" msgid "New Folder..." msgstr "תיקייה חדשה…" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "×¨×¢× ×•×Ÿ" @@ -1785,7 +1809,7 @@ msgstr "התקדמות קדימה" msgid "Go Up" msgstr "עלייה למעלה" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "החלפת מצב תצוגה ×œ×§×‘×¦×™× ×ž×•×¡×ª×¨×™×" @@ -1811,27 +1835,32 @@ msgstr "העברת מועדף למטה" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "המישור הקוד×" +msgid "Go to previous folder." +msgstr "מעבר לתיקייה שמעל" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "יצירת תיקייה" +msgid "Go to next folder." +msgstr "מעבר לתיקייה שמעל" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "מעבר לתיקייה שמעל" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "חיפוש במחלקות" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "×œ× × ×™×ª×Ÿ ליצור תיקייה." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "החלפת מצב תצוגה ×œ×§×‘×¦×™× ×ž×•×¡×ª×¨×™×" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2539,6 +2568,11 @@ msgid "Go to previously opened scene." msgstr "מעבר ×œ×¡×¦× ×” ×©× ×¤×ª×—×” ×§×•×“× ×œ×›×Ÿ." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "העתקת × ×ª×™×‘" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "×”×œ×©×•× ×™×ª הב××”" @@ -2736,15 +2770,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "הגדרות עורך" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "פתיחת העורך הב×" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "×›× ×™×¡×” ×ל/יצי××” ממסך מל×" @@ -3070,6 +3095,11 @@ msgstr "זמן" msgid "Calls" msgstr "קרי×ות" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "חברי×" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4781,6 +4811,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "×”×ª×§× ×”" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4810,7 +4845,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4824,8 +4858,9 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "" +#, fuzzy +msgid "Reverse sorting." +msgstr "מוגשת בקשה…" #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4899,31 +4934,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "יצירת תיקייה" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "הסרת מפתחות שגויי×" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "יצירת תיקייה" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "הסרת מפתחות שגויי×" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6871,7 +6910,12 @@ msgstr "×חורי" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" +msgstr "יישור ×¢× ×”×ª×¦×•×’×”" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" msgstr "יישור ×¢× ×”×ª×¦×•×’×”" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7062,10 +7106,6 @@ msgid "Focus Selection" msgstr "בחירת מיקוד" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7651,14 +7691,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8084,6 +8116,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Vertex" msgstr "קודקודי×" @@ -8174,6 +8210,22 @@ msgid "Color uniform." msgstr "התמרה" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8181,10 +8233,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8274,7 +8360,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8282,7 +8368,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8294,7 +8380,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8311,7 +8397,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8380,11 +8466,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8400,7 +8486,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8428,11 +8514,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8473,11 +8559,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8487,7 +8577,7 @@ msgstr "התמרה" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8505,15 +8595,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8565,7 +8655,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8593,12 +8683,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8675,47 +8765,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9909,6 +9999,11 @@ msgstr "הרצת סקריפט" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "יצירת %s חדש" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "שמירת ×¡×¦× ×”" @@ -10127,7 +10222,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11676,6 +11771,11 @@ msgstr "גודל הגופן שגוי." msgid "Invalid source for shader." msgstr "גודל הגופן שגוי." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "גודל הגופן שגוי." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11692,6 +11792,18 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "המישור הקוד×" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "יצירת תיקייה" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "פתיחת העורך הב×" + #~ msgid "Generating solution..." #~ msgstr "הפתרון × ×•×¦×¨â€¦" diff --git a/editor/translations/hi.po b/editor/translations/hi.po index 7fa0ae91a0..8a8a3c28a5 100644 --- a/editor/translations/hi.po +++ b/editor/translations/hi.po @@ -136,6 +136,31 @@ msgstr "à¤à¤¨à¥€à¤®à¥‡à¤¶à¤¨ परिवरà¥à¤¤à¤¨ बà¥à¤²à¤¾à¤µà¤¾" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "à¤à¤¨à¥€à¤®à¥‡à¤¶à¤¨ परिवरà¥à¤¤à¤¨ निधि" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "à¤à¤¨à¥€à¤®à¥‡à¤¶à¤¨ परिवरà¥à¤¤à¤¨ बà¥à¤²à¤¾à¤µà¤¾" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "à¤à¤¨à¥€à¤®à¥‡à¤¶à¤¨ परिवरà¥à¤¤à¤¨ परिणत" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "à¤à¤¨à¥€à¤®à¥‡à¤¶à¤¨ मà¥à¤–à¥à¤¯-फ़à¥à¤°à¥‡à¤® मूलà¥à¤¯(Value) बदलें" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "à¤à¤¨à¥€à¤®à¥‡à¤¶à¤¨ परिवरà¥à¤¤à¤¨ बà¥à¤²à¤¾à¤µà¤¾" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "शबà¥à¤¦ बदलें मूलà¥à¤¯" @@ -1175,7 +1200,6 @@ msgid "Success!" msgstr "सफलता!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "इंसà¥à¤Ÿà¥‰à¤²" @@ -1721,7 +1745,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1772,7 +1796,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1797,23 +1821,28 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "खोज कर:" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2499,6 +2528,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "सà¤à¥€ खंड" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2691,14 +2725,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -3011,6 +3037,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "परिवरà¥à¤¤à¤¨ वकà¥à¤° चयन" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4673,6 +4704,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "इंसà¥à¤Ÿà¥‰à¤²" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4701,7 +4737,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4715,7 +4750,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4790,31 +4825,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "à¤à¤• नया बनाà¤à¤‚" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "मिटाना" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "à¤à¤• नया बनाà¤à¤‚" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "मिटाना" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6701,7 +6740,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6886,10 +6929,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7464,14 +7503,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7875,6 +7906,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7962,6 +7997,22 @@ msgid "Color uniform." msgstr "à¤à¤¨à¥€à¤®à¥‡à¤¶à¤¨ परिवरà¥à¤¤à¤¨ परिणत" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7969,10 +8020,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8061,7 +8146,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8069,7 +8154,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8081,7 +8166,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8098,7 +8183,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8167,11 +8252,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8187,7 +8272,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8215,11 +8300,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8260,11 +8345,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8274,7 +8363,7 @@ msgstr "सदसà¥à¤¯à¤¤à¤¾ बनाà¤à¤‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8292,15 +8381,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8352,7 +8441,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8380,12 +8469,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8462,47 +8551,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9663,6 +9752,11 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "à¤à¤• नया बनाà¤à¤‚" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9871,7 +9965,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11403,6 +11497,11 @@ msgstr "गलत फॉणà¥à¤Ÿ का आकार |" msgid "Invalid source for shader." msgstr "गलत फॉणà¥à¤Ÿ का आकार |" +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "गलत फॉणà¥à¤Ÿ का आकार |" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/hr.po b/editor/translations/hr.po index 4f05208f9b..606f7b021f 100644 --- a/editor/translations/hr.po +++ b/editor/translations/hr.po @@ -127,6 +127,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1108,7 +1128,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1641,7 +1660,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1692,7 +1711,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1717,23 +1736,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2408,6 +2431,10 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2599,14 +2626,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2920,6 +2939,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4542,6 +4565,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4570,7 +4597,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4584,7 +4610,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4659,31 +4685,32 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Pomakni Bezier ToÄke" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6544,7 +6571,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6729,10 +6760,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7293,14 +7320,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7682,6 +7701,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7766,6 +7789,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7773,10 +7812,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7865,7 +7938,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7873,7 +7946,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7885,7 +7958,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7902,7 +7975,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7971,11 +8044,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7991,7 +8064,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8019,11 +8092,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8063,11 +8136,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8076,7 +8153,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8094,15 +8171,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8151,7 +8228,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8179,12 +8256,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8261,47 +8338,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9452,6 +9529,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9656,7 +9737,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11175,6 +11256,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/hu.po b/editor/translations/hu.po index a7033084d3..ac339ff977 100644 --- a/editor/translations/hu.po +++ b/editor/translations/hu.po @@ -6,14 +6,15 @@ # Nagy Lajos <neutron9707@gmail.com>, 2017. # Sandor Domokos <sandor.domokos@gmail.com>, 2017-2018. # Varga Dániel <danikah.danikah@gmail.com>, 2016-2018. -# Gabor Csordas <gaborcsordas@yahoo.com>, 2018. +# Gabor Csordas <gaborcsordas@yahoo.com>, 2018, 2019. # Tusa Gamer <tusagamer@mailinator.com>, 2018. +# Máté Lugosi <mate.lugosi@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2018-12-29 12:09+0000\n" -"Last-Translator: Tusa Gamer <tusagamer@mailinator.com>\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" +"Last-Translator: Gabor Csordas <gaborcsordas@yahoo.com>\n" "Language-Team: Hungarian <https://hosted.weblate.org/projects/godot-engine/" "godot/hu/>\n" "Language: hu\n" @@ -21,7 +22,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.4-dev\n" +"X-Generator: Weblate 3.8-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -45,15 +46,15 @@ msgstr "self nem használható, mert a példány null (nincs átadva)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." -msgstr "" +msgstr "Érvénytelen operandus a %s, %s és %s operátorokhoz." #: core/math/expression.cpp msgid "Invalid index of type %s for base type %s" -msgstr "" +msgstr "Érvénytelen %s tÃpusú index a %s alap tÃpushoz." #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" -msgstr "" +msgstr "Érvénytelen nevezett index '%s' %s alaptÃpushoz" #: core/math/expression.cpp #, fuzzy @@ -63,7 +64,7 @@ msgstr "" #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "" +msgstr "'%s' hÃvásánál:" #: editor/animation_bezier_editor.cpp #: editor/plugins/asset_library_editor_plugin.cpp @@ -72,21 +73,19 @@ msgstr "Ingyenes" #: editor/animation_bezier_editor.cpp msgid "Balanced" -msgstr "" +msgstr "Kiegyensúlyozott" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Mirror" -msgstr "Hiba!" +msgstr "Tükör" #: editor/animation_bezier_editor.cpp editor/editor_profiler.cpp msgid "Time:" msgstr "IdÅ‘:" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Value:" -msgstr "Új név:" +msgstr "Érték:" #: editor/animation_bezier_editor.cpp #, fuzzy @@ -94,24 +93,20 @@ msgid "Insert Key Here" msgstr "Kulcs Beszúrása" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Duplicate Selected Key(s)" -msgstr "Kiválasztás megkettÅ‘zés" +msgstr "Kiválasztott elem(ek) megkettÅ‘zése" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Delete Selected Key(s)" -msgstr "Törli a kiválasztott fájlokat?" +msgstr "Kiválasztott kulcsok törlése" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Pont hozzáadása" +msgstr "Bezier pont hozzáadása" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Pont Mozgatása" +msgstr "Bezier pont Mozgatása" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -119,7 +114,7 @@ msgstr "Animáció kulcsok megkettÅ‘zése" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Delete Keys" -msgstr "Animáció kulcs törlés" +msgstr "Animáció kulcs törlése" #: editor/animation_track_editor.cpp msgid "Anim Change Keyframe Time" @@ -143,17 +138,43 @@ msgstr "Animáció hÃvás változtatás" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Animáció kulcsképkocka idÅ‘ változtatás" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animáció átmenet változtatása" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animáció transzformáció változtatás" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Animáció kulcsképkocka érték változtatás" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animáció hÃvás változtatás" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "Animáció Nevének Megváltoztatása:" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "" +msgstr "Animációs ciklus változtatása" #: editor/animation_track_editor.cpp +#, fuzzy msgid "Property Track" -msgstr "" +msgstr "Tulajdonság Követés" #: editor/animation_track_editor.cpp #, fuzzy @@ -178,14 +199,12 @@ msgid "Animation Playback Track" msgstr "Animáció lejátszásának leállÃtása. (S)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (frames)" -msgstr "Animáció hossza (másodpercben)." +msgstr "Animáció hossza (képkockákban)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (seconds)" -msgstr "Animáció hossza (másodpercben)." +msgstr "Animáció hossza (másodpercben)" #: editor/animation_track_editor.cpp #, fuzzy @@ -200,7 +219,7 @@ msgstr "Animáció nagyÃtás." #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Functions:" -msgstr "" +msgstr "Funkciók:" #: editor/animation_track_editor.cpp msgid "Audio Clips:" @@ -225,9 +244,8 @@ msgid "Update Mode (How this property is set)" msgstr "" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Interpolation Mode" -msgstr "Animáció Node" +msgstr "Interpoláció mód" #: editor/animation_track_editor.cpp msgid "Loop Wrap Mode (Interpolate end with beginning on loop)" @@ -1188,7 +1206,6 @@ msgid "Success!" msgstr "Siker!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "TelepÃtés" @@ -1756,7 +1773,7 @@ msgstr "Mutat FájlkezelÅ‘ben" msgid "New Folder..." msgstr "Új Mappa..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "FrissÃtés" @@ -1807,7 +1824,7 @@ msgstr "Ugrás ElÅ‘re" msgid "Go Up" msgstr "Ugrás Fel" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Rejtett Fájlok MegjelenÃtése" @@ -1833,27 +1850,32 @@ msgstr "Kedvenc Lefelé Mozgatása" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "ElÅ‘zÅ‘ SÃk" +msgid "Go to previous folder." +msgstr "Ugrás a szülÅ‘mappába" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Mappa Létrehozása" +msgid "Go to next folder." +msgstr "Ugrás a szülÅ‘mappába" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "Ugrás a szülÅ‘mappába" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Osztályok Keresése" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "Nem sikerült létrehozni a mappát." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Rejtett Fájlok MegjelenÃtése" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2617,6 +2639,11 @@ msgid "Go to previously opened scene." msgstr "Ugrás az elÅ‘zÅ‘leg megnyitott jelenetre." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Útvonal másolása" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "KövetkezÅ‘ fül" @@ -2832,15 +2859,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "SzerkesztÅ‘ BeállÃtások" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "KövetkezÅ‘ SzerkesztÅ‘ Megnyitása" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Teljes KépernyÅ‘" @@ -3167,6 +3185,11 @@ msgstr "IdÅ‘" msgid "Calls" msgstr "HÃvások" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Tagok" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4904,6 +4927,11 @@ msgid "Idle" msgstr "Tétlen" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "TelepÃtés" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Újra" @@ -4934,7 +4962,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Mind" @@ -4948,8 +4975,9 @@ msgid "Sort:" msgstr "Rendezés:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Visszafele" +#, fuzzy +msgid "Reverse sorting." +msgstr "Lekérdezés..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -5032,31 +5060,38 @@ msgid "Rotation Step:" msgstr "Forgatási Léptetés:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "FüggÅ‘leges vezetÅ‘vonal mozgatása" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Új függÅ‘leges vezetÅ‘vonal létrehozása" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "FüggÅ‘leges vezetÅ‘vonal eltávolÃtása" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "VÃzszintes vezetÅ‘vonal mozgatása" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Új vÃzszintes vezetÅ‘vonal létrehozása" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "VÃzszintes vezetÅ‘vonal eltávolÃtása" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Új vÃzszintes és függÅ‘leges vezetÅ‘vonalak létrehozása" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -7036,7 +7071,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7223,10 +7262,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7818,14 +7853,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8259,6 +8286,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8350,6 +8381,22 @@ msgid "Color uniform." msgstr "Animáció transzformáció változtatás" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8357,10 +8404,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." msgstr "Vec állandó változtatás" @@ -8453,7 +8534,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8461,7 +8542,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8473,7 +8554,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8490,7 +8571,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8559,11 +8640,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8579,7 +8660,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8607,11 +8688,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8653,11 +8734,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8667,7 +8752,7 @@ msgstr "Sokszög Létrehozása" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8685,15 +8770,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8746,7 +8831,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8774,12 +8859,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8858,47 +8943,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10090,6 +10175,11 @@ msgstr "Szkript Futtatása" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Új %s Létrehozása" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Scene mentés" @@ -10308,7 +10398,7 @@ msgid "Script is valid." msgstr "Az animációs fa érvényes." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11870,6 +11960,11 @@ msgstr "Érvénytelen betűtÃpus méret." msgid "Invalid source for shader." msgstr "Érvénytelen betűtÃpus méret." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Érvénytelen betűtÃpus méret." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11887,6 +11982,21 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "ElÅ‘zÅ‘ SÃk" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Mappa Létrehozása" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "KövetkezÅ‘ SzerkesztÅ‘ Megnyitása" + +#~ msgid "Reverse" +#~ msgstr "Visszafele" + +#, fuzzy #~ msgid "View log" #~ msgstr "Fájlok Megtekintése" diff --git a/editor/translations/id.po b/editor/translations/id.po index f88fff02e5..7048f501b5 100644 --- a/editor/translations/id.po +++ b/editor/translations/id.po @@ -24,8 +24,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-09 10:47+0000\n" -"Last-Translator: herri siagian <herry.it.2007@gmail.com>\n" +"PO-Revision-Date: 2019-07-19 13:42+0000\n" +"Last-Translator: Sofyan Sugianto <sofyanartem@gmail.com>\n" "Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/" "godot/id/>\n" "Language: id\n" @@ -146,6 +146,31 @@ msgid "Anim Change Call" msgstr "Ubah Panggilan Anim" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Ubah Waktu Keyframe Animasi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Ubah Transisi Animasi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Ubah Transformasi Animasi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Ubah Nilai Keyframe Animasi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Ubah Panggilan Anim" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Ubah Panjang Animasi" @@ -468,9 +493,8 @@ msgid "Select All" msgstr "Pilih Semua" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select None" -msgstr "Metode Publik:" +msgstr "Pilih Tidak Ada" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -648,7 +672,7 @@ msgstr "Nomor Baris:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Ditemukan %d kecocokan." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -805,9 +829,8 @@ msgid "Connect" msgstr "Menghubungkan" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Sinyal-sinyal:" +msgstr "Sinyal:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -972,10 +995,8 @@ msgid "Owners Of:" msgstr "Pemilik Dari:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "" -"Hapus file-file yang dipilih dari proyek? (tidak bisa dibatalkan / undo)" +msgstr "Hapus berkas yang dipilih dari proyek? (tidak bisa dibatalkan)" #: editor/dependency_editor.cpp msgid "" @@ -1157,7 +1178,6 @@ msgid "Success!" msgstr "Sukses!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Pasang" @@ -1345,7 +1365,6 @@ msgid "Must not collide with an existing engine class name." msgstr "Tidak boleh sama dengan nama kelas engine yang sudah ada." #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing built-in type name." msgstr "Tidak boleh sama dengan nama tipe bawaan yang ada." @@ -1498,7 +1517,6 @@ msgstr "" "'Impor Lainnya 2' di Pengaturan Proyek." #: editor/editor_export.cpp -#, fuzzy msgid "" "Target platform requires 'ETC' texture compression for the driver fallback " "to GLES2.\n" @@ -1506,8 +1524,9 @@ msgid "" "Enabled'." msgstr "" "Platform target membutuhkan kompressi tekstur 'ETC' untuk mengembalikan " -"driver ke GLES2. Aktifkan 'Impor Lainnya' di Pengaturan Proyek, atau matikan " -"'Driver Fallback Enabled'." +"driver ke GLES2. \n" +"Aktifkan 'Impor Lainnya' di Pengaturan Proyek, atau matikan 'Driver Fallback " +"Enabled'." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1527,7 +1546,7 @@ msgstr "Templat berkas tidak ditemukan:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." -msgstr "" +msgstr "Pada ekspor 32-bit PCK yang ditanamkan tidak boleh lebih dari 4GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1554,9 +1573,8 @@ msgid "Node Dock" msgstr "Dok Node" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "FileSystem and Import Docks" -msgstr "Dok Berkas Sistem" +msgstr "Dok Impor dan Berkas Sistem" #: editor/editor_feature_profile.cpp msgid "Erase profile '%s'? (no undo)" @@ -1623,9 +1641,8 @@ msgid "Unset" msgstr "Tidak diatur" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Current Profile:" -msgstr "Profil Sekarang" +msgstr "Profil Sekarang:" #: editor/editor_feature_profile.cpp msgid "Make Current" @@ -1647,9 +1664,8 @@ msgid "Export" msgstr "Ekspor" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Available Profiles:" -msgstr "Profil yang Tersedia" +msgstr "Profil yang Tersedia:" #: editor/editor_feature_profile.cpp msgid "Class Options" @@ -1704,7 +1720,7 @@ msgstr "Tampilkan di Manajer Berkas" msgid "New Folder..." msgstr "Buat Direktori..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Segarkan" @@ -1755,7 +1771,7 @@ msgstr "Maju" msgid "Go Up" msgstr "Naik" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Beralih File Tersembunyi" @@ -1780,23 +1796,31 @@ msgid "Move Favorite Down" msgstr "Pindahkan Favorit Kebawah" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Direktori Sebelumnya" +#, fuzzy +msgid "Go to previous folder." +msgstr "Pergi ke direktori atasnya." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Folder Berikutnya" +#, fuzzy +msgid "Go to next folder." +msgstr "Pergi ke direktori atasnya." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Pergi ke direktori atasnya." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Cari berkas" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Hapus favorit direktori saat ini." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Beralih visibilitas berkas yang tersembunyi." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2527,6 +2551,11 @@ msgid "Go to previously opened scene." msgstr "Pergi ke skena yang sebelumnya dibuka." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Salin Lokasi" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Tab selanjutnya" @@ -2729,30 +2758,20 @@ msgid "Editor Layout" msgstr "Tata Letak Editor" #: editor/editor_node.cpp -#, fuzzy msgid "Take Screenshot" -msgstr "Jadikan Skena Dasar" +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" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "Buka Screenshoots secara otomatis" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "Buka di pengolah gambar lainnya" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Mode Layar Penuh" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle System Console" -msgstr "Beralih Mode Split" +msgstr "Jungkitkan Konsol Sistem" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -2861,19 +2880,16 @@ msgid "Spins when the editor window redraws." msgstr "Putar ketika jendela penyunting digambar ulang." #: editor/editor_node.cpp -#, fuzzy msgid "Update Continuously" -msgstr "Lanjut" +msgstr "Perbarui Terus-menerus" #: editor/editor_node.cpp -#, fuzzy msgid "Update When Changed" -msgstr "Perbarui Perubahan" +msgstr "Perbarui Saat Berubah" #: editor/editor_node.cpp -#, fuzzy msgid "Hide Update Spinner" -msgstr "Nonaktifkan Perbaruan Spinner" +msgstr "Sembunyikan Spinner Pembaruan" #: editor/editor_node.cpp msgid "FileSystem" @@ -3067,6 +3083,11 @@ msgstr "Waktu" msgid "Calls" msgstr "Panggil" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Sunting tema..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Nyala" @@ -3584,9 +3605,8 @@ msgid "Re-Scan Filesystem" msgstr "Pindai Ulang Berkas Sistem" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Toggle Split Mode" -msgstr "Beralih Mode Split" +msgstr "Jungkitkan Mode Split" #: editor/filesystem_dock.cpp msgid "Search files" @@ -3633,7 +3653,6 @@ msgid "Filters:" msgstr "Filter:" #: editor/find_in_files.cpp -#, fuzzy msgid "" "Include the files with the following extensions. Add or remove them in " "ProjectSettings." @@ -3655,59 +3674,49 @@ msgid "Cancel" msgstr "Batal" #: editor/find_in_files.cpp -#, fuzzy msgid "Find: " -msgstr "Cari" +msgstr "Cari: " #: editor/find_in_files.cpp -#, fuzzy msgid "Replace: " -msgstr "Ganti" +msgstr "Ganti: " #: editor/find_in_files.cpp -#, fuzzy msgid "Replace all (no undo)" -msgstr "Ganti Semua" +msgstr "Ganti Semua (tidak bisa dikembalikan)" #: editor/find_in_files.cpp -#, fuzzy msgid "Searching..." -msgstr "Menyimpan..." +msgstr "Mencari..." #: editor/find_in_files.cpp -#, fuzzy msgid "Search complete" -msgstr "Mencari Teks" +msgstr "Pencarian selesai" #: editor/groups_editor.cpp -#, fuzzy msgid "Group name already exists." -msgstr "KESALAHAN: Nama animasi sudah ada!" +msgstr "Nama grup sudah ada." #: editor/groups_editor.cpp -#, fuzzy msgid "Invalid group name." -msgstr "Nama tidak sah." +msgstr "Nama grup tidak valid." #: editor/groups_editor.cpp editor/node_dock.cpp msgid "Groups" msgstr "Kelompok" #: editor/groups_editor.cpp -#, fuzzy msgid "Nodes not in Group" -msgstr "Tambahkan ke Grup" +msgstr "Node tidak dalam Grup" #: editor/groups_editor.cpp editor/scene_tree_dock.cpp #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Filter nodes" -msgstr "Filter:" +msgstr "Saring node" #: editor/groups_editor.cpp -#, fuzzy msgid "Nodes in Group" -msgstr "Tambahkan ke Grup" +msgstr "Node dalam Grup" #: editor/groups_editor.cpp msgid "Add to Group" @@ -3718,9 +3727,8 @@ msgid "Remove from Group" msgstr "Hapus dari Grup" #: editor/groups_editor.cpp -#, fuzzy msgid "Manage Groups" -msgstr "Grup" +msgstr "Kelola Grup" #: editor/import/resource_importer_scene.cpp msgid "Import as Single Scene" @@ -3828,9 +3836,8 @@ msgid "Save scenes, re-import and restart" msgstr "Simpan skena, impor ulang, dan mulai ulang" #: editor/import_dock.cpp -#, fuzzy msgid "Changing the type of an imported file requires editor restart." -msgstr "Mengubah driver video harus memulai ulang editor." +msgstr "Mengubah jenis berkas yang diimpor butuh menyalakan ulang penyunting." #: editor/import_dock.cpp msgid "" @@ -3844,9 +3851,8 @@ msgid "Failed to load resource." msgstr "Gagal memuat resource." #: editor/inspector_dock.cpp -#, fuzzy msgid "Expand All Properties" -msgstr "Perluas semua properti" +msgstr "Perluas Semua Properti" #: editor/inspector_dock.cpp #, fuzzy @@ -3867,9 +3873,8 @@ msgid "Paste Params" msgstr "Tempel Parameter" #: editor/inspector_dock.cpp -#, fuzzy msgid "Edit Resource Clipboard" -msgstr "KESALAHAN: Tidak ada aset animasi di clipboard!" +msgstr "Sunting PapanKlip SumberDaya" #: editor/inspector_dock.cpp msgid "Copy Resource" @@ -3916,9 +3921,8 @@ msgid "Object properties." msgstr "Properti Objek." #: editor/inspector_dock.cpp -#, fuzzy msgid "Filter properties" -msgstr "Filter:" +msgstr "Saring properti" #: editor/inspector_dock.cpp msgid "Changes may be lost!" @@ -3933,19 +3937,16 @@ msgid "Select a Node to edit Signals and Groups." msgstr "Pilih sebuah node untuk menyunting Sinyal dan Grup." #: editor/plugin_config_dialog.cpp -#, fuzzy msgid "Edit a Plugin" -msgstr "Sunting Bidang" +msgstr "Sunting Plugin" #: editor/plugin_config_dialog.cpp -#, fuzzy msgid "Create a Plugin" -msgstr "Buat Subskribsi" +msgstr "Buat Plugin" #: editor/plugin_config_dialog.cpp -#, fuzzy msgid "Plugin Name:" -msgstr "Pengaya" +msgstr "Nama Plugin:" #: editor/plugin_config_dialog.cpp msgid "Subfolder:" @@ -3956,9 +3957,8 @@ msgid "Language:" msgstr "Bahasa:" #: editor/plugin_config_dialog.cpp -#, fuzzy msgid "Script Name:" -msgstr "Nama Projek:" +msgstr "Nama Skrip:" #: editor/plugin_config_dialog.cpp msgid "Activate now?" @@ -3966,53 +3966,45 @@ msgstr "Aktifkan sekarang?" #: editor/plugins/abstract_polygon_2d_editor.cpp #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Create Polygon" -msgstr "Buat Bidang" +msgstr "Buat Poligon" #: editor/plugins/abstract_polygon_2d_editor.cpp #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Create points." -msgstr "Hapus Titik" +msgstr "Buat titik." #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "" "Edit points.\n" "LMB: Move Point\n" "RMB: Erase Point" msgstr "" -"Sunting bidang yang ada:\n" -"LMB: Pindahkan Titik.\n" -"Ctrl+LMB: Pecah Segmen.\n" -"RMB: Hapus Titik." +"Sunting titik.\n" +"LMB: Pindahkan Titik\n" +"RMB: Hapus Titik" #: editor/plugins/abstract_polygon_2d_editor.cpp #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Erase points." -msgstr "Beri Skala Seleksi" +msgstr "Hapus titik." #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "Edit Polygon" -msgstr "Sunting Bidang" +msgstr "Sunting Poligon" #: editor/plugins/abstract_polygon_2d_editor.cpp msgid "Insert Point" msgstr "Tambah Titik" #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "Edit Polygon (Remove Point)" -msgstr "Sunting Bidang (Hapus Titik)" +msgstr "Sunting Poligon (Hapus Titik)" #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "Remove Polygon And Point" -msgstr "Hapus Bidang dan Titik" +msgstr "Hapus Poligon dan Titik" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -4026,25 +4018,21 @@ msgstr "Tambah Animasi" #: 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 "Load..." -msgstr "Muat" +msgstr "Muat..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "Hapus Sinyal" +msgstr "Pindahkan Titik Node" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Ubah Waktu Blend" +msgstr "Ubah Batas BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "Ubah Waktu Blend" +msgstr "Ubah Label BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -4054,20 +4042,17 @@ msgstr "Node tipe ini tidak dapat digunakan. Hanya node utama yang diijinkan." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "Tambahkan Node" +msgstr "Tambah Titik Node" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "Tambah Animasi" +msgstr "Tambah Titik Animasi" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "Hapus Bidang dan Titik" +msgstr "Hapus Titik BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" @@ -4109,39 +4094,32 @@ msgstr "Titik" #: 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" -msgstr "Nama Animasi Baru:" +msgstr "Buka Node Animasi" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Triangle already exists." -msgstr "KESALAHAN: Nama animasi sudah ada!" +msgstr "Segitiga sudah ada." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "Tambahkan Variabel" +msgstr "Tambah Segitiga" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "Ubah Waktu Blend" +msgstr "Ubah Batas BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "Ubah Waktu Blend" +msgstr "Ubah Label BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "Hapus Bidang dan Titik" +msgstr "Hapus Titik BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "Hapus Variabel" +msgstr "Hapus Segitiga BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -4152,9 +4130,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "Tidak ada segi tiga, pembauran tidak di terapkan." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "Beralih AutoLoad Globals" +msgstr "Jungkitkan Segitiga Otomatis" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -4174,30 +4151,26 @@ msgid "Blend:" msgstr "Campur:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Menyimpan perubahan-perubahan lokal..." +msgstr "Parameter Berubah" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "Edit Filters" -msgstr "Sunting Filter" +msgstr "Sunting Penyaring" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Output node can't be added to the blend tree." msgstr "Node keluaran tidak bisa ditambahkan ke pohon campur." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "Tambahkan Node (Node-node) dari Tree" +msgstr "Tambah Node ke BlendTree" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Nama Node:" +msgstr "Node Dipindahkan" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Unable to connect, port may be in use or connection may be invalid." @@ -4206,26 +4179,22 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "Terhubung" +msgstr "Node Terhubung" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Terputus" +msgstr "Node Terputus" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Animasi" +msgstr "Atur Animasi" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Metode Publik:" +msgstr "Hapus Node" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/scene_tree_dock.cpp @@ -4233,14 +4202,12 @@ msgid "Delete Node(s)" msgstr "Hapus Node" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Alihkan track ini ke nyala/mati." +msgstr "Jungkitkan Penyaring Nyala/Mati" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "Ganti Ukuran Kamera" +msgstr "Ganti Penyaring" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -4263,31 +4230,26 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Nama Node:" +msgstr "Node Telah Diubah Namanya" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node..." -msgstr "Tambahkan Node" +msgstr "Tambah Node..." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/root_motion_editor_plugin.cpp -#, fuzzy msgid "Edit Filtered Tracks:" -msgstr "Sunting Filter" +msgstr "Sunting Trek yang Disaring:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Enable Filtering" msgstr "Aktifkan penyaringan" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Toggle Autoplay" -msgstr "Kondisikan Putar Otomatis" +msgstr "Jungkitkan Putar Otomatis" #: editor/plugins/animation_player_editor_plugin.cpp msgid "New Animation Name:" @@ -4311,14 +4273,12 @@ msgid "Remove Animation" msgstr "Hapus Animasi" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Invalid animation name!" -msgstr "KESALAHAN: Nama animasi tidak valid!" +msgstr "Nama animasi tidak valid!" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Animation name already exists!" -msgstr "KESALAHAN: Nama animasi sudah ada!" +msgstr "Nama animasi sudah ada!" #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -4342,37 +4302,30 @@ msgid "Duplicate Animation" msgstr "Gandakan Animasi" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "No animation to copy!" -msgstr "KESALAHAN: Tidak ada animasi untuk disalin!" +msgstr "Tidak ada animasi untuk disalin!" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "No animation resource on clipboard!" -msgstr "KESALAHAN: Tidak ada aset animasi di clipboard!" +msgstr "Tidak ada aset animasi di papan klip!" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Pasted Animation" -msgstr "Animasi Ditempel" +msgstr "Animasi yang Direkatkan" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Paste Animation" -msgstr "Tempelkan Animasi" +msgstr "Rekatkan Animasi" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "No animation to edit!" -msgstr "KESALAHAN: Tidak ada animasi untuk disunting!" +msgstr "Tidak ada animasi untuk disunting!" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Play selected animation backwards from current pos. (A)" msgstr "Mainkan mundur animasi terpilih dari lokasi sekarang. (A)" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Play selected animation backwards from end. (Shift+A)" msgstr "Mainkan mundur animasi terpilih dari akhir. (Shift+A)" @@ -4393,9 +4346,8 @@ msgid "Animation position (in seconds)." msgstr "Posisi Animasi (dalam detik)." #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Scale animation playback globally for the node." -msgstr "Skalakan playback animasi secara global untuk node ini." +msgstr "Skalakan pemutaran animasi secara global untuk node ini." #: editor/plugins/animation_player_editor_plugin.cpp msgid "Animation Tools" @@ -4407,21 +4359,18 @@ msgid "Animation" msgstr "Animasi" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Edit Transitions..." -msgstr "Transisi" +msgstr "Sunting Transisi..." #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Open in Inspector" -msgstr "Buka dalam Penyunting" +msgstr "Buka dalam Inspektur" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Display list of animations in player." msgstr "Tampilkan daftar animasi dalam pemutar animasi." #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Autoplay on Load" msgstr "Putar Otomatis saat Dimuat" @@ -4430,19 +4379,16 @@ msgid "Enable Onion Skinning" msgstr "Aktifkan Bayang-bayang" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Onion Skinning Options" -msgstr "Onion Skinning" +msgstr "Opsi Onion Skinning" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Directions" -msgstr "Deskripsi:" +msgstr "Arah" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Past" -msgstr "Tempel" +msgstr "Sebelum" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Future" @@ -4509,14 +4455,12 @@ msgid "Cross-Animation Blend Times" msgstr "Waktu Berbaur Animasi-silang" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Salin Resource" +msgstr "Pindahkan Node" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "Transisi" +msgstr "Tambah Transisi" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4548,19 +4492,16 @@ msgid "Start and end nodes are needed for a sub-transition." msgstr "Node awal dan akhir dibutuhkan untuk sub-transisi." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "No playback resource set at path: %s." -msgstr "Tidak didalam path resource." +msgstr "Tidak ada aset playback yang diatur di lokasi: %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Dihapus:" +msgstr "Node Dihapus" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "Node Transisi" +msgstr "Transisi Dihapus" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" @@ -4577,19 +4518,16 @@ msgstr "" "Shift+LMB untuk membuat sambungan." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Create new nodes." -msgstr "Buat Baru %s" +msgstr "Buat node baru." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Connect nodes." -msgstr "Sambungkan Ke Node:" +msgstr "Hubungkan node." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Remove selected node or transition." -msgstr "Hapus track yang dipilih." +msgstr "Hapus node atau transisi terpilih." #: editor/plugins/animation_state_machine_editor.cpp msgid "Toggle autoplay this animation on start, restart or seek to zero." @@ -4600,9 +4538,8 @@ msgid "Set the end animation. This is useful for sub-transitions." msgstr "Terapkan akhir pada animasi. Berguna untuk sub-transisi." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition: " -msgstr "Transisi" +msgstr "Transisi: " #: editor/plugins/animation_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -4736,23 +4673,20 @@ msgid "Import Animations..." msgstr "Impor Animasi..." #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "Edit Node Filters" -msgstr "Sunting Filter Node" +msgstr "Sunting Penyaring Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Filters..." msgstr "Penyaring..." #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Contents:" -msgstr "Konstanta:" +msgstr "Konten:" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "View Files" -msgstr "File:" +msgstr "Tampilkan Berkas" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't resolve hostname:" @@ -4763,12 +4697,10 @@ msgid "Connection error, please try again." msgstr "Gangguan koneksi, silakan coba lagi." #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Can't connect to host:" -msgstr "Tidak bisa terhubung ke host:" +msgstr "Tidak dapat terhubung ke host:" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "No response from host:" msgstr "Tidak ada respon dari host:" @@ -4821,6 +4753,11 @@ msgid "Idle" msgstr "Menganggur" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Pasang" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Coba Lagi" @@ -4833,14 +4770,12 @@ msgid "Download for this asset is already in progress!" msgstr "Unduhan untuk aset ini sedang diproses!" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "First" -msgstr "pertama" +msgstr "Pertama" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Previous" -msgstr "Tab sebelumnya" +msgstr "Sebelum" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Next" @@ -4851,7 +4786,6 @@ msgid "Last" msgstr "Terakhir" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Semua" @@ -4865,8 +4799,9 @@ msgid "Sort:" msgstr "Sortir:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Terbalik" +#, fuzzy +msgid "Reverse sorting." +msgstr "Melakukan permintaan..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4946,65 +4881,63 @@ msgid "Rotation Step:" msgstr "Jangkah Perputaran:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Pindahkan garis-bantu vertikal" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new vertical guide" -msgstr "Buat Subskribsi" +msgid "Create Vertical Guide" +msgstr "Buat panduan vertikal baru" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove vertical guide" -msgstr "Hapus Variabel" +msgid "Remove Vertical Guide" +msgstr "Hapus panduan vertikal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Pindahkan garis-bantu horisontal" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new horizontal guide" -msgstr "Buat Subskribsi" +msgid "Create Horizontal Guide" +msgstr "Buat panduan horizontal baru" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove horizontal guide" -msgstr "Hapus Tombol-tombol yang tidak sah" +msgid "Remove Horizontal Guide" +msgstr "Hapus panduan horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Buat garis-bantu vertikal dan horisontal baru" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Move pivot" -msgstr "Hapus Sinyal" +msgstr "Pindahkan poros" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Rotate CanvasItem" -msgstr "Sunting CanvasItem" +msgstr "Putar CanvasItem" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move anchor" msgstr "Pindahkan jangkar" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Resize CanvasItem" -msgstr "Sunting CanvasItem" +msgstr "Ubah Ukuran CanvasItem" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Scale CanvasItem" -msgstr "Sunting CanvasItem" +msgstr "Skalakan CanvasItem" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Move CanvasItem" -msgstr "Sunting CanvasItem" +msgstr "Pindahkan CanvasItem" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "" @@ -5040,36 +4973,31 @@ msgstr "Ubah Jangkar-jangkar" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Lock Selected" -msgstr "Semua pilihan" +msgstr "Kunci yang Dipilih" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Unlock Selected" -msgstr "Hapus yang Dipilih" +msgstr "Lepas Kunci yang Dipilih" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Group Selected" -msgstr "Hapus Pilihan" +msgstr "Kelompokkan yang Dipilih" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Ungroup Selected" -msgstr "Hapus Pilihan" +msgstr "Keluarkan yang dipilih dari Grup" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Paste Pose" msgstr "Tempel Pose" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Create Custom Bone(s) from Node(s)" -msgstr "Buat Tulang Kustom(satu/lebih) dari Node(satu/lebih)" +msgstr "Buat Tulang Kustom dari Node" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear Bones" @@ -5094,9 +5022,8 @@ msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/texture_region_editor_plugin.cpp #: editor/plugins/tile_set_editor_plugin.cpp scene/gui/graph_edit.cpp -#, fuzzy msgid "Zoom Reset" -msgstr "Perkecil Pandangan" +msgstr "Reset Perbesaran" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Select Mode" @@ -5128,9 +5055,8 @@ msgid "Rotate Mode" msgstr "Mode Putar" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Scale Mode" -msgstr "Beralih Mode" +msgstr "Mode Skala" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5150,9 +5076,8 @@ msgid "Pan Mode" msgstr "Mode Geser Pandangan" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Toggle snapping." -msgstr "Beralih Breakpoint" +msgstr "Jungkitkan Pengancingan." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Snap" @@ -5163,9 +5088,8 @@ msgid "Snapping Options" msgstr "Opsi-opsi Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Grid" -msgstr "Snap ke kotak-kotak" +msgstr "Kancing ke Kisi" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" @@ -5185,39 +5109,32 @@ msgid "Use Pixel Snap" msgstr "Gunakan Snap Piksel" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Smart Snapping" -msgstr "Snap pintar" +msgstr "Pengancingan Pintar" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Parent" -msgstr "Snap ke orang-tua" +msgstr "Kancingkan ke Orangtuanya" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Anchor" -msgstr "Snap ke jangkar node" +msgstr "Kancing ke Jangkar Node" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Sides" -msgstr "Snap ke sisi-sisi node" +msgstr "Kancing ke Tepi Node" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Center" -msgstr "Snap ke tengah node" +msgstr "Kancing ke Tengah Node" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Other Nodes" -msgstr "Snape ke node-node lain" +msgstr "Kancing ke Node Lain" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Guides" -msgstr "Snape ke garis-bantu" +msgstr "Kancing ke Panduan" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5240,9 +5157,8 @@ msgid "Restores the object's children's ability to be selected." msgstr "Jadikan anak-anak object dapat di seleksi kembali." #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Skeleton Options" -msgstr "Singleton" +msgstr "Opsi Pertulangan" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Bones" @@ -5315,9 +5231,8 @@ msgid "Scale mask for inserting keys." msgstr "Masker skala untuk menyisipkan key." #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Insert keys (based on mask)." -msgstr "Sisipkan Key Anim" +msgstr "Sisipkan Kunci (berdasarkan mask)." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "" @@ -5333,9 +5248,8 @@ msgstr "" "Key harus disisipkan secara manual untuk pertama kali." #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Auto Insert Key" -msgstr "Sisipkan Key Anim" +msgstr "Otomatis Sisipkan Kunci" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key (Existing Tracks)" @@ -5371,7 +5285,6 @@ msgid "Adding %s..." msgstr "Menambahkan %s..." #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Cannot instantiate multiple nodes without root." msgstr "Tidak dapat menginstansiasi beberapa node tanpa root." @@ -5386,9 +5299,8 @@ msgid "Error instancing scene from %s" msgstr "Gagal meng-instance skena dari %s" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Change Default Type" -msgstr "Ubah Tipe Nilai Array" +msgstr "Ubah Tipe Baku" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "" @@ -5399,21 +5311,18 @@ msgstr "" "Seret & lepas + Alt : Ubah tipe node" #: editor/plugins/collision_polygon_editor_plugin.cpp -#, fuzzy msgid "Create Polygon3D" -msgstr "Buat Bidang" +msgstr "Buat Polygon3D" #: editor/plugins/collision_polygon_editor_plugin.cpp -#, fuzzy msgid "Edit Poly" -msgstr "Sunting Bidang" +msgstr "Sunting Poligon" #: editor/plugins/collision_polygon_editor_plugin.cpp msgid "Edit Poly (Remove Point)" msgstr "Sunting Bidang (Hapus Titik)" #: editor/plugins/collision_shape_2d_editor_plugin.cpp -#, fuzzy msgid "Set Handle" msgstr "Atur Pegangan" @@ -5436,9 +5345,8 @@ msgstr "Muat Masker Emisi" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Restart" -msgstr "Mulai Ulang:" +msgstr "Mulai Ulang" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5472,9 +5380,8 @@ msgid "Emission Colors" msgstr "Warna Emisi" #: editor/plugins/cpu_particles_editor_plugin.cpp -#, fuzzy msgid "CPUParticles" -msgstr "Partikel" +msgstr "Partikel(CPU)" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp @@ -5519,41 +5426,34 @@ msgid "Load Curve Preset" msgstr "Muat Preset Kurva" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Add Point" -msgstr "Tambahkan Sinyal" +msgstr "Tambah Titik" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Remove Point" -msgstr "Hapus Sinyal" +msgstr "Hapus Titik" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Left Linear" -msgstr "Linier" +msgstr "Linier ke Kiri" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Right Linear" -msgstr "Tampilan Kanan." +msgstr "Linier ke Kanan" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Load Preset" -msgstr "Muat Galat" +msgstr "Muat Preset" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Remove Curve Point" -msgstr "Hapus Sinyal" +msgstr "Hapus Titik Kurva" #: editor/plugins/curve_editor_plugin.cpp msgid "Toggle Curve Linear Tangent" msgstr "Beralih Kurva Linear Tangen" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Hold Shift to edit tangents individually" msgstr "Tahan Shift untuk menyunting tangen kurva satu-persatu" @@ -5563,7 +5463,7 @@ msgstr "" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Gradasi Disunting" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5574,7 +5474,6 @@ msgid "Items" msgstr "Item" #: editor/plugins/item_list_editor_plugin.cpp -#, fuzzy msgid "Item List Editor" msgstr "Penyunting Daftar Item" @@ -5592,7 +5491,7 @@ msgstr "Buat Badan Trimesh Statis" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Convex Body" -msgstr "" +msgstr "Buat Bodi Cembung Statis" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "This doesn't work on scene root!" @@ -5607,9 +5506,8 @@ msgid "Failed creating shapes!" msgstr "Gagal membuat bentuk!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Convex Shape(s)" -msgstr "Buat Baru %s" +msgstr "Buat Bentuk Cembung" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5625,7 +5523,7 @@ msgstr "UV Unwrap gagal, mesh mungkin tidak bermacam-macam?" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "No mesh to debug." -msgstr "" +msgstr "Tidak ada mesh untuk diawakutu." #: editor/plugins/mesh_instance_editor_plugin.cpp #: editor/plugins/sprite_editor_plugin.cpp @@ -5638,7 +5536,7 @@ msgstr "MeshInstance tidak memiliki Mesh!" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh has not surface to create outlines from!" -msgstr "" +msgstr "Mesh belum muncul untuk membuat garis tepi darinya!" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!" @@ -5649,13 +5547,13 @@ msgid "Could not create outline!" msgstr "Tidak dapat membuat garis!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Outline" -msgstr "Buat Garis" +msgstr "Buat Garis Tepi" #: editor/plugins/mesh_instance_editor_plugin.cpp +#, fuzzy msgid "Mesh" -msgstr "" +msgstr "Jala" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Static Body" @@ -5676,14 +5574,12 @@ msgid "Create Outline Mesh..." msgstr "Buat Garis Mesh..." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "View UV1" -msgstr "File:" +msgstr "Tampilkan UV1" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "View UV2" -msgstr "File:" +msgstr "Tampilkan UV2" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Unwrap UV2 for Lightmap/AO" @@ -5763,15 +5659,15 @@ msgstr "" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Couldn't map area." -msgstr "" +msgstr "Tidak dapat memetakan area." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Source Mesh:" -msgstr "" +msgstr "Pilih Mesh Sumber:" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Target Surface:" -msgstr "" +msgstr "Pilih Target Permukaan:" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Populate Surface" @@ -5791,31 +5687,31 @@ msgstr "" #: editor/plugins/multimesh_editor_plugin.cpp msgid "X-Axis" -msgstr "" +msgstr "Sumbu-X" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Y-Axis" -msgstr "" +msgstr "Sumbu-Y" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Z-Axis" -msgstr "" +msgstr "Sumbu-Z" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh Up Axis:" -msgstr "" +msgstr "Sumbu Atas Mesh:" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Random Rotation:" -msgstr "" +msgstr "Perputaran Acak:" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Random Tilt:" -msgstr "" +msgstr "Kemiringan Acak:" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Random Scale:" -msgstr "" +msgstr "Skala Acak:" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Populate" @@ -5824,169 +5720,167 @@ msgstr "" #: editor/plugins/navigation_polygon_editor_plugin.cpp #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create Navigation Polygon" -msgstr "" +msgstr "Buat Poligon Navigasi" #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Convert to CPUParticles" -msgstr "Sambungkan Ke Node:" +msgstr "Konversikan menjadi CPUParticles" #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Generating Visibility Rect" -msgstr "" +msgstr "Menghasilkan Kotak Penampakan" #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Generate Visibility Rect" -msgstr "" +msgstr "Buatkan Kotak Penampakan" #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" -msgstr "" +msgstr "Hanya dapat mengatur titik ke dalam material proses ParticlesMaterial" #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp msgid "Generation Time (sec):" -msgstr "" +msgstr "Waktu Pembuatan (detik):" #: editor/plugins/particles_editor_plugin.cpp msgid "Faces contain no area!" -msgstr "" +msgstr "Bidang tidak memiliki area!" #: editor/plugins/particles_editor_plugin.cpp msgid "No faces!" -msgstr "" +msgstr "Tidak ada bidang!" #: editor/plugins/particles_editor_plugin.cpp msgid "Node does not contain geometry." -msgstr "" +msgstr "Node tidak mengandung geometri." #: editor/plugins/particles_editor_plugin.cpp msgid "Node does not contain geometry (faces)." -msgstr "" +msgstr "Node tidak mengandung geometri (bidang)." #: editor/plugins/particles_editor_plugin.cpp msgid "Create Emitter" -msgstr "" +msgstr "Buat Pengemisi" #: editor/plugins/particles_editor_plugin.cpp msgid "Emission Points:" -msgstr "" +msgstr "Titik Emisi:" #: editor/plugins/particles_editor_plugin.cpp msgid "Surface Points" -msgstr "" +msgstr "Titik Permukaan" #: editor/plugins/particles_editor_plugin.cpp msgid "Surface Points+Normal (Directed)" -msgstr "" +msgstr "Titik+Normal Permukaan (Diarahkan)" #: editor/plugins/particles_editor_plugin.cpp msgid "Volume" -msgstr "" +msgstr "Volume" #: editor/plugins/particles_editor_plugin.cpp msgid "Emission Source: " -msgstr "" +msgstr "Sumber Emisi: " #: editor/plugins/particles_editor_plugin.cpp msgid "A processor material of type 'ParticlesMaterial' is required." -msgstr "" +msgstr "Pemroses material atau jenis 'ParticlesMaterial' dibutuhkan." #: editor/plugins/particles_editor_plugin.cpp msgid "Generating AABB" -msgstr "" +msgstr "Membuat AABB" #: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" -msgstr "" +msgstr "Buat Penampakan AABB" #: editor/plugins/particles_editor_plugin.cpp msgid "Generate AABB" -msgstr "" +msgstr "Buat AABB" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" -msgstr "" +msgstr "Hapus Titik dari Kurva" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Out-Control from Curve" -msgstr "" +msgstr "Hapus Kontrol-Luar dari Kurva" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove In-Control from Curve" -msgstr "" +msgstr "Hapus Kontrol-Dalam dari Kurva" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Add Point to Curve" -msgstr "" +msgstr "Tambah Titik ke Kurva" #: editor/plugins/path_2d_editor_plugin.cpp -#, fuzzy msgid "Split Curve" -msgstr "Sunting Kurva Node" +msgstr "Pisahkan Kurva" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Move Point in Curve" -msgstr "" +msgstr "Geser Titik dalam Kurva" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Move In-Control in Curve" -msgstr "" +msgstr "Geser Kontrol-Dalam dalam Kurva" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Move Out-Control in Curve" -msgstr "" +msgstr "Geser Kontrol-Luar dalam Kurva" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Select Points" -msgstr "" +msgstr "Pilih Titik" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Shift+Drag: Select Control Points" -msgstr "" +msgstr "Shift+Seret: Pilih Titik Kontrol" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Click: Add Point" -msgstr "" +msgstr "Klik: Tambah Titik" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Left Click: Split Segment (in curve)" -msgstr "" +msgstr "Klik Kiri: Pisahkan Segmen (dalam Kurva)" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Right Click: Delete Point" -msgstr "" +msgstr "Klik Kanan: Hapus Titik" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Select Control Points (Shift+Drag)" -msgstr "" +msgstr "Pilih Titik Kontrol (Shift+Seret)" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Add Point (in empty space)" -msgstr "" +msgstr "Tambah Titik (dalam ruang kosong)" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Delete Point" -msgstr "" +msgstr "Hapus Titik" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Close Curve" -msgstr "" +msgstr "Tutup Kurva" #: 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 msgid "Options" -msgstr "" +msgstr "Opsi" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp @@ -6000,257 +5894,245 @@ msgstr "" #: editor/plugins/path_editor_plugin.cpp msgid "Curve Point #" -msgstr "" +msgstr "Titik #" #: editor/plugins/path_editor_plugin.cpp -#, fuzzy msgid "Set Curve Point Position" -msgstr "Hapus Sinyal" +msgstr "Atur Posisi Titik Kurva" #: editor/plugins/path_editor_plugin.cpp -#, fuzzy msgid "Set Curve In Position" -msgstr "Hapus Sinyal" +msgstr "Atur Posisi Kurva Dalam" #: editor/plugins/path_editor_plugin.cpp -#, fuzzy msgid "Set Curve Out Position" -msgstr "Hapus Sinyal" +msgstr "Atur Posisi Kurva Luar" #: editor/plugins/path_editor_plugin.cpp msgid "Split Path" -msgstr "" +msgstr "Pisahkan Tapak" #: editor/plugins/path_editor_plugin.cpp msgid "Remove Path Point" -msgstr "" +msgstr "Hapus Titik Tapak" #: editor/plugins/path_editor_plugin.cpp -#, fuzzy msgid "Remove Out-Control Point" -msgstr "Hapus Autoload" +msgstr "Hapus Titik Kontrol-Luar" #: editor/plugins/path_editor_plugin.cpp msgid "Remove In-Control Point" -msgstr "" +msgstr "Hapus Titik Kontrol-Dalam" #: editor/plugins/path_editor_plugin.cpp msgid "Split Segment (in curve)" -msgstr "" +msgstr "Pisahkan Segmen (dalam kurva)" #: editor/plugins/physical_bone_plugin.cpp -#, fuzzy msgid "Move Joint" -msgstr "Hapus Sinyal" +msgstr "Geser Persendian" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "" "The skeleton property of the Polygon2D does not point to a Skeleton2D node" -msgstr "" +msgstr "Properti pertulangan dari Polygon2D tidak mengarah ke node Skeleton2D" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Sync Bones" -msgstr "" +msgstr "Sinkronkan Pertulangan" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "" "No texture in this polygon.\n" "Set a texture to be able to edit UV." msgstr "" +"Tidak ada tekstur dalam poligon ini.\n" +"Atur tekstur supaya bisa menyunting UV-nya." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create UV Map" -msgstr "" +msgstr "Buat Peta UV" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "" "Polygon 2D has internal vertices, so it can no longer be edited in the " "viewport." msgstr "" +"Polygon2D memiliki verteks internal, jadi tidak bisa disunting lagi di dalam " +"viewport." #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Create Polygon & UV" -msgstr "Buat Bidang" +msgstr "Buat Poligon & UV" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Create Internal Vertex" -msgstr "Buat Subskribsi" +msgstr "Buat Verteks Internal" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Remove Internal Vertex" -msgstr "Hapus item" +msgstr "Hapus Verteks Internal" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Invalid Polygon (need 3 different vertices)" -msgstr "" +msgstr "Poligon tidak valid (butuh 3 verteks yang berbeda)" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Add Custom Polygon" -msgstr "Sunting Bidang" +msgstr "Tambah Poligon Kustom" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Remove Custom Polygon" -msgstr "Hapus Bidang dan Titik" +msgstr "Hapus Poligon Kustom" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Transform UV Map" -msgstr "" +msgstr "Transformasikan Peta UV" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Transform Polygon" -msgstr "Buat Bidang" +msgstr "Transformasikan Poligon" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Paint Bone Weights" -msgstr "" +msgstr "Gambar Pembobotan Tulang" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Open Polygon 2D UV editor." -msgstr "Penyunting UV Poligon 2D" +msgstr "Buka Penyunting UV Poligon 2D." #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Polygon 2D UV Editor" msgstr "Penyunting UV Poligon 2D" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "UV" -msgstr "" +msgstr "UV" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Points" msgstr "Titik" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Polygons" -msgstr "Sunting Bidang" +msgstr "Poligon" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Bones" -msgstr "" +msgstr "Tulang" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Move Points" -msgstr "Hapus Sinyal" +msgstr "Geser Titik" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Ctrl: Rotate" -msgstr "" +msgstr "Ctrl: Putar" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Shift: Move All" -msgstr "" +msgstr "Shift: Geser Semua" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Shift+Ctrl: Scale" -msgstr "" +msgstr "Shift+Ctrl: Skala" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Move Polygon" -msgstr "" +msgstr "Geser Poligon" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Rotate Polygon" -msgstr "" +msgstr "Putar Poligon" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Scale Polygon" -msgstr "" +msgstr "Skalakan Poligon" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create a custom polygon. Enables custom polygon rendering." -msgstr "" +msgstr "Buat poligon kustom. Mengaktifkan perenderan poligon kustom." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "" "Remove a custom polygon. If none remain, custom polygon rendering is " "disabled." msgstr "" +"Hapus poligon kustom. Jika tidak tersisa, perenderan poligon kustom " +"dinonaktifkan." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Paint weights with specified intensity." -msgstr "" +msgstr "Gambar pembobotan dengan intensitas yang ditentukan." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Unpaint weights with specified intensity." -msgstr "" +msgstr "Hapus pembobotan dengan intensitas yang ditentukan." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Radius:" -msgstr "" +msgstr "Radius:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Polygon->UV" -msgstr "" +msgstr "Poligon->UV" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "UV->Polygon" -msgstr "" +msgstr "UV->Poligon" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Clear UV" -msgstr "" +msgstr "Bersihkan UV" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Grid Settings" -msgstr "Pengaturan Editor" +msgstr "Pengaturan Kisi" #: editor/plugins/polygon_2d_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Snap" -msgstr "" +msgstr "Pengancingan" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Enable Snap" -msgstr "" +msgstr "Aktifkan Pengancingan" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid" -msgstr "" +msgstr "Kisi" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Configure Grid:" -msgstr "Atur Snap" +msgstr "Konfigurasikan Kisi:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Offset X:" -msgstr "" +msgstr "Ofset X Kisi:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Offset Y:" -msgstr "" +msgstr "Ofset Y Kisi:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Step X:" -msgstr "" +msgstr "Jarak X Kisi:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Step Y:" -msgstr "" +msgstr "Jarak Y Kisi:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Sync Bones to Polygon" -msgstr "" +msgstr "Sinkronkan Tulang ke Poligon" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "ERROR: Couldn't load resource!" -msgstr "" +msgstr "KESALAHAN: Tidak dapat memuat sumber daya!" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "Add Resource" -msgstr "" +msgstr "Tambah Sumber Daya" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "Rename Resource" @@ -6271,7 +6153,6 @@ msgstr "Tempel Resource" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Instance:" msgstr "Instansi:" @@ -6283,7 +6164,6 @@ msgstr "Jenis:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/scene_tree_dock.cpp editor/scene_tree_editor.cpp -#, fuzzy msgid "Open in Editor" msgstr "Buka dalam Penyunting" @@ -6292,9 +6172,8 @@ msgid "Load Resource" msgstr "Muat Sumber Daya" #: editor/plugins/resource_preloader_editor_plugin.cpp -#, fuzzy msgid "ResourcePreloader" -msgstr "Resource" +msgstr "PreloaderSumberDaya" #: editor/plugins/root_motion_editor_plugin.cpp msgid "AnimationTree has no path set to an AnimationPlayer" @@ -6313,59 +6192,48 @@ msgid "Close and save changes?" msgstr "Tutup dan simpan perubahan?" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error writing TextFile:" -msgstr "Error menyimpan TileSet!" +msgstr "Galat saat menulis TextFile:" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error: could not load file." -msgstr "Tidak dapat membuat folder." +msgstr "Galat: tidak dapat memuat berkas." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error could not load file." -msgstr "Tidak dapat membuat folder." +msgstr "Galat tidak dapat memuat berkas." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error saving file!" -msgstr "Error menyimpan TileSet!" +msgstr "Galat saat menyimpan berkas!" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error while saving theme." -msgstr "Error saat menyimpan." +msgstr "Galat saat menyimpan tema." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error Saving" -msgstr "Galat saat memindahkan:" +msgstr "Galat Menyimpan" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error importing theme." -msgstr "Galat saat mengimpor:" +msgstr "Galat saat mengimpor tema." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error Importing" -msgstr "Galat saat mengimpor:" +msgstr "Galat saat mengimpor" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "New TextFile..." -msgstr "Buat Direktori..." +msgstr "Berkas Teks Baru..." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Open File" -msgstr "Buka sebuah File" +msgstr "Buka Berkas" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Save File As..." -msgstr "Simpan Sebagai..." +msgstr "Simpan Berkas Sebagai..." #: editor/plugins/script_editor_plugin.cpp msgid "Import Theme" @@ -6393,23 +6261,20 @@ msgid "Find Next" msgstr "Pencarian Selanjutnya" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter scripts" -msgstr "Filter:" +msgstr "Penyaring Skrip" #: editor/plugins/script_editor_plugin.cpp msgid "Toggle alphabetical sorting of the method list." msgstr "Beralih penyortiran alfabetis dari daftar fungsi." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter methods" -msgstr "Filter:" +msgstr "Penyaring fungsi" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Sort" -msgstr "Sortir:" +msgstr "Urutkan" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp @@ -6436,9 +6301,8 @@ msgid "File" msgstr "Berkas" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Open..." -msgstr "Buka" +msgstr "Buka..." #: editor/plugins/script_editor_plugin.cpp msgid "Save All" @@ -6446,27 +6310,24 @@ msgstr "Simpan Semua" #: editor/plugins/script_editor_plugin.cpp msgid "Soft Reload Script" -msgstr "" +msgstr "Muat Ulang Skrip secara Halus" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Copy Script Path" -msgstr "Salin Resource" +msgstr "Salin Lokasi Skrip" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "History Previous" -msgstr "Tab sebelumnya" +msgstr "Riwayat Sebelumnya" #: editor/plugins/script_editor_plugin.cpp msgid "History Next" -msgstr "" +msgstr "Riwayat Selanjutnya" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "Simpan Tema" +msgstr "Tema" #: editor/plugins/script_editor_plugin.cpp msgid "Import Theme..." @@ -6493,176 +6354,167 @@ msgid "Run" msgstr "Jalankan" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Toggle Scripts Panel" -msgstr "Beralih Favorit" +msgstr "Jungkitkan Panel Skrip" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Step Over" -msgstr "" +msgstr "Langkahi" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Step Into" -msgstr "" +msgstr "Masuki" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Break" -msgstr "" +msgstr "Putuskan" #: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp #: editor/script_editor_debugger.cpp msgid "Continue" -msgstr "" +msgstr "Lanjutkan" #: editor/plugins/script_editor_plugin.cpp msgid "Keep Debugger Open" -msgstr "" +msgstr "Biarkan Pengawakutu Terbuka" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Debug with External Editor" -msgstr "Debug menggunakan penyunting eksternal" +msgstr "Awakutu menggunakan Penyunting Eksternal" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Open Godot online documentation." -msgstr "Buka baru-baru ini" +msgstr "Buka dokumentasi daring Godot." #: editor/plugins/script_editor_plugin.cpp msgid "Request Docs" -msgstr "" +msgstr "Minta Dokumentasi" #: editor/plugins/script_editor_plugin.cpp msgid "Help improve the Godot documentation by giving feedback." -msgstr "" +msgstr "Bantu tingkatkan dokumentasi Godot dengan memberikan tanggapan." #: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." -msgstr "" +msgstr "Cari dokumentasi referensi." #: editor/plugins/script_editor_plugin.cpp msgid "Go to previous edited document." msgstr "Ke dokumen yang disunting sebelumnya." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Go to next edited document." -msgstr "Ke dokumen yang disunting selanjutnya." +msgstr "Pergi ke dokumen yang disunting selanjutnya." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Discard" -msgstr "Berlainan" +msgstr "Abaikan" #: editor/plugins/script_editor_plugin.cpp msgid "" "The following files are newer on disk.\n" "What action should be taken?:" msgstr "" +"Berkas berikut lebih baru dalam diska.\n" +"Aksi apa yang ingin diambil?:" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/shader_editor_plugin.cpp msgid "Reload" -msgstr "" +msgstr "Muat Ulang" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/shader_editor_plugin.cpp msgid "Resave" -msgstr "" +msgstr "Simpan Ulang" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Debugger" -msgstr "" +msgstr "Pengawakutu" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Search Results" -msgstr "Mencari Bantuan" +msgstr "Hasil Pencarian" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Connections to method:" -msgstr "Sambungkan Ke Node:" +msgstr "Hubungan dengan fungsi:" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Source" -msgstr "Resource" +msgstr "Sumber" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Signal" -msgstr "Sinyal-sinyal" +msgstr "Sinyal" #: editor/plugins/script_text_editor.cpp msgid "Target" -msgstr "" +msgstr "Target" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "" "Missing connected method '%s' for signal '%s' from node '%s' to node '%s'." -msgstr "Memutuskan '%s' dari '%s'" +msgstr "" +"Tidak ditemukan fungsi '%s' yang dihubungkan untuk sinyal '%s' dari node " +"'%s' ke node '%s'." #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Line" -msgstr "Baris:" +msgstr "Baris" #: editor/plugins/script_text_editor.cpp msgid "(ignore)" -msgstr "" +msgstr "(abaikan)" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Function" -msgstr "Tambahkan Fungsi" +msgstr "Pergi ke Fungsi" #: editor/plugins/script_text_editor.cpp msgid "Only resources from filesystem can be dropped." -msgstr "" +msgstr "Hanya sumber daya dari berkas sistem yang dapat dihapus." #: editor/plugins/script_text_editor.cpp msgid "Lookup Symbol" -msgstr "" +msgstr "Simbol Pencarian" #: editor/plugins/script_text_editor.cpp msgid "Pick Color" -msgstr "" +msgstr "Pilih Warna" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Convert Case" -msgstr "" +msgstr "Konversikan Pengkapitalan" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Uppercase" -msgstr "" +msgstr "Huruf Besar" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Lowercase" -msgstr "" +msgstr "Huruf Kecil" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Capitalize" -msgstr "" +msgstr "Kapitalisasi" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Syntax Highlighter" -msgstr "" +msgstr "Penyorot Sintaks" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Pergi Ke" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp msgid "Bookmarks" -msgstr "" +msgstr "Bilah Marka" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Hapus Titik" +msgstr "Breakpoint" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6670,58 +6522,52 @@ msgid "Cut" msgstr "Potong" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Delete Line" -msgstr "Hapus" +msgstr "Hapus Baris" #: editor/plugins/script_text_editor.cpp msgid "Indent Left" -msgstr "" +msgstr "Indentasi Kiri" #: editor/plugins/script_text_editor.cpp msgid "Indent Right" -msgstr "" +msgstr "Indentasi Kanan" #: editor/plugins/script_text_editor.cpp msgid "Toggle Comment" -msgstr "" +msgstr "Jungkitkan Komentar" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Toggle Bookmark" -msgstr "Mode Layar Penuh" +msgstr "Jungkitkan Markah Buku" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Next Bookmark" -msgstr "Lanjut ke Langkah Berikutnya" +msgstr "Pergi ke Markah Buku Berikutnya" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Previous Bookmark" -msgstr "Ke dokumen yang disunting sebelumnya." +msgstr "Pergi ke Markah Buku Sebelumnya" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Remove All Bookmarks" -msgstr "Hapus Pilihan" +msgstr "Hapus Semua Markah Buku" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Fold/Unfold Line" -msgstr "Pergi ke Baris" +msgstr "Lipat/Bentangkan Baris" #: editor/plugins/script_text_editor.cpp msgid "Fold All Lines" -msgstr "" +msgstr "Lipat Semua Baris" #: editor/plugins/script_text_editor.cpp msgid "Unfold All Lines" -msgstr "" +msgstr "Bentangkan Semua Baris" #: editor/plugins/script_text_editor.cpp msgid "Clone Down" -msgstr "" +msgstr "Duplikat ke Bawah" #: editor/plugins/script_text_editor.cpp msgid "Complete Symbol" @@ -6729,21 +6575,19 @@ msgstr "" #: editor/plugins/script_text_editor.cpp msgid "Trim Trailing Whitespace" -msgstr "" +msgstr "Hapus Spasi di Belakang" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Convert Indent to Spaces" -msgstr "Sambungkan Ke Node:" +msgstr "Konversikan Indentasi ke Spasi" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Convert Indent to Tabs" -msgstr "Sambungkan Ke Node:" +msgstr "Konversikan Indentasi ke Tab" #: editor/plugins/script_text_editor.cpp msgid "Auto Indent" -msgstr "" +msgstr "Indentasi Otomatis" #: editor/plugins/script_text_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -6752,46 +6596,43 @@ msgstr "Beralih Breakpoint" #: editor/plugins/script_text_editor.cpp msgid "Remove All Breakpoints" -msgstr "" +msgstr "Hapus Semua Titik Jeda" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Next Breakpoint" -msgstr "Lanjut ke Langkah Berikutnya" +msgstr "Pergi ke Langkah Jeda Berikutnya" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Previous Breakpoint" -msgstr "Ke dokumen yang disunting sebelumnya." +msgstr "Pergi ke Langkah Jeda Sebelumnya" #: editor/plugins/script_text_editor.cpp msgid "Find Previous" -msgstr "" +msgstr "Cari Sebelumnya" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Find in Files..." -msgstr "Saring berkas..." +msgstr "Cari Dalam Berkas..." #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Function..." -msgstr "Hapus Fungsi" +msgstr "Pergi ke Fungsi..." #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Line..." -msgstr "Pergi ke Baris" +msgstr "Pergi ke Baris..." #: editor/plugins/script_text_editor.cpp msgid "Contextual Help" -msgstr "" +msgstr "Bantuan Kontekstual" #: editor/plugins/shader_editor_plugin.cpp msgid "" "This shader has been modified on on disk.\n" "What action should be taken?" msgstr "" +"Shader ini telah dimodifikasi dalam diska.\n" +"Aksi apa yang harus diambil?" #: editor/plugins/shader_editor_plugin.cpp msgid "Shader" @@ -6970,7 +6811,12 @@ msgstr "Belakang" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" +msgstr "Tampilan Kanan." + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" msgstr "Tampilan Kanan." #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7164,10 +7010,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Tool Select" msgstr "Semua pilihan" @@ -7764,14 +7606,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8207,6 +8041,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8300,6 +8138,22 @@ msgid "Color uniform." msgstr "Ubah Transformasi Animasi" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8307,10 +8161,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8401,7 +8289,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8409,7 +8297,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8421,7 +8309,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8438,7 +8326,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8507,11 +8395,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8527,7 +8415,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8555,11 +8443,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8600,12 +8488,18 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." -msgstr "" +#, fuzzy +msgid "Cubic texture uniform lookup." +msgstr "Format Tekstur" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup." +msgstr "Format Tekstur" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "Format Tekstur" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8615,7 +8509,7 @@ msgstr "Buat Bidang" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8633,15 +8527,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8693,7 +8587,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8721,12 +8615,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8803,47 +8697,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10063,6 +9957,11 @@ msgid "Extend Script" msgstr "Buka Cepat Script..." #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Buat Baru %s" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Jadikan Skena Dasar" @@ -10288,7 +10187,7 @@ msgid "Script is valid." msgstr "Pohon animasi valid." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11989,6 +11888,11 @@ msgstr "Ukuran font tidak sah." 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." + #: servers/visual/shader_language.cpp #, fuzzy msgid "Assignment to function." @@ -12008,6 +11912,21 @@ msgstr "Variasi hanya bisa ditetapkan dalam fungsi vertex." msgid "Constants cannot be modified." msgstr "Konstanta tidak dapat dimodifikasi." +#~ msgid "Previous Folder" +#~ msgstr "Direktori Sebelumnya" + +#~ msgid "Next Folder" +#~ msgstr "Folder Berikutnya" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Buka Screenshoots secara otomatis" + +#~ msgid "Open in an external image editor." +#~ msgstr "Buka di pengolah gambar lainnya" + +#~ msgid "Reverse" +#~ msgstr "Terbalik" + #, fuzzy #~ msgid "Failed to create solution." #~ msgstr "Gagal memuat resource." diff --git a/editor/translations/is.po b/editor/translations/is.po index d63db7f02d..98d0678673 100644 --- a/editor/translations/is.po +++ b/editor/translations/is.po @@ -134,6 +134,31 @@ msgid "Anim Change Call" msgstr "Útkall breyting sÃmtal" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim breyta lyklagrind tÃmi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim breyting umskipti" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Breyta umbreytingu" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim breyta lyklagrind gildi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Útkall breyting sÃmtal" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1133,7 +1158,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1669,7 +1693,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1720,7 +1744,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1745,23 +1769,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2438,6 +2466,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Fjarlægja val" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2629,14 +2662,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2950,6 +2975,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Breyta:" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4584,6 +4614,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4612,7 +4646,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4626,7 +4659,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4701,31 +4734,33 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Fjarlægja val" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Fjarlægja val" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6591,7 +6626,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6776,10 +6815,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7349,14 +7384,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7752,6 +7779,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7837,6 +7868,22 @@ msgid "Color uniform." msgstr "Breyta umbreytingu" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7844,10 +7891,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7937,7 +8018,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7945,7 +8026,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7957,7 +8038,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7974,7 +8055,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8043,11 +8124,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8063,7 +8144,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8091,11 +8172,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8136,11 +8217,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8149,7 +8234,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8167,15 +8252,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8224,7 +8309,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8252,12 +8337,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8334,47 +8419,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9532,6 +9617,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9735,7 +9824,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11257,6 +11346,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/it.po b/editor/translations/it.po index 41cdd4df93..9773fd2a13 100644 --- a/editor/translations/it.po +++ b/editor/translations/it.po @@ -35,12 +35,16 @@ # Marco <rodomar705@gmail.com>, 2019. # Davide Giuliano <davidegiuliano00@gmail.com>, 2019. # Stefano Merazzi <asso99@hotmail.com>, 2019. +# Sinapse X <sinapsex13@gmail.com>, 2019. +# Micila Micillotto <micillotto@gmail.com>, 2019. +# Mirko Soppelsa <miknsop@gmail.com>, 2019. +# No <kingofwizards.kw7@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-02 10:50+0000\n" -"Last-Translator: Marco <rodomar705@gmail.com>\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" +"Last-Translator: No <kingofwizards.kw7@gmail.com>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot/it/>\n" "Language: it\n" @@ -161,6 +165,31 @@ msgid "Anim Change Call" msgstr "Cambia chiamata animazione" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Cambia Tempo Keyframe" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Cambia transizione dell'animazione" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Cambia trasformazione dell'animazione" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Cambia valore fotogramma chiave dell'animazione" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Cambia chiamata animazione" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Cambia lunghezza dell'animazione" @@ -663,7 +692,7 @@ msgstr "Numero linea:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Trovata/e %d corrispondenza/e." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -821,9 +850,8 @@ msgid "Connect" msgstr "Connetti" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Segnali:" +msgstr "Segnale:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -988,9 +1016,8 @@ msgid "Owners Of:" msgstr "Proprietari di:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "Rimuovi i file selezionati dal progetto? (non annullabile)" +msgstr "Rimuovere i file selezionati dal progetto? (Non può essere annullato)" #: editor/dependency_editor.cpp msgid "" @@ -1008,7 +1035,7 @@ msgstr "Impossibile rimuovere:" #: editor/dependency_editor.cpp msgid "Error loading:" -msgstr "Errore in caricamento:" +msgstr "Errore di caricamento:" #: editor/dependency_editor.cpp msgid "Load failed due to missing dependencies:" @@ -1172,7 +1199,6 @@ msgid "Success!" msgstr "Successo!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Installa" @@ -1361,7 +1387,6 @@ msgstr "" "Non deve essere in conflitto con un nome di una classe esistente dell'engine." #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing built-in type name." msgstr "Non deve essere in conflitto con un nome di tipo built-in esistente." @@ -1545,6 +1570,7 @@ msgstr "Modello non trovato:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"Su export di 32-bit il PCK integrato non può essere più grande di 4 GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1563,7 +1589,6 @@ msgid "Scene Tree Editing" msgstr "Editor delle scene" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Import Dock" msgstr "Importa" @@ -1572,9 +1597,8 @@ msgid "Node Dock" msgstr "Nodo" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "FileSystem and Import Docks" -msgstr "Filesystem" +msgstr "Filesystem e dock di importazione" #: editor/editor_feature_profile.cpp msgid "Erase profile '%s'? (no undo)" @@ -1625,7 +1649,6 @@ msgid "File '%s' format is invalid, import aborted." msgstr "Il formato del file '%s' non è valido, importazione annullata." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." @@ -1642,9 +1665,8 @@ msgid "Unset" msgstr "Disattiva" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Current Profile:" -msgstr "Profilo attuale" +msgstr "Profilo corrente:" #: editor/editor_feature_profile.cpp msgid "Make Current" @@ -1666,9 +1688,8 @@ msgid "Export" msgstr "Esporta" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Available Profiles:" -msgstr "Profili disponibili" +msgstr "Profili disponibili:" #: editor/editor_feature_profile.cpp msgid "Class Options" @@ -1723,7 +1744,7 @@ msgstr "Mostra nel gestore file" msgid "New Folder..." msgstr "Nuova cartella..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Aggiorna" @@ -1774,7 +1795,7 @@ msgstr "Va' avanti" msgid "Go Up" msgstr "Va' su" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Attiva/disattiva file nascosti" @@ -1799,23 +1820,31 @@ msgid "Move Favorite Down" msgstr "Sposta preferito in giù" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Cartella precedente" +#, fuzzy +msgid "Go to previous folder." +msgstr "Va' alla cartella superiore." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Cartella successiva" +#, fuzzy +msgid "Go to next folder." +msgstr "Va' alla cartella superiore." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Va' alla cartella superiore." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Cerca file" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Aggiungi/rimuovi cartella attuale dai preferiti." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Attiva/disattiva visibilità dei file nascosti." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2556,6 +2585,10 @@ msgid "Go to previously opened scene." msgstr "Vai alla scena precedentemente aperta." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Copia Testo" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Scheda successiva" @@ -2609,7 +2642,7 @@ msgstr "Libreria delle Mesh..." #: editor/editor_node.cpp msgid "TileSet..." -msgstr "TileSet..." +msgstr "TileSet…" #: editor/editor_node.cpp editor/plugins/script_text_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp @@ -2647,7 +2680,7 @@ msgstr "Apri la cartella del progetto" #: editor/editor_node.cpp msgid "Install Android Build Template" -msgstr "" +msgstr "Installa Android Build Template" #: editor/editor_node.cpp msgid "Quit to Project List" @@ -2758,32 +2791,21 @@ msgid "Editor Layout" msgstr "Layout dell'editor" #: editor/editor_node.cpp -#, fuzzy msgid "Take Screenshot" -msgstr "Rendi Scena Radice" +msgstr "Acquisisci screenshot" #: editor/editor_node.cpp -#, fuzzy msgid "Screenshots are stored in the Editor Data/Settings Folder." -msgstr "Apri cartella dati/impostazioni editor" - -#: editor/editor_node.cpp -msgid "Automatically Open Screenshots" msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Apri l'Editor successivo" +"Gli screenshot vengono memorizzati nella cartella Data/Settings dell'editor." #: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Abilita/Disabilita modalità a schermo intero" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle System Console" -msgstr "Abilita CanvasItem Visibile" +msgstr "Abilita/Disabilita la console di sistema" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -2798,9 +2820,8 @@ msgid "Open Editor Settings Folder" msgstr "Apri cartella impostazioni editor" #: editor/editor_node.cpp -#, fuzzy msgid "Manage Editor Features" -msgstr "Gestisci template d'esportazione" +msgstr "Gestisci le funzionalità dell'editor" #: editor/editor_node.cpp editor/project_export.cpp msgid "Manage Export Templates" @@ -2893,17 +2914,14 @@ msgid "Spins when the editor window redraws." msgstr "Gira quando la finestra dell'editor viene ridisegnata." #: editor/editor_node.cpp -#, fuzzy msgid "Update Continuously" -msgstr "Continuo" +msgstr "Aggiorna continuamente" #: editor/editor_node.cpp -#, fuzzy msgid "Update When Changed" -msgstr "Aggiorna cambiamenti" +msgstr "Aggiorna quando modificato" #: editor/editor_node.cpp -#, fuzzy msgid "Hide Update Spinner" msgstr "Disabilita l'icona girevole di aggiornamento" @@ -2934,21 +2952,21 @@ msgstr "Non salvare" #: editor/editor_node.cpp msgid "Android build template is missing, please install relevant templates." msgstr "" +"Modello build di Android non è presente, si prega di installare i modelli " +"rilevanti." #: editor/editor_node.cpp -#, fuzzy msgid "Manage Templates" -msgstr "Gestisci template d'esportazione" +msgstr "Gestisci i template d'esportazione" #: editor/editor_node.cpp -#, fuzzy msgid "" "This will install the Android project for custom builds.\n" "Note that, in order to use it, it needs to be enabled per export preset." msgstr "" -"Questo installerà il progetto Android per builds personalizzate.\n" -"Nota bene: per essere usato, deve essere abilitato secondo l'esportazione " -"del preset." +"Questo installerà il progetto Android per build personalizzate.\n" +"Nota bene: per essere usato, deve essere abilitato per l'esportazione del " +"preset." #: editor/editor_node.cpp msgid "" @@ -2956,6 +2974,9 @@ msgid "" "Remove the \"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." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3099,6 +3120,11 @@ msgstr "Tempo" msgid "Calls" msgstr "Chiamate" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Modifica Tema" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "On" @@ -3428,9 +3454,8 @@ msgid "SSL Handshake Error" msgstr "Errore nell'Handshake SSL" #: editor/export_template_manager.cpp -#, fuzzy msgid "Uncompressing Android Build Sources" -msgstr "Estrazione asset" +msgstr "Decomprimendo Android Build Sources" #: editor/export_template_manager.cpp msgid "Current Version:" @@ -3538,7 +3563,6 @@ msgid "Duplicating folder:" msgstr "Duplicando cartella:" #: editor/filesystem_dock.cpp -#, fuzzy msgid "New Inherited Scene" msgstr "Nuova scena ereditata" @@ -3616,9 +3640,8 @@ msgid "Re-Scan Filesystem" msgstr "Re-Scan Filesystem" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Toggle Split Mode" -msgstr "Attiva/disattiva la modalità split" +msgstr "Attiva/disattiva la modalità Split" #: editor/filesystem_dock.cpp msgid "Search files" @@ -3837,7 +3860,7 @@ msgstr "Importa Come:" #: editor/import_dock.cpp editor/property_editor.cpp msgid "Preset..." -msgstr "Preset..." +msgstr "Preset…" #: editor/import_dock.cpp msgid "Reimport" @@ -4261,7 +4284,6 @@ msgid "Edit Filtered Tracks:" msgstr "Modifica Tracce Filtrate:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Enable Filtering" msgstr "Abilita filtraggio" @@ -4398,9 +4420,8 @@ msgid "Enable Onion Skinning" msgstr "Abilita l'Onion Skinning" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Onion Skinning Options" -msgstr "Onion Skinning" +msgstr "Opzioni dell'onion skinning" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Directions" @@ -4775,6 +4796,10 @@ msgid "Idle" msgstr "Inattivo" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "Installa..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Riprova" @@ -4803,7 +4828,6 @@ msgid "Last" msgstr "Ultimo" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Tutti" @@ -4817,8 +4841,9 @@ msgid "Sort:" msgstr "Ordina:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Inverti" +#, fuzzy +msgid "Reverse sorting." +msgstr "Richiedendo..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4900,32 +4925,32 @@ msgid "Rotation Step:" msgstr "Step Rotazione:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "Muovi guida verticale" +msgid "Move Vertical Guide" +msgstr "Muovi Guida Verticale" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "Crea nuova guida verticale" +msgid "Create Vertical Guide" +msgstr "Crea Guida Verticale" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "Rimuovi guida verticale" +msgid "Remove Vertical Guide" +msgstr "Rimuovi Guida Verticale" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "Sposta guida orizzontale" +msgid "Move Horizontal Guide" +msgstr "Sposta Guida Orizzontale" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "Crea nuova guida orizzontale" +msgid "Create Horizontal Guide" +msgstr "Crea Guida Orizzontale" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "Rimuovi guida orizzontale" +msgid "Remove Horizontal Guide" +msgstr "Rimuovi Guida Orizzontale" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "Crea nuove guide orizzontali e verticali" +msgid "Create Horizontal and Vertical Guides" +msgstr "Crea Guide Orizzontali e Verticali" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -4964,13 +4989,12 @@ msgid "Presets for the anchors and margins values of a Control node." msgstr "Preset per i valori di ancoraggio e margini di un nodo Control." #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "" "When active, moving Control nodes changes their anchors instead of their " "margins." msgstr "" -"Quando è attivo, il movimento dei nodi di Controllo cambia le loro ancore " -"invece dei loro margini." +"Quando attivato, muovere i nodi Control cambia le loro ancore invece dei " +"loro margini." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchors only" @@ -4986,9 +5010,8 @@ msgstr "Cambia Ancore" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Lock Selected" -msgstr "Strumento Seleziona" +msgstr "Blocca selezionato" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5002,9 +5025,8 @@ msgstr "Gruppo Selezionato" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Ungroup Selected" -msgstr "Copia Selezione" +msgstr "Rimuovi selezionati dal gruppo" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Paste Pose" @@ -5015,9 +5037,8 @@ msgid "Create Custom Bone(s) from Node(s)" msgstr "Crea Ossa personalizzate a partire da uno o più Nodi" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Clear Bones" -msgstr "Pulisci Posa" +msgstr "Rimuovi ossa" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -5105,7 +5126,6 @@ msgid "Snapping Options" msgstr "Opzioni di Snapping" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Grid" msgstr "Snap alla griglia" @@ -5127,39 +5147,32 @@ msgid "Use Pixel Snap" msgstr "Usa Pixel Snap" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Smart Snapping" msgstr "Snapping intelligente" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Parent" -msgstr "Snap su Genitore" +msgstr "Snap al Genitore" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Anchor" -msgstr "Snap su ancora nodo" +msgstr "Snap ad ancora del nodo" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Sides" msgstr "Snap sui lati del nodo" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Center" msgstr "Snap al centro del nodo" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Other Nodes" msgstr "Snap ad altri nodi" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Guides" -msgstr "Snap sulle guide" +msgstr "Snap alle guide" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5240,14 +5253,12 @@ msgid "Frame Selection" msgstr "Selezione Frame" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Preview Canvas Scale" -msgstr "Anteprima Atlas" +msgstr "Anteprima dimensione canvas" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Translation mask for inserting keys." -msgstr "Maschera di traduzione per inserimento chiavi" +msgstr "Maschera di traduzione per inserimento chiavi." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation mask for inserting keys." @@ -5268,6 +5279,11 @@ msgid "" "Keys are only added to existing tracks, no new tracks will be created.\n" "Keys must be inserted manually for the first time." msgstr "" +"Inserimento automatico di chiavi quando gli oggetti sono traslati, ruotati o " +"ridimensionati (basato sulla maschera).\n" +"Le chiavi sono soltanto aggiunte su tracciati già esistenti, nessun " +"tracciato nuovo verrà creato.\n" +"Le chiavi devono essere inserite manualmente per la prima volta." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Auto Insert Key" @@ -5294,9 +5310,8 @@ msgid "Divide grid step by 2" msgstr "Dividi per 2 il passo della griglia" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Pan View" -msgstr "Vista dal Retro" +msgstr "Vista panoramica" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Add %s" @@ -5321,7 +5336,6 @@ msgid "Error instancing scene from %s" msgstr "Errore istanziamento scena da %s" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Change Default Type" msgstr "Cambia tipo di default" @@ -5368,9 +5382,8 @@ msgstr "Carica Maschera Emissione" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Restart" -msgstr "Riavvia Ora" +msgstr "Ricomincia" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5450,17 +5463,14 @@ msgid "Load Curve Preset" msgstr "Carica Preset Curve" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Add Point" msgstr "Aggiungi punto" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Remove Point" msgstr "Rimuovi punto" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Left Linear" msgstr "Lineare sinistra" @@ -5469,7 +5479,6 @@ msgid "Right Linear" msgstr "Lineare destra" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Load Preset" msgstr "Carica preset" @@ -5592,9 +5601,8 @@ msgid "Create Trimesh Collision Sibling" msgstr "Crea Fratello di Collisione Trimesh" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Convex Collision Sibling(s)" -msgstr "Crea Fratello di Collisione Convessa" +msgstr "Crea Fratello(i) di Collisione Convessa" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -5913,12 +5921,12 @@ msgstr "Opzioni" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Mirror Handle Angles" -msgstr "" +msgstr "Specchia maniglie angolari" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp msgid "Mirror Handle Lengths" -msgstr "" +msgstr "Specchia lunghezza maniglie" #: editor/plugins/path_editor_plugin.cpp msgid "Curve Point #" @@ -5957,7 +5965,6 @@ msgid "Split Segment (in curve)" msgstr "Spezza Segmento (in curva)" #: editor/plugins/physical_bone_plugin.cpp -#, fuzzy msgid "Move Joint" msgstr "Sposta articolazione" @@ -6093,9 +6100,8 @@ msgstr "" "personalizzato dei poligoni è disabilitato." #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Paint weights with specified intensity." -msgstr "Colora i pesi con le intensità specificate." +msgstr "Colora i pesi con l'intensità specificata." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Unpaint weights with specified intensity." @@ -6293,18 +6299,16 @@ msgid "Find Next" msgstr "Trova Successivo" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter scripts" -msgstr "Filtra proprietà " +msgstr "Filtra script" #: editor/plugins/script_editor_plugin.cpp msgid "Toggle alphabetical sorting of the method list." msgstr "Ordina in ordine alfabetico la lista dei metodi." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter methods" -msgstr "Modalità di filtro:" +msgstr "Modalità di filtraggio" #: editor/plugins/script_editor_plugin.cpp msgid "Sort" @@ -6418,7 +6422,7 @@ msgstr "Debug con Editor Esterno" #: editor/plugins/script_editor_plugin.cpp msgid "Open Godot online documentation." -msgstr "Apri la documentazione online di Godot" +msgstr "Apri la documentazione online di Godot." #: editor/plugins/script_editor_plugin.cpp msgid "Request Docs" @@ -6538,7 +6542,7 @@ msgstr "Evidenziatore di Sintassi" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Vai a" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6546,9 +6550,8 @@ msgid "Bookmarks" msgstr "Segnalibri" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Crea punti." +msgstr "Punti di rottura" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6686,7 +6689,7 @@ msgstr "Imposta Ossa in Posizione di Riposo" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" -msgstr "Skeleton2D" +msgstr "Scheletro2D" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Make Rest Pose (From Bones)" @@ -6837,9 +6840,15 @@ msgid "Rear" msgstr "Retro" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Allinea alla Vista" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Allinea Selezione Con Vista" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Nessun genitore del quale istanziare un figlio." @@ -6954,15 +6963,14 @@ msgid "Select Mode (Q)" msgstr "Modalità di Selezione (Q)" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "" "Drag: Rotate\n" "Alt+Drag: Move\n" "Alt+RMB: Depth list selection" msgstr "" "Trascina: Ruota\n" -"Alt+Trascina: Muovi\n" -"Alt+PDM: Selezione Lista Profondità " +"Alt+Trascina: Sposta\n" +"Alt+RMB: Selezione Lista Profondità " #: editor/plugins/spatial_editor_plugin.cpp msgid "Move Mode (W)" @@ -7013,7 +7021,6 @@ msgid "Right View" msgstr "Vista Destra" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Switch Perspective/Orthogonal View" msgstr "Cambia tra Vista Prospettiva/Ortogonale" @@ -7030,10 +7037,6 @@ msgid "Focus Selection" msgstr "Centra a Selezione" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Allinea Selezione Con Vista" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Strumento Seleziona" @@ -7059,7 +7062,6 @@ msgid "Transform" msgstr "Trasforma" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Object to Floor" msgstr "Posa l'oggetto sul suolo" @@ -7173,9 +7175,8 @@ msgid "Nameless gizmo" msgstr "Gizmo senza nome" #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Create Mesh2D" -msgstr "Crea Mesh 2D" +msgstr "Crea Mesh2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Create Polygon2D" @@ -7204,9 +7205,8 @@ msgid "Invalid geometry, can't replace by mesh." msgstr "Geometria non valida, impossibile sostituirla con una mesh." #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Convert to Mesh2D" -msgstr "Converti in Mesh 2D" +msgstr "Converti in Mesh2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Invalid geometry, can't create polygon." @@ -7599,14 +7599,6 @@ msgid "Transpose" msgstr "Trasponi" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Specchia X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Specchia Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "Disabilita Autotile" @@ -7631,27 +7623,22 @@ msgid "Pick Tile" msgstr "Preleva Tile" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Rotate Left" msgstr "Ruota a sinistra" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Rotate Right" msgstr "Ruota a destra" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Flip Horizontally" -msgstr "Ribalta in orizzontale" +msgstr "Ribalta orizzontalmente" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Flip Vertically" -msgstr "Ribalta in verticale" +msgstr "Ribalta verticalmente" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Clear Transform" msgstr "Cancella la trasformazione" @@ -7688,9 +7675,8 @@ msgid "Select the previous shape, subtile, or Tile." msgstr "Seleziona la precedente forma, sottotile, o Tile." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Region Mode" -msgstr "Modalità esecuzione:" +msgstr "Modalità regione" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Collision Mode" @@ -8011,6 +7997,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Tipo di Input Visual Shader Cambiato" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(Solo GLES3)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vertice" @@ -8032,7 +8022,7 @@ msgstr "Colora funzione." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color operator." -msgstr "" +msgstr "Operatore colore." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Grayscale function." @@ -8059,280 +8049,334 @@ msgid "Darken operator." msgstr "Operatore Darken." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Difference operator." -msgstr "Solo le Differenze" +msgstr "Operatore \"differenza\"." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Dodge operator." -msgstr "" +msgstr "Operatore schivata." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "HardLight operator" -msgstr "" +msgstr "Operatore HardLight" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Lighten operator." -msgstr "" +msgstr "Operatore \"schiarischi\"." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Overlay operator." -msgstr "" +msgstr "Operatore overlay." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Screen operator." -msgstr "" +msgstr "Operatore schermo." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "SoftLight operator." -msgstr "" +msgstr "Operatore SoftLight." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Color constant." -msgstr "Costante" +msgstr "Costante di colore." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Color uniform." -msgstr "Cancella la trasformazione" +msgstr "Uniforme di colore." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Ritorna il risultato booleano del confronto di %s tra due parametri." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "Uguale (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "Maggiore Di (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "Maggiore o Uguale (>=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." msgstr "" +"Ritorna un vettore associato se gli scalari di quello fornito sono uguali, " +"maggiori o minori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns an associated vector if the provided boolean value is true or false." +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." msgstr "" +"Ritorna il risultato booleano del confronto tra INF e un parametro scalare." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" +"Ritorna il risultato booleano del confronto tra NaN e un parametro scalare." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "Minore Di (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "Minore o Uguale (<=)" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "Not Equal (!=)" +msgstr "Non Uguale (!=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns an associated vector if the provided boolean value is true or false." +msgstr "" +"Ritorna un vettore associato se il valore booleano fornito è vero o falso." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Ritorna il risultato booleano del confronto tra due parametri." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" +"Ritorna il risultato booleano del confronto tra INF (o NaN) e un parametro " +"scalare." + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." -msgstr "Cambia Costante Vett." +msgstr "Costante booleana." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean uniform." -msgstr "" +msgstr "Uniforme booleana." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for all shader modes." -msgstr "" +msgstr "Parametro di input '%s' per tutte le modalità shader." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Input parameter." -msgstr "Snap su Genitore" +msgstr "Parametro di input." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader modes." -msgstr "" +msgstr "Parametro di input '%s' per le modalità shader vertex e fragment." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for fragment and light shader modes." -msgstr "" +msgstr "Parametro di input '%s' per le modalità shader fragment e light." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for fragment shader mode." -msgstr "" +msgstr "Parametro di input '%s' per la modalità shader fragment." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for light shader mode." -msgstr "" +msgstr "Parametro di input '%s' per la modalità shader light." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex shader mode." -msgstr "" +msgstr "Parametro di input '%s' per la modalità shader vertex." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader mode." -msgstr "" +msgstr "Parametro di input '%s' per la modalità shader vertex e fragment." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar function." -msgstr "Cambia Funzione Scalare" +msgstr "Funzione scalare." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar operator." -msgstr "Cambia Operatore Scalare" +msgstr "Operatore scalare." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "E constant (2.718282). Represents the base of the natural logarithm." -msgstr "" +msgstr "La costante E (2.718282). Rappresenta la base del logaritmo naturale." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Epsilon constant (0.00001). Smallest possible scalar number." -msgstr "" +msgstr "La costante Epsilon (0.00001). Il numero scalare più piccolo." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Phi constant (1.618034). Golden ratio." -msgstr "" +msgstr "La costante Phi (1.618034). Il rapporto aureo." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/4 constant (0.785398) or 45 degrees." -msgstr "" +msgstr "La costante Pi/4 (0.785398 radianti), o 45 gradi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/2 constant (1.570796) or 90 degrees." -msgstr "" +msgstr "La costante Pi/2 (1.570796 radianti), o 90 gradi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi constant (3.141593) or 180 degrees." -msgstr "" +msgstr "La costante Pi (3.141593 radianti), o 180 gradi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Tau constant (6.283185) or 360 degrees." -msgstr "" +msgstr "La costante Tau (6.283185 radianti), o 360 gradi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Sqrt2 constant (1.414214). Square root of 2." -msgstr "" +msgstr "La costante Sqrt2 (1.414214). La radice quadrata di 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the absolute value of the parameter." -msgstr "" +msgstr "Ritorna il valore assoluto del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-cosine of the parameter." -msgstr "" +msgstr "Ritorna l'arco-coseno del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "" +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "Ritorna l'inversa del coseno iperbolico del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." -msgstr "" +msgstr "Ritorna l'arco-seno del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "" +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "Ritorna l'inversa del seno iperbolico del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." -msgstr "" +msgstr "Ritorna l'arco-tangente del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameters." -msgstr "" +msgstr "Ritorna l'arco-tangente dei parametri." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "" +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "Ritorna l'inversa della tangente iperbolica del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Finds the nearest integer that is greater than or equal to the parameter." msgstr "" +"Trova il numero intero più vicino che sia maggiore o uguale al parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Constrains a value to lie between two further values." -msgstr "" +msgstr "Vincola un valore tra due altri valori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the cosine of the parameter." -msgstr "" +msgstr "Ritorna il coseno del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "" +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "Ritorna il coseno iperbolico del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." -msgstr "" +msgstr "Converte una quantità di radianti in gradi." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-e Exponential." -msgstr "" +msgstr "Esponenziale in base e." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-2 Exponential." -msgstr "" +msgstr "Esponenziale in base 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Finds the nearest integer less than or equal to the parameter." msgstr "" +"Trova il numero intero più vicino che sia minore o uguale al parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Computes the fractional part of the argument." -msgstr "" +msgstr "Calcola la parte frazionaria dell'argomento." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse of the square root of the parameter." -msgstr "" +msgstr "Ritorna l'inversa della radice quadrata del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Natural logarithm." -msgstr "" +msgstr "Logaritmo naturale." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-2 logarithm." -msgstr "" +msgstr "Logaritmo in base 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the greater of two values." -msgstr "" +msgstr "Ritorna il maggiore di due valori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the lesser of two values." -msgstr "" +msgstr "Ritorna il minore di due valori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two scalars." -msgstr "" +msgstr "Interpolazione lineare tra due scalari." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the opposite value of the parameter." -msgstr "" +msgstr "Ritorna il valore opposto del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - scalar" -msgstr "" +msgstr "1.0 - scalare" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns the value of the first parameter raised to the power of the second." msgstr "" +"Ritorna il valore del primo parametro elevato alla potenza del secondo." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in degrees to radians." -msgstr "" +msgstr "Converte una quantità in gradi in radianti." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / scalar" -msgstr "" +msgstr "1.0 / scalare" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "" +msgid "Finds the nearest integer to the parameter." +msgstr "Trova il numero intero più vicino al parametro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "" +msgid "Finds the nearest even integer to the parameter." +msgstr "Trova il numero intero pari più vicino al parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." -msgstr "" +msgstr "Blocca il valore tra 0.0 ed 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Extracts the sign of the parameter." -msgstr "" +msgstr "Estrae il segno del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the sine of the parameter." -msgstr "" +msgstr "Ritorna il seno del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "" +msgid "Returns the hyperbolic sine of the parameter." +msgstr "Ritorna il seno iperbolico del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." -msgstr "" +msgstr "Ritorna la radice quadrata del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8342,6 +8386,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( scalar(edge0), scalar(edge1), scalar(x) ).\n" +"\n" +"Ritorna 0.0 se 'x' è più piccolo di 'edge0', o 1.0 se 'x' è più largo di " +"'edge1'. Altrimenti, il valore di ritorno è interpolato tra 0.0 ed 1.0 " +"usando i polinomi di Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8349,75 +8398,80 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Step function( scalar(edge), scalar(x) ).\n" +"\n" +"Ritorna 0.0 se 'x' è più piccolo di 'edge', altrimenti 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the tangent of the parameter." -msgstr "" +msgstr "Ritorna la tangente del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "" +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "Ritorna la tangente iperbolica del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "" +msgid "Finds the truncated value of the parameter." +msgstr "Trova il valore troncato del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." -msgstr "" +msgstr "Aggiunge scalare allo scalare." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides scalar by scalar." -msgstr "" +msgstr "Divide lo scalare per scalare." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies scalar by scalar." -msgstr "" +msgstr "Moltiplica lo scalare per scalare." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two scalars." -msgstr "" +msgstr "Ritorna il resto dei due scalari." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts scalar from scalar." -msgstr "" +msgstr "Sottrae scalare dallo scalare." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar constant." -msgstr "Cambia Costante Scalare" +msgstr "Costante scalare." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar uniform." -msgstr "Cambia Uniforme Scalare" +msgstr "Uniforme scalare." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the cubic texture lookup." -msgstr "" +msgstr "Esegue la ricerca di texture cubiche." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the texture lookup." -msgstr "" +msgstr "Esegue la ricerca di texture." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." -msgstr "Cambia Uniforme Texture" +msgid "Cubic texture uniform lookup." +msgstr "Controllo dinamico dell'uniforme della texture cubica." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." -msgstr "Cambia Uniforme Texture" +msgid "2D texture uniform lookup." +msgstr "Controllo dinamico dell'uniforme della texture 2D." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy +msgid "2D texture uniform lookup with triplanar." +msgstr "Controllo dinamico dell'uniforme della texture cubica con triplanar." + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Transform function." -msgstr "Finestra di Transform..." +msgstr "Funzione di trasformazione." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8425,112 +8479,125 @@ 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 "" +"Calcola il prodotto esterno di una coppia di vettori.\n" +"\n" +"OuterProduct considera il primo parametro 'c' come un vettore colonna " +"(matrice con una colonna) ed il secondo, 'r', come un vettore riga (matrice " +"con una riga) ed esegue una moltiplicazione algebrica lineare di matrici 'c " +"* r', creando una matrice i cui numeri di righe sono il numero di componenti " +"di 'c' e le cui colonne sono il numero di componenti in 'r'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes transform from four vectors." -msgstr "" +msgstr "Compone la trasformazione da quattro vettori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes transform to four vectors." -msgstr "" +msgstr "Scompone la trasformazione in quattro vettori." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "" +msgid "Calculates the determinant of a transform." +msgstr "Calcola il determinante di una trasformazione." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "" +msgid "Calculates the inverse of a transform." +msgstr "Calcola l'inverso di una trasformazione." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "" +msgid "Calculates the transpose of a transform." +msgstr "Calcola la trasposizione di una trasformazione." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." -msgstr "" +msgstr "Moltiplica la trasformazione per la trasformazione." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by transform." -msgstr "" +msgstr "Moltiplica il vettore per la trasformazione." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform constant." -msgstr "Transform Abortito." +msgstr "Costante transform." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform uniform." -msgstr "Transform Abortito." +msgstr "Uniforme transform." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector function." -msgstr "Assegnazione alla funzione." +msgstr "Funzione vettore." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector operator." -msgstr "Cambia Operatore Vett." +msgstr "Operatore vettore." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes vector from three scalars." -msgstr "" +msgstr "Compone il vettore da tre scalari." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes vector to three scalars." -msgstr "" +msgstr "Scompone il vettore a tre scalari." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the cross product of two vectors." -msgstr "" +msgstr "Calcola il prodotto incrociato di due vettori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the distance between two points." -msgstr "" +msgstr "Ritorna la distanza tra due punti." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the dot product of two vectors." -msgstr "" +msgstr "Calcola il prodotto scalare di due vettori." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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 "" +"Ritorna un vettore che punta nella stessa direzione di quello di " +"riferimento. La funzione ha tre vettori parametro: N, il vettore da " +"orientare; I, il vettore incidente; ed Nref, il vettore di riferimento. Se " +"il prodotto scalare di I ed Nref è minore di zero, il valore di ritorno è N. " +"Altrimenti il ritorno sarà -N." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." -msgstr "" +msgstr "Calcola la lunghezza di un vettore." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two vectors." -msgstr "" +msgstr "Interpolazione lineare tra due vettori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the normalize product of vector." -msgstr "" +msgstr "Calcola il prodotto di normalizzazione del vettore." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - vector" -msgstr "" +msgstr "1.0 - vettore" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / vector" -msgstr "" +msgstr "1.0 / vettore" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" +"Ritorna un vettore che punta nella direzione della riflessione ( a : vettore " +"incidente, b : vettore normale )." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." -msgstr "" +#, fuzzy +msgid "Returns the vector that points in the direction of refraction." +msgstr "Ritorna un vettore che punta nella direzione della refrazione." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8540,6 +8607,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( vector(edge0), vector(edge1), vector(x) ).\n" +"\n" +"Ritorna 0.0 se 'x' è minore di 'edge0', ed 1.0 se 'x' è maggiore di 'edge1'. " +"Altrimenti, il valore di ritorno è interpolato tra 0.0 ed 1.0 usando i " +"polinomiali di Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8549,6 +8621,11 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( scalar(edge0), scalar(edge1), vector(x) ).\n" +"\n" +"Ritorna 0.0 se 'x' è minore di 'edge0', ed 1.0 se 'x' è maggiore di 'edge1'. " +"Altrimenti, il valore di ritorno è interpolato tra 0.0 ed 1.0 usando i " +"polinomiali di Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8556,6 +8633,9 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Step function( vector(edge), vector(x) ).\n" +"\n" +"Ritorna 0.0 se 'x' è minore di 'edge', altrimenti 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8563,36 +8643,37 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Step function( scalar(edge), vector(x) ).\n" +"\n" +"Ritorna 0.0 se 'x' è minore di 'edge', altrimenti 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds vector to vector." -msgstr "" +msgstr "Aggiunge un vettore al vettore." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides vector by vector." -msgstr "" +msgstr "Divide vettore per vettore." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by vector." -msgstr "" +msgstr "Moltiplica vettore per vettore." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two vectors." -msgstr "" +msgstr "Ritorna il resto dei due vettori." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts vector from vector." -msgstr "" +msgstr "Sottrae vettore dal vettore." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector constant." -msgstr "Cambia Costante Vett." +msgstr "Costante vettore." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector uniform." -msgstr "Assegnazione all'uniforme." +msgstr "Uniforme vettore." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8600,56 +8681,83 @@ 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 "" +"Una espressione del Custom Godot Shader Language, con quantità " +"personalizzabile di porte input ed output. Questa è una iniezione diretta di " +"codice nella funzione vertex/fragment/light. Non usarla per scrivere le " +"dichiarazione della funzione all'interno." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns falloff based on the dot product of surface normal and view " "direction of camera (pass associated inputs to it)." msgstr "" +"Ritorna il decadimento in base al prodotto scalare della normale della " +"superfice e direzione della telecamera (passa gli input associati ad essa)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "" +#, fuzzy +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(solo GLES3) (Solo modalità Fragment/Light) Fuzione derivata scalare." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +#, fuzzy +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" +"(solo GLES3) (Solo modalità Fragment/Light) Fuzione derivata vettoriale." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" +"(solo GLES3) (Solo modalità Fragment/Light) (Vettore) Derivata in 'x' usando " +"la differenziazione locale." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" +"(solo GLES3) (Solo modalità Fragment/Light) (Scalare) Derivata in 'x' usando " +"la differeziazione locale." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" +"(solo GLES3) (soltanto modalità Fragment/Light) (Vettore) Derivata in 'y' " +"usando la differenziazione locale." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" +"(solo GLES3) (soltanto modalità Fragment/Light) (Scalare) Derivata in 'y' " +"usando la differenziazione locale." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" +"(solo GLES3) (soltanto modalità Fragment/Light) (Vettore) Somma delle " +"derivate assolute in 'x' ed 'y'." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" +"(solo GLES3) (soltanto modalità Fragment/Light) (Scalare) Somma delle " +"derivate assolute in 'x' ed 'y'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -8992,7 +9100,6 @@ msgid "Are you sure to open more than one project?" msgstr "Sei sicuro di voler aprire più di un progetto?" #: editor/project_manager.cpp -#, fuzzy msgid "" "The following project settings file does not specify the version of Godot " "through which it was created.\n" @@ -9015,7 +9122,6 @@ msgstr "" "precedenti del motore." #: editor/project_manager.cpp -#, fuzzy msgid "" "The following project settings file was generated by an older engine " "version, and needs to be converted for this version:\n" @@ -9027,8 +9133,7 @@ msgid "" "engine anymore." msgstr "" "Il seguente file delle impostazioni del progetto è stato generato da una " -"versione precedente del motore e deve essere convertito per questa " -"versione:\n" +"versione precedente del motore e deve essere convertito a questa versione:\n" "\n" "%s\n" "\n" @@ -9045,14 +9150,13 @@ msgstr "" "del motore, le cui impostazioni non sono compatibili con questa versione." #: editor/project_manager.cpp -#, fuzzy msgid "" "Can't run project: no main scene defined.\n" "Please edit the project and set the main scene in the Project Settings under " "the \"Application\" category." msgstr "" "Non è possibile eseguire il progetto: nessuna scena principale definita.\n" -"Si prega di modificare il progetto e impostare la scena principale in " +"Si prega di modificare il progetto e di impostare la scena principale in " "\"Impostazioni Progetto\" nella categoria \"Applicazione\"." #: editor/project_manager.cpp @@ -9064,36 +9168,32 @@ msgstr "" "Per favore modifica il progetto per azionare l'importo iniziale." #: editor/project_manager.cpp -#, fuzzy msgid "Are you sure to run %d projects at once?" -msgstr "Sei sicuro di voler eseguire più di un progetto?" +msgstr "Sei sicuro di voler eseguire %d progetti contemporaneamente?" #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove %d projects from the list?\n" "The project folders' contents won't be modified." msgstr "" -"Rimuovere progetto dalla lista? (I contenuti della cartella non saranno " -"modificati)" +"Rimuovere %d progetti dalla lista?\n" +"I contenuti delle cartelle di progetto non saranno modificati." #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove this project from the list?\n" "The project folder's contents won't be modified." msgstr "" -"Rimuovere progetto dalla lista? (I contenuti della cartella non saranno " -"modificati)" +"Rimuovere questo progetto dalla lista?\n" +"I contenuti della cartella di progetto non saranno modificati." #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove all missing projects from the list? (Folders contents will not be " "modified)" msgstr "" -"Rimuovere progetto dalla lista? (I contenuti della cartella non saranno " -"modificati)" +"Rimuovere tutti i progetti mancanti dalla lista?\n" +"(Il contenuto delle cartelle di progetto non saranno modificati)" #: editor/project_manager.cpp msgid "" @@ -9105,11 +9205,13 @@ msgstr "" "gestore dei progetti sarà avviato." #: editor/project_manager.cpp -#, fuzzy msgid "" "Are you sure to scan %s folders for existing Godot projects?\n" "This could take a while." -msgstr "Stai per esaminare %s cartelle per progetti Godot esistenti. Confermi?" +msgstr "" +"Sei sicuro di voler scannerizzare %s cartelle per progetti Godot già " +"esistenti?\n" +"Per questo potrebbe volerci un pò." #: editor/project_manager.cpp msgid "Project Manager" @@ -9132,9 +9234,8 @@ msgid "New Project" msgstr "Nuovo Progetto" #: editor/project_manager.cpp -#, fuzzy msgid "Remove Missing" -msgstr "Rimuovi punto" +msgstr "Rimuovi mancante" #: editor/project_manager.cpp msgid "Templates" @@ -9153,13 +9254,12 @@ msgid "Can't run project" msgstr "Impossibile eseguire il progetto" #: editor/project_manager.cpp -#, fuzzy msgid "" "You currently don't have any projects.\n" "Would you like to explore official example projects in the Asset Library?" msgstr "" -"Al momento non hai alcun progetto.\n" -"Ti piacerebbe esplorare gli esempi ufficiali nella Libreria delle Risorse?" +"Al momento non hai nessun progetto.\n" +"Ti piacerebbe esplorare gli esempi ufficiali nella libreria degli Asset?" #: editor/project_settings_editor.cpp msgid "Key " @@ -9186,9 +9286,8 @@ msgstr "" "'\\' oppure '\"'" #: editor/project_settings_editor.cpp -#, fuzzy msgid "An action with the name '%s' already exists." -msgstr "L'Azione '%s' esiste già !" +msgstr "Un'azione col nome '%s' è già esistente." #: editor/project_settings_editor.cpp msgid "Rename Input Action Event" @@ -9196,7 +9295,7 @@ msgstr "Rinomina Evento di Azione Input" #: editor/project_settings_editor.cpp msgid "Change Action deadzone" -msgstr "" +msgstr "Cambia la zona morta d'azione" #: editor/project_settings_editor.cpp msgid "Add Input Action Event" @@ -9388,11 +9487,11 @@ msgstr "Rimuovi Opzione di Remap Rimorse" #: editor/project_settings_editor.cpp msgid "Changed Locale Filter" -msgstr "" +msgstr "Filtro lingue modificato" #: editor/project_settings_editor.cpp msgid "Changed Locale Filter Mode" -msgstr "" +msgstr "Modalità filtro lingue modificata" #: editor/project_settings_editor.cpp msgid "Project Settings (project.godot)" @@ -9407,9 +9506,8 @@ msgid "Override For..." msgstr "Sovrascrivi Per..." #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp -#, fuzzy msgid "The editor must be restarted for changes to take effect." -msgstr "Per rendere effettive le modifiche è necessario un riavvio dell'editor" +msgstr "Per rendere effettive le modifiche, l'editor deve essere riavviato." #: editor/project_settings_editor.cpp msgid "Input Map" @@ -9425,7 +9523,7 @@ msgstr "Azione" #: editor/project_settings_editor.cpp msgid "Deadzone" -msgstr "" +msgstr "Zona morta" #: editor/project_settings_editor.cpp msgid "Device:" @@ -9465,15 +9563,13 @@ msgstr "Locale" #: editor/project_settings_editor.cpp msgid "Locales Filter" -msgstr "" +msgstr "Filtro lingue" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show All Locales" msgstr "Mostra tutte le lingue" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show Selected Locales Only" msgstr "Mostra solo le lingue selezionate" @@ -9562,7 +9658,6 @@ msgid "Suffix" msgstr "Suffisso" #: editor/rename_dialog.cpp -#, fuzzy msgid "Advanced Options" msgstr "Opzioni avanzate" @@ -9825,9 +9920,8 @@ msgid "User Interface" msgstr "Interfaccia Utente" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Other Node" -msgstr "Elimina Nodo" +msgstr "Altro nodo" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" @@ -9870,7 +9964,6 @@ msgid "Clear Inheritance" msgstr "Liberare ereditarietà " #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Open Documentation" msgstr "Apri la documentazione" @@ -9879,9 +9972,8 @@ msgid "Add Child Node" msgstr "Aggiungi Nodo Figlio" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Expand/Collapse All" -msgstr "Comprimi Tutto" +msgstr "Espandi/Collassa tutto" #: editor/scene_tree_dock.cpp msgid "Change Type" @@ -9892,6 +9984,11 @@ msgid "Extend Script" msgstr "Estendi Script" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Reparent Nodo" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Rendi Scena Radice" @@ -9912,9 +10009,8 @@ msgid "Delete (No Confirm)" msgstr "Elimina (Senza Conferma)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Add/Create a New Node." -msgstr "Aggiungi/Crea un Nuovo Nodo" +msgstr "Aggiungi/Crea un Nuovo Nodo." #: editor/scene_tree_dock.cpp msgid "" @@ -9949,19 +10045,16 @@ msgid "Toggle Visible" msgstr "Attiva/Disattiva Visibilità " #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Unlock Node" -msgstr "Seleziona Nodo" +msgstr "Sblocca nodo" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Button Group" -msgstr "Pulsante 7" +msgstr "Gruppo pulsanti" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "(Connecting From)" -msgstr "Errore di Connessione" +msgstr "(Collegamento da)" #: editor/scene_tree_editor.cpp msgid "Node configuration warning:" @@ -9992,9 +10085,8 @@ msgstr "" "Fai click per mostrare il dock gruppi." #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Open Script:" -msgstr "Apri Script" +msgstr "Apri script:" #: editor/scene_tree_editor.cpp msgid "" @@ -10021,6 +10113,8 @@ msgid "" "AnimationPlayer is pinned.\n" "Click to unpin." msgstr "" +"AnimationPlayer è bloccato.\n" +"Fare clic per sbloccare." #: editor/scene_tree_editor.cpp msgid "Invalid node name, the following characters are not allowed:" @@ -10043,39 +10137,32 @@ msgid "Select a Node" msgstr "Scegli un Nodo" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is empty." -msgstr "Percorso vuoto" +msgstr "Il percorso è vuoto." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Filename is empty." -msgstr "Il nome del file è vuoto" +msgstr "Il nome del file è vuoto." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is not local." -msgstr "Percorso non locale" +msgstr "Percorso non locale." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid base path." -msgstr "Percorso di base invalido" +msgstr "Percorso di base non valido." #: editor/script_create_dialog.cpp -#, fuzzy msgid "A directory with the same name exists." -msgstr "Una cartella con lo stesso nome esiste già " +msgstr "Esiste già una directory con lo stesso nome." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid extension." -msgstr "Estensione Invalida" +msgstr "Estensione non valida." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Wrong extension chosen." -msgstr "Estensione scelta errata" +msgstr "Selezionata estensione errata." #: editor/script_create_dialog.cpp msgid "Error loading template '%s'" @@ -10094,52 +10181,45 @@ msgid "N/A" msgstr "N/A" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Open Script / Choose Location" -msgstr "Apri Script/Scegli Posizione" +msgstr "Apri Script / Scegli Posizione" #: editor/script_create_dialog.cpp msgid "Open Script" msgstr "Apri Script" #: editor/script_create_dialog.cpp -#, fuzzy msgid "File exists, it will be reused." -msgstr "Il file esiste, sarà riutilizzato" +msgstr "Il file è già esistente, quindi, verrà riutilizzato." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid class name." -msgstr "Nome classe invalido" +msgstr "Nome classe non valido." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid inherited parent name or path." -msgstr "Nome genitore ereditato o percorso invalido" +msgstr "Nome o percorso genitore ereditato non valido." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script is valid." -msgstr "Script valido" +msgstr "Lo script è valido." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "Consentiti: a-z, A-Z, 0-9 e _" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Built-in script (into scene file)." -msgstr "Script built-in (nel file scena)" +msgstr "Script incorporato (nel file della scena)." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will create a new script file." -msgstr "Crea nuovo file script" +msgstr "Verrà creato un nuovo file di script." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will load an existing script file." -msgstr "Carica file script esistente" +msgstr "Caricherà un file di script esistente." #: editor/script_create_dialog.cpp msgid "Language" @@ -10271,7 +10351,7 @@ msgstr "Imposta da Tree" #: editor/script_editor_debugger.cpp msgid "Export measures as CSV" -msgstr "" +msgstr "Esporta misure in formato CSV" #: editor/settings_config_dialog.cpp msgid "Erase Shortcut" @@ -10311,7 +10391,7 @@ msgstr "Cambia dimensione Telecamera" #: editor/spatial_editor_gizmos.cpp msgid "Change Notifier AABB" -msgstr "" +msgstr "Cambia notificatore AABB" #: editor/spatial_editor_gizmos.cpp msgid "Change Particles AABB" @@ -10403,12 +10483,11 @@ msgstr "GDNativeLibrary" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Enabled GDNative Singleton" -msgstr "" +msgstr "Singleton GDNative abilitato" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Disabled GDNative Singleton" -msgstr "Disabilita l'icona girevole di aggiornamento" +msgstr "Singleton GDNative disabilitato" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Library" @@ -10496,9 +10575,8 @@ msgid "GridMap Fill Selection" msgstr "GridMap Riempi Selezione" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paste Selection" -msgstr "GridMap Elimina Selezione" +msgstr "Sezione GridMap incolla" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "GridMap Paint" @@ -10586,7 +10664,7 @@ msgstr "Il nome della classe non può essere una parola chiave riservata" #: modules/mono/mono_gd/gd_mono_utils.cpp msgid "End of inner exception stack trace" -msgstr "" +msgstr "Fine dell'analisi dell’eccezione interna dello stack" #: modules/recast/navigation_mesh_editor_plugin.cpp msgid "Bake NavMesh" @@ -10877,9 +10955,8 @@ msgid "Available Nodes:" msgstr "Nodi Disponibili:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Select or create a function to edit its graph." -msgstr "Seleziona o crea una funzione per modificare il grafico" +msgstr "Seleziona o crea una funzione per modificarne il grafico." #: modules/visual_script/visual_script_editor.cpp msgid "Delete Selected" @@ -11020,15 +11097,21 @@ msgstr "" #: platform/android/export/export.cpp msgid "Custom build requires a valid Android SDK path in Editor Settings." msgstr "" +"Le build personalizzate richiedono un percorso per un Android SDK valido " +"nelle impostazioni dell'editor." #: platform/android/export/export.cpp msgid "Invalid Android SDK path for custom build in Editor Settings." msgstr "" +"Percorso per Android SDK per build personalizzata nelle impostazioni " +"dell'editor non è valido." #: platform/android/export/export.cpp msgid "" "Android project is not installed for compiling. Install from Editor menu." msgstr "" +"Android Project non è installato per la compilazione. Installalo dal menu " +"Editor." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -11043,6 +11126,9 @@ msgid "" "Trying to build from a custom built template, but no version info for it " "exists. Please reinstall from the 'Project' menu." msgstr "" +"Tentativo di costruire da un template build personalizzato, ma nesuna " +"informazione sulla sua versione esiste. Perfavore, reinstallalo dal menu " +"'Progetto'." #: platform/android/export/export.cpp msgid "" @@ -11051,20 +11137,28 @@ msgid "" " Godot Version: %s\n" "Please reinstall Android build template from 'Project' menu." msgstr "" +"Versione build di Android non coerente:\n" +" Template installato: %s\n" +" Versione Godot: %s\n" +"Perfavore, reinstalla il build template di Android dal menu 'Progetto'." #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" -msgstr "" +msgstr "Compilazione di un progetto 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 "" +"Costruzione del progetto Android fallita, controlla l'output per vedere gli " +"errori.\n" +"In alternativa, visita docs.godotengine.org per la documentazione della " +"build Android." #: platform/android/export/export.cpp msgid "No build apk generated at: " -msgstr "" +msgstr "Nessun apk build generato a: " #: platform/iphone/export/export.cpp msgid "Identifier is missing." @@ -11198,13 +11292,12 @@ msgstr "" "620x300)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." msgstr "" "Una risorsa SpriteFrames deve essere creata o impostata nella proprietà " -"'Frames' affinché AnimatedSprite mostri i frame." +"\"Frames\" in modo da far mostrare i frame dal nodo AnimatedSprite." #: scene/2d/canvas_modulate.cpp msgid "" @@ -11269,13 +11362,12 @@ msgstr "" "\"Animazione Particelle\" abilitata." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." msgstr "" -"Una texture con la forma della luce deve essere fornita nella proprietà " -"'texture'." +"Una texture con una forma della luce deve essere fornita alla proprietà " +"\"Texture\"." #: scene/2d/light_occluder_2d.cpp msgid "" @@ -11285,11 +11377,9 @@ msgstr "" "l'occlusore abbia effetto." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." msgstr "" -"Il poligono di occlusione per questo occlusore è vuoto. Per favore disegna " -"un poligono!" +"Il poligono per questo occluder è vuoto. Perfavore, disegna un poligono." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11380,63 +11470,54 @@ msgstr "" "Skeleton2D e impostane una." #: scene/2d/tile_map.cpp -#, fuzzy msgid "" "TileMap with Use Parent on needs a parent CollisionObject2D to give shapes " "to. Please use it as a child of Area2D, StaticBody2D, RigidBody2D, " "KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionShape2D serve a fornire una forma di collisione ad un nodo derivato " -"di CollisionObject2D. Si prega di utilizzarlo solamente come figlio di " -"Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. in modo da dargli " -"una forma." +"TileMap con Use Parent abilitato richiede un genitore CollisionObject2D per " +"dargli forma. Perfavore, usalo come figlio di Area2D, StaticBody2D, " +"RigidBody2D, KinematicBody2D, etc. per dargli una forma." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." msgstr "" -"VisibilityEnable2D funziona al meglio quando usato direttamente come " -"genitore con il root della scena modificata." +"VisibilityEnabler2D funziona meglio quando usato con il nodo principale " +"della scena ereditata direttamente come genitore." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera deve avere un nodo ARVROrigin come suo genitore" +msgstr "ARVRCamera deve avere un nodo ARVROrigin come genitore." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRController must have an ARVROrigin node as its parent." -msgstr "ARVRController deve avere un nodo ARVROrigin come suo genitore" +msgstr "ARVRController deve avere un nodo ARVROrigin come genitore." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "" "The controller ID must not be 0 or this controller won't be bound to an " "actual controller." msgstr "" -"L'id del controller non deve essere 0 o questo controller non sarà legato ad " -"un vero controller" +"L'id del controller non deve essere 0 o non verrà associato ad un controller " +"attuale." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRAnchor must have an ARVROrigin node as its parent." -msgstr "ARVRAnchor deve avere un nodo ARVROrigin come suo genitore" +msgstr "ARVRAnchor deve avere un nodo ARVROrigin come genitore." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "" "The anchor ID must not be 0 or this anchor won't be bound to an actual " "anchor." msgstr "" -"L'id dell'ancora non deve essere 0 o questa ancora non sarà legata ad una " -"vera ancora" +"L'ID dell'ancora non deve essere 0 oppure non verrà associato ad un'ancora " +"attuale." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVROrigin requires an ARVRCamera child node." -msgstr "ARVROrigin necessita di un nodo figlio ARVRCamera" +msgstr "ARVROrigin richiede un nodo figlio di tipo ARVRCamera." #: scene/3d/baked_lightmap.cpp msgid "%d%%" @@ -11448,11 +11529,11 @@ msgstr "(Tempo Rimanente: %d:%02d s)" #: scene/3d/baked_lightmap.cpp msgid "Plotting Meshes: " -msgstr "" +msgstr "Stampa Meshes: " #: scene/3d/baked_lightmap.cpp msgid "Plotting Lights:" -msgstr "" +msgstr "Stampando Luci:" #: scene/3d/baked_lightmap.cpp scene/3d/gi_probe.cpp msgid "Finishing Plot" @@ -11460,7 +11541,7 @@ msgstr "Trama di Finitura" #: scene/3d/baked_lightmap.cpp msgid "Lighting Meshes: " -msgstr "" +msgstr "Illuminando Meshes: " #: scene/3d/collision_object.cpp msgid "" @@ -11499,36 +11580,36 @@ msgstr "" "StaticBody, RigidBody, KinematicBody, etc. in modo da dargli una forma." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" -"Perché CollisionShape funzioni deve essere fornita una forma. Si prega di " -"creare una risorsa forma (shape)!" +"Una forma deve essere fornita per il CollisionShape per farlo funzionare. " +"Perfavore, creali una risorsa \"forma\"." #: scene/3d/collision_shape.cpp msgid "" "Plane shapes don't work well and will be removed in future versions. Please " "don't use them." msgstr "" +"Le forme planari non funzionano bene e verranno rimosse nelle versioni " +"future. Per favore, non usarle." #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Niente è visibile perché non è stata assegnata alcuna mesh." #: scene/3d/cpu_particles.cpp -#, fuzzy msgid "" "CPUParticles animation requires the usage of a SpatialMaterial whose " "Billboard Mode is set to \"Particle Billboard\"." msgstr "" -"L'animazione delle particelle richiede l'utilizzo di uno SpatialMaterial con " -"\"Billboard Particles\" abilitato." +"Le animazioni per CPUParticles richiedono l'uso di un SpatialMaterial la cui " +"modalità Billboard è impostata a \"Particle Billboard\"." #: scene/3d/gi_probe.cpp msgid "Plotting Meshes" -msgstr "" +msgstr "Tracciando Meshes" #: scene/3d/gi_probe.cpp msgid "" @@ -11541,6 +11622,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." msgstr "" +"Un SpotLight con un angolo più ampio di 90 gradi non può proiettare ombre." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11572,26 +11654,24 @@ msgid "" msgstr "Nulla é visibile perché le mesh non sono state assegnate ai draw pass." #: scene/3d/particles.cpp -#, fuzzy msgid "" "Particles animation requires the usage of a SpatialMaterial whose Billboard " "Mode is set to \"Particle Billboard\"." msgstr "" -"L'animazione delle particelle richiede l'utilizzo di uno SpatialMaterial con " -"\"Billboard Particles\" abilitato." +"Le animazioni delle particelle richiedono l'uso di un SpatialMaterial la cui " +"modalità Billboard è impostata a \"Particle Billboard\"." #: scene/3d/path.cpp msgid "PathFollow only works when set as a child of a Path node." msgstr "PathFollow funziona solo se impostato come figlio di un nodo Path." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED richiede \"Up Vector\" abilitato nella risorsa " -"Path’s Curve del padre." +"Il flag ROTATION_ORIENTED di un PathFollow richiede \"Up Vector\" di essere " +"abilitato nella risorsa Curve del genitore Path." #: scene/3d/physics_body.cpp msgid "" @@ -11604,18 +11684,16 @@ msgstr "" "Modifica invece la dimensione in sagome di collisione figlie." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." msgstr "" -"La proprietà path deve puntare ad un nodo Spaziale (Spatial) valido per " -"poter funzionare." +"La proprietà \"Remove Path\" deve essere puntata su un Spatial o Spatial-" +"derived valido per funzionare." #: scene/3d/soft_body.cpp -#, fuzzy msgid "This body will be ignored until you set a mesh." -msgstr "Questo corpo verrà ignorato finché non imposti una mesh" +msgstr "Questo corpo verrà ignorato fino a quando non imposterai una mesh." #: scene/3d/soft_body.cpp msgid "" @@ -11628,13 +11706,12 @@ msgstr "" "Cambiare invece le dimensioni nelle forme di collisioni figlie." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" "Una risorsa SpriteFrames deve essere creata o impostata nella proprietà " -"'Frames' affinché AnimatedSprite3D mostri i frame." +"\"Frames\" in modo da far mostrare i frame dall'AnimatedSprite3D." #: scene/3d/vehicle_body.cpp msgid "" @@ -11649,6 +11726,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"WordEnvironment richiede la sua proprietà \"Environment\" di contenere un " +"Environment per avere un effetto visibile." #: scene/3d/world_environment.cpp msgid "" @@ -11686,9 +11765,8 @@ msgid "Nothing connected to input '%s' of node '%s'." msgstr "Nulla collegato all'ingresso '%s' del nodo '%s'." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." -msgstr "Una radice AnimationNode per il grafico non è impostata." +msgstr "Non è stato impostato alcun AnimationNode root per il grafico." #: scene/animation/animation_tree.cpp msgid "Path to an AnimationPlayer node containing animations is not set." @@ -11702,9 +11780,8 @@ msgstr "" "AnimationPlayer." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." -msgstr "La radice di AnimationPlayer non è un nodo valido." +msgstr "Il nodo root dell'AnimationPlayer non è valido." #: scene/animation/animation_tree_player.cpp msgid "This node has been deprecated. Use AnimationTree instead." @@ -11716,12 +11793,11 @@ msgstr "Scegliere un colore dallo schermo." #: scene/gui/color_picker.cpp msgid "HSV" -msgstr "" +msgstr "HSV" #: scene/gui/color_picker.cpp -#, fuzzy msgid "Raw" -msgstr "Imbardata" +msgstr "Raw" #: scene/gui/color_picker.cpp msgid "Switch between hexadecimal and code values." @@ -11732,22 +11808,22 @@ msgid "Add current color as a preset." msgstr "Aggiungi il colore corrente come preset." #: scene/gui/container.cpp -#, fuzzy msgid "" "Container by itself serves no purpose unless a script configures its " "children placement behavior.\n" "If you don't intend to add a script, use a plain Control node instead." msgstr "" -"Il Contenitore da solo non serve a nessuno scopo a meno che uno script non " -"configuri il suo comportamento di posizionamento per i figli.\n" -"Se non avete intenzione di aggiungere uno script, utilizzate invece un " -"semplice nodo \"Controllo\"." +"Il Contanier da se non serve alcuna funzione affinché uno script non " +"configura il comportamento di posizione dei figli.\n" +"Se non intendi aggiungere uno script, usa un semplice nodo Control." #: scene/gui/control.cpp 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 "" +"Il tooltip non comparirà poiché il Mouse filter del control è impostato a " +"\"Ignore\". Per risolvere questo, impostalo a \"Stop\" o \"Pass\"." #: scene/gui/dialogs.cpp msgid "Alert!" @@ -11758,31 +11834,28 @@ msgid "Please Confirm..." msgstr "Per Favore Conferma..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " "running." msgstr "" -"I popup saranno nascosti di default a meno che vengano chiamate la funzione " -"popup() o qualsiasi altra funzione popup*(). Renderli visibili per la " -"modifica nell'editor è okay, ma verranno nascosti una volta in esecuzione." +"I popup saranno nascosti per default affinché non chiami la funzione " +"popup(), oppure una delle funzioni popup*(). Farli diventare visibili per " +"modificarli va bene, ma scompariranno all'esecuzione." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "Se exp_edit è true min_value deve essere > 0." +msgstr "Se \"Exp Edit\" è abilitato, \"Min Value\" deve essere maggiore di 0." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " "minimum size manually." msgstr "" -"ScrollContainer é fatto per funzionare con un solo controllo figlio.\n" -"Usa un container come figlio (VBox,HBox,etc), o un Control impostando la " -"dimensione minima manualmente." +"ScrollContainer è inteso per funzionare con un singolo figlio di controllo.\n" +"Usa un container come figlio (VBox, HBox, ect.), oppure un nodo Control ed " +"imposta la dimensione minima personalizzata manualmente." #: scene/gui/tree.cpp msgid "(Other)" @@ -11829,14 +11902,18 @@ msgid "Input" msgstr "Ingresso" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "Sorgente non valida per la shader." +msgstr "Fonte non valida per l'anteprima." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "Sorgente non valida per la shader." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Sorgente non valida per la shader." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Assegnazione alla funzione." @@ -11846,13 +11923,33 @@ msgid "Assignment to uniform." msgstr "Assegnazione all'uniforme." #: servers/visual/shader_language.cpp -#, fuzzy msgid "Varyings can only be assigned in vertex function." -msgstr "Varyings può essere assegnato solo nella funzione del vertice." +msgstr "Varyings può essere assegnato soltanto nella funzione del vertice." #: servers/visual/shader_language.cpp msgid "Constants cannot be modified." -msgstr "" +msgstr "Le constanti non possono essere modificate." + +#~ msgid "Previous Folder" +#~ msgstr "Cartella precedente" + +#~ msgid "Next Folder" +#~ msgstr "Cartella successiva" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Apri screenshots automaticamente" + +#~ msgid "Open in an external image editor." +#~ msgstr "Apri in un editor di immagini esterno." + +#~ msgid "Reverse" +#~ msgstr "Inverti" + +#~ msgid "Mirror X" +#~ msgstr "Specchia X" + +#~ msgid "Mirror Y" +#~ msgstr "Specchia Y" #~ msgid "Generating solution..." #~ msgstr "Generando la soluzione..." diff --git a/editor/translations/ja.po b/editor/translations/ja.po index d44fc089e8..689a7f3e2b 100644 --- a/editor/translations/ja.po +++ b/editor/translations/ja.po @@ -2,7 +2,7 @@ # Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. # Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) # This file is distributed under the same license as the Godot source code. -# akirakido <achts.y@gmail.com>, 2016-2017, 2018. +# akirakido <achts.y@gmail.com>, 2016-2017, 2018, 2019. # D_first <dntk.daisei@gmail.com>, 2017, 2018. # Daisuke Saito <d.saito@coriginate.com>, 2017, 2018. # h416 <shinichiro.hirama@gmail.com>, 2017. @@ -27,7 +27,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-02 10:49+0000\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" "Last-Translator: John Smith <weblater_jp@susa.eek.jp>\n" "Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/" "godot/ja/>\n" @@ -147,6 +147,31 @@ msgid "Anim Change Call" msgstr "アニメーション呼出ã—ã®å¤‰æ›´" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "アニメーションã‚ãƒ¼ãƒ•ãƒ¬ãƒ¼ãƒ ã®æ™‚間を変更" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "アニメーションã®ãƒˆãƒ©ãƒ³ã‚¸ã‚·ãƒ§ãƒ³ã‚’変更" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "アニメーションã®ãƒˆãƒ©ãƒ³ã‚¹ãƒ•ォームを変更" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "アニメーションã‚ーフレームã®å€¤ã‚’変更" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "アニメーション呼出ã—ã®å¤‰æ›´" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "アニメーションã®é•·ã•を変更" @@ -477,9 +502,8 @@ msgid "Select All" msgstr "ã™ã¹ã¦é¸æŠž" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select None" -msgstr "ãƒŽãƒ¼ãƒ‰ã‚’é¸æŠž" +msgstr "é¸æŠžè§£é™¤" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -491,9 +515,8 @@ msgstr "" "ノードã”ã¨ã«ãƒˆãƒ©ãƒƒã‚¯ã‚’グループ化ã™ã‚‹ã‹ã€ãƒ—レーンãªãƒªã‚¹ãƒˆã¨ã—ã¦è¡¨ç¤ºã—ã¾ã™ã€‚" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Snap:" -msgstr "スナップ" +msgstr "スナップ:" #: editor/animation_track_editor.cpp msgid "Animation step value." @@ -660,7 +683,7 @@ msgstr "行番å·:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "ï¼…dä»¶ã®ä¸€è‡´ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸã€‚" #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -720,23 +743,20 @@ msgid "Line and column numbers." msgstr "行番å·ã¨åˆ—番å·ã€‚" #: editor/connections_dialog.cpp -#, fuzzy msgid "Method in target node must be specified." -msgstr "対象ノードã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’指定ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼" +msgstr "対象ノードã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’指定ã—ã¦ãã ã•ã„。" #: editor/connections_dialog.cpp -#, fuzzy msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." msgstr "" -"対象メソッドãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ï¼æœ‰åйãªãƒ¡ã‚½ãƒƒãƒ‰ã‚’指定ã™ã‚‹ã‹ã€å¯¾è±¡ãƒŽãƒ¼ãƒ‰ã«ã‚¹ã‚¯ãƒª" -"プトを添付ã—ã¦ãã ã•ã„。" +"対象ã®ãƒ¡ã‚½ãƒƒãƒ‰ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。有効ãªãƒ¡ã‚½ãƒƒãƒ‰ã‚’指定ã™ã‚‹ã‹ã€ã‚¿ãƒ¼ã‚²ãƒƒãƒˆãƒŽãƒ¼ãƒ‰" +"ã«ã‚¹ã‚¯ãƒªãƒ—トをアタッãƒã—ã¦ãã ã•ã„。" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect to Node:" -msgstr "ãƒŽãƒ¼ãƒ‰ã«æŽ¥ç¶š:" +msgstr "ノードã¸ã®æŽ¥ç¶š:" #: editor/connections_dialog.cpp msgid "Connect to Script:" @@ -747,9 +767,8 @@ msgid "From Signal:" msgstr "シグナルã‹ã‚‰:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Scene does not contain any script." -msgstr "ノードã¯ã‚¸ã‚ªãƒ¡ãƒˆãƒªãƒ¼ã‚’å«ã‚“ã§ã„ã¾ã›ã‚“。" +msgstr "シーンã«ã¯ã‚¹ã‚¯ãƒªãƒ—トãŒå«ã¾ã‚Œã¦ã„ã¾ã›ã‚“。" #: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp @@ -777,9 +796,8 @@ msgid "Extra Call Arguments:" msgstr "è¿½åŠ ã®å‘¼å‡ºã—引数:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Advanced" -msgstr "アニメーションã®ã‚ªãƒ—ション" +msgstr "高度ãªè¨å®š" #: editor/connections_dialog.cpp msgid "Deferred" @@ -799,9 +817,8 @@ msgid "Disconnects the signal after its first emission." msgstr "最åˆã®æ”¾å‡ºå¾Œã«ä¿¡å·ã‚’切æ–ã—ã¾ã™ã€‚" #: editor/connections_dialog.cpp -#, fuzzy msgid "Cannot connect signal" -msgstr "ã‚·ã‚°ãƒŠãƒ«ã®æŽ¥ç¶š: " +msgstr "ã‚·ã‚°ãƒŠãƒ«ã«æŽ¥ç¶šã§ãã¾ã›ã‚“" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/export_template_manager.cpp editor/groups_editor.cpp @@ -822,7 +839,6 @@ msgid "Connect" msgstr "接続" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" msgstr "シグナル:" @@ -848,14 +864,12 @@ msgid "Disconnect" msgstr "切æ–" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect a Signal to a Method" -msgstr "ã‚·ã‚°ãƒŠãƒ«ã®æŽ¥ç¶š: " +msgstr "メソッドã«ã‚·ã‚°ãƒŠãƒ«ã‚’接続ã™ã‚‹" #: editor/connections_dialog.cpp -#, fuzzy msgid "Edit Connection:" -msgstr "接続を編集: " +msgstr "接続を編集:" #: editor/connections_dialog.cpp msgid "Are you sure you want to remove all connections from the \"%s\" signal?" @@ -993,9 +1007,8 @@ msgid "Owners Of:" msgstr "次ã®ã‚ªãƒ¼ãƒŠãƒ¼:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "é¸æŠžã—ãŸãƒ•ァイルをプãƒã‚¸ã‚§ã‚¯ãƒˆã‹ã‚‰é™¤åŽ»ã—ã¾ã™ã‹ï¼Ÿï¼ˆã€Œå…ƒã«æˆ»ã™ã€ä¸å¯ï¼‰" +msgstr "é¸æŠžã—ãŸãƒ•ァイルをプãƒã‚¸ã‚§ã‚¯ãƒˆã‹ã‚‰å‰Šé™¤ã—ã¾ã™ã‹?(å…ƒã«æˆ»ã›ã¾ã›ã‚“)" #: editor/dependency_editor.cpp msgid "" @@ -1039,9 +1052,8 @@ msgid "Permanently delete %d item(s)? (No undo!)" msgstr "%d 個ã®ã‚¢ã‚¤ãƒ†ãƒ を完全ã«å‰Šé™¤ã—ã¾ã™ã‹?ï¼ˆã€Œå…ƒã«æˆ»ã™ã€ä¸å¯!)" #: editor/dependency_editor.cpp -#, fuzzy msgid "Show Dependencies" -msgstr "ä¾å˜é–¢ä¿‚" +msgstr "ä¾å˜é–¢ä¿‚を表示" #: editor/dependency_editor.cpp editor/editor_node.cpp msgid "Orphan Resource Explorer" @@ -1085,7 +1097,7 @@ msgstr "プãƒã‚¸ã‚§ã‚¯ãƒˆå‰µå§‹è€…" #: editor/editor_about.cpp msgid "Lead Developer" -msgstr "開発主任" +msgstr "開発リーダー" #: editor/editor_about.cpp msgid "Project Manager " @@ -1176,7 +1188,6 @@ msgid "Success!" msgstr "æˆåŠŸï¼" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "インストール" @@ -1360,19 +1371,16 @@ msgid "Valid characters:" msgstr "æœ‰åŠ¹ãªæ–‡å—:" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing engine class name." -msgstr "無効ãªåå‰ã§ã™ã€‚æ—¢å˜ã®ã‚¨ãƒ³ã‚¸ãƒ³ã‚¯ãƒ©ã‚¹åã¨é‡è¤‡ã—ã¦ã¯ã„ã‘ã¾ã›ã‚“。" +msgstr "æ—¢å˜ã®ã‚¨ãƒ³ã‚¸ãƒ³ã‚¯ãƒ©ã‚¹åã¨é‡è¤‡ã—ã¦ã¯ãªã‚Šã¾ã›ã‚“。" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing built-in type name." -msgstr "無効ãªåå‰ã§ã™ã€‚æ—¢å˜ã®çµ„è¾¼ã¿åž‹åã¨é‡è¤‡ã—ã¦ã¯ã„ã‘ã¾ã›ã‚“。" +msgstr "æ—¢å˜ã®çµ„è¾¼ã¿åž‹åã¨é‡è¤‡ã—ã¦ã¯ã„ã‘ã¾ã›ã‚“。" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing global constant name." -msgstr "無効ãªåå‰ã§ã™ã€‚æ—¢å˜ã®ã‚°ãƒãƒ¼ãƒãƒ«å®šæ•°åã¨é‡è¤‡ã—ã¦ã¯ã„ã‘ã¾ã›ã‚“。" +msgstr "æ—¢å˜ã®ã‚°ãƒãƒ¼ãƒãƒ«å®šæ•°åã¨é‡è¤‡ã—ã¦ã¯ã„ã‘ã¾ã›ã‚“。" #: editor/editor_autoload_settings.cpp msgid "Keyword cannot be used as an autoload name." @@ -1407,9 +1415,8 @@ msgid "Rearrange Autoloads" msgstr "自動èªè¾¼ã¿ã®ä¸¦ã¹æ›¿ãˆ" #: editor/editor_autoload_settings.cpp editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid path." -msgstr "無効ãªãƒ‘スã§ã™ã€‚" +msgstr "パスãŒç„¡åйã§ã™ã€‚" #: editor/editor_autoload_settings.cpp editor/script_create_dialog.cpp msgid "File does not exist." @@ -1462,9 +1469,8 @@ msgid "[unsaved]" msgstr "[未ä¿å˜]" #: editor/editor_dir_dialog.cpp -#, fuzzy msgid "Please select a base directory first." -msgstr "ã¯ã˜ã‚ã«ãƒ™ãƒ¼ã‚¹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’é¸æŠžã—ã¦ãã ã•ã„" +msgstr "ã¯ã˜ã‚ã«ãƒ™ãƒ¼ã‚¹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’é¸æŠžã—ã¦ãã ã•ã„。" #: editor/editor_dir_dialog.cpp msgid "Choose a Directory" @@ -1550,45 +1556,39 @@ msgstr "テンプレートファイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"32ビットã®ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆã§ã¯ã€çµ„ã¿è¾¼ã¿PCKã¯4GiBã‚’è¶…ãˆã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "3D Editor" -msgstr "エディタ" +msgstr "3Dエディタ" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Script Editor" -msgstr "スクリプトエディタを開ã" +msgstr "スクリプトエディタ" #: editor/editor_feature_profile.cpp msgid "Asset Library" msgstr "アセットライブラリ" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Scene Tree Editing" -msgstr "シーンツリー(ノード):" +msgstr "シーンツリーã®ç·¨é›†" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Import Dock" -msgstr "インãƒãƒ¼ãƒˆ" +msgstr "インãƒãƒ¼ãƒˆãƒ‰ãƒƒã‚¯" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Node Dock" -msgstr "è¿½åŠ ã—ãŸã‚ーを移動" +msgstr "ノードドック" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "FileSystem and Import Docks" -msgstr "ファイルシステム" +msgstr "ファイルシステムã¨ã‚¤ãƒ³ãƒãƒ¼ãƒˆãƒ‰ãƒƒã‚¯" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Erase profile '%s'? (no undo)" -msgstr "ã™ã¹ã¦ç½®æ›ï¼ˆã€Œå…ƒã«æˆ»ã™ã€ä¸å¯ï¼‰" +msgstr "プãƒãƒ•ァイル '%s'を消去ã—ã¾ã™ã‹ï¼Ÿ(å…ƒã«æˆ»ã›ã¾ã›ã‚“)" #: editor/editor_feature_profile.cpp msgid "Profile must be a valid filename and must not contain '.'" @@ -1596,61 +1596,52 @@ msgstr "" "プãƒãƒ•ã‚¡ã‚¤ãƒ«ã¯æœ‰åйãªãƒ•ァイルåã§ãªã‘れã°ãªã‚‰ãšã€ '.' ã‚’å«ã‚“ã§ã¯ã„ã‘ã¾ã›ã‚“" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Profile with this name already exists." -msgstr "åŒåã®ãƒ•ァイルã¾ãŸã¯ãƒ•ォルダãŒã‚りã¾ã™ã€‚" +msgstr "ã“ã®åå‰ã®ãƒ—ãƒãƒ•ã‚¡ã‚¤ãƒ«ã¯æ—¢ã«å˜åœ¨ã—ã¾ã™ã€‚" #: editor/editor_feature_profile.cpp msgid "(Editor Disabled, Properties Disabled)" msgstr "(エディタ無効ã€ãƒ—ãƒãƒ‘ティ無効)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "(Properties Disabled)" -msgstr "プãƒãƒ‘ティã®ã¿" +msgstr "(プãƒãƒ‘ティ無効)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "(Editor Disabled)" -msgstr "無効" +msgstr "(エディタ無効)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Class Options:" -msgstr "クラスã®èª¬æ˜Žï¼š" +msgstr "クラスオプション:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enable Contextual Editor" -msgstr "次ã®ã‚¨ãƒ‡ã‚£ã‚¿ã‚’é–‹ã" +msgstr "コンテã‚ストエディタを有効ã«ã™ã‚‹" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Properties:" -msgstr "プãƒãƒ‘ティ:" +msgstr "プãƒãƒ‘ティを有効ã«ã™ã‚‹:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Features:" -msgstr "テクスãƒãƒ£" +msgstr "機能を有効ã«ã™ã‚‹:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Classes:" -msgstr "ã‚¯ãƒ©ã‚¹ã®æ¤œç´¢" +msgstr "クラスを有効ã«ã™ã‚‹:" #: editor/editor_feature_profile.cpp msgid "File '%s' format is invalid, import aborted." msgstr "ファイル '%s' ã®ãƒ•ォーマットãŒç„¡åйã§ã™ã€‚インãƒãƒ¼ãƒˆãŒä¸æ¢ã•れã¾ã—ãŸã€‚" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." msgstr "" -"プãƒãƒ•ァイル '%s' ã¯ã™ã§ã«å˜åœ¨ã—ã¾ã™ã€‚インãƒãƒ¼ãƒˆå‰ã«æœ€åˆã«ãƒªãƒ¢ãƒ¼ãƒˆã§å®Ÿè¡Œã™ã‚‹" -"ã¨ã€ã‚¤ãƒ³ãƒãƒ¼ãƒˆã¯ä¸æ¢ã•れã¾ã™ã€‚" +"プãƒãƒ•ァイル '%s' ã¯ã™ã§ã«å˜åœ¨ã—ã¾ã™ã€‚インãƒãƒ¼ãƒˆã™ã‚‹å‰ã«å‰Šé™¤ã—ã¦ãã ã•ã„。イ" +"ンãƒãƒ¼ãƒˆã¯ä¸æ¢ã•れã¾ã—ãŸã€‚" #: editor/editor_feature_profile.cpp #, fuzzy @@ -1662,14 +1653,12 @@ msgid "Unset" msgstr "未è¨å®š" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Current Profile:" -msgstr "ç¾åœ¨ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³:" +msgstr "ç¾åœ¨ã®ãƒ—ãƒãƒ•ァイル:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Make Current" -msgstr "ç¾åœ¨:" +msgstr "最新ã«ã™ã‚‹" #: editor/editor_feature_profile.cpp #: editor/plugins/animation_player_editor_plugin.cpp @@ -1687,9 +1676,8 @@ msgid "Export" msgstr "エクスãƒãƒ¼ãƒˆ" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Available Profiles:" -msgstr "利用å¯èƒ½ãªãƒŽãƒ¼ãƒ‰:" +msgstr "利用å¯èƒ½ãªãƒ—ãƒãƒ•ァイル:" #: editor/editor_feature_profile.cpp #, fuzzy @@ -1707,9 +1695,8 @@ msgid "Erase Profile" msgstr "タイルマップを消去" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Import Profile(s)" -msgstr "インãƒãƒ¼ãƒˆã•れãŸãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆ" +msgstr "プãƒãƒ•ァイルã®ã‚¤ãƒ³ãƒãƒ¼ãƒˆ" #: editor/editor_feature_profile.cpp #, fuzzy @@ -1750,7 +1737,7 @@ msgstr "ファイルマãƒãƒ¼ã‚¸ãƒ£ãƒ¼ã§è¡¨ç¤º" msgid "New Folder..." msgstr "æ–°è¦ãƒ•ォルダ..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "å†èªè¾¼" @@ -1801,7 +1788,7 @@ msgstr "進む" msgid "Go Up" msgstr "上ã¸" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "éš ã—ファイルã®åˆ‡ã‚Šæ›¿ãˆ" @@ -1827,27 +1814,31 @@ msgstr "ãŠæ°—ã«å…¥ã‚Šã‚’下ã¸" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "å‰ã®åºŠé¢" +msgid "Go to previous folder." +msgstr "親フォルダã¸ç§»å‹•ã™ã‚‹ã€‚" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "次ã®åºŠé¢" +msgid "Go to next folder." +msgstr "親フォルダã¸ç§»å‹•ã™ã‚‹ã€‚" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Go to parent folder." -msgstr "親フォルダã¸" +msgstr "親フォルダã¸ç§»å‹•ã™ã‚‹ã€‚" + +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "ファイル検索" #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "フォルダを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "éš ã—ファイルã®åˆ‡ã‚Šæ›¿ãˆ" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2232,7 +2223,6 @@ msgstr "" "ントをãŠèªã¿ãã ã•ã„。" #: editor/editor_node.cpp -#, fuzzy msgid "" "This resource belongs to a scene that was instanced or inherited.\n" "Changes to it won't be kept when saving the current scene." @@ -2249,7 +2239,6 @@ msgstr "" "を変更ã—ã€å†åº¦ã‚¤ãƒ³ãƒãƒ¼ãƒˆã—ã¦ãã ã•ã„。" #: editor/editor_node.cpp -#, fuzzy msgid "" "This scene was imported, so changes to it won't be kept.\n" "Instancing it or inheriting will allow making changes to it.\n" @@ -2257,12 +2246,11 @@ msgid "" "understand this workflow." msgstr "" "ã“ã®ã‚·ãƒ¼ãƒ³ã¯ã‚¤ãƒ³ãƒãƒ¼ãƒˆã•れãŸã‚‚ã®ã§ã€å¤‰æ›´ã¯ä¿æŒã•れã¾ã›ã‚“。\n" -"インスタンス化ã‹ç¶™æ‰¿ã™ã‚‹ã¨ã€å¤‰æ›´ãŒå¯èƒ½ã«ãªã‚Šã¾ã™ã€‚\n" -"ã“ã®ãƒ¯ãƒ¼ã‚¯ãƒ•ãƒãƒ¼ã‚’よりよãç†è§£ã™ã‚‹ãŸã‚ã«ã€ã‚·ãƒ¼ãƒ³ã®èªã¿è¾¼ã¿ã«é–¢é€£ã™ã‚‹ãƒ‰ã‚ュメ" -"ントをãŠèªã¿ãã ã•ã„。" +"インスタンス化もã—ãã¯ç¶™æ‰¿ã™ã‚‹ã¨ã€å¤‰æ›´ãŒå¯èƒ½ã«ãªã‚Šã¾ã™ã€‚\n" +"ã“ã®ãƒ¯ãƒ¼ã‚¯ãƒ•ãƒãƒ¼ã‚’よりよãç†è§£ã™ã‚‹ãŸã‚ã«ã€ã‚·ãƒ¼ãƒ³ã®ã‚¤ãƒ³ãƒãƒ¼ãƒˆã«é–¢é€£ã™ã‚‹ãƒ‰ã‚ュ" +"メントをãŠèªã¿ãã ã•ã„。" #: editor/editor_node.cpp -#, fuzzy msgid "" "This is a remote object, so changes to it won't be kept.\n" "Please read the documentation relevant to debugging to better understand " @@ -2584,6 +2572,10 @@ msgid "Go to previously opened scene." msgstr "以å‰ã«é–‹ã„ãŸã‚·ãƒ¼ãƒ³ã«ç§»å‹•ã™ã‚‹ã€‚" #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "テã‚ストをコピー" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "次ã®ã‚¿ãƒ–" @@ -2785,32 +2777,20 @@ msgid "Editor Layout" msgstr "エディタレイアウト" #: editor/editor_node.cpp -#, fuzzy msgid "Take Screenshot" -msgstr "シーンをルートã«ã™ã‚‹" +msgstr "スクリーンショットを撮る" #: editor/editor_node.cpp -#, fuzzy msgid "Screenshots are stored in the Editor Data/Settings Folder." -msgstr "エディタã®ãƒ‡ãƒ¼ã‚¿ãƒ»è¨å®šãƒ•ォルダを開ã" - -#: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "次ã®ã‚¨ãƒ‡ã‚£ã‚¿ã‚’é–‹ã" +msgstr "スクリーンショットã¯Editor Data / Settingsフォルダã«ä¿å˜ã•れã¦ã„ã¾ã™ã€‚" #: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "フルスクリーン切り替ãˆ" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle System Console" -msgstr "分割モード切り替ãˆ" +msgstr "システムコンソールã®åˆ‡ã‚Šæ›¿ãˆ" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -2920,19 +2900,16 @@ msgid "Spins when the editor window redraws." msgstr "エディタ ウィンドウã®å†æç”»æ™‚ã«ã‚¹ãƒ”ンã—ã¾ã™ã€‚" #: editor/editor_node.cpp -#, fuzzy msgid "Update Continuously" -msgstr "継続的" +msgstr "ç¶™ç¶šçš„ã«æ›´æ–°" #: editor/editor_node.cpp -#, fuzzy msgid "Update When Changed" msgstr "å¤‰æ›´æ™‚ã«æ›´æ–°" #: editor/editor_node.cpp -#, fuzzy msgid "Hide Update Spinner" -msgstr "アップデートスピナーを無効化" +msgstr "アップデートスピナーをéžè¡¨ç¤º" #: editor/editor_node.cpp msgid "FileSystem" @@ -3128,6 +3105,11 @@ msgstr "時間" msgid "Calls" msgstr "呼出ã—" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "テーマを編集..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "オン" @@ -3477,7 +3459,6 @@ msgid "Remove Template" msgstr "テンプレートを除去" #: editor/export_template_manager.cpp -#, fuzzy msgid "Select Template File" msgstr "ãƒ†ãƒ³ãƒ—ãƒ¬ãƒ¼ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã‚’é¸æŠž" @@ -3540,9 +3521,8 @@ msgid "No name provided." msgstr "åå‰ãŒä»˜ã„ã¦ã„ã¾ã›ã‚“。" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Provided name contains invalid characters." -msgstr "åå‰ã«ä½¿ç”¨ã§ããªã„æ–‡å—ãŒå«ã¾ã‚Œã¦ã„ã¾ã™" +msgstr "åå‰ã«ä½¿ç”¨ã§ããªã„æ–‡å—ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚" #: editor/filesystem_dock.cpp msgid "Name contains invalid characters." @@ -3574,7 +3554,6 @@ msgid "New Inherited Scene" msgstr "æ–°ã—ã„継承ã—ãŸã‚·ãƒ¼ãƒ³..." #: editor/filesystem_dock.cpp -#, fuzzy msgid "Open Scenes" msgstr "シーンを開ã" @@ -3583,12 +3562,10 @@ msgid "Instance" msgstr "インスタンス" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Add to Favorites" msgstr "ãŠæ°—ã«å…¥ã‚Šã«è¿½åŠ " #: editor/filesystem_dock.cpp -#, fuzzy msgid "Remove from Favorites" msgstr "ãŠæ°—ã«å…¥ã‚Šã‹ã‚‰å‰Šé™¤" @@ -3879,9 +3856,8 @@ msgid "Reimport" msgstr "å†ã‚¤ãƒ³ãƒãƒ¼ãƒˆ" #: editor/import_dock.cpp -#, fuzzy msgid "Save scenes, re-import and restart" -msgstr "シーンをä¿å˜ã—ã€å†ã‚¤ãƒ³ãƒãƒ¼ãƒˆã—ã¦å†èµ·å‹•" +msgstr "シーンをä¿å˜ã—ã¦ã€å†ã‚¤ãƒ³ãƒãƒ¼ãƒˆã—ã¦å†èµ·å‹•ã—ã¦ãã ã•ã„" #: editor/import_dock.cpp msgid "Changing the type of an imported file requires editor restart." @@ -4151,9 +4127,8 @@ msgid "Open Animation Node" msgstr "アニメーションノードを開ã" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Triangle already exists." -msgstr "ä¸‰è§’å½¢ãŒæ—¢ã«å˜åœ¨ã—ã¾ã™" +msgstr "ä¸‰è§’å½¢ãŒæ—¢ã«å˜åœ¨ã—ã¾ã™ã€‚" #: editor/plugins/animation_blend_space_2d_editor.cpp #, fuzzy @@ -4176,9 +4151,8 @@ msgid "Remove BlendSpace2D Point" msgstr "パスã®ãƒã‚¤ãƒ³ãƒˆã‚’除去" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "無効ãªã‚ーを削除" +msgstr "BlendSpace2D三角形を削除ã™ã‚‹" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -4258,7 +4232,6 @@ msgstr "æ–°è¦ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" msgstr "ノードを削除" @@ -4312,7 +4285,6 @@ msgid "Edit Filtered Tracks:" msgstr "フィルタリング済トラックã®ç·¨é›†:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Enable Filtering" msgstr "フィルタリングを有効化" @@ -4604,11 +4576,10 @@ msgid "Remove selected node or transition." msgstr "é¸æŠžã—ãŸãƒŽãƒ¼ãƒ‰ã¾ãŸã¯ãƒˆãƒ©ãƒ³ã‚¸ã‚·ãƒ§ãƒ³ã‚’除去。" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Toggle autoplay this animation on start, restart or seek to zero." msgstr "" -"ã“ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã®è‡ªå‹•å†ç”Ÿã‚’ã€ã‚¹ã‚¿ãƒ¼ãƒˆã€ãƒªã‚¹ã‚¿ãƒ¼ãƒˆã€ã‚¼ãƒã«ã‚·ãƒ¼ã‚¯ã«åˆ‡ã‚Šæ›¿ãˆ" -"る。" +"ã“ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã®è‡ªå‹•å†ç”Ÿã®é–‹å§‹ã€å†èµ·å‹•ã€ã¾ãŸã¯ã‚¼ãƒã¸ã®ã‚·ãƒ¼ã‚¯ã‚’切り替ãˆã¾" +"ã™ã€‚" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set the end animation. This is useful for sub-transitions." @@ -4831,6 +4802,10 @@ msgid "Idle" msgstr "待機" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "インストール..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "å†è©¦è¡Œ" @@ -4859,7 +4834,6 @@ msgid "Last" msgstr "最後" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "ã™ã¹ã¦" @@ -4873,8 +4847,8 @@ msgid "Sort:" msgstr "ソート:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "逆" +msgid "Reverse sorting." +msgstr "é€†é †ã‚½ãƒ¼ãƒˆã€‚" #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4955,31 +4929,31 @@ msgid "Rotation Step:" msgstr "回転ã®ã‚¹ãƒ†ãƒƒãƒ—:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "垂直ガイドを移動" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "垂直ガイドを作æˆ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "垂直ガイドを削除" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "水平ガイドを移動" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "水平ガイドを作æˆ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "水平ガイドを削除" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "水平垂直ガイドを作æˆ" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -4999,9 +4973,8 @@ msgid "Resize CanvasItem" msgstr "CanvasItemをリサイズ" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Scale CanvasItem" -msgstr "ã‚ャンãƒã‚¹ã‚¢ã‚¤ãƒ†ãƒ ã®ç·¨é›†" +msgstr "ã‚ャンãƒã‚¹ã‚¢ã‚¤ãƒ†ãƒ ã®æ‹¡å¤§/縮å°" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move CanvasItem" @@ -5040,41 +5013,35 @@ msgstr "アンカーを変更" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Lock Selected" -msgstr "é¸æŠžãƒ„ãƒ¼ãƒ«" +msgstr "é¸æŠžã‚’ãƒãƒƒã‚¯" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Unlock Selected" -msgstr "é¸æŠžæ¸ˆã¿ã‚’削除" +msgstr "é¸æŠžã‚’è§£é™¤" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Group Selected" -msgstr "é¸æŠžã—ã¦ã„ã‚‹ã‚‚ã®ã‚’削除" +msgstr "é¸æŠžã—ãŸã‚°ãƒ«ãƒ¼ãƒ—" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Ungroup Selected" -msgstr "é¸æŠžã—ã¦ã„ã‚‹ã‚‚ã®ã‚’削除" +msgstr "グループ解除" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Paste Pose" msgstr "ãƒãƒ¼ã‚ºã‚’貼り付ã‘" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Create Custom Bone(s) from Node(s)" -msgstr "メッシュã‹ã‚‰æ”¾å‡ºç‚¹ã‚’生æˆ" +msgstr "ノードã‹ã‚‰ã‚«ã‚¹ã‚¿ãƒ ボーンを作æˆ" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Clear Bones" -msgstr "ãƒãƒ¼ã‚ºã‚’クリアã™ã‚‹" +msgstr "ボーンをクリアã™ã‚‹" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -5109,10 +5076,10 @@ msgid "Alt+Drag: Move" msgstr "Alt+ドラッグ: 移動" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)." msgstr "" -"vã‚ーを押ã™ã¨ãƒ”ボットã®å¤‰æ›´ã€'Shift+v' ã§ãƒ”ボットをドラッグ(移動ä¸ã§ã‚‚)" +"ピボットを変更ã™ã‚‹ã«ã¯ 'v' ã€ãƒ”ボットをドラッグã™ã‚‹ã«ã¯ 'Shift+v' を押ã—ã¾ã™" +"(移動ä¸)。" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5120,9 +5087,8 @@ msgid "Alt+RMB: Depth list selection" msgstr "Alt+å³ã‚¯ãƒªãƒƒã‚¯: デプス(深ã•)リストã®é¸æŠž" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Move Mode" -msgstr "è¿½åŠ ã—ãŸã‚ーを移動" +msgstr "移動モード" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotate Mode" @@ -5162,7 +5128,6 @@ msgid "Snapping Options" msgstr "スナッピングオプション" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Grid" msgstr "グリッドã«ã‚¹ãƒŠãƒƒãƒ—" @@ -5184,37 +5149,30 @@ msgid "Use Pixel Snap" msgstr "ピクセルスナップを使用" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Smart Snapping" msgstr "スマートスナップ" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Parent" msgstr "親ã«ã‚¹ãƒŠãƒƒãƒ—" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Anchor" msgstr "ノードアンカーã«ã‚¹ãƒŠãƒƒãƒ—" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Sides" msgstr "ノードå´é¢ã«ã‚¹ãƒŠãƒƒãƒ—" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Center" msgstr "ノードã®ä¸å¿ƒã«ã‚¹ãƒŠãƒƒãƒ—" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Other Nodes" msgstr "ä»–ã®ãƒŽãƒ¼ãƒ‰ã«ã‚¹ãƒŠãƒƒãƒ—" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Guides" msgstr "ガイドã«ã‚¹ãƒŠãƒƒãƒ—" @@ -5289,14 +5247,12 @@ msgid "Show Group And Lock Icons" msgstr "グループアイコンã¨ãƒãƒƒã‚¯ã‚¢ã‚¤ã‚³ãƒ³ã‚’表示" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Center Selection" -msgstr "é¸æŠžå¯¾è±¡ã‚’ä¸å¤®ã«" +msgstr "ã‚»ãƒ³ã‚¿ãƒ¼é¸æŠž" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Frame Selection" -msgstr "é¸æŠžå¯¾è±¡ã‚’ãƒ•ãƒ¬ãƒ¼ãƒ ã®ä¸å¤®ã«" +msgstr "ãƒ•ãƒ¬ãƒ¼ãƒ é¸æŠž" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Preview Canvas Scale" @@ -5381,9 +5337,8 @@ msgstr "ノードを生æˆ" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp -#, fuzzy msgid "Error instancing scene from %s" -msgstr "%sシーンã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹åŒ–エラー" +msgstr "%sã‹ã‚‰ã‚·ãƒ¼ãƒ³ã‚’インスタンス化処ç†ä¸ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5411,7 +5366,6 @@ msgid "Edit Poly (Remove Point)" msgstr "ãƒãƒªã‚´ãƒ³ã‚’編集(点を除去)" #: editor/plugins/collision_shape_2d_editor_plugin.cpp -#, fuzzy msgid "Set Handle" msgstr "ãƒãƒ³ãƒ‰ãƒ«ã‚’è¨å®šã™ã‚‹" @@ -5435,9 +5389,8 @@ msgstr "発光(Emission)マスクをèªã¿è¾¼ã‚€" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Restart" -msgstr "今ã™ãå†èµ·å‹•" +msgstr "å†èµ·å‹•" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5463,9 +5416,8 @@ msgstr "発光(Emission)マスク" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp -#, fuzzy msgid "Capture from Pixel" -msgstr "ピクセルã‹ã‚‰å–å¾—" +msgstr "ピクセルã‹ã‚‰ã‚ャプãƒãƒ£" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5487,12 +5439,10 @@ msgid "Create Emission Points From Node" msgstr "ノードã‹ã‚‰æ”¾å‡ºç‚¹ã‚’生æˆ" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Flat 0" msgstr "フラット0" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Flat 1" msgstr "フラット1" @@ -5542,9 +5492,8 @@ msgid "Right Linear" msgstr "å³å´é¢å›³" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Load Preset" -msgstr "åˆæœŸè¨å®šå€¤ã‚’èªã¿è¾¼ã‚€" +msgstr "プリセットをèªã¿è¾¼ã‚€" #: editor/plugins/curve_editor_plugin.cpp msgid "Remove Curve Point" @@ -5591,9 +5540,8 @@ msgid "Create Static Trimesh Body" msgstr "スタティック(ä¸å¤‰ï¼‰ä¸‰è§’形メッシュ ボディを作æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Static Convex Body" -msgstr "スタティック(ä¸å¤‰ï¼‰å‡¸çŠ¶ãƒœãƒ‡ã‚£ã‚’ç”Ÿæˆ" +msgstr "é™çš„凸状ボディを生æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp #, fuzzy @@ -5610,9 +5558,8 @@ msgid "Failed creating shapes!" msgstr "図形ã®ä½œæˆã«å¤±æ•—ã—ã¾ã—ãŸ!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Convex Shape(s)" -msgstr "凸状シェイプを生æˆ" +msgstr "凸状シェイプを作æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5661,9 +5608,8 @@ msgid "Mesh" msgstr "メッシュ" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Trimesh Static Body" -msgstr "スタティック(ä¸å¤‰ï¼‰ä¸‰è§’形メッシュ ボディを作æˆ" +msgstr "é™çš„三角形メッシュボディを作æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -5814,7 +5760,6 @@ msgid "Mesh Up Axis:" msgstr "メッシュã®ã‚¢ãƒƒãƒ—軸:" #: editor/plugins/multimesh_editor_plugin.cpp -#, fuzzy msgid "Random Rotation:" msgstr "ランダムãªå›žè»¢:" @@ -5855,7 +5800,7 @@ msgstr "å¯è¦–性ã®çŸ©å½¢ã‚’生æˆ" #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" -msgstr "" +msgstr "ParticlesMaterialプãƒã‚»ã‚¹ãƒžãƒ†ãƒªã‚¢ãƒ«ã«ã®ã¿ç‚¹ã‚’è¨å®šã§ãã¾ã™" #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp @@ -5863,7 +5808,6 @@ msgid "Generation Time (sec):" msgstr "ç”Ÿæˆæ™‚é–“ (ç§’):" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Faces contain no area!" msgstr "é¢ã«ã‚¨ãƒªã‚¢ãŒå«ã¾ã‚Œã¦ã„ã¾ã›ã‚“!" @@ -5893,9 +5837,8 @@ msgid "Surface Points" msgstr "表é¢ã®ç‚¹" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Surface Points+Normal (Directed)" -msgstr "サーフェスãƒã‚¤ãƒ³ãƒˆï¼‹Normalï¼ˆæŒ‡å‘æ€§ï¼‰" +msgstr "サーフェスãƒã‚¤ãƒ³ãƒˆï¼‹Normal(æŒ‡å‘æ€§)" #: editor/plugins/particles_editor_plugin.cpp msgid "Volume" @@ -5939,9 +5882,8 @@ msgstr "In-ãƒãƒ³ãƒ‰ãƒ«ã‚’曲線ã‹ã‚‰é™¤åŽ»" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp -#, fuzzy msgid "Add Point to Curve" -msgstr "ãƒã‚¤ãƒ³ãƒˆã‚’曲線ã«è¿½åŠ " +msgstr "点を曲線ã«è¿½åŠ " #: editor/plugins/path_2d_editor_plugin.cpp #, fuzzy @@ -5970,9 +5912,8 @@ msgstr "ç‚¹ã‚’é¸æŠž" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp -#, fuzzy msgid "Shift+Drag: Select Control Points" -msgstr "Shift+ドラッグ:コントãƒãƒ¼ãƒ«ãƒã‚¤ãƒ³ãƒˆã‚’é¸æŠž" +msgstr "Shift + ドラッグ:コントãƒãƒ¼ãƒ«ãƒã‚¤ãƒ³ãƒˆã‚’é¸æŠž" #: editor/plugins/path_2d_editor_plugin.cpp #: editor/plugins/path_editor_plugin.cpp @@ -6285,9 +6226,8 @@ msgid "Delete Resource" msgstr "リソースを削除" #: editor/plugins/resource_preloader_editor_plugin.cpp -#, fuzzy msgid "Resource clipboard is empty!" -msgstr "リソースã®ã‚¯ãƒªãƒƒãƒ—ボードã¯ç©ºã§ã™!" +msgstr "リソースクリップボードãŒç©ºã§ã™!" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "Paste Resource" @@ -6301,9 +6241,8 @@ msgstr "インスタンス:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Type:" -msgstr "åž‹(Type):" +msgstr "åž‹:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/scene_tree_dock.cpp editor/scene_tree_editor.cpp @@ -6344,9 +6283,8 @@ msgid "Error: could not load file." msgstr "エラー: ファイルをèªã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸã€‚" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error could not load file." -msgstr "フォルダを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚" +msgstr "エラー:ファイルをèªã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸã€‚" #: editor/plugins/script_editor_plugin.cpp msgid "Error saving file!" @@ -6412,18 +6350,16 @@ msgid "Find Next" msgstr "次を検索" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter scripts" -msgstr "フィルタプãƒãƒ‘ティ" +msgstr "フィルタスクリプト" #: editor/plugins/script_editor_plugin.cpp msgid "Toggle alphabetical sorting of the method list." msgstr "メソッドリストã®ã‚¢ãƒ«ãƒ•ã‚¡ãƒ™ãƒƒãƒˆé †ã‚½ãƒ¼ãƒˆã‚’åˆ‡ã‚Šæ›¿ãˆã‚‹ã€‚" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter methods" -msgstr "フィルターモード:" +msgstr "フィルタメソッド" #: editor/plugins/script_editor_plugin.cpp msgid "Sort" @@ -6603,7 +6539,6 @@ msgid "Source" msgstr "ソース:" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Signal" msgstr "シグナル" @@ -6673,9 +6608,8 @@ msgid "Bookmarks" msgstr "ブックマーク" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "点を作æˆã™ã‚‹ã€‚" +msgstr "ブレークãƒã‚¤ãƒ³ãƒˆ" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6981,9 +6915,14 @@ msgstr "後é¢" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" msgstr "シーンビューã«ã‚«ãƒ¡ãƒ©ã‚’åˆã‚ã›ã‚‹ï¼ˆAlign With View)" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "é¸æŠžã‚’ãƒ“ãƒ¥ãƒ¼ã«æ•´åˆ—" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp #, fuzzy msgid "No parent to instance a child at." @@ -7177,10 +7116,6 @@ msgid "Focus Selection" msgstr "é¸æŠžã«ãƒ•ォーカス" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "é¸æŠžã‚’ãƒ“ãƒ¥ãƒ¼ã«æ•´åˆ—" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "é¸æŠžãƒ„ãƒ¼ãƒ«" @@ -7782,9 +7717,8 @@ msgid "Erase TileMap" msgstr "タイルマップを消去" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Find Tile" -msgstr "タイルを探ã™" +msgstr "タイルを検索ã™ã‚‹" #: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy @@ -7792,14 +7726,6 @@ msgid "Transpose" msgstr "転置" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "ミラーX" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "ミラーY" - -#: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy msgid "Disable Autotile" msgstr "自動スライス" @@ -7905,9 +7831,8 @@ msgid "Navigation Mode" msgstr "ナビゲーションメッシュを生æˆ" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Bitmask Mode" -msgstr "回転モード" +msgstr "ビットマスクモード" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -7915,9 +7840,8 @@ msgid "Priority Mode" msgstr "エクスãƒãƒ¼ãƒˆã®ãƒ¢ãƒ¼ãƒ‰:" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Icon Mode" -msgstr "パンモード" +msgstr "アイコンモード" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -7948,7 +7872,7 @@ msgstr "æ–°è¦ãƒãƒªã‚´ãƒ³ã‚’生æˆã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Keep polygon inside region Rect." -msgstr "" +msgstr "é ˜åŸŸRect内ã«ãƒãƒªã‚´ãƒ³ã‚’ä¿æŒã—ã¾ã™ã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Enable snap and show grid (configurable via the Inspector)." @@ -8221,12 +8145,10 @@ msgid "Add Node to Visual Shader" msgstr "シェーダー" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" msgstr "ノードを複製" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Nodes" msgstr "ノードを削除" @@ -8235,13 +8157,16 @@ msgid "Visual Shader Input Type Changed" msgstr "ビジュアルシェーダã®å…¥åŠ›ã‚¿ã‚¤ãƒ—ãŒå¤‰æ›´ã•れã¾ã—ãŸ" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(GLES3ã®ã¿)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "é ‚ç‚¹" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Fragment" -msgstr "引数:" +msgstr "フラグメント" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8295,7 +8220,7 @@ msgstr "差分ã®ã¿" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Dodge operator." -msgstr "" +msgstr "Dodge演算å。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "HardLight operator" @@ -8328,6 +8253,22 @@ msgid "Color uniform." msgstr "トランスフォーム" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "2ã¤ã®ãƒ‘ラメータ間㮠%s 比較ã®ãƒ–ãƒ¼ãƒ«çµæžœã‚’è¿”ã—ã¾ã™ã€‚" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "ç‰ã—ã„(==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "より大ãã„(>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "より大ãã„ã‹ç‰ã—ã„(>=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8337,11 +8278,45 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "INFã¨ã‚¹ã‚«ãƒ©ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã®æ¯”較ã®çµæžœã‚’ブール値ã§è¿”ã—ã¾ã™ã€‚" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "NaNã¨ã‚¹ã‚«ãƒ©ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã®æ¯”較ã®çµæžœã‚’ブール値ã§è¿”ã—ã¾ã™ã€‚" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "よりå°ã•ã„(<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "ãれ以下(<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "ç‰ã—ããªã„(!=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" "指定ã•れãŸãƒ–ール値ãŒtrueã¾ãŸã¯falseã®å ´åˆã€é–¢é€£ä»˜ã‘られãŸãƒ™ã‚¯ãƒˆãƒ«ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "2ã¤ã®ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿é–“ã®æ¯”較ã®çµæžœã‚’ブール値ã§è¿”ã—ã¾ã™ã€‚" + +#: editor/plugins/visual_shader_editor_plugin.cpp +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 "ベクトル定数を変更" @@ -8377,7 +8352,7 @@ msgstr "" #: 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." @@ -8395,31 +8370,31 @@ msgstr "スカラ演算åを変更" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "E constant (2.718282). Represents the base of the natural logarithm." -msgstr "" +msgstr "ãƒã‚¤ãƒ”ア数(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." @@ -8434,16 +8409,16 @@ msgid "Returns the arc-cosine of the parameter." msgstr "パラメータã®é€†ã‚³ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "(GLES3ã®ã¿)パラメータã®åŒæ›²ç·šé€†ã‚³ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "パラメータã®é€†åŒæ›²ç·šä½™å¼¦ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." msgstr "パラメータã®é€†ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "(GLES3ã®ã¿)パラメータã®åŒæ›²ç·šé€†ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "パラメータã®åŒæ›²ç·šé€†ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." @@ -8454,8 +8429,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "複数パラメータã®é€†ã‚¿ãƒ³ã‚¸ã‚§ãƒ³ãƒˆã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "(GLES3ã®ã¿)パラメータã®åŒæ›²ç·šé€†ã‚¿ãƒ³ã‚¸ã‚§ãƒ³ãƒˆã‚’è¿”ã—ã¾ã™ã€‚" +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "パラメータã®åŒæ›²ç·šé€†ã‚¿ãƒ³ã‚¸ã‚§ãƒ³ãƒˆã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8471,8 +8446,8 @@ msgid "Returns the cosine of the parameter." msgstr "パラメータã®ã‚³ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "(GLES3ã®ã¿)パラメータã®åŒæ›²ç·šã‚³ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "パラメータã®åŒæ›²ç·šã‚³ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." @@ -8540,12 +8515,12 @@ msgid "1.0 / scalar" msgstr "1.0 / スカラー" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "(GLES3ã®ã¿)ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã«æœ€ã‚‚è¿‘ã„æ•´æ•°ã‚’検索ã—ã¾ã™ã€‚" +msgid "Finds the nearest integer to the parameter." +msgstr "ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã«æœ€ã‚‚è¿‘ã„æ•´æ•°ã‚’検索ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "(GLES3ã®ã¿)ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã«æœ€ã‚‚è¿‘ã„å¶æ•°ã®æ•´æ•°ã‚’検索ã—ã¾ã™ã€‚" +msgid "Finds the nearest even integer to the parameter." +msgstr "ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã«æœ€ã‚‚è¿‘ã„å¶æ•°ã®æ•´æ•°ã‚’検索ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." @@ -8560,8 +8535,8 @@ msgid "Returns the sine of the parameter." msgstr "パラメータã®ç¬¦å·ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "(GLES3ã®ã¿)パラメータã®åŒæ›²ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" +msgid "Returns the hyperbolic sine of the parameter." +msgstr "パラメータã®åŒæ›²ã‚µã‚¤ãƒ³ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." @@ -8596,12 +8571,12 @@ msgid "Returns the tangent of the parameter." msgstr "パラメータã®ã‚¿ãƒ³ã‚¸ã‚§ãƒ³ãƒˆã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "(GLES3ã®ã¿)パラメータã®åŒæ›²ã‚¿ãƒ³ã‚¸ã‚§ãƒ³ãƒˆã‚’è¿”ã—ã¾ã™ã€‚" +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "パラメータã®åŒæ›²ã‚¿ãƒ³ã‚¸ã‚§ãƒ³ãƒˆã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "(GLES3ã®ã¿)パラメータã®ãƒˆãƒ©ãƒ³ã‚±ãƒ¼ãƒˆã•れãŸå€¤ã‚’検索ã—ã¾ã™ã€‚" +msgid "Finds the truncated value of the parameter." +msgstr "パラメータã®ãƒˆãƒ©ãƒ³ã‚±ãƒ¼ãƒˆã•れãŸå€¤ã‚’検索ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." @@ -8643,12 +8618,17 @@ msgstr "テクスãƒãƒ£ãƒ»ãƒ«ãƒƒã‚¯ã‚¢ãƒƒãƒ—を実行ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "テクスãƒãƒ£Uniformを変更" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "テクスãƒãƒ£Uniformを変更" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup with triplanar." msgstr "テクスãƒãƒ£Uniformを変更" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8657,8 +8637,9 @@ msgid "Transform function." msgstr "トランスフォームã®ãƒ€ã‚¤ã‚¢ãƒã‚°..." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8682,16 +8663,16 @@ msgid "Decomposes transform to four vectors." msgstr "変æ›ã‚’4ã¤ã®ãƒ™ã‚¯ãƒˆãƒ«ã«åˆ†è§£ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "(GLES3ã®ã¿)変æ›ã®è¡Œåˆ—å¼ã‚’計算ã—ã¾ã™ã€‚" +msgid "Calculates the determinant of a transform." +msgstr "変æ›ã®è¡Œåˆ—å¼ã‚’計算ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "(GLES3ã®ã¿)変æ›ã®é€†é–¢æ•°ã‚’計算ã—ã¾ã™ã€‚" +msgid "Calculates the inverse of a transform." +msgstr "変æ›ã®é€†è¡Œåˆ—を計算ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "(GLES3ã®ã¿)変æ›ã®è»¢ç½®ã‚’計算ã—ã¾ã™ã€‚" +msgid "Calculates the transpose of a transform." +msgstr "変æ›ã®è»¢ç½®ã‚’計算ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." @@ -8742,8 +8723,9 @@ msgid "Calculates the dot product of two vectors." msgstr "2ã¤ã®ãƒ™ã‚¯ãƒˆãƒ«ã®å†…ç©ã‚’計算ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8774,13 +8756,14 @@ msgid "1.0 / vector" msgstr "1.0 / ベクトル" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"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 a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "å±ˆæŠ˜ã®æ–¹å‘を指ã™ãƒ™ã‚¯ãƒˆãƒ«ã‚’è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8880,60 +8863,58 @@ msgstr "" "è¿”ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "(GLES3ã®ã¿)(フラグメント/ライトモードã®ã¿)スカラー導関数。" +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(フラグメント/ライトモードã®ã¿)スカラー導関数。" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "(GLES3ã®ã¿)(フラグメント/ライトモードã®ã¿)ベクトル導関数。" +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(フラグメント/ライトモードã®ã¿)ベクトル導関数。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" -"(GLES3ã®ã¿)(フラグメント/ライトモードã®ã¿)(ベクトル)ãƒãƒ¼ã‚«ãƒ«å·®åˆ†ã‚’使用ã—㦠" -"'x' ã§å¾®åˆ†ã—ã¾ã™ã€‚" +"(フラグメント/ライトモードã®ã¿)(ベクトル)ãƒãƒ¼ã‚«ãƒ«å·®åˆ†ã‚’使用ã—㦠'x' ã§å¾®åˆ†ã—" +"ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" -"(GLES3ã®ã¿)(フラグメント/ライトモードã®ã¿)(スカラー)ãƒãƒ¼ã‚«ãƒ«å·®åˆ†ã‚’使用ã—㦠" -"'x' ã§å¾®åˆ†ã—ã¾ã™ã€‚" +"(フラグメント/ライトモードã®ã¿)(スカラー)ãƒãƒ¼ã‚«ãƒ«å·®åˆ†ã‚’使用ã—㦠'x' ã§å¾®åˆ†ã—" +"ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" -"(GLES3ã®ã¿)(フラグメント/ライトモードã®ã¿)(ベクトル)ãƒãƒ¼ã‚«ãƒ«å·®åˆ†ã‚’使用ã—㦠" -"'y' ã§å¾®åˆ†ã—ã¾ã™ã€‚" +"(フラグメント/ライトモードã®ã¿)(ベクトル)ãƒãƒ¼ã‚«ãƒ«å·®åˆ†ã‚’使用ã—㦠'y' ã§å¾®åˆ†ã—" +"ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" -"(GLES3ã®ã¿)(フラグメント/ライトモードã®ã¿)(スカラー)ãƒãƒ¼ã‚«ãƒ«å·®åˆ†ã‚’使用ã—㦠" -"'y' ã§å¾®åˆ†ã—ã¾ã™ã€‚" +"(フラグメント/ライトモードã®ã¿)(スカラー)ãƒãƒ¼ã‚«ãƒ«å·®åˆ†ã‚’使用ã—㦠'y' ã§å¾®åˆ†ã—" +"ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(GLES3ã®ã¿)(フラグメント/ライトモードã®ã¿)(ベクトル) 'x' 㨠'y' ã®çµ¶å¯¾å°Žé–¢æ•°" -"ã®åˆè¨ˆã€‚" +"(フラグメント/ライトモードã®ã¿)(ベクトル) 'x' 㨠'y' ã®çµ¶å¯¾å°Žé–¢æ•°ã®åˆè¨ˆã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(GLES3ã®ã¿)(フラグメント/ライトモードã®ã¿)(スカラー) 'x' 㨠'y' ã®çµ¶å¯¾å°Žé–¢æ•°" -"ã®åˆè¨ˆã€‚" +"(フラグメント/ライトモードã®ã¿)(スカラー) 'x' 㨠'y' ã®çµ¶å¯¾å°Žé–¢æ•°ã®åˆè¨ˆã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9307,7 +9288,6 @@ msgstr "" "è¦å‘Š: プãƒã‚¸ã‚§ã‚¯ãƒˆã¯æ—§ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ã‚¨ãƒ³ã‚¸ãƒ³ã§é–‹ãã“ã¨ãŒã§ããªããªã‚Šã¾ã™ã€‚" #: editor/project_manager.cpp -#, fuzzy msgid "" "The following project settings file was generated by an older engine " "version, and needs to be converted for this version:\n" @@ -9441,7 +9421,6 @@ msgid "Can't run project" msgstr "プãƒã‚¸ã‚§ã‚¯ãƒˆã‚’実行ã§ãã¾ã›ã‚“" #: editor/project_manager.cpp -#, fuzzy msgid "" "You currently don't have any projects.\n" "Would you like to explore official example projects in the Asset Library?" @@ -9481,7 +9460,6 @@ msgid "An action with the name '%s' already exists." msgstr "アクション'%s'ã¯æ—¢ã«ã‚りã¾ã™!" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Rename Input Action Event" msgstr "入力アクションイベントã®åå‰ã‚’変更ã™ã‚‹" @@ -9938,7 +9916,7 @@ msgstr "å„ノードã®ã‚«ã‚¦ãƒ³ã‚¿ã®å¢—分é‡" #: editor/rename_dialog.cpp msgid "Padding" -msgstr "" +msgstr "パディング" #: editor/rename_dialog.cpp msgid "" @@ -10062,9 +10040,8 @@ msgid "This operation can't be done on the tree root." msgstr "ã“ã®å‡¦ç†ã¯ãƒ„リーã®ãƒ«ãƒ¼ãƒˆã§ã¯ã§ãã¾ã›ã‚“." #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Move Node In Parent" -msgstr "親ã®ãƒŽãƒ¼ãƒ‰ã‚’移動" +msgstr "ノードを親ã«ç§»å‹•" #: editor/scene_tree_dock.cpp #, fuzzy @@ -10202,7 +10179,6 @@ msgid "Clear Inheritance" msgstr "継承をクリア" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Open Documentation" msgstr "ドã‚ュメントを開ã" @@ -10211,9 +10187,8 @@ msgid "Add Child Node" msgstr "åãƒŽãƒ¼ãƒ‰ã‚’è¿½åŠ " #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Expand/Collapse All" -msgstr "ã™ã¹ã¦æŠ˜ã‚ŠãŸãŸã‚€" +msgstr "ã™ã¹ã¦å±•é–‹/折りãŸãŸã¿" #: editor/scene_tree_dock.cpp #, fuzzy @@ -10225,6 +10200,11 @@ msgid "Extend Script" msgstr "スクリプトを拡張" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "親ノードを変更" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "シーンをルートã«ã™ã‚‹" @@ -10245,9 +10225,8 @@ msgid "Delete (No Confirm)" msgstr "削除 (確èªãªã—)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Add/Create a New Node." -msgstr "æ–°ã—ã„ãƒŽãƒ¼ãƒ‰ã‚’è¿½åŠ /生æˆ" +msgstr "æ–°ã—ã„ãƒŽãƒ¼ãƒ‰ã‚’è¿½åŠ /作æˆã™ã‚‹ã€‚" #: editor/scene_tree_dock.cpp #, fuzzy @@ -10465,7 +10444,8 @@ msgid "Script is valid." msgstr "æ£å½“ãªã‚¹ã‚¯ãƒªãƒ—ト" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "使用å¯èƒ½: a-z, A-Z, 0-9 㨠_" #: editor/script_create_dialog.cpp @@ -10474,14 +10454,12 @@ msgid "Built-in script (into scene file)." msgstr "組ã¿è¾¼ã¿ã‚¹ã‚¯ãƒªãƒ—ト(シーンファイルã®ï¼‰" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will create a new script file." -msgstr "æ–°è¦ã‚¹ã‚¯ãƒªãƒ—トファイルを作æˆ" +msgstr "æ–°è¦ã‚¹ã‚¯ãƒªãƒ—トファイルを作æˆã€‚" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will load an existing script file." -msgstr "æ—¢å˜ã®ã‚¹ã‚¯ãƒªãƒ—トファイルをèªã¿è¾¼ã‚€" +msgstr "æ—¢å˜ã®ã‚¹ã‚¯ãƒªãƒ—トファイルをèªã¿è¾¼ã‚€ã€‚" #: editor/script_create_dialog.cpp msgid "Language" @@ -10542,9 +10520,8 @@ msgid "Inspect Previous Instance" msgstr "å‰ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã®å†…容を確èª" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Inspect Next Instance" -msgstr "次ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã®å†…容を確èª" +msgstr "次ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’確èªã™ã‚‹" #: editor/script_editor_debugger.cpp msgid "Stack Frames" @@ -10687,9 +10664,8 @@ msgid "Change Capsule Shape Radius" msgstr "カプセル形状ã®åŠå¾„変更" #: editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Capsule Shape Height" -msgstr "カプセル形状ã®é«˜ã•変更" +msgstr "カプセル形状ã®é«˜ã•を変更ã™ã‚‹" #: editor/spatial_editor_gizmos.cpp #, fuzzy @@ -10925,15 +10901,15 @@ msgstr "Ctrl: 回転" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Cursor Back Rotate X" -msgstr "" +msgstr "X軸ã§ã‚«ãƒ¼ã‚½ãƒ«ã‚’逆回転ã•ã›ã‚‹" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Cursor Back Rotate Y" -msgstr "" +msgstr "Y軸ã§ã‚«ãƒ¼ã‚½ãƒ«ã‚’逆回転ã•ã›ã‚‹" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Cursor Back Rotate Z" -msgstr "" +msgstr "Z軸ã§ã‚«ãƒ¼ã‚½ãƒ«ã‚’逆回転ã•ã›ã‚‹" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Cursor Clear Rotation" @@ -11284,9 +11260,8 @@ msgid "Available Nodes:" msgstr "利用å¯èƒ½ãªãƒŽãƒ¼ãƒ‰:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Select or create a function to edit its graph." -msgstr "グラフを編集ã™ã‚‹é–¢æ•°ã‚’é¸æŠžã¾ãŸã¯ç”Ÿæˆ" +msgstr "グラフを編集ã™ã‚‹é–¢æ•°ã‚’é¸æŠžã¾ãŸã¯ä½œæˆã—ã¾ã™ã€‚" #: modules/visual_script/visual_script_editor.cpp msgid "Delete Selected" @@ -11804,7 +11779,6 @@ msgstr "" "ãã ã•ã„." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." @@ -11813,9 +11787,8 @@ msgstr "" "é©ã§ã™ã€‚" #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCameraã¯ARVROriginãƒŽãƒ¼ãƒ‰ã‚’è¦ªã«æŒã¤å¿…è¦ãŒã‚りã¾ã™" +msgstr "ARVRCameraã¯ARVROriginãƒŽãƒ¼ãƒ‰ã‚’è¦ªã«æŒã¤å¿…è¦ãŒã‚りã¾ã™ã€‚" #: scene/3d/arvr_nodes.cpp #, fuzzy @@ -11943,9 +11916,8 @@ msgstr "" "定ã•れã¦ã„ã‚‹SpatialMaterialを使用ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚" #: scene/3d/gi_probe.cpp -#, fuzzy msgid "Plotting Meshes" -msgstr "イメージをé…ç½®(Blit)" +msgstr "メッシュã®ãƒ—ãƒãƒƒãƒˆ" #: scene/3d/gi_probe.cpp msgid "" @@ -11957,7 +11929,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." -msgstr "" +msgstr "90度を超ãˆã‚‹è§’度ã®ã‚¹ãƒãƒƒãƒˆãƒ©ã‚¤ãƒˆã¯ã€ã‚·ãƒ£ãƒ‰ã‚¦ã‚’投影ã§ãã¾ã›ã‚“。" #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -12250,14 +12222,17 @@ msgid "Input" msgstr "入力" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "無効ãªã‚·ã‚§ãƒ¼ãƒ€ãƒ¼ã®ã‚½ãƒ¼ã‚¹ã§ã™ã€‚" +msgstr "プレビューã®ã‚½ãƒ¼ã‚¹ãŒç„¡åйã§ã™ã€‚" #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "無効ãªã‚·ã‚§ãƒ¼ãƒ€ãƒ¼ã®ã‚½ãƒ¼ã‚¹ã§ã™ã€‚" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "ãã®ã‚¿ã‚¤ãƒ—ã®æ¯”較関数ã¯ç„¡åйã§ã™ã€‚" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "関数ã¸ã®å‰²ã‚Šå½“ã¦ã€‚" @@ -12275,6 +12250,28 @@ msgstr "Varyingã¯é ‚点関数ã«ã®ã¿å‰²ã‚Šå½“ã¦ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚" msgid "Constants cannot be modified." msgstr "定数ã¯å¤‰æ›´ã§ãã¾ã›ã‚“。" +#~ msgid "Previous Folder" +#~ msgstr "å‰ã®ãƒ•ォルダ" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "次ã®åºŠé¢" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "スクリーンショットを自動的ã«é–‹ã" + +#~ msgid "Open in an external image editor." +#~ msgstr "外部ã®ã‚¤ãƒ¡ãƒ¼ã‚¸ã‚¨ãƒ‡ã‚£ã‚¿ã§é–‹ãã¾ã™ã€‚" + +#~ msgid "Reverse" +#~ msgstr "逆" + +#~ msgid "Mirror X" +#~ msgstr "ミラーX" + +#~ msgid "Mirror Y" +#~ msgstr "ミラーY" + #, fuzzy #~ msgid "Generating solution..." #~ msgstr "八分木テクスãƒãƒ£ã‚’生æˆ" diff --git a/editor/translations/ka.po b/editor/translations/ka.po index 960bcd13b7..f6dc4ca514 100644 --- a/editor/translations/ka.po +++ b/editor/translations/ka.po @@ -134,6 +134,31 @@ msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ ძáƒáƒ®áƒ˜áƒšáƒ˜áƒ¡ ცვლილებá #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ გáƒáƒ¡áƒáƒ¦áƒ”ბური კáƒáƒ“რის დრáƒáƒ˜áƒ¡ ცვლილებáƒ" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ გáƒáƒ დáƒáƒ›áƒáƒ›áƒ•ლáƒáƒ‘ის შეცვლáƒ" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ გáƒáƒ დáƒáƒ¥áƒ›áƒœáƒ˜áƒ¡ ცვლილებáƒ" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ გáƒáƒ¡áƒáƒ¦áƒ”ბური კáƒáƒ“რის მნიშვნელáƒáƒ‘ის ცვლილებáƒ" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ ძáƒáƒ®áƒ˜áƒšáƒ˜áƒ¡ ცვლილებáƒ" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "áƒáƒœáƒ˜áƒ› სიგრძის შეცვლáƒ" @@ -1177,7 +1202,6 @@ msgid "Success!" msgstr "წáƒáƒ მáƒáƒ¢áƒ”ბáƒ!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "დáƒáƒ§áƒ”ნებáƒ" @@ -1722,7 +1746,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1773,7 +1797,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1798,23 +1822,30 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "" +#, fuzzy +msgid "Go to previous folder." +msgstr "წინáƒáƒ›áƒ“ებáƒáƒ ე ნáƒáƒ‘იჯზე გáƒáƒ“áƒáƒ¡áƒ•ლáƒ" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "" +#, fuzzy +msgid "Go to next folder." +msgstr "მáƒáƒ›áƒ“ევნრნáƒáƒ‘იჯზე გáƒáƒ“áƒáƒ¡áƒ•ლáƒ" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "ძებნáƒ:" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2503,6 +2534,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "მáƒáƒœáƒ˜áƒ¨áƒ•ნის მáƒáƒ¨áƒáƒ ებáƒ" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2695,14 +2731,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -3016,6 +3044,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "მáƒáƒœáƒ˜áƒ¨áƒ•ნის მრუდის ცვლილებáƒ" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4676,6 +4709,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "დáƒáƒ§áƒ”ნებáƒ" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4704,7 +4742,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4718,7 +4755,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4793,31 +4830,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "შექმნáƒ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "áƒáƒ áƒáƒ¡áƒ¬áƒáƒ ი გáƒáƒ¡áƒáƒ¦áƒ”ბების მáƒáƒ¨áƒáƒ ებáƒ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "კვáƒáƒœáƒ«áƒ—áƒáƒœ დáƒáƒ™áƒáƒ•შირებáƒ:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "áƒáƒ áƒáƒ¡áƒ¬áƒáƒ ი გáƒáƒ¡áƒáƒ¦áƒ”ბების მáƒáƒ¨áƒáƒ ებáƒ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6715,7 +6756,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6900,10 +6945,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7479,14 +7520,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7892,6 +7925,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7982,6 +8019,22 @@ msgid "Color uniform." msgstr "áƒáƒœáƒ˜áƒ›áƒáƒªáƒ˜áƒ˜áƒ¡ გáƒáƒ დáƒáƒ¥áƒ›áƒœáƒ˜áƒ¡ ცვლილებáƒ" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7989,10 +8042,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8082,7 +8169,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8090,7 +8177,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8102,7 +8189,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8119,7 +8206,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8188,11 +8275,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8208,7 +8295,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8236,11 +8323,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8281,11 +8368,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8295,7 +8386,7 @@ msgstr "შექმნáƒ" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8313,15 +8404,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8373,7 +8464,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8401,12 +8492,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8483,47 +8574,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9684,6 +9775,11 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "áƒáƒ®áƒáƒšáƒ˜ %s შექმნáƒ" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9894,7 +9990,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11430,6 +11526,11 @@ msgstr "áƒáƒ áƒáƒ¡áƒ¬áƒáƒ ი ფáƒáƒœáƒ¢áƒ˜áƒ¡ ზáƒáƒ›áƒ." msgid "Invalid source for shader." msgstr "áƒáƒ áƒáƒ¡áƒ¬áƒáƒ ი ფáƒáƒœáƒ¢áƒ˜áƒ¡ ზáƒáƒ›áƒ." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "áƒáƒ áƒáƒ¡áƒ¬áƒáƒ ი ფáƒáƒœáƒ¢áƒ˜áƒ¡ ზáƒáƒ›áƒ." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/ko.po b/editor/translations/ko.po index fa3b289864..374d996926 100644 --- a/editor/translations/ko.po +++ b/editor/translations/ko.po @@ -17,7 +17,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-09 10:47+0000\n" +"PO-Revision-Date: 2019-07-21 11:06+0000\n" "Last-Translator: ì†¡íƒœì„ <xotjq237@gmail.com>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/" "godot/ko/>\n" @@ -32,13 +32,13 @@ 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 #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "ë””ì½”ë”©í• ë°”ì´íŠ¸ê°€ 모ìžë¼ê±°ë‚˜, ìœ íš¨í•˜ì§€ ì•Šì€ í˜•ì‹ìž…니다." +msgstr "ë””ì½”ë”©í• ë°”ì´íŠ¸ê°€ 모ìžë¼ê±°ë‚˜, 올바르지 ì•Šì€ í˜•ì‹ìž…니다." #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" @@ -50,19 +50,19 @@ msgstr "ì¸ìŠ¤í„´ìŠ¤ê°€ 비어있기 ë•Œë¬¸ì— Self를 ì‚¬ìš©í• ìˆ˜ ì—†ìŠµë‹ˆë‹ #: 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':" @@ -138,6 +138,31 @@ msgid "Anim Change Call" msgstr "ì• ë‹ˆë©”ì´ì…˜ 호출 변경" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "ì• ë‹ˆë©”ì´ì…˜ í‚¤í”„ë ˆìž„ 시간 변경" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "ì• ë‹ˆë©”ì´ì…˜ ì „í™˜ 변경" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "ì• ë‹ˆë©”ì´ì…˜ 변형 변경" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "ì• ë‹ˆë©”ì´ì…˜ í‚¤í”„ë ˆìž„ ê°’ 변경" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "ì• ë‹ˆë©”ì´ì…˜ 호출 변경" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "ì• ë‹ˆë©”ì´ì…˜ ê¸¸ì´ ë³€ê²½" @@ -380,7 +405,7 @@ msgstr "ë² ì§€ì–´ 트랙 추가" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." -msgstr "트랙 경로가 ìœ íš¨í•˜ì§€ 않습니다, 키를 추가하실 수 없습니다." +msgstr "트랙 경로가 올바르지 않습니다, 키를 ì¶”ê°€í• ìˆ˜ 없습니다." #: editor/animation_track_editor.cpp msgid "Track is not of type Spatial, can't insert key" @@ -396,7 +421,7 @@ msgstr "트랙 키 추가" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." -msgstr "트랙 경로가 ìœ íš¨í•˜ì§€ 않습니다, 메서드 키를 추가하실 수 없습니다." +msgstr "트랙 경로가 올바르지 않습니다, 메서드 키를 ì¶”ê°€í• ìˆ˜ 없습니다." #: editor/animation_track_editor.cpp msgid "Add Method Track Key" @@ -567,7 +592,7 @@ msgstr "최ì í™”" #: editor/animation_track_editor.cpp msgid "Remove invalid keys" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ í‚¤ ì‚ì œ" +msgstr "올바르지 ì•Šì€ í‚¤ ì‚ì œ" #: editor/animation_track_editor.cpp msgid "Remove unresolved and empty tracks" @@ -636,7 +661,7 @@ msgstr "ë¼ì¸ 번호:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "%d 개가 ì¼ì¹˜í•©ë‹ˆë‹¤." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -644,7 +669,7 @@ msgstr "ì¼ì¹˜ ê²°ê³¼ ì—†ìŒ" #: editor/code_editor.cpp msgid "Replaced %d occurrence(s)." -msgstr "%d 회 êµì²´ë¨." +msgstr "%d ê°œì˜ ë°œìƒì„ êµì²´í–ˆìŠµë‹ˆë‹¤." #: editor/code_editor.cpp editor/find_in_files.cpp msgid "Match Case" @@ -704,7 +729,7 @@ msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." msgstr "" -"ëŒ€ìƒ ë©”ì„œë“œë¥¼ ì°¾ì„ ìˆ˜ 없습니다! ìœ íš¨í•œ 메서드를 ì§€ì •í•˜ê±°ë‚˜, ëŒ€ìƒ ë…¸ë“œì— ìŠ¤í¬" +"ëŒ€ìƒ ë©”ì„œë“œë¥¼ ì°¾ì„ ìˆ˜ 없습니다! 올바른 메서드를 ì§€ì •í•˜ê±°ë‚˜, ëŒ€ìƒ ë…¸ë“œì— ìŠ¤í¬" "립트를 ë¶™ì´ì„¸ìš”." #: editor/connections_dialog.cpp @@ -792,7 +817,6 @@ msgid "Connect" msgstr "ì—°ê²°" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" msgstr "시그ë„:" @@ -938,7 +962,7 @@ msgstr "깨진 종ì†ì„± ìˆ˜ì •" #: editor/dependency_editor.cpp msgid "Dependency Editor" -msgstr "ì¢…ì† ê´€ê³„ ì—디터" +msgstr "ì¢…ì† ê´€ê³„ 편집기" #: editor/dependency_editor.cpp msgid "Search Replacement Resource:" @@ -959,9 +983,8 @@ msgid "Owners Of:" msgstr "ì†Œìœ ìž:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "프로ì 트ì—서 ì„ íƒëœ 파ì¼ë“¤ì„ ì‚ì œí•˜ì‹œê² ìŠµë‹ˆê¹Œ? (ë˜ëŒë¦¬ê¸° 불가)" +msgstr "프로ì 트ì—서 ì„ íƒí•œ 파ì¼ì„ ì‚ì œí•˜ì‹œê² ìŠµë‹ˆê¹Œ? (ë˜ëŒë¦¬ê¸° 불가)" #: editor/dependency_editor.cpp msgid "" @@ -1129,7 +1152,7 @@ msgstr "패키지 파ì¼ì„ 여는 ë° ì˜¤ë¥˜ê°€ ë°œìƒí–ˆìŠµë‹ˆë‹¤. zip 형ì‹ì #: editor/editor_asset_installer.cpp msgid "Uncompressing Assets" -msgstr "ì—ì…‹ ì••ì¶•í•´ì œ" +msgstr "ì• ì…‹ ì••ì¶•í•´ì œ" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "Package installed successfully!" @@ -1141,7 +1164,6 @@ msgid "Success!" msgstr "성공!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "설치" @@ -1318,11 +1340,11 @@ msgstr "새로운 버스 ë ˆì´ì•„ì›ƒì„ ë§Œë“니다." #: editor/editor_autoload_settings.cpp msgid "Invalid name." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ì´ë¦„." +msgstr "올바르지 ì•Šì€ ì´ë¦„." #: editor/editor_autoload_settings.cpp msgid "Valid characters:" -msgstr "ìœ íš¨í•œ 문ìž:" +msgstr "올바른 문ìž:" #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing engine class name." @@ -1511,18 +1533,20 @@ msgstr "í…œí”Œë¦¿ì„ ì°¾ì„ ìˆ˜ 없습니다:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"32 비트 환경ì—서 ë‚´ìž¥ëœ PCK를 ë‚´ë³´ë‚´ë ¤ë©´ 4 GiB(기가 ì´ì§„ ë°”ì´íЏ)보다 작아야 " +"합니다." #: editor/editor_feature_profile.cpp msgid "3D Editor" -msgstr "3D ì—디터" +msgstr "3D 편집기" #: editor/editor_feature_profile.cpp msgid "Script Editor" -msgstr "스í¬ë¦½íЏ ì—디터" +msgstr "스í¬ë¦½íЏ 편집기" #: editor/editor_feature_profile.cpp msgid "Asset Library" -msgstr "ì—ì…‹ ë¼ì´ë¸ŒëŸ¬ë¦¬" +msgstr "ì• ì…‹ ë¼ì´ë¸ŒëŸ¬ë¦¬" #: editor/editor_feature_profile.cpp msgid "Scene Tree Editing" @@ -1554,7 +1578,7 @@ msgstr "ì´ ì´ë¦„ì„ ê°€ì§„ í”„ë¡œí•„ì´ ì´ë¯¸ 존재합니다." #: editor/editor_feature_profile.cpp msgid "(Editor Disabled, Properties Disabled)" -msgstr "(ì—디터 비활성화ë¨, ì†ì„± 비활성화ë¨)" +msgstr "(편집기 비활성화ë¨, ì†ì„± 비활성화ë¨)" #: editor/editor_feature_profile.cpp msgid "(Properties Disabled)" @@ -1562,7 +1586,7 @@ msgstr "(ì†ì„± 비활성화ë¨)" #: editor/editor_feature_profile.cpp msgid "(Editor Disabled)" -msgstr "(ì—디터 비활성화ë¨)" +msgstr "(편집기 비활성화ë¨)" #: editor/editor_feature_profile.cpp msgid "Class Options:" @@ -1570,7 +1594,7 @@ msgstr "í´ëž˜ìФ 옵션:" #: editor/editor_feature_profile.cpp msgid "Enable Contextual Editor" -msgstr "컨í…스트 ì—디터 활성화" +msgstr "컨í…스트 편집기 활성화" #: editor/editor_feature_profile.cpp msgid "Enabled Properties:" @@ -1653,7 +1677,7 @@ msgstr "프로필 내보내기" #: editor/editor_feature_profile.cpp msgid "Manage Editor Feature Profiles" -msgstr "ì—디터 기능 프로필 관리" +msgstr "편집기 기능 프로필 관리" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select Current Folder" @@ -1684,7 +1708,7 @@ msgstr "íŒŒì¼ íƒìƒ‰ê¸°ì—서 보기" msgid "New Folder..." msgstr "새 í´ë”..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "ìƒˆë¡œê³ ì¹¨" @@ -1735,7 +1759,7 @@ msgstr "앞으로 가기" msgid "Go Up" msgstr "위로 가기" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "숨김 íŒŒì¼ í† ê¸€" @@ -1760,23 +1784,31 @@ msgid "Move Favorite Down" msgstr "ì¦ê²¨ì°¾ê¸° 아래로 ì´ë™" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "ì´ì „ í´ë”" +#, fuzzy +msgid "Go to previous folder." +msgstr "부모 í´ë”로 ì´ë™í•©ë‹ˆë‹¤." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "ë‹¤ìŒ í´ë”" +#, fuzzy +msgid "Go to next folder." +msgstr "부모 í´ë”로 ì´ë™í•©ë‹ˆë‹¤." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "부모 í´ë”로 ì´ë™í•©ë‹ˆë‹¤." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "íŒŒì¼ ê²€ìƒ‰" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "현재 í´ë”를 ì¦ê²¨ì°¾ê¸° (안) 합니다." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "숨김 íŒŒì¼ ê°€ì‹œì„± í† ê¸€í•˜ê¸°." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -1803,7 +1835,7 @@ msgstr "파ì¼:" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Must use a valid extension." -msgstr "ìœ íš¨í•œ 확장ìžë¥¼ 사용해야 합니다." +msgstr "올바른 확장ìžë¥¼ 사용해야 합니다." #: editor/editor_file_system.cpp msgid "ScanSources" @@ -1819,7 +1851,7 @@ msgstr "" #: editor/editor_file_system.cpp msgid "(Re)Importing Assets" -msgstr "ì—ì…‹ (다시) ê°€ì ¸ì˜¤ê¸°" +msgstr "ì• ì…‹ (다시) ê°€ì ¸ì˜¤ê¸°" #: editor/editor_help.cpp editor/plugins/spatial_editor_plugin.cpp msgid "Top" @@ -1883,7 +1915,7 @@ msgstr "ì´ë„˜ " #: editor/editor_help.cpp msgid "Constants" -msgstr "ìƒìˆ˜" +msgstr "ìƒìˆ˜(Constant)" #: editor/editor_help.cpp msgid "Constants:" @@ -2137,7 +2169,7 @@ msgstr "ë ˆì´ì•„웃 ì €ìž¥ ì‹œë„ ì¤‘ 오류!" #: editor/editor_node.cpp msgid "Default editor layout overridden." -msgstr "ì—디터 기본 ë ˆì´ì•„ì›ƒì´ ë³€ê²½ë˜ì—ˆìŠµë‹ˆë‹¤." +msgstr "편집기 기본 ë ˆì´ì•„ì›ƒì´ ë³€ê²½ë˜ì—ˆìŠµë‹ˆë‹¤." #: editor/editor_node.cpp msgid "Layout name not found!" @@ -2304,7 +2336,7 @@ msgstr "종료" #: editor/editor_node.cpp msgid "Exit the editor?" -msgstr "ì—디터를 ì¢…ë£Œí•˜ì‹œê² ìŠµë‹ˆê¹Œ?" +msgstr "편집기를 ì¢…ë£Œí•˜ì‹œê² ìŠµë‹ˆê¹Œ?" #: editor/editor_node.cpp msgid "Open Project Manager?" @@ -2497,6 +2529,10 @@ msgid "Go to previously opened scene." msgstr "ì´ì „ì— ì—´ì—ˆë˜ ì”¬ìœ¼ë¡œ 가기." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "ë¬¸ìž ë³µì‚¬" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "ë‹¤ìŒ íƒ" @@ -2626,7 +2662,7 @@ msgid "" msgstr "" "ì´ ì˜µì…˜ì´ í™œì„±í™” ë˜ì–´ ìžˆì„ ê²½ìš°, 내보내기나 ë°°í¬ëŠ” ìµœì†Œí•œì˜ ì‹¤í–‰ 파ì¼ì„ ìƒì„±" "합니다.\n" -"íŒŒì¼ ì‹œìŠ¤í…œì€ ë„¤íŠ¸ì›Œí¬ë¥¼ 통해서 ì—디터 ìƒì˜ 프로ì 트가 ì œê³µí•©ë‹ˆë‹¤.\n" +"íŒŒì¼ ì‹œìŠ¤í…œì€ ë„¤íŠ¸ì›Œí¬ë¥¼ 통해서 편집기 ìƒì˜ 프로ì 트가 ì œê³µí•©ë‹ˆë‹¤.\n" "안드로ì´ë“œì˜ 경우, USB ì¼€ì´ë¸”ì„ ì‚¬ìš©í•˜ì—¬ ë°°í¬í• 경우 ë” ë¹ ë¥¸ í¼í¬ë¨¼ìŠ¤ë¥¼ ì œê³µ" "합니다. ì´ ì˜µì…˜ì€ í° ì„¤ì¹˜ ìš©ëŸ‰ì„ ìš”êµ¬í•˜ëŠ” ê²Œìž„ì˜ í…ŒìŠ¤íŠ¸ë¥¼ ë¹ ë¥´ê²Œ í• ìˆ˜ 있습니" "다." @@ -2666,7 +2702,7 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" -"ì´ ì˜µì…˜ì´ í™œì„±í™” ë˜ì–´ ìžˆì„ ê²½ìš°, ì—디터 ìƒì˜ ì”¬ì˜ ë³€ê²½ì‚¬í•ì´ ì‹¤í–‰ ì¤‘ì¸ ê²Œìž„" +"ì´ ì˜µì…˜ì´ í™œì„±í™” ë˜ì–´ ìžˆì„ ê²½ìš°, 편집기 ìƒì˜ ì”¬ì˜ ë³€ê²½ì‚¬í•ì´ ì‹¤í–‰ ì¤‘ì¸ ê²Œìž„" "ì— ë°˜ì˜ë©ë‹ˆë‹¤.\n" "ê¸°ê¸°ì— ì›ê²©ìœ¼ë¡œ 사용ë˜ëŠ” 경우, ë„¤íŠ¸ì›Œí¬ íŒŒì¼ ì‹œìŠ¤í…œê³¼ 함께하면 ë”ìš± 효과ì ìž…" "니다." @@ -2689,15 +2725,15 @@ msgstr "" #: editor/editor_node.cpp msgid "Editor" -msgstr "ì—디터" +msgstr "편집기" #: editor/editor_node.cpp editor/settings_config_dialog.cpp msgid "Editor Settings" -msgstr "ì—디터 ì„¤ì •" +msgstr "편집기 ì„¤ì •" #: editor/editor_node.cpp msgid "Editor Layout" -msgstr "ì—디터 ë ˆì´ì•„웃" +msgstr "편집기 ë ˆì´ì•„웃" #: editor/editor_node.cpp msgid "Take Screenshot" @@ -2708,14 +2744,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "스í¬ë¦°ìƒ·ì´ Editor Data/Settings í´ë”ì— ì €ìž¥ë˜ì—ˆìŠµë‹ˆë‹¤." #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "스í¬ë¦°ìƒ· ìžë™ 열기" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "외부 ì´ë¯¸ì§€ 편집기ì—서 열기." - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "ì „ì²´ 화면 í† ê¸€" @@ -2725,19 +2753,19 @@ msgstr "시스템 콘솔 í† ê¸€" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" -msgstr "ì—디터 ë°ì´í„°/ì„¤ì • í´ë” 열기" +msgstr "편집기 ë°ì´í„°/ì„¤ì • í´ë” 열기" #: editor/editor_node.cpp msgid "Open Editor Data Folder" -msgstr "ì—디터 ë°ì´í„° í´ë” 열기" +msgstr "편집기 ë°ì´í„° í´ë” 열기" #: editor/editor_node.cpp msgid "Open Editor Settings Folder" -msgstr "ì—디터 ì„¤ì • í´ë” 열기" +msgstr "편집기 ì„¤ì • í´ë” 열기" #: editor/editor_node.cpp msgid "Manage Editor Features" -msgstr "ì—디터 기능 관리" +msgstr "편집기 기능 관리" #: editor/editor_node.cpp editor/project_export.cpp msgid "Manage Export Templates" @@ -2818,7 +2846,7 @@ msgstr "커스텀 씬 실행" #: editor/editor_node.cpp msgid "Changing the video driver requires restarting the editor." -msgstr "비디오 드ë¼ì´ë²„를 ë³€ê²½í•˜ë ¤ë©´ ì—디터를 다시 시작해야 합니다." +msgstr "비디오 드ë¼ì´ë²„를 ë³€ê²½í•˜ë ¤ë©´ 편집기를 다시 시작해야 합니다." #: editor/editor_node.cpp editor/project_settings_editor.cpp #: editor/settings_config_dialog.cpp @@ -2827,7 +2855,7 @@ msgstr "ì €ìž¥ & 다시 시작" #: editor/editor_node.cpp msgid "Spins when the editor window redraws." -msgstr "ì—디터 윈ë„ìš°ê°€ 다시 ê·¸ë ¤ì§ˆ 때 íšŒì „í•©ë‹ˆë‹¤." +msgstr "편집기 ì°½ì´ ë‹¤ì‹œ ê·¸ë ¤ì§ˆ 때 íšŒì „í•©ë‹ˆë‹¤." #: editor/editor_node.cpp msgid "Update Continuously" @@ -2929,27 +2957,27 @@ msgstr "ì„ íƒ" #: editor/editor_node.cpp msgid "Open 2D Editor" -msgstr "2D ì—디터 열기" +msgstr "2D 편집기 열기" #: editor/editor_node.cpp msgid "Open 3D Editor" -msgstr "3D ì—디터 열기" +msgstr "3D 편집기 열기" #: editor/editor_node.cpp msgid "Open Script Editor" -msgstr "스í¬ë¦½íЏ ì—디터 열기" +msgstr "스í¬ë¦½íЏ 편집기 열기" #: editor/editor_node.cpp editor/project_manager.cpp msgid "Open Asset Library" -msgstr "ì—ì…‹ ë¼ì´ë¸ŒëŸ¬ë¦¬ 열기" +msgstr "ì• ì…‹ ë¼ì´ë¸ŒëŸ¬ë¦¬ 열기" #: editor/editor_node.cpp msgid "Open the next Editor" -msgstr "ë‹¤ìŒ ì—디터 열기" +msgstr "ë‹¤ìŒ íŽ¸ì§‘ê¸° 열기" #: editor/editor_node.cpp msgid "Open the previous Editor" -msgstr "ì´ì „ ì—디터 열기" +msgstr "ì´ì „ 편집기 열기" #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" @@ -3033,6 +3061,11 @@ msgstr "시간" msgid "Calls" msgstr "호출" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "테마 편집" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "사용" @@ -3055,7 +3088,7 @@ msgstr "ì§€ì •í•˜ê¸°..." #: editor/editor_properties.cpp msgid "Invalid RID" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ RID" +msgstr "올바르지 ì•Šì€ RID" #: editor/editor_properties.cpp msgid "" @@ -3122,7 +3155,7 @@ msgstr "%s로 변환" #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Open Editor" -msgstr "ì—디터 열기" +msgstr "편집기 열기" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" @@ -3240,7 +3273,7 @@ msgstr "내보내기 템플릿 zip 파ì¼ì„ ì—´ 수 없습니다." #: editor/export_template_manager.cpp msgid "Invalid version.txt format inside templates: %s." -msgstr "템플릿 ì•ˆì— version.txtê°€ ìœ íš¨í•˜ì§€ ì•Šì€ í˜•ì‹ìž…니다: %s." +msgstr "템플릿 안 version.txtê°€ 올바르지 ì•Šì€ í˜•ì‹ìž…니다: %s." #: editor/export_template_manager.cpp msgid "No version.txt found inside templates." @@ -3437,11 +3470,11 @@ msgstr "ì´ë¦„ì´ ì œê³µë˜ì§€ 않았습니다." #: editor/filesystem_dock.cpp msgid "Provided name contains invalid characters." -msgstr "ì œê³µëœ ì´ë¦„ì— ìœ íš¨í•˜ì§€ ì•Šì€ ë¬¸ìžê°€ 있습니다." +msgstr "ì œê³µëœ ì´ë¦„ì— ì˜¬ë°”ë¥´ì§€ ì•Šì€ ë¬¸ìžê°€ 있습니다." #: editor/filesystem_dock.cpp msgid "Name contains invalid characters." -msgstr "ì´ë¦„ì— ìœ íš¨í•˜ì§€ ì•Šì€ ë¬¸ìžê°€ 있습니다." +msgstr "ì´ë¦„ì— ì˜¬ë°”ë¥´ì§€ ì•Šì€ ë¬¸ìžê°€ 있습니다." #: editor/filesystem_dock.cpp msgid "A file or folder with this name already exists." @@ -3734,7 +3767,7 @@ msgstr "ê°€ì ¸ì˜¤ê¸° 후 ì‹¤í–‰í• ìŠ¤í¬ë¦½íŠ¸ë¥¼ 불러올 수 없습니다:" #: editor/import/resource_importer_scene.cpp msgid "Invalid/broken script for post-import (check console):" msgstr "" -"ê°€ì ¸ì˜¤ê¸° 후 ì‹¤í–‰í• ìŠ¤í¬ë¦½íŠ¸ê°€ ìœ íš¨í•˜ì§€ 않거나 ê¹¨ì ¸ 있습니다 (콘솔 확ì¸):" +"ê°€ì ¸ì˜¤ê¸° 후 ì‹¤í–‰í• ìŠ¤í¬ë¦½íŠ¸ê°€ 올바르지 않거나 ê¹¨ì ¸ 있습니다 (콘솔 확ì¸):" #: editor/import/resource_importer_scene.cpp msgid "Error running post-import script:" @@ -3774,13 +3807,13 @@ msgstr "씬 ì €ìž¥, 다시 ê°€ì ¸ì˜¤ê¸° ë° ë‹¤ì‹œ 시작" #: editor/import_dock.cpp msgid "Changing the type of an imported file requires editor restart." -msgstr "ê°€ì ¸ì˜¨ 파ì¼ì˜ íƒ€ìž…ì„ ë³€ê²½í•˜ë ¤ë©´ ì—디터를 다시 시작해야 합니다." +msgstr "ê°€ì ¸ì˜¨ 파ì¼ì˜ íƒ€ìž…ì„ ë³€ê²½í•˜ë ¤ë©´ 편집기를 다시 시작해야 합니다." #: editor/import_dock.cpp msgid "" "WARNING: Assets exist that use this resource, they may stop loading properly." msgstr "" -"ê²½ê³ : ì´ ë¦¬ì†ŒìŠ¤ë¥¼ 사용하는 ì—ì…‹ì´ ì¡´ìž¬í•©ë‹ˆë‹¤, ì—ì…‹ì„ ë¶ˆëŸ¬ì˜¤ì§€ ëª»í• ìˆ˜ 있습니" +"ê²½ê³ : ì´ ë¦¬ì†ŒìŠ¤ë¥¼ 사용하는 ì• ì…‹ì´ ì¡´ìž¬í•©ë‹ˆë‹¤, ì• ì…‹ì„ ë¶ˆëŸ¬ì˜¤ì§€ ëª»í• ìˆ˜ 있습니" "다." #: editor/inspector_dock.cpp @@ -4110,7 +4143,7 @@ msgstr "노드 ì´ë™ë¨" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Unable to connect, port may be in use or connection may be invalid." -msgstr "ì—°ê²°í• ìˆ˜ 없습니다, í¬íŠ¸ê°€ 사용 중ì´ê±°ë‚˜ ìœ íš¨í•˜ì§€ 않는 연결입니다." +msgstr "ì—°ê²°í• ìˆ˜ 없습니다, í¬íŠ¸ê°€ 사용 중ì´ê±°ë‚˜ 올바르지 않는 연결입니다." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -4151,7 +4184,7 @@ msgstr "ì„¤ì •í•œ ì• ë‹ˆë©”ì´ì…˜ í”Œë ˆì´ì–´ê°€ 없습니다, 트랙 ì´ë¦„ì„ #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Player path set is invalid, so unable to retrieve track names." msgstr "" -"ìœ íš¨í•˜ì§€ 않는 í”Œë ˆì´ì–´ 경로 ì„¤ì •ìž…ë‹ˆë‹¤, 트랙 ì´ë¦„ì„ ê²€ìƒ‰í• ìˆ˜ 없습니다." +"올바르지 않는 í”Œë ˆì´ì–´ 경로 ì„¤ì •ìž…ë‹ˆë‹¤, 트랙 ì´ë¦„ì„ ê²€ìƒ‰í• ìˆ˜ 없습니다." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/root_motion_editor_plugin.cpp @@ -4159,7 +4192,7 @@ msgid "" "Animation player has no valid root node path, so unable to retrieve track " "names." msgstr "" -"ì• ë‹ˆë©”ì´ì…˜ í”Œë ˆì´ì–´ê°€ ìœ íš¨í•œ 루트 노드 경로를 ê°€ì§€ê³ ìžˆì§€ 않습니다, 트랙 ì´ë¦„" +"ì• ë‹ˆë©”ì´ì…˜ í”Œë ˆì´ì–´ê°€ 올바른 루트 노드 경로를 ê°€ì§€ê³ ìžˆì§€ 않습니다, 트랙 ì´ë¦„" "ì„ ê²€ìƒ‰í• ìˆ˜ 없습니다." #: editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -4208,7 +4241,7 @@ msgstr "ì• ë‹ˆë©”ì´ì…˜ ì‚ì œ" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Invalid animation name!" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ì• ë‹ˆë©”ì´ì…˜ ì´ë¦„!" +msgstr "올바르지 ì•Šì€ ì• ë‹ˆë©”ì´ì…˜ ì´ë¦„!" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Animation name already exists!" @@ -4562,11 +4595,11 @@ msgstr "ìž…ë ¥ ì‚ì œ" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Animation tree is valid." -msgstr "ì• ë‹ˆë©”ì´ì…˜ 트리가 ìœ íš¨í•©ë‹ˆë‹¤." +msgstr "ì• ë‹ˆë©”ì´ì…˜ 트리가 올바릅니다." #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Animation tree is invalid." -msgstr "ì• ë‹ˆë©”ì´ì…˜ 트리가 ìœ íš¨í•˜ì§€ 않습니다." +msgstr "ì• ë‹ˆë©”ì´ì…˜ 트리가 올바르지 않습니다." #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Animation Node" @@ -4666,7 +4699,7 @@ msgstr "sha256 해시 í™•ì¸ ì‹¤íŒ¨" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Asset Download Error:" -msgstr "ì—ì…‹ 다운로드 오류:" +msgstr "ì• ì…‹ 다운로드 오류:" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Downloading (%s / %s)..." @@ -4689,6 +4722,10 @@ msgid "Idle" msgstr "대기" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "설치하기..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "다시 시ë„" @@ -4698,7 +4735,7 @@ msgstr "다운로드 오류" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Download for this asset is already in progress!" -msgstr "ì´ ì—ì…‹ì˜ ë‹¤ìš´ë¡œë“œê°€ ì´ë¯¸ 진행중입니다!" +msgstr "ì´ ì• ì…‹ì˜ ë‹¤ìš´ë¡œë“œê°€ ì´ë¯¸ 진행중입니다!" #: editor/plugins/asset_library_editor_plugin.cpp msgid "First" @@ -4717,7 +4754,6 @@ msgid "Last" msgstr "ë으로" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "모ë‘" @@ -4731,8 +4767,8 @@ msgid "Sort:" msgstr "ì •ë ¬:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "뒤집기" +msgid "Reverse sorting." +msgstr "ì—순 ì •ë ¬." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4757,7 +4793,7 @@ msgstr "테스팅" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Assets ZIP File" -msgstr "ì—ì…‹ ZIP 파ì¼" +msgstr "ì• ì…‹ ZIP 파ì¼" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" @@ -4811,32 +4847,32 @@ msgid "Rotation Step:" msgstr "íšŒì „ 스í…:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "세로 ê°€ì´ë“œ ì´ë™" +msgid "Move Vertical Guide" +msgstr "ìˆ˜ì§ ê°€ì´ë“œ ì´ë™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "새로운 세로 ê°€ì´ë“œ 만들기" +msgid "Create Vertical Guide" +msgstr "ìˆ˜ì§ ê°€ì´ë“œ 만들기" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "세로 ê°€ì´ë“œ ì‚ì œ" +msgid "Remove Vertical Guide" +msgstr "ìˆ˜ì§ ê°€ì´ë“œ ì‚ì œ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "가로 ê°€ì´ë“œ ì´ë™" +msgid "Move Horizontal Guide" +msgstr "ìˆ˜í‰ ê°€ì´ë“œ ì´ë™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "새로운 가로 ê°€ì´ë“œ 만들기" +msgid "Create Horizontal Guide" +msgstr "ìˆ˜í‰ ê°€ì´ë“œ 만들기" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "가로 ê°€ì´ë“œ ì‚ì œ" +msgid "Remove Horizontal Guide" +msgstr "ìˆ˜í‰ ê°€ì´ë“œ ì‚ì œ" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "새 가로 세로 ê°€ì´ë“œ 만들기" +msgid "Create Horizontal and Vertical Guides" +msgstr "ìˆ˜í‰ ë° ìˆ˜ì§ ê°€ì´ë“œ 만들기" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -5388,7 +5424,7 @@ msgstr "í•목" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item List Editor" -msgstr "í•목 ëª©ë¡ ì—디터" +msgstr "í•목 ëª©ë¡ íŽ¸ì§‘ê¸°" #: editor/plugins/light_occluder_2d_editor_plugin.cpp msgid "Create Occluder Polygon" @@ -5534,15 +5570,15 @@ msgstr "소스 메시가 ì§€ì •ë˜ì§€ 않았습니다 (ê·¸ë¦¬ê³ MultiMeshì— ë© #: editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (invalid path)." -msgstr "소스 메시가 ìœ íš¨í•˜ì§€ 않습니다 (ìœ íš¨í•˜ì§€ ì•Šì€ ê²½ë¡œ)." +msgstr "소스 메시가 올바르지 않습니다 (올바르지 ì•Šì€ ê²½ë¡œ)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (not a MeshInstance)." -msgstr "소스 메시가 ìœ íš¨í•˜ì§€ 않습니다 (MeshInstanceê°€ 아닙니다)." +msgstr "소스 메시가 올바르지 않습니다 (MeshInstanceê°€ 아닙니다)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (contains no Mesh resource)." -msgstr "소스 메시가 ìœ íš¨í•˜ì§€ 않습니다 (메시 리소스가 없습니다)." +msgstr "소스 메시가 올바르지 않습니다 (Mesh 리소스가 없습니다)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "No surface source specified." @@ -5550,15 +5586,15 @@ msgstr "서피스 소스가 ì§€ì •ë˜ì§€ 않았습니다." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (invalid path)." -msgstr "서피스 소스가 ìœ íš¨í•˜ì§€ 않습니다 (ìœ íš¨í•˜ì§€ ì•Šì€ ê²½ë¡œ)." +msgstr "서피스 소스가 올바르지 않습니다 (올바르지 ì•Šì€ ê²½ë¡œ)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (no geometry)." -msgstr "서피스 소스가 ìœ íš¨í•˜ì§€ 않습니다 (지오메트리 ì—†ìŒ)." +msgstr "서피스 소스가 올바르지 않습니다 (지오메트리 ì—†ìŒ)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (no faces)." -msgstr "서피스 소스가 ìœ íš¨í•˜ì§€ 않습니다 (페ì´ìФ ì—†ìŒ)." +msgstr "서피스 소스가 올바르지 않습니다 (페ì´ìФ ì—†ìŒ)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Parent has no solid faces to populate." @@ -5882,7 +5918,7 @@ msgstr "ë‚´ë¶€ ê¼ì§“ì ì‚ì œ" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Invalid Polygon (need 3 different vertices)" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ í´ë¦¬ê³¤ (3ê°œì˜ ë‹¤ë¥¸ ê¼ì§“ì ì´ í•„ìš”í•¨)" +msgstr "올바르지 ì•Šì€ í´ë¦¬ê³¤ (3ê°œì˜ ë‹¤ë¥¸ ê¼ì§“ì ì´ í•„ìš”í•¨)" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Add Custom Polygon" @@ -5906,11 +5942,11 @@ msgstr "본 무게 페ì¸íЏ" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Open Polygon 2D UV editor." -msgstr "í´ë¦¬ê³¤ 2D UV ì—디터 열기." +msgstr "í´ë¦¬ê³¤ 2D UV 편집기 열기." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Polygon 2D UV Editor" -msgstr "í´ë¦¬ê³¤ 2D UV ì—디터" +msgstr "í´ë¦¬ê³¤ 2D UV 편집기" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "UV" @@ -6072,7 +6108,7 @@ msgstr "타입:" #: editor/plugins/resource_preloader_editor_plugin.cpp #: editor/scene_tree_dock.cpp editor/scene_tree_editor.cpp msgid "Open in Editor" -msgstr "ì—디터ì—서 열기" +msgstr "편집기ì—서 열기" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "Load Resource" @@ -6088,7 +6124,7 @@ msgstr "AnimationTreeê°€ AnimationPlayer로 향하는 경로를 ê°€ì§€ê³ ìžˆì§€ #: editor/plugins/root_motion_editor_plugin.cpp msgid "Path to AnimationPlayer is invalid" -msgstr "AnimationPlayer로 향하는 경로가 ìœ íš¨í•˜ì§€ 않습니다" +msgstr "AnimationPlayer로 향하는 경로가 올바르지 않습니다" #: editor/plugins/script_editor_plugin.cpp msgid "Clear Recent Files" @@ -6287,7 +6323,7 @@ msgstr "디버거 í•ìƒ ì—´ì–´ë†“ê¸°" #: editor/plugins/script_editor_plugin.cpp msgid "Debug with External Editor" -msgstr "외부 ì—디터로 디버깅" +msgstr "외부 편집기로 디버깅" #: editor/plugins/script_editor_plugin.cpp msgid "Open Godot online documentation." @@ -6412,7 +6448,7 @@ msgstr "구문 ê°•ì¡°" #: editor/plugins/script_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 @@ -6420,9 +6456,8 @@ msgid "Bookmarks" msgstr "ë¶ë§ˆí¬" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "í¬ì¸íЏ 만들기." +msgstr "중단ì " #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6712,9 +6747,15 @@ msgid "Rear" msgstr "ë’·ë©´" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "뷰와 ì •ë ¬" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "ì„ íƒ í•ëª©ì„ ë·°ì— ì •ë ¬" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "ì„ íƒëœ 부모 노드가 없어서 ìžì‹ë…¸ë“œë¥¼ ì¸ìŠ¤í„´ìŠ¤í• ìˆ˜ 없습니다." @@ -6808,7 +6849,7 @@ 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 "" -"ì°¸ê³ : FPS ê°’ì€ ì—ë””í„°ì˜ í”„ë ˆìž„ ì†ë„입니다.\n" +"ì°¸ê³ : FPS ê°’ì€ íŽ¸ì§‘ê¸°ì˜ í”„ë ˆìž„ ì†ë„입니다.\n" "게임 ë‚´ ì„±ëŠ¥ì„ ë³´ì¦í•˜ëŠ” 표시로 ë³¼ 수 없습니다." #: editor/plugins/spatial_editor_plugin.cpp @@ -6902,10 +6943,6 @@ msgid "Focus Selection" msgstr "ì„ íƒ í¬ì»¤ìФ" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "ì„ íƒ í•ëª©ì„ ë·°ì— ì •ë ¬" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "ì„ íƒ íˆ´" @@ -7310,11 +7347,11 @@ msgstr "빈 템플릿 만들기" #: editor/plugins/theme_editor_plugin.cpp msgid "Create Empty Editor Template" -msgstr "빈 ì—디터 템플릿 만들기" +msgstr "빈 편집기 템플릿 만들기" #: editor/plugins/theme_editor_plugin.cpp msgid "Create From Current Editor Theme" -msgstr "현재 ì—디터 테마로부터 만들기" +msgstr "현재 편집기 테마로부터 만들기" #: editor/plugins/theme_editor_plugin.cpp msgid "Toggle Button" @@ -7466,14 +7503,6 @@ msgid "Transpose" msgstr "바꾸기" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Xì¶• 뒤집기" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Yì¶• 뒤집기" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "ì˜¤í† íƒ€ì¼ ë¹„í™œì„±í™”" @@ -7681,9 +7710,9 @@ msgid "" "bindings.\n" "Click on another Tile to edit it." msgstr "" -"ì‚¬ìš©í• ì„œë¸Œ 타ì¼ì„ ì•„ì´ì½˜ìœ¼ë¡œ ì„¤ì •í•˜ì„¸ìš”, ìœ íš¨í•˜ì§€ ì•Šì€ ìžë™ íƒ€ì¼ ë°”ì¸ë”©ì—ë„ " +"ì•„ì´ì½˜ìœ¼ë¡œ ì‚¬ìš©í• ì„œë¸Œ 타ì¼ì„ ì„¤ì •í•˜ì„¸ìš”, 올바르지 ì•Šì€ ìžë™ íƒ€ì¼ ë°”ì¸ë”©ì—ë„ " "사용ë©ë‹ˆë‹¤.\n" -"다른 타ì¼ì„ íŽ¸ì§‘í•˜ë ¤ë©´ í´ë¦." +"다른 타ì¼ì„ íŽ¸ì§‘í•˜ë ¤ë©´ í´ë¦í•˜ì„¸ìš”." #: editor/plugins/tile_set_editor_plugin.cpp msgid "" @@ -7870,6 +7899,10 @@ msgid "Visual Shader Input Type Changed" msgstr "비주얼 ì…°ì´ë” ìž…ë ¥ 타입 변경ë¨" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(GLES3ë§Œ 가능)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "버í…스" @@ -7954,6 +7987,22 @@ msgid "Color uniform." msgstr "ìƒ‰ìƒ ìœ ë‹ˆí¼." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "ë‘ ë§¤ê°œë³€ìˆ˜ ì‚¬ì´ %s 비êµì˜ 불리언 ê²°ê³¼ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "같다 (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "보다 ë” í¬ë‹¤ (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "보다 í¬ê±°ë‚˜ 같다 (>=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7961,10 +8010,47 @@ msgstr "ì œê³µëœ ìŠ¤ì¹¼ë¼ê°€ 같거나, ë” í¬ê±°ë‚˜, ë” ìž‘ìœ¼ë©´ ê´€ë ¨ ë² #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "무한(INF)ê³¼ ìŠ¤ì¹¼ë¼ ë§¤ê°œë³€ìˆ˜ ì‚¬ì´ ë¹„êµì˜ 불리언 ê²°ê³¼ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" +"ìˆ«ìž ì•„ë‹˜(NaN)ê³¼ ìŠ¤ì¹¼ë¼ ë§¤ê°œë³€ìˆ˜ ì‚¬ì´ ë¹„êµì˜ 불리언 ê²°ê³¼ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "보다 ë” ìž‘ë‹¤ (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "보다 작거나 같다 (<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "같지 않다 (!=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "불리언 ê°’ì´ ì°¸ì´ê±°ë‚˜ ê±°ì§“ì´ë©´ ê´€ë ¨ 벡터를 반환합니다." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "ë‘ ë§¤ê°œë³€ìˆ˜ ì‚¬ì´ ë¹„êµì˜ 불리언 ê²°ê³¼ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." + +#: editor/plugins/visual_shader_editor_plugin.cpp +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 msgid "Boolean constant." msgstr "불리언 ìƒìˆ˜." @@ -8053,16 +8139,16 @@ msgid "Returns the arc-cosine of the parameter." msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ì•„í¬ì½”ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "(GLES3ë§Œ 가능) ë§¤ê°œë³€ìˆ˜ì˜ ì—ìŒê³¡ì½”ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ì—ìŒê³¡ì½”ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ì•„í¬ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "(GLES3ë§Œ 가능) ë§¤ê°œë³€ìˆ˜ì˜ ì—ìŒê³¡ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ì—ìŒê³¡ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." @@ -8073,8 +8159,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "ë§¤ê°œë³€ìˆ˜ë“¤ì˜ ì•„í¬íƒ„ì 트 ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "(GLES3ë§Œ 가능) ë§¤ê°œë³€ìˆ˜ì˜ ì—ìŒê³¡íƒ„ì 트 ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ì—ìŒê³¡íƒ„ì 트 ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8090,8 +8176,8 @@ msgid "Returns the cosine of the parameter." msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ì½”ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "(GLES3ë§Œ 가능) ë§¤ê°œë³€ìˆ˜ì˜ ìŒê³¡ì½”ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ìŒê³¡ì½”ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." @@ -8159,12 +8245,12 @@ msgid "1.0 / scalar" msgstr "1.0 / 스칼ë¼" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "(GLES3ë§Œ 가능) 매개변수ì—서 가장 가까운 ì •ìˆ˜ë¥¼ 찾습니다." +msgid "Finds the nearest integer to the parameter." +msgstr "매개변수ì—서 가장 가까운 ì •ìˆ˜ë¥¼ 찾습니다." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "(GLES3ë§Œ 가능) 매개변수ì—서 가장 가까운 ì§ìˆ˜ ì •ìˆ˜ë¥¼ 찾습니다." +msgid "Finds the nearest even integer to the parameter." +msgstr "매개변수ì—서 가장 가까운 ì§ìˆ˜ ì •ìˆ˜ë¥¼ 찾습니다." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." @@ -8179,8 +8265,8 @@ msgid "Returns the sine of the parameter." msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "(GLES3ë§Œ 가능) ë§¤ê°œë³€ìˆ˜ì˜ ìŒê³¡ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." +msgid "Returns the hyperbolic sine of the parameter." +msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ìŒê³¡ì‚¬ì¸ ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." @@ -8214,12 +8300,12 @@ msgid "Returns the tangent of the parameter." msgstr "ë§¤ê°œë³€ìˆ˜ì˜ íƒ„ì 트 ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "(GLES3ë§Œ 가능) ë§¤ê°œë³€ìˆ˜ì˜ ìŒê³¡íƒ„ì 트 ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ìŒê³¡íƒ„ì 트 ê°’ì„ ë°˜í™˜í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "(GLES3ë§Œ 가능) ë§¤ê°œë³€ìˆ˜ì˜ ì ˆì‚¬ ê°’ì„ ì°¾ìŠµë‹ˆë‹¤." +msgid "Finds the truncated value of the parameter." +msgstr "ë§¤ê°œë³€ìˆ˜ì˜ ì ˆì‚¬ëœ ê°’ì„ ì°¾ìŠµë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." @@ -8258,12 +8344,16 @@ msgid "Perform the texture lookup." msgstr "í…ìŠ¤ì³ ë£©ì—…ì„ ìˆ˜í–‰í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." -msgstr "ì„¸ì œê³± í…ìŠ¤ì³ ìœ ë‹ˆí¼." +msgid "Cubic texture uniform lookup." +msgstr "ì„¸ì œê³± í…ìŠ¤ì³ ìœ ë‹ˆí¼ ë£©ì—…." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." -msgstr "2D í…ìŠ¤ì³ ìœ ë‹ˆí¼." +msgid "2D texture uniform lookup." +msgstr "2D í…ìŠ¤ì³ ìœ ë‹ˆí¼ ë£©ì—…." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." +msgstr "Triplanarê°€ ì ìš©ëœ 2D í…ìŠ¤ì³ ìœ ë‹ˆí¼ ë£©ì—… ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Transform function." @@ -8271,7 +8361,7 @@ msgstr "변형 함수." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8279,7 +8369,7 @@ 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 "" -"(GLES3ë§Œ 가능) 한 ìŒì˜ ë²¡í„°ì˜ ì™¸ì ì„ ê³„ì‚°í•©ë‹ˆë‹¤.\n" +"벡터 한 ìŒì˜ 외ì ì„ ê³„ì‚°í•©ë‹ˆë‹¤.\n" "\n" "OuterProduct는 첫 매개변수 'c'를 ì—´ 벡터로 취급합니다 (1열로 ì´ë£¨ì–´ì§„ í–‰ë ¬) " "ê·¸ë¦¬ê³ ë‘ ë²ˆì§¸ 매개변수 'r'ì„ í–‰ 벡터로 취급합니다 (1행으로 ì´ë£¨ì–´ì§„ í–‰ë ¬) ê·¸" @@ -8295,16 +8385,16 @@ msgid "Decomposes transform to four vectors." msgstr "ë³€í˜•ì„ 4ê°œì˜ ë²¡í„°ë¡œ 분해합니다." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "(GLES3ë§Œ 가능) ë³€í˜•ì˜ í–‰ë ¬ì‹ì„ 계산합니다." +msgid "Calculates the determinant of a transform." +msgstr "ë³€í˜•ì˜ í–‰ë ¬ì‹ì„ 계산합니다." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "(GLES3ë§Œ 가능) ë³€í˜•ì˜ ì—함수를 계산합니다." +msgid "Calculates the inverse of a transform." +msgstr "ë³€í˜•ì˜ ì—함수를 계산합니다." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "(GLES3ë§Œ 가능) ë³€í˜•ì˜ ì „ì¹˜ë¥¼ 계산합니다." +msgid "Calculates the transpose of a transform." +msgstr "ë³€í˜•ì˜ ì „ì¹˜ë¥¼ 계산합니다." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." @@ -8352,15 +8442,15 @@ msgstr "ë‘ ë²¡í„°ì˜ ìŠ¤ì¹¼ë¼ê³± ê°’ì„ ê³„ì‚°í•©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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ì˜ ìŠ¤ì¹¼ë¼ê³± ê°’ì´ 0보다 작으면 ë°˜í™˜ê°’ì€ Nì´ ë©ë‹ˆë‹¤. ê·¸ë ‡ì§€ 않" -"으면 -Nì´ ë°˜í™˜ë©ë‹ˆë‹¤." +"í„° Nref. I와 Nrefì˜ ë‚´ì ê°’ì´ 0보다 작으면 ë°˜í™˜ê°’ì€ Nì´ ë©ë‹ˆë‹¤. ê·¸ë ‡ì§€ 않으" +"ë©´ -Nì´ ë°˜í™˜ë©ë‹ˆë‹¤." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." @@ -8384,13 +8474,13 @@ msgstr "1.0 / 벡터" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"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 a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "반사 ë°©í–¥ì„ ê°€ë¦¬í‚¤ëŠ” 벡터를 반환합니다." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8488,60 +8578,50 @@ msgstr "" "다 (í´ì˜¤í”„와 ê´€ë ¨ëœ ìž…ë ¥ì„ ì „ë‹¬í•¨)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "(GLES3ë§Œ 가능) (프래그먼트/조명 모드만 가능) ìŠ¤ì¹¼ë¼ ë¯¸ë¶„ 함수." +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(프래그먼트/조명 모드만 가능) ìŠ¤ì¹¼ë¼ ë¯¸ë¶„ 함수." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "(GLES3ë§Œ 가능) (프래그먼트/조명 모드만 가능) 벡터 미분 함수." +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(프래그먼트/조명 모드만 가능) 벡터 미분 함수." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." -msgstr "" -"(GLES3ë§Œ 가능) (프래그먼트/조명 모드만 가능) ì§€ì— ì°¨ë¶„ì„ ì´ìš©í•œ 'x'ì˜ (벡터) " -"ë„함수." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." +msgstr "(프래그먼트/조명 모드만 가능) ì§€ì— ì°¨ë¶„ì„ ì´ìš©í•œ 'x'ì˜ (벡터) ë„함수." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" -"(GLES3ë§Œ 가능) (프래그먼트/조명 모드만 가능) ì§€ì— ì°¨ë¶„ì„ ì´ìš©í•œ 'x'ì˜ (스칼" -"ë¼) ë„함수." +"(프래그먼트/조명 모드만 가능) ì§€ì— ì°¨ë¶„ì„ ì´ìš©í•œ 'x'ì˜ (스칼ë¼) ë„함수." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." -msgstr "" -"(GLES3ë§Œ 가능) (프래그먼트/조명 모드만 가능) ì§€ì— ì°¨ë¶„ì„ ì´ìš©í•œ 'y'ì˜ (벡터) " -"ë„함수." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." +msgstr "(프래그먼트/조명 모드만 가능) ì§€ì— ì°¨ë¶„ì„ ì´ìš©í•œ 'y'ì˜ (벡터) ë„함수." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" -"(GLES3ë§Œ 가능) (프래그먼트/조명 모드만 가능) ì§€ì— ì°¨ë¶„ì„ ì´ìš©í•œ 'y'ì˜ (스칼" -"ë¼) ë„함수." +"(프래그먼트/조명 모드만 가능) ì§€ì— ì°¨ë¶„ì„ ì´ìš©í•œ 'y'ì˜ (스칼ë¼) ë„함수." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." -msgstr "" -"(GLES3ë§Œ 가능) (프래그먼트/조명 모드만 가능) (벡터) 'x'와 'y'ì˜ ì ˆëŒ€ 미분 ê°’" -"ì˜ í•©." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." +msgstr "(프래그먼트/조명 모드만 가능) (벡터) 'x'와 'y'ì˜ ì ˆëŒ€ 미분 ê°’ì˜ í•©." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." -msgstr "" -"(GLES3ë§Œ 가능) (프래그먼트/조명 모드만 가능) (스칼ë¼) 'x'와 'y'ì˜ ì ˆëŒ€ 미분 " -"ê°’ì˜ í•©." +"(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" @@ -8721,7 +8801,8 @@ msgstr "경로가 존재하지 않습니다." #: editor/project_manager.cpp msgid "Invalid '.zip' project file, does not contain a 'project.godot' file." msgstr "" -"ìœ íš¨í•˜ì§€ ì•Šì€ '.zip' 프로ì 트 파ì¼, 'project.godot' 파ì¼ì„ í¬í•¨í•˜ì§€ 않ìŒ." +"올바르지 ì•Šì€ '.zip' 프로ì 트 파ì¼, 'project.godot' 파ì¼ì„ í¬í•¨í•˜ì§€ ì•Šê³ ìžˆìŠµ" +"니다." #: editor/project_manager.cpp msgid "Please choose an empty folder." @@ -8761,7 +8842,7 @@ msgstr "프로ì 트 ì´ë¦„ì„ ì •í•˜ëŠ” ê²ƒì„ ê¶Œí•©ë‹ˆë‹¤." #: editor/project_manager.cpp msgid "Invalid project path (changed anything?)." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ í”„ë¡œì 트 경로 (ë”ê°€ ë³€ê²½í•˜ì‹ ê±°ë¼ë„?)." +msgstr "올바르지 ì•Šì€ í”„ë¡œì 트 경로 (ë”ê°€ ë³€ê²½í•˜ì‹ ê±°ë¼ë„?)." #: editor/project_manager.cpp msgid "" @@ -8936,7 +9017,7 @@ msgid "" "Can't run project: Assets need to be imported.\n" "Please edit the project to trigger the initial import." msgstr "" -"프로ì 트 실행 불가: ì—ì…‹ë“¤ì„ ê°€ì ¸ì™€ì•¼ 합니다.\n" +"프로ì 트 실행 불가: ì• ì…‹ë“¤ì„ ê°€ì ¸ì™€ì•¼ 합니다.\n" "프로ì 트를 편집하여 최초 ê°€ì ¸ì˜¤ê¸°ê°€ 실행ë˜ë„ë¡ í•˜ì„¸ìš”." #: editor/project_manager.cpp @@ -8973,7 +9054,7 @@ msgid "" "The interface will update after restarting the editor or project manager." msgstr "" "언어가 변경ë˜ì—ˆìŠµë‹ˆë‹¤.\n" -"ì¸í„°íŽ˜ì´ìŠ¤ëŠ” ì—디터나 프로ì 트 ë§¤ë‹ˆì €ë¥¼ ìž¬ì‹œìž‘í• ë•Œ ì—…ë°ì´íЏë©ë‹ˆë‹¤." +"ì¸í„°íŽ˜ì´ìŠ¤ëŠ” 편집기나 프로ì 트 ë§¤ë‹ˆì €ë¥¼ ìž¬ì‹œìž‘í• ë•Œ ì—…ë°ì´íЏë©ë‹ˆë‹¤." #: editor/project_manager.cpp msgid "" @@ -9029,7 +9110,7 @@ msgid "" "Would you like to explore official example projects in the Asset Library?" msgstr "" "현재 프로ì 트가 í•˜ë‚˜ë„ ì—†ìŠµë‹ˆë‹¤.\n" -"ì—ì…‹ ë¼ì´ë¸ŒëŸ¬ë¦¬ì—서 ê³µì‹ ì˜ˆì œ 프로ì 트를 ì°¾ì•„ë³´ì‹œê² ìŠµë‹ˆê¹Œ?" +"ì• ì…‹ ë¼ì´ë¸ŒëŸ¬ë¦¬ì—서 ê³µì‹ ì˜ˆì œ 프로ì 트를 ì°¾ì•„ë³´ì‹œê² ìŠµë‹ˆê¹Œ?" #: editor/project_settings_editor.cpp msgid "Key " @@ -9052,7 +9133,7 @@ msgid "" "Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or " "'\"'" msgstr "" -"ìœ íš¨í•˜ì§€ ì•Šì€ ì•¡ì…˜ ì´ë¦„. 공백ì´ê±°ë‚˜, '/' , ':', '=', '\\', '\"' 를 í¬í•¨í•˜ë©´ " +"올바르지 ì•Šì€ ì•¡ì…˜ ì´ë¦„. 공백ì´ê±°ë‚˜, '/' , ':', '=', '\\', '\"' 를 í¬í•¨í•˜ë©´ " "안 ë©ë‹ˆë‹¤" #: editor/project_settings_editor.cpp @@ -9277,7 +9358,7 @@ msgstr "ìž¬ì •ì˜..." #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp msgid "The editor must be restarted for changes to take effect." -msgstr "변경 사í•ì„ ì ìš©í•˜ë ¤ë©´ ì—디터를 다시 실행해야 합니다." +msgstr "변경 사í•ì„ ì ìš©í•˜ë ¤ë©´ 편집기를 다시 실행해야 합니다." #: editor/project_settings_editor.cpp msgid "Input Map" @@ -9752,6 +9833,11 @@ msgid "Extend Script" msgstr "스í¬ë¦½íЏ 펼치기" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "부모 노드 ìž¬ì§€ì •" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "씬 루트 만들기" @@ -9880,7 +9966,7 @@ msgstr "" #: editor/scene_tree_editor.cpp msgid "Invalid node name, the following characters are not allowed:" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ë…¸ë“œ ì´ë¦„입니다. 다ìŒì˜ 문ìžëŠ” 허용ë˜ì§€ 않습니다:" +msgstr "올바르지 ì•Šì€ ë…¸ë“œ ì´ë¦„입니다. 다ìŒì˜ 문ìžëŠ” 허용ë˜ì§€ 않습니다:" #: editor/scene_tree_editor.cpp msgid "Rename Node" @@ -9964,11 +10050,11 @@ msgstr "올바르지 ì•Šì€ ìƒì†ëœ 부모 ì´ë¦„ ë˜ëŠ” 경로." #: editor/script_create_dialog.cpp msgid "Script is valid." -msgstr "스í¬ë¦½íŠ¸ê°€ ìœ íš¨í•©ë‹ˆë‹¤." +msgstr "스í¬ë¦½íŠ¸ê°€ 올바릅니다." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" -msgstr "허용ë¨: a-z, A-z, 0-9 ê·¸ë¦¬ê³ _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." +msgstr "허용ë¨: a-z, A-z, 0-9 ê·¸ë¦¬ê³ ." #: editor/script_create_dialog.cpp msgid "Built-in script (into scene file)." @@ -10284,21 +10370,21 @@ msgstr "리소스 파ì¼ì— 기반하지 않ìŒ" #: modules/gdscript/gdscript_functions.cpp msgid "Invalid instance dictionary format (missing @path)" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ì¸ìŠ¤í„´ìŠ¤ Dictionary í˜•ì‹ (@path ì—†ìŒ)" +msgstr "올바르지 ì•Šì€ ì¸ìŠ¤í„´ìŠ¤ Dictionary í˜•ì‹ (@path ì—†ìŒ)" #: modules/gdscript/gdscript_functions.cpp msgid "Invalid instance dictionary format (can't load script at @path)" msgstr "" -"ìœ íš¨í•˜ì§€ ì•Šì€ ì¸ìŠ¤í„´ìŠ¤ Dictionary í˜•ì‹ (@path ì—서 스í¬ë¦½íŠ¸ë¥¼ 불러올 수 ì—†ìŒ)" +"올바르지 ì•Šì€ ì¸ìŠ¤í„´ìŠ¤ Dictionary í˜•ì‹ (@path ì—서 스í¬ë¦½íŠ¸ë¥¼ 불러올 수 ì—†ìŒ)" #: modules/gdscript/gdscript_functions.cpp msgid "Invalid instance dictionary format (invalid script at @path)" msgstr "" -"ìœ íš¨í•˜ì§€ ì•Šì€ ì¸ìŠ¤í„´ìŠ¤ Dictionary í˜•ì‹ (@pathì˜ ìŠ¤í¬ë¦½íŠ¸ê°€ ìœ íš¨í•˜ì§€ 않ìŒ)" +"올바르지 ì•Šì€ ì¸ìŠ¤í„´ìŠ¤ Dictionary í˜•ì‹ (@pathì˜ ìŠ¤í¬ë¦½íŠ¸ê°€ 올바르지 않ìŒ)" #: modules/gdscript/gdscript_functions.cpp msgid "Invalid instance dictionary (invalid subclasses)" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ì¸ìŠ¤í„´ìŠ¤ Dictionary (서브í´ëž˜ìŠ¤ê°€ ìœ íš¨í•˜ì§€ 않ìŒ)" +msgstr "올바르지 ì•Šì€ ì¸ìŠ¤í„´ìŠ¤ Dictionary (하위 í´ëž˜ìŠ¤ê°€ 올바르지 않ìŒ)" #: modules/gdscript/gdscript_functions.cpp msgid "Object can't provide a length." @@ -10514,7 +10600,7 @@ msgstr "" #: modules/visual_script/visual_script.cpp msgid "Node returned an invalid sequence output: " -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ì‹œí€€ìŠ¤ ì¶œë ¥ì„ ë°˜í™˜í•œ 노드: " +msgstr "올바르지 ì•Šì€ ì‹œí€€ìŠ¤ ì¶œë ¥ì„ ë°˜í™˜í•œ 노드: " #: modules/visual_script/visual_script.cpp msgid "Found sequence bit but not the node in the stack, report bug!" @@ -10551,7 +10637,7 @@ msgstr "변수:" #: modules/visual_script/visual_script_editor.cpp msgid "Name is not a valid identifier:" -msgstr "ìœ íš¨í•œ ì‹ë³„ìžê°€ 아닌 ì´ë¦„:" +msgstr "ì´ë¦„ì´ ì˜¬ë°”ë¥¸ ì‹ë³„ìžê°€ 아닙니다:" #: modules/visual_script/visual_script_editor.cpp msgid "Name already in use by another func/var/signal:" @@ -10759,7 +10845,7 @@ msgstr "반복ìžê°€ ìœ íš¨í•˜ì§€ 않게 ë¨: " #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ì¸ë±ìФ ì†ì„±ëª…." +msgstr "올바르지 ì•Šì€ ì¸ë±ìФ ì†ì„±ëª…." #: modules/visual_script/visual_script_func_nodes.cpp msgid "Base object is not a Node!" @@ -10771,15 +10857,15 @@ msgstr "노드를 ì§€ì¹í•˜ëŠ” 경로가 아닙니다!" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name '%s' in node %s." -msgstr "노드 %s ì•ˆì— ì¸ë±ìФ ì†ì„± ì´ë¦„ '%s'ì€(는) ìœ íš¨í•˜ì§€ 않습니다." +msgstr "노드 %s ì•ˆì— ì¸ë±ìФ ì†ì„± ì´ë¦„ '%s'ì€(는) 올바르지 않습니다." #: modules/visual_script/visual_script_nodes.cpp msgid ": Invalid argument of type: " -msgstr ": ìœ íš¨í•˜ì§€ ì•Šì€ ì¸ìˆ˜ 타입: " +msgstr ": 올바르지 ì•Šì€ ì¸ìˆ˜ 타입: " #: modules/visual_script/visual_script_nodes.cpp msgid ": Invalid arguments: " -msgstr ": ìœ íš¨í•˜ì§€ ì•Šì€ ì¸ìˆ˜: " +msgstr ": 올바르지 ì•Šì€ ì¸ìˆ˜: " #: modules/visual_script/visual_script_nodes.cpp msgid "VariableGet not found in script: " @@ -10799,7 +10885,7 @@ msgid "" "Invalid return value from _step(), must be integer (seq out), or string " "(error)." msgstr "" -"_step()ìœ¼ë¡œë¶€í„°ì˜ ìœ íš¨í•˜ì§€ ì•Šì€ ë°˜í™˜ 값으로, integer (seq out), í˜¹ì€ string " +"_step()ìœ¼ë¡œë¶€í„°ì˜ ì˜¬ë°”ë¥´ì§€ ì•Šì€ ë°˜í™˜ 값으로, integer (seq out), í˜¹ì€ string " "(error)ê°€ 아니면 안ë©ë‹ˆë‹¤." #: modules/visual_script/visual_script_property_selector.cpp @@ -10841,39 +10927,39 @@ msgstr "패키지는 ì ì–´ë„ í•˜ë‚˜ì˜ '.' 분리 기호를 ê°–ê³ ìžˆì–´ì•¼ í #: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." -msgstr "ADB 실행 파ì¼ì´ ì—디터 ì„¤ì •ì—서 구성ë˜ì§€ 않았습니다." +msgstr "ADB 실행 파ì¼ì´ 편집기 ì„¤ì •ì—서 구성ë˜ì§€ 않았습니다." #: platform/android/export/export.cpp msgid "OpenJDK jarsigner not configured in the Editor Settings." -msgstr "OpenJDK jarsignerê°€ ì—디터 ì„¤ì •ì—서 구성ë˜ì§€ 않았습니다." +msgstr "OpenJDK jarsignerê°€ 편집기 ì„¤ì •ì—서 구성ë˜ì§€ 않았습니다." #: platform/android/export/export.cpp msgid "Debug keystore not configured in the Editor Settings nor in the preset." -msgstr "Debug keystoreì´ ì—디터 ì„¤ì • ë˜ëŠ” 프리셋ì—서 구성ë˜ì§€ 않았습니다." +msgstr "Debug keystoreì´ íŽ¸ì§‘ê¸° ì„¤ì • ë˜ëŠ” 프리셋ì—서 구성ë˜ì§€ 않았습니다." #: platform/android/export/export.cpp msgid "Custom build requires a valid Android SDK path in Editor Settings." msgstr "" -"커스텀 빌드ì—는 ì—디터 ì„¤ì •ì—서 ìœ íš¨í•œ 안드로ì´ë“œ SDK 경로가 필요합니다." +"커스텀 빌드ì—는 편집기 ì„¤ì •ì—서 올바른 안드로ì´ë“œ SDK 경로가 필요합니다." #: platform/android/export/export.cpp msgid "Invalid Android SDK path for custom build in Editor Settings." -msgstr "ì—디터 ì„¤ì •ì—서 커스텀 ë¹Œë“œì— ì˜¬ë°”ë¥´ì§€ ì•Šì€ ì•ˆë“œë¡œì´ë“œ SDK 경로입니다." +msgstr "편집기 ì„¤ì •ì—서 커스텀 ë¹Œë“œì— ì˜¬ë°”ë¥´ì§€ ì•Šì€ ì•ˆë“œë¡œì´ë“œ SDK 경로입니다." #: platform/android/export/export.cpp msgid "" "Android project is not installed for compiling. Install from Editor menu." msgstr "" -"컴파ì¼ì„ 하기 위한 안드로ì´ë“œ 프로ì 트가 설치ë˜ì§€ 않았습니다. ì—디터 메뉴ì—" +"컴파ì¼ì„ 하기 위한 안드로ì´ë“œ 프로ì 트가 설치ë˜ì§€ 않았습니다. 편집기 메뉴ì—" "서 설치하세요." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." -msgstr "APK í™•ìž¥ì— ìœ íš¨í•˜ì§€ ì•Šì€ ê³µìš© 키입니다." +msgstr "APK í™•ìž¥ì— ì˜¬ë°”ë¥´ì§€ ì•Šì€ ê³µìš© 키입니다." #: platform/android/export/export.cpp msgid "Invalid package name:" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ íŒ¨í‚¤ì§€ ì´ë¦„:" +msgstr "올바르지 ì•Šì€ íŒ¨í‚¤ì§€ ì´ë¦„:" #: platform/android/export/export.cpp msgid "" @@ -10942,7 +11028,7 @@ msgstr "ì•±ìŠ¤í† ì–´ 팀 IDê°€ ì§€ì •ë˜ì§€ 않았습니다 - 프로ì 트를 êµ #: platform/iphone/export/export.cpp msgid "Invalid Identifier:" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ì‹ë³„ìž:" +msgstr "올바르지 ì•Šì€ ì‹ë³„ìž:" #: platform/iphone/export/export.cpp msgid "Required icon is not specified in the preset." @@ -10966,7 +11052,7 @@ msgstr "내보내기 í…œí”Œë¦¿ì„ ì—´ 수 없습니다:" #: platform/javascript/export/export.cpp msgid "Invalid export template:" -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ë‚´ë³´ë‚´ê¸° 템플릿:" +msgstr "올바르지 ì•Šì€ ë‚´ë³´ë‚´ê¸° 템플릿:" #: platform/javascript/export/export.cpp msgid "Could not read custom HTML shell:" @@ -10982,7 +11068,7 @@ msgstr "기본 부트 스플래시 ì´ë¯¸ì§€ 사용." #: platform/uwp/export/export.cpp msgid "Invalid package unique name." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ íŒ¨í‚¤ì§€ ê³ ìœ ì´ë¦„." +msgstr "올바르지 ì•Šì€ íŒ¨í‚¤ì§€ ê³ ìœ ì´ë¦„." #: platform/uwp/export/export.cpp msgid "Invalid product GUID." @@ -10998,41 +11084,40 @@ msgstr "ìœ ìš”í•˜ì§€ ì•Šì€ ë°°ê²½ 색ìƒ." #: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (50x50 ì´ì–´ì•¼ 합니다)." +msgstr "올바르지 ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (50x50 ì´ì–´ì•¼ 합니다)." #: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (44x44 ì´ì–´ì•¼ 합니다)." +msgstr "올바르지 ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (44x44 ì´ì–´ì•¼ 합니다)." #: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (71x71 ì´ì–´ì•¼ 합니다)." +msgstr "올바르지 ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (71x71 ì´ì–´ì•¼ 합니다)." #: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (150x150 ì´ì–´ì•¼ 합니다)." +msgstr "올바르지 ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (150x150 ì´ì–´ì•¼ 합니다)." #: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (310x310 ì´ì–´ì•¼ 합니다)." +msgstr "올바르지 ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (310x310 ì´ì–´ì•¼ 합니다)." #: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (310x150 ì´ì–´ì•¼ 합니다)." +msgstr "올바르지 ì•Šì€ ë¡œê³ ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (310x150 ì´ì–´ì•¼ 합니다)." #: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" -"ìœ íš¨í•˜ì§€ ì•Šì€ ìŠ¤í”Œëž˜ì‰¬ 스í¬ë¦° ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (620x300 ì´ì–´ì•¼ 합니다)." +"올바르지 ì•Šì€ ìŠ¤í”Œëž˜ì‹œ 스í¬ë¦° ì´ë¯¸ì§€ í¬ê¸°ìž…니다 (620x300 ì´ì–´ì•¼ 합니다)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." msgstr "" -"AnimatedSpriteì´ í”„ë ˆìž„ì„ ë³´ì—¬ì£¼ê¸° 위해서는 'Frames' ì†ì„±ì— SpriteFrames 리소" -"스 만들거나 ì§€ì •í•´ì•¼ 합니다." +"AnimatedSpriteì´ í”„ë ˆìž„ì„ ë³´ì—¬ì£¼ê¸° 위해서는 \"Frames\" ì†ì„±ì— SpriteFrames 리" +"소스를 만들거나 ì§€ì •í•´ì•¼ 합니다." #: scene/2d/canvas_modulate.cpp msgid "" @@ -11094,11 +11179,10 @@ msgstr "" "CanvasItemMaterialì´ í•„ìš”í•©ë‹ˆë‹¤." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." -msgstr "ë¼ì´íŠ¸ì˜ ëª¨ì–‘ì„ ë‚˜íƒ€ë‚´ëŠ” í…스ì³ë¥¼ 'texture' ì†ì„±ì— ì§€ì •í•´ì•¼í•©ë‹ˆë‹¤." +msgstr "ì¡°ëª…ì˜ ëª¨ì–‘ì„ ë‚˜íƒ€ë‚¼ í…스ì³ë¥¼ \"Texture\" ì†ì„±ì— ì§€ì •í•´ì•¼ 합니다." #: scene/2d/light_occluder_2d.cpp msgid "" @@ -11107,9 +11191,8 @@ msgstr "" "Occluderê°€ ë™ìž‘하기 위해서는 Occluder í´ë¦¬ê³¤ì„ ì§€ì •í•˜ê±°ë‚˜ ê·¸ë ¤ì•¼ 합니다." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." -msgstr "Occluder í´ë¦¬ê³¤ì´ 비어있습니다. í´ë¦¬ê³¤ì„ 그리세요!" +msgstr "Occluder í´ë¦¬ê³¤ì´ 비어있습니다. í´ë¦¬ê³¤ì„ 그리세요." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11175,7 +11258,7 @@ msgstr "" #: scene/2d/remote_transform_2d.cpp msgid "Path property must point to a valid Node2D node to work." -msgstr "Path ì†ì„±ì€ ìœ íš¨í•œ Node2D 노드를 가리켜야 합니다." +msgstr "Path ì†ì„±ì€ 올바른 Node2D 노드를 가리켜야 합니다." #: scene/2d/skeleton_2d.cpp msgid "This Bone2D chain should end at a Skeleton2D node." @@ -11203,18 +11286,16 @@ msgstr "" "ì˜ ìžì‹ 노드로 추가하여 사용합니다." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." msgstr "" -"VisibilityEnable2D는 편집 ì”¬ì˜ ë£¨íŠ¸ì˜ í•˜ìœ„ 노드로 ì¶”ê°€í• ë•Œ 가장 잘 ë™ìž‘합니" +"VisibilityEnabler2D는 편집 ì”¬ì˜ ë£¨íŠ¸ì˜ í•˜ìœ„ 노드로 ì¶”ê°€í• ë•Œ 가장 잘 ë™ìž‘합니" "다." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera는 반드시 ARVROrigin 노드를 부모로 ê°€ì§€ê³ ìžˆì–´ì•¼ 함" +msgstr "ARVRCamera는 반드시 ARVROrigin 노드를 부모로 ê°€ì§€ê³ ìžˆì–´ì•¼ 합니다." #: scene/3d/arvr_nodes.cpp msgid "ARVRController must have an ARVROrigin node as its parent." @@ -11301,13 +11382,12 @@ msgstr "" "합니다." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" -"CollisionShapeê°€ ê¸°ëŠ¥ì„ í•˜ê¸° 위해서는 Shapeì´ ì œê³µë˜ì–´ì•¼ 합니다. Shape 리소스" -"를 만드세요!" +"CollisionShapeê°€ ì œ ê¸°ëŠ¥ì„ í•˜ë ¤ë©´ Shapeê°€ ì œê³µë˜ì–´ì•¼ 합니다. Shape 리소스를 " +"만드세요." #: scene/3d/collision_shape.cpp msgid "" @@ -11343,7 +11423,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." -msgstr "" +msgstr "SpotLightì˜ ê°ë„를 90ë„ ì´ìƒìœ¼ë¡œ 잡게ë˜ë©´ 그림ìžë¥¼ 투ì˜í• 수 없습니다." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11387,13 +11467,12 @@ msgid "PathFollow only works when set as a child of a Path node." msgstr "PathFollow는 Path ë…¸ë“œì˜ ìžì‹ìœ¼ë¡œ ìžˆì„ ë•Œë§Œ ë™ìž‘합니다." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED는 부모 Pathì˜ Curve 리소스ì—서 \"Up Vector\"ê°€ " -"활성화ë˜ì–´ 있어야 합니다." +"PathFollowì˜ ROTATION_ORIENTED는 부모 Pathì˜ Curve 리소스ì—서 \"Up Vector" +"\"ê°€ 활성화ë˜ì–´ 있어야 합니다." #: scene/3d/physics_body.cpp msgid "" @@ -11406,11 +11485,12 @@ msgstr "" "ëŒ€ì‹ ìžì‹ ì¶©ëŒ í˜•íƒœì˜ í¬ê¸°ë¥¼ 변경해보세요." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." -msgstr "Path ì†ì„±ì€ ìœ íš¨í•œ Spatial 노드를 가리켜야 합니다." +msgstr "" +"\"Remote Path\" ì†ì„±ì€ 올바른 Spatial 노드, ë˜ëŠ” Spatial íŒŒìƒ ë…¸ë“œë¥¼ 가리켜" +"야 합니다." #: scene/3d/soft_body.cpp msgid "This body will be ignored until you set a mesh." @@ -11426,13 +11506,12 @@ msgstr "" "ëŒ€ì‹ ìžì‹ì˜ ì¶©ëŒ í¬ê¸°ë¥¼ 변경하세요." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" -"AnimatedSprite3Dê°€ í”„ë ˆìž„ì„ ë³´ì—¬ì£¼ê¸° 위해서는 'Frames' ì†ì„±ì— SpriteFrames 리" -"소스 만들거나 ì§€ì •í•´ì•¼ 합니다." +"AnimatedSprite3Dê°€ í”„ë ˆìž„ì„ ë³´ì—¬ì£¼ê¸° 위해서는 \"Frames\" ì†ì„±ì— SpriteFrames " +"리소스 만들거나 ì§€ì •í•´ì•¼ 합니다." #: scene/3d/vehicle_body.cpp msgid "" @@ -11447,6 +11526,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 "" @@ -11471,20 +11552,19 @@ msgstr "ì• ë‹ˆë©”ì´ì…˜ì„ ì°¾ì„ ìˆ˜ ì—†ìŒ: '%s'" #: scene/animation/animation_tree.cpp msgid "In node '%s', invalid animation: '%s'." -msgstr "노드 '%s'ì—서, ìœ íš¨í•˜ì§€ ì•Šì€ ì• ë‹ˆë©”ì´ì…˜: '%s'." +msgstr "노드 '%s'ì—서, 올바르지 ì•Šì€ ì• ë‹ˆë©”ì´ì…˜: '%s'." #: scene/animation/animation_tree.cpp msgid "Invalid animation: '%s'." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ ì• ë‹ˆë©”ì´ì…˜: '%s'." +msgstr "올바르지 ì•Šì€ ì• ë‹ˆë©”ì´ì…˜: '%s'." #: scene/animation/animation_tree.cpp msgid "Nothing connected to input '%s' of node '%s'." msgstr "노드 '%s'ì˜ '%s' ìž…ë ¥ì— ì•„ë¬´ê²ƒë„ ì—°ê²°ë˜ì§€ 않ìŒ." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." -msgstr "ê·¸ëž˜í”„ì˜ ë£¨íŠ¸ AnimationNodeê°€ ì„¤ì •ë˜ì§€ 않았습니다." +msgstr "그래프를 위한 루트 AnimationNodeê°€ ì„¤ì •ë˜ì§€ 않았습니다." #: scene/animation/animation_tree.cpp msgid "Path to an AnimationPlayer node containing animations is not set." @@ -11498,9 +11578,8 @@ msgstr "" "다." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." -msgstr "AnimationPlayer 루트가 ìœ íš¨í•œ 노드가 아닙니다." +msgstr "AnimationPlayer 루트 노드가 올바른 노드가 아닙니다." #: scene/animation/animation_tree_player.cpp msgid "This node has been deprecated. Use AnimationTree instead." @@ -11528,14 +11607,13 @@ 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" "If you don't intend to add a script, use a plain Control node instead." msgstr "" "Container ìžì²´ëŠ” ìžì‹ 배치 ìž‘ì—…ì„ êµ¬ì„±í•˜ëŠ” 스í¬ë¦½íЏ 외ì—는 목ì ì´ ì—†ìŠµë‹ˆë‹¤.\n" -"스í¬ë¦½íŠ¸ë¥¼ 추가하지 않는 경우, 순수한 'Control' 노드를 사용해주세요." +"스í¬ë¦½íŠ¸ë¥¼ 추가하지 않는 경우, 순수한 Control 노드를 사용해주세요." #: scene/gui/control.cpp msgid "" @@ -11555,30 +11633,27 @@ msgid "Please Confirm..." msgstr "확ì¸í•´ì£¼ì„¸ìš”..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " "running." msgstr "" -"Popupì€ popup() ë˜ëŠ” 기타 popup*() 함수를 호출하기 ì „ê¹Œì§€ëŠ” 기본ì 으로 숨겨집" -"니다. 편집하는 ë™ì•ˆ 보여지ë„ë¡ í• ìˆ˜ëŠ” 있으나, 실행 시ì—는 숨겨집니다." +"Popupì€ popup() ë˜ëŠ” 기타 popup*() 함수로 호출ë˜ê¸° ì „ê¹Œì§€ 기본ì 으로 숨어있습" +"니다. 편집하는 ë™ì•ˆ ë³´ì´ë„ë¡ í• ìˆ˜ëŠ” 있으나, 실행 시ì—는 ë³´ì´ì§€ 않습니다." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "exp_editì´ ì°¸ì´ë¼ë©´ min_value는 반드시 > 0 ì´ì–´ì•¼ 합니다." +msgstr "\"Exp Edit\"ì´ í™œì„±í™”ë˜ë©´, \"Min Value\"는 반드시 0보다 커야 합니다." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " "minimum size manually." msgstr "" -"ScrollContainer는 ë‹¨ì¼ ìžì‹ ì»¨íŠ¸ë¡¤ì„ ìž‘ì—…í•˜ê¸° 위한 것입니다.\n" -"컨테ì´ë„ˆë¥¼ ìžì‹ (VBox,HBox,등)으로 사용하거나, Controlì„ ìˆ˜ë™ìœ¼ë¡œ ì§€ì •í•œ 최" -"소 수치로 ì„¤ì •í•´ì„œ 사용하세요." +"ScrollContainer는 ë‹¨ì¼ ìžì‹ Controlì„ ìž‘ì—…í•˜ê¸° 위한 것입니다.\n" +"컨테ì´ë„ˆë¥¼ ìžì‹ìœ¼ë¡œ 사용하거나 (VBox, HBox 등), Controlì„ ì‚¬ìš©í•´ ì†ìˆ˜ 최소 수" +"치를 ì„¤ì •í•˜ì„¸ìš”." #: scene/gui/tree.cpp msgid "(Other)" @@ -11618,20 +11693,23 @@ msgstr "í°íЏ 로딩 오류." #: scene/resources/dynamic_font.cpp msgid "Invalid font size." -msgstr "ìœ íš¨í•˜ì§€ ì•Šì€ í°íЏ í¬ê¸°." +msgstr "올바르지 ì•Šì€ í°íЏ í¬ê¸°." #: scene/resources/visual_shader.cpp msgid "Input" msgstr "ìž…ë ¥" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "ì…°ì´ë”ì— ìœ íš¨í•˜ì§€ ì•Šì€ ì†ŒìŠ¤." +msgstr "ë¯¸ë¦¬ë³´ê¸°ì— ì˜¬ë°”ë¥´ì§€ ì•Šì€ ì†ŒìŠ¤." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." -msgstr "ì…°ì´ë”ì— ìœ íš¨í•˜ì§€ ì•Šì€ ì†ŒìŠ¤." +msgstr "ì…°ì´ë”ì— ì˜¬ë°”ë¥´ì§€ ì•Šì€ ì†ŒìŠ¤." + +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "해당 íƒ€ìž…ì— ì˜¬ë°”ë¥´ì§€ ì•Šì€ ë¹„êµ í•¨ìˆ˜." #: servers/visual/shader_language.cpp msgid "Assignment to function." @@ -11649,6 +11727,27 @@ msgstr "Varyings는 ì˜¤ì§ ë²„í…스 함수ì—서만 ì§€ì •í• ìˆ˜ 있습니다. msgid "Constants cannot be modified." msgstr "ìƒìˆ˜ëŠ” ìˆ˜ì •í• ìˆ˜ 없습니다." +#~ msgid "Previous Folder" +#~ msgstr "ì´ì „ í´ë”" + +#~ msgid "Next Folder" +#~ msgstr "ë‹¤ìŒ í´ë”" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "스í¬ë¦°ìƒ· ìžë™ 열기" + +#~ msgid "Open in an external image editor." +#~ msgstr "외부 ì´ë¯¸ì§€ 편집기ì—서 열기." + +#~ msgid "Reverse" +#~ msgstr "뒤집기" + +#~ msgid "Mirror X" +#~ msgstr "Xì¶• 뒤집기" + +#~ msgid "Mirror Y" +#~ msgstr "Yì¶• 뒤집기" + #~ msgid "Generating solution..." #~ msgstr "솔루션 ìƒì„± 중..." diff --git a/editor/translations/lt.po b/editor/translations/lt.po index ab9107801f..088260b86f 100644 --- a/editor/translations/lt.po +++ b/editor/translations/lt.po @@ -133,6 +133,31 @@ msgstr "Animacija: Pakeisti IÅ¡kvietimÄ…" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Animacija: Pakeisti ReikÅ¡mÄ™" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animacija: Pakeisti PerÄ—jimÄ…" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animacija: Pakeisti TransformacijÄ…" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Animacija: Pakeisti ReikÅ¡mÄ™" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animacija: Pakeisti IÅ¡kvietimÄ…" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "Animacijos Nodas" @@ -1145,7 +1170,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1695,7 +1719,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1746,7 +1770,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1772,24 +1796,28 @@ msgstr "" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "Pasirinkite Nodus, kuriuos norite importuoti" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" +msgid "Go to next folder." msgstr "Pasirinkite Nodus, kuriuos norite importuoti" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2476,6 +2504,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Panaikinti pasirinkimÄ…" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2667,14 +2700,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2991,6 +3016,11 @@ msgstr "TrukmÄ—:" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Redaguoti Filtrus" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4666,6 +4696,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "(Ä®diegta)" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Bandyti iÅ¡ naujo" @@ -4695,7 +4730,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Visi" @@ -4709,7 +4743,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4784,31 +4818,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "Sukurti" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Panaikinti pasirinkimÄ…" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "Prijunkite prie Nodo:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Panaikinti pasirinkimÄ…" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6701,7 +6739,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6887,10 +6929,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7468,14 +7506,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7886,6 +7916,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7974,6 +8008,22 @@ msgid "Color uniform." msgstr "Animacija: Pakeisti TransformacijÄ…" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7981,10 +8031,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8073,7 +8157,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8081,7 +8165,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8093,7 +8177,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8110,7 +8194,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8179,11 +8263,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8199,7 +8283,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8227,11 +8311,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8272,11 +8356,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8286,7 +8374,7 @@ msgstr "Keisti Poligono SkalÄ™" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8304,15 +8392,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8363,7 +8451,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8391,12 +8479,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8473,47 +8561,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9682,6 +9770,11 @@ msgid "Extend Script" msgstr "Atidaryti Skriptų Editorių" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Sukurti NaujÄ…" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9892,7 +9985,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11432,6 +11525,11 @@ msgstr "Netinkamas Å¡rifto dydis." msgid "Invalid source for shader." msgstr "Netinkamas Å¡rifto dydis." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Netinkamas Å¡rifto dydis." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/lv.po b/editor/translations/lv.po index cb6df1de91..281cbf2c8d 100644 --- a/editor/translations/lv.po +++ b/editor/translations/lv.po @@ -131,6 +131,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp #, fuzzy msgid "Change Animation Length" msgstr "AnimÄciju Cilpa" @@ -1149,7 +1169,6 @@ msgid "Success!" msgstr "IzdevÄs!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "IeinstalÄ“t" @@ -1702,7 +1721,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1753,7 +1772,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1779,24 +1798,29 @@ msgstr "" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "IzvÄ“lÄ“ties Å¡o Mapi" +msgid "Go to previous folder." +msgstr "Doties uz iepriekšējo soli" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "IzvÄ“lÄ“ties Å¡o Mapi" +msgid "Go to next folder." +msgstr "Doties uz nÄkamo soli" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "MeklÄ“t:" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2482,6 +2506,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Noņemt IzvÄ“lÄ“to" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2675,14 +2704,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2996,6 +3017,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Savieno SignÄlu:" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4652,6 +4678,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "IeinstalÄ“t" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4680,7 +4711,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4694,7 +4724,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4769,31 +4799,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "Izveidot" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Noņemt IzvÄ“lÄ“to" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "Izveidot Jaunu %s" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Noņemt IzvÄ“lÄ“to" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6688,7 +6722,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6873,10 +6911,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7453,14 +7487,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7866,6 +7892,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7954,6 +7984,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7961,10 +8007,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8054,7 +8134,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8062,7 +8142,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8074,7 +8154,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8091,7 +8171,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8160,11 +8240,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8180,7 +8260,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8208,11 +8288,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8252,11 +8332,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8266,7 +8350,7 @@ msgstr "Izveidot" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8284,15 +8368,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8344,7 +8428,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8372,12 +8456,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8454,47 +8538,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9651,6 +9735,11 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Izveidot Jaunu %s" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9860,7 +9949,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11396,6 +11485,11 @@ msgstr "NederÄ«gs fonta izmÄ“rs." msgid "Invalid source for shader." msgstr "NederÄ«gs fonta izmÄ“rs." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "NederÄ«gs fonta izmÄ“rs." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11412,6 +11506,14 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "IzvÄ“lÄ“ties Å¡o Mapi" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "IzvÄ“lÄ“ties Å¡o Mapi" + #~ msgid "Delete selected files?" #~ msgstr "IzdzÄ“st izvÄ“lÄ“tos failus?" diff --git a/editor/translations/mi.po b/editor/translations/mi.po index 5462f66f69..8c135ea467 100644 --- a/editor/translations/mi.po +++ b/editor/translations/mi.po @@ -119,6 +119,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1096,7 +1116,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1629,7 +1648,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1680,7 +1699,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1705,23 +1724,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2396,6 +2419,10 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2587,14 +2614,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2907,6 +2926,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4529,6 +4552,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4557,7 +4584,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4571,7 +4597,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4646,31 +4672,31 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6526,7 +6552,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6711,10 +6741,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7275,14 +7301,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7660,6 +7678,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7744,6 +7766,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7751,10 +7789,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7843,7 +7915,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7851,7 +7923,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7863,7 +7935,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7880,7 +7952,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7949,11 +8021,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7969,7 +8041,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7997,11 +8069,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8041,11 +8113,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8054,7 +8130,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8072,15 +8148,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8129,7 +8205,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8157,12 +8233,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8239,47 +8315,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9430,6 +9506,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9632,7 +9712,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11151,6 +11231,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/ml.po b/editor/translations/ml.po index 4e120c2412..e5f1538050 100644 --- a/editor/translations/ml.po +++ b/editor/translations/ml.po @@ -127,6 +127,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1104,7 +1124,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1637,7 +1656,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1688,7 +1707,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1713,23 +1732,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2404,6 +2427,10 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2595,14 +2622,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2915,6 +2934,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4537,6 +4560,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4565,7 +4592,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4579,7 +4605,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4654,31 +4680,31 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6534,7 +6560,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6719,10 +6749,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7283,14 +7309,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7668,6 +7686,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7752,6 +7774,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7759,10 +7797,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7851,7 +7923,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7859,7 +7931,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7871,7 +7943,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7888,7 +7960,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7957,11 +8029,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7977,7 +8049,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8005,11 +8077,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8049,11 +8121,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8062,7 +8138,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8080,15 +8156,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8137,7 +8213,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8165,12 +8241,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8247,47 +8323,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9438,6 +9514,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9640,7 +9720,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11159,6 +11239,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/ms.po b/editor/translations/ms.po index 7b7ac1ea61..6134a44d66 100644 --- a/editor/translations/ms.po +++ b/editor/translations/ms.po @@ -132,6 +132,31 @@ msgid "Anim Change Call" msgstr "Anim Ubah Panggilan" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Ubah Masa Keyframe" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim Ubah Peralihan" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Ubah Penukaran" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Ubah Nilai Keyframe" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Ubah Panggilan" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1119,7 +1144,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1653,7 +1677,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1704,7 +1728,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1729,23 +1753,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2421,6 +2449,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Semua Pilihan" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2612,14 +2645,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2932,6 +2957,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4562,6 +4591,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4590,7 +4623,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4604,7 +4636,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4679,31 +4711,32 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Buang Trek Anim" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6564,7 +6597,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6749,10 +6786,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7319,14 +7352,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7710,6 +7735,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7795,6 +7824,22 @@ msgid "Color uniform." msgstr "Anim Ubah Penukaran" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7802,10 +7847,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7894,7 +7973,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7902,7 +7981,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7914,7 +7993,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7931,7 +8010,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8000,11 +8079,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8020,7 +8099,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8048,11 +8127,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8093,11 +8172,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8106,7 +8189,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8124,15 +8207,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8181,7 +8264,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8209,12 +8292,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8291,47 +8374,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9485,6 +9568,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9687,7 +9774,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11209,6 +11296,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/nb.po b/editor/translations/nb.po index 66d1b3952a..28e807a399 100644 --- a/editor/translations/nb.po +++ b/editor/translations/nb.po @@ -19,8 +19,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-02 10:51+0000\n" -"Last-Translator: Petter Reinholdtsen <pere-weblate@hungry.com>\n" +"PO-Revision-Date: 2019-07-29 19:21+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" "Language: nb\n" @@ -50,24 +50,20 @@ msgid "self can't be used because instance is null (not passed)" msgstr "self kan ikke brukes siden instansen er lik null (ikke bestÃ¥tt)" #: core/math/expression.cpp -#, fuzzy msgid "Invalid operands to operator %s, %s and %s." -msgstr "Ugyldig indeks egenskap navn '%s' i node %s." +msgstr "Ugyldige argumenter til operator %s, %s og %s." #: core/math/expression.cpp -#, fuzzy msgid "Invalid index of type %s for base type %s" -msgstr "Ugyldig indeks egenskap navn '%s' i node %s." +msgstr "Ugyldig indeks av type %s for basistype %s" #: core/math/expression.cpp -#, fuzzy msgid "Invalid named index '%s' for base type %s" msgstr "Ugyldig navngitt indeks \"%s\" for grunntypen %s" #: core/math/expression.cpp -#, fuzzy msgid "Invalid arguments to construct '%s'" -msgstr ": Ugyldig argument av type: " +msgstr "Ugyldige argumenter for Ã¥ lage \"%s\"" #: core/math/expression.cpp msgid "On call to '%s':" @@ -91,14 +87,12 @@ msgid "Time:" msgstr "Tid:" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Value:" -msgstr "Nytt navn:" +msgstr "Verdi:" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Insert Key Here" -msgstr "Sett inn Nøkkel" +msgstr "Sett inn nøkkel her" #: editor/animation_bezier_editor.cpp msgid "Duplicate Selected Key(s)" @@ -148,6 +142,31 @@ msgstr "Anim Forandre Kall" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Endre Nøkkelbildetid" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim Forandre Overgang" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Forandre Omforming" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Endre Nøkkelbildeverdi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Forandre Kall" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "Endre Animasjonsnavn:" @@ -1211,7 +1230,6 @@ msgid "Success!" msgstr "Suksess!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Installer" @@ -1792,7 +1810,7 @@ msgstr "Vis I Filutforsker" msgid "New Folder..." msgstr "Ny Mappe..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Oppdater" @@ -1843,7 +1861,7 @@ msgstr "GÃ¥ framover" msgid "Go Up" msgstr "GÃ¥ oppover" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Veksle visning av skjulte filer" @@ -1869,27 +1887,30 @@ msgstr "Flytt Favoritt Nedover" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "Forrige fane" +msgid "Go to previous folder." +msgstr "GÃ¥ til ovennevnt mappe." #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Lag mappe" +msgid "Go to next folder." +msgstr "GÃ¥ til ovennevnt mappe." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Go to parent folder." -msgstr "GÃ¥ til overnevnt mappe" +msgstr "GÃ¥ til ovennevnt mappe." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "(Un)favorite current folder." -msgstr "Kunne ikke opprette mappe." +msgid "Refresh files." +msgstr "Søk i klasser" #: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "(Av)favoriser gjeldende mappe." + +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Veksle visning av skjulte filer" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2647,6 +2668,11 @@ msgid "Go to previously opened scene." msgstr "GÃ¥ til forrige Ã¥pne scene." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Kopier Sti" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Neste fane" @@ -2867,15 +2893,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Redigeringsverktøy-instillinger" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Ã…pne den neste Editoren" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Skru av/pÃ¥ Fullskjerm" @@ -3210,6 +3227,11 @@ msgstr "Tid:" msgid "Calls" msgstr "Ring" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Medlemmer" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "PÃ¥" @@ -4991,6 +5013,11 @@ msgid "Idle" msgstr "Inaktiv" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Installer" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Prøv pÃ¥ nytt" @@ -5022,7 +5049,6 @@ msgid "Last" msgstr "Siste" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Alle" @@ -5037,8 +5063,9 @@ msgid "Sort:" msgstr "Sorter:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Reverser" +#, fuzzy +msgid "Reverse sorting." +msgstr "Ber om..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -5112,31 +5139,38 @@ msgid "Rotation Step:" msgstr "Rotasjon Steg:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Flytt vertikal veileder" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Lag ny vertikal veileder" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Fjern vertikal veileder" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Flytt horisontal veileder" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Lag ny horisontal veileder" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Fjern horisontal veileder" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Lag ny horisontal og vertikal veileder" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -7126,7 +7160,12 @@ msgstr "Bak" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" +msgstr "Høyrevisning" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" msgstr "Høyrevisning" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7317,10 +7356,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Tool Select" msgstr "Slett Valgte" @@ -7916,14 +7951,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Speil X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Speil Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8361,6 +8388,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8453,6 +8484,22 @@ msgid "Color uniform." msgstr "Anim Forandre Omforming" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8460,10 +8507,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8554,7 +8635,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8562,7 +8643,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8574,7 +8655,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8591,7 +8672,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8660,11 +8741,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8680,7 +8761,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8708,11 +8789,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8753,11 +8834,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8767,7 +8852,7 @@ msgstr "Lag Poly" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8785,15 +8870,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8845,7 +8930,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8873,12 +8958,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8955,47 +9040,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10207,6 +10292,11 @@ msgstr "Kjør Skript" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Lag ny %s" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Lagre Scene" @@ -10428,7 +10518,7 @@ msgid "Script is valid." msgstr "Animasjonstre er gyldig." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -12007,6 +12097,11 @@ msgstr "Ugyldig fontstørrelse." 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." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -12021,7 +12116,28 @@ msgstr "" #: servers/visual/shader_language.cpp msgid "Constants cannot be modified." -msgstr "" +msgstr "Konstanter kan ikke endres." + +#, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "Forrige fane" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Lag mappe" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Ã…pne den neste Editoren" + +#~ msgid "Reverse" +#~ msgstr "Reverser" + +#~ msgid "Mirror X" +#~ msgstr "Speil X" + +#~ msgid "Mirror Y" +#~ msgstr "Speil Y" #, fuzzy #~ msgid "Generating solution..." diff --git a/editor/translations/nl.po b/editor/translations/nl.po index d5d9277fe9..67b9141d5b 100644 --- a/editor/translations/nl.po +++ b/editor/translations/nl.po @@ -161,6 +161,31 @@ msgid "Anim Change Call" msgstr "Anim Wijzig Aanroep" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Wijzig Keyframe Waarde" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim Wijzig Overgang" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Wijzig Transform" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Wijzig Keyframe Waarde" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Wijzig Aanroep" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Verander Animatielengte" @@ -1183,7 +1208,6 @@ msgid "Success!" msgstr "Geslaagd!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Installeer" @@ -1754,7 +1778,7 @@ msgstr "Weergeven in Bestandsbeheer" msgid "New Folder..." msgstr "Nieuwe Map..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Verversen" @@ -1805,7 +1829,7 @@ msgstr "Ga Verder" msgid "Go Up" msgstr "Ga Omhoog" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Toggle Verborgen Bestanden" @@ -1830,25 +1854,32 @@ msgid "Move Favorite Down" msgstr "Verplaats Favoriet Naar Beneden" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Vorige Folder" +#, fuzzy +msgid "Go to previous folder." +msgstr "Ga naar bovenliggende folder" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Volgende Folder" +#, fuzzy +msgid "Go to next folder." +msgstr "Ga naar bovenliggende folder" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "Ga naar bovenliggende folder" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Zoek bestanden" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "(On)favoriet huidige map." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Toggle Verborgen Bestanden" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2596,6 +2627,11 @@ msgid "Go to previously opened scene." msgstr "Ga naar de vorige geopende scene." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Kopieer Pad" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Volgend tabblad" @@ -2814,15 +2850,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Open Editor Data/Instellingen Map" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Open de volgende Editor" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Schakel Volledig Scherm" @@ -3142,6 +3169,11 @@ msgstr "Tijd" msgid "Calls" msgstr "Aanroepen" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Bewerk Thema..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Aan" @@ -4858,6 +4890,11 @@ msgid "Idle" msgstr "Inactief" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Installeer" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Probeer opnieuw" @@ -4886,7 +4923,6 @@ msgid "Last" msgstr "Laatste" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Alle" @@ -4900,8 +4936,9 @@ msgid "Sort:" msgstr "Sorteren:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Omkeren" +#, fuzzy +msgid "Reverse sorting." +msgstr "Opvragen..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4982,31 +5019,38 @@ msgid "Rotation Step:" msgstr "Rotatie Stap:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Verplaats vertical gids" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Maak nieuwe verticale gids" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Verwijder de verticale gids" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Verplaats de horizontale gids" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Maak nieuwe horizontale gids" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Verwijder de horizontale gids" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Maak nieuwe horizontale en verticale gidsen" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -7016,9 +7060,14 @@ msgstr "Achter" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" msgstr "Uitlijnen met zicht" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Arrangeer Selectie naar Aanzicht" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Geen ouder om kind aan te instantiëren." @@ -7214,10 +7263,6 @@ msgid "Focus Selection" msgstr "Focus Selectie" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Arrangeer Selectie naar Aanzicht" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Gereedschappen" @@ -7820,14 +7865,6 @@ msgid "Transpose" msgstr "Transponeren" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Spiegel X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Spiegel Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8276,6 +8313,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Visuele Shader Invoertype Gewijzigd" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Vertex" msgstr "Vertices" @@ -8370,6 +8411,22 @@ msgid "Color uniform." msgstr "Transform vrijmaken" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8377,10 +8434,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." msgstr "Verander Vec Constante" @@ -8473,7 +8564,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8481,7 +8572,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8493,7 +8584,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8510,7 +8601,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8579,11 +8670,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8599,7 +8690,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8627,11 +8718,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8674,12 +8765,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "Verander Textuur Uniform" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup." msgstr "Verander Textuur Uniform" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "Verander Textuur Uniform" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8689,7 +8785,7 @@ msgstr "Transformatie Dialoog..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8707,15 +8803,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8768,7 +8864,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8796,12 +8892,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8880,47 +8976,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10212,6 +10308,11 @@ msgstr "Omschrijving:" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Voeg nieuwe knooppunt aan" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Klinkt logisch!" @@ -10438,7 +10539,8 @@ msgid "Script is valid." msgstr "Script geldig" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "Toegestaan: a-z, A-Z, 0-9 en _" #: editor/script_create_dialog.cpp @@ -12111,6 +12213,11 @@ msgstr "Ongeldige bron voor shader." msgid "Invalid source for shader." msgstr "Ongeldige bron voor shader." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Ongeldige bron voor shader." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -12127,6 +12234,25 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Previous Folder" +#~ msgstr "Vorige Folder" + +#~ msgid "Next Folder" +#~ msgstr "Volgende Folder" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Open de volgende Editor" + +#~ msgid "Reverse" +#~ msgstr "Omkeren" + +#~ msgid "Mirror X" +#~ msgstr "Spiegel X" + +#~ msgid "Mirror Y" +#~ msgstr "Spiegel Y" + #, fuzzy #~ msgid "Failed to create solution." #~ msgstr "Mislukt om resource te laden." diff --git a/editor/translations/pl.po b/editor/translations/pl.po index ff93299b81..61af6ef9b8 100644 --- a/editor/translations/pl.po +++ b/editor/translations/pl.po @@ -39,8 +39,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-09 10:47+0000\n" -"Last-Translator: RafaÅ‚ Wyszomirski <rawyszo@gmail.com>\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" +"Last-Translator: Tomek <kobewi4e@gmail.com>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/" "godot/pl/>\n" "Language: pl\n" @@ -162,6 +162,31 @@ msgid "Anim Change Call" msgstr "Animacja - wywoÅ‚anie funkcji" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Zmiana czasu klatki kluczowej" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Zmiana przejÅ›cia" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Zmiana transformacji" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Zmiana wartoÅ›ci klatki kluczowej" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animacja - wywoÅ‚anie funkcji" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "ZmieÅ„ dÅ‚ugość animacji" @@ -663,7 +688,7 @@ msgstr "Numer linii:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Znaleziono %d dopasowaÅ„." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -820,9 +845,8 @@ msgid "Connect" msgstr "Połącz" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "SygnaÅ‚y:" +msgstr "SygnaÅ‚:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -987,9 +1011,8 @@ msgid "Owners Of:" msgstr "WÅ‚aÅ›ciciele:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "Usunąć wybrane pliki z projektu? (Nie można tego cofnąć)" +msgstr "Usunąć wybrane pliki z projektu? (Nie można ich przywrócić)" #: editor/dependency_editor.cpp msgid "" @@ -1170,7 +1193,6 @@ msgid "Success!" msgstr "Sukces!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Zainstaluj" @@ -1539,7 +1561,7 @@ msgstr "Nie znaleziono pliku szablonu:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." -msgstr "" +msgstr "W eksportach 32-bitowych dołączony PCK nie może być wiÄ™kszy niż 4 GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1712,7 +1734,7 @@ msgstr "Pokaż w menedżerze plików" msgid "New Folder..." msgstr "Utwórz katalog..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "OdÅ›wież" @@ -1763,7 +1785,7 @@ msgstr "Dalej" msgid "Go Up" msgstr "W górÄ™" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Przełącz ukryte pliki" @@ -1788,23 +1810,31 @@ msgid "Move Favorite Down" msgstr "PrzesuÅ„ Ulubiony w dół" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Poprzedni folder" +#, fuzzy +msgid "Go to previous folder." +msgstr "Przejdź folder wyżej." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "NastÄ™pny folder" +#, fuzzy +msgid "Go to next folder." +msgstr "Przejdź folder wyżej." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Przejdź folder wyżej." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Przeszukaj pliki" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Dodaj/usuÅ„ aktualny folder z ulubionych." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Przełącz widoczność ukrytych plików." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2532,6 +2562,10 @@ msgid "Go to previously opened scene." msgstr "Wróć do poprzednio otwartej sceny." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Skopiuj tekst" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "NastÄ™pna zakÅ‚adka" @@ -2739,14 +2773,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Zrzuty ekranu sÄ… przechowywane w folderze danych/ustawieÅ„ edytora." #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "Automatycznie otwórz zrzuty ekranu" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "Otwórz w zewnÄ™trznym edytorze obrazów." - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "PeÅ‚ny ekran" @@ -3063,6 +3089,11 @@ msgstr "Czas" msgid "Calls" msgstr "WywoÅ‚ania" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Edytuj motyw" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Włącz" @@ -4521,7 +4552,7 @@ msgstr "PrzejÅ›cie: " #: editor/plugins/animation_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "AnimationTree" -msgstr "AnimationTree" +msgstr "Drzewo animacji" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "New name:" @@ -4732,6 +4763,10 @@ msgid "Idle" msgstr "Bezczynny" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "Zainstaluj..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Ponów PróbÄ™" @@ -4760,7 +4795,6 @@ msgid "Last" msgstr "Koniec" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Wszystko" @@ -4774,8 +4808,8 @@ msgid "Sort:" msgstr "Sortuj:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Odwróć" +msgid "Reverse sorting." +msgstr "Odwróć sortowanie." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4856,32 +4890,32 @@ msgid "Rotation Step:" msgstr "Krok obrotu:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "PrzesuÅ„ PionowÄ… ProwadnicÄ™" +msgid "Move Vertical Guide" +msgstr "PrzesuÅ„ pionowÄ… prowadnicÄ™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "Utwórz nowÄ… prowadnicÄ™ pionowÄ…" +msgid "Create Vertical Guide" +msgstr "Utwórz pionowÄ… prowadnicÄ™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "UsuÅ„ prowadnicÄ™ pionowÄ…" +msgid "Remove Vertical Guide" +msgstr "UsuÅ„ pionowÄ… prowadnicÄ™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "PrzesuÅ„ prowadnicÄ™ poziomÄ…" +msgid "Move Horizontal Guide" +msgstr "PrzesuÅ„ poziomÄ… prowadnicÄ™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "Utwórz nowÄ… prowadnicÄ™ poziomÄ…" +msgid "Create Horizontal Guide" +msgstr "Utwórz poziomÄ… prowadnicÄ™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "UsuÅ„ prowadnicÄ™ poziomÄ…" +msgid "Remove Horizontal Guide" +msgstr "UsuÅ„ poziomÄ… prowadnicÄ™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "Utwórz nowe prowadnice: poziomÄ…Â oraz pionowÄ…" +msgid "Create Horizontal and Vertical Guides" +msgstr "Utwórz poziomÄ…Â i pionowÄ… prowadnicÄ™" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -5448,7 +5482,7 @@ msgstr "Edytor listy elementów" #: editor/plugins/light_occluder_2d_editor_plugin.cpp msgid "Create Occluder Polygon" -msgstr "Stwórz Occluder Polygon" +msgstr "Utwórz wielokÄ…t przesÅ‚aniajÄ…cy" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh is empty!" @@ -6468,7 +6502,7 @@ msgstr "PodÅ›wietlacz skÅ‚adni" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Idź do" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6476,9 +6510,8 @@ msgid "Bookmarks" msgstr "ZakÅ‚adki" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Utwórz punkty." +msgstr "Punkty wstrzymania" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6767,9 +6800,15 @@ msgid "Rear" msgstr "TyÅ‚" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Dopasuj do widoku" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Dopasuj zaznaczenie do widoku" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Brak elementu nadrzÄ™dnego do stworzenia instancji." @@ -6957,10 +6996,6 @@ msgid "Focus Selection" msgstr "Wycentruj na zaznaczeniu" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Dopasuj zaznaczenie do widoku" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "NarzÄ™dzie wyboru" @@ -7522,14 +7557,6 @@ msgid "Transpose" msgstr "Transpozycja" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Odbij X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Odbij Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "Wyłącz autokafelki" @@ -7925,6 +7952,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Typ wejÅ›cia shadera wizualnego zmieniony" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(Tylko GLES3)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "WierzchoÅ‚ki" @@ -8009,6 +8040,22 @@ msgid "Color uniform." msgstr "Uniform koloru." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Zwraca wynik boolowski porównania %s pomiÄ™dzy dwoma parametrami." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "Równe (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "WiÄ™ksze niż (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "WiÄ™ksze lub równe (>=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8017,12 +8064,48 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "Zwraca wynik boolowski porównania pomiÄ™dzy INF i parametrem skalarnym." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "Zwraca wynik boolowski porównania pomiÄ™dzy NaN i parametrem skalarnym." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "Mniejsze niż (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "Mniejsze lub równe (<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "Nierówne (!=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" "Zwraca powiÄ…zany wektor, jeÅ›li podana wartość boolowska jest prawdziwa albo " "faÅ‚szywa." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Zwraca wynik boolowski porównania pomiÄ™dzy dwoma parametrami." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" +"Zwraca wynik boolowski porównania pomiÄ™dzy INF (lub NaN) i parametrem " +"skalarnym." + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "StaÅ‚a prawda/faÅ‚sz." @@ -8113,16 +8196,16 @@ msgid "Returns the arc-cosine of the parameter." msgstr "Zwraca arcus cosinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "(Tylko GLES3) Zwraca odwrócony cosinus hiperboliczny parametru." +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "Zwraca odwrócony cosinus hiperboliczny parametru." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." msgstr "Zwraca arcus sinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "(Tylko GLES3) Zwraca odwrócony sinus hiperboliczny parametru." +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "Zwraca odwrócony sinus hiperboliczny parametru." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." @@ -8133,8 +8216,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Zwraca arcus tangens parametrów." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "(Tylko GLES3) Zwraca odwrócony tangens hiperboliczny parametru." +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "Zwraca odwrócony tangens hiperboliczny parametru." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8150,8 +8233,8 @@ msgid "Returns the cosine of the parameter." msgstr "Zwraca cosinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "(Tylko GLES3) Zwraca cosinus hiperboliczny parametru." +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "Zwraca cosinus hiperboliczny parametru." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." @@ -8219,13 +8302,12 @@ msgid "1.0 / scalar" msgstr "1.0 / skalar" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "(Tylko GLES3) Znajduje najbliższÄ… parametrowi liczbÄ™ caÅ‚kowitÄ…." +msgid "Finds the nearest integer to the parameter." +msgstr "Znajduje najbliższÄ… parametrowi liczbÄ™ caÅ‚kowitÄ…." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "" -"(Tylko GLES3) Znajduje najbliższÄ… parametrowi parzystÄ… liczbÄ™ caÅ‚kowitÄ…." +msgid "Finds the nearest even integer to the parameter." +msgstr "Znajduje najbliższÄ… parametrowi parzystÄ… liczbÄ™ caÅ‚kowitÄ…." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." @@ -8240,8 +8322,8 @@ msgid "Returns the sine of the parameter." msgstr "Zwraca sinus parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "(Tylko GLES3) Zwraca sinus hiperboliczny parametru." +msgid "Returns the hyperbolic sine of the parameter." +msgstr "Zwraca sinus hiperboliczny parametru." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." @@ -8277,12 +8359,12 @@ msgid "Returns the tangent of the parameter." msgstr "Zwraca tangens parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "(Tylko GLES3) Zwraca tangens hiperboliczny parametru." +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "Zwraca tangens hiperboliczny parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "(Tylko GLES3) Zwraca obciÄ™tÄ… wartość parametru." +msgid "Finds the truncated value of the parameter." +msgstr "Zwraca obciÄ™tÄ… wartość parametru." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." @@ -8321,12 +8403,16 @@ msgid "Perform the texture lookup." msgstr "Wykonaj podejrzenie tekstury." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." -msgstr "Uniform tekstury kubicznej." +msgid "Cubic texture uniform lookup." +msgstr "Podejrzenie uniformu tekstury kubicznej." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." +msgstr "Podejrzenie uniformu tekstury 2D." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." -msgstr "Uniform tekstury 2D." +msgid "2D texture uniform lookup with triplanar." +msgstr "Podejrzenie uniformu tekstury 2D triplanarnej." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Transform function." @@ -8334,7 +8420,7 @@ msgstr "Funkcja transformacji." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8342,6 +8428,13 @@ 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 "" +"Oblicz iloczyn diadyczny pary wektorów.\n" +"\n" +"OuterProduct traktuje pierwszy parametr \"c\" jako kolumnowy wektor (macierz " +"z jednÄ… kolumnÄ…) i drugi parametr \"r\" jako rzÄ™dowy wektor (macierz z " +"jednym rzÄ™dem) i wykonuje mnożenie macierzy \"c * r\" dajÄ…c w wyniku " +"macierz, której ilość rzÄ™dów odpowiada iloÅ›ci komponentów w \"c\" oraz " +"której ilość kolumn to liczba komponentów w 'r'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes transform from four vectors." @@ -8352,16 +8445,16 @@ msgid "Decomposes transform to four vectors." msgstr "RozkÅ‚ada przeksztaÅ‚cenie na cztery wektory." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "(Tylko GLES3) Liczy wyznacznik przeksztaÅ‚cenia." +msgid "Calculates the determinant of a transform." +msgstr "Liczy wyznacznik przeksztaÅ‚cenia." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "(Tylko GLES3) Liczy odwrotność przeksztaÅ‚cenia." +msgid "Calculates the inverse of a transform." +msgstr "Liczy odwrotność przeksztaÅ‚cenia." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "(Tylko GLES3) Liczy transpozycjÄ™ przeksztaÅ‚cenia." +msgid "Calculates the transpose of a transform." +msgstr "Liczy transpozycjÄ™ przeksztaÅ‚cenia." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." @@ -8409,11 +8502,16 @@ msgstr "Liczy iloczyn skalarny dwóch wektorów." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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 "" +"Zwraca wektor, który wskazuje ten sam kierunek co wektor odniesienia. " +"Funkcja posiada trzy parametry wektorowe: N, wektor do orientacji, I, wektor " +"padajÄ…cy i Nref, wektor odniesienia. Jeżeli iloczyn skalarny I i Nref jest " +"mniejszy od zera, zwracana jest wartość N. W przeciwnym razie zwracana jest " +"wartość -N." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." @@ -8437,14 +8535,14 @@ msgstr "1.0 / wektor" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" "Zwraca wektor zwrócony w kierunku odbicia ( a : wektor padajÄ…cy, b : wektor " "normalny )." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "Zwraca wektor skierowany w kierunku zaÅ‚amania." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8531,6 +8629,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 "" +"WÅ‚asne wyrażenie w jÄ™zyku shaderów Godota, z wÅ‚asnÄ… iloÅ›ciÄ… portów wejÅ›cia i " +"wyjÅ›cia. To jest bezpoÅ›rednie wstrzykniÄ™cie kodu do funkcji wierzchoÅ‚ków/" +"fragmentów/Å›wiatÅ‚a, nie używaj tego do deklarowania tych funkcji w Å›rodku." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8541,62 +8642,60 @@ msgstr "" "kierunku widoku kamery (podaj tu powiÄ…zane wejÅ›cie)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "" -"(Tylko GLES3) (Tylko tryb fragmentów/Å›wiatÅ‚a) Skalarna pochodna funkcji." +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(Tylko tryb fragmentów/Å›wiatÅ‚a) Skalarna pochodna funkcji." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "" -"(Tylko GLES3) (Tylko tryb fragmentów/Å›wiatÅ‚a) Wektorowa pochodna funkcji." +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(Tylko tryb fragmentów/Å›wiatÅ‚a) Wektorowa pochodna funkcji." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" -"(Tylko GLES3) (Tylko tryb fragmentów/Å›wiatÅ‚a) (Wektor) Pochodna po \"x\" " -"używajÄ…c lokalnej zmiennoÅ›ci." +"(Tylko tryb fragmentów/Å›wiatÅ‚a) (Wektor) Pochodna po \"x\" używajÄ…c lokalnej " +"zmiennoÅ›ci." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" -"(Tylko GLES3) (Tylko tryb fragmentów/Å›wiatÅ‚a) (Skalar) Pochodna po \"x\" " -"używajÄ…c lokalnej zmiennoÅ›ci." +"(Tylko tryb fragmentów/Å›wiatÅ‚a) (Skalar) Pochodna po \"x\" używajÄ…c lokalnej " +"zmiennoÅ›ci." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" -"(Tylko GLES3) (Tylko tryb fragmentów/Å›wiatÅ‚a) (Wektor) Pochodna po \"y\" " -"używajÄ…c lokalnej zmiennoÅ›ci." +"(Tylko tryb fragmentów/Å›wiatÅ‚a) (Wektor) Pochodna po \"y\" używajÄ…c lokalnej " +"zmiennoÅ›ci." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" -"(Tylko GLES3) (Tylko tryb fragmentów/Å›wiatÅ‚a) (Skalar) Pochodna po \"y\" " -"używajÄ…c lokalnej zmiennoÅ›ci." +"(Tylko tryb fragmentów/Å›wiatÅ‚a) (Skalar) Pochodna po \"y\" używajÄ…c lokalnej " +"zmiennoÅ›ci." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(Tylko GLES3) (Tylko tryb fragmentów/Å›wiatÅ‚a) (Wektor) Suma bezwzglÄ™dnej " -"pochodnej po \"x\" i \"y\"." +"(Tylko tryb fragmentów/Å›wiatÅ‚a) (Wektor) Suma bezwzglÄ™dnej pochodnej po \"x" +"\" i \"y\"." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(Tylko GLES3) (Tylko tryb fragmentów/Å›wiatÅ‚a) (Skalar) Suma bezwzglÄ™dnej " -"pochodnej po \"x\" i \"y\"." +"(Tylko tryb fragmentów/Å›wiatÅ‚a) (Skalar) Suma bezwzglÄ™dnej pochodnej po \"x" +"\" i \"y\"." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -8716,7 +8815,7 @@ msgstr "Utwórz Å›cieżkÄ™" #: editor/project_export.cpp msgid "Features" -msgstr "Funkcje" +msgstr "FunkcjonalnoÅ›ci" #: editor/project_export.cpp msgid "Custom (comma-separated):" @@ -9822,6 +9921,11 @@ msgid "Extend Script" msgstr "Rozszerz skrypt" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "ZmieÅ„ nadrzÄ™dny wÄ™zeÅ‚" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "ZmieÅ„ na korzeÅ„ sceny" @@ -9839,7 +9943,7 @@ msgstr "Skopiuj Å›cieżkÄ™ wÄ™zÅ‚a" #: editor/scene_tree_dock.cpp msgid "Delete (No Confirm)" -msgstr "UsuÅ„ (bez potwierdzenie)" +msgstr "UsuÅ„ (bez potwierdzenia)" #: editor/scene_tree_dock.cpp msgid "Add/Create a New Node." @@ -9887,7 +9991,7 @@ msgstr "Grupa przycisków" #: editor/scene_tree_editor.cpp msgid "(Connecting From)" -msgstr "(Połączenie z)" +msgstr "(łączony teraz)" #: editor/scene_tree_editor.cpp msgid "Node configuration warning:" @@ -10038,8 +10142,8 @@ msgid "Script is valid." msgstr "Skrypt jest prawidÅ‚owy." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" -msgstr "DostÄ™pne znaki: a-z, A-Z, 0-9 i _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." +msgstr "Dozwolone: a-z, A-Z, 0-9, _ i ." #: editor/script_create_dialog.cpp msgid "Built-in script (into scene file)." @@ -10924,15 +11028,20 @@ msgstr "" #: platform/android/export/export.cpp msgid "Custom build requires a valid Android SDK path in Editor Settings." msgstr "" +"WÅ‚asny build wymaga poprawnej Å›cieżki do SDK Androida w Ustawieniach Edytora." #: platform/android/export/export.cpp msgid "Invalid Android SDK path for custom build in Editor Settings." msgstr "" +"Niepoprawna Å›cieżka do SDK Androida dla wÅ‚asnego builda w Ustawieniach " +"Edytora." #: platform/android/export/export.cpp msgid "" "Android project is not installed for compiling. Install from Editor menu." msgstr "" +"Projekt Androida nie jest zainstalowany do kompilacji. Zainstaluj z menu " +"Edytor." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -10947,6 +11056,8 @@ msgid "" "Trying to build from a custom built template, but no version info for it " "exists. Please reinstall from the 'Project' menu." msgstr "" +"Próbowano zbudować z wÅ‚asnego szablonu, ale nie istnieje dla niego " +"informacja o wersji. Zainstaluj ponownie z menu \"Projekt\"." #: platform/android/export/export.cpp msgid "" @@ -10955,20 +11066,27 @@ msgid "" " Godot Version: %s\n" "Please reinstall Android build template from 'Project' menu." msgstr "" +"Niezgodna wersja buildu Androida:\n" +" Zainstalowany szablon: %s\n" +" Wersja Godota: %s\n" +"Zainstaluj ponownie szablon z menu \"Projekt\"." #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" -msgstr "" +msgstr "Budowanie projektu Androida (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 "" +"Budowanie projektu Androida siÄ™ nie powiodÅ‚o, sprawdź wyjÅ›cie błędu.\n" +"Alternatywnie, odwiedź docs.godotengine.org po dokumentacjÄ™ budowania dla " +"Androida." #: platform/android/export/export.cpp msgid "No build apk generated at: " -msgstr "" +msgstr "Nie wygenerowano budowanego apk w: " #: platform/iphone/export/export.cpp msgid "Identifier is missing." @@ -11092,13 +11210,12 @@ msgstr "" "NieprawidÅ‚owe wymiary obrazka ekranu powitalnego (powinno być 620x300)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." msgstr "" -"Aby AnimatedSprite pokazywaÅ‚ poszczególne klatki, pole Frames musi zawierać " -"odpowiedni zasób SpriteFrames." +"WÅ‚aÅ›ciwość \"Frames\" musi zawierać odpowiedni zasób SpriteFrames, aby " +"AnimatedSprite wyÅ›wietlaÅ‚ klatki." #: scene/2d/canvas_modulate.cpp msgid "" @@ -11128,7 +11245,8 @@ msgid "" msgstr "" "CollisionPolygon2D sÅ‚uży jedynie do okreÅ›lenia ksztaÅ‚tu kolizji dla jednego " "z obiektów dziedziczÄ…cych z CollisionObject2D. Używaj go tylko jako dziecko " -"obiektów typu Area2D, StaticBody2D, RigidBody2D, KinematicBody2D itd." +"obiektów typu Area2D, StaticBody2D, RigidBody2D, KinematicBody2D itp. by " +"nadać im ksztaÅ‚t." #: scene/2d/collision_polygon_2d.cpp msgid "An empty CollisionPolygon2D has no effect on collision." @@ -11142,7 +11260,8 @@ msgid "" msgstr "" "CollisionShape2D sÅ‚uży jedynie do okreÅ›lenia ksztaÅ‚tu kolizji dla jednego z " "obiektów dziedziczÄ…cych z CollisionObject2D. Używaj go tylko jako dziecko " -"obiektów typu Area2D, StaticBody2D, RigidBody2D, KinematicBody2D itd." +"obiektów typu Area2D, StaticBody2D, RigidBody2D, KinematicBody2D itp. by " +"nadać im ksztaÅ‚t." #: scene/2d/collision_shape_2d.cpp msgid "" @@ -11161,24 +11280,24 @@ msgstr "" "\"Particles Animation\"." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." msgstr "" -"Tekstura z ksztaÅ‚tem promieni Å›wiatÅ‚a musi być dodana do pola Tekstura." +"Tekstura z ksztaÅ‚tem promieni Å›wiatÅ‚a musi być dostarczona do wÅ‚aÅ›ciwoÅ›ci " +"\"Texture\"." #: scene/2d/light_occluder_2d.cpp msgid "" "An occluder polygon must be set (or drawn) for this occluder to take effect." msgstr "" -"WielokÄ…t zasÅ‚aniajÄ…cy musi być ustawiony (lub narysowany) aby Occluder " -"zadziaÅ‚aÅ‚." +"WielokÄ…t przesÅ‚aniajÄ…cy musi być ustawiony (lub narysowany), aby ten " +"przesÅ‚aniacz zadziaÅ‚aÅ‚." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." -msgstr "Poligon zasÅ‚aniajÄ…cy jest pusty. ProszÄ™ narysować poligon!" +msgstr "" +"WielokÄ…t przesÅ‚aniajÄ…cy dla tego przesÅ‚aniacza jest pusty. Narysuj wielokÄ…t." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11265,29 +11384,26 @@ msgstr "" "i ustaw jÄ…." #: scene/2d/tile_map.cpp -#, fuzzy msgid "" "TileMap with Use Parent on needs a parent CollisionObject2D to give shapes " "to. Please use it as a child of Area2D, StaticBody2D, RigidBody2D, " "KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionShape2D sÅ‚uży jedynie do okreÅ›lenia ksztaÅ‚tu kolizji dla jednego z " -"obiektów dziedziczÄ…cych z CollisionObject2D. Używaj go tylko jako dziecko " -"obiektów typu Area2D, StaticBody2D, RigidBody2D, KinematicBody2D itd." +"WÄ™zeÅ‚ TileMap z włączonym Use Parent potrzebuje nadrzÄ™dnego wÄ™zÅ‚a " +"CollisionObject2D, by dać mu ksztaÅ‚ty. Używaj go jako dziecko wÄ™złów Area2D, " +"StaticBody2D, RigidBody2D, KinematicBody2D itp. by nadać im ksztaÅ‚t." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." msgstr "" -"VisibilityEnable2D dziaÅ‚a najlepiej, gdy jest bezpoÅ›rednio pod korzeniem " -"aktualnie edytowanej sceny." +"VisibilityEnabler2D dziaÅ‚a najlepiej, gdy jest użyty bezpoÅ›rednio pod " +"korzeniem aktualnie edytowanej sceny." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera musi dziedziczyć po węźle ARVROrigin" +msgstr "ARVRCamera musi posiadać wÄ™zeÅ‚ ARVROrigin jako nadrzÄ™dny." #: scene/3d/arvr_nodes.cpp msgid "ARVRController must have an ARVROrigin node as its parent." @@ -11360,7 +11476,8 @@ msgid "" msgstr "" "CollisionPolygon sÅ‚uży jedynie do okreÅ›lenia ksztaÅ‚tu kolizji dla jednego z " "obiektów dziedziczÄ…cych z CollisionObject. Używaj go tylko jako dziecko " -"obiektów typu Area, StaticBody, RigidBody, KinematicBody itd." +"obiektów typu Area, StaticBody, RigidBody, KinematicBody itp. by nadać im " +"ksztaÅ‚t." #: scene/3d/collision_polygon.cpp msgid "An empty CollisionPolygon has no effect on collision." @@ -11374,16 +11491,15 @@ msgid "" msgstr "" "CollisionShape sÅ‚uży jedynie do okreÅ›lenia ksztaÅ‚tu kolizji dla jednego z " "wÄ™złów dziedziczÄ…cych z CollisionObject. Używaj go tylko jako dziecko wÄ™złów " -"typu Area, StaticBody, RigidBody, KinematicBody itd." +"typu Area, StaticBody, RigidBody, KinematicBody itp. by nadać im ksztaÅ‚t." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" -"KsztaÅ‚t musi być okreÅ›lony dla CollisionShape, aby speÅ‚niaÅ‚ swoje zadanie. " -"Utwórz zasób typu CollisionShape w odpowiednim polu obiektu!" +"KsztaÅ‚t musi być zapewniony, aby CollisionShape zadziaÅ‚aÅ‚. Utwórz dla niego " +"zasób typu CollisionShape." #: scene/3d/collision_shape.cpp msgid "" @@ -11419,7 +11535,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." -msgstr "" +msgstr "SpotLight z kÄ…tem szerszym niż 90 stopni nie może rzucać cieni." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11464,13 +11580,12 @@ msgid "PathFollow only works when set as a child of a Path node." msgstr "PathFollow dziaÅ‚a tylko, gdy jest wÄ™zÅ‚em podrzÄ™dnym Path." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED wymaga włączonego \"Wektora w górÄ™\" w zasobie " -"Curve jego nadrzÄ™dnego wÄ™zÅ‚a Path." +"WÅ‚aÅ›ciwość ROTATION_ORIENTED wÄ™zÅ‚a PathFollow wymaga włączonego \"Up Vector" +"\" w zasobie Curve jego nadrzÄ™dnego wÄ™zÅ‚a Path." #: scene/3d/physics_body.cpp msgid "" @@ -11483,11 +11598,12 @@ msgstr "" "Zamiast tego, zmieÅ„ rozmiary ksztaÅ‚tów kolizji w wÄ™zÅ‚ach podrzÄ™dnych." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." -msgstr "Pole Path musi wskazywać na wÄ™zeÅ‚ Spatial." +msgstr "" +"WÅ‚aÅ›ciwość \"Remote Path\" musi wskazywać na poprawny wÄ™zeÅ‚ typu Spatial lub " +"pochodnego." #: scene/3d/soft_body.cpp msgid "This body will be ignored until you set a mesh." @@ -11504,13 +11620,12 @@ msgstr "" "Zamiast tego, zmieÅ„ rozmiary ksztaÅ‚tów kolizji w wÄ™zÅ‚ach podrzÄ™dnych." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" -"Zasób SpriteFrames musi być ustawiony jako wartość wÅ‚aÅ›ciwoÅ›ci \"Frames\" " -"żeby AnimatedSprite3D wyÅ›wietlaÅ‚ klatki." +"WÅ‚aÅ›ciwość \"Frames\" musi zawierać odpowiedni zasób SpriteFrames, aby " +"AnimatedSprite3D wyÅ›wietlaÅ‚ klatki." #: scene/3d/vehicle_body.cpp msgid "" @@ -11525,6 +11640,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"WorldEnvironment wymaga, by jego wÅ‚aÅ›ciwość \"Environment\" posiadaÅ‚a zasób " +"Environment, by mieć widoczny efekt." #: scene/3d/world_environment.cpp msgid "" @@ -11562,9 +11679,8 @@ msgid "Nothing connected to input '%s' of node '%s'." msgstr "Nic nie podłączono do wejÅ›cia \"%s\" wÄ™zÅ‚a \"%s\"." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." -msgstr "KorzeÅ„ dla grafu AnimationNode nie jest ustawiony." +msgstr "Nie ustawiono korzenia AnimationNode dla grafu." #: scene/animation/animation_tree.cpp msgid "Path to an AnimationPlayer node containing animations is not set." @@ -11577,7 +11693,6 @@ msgstr "" "Åšcieżka do wÄ™zÅ‚a AnimationPlayer nie prowadzi do wÄ™zÅ‚a AnimationPlayer." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." msgstr "KorzeÅ„ AnimationPlayer nie jest poprawnym wÄ™zÅ‚em." @@ -11606,7 +11721,6 @@ msgid "Add current color as a preset." msgstr "Dodaj bieżący kolor do zapisanych." #: scene/gui/container.cpp -#, fuzzy msgid "" "Container by itself serves no purpose unless a script configures its " "children placement behavior.\n" @@ -11614,8 +11728,7 @@ msgid "" msgstr "" "Kontener sam w sobie nie speÅ‚nia żadnego celu, chyba że jakiÅ› skrypt " "konfiguruje sposób ustawiania jego podrzÄ™dnych wÄ™złów.\n" -"JeÅ›li nie zamierzasz dodać skryptu, zamiast tego użyj zwykÅ‚ego wÄ™zÅ‚a " -"\"Control\"." +"JeÅ›li nie zamierzasz dodać skryptu, zamiast tego użyj zwykÅ‚ego wÄ™zÅ‚a Control." #: scene/gui/control.cpp msgid "" @@ -11634,32 +11747,28 @@ msgid "Please Confirm..." msgstr "ProszÄ™ potwierdzić..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " "running." msgstr "" "WyskakujÄ…ce okna bÄ™dÄ… domyÅ›lnie ukryte dopóki nie wywoÅ‚asz popup() lub " -"dowolnej funkcji popup*(). Ustawienie ich jako widocznych jest przydatne do " -"edycji, ale zostanÄ… ukryte po uruchomieniu." +"dowolnej funkcji popup*(). Ustawienie ich jako widocznych do edycji jest w " +"porzÄ…dku, ale zostanÄ… ukryte po uruchomieniu." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "JeÅ›li exp_edit jest prawdziwe, min_value musi być > 0." +msgstr "JeÅ›li \"Exp Edit\" jest włączone, \"Min Value\" musi być wiÄ™ksze od 0." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " "minimum size manually." msgstr "" -"ScrollContainer jest zaprojektowany do dziaÅ‚ania z jednym dzieckiem klasy " -"Control.\n" -"Użyj kontenera jako dziecko (VBox,HBox,etc), lub wÄ™zÅ‚a klasy Control i ustaw " -"rÄ™cznie minimalny rozmiar." +"ScrollContainer jest zaprojektowany do dziaÅ‚ania z jednÄ… potomnÄ… kontrolkÄ….\n" +"Użyj kontenera jako dziecko (VBox, HBox, itp.) lub wÄ™zÅ‚a typu Control i " +"ustaw minimalny rozmiar rÄ™cznie." #: scene/gui/tree.cpp msgid "(Other)" @@ -11706,14 +11815,17 @@ msgid "Input" msgstr "WejÅ›cie" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "NiewÅ‚aÅ›ciwe źródÅ‚o dla shadera." +msgstr "NieprawidÅ‚owe źródÅ‚o do podglÄ…du." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "NiewÅ‚aÅ›ciwe źródÅ‚o dla shadera." +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "NiewÅ‚aÅ›ciwa funkcja porównania dla tego typu." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Przypisanie do funkcji." @@ -11730,6 +11842,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 "Previous Folder" +#~ msgstr "Poprzedni folder" + +#~ msgid "Next Folder" +#~ msgstr "NastÄ™pny folder" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Automatycznie otwórz zrzuty ekranu" + +#~ msgid "Open in an external image editor." +#~ msgstr "Otwórz w zewnÄ™trznym edytorze obrazów." + +#~ msgid "Reverse" +#~ msgstr "Odwróć" + +#~ msgid "Mirror X" +#~ msgstr "Odbij X" + +#~ msgid "Mirror Y" +#~ msgstr "Odbij Y" + #~ msgid "Generating solution..." #~ msgstr "Generowanie solucji..." diff --git a/editor/translations/pr.po b/editor/translations/pr.po index 95c567a176..1ab60028e0 100644 --- a/editor/translations/pr.po +++ b/editor/translations/pr.po @@ -143,6 +143,31 @@ msgid "Anim Change Call" msgstr "Change yer Anim Call" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Change yer Anim Value" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Change yer Anim Transition" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Change yer Anim Transform" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Change yer Anim Value" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Change yer Anim Call" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1139,7 +1164,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1695,7 +1719,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1746,7 +1770,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1772,24 +1796,28 @@ msgstr "" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "Slit th' Node" +msgid "Go to previous folder." +msgstr "Toggle ye Breakpoint" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Slit th' Node" +msgid "Go to next folder." +msgstr "Toggle ye Breakpoint" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2478,6 +2506,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Forge yer Node!" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2671,14 +2704,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2997,6 +3022,11 @@ msgstr "" msgid "Calls" msgstr "Call" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "th' Members:" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4673,6 +4703,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4701,7 +4735,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4715,7 +4748,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4790,33 +4823,37 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "" +#, fuzzy +msgid "Move Vertical Guide" +msgstr "Discharge ye' Variable" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "Discharge ye' Variable" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "Discharge ye' Variable" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "" +#, fuzzy +msgid "Move Horizontal Guide" +msgstr "Discharge ye' Variable" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "Discharge ye' Variable" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "Discharge ye' Variable" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6726,7 +6763,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6912,10 +6953,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Tool Select" msgstr "Yar, Blow th' Selected Down!" @@ -7500,14 +7537,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7925,6 +7954,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8012,6 +8045,22 @@ msgid "Color uniform." msgstr "Change yer Anim Transform" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8019,10 +8068,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8111,7 +8194,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8119,7 +8202,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8131,7 +8214,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8148,7 +8231,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8217,11 +8300,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8237,7 +8320,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8265,11 +8348,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8310,11 +8393,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8323,7 +8410,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8341,15 +8428,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8399,7 +8486,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8427,12 +8514,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8509,47 +8596,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9717,6 +9804,11 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Yar, Blow th' Selected Down!" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9932,7 +10024,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11504,6 +11596,11 @@ msgstr "Yer Calligraphy be wrongly sized." msgid "Invalid source for shader." msgstr "Yer Calligraphy be wrongly sized." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Yer Calligraphy be wrongly sized." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11521,6 +11618,14 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "Slit th' Node" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Slit th' Node" + +#, fuzzy #~ msgid "Custom Node" #~ msgstr "Slit th' Node" diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po index c9b8697dd6..6648ae1f7e 100644 --- a/editor/translations/pt_BR.po +++ b/editor/translations/pt_BR.po @@ -64,12 +64,13 @@ # Douglas Fiedler <dognew@gmail.com>, 2019. # Rarysson Guilherme <r_guilherme12@hotmail.com>, 2019. # Gustavo da Silva Santos <gustavo94.rb@gmail.com>, 2019. +# Rafael Roque <rafael.roquec@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: 2016-05-30\n" -"PO-Revision-Date: 2019-07-09 10:46+0000\n" -"Last-Translator: Gustavo da Silva Santos <gustavo94.rb@gmail.com>\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" +"Last-Translator: Rafael Roque <rafael.roquec@gmail.com>\n" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_BR/>\n" "Language: pt_BR\n" @@ -188,6 +189,31 @@ msgid "Anim Change Call" msgstr "Alterar Chamada da Anim" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Alterar Tempo de Quadro-Chave da Anim" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Alterar Transição da Animação" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Alterar Transformação da Anim" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Alterar Valor de Quadro-Chave da Anim" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Alterar Chamada da Anim" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Alterar Duração da Animação" @@ -690,7 +716,7 @@ msgstr "Número da Linha:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "%d correspondência(s) encontrada(s)." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -847,9 +873,8 @@ msgid "Connect" msgstr "Conectar" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Sinais:" +msgstr "Sinal:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -1014,7 +1039,6 @@ msgid "Owners Of:" msgstr "Donos De:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" msgstr "Remover arquivos selecionados do projeto? (irreversÃvel)" @@ -1198,7 +1222,6 @@ msgid "Success!" msgstr "Sucesso!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Instalar" @@ -1567,7 +1590,7 @@ msgstr "Arquivo de modelo não encontrado:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." -msgstr "" +msgstr "Em exportações de 32 bits, o PCK embutido não pode ser maior que 4GB." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1590,14 +1613,12 @@ msgid "Import Dock" msgstr "Importar Dock" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Node Dock" -msgstr "Nó Movido" +msgstr "Dock de Nós" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "FileSystem and Import Docks" -msgstr "Arquivos" +msgstr "Sistema de Arquivos e Importar Docks" #: editor/editor_feature_profile.cpp msgid "Erase profile '%s'? (no undo)" @@ -1742,7 +1763,7 @@ msgstr "Mostrar no Gerenciador de Arquivos" msgid "New Folder..." msgstr "Nova Pasta..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Atualizar" @@ -1793,7 +1814,7 @@ msgstr "Avançar" msgid "Go Up" msgstr "Acima" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Alternar Arquivos Ocultos" @@ -1818,25 +1839,32 @@ msgid "Move Favorite Down" msgstr "Mover Favorito Abaixo" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Pasta Anterior" +#, fuzzy +msgid "Go to previous folder." +msgstr "Ir para diretório (pasta) pai." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Próxima Pasta" +#, fuzzy +msgid "Go to next folder." +msgstr "Ir para diretório (pasta) pai." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Ir para diretório (pasta) pai." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Pesquisar arquivos" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "(Des)favoritar pasta atual." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." -msgstr "Alternar Arquivos Ocultos" +msgid "Toggle the visibility of hidden files." +msgstr "Alternar visibilidade de arquivos ocultos." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "View items as a grid of thumbnails." @@ -1873,6 +1901,8 @@ msgid "" "There are multiple importers for different types pointing to file %s, import " "aborted" msgstr "" +"Existem múltiplos importadores para diferentes tipos que apontam para o " +"arquivo %s, importação abortada" #: editor/editor_file_system.cpp msgid "(Re)Importing Assets" @@ -2566,6 +2596,10 @@ msgid "Go to previously opened scene." msgstr "Ir para cena aberta anteriormente." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Copiar Texto" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Próxima guia" @@ -2657,7 +2691,7 @@ msgstr "Abrir Pasta do Projeto" #: editor/editor_node.cpp msgid "Install Android Build Template" -msgstr "" +msgstr "Instalar o Modelo de Compilação do Android" #: editor/editor_node.cpp msgid "Quit to Project List" @@ -2768,32 +2802,20 @@ msgid "Editor Layout" msgstr "Layout do Editor" #: editor/editor_node.cpp -#, fuzzy msgid "Take Screenshot" -msgstr "Fazer Raiz de Cena" +msgstr "Tirar Captura de Tela" #: editor/editor_node.cpp -#, fuzzy msgid "Screenshots are stored in the Editor Data/Settings Folder." -msgstr "Abrir Editor/Configurações de Pasta" - -#: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Abrir o próximo Editor" +msgstr "Capturas de Telas ficam salvas na Pasta Editor Data/Settings." #: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Alternar Tela-Cheia" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle System Console" -msgstr "Alternar CanvasItem VisÃvel" +msgstr "Alternar Console do Sistema" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -2808,9 +2830,8 @@ msgid "Open Editor Settings Folder" msgstr "Abrir Configurações do Editor" #: editor/editor_node.cpp -#, fuzzy msgid "Manage Editor Features" -msgstr "Gerenciar Modelos de Exportação" +msgstr "Gerenciar Recursos do Editor" #: editor/editor_node.cpp editor/project_export.cpp msgid "Manage Export Templates" @@ -2903,19 +2924,16 @@ msgid "Spins when the editor window redraws." msgstr "Gira quando a janela do editor atualiza." #: editor/editor_node.cpp -#, fuzzy msgid "Update Continuously" -msgstr "ContÃnuo" +msgstr "Atualizar Continuamente" #: editor/editor_node.cpp -#, fuzzy msgid "Update When Changed" -msgstr "Atualizar Alterações" +msgstr "Atualizar quando Alterado" #: editor/editor_node.cpp -#, fuzzy msgid "Hide Update Spinner" -msgstr "Desabilitar Spinner de Atualização" +msgstr "Ocultar Spinner de Atualização" #: editor/editor_node.cpp msgid "FileSystem" @@ -2944,6 +2962,8 @@ msgstr "Não Salvar" #: editor/editor_node.cpp msgid "Android build template is missing, please install relevant templates." msgstr "" +"O modelo de compilação do Android não foi encontrado, por favor instale " +"modelos relevantes." #: editor/editor_node.cpp msgid "Manage Templates" @@ -2954,6 +2974,9 @@ msgid "" "This will install the Android project for custom builds.\n" "Note that, in order to use it, it needs to be enabled per export preset." msgstr "" +"Isso instalará o projeto Android para compilações personalizadas.\n" +"Note que, para usá-lo, ele precisa estar habilitado por predefinição de " +"exportação." #: editor/editor_node.cpp msgid "" @@ -2961,6 +2984,8 @@ msgid "" "Remove the \"build\" directory manually before attempting this operation " "again." msgstr "" +"O modelo de compilação do Android já está instalado e não será substituÃdo.\n" +"Remova a pasta \"build\" manualmente antes de tentar esta operação novamente." #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3070,7 +3095,7 @@ msgstr "Medida:" #: editor/editor_profiler.cpp msgid "Frame Time (sec)" -msgstr "Tempo de Quadro (seg)" +msgstr "Tempo do Frame (seg)" #: editor/editor_profiler.cpp msgid "Average Time (sec)" @@ -3078,11 +3103,11 @@ msgstr "Tempo Médio (seg)" #: editor/editor_profiler.cpp msgid "Frame %" -msgstr "% de Quadro" +msgstr "Frame %" #: editor/editor_profiler.cpp msgid "Physics Frame %" -msgstr "Quadro FÃsico %" +msgstr "Frame de FÃsica %" #: editor/editor_profiler.cpp msgid "Inclusive" @@ -3104,6 +3129,11 @@ msgstr "Tempo" msgid "Calls" msgstr "Chamadas" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Editar Tema" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Ativo" @@ -3434,9 +3464,8 @@ msgid "SSL Handshake Error" msgstr "Erro SSL Handshake" #: editor/export_template_manager.cpp -#, fuzzy msgid "Uncompressing Android Build Sources" -msgstr "Descompactando Assets" +msgstr "Descompactando Fontes de Compilação do Android" #: editor/export_template_manager.cpp msgid "Current Version:" @@ -3455,9 +3484,8 @@ msgid "Remove Template" msgstr "Remover Modelo" #: editor/export_template_manager.cpp -#, fuzzy msgid "Select Template File" -msgstr "Selecione o arquivo de modelo" +msgstr "Selecionar o Arquivo de Modelo" #: editor/export_template_manager.cpp msgid "Export Template Manager" @@ -3621,9 +3649,8 @@ msgid "Re-Scan Filesystem" msgstr "Re-escanear Sistema de Arquivos" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Toggle Split Mode" -msgstr "Alternar modo" +msgstr "Alternar Modo Split" #: editor/filesystem_dock.cpp msgid "Search files" @@ -4402,9 +4429,8 @@ msgid "Enable Onion Skinning" msgstr "Ativar Papel Vegetal" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Onion Skinning Options" -msgstr "Papel Vegetal" +msgstr "Opções do Onion Skinning" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Directions" @@ -4779,6 +4805,10 @@ msgid "Idle" msgstr "Ocioso" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "Instalar..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Tentar Novamente" @@ -4807,7 +4837,6 @@ msgid "Last" msgstr "Último" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Todos" @@ -4821,8 +4850,8 @@ msgid "Sort:" msgstr "Ordenar:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Reverso" +msgid "Reverse sorting." +msgstr "Inverter ordenação." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4903,32 +4932,32 @@ msgid "Rotation Step:" msgstr "Passo de Rotação:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "Mover guia vertical" +msgid "Move Vertical Guide" +msgstr "Mover Guia Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "Criar novo guia vertical" +msgid "Create Vertical Guide" +msgstr "Criar Guia Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "Remover guia vertical" +msgid "Remove Vertical Guide" +msgstr "Remover Guia Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "Mover guia horizontal" +msgid "Move Horizontal Guide" +msgstr "Mover Guia Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "Criar novo guia horizontal" +msgid "Create Horizontal Guide" +msgstr "Criar Guia Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "Remover guia horizontal" +msgid "Remove Horizontal Guide" +msgstr "Remover Guia Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "Criar novos guias horizontais e verticais" +msgid "Create Horizontal and Vertical Guides" +msgstr "Criar Guias Horizontais e Verticais" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -4972,6 +5001,8 @@ msgid "" "When active, moving Control nodes changes their anchors instead of their " "margins." msgstr "" +"Quando ativo, os nós de Controle móveis mudam suas âncoras em vez de suas " +"margens." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchors only" @@ -5010,14 +5041,12 @@ msgid "Paste Pose" msgstr "Colar Pose" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Create Custom Bone(s) from Node(s)" -msgstr "Criar esqueleto(s) customizado do(s) nó(s)" +msgstr "Criar esqueleto(s) customizado(s) do(s) nó(s)" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Clear Bones" -msgstr "Limpar Pose" +msgstr "Limpar Esqueletos" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -5105,7 +5134,6 @@ msgid "Snapping Options" msgstr "Opções de agarramento" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Grid" msgstr "Encaixar na grade" @@ -5127,39 +5155,32 @@ msgid "Use Pixel Snap" msgstr "Usar Snap de Pixel" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Smart Snapping" msgstr "Encaixe inteligente" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Parent" -msgstr "Encaixar no pai" +msgstr "Encaixar no Pai" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Anchor" -msgstr "Encaixar na âncora do nó" +msgstr "Encaixar na Âncora do Nó" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Sides" -msgstr "Encaixar nos lados do nó" +msgstr "Encaixar nos Lados do Nó" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Node Center" -msgstr "Encaixar no centro do nó" +msgstr "Encaixar no Centro do Nó" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Other Nodes" -msgstr "Encaixar em outros nós" +msgstr "Encaixar em Outros Nós" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Snap to Guides" -msgstr "Encaixar nas guias" +msgstr "Encaixar nas Guias" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5240,9 +5261,8 @@ msgid "Frame Selection" msgstr "Seleção de Quadros" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Preview Canvas Scale" -msgstr "Prever Atlas" +msgstr "Visualizar Canvas Scale" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Translation mask for inserting keys." @@ -5298,9 +5318,8 @@ msgid "Divide grid step by 2" msgstr "Dividir o passo da grade por 2" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Pan View" -msgstr "Visão Traseira" +msgstr "Vista Panorâmica" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Add %s" @@ -5371,9 +5390,8 @@ msgstr "Carregar Máscara de Emissão" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Restart" -msgstr "Reiniciar Agora" +msgstr "Reiniciar" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5461,19 +5479,16 @@ msgid "Remove Point" msgstr "Remover Ponto" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Left Linear" -msgstr "Linear esquerda" +msgstr "Linear Esquerda" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Right Linear" -msgstr "Linear direita" +msgstr "Linear Direita" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Load Preset" -msgstr "Carregar definição" +msgstr "Carregar Predefinição" #: editor/plugins/curve_editor_plugin.cpp msgid "Remove Curve Point" @@ -5528,9 +5543,8 @@ msgid "This doesn't work on scene root!" msgstr "Não funciona na raiz da cena!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Trimesh Static Shape" -msgstr "Criar Forma Trimesh" +msgstr "Criar Forma Estática Trimesh" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Failed creating shapes!" @@ -5958,9 +5972,8 @@ msgid "Split Segment (in curve)" msgstr "Dividir Segmentos (na curva)" #: editor/plugins/physical_bone_plugin.cpp -#, fuzzy msgid "Move Joint" -msgstr "Mover junta" +msgstr "Mover Junta" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "" @@ -6293,18 +6306,16 @@ msgid "Find Next" msgstr "Localizar próximo" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter scripts" -msgstr "Filtrar propriedades" +msgstr "Filtrar scripts" #: editor/plugins/script_editor_plugin.cpp msgid "Toggle alphabetical sorting of the method list." msgstr "Alternar ordenação alfabética da lista de métodos." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter methods" -msgstr "Modo de filtragem:" +msgstr "Métodos de filtragem" #: editor/plugins/script_editor_plugin.cpp msgid "Sort" @@ -6537,7 +6548,7 @@ msgstr "Realce de sintaxe" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Ir Para" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6547,7 +6558,7 @@ msgstr "Marcadores" #: editor/plugins/script_text_editor.cpp #, fuzzy msgid "Breakpoints" -msgstr "Criar pontos." +msgstr "Pontos de interrupção(Breakpoints)" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6575,19 +6586,16 @@ msgid "Toggle Bookmark" msgstr "Alternar Marcador" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Next Bookmark" -msgstr "Vá para o próximo ponto de interrupção" +msgstr "Ir para o Próximo Marcador" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Go to Previous Bookmark" -msgstr "Ir para ponto de interrupção anterior" +msgstr "Ir para o Marcador Anterior" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Remove All Bookmarks" -msgstr "Remover Todos os Itens" +msgstr "Remover Todos os Marcadores" #: editor/plugins/script_text_editor.cpp msgid "Fold/Unfold Line" @@ -6668,8 +6676,8 @@ msgid "" "This shader has been modified on on disk.\n" "What action should be taken?" msgstr "" -"Os seguintes arquivos são mais recentes no disco.\n" -"Que ação deve ser tomada?:" +"Este shader foi modificado no disco.\n" +"Que ação deve ser tomada?" #: editor/plugins/shader_editor_plugin.cpp msgid "Shader" @@ -6840,9 +6848,15 @@ msgid "Rear" msgstr "Traseira" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Alinhar com a Vista" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Alinhar Seleção com Visualização" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Sem pai onde instanciar um filho." @@ -7030,10 +7044,6 @@ msgid "Focus Selection" msgstr "Focar Seleção" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Alinhar Seleção com Visualização" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Ferramenta Selecionar" @@ -7249,21 +7259,20 @@ msgid "Settings:" msgstr "Configurações:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "No Frames Selected" -msgstr "Seleção de Quadros" +msgstr "Nenhum Frame Selecionado" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add %d Frame(s)" -msgstr "Adicionar %d Quadro(s)" +msgstr "Adicionar %d Frame(s)" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Frame" -msgstr "Adicionar Quadro" +msgstr "Adicionar Frame" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "ERROR: Couldn't load frame resource!" -msgstr "ERRO: Não foi possÃvel carregar recurso de quadro!" +msgstr "ERRO: Não foi possÃvel carregar o recurso de frame!" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Resource clipboard is empty or not a texture!" @@ -7271,7 +7280,7 @@ msgstr "Recurso da área de transferência está vazio ou não é uma textura!" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Paste Frame" -msgstr "Colar Quadro" +msgstr "Colar Frame" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Empty" @@ -7303,7 +7312,7 @@ msgstr "Repetir" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animation Frames:" -msgstr "Quadros da Animação:" +msgstr "Frames da Animação:" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add a Texture from File" @@ -7311,7 +7320,7 @@ msgstr "Adicionar Textura de um Arquivo" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Frames from a Sprite Sheet" -msgstr "" +msgstr "Adicionar Frames de uma Sprite Sheet" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (Before)" @@ -7330,9 +7339,8 @@ msgid "Move (After)" msgstr "Mover (Depois)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Select Frames" -msgstr "Pilha de Quadros" +msgstr "Selecionar Frames" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Horizontal:" @@ -7343,14 +7351,13 @@ msgid "Vertical:" msgstr "Vertical:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Select/Clear All Frames" -msgstr "Selecionar Tudo" +msgstr "Selecionar/Deselecionar Todos os Frames" #: editor/plugins/sprite_frames_editor_plugin.cpp #, fuzzy msgid "Create Frames from Sprite Sheet" -msgstr "Criar a partir de Cena" +msgstr "Criar Frames a partir da Planilha de Sprites" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "SpriteFrames" @@ -7422,9 +7429,8 @@ msgid "Remove All" msgstr "Remover Tudo" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Edit Theme" -msgstr "Editar tema..." +msgstr "Editar Tema" #: editor/plugins/theme_editor_plugin.cpp msgid "Theme editing menu." @@ -7451,23 +7457,20 @@ msgid "Create From Current Editor Theme" msgstr "Criar a Partir do Tema Atual do Editor" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Toggle Button" -msgstr "Botão do Mous" +msgstr "Alternar Botão" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Disabled Button" -msgstr "Botão do Meio" +msgstr "Botão Desativado" #: editor/plugins/theme_editor_plugin.cpp msgid "Item" msgstr "Item" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Disabled Item" -msgstr "Desabilitado" +msgstr "Item Desativado" #: editor/plugins/theme_editor_plugin.cpp msgid "Check Item" @@ -7487,21 +7490,19 @@ msgstr "Item Rádio Marcado" #: editor/plugins/theme_editor_plugin.cpp msgid "Named Sep." -msgstr "" +msgstr "Sep. Nomeado" #: editor/plugins/theme_editor_plugin.cpp msgid "Submenu" msgstr "Submenu" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Item 1" -msgstr "Item" +msgstr "Item 1" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Item 2" -msgstr "Item" +msgstr "Item 2" #: editor/plugins/theme_editor_plugin.cpp msgid "Has" @@ -7512,9 +7513,8 @@ msgid "Many" msgstr "Muitas" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Disabled LineEdit" -msgstr "Desabilitado" +msgstr "LineEdit Desativado" #: editor/plugins/theme_editor_plugin.cpp msgid "Tab 1" @@ -7529,9 +7529,8 @@ msgid "Tab 3" msgstr "Guia 3" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Editable Item" -msgstr "Filhos Editáveis" +msgstr "Item Editável" #: editor/plugins/theme_editor_plugin.cpp msgid "Subtree" @@ -7607,22 +7606,12 @@ msgid "Transpose" msgstr "Transpor" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Espelhar X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Espelhar Y" - -#: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Disable Autotile" -msgstr "Autotiles" +msgstr "Desativar Autotile" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Enable Priority" -msgstr "Editar prioridade da telha" +msgstr "Ativar Prioridade" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" @@ -7641,27 +7630,22 @@ msgid "Pick Tile" msgstr "Pegar Tile" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Rotate Left" msgstr "Rotacionar para a esquerda" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Rotate Right" msgstr "Rotacionar para a direita" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Flip Horizontally" -msgstr "Girar horizontalmente" +msgstr "Inverter Horizontalmente" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Flip Vertically" -msgstr "Girar verticalmente" +msgstr "Inverter Verticalmente" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Clear Transform" msgstr "Limpar Transformação" @@ -7700,42 +7684,35 @@ msgstr "Selecione a forma, subtile ou tile anterior." #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Region Mode" -msgstr "Modo de InÃcio:" +msgstr "Modo de Região" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Collision Mode" -msgstr "Modo de Interpolação" +msgstr "Modo de Colisão" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Occlusion Mode" -msgstr "Editar polÃgono de oclusão" +msgstr "Modo de Oclusão" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Navigation Mode" -msgstr "Criar Malha de Navegação" +msgstr "Modo de Navegação" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Bitmask Mode" -msgstr "Modo Rotacionar" +msgstr "Modo Bitmask" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Priority Mode" -msgstr "Modo de Exportação:" +msgstr "Modo de Prioridade" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Icon Mode" -msgstr "Modo Panorâmico" +msgstr "Modo de Ãcone" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Z Index Mode" -msgstr "Modo Panorâmico" +msgstr "Modo Ãndice Z" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." @@ -7825,8 +7802,9 @@ msgid "" "Shift+LMB: Set wildcard bit.\n" "Click on another Tile to edit it." msgstr "" -"LMB: ligar bit.\n" -"RMB: desligar bit.\n" +"BEM: ligar bit.\n" +"BDM: desligar bit.\n" +"Shift+BEM: Escolher wildcard.\n" "Clique em outro Mosaico para editá-lo." #: editor/plugins/tile_set_editor_plugin.cpp @@ -7940,19 +7918,16 @@ msgid "TileSet" msgstr "Conjunto de Telha" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add input +" -msgstr "Adicionar Entrada" +msgstr "Adicionar Entrada +" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add output +" -msgstr "Adicionar Entrada" +msgstr "Adicionar saÃda +" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar" -msgstr "Escala:" +msgstr "Escalar" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vector" @@ -7963,9 +7938,8 @@ msgid "Boolean" msgstr "Booleano" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add input port" -msgstr "Adicionar Entrada" +msgstr "Adicionar porta de entrada" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add output port" @@ -7974,42 +7948,36 @@ msgstr "Adicionar porta de saÃda" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Change input port type" -msgstr "Mudar tipo padrão" +msgstr "Mudar tipo de porta de entrada" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Change output port type" -msgstr "Mudar tipo padrão" +msgstr "Mudar tipo de porta de saÃda" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Change input port name" -msgstr "Alterar Nome da Entrada" +msgstr "Alterar nome da porta de entrada" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Change output port name" -msgstr "Alterar Nome da Entrada" +msgstr "Alterar nome da porta de saÃda" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Remove input port" -msgstr "Remover ponto" +msgstr "Remover porta de entrada" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Remove output port" -msgstr "Remover ponto" +msgstr "Remover porta de saÃda" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set expression" -msgstr "Alterar Expressão" +msgstr "Definir expressão" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Resize VisualShader node" -msgstr "VisualShader" +msgstr "Redimensionar nó VisualShader" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" @@ -8036,6 +8004,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Tipo de Entrada de Shader Visual Alterado" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(Apenas GLES3)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vértice" @@ -8050,21 +8022,19 @@ msgstr "Luz" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Create Shader Node" -msgstr "Criar Nó" +msgstr "Criar Nó Shader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Color function." -msgstr "Ir para Função" +msgstr "Função cor." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color operator." -msgstr "" +msgstr "Operador de cor." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Grayscale function." -msgstr "Fazer Função" +msgstr "Função Escala de Cinza." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts HSV vector to RGB equivalent." @@ -8075,56 +8045,70 @@ msgid "Converts RGB vector to HSV equivalent." msgstr "Converter vetor RGB para um HSV equivalente." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Sepia function." -msgstr "Renomear Função" +msgstr "Função Sépia." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Burn operator." -msgstr "" +msgstr "Operador de gravação." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Darken operator." -msgstr "" +msgstr "Operador de escurecimento." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Difference operator." -msgstr "Apenas Diferenças" +msgstr "Operador de diferença." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Dodge operator." -msgstr "" +msgstr "Operador de desvio." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "HardLight operator" -msgstr "" +msgstr "Operador HardLight" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Lighten operator." -msgstr "" +msgstr "Operador de iluminação." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Overlay operator." -msgstr "" +msgstr "Operador de sobreposição." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Screen operator." -msgstr "" +msgstr "Operador de tela." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "SoftLight operator." -msgstr "" +msgstr "Operador SoftLight." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Color constant." -msgstr "Constante" +msgstr "Cor constante." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Color uniform." -msgstr "Limpar Transformação" +msgstr "Cor uniforme." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Retorna o resultado booleano da comparação %s entre dois parâmetros." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "Igual (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "Maior Que (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "Maior ou Igual (>=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8135,62 +8119,106 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" +"Retorna o resultado booleano da comparação entre INF e o parâmetro escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" +"Retorna o resultado booleano da comparação entre NaN e um parâmetro escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "Menor Que (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "Menor ou Igual (<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "Diferente (!=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" "Retorna um vetor associado se o valor lógico fornecido for verdadeiro ou " "falso." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Retorna o resultado booleano da comparação entre dois parâmetros." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" +"Retorna o resultado booleano da comparação entre INF (ou NaN) e um parâmetro " +"escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." -msgstr "Alterar Constante Vet" +msgstr "Constante booleana." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean uniform." -msgstr "" +msgstr "Booleano uniforme." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for all shader modes." -msgstr "" +msgstr "Parâmetro de entrada '%s' para todos os modos de sombreamento." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Input parameter." -msgstr "Encaixar no pai" +msgstr "Parâmetro de entrada." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "'%s' input parameter for vertex and fragment shader modes." msgstr "" +"Parâmetro de entrada '%s' para os modos de sombreamento de vértice e " +"fragmento." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "'%s' input parameter for fragment and light shader modes." msgstr "" +"Parâmetro de entrada '%s' para os modos de sombreamento de fragmento e luz." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "'%s' input parameter for fragment shader mode." -msgstr "" +msgstr "Parâmetro de entrada '%s' para o modo de sombreamento de fragmento." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "'%s' input parameter for light shader mode." -msgstr "" +msgstr "Parâmetro de entrada '%s' para o modo de sombreamento de luz." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "'%s' input parameter for vertex shader mode." -msgstr "" +msgstr "Parâmetro de entrada '%s' para o modo de sombreamento de vértice." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "'%s' input parameter for vertex and fragment shader mode." msgstr "" +"Parâmetro de entrada '%s' para o modo de sombreamento de vértice e fragmento." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar function." -msgstr "Alterar Função Escalar" +msgstr "Função escalar." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar operator." -msgstr "Alterar Operador Escalar" +msgstr "Operador escalar." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "E constant (2.718282). Represents the base of the natural logarithm." @@ -8233,16 +8261,16 @@ msgid "Returns the arc-cosine of the parameter." msgstr "Retorna o arco-cosseno do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "(Somente em GLES3) Retorna o coseno hiperbólico inverso do parâmetro." +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "Retorna o cosseno hiperbólico inverso do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." msgstr "Retorna o arco-seno do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "(Somente em GLES3) Retorna o seno hiperbólico inverso do parâmetro." +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "Retorna o seno hiperbólico inverso do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." @@ -8253,9 +8281,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Retorna o arco-tangente dos parâmetros." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "" -"(Somente em GLES3) Retorna a tangente hiperbólica inversa do parâmetro." +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "Retorna a tangente hiperbólica inversa do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8264,20 +8291,19 @@ msgstr "Encontra o inteiro mais próximo que é maior ou igual ao parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Constrains a value to lie between two further values." -msgstr "" +msgstr "Limita um valor para permanecer entre dois outros valores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the cosine of the parameter." msgstr "Retorna o cosseno do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "(Somente em GLES3) Retorna o coseno hiperbólico do parâmetro." +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "Retorna o cosseno hiperbólico do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Converts a quantity in radians to degrees." -msgstr "Converte uma quantidade em radianos para graus." +msgstr "Converte um valor em radianos para graus." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-e Exponential." @@ -8293,8 +8319,9 @@ msgid "Finds the nearest integer less than or equal to the parameter." msgstr "Encontra o inteiro mais próximo que é menor ou igual ao parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Computes the fractional part of the argument." -msgstr "" +msgstr "Calcula a parte decimal do argumento." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse of the square root of the parameter." @@ -8311,11 +8338,11 @@ msgstr "Logaritmo de Base-2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the greater of two values." -msgstr "" +msgstr "Retorna o maior entre dois valores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the lesser of two values." -msgstr "" +msgstr "Retorna o menor entre dois valores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two scalars." @@ -8343,18 +8370,16 @@ msgid "1.0 / scalar" msgstr "1,0 / escalar" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "(Somente em GLES3) Encontra o inteiro mais próximo ao parâmetro." +msgid "Finds the nearest integer to the parameter." +msgstr "Encontra o inteiro mais próximo do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "(Somente em GLES3) Encontra o inteiro par mais próximo ao parâmetro." +msgid "Finds the nearest even integer to the parameter." +msgstr "Encontra o inteiro par mais próximo do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." -msgstr "" +msgstr "Limita o valor entre 0.0 e 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Extracts the sign of the parameter." @@ -8365,14 +8390,15 @@ msgid "Returns the sine of the parameter." msgstr "Retorna o seno do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "(Somente em GLES3) Retorna o seno hiperbólico do parâmetro." +msgid "Returns the hyperbolic sine of the parameter." +msgstr "Retorna o seno hiperbólico do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." msgstr "Retorna a raiz quadrada do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "SmoothStep function( scalar(edge0), scalar(edge1), scalar(x) ).\n" "\n" @@ -8380,24 +8406,35 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"Função SmoothStep( scalar(edge0), scalar(edge1), scalar(x) ).\n" +"\n" +"Retorna 0.0 se 'x' é menor que 'edge0' e 1.0 se 'x' é maior que 'edge1'. " +"Caso contrário o valor retornado é interpolado entre 0.0 e 1.0 utilizando " +"polinômios de Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Step function( scalar(edge), scalar(x) ).\n" "\n" "Returns 0.0 if 'x' is smaller then 'edge' and otherwise 1.0." msgstr "" +"Função Step( scalar(edge), scalar(x) ).\n" +"\n" +"Retorna 0.0 se 'x' é menor que 'edge' e 1.0 caso contrário." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the tangent of the parameter." msgstr "Retorna a tangente do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +#, fuzzy +msgid "Returns the hyperbolic tangent of the parameter." msgstr "(Somente em GLES3) Retorna a tangente hiperbólica do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +#, fuzzy +msgid "Finds the truncated value of the parameter." msgstr "(Somente em GLES3) Encontra o valor truncado do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8436,8 +8473,9 @@ msgid "Scalar uniform." msgstr "Alterar Uniforme Escalar" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Perform the cubic texture lookup." -msgstr "" +msgstr "Faça a pesquisa da textura cúbica." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the texture lookup." @@ -8445,12 +8483,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "Alterar Uniforme da Textura" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "Alterar Uniforme da Textura" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup with triplanar." msgstr "Alterar Uniforme da Textura" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8460,7 +8503,7 @@ msgstr "Diálogo Transformação..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8479,17 +8522,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "(Somente em GLES3) Calcula o determinante da transform." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "(Somente em GLES3) Calcula a inversa da transform." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "(Somente em GLES3) Calcula a transposta da transform." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8543,8 +8586,9 @@ msgid "Calculates the dot product of two vectors." msgstr "Calcula o produto escalar de dois vetores." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8576,15 +8620,17 @@ msgid "1.0 / vector" msgstr "1,0 / vetor" #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" "Retorna um vetor que aponta na direção da reflexão ( a: vetor incidente, b: " "vetor normal )." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +#, fuzzy +msgid "Returns the vector that points in the direction of refraction." msgstr "Retorna um vetor que aponta na direção da refração." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8663,47 +8709,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9942,6 +9988,11 @@ msgid "Extend Script" msgstr "Estender Script" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Reparentar Nó" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Fazer Raiz de Cena" @@ -10175,7 +10226,8 @@ msgid "Script is valid." msgstr "Script válido" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "Permitidos: a-z, A-Z, 0-9 e _" #: editor/script_create_dialog.cpp @@ -11868,6 +11920,11 @@ msgstr "Fonte inválida para o shader." msgid "Invalid source for shader." msgstr "Fonte inválida para o shader." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Fonte inválida para o shader." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Atribuição à função." @@ -11884,6 +11941,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 "Previous Folder" +#~ msgstr "Pasta Anterior" + +#~ msgid "Next Folder" +#~ msgstr "Próxima Pasta" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Abrir Capturas de Tela Automaticamente" + +#~ msgid "Open in an external image editor." +#~ msgstr "Abrir em um editor de imagens externo." + +#~ msgid "Reverse" +#~ msgstr "Reverso" + +#~ msgid "Mirror X" +#~ msgstr "Espelhar X" + +#~ msgid "Mirror Y" +#~ msgstr "Espelhar Y" + #~ msgid "Generating solution..." #~ msgstr "Gerando solução..." diff --git a/editor/translations/pt_PT.po b/editor/translations/pt_PT.po index 4bc53e53db..b223e41766 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-07-09 10:47+0000\n" +"PO-Revision-Date: 2019-07-29 19:20+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" @@ -139,6 +139,31 @@ msgid "Anim Change Call" msgstr "Anim Mudar Chamada" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Mudar Tempo do Keyframe" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim Mudar Transição" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Mudar Transformação" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Mudar Valor do Keyframe" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Mudar Chamada" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Mudar Duração da Animação" @@ -642,7 +667,7 @@ msgstr "Numero da linha:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Encontrada(s) %d correspondência(s)." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -800,9 +825,8 @@ msgid "Connect" msgstr "Ligar" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Sinais:" +msgstr "Sinal:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -967,9 +991,8 @@ msgid "Owners Of:" msgstr "Proprietários de:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "Remover arquivos selecionados do Projeto? (sem desfazer)" +msgstr "Remover arquivos selecionados do Projeto? (Sem desfazer)" #: editor/dependency_editor.cpp msgid "" @@ -1151,7 +1174,6 @@ msgid "Success!" msgstr "Sucesso!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Instalar" @@ -1522,6 +1544,7 @@ msgstr "Ficheiro Modelo não encontrado:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"Em exportações de 32 bits o PCK incorporado não pode ser maior do que 4 GiB." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1694,7 +1717,7 @@ msgstr "Mostrar no Gestor de Ficheiros" msgid "New Folder..." msgstr "Nova Diretoria..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Atualizar" @@ -1745,7 +1768,7 @@ msgstr "Avançar" msgid "Go Up" msgstr "Subir" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Alternar Ficheiros escondidos" @@ -1770,23 +1793,31 @@ msgid "Move Favorite Down" msgstr "Mover Favorito para Baixo" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Pasta Anterior" +#, fuzzy +msgid "Go to previous folder." +msgstr "Ir para a pasta acima." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Próxima Pasta" +#, fuzzy +msgid "Go to next folder." +msgstr "Ir para a pasta acima." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Ir para a pasta acima." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Procurar ficheiros" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "(Não) tornar favorita atual pasta." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Alternar visibilidade de ficheiros escondidos." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2518,6 +2549,10 @@ msgid "Go to previously opened scene." msgstr "Ir para Cena aberta anteriormente." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Copiar Texto" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Próxima guia" @@ -2728,14 +2763,6 @@ msgstr "" "Capturas do ecrã são armazenadas na pasta Dados/Configurações do Editor." #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "Abrir Capturas do ecrã automaticamente" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "Abrir num editor de imagem externo." - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Alternar Ecrã completo" @@ -3052,6 +3079,11 @@ msgstr "Tempo" msgid "Calls" msgstr "Chamadas" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Editar Tema" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "On" @@ -4715,6 +4747,10 @@ msgid "Idle" msgstr "Inativo" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "Instalar..." + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Repetir" @@ -4743,7 +4779,6 @@ msgid "Last" msgstr "Último" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Todos" @@ -4757,8 +4792,8 @@ msgid "Sort:" msgstr "Ordenar:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Inverter" +msgid "Reverse sorting." +msgstr "Inverter ordenação." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4837,32 +4872,32 @@ msgid "Rotation Step:" msgstr "Passo da rotação:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "Mover guia vertical" +msgid "Move Vertical Guide" +msgstr "Mover Guia Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "Criar nova guia vertical" +msgid "Create Vertical Guide" +msgstr "Criar Guia Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "Remover guia vertical" +msgid "Remove Vertical Guide" +msgstr "Remover Guia Vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "Mover guia horizontal" +msgid "Move Horizontal Guide" +msgstr "Mover Guia Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "Criar nova guia horizontal" +msgid "Create Horizontal Guide" +msgstr "Criar Guia Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "Remover guia horizontal" +msgid "Remove Horizontal Guide" +msgstr "Remover Guia Horizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "Criar guias horizontal e vertical" +msgid "Create Horizontal and Vertical Guides" +msgstr "Criar Guias Horizontais e Verticais" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -6445,7 +6480,7 @@ msgstr "Destaque de Sintaxe" #: editor/plugins/script_text_editor.cpp msgid "Go To" -msgstr "" +msgstr "Ir Para" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp @@ -6453,9 +6488,8 @@ msgid "Bookmarks" msgstr "Marcadores" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Criar pontos." +msgstr "Pontos de paragem" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6744,9 +6778,15 @@ msgid "Rear" msgstr "Trás" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "Alinhar com a Vista" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Alinhar seleção com vista" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Sem parente para criar instância de filho." @@ -6934,10 +6974,6 @@ msgid "Focus Selection" msgstr "Focar na seleção" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Alinhar seleção com vista" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Seleção de ferramenta" @@ -7498,14 +7534,6 @@ msgid "Transpose" msgstr "Transpor" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Espelho X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Espelho Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "Desativar Autotile" @@ -7901,6 +7929,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Alterado Tipo de Entrada do Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(Apenas GLES3)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Vértice" @@ -7985,6 +8017,22 @@ msgid "Color uniform." msgstr "Uniforme Cor." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Devolve o resultado lógico da comparação %s entre dois parâmetros." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "Igual (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "Maior Que (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "Maior ou Igual a (>=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7993,12 +8041,50 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" +"Devolve o resultado lógico da comparação entre INF e um parâmetro escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" +"Devolve o resultado lógico da comparação entre NaN e um parâmetro escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "Menor Que (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "Menor ou Igual a (<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "Diferente (!=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" "Devolve um vetor associado se o valor lógico fornecido for verdadeiro ou " "falso." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Devolve o resultado lógico da comparação entre dois parâmetros." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" +"Devolve o resultado lógico da comparação entre INF (ou NaN) e um parâmetro " +"escalar." + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "Constante Lógica." @@ -8087,16 +8173,16 @@ msgid "Returns the arc-cosine of the parameter." msgstr "Devolve o arco seno do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "(Apenas GLES3) Devolve o arco cosseno hiperbólico do parâmetro." +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "Devolve o arco cosseno hiperbólico do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." msgstr "Devolve o arco seno do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "(Apenas GLES3) Devolve o arco seno hiperbólico do parâmetro." +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "Devolve o arco seno hiperbólico do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." @@ -8107,8 +8193,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Devolve o arco tangente do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "(Apenas GLES3) Devolve o arco tangente hiperbólico do parâmetro." +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "Devolve o arco tangente hiperbólico do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8124,8 +8210,8 @@ msgid "Returns the cosine of the parameter." msgstr "Devolve o cosseno do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "(Apenas GLES3) Devolve o cosseno hiperbólico do parâmetro." +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "Devolve o cosseno hiperbólico do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." @@ -8193,12 +8279,12 @@ msgid "1.0 / scalar" msgstr "1.0 / escalar" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "(Apenas GLES3) Encontra o inteiro mais próximo do parâmetro." +msgid "Finds the nearest integer to the parameter." +msgstr "Encontra o inteiro mais próximo do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "(Apenas GLES3) Encontra o inteiro Ãmpar mais próximo do parâmetro." +msgid "Finds the nearest even integer to the parameter." +msgstr "Encontra o inteiro Ãmpar mais próximo do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." @@ -8213,8 +8299,8 @@ msgid "Returns the sine of the parameter." msgstr "Devolve o seno do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "(Apenas GLES3) Devolve o seno hiperbólico do parâmetro." +msgid "Returns the hyperbolic sine of the parameter." +msgstr "Devolve o seno hiperbólico do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." @@ -8249,12 +8335,12 @@ msgid "Returns the tangent of the parameter." msgstr "Devolve a tangente do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "(Apenas GLES3) Devolve a tangente hiperbólica do parâmetro." +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "Devolve a tangente hiperbólica do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "(Apenas GLES3) Encontra o valor truncado do parâmetro." +msgid "Finds the truncated value of the parameter." +msgstr "Encontra o valor truncado do parâmetro." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." @@ -8293,12 +8379,16 @@ msgid "Perform the texture lookup." msgstr "Executa texture lookup." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." -msgstr "Uniforme Textura Cúbica." +msgid "Cubic texture uniform lookup." +msgstr "Consulta uniforme de textura cúbica." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." +msgstr "Consulta uniforme de textura 2D." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." -msgstr "Uniforme Textura 2D." +msgid "2D texture uniform lookup with triplanar." +msgstr "Consulta uniforme de textura 2D com triplanar." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Transform function." @@ -8306,7 +8396,7 @@ msgstr "Função Transformação." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8314,7 +8404,7 @@ 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 "" -"(Apenas GLES3) Calcula o produto tensorial de um par de vetores.\n" +"Calcula o produto tensorial de um par de vetores.\n" "\n" "OuterProduct trata o primeiro parâmetro 'c' como um vetor coluna (matriz com " "uma coluna) e o segundo parâmetro 'r' como um vetor linha (matriz com uma " @@ -8331,16 +8421,16 @@ msgid "Decomposes transform to four vectors." msgstr "Decompõe transformação em quatro vetores." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "(Apenas GLES3) Calcula o determinante de uma transformação." +msgid "Calculates the determinant of a transform." +msgstr "Calcula o determinante de uma transformação." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "(Apenas GLES3) Calcula o inverso de uma transformação." +msgid "Calculates the inverse of a transform." +msgstr "Calcula o inverso de uma transformação." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "(Apenas GLES3) Calcula a transposta de uma transformação." +msgid "Calculates the transpose of a transform." +msgstr "Calcula a transposta de uma transformação." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." @@ -8388,7 +8478,7 @@ msgstr "Calcula o produto escalar de dois vetores." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8420,14 +8510,14 @@ msgstr "1.0 / vetor" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" "Devolve um vetor que aponta na direção da reflexão ( a : vetor incidente, " "b : vetor normal )." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "Devolve um vetor que aponta na direção da refração." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8526,60 +8616,57 @@ msgstr "" "da câmara (passa entradas associadas)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "(Apenas GLES3) (apenas modo Fragment/Light) Função derivada escalar." +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(Apenas modo Fragment/Light) Função derivada escalar." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "(Apenas GLES3) (apenas modo Fragment/Light) Função derivada vetorial." +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(Apenas modo Fragment/Light) Função derivada vetorial." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." -msgstr "" -"(Apenas GLES3) (apenas modo Fragment/Light) Derivação em 'x' usando " -"derivação local." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." +msgstr "(Apenas modo Fragment/Light) Derivada em 'x' usando derivação local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" -"(Apenas GLES3) (apenas modo Fragment/Light) (Escalar) Derivação em 'x' " -"usando derivação local." +"(Apenas modo Fragment/Light) (Escalar) Derivada em 'x' usando derivação " +"local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" -"(Apenas GLES3) (apenas modo Fragment/Light) (Vetor) Derivação em 'y' usando " -"derivação local." +"(Apenas modo Fragment/Light) (Vetor) Derivada em 'y' usando derivação local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" -"(Apenas GLES3) (apenas modo Fragment/Light) (Escalar) Derivação em 'y' " -"usando derivação local." +"(Apenas modo Fragment/Light) (Escalar) Derivada em 'y' usando derivação " +"local." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(Apenas GLES3) (apenas modo Fragment/Light) (Vetor) Soma das derivadas " -"absolutas em 'x' e 'y'." +"(Apenas modo Fragment/Light) (Vetor) Soma das derivadas absolutas em 'x' e " +"'y'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(Apenas GLES3) (apenas modo Fragment/Light) (Escalar) Soma das derivadas " -"absolutas em 'x' e 'y'." +"(Apenas modo Fragment/Light) (Escalar) Soma das derivadas absolutas em 'x' e " +"'y'." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -9803,6 +9890,11 @@ msgid "Extend Script" msgstr "Estender Script" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Recolocar Nó" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Tornar Nó Raiz" @@ -10019,8 +10111,8 @@ msgid "Script is valid." msgstr "Script é válido." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" -msgstr "Permitido: a-z, A-Z, 0-9 e _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." +msgstr "Permitido: a-z, A-Z, 0-9, _ e ." #: editor/script_create_dialog.cpp msgid "Built-in script (into scene file)." @@ -11090,13 +11182,12 @@ msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "Dimensões inválidas da imagem do ecrã inicial (deve ser 620x300)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." msgstr "" -"Um recurso SpriteFrames tem de ser criado ou definido na Propriedade " -"'Frames' para que AnimatedSprite mostre Frames." +"Um recurso SpriteFrames tem de ser criado ou definido na Propriedade \"Frames" +"\" para que AnimatedSprite mostre frames." #: scene/2d/canvas_modulate.cpp msgid "" @@ -11159,13 +11250,12 @@ msgstr "" "\"Particles Animation\" ativada." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." msgstr "" "Uma textura com a forma da luz tem de ser disponibilizada na Propriedade " -"'textura'." +"\"Textura\"." #: scene/2d/light_occluder_2d.cpp msgid "" @@ -11175,9 +11265,8 @@ msgstr "" "efeito." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." -msgstr "O PolÃgono oclusor deste Oclusor está vazio. Desenhe um PolÃgono!" +msgstr "O polÃgono oclusor deste oclusor está vazio. Desenhe um polÃgono." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11273,18 +11362,16 @@ msgstr "" "KinematicBody2D, etc. para lhes dar uma forma." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." msgstr "" -"VisibilityEnable2D funciona melhor quando usado diretamente como parente na " +"VisibilityEnabler2D funciona melhor quando usado diretamente como parente na " "Cena raiz editada." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera precisa de um Nó ARVROrigin como parente" +msgstr "ARVRCamera precisa de um Nó ARVROrigin como parente." #: scene/3d/arvr_nodes.cpp msgid "ARVRController must have an ARVROrigin node as its parent." @@ -11374,13 +11461,12 @@ msgstr "" "RigidBody, KinematicBody, etc. para lhes dar uma forma." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" "Uma forma tem de ser fornecida para CollisionShape funcionar. Crie um " -"recurso forma!" +"recurso forma." #: scene/3d/collision_shape.cpp msgid "" @@ -11416,7 +11502,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." -msgstr "" +msgstr "Uma SpotLight com ângulo superior a 90 graus não cria sombras." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11461,13 +11547,12 @@ msgid "PathFollow only works when set as a child of a Path node." msgstr "PathFollow apenas funciona quando definido como filho de um Nó Path." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED requer \"Up Vector\" habilitado no recurso de " -"Curva do Caminho do seu pai." +"ROTATION_ORIENTED de PathFollow requer \"Up Vector\" habilitado no recurso " +"de Curva do Caminho do seu pai." #: scene/3d/physics_body.cpp msgid "" @@ -11480,13 +11565,12 @@ msgstr "" "Mude antes o tamanho das formas de colisão filhas." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." msgstr "" -"Para funcionar, a Propriedade Caminho tem de apontar para um Nó Spatial " -"válido." +"Para funcionar, a Propriedade \"Caminho Remoto\" tem de apontar para um Nó " +"Spatial válido ou seu derivado." #: scene/3d/soft_body.cpp msgid "This body will be ignored until you set a mesh." @@ -11503,13 +11587,12 @@ msgstr "" "Em vez disso, mude o tamanho das formas de colisão filhas." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" -"Um recurso SpriteFrames tem de ser criado ou definido na Propriedade " -"'Frames' de forma a que AnimatedSprite3D mostre frames." +"Um recurso SpriteFrames tem de ser criado ou definido na Propriedade \"Frames" +"\" de forma a que AnimatedSprite3D mostre frames." #: scene/3d/vehicle_body.cpp msgid "" @@ -11524,6 +11607,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"WorldEnvironment exige que a sua propriedade \"Ambiente\" contenha um " +"Ambiente para obter efeitos visÃveis." #: scene/3d/world_environment.cpp msgid "" @@ -11561,9 +11646,8 @@ msgid "Nothing connected to input '%s' of node '%s'." msgstr "Nada conectado à entrada '%s' do nó '%s'." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." -msgstr "Não foi definida um AnimationNode raiz para o gráfico." +msgstr "Não foi definida uma raÃz AnimationNode para o gráfico." #: scene/animation/animation_tree.cpp msgid "Path to an AnimationPlayer node containing animations is not set." @@ -11576,9 +11660,8 @@ msgstr "" "O caminho definido para AnimationPlayer não conduz a um nó AnimationPlayer." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." -msgstr "A raiz de AnimationPlayer não é um nó válido." +msgstr "O Nó raiz de AnimationPlayer não é um Nó válido." #: scene/animation/animation_tree_player.cpp msgid "This node has been deprecated. Use AnimationTree instead." @@ -11605,7 +11688,6 @@ msgid "Add current color as a preset." msgstr "Adicionar cor atual como predefinição." #: scene/gui/container.cpp -#, fuzzy msgid "" "Container by itself serves no purpose unless a script configures its " "children placement behavior.\n" @@ -11613,7 +11695,7 @@ msgid "" msgstr "" "Por si só um Contentor não tem utilidade, a não ser que um script configure " "a disposição dos seu filhos.\n" -"Se não pretende adicionar um script, use antes um simples Nó 'Control'." +"Se não pretende adicionar um script, use antes um simples Nó Control." #: scene/gui/control.cpp msgid "" @@ -11633,30 +11715,27 @@ msgid "Please Confirm..." msgstr "Confirme por favor..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " "running." msgstr "" "Popups estão escondidas por defeito a não ser que chame popup() ou qualquer " -"das funções popup*(). Torná-las visÃveis para edição é aceitável, mas serão " -"escondidas na execução." +"das funções popup*(). Torná-las visÃveis para edição é aceitável, mas " +"estarão escondidas na execução." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "Se exp_edit é verdadeiro min_value tem de ser > 0." +msgstr "Se \"Exp Edit\" está ativado, \"Min Value\" tem de ser maior que 0." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " "minimum size manually." msgstr "" -"ScrollContainer está destinado a funcionar com um único controlo filho.\n" -"Use um contentor como filho (VBox,HBox,etc), um um Control e defina o " +"ScrollContainer deve ser usado com um único controlo filho.\n" +"Use um contentor como filho (VBox, HBox, etc.), ou um Control e defina o " "tamanho mÃnimo manualmente." #: scene/gui/tree.cpp @@ -11704,14 +11783,17 @@ msgid "Input" msgstr "Entrada" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "Fonte inválida para Shader." +msgstr "Fonte inválida para previsualização." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "Fonte inválida para Shader." +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "Função de comparação inválida para este tipo." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Atribuição a função." @@ -11728,6 +11810,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 "Previous Folder" +#~ msgstr "Pasta Anterior" + +#~ msgid "Next Folder" +#~ msgstr "Próxima Pasta" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Abrir Capturas do ecrã automaticamente" + +#~ msgid "Open in an external image editor." +#~ msgstr "Abrir num editor de imagem externo." + +#~ msgid "Reverse" +#~ msgstr "Inverter" + +#~ msgid "Mirror X" +#~ msgstr "Espelho X" + +#~ msgid "Mirror Y" +#~ msgstr "Espelho Y" + #~ msgid "Generating solution..." #~ msgstr "A gerar soluções..." diff --git a/editor/translations/ro.po b/editor/translations/ro.po index b204bf19fd..efb7ff3a4c 100644 --- a/editor/translations/ro.po +++ b/editor/translations/ro.po @@ -136,6 +136,31 @@ msgstr "Anim Schimbare apelare" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim SchimbaÈ›i Timpul Cadru Cheie" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim SchimbaÈ›i TranziÈ›ie" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Schimbare transformare" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Schimbare valoare cadre cheie" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Schimbare apelare" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "Schimbă Numele AnimaÈ›iei:" @@ -1183,7 +1208,6 @@ msgid "Success!" msgstr "Succes!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "InstalaÈ›i" @@ -1756,7 +1780,7 @@ msgstr "ArătaÈ›i în Administratorul de FiÈ™iere" msgid "New Folder..." msgstr "Director Nou..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "ReîmprospătaÈ›i" @@ -1807,7 +1831,7 @@ msgstr "ÃŽnainte" msgid "Go Up" msgstr "Sus" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "ComutaÈ›i FiÈ™iere Ascunse" @@ -1833,27 +1857,32 @@ msgstr "DeplasaÈ›i Favorit Jos" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "Fila anterioară" +msgid "Go to previous folder." +msgstr "AccesaÈ›i Directorul Părinte" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "CreaÈ›i Director" +msgid "Go to next folder." +msgstr "AccesaÈ›i Directorul Părinte" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "AccesaÈ›i Directorul Părinte" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Căutare Clase" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "Directorul nu a putut fi creat." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "ComutaÈ›i FiÈ™iere Ascunse" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2611,6 +2640,11 @@ msgid "Go to previously opened scene." msgstr "Mergi la o scenă deschisă anterior." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "CopiaÅ£i Calea" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Fila următoare" @@ -2825,15 +2859,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Setări ale Editorului" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Deschide Editorul următor" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Comută în Ecran Complet" @@ -3159,6 +3184,11 @@ msgstr "Timp" msgid "Calls" msgstr "Apeluri" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Membri" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4896,6 +4926,11 @@ msgid "Idle" msgstr "Inactiv" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "InstalaÈ›i" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Reîncearcă" @@ -4927,7 +4962,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Toate" @@ -4941,8 +4975,9 @@ msgid "Sort:" msgstr "Sorare:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Revers" +#, fuzzy +msgid "Reverse sorting." +msgstr "Se Solicită..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -5023,31 +5058,38 @@ msgid "Rotation Step:" msgstr "Pas RotaÈ›ie:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Mută ghidul vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Creează un nou ghid vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Elimină ghidul vertical" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Mută ghidul orizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Creează un nou ghid orizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Elimină ghidul orizontal" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Creează ghizi noi orizontal È™i vertical" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -7017,7 +7059,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7206,10 +7252,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7800,14 +7842,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8238,6 +8272,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8329,6 +8367,22 @@ msgid "Color uniform." msgstr "Anim Schimbare transformare" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8336,10 +8390,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8431,7 +8519,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8439,7 +8527,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8451,7 +8539,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8468,7 +8556,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8537,11 +8625,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8557,7 +8645,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8585,11 +8673,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8630,11 +8718,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8644,7 +8736,7 @@ msgstr "Crează Poligon" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8662,15 +8754,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8722,7 +8814,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8750,12 +8842,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8832,47 +8924,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10068,6 +10160,11 @@ msgstr "Execută Scriptul" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "CreaÈ›i %s Nou" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Salvează Scena" @@ -10285,7 +10382,7 @@ msgid "Script is valid." msgstr "Arborele AnimaÈ›iei este valid." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11833,6 +11930,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11849,6 +11950,21 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "Fila anterioară" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "CreaÈ›i Director" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Deschide Editorul următor" + +#~ msgid "Reverse" +#~ msgstr "Revers" + #~ msgid "View log" #~ msgstr "Vizualizează fiÈ™iere log" diff --git a/editor/translations/ru.po b/editor/translations/ru.po index a3e64f65b0..24fb5100bb 100644 --- a/editor/translations/ru.po +++ b/editor/translations/ru.po @@ -51,12 +51,14 @@ # Teashrock <kajitsu22@gmail.com>, 2019. # Дмитрий Ефимов <daefimov@gmail.com>, 2019. # Sergey <www.window1@mail.ru>, 2019. +# Vladislav <onion.ring@mail.ru>, 2019. +# knightpp <kotteam99@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-09 10:46+0000\n" -"Last-Translator: Sergey <www.window1@mail.ru>\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" +"Last-Translator: knightpp <kotteam99@gmail.com>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot/ru/>\n" "Language: ru\n" @@ -177,6 +179,31 @@ msgid "Anim Change Call" msgstr "Изменить вызов анимации" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Изменить Ð²Ñ€ÐµÐ¼Ñ ÐºÐ»ÑŽÑ‡ÐµÐ²Ð¾Ð³Ð¾ кадра" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Изменить переход" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Изменить положение" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Измененить значение ключевого кадра" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Изменить вызов анимации" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Изменить длину анимации" @@ -482,7 +509,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Warning: Editing imported animation" -msgstr "" +msgstr "Внимание: Редактирование импортированной анимации. " #: editor/animation_track_editor.cpp editor/plugins/script_text_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp @@ -502,9 +529,8 @@ msgid "Group tracks by node or display them as plain list." msgstr "Группировать треки по узлам или показывать их как проÑтой ÑпиÑок." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Snap:" -msgstr "ПривÑзка" +msgstr "ПривÑзка:" #: editor/animation_track_editor.cpp msgid "Animation step value." @@ -670,7 +696,7 @@ msgstr "Ðомер Ñтроки:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Ðайдено %d Ñовпадений." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -755,9 +781,8 @@ msgid "From Signal:" msgstr "Сигналы:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Scene does not contain any script." -msgstr "Узел не Ñодержит геометрии." +msgstr "Узел не Ñодержит Ñкрипт." #: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp @@ -797,6 +822,8 @@ msgstr "Отложенное" msgid "" "Defers the signal, storing it in a queue and only firing it at idle time." msgstr "" +"Откладывает Ñигнал, Ñ…Ñ€Ð°Ð½Ñ ÐµÐ³Ð¾ в очереди и выполнÑет его только в режиме " +"проÑтоÑ." #: editor/connections_dialog.cpp msgid "Oneshot" @@ -855,9 +882,8 @@ msgid "Disconnect" msgstr "ОтÑоединить" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect a Signal to a Method" -msgstr "Подключить Ñигнал: " +msgstr "Подключить Сигнал к Методу: " #: editor/connections_dialog.cpp msgid "Edit Connection:" @@ -1180,7 +1206,6 @@ msgid "Success!" msgstr "УÑпех!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "УÑтановить" @@ -1307,7 +1332,7 @@ msgstr "Открыть раÑкладку звуковой шины" #: editor/editor_audio_buses.cpp msgid "There is no '%s' file." -msgstr "" +msgstr "Файла '%s' не ÑущеÑтвует." #: editor/editor_audio_buses.cpp editor/plugins/canvas_item_editor_plugin.cpp msgid "Layout" @@ -1376,8 +1401,9 @@ msgid "Must not collide with an existing global constant name." msgstr "Ðе должно конфликтовать Ñ ÑущеÑтвующим глобальным именем конÑтанты." #: editor/editor_autoload_settings.cpp +#, fuzzy msgid "Keyword cannot be used as an autoload name." -msgstr "" +msgstr "Ключевое Ñлово Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать как Ð¸Ð¼Ñ Ð°Ð²Ñ‚Ð¾Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸." #: editor/editor_autoload_settings.cpp msgid "Autoload '%s' already exists!" @@ -1462,9 +1488,8 @@ msgid "[unsaved]" msgstr "[не Ñохранено]" #: editor/editor_dir_dialog.cpp -#, fuzzy msgid "Please select a base directory first." -msgstr "ПожалуйÑта, выберите базовый каталог" +msgstr "ПожалуйÑта, выберите базовый каталог." #: editor/editor_dir_dialog.cpp msgid "Choose a Directory" @@ -1550,6 +1575,7 @@ msgstr "Файл шаблона не найден:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"Ðа 32-Ñ… битных ÑиÑтемах вÑтроенный PCK файл не может быть больше 4 Гбит." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1592,6 +1618,7 @@ msgstr "Заменить вÑÑ‘ (без возможноÑти отмены)" #: editor/editor_feature_profile.cpp msgid "Profile must be a valid filename and must not contain '.'" msgstr "" +"Ðазвание Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ Ð´Ð¾Ð»Ð¶Ð½Ð¾ быть корректным именем файла и не Ñодержать '.'" #: editor/editor_feature_profile.cpp msgid "Profile with this name already exists." @@ -1646,6 +1673,7 @@ msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." msgstr "" +"Профиль '%s' уже ÑущеÑтвует. Удалите его перед импортом, импорт отменен." #: editor/editor_feature_profile.cpp #, fuzzy @@ -1654,7 +1682,7 @@ msgstr "Ошибка при загрузке шаблона '%s'" #: editor/editor_feature_profile.cpp msgid "Unset" -msgstr "" +msgstr "СброÑить" #: editor/editor_feature_profile.cpp #, fuzzy @@ -1745,7 +1773,7 @@ msgstr "ПроÑмотреть в проводнике" msgid "New Folder..." msgstr "ÐÐ¾Ð²Ð°Ñ Ð¿Ð°Ð¿ÐºÐ°..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Обновить" @@ -1796,7 +1824,7 @@ msgstr "Вперёд" msgid "Go Up" msgstr "Вверх" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Скрыть файлы" @@ -1821,24 +1849,31 @@ msgid "Move Favorite Down" msgstr "ПеремеÑтить избранное вниз" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "ÐŸÑ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰Ð°Ñ Ð¿Ð°Ð¿ÐºÐ°" +#, fuzzy +msgid "Go to previous folder." +msgstr "Перейти к родительÑкой папке." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Ð¡Ð»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð¿Ð°Ð¿ÐºÐ°" +#, fuzzy +msgid "Go to next folder." +msgstr "Перейти к родительÑкой папке." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Перейти к родительÑкой папке." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "ПоиÑк файлов" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Добавить или удалить текущую папку из избранных." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Скрыть файлы" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2419,8 +2454,8 @@ msgid "" "Unable to load addon script from path: '%s' There seems to be an error in " "the code, please check the syntax." msgstr "" -"Ðевозможно загрузить Ñкрипт аддона из иÑточника: '%s' Ð’ коде еÑть " -"ошибка. ПожалуйÑта, проверьте ÑинтакÑиÑ." +"Ðевозможно загрузить Ñкрипт аддона из иÑточника: '%s' Ð’ коде еÑть ошибка. " +"ПожалуйÑта, проверьте ÑинтакÑиÑ." #: editor/editor_node.cpp msgid "" @@ -2522,7 +2557,7 @@ msgstr "Закрыть другие вкладки" #: editor/editor_node.cpp msgid "Close Tabs to the Right" -msgstr "" +msgstr "Закрыть вкладки Ñправа" #: editor/editor_node.cpp #, fuzzy @@ -2570,6 +2605,11 @@ msgid "Go to previously opened scene." msgstr "Перейти к предыдущей открытой Ñцене." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Копировать путь" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Ð¡Ð»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð²ÐºÐ»Ð°Ð´ÐºÐ°" @@ -2661,7 +2701,7 @@ msgstr "Открыть папку Ñ Ð´Ð°Ð½Ð½Ñ‹Ð¼Ð¸ проекта" #: editor/editor_node.cpp msgid "Install Android Build Template" -msgstr "" +msgstr "УÑтановить шаблон Ñборки Android" #: editor/editor_node.cpp msgid "Quit to Project List" @@ -2782,15 +2822,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Открыть папку Данные/ÐаÑтройки редактора" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Открыть Ñледующий редактор" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Переключить полноÑкранный режим" @@ -2948,6 +2979,8 @@ msgstr "Ðе ÑохранÑть" #: editor/editor_node.cpp msgid "Android build template is missing, please install relevant templates." msgstr "" +"Шаблон Ñборки Android отÑутÑтвует, пожалуйÑта, уÑтановите ÑоответÑтвующие " +"шаблоны." #: editor/editor_node.cpp #, fuzzy @@ -3109,6 +3142,11 @@ msgstr "ВремÑ" msgid "Calls" msgstr "Вызовы" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Редактировать тему..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Вкл" @@ -4786,6 +4824,11 @@ msgid "Idle" msgstr "ПроÑтой" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "УÑтановить" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Повторить" @@ -4814,7 +4857,6 @@ msgid "Last" msgstr "ПоÑледнÑÑ" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Ð’Ñе" @@ -4828,8 +4870,9 @@ msgid "Sort:" msgstr "Сортировать:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Обратно" +#, fuzzy +msgid "Reverse sorting." +msgstr "Запрашиваю..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4909,31 +4952,38 @@ msgid "Rotation Step:" msgstr "Шаг поворота:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Перемещение вертикальной направлÑющей" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Создать вертикальную направлÑющую" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Убрать вертикальную направлÑющую" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "ПеремеÑтить горизонтальную направлÑющую" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Создать новую горизонтальную направлÑющую" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Удалить горизонтальную направлÑющую" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Создание новых горизонтальных и вертикальных направлÑющих" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6866,9 +6916,14 @@ msgstr "Зад" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" msgstr "ВыравнÑть Ñ Ð¾Ð±Ð»Ð°Ñтью проÑмотра" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "СовмеÑтить выбранное Ñ Ð²Ð¸Ð´Ð¾Ð¼" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Ðе выбран родитель Ð´Ð»Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¾Ñ‚Ð¾Ð¼ÐºÐ°." @@ -7059,10 +7114,6 @@ msgid "Focus Selection" msgstr "Показать выбранное" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "СовмеÑтить выбранное Ñ Ð²Ð¸Ð´Ð¾Ð¼" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "ИнÑтрумент выбора" @@ -7650,14 +7701,6 @@ msgid "Transpose" msgstr "ТранÑпонировать" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Зеркально по X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Зеркально по Y" - -#: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy msgid "Disable Autotile" msgstr "Ðвтотайлы" @@ -8080,6 +8123,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Изменен тип ввода Визуального Шейдера" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Вершины" @@ -8171,6 +8218,22 @@ msgid "Color uniform." msgstr "ОчиÑтить преобразование" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8178,10 +8241,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." msgstr "Изменить векторную конÑтанту" @@ -8274,7 +8371,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8282,7 +8379,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8294,7 +8391,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8311,7 +8408,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8380,11 +8477,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8400,7 +8497,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8428,11 +8525,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8475,12 +8572,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "Изменить текÑтурную единицу" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup." msgstr "Изменить текÑтурную единицу" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "Изменить текÑтурную единицу" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8490,7 +8592,7 @@ msgstr "Окно преобразованиÑ..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8508,15 +8610,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8569,7 +8671,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8597,12 +8699,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8681,47 +8783,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9964,6 +10066,11 @@ msgid "Extend Script" msgstr "РаÑширить Ñкрипт" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Переподчинить узел" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Создать корневой узел Ñцены" @@ -10197,7 +10304,8 @@ msgid "Script is valid." msgstr "Скрипт корректен" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "ДопуÑкаютÑÑ: a-z, A-Z, 0-9 и _" #: editor/script_create_dialog.cpp @@ -11885,6 +11993,11 @@ msgstr "ÐедейÑтвительный иÑточник шейдера." msgid "Invalid source for shader." msgstr "ÐедейÑтвительный иÑточник шейдера." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "ÐедейÑтвительный иÑточник шейдера." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "Ðазначение функции." @@ -11901,6 +12014,28 @@ msgstr "Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð³ÑƒÑ‚ быть назначены только Ð msgid "Constants cannot be modified." msgstr "КонÑтанты не могут быть изменены." +#~ msgid "Previous Folder" +#~ msgstr "ÐŸÑ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰Ð°Ñ Ð¿Ð°Ð¿ÐºÐ°" + +#~ msgid "Next Folder" +#~ msgstr "Ð¡Ð»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð¿Ð°Ð¿ÐºÐ°" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "ÐвтоматичеÑки открывать Ñкриншоты" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Открыть Ñледующий редактор" + +#~ msgid "Reverse" +#~ msgstr "Обратно" + +#~ msgid "Mirror X" +#~ msgstr "Зеркально по X" + +#~ msgid "Mirror Y" +#~ msgstr "Зеркально по Y" + #~ msgid "Generating solution..." #~ msgstr "Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñ€ÐµÑˆÐµÐ½Ð¸Ñ..." diff --git a/editor/translations/si.po b/editor/translations/si.po index 3f62079f19..68f2b09028 100644 --- a/editor/translations/si.po +++ b/editor/translations/si.po @@ -128,6 +128,31 @@ msgstr "Anim à¶šà·à¶¯à·€à·“ම් වෙනස් කරන්න" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim කීෆ්â€à¶»à·šà¶¸à·Š à¶šà·à¶½à¶º වෙනස් කරන්න" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim සංක්රමණය වෙනස් කරන්න" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim පරිවර්à¶à¶±à¶º වෙනස් කරන්න" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim කීෆ්â€à¶»à·šà¶¸à·Š අගය වෙනස් කරන්න" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim à¶šà·à¶¯à·€à·“ම් වෙනස් කරන්න" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "සජීවීකරණ පුනරà·à·€à¶»à·Šà¶®à¶±à¶º" @@ -1120,7 +1145,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1653,7 +1677,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1704,7 +1728,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1729,23 +1753,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2420,6 +2448,10 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2611,14 +2643,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2932,6 +2956,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4560,6 +4588,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4588,7 +4620,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4602,7 +4633,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4677,31 +4708,33 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "à·ƒà·à¶¯à¶±à·Šà¶±" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "මෙම ලුහුබදින්න෠ඉවà¶à·Š කරන්න." #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6564,7 +6597,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6749,10 +6786,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7317,14 +7350,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7711,6 +7736,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7797,6 +7826,22 @@ msgid "Color uniform." msgstr "Anim පරිවර්à¶à¶±à¶º වෙනස් කරන්න" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7804,10 +7849,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7896,7 +7975,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7904,7 +7983,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7916,7 +7995,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7933,7 +8012,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8002,11 +8081,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8022,7 +8101,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8050,11 +8129,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8095,11 +8174,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8108,7 +8191,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8126,15 +8209,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8185,7 +8268,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8213,12 +8296,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8295,47 +8378,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9487,6 +9570,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9689,7 +9776,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11208,6 +11295,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/sk.po b/editor/translations/sk.po index aeef25389e..bed5a879ef 100644 --- a/editor/translations/sk.po +++ b/editor/translations/sk.po @@ -134,6 +134,31 @@ msgid "Anim Change Call" msgstr "Animácia ZmeniÅ¥ Hovor" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Animácia ZmeniÅ¥ Keyframe ÄŒas" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animácia zmeniÅ¥ prechod" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animácia zmeniÅ¥ prechod" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Animácia ZmeniÅ¥ Keyframe Hodnotu" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animácia ZmeniÅ¥ Hovor" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "ZmeniÅ¥ Dĺžku Animácie" @@ -1146,7 +1171,6 @@ msgid "Success!" msgstr "Úspech!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "InÅ¡talovaÅ¥" @@ -1697,7 +1721,7 @@ msgstr "OtvoriÅ¥ súbor" msgid "New Folder..." msgstr "VytvoriÅ¥ adresár" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1748,7 +1772,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1774,12 +1798,12 @@ msgstr "" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "VytvoriÅ¥ adresár" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" +msgid "Go to next folder." msgstr "VytvoriÅ¥ adresár" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp @@ -1787,12 +1811,16 @@ msgstr "VytvoriÅ¥ adresár" msgid "Go to parent folder." msgstr "VytvoriÅ¥ adresár" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2487,6 +2515,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "KopÃrovaÅ¥" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2679,14 +2712,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -3006,6 +3031,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Súbor:" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4678,6 +4708,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "InÅ¡talovaÅ¥" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4706,7 +4741,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4720,7 +4754,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4795,35 +4829,39 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "" +#, fuzzy +msgid "Move Vertical Guide" +msgstr "Popis:" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "Popis:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "VÅ¡etky vybrané" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "" +#, fuzzy +msgid "Move Horizontal Guide" +msgstr "VÅ¡etky vybrané" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "Popis:" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "VÅ¡etky vybrané" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" +msgstr "Popis:" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -6734,7 +6772,12 @@ msgstr "" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" +msgstr "VÅ¡etky vybrané" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" msgstr "VÅ¡etky vybrané" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6922,11 +6965,6 @@ msgstr "VÅ¡etky vybrané" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align Selection With View" -msgstr "VÅ¡etky vybrané" - -#: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Tool Select" msgstr "VÅ¡etky vybrané" @@ -7508,14 +7546,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7934,6 +7964,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8022,6 +8056,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8029,10 +8079,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8122,7 +8206,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8130,7 +8214,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8142,7 +8226,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8159,7 +8243,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8228,11 +8312,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8248,7 +8332,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8276,11 +8360,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8320,11 +8404,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8334,7 +8422,7 @@ msgstr "VytvoriÅ¥ adresár" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8352,15 +8440,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8412,7 +8500,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8440,12 +8528,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8522,47 +8610,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9733,6 +9821,11 @@ msgid "Extend Script" msgstr "Popis:" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "VytvoriÅ¥ adresár" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9945,7 +10038,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11512,6 +11605,11 @@ msgstr "Nesprávna veľkosÅ¥ pÃsma." msgid "Invalid source for shader." msgstr "Nesprávna veľkosÅ¥ pÃsma." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Nesprávna veľkosÅ¥ pÃsma." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11529,6 +11627,14 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "VytvoriÅ¥ adresár" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "VytvoriÅ¥ adresár" + +#, fuzzy #~ msgid "View log" #~ msgstr "Súbor:" diff --git a/editor/translations/sl.po b/editor/translations/sl.po index 673ed15421..3a098b5971 100644 --- a/editor/translations/sl.po +++ b/editor/translations/sl.po @@ -141,6 +141,31 @@ msgstr "Animacija Spremeni klic" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Animacija Spremeni Äas kljuÄne slike" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animacija Spremeni prehod" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animacija Spremeni transformacijo" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Animacija Spremeni vrednost kljuÄne slike" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animacija Spremeni klic" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "Spremeni Ime Animacije:" @@ -1184,7 +1209,6 @@ msgid "Success!" msgstr "Uspelo je!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Namesti" @@ -1753,7 +1777,7 @@ msgstr "Pokaži V Upravitelju Datotek" msgid "New Folder..." msgstr "Nova Mapa..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Osveži" @@ -1804,7 +1828,7 @@ msgstr "Pojdi Naprej" msgid "Go Up" msgstr "Pojdi Navzgor" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Preklopi na Skrite Datoteke" @@ -1830,27 +1854,32 @@ msgstr "Premakni Priljubljeno Navzdol" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "PrejÅ¡nji zavihek" +msgid "Go to previous folder." +msgstr "Pojdi v nadrejeno mapo" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Ustvarite Mapo" +msgid "Go to next folder." +msgstr "Pojdi v nadrejeno mapo" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "Pojdi v nadrejeno mapo" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "IÅ¡Äi Razrede" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "Mape ni mogoÄe ustvariti." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Preklopi na Skrite Datoteke" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2598,6 +2627,11 @@ msgid "Go to previously opened scene." msgstr "Pojdi na predhodno odprti prizor." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Kopiraj Pot" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Naslednji zavihek" @@ -2810,15 +2844,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Nastavitve Urejevalnika" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Odpri naslednji Urejevalnik" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Preklopi na Celozaslonski NaÄin" @@ -3145,6 +3170,11 @@ msgstr "ÄŒas" msgid "Calls" msgstr "Klici" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "ÄŒlani" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4882,6 +4912,11 @@ msgid "Idle" msgstr "Nedejaven" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Namesti" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Ponovi" @@ -4913,7 +4948,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Vse" @@ -4927,8 +4961,9 @@ msgid "Sort:" msgstr "Razvrsti:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Obrni" +#, fuzzy +msgid "Reverse sorting." +msgstr "Zahtevam..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -5008,31 +5043,38 @@ msgid "Rotation Step:" msgstr "Rotacijski Korak:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Premakni navpiÄni vodnik" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Ustvari nov navpiÄni vodnik" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Odstranite navpiÄni vodnik" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Premakni vodoravni vodnik" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Ustvari nov vodoravni vodnik" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Odstrani vodoravni vodnik" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Ustvari nov vodoravni in navpiÄni vodnik" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6989,7 +7031,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7179,10 +7225,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Izbira Orodja" @@ -7769,14 +7811,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8210,6 +8244,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8301,6 +8339,22 @@ msgid "Color uniform." msgstr "Preoblikovanje" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8308,10 +8362,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8402,7 +8490,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8410,7 +8498,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8422,7 +8510,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8439,7 +8527,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8508,11 +8596,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8528,7 +8616,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8556,11 +8644,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8601,11 +8689,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8615,7 +8707,7 @@ msgstr "Preoblikovanje Dialoga..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8633,15 +8725,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8693,7 +8785,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8721,12 +8813,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8803,47 +8895,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10035,6 +10127,11 @@ msgstr "Zaženi Skripto" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Ustvari Nov %s" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Shrani Prizor" @@ -10254,7 +10351,7 @@ msgid "Script is valid." msgstr "Drevo animacije je veljavno." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11842,6 +11939,11 @@ msgstr "Neveljaven vir za shader." msgid "Invalid source for shader." msgstr "Neveljaven vir za shader." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Neveljaven vir za shader." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11859,6 +11961,21 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "PrejÅ¡nji zavihek" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Ustvarite Mapo" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Odpri naslednji Urejevalnik" + +#~ msgid "Reverse" +#~ msgstr "Obrni" + +#, fuzzy #~ msgid "View log" #~ msgstr "Ogled datotek" diff --git a/editor/translations/sq.po b/editor/translations/sq.po index f798e780cb..fa9f6075e3 100644 --- a/editor/translations/sq.po +++ b/editor/translations/sq.po @@ -130,6 +130,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Ndrysho Gjatësin e Animacionit" @@ -1133,7 +1153,6 @@ msgid "Success!" msgstr "Sukses!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Instalo" @@ -1703,7 +1722,7 @@ msgstr "Shfaq në Menaxherin e Skedarëve" msgid "New Folder..." msgstr "Folder i Ri..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Rifresko" @@ -1754,7 +1773,7 @@ msgstr "Shko Përpara" msgid "Go Up" msgstr "Shko Lartë" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Ndrysho Skedarët e Fshehur" @@ -1779,24 +1798,31 @@ msgid "Move Favorite Down" msgstr "Lëviz të Preferuarën Poshtë" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Folderi i Mëparshëm" +#, fuzzy +msgid "Go to previous folder." +msgstr "Shko te folderi prind" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Folderi Tjetër" +#, fuzzy +msgid "Go to next folder." +msgstr "Shko te folderi prind" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Kërko skedarët" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Hiqe nga të preferuarat folderin aktual." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Ndrysho Skedarët e Fshehur" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2532,6 +2558,11 @@ msgid "Go to previously opened scene." msgstr "Shko në skenën e hapur më parë." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Kopjo Rrugën" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Tabi tjetër" @@ -2742,15 +2773,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Hap Folderin e Editorit për të Dhënat/Opsionet" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Hap Editorin tjetër" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Ndrysho Ekranin e Plotë" @@ -3070,6 +3092,11 @@ msgstr "Koha" msgid "Calls" msgstr "Thërritjet" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Modifiko:" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Mbi" @@ -4732,6 +4759,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Instalo" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4760,7 +4792,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4774,8 +4805,9 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "" +#, fuzzy +msgid "Reverse sorting." +msgstr "Duke bër kërkesën..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4849,31 +4881,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "Krijo Pllakë" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Fshi keys të gabuar" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "Krijo një Folder" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Fshi keys të gabuar" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6751,7 +6787,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6936,10 +6976,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7509,14 +7545,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7905,6 +7933,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7991,6 +8023,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7998,10 +8046,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8090,7 +8172,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8098,7 +8180,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8110,7 +8192,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8127,7 +8209,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8196,11 +8278,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8216,7 +8298,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8244,11 +8326,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8288,11 +8370,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8301,7 +8387,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8319,15 +8405,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8377,7 +8463,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8405,12 +8491,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8487,47 +8573,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9687,6 +9773,11 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Krijo një Folder" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9899,7 +9990,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11421,6 +11512,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11437,15 +11532,22 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Previous Folder" +#~ msgstr "Folderi i Mëparshëm" + +#~ msgid "Next Folder" +#~ msgstr "Folderi Tjetër" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Hap Editorin tjetër" + #~ msgid "Update Always" #~ msgstr "Përditëso Gjithmonë" #~ msgid "Delete selected files?" #~ msgstr "Fshi skedarët e zgjedhur?" -#~ msgid "Go to parent folder" -#~ msgstr "Shko te folderi prind" - #~ msgid "Select device from the list" #~ msgstr "Zgjidh paisjen nga lista" diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po index 024f536ebd..4b22ba2ff2 100644 --- a/editor/translations/sr_Cyrl.po +++ b/editor/translations/sr_Cyrl.po @@ -138,6 +138,31 @@ msgstr "Промени позив анимације" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Промени вредноÑÑ‚" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Промени прелаз" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Промени положај" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Промени вредноÑÑ‚" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Промени позив анимације" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "Промени Ñ†Ð¸ÐºÐ»ÑƒÑ Ð°Ð½Ð¸Ð¼Ð°Ñ†Ð¸Ñ˜Ðµ" @@ -1189,7 +1214,6 @@ msgid "Success!" msgstr "УÑпех!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "ИнÑталирај" @@ -1760,7 +1784,7 @@ msgstr "Покажи у менаџеру датотека" msgid "New Folder..." msgstr "Ðови директоријум..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "ОÑвежи" @@ -1811,7 +1835,7 @@ msgstr "Ðапред" msgid "Go Up" msgstr "Иди горе" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Прикажи Ñакривене датотеке" @@ -1837,27 +1861,32 @@ msgstr "Помери надоле омиљену" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "Претодни Ñпрат" +msgid "Go to previous folder." +msgstr "Иди у родитељÑки директоријум" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Ðаправи директоријум" +msgid "Go to next folder." +msgstr "Иди у родитељÑки директоријум" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "Иди у родитељÑки директоријум" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Потражи клаÑе" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "ÐеуÑпех при прављењу директоријума." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Прикажи Ñакривене датотеке" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2609,6 +2638,11 @@ msgid "Go to previously opened scene." msgstr "Отвори претходну Ñцену." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Копирај пут" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Следећи таб" @@ -2823,15 +2857,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "ПоÑтавке уредника" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Отвори Ñледећи уредник" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Укљ./ИÑкљ. режим целог екрана" @@ -3160,6 +3185,11 @@ msgstr "Време:" msgid "Calls" msgstr "Позиви цртања" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Измени тему..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4909,6 +4939,11 @@ msgid "Idle" msgstr "Ðеактиван" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "ИнÑталирај" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Покушај поново" @@ -4939,7 +4974,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Ñви" @@ -4953,8 +4987,9 @@ msgid "Sort:" msgstr "Сортирање:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Обрнут" +#, fuzzy +msgid "Reverse sorting." +msgstr "Захтевање..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -5028,31 +5063,38 @@ msgid "Rotation Step:" msgstr "Ротације корака:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Помери вертикални водич" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Ðаправи нови вертикални водич" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Обриши вертикални водич" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Помери хоризонтални водич" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Ðаправи нови хоризонтални водич" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Обриши хоризонтални водич" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Ðаправи нови хоризонтални и вертикални водич" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -7045,9 +7087,14 @@ msgstr "Бок" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" msgstr "Поравнавање Ñа погледом" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Поравнај одабрано Ñа погледом" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Ðема родитеља за прављење Ñина." @@ -7241,10 +7288,6 @@ msgid "Focus Selection" msgstr "Ð¤Ð¾ÐºÑƒÑ Ð½Ð° Ñелекцију" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Поравнај одабрано Ñа погледом" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Избор алатки" @@ -7851,14 +7894,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Огледало X оÑе" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Огледало Y оÑе" - -#: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy msgid "Disable Autotile" msgstr "ÐутоматÑки рез" @@ -8300,6 +8335,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Vertex" msgstr "Тачке" @@ -8393,6 +8432,22 @@ msgid "Color uniform." msgstr "ТранÑформација" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8400,10 +8455,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." msgstr "Промени векторÑку конÑтанту" @@ -8496,7 +8585,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8504,7 +8593,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8516,7 +8605,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8533,7 +8622,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8602,11 +8691,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8622,7 +8711,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8650,11 +8739,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8697,12 +8786,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "Промени текÑтурну униформу (uniform)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup." msgstr "Промени текÑтурну униформу (uniform)" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "Промени текÑтурну униформу (uniform)" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8712,7 +8806,7 @@ msgstr "Прозор транÑформације..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8730,15 +8824,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8791,7 +8885,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8819,12 +8913,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8903,47 +8997,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10150,6 +10244,11 @@ msgstr "Покрени Ñкриптицу" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Ðаправи нов" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Сачувај Ñцену" @@ -10368,7 +10467,7 @@ msgid "Script is valid." msgstr "Ðнимационо дрво је важеће." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11929,6 +12028,11 @@ msgstr "Ðеважећа величина фонта." msgid "Invalid source for shader." msgstr "Ðеважећа величина фонта." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Ðеважећа величина фонта." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11946,6 +12050,27 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "Претодни Ñпрат" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Ðаправи директоријум" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Отвори Ñледећи уредник" + +#~ msgid "Reverse" +#~ msgstr "Обрнут" + +#~ msgid "Mirror X" +#~ msgstr "Огледало X оÑе" + +#~ msgid "Mirror Y" +#~ msgstr "Огледало Y оÑе" + +#, fuzzy #~ msgid "Generating solution..." #~ msgstr "Прављење контура..." diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po index 8478d11a8f..21a14c6a83 100644 --- a/editor/translations/sr_Latn.po +++ b/editor/translations/sr_Latn.po @@ -5,12 +5,13 @@ # Milos Ponjavusic <brane@branegames.com>, 2018. # BLu <blmasfon@gmail.com>, 2018. # Vojislav Bajakic <ch3d4.ns@gmail.com>, 2018. +# LT <lakizvezdas@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: Vojislav Bajakic <ch3d4.ns@gmail.com>\n" +"PO-Revision-Date: 2019-07-29 19:21+0000\n" +"Last-Translator: LT <lakizvezdas@gmail.com>\n" "Language-Team: Serbian (latin) <https://hosted.weblate.org/projects/godot-" "engine/godot/sr_Latn/>\n" "Language: sr_Latn\n" @@ -19,7 +20,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: Poedit 2.2\n" +"X-Generator: Weblate 3.8-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -63,33 +64,31 @@ msgstr "" #: editor/animation_bezier_editor.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Free" -msgstr "" +msgstr "Slobodno" #: editor/animation_bezier_editor.cpp msgid "Balanced" -msgstr "" +msgstr "Balansirano" #: editor/animation_bezier_editor.cpp msgid "Mirror" -msgstr "" +msgstr "Ogledalo" #: editor/animation_bezier_editor.cpp editor/editor_profiler.cpp msgid "Time:" -msgstr "" +msgstr "Vreme:" #: editor/animation_bezier_editor.cpp msgid "Value:" -msgstr "" +msgstr "Vrednost:" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Insert Key Here" -msgstr "Animacija dodaj kljuÄ" +msgstr "Dodaj kljuÄ ovde" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Duplicate Selected Key(s)" -msgstr "Uduplaj Selekciju" +msgstr "Dupliraj Selektovane KljuÄeve" #: editor/animation_bezier_editor.cpp msgid "Delete Selected Key(s)" @@ -97,11 +96,11 @@ msgstr "IzbriÅ¡i oznaÄeni kljuÄ(eve)" #: editor/animation_bezier_editor.cpp msgid "Add Bezier Point" -msgstr "" +msgstr "Dodaj Bezier TaÄku" #: editor/animation_bezier_editor.cpp msgid "Move Bezier Points" -msgstr "" +msgstr "Pomeri Bezier TaÄke" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -133,8 +132,32 @@ msgstr "Animacija Promjeni Poziv" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Animacija Promjeni Vrijeme KljuÄnog Kadra" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animacija Promjeni Tranziciju" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animacija Promjeni Transformaciju" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Animacija Promjeni Vrijednost KljuÄnog Kadra" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animacija Promjeni Poziv" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" -msgstr "Promijeni Dužinu Animacije" +msgstr "Promeni Dužinu Animacije" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -159,26 +182,24 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Audio Playback Track" -msgstr "" +msgstr "Audio Plejbek Traka" #: editor/animation_track_editor.cpp msgid "Animation Playback Track" -msgstr "" +msgstr "Animacija Plejbek Traka" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (frames)" -msgstr "Optimizuj Animaciju" +msgstr "Dužina Animacije (frames)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (seconds)" -msgstr "Promijeni Dužinu Animacije" +msgstr "Dužina Animacije (secunde)" #: editor/animation_track_editor.cpp #, fuzzy msgid "Add Track" -msgstr "Animacija Dodaj Kanal" +msgstr "Dodaj Traku" #: editor/animation_track_editor.cpp msgid "Animation Looping" @@ -186,16 +207,18 @@ msgstr "" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Functions:" -msgstr "" +msgstr "Funkcije:" #: editor/animation_track_editor.cpp msgid "Audio Clips:" -msgstr "" +msgstr "Audio Klipovi:" #: editor/animation_track_editor.cpp +#, fuzzy msgid "Anim Clips:" -msgstr "" +msgstr "Anim Klipovi:" #: editor/animation_track_editor.cpp msgid "Change Track Path" @@ -224,7 +247,7 @@ msgstr "Odstrani Kanal Animacije" #: editor/animation_track_editor.cpp msgid "Time (s): " -msgstr "" +msgstr "Vreme (s): " #: editor/animation_track_editor.cpp msgid "Toggle Track Enabled" @@ -247,8 +270,9 @@ msgid "Capture" msgstr "" #: editor/animation_track_editor.cpp +#, fuzzy msgid "Nearest" -msgstr "" +msgstr "Najbliže" #: editor/animation_track_editor.cpp editor/plugins/curve_editor_plugin.cpp #: editor/property_editor.cpp @@ -275,12 +299,12 @@ msgstr "" #: editor/animation_track_editor.cpp #, fuzzy msgid "Duplicate Key(s)" -msgstr "Animacija Uduplaj KljuÄeve" +msgstr "Dupliraj KljuÄeve" #: editor/animation_track_editor.cpp #, fuzzy msgid "Delete Key(s)" -msgstr "Animacija ObriÅ¡i KljuÄeve" +msgstr "ObriÅ¡i KljuÄeve" #: editor/animation_track_editor.cpp #, fuzzy @@ -376,7 +400,7 @@ msgstr "" #: editor/animation_track_editor.cpp #, fuzzy msgid "Add Bezier Track" -msgstr "Animacija Dodaj Kanal" +msgstr "Dodaj Bezier Kanal" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -392,9 +416,8 @@ msgid "Add Transform Track Key" msgstr "Animacija Dodaj kanal i kljuÄ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Animacija Dodaj Kanal" +msgstr "Dodaj Kljuc Kanal" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." @@ -1130,7 +1153,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1664,7 +1686,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1715,7 +1737,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1740,23 +1762,29 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "" +#, fuzzy +msgid "Go to previous folder." +msgstr "OtiÄ‘i Na Prethodni Korak" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "" +#, fuzzy +msgid "Go to next folder." +msgstr "OtiÄ‘i Na Sljedeći Korak" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2433,6 +2461,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "ObriÅ¡i Selekciju" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2624,14 +2657,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2945,6 +2970,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Izmjeni Selekciju Krivulje" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4580,6 +4610,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4608,7 +4642,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4622,7 +4655,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4697,31 +4730,34 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "Napravi" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "ObriÅ¡i Selekciju" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "ObriÅ¡i Selekciju" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6599,7 +6635,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6784,10 +6824,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7362,14 +7398,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7771,6 +7799,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7857,6 +7889,22 @@ msgid "Color uniform." msgstr "Animacija Promjeni Transformaciju" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7864,10 +7912,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7957,7 +8039,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7965,7 +8047,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7977,7 +8059,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7994,7 +8076,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8063,11 +8145,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8083,7 +8165,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8111,11 +8193,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8156,11 +8238,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8170,7 +8256,7 @@ msgstr "Napravi" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8188,15 +8274,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8247,7 +8333,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8275,12 +8361,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8357,47 +8443,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9553,6 +9639,11 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Napravi" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9756,7 +9847,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11279,6 +11370,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/sv.po b/editor/translations/sv.po index 0b7ff433c9..0b2f9133c3 100644 --- a/editor/translations/sv.po +++ b/editor/translations/sv.po @@ -135,6 +135,31 @@ msgid "Anim Change Call" msgstr "Anim Ändra Anrop" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Ändra Tid för Nyckebild" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Anim Ändra ÖvergÃ¥ng" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Anim Ändra Transformation" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Ändra Värde PÃ¥ Nyckelbild" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Anim Ändra Anrop" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Ändra Animationslängd" @@ -1240,7 +1265,6 @@ msgid "Success!" msgstr "Klart!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Installera" @@ -1861,7 +1885,7 @@ msgstr "Visa I Filhanteraren" msgid "New Folder..." msgstr "Ny Mapp..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Uppdatera" @@ -1914,7 +1938,7 @@ msgstr "GÃ¥ FramÃ¥t" msgid "Go Up" msgstr "GÃ¥ Upp" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp #, fuzzy msgid "Toggle Hidden Files" msgstr "Växla Dolda Filer" @@ -1943,27 +1967,32 @@ msgstr "Flytta Favorit Ner" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "FöregÃ¥ende flik" +msgid "Go to previous folder." +msgstr "GÃ¥ till överordnad mapp" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "Skapa Mapp" +msgid "Go to next folder." +msgstr "GÃ¥ till överordnad mapp" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "GÃ¥ till överordnad mapp" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Sök Klasser" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "Kunde inte skapa mapp." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Växla Dolda Filer" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2788,6 +2817,11 @@ msgid "Go to previously opened scene." msgstr "GÃ¥ till föregÃ¥ende öppna scen." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Kopiera Sökvägen" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Nästa flik" @@ -2993,14 +3027,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -3331,6 +3357,11 @@ msgstr "Tid:" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Redigera tema..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp #, fuzzy msgid "On" @@ -5120,6 +5151,11 @@ msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp #, fuzzy +msgid "Install..." +msgstr "Installera" + +#: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy msgid "Retry" msgstr "Försök igen" @@ -5149,7 +5185,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Alla" @@ -5163,7 +5198,7 @@ msgid "Sort:" msgstr "Sortera:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -5240,31 +5275,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "Skapa Mapp" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Ta bort Variabeln" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "Skapa Node" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Ta bort ogiltiga nycklar" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -7264,7 +7303,12 @@ msgstr "Baksida" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" +msgstr "Vy frÃ¥n höger" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" msgstr "Vy frÃ¥n höger" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7462,10 +7506,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -8066,16 +8106,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy -msgid "Mirror X" -msgstr "Spegla X" - -#: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy -msgid "Mirror Y" -msgstr "Spegla Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8502,6 +8532,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8593,6 +8627,22 @@ msgid "Color uniform." msgstr "Transformera" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8600,10 +8650,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8693,7 +8777,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8701,7 +8785,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8713,7 +8797,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8730,7 +8814,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8799,11 +8883,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8819,7 +8903,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8847,11 +8931,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8892,11 +8976,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8906,7 +8994,7 @@ msgstr "Transformera" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8924,15 +9012,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8984,7 +9072,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -9012,12 +9100,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9094,47 +9182,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10388,6 +10476,11 @@ msgstr "Öppna Skript" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Byt Förälder-Node" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Vettigt!" @@ -10615,7 +10708,8 @@ msgid "Script is valid." msgstr "Skript giltigt" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "TillÃ¥tna: a-z, a-Z, 0-9 och _" #: editor/script_create_dialog.cpp @@ -12253,6 +12347,11 @@ msgstr "Ogiltig teckenstorlek." msgid "Invalid source for shader." msgstr "Ogiltig teckenstorlek." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Ogiltig teckenstorlek." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -12270,6 +12369,22 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "FöregÃ¥ende flik" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "Skapa Mapp" + +#, fuzzy +#~ msgid "Mirror X" +#~ msgstr "Spegla X" + +#, fuzzy +#~ msgid "Mirror Y" +#~ msgstr "Spegla Y" + +#, fuzzy #~ msgid "Generating solution..." #~ msgstr "Skapar konturer..." diff --git a/editor/translations/ta.po b/editor/translations/ta.po index 2aad1e09d7..4444305cf2 100644 --- a/editor/translations/ta.po +++ b/editor/translations/ta.po @@ -132,6 +132,31 @@ msgid "Anim Change Call" msgstr "மாறà¯à®± அழைபà¯à®ªà¯ அசைவூடà¯à®Ÿà¯" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "மாறà¯à®± மதிபà¯à®ªà¯ அசைவூடà¯à®Ÿà¯" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "மாறà¯à®±à®®à¯ அசைவூடà¯à®Ÿà¯" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "உரà¯à®®à®¾à®±à¯à®±à®®à¯ அசைவூடà¯à®Ÿà¯" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "மாறà¯à®± மதிபà¯à®ªà¯ அசைவூடà¯à®Ÿà¯" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "மாறà¯à®± அழைபà¯à®ªà¯ அசைவூடà¯à®Ÿà¯" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1121,7 +1146,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1655,7 +1679,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1706,7 +1730,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1731,23 +1755,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2423,6 +2451,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "அனைதà¯à®¤à¯ தேரà¯à®µà¯à®•ளà¯" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2614,14 +2647,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2934,6 +2959,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "தேரà¯à®µà¯ வளைவை [Selection Curve] திரà¯à®¤à¯à®¤à¯" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4566,6 +4596,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4594,7 +4628,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4608,7 +4641,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4683,31 +4716,32 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "அசைவூடà¯à®Ÿà¯ பாதையை நீகà¯à®•à¯" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6570,7 +6604,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6755,10 +6793,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7325,14 +7359,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7716,6 +7742,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7801,6 +7831,22 @@ msgid "Color uniform." msgstr "உரà¯à®®à®¾à®±à¯à®±à®®à¯ அசைவூடà¯à®Ÿà¯" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7808,10 +7854,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7900,7 +7980,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7908,7 +7988,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7920,7 +8000,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7937,7 +8017,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8006,11 +8086,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8026,7 +8106,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8054,11 +8134,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8099,11 +8179,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8112,7 +8196,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8130,15 +8214,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8187,7 +8271,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8215,12 +8299,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8297,47 +8381,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9491,6 +9575,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9694,7 +9782,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11216,6 +11304,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/te.po b/editor/translations/te.po index 8d9b4c87f2..abc011cfab 100644 --- a/editor/translations/te.po +++ b/editor/translations/te.po @@ -127,6 +127,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1104,7 +1124,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1637,7 +1656,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1688,7 +1707,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1713,23 +1732,27 @@ msgid "Move Favorite Down" msgstr "" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" +msgid "Go to previous folder." msgstr "" #: editor/editor_file_dialog.cpp -msgid "Next Folder" +msgid "Go to next folder." msgstr "" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2404,6 +2427,10 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2595,14 +2622,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2915,6 +2934,10 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +msgid "Edit Text:" +msgstr "" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4537,6 +4560,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4565,7 +4592,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4579,7 +4605,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4654,31 +4680,31 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6534,7 +6560,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6719,10 +6749,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7283,14 +7309,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7668,6 +7686,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7752,6 +7774,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7759,10 +7797,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -7851,7 +7923,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7859,7 +7931,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7871,7 +7943,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7888,7 +7960,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7957,11 +8029,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -7977,7 +8049,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8005,11 +8077,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8049,11 +8121,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8062,7 +8138,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8080,15 +8156,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8137,7 +8213,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8165,12 +8241,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8247,47 +8323,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9438,6 +9514,10 @@ msgid "Extend Script" msgstr "" #: editor/scene_tree_dock.cpp +msgid "Reparent to New Node" +msgstr "" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9640,7 +9720,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11159,6 +11239,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/th.po b/editor/translations/th.po index 2675f9b850..e23decda82 100644 --- a/editor/translations/th.po +++ b/editor/translations/th.po @@ -141,6 +141,31 @@ msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹€à¸£à¸µà¸¢à¸à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™à¹à¸à¸™ #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "à¹à¸à¹‰à¹„ขเวลาคีย์เฟรมà¹à¸à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "à¹à¸à¹‰à¹„ขทรานสิชันà¹à¸à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "เคลื่à¸à¸™à¸¢à¹‰à¸²à¸¢à¹à¸à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "à¹à¸à¹‰à¹„ขค่าคีย์เฟรมà¹à¸à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹€à¸£à¸µà¸¢à¸à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™à¹à¸à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¸§à¸™à¸‹à¹‰à¸³à¹à¸à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™" @@ -1187,7 +1212,6 @@ msgid "Success!" msgstr "สำเร็จ!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "ติดตั้ง" @@ -1760,7 +1784,7 @@ msgstr "à¹à¸ªà¸”งในตัวจัดà¸à¸²à¸£à¹„ฟล์" msgid "New Folder..." msgstr "สร้างโฟลเดà¸à¸£à¹Œ..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "รีเฟรช" @@ -1811,7 +1835,7 @@ msgstr "ไปหน้า" msgid "Go Up" msgstr "ขึ้นบน" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "เปิด/ปิดไฟล์ที่ซ่à¸à¸™" @@ -1837,27 +1861,32 @@ msgstr "เลื่à¸à¸™à¹‚ฟลเดà¸à¸£à¹Œà¸—ี่ชà¸à¸šà¸¥à¸‡" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "ไปชั้นล่าง" +msgid "Go to previous folder." +msgstr "ไปยังโฟลเดà¸à¸£à¹Œà¸«à¸¥à¸±à¸" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "ไปชั้นบน" +msgid "Go to next folder." +msgstr "ไปยังโฟลเดà¸à¸£à¹Œà¸«à¸¥à¸±à¸" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "ไปยังโฟลเดà¸à¸£à¹Œà¸«à¸¥à¸±à¸" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "ค้นหาคลาส" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "ไม่สามารถสร้างโฟลเดà¸à¸£à¹Œ" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "เปิด/ปิดไฟล์ที่ซ่à¸à¸™" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2586,6 +2615,11 @@ msgid "Go to previously opened scene." msgstr "ไปยังฉาà¸à¸—ี่เพิ่งเปิด" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "คัดลà¸à¸à¸•ำà¹à¸«à¸™à¹ˆà¸‡" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "à¹à¸—็บถัดไป" @@ -2788,15 +2822,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "ตัวเลืà¸à¸à¹‚ปรà¹à¸à¸£à¸¡à¸ªà¸£à¹‰à¸²à¸‡à¹€à¸à¸¡" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "เปิดตัวà¹à¸à¹‰à¹„ขถัดไป" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "สลับเต็มจà¸" @@ -3123,6 +3148,11 @@ msgstr "เวลา" msgid "Calls" msgstr "จำนวนครั้ง" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "à¹à¸à¹‰à¹„ขธีม..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "เปิด" @@ -4860,6 +4890,11 @@ msgid "Idle" msgstr "พร้à¸à¸¡à¹ƒà¸Šà¹‰à¸‡à¸²à¸™" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "ติดตั้ง" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "ลà¸à¸‡à¹ƒà¸«à¸¡à¹ˆ" @@ -4890,7 +4925,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "ทั้งหมด" @@ -4904,8 +4938,9 @@ msgid "Sort:" msgstr "เรียงตาม:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "ย้à¸à¸™à¸à¸¥à¸±à¸š" +#, fuzzy +msgid "Reverse sorting." +msgstr "à¸à¸³à¸¥à¸±à¸‡à¸£à¹‰à¸à¸‡à¸‚à¸..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4982,31 +5017,38 @@ msgid "Rotation Step:" msgstr "ช่วงà¸à¸‡à¸¨à¸²:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "เลื่à¸à¸™à¹€à¸ªà¹‰à¸™à¸™à¸³à¹à¸™à¸§à¸•ั้ง" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "สร้างเส้นนำà¹à¸™à¸§à¸•ั้ง" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "ลบเส้นนำà¹à¸™à¸§à¸•ั้ง" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "เลื่à¸à¸™à¹€à¸ªà¹‰à¸™à¸™à¸³à¹à¸™à¸§à¸™à¸à¸™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "สร้างเส้นนำà¹à¸™à¸§à¸™à¸à¸™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "ลบเส้นนำà¹à¸™à¸§à¸™à¸à¸™" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "สร้างเส้นนำà¹à¸™à¸§à¸•ั้งà¹à¸¥à¸°à¹à¸™à¸§à¸™à¸à¸™" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6989,9 +7031,14 @@ msgstr "หลัง" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" msgstr "ย้ายมาที่à¸à¸¥à¹‰à¸à¸‡" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "ย้ายวัตถุที่เลืà¸à¸à¸¡à¸²à¸—ี่à¸à¸¥à¹‰à¸à¸‡" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "ไม่พบโหนดà¹à¸¡à¹ˆà¸—ี่จะรับà¸à¸´à¸™à¸ªà¹à¸•นซ์โหนดลูà¸" @@ -7182,10 +7229,6 @@ msgid "Focus Selection" msgstr "มà¸à¸‡à¸§à¸±à¸•ถุที่เลืà¸à¸" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "ย้ายวัตถุที่เลืà¸à¸à¸¡à¸²à¸—ี่à¸à¸¥à¹‰à¸à¸‡" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "เครื่à¸à¸‡à¸¡à¸·à¸à¹€à¸¥à¸·à¸à¸" @@ -7788,14 +7831,6 @@ msgid "Transpose" msgstr "สลับà¹à¸à¸™" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "สะท้à¸à¸™à¸‹à¹‰à¸²à¸¢à¸‚วา" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "สะท้à¸à¸™à¸šà¸™à¸¥à¹ˆà¸²à¸‡" - -#: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy msgid "Disable Autotile" msgstr "Autotiles" @@ -8240,6 +8275,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Vertex" msgstr "มุมรูปทรง" @@ -8334,6 +8373,22 @@ msgid "Color uniform." msgstr "เคลื่à¸à¸™à¸¢à¹‰à¸²à¸¢" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8341,10 +8396,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." msgstr "à¹à¸à¹‰à¹„ขค่าคงที่เวà¸à¹€à¸•à¸à¸£à¹Œ" @@ -8437,7 +8526,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8445,7 +8534,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8457,7 +8546,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8474,7 +8563,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8543,11 +8632,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8563,7 +8652,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8591,11 +8680,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8638,12 +8727,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "à¹à¸à¹‰à¹„ข Texture Uniform" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup." msgstr "à¹à¸à¹‰à¹„ข Texture Uniform" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "à¹à¸à¹‰à¹„ข Texture Uniform" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8653,7 +8747,7 @@ msgstr "เครื่à¸à¸‡à¸¡à¸·à¸à¹€à¸„ลื่à¸à¸™à¸¢à¹‰à¸²à¸¢..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8671,15 +8765,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8732,7 +8826,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8760,12 +8854,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8844,47 +8938,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10102,6 +10196,11 @@ msgstr "เปิดสคริปต์" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "หาโหนดà¹à¸¡à¹ˆà¹ƒà¸«à¸¡à¹ˆ" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "เข้าใจ!" @@ -10336,7 +10435,8 @@ msgid "Script is valid." msgstr "สคริปต์ถูà¸à¸•้à¸à¸‡" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "à¸à¸±à¸à¸‚ระที่ใช้ได้: a-z, A-Z, 0-9 à¹à¸¥à¸° _" #: editor/script_create_dialog.cpp @@ -11955,6 +12055,11 @@ msgstr "ต้นฉบับไม่ถูà¸à¸•้à¸à¸‡!" msgid "Invalid source for shader." msgstr "ต้นฉบับไม่ถูà¸à¸•้à¸à¸‡!" +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "ต้นฉบับไม่ถูà¸à¸•้à¸à¸‡!" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11971,6 +12076,27 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "ไปชั้นล่าง" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "ไปชั้นบน" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "เปิดตัวà¹à¸à¹‰à¹„ขถัดไป" + +#~ msgid "Reverse" +#~ msgstr "ย้à¸à¸™à¸à¸¥à¸±à¸š" + +#~ msgid "Mirror X" +#~ msgstr "สะท้à¸à¸™à¸‹à¹‰à¸²à¸¢à¸‚วา" + +#~ msgid "Mirror Y" +#~ msgstr "สะท้à¸à¸™à¸šà¸™à¸¥à¹ˆà¸²à¸‡" + #~ msgid "Generating solution..." #~ msgstr "à¸à¸³à¸¥à¸±à¸‡à¸ªà¸£à¹‰à¸²à¸‡ solution..." diff --git a/editor/translations/tr.po b/editor/translations/tr.po index 406b84b591..f59cc0a809 100644 --- a/editor/translations/tr.po +++ b/editor/translations/tr.po @@ -152,6 +152,31 @@ msgid "Anim Change Call" msgstr "Animasyon DeÄŸiÅŸikliÄŸi ÇaÄŸrısı" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Anim Anahtar-kare Zamanını DeÄŸiÅŸtir" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Animasyon GeçiÅŸinin DeÄŸiÅŸimi" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Animasyon DeÄŸiÅŸikliÄŸi Dönüşümü" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Anim Anahtar-kare DeÄŸerini DeÄŸiÅŸtir" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Animasyon DeÄŸiÅŸikliÄŸi ÇaÄŸrısı" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Animasyon UzunluÄŸunu DeÄŸiÅŸtir" @@ -1167,7 +1192,6 @@ msgid "Success!" msgstr "BaÅŸarılı!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Kur" @@ -1740,7 +1764,7 @@ msgstr "Dosya Yöneticisinde Göster" msgid "New Folder..." msgstr "Yeni Klasör..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Yenile" @@ -1791,7 +1815,7 @@ msgstr "İleri Git" msgid "Go Up" msgstr "Yukarı Git" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Gizli Dosyalari Aç / Kapat" @@ -1816,25 +1840,32 @@ msgid "Move Favorite Down" msgstr "BeÄŸenileni AÅŸağı Taşı" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Önceki Klasör" +#, fuzzy +msgid "Go to previous folder." +msgstr "Üst klasöre git" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Sonraki Klasör" +#, fuzzy +msgid "Go to next folder." +msgstr "Üst klasöre git" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "Üst klasöre git" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Dosyaları ara" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Bu klasörü favorilerden çıkar/favorilere ekle." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "Gizli Dosyalari Aç / Kapat" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2569,6 +2600,11 @@ msgid "Go to previously opened scene." msgstr "Daha önce açılan sahneye git." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Dosya Yolunu Tıpkıla" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Sonraki sekme" @@ -2781,15 +2817,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Düzenleyici Verileri/Ayarları Klasörünü Aç" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "Sonraki Düzenleyiciyi aç" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Tam Ekran Aç / Kapat" @@ -3109,6 +3136,11 @@ msgstr "Zaman" msgid "Calls" msgstr "ÇaÄŸrılar" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Tema düzenle..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Açık" @@ -4822,6 +4854,11 @@ msgid "Idle" msgstr "BoÅŸta" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Kur" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Tekrarla" @@ -4852,7 +4889,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Hepsi" @@ -4866,8 +4902,9 @@ msgid "Sort:" msgstr "Sırala:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Tersi" +#, fuzzy +msgid "Reverse sorting." +msgstr "İsteniyor..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4948,31 +4985,38 @@ msgid "Rotation Step:" msgstr "Dönme Adımı:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "Dikey kılavuzu taşı" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "Yeni dikey kılavuz oluÅŸtur" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "Dikey kılavuzu kaldır" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "Yatay kılavuzu taşı" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "Yeni yatay kılavuz oluÅŸtur" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "Yatay kılavuzu kaldır" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "Yeni yatay ve dikey kılavuzlar oluÅŸtur" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6954,9 +6998,14 @@ msgstr "Arka" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" msgstr "Görünüme Ayarla" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "Seçimi Görünüme Ayarla" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "ÇocuÄŸun örnek alacağı bir ebeveyn yok." @@ -7147,10 +7196,6 @@ msgid "Focus Selection" msgstr "Seçime Odaklan" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "Seçimi Görünüme Ayarla" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "Seçim Aracı" @@ -7750,14 +7795,6 @@ msgid "Transpose" msgstr "Tersine Çevir" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "X'e Aynala" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Y'ye Aynala" - -#: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy msgid "Disable Autotile" msgstr "Oto-döşemeler" @@ -8204,6 +8241,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Vertex" msgstr "Köşenoktalar" @@ -8297,6 +8338,22 @@ msgid "Color uniform." msgstr "Dönüşüm" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8304,10 +8361,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." msgstr "Vec Sabitini DeÄŸiÅŸtir" @@ -8400,7 +8491,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8408,7 +8499,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8420,7 +8511,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8437,7 +8528,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8506,11 +8597,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8526,7 +8617,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8554,11 +8645,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8601,12 +8692,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "Doku Tekdüzenini DeÄŸiÅŸtir" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup." msgstr "Doku Tekdüzenini DeÄŸiÅŸtir" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "Doku Tekdüzenini DeÄŸiÅŸtir" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8616,7 +8712,7 @@ msgstr "Dönüştürme İletiÅŸim Kutusu..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8634,15 +8730,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8695,7 +8791,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8723,12 +8819,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8807,47 +8903,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10076,6 +10172,11 @@ msgstr "Betik Aç" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "Düğümün EbeveynliÄŸini DeÄŸiÅŸtir" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "Anlamlı!" @@ -10312,7 +10413,8 @@ msgid "Script is valid." msgstr "Betik geçerli" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "İzin verilenler: a-z, A-Z, 0-9 ve _" #: editor/script_create_dialog.cpp @@ -11994,6 +12096,11 @@ msgstr "Geçersiz kaynak!" msgid "Invalid source for shader." msgstr "Geçersiz kaynak!" +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "Geçersiz kaynak!" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -12010,6 +12117,25 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Previous Folder" +#~ msgstr "Önceki Klasör" + +#~ msgid "Next Folder" +#~ msgstr "Sonraki Klasör" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "Sonraki Düzenleyiciyi aç" + +#~ msgid "Reverse" +#~ msgstr "Tersi" + +#~ msgid "Mirror X" +#~ msgstr "X'e Aynala" + +#~ msgid "Mirror Y" +#~ msgstr "Y'ye Aynala" + #~ msgid "Generating solution..." #~ msgstr "Çözüm oluÅŸturuluyor..." diff --git a/editor/translations/uk.po b/editor/translations/uk.po index db7f358773..19e21461cd 100644 --- a/editor/translations/uk.po +++ b/editor/translations/uk.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: Ukrainian (Godot Engine)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-09 10:46+0000\n" +"PO-Revision-Date: 2019-07-21 11:06+0000\n" "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/" "godot/uk/>\n" @@ -138,6 +138,31 @@ msgid "Anim Change Call" msgstr "Змінити виклик анімації" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Змінити Ñ‡Ð°Ñ ÐºÐ»ÑŽÑ‡Ð¾Ð²Ð¾Ð³Ð¾ кадру" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Змінити перехід" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Змінити перетвореннÑ" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Змінити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ ÐºÐ»ÑŽÑ‡Ð¾Ð²Ð¾Ð³Ð¾ кадру" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Змінити виклик анімації" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "Змінити триваліÑть анімації" @@ -642,7 +667,7 @@ msgstr "Ðомер Ñ€Ñдка:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "ВиÑвлено %d відповідників." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -800,9 +825,8 @@ msgid "Connect" msgstr "З'єднати" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Сигнали:" +msgstr "Сигнал:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -967,9 +991,9 @@ msgid "Owners Of:" msgstr "ВлаÑники:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "Видалити вибрані файли з проєкту? (ÑкаÑÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ðµ)" +msgstr "" +"Вилучити позначені файли з проєкту? (Вилучені файли не вдаÑтьÑÑ Ð²Ñ–Ð´Ð½Ð¾Ð²Ð¸Ñ‚Ð¸)" #: editor/dependency_editor.cpp msgid "" @@ -1151,7 +1175,6 @@ msgid "Success!" msgstr "УÑпіх!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Ð’Ñтановити" @@ -1520,6 +1543,8 @@ msgstr "Файл шаблону не знайдено:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" +"При екÑпортуванні у 32-бітовому режимі вбудовані PCK не можуть перевищувати " +"за розміром 4 ГіБ." #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1693,7 +1718,7 @@ msgstr "Показати у менеджері файлів" msgid "New Folder..." msgstr "Створити теку..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Оновити" @@ -1744,7 +1769,7 @@ msgstr "Йти вперед" msgid "Go Up" msgstr "Вгору" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Перемкнути приховані файли" @@ -1769,23 +1794,31 @@ msgid "Move Favorite Down" msgstr "ПереміÑтити вибране вниз" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "ÐŸÐ¾Ð¿ÐµÑ€ÐµÐ´Ð½Ñ Ñ‚ÐµÐºÐ°" +#, fuzzy +msgid "Go to previous folder." +msgstr "Перейти до батьківÑької теки." #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "ÐаÑтупна тека" +#, fuzzy +msgid "Go to next folder." +msgstr "Перейти до батьківÑької теки." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Перейти до батьківÑької теки." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Шукати файли" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Перемкнути Ñтан вибраноÑті Ð´Ð»Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ñ— теки." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Увімкнути або вимкнути видиміÑть прихованих файлів." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2517,6 +2550,10 @@ msgid "Go to previously opened scene." msgstr "Перейти до раніше відкритої Ñцени." #: editor/editor_node.cpp +msgid "Copy Text" +msgstr "Копіювати текÑÑ‚" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "ÐаÑтупна вкладка" @@ -2727,14 +2764,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Знімки зберігаютьÑÑ Ñƒ теці Data/Settings редактора." #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "Ðвтоматично відкривати знімки вікон" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "Відкрити у зовнішньому редакторі зображень." - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Перемикач повноекранного режиму" @@ -3055,6 +3084,11 @@ msgstr "ЧаÑ" msgid "Calls" msgstr "Виклики" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Редагувати тему" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "Увімкнено" @@ -4726,6 +4760,10 @@ msgid "Idle" msgstr "ПроÑтій" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "Ð’Ñтановити…" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Повторити Ñпробу" @@ -4754,7 +4792,6 @@ msgid "Last" msgstr "ОÑтанній" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Ð’Ñе" @@ -4768,8 +4805,8 @@ msgid "Sort:" msgstr "Сортувати:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Зворотний" +msgid "Reverse sorting." +msgstr "Обернений порÑдок." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4850,32 +4887,32 @@ msgid "Rotation Step:" msgstr "Крок повороту:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "ПереміÑтити вертикальну напрÑмну" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "Створити нову вертикальну напрÑмну" +msgid "Create Vertical Guide" +msgstr "Створити вертикальну напрÑмну" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +msgid "Remove Vertical Guide" msgstr "Вилучити вертикальну напрÑмну" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "ПереміÑтити горизонтальну напрÑмну" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "Створити нову горизонтальну напрÑмну" +msgid "Create Horizontal Guide" +msgstr "Створити горизонтальну напрÑмну" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "Вилучити горизонтальну напрÑмну" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "Створити нові горизонтальні та вертикальні напрÑмні" +msgid "Create Horizontal and Vertical Guides" +msgstr "Створити горизонтальні та вертикальні напрÑмні" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move pivot" @@ -6464,7 +6501,7 @@ msgstr "ЗаÑіб підÑÐ²Ñ–Ñ‡ÑƒÐ²Ð°Ð½Ð½Ñ ÑинтакÑиÑу" #: editor/plugins/script_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 @@ -6472,9 +6509,8 @@ msgid "Bookmarks" msgstr "Закладки" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Breakpoints" -msgstr "Створити точки." +msgstr "Точки зупину" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6763,9 +6799,15 @@ msgid "Rear" msgstr "Ззаду" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "ВирівнÑти з переглÑдом" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "ВирівнÑти позначене із переглÑдом" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "Ðемає батьківÑького запиÑу Ð´Ð»Ñ Ð´Ð¾Ñ‡Ñ–Ñ€Ð½ÑŒÐ¾Ð³Ð¾." @@ -6954,10 +6996,6 @@ msgid "Focus Selection" msgstr "ФокуÑувати позначене" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "ВирівнÑти позначене із переглÑдом" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "ІнÑтрумент позначеннÑ" @@ -7520,14 +7558,6 @@ msgid "Transpose" msgstr "ТранÑпонувати" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "Віддзеркалити за X" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "Віддзеркалити за Y" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "Вимкнути автоплитки" @@ -7927,6 +7957,10 @@ msgid "Visual Shader Input Type Changed" msgstr "Змінено тип Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð²Ñ–Ð·ÑƒÐ°Ð»ÑŒÐ½Ð¾Ð³Ð¾ шейдера" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "(лише GLES3)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "Вершина" @@ -8011,6 +8045,22 @@ msgid "Color uniform." msgstr "Однорідний колір." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "Повертає булевий результат порівнÑÐ½Ð½Ñ %s між двома параметрами." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "РівніÑть (==)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "Більше (>)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "Більше або дорівнює (>=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8020,11 +8070,47 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "Повертає булевий результат порівнÑÐ½Ð½Ñ Ð¼Ñ–Ð¶ INF та ÑкалÑрним параметром." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "Повертає булевий результат порівнÑÐ½Ð½Ñ Ð¼Ñ–Ð¶ NaN Ñ– ÑкалÑрним параметром." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "Менше (<)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "Менше або дорівнює (<=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "Ðе дорівнює (!=)" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" "Повертає пов'Ñзаний вектор за заданим булевим значеннÑм «true» або «false»." #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "Повертає булевий результат порівнÑÐ½Ð½Ñ Ð¼Ñ–Ð¶ двома параметрами." + +#: editor/plugins/visual_shader_editor_plugin.cpp +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 msgid "Boolean constant." msgstr "Булева Ñтала." @@ -8113,16 +8199,16 @@ msgid "Returns the arc-cosine of the parameter." msgstr "Повертає арккоÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." -msgstr "(Лише GLES3) Повертає обернений гіперболічний коÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." +msgid "Returns the inverse hyperbolic cosine of the parameter." +msgstr "Повертає обернений гіперболічний коÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." msgstr "Повертає аркÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." -msgstr "(Лише GLES3) Повертає обернений гіперболічний ÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." +msgid "Returns the inverse hyperbolic sine of the parameter." +msgstr "Повертає обернений гіперболічний ÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameter." @@ -8133,8 +8219,8 @@ msgid "Returns the arc-tangent of the parameters." msgstr "Повертає Ð°Ñ€ÐºÑ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ñ–Ð²." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." -msgstr "(Лише GLES3) Повертає обернений гіперболічний Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." +msgid "Returns the inverse hyperbolic tangent of the parameter." +msgstr "Повертає обернений гіперболічний Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -8152,8 +8238,8 @@ msgid "Returns the cosine of the parameter." msgstr "Повертає коÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." -msgstr "(Лише GLES3) Повертає гіперболічний коÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." +msgid "Returns the hyperbolic cosine of the parameter." +msgstr "Повертає гіперболічний коÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." @@ -8225,12 +8311,12 @@ msgid "1.0 / scalar" msgstr "1.0 / ÑкалÑÑ€" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." -msgstr "(Лише GLES3) Знаходить найближче ціле Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð¾ параметра." +msgid "Finds the nearest integer to the parameter." +msgstr "Знаходить найближче ціле Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð¾ параметра." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." -msgstr "(Лише GLES3) Знаходить найближче парне ціле Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð¾ параметра." +msgid "Finds the nearest even integer to the parameter." +msgstr "Знаходить найближче парне ціле Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð¾ параметра." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." @@ -8245,8 +8331,8 @@ msgid "Returns the sine of the parameter." msgstr "Повертає ÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." -msgstr "(Лише GLES3) Повертає гіперболічний ÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." +msgid "Returns the hyperbolic sine of the parameter." +msgstr "Повертає гіперболічний ÑÐ¸Ð½ÑƒÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." @@ -8281,12 +8367,12 @@ msgid "Returns the tangent of the parameter." msgstr "Повертає Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." -msgstr "(Лише GLES3) Повертає гіперболічний Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." +msgid "Returns the hyperbolic tangent of the parameter." +msgstr "Повертає гіперболічний Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." -msgstr "(Лише GLES3) Визначає обрізане до цілого Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." +msgid "Finds the truncated value of the parameter." +msgstr "Визначає обрізане до цілого Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð°." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." @@ -8325,12 +8411,16 @@ msgid "Perform the texture lookup." msgstr "Виконує пошук текÑтури." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." -msgstr "Однорідна кубічна текÑтура." +msgid "Cubic texture uniform lookup." +msgstr "Пошук однорідної кубічної текÑтури." + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." +msgstr "Пошук однорідної плаÑкої текÑтури." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." -msgstr "Однорідна плаÑка текÑтура." +msgid "2D texture uniform lookup with triplanar." +msgstr "Однорідний пошук плаÑкої текÑтури за допомогою трьох площин." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Transform function." @@ -8338,7 +8428,7 @@ msgstr "Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8346,7 +8436,7 @@ 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 "" -"(Лише GLES3) ОбчиÑлити зовнішній добуток пари векторів.\n" +"ОбчиÑлити зовнішній добуток пари векторів.\n" "\n" "OuterProduct вважає перший параметр, «c», Ñ” вектором-Ñтовпчиком (матрицею із " "одного Ñтовпчика) а другий параметр, «r», Ñ” вектором-Ñ€Ñдком (матрицею із " @@ -8363,16 +8453,16 @@ msgid "Decomposes transform to four vectors." msgstr "Розкладає Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð½Ð° чотири вектори." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." -msgstr "(Лише GLES3) ОбчиÑлює визначник перетвореннÑ." +msgid "Calculates the determinant of a transform." +msgstr "ОбчиÑлює визначник перетвореннÑ." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." -msgstr "(Лише GLES3) ОбчиÑлює обернену матрицю перетвореннÑ." +msgid "Calculates the inverse of a transform." +msgstr "ОбчиÑлює обернену матрицю перетвореннÑ." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." -msgstr "(Лише GLES3) ОбчиÑлює транÑпозицію перетвореннÑ." +msgid "Calculates the transpose of a transform." +msgstr "ОбчиÑлює транÑпозицію перетвореннÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." @@ -8420,7 +8510,7 @@ msgstr "ОбчиÑлює ÑкалÑрний добуток двох вектор #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8452,14 +8542,14 @@ msgstr "1.0 / вектор" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"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 a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "Повертає вектор, Ñкий вказує напрÑмок рефракції." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8558,64 +8648,59 @@ msgstr "" "напрÑмку поглÑду камери (функції Ñлід передати відповіді вхідні дані)." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." -msgstr "" -"(Лише GLES3) (лише у режимі фрагментів або Ñвітла) Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ ÑкалÑрної " -"похідної." +msgid "(Fragment/Light mode only) Scalar derivative function." +msgstr "(лише у режимі фрагментів або Ñвітла) Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ ÑкалÑрної похідної." #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." -msgstr "" -"(Лише GLES3) (лише у режимі фрагментів або Ñвітла) Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ Ð²ÐµÐºÑ‚Ð¾Ñ€Ð½Ð¾Ñ— " -"похідної." +msgid "(Fragment/Light mode only) Vector derivative function." +msgstr "(лише у режимі фрагментів або Ñвітла) Ð¤ÑƒÐ½ÐºÑ†Ñ–Ñ Ð²ÐµÐºÑ‚Ð¾Ñ€Ð½Ð¾Ñ— похідної." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" -"(Лише GLES3) (лише у режимі фрагментів або Ñвітла) (вектор) Похідна у «x» на " -"оÑнові локального диференціюваннÑ." +"(лише у режимі фрагментів або Ñвітла) (вектор) Похідна у «x» на оÑнові " +"локального диференціюваннÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" -"(Лише GLES3) (лише у режимі фрагментів або Ñвітла) (ÑкалÑÑ€) Похідна у «x» на " -"оÑнові локального диференціюваннÑ." +"(лише у режимі фрагментів або Ñвітла) (ÑкалÑÑ€) Похідна у «x» на оÑнові " +"локального диференціюваннÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" -"(Лише GLES3) (лише у режимі фрагментів або Ñвітла) (вектор) Похідна у «y» на " -"оÑнові локального диференціюваннÑ." +"(лише у режимі фрагментів або Ñвітла) (вектор) Похідна у «y» на оÑнові " +"локального диференціюваннÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" -"(Лише GLES3) (лише у режимі фрагментів або Ñвітла) (ÑкалÑÑ€) Похідна у «y» на " -"оÑнові локального диференціюваннÑ." +"(лише у режимі фрагментів або Ñвітла) (ÑкалÑÑ€) Похідна у «y» на оÑнові " +"локального диференціюваннÑ." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(Лише GLES3) (лише у режимі фрагментів або Ñвітла) (вектор) Сума похідних за " -"модулем у «x» та «y»." +"(лише у режимі фрагментів або Ñвітла) (вектор) Сума похідних за модулем у " +"«x» та «y»." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" -"(Лише GLES3) (лише у режимі фрагментів або Ñвітла) Сума похідних за модулем " -"у «x» та «y»." +"(лише у режимі фрагментів або Ñвітла) Сума похідних за модулем у «x» та «y»." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -9842,6 +9927,11 @@ msgid "Extend Script" msgstr "Розширити Ñкрипт" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "Змінити батьківÑький вузол" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "Зробити кореневим Ð´Ð»Ñ Ñцени" @@ -10058,8 +10148,8 @@ msgid "Script is valid." msgstr "Скрипт Ñ” коректним." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" -msgstr "Можна викориÑтовувати: a-z, A-Z, 0-9 Ñ– _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." +msgstr "Можна викориÑтовувати: a-z, A-Z, 0-9, _ Ñ– ." #: editor/script_create_dialog.cpp msgid "Built-in script (into scene file)." @@ -11138,7 +11228,6 @@ msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "Ðекоректні розмірноÑті Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð²Ñ–ÐºÐ½Ð° Ð²Ñ–Ñ‚Ð°Ð½Ð½Ñ (мають бути 620x300)." #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." @@ -11206,11 +11295,10 @@ msgstr "" "увімкненим параметром «ÐÐ½Ñ–Ð¼Ð°Ñ†Ñ–Ñ Ñ‡Ð°Ñток»." #: scene/2d/light_2d.cpp -#, fuzzy msgid "" "A texture with the shape of the light must be supplied to the \"Texture\" " "property." -msgstr "Ð”Ð»Ñ Ð²Ð»Ð°ÑтивоÑті «texture» Ñлід надати текÑтуру із формою оÑвітленнÑ." +msgstr "Ð”Ð»Ñ Ð²Ð»Ð°ÑтивоÑті «Texture» Ñлід надати текÑтуру із формою оÑвітленнÑ." #: scene/2d/light_occluder_2d.cpp msgid "" @@ -11220,11 +11308,10 @@ msgstr "" "багатокутник затулÑннÑ." #: scene/2d/light_occluder_2d.cpp -#, fuzzy msgid "The occluder polygon for this occluder is empty. Please draw a polygon." msgstr "" "Ð”Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ затулÑÐ½Ð½Ñ Ð±Ð°Ð³Ð°Ñ‚Ð¾ÐºÑƒÑ‚Ð½Ð¸Ðº Ñ” порожнім. Будь лаÑка, намалюйте " -"багатокутник!" +"багатокутник." #: scene/2d/navigation_polygon.cpp msgid "" @@ -11324,7 +11411,6 @@ msgstr "" "форми." #: scene/2d/visibility_notifier_2d.cpp -#, fuzzy msgid "" "VisibilityEnabler2D works best when used with the edited scene root directly " "as parent." @@ -11333,9 +11419,8 @@ msgstr "" "безпоÑереднім батьківÑьким елементом — редагованим коренем Ñцени." #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera повинен мати батьківÑьким вузлом вузол ARVROrigin" +msgstr "ARVRCamera повинен мати батьківÑьким вузлом вузол ARVROrigin." #: scene/3d/arvr_nodes.cpp msgid "ARVRController must have an ARVROrigin node as its parent." @@ -11425,13 +11510,12 @@ msgstr "" "Area, StaticBody, RigidBody, KinematicBody тощо, щоб надати їм форми." #: scene/3d/collision_shape.cpp -#, fuzzy msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it." msgstr "" "Ð”Ð»Ñ Ð·Ð°Ð±ÐµÐ·Ð¿ÐµÑ‡ÐµÐ½Ð½Ñ Ð¿Ñ€Ð°Ñ†ÐµÐ·Ð´Ð°Ñ‚Ð½Ð¾Ñті CollisionShape Ñлід надати форму. Будь " -"лаÑка, Ñтворіть реÑÑƒÑ€Ñ Ñ„Ð¾Ñ€Ð¼Ð¸ Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ елемента!" +"лаÑка, Ñтворіть реÑÑƒÑ€Ñ Ñ„Ð¾Ñ€Ð¼Ð¸ Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ елемента." #: scene/3d/collision_shape.cpp msgid "" @@ -11467,7 +11551,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." -msgstr "" +msgstr "SpotLight з кутом, Ñкий Ñ” більшим за 90 градуÑів, не може давати тіні." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11513,12 +11597,11 @@ msgid "PathFollow only works when set as a child of a Path node." msgstr "PathFollow працюватиме лише Ñк дочірній елемент вузла Path." #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED потребує Ð²Ð¼Ð¸ÐºÐ°Ð½Ð½Ñ Â«Up Vector» у його " +"ROTATION_ORIENTED у PathFollow потребує Ð²Ð¼Ð¸ÐºÐ°Ð½Ð½Ñ Â«Up Vector» у його " "батьківÑькому реÑурÑÑ– Curve у Path." #: scene/3d/physics_body.cpp @@ -11532,13 +11615,12 @@ msgstr "" "ЗаміÑть цієї зміни, вам варто змінити розміри дочірніх форм зіткненнÑ." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." msgstr "" -"Щоб уÑе працювало Ñк Ñлід, влаÑтивіÑть шлÑху (path) має вказувати на " -"коректний вузол Spatial." +"Щоб уÑе працювало Ñк Ñлід, влаÑтивіÑть «Remote Path» має вказувати на " +"коректний вузол Spatial або похідний від Spatial." #: scene/3d/soft_body.cpp msgid "This body will be ignored until you set a mesh." @@ -11554,13 +11636,12 @@ msgstr "" "ЗаміÑть цієї зміни, вам варто змінити розміри дочірніх форм зіткненнÑ." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite3D to display frames." msgstr "" -"Щоб AnimatedSprite могла показувати кадри, має бути Ñтворено або вÑтановлено " -"у влаÑтивоÑті «Frames» реÑÑƒÑ€Ñ SpriteFrames." +"Щоб AnimatedSprite3D могла показувати кадри, має бути Ñтворено або " +"вÑтановлено у влаÑтивоÑті «Frames» реÑÑƒÑ€Ñ SpriteFrames." #: scene/3d/vehicle_body.cpp msgid "" @@ -11575,6 +11656,8 @@ msgid "" "WorldEnvironment requires its \"Environment\" property to contain an " "Environment to have a visible effect." msgstr "" +"Щоб WorldEnvironment мала видимий ефект, Ñ—Ñ— влаÑтивіÑть «Environment» має " +"міÑтити Ñередовище." #: scene/3d/world_environment.cpp msgid "" @@ -11613,7 +11696,6 @@ msgid "Nothing connected to input '%s' of node '%s'." msgstr "Ðічого не з'єднано із входом «%s» вузла «%s»." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "No root AnimationNode for the graph is set." msgstr "Кореневий елемент AnimationNode Ð´Ð»Ñ Ð³Ñ€Ð°Ñ„Ñƒ не вÑтановлено." @@ -11627,7 +11709,6 @@ msgstr "" "ШлÑÑ…, вÑтановлений Ð´Ð»Ñ AnimationPlayer, не веде до вузла AnimationPlayer." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "The AnimationPlayer root node is not a valid node." msgstr "Кореневий елемент AnimationPlayer не Ñ” коректним вузлом." @@ -11657,7 +11738,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" @@ -11686,7 +11766,6 @@ msgid "Please Confirm..." msgstr "Будь лаÑка, підтвердьте..." #: scene/gui/popup.cpp -#, fuzzy msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " "functions. Making them visible for editing is fine, but they will hide upon " @@ -11697,12 +11776,10 @@ msgstr "" "практика. Втім, Ñлід пам'Ñтати, що під Ñ‡Ð°Ñ Ð·Ð°Ð¿ÑƒÑку Ñ—Ñ… буде приховано." #: scene/gui/range.cpp -#, fuzzy msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." -msgstr "Якщо exp_edit має Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ true, min_value має бути > 0." +msgstr "Якщо увімкнено «Exp Edit», «Min Value» має бути > 0." #: scene/gui/scroll_container.cpp -#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " @@ -11758,14 +11835,17 @@ msgid "Input" msgstr "Вхідні дані" #: scene/resources/visual_shader_nodes.cpp -#, fuzzy msgid "Invalid source for preview." -msgstr "Ðекоректне джерело програми побудови тіней." +msgstr "Ðекоректне джерело Ð´Ð»Ñ Ð¿Ð¾Ð¿ÐµÑ€ÐµÐ´Ð½ÑŒÐ¾Ð³Ð¾ переглÑду." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for shader." msgstr "Ðекоректне джерело програми побудови тіней." +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "Ðекоректна Ñ„ÑƒÐ½ÐºÑ†Ñ–Ñ Ð¿Ð¾Ñ€Ñ–Ð²Ð½ÑÐ½Ð½Ñ Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ типу." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "ÐŸÑ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ„ÑƒÐ½ÐºÑ†Ñ–Ð¹Ð½Ð¾Ð³Ð¾." @@ -11782,6 +11862,27 @@ msgstr "Змінні величини можна пов'Ñзувати лише msgid "Constants cannot be modified." msgstr "Сталі не можна змінювати." +#~ msgid "Previous Folder" +#~ msgstr "ÐŸÐ¾Ð¿ÐµÑ€ÐµÐ´Ð½Ñ Ñ‚ÐµÐºÐ°" + +#~ msgid "Next Folder" +#~ msgstr "ÐаÑтупна тека" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "Ðвтоматично відкривати знімки вікон" + +#~ msgid "Open in an external image editor." +#~ msgstr "Відкрити у зовнішньому редакторі зображень." + +#~ msgid "Reverse" +#~ msgstr "Зворотний" + +#~ msgid "Mirror X" +#~ msgstr "Віддзеркалити за X" + +#~ msgid "Mirror Y" +#~ msgstr "Віддзеркалити за Y" + #~ msgid "Generating solution..." #~ msgstr "Ð¡Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ€Ð¾Ð·Ð²'Ñзку..." diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po index cccbdbf067..f22e442132 100644 --- a/editor/translations/ur_PK.po +++ b/editor/translations/ur_PK.po @@ -133,6 +133,26 @@ msgid "Anim Change Call" msgstr "" #: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Time" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transition" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Transform" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Keyframe Value" +msgstr "" + +#: editor/animation_track_editor.cpp +msgid "Anim Multi Change Call" +msgstr "" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "" @@ -1122,7 +1142,6 @@ msgid "Success!" msgstr "" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "" @@ -1670,7 +1689,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "" @@ -1721,7 +1740,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "" @@ -1748,24 +1767,30 @@ msgid "Move Favorite Down" msgstr "Ù¾Ø³Ù†Ø¯ÛŒØ¯Û Ù†ÛŒÚ†Û’ منتقل کریں" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "" +#, fuzzy +msgid "Go to previous folder." +msgstr "سب سکریپشن بنائیں" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "" +#, fuzzy +msgid "Go to next folder." +msgstr "سب سکریپشن بنائیں" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "سب سکریپشن بنائیں" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Refresh files." +msgstr "" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +msgid "Toggle the visibility of hidden files." msgstr "" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2451,6 +2476,11 @@ msgid "Go to previously opened scene." msgstr "" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr ".تمام کا انتخاب" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "" @@ -2642,14 +2672,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "" @@ -2964,6 +2986,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr ".تمام کا انتخاب" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4617,6 +4644,10 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +msgid "Install..." +msgstr "" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "" @@ -4645,7 +4676,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "" @@ -4659,7 +4689,7 @@ msgid "Sort:" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" +msgid "Reverse sorting." msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp @@ -4734,35 +4764,39 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "" +#, fuzzy +msgid "Move Vertical Guide" +msgstr "سب سکریپشن بنائیں" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "سب سکریپشن بنائیں" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr ".تمام کا انتخاب" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "" +#, fuzzy +msgid "Move Horizontal Guide" +msgstr ".تمام کا انتخاب" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "سب سکریپشن بنائیں" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr ".تمام کا انتخاب" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" +msgstr "سب سکریپشن بنائیں" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -6657,7 +6691,12 @@ msgstr "" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align with View" +msgid "Align Transform with View" +msgstr ".تمام کا انتخاب" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" msgstr ".تمام کا انتخاب" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6844,11 +6883,6 @@ msgstr ".تمام کا انتخاب" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy -msgid "Align Selection With View" -msgstr ".تمام کا انتخاب" - -#: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Tool Select" msgstr ".تمام کا انتخاب" @@ -7423,14 +7457,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7836,6 +7862,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7923,6 +7953,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7930,10 +7976,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8022,7 +8102,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8030,7 +8110,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8042,7 +8122,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8059,7 +8139,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8128,11 +8208,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8148,7 +8228,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8176,11 +8256,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8220,11 +8300,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8234,7 +8318,7 @@ msgstr "سب سکریپشن بنائیں" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8252,15 +8336,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8312,7 +8396,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8340,12 +8424,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8422,47 +8506,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9626,6 +9710,11 @@ msgid "Extend Script" msgstr "سب سکریپشن بنائیں" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "سب سکریپشن بنائیں" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9834,7 +9923,7 @@ msgid "Script is valid." msgstr "" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11374,6 +11463,10 @@ msgstr "" msgid "Invalid source for shader." msgstr "" +#: scene/resources/visual_shader_nodes.cpp +msgid "Invalid comparison function for that type." +msgstr "" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" diff --git a/editor/translations/vi.po b/editor/translations/vi.po index e30b7b02b6..b8707a154c 100644 --- a/editor/translations/vi.po +++ b/editor/translations/vi.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-02 10:49+0000\n" +"PO-Revision-Date: 2019-07-29 19:20+0000\n" "Last-Translator: Steve Dang <itsnguu@outlook.com>\n" "Language-Team: Vietnamese <https://hosted.weblate.org/projects/godot-engine/" "godot/vi/>\n" @@ -28,7 +28,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 "" +msgstr "Hà m convert() có đối số không hợp lệ, sá» dụng các hằng TYPE_*." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -71,7 +71,7 @@ msgstr "Miá»…n phÃ" #: editor/animation_bezier_editor.cpp msgid "Balanced" -msgstr "" +msgstr "Cân bằng" #: editor/animation_bezier_editor.cpp msgid "Mirror" @@ -86,14 +86,12 @@ msgid "Value:" msgstr "Giá trị:" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Insert Key Here" -msgstr "Chèn Key Anim" +msgstr "Thêm Khoá Tại Äây" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Duplicate Selected Key(s)" -msgstr "Nhân đôi lá»±a chá»n" +msgstr "Nhân đôi các khoá đã chá»n" #: editor/animation_bezier_editor.cpp msgid "Delete Selected Key(s)" @@ -101,12 +99,11 @@ msgstr "Xoá Key(s) được chá»n" #: editor/animation_bezier_editor.cpp msgid "Add Bezier Point" -msgstr "" +msgstr "Thêm Ä‘iểm Bezier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Di chuyển đến..." +msgstr "Di chuyển Ä‘iểm Bezier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -138,13 +135,37 @@ msgstr "Äổi Function Gá»i Animation" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "Äổi thá»i gian khung hình" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "Äổi Transition Animation" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "Äổi Transform Animation" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "Äổi giá trị khung hình" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "Äổi Function Gá»i Animation" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" -msgstr "Äổi vòng lặp Anim" +msgstr "Thay Äá»™ Dà i Hoạt Ảnh" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "" +msgstr "Chỉnh Vòng Lặp Hoạt Ảnh" #: editor/animation_track_editor.cpp msgid "Property Track" @@ -172,14 +193,12 @@ msgid "Animation Playback Track" msgstr "Ngưng chạy animation. (S)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (frames)" -msgstr "Äá»™ dà i Animation (giây)." +msgstr "Äá»™ dà i hoạt ảnh (khung hình)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (seconds)" -msgstr "Äá»™ dà i Animation (giây)." +msgstr "Äá»™ dà i hoạt ảnh (giây)" #: editor/animation_track_editor.cpp #, fuzzy @@ -187,9 +206,8 @@ msgid "Add Track" msgstr "Thêm Track Animation" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation Looping" -msgstr "Phóng Animation." +msgstr "Vòng Lặp Hoạt Ảnh" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -366,7 +384,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Animation tracks can only point to AnimationPlayer nodes." -msgstr "" +msgstr "Các bản hoạt ảnh chỉ có thể trá» tá»›i các nút AnimationPlayer." #: editor/animation_track_editor.cpp msgid "An animation player can't animate itself, only other players." @@ -454,12 +472,11 @@ 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 "" +msgstr "Chá»n Toà n Bá»™" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select None" -msgstr "Chế độ chá»n" +msgstr "Chá»n Không có" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." @@ -470,14 +487,12 @@ msgid "Group tracks by node or display them as plain list." msgstr "" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Snap:" -msgstr "Bước (s):" +msgstr "Chụp:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation step value." -msgstr "Phóng Animation." +msgstr "Giá trị bước hoạt ảnh." #: editor/animation_track_editor.cpp msgid "Seconds" @@ -521,27 +536,24 @@ msgid "Duplicate Transposed" msgstr "" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Delete Selection" -msgstr "Nhân đôi lá»±a chá»n" +msgstr "Xoá lá»±a chá»n" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Go to Next Step" -msgstr "Äến Step tiếp theo" +msgstr "Äến Bước tiếp theo" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Go to Previous Step" -msgstr "Äến Step trước đó" +msgstr "Äến Bước trước đó" #: editor/animation_track_editor.cpp msgid "Optimize Animation" -msgstr "Tối ưu Animation" +msgstr "Tối ưu Hoạt ảnh" #: editor/animation_track_editor.cpp msgid "Clean-Up Animation" -msgstr "Dá»n dẹp Animation" +msgstr "Dá»n dẹp Hoạt ảnh" #: editor/animation_track_editor.cpp msgid "Pick the node that will be animated:" @@ -573,12 +585,11 @@ msgstr "Tối ưu" #: editor/animation_track_editor.cpp msgid "Remove invalid keys" -msgstr "Há»§y key không đúng chuẩn" +msgstr "Gỡ bá» các khoá không hợp lệ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Remove unresolved and empty tracks" -msgstr "Gỡ bá» track trống và không tìm thấy" +msgstr "Gỡ bá» các Tracks không thể xá» lý và trống" #: editor/animation_track_editor.cpp msgid "Clean-up all animations" @@ -586,7 +597,7 @@ msgstr "Dá»n dẹp tất cả animations" #: editor/animation_track_editor.cpp msgid "Clean-Up Animation(s) (NO UNDO!)" -msgstr "Dá»n dẹp tất cả Animation (KHÔNG THỂ Há»’I LẠI)" +msgstr "Dá»n dẹp tất cả Hoạt ảnh (KHÔNG THỂ Há»’I LẠI)" #: editor/animation_track_editor.cpp msgid "Clean-Up" @@ -598,7 +609,7 @@ msgstr "Tỉ lệ Scale:" #: editor/animation_track_editor.cpp msgid "Select tracks to copy:" -msgstr "" +msgstr "Chá»n các Track để sao chép:" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -610,9 +621,8 @@ msgid "Copy" msgstr "Sao chép" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Thêm Track Animation" +msgstr "Thêm Track Âm thanh" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" @@ -644,20 +654,19 @@ msgstr "Dòng số:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "Tìm thấy %d khá»›p." #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" -msgstr "Không tìm thấy" +msgstr "Không khá»›p" #: editor/code_editor.cpp msgid "Replaced %d occurrence(s)." -msgstr "" +msgstr "Äã thay thế %d biến cố." #: editor/code_editor.cpp editor/find_in_files.cpp -#, fuzzy msgid "Match Case" -msgstr "Trùng khá»›p" +msgstr "Khá»›p Trưá»ng Hợp" #: editor/code_editor.cpp editor/find_in_files.cpp msgid "Whole Words" @@ -705,37 +714,32 @@ msgid "Line and column numbers." msgstr "Số dòng và cá»™t." #: editor/connections_dialog.cpp -#, fuzzy msgid "Method in target node must be specified." -msgstr "Cách thức trong Node được chá»n phải được ghi rõ!" +msgstr "Phương thức trong nút Ä‘Ãch phải được chỉ định." #: editor/connections_dialog.cpp -#, fuzzy msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." msgstr "" -"Cách thức cá»§a đối tượng không tìm thấy! ghi rõ má»™t cách thức hợp lệ hoặc " -"Ä‘Ãnh kèm má»™t script cho đối tượng Node." +"Phương thức không tìm thấy. Chỉ định phương thức hợp lệ hoặc Ä‘Ãnh kèm tệp " +"lệnh và o nút." #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect to Node:" -msgstr "Kết nối đến Node:" +msgstr "Kết nối đến Nút:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect to Script:" -msgstr "Không thể kết nối tá»›i host:" +msgstr "Kết nối Tệp lệnh:" #: editor/connections_dialog.cpp -#, fuzzy msgid "From Signal:" -msgstr "Äang kết nối Signal:" +msgstr "Từ tÃn hiệu:" #: editor/connections_dialog.cpp msgid "Scene does not contain any script." -msgstr "Cảnh không chứa mã lệnh." +msgstr "Cảnh không chứa tệp lệnh." #: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp @@ -755,27 +759,26 @@ msgid "Remove" msgstr "Xóa" #: editor/connections_dialog.cpp -#, fuzzy msgid "Add Extra Call Argument:" -msgstr "Thêm đối số:" +msgstr "Thêm đối số mở rá»™ng:" #: editor/connections_dialog.cpp msgid "Extra Call Arguments:" -msgstr "" +msgstr "Mở rá»™ng Äối số được gá»i:" #: editor/connections_dialog.cpp msgid "Advanced" msgstr "Nâng cao" #: editor/connections_dialog.cpp -#, fuzzy msgid "Deferred" -msgstr "Hoãn lại" +msgstr "Trì hoãn" #: editor/connections_dialog.cpp msgid "" "Defers the signal, storing it in a queue and only firing it at idle time." msgstr "" +"Trì hoãn tÃn hiệu, lưu và o má»™t hà ng chá» và chỉ kÃch nó và o thá»i gian rãnh." #: editor/connections_dialog.cpp msgid "Oneshot" @@ -808,7 +811,6 @@ msgid "Connect" msgstr "Kết nối" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" msgstr "TÃn hiệu:" @@ -821,9 +823,8 @@ msgid "Disconnect '%s' from '%s'" msgstr "Há»§y kết nối '%s' từ '%s'" #: editor/connections_dialog.cpp -#, fuzzy msgid "Disconnect all from signal: '%s'" -msgstr "Há»§y kết nối '%s' từ '%s'" +msgstr "Dừng kết nối tất cả từ tÃn hiệu: '%s'" #: editor/connections_dialog.cpp msgid "Connect..." @@ -868,7 +869,7 @@ msgstr "Äến Method" #: editor/create_dialog.cpp msgid "Change %s Type" -msgstr "Äổi %s Type" +msgstr "Äổi %s Loại" #: editor/create_dialog.cpp editor/project_settings_editor.cpp msgid "Change" @@ -921,38 +922,42 @@ msgid "" "Scene '%s' is currently being edited.\n" "Changes will only take effect when reloaded." msgstr "" +"Cảnh '%s' hiện Ä‘ang được chỉnh sá»a.\n" +"Các thay đổi chỉ có hiệu lá»±c khi tải lại." #: editor/dependency_editor.cpp msgid "" "Resource '%s' is in use.\n" "Changes will only take effect when reloaded." msgstr "" +"Tà i nguyên '%s' Ä‘ang sá» dụng.\n" +"Thay đổi sẽ chỉ hiệu lá»±c khi tải lại." #: editor/dependency_editor.cpp #: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "Dependencies" -msgstr "" +msgstr "Các phụ thuá»™c" #: editor/dependency_editor.cpp msgid "Resource" -msgstr "" +msgstr "Tà i nguyên" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp #: editor/project_settings_editor.cpp editor/script_create_dialog.cpp msgid "Path" -msgstr "" +msgstr "ÄÆ°á»ng dẫn" #: editor/dependency_editor.cpp msgid "Dependencies:" -msgstr "" +msgstr "Các phụ thuá»™c:" #: editor/dependency_editor.cpp msgid "Fix Broken" -msgstr "" +msgstr "Sá»a chữa" #: editor/dependency_editor.cpp msgid "Dependency Editor" -msgstr "" +msgstr "Trình chỉnh sá»a Phụ thuá»™c" #: editor/dependency_editor.cpp msgid "Search Replacement Resource:" @@ -970,11 +975,11 @@ msgstr "Mở" #: editor/dependency_editor.cpp msgid "Owners Of:" -msgstr "" +msgstr "Sở hữu cá»§a:" #: editor/dependency_editor.cpp msgid "Remove selected files from the project? (Can't be restored)" -msgstr "" +msgstr "Gỡ bá» các tệp đã chá»n trong dá»± án? (Không thể khôi phục)" #: editor/dependency_editor.cpp msgid "" @@ -997,15 +1002,15 @@ msgstr "" #: editor/dependency_editor.cpp editor/editor_node.cpp msgid "Open Anyway" -msgstr "" +msgstr "Luôn mở" #: editor/dependency_editor.cpp msgid "Which action should be taken?" -msgstr "" +msgstr "Chá»n hà nh động nên thá»±c hiện?" #: editor/dependency_editor.cpp msgid "Fix Dependencies" -msgstr "" +msgstr "Sá»a các phần phụ thuá»™c" #: editor/dependency_editor.cpp msgid "Errors loading!" @@ -1034,7 +1039,7 @@ msgstr "Xóa" #: editor/dependency_editor.cpp msgid "Owns" -msgstr "" +msgstr "Sở hữu" #: editor/dependency_editor.cpp msgid "Resources Without Explicit Ownership:" @@ -1119,6 +1124,10 @@ msgid "" "is an exhaustive list of all such thirdparty components with their " "respective copyright statements and license terms." msgstr "" +"Godot Engine dá»±a trên má»™t số thư viện mã nguồn mở và miá»…n phà cá»§a bên thứ " +"ba, tất cả Ä‘á»u phù hợp vá»›i các Ä‘iá»u khoản trong giấy phép MIT. Sau đây là " +"danh sách tất cả các thà nh phần cá»§a bên thứ ba vá»›i các Ä‘iá»u khoản bản quyá»n " +"và điá»u khoản cấp phép tương ứng." #: editor/editor_about.cpp msgid "All Components" @@ -1138,7 +1147,7 @@ msgstr "Lá»—i không thể mở gói, không phải dạng nén." #: editor/editor_asset_installer.cpp msgid "Uncompressing Assets" -msgstr "" +msgstr "Giải nén Assets" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "Package installed successfully!" @@ -1150,7 +1159,6 @@ msgid "Success!" msgstr "Thà nh công!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "Cà i đặt" @@ -1160,7 +1168,7 @@ msgstr "Gói cà i đặt" #: editor/editor_audio_buses.cpp msgid "Speakers" -msgstr "" +msgstr "Máy phát thanh" #: editor/editor_audio_buses.cpp msgid "Add Effect" @@ -1269,7 +1277,7 @@ msgstr "" #: editor/editor_audio_buses.cpp msgid "Location for New Layout..." -msgstr "" +msgstr "Vị trà cho Bố cục má»›i..." #: editor/editor_audio_buses.cpp msgid "Open Audio Bus Layout" @@ -1688,7 +1696,7 @@ msgstr "Xem trong trình quản lý tệp" msgid "New Folder..." msgstr "Thư mục má»›i ..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "Là m má»›i" @@ -1739,7 +1747,7 @@ msgstr "Tiến tá»›i" msgid "Go Up" msgstr "Äi Lên" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "Báºt tắt File ẩn" @@ -1764,23 +1772,31 @@ msgid "Move Favorite Down" msgstr "Di chuyển Ưa thÃch xuống" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "Thư mục trước" +#, fuzzy +msgid "Go to previous folder." +msgstr "Äến thư mục cha" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "Thư mục sau" +#, fuzzy +msgid "Go to next folder." +msgstr "Äến thư mục cha" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "Äến thư mục cha" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "Tìm kiếm tệp tin" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "Bá» yêu thÃch thư mục hiện tại." -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "Báºt tắt hiện các tệp tin ẩn." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2489,6 +2505,11 @@ msgid "Go to previously opened scene." msgstr "Trở vá» cảnh đã mở trước đó." #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "Sao chép đưá»ng dẫn" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "Tab tiếp theo" @@ -2683,14 +2704,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "Mở thư mục dữ liệu Trình biên táºp" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "Chế độ Toà n mà n hình" @@ -3006,6 +3019,11 @@ msgstr "" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "Lưu Theme" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -3909,7 +3927,7 @@ msgstr "" #: editor/plugins/animation_state_machine_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Animation" -msgstr "Thêm Animation" +msgstr "Thêm Hoạt ảnh" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -4111,7 +4129,7 @@ msgstr "Äổi bá»™ lá»c" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." -msgstr "" +msgstr "Không có trình phát hoạt ảnh, không thể truy xuất tên." #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Player path set is invalid, so unable to retrieve track names." @@ -4123,6 +4141,7 @@ msgid "" "Animation player has no valid root node path, so unable to retrieve track " "names." msgstr "" +"TrÃnh phát hoạt ảnh không có đưá»ng dẫn nút Gốc, không thể truy xuất tên." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp @@ -4227,7 +4246,7 @@ msgstr "Chạy hoạt ảnh đã chá»n ngược lại từ cuối. (Shift+A)" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Stop animation playback. (S)" -msgstr "Ngưng chạy hoạt ảnh. (S)" +msgstr "Dừng chạy lại hoạt ảnh. (S)" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation from start. (Shift+D)" @@ -4653,6 +4672,11 @@ msgid "Idle" msgstr "Chạy không" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "Cà i đặt" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "Thá» lại" @@ -4681,7 +4705,6 @@ msgid "Last" msgstr "Cuối cùng" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "Tất cả" @@ -4695,8 +4718,9 @@ msgid "Sort:" msgstr "Sắp xếp:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "Ngược lại" +#, fuzzy +msgid "Reverse sorting." +msgstr "Äang yêu cầu..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4770,31 +4794,35 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +msgid "Move Vertical Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" -msgstr "" +#, fuzzy +msgid "Create Vertical Guide" +msgstr "Tạo Folder" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "Xoá Variable" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +msgid "Move Horizontal Guide" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" -msgstr "" +#, fuzzy +msgid "Create Horizontal Guide" +msgstr "Tạo Root Node:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" -msgstr "" +#, fuzzy +msgid "Remove Horizontal Guide" +msgstr "Há»§y key không đúng chuẩn" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +msgid "Create Horizontal and Vertical Guides" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6699,7 +6727,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -6884,10 +6916,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "" @@ -7469,14 +7497,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -7893,6 +7913,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -7984,6 +8008,22 @@ msgid "Color uniform." msgstr "Äổi Transform Animation" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -7991,10 +8031,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8084,7 +8158,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8092,7 +8166,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8104,7 +8178,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8121,7 +8195,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8190,11 +8264,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8210,7 +8284,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8238,11 +8312,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8283,11 +8357,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8297,7 +8375,7 @@ msgstr "Tạo" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8315,15 +8393,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8375,7 +8453,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8403,12 +8481,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8485,47 +8563,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9700,6 +9778,11 @@ 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." + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "" @@ -9914,7 +9997,7 @@ msgid "Script is valid." msgstr "Animation tree khả dụng." #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11455,6 +11538,11 @@ msgstr "nguồn vô hiệu cho shader." msgid "Invalid source for shader." msgstr "nguồn vô hiệu cho shader." +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "nguồn vô hiệu cho shader." + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11471,6 +11559,15 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Previous Folder" +#~ msgstr "Thư mục trước" + +#~ msgid "Next Folder" +#~ msgstr "Thư mục sau" + +#~ msgid "Reverse" +#~ msgstr "Ngược lại" + #~ msgid "Enabled Classes" #~ msgstr "Các lá»›p đã báºt" diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po index a789fbbaaa..affef14b72 100644 --- a/editor/translations/zh_CN.po +++ b/editor/translations/zh_CN.po @@ -48,12 +48,16 @@ # DS <dseqrasd@126.com>, 2019. # ZeroAurora <zeroaurora@qq.com>, 2019. # Gary Wang <wzc782970009@gmail.com>, 2019. +# ASC_8384 <ASC8384ST@gmail.com>, 2019. +# Lyu Shiqing <shiqing-thu18@yandex.com>, 2019. +# ColdThunder11 <lslyj27761@gmail.com>, 2019. +# liu lizhi <kz-xy@163.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-07-09 10:47+0000\n" -"Last-Translator: Gary Wang <wzc782970009@gmail.com>\n" +"PO-Revision-Date: 2019-07-19 13:42+0000\n" +"Last-Translator: liu lizhi <kz-xy@163.com>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot/zh_Hans/>\n" "Language: zh_CN\n" @@ -172,6 +176,31 @@ msgid "Anim Change Call" msgstr "修改回调" #: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "修改动画关键帧的时长" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "修改动画过渡方å¼" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "ä¿®æ”¹åŠ¨ç”»å˜æ¢" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "修改动画关键帧的值" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "修改回调" + +#: editor/animation_track_editor.cpp msgid "Change Animation Length" msgstr "修改动画长度" @@ -471,6 +500,11 @@ msgid "" "Alternatively, use an import preset that imports animations to separate " "files." msgstr "" +"æ¤åŠ¨ç”»å±žäºŽå¯¼å…¥çš„åœºæ™¯ï¼Œå› æ¤ä¸ä¼šä¿å˜å¯¹å¯¼å…¥è½¨é“的更改。\n" +"\n" +"è¦å¯ç”¨æ·»åŠ è‡ªå®šä¹‰è½¨é“的功能,å¯ä»¥å¯¼èˆªåˆ°åœºæ™¯çš„导入设置,将\n" +"“动画 > å˜å‚¨â€è®¾ä¸ºâ€œæ–‡ä»¶â€ï¼Œå¯ç”¨â€œåŠ¨ç”» > ä¿ç•™è‡ªå®šä¹‰è½¨é“â€å¹¶é‡æ–°å¯¼å…¥ã€‚\n" +"或者也å¯ä»¥é€‰æ‹©ä¸€ä¸ªå¯¼å…¥åŠ¨ç”»çš„å¯¼å…¥é¢„è®¾ä»¥åˆ†éš”æ–‡ä»¶ã€‚" #: editor/animation_track_editor.cpp msgid "Warning: Editing imported animation" @@ -661,7 +695,7 @@ msgstr "行å·:" #: editor/code_editor.cpp msgid "Found %d match(es)." -msgstr "" +msgstr "找到%d个匹é…项。" #: editor/code_editor.cpp editor/editor_help.cpp msgid "No Matches" @@ -721,16 +755,14 @@ msgid "Line and column numbers." msgstr "行å·å’Œåˆ—å·ã€‚" #: editor/connections_dialog.cpp -#, fuzzy msgid "Method in target node must be specified." -msgstr "å¿…é¡»æŒ‡å®šç›®æ ‡èŠ‚ç‚¹çš„æ–¹æ³•ï¼" +msgstr "å¿…é¡»æŒ‡å®šç›®æ ‡èŠ‚ç‚¹çš„æ–¹æ³•ã€‚" #: editor/connections_dialog.cpp -#, fuzzy msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." -msgstr "找ä¸åˆ°ç›®æ ‡æ–¹æ³•ï¼ è¯·æŒ‡å®šä¸€ä¸ªæœ‰æ•ˆçš„æ–¹æ³•æˆ–æŠŠè„šæœ¬é™„åŠ åˆ°ç›®æ ‡èŠ‚ç‚¹ã€‚" +msgstr "找ä¸åˆ°ç›®æ ‡æ–¹æ³•ï¼ è¯·æŒ‡å®šä¸€ä¸ªæœ‰æ•ˆçš„æ–¹æ³•æˆ–è€…æŠŠè„šæœ¬é™„åŠ åˆ°ç›®æ ‡èŠ‚ç‚¹ã€‚" #: editor/connections_dialog.cpp msgid "Connect to Node:" @@ -741,7 +773,6 @@ msgid "Connect to Script:" msgstr "连接到脚本:" #: editor/connections_dialog.cpp -#, fuzzy msgid "From Signal:" msgstr "ä¿¡å·æº:" @@ -775,7 +806,6 @@ msgid "Extra Call Arguments:" msgstr "é¢å¤–è°ƒç”¨å‚æ•°:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Advanced" msgstr "高级选项" @@ -819,7 +849,6 @@ msgid "Connect" msgstr "连接" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" msgstr "ä¿¡å·:" @@ -932,11 +961,12 @@ msgid "" msgstr "场景 '%s' å·²è¢«ä¿®æ”¹ï¼Œé‡æ–°åŠ è½½åŽç”Ÿæ•ˆã€‚" #: editor/dependency_editor.cpp -#, fuzzy msgid "" "Resource '%s' is in use.\n" "Changes will only take effect when reloaded." -msgstr "资æº'%s'æ£åœ¨ä½¿ç”¨ä¸ï¼Œä¿®æ”¹å°†åœ¨é‡æ–°åŠ è½½åŽç”Ÿæ•ˆã€‚" +msgstr "" +"资æº'%s'æ£åœ¨ä½¿ç”¨ä¸ã€‚\n" +"修改将åªåœ¨é‡æ–°åŠ è½½åŽç”Ÿæ•ˆã€‚" #: editor/dependency_editor.cpp #: modules/gdnative/gdnative_library_editor_plugin.cpp @@ -983,9 +1013,8 @@ msgid "Owners Of:" msgstr "拥有者:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "确定从项目ä¸åˆ é™¤æ–‡ä»¶ï¼Ÿï¼ˆæ¤æ“ä½œæ— æ³•æ’¤é”€ï¼‰" +msgstr "确定从项目ä¸åˆ é™¤é€‰å®šæ–‡ä»¶ï¼Ÿï¼ˆæ¤æ“ä½œæ— æ³•æ’¤é”€ï¼‰" #: editor/dependency_editor.cpp msgid "" @@ -1162,7 +1191,6 @@ msgid "Success!" msgstr "æˆåŠŸï¼" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "安装" @@ -1390,7 +1418,6 @@ msgid "Rearrange Autoloads" msgstr "釿ޒåºAutoload" #: editor/editor_autoload_settings.cpp editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid path." msgstr "è·¯å¾„éžæ³•。" @@ -1526,7 +1553,7 @@ msgstr "找ä¸åˆ°æ¨¡æ¿æ–‡ä»¶:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." -msgstr "" +msgstr "以32ä½å¹³å°å¯¼å‡ºæ—¶ï¼Œå†…嵌的PCKä¸èƒ½å¤§äºŽ4GB。" #: editor/editor_feature_profile.cpp msgid "3D Editor" @@ -1605,11 +1632,10 @@ msgid "File '%s' format is invalid, import aborted." msgstr "文件 '%s' æ ¼å¼æ— æ•ˆï¼Œå¯¼å…¥ä¸æ¢ã€‚" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." -msgstr "é…置文件 '%s' å·²å˜åœ¨ã€‚在导入之å‰é¦–先远程处ç†ï¼Œå¯¼å…¥å·²ä¸æ¢ã€‚" +msgstr "é…置文件 '%s' å·²å˜åœ¨ã€‚在导入之å‰å…ˆåˆ é™¤å®ƒï¼Œå¯¼å…¥å·²ä¸æ¢ã€‚" #: editor/editor_feature_profile.cpp msgid "Error saving profile to path: '%s'." @@ -1620,7 +1646,6 @@ msgid "Unset" msgstr "未设置" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Current Profile:" msgstr "当å‰é…置文件" @@ -1644,9 +1669,8 @@ msgid "Export" msgstr "导出" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Available Profiles:" -msgstr "å¯ç”¨é…置文件" +msgstr "å¯ç”¨é…置文件:" #: editor/editor_feature_profile.cpp msgid "Class Options" @@ -1701,7 +1725,7 @@ msgstr "在文件管ç†å™¨ä¸æ˜¾ç¤º" msgid "New Folder..." msgstr "新建文件夹 ..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "刷新" @@ -1752,7 +1776,7 @@ msgstr "å‰è¿›" msgid "Go Up" msgstr "上一级" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "åˆ‡æ¢æ˜¾ç¤ºéšè—文件" @@ -1777,23 +1801,31 @@ msgid "Move Favorite Down" msgstr "å‘下移动收è—" #: editor/editor_file_dialog.cpp -msgid "Previous Folder" -msgstr "上一个文件夹" +#, fuzzy +msgid "Go to previous folder." +msgstr "转到父文件夹。" #: editor/editor_file_dialog.cpp -msgid "Next Folder" -msgstr "下一个文件夹" +#, fuzzy +msgid "Go to next folder." +msgstr "转到父文件夹。" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." msgstr "转到父文件夹。" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "æœç´¢æ–‡ä»¶" + #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." msgstr "ï¼ˆå–æ¶ˆï¼‰æ”¶è—当剿–‡ä»¶å¤¹ã€‚" -#: editor/editor_file_dialog.cpp -msgid "Toggle visibility of hidden files." +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Toggle the visibility of hidden files." msgstr "åˆ‡æ¢æ˜¾ç¤ºéšè—文件。" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2500,6 +2532,11 @@ msgid "Go to previously opened scene." msgstr "å‰å¾€ä¸Šä¸€ä¸ªæ‰“开的场景。" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "æ‹·è´è·¯å¾„" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "下一项" @@ -2700,20 +2737,12 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "截图已ä¿å˜åˆ°ç¼–辑器设置/æ•°æ®ç›®å½•。" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "自动打开截图" - -#: editor/editor_node.cpp -msgid "Open in an external image editor." -msgstr "使用外部图åƒç¼–辑器打开。" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "免屿¨¡å¼" #: editor/editor_node.cpp msgid "Toggle System Console" -msgstr "" +msgstr "系统命令行模å¼" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -2874,6 +2903,8 @@ msgid "" "This will install the Android project for custom builds.\n" "Note that, in order to use it, it needs to be enabled per export preset." msgstr "" +"将安装Android项目以进行自定义构建。\n" +"注æ„,为了å¯ç”¨ï¼Œéœ€è¦ä¸ºæ¯ä¸ªå¯¼å‡ºé¢„设å¯ç”¨ã€‚" #: editor/editor_node.cpp msgid "" @@ -2881,6 +2912,8 @@ msgid "" "Remove the \"build\" directory manually before attempting this operation " "again." msgstr "" +"Android 构建模æ¿å·²ç»å®‰è£…且ä¸ä¼šè¢«è¦†ç›–。\n" +"请先移除“buildâ€ç›®å½•å†é‡æ–°å°è¯•æ¤æ“作。" #: editor/editor_node.cpp msgid "Import Templates From ZIP File" @@ -3024,6 +3057,11 @@ msgstr "æ—¶é—´" msgid "Calls" msgstr "调用次数" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "编辑主题..." + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "å¯ç”¨" @@ -3586,7 +3624,7 @@ msgstr "ç›é€‰ï¼š" msgid "" "Include the files with the following extensions. Add or remove them in " "ProjectSettings." -msgstr "" +msgstr "包å«ä¸‹åˆ—扩展å的文件。å¯åœ¨é¡¹ç›®è®¾ç½®ä¸å¢žåŠ æˆ–ç§»é™¤ã€‚" #: editor/find_in_files.cpp editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp @@ -4675,6 +4713,11 @@ msgid "Idle" msgstr "空闲" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "安装" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "é‡è¯•" @@ -4703,7 +4746,6 @@ msgid "Last" msgstr "最åŽä¸€é¡¹" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "全部" @@ -4717,8 +4759,9 @@ msgid "Sort:" msgstr "排åº:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "å选" +#, fuzzy +msgid "Reverse sorting." +msgstr "æ£åœ¨è¯·æ±‚。。" #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4795,31 +4838,38 @@ msgid "Rotation Step:" msgstr "旋转æ¥é•¿:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "ç§»åŠ¨åž‚ç›´æ ‡å°º" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "åˆ›å»ºæ–°çš„åž‚ç›´æ ‡å°º" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "åˆ é™¤åž‚ç›´æ ‡å°º" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "ç§»åŠ¨æ°´å¹³æ ‡å°º" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "åˆ›å»ºæ°´å¹³æ ‡å°º" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "ç§»é™¤æ°´å¹³æ ‡å°º" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "åˆ›å»ºåž‚ç›´æ°´å¹³æ ‡å°º" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -4860,7 +4910,7 @@ msgstr "控件节点的定ä½ç‚¹å’Œè¾¹è·å€¼çš„预设。" msgid "" "When active, moving Control nodes changes their anchors instead of their " "margins." -msgstr "" +msgstr "激活åŽï¼Œç§»åŠ¨æŽ§åˆ¶èŠ‚ç‚¹ä¼šæ›´æ”¹å˜é”šç‚¹ï¼Œè€Œéžè¾¹è·ã€‚" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchors only" @@ -5143,7 +5193,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)." @@ -5423,7 +5473,7 @@ msgstr "创建Trimesh(ä¸‰ç»´ç½‘æ ¼)形状" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Failed creating shapes!" -msgstr "" +msgstr "创建形状失败ï¼" #: editor/plugins/mesh_instance_editor_plugin.cpp #, fuzzy @@ -6422,7 +6472,7 @@ msgstr "è¯æ³•高亮显示" #: editor/plugins/script_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 @@ -6726,9 +6776,15 @@ msgid "Rear" msgstr "åŽæ–¹" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "对é½è§†å›¾" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "选ä¸é¡¹ä¸Žè§†å›¾å¯¹é½" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "没有选ä¸èŠ‚ç‚¹æ¥æ·»åŠ å®žä¾‹ã€‚" @@ -6917,10 +6973,6 @@ msgid "Focus Selection" msgstr "选ä¸é€‰ä¸é¡¹" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "选ä¸é¡¹ä¸Žè§†å›¾å¯¹é½" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "Tool Select" msgstr "选择工具" @@ -7194,13 +7246,12 @@ msgid "Animation Frames:" msgstr "动画帧:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Add a Texture from File" -msgstr "æ·»åŠ çº¹ç†åˆ°ç£è´´é›†ã€‚" +msgstr "ä»Žæ–‡ä»¶æ·»åŠ çº¹ç†" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Frames from a Sprite Sheet" -msgstr "" +msgstr "从精çµè¡¨æ ¼ä¸æ·»åР叧" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (Before)" @@ -7219,9 +7270,8 @@ msgid "Move (After)" msgstr "å¾€åŽç§»åЍ" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Select Frames" -msgstr "å †æ ˆå¸§ï¼ˆStack Frames)" +msgstr "选择帧" #: editor/plugins/sprite_frames_editor_plugin.cpp #, fuzzy @@ -7498,14 +7548,6 @@ msgid "Transpose" msgstr "转置" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "沿X轴翻转" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "沿Y轴翻转" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "ç¦ç”¨æ™ºèƒ½ç£è´´(Autotile)" @@ -7523,6 +7565,8 @@ msgid "" "Shift+RMB: Line Draw\n" "Shift+Ctrl+RMB: Rectangle Paint" msgstr "" +"Shift+é¼ æ ‡å³é”®ï¼šç»˜åˆ¶ç›´çº¿\n" +"Shift+Ctrl+é¼ æ ‡å³é”®ï¼šç»˜åˆ¶çŸ©å½¢" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Pick Tile" @@ -7849,7 +7893,7 @@ msgstr "å‘é‡" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" -msgstr "" +msgstr "布尔值" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -7858,7 +7902,7 @@ msgstr "æ·»åŠ è¾“å…¥äº‹ä»¶" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add output port" -msgstr "" +msgstr "å¢žåŠ è¾“å‡ºç«¯å£" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -7925,6 +7969,10 @@ msgid "Visual Shader Input Type Changed" msgstr "å¯è§†ç€è‰²å™¨è¾“入类型已更改" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "顶点" @@ -7948,7 +7996,7 @@ msgstr "转到函数" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color operator." -msgstr "" +msgstr "颜色è¿ç®—符。" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -7957,11 +8005,11 @@ msgstr "创建方法" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts HSV vector to RGB equivalent." -msgstr "" +msgstr "å°†HSVå‘é‡è½¬æ¢ä¸ºç‰æ•ˆçš„RGBå‘é‡ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts RGB vector to HSV equivalent." -msgstr "" +msgstr "å°†RGBå‘é‡è½¬æ¢ä¸ºç‰æ•ˆçš„HSVå‘é‡ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8016,6 +8064,22 @@ msgid "Color uniform." msgstr "æ¸…é™¤å˜æ¢" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8023,10 +8087,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "Boolean constant." msgstr "修改Vec常é‡ç³»æ•°" @@ -8119,7 +8217,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8127,7 +8225,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8139,7 +8237,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8156,7 +8254,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8225,11 +8323,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8245,7 +8343,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8273,11 +8371,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8320,12 +8418,17 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." msgstr "修改Uniform纹ç†" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy -msgid "2D texture uniform." +msgid "2D texture uniform lookup." +msgstr "修改Uniform纹ç†" + +#: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy +msgid "2D texture uniform lookup with triplanar." msgstr "修改Uniform纹ç†" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8335,7 +8438,7 @@ msgstr "å˜æ¢å¯¹è¯æ¡†..." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8353,15 +8456,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8414,7 +8517,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8442,12 +8545,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8526,47 +8629,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9004,7 +9107,7 @@ msgstr "æ‚¨ç¡®è®¤è¦æ‰«æ%s目录下现有的Godot项目å—?" #: editor/project_manager.cpp msgid "Project Manager" -msgstr "项目管ç†å‘˜" +msgstr "项目管ç†å™¨" #: editor/project_manager.cpp msgid "Project List" @@ -9772,6 +9875,11 @@ msgid "Extend Script" msgstr "打开脚本" #: editor/scene_tree_dock.cpp +#, fuzzy +msgid "Reparent to New Node" +msgstr "é‡è®¾çˆ¶èŠ‚ç‚¹" + +#: editor/scene_tree_dock.cpp msgid "Make Scene Root" msgstr "åˆ›å»ºåœºæ™¯æ ¹èŠ‚ç‚¹" @@ -10003,7 +10111,8 @@ msgid "Script is valid." msgstr "脚本å¯ç”¨" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +#, fuzzy +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "ä»…å…许使用: a-z, A-Z, 0-9 或 _" #: editor/script_create_dialog.cpp @@ -11337,7 +11446,7 @@ msgstr "" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." -msgstr "" +msgstr "角度宽于 90 度的 SpotLight æ— æ³•æŠ•å°„å‡ºé˜´å½±ã€‚" #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." @@ -11436,6 +11545,7 @@ 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 "" @@ -11614,6 +11724,11 @@ msgstr "éžæ³•çš„ç€è‰²å™¨æºã€‚" msgid "Invalid source for shader." msgstr "éžæ³•çš„ç€è‰²å™¨æºã€‚" +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "éžæ³•çš„ç€è‰²å™¨æºã€‚" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "对函数的赋值。" @@ -11630,6 +11745,27 @@ msgstr "å˜é‡åªèƒ½åœ¨é¡¶ç‚¹å‡½æ•°ä¸æŒ‡å®šã€‚" msgid "Constants cannot be modified." msgstr "ä¸å…许修改常é‡ã€‚" +#~ msgid "Previous Folder" +#~ msgstr "上一个文件夹" + +#~ msgid "Next Folder" +#~ msgstr "下一个文件夹" + +#~ msgid "Automatically Open Screenshots" +#~ msgstr "自动打开截图" + +#~ msgid "Open in an external image editor." +#~ msgstr "使用外部图åƒç¼–辑器打开。" + +#~ msgid "Reverse" +#~ msgstr "å选" + +#~ msgid "Mirror X" +#~ msgstr "沿X轴翻转" + +#~ msgid "Mirror Y" +#~ msgstr "沿Y轴翻转" + #~ msgid "Generating solution..." #~ msgstr "æ£åœ¨åˆ›ç”Ÿæˆå†³æ–¹æ¡ˆ..." diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po index 4488955481..6946008e81 100644 --- a/editor/translations/zh_HK.po +++ b/editor/translations/zh_HK.po @@ -137,6 +137,31 @@ msgstr "" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "動畫變化數值" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "å‹•ç•«è®ŠåŒ–éŽæ¸¡" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "å‹•ç•«è®ŠåŒ–éŽæ¸¡" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "動畫變化數值" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "動畫軌跡變化數值模å¼" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "更改動畫å稱:" @@ -1194,7 +1219,6 @@ msgid "Success!" msgstr "æˆåŠŸï¼" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "安è£" @@ -1786,7 +1810,7 @@ msgstr "開啟 Project Manager?" msgid "New Folder..." msgstr "新增資料夾" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "釿–°æ•´ç†" @@ -1837,7 +1861,7 @@ msgstr "" msgid "Go Up" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "(ä¸ï¼‰é¡¯ç¤ºéš±è—的文件" @@ -1865,27 +1889,32 @@ msgstr "下移最愛" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "上一個tab" +msgid "Go to previous folder." +msgstr "無法新增資料夾" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "新增資料夾" +msgid "Go to next folder." +msgstr "無法新增資料夾" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "無法新增資料夾" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "在幫助檔æœå°‹" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "無法新增資料夾" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "(ä¸ï¼‰é¡¯ç¤ºéš±è—的文件" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2624,6 +2653,11 @@ msgstr "上一個開啟的scene" #: editor/editor_node.cpp #, fuzzy +msgid "Copy Text" +msgstr "複製路徑" + +#: editor/editor_node.cpp +#, fuzzy msgid "Next tab" msgstr "下一個" @@ -2823,15 +2857,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "編輯器è¨å®š" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "è¦é›¢é–‹ç·¨è¼¯å™¨å—Ž?" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "全螢幕" @@ -3164,6 +3189,11 @@ msgstr "時間:" msgid "Calls" msgstr "" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "檔案" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "" @@ -4920,6 +4950,11 @@ msgid "Idle" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "安è£" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "é‡è©¦" @@ -4950,7 +4985,6 @@ msgid "Last" msgstr "" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "全部" @@ -4964,8 +4998,9 @@ msgid "Sort:" msgstr "排åºï¼š" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "" +#, fuzzy +msgid "Reverse sorting." +msgstr "請求ä¸..." #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -5039,35 +5074,39 @@ msgid "Rotation Step:" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" -msgstr "" +#, fuzzy +msgid "Move Vertical Guide" +msgstr "新增" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new vertical guide" +msgid "Create Vertical Guide" msgstr "新增" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" -msgstr "" +#, fuzzy +msgid "Remove Vertical Guide" +msgstr "åªé™é¸ä¸" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" -msgstr "" +#, fuzzy +msgid "Move Horizontal Guide" +msgstr "åªé™é¸ä¸" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Create new horizontal guide" +msgid "Create Horizontal Guide" msgstr "新增" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy -msgid "Remove horizontal guide" +msgid "Remove Horizontal Guide" msgstr "åªé™é¸ä¸" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" -msgstr "" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" +msgstr "新增" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -7023,7 +7062,11 @@ msgid "Rear" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +msgid "Align Transform with View" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp +msgid "Align Rotation with View" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -7216,10 +7259,6 @@ msgid "Focus Selection" msgstr "åªé™é¸ä¸" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "" - -#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Tool Select" msgstr "所有é¸é …" @@ -7814,14 +7853,6 @@ msgid "Transpose" msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8249,6 +8280,10 @@ msgid "Visual Shader Input Type Changed" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "" @@ -8337,6 +8372,22 @@ msgid "Color uniform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8344,10 +8395,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8437,7 +8522,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8445,7 +8530,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8457,7 +8542,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8474,7 +8559,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8543,11 +8628,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8563,7 +8648,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8591,11 +8676,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8635,11 +8720,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8649,7 +8738,7 @@ msgstr "縮放selection" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8667,15 +8756,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8727,7 +8816,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8755,12 +8844,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8837,47 +8926,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10095,6 +10184,11 @@ msgstr "下一個腳本" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "新增" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "儲å˜å ´æ™¯" @@ -10316,7 +10410,7 @@ msgid "Script is valid." msgstr "腳本" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11894,6 +11988,11 @@ msgstr "無效å—åž‹" msgid "Invalid source for shader." msgstr "無效å—åž‹" +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "無效å—åž‹" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11911,6 +12010,18 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "上一個tab" + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "新增資料夾" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "è¦é›¢é–‹ç·¨è¼¯å™¨å—Ž?" + +#, fuzzy #~ msgid "Failed to create solution." #~ msgstr "資æºåŠ è¼‰å¤±æ•—ã€‚" @@ -12074,9 +12185,6 @@ msgstr "" #~ msgid "Anim Track Change Interpolation" #~ msgstr "動畫軌跡變化Interpolation" -#~ msgid "Anim Track Change Value Mode" -#~ msgstr "動畫軌跡變化數值模å¼" - #~ msgid "Edit Selection Curve" #~ msgstr "編輯Selection Curve" diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po index 27afde910f..54c1f74b02 100644 --- a/editor/translations/zh_TW.po +++ b/editor/translations/zh_TW.po @@ -141,6 +141,31 @@ msgstr "更改回調" #: editor/animation_track_editor.cpp #, fuzzy +msgid "Anim Multi Change Keyframe Time" +msgstr "變更關éµç•«æ ¼çš„æ™‚é–“" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transition" +msgstr "è®Šæ›´è½‰å ´æ•ˆæžœ" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Transform" +msgstr "變更動畫變æ›" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Keyframe Value" +msgstr "變更關éµç•«æ ¼çš„æ•¸å€¼" + +#: editor/animation_track_editor.cpp +#, fuzzy +msgid "Anim Multi Change Call" +msgstr "更改回調" + +#: editor/animation_track_editor.cpp +#, fuzzy msgid "Change Animation Length" msgstr "變更動畫長度" @@ -1184,7 +1209,6 @@ msgid "Success!" msgstr "æˆåŠŸ!" #: editor/editor_asset_installer.cpp editor/editor_node.cpp -#: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" msgstr "安è£" @@ -1765,7 +1789,7 @@ msgstr "在檔案管ç†å“¡å…§é¡¯ç¤º" msgid "New Folder..." msgstr "新增資料夾..." -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Refresh" msgstr "釿–°æ•´ç†" @@ -1816,7 +1840,7 @@ msgstr "å¾€å‰" msgid "Go Up" msgstr "往上" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" msgstr "切æ›é¡¯ç¤ºéš±è—檔案" @@ -1843,27 +1867,32 @@ msgstr "å‘下移動收è—" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Previous Folder" -msgstr "上個分é " +msgid "Go to previous folder." +msgstr "無法新增資料夾" #: editor/editor_file_dialog.cpp #, fuzzy -msgid "Next Folder" -msgstr "新增資料夾" +msgid "Go to next folder." +msgstr "無法新增資料夾" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Go to parent folder." msgstr "無法新增資料夾" +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#, fuzzy +msgid "Refresh files." +msgstr "æœå°‹ Class" + #: editor/editor_file_dialog.cpp #, fuzzy msgid "(Un)favorite current folder." msgstr "無法新增資料夾" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy -msgid "Toggle visibility of hidden files." +msgid "Toggle the visibility of hidden files." msgstr "切æ›é¡¯ç¤ºéš±è—檔案" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp @@ -2584,6 +2613,11 @@ msgid "Go to previously opened scene." msgstr "å‰å¾€ä¸Šæ¬¡é–‹å•Ÿçš„å ´æ™¯ã€‚" #: editor/editor_node.cpp +#, fuzzy +msgid "Copy Text" +msgstr "複製路徑" + +#: editor/editor_node.cpp msgid "Next tab" msgstr "下一個分é " @@ -2786,15 +2820,6 @@ msgid "Screenshots are stored in the Editor Data/Settings Folder." msgstr "開啟 編輯器數據/è¨å®š 資料夾" #: editor/editor_node.cpp -msgid "Automatically Open Screenshots" -msgstr "" - -#: editor/editor_node.cpp -#, fuzzy -msgid "Open in an external image editor." -msgstr "開啟下一個編輯器" - -#: editor/editor_node.cpp msgid "Toggle Fullscreen" msgstr "全螢幕顯示" @@ -3116,6 +3141,11 @@ msgstr "時間" msgid "Calls" msgstr "調用" +#: editor/editor_properties.cpp +#, fuzzy +msgid "Edit Text:" +msgstr "編輯主題…" + #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" msgstr "啟用" @@ -4839,6 +4869,11 @@ msgid "Idle" msgstr "空閒" #: editor/plugins/asset_library_editor_plugin.cpp +#, fuzzy +msgid "Install..." +msgstr "安è£" + +#: editor/plugins/asset_library_editor_plugin.cpp msgid "Retry" msgstr "é‡è©¦" @@ -4868,7 +4903,6 @@ msgid "Last" msgstr "最後" #: editor/plugins/asset_library_editor_plugin.cpp -#: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "All" msgstr "全部" @@ -4882,8 +4916,9 @@ msgid "Sort:" msgstr "排åº:" #: editor/plugins/asset_library_editor_plugin.cpp -msgid "Reverse" -msgstr "å轉" +#, fuzzy +msgid "Reverse sorting." +msgstr "æ£åœ¨è«‹æ±‚…" #: editor/plugins/asset_library_editor_plugin.cpp #: editor/project_settings_editor.cpp @@ -4958,31 +4993,38 @@ msgid "Rotation Step:" msgstr "旋轉æ¥é©Ÿ:" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move vertical guide" +#, fuzzy +msgid "Move Vertical Guide" msgstr "垂直移動尺標" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new vertical guide" +#, fuzzy +msgid "Create Vertical Guide" msgstr "創建新的垂直尺標" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove vertical guide" +#, fuzzy +msgid "Remove Vertical Guide" msgstr "刪除垂直尺標" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Move horizontal guide" +#, fuzzy +msgid "Move Horizontal Guide" msgstr "移動水平尺標" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal guide" +#, fuzzy +msgid "Create Horizontal Guide" msgstr "創建新的水平尺標" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Remove horizontal guide" +#, fuzzy +msgid "Remove Horizontal Guide" msgstr "移除水平尺標" #: editor/plugins/canvas_item_editor_plugin.cpp -msgid "Create new horizontal and vertical guides" +#, fuzzy +msgid "Create Horizontal and Vertical Guides" msgstr "創建新的水平和垂直尺標" #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6936,9 +6978,15 @@ msgid "Rear" msgstr "後" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align with View" +#, fuzzy +msgid "Align Transform with View" msgstr "與視圖å°é½Š" +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Align Rotation with View" +msgstr "將所é¸å…§å®¹èˆ‡è¦–圖å°é½Š" + #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." msgstr "" @@ -7124,10 +7172,6 @@ msgid "Focus Selection" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "Align Selection With View" -msgstr "將所é¸å…§å®¹èˆ‡è¦–圖å°é½Š" - -#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Tool Select" msgstr "工具鏿“‡" @@ -7725,14 +7769,6 @@ msgid "Transpose" msgstr "轉置" #: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror X" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp -msgid "Mirror Y" -msgstr "" - -#: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" msgstr "" @@ -8155,6 +8191,10 @@ msgid "Visual Shader Input Type Changed" msgstr "視覺著色器輸入類型已更改" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "(GLES3 only)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" msgstr "é ‚é»ž" @@ -8247,6 +8287,22 @@ msgid "Color uniform." msgstr "清除變æ›" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the %s comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Equal (==)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than (>)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Greater Than or Equal (>=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." @@ -8254,10 +8310,44 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" +"Returns the boolean result of the comparison between INF and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between NaN and a scalar " +"parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than (<)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Less Than or Equal (<=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Not Equal (!=)" +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" "Returns an associated vector if the provided boolean value is true or false." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp +msgid "Returns the boolean result of the comparison between two parameters." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "" +"Returns the boolean result of the comparison between INF (or NaN) and a " +"scalar parameter." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean constant." msgstr "" @@ -8349,7 +8439,7 @@ msgid "Returns the arc-cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic cosine of the parameter." +msgid "Returns the inverse hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8357,7 +8447,7 @@ msgid "Returns the arc-sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic sine of the parameter." +msgid "Returns the inverse hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8369,7 +8459,7 @@ msgid "Returns the arc-tangent of the parameters." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the inverse hyperbolic tangent of the parameter." +msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8386,7 +8476,7 @@ msgid "Returns the cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic cosine of the parameter." +msgid "Returns the hyperbolic cosine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8455,11 +8545,11 @@ msgid "1.0 / scalar" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest integer to the parameter." +msgid "Finds the nearest integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the nearest even integer to the parameter." +msgid "Finds the nearest even integer to the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8475,7 +8565,7 @@ msgid "Returns the sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic sine of the parameter." +msgid "Returns the hyperbolic sine of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8503,11 +8593,11 @@ msgid "Returns the tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Returns the hyperbolic tangent of the parameter." +msgid "Returns the hyperbolic tangent of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Finds the truncated value of the parameter." +msgid "Finds the truncated value of the parameter." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8548,11 +8638,15 @@ msgid "Perform the texture lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Cubic texture uniform." +msgid "Cubic texture uniform lookup." +msgstr "" + +#: editor/plugins/visual_shader_editor_plugin.cpp +msgid "2D texture uniform lookup." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "2D texture uniform." +msgid "2D texture uniform lookup with triplanar." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8562,7 +8656,7 @@ msgstr "轉æ›å°è©±æ¡†..。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) Calculate the outer product of a pair of vectors.\n" +"Calculate the outer product of a pair of vectors.\n" "\n" "OuterProduct treats the first parameter 'c' as a column vector (matrix with " "one column) and the second parameter 'r' as a row vector (matrix with one " @@ -8580,15 +8674,15 @@ msgid "Decomposes transform to four vectors." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the determinant of a transform." +msgid "Calculates the determinant of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the inverse of a transform." +msgid "Calculates the inverse of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) Calculates the transpose of a transform." +msgid "Calculates the transpose of a transform." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8640,7 +8734,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the same direction as a reference vector. " +"Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " "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." @@ -8668,12 +8762,12 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"Returns a vector that points in the direction of reflection ( a : incident " +"Returns the vector that points in the direction of reflection ( a : incident " "vector, b : normal vector )." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "Returns a vector that points in the direction of refraction." +msgid "Returns the vector that points in the direction of refraction." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -8750,47 +8844,47 @@ msgid "" msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Scalar derivative function." +msgid "(Fragment/Light mode only) Scalar derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp -msgid "(GLES3 only) (Fragment/Light mode only) Vector derivative function." +msgid "(Fragment/Light mode only) Vector derivative function." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'x' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Vector) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Derivative in 'y' using " -"local differencing." +"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local " +"differencing." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Vector) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" -"(GLES3 only) (Fragment/Light mode only) (Scalar) Sum of absolute derivative " -"in 'x' and 'y'." +"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " +"'y'." msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp @@ -10000,6 +10094,11 @@ msgstr "開啟最近å˜å–" #: editor/scene_tree_dock.cpp #, fuzzy +msgid "Reparent to New Node" +msgstr "新增 %s" + +#: editor/scene_tree_dock.cpp +#, fuzzy msgid "Make Scene Root" msgstr "儲å˜å ´æ™¯" @@ -10220,7 +10319,7 @@ msgid "Script is valid." msgstr "動畫樹有效。" #: editor/script_create_dialog.cpp -msgid "Allowed: a-z, A-Z, 0-9 and _" +msgid "Allowed: a-z, A-Z, 0-9, _ and ." msgstr "" #: editor/script_create_dialog.cpp @@ -11822,6 +11921,11 @@ msgstr "無效的å—體大å°ã€‚" msgid "Invalid source for shader." msgstr "無效的å—體大å°ã€‚" +#: scene/resources/visual_shader_nodes.cpp +#, fuzzy +msgid "Invalid comparison function for that type." +msgstr "無效的å—體大å°ã€‚" + #: servers/visual/shader_language.cpp msgid "Assignment to function." msgstr "" @@ -11839,6 +11943,21 @@ msgid "Constants cannot be modified." msgstr "" #, fuzzy +#~ msgid "Previous Folder" +#~ msgstr "上個分é " + +#, fuzzy +#~ msgid "Next Folder" +#~ msgstr "新增資料夾" + +#, fuzzy +#~ msgid "Open in an external image editor." +#~ msgstr "開啟下一個編輯器" + +#~ msgid "Reverse" +#~ msgstr "å轉" + +#, fuzzy #~ msgid "Failed to create solution." #~ msgstr "無法新增資料夾" diff --git a/main/SCsub b/main/SCsub index e7fe6ab4e1..62bc155c67 100644 --- a/main/SCsub +++ b/main/SCsub @@ -6,6 +6,7 @@ from platform_methods import run_in_subprocess import main_builders env.main_sources = [] + env.add_source_files(env.main_sources, "*.cpp") # order matters here. higher index controller database files write on top of lower index database files @@ -14,7 +15,9 @@ controller_databases = ["#main/gamecontrollerdb.txt", "#main/gamecontrollerdb_20 env.Depends("#main/default_controller_mappings.gen.cpp", controller_databases) env.CommandNoCache("#main/default_controller_mappings.gen.cpp", controller_databases, run_in_subprocess(main_builders.make_default_controller_mappings)) -env.main_sources.append("#main/default_controller_mappings.gen.cpp") +# Don't warn about duplicate entry here, we need it registered manually for first build, +# even if later builds will pick it up twice due to above *.cpp globbing. +env.add_source_files(env.main_sources, "#main/default_controller_mappings.gen.cpp", warn_duplicates=False) env.Depends("#main/splash.gen.h", "#main/splash.png") env.CommandNoCache("#main/splash.gen.h", "#main/splash.png", run_in_subprocess(main_builders.make_splash)) diff --git a/main/input_default.cpp b/main/input_default.cpp index a03d015fc3..60675f1115 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -472,6 +472,10 @@ void InputDefault::stop_joy_vibration(int p_device) { joy_vibration[p_device] = vibration; } +void InputDefault::vibrate_handheld(int p_duration_ms) { + OS::get_singleton()->vibrate_handheld(p_duration_ms); +} + void InputDefault::set_gravity(const Vector3 &p_gravity) { _THREAD_SAFE_METHOD_ @@ -629,6 +633,10 @@ Input::CursorShape InputDefault::get_default_cursor_shape() const { } void InputDefault::set_default_cursor_shape(CursorShape p_shape) { + + if (default_shape == p_shape) + return; + default_shape = p_shape; // The default shape is set in Viewport::_gui_input_event. To instantly // see the shape in the viewport we need to trigger a mouse motion event. @@ -686,7 +694,8 @@ void InputDefault::release_pressed_events() { _joy_axis.clear(); for (Map<StringName, InputDefault::Action>::Element *E = action_state.front(); E; E = E->next()) { - action_release(E->key()); + if (E->get().pressed) + action_release(E->key()); } } diff --git a/main/input_default.h b/main/input_default.h index 80ee17656c..4fc4ad6506 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -226,6 +226,7 @@ public: virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration = 0); virtual void stop_joy_vibration(int p_device); + virtual void vibrate_handheld(int p_duration_ms = 500); void set_main_loop(MainLoop *p_main_loop); void set_mouse_position(const Point2 &p_posf); diff --git a/main/main.cpp b/main/main.cpp index ef5c4109db..582df4e866 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -30,6 +30,7 @@ #include "main.h" +#include "core/crypto/crypto.h" #include "core/input_map.h" #include "core/io/file_access_network.h" #include "core/io/file_access_pack.h" @@ -37,8 +38,6 @@ #include "core/io/image_loader.h" #include "core/io/ip.h" #include "core/io/resource_loader.h" -#include "core/io/stream_peer_ssl.h" -#include "core/io/stream_peer_tcp.h" #include "core/message_queue.h" #include "core/os/dir_access.h" #include "core/os/os.h" @@ -783,8 +782,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph ProjectSettings::get_singleton()->set_custom_property_info("network/limits/debugger_stdout/max_chars_per_second", PropertyInfo(Variant::INT, "network/limits/debugger_stdout/max_chars_per_second", PROPERTY_HINT_RANGE, "0, 4096, 1, or_greater")); GLOBAL_DEF("network/limits/debugger_stdout/max_messages_per_frame", 10); ProjectSettings::get_singleton()->set_custom_property_info("network/limits/debugger_stdout/max_messages_per_frame", PropertyInfo(Variant::INT, "network/limits/debugger_stdout/max_messages_per_frame", PROPERTY_HINT_RANGE, "0, 20, 1, or_greater")); - GLOBAL_DEF("network/limits/debugger_stdout/max_errors_per_frame", 10); - ProjectSettings::get_singleton()->set_custom_property_info("network/limits/debugger_stdout/max_errors_per_frame", PropertyInfo(Variant::INT, "network/limits/debugger_stdout/max_errors_per_frame", PROPERTY_HINT_RANGE, "0, 20, 1, or_greater")); + GLOBAL_DEF("network/limits/debugger_stdout/max_errors_per_second", 100); + ProjectSettings::get_singleton()->set_custom_property_info("network/limits/debugger_stdout/max_errors_per_second", PropertyInfo(Variant::INT, "network/limits/debugger_stdout/max_errors_per_second", PROPERTY_HINT_RANGE, "0, 200, 1, or_greater")); + GLOBAL_DEF("network/limits/debugger_stdout/max_warnings_per_second", 100); + ProjectSettings::get_singleton()->set_custom_property_info("network/limits/debugger_stdout/max_warnings_per_second", PropertyInfo(Variant::INT, "network/limits/debugger_stdout/max_warnings_per_second", PROPERTY_HINT_RANGE, "0, 200, 1, or_greater")); if (debug_mode == "remote") { @@ -814,10 +815,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph String bp = breakpoints[i]; int sp = bp.find_last(":"); - if (sp == -1) { - ERR_EXPLAIN("Invalid breakpoint: '" + bp + "', expected file:line format."); - ERR_CONTINUE(true); - } + ERR_CONTINUE_MSG(sp == -1, "Invalid breakpoint: '" + bp + "', expected file:line format."); script_debugger->insert_breakpoint(bp.substr(sp + 1, bp.length()).to_int(), bp.substr(0, sp)); } @@ -1373,10 +1371,7 @@ bool Main::start() { { DirAccessRef da = DirAccess::open(doc_tool); - if (!da) { - ERR_EXPLAIN("Argument supplied to --doctool must be a base Godot build directory"); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(!da, false, "Argument supplied to --doctool must be a base Godot build directory."); } DocData doc; doc.generate(doc_base); @@ -1460,8 +1455,7 @@ bool Main::start() { } else if (script != "") { Ref<Script> script_res = ResourceLoader::load(script); - ERR_EXPLAIN("Can't load script: " + script); - ERR_FAIL_COND_V(script_res.is_null(), false); + ERR_FAIL_COND_V_MSG(script_res.is_null(), false, "Can't load script: " + script); if (check_only) { return false; @@ -1475,8 +1469,7 @@ bool Main::start() { if (!script_loop) { if (obj) memdelete(obj); - ERR_EXPLAIN("Can't load script '" + script + "', it does not inherit from a MainLoop type"); - ERR_FAIL_V(false); + ERR_FAIL_V_MSG(false, "Can't load script '" + script + "', it does not inherit from a MainLoop type."); } script_loop->set_init_script(script_res); @@ -1500,17 +1493,13 @@ bool Main::start() { } else { Object *ml = ClassDB::instance(main_loop_type); - if (!ml) { - ERR_EXPLAIN("Can't instance MainLoop type"); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(!ml, false, "Can't instance MainLoop type."); main_loop = Object::cast_to<MainLoop>(ml); if (!main_loop) { memdelete(ml); - ERR_EXPLAIN("Invalid MainLoop type"); - ERR_FAIL_V(false); + ERR_FAIL_V_MSG(false, "Invalid MainLoop type."); } } } @@ -1573,8 +1562,7 @@ bool Main::start() { } RES res = ResourceLoader::load(path); - ERR_EXPLAIN("Can't autoload: " + path); - ERR_CONTINUE(res.is_null()); + ERR_CONTINUE_MSG(res.is_null(), "Can't autoload: " + path); Node *n = NULL; if (res->is_class("PackedScene")) { Ref<PackedScene> ps = res; @@ -1583,20 +1571,17 @@ bool Main::start() { Ref<Script> script_res = res; StringName ibt = script_res->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); - ERR_EXPLAIN("Script does not inherit a Node: " + path); - ERR_CONTINUE(!valid_type); + ERR_CONTINUE_MSG(!valid_type, "Script does not inherit a Node: " + path); Object *obj = ClassDB::instance(ibt); - ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt)); - ERR_CONTINUE(obj == NULL); + ERR_CONTINUE_MSG(obj == NULL, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt)); n = Object::cast_to<Node>(obj); n->set_script(script_res.get_ref_ptr()); } - ERR_EXPLAIN("Path in autoload not a node or script: " + path); - ERR_CONTINUE(!n); + ERR_CONTINUE_MSG(!n, "Path in autoload not a node or script: " + path); n->set_name(name); //defer so references are all valid on _ready() @@ -1754,8 +1739,8 @@ bool Main::start() { if (!project_manager && !editor) { // game - // Load SSL Certificates from Project Settings (or builtin) - StreamPeerSSL::load_certs_from_memory(StreamPeerSSL::get_project_cert_array()); + // Load SSL Certificates from Project Settings (or builtin). + Crypto::load_default_certificates(GLOBAL_DEF("network/ssl/certificates", "")); if (game_path != "") { Node *scene = NULL; @@ -1763,8 +1748,7 @@ bool Main::start() { if (scenedata.is_valid()) scene = scenedata->instance(); - ERR_EXPLAIN("Failed loading scene: " + local_game_path); - ERR_FAIL_COND_V(!scene, false); + ERR_FAIL_COND_V_MSG(!scene, false, "Failed loading scene: " + local_game_path); sml->add_current_scene(scene); #ifdef OSX_ENABLED @@ -1808,17 +1792,15 @@ bool Main::start() { } if (project_manager || editor) { - // Load SSL Certificates from Editor Settings (or builtin) - String certs = EditorSettings::get_singleton()->get_setting("network/ssl/editor_ssl_certificates").operator String(); - if (certs != "") - StreamPeerSSL::load_certs_from_file(certs); - else - StreamPeerSSL::load_certs_from_memory(StreamPeerSSL::get_project_cert_array()); - - // Hide console window if requested (Windows-only) + // Hide console window if requested (Windows-only). bool hide_console = EditorSettings::get_singleton()->get_setting("interface/editor/hide_console_window"); OS::get_singleton()->set_console_visible(!hide_console); } + + if (project_manager || editor) { + // Load SSL Certificates from Editor Settings (or builtin) + Crypto::load_default_certificates(EditorSettings::get_singleton()->get_setting("network/ssl/editor_ssl_certificates").operator String()); + } #endif } @@ -1852,7 +1834,7 @@ bool Main::is_iterating() { return iterating > 0; } -// For performance metrics +// For performance metrics. static uint64_t physics_process_max = 0; static uint64_t idle_process_max = 0; @@ -1880,6 +1862,7 @@ bool Main::iteration() { double scaled_step = step * time_scale; Engine::get_singleton()->_frame_step = step; + Engine::get_singleton()->_physics_interpolation_fraction = advance.interpolation_fraction; uint64_t physics_process_ticks = 0; uint64_t idle_process_ticks = 0; diff --git a/main/main.h b/main/main.h index 694305526a..b0b90dc0fe 100644 --- a/main/main.h +++ b/main/main.h @@ -31,10 +31,6 @@ #ifndef MAIN_H #define MAIN_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #include "core/error_list.h" #include "core/os/thread.h" #include "core/typedefs.h" diff --git a/main/main_timer_sync.cpp b/main/main_timer_sync.cpp index f7388c8517..edacb20f28 100644 --- a/main/main_timer_sync.cpp +++ b/main/main_timer_sync.cpp @@ -178,6 +178,10 @@ MainFrameTime MainTimerSync::advance_checked(float p_frame_slice, int p_iteratio // track deficit time_deficit = p_idle_step - ret.idle_step; + // p_frame_slice is 1.0 / iterations_per_sec + // i.e. the time in seconds taken by a physics tick + ret.interpolation_fraction = time_accum / p_frame_slice; + return ret; } diff --git a/main/main_timer_sync.h b/main/main_timer_sync.h index 179119edce..93d335b27f 100644 --- a/main/main_timer_sync.h +++ b/main/main_timer_sync.h @@ -36,6 +36,7 @@ struct MainFrameTime { float idle_step; // time to advance idles for (argument to process()) int physics_steps; // number of times to iterate the physics engine + float interpolation_fraction; // fraction through the current physics tick void clamp_idle(float min_idle_step, float max_idle_step); }; diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index e82af93293..b2b2c22bf9 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -300,14 +300,11 @@ static String _parser_expr(const GDScriptParser::Node *p_expr) { } break; default: { - String error = "Parser bug at " + itos(p_expr->line) + ", invalid expression type: " + itos(p_expr->type); - ERR_EXPLAIN(error); - ERR_FAIL_V(""); + ERR_FAIL_V_MSG("", "Parser bug at " + itos(p_expr->line) + ", invalid expression type: " + itos(p_expr->type)); } } return txt; - //return "("+txt+")"; } static void _parser_show_block(const GDScriptParser::BlockNode *p_block, int p_indent) { @@ -910,8 +907,7 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String if (incr == 0) { - ERR_EXPLAIN("unhandled opcode: " + itos(code[ip])); - ERR_BREAK(true); + ERR_BREAK_MSG(true, "Unhandled opcode: " + itos(code[ip])); } ip += incr; @@ -936,11 +932,7 @@ MainLoop *test(TestType p_type) { } FileAccess *fa = FileAccess::open(test, FileAccess::READ); - - if (!fa) { - ERR_EXPLAIN("Could not open file: " + test); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!fa, NULL, "Could not open file: " + test); Vector<uint8_t> buf; int flen = fa->get_len(); diff --git a/main/tests/test_gui.h b/main/tests/test_gui.h index 1752818981..075bc40aa7 100644 --- a/main/tests/test_gui.h +++ b/main/tests/test_gui.h @@ -33,9 +33,6 @@ #include "core/os/main_loop.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ namespace TestGUI { MainLoop *test(); diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index f341159079..68ecb2b1b2 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -494,11 +494,7 @@ MainLoop *test() { } FileAccess *fa = FileAccess::open(test, FileAccess::READ); - - if (!fa) { - ERR_EXPLAIN("Could not open file: " + test); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!fa, NULL, "Could not open file: " + test); Vector<uint8_t> buf; int flen = fa->get_len(); diff --git a/main/tests/test_physics.h b/main/tests/test_physics.h index 699e31f492..a281f669e0 100644 --- a/main/tests/test_physics.h +++ b/main/tests/test_physics.h @@ -31,10 +31,6 @@ #ifndef TEST_PHYSICS_H #define TEST_PHYSICS_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #include "core/os/main_loop.h" namespace TestPhysics { diff --git a/main/tests/test_render.h b/main/tests/test_render.h index 3810760b56..6dda57db5b 100644 --- a/main/tests/test_render.h +++ b/main/tests/test_render.h @@ -31,10 +31,6 @@ #ifndef TEST_RENDER_H #define TEST_RENDER_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #include "core/os/main_loop.h" namespace TestRender { diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp index dcb19b7df7..d66e706b6f 100644 --- a/main/tests/test_shader_lang.cpp +++ b/main/tests/test_shader_lang.cpp @@ -197,6 +197,13 @@ static String dump_node_code(SL::Node *p_node, int p_level) { case SL::Node::TYPE_VARIABLE_DECLARATION: { // FIXME: Implement } break; + case SL::Node::TYPE_ARRAY: { + SL::ArrayNode *vnode = (SL::ArrayNode *)p_node; + code = vnode->name; + } break; + case SL::Node::TYPE_ARRAY_DECLARATION: { + // FIXME: Implement + } break; case SL::Node::TYPE_CONSTANT: { SL::ConstantNode *cnode = (SL::ConstantNode *)p_node; return get_constant_text(cnode->datatype, cnode->values); diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp index 05df888f40..7a41880645 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -432,6 +432,10 @@ bool test_26() { OS::get_singleton()->print("\n\nTest 26: RegEx substitution\n"); +#ifndef MODULE_REGEX_ENABLED + OS::get_singleton()->print("\tRegEx module disabled, can't run test."); + return false; +#else String s = "Double all the vowels."; OS::get_singleton()->print("\tString: %ls\n", s.c_str()); @@ -443,6 +447,7 @@ bool test_26() { OS::get_singleton()->print("\tResult: %ls\n", s.c_str()); return (s == "Doouublee aall thee vooweels."); +#endif } struct test_27_data { @@ -1078,6 +1083,44 @@ bool test_34() { return state; } +bool test_35() { +#define COUNT_TEST(x) \ + { \ + bool success = x; \ + state = state && success; \ + if (!success) { \ + OS::get_singleton()->print("\tfailed at: %s\n", #x); \ + } \ + } + + OS::get_singleton()->print("\n\nTest 35: count and countn function\n"); + bool state = true; + + COUNT_TEST(String("").count("Test") == 0); + COUNT_TEST(String("Test").count("") == 0); + COUNT_TEST(String("Test").count("test") == 0); + COUNT_TEST(String("Test").count("TEST") == 0); + COUNT_TEST(String("TEST").count("TEST") == 1); + COUNT_TEST(String("Test").count("Test") == 1); + COUNT_TEST(String("aTest").count("Test") == 1); + COUNT_TEST(String("Testa").count("Test") == 1); + COUNT_TEST(String("TestTestTest").count("Test") == 3); + COUNT_TEST(String("TestTestTest").count("TestTest") == 1); + COUNT_TEST(String("TestGodotTestGodotTestGodot").count("Test") == 3); + + COUNT_TEST(String("TestTestTestTest").count("Test", 4, 8) == 1); + COUNT_TEST(String("TestTestTestTest").count("Test", 4, 12) == 2); + COUNT_TEST(String("TestTestTestTest").count("Test", 4, 16) == 3); + COUNT_TEST(String("TestTestTestTest").count("Test", 4) == 3); + + COUNT_TEST(String("Test").countn("test") == 1); + COUNT_TEST(String("Test").countn("TEST") == 1); + COUNT_TEST(String("testTest-Testatest").countn("tEst") == 4); + COUNT_TEST(String("testTest-TeStatest").countn("tEsT", 4, 16) == 2); + + return state; +} + typedef bool (*TestFunc)(void); TestFunc test_funcs[] = { @@ -1116,6 +1159,7 @@ TestFunc test_funcs[] = { test_32, test_33, test_34, + test_35, 0 }; diff --git a/methods.py b/methods.py index bb4adfb70b..86ab7cd9af 100644 --- a/methods.py +++ b/methods.py @@ -8,14 +8,28 @@ import subprocess from compat import iteritems, isbasestring, decode_utf8 -def add_source_files(self, sources, filetype, lib_env=None, shared=False): - - if isbasestring(filetype): - dir_path = self.Dir('.').abspath - filetype = sorted(glob.glob(dir_path + "/" + filetype)) - - for path in filetype: - sources.append(self.Object(path)) +def add_source_files(self, sources, files, warn_duplicates=True): + # Convert string to list of absolute paths (including expanding wildcard) + if isbasestring(files): + # Keep SCons project-absolute path as they are (no wildcard support) + if files.startswith('#'): + if '*' in files: + print("ERROR: Wildcards can't be expanded in SCons project-absolute path: '{}'".format(files)) + return + files = [files] + else: + dir_path = self.Dir('.').abspath + files = sorted(glob.glob(dir_path + "/" + files)) + + # Add each path as compiled Object following environment (self) configuration + for path in files: + obj = self.Object(path) + if obj in sources: + if warn_duplicates: + print("WARNING: Object \"{}\" already included in environment sources.".format(obj)) + else: + continue + sources.append(obj) def disable_warnings(self): @@ -603,7 +617,11 @@ def detect_darwin_sdk_path(platform, env): raise def get_compiler_version(env): - version = decode_utf8(subprocess.check_output([env['CXX'], '--version']).strip()) + # Not using this method on clang because it returns 4.2.1 # https://reviews.llvm.org/D56803 + if using_gcc(env): + version = decode_utf8(subprocess.check_output([env['CXX'], '-dumpversion']).strip()) + else: + version = decode_utf8(subprocess.check_output([env['CXX'], '--version']).strip()) match = re.search('[0-9][0-9.]*', version) if match is not None: return match.group().split('.') diff --git a/misc/ide/jetbrains/build.gradle b/misc/ide/jetbrains/build.gradle index eb2fbc0e69..dea81b4ea3 100644 --- a/misc/ide/jetbrains/build.gradle +++ b/misc/ide/jetbrains/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.2' } } diff --git a/misc/ide/jetbrains/gradle/wrapper/gradle-wrapper.properties b/misc/ide/jetbrains/gradle/wrapper/gradle-wrapper.properties index b477add150..22e7a5c60b 100644 --- a/misc/ide/jetbrains/gradle/wrapper/gradle-wrapper.properties +++ b/misc/ide/jetbrains/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Mar 31 16:34:43 PDT 2019 +#Wed Aug 21 13:47:30 PDT 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/modules/SCsub b/modules/SCsub index 36c2472c42..42d89d6ce2 100644 --- a/modules/SCsub +++ b/modules/SCsub @@ -6,9 +6,9 @@ env_modules = env.Clone() Export('env_modules') -env.modules_sources = [ - "register_module_types.gen.cpp", -] +env.modules_sources = [] + +env_modules.add_source_files(env.modules_sources, "register_module_types.gen.cpp") for x in env.module_list: if (x in env.disabled_modules): diff --git a/modules/arkit/arkit_interface.mm b/modules/arkit/arkit_interface.mm index de58f93276..68844c54c2 100644 --- a/modules/arkit/arkit_interface.mm +++ b/modules/arkit/arkit_interface.mm @@ -430,7 +430,7 @@ void ARKitInterface::process() { // get some info about our screen and orientation Size2 screen_size = OS::get_singleton()->get_window_size(); - UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; // Grab our camera image for our backbuffer CVPixelBufferRef pixelBuffer = current_frame.capturedImage; @@ -531,7 +531,7 @@ void ARKitInterface::process() { // we need to invert this, probably row v.s. column notation affine_transform = CGAffineTransformInvert(affine_transform); - if (orientation != UIDeviceOrientationPortrait) { + if (orientation != UIInterfaceOrientationPortrait) { affine_transform.b = -affine_transform.b; affine_transform.d = -affine_transform.d; affine_transform.ty = 1.0 - affine_transform.ty; @@ -582,28 +582,28 @@ void ARKitInterface::process() { // copy our current frame transform matrix_float4x4 m44 = camera.transform; - if (orientation == UIDeviceOrientationLandscapeLeft) { + if (orientation == UIInterfaceOrientationLandscapeLeft) { transform.basis.elements[0].x = m44.columns[0][0]; transform.basis.elements[1].x = m44.columns[0][1]; transform.basis.elements[2].x = m44.columns[0][2]; transform.basis.elements[0].y = m44.columns[1][0]; transform.basis.elements[1].y = m44.columns[1][1]; transform.basis.elements[2].y = m44.columns[1][2]; - } else if (orientation == UIDeviceOrientationPortrait) { + } else if (orientation == UIInterfaceOrientationPortrait) { transform.basis.elements[0].x = m44.columns[1][0]; transform.basis.elements[1].x = m44.columns[1][1]; transform.basis.elements[2].x = m44.columns[1][2]; transform.basis.elements[0].y = -m44.columns[0][0]; transform.basis.elements[1].y = -m44.columns[0][1]; transform.basis.elements[2].y = -m44.columns[0][2]; - } else if (orientation == UIDeviceOrientationLandscapeRight) { + } else if (orientation == UIInterfaceOrientationLandscapeRight) { transform.basis.elements[0].x = -m44.columns[0][0]; transform.basis.elements[1].x = -m44.columns[0][1]; transform.basis.elements[2].x = -m44.columns[0][2]; transform.basis.elements[0].y = -m44.columns[1][0]; transform.basis.elements[1].y = -m44.columns[1][1]; transform.basis.elements[2].y = -m44.columns[1][2]; - } else if (orientation == UIDeviceOrientationPortraitUpsideDown) { + } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) { // this may not be correct transform.basis.elements[0].x = m44.columns[1][0]; transform.basis.elements[1].x = m44.columns[1][1]; diff --git a/modules/assimp/SCsub b/modules/assimp/SCsub index 8a77e4f803..275f1ff5e9 100644 --- a/modules/assimp/SCsub +++ b/modules/assimp/SCsub @@ -9,6 +9,7 @@ env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/include']) env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code/Importer/IFC']) env_assimp.Prepend(CPPPATH=['#thirdparty/misc']) env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/common']) env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/irrXML/']) env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/unzip/']) env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code/Importer/STEPParser']) @@ -65,18 +66,13 @@ env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_STEP_IMPORTER']) env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_IFC_IMPORTER']) env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_XGL_IMPORTER']) env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_ASSBIN_IMPORTER']) -env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF_IMPORTER']) env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_C4D_IMPORTER']) env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_3MF_IMPORTER']) 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']) -if (not env.msvc): - env_assimp.Append(CXXFLAGS=['-std=c++11']) -elif (env.msvc == False and env['platform'] == 'windows'): - env_assimp.Append(LDFLAGS=['-pthread']) - if(env['platform'] == 'windows'): env_assimp.Append(CPPDEFINES=['PLATFORM_WINDOWS']) env_assimp.Append(CPPDEFINES=[('PLATFORM', 'WINDOWS')]) @@ -89,7 +85,13 @@ elif(env['platform'] == 'osx'): env_thirdparty = env_assimp.Clone() env_thirdparty.disable_warnings() -env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/*.cpp')) +env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/Common/*.cpp')) +env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/PostProcessing/*.cpp')) +env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/Material/*.cpp')) +env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/FBX/*.cpp')) +env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/MMD/*.cpp')) +env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/glTF/*.cpp')) +env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/glTF2/*.cpp')) # Godot's own source files env_assimp.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index f23c66dbcf..05f9120a07 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -150,8 +150,7 @@ Node *EditorSceneImporterAssimp::import_scene(const String &p_path, uint32_t p_f 0; const aiScene *scene = 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); } @@ -348,8 +347,7 @@ void EditorSceneImporterAssimp::_fill_node_relationships(ImportState &state, con } else if (ownership[name] != p_skeleton_id) { //oh, it's from another skeleton? fine.. reparent all bones to this skeleton. int prev_owner = ownership[name]; - ERR_EXPLAIN("A previous skeleton exists for bone '" + name + "', this type of skeleton layout is unsupported."); - ERR_FAIL_COND(skeleton_map.has(prev_owner)); + ERR_FAIL_COND_MSG(skeleton_map.has(prev_owner), "A previous skeleton exists for bone '" + name + "', this type of skeleton layout is unsupported."); for (Map<String, int>::Element *E = ownership.front(); E; E = E->next()) { if (E->get() == prev_owner) { E->get() = p_skeleton_id; @@ -779,8 +777,7 @@ Ref<Texture> EditorSceneImporterAssimp::_load_texture(ImportState &state, String t->set_storage(ImageTexture::STORAGE_COMPRESS_LOSSY); return t; } else if (tex->CheckFormat("dds")) { - ERR_EXPLAIN("Open Asset Import: Embedded dds not implemented"); - ERR_FAIL_COND_V(true, Ref<Texture>()); + ERR_FAIL_V_MSG(Ref<Texture>(), "Open Asset Import: Embedded dds not implemented."); //Ref<Image> img = Image::_dds_mem_loader_func((uint8_t *)tex->pcData, tex->mWidth); //ERR_FAIL_COND_V(img.is_null(), Ref<Texture>()); //Ref<ImageTexture> t; @@ -1718,7 +1715,7 @@ void EditorSceneImporterAssimp::_find_texture_path(const String &p_path, _Direct } } -String EditorSceneImporterAssimp::_assimp_get_string(const aiString p_string) const { +String EditorSceneImporterAssimp::_assimp_get_string(const aiString &p_string) const { //convert an assimp String to a Godot String String name; name.parse_utf8(p_string.C_Str() /*,p_string.length*/); @@ -1733,7 +1730,7 @@ String EditorSceneImporterAssimp::_assimp_get_string(const aiString p_string) co return name; } -String EditorSceneImporterAssimp::_assimp_anim_string_to_string(const aiString p_string) const { +String EditorSceneImporterAssimp::_assimp_anim_string_to_string(const aiString &p_string) const { String name; name.parse_utf8(p_string.C_Str() /*,p_string.length*/); @@ -1745,7 +1742,7 @@ String EditorSceneImporterAssimp::_assimp_anim_string_to_string(const aiString p return name; } -String EditorSceneImporterAssimp::_assimp_raw_string_to_string(const aiString p_string) const { +String EditorSceneImporterAssimp::_assimp_raw_string_to_string(const aiString &p_string) const { String name; name.parse_utf8(p_string.C_Str() /*,p_string.length*/); return name; diff --git a/modules/assimp/editor_scene_importer_assimp.h b/modules/assimp/editor_scene_importer_assimp.h index 598845236e..7a30816e3b 100644 --- a/modules/assimp/editor_scene_importer_assimp.h +++ b/modules/assimp/editor_scene_importer_assimp.h @@ -178,7 +178,7 @@ private: }; const Transform _assimp_matrix_transform(const aiMatrix4x4 p_matrix); - String _assimp_get_string(const aiString p_string) const; + String _assimp_get_string(const aiString &p_string) const; Transform _get_global_assimp_node_transform(const aiNode *p_current_node); void _calc_tangent_from_mesh(const aiMesh *ai_mesh, int i, int tri_index, int index, PoolColorArray::Write &w); @@ -200,8 +200,8 @@ private: Spatial *_generate_scene(const String &p_path, const 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; + 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); diff --git a/modules/assimp/godot_update_assimp.sh b/modules/assimp/godot_update_assimp.sh index dcf1e6d4a2..ff8ff59e97 100644..100755 --- a/modules/assimp/godot_update_assimp.sh +++ b/modules/assimp/godot_update_assimp.sh @@ -254,8 +254,9 @@ rm -rf contrib/irrXML rm -rf contrib/Open3DGC rm -rf contrib/openddlparser rm -rf contrib/poly2tri -rm -rf contrib/rapidjson +#rm -rf contrib/rapidjson rm -rf contrib/unzip rm -rf contrib/zip rm -rf contrib/stb_image rm .travis* + diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp index a7e8dec11e..5a32fa1c2c 100644 --- a/modules/bmp/image_loader_bmp.cpp +++ b/modules/bmp/image_loader_bmp.cpp @@ -47,9 +47,6 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, size_t height = (size_t)p_header.bmp_info_header.bmp_height; size_t bits_per_pixel = (size_t)p_header.bmp_info_header.bmp_bit_count; - if (p_header.bmp_info_header.bmp_compression != BI_RGB) { - err = FAILED; - } // Check whether we can load it if (bits_per_pixel == 1) { @@ -238,11 +235,16 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, bmp_header.bmp_info_header.bmp_colors_used = f->get_32(); bmp_header.bmp_info_header.bmp_important_colors = f->get_32(); - // Compressed bitmaps not supported, stop parsing - if (bmp_header.bmp_info_header.bmp_compression != BI_RGB) { - ERR_EXPLAIN("Unsupported bmp file: " + f->get_path()); - f->close(); - ERR_FAIL_V(ERR_UNAVAILABLE); + switch (bmp_header.bmp_info_header.bmp_compression) { + case BI_RLE8: + case BI_RLE4: + case BI_CMYKRLE8: + case BI_CMYKRLE4: { + // Stop parsing + String bmp_path = f->get_path(); + f->close(); + ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "Compressed BMP files are not supported: " + bmp_path + "."); + } break; } // Don't rely on sizeof(bmp_file_header) as structure padding // adds 2 bytes offset leading to misaligned color table reading @@ -257,8 +259,8 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, if (bmp_header.bmp_info_header.bmp_bit_count <= 8) { // Support 256 colors max color_table_size = 1 << bmp_header.bmp_info_header.bmp_bit_count; + ERR_FAIL_COND_V(color_table_size == 0, ERR_BUG); } - ERR_FAIL_COND_V(color_table_size == 0, ERR_BUG); PoolVector<uint8_t> bmp_color_table; // Color table is usually 4 bytes per color -> [B][G][R][0] diff --git a/modules/bmp/image_loader_bmp.h b/modules/bmp/image_loader_bmp.h index 0082cf778a..2debb19a1c 100644 --- a/modules/bmp/image_loader_bmp.h +++ b/modules/bmp/image_loader_bmp.h @@ -42,15 +42,15 @@ protected: enum bmp_compression_s { BI_RGB = 0x00, - BI_RLE8 = 0x01, - BI_RLE4 = 0x02, + BI_RLE8 = 0x01, // compressed + BI_RLE4 = 0x02, // compressed BI_BITFIELDS = 0x03, BI_JPEG = 0x04, BI_PNG = 0x05, BI_ALPHABITFIELDS = 0x06, BI_CMYK = 0x0b, - BI_CMYKRLE8 = 0x0c, - BI_CMYKRLE4 = 0x0d + BI_CMYKRLE8 = 0x0c, // compressed + BI_CMYKRLE4 = 0x0d // compressed }; struct bmp_header_s { diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp index 038001996d..e01928191a 100644 --- a/modules/bullet/bullet_physics_server.cpp +++ b/modules/bullet/bullet_physics_server.cpp @@ -1548,8 +1548,7 @@ void BulletPhysicsServer::free(RID p_rid) { bulletdelete(space); } else { - ERR_EXPLAIN("Invalid ID"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid ID."); } } diff --git a/modules/bullet/cone_twist_joint_bullet.cpp b/modules/bullet/cone_twist_joint_bullet.cpp index bc7fd52cf6..97b9a81f77 100644 --- a/modules/bullet/cone_twist_joint_bullet.cpp +++ b/modules/bullet/cone_twist_joint_bullet.cpp @@ -83,8 +83,7 @@ void ConeTwistJointBullet::set_param(PhysicsServer::ConeTwistJointParam p_param, coneConstraint->setLimit(coneConstraint->getSwingSpan1(), coneConstraint->getSwingSpan2(), coneConstraint->getTwistSpan(), coneConstraint->getLimitSoftness(), coneConstraint->getBiasFactor(), p_value); break; default: - ERR_EXPLAIN("This parameter " + itos(p_param) + " is deprecated"); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); break; } } @@ -102,8 +101,7 @@ real_t ConeTwistJointBullet::get_param(PhysicsServer::ConeTwistJointParam p_para case PhysicsServer::CONE_TWIST_JOINT_RELAXATION: return coneConstraint->getRelaxationFactor(); default: - ERR_EXPLAIN("This parameter " + itos(p_param) + " is deprecated"); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); return 0; } } diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp index 0d2c46c579..4aae87c220 100644 --- a/modules/bullet/generic_6dof_joint_bullet.cpp +++ b/modules/bullet/generic_6dof_joint_bullet.cpp @@ -174,8 +174,7 @@ void Generic6DOFJointBullet::set_param(Vector3::Axis p_axis, PhysicsServer::G6DO sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_equilibriumPoint = p_value; break; default: - ERR_EXPLAIN("This parameter " + itos(p_param) + " is deprecated"); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); break; } } @@ -216,8 +215,7 @@ real_t Generic6DOFJointBullet::get_param(Vector3::Axis p_axis, PhysicsServer::G6 case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_equilibriumPoint; default: - ERR_EXPLAIN("This parameter " + itos(p_param) + " is deprecated"); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); return 0; } } @@ -255,8 +253,7 @@ void Generic6DOFJointBullet::set_flag(Vector3::Axis p_axis, PhysicsServer::G6DOF sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableSpring = p_value; break; default: - ERR_EXPLAIN("This flag " + itos(p_flag) + " is deprecated"); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The flag " + itos(p_flag) + " is deprecated."); break; } } diff --git a/modules/bullet/hinge_joint_bullet.cpp b/modules/bullet/hinge_joint_bullet.cpp index b7e1e1a4c2..4d26e729db 100644 --- a/modules/bullet/hinge_joint_bullet.cpp +++ b/modules/bullet/hinge_joint_bullet.cpp @@ -117,8 +117,7 @@ void HingeJointBullet::set_param(PhysicsServer::HingeJointParam p_param, real_t hingeConstraint->setMaxMotorImpulse(p_value); break; default: - ERR_EXPLAIN("The HingeJoint parameter " + itos(p_param) + " is deprecated."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The HingeJoint parameter " + itos(p_param) + " is deprecated."); break; } } @@ -143,8 +142,7 @@ real_t HingeJointBullet::get_param(PhysicsServer::HingeJointParam p_param) const case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE: return hingeConstraint->getMaxMotorImpulse(); default: - ERR_EXPLAIN("The HingeJoint parameter " + itos(p_param) + " is deprecated."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The HingeJoint parameter " + itos(p_param) + " is deprecated."); return 0; } } diff --git a/modules/bullet/pin_joint_bullet.cpp b/modules/bullet/pin_joint_bullet.cpp index c9c4d1af7e..8d404e7f04 100644 --- a/modules/bullet/pin_joint_bullet.cpp +++ b/modules/bullet/pin_joint_bullet.cpp @@ -85,8 +85,7 @@ real_t PinJointBullet::get_param(PhysicsServer::PinJointParam p_param) const { case PhysicsServer::PIN_JOINT_IMPULSE_CLAMP: return p2pConstraint->m_setting.m_impulseClamp; default: - ERR_EXPLAIN("This parameter " + itos(p_param) + " is deprecated"); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); return 0; } } diff --git a/modules/bullet/rigid_body_bullet.h b/modules/bullet/rigid_body_bullet.h index 2c9bdb8b0b..f63148092f 100644 --- a/modules/bullet/rigid_body_bullet.h +++ b/modules/bullet/rigid_body_bullet.h @@ -305,7 +305,7 @@ public: void reload_axis_lock(); /// Doc: - /// http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Anti_tunneling_by_Motion_Clamping + /// https://web.archive.org/web/20180404091446/http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Anti_tunneling_by_Motion_Clamping void set_continuous_collision_detection(bool p_enable); bool is_continuous_collision_detection_enabled() const; diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index f15bcec914..85f47c3bbb 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -505,8 +505,7 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) { } } else { - ERR_EXPLAIN("Expected PoolRealArray or float Image."); - ERR_FAIL(); + ERR_FAIL_MSG("Expected PoolRealArray or float Image."); } ERR_FAIL_COND(l_width <= 0); diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index 738b415d16..d2b16b0fd1 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -582,6 +582,8 @@ void SpaceBullet::create_empty_world(bool p_create_soft_world) { world_mem = malloc(sizeof(btDiscreteDynamicsWorld)); } + ERR_FAIL_COND_MSG(!world_mem, "Out of memory."); + if (p_create_soft_world) { collisionConfiguration = bulletnew(GodotSoftCollisionConfiguration(static_cast<btDiscreteDynamicsWorld *>(world_mem))); } else { @@ -1230,7 +1232,7 @@ bool SpaceBullet::recover_from_penetration(RigidBodyBullet *p_body, const btTran ERR_FAIL_COND_V(shape_idx < 0 || shape_idx >= cs->getNumChildShapes(), false); if (cs->getChildShape(shape_idx)->isConvex()) { - if (RFP_convex_convex_test(kin_shape.shape, static_cast<const btConvexShape *>(cs->getChildShape(shape_idx)), otherObject, shape_idx, shape_transform, otherObject->getWorldTransform() * cs->getChildTransform(shape_idx), p_recover_movement_scale, r_delta_recover_movement, r_recover_result)) { + if (RFP_convex_convex_test(kin_shape.shape, static_cast<const btConvexShape *>(cs->getChildShape(shape_idx)), otherObject, kinIndex, shape_idx, shape_transform, otherObject->getWorldTransform() * cs->getChildTransform(shape_idx), p_recover_movement_scale, r_delta_recover_movement, r_recover_result)) { penetration = true; } @@ -1241,7 +1243,7 @@ bool SpaceBullet::recover_from_penetration(RigidBodyBullet *p_body, const btTran } } } else if (otherObject->getCollisionShape()->isConvex()) { /// Execute GJK test against object shape - if (RFP_convex_convex_test(kin_shape.shape, static_cast<const btConvexShape *>(otherObject->getCollisionShape()), otherObject, 0, shape_transform, otherObject->getWorldTransform(), p_recover_movement_scale, r_delta_recover_movement, r_recover_result)) { + if (RFP_convex_convex_test(kin_shape.shape, static_cast<const btConvexShape *>(otherObject->getCollisionShape()), otherObject, kinIndex, 0, shape_transform, otherObject->getWorldTransform(), p_recover_movement_scale, r_delta_recover_movement, r_recover_result)) { penetration = true; } @@ -1257,7 +1259,7 @@ bool SpaceBullet::recover_from_penetration(RigidBodyBullet *p_body, const btTran return penetration; } -bool SpaceBullet::RFP_convex_convex_test(const btConvexShape *p_shapeA, const btConvexShape *p_shapeB, btCollisionObject *p_objectB, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btScalar p_recover_movement_scale, btVector3 &r_delta_recover_movement, RecoverResult *r_recover_result) { +bool SpaceBullet::RFP_convex_convex_test(const btConvexShape *p_shapeA, const btConvexShape *p_shapeB, btCollisionObject *p_objectB, int p_shapeId_A, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btScalar p_recover_movement_scale, btVector3 &r_delta_recover_movement, RecoverResult *r_recover_result) { // Initialize GJK input btGjkPairDetector::ClosestPointInput gjk_input; @@ -1275,6 +1277,7 @@ bool SpaceBullet::RFP_convex_convex_test(const btConvexShape *p_shapeA, const bt if (r_recover_result) { if (result.m_distance < r_recover_result->penetration_distance) { r_recover_result->hasPenetration = true; + r_recover_result->local_shape_most_recovered = p_shapeId_A; r_recover_result->other_collision_object = p_objectB; r_recover_result->other_compound_shape_index = p_shapeId_B; r_recover_result->penetration_distance = result.m_distance; @@ -1310,6 +1313,7 @@ bool SpaceBullet::RFP_convex_world_test(const btConvexShape *p_shapeA, const btC if (r_recover_result) { if (contactPointResult.m_penetration_distance < r_recover_result->penetration_distance) { r_recover_result->hasPenetration = true; + r_recover_result->local_shape_most_recovered = p_shapeId_A; r_recover_result->other_collision_object = p_objectB; r_recover_result->other_compound_shape_index = p_shapeId_B; r_recover_result->penetration_distance = contactPointResult.m_penetration_distance; diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h index eb4a065e54..ecf8a2db9d 100644 --- a/modules/bullet/space_bullet.h +++ b/modules/bullet/space_bullet.h @@ -208,7 +208,7 @@ private: bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_body_position, btScalar p_recover_movement_scale, bool p_infinite_inertia, btVector3 &r_delta_recover_movement, RecoverResult *r_recover_result = NULL); /// This is an API that recover a kinematic object from penetration /// This allow only Convex Convex test and it always use GJK algorithm, With this API we don't benefit of Bullet special accelerated functions - bool RFP_convex_convex_test(const btConvexShape *p_shapeA, const btConvexShape *p_shapeB, btCollisionObject *p_objectB, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btScalar p_recover_movement_scale, btVector3 &r_delta_recover_movement, RecoverResult *r_recover_result = NULL); + bool RFP_convex_convex_test(const btConvexShape *p_shapeA, const btConvexShape *p_shapeB, btCollisionObject *p_objectB, int p_shapeId_A, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btScalar p_recover_movement_scale, btVector3 &r_delta_recover_movement, RecoverResult *r_recover_result = NULL); /// This is an API that recover a kinematic object from penetration /// Using this we leave Bullet to select the best algorithm, For example GJK in case we have Convex Convex, or a Bullet accelerated algorithm bool RFP_convex_world_test(const btConvexShape *p_shapeA, const btCollisionShape *p_shapeB, btCollisionObject *p_objectA, btCollisionObject *p_objectB, int p_shapeId_A, int p_shapeId_B, const btTransform &p_transformA, const btTransform &p_transformB, btScalar p_recover_movement_scale, btVector3 &r_delta_recover_movement, RecoverResult *r_recover_result = NULL); diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index fd0d36eddf..f1b3fa2ac6 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 (Math::is_zero_approx(segment[j].distance_to(points[i].point))) { + if (segment[j] == 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 (Math::is_zero_approx(closest.distance_to(segment[j]))) { + if (closest == 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 (Math::is_zero_approx(segment[0].distance_to(segment[1]))) + if (segment[0] == 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 (Math::is_zero_approx(va[0].distance_to(va[1])) || Math::is_zero_approx(va[0].distance_to(va[2])) || Math::is_zero_approx(va[1].distance_to(va[2]))) + if (va[0] == va[1] || va[0] == va[2] || va[1] == va[2]) return; - if (Math::is_zero_approx(vb[0].distance_to(vb[1])) || Math::is_zero_approx(vb[0].distance_to(vb[2])) || Math::is_zero_approx(vb[1].distance_to(vb[2]))) + if (vb[0] == vb[1] || vb[0] == vb[2] || vb[1] == vb[2]) return; } diff --git a/modules/csg/doc_classes/CSGBox.xml b/modules/csg/doc_classes/CSGBox.xml index d100c01205..14f5a1952e 100644 --- a/modules/csg/doc_classes/CSGBox.xml +++ b/modules/csg/doc_classes/CSGBox.xml @@ -17,7 +17,7 @@ <member name="height" type="float" setter="set_height" getter="get_height" default="2.0"> Height of the box measured from the center of the box. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the box. </member> <member name="width" type="float" setter="set_width" getter="get_width" default="2.0"> diff --git a/modules/csg/doc_classes/CSGCylinder.xml b/modules/csg/doc_classes/CSGCylinder.xml index 643eb7c7f4..9fc0281887 100644 --- a/modules/csg/doc_classes/CSGCylinder.xml +++ b/modules/csg/doc_classes/CSGCylinder.xml @@ -17,7 +17,7 @@ <member name="height" type="float" setter="set_height" getter="get_height" default="1.0"> The height of the cylinder. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the cylinder. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0"> diff --git a/modules/csg/doc_classes/CSGMesh.xml b/modules/csg/doc_classes/CSGMesh.xml index daa08decb6..afe0bc262d 100644 --- a/modules/csg/doc_classes/CSGMesh.xml +++ b/modules/csg/doc_classes/CSGMesh.xml @@ -11,9 +11,9 @@ <methods> </methods> <members> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> </member> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> The mesh resource to use as a CSG shape. </member> </members> diff --git a/modules/csg/doc_classes/CSGPolygon.xml b/modules/csg/doc_classes/CSGPolygon.xml index 48f5d730cc..0ecee92cd5 100644 --- a/modules/csg/doc_classes/CSGPolygon.xml +++ b/modules/csg/doc_classes/CSGPolygon.xml @@ -14,7 +14,7 @@ <member name="depth" type="float" setter="set_depth" getter="get_depth" default="1.0"> Extrusion depth when [member mode] is [constant MODE_DEPTH]. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> Material to use for the resulting mesh. </member> <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="CSGPolygon.Mode" default="0"> diff --git a/modules/csg/doc_classes/CSGSphere.xml b/modules/csg/doc_classes/CSGSphere.xml index 0a62644179..714e725acb 100644 --- a/modules/csg/doc_classes/CSGSphere.xml +++ b/modules/csg/doc_classes/CSGSphere.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the sphere. </member> <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" default="12"> diff --git a/modules/csg/doc_classes/CSGTorus.xml b/modules/csg/doc_classes/CSGTorus.xml index 156fb185e7..5dc6bb8380 100644 --- a/modules/csg/doc_classes/CSGTorus.xml +++ b/modules/csg/doc_classes/CSGTorus.xml @@ -14,7 +14,7 @@ <member name="inner_radius" type="float" setter="set_inner_radius" getter="get_inner_radius" default="2.0"> The inner radius of the torus. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the torus. </member> <member name="outer_radius" type="float" setter="set_outer_radius" getter="get_outer_radius" default="3.0"> diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 4628bd9a5b..0220dcae4a 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -108,8 +108,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, if (r_error) *r_error = ERR_FILE_CORRUPT; - ERR_EXPLAIN("Unable to open DDS texture file: " + p_path); - ERR_FAIL_COND_V(err != OK, RES()); + ERR_FAIL_COND_V_MSG(err != OK, RES(), "Unable to open DDS texture file: " + p_path + "."); uint32_t magic = f->get_32(); uint32_t hsize = f->get_32(); @@ -128,8 +127,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, if (magic != DDS_MAGIC || hsize != 124 || !(flags & DDSD_PIXELFORMAT) || !(flags & DDSD_CAPS)) { - ERR_EXPLAIN("Invalid or Unsupported DDS texture file: " + p_path); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), "Invalid or unsupported DDS texture file: " + p_path + "."); } /* uint32_t format_size = */ f->get_32(); @@ -218,9 +216,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, } else { printf("unrecognized fourcc %x format_flags: %x - rgbbits %i - red_mask %x green mask %x blue mask %x alpha mask %x\n", format_fourcc, format_flags, format_rgb_bits, format_red_mask, format_green_mask, format_blue_mask, format_alpha_mask); - ERR_EXPLAIN("Unrecognized or Unsupported color layout in DDS: " + p_path); - - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), "Unrecognized or unsupported color layout in DDS: " + p_path + "."); } if (!(flags & DDSD_MIPMAPCOUNT)) diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index a5a356ced2..44f69ca261 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -543,10 +543,7 @@ Error NetworkedMultiplayerENet::put_packet(const uint8_t *p_buffer, int p_buffer if (target_peer != 0) { E = peer_map.find(ABS(target_peer)); - if (!E) { - ERR_EXPLAIN("Invalid Target Peer: " + itos(target_peer)); - ERR_FAIL_V(ERR_INVALID_PARAMETER); - } + ERR_FAIL_COND_V_MSG(!E, ERR_INVALID_PARAMETER, "Invalid target peer: " + itos(target_peer) + "."); } ENetPacket *packet = enet_packet_create(NULL, p_buffer_size + 8, packet_flags); @@ -794,11 +791,7 @@ int NetworkedMultiplayerENet::get_peer_port(int p_peer_id) const { void NetworkedMultiplayerENet::set_transfer_channel(int p_channel) { ERR_FAIL_COND(p_channel < -1 || p_channel >= channel_count); - - if (p_channel == SYSCH_CONFIG) { - ERR_EXPLAIN("Channel " + itos(SYSCH_CONFIG) + " is reserved"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(p_channel == SYSCH_CONFIG, "Channel " + itos(SYSCH_CONFIG) + " is reserved."); transfer_channel = p_channel; } diff --git a/modules/etc/SCsub b/modules/etc/SCsub index 532b97b006..1742d3534f 100644 --- a/modules/etc/SCsub +++ b/modules/etc/SCsub @@ -29,10 +29,6 @@ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] env_etc.Prepend(CPPPATH=[thirdparty_dir]) -# upstream uses c++11 -if not env.msvc: - env_etc.Append(CXXFLAGS="-std=c++11") - env_thirdparty = env_etc.Clone() env_thirdparty.disable_warnings() env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) diff --git a/modules/etc/texture_loader_pkm.cpp b/modules/etc/texture_loader_pkm.cpp index ff925480b8..dd61d816d4 100644 --- a/modules/etc/texture_loader_pkm.cpp +++ b/modules/etc/texture_loader_pkm.cpp @@ -56,17 +56,14 @@ RES ResourceFormatPKM::load(const String &p_path, const String &p_original_path, if (r_error) *r_error = ERR_FILE_CORRUPT; - ERR_EXPLAIN("Unable to open PKM texture file: " + p_path); - ERR_FAIL_COND_V(err != OK, RES()); + ERR_FAIL_COND_V_MSG(err != OK, RES(), "Unable to open PKM texture file: " + p_path + "."); // big endian f->set_endian_swap(true); ETC1Header h; - ERR_EXPLAIN("Invalid or Unsupported PKM texture file: " + p_path); f->get_buffer((uint8_t *)&h.tag, sizeof(h.tag)); - if (strncmp(h.tag, "PKM 10", sizeof(h.tag))) - ERR_FAIL_V(RES()); + ERR_FAIL_COND_V_MSG(strncmp(h.tag, "PKM 10", sizeof(h.tag)), RES(), "Invalid or unsupported PKM texture file: " + p_path + "."); h.format = f->get_16(); h.texWidth = f->get_16(); diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp index 64e2c362b2..bd6eb575d0 100644 --- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp +++ b/modules/gdnative/arvr/arvr_interface_gdnative.cpp @@ -245,8 +245,7 @@ extern "C" { void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface) { // If our major version is 0 or bigger then 10, we're likely looking at our constructor pointer from an older plugin - ERR_EXPLAINC("GDNative ARVR interfaces build for Godot 3.0 are not supported"); - ERR_FAIL_COND((p_interface->version.major == 0) || (p_interface->version.major > 10)); + ERR_FAIL_COND_MSG((p_interface->version.major == 0) || (p_interface->version.major > 10), "GDNative ARVR interfaces build for Godot 3.0 are not supported."); Ref<ARVRInterfaceGDNative> new_interface; new_interface.instance(); diff --git a/modules/gdnative/doc_classes/GDNative.xml b/modules/gdnative/doc_classes/GDNative.xml index 95ed1fc048..8750ddc56d 100644 --- a/modules/gdnative/doc_classes/GDNative.xml +++ b/modules/gdnative/doc_classes/GDNative.xml @@ -33,7 +33,7 @@ </method> </methods> <members> - <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library" default="null"> + <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library"> </member> </members> <constants> diff --git a/modules/gdnative/doc_classes/NativeScript.xml b/modules/gdnative/doc_classes/NativeScript.xml index 460471386d..e34e209374 100644 --- a/modules/gdnative/doc_classes/NativeScript.xml +++ b/modules/gdnative/doc_classes/NativeScript.xml @@ -53,7 +53,7 @@ <members> <member name="class_name" type="String" setter="set_class_name" getter="get_class_name" default=""""> </member> - <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library" default="null"> + <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library"> </member> <member name="script_class_icon_path" type="String" setter="set_script_class_icon_path" getter="get_script_class_icon_path" default=""""> </member> diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 4eb9a2a0a3..783ad4e147 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -268,8 +268,7 @@ void GDNative::_bind_methods() { } void GDNative::set_library(Ref<GDNativeLibrary> p_library) { - ERR_EXPLAIN("Tried to change library of GDNative when it is already set"); - ERR_FAIL_COND(library.is_valid()); + ERR_FAIL_COND_MSG(library.is_valid(), "Tried to change library of GDNative when it is already set."); library = p_library; } diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp index 913c57eb56..9086121940 100644 --- a/modules/gdnative/gdnative/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -186,6 +186,20 @@ godot_bool GDAPI godot_string_ends_with(const godot_string *p_self, const godot_ return self->ends_with(*string); } +godot_int GDAPI godot_string_count(const godot_string *p_self, godot_string p_what, godot_int p_from, godot_int p_to) { + const String *self = (const String *)p_self; + String *what = (String *)&p_what; + + return self->count(*what, p_from, p_to); +} + +godot_int GDAPI godot_string_countn(const godot_string *p_self, godot_string p_what, godot_int p_from, godot_int p_to) { + const String *self = (const String *)p_self; + String *what = (String *)&p_what; + + return self->countn(*what, p_from, p_to); +} + godot_int GDAPI godot_string_find(const godot_string *p_self, godot_string p_what) { const String *self = (const String *)p_self; String *what = (String *)&p_what; diff --git a/modules/gdnative/gdnative/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp index a2ac61b35e..d82f2c692d 100644 --- a/modules/gdnative/gdnative/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -77,6 +77,14 @@ godot_bool GDAPI godot_vector2_is_normalized(const godot_vector2 *p_self) { return self->is_normalized(); } +godot_vector2 GDAPI godot_vector2_direction_to(const godot_vector2 *p_self, const godot_vector2 *p_to) { + godot_vector2 dest; + const Vector2 *self = (const Vector2 *)p_self; + const Vector2 *to = (const Vector2 *)p_to; + *((Vector2 *)&dest) = self->direction_to(*to); + return dest; +} + godot_real GDAPI godot_vector2_distance_to(const godot_vector2 *p_self, const godot_vector2 *p_to) { const Vector2 *self = (const Vector2 *)p_self; const Vector2 *to = (const Vector2 *)p_to; diff --git a/modules/gdnative/gdnative/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp index 894683ab38..15a8ef9a2e 100644 --- a/modules/gdnative/gdnative/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -182,6 +182,14 @@ godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self) { return dest; } +godot_vector3 GDAPI godot_vector3_direction_to(const godot_vector3 *p_self, const godot_vector3 *p_to) { + godot_vector3 dest; + const Vector3 *self = (const Vector3 *)p_self; + const Vector3 *to = (const Vector3 *)p_to; + *((Vector3 *)&dest) = self->direction_to(*to); + return dest; +} + godot_real GDAPI godot_vector3_distance_to(const godot_vector3 *p_self, const godot_vector3 *p_b) { const Vector3 *self = (const Vector3 *)p_self; const Vector3 *b = (const Vector3 *)p_b; diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 6c12ee6534..03258584ce 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -44,6 +44,42 @@ ["const godot_vector2 *", "p_to"], ["const godot_real", "p_delta"] ] + }, + { + "name": "godot_string_count", + "return_type": "godot_int", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_string", "p_what"], + ["godot_int", "p_from"], + ["godot_int", "p_to"] + ] + }, + { + "name": "godot_string_countn", + "return_type": "godot_int", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_string", "p_what"], + ["godot_int", "p_from"], + ["godot_int", "p_to"] + ] + }, + { + "name": "godot_vector3_direction_to", + "return_type": "godot_vector3", + "arguments": [ + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_to"] + ] + }, + { + "name": "godot_vector2_direction_to", + "return_type": "godot_vector2", + "arguments": [ + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_to"] + ] } ] }, @@ -6512,24 +6548,24 @@ "name": "godot_net_bind_stream_peer", "return_type": "void", "arguments": [ - ["godot_object *", "p_obj"], - ["const godot_net_stream_peer *", "p_interface"] + ["godot_object *", "p_obj"], + ["const godot_net_stream_peer *", "p_interface"] ] }, { "name": "godot_net_bind_packet_peer", "return_type": "void", "arguments": [ - ["godot_object *", "p_obj"], - ["const godot_net_packet_peer *", "p_interface"] + ["godot_object *", "p_obj"], + ["const godot_net_packet_peer *", "p_interface"] ] }, { "name": "godot_net_bind_multiplayer_peer", "return_type": "void", "arguments": [ - ["godot_object *", "p_obj"], - ["const godot_net_multiplayer_peer *", "p_interface"] + ["godot_object *", "p_obj"], + ["const godot_net_multiplayer_peer *", "p_interface"] ] } ] diff --git a/modules/gdnative/gdnative_builders.py b/modules/gdnative/gdnative_builders.py index 7ab0e01108..20c1a2233c 100644 --- a/modules/gdnative/gdnative_builders.py +++ b/modules/gdnative/gdnative_builders.py @@ -185,7 +185,7 @@ def _build_gdnative_api_struct_source(api): 'extern const godot_gdnative_core_' + ('{0}_{1}_api_struct api_{0}_{1}'.format(core['version']['major'], core['version']['minor'])) + ' = {', '\tGDNATIVE_' + core['type'] + ',', '\t{' + str(core['version']['major']) + ', ' + str(core['version']['minor']) + '},', - '\t' + ('NULL' if not core['next'] else ('(const godot_gdnative_api_struct *)& api_{0}_{1}'.format(core['version']['major'], core['version']['minor']))) + ',' + '\t' + ('NULL' if not core['next'] else ('(const godot_gdnative_api_struct *)& api_{0}_{1}'.format(core['next']['version']['major'], core['next']['version']['minor']))) + ',' ] for funcdef in core['api']: diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index e2a69b1635..5d272a6cdc 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -66,10 +66,18 @@ void GDNativeLibraryEditor::_update_tree() { tree->clear(); TreeItem *root = tree->create_item(); - for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) { + PopupMenu *filter_list = filter->get_popup(); + String text = ""; + for (int i = 0; i < filter_list->get_item_count(); i++) { - if (showing_platform != E->key() && showing_platform != "All") + if (!filter_list->is_item_checked(i)) { continue; + } + Map<String, NativePlatformConfig>::Element *E = platforms.find(filter_list->get_item_metadata(i)); + if (!text.empty()) { + text += ", "; + } + text += E->get().name; TreeItem *platform = tree->create_item(root); platform->set_text(0, E->get().name); @@ -119,6 +127,7 @@ void GDNativeLibraryEditor::_update_tree() { platform->set_collapsed(collapsed_items.find(E->get().name) != NULL); } + filter->set_text(text); } void GDNativeLibraryEditor::_on_item_button(Object *item, int column, int id) { @@ -162,9 +171,10 @@ void GDNativeLibraryEditor::_on_dependencies_selected(const PoolStringArray &fil _set_target_value(file_dialog->get_meta("section"), file_dialog->get_meta("target"), files); } -void GDNativeLibraryEditor::_on_filter_selected(int id) { +void GDNativeLibraryEditor::_on_filter_selected(int index) { - showing_platform = filter->get_item_metadata(id); + PopupMenu *filter_list = filter->get_popup(); + filter_list->set_item_checked(index, !filter_list->is_item_checked(index)); _update_tree(); } @@ -265,8 +275,6 @@ void GDNativeLibraryEditor::_translate_to_config_file() { GDNativeLibraryEditor::GDNativeLibraryEditor() { - showing_platform = "All"; - { // Define platforms NativePlatformConfig platform_windows; platform_windows.name = "Windows"; @@ -336,20 +344,21 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { Label *label = memnew(Label); label->set_text(TTR("Platform:")); hbox->add_child(label); - filter = memnew(OptionButton); - hbox->add_child(filter); + filter = memnew(MenuButton); filter->set_h_size_flags(SIZE_EXPAND_FILL); + filter->set_text_align(filter->ALIGN_LEFT); + hbox->add_child(filter); + PopupMenu *filter_list = filter->get_popup(); + filter_list->set_hide_on_checkable_item_selection(false); int idx = 0; - filter->add_item(TTR("All"), idx); - filter->set_item_metadata(idx, "All"); - idx += 1; for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) { - filter->add_item(E->get().name, idx); - filter->set_item_metadata(idx, E->key()); + filter_list->add_check_item(E->get().name, idx); + filter_list->set_item_metadata(idx, E->key()); + filter_list->set_item_checked(idx, true); idx += 1; } - filter->connect("item_selected", this, "_on_filter_selected"); + filter_list->connect("index_pressed", this, "_on_filter_selected"); tree = memnew(Tree); container->add_child(tree); @@ -387,11 +396,9 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { void GDNativeLibraryEditorPlugin::edit(Object *p_node) { - if (Object::cast_to<GDNativeLibrary>(p_node)) { - library_editor->edit(Object::cast_to<GDNativeLibrary>(p_node)); - library_editor->show(); - } else - library_editor->hide(); + Ref<GDNativeLibrary> new_library = Object::cast_to<GDNativeLibrary>(p_node); + if (new_library.is_valid()) + library_editor->edit(new_library); } bool GDNativeLibraryEditorPlugin::handles(Object *p_node) const { diff --git a/modules/gdnative/gdnative_library_editor_plugin.h b/modules/gdnative/gdnative_library_editor_plugin.h index e7d50ba29f..8c1449f55a 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.h +++ b/modules/gdnative/gdnative_library_editor_plugin.h @@ -61,7 +61,7 @@ class GDNativeLibraryEditor : public Control { }; Tree *tree; - OptionButton *filter; + MenuButton *filter; EditorFileDialog *file_dialog; ConfirmationDialog *new_architecture_dialog; LineEdit *new_architecture_input; diff --git a/modules/gdnative/include/gdnative/string.h b/modules/gdnative/include/gdnative/string.h index f045ac9d58..7500d70f20 100644 --- a/modules/gdnative/include/gdnative/string.h +++ b/modules/gdnative/include/gdnative/string.h @@ -102,6 +102,8 @@ godot_bool GDAPI godot_string_begins_with_char_array(const godot_string *p_self, godot_array GDAPI godot_string_bigrams(const godot_string *p_self); godot_string GDAPI godot_string_chr(wchar_t p_character); godot_bool GDAPI godot_string_ends_with(const godot_string *p_self, const godot_string *p_string); +godot_int GDAPI godot_string_count(const godot_string *p_self, godot_string p_what, godot_int p_from, godot_int p_to); +godot_int GDAPI godot_string_countn(const godot_string *p_self, godot_string p_what, godot_int p_from, godot_int p_to); godot_int GDAPI godot_string_find(const godot_string *p_self, godot_string p_what); godot_int GDAPI godot_string_find_from(const godot_string *p_self, godot_string p_what, godot_int p_from); godot_int GDAPI godot_string_findmk(const godot_string *p_self, const godot_array *p_keys); diff --git a/modules/gdnative/include/gdnative/vector2.h b/modules/gdnative/include/gdnative/vector2.h index 7a5ae6afa9..15a6c80887 100644 --- a/modules/gdnative/include/gdnative/vector2.h +++ b/modules/gdnative/include/gdnative/vector2.h @@ -71,6 +71,8 @@ godot_real GDAPI godot_vector2_length_squared(const godot_vector2 *p_self); godot_bool GDAPI godot_vector2_is_normalized(const godot_vector2 *p_self); +godot_vector2 GDAPI godot_vector2_direction_to(const godot_vector2 *p_self, const godot_vector2 *p_b); + godot_real GDAPI godot_vector2_distance_to(const godot_vector2 *p_self, const godot_vector2 *p_to); godot_real GDAPI godot_vector2_distance_squared_to(const godot_vector2 *p_self, const godot_vector2 *p_to); diff --git a/modules/gdnative/include/gdnative/vector3.h b/modules/gdnative/include/gdnative/vector3.h index 70ec6422ac..ee7d029028 100644 --- a/modules/gdnative/include/gdnative/vector3.h +++ b/modules/gdnative/include/gdnative/vector3.h @@ -106,6 +106,8 @@ godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self); godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self); +godot_vector3 GDAPI godot_vector3_direction_to(const godot_vector3 *p_self, const godot_vector3 *p_b); + godot_real GDAPI godot_vector3_distance_to(const godot_vector3 *p_self, const godot_vector3 *p_b); godot_real GDAPI godot_vector3_distance_squared_to(const godot_vector3 *p_self, const godot_vector3 *p_b); diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index f3b9f7fb31..7f52f5736c 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -56,7 +56,7 @@ typedef enum { GODOT_PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc" GODOT_PROPERTY_HINT_EXP_EASING, /// exponential easing function (Math::ease) GODOT_PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer) - GODOT_PROPERTY_HINT_SPRITE_FRAME, + GODOT_PROPERTY_HINT_SPRITE_FRAME, // FIXME: Obsolete: drop whenever we can break compat GODOT_PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer) GODOT_PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags) GODOT_PROPERTY_HINT_LAYERS_2D_RENDER, @@ -98,8 +98,8 @@ typedef enum { GODOT_PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings GODOT_PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor GODOT_PROPERTY_USAGE_CATEGORY = 256, - GODOT_PROPERTY_USAGE_STORE_IF_NONZERO = 512, //only store if nonzero - GODOT_PROPERTY_USAGE_STORE_IF_NONONE = 1024, //only store if false + GODOT_PROPERTY_USAGE_STORE_IF_NONZERO = 512, // FIXME: Obsolete: drop whenever we can break compat + GODOT_PROPERTY_USAGE_STORE_IF_NONONE = 1024, // FIXME: Obsolete: drop whenever we can break compat GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE = 2048, GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED = 4096, GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE = 8192, diff --git a/modules/gdnative/nativescript/godot_nativescript.cpp b/modules/gdnative/nativescript/godot_nativescript.cpp index 863999d6d4..979e47f7b9 100644 --- a/modules/gdnative/nativescript/godot_nativescript.cpp +++ b/modules/gdnative/nativescript/godot_nativescript.cpp @@ -104,11 +104,7 @@ void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const cha String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to register method on non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to register method on non-existent class."); NativeScriptDesc::Method method; method.method = p_method; @@ -123,11 +119,7 @@ void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const c String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to register method on non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to register method on non-existent class."); NativeScriptDesc::Property property; property.default_value = *(Variant *)&p_attr->default_value; @@ -148,11 +140,7 @@ void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const cha String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to register method on non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to register method on non-existent class."); List<PropertyInfo> args; Vector<Variant> default_args; @@ -213,17 +201,10 @@ void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_h String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to add argument information for a method on a non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to add argument information for a method on a non-existent class."); Map<StringName, NativeScriptDesc::Method>::Element *method = E->get().methods.find(p_function_name); - if (!method) { - ERR_EXPLAIN("Attempted to add argument information to non-existent method!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!method, "Attempted to add argument information to non-existent method."); MethodInfo *method_information = &method->get().info; @@ -247,11 +228,7 @@ void GDAPI godot_nativescript_set_class_documentation(void *p_gdnative_handle, c String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to add documentation to a non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to add documentation to a non-existent class."); E->get().documentation = *(String *)&p_documentation; } @@ -260,17 +237,10 @@ void GDAPI godot_nativescript_set_method_documentation(void *p_gdnative_handle, String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to add documentation to a method on a non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to add documentation to a method on a non-existent class."); Map<StringName, NativeScriptDesc::Method>::Element *method = E->get().methods.find(p_function_name); - if (!method) { - ERR_EXPLAIN("Attempted to add documentatino to non-existent method!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!method, "Attempted to add documentation to non-existent method."); method->get().documentation = *(String *)&p_documentation; } @@ -279,17 +249,10 @@ void GDAPI godot_nativescript_set_property_documentation(void *p_gdnative_handle String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to add documentation to a property on a non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to add documentation to a property on a non-existent class."); OrderedHashMap<StringName, NativeScriptDesc::Property>::Element property = E->get().properties.find(p_path); - if (!property) { - ERR_EXPLAIN("Attempted to add documentation to non-existent property!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!property, "Attempted to add documentation to non-existent property."); property.get().documentation = *(String *)&p_documentation; } @@ -298,17 +261,10 @@ void GDAPI godot_nativescript_set_signal_documentation(void *p_gdnative_handle, String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to add documentation to a signal on a non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to add documentation to a signal on a non-existent class."); Map<StringName, NativeScriptDesc::Signal>::Element *signal = E->get().signals_.find(p_signal_name); - if (!signal) { - ERR_EXPLAIN("Attempted to add documentation to non-existent signal!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!signal, "Attempted to add documentation to non-existent signal."); signal->get().documentation = *(String *)&p_documentation; } @@ -325,11 +281,7 @@ void GDAPI godot_nativescript_set_type_tag(void *p_gdnative_handle, const char * String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); - - if (!E) { - ERR_EXPLAIN("Attempted to set type tag on a non-existent class!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!E, "Attempted to set type tag on a non-existent class."); E->get().type_tag = p_type_tag; } diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index f30c9da4c1..9f7c3880ec 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -402,10 +402,7 @@ void NativeScript::get_script_property_list(List<PropertyInfo> *p_list) const { String NativeScript::get_class_documentation() const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) { - ERR_EXPLAIN("Attempt to get class documentation on invalid NativeScript"); - ERR_FAIL_V(""); - } + ERR_FAIL_COND_V_MSG(!script_data, "", "Attempt to get class documentation on invalid NativeScript."); return script_data->documentation; } @@ -413,10 +410,7 @@ String NativeScript::get_class_documentation() const { String NativeScript::get_method_documentation(const StringName &p_method) const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) { - ERR_EXPLAIN("Attempt to get method documentation on invalid NativeScript"); - ERR_FAIL_V(""); - } + ERR_FAIL_COND_V_MSG(!script_data, "", "Attempt to get method documentation on invalid NativeScript."); while (script_data) { @@ -429,17 +423,13 @@ String NativeScript::get_method_documentation(const StringName &p_method) const script_data = script_data->base_data; } - ERR_EXPLAIN("Attempt to get method documentation for non-existent method"); - ERR_FAIL_V(""); + ERR_FAIL_V_MSG("", "Attempt to get method documentation for non-existent method."); } String NativeScript::get_signal_documentation(const StringName &p_signal_name) const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) { - ERR_EXPLAIN("Attempt to get signal documentation on invalid NativeScript"); - ERR_FAIL_V(""); - } + ERR_FAIL_COND_V_MSG(!script_data, "", "Attempt to get signal documentation on invalid NativeScript."); while (script_data) { @@ -452,17 +442,13 @@ String NativeScript::get_signal_documentation(const StringName &p_signal_name) c script_data = script_data->base_data; } - ERR_EXPLAIN("Attempt to get signal documentation for non-existent signal"); - ERR_FAIL_V(""); + ERR_FAIL_V_MSG("", "Attempt to get signal documentation for non-existent signal."); } String NativeScript::get_property_documentation(const StringName &p_path) const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) { - ERR_EXPLAIN("Attempt to get property documentation on invalid NativeScript"); - ERR_FAIL_V(""); - } + ERR_FAIL_COND_V_MSG(!script_data, "", "Attempt to get property documentation on invalid NativeScript."); while (script_data) { @@ -475,8 +461,7 @@ String NativeScript::get_property_documentation(const StringName &p_path) const script_data = script_data->base_data; } - ERR_EXPLAIN("Attempt to get property documentation for non-existent signal"); - ERR_FAIL_V(""); + ERR_FAIL_V_MSG("", "Attempt to get property documentation for non-existent signal."); } Variant NativeScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { @@ -655,10 +640,7 @@ void NativeScriptInstance::get_property_list(List<PropertyInfo> *p_properties) c Variant res = *(Variant *)&result; godot_variant_destroy(&result); - if (res.get_type() != Variant::ARRAY) { - ERR_EXPLAIN("_get_property_list must return an array of dictionaries"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(res.get_type() != Variant::ARRAY, "_get_property_list must return an array of dictionaries."); Array arr = res; for (int i = 0; i < arr.size(); i++) { @@ -780,8 +762,7 @@ String NativeScriptInstance::to_string(bool *r_valid) { if (ret.get_type() != Variant::STRING) { if (r_valid) *r_valid = false; - ERR_EXPLAIN("Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); - ERR_FAIL_V(String()); + ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); } if (r_valid) *r_valid = true; @@ -1344,10 +1325,7 @@ void NativeScriptLanguage::unregister_binding_functions(int p_idx) { void *NativeScriptLanguage::get_instance_binding_data(int p_idx, Object *p_object) { ERR_FAIL_INDEX_V(p_idx, binding_functions.size(), NULL); - if (!binding_functions[p_idx].first) { - ERR_EXPLAIN("Tried to get binding data for a nativescript binding that does not exist"); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!binding_functions[p_idx].first, NULL, "Tried to get binding data for a nativescript binding that does not exist."); Vector<void *> *binding_data = (Vector<void *> *)p_object->get_script_instance_binding(lang_idx); @@ -1499,8 +1477,7 @@ void NativeScriptLanguage::init_library(const Ref<GDNativeLibrary> &lib) { #endif // See if this library was "registered" already. const String &lib_path = lib->get_current_library_path(); - ERR_EXPLAIN(lib->get_name() + " does not have a library for the current platform"); - ERR_FAIL_COND(lib_path.length() == 0); + ERR_FAIL_COND_MSG(lib_path.length() == 0, lib->get_name() + " does not have a library for the current platform."); Map<String, Ref<GDNative> >::Element *E = library_gdnatives.find(lib_path); if (!E) { diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index 3ecb29404a..b82823ab64 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -35,16 +35,14 @@ #include "pluginscript_script.h" #ifdef DEBUG_ENABLED -#define __ASSERT_SCRIPT_REASON "Cannot retrieve pluginscript class for this script, is you code correct ?" -#define ASSERT_SCRIPT_VALID() \ - { \ - ERR_EXPLAIN(__ASSERT_SCRIPT_REASON); \ - ERR_FAIL_COND(!can_instance()); \ +#define __ASSERT_SCRIPT_REASON "Cannot retrieve PluginScript class for this script, is your code correct?" +#define ASSERT_SCRIPT_VALID() \ + { \ + ERR_FAIL_COND_MSG(!can_instance(), __ASSERT_SCRIPT_REASON); \ } -#define ASSERT_SCRIPT_VALID_V(ret) \ - { \ - ERR_EXPLAIN(__ASSERT_SCRIPT_REASON); \ - ERR_FAIL_COND_V(!can_instance(), ret); \ +#define ASSERT_SCRIPT_VALID_V(ret) \ + { \ + ERR_FAIL_COND_V_MSG(!can_instance(), ret, __ASSERT_SCRIPT_REASON); \ } #else #define ASSERT_SCRIPT_VALID() @@ -197,8 +195,7 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) { // if (ScriptDebugger::get_singleton()) { // _language->debug_break_parse(get_path(), 0, msg); // } - ERR_EXPLAIN(msg); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, msg); } } @@ -272,8 +269,7 @@ Error PluginScript::reload(bool p_keep_state) { _ref_base_parent = res; } else { String name = *(StringName *)&manifest.name; - ERR_EXPLAIN(_path + ": Script '" + name + "' has an invalid parent '" + *base_name + "'."); - ERR_FAIL_V(ERR_PARSE_ERROR); + ERR_FAIL_V_MSG(ERR_PARSE_ERROR, _path + ": Script '" + name + "' has an invalid parent '" + *base_name + "'."); } } } @@ -420,8 +416,7 @@ Error PluginScript::load_source_code(const String &p_path) { String s; if (s.parse_utf8((const char *)w.ptr())) { - ERR_EXPLAIN("Script '" + p_path + "' contains invalid unicode (utf-8), so it was not loaded. Please ensure that scripts are saved in valid utf-8 unicode."); - ERR_FAIL_V(ERR_INVALID_DATA); + ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); } _source = s; diff --git a/modules/gdnative/pluginscript/register_types.cpp b/modules/gdnative/pluginscript/register_types.cpp index b7ab887e11..3b46f33afb 100644 --- a/modules/gdnative/pluginscript/register_types.cpp +++ b/modules/gdnative/pluginscript/register_types.cpp @@ -114,6 +114,8 @@ void unregister_pluginscript_types() { for (List<PluginScriptLanguage *>::Element *e = pluginscript_languages.front(); e; e = e->next()) { PluginScriptLanguage *language = e->get(); ScriptServer::unregister_language(language); + ResourceLoader::remove_resource_format_loader(language->get_resource_loader()); + ResourceSaver::remove_resource_format_saver(language->get_resource_saver()); memdelete(language); } } diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 3870a5ea7d..ad47323613 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -322,6 +322,7 @@ <description> The natural exponential function. It raises the mathematical constant [b]e[/b] to the power of [code]s[/code] and returns it. [b]e[/b] has an approximate value of 2.71828. + For exponents to other bases use the method [method pow]. [codeblock] a = exp(2) # Approximately 7.39 [/codeblock] @@ -345,45 +346,47 @@ <method name="fmod"> <return type="float"> </return> - <argument index="0" name="x" type="float"> + <argument index="0" name="a" type="float"> </argument> - <argument index="1" name="y" type="float"> + <argument index="1" name="b" type="float"> </argument> <description> - Returns the floating-point remainder of [code]x/y[/code]. + Returns the floating-point remainder of [code]a/b[/code], keeping the sign of [code]a[/code]. [codeblock] # Remainder is 1.5 var remainder = fmod(7, 5.5) [/codeblock] + For the integer remainder operation, use the % operator. </description> </method> <method name="fposmod"> <return type="float"> </return> - <argument index="0" name="x" type="float"> + <argument index="0" name="a" type="float"> </argument> - <argument index="1" name="y" type="float"> + <argument index="1" name="b" type="float"> </argument> <description> - Returns the floating-point remainder of [code]x/y[/code] that wraps equally in positive and negative. + Returns the floating-point modulus of [code]a/b[/code] that wraps equally in positive and negative. [codeblock] - var i = -10 - while i < 0: - prints(i, fposmod(i, 10)) + var i = -6 + while i < 5: + prints(i, fposmod(i, 3)) i += 1 [/codeblock] Produces: [codeblock] - -10 10 - -9 1 - -8 2 - -7 3 - -6 4 - -5 5 - -4 6 - -3 7 - -2 8 - -1 9 + -6 0 + -5 1 + -4 2 + -3 0 + -2 1 + -1 2 + 0 0 + 1 1 + 2 2 + 3 0 + 4 1 [/codeblock] </description> </method> @@ -571,6 +574,29 @@ [/codeblock] </description> </method> + <method name="lerp_angle"> + <return type="float"> + </return> + <argument index="0" name="from" type="float"> + </argument> + <argument index="1" name="to" type="float"> + </argument> + <argument index="2" name="weight" type="float"> + </argument> + <description> + Linearly interpolates between two angles (in radians) by a normalized value. + Similar to [method lerp] but interpolate correctly when the angles wrap around [constant @GDScript.TAU]. + [codeblock] + extends Sprite + var elapsed = 0.0 + func _process(delta): + var min_angle = deg2rad(0.0) + var max_angle = deg2rad(90.0) + rotation = lerp_angle(min_angle, max_angle, elapsed) + elapsed += delta + [/codeblock] + </description> + </method> <method name="linear2db"> <return type="float"> </return> @@ -697,12 +723,43 @@ Converts a 2D point expressed in the polar coordinate system (a distance from the origin [code]r[/code] and an angle [code]th[/code]) to the cartesian coordinate system (X and Y axis). </description> </method> + <method name="posmod"> + <return type="int"> + </return> + <argument index="0" name="a" type="int"> + </argument> + <argument index="1" name="b" type="int"> + </argument> + <description> + Returns the integer modulus of [code]a/b[/code] that wraps equally in positive and negative. + [codeblock] + var i = -6 + while i < 5: + prints(i, posmod(i, 3)) + i += 1 + [/codeblock] + Produces: + [codeblock] + -6 0 + -5 1 + -4 2 + -3 0 + -2 1 + -1 2 + 0 0 + 1 1 + 2 2 + 3 0 + 4 1 + [/codeblock] + </description> + </method> <method name="pow"> <return type="float"> </return> - <argument index="0" name="x" type="float"> + <argument index="0" name="base" type="float"> </argument> - <argument index="1" name="y" type="float"> + <argument index="1" name="exp" type="float"> </argument> <description> Returns the result of [code]x[/code] raised to the power of [code]y[/code]. @@ -1039,7 +1096,7 @@ <argument index="0" name="step" type="float"> </argument> <description> - Returns the position of the first non-zero digit, after the decimal point. + Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation. [codeblock] # n is 0 n = step_decimals(5) diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index bc28f7009e..d929bdb3e5 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -67,10 +67,7 @@ void GDScriptNativeClass::_bind_methods() { Variant GDScriptNativeClass::_new() { Object *o = instance(); - if (!o) { - ERR_EXPLAIN("Class type: '" + String(name) + "' is not instantiable."); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(!o, Variant(), "Class type: '" + String(name) + "' is not instantiable."); Reference *ref = Object::cast_to<Reference>(o); if (ref) { @@ -158,8 +155,7 @@ Variant GDScript::_new(const Variant **p_args, int p_argcount, Variant::CallErro } else { owner = memnew(Reference); //by default, no base means use reference } - ERR_EXPLAIN("Can't inherit from a virtual class"); - ERR_FAIL_COND_V(!owner, Variant()); + ERR_FAIL_COND_V_MSG(!owner, Variant(), "Can't inherit from a virtual class."); Reference *r = Object::cast_to<Reference>(owner); if (r) { @@ -326,8 +322,7 @@ ScriptInstance *GDScript::instance_create(Object *p_this) { if (ScriptDebugger::get_singleton()) { GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), 0, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"); } - ERR_EXPLAIN("Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type '" + p_this->get_class() + "'" + "."); } } @@ -648,10 +643,7 @@ Variant GDScript::call(const StringName &p_method, const Variant **p_args, int p Map<StringName, GDScriptFunction *>::Element *E = top->member_functions.find(p_method); if (E) { - if (!E->get()->is_static()) { - ERR_EXPLAIN("Can't call non-static function: '" + String(p_method) + "' in script."); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(!E->get()->is_static(), Variant(), "Can't call non-static function '" + String(p_method) + "' in script."); return E->get()->call(NULL, p_args, p_argcount, r_error); } @@ -826,8 +818,7 @@ Error GDScript::load_source_code(const String &p_path) { String s; if (s.parse_utf8((const char *)w.ptr())) { - ERR_EXPLAIN("Script '" + p_path + "' contains invalid unicode (utf-8), so it was not loaded. Please ensure that scripts are saved in valid utf-8 unicode."); - ERR_FAIL_V(ERR_INVALID_DATA); + ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); } source = s; @@ -1079,11 +1070,8 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const Variant ret = const_cast<GDScriptFunction *>(E->get())->call(const_cast<GDScriptInstance *>(this), NULL, 0, err); if (err.error == Variant::CallError::CALL_OK) { - if (ret.get_type() != Variant::ARRAY) { + ERR_FAIL_COND_MSG(ret.get_type() != Variant::ARRAY, "Wrong type for _get_property_list, must be an array of dictionaries."); - ERR_EXPLAIN("Wrong type for _get_property list, must be an array of dictionaries."); - ERR_FAIL(); - } Array arr = ret; for (int i = 0; i < arr.size(); i++) { @@ -1243,8 +1231,7 @@ String GDScriptInstance::to_string(bool *r_valid) { if (ret.get_type() != Variant::STRING) { if (r_valid) *r_valid = false; - ERR_EXPLAIN("Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); - ERR_FAIL_V(String()); + ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); } if (r_valid) *r_valid = true; @@ -2057,8 +2044,7 @@ String GDScriptWarning::get_message() const { } break; case WARNING_MAX: break; // Can't happen, but silences warning } - ERR_EXPLAIN("Invalid GDScript warning code: " + get_name_from_code(code)); - ERR_FAIL_V(String()); + ERR_FAIL_V_MSG(String(), "Invalid GDScript warning code: " + get_name_from_code(code) + "."); #undef CHECK_SYMBOLS } @@ -2110,8 +2096,7 @@ GDScriptWarning::Code GDScriptWarning::get_code_from_name(const String &p_name) } } - ERR_EXPLAIN("Invalid GDScript warning name: " + p_name); - ERR_FAIL_V(WARNING_MAX); + ERR_FAIL_V_MSG(WARNING_MAX, "Invalid GDScript warning name: " + p_name); } #endif // DEBUG_ENABLED diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 4c976bd2e0..7166189416 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -1241,8 +1241,7 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser:: } break; default: { - ERR_EXPLAIN("Bug in bytecode compiler, unexpected operator #" + itos(on->op) + " in parse tree while parsing expression."); - ERR_FAIL_V(0); //unreachable code + ERR_FAIL_V_MSG(0, "Bug in bytecode compiler, unexpected operator #" + itos(on->op) + " in parse tree while parsing expression."); //unreachable code } break; } @@ -1255,8 +1254,7 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser:: //TYPE_TYPE, default: { - ERR_EXPLAIN("Bug in bytecode compiler, unexpected node in parse tree while parsing expression."); - ERR_FAIL_V(-1); //unreachable code + ERR_FAIL_V_MSG(-1, "Bug in bytecode compiler, unexpected node in parse tree while parsing expression."); //unreachable code } break; } } diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 78a1bfc99b..7c01e85ff7 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -159,7 +159,11 @@ bool GDScriptLanguage::validate(const String &p_script, int &r_line_error, int & for (int i = 0; i < cl->subclasses.size(); i++) { for (int j = 0; j < cl->subclasses[i]->functions.size(); j++) { - funcs[cl->subclasses[i]->functions[j]->line] = String(cl->subclasses[i]->name) + "." + String(cl->subclasses[i]->functions[j]->name); + funcs[cl->subclasses[i]->functions[j]->line] = String(cl->subclasses[i]->name) + "." + cl->subclasses[i]->functions[j]->name; + } + for (int j = 0; j < cl->subclasses[i]->static_functions.size(); j++) { + + funcs[cl->subclasses[i]->static_functions[j]->line] = String(cl->subclasses[i]->name) + "." + cl->subclasses[i]->static_functions[j]->name; } } @@ -382,8 +386,6 @@ void GDScriptLanguage::debug_get_globals(List<String> *p_globals, List<Variant> String GDScriptLanguage::debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems, int p_max_depth) { - if (_debug_parse_err_line >= 0) - return ""; return ""; } @@ -632,7 +634,7 @@ static GDScriptCompletionIdentifier _type_from_gdtype(const GDScriptDataType &p_ switch (p_gdtype.kind) { case GDScriptDataType::UNINITIALIZED: { - ERR_EXPLAIN("Uninitialized completion. Please report a bug."); + ERR_PRINT("Uninitialized completion. Please report a bug."); } break; case GDScriptDataType::BUILTIN: { ci.type.kind = GDScriptParser::DataType::BUILTIN; diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index d5e74c07c9..dc0e64fd03 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -86,8 +86,7 @@ Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_insta o = o->_owner; } - ERR_EXPLAIN("GDScriptCompiler bug..."); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "GDScriptCompiler bug."); } break; case ADDR_TYPE_LOCAL_CONSTANT: { #ifdef DEBUG_ENABLED @@ -128,8 +127,7 @@ Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_insta } break; } - ERR_EXPLAIN("Bad Code! (Addressing Mode)"); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Bad code! (unknown addressing mode)."); return NULL; } @@ -1784,20 +1782,9 @@ GDScriptFunction::~GDScriptFunction() { Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { - if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) { -#ifdef DEBUG_ENABLED - ERR_EXPLAIN("Resumed function '" + String(function->get_name()) + "()' after yield, but class instance is gone. At script: " + state.script->get_path() + ":" + itos(state.line)); - ERR_FAIL_V(Variant()); -#else - return Variant(); -#endif - } - Variant arg; r_error.error = Variant::CallError::CALL_OK; - ERR_FAIL_COND_V(!function, Variant()); - if (p_argcount == 0) { r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; @@ -1823,44 +1810,7 @@ Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_ar return Variant(); } - state.result = arg; - Variant ret = function->call(NULL, NULL, 0, r_error, &state); - - bool completed = true; - - // If the return value is a GDScriptFunctionState reference, - // then the function did yield again after resuming. - if (ret.is_ref()) { - GDScriptFunctionState *gdfs = Object::cast_to<GDScriptFunctionState>(ret); - if (gdfs && gdfs->function == function) { - completed = false; - gdfs->first_state = first_state.is_valid() ? first_state : Ref<GDScriptFunctionState>(this); - } - } - - function = NULL; //cleaned up; - state.result = Variant(); - - if (completed) { - if (first_state.is_valid()) { - first_state->emit_signal("completed", ret); - } else { - emit_signal("completed", ret); - } - } - -#ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) - GDScriptLanguage::get_singleton()->exit_function(); - if (state.stack_size) { - //free stack - Variant *stack = (Variant *)state.stack.ptr(); - for (int i = 0; i < state.stack_size; i++) - stack[i].~Variant(); - } -#endif - - return ret; + return resume(arg); } bool GDScriptFunctionState::is_valid(bool p_extended_check) const { @@ -1882,8 +1832,7 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) { ERR_FAIL_COND_V(!function, Variant()); if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) { #ifdef DEBUG_ENABLED - ERR_EXPLAIN("Resumed function '" + String(function->get_name()) + "()' after yield, but class instance is gone. At script: " + state.script->get_path() + ":" + itos(state.line)); - ERR_FAIL_V(Variant()); + ERR_FAIL_V_MSG(Variant(), "Resumed function '" + String(function->get_name()) + "()' after yield, but class instance is gone. At script: " + state.script->get_path() + ":" + itos(state.line)); #else return Variant(); #endif diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index 0736f3d010..ad8bf5b2c0 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -58,6 +58,7 @@ const char *GDScriptFunctions::get_func_name(Function p_func) { "sqrt", "fmod", "fposmod", + "posmod", "floor", "ceil", "round", @@ -75,6 +76,7 @@ const char *GDScriptFunctions::get_func_name(Function p_func) { "step_decimals", "stepify", "lerp", + "lerp_angle", "inverse_lerp", "range_lerp", "smoothstep", @@ -243,6 +245,12 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ VALIDATE_ARG_NUM(1); r_ret = Math::fposmod((double)*p_args[0], (double)*p_args[1]); } break; + case MATH_POSMOD: { + VALIDATE_ARG_COUNT(2); + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + r_ret = Math::posmod((int)*p_args[0], (int)*p_args[1]); + } break; case MATH_FLOOR: { VALIDATE_ARG_COUNT(1); VALIDATE_ARG_NUM(0); @@ -341,8 +349,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ VALIDATE_ARG_COUNT(1); VALIDATE_ARG_NUM(0); r_ret = Math::step_decimals((double)*p_args[0]); - ERR_EXPLAIN("GDScript method 'decimals' is deprecated and has been renamed to 'step_decimals', please update your code accordingly."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("GDScript method 'decimals' is deprecated and has been renamed to 'step_decimals', please update your code accordingly."); } break; case MATH_STEP_DECIMALS: { VALIDATE_ARG_COUNT(1); @@ -376,6 +383,13 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } break; } } break; + case MATH_LERP_ANGLE: { + VALIDATE_ARG_COUNT(3); + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + VALIDATE_ARG_NUM(2); + r_ret = Math::lerp_angle((double)*p_args[0], (double)*p_args[1], (double)*p_args[2]); + } break; case MATH_INVERSE_LERP: { VALIDATE_ARG_COUNT(3); VALIDATE_ARG_NUM(0); @@ -1456,6 +1470,7 @@ bool GDScriptFunctions::is_deterministic(Function p_func) { case MATH_SQRT: case MATH_FMOD: case MATH_FPOSMOD: + case MATH_POSMOD: case MATH_FLOOR: case MATH_CEIL: case MATH_ROUND: @@ -1568,15 +1583,20 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { return mi; } break; case MATH_FMOD: { - MethodInfo mi("fmod", PropertyInfo(Variant::REAL, "x"), PropertyInfo(Variant::REAL, "y")); + MethodInfo mi("fmod", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b")); mi.return_val.type = Variant::REAL; return mi; } break; case MATH_FPOSMOD: { - MethodInfo mi("fposmod", PropertyInfo(Variant::REAL, "x"), PropertyInfo(Variant::REAL, "y")); + MethodInfo mi("fposmod", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b")); mi.return_val.type = Variant::REAL; return mi; } break; + case MATH_POSMOD: { + MethodInfo mi("posmod", PropertyInfo(Variant::INT, "a"), PropertyInfo(Variant::INT, "b")); + mi.return_val.type = Variant::INT; + return mi; + } break; case MATH_FLOOR: { MethodInfo mi("floor", PropertyInfo(Variant::REAL, "s")); mi.return_val.type = Variant::REAL; @@ -1603,7 +1623,7 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { return mi; } break; case MATH_POW: { - MethodInfo mi("pow", PropertyInfo(Variant::REAL, "x"), PropertyInfo(Variant::REAL, "y")); + MethodInfo mi("pow", PropertyInfo(Variant::REAL, "base"), PropertyInfo(Variant::REAL, "exp")); mi.return_val.type = Variant::REAL; return mi; } break; @@ -1663,6 +1683,11 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { mi.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; return mi; } break; + case MATH_LERP_ANGLE: { + MethodInfo mi("lerp_angle", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight")); + mi.return_val.type = Variant::REAL; + return mi; + } break; case MATH_INVERSE_LERP: { MethodInfo mi("inverse_lerp", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight")); mi.return_val.type = Variant::REAL; diff --git a/modules/gdscript/gdscript_functions.h b/modules/gdscript/gdscript_functions.h index 6ad70f2eb4..8f7ba76d2c 100644 --- a/modules/gdscript/gdscript_functions.h +++ b/modules/gdscript/gdscript_functions.h @@ -49,6 +49,7 @@ public: MATH_SQRT, MATH_FMOD, MATH_FPOSMOD, + MATH_POSMOD, MATH_FLOOR, MATH_CEIL, MATH_ROUND, @@ -66,6 +67,7 @@ public: MATH_STEP_DECIMALS, MATH_STEPIFY, MATH_LERP, + MATH_LERP_ANGLE, MATH_INVERSE_LERP, MATH_RANGE_LERP, MATH_SMOOTHSTEP, diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 80da606967..764f57aaa1 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -898,6 +898,10 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s } else if (tokenizer->get_token() == GDScriptTokenizer::TK_PR_IS && tokenizer->get_token(1) == GDScriptTokenizer::TK_BUILT_IN_TYPE) { // 'is' operator with built-in type + if (!expr) { + _set_error("Expected identifier before 'is' operator"); + return NULL; + } OperatorNode *op = alloc_node<OperatorNode>(); op->op = OperatorNode::OP_IS_BUILTIN; op->arguments.push_back(expr); @@ -1136,10 +1140,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s return NULL; //nothing } - if (!expr) { - ERR_EXPLAIN("GDScriptParser bug, couldn't figure out what expression is..."); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!expr, NULL, "GDScriptParser bug, couldn't figure out what expression is."); /******************/ /* Parse Indexing */ @@ -1766,8 +1767,6 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to cn->value = v; cn->datatype = _type_from_variant(v); return cn; - - } else if (op->arguments[0]->type == Node::TYPE_BUILT_IN_FUNCTION && last_not_constant == 0) { } return op; //don't reduce yet @@ -2211,6 +2210,8 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran p_block->has_return = true; + bool catch_all_appeared = false; + while (true) { while (tokenizer->get_token() == GDScriptTokenizer::TK_NEWLINE && _parse_newline()) @@ -2221,7 +2222,7 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran return; if (indent_level > tab_level.back()->get()) { - return; // go back a level + break; // go back a level } if (pending_newline != -1) { @@ -2236,12 +2237,20 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran branch->patterns.push_back(_parse_pattern(p_static)); if (!branch->patterns[0]) { - return; + break; } bool has_binding = branch->patterns[0]->pt_type == PatternNode::PT_BIND; bool catch_all = has_binding || branch->patterns[0]->pt_type == PatternNode::PT_WILDCARD; +#ifdef DEBUG_ENABLED + // Branches after a wildcard or binding are unreachable + if (catch_all_appeared && !current_function->has_unreachable_code) { + _add_warning(GDScriptWarning::UNREACHABLE_CODE, -1, current_function->name.operator String()); + current_function->has_unreachable_code = true; + } +#endif + while (tokenizer->get_token() == GDScriptTokenizer::TK_COMMA) { tokenizer->advance(); branch->patterns.push_back(_parse_pattern(p_static)); @@ -2259,6 +2268,8 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran catch_all = catch_all || pt == PatternNode::PT_WILDCARD; } + catch_all_appeared = catch_all_appeared || catch_all; + if (!_enter_indent_block()) { _set_error("Expected block in pattern branch"); return; @@ -2274,6 +2285,11 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran p_branches.push_back(branch); } + + // Even if all branches return, there is possibility of default fallthrough + if (!catch_all_appeared) { + p_block->has_return = false; + } } void GDScriptParser::_generate_pattern(PatternNode *p_pattern, Node *p_node_to_match, Node *&p_resulting_node, Map<StringName, Node *> &p_bindings) { @@ -3472,6 +3488,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { } break; case GDScriptTokenizer::TK_PR_CLASS_NAME: { + _mark_line_as_safe(tokenizer->get_token_line()); if (p_class->owner) { _set_error("'class_name' is only valid for the main class namespace."); return; @@ -4003,8 +4020,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { tokenizer->advance(); if (tokenizer->get_token() == GDScriptTokenizer::TK_PARENTHESIS_CLOSE) { - ERR_EXPLAIN("Exporting bit flags hint requires string constants."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("Exporting bit flags hint requires string constants."); break; } if (tokenizer->get_token() != GDScriptTokenizer::TK_COMMA) { @@ -5745,7 +5761,7 @@ GDScriptParser::DataType GDScriptParser::_type_from_gdtype(const GDScriptDataTyp switch (p_gdtype.kind) { case GDScriptDataType::UNINITIALIZED: { - ERR_EXPLAIN("Uninitialized datatype. Please report a bug."); + ERR_PRINT("Uninitialized datatype. Please report a bug."); } break; case GDScriptDataType::BUILTIN: { result.kind = DataType::BUILTIN; @@ -6679,8 +6695,7 @@ bool GDScriptParser::_get_function_signature(DataType &p_base_type, const String } if (!ClassDB::class_exists(native)) { if (!check_types) return false; - ERR_EXPLAIN("Parser bug: Class '" + String(native) + "' not found."); - ERR_FAIL_V(false); + ERR_FAIL_V_MSG(false, "Parser bug: Class '" + String(native) + "' not found."); } MethodBind *method = ClassDB::get_method(native, p_function); @@ -7188,8 +7203,7 @@ bool GDScriptParser::_get_member_type(const DataType &p_base_type, const StringN } if (!ClassDB::class_exists(native)) { if (!check_types) return false; - ERR_EXPLAIN("Parser bug: Class '" + String(native) + "' not found."); - ERR_FAIL_V(false); + ERR_FAIL_V_MSG(false, "Parser bug: Class '" + String(native) + "' not found."); } bool valid = false; diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 95715ab648..64b354bdb8 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -357,8 +357,7 @@ StringName GDScriptTokenizer::get_token_literal(int p_offset) const { } } } - ERR_EXPLAIN("Failed to get token literal"); - ERR_FAIL_V(""); + ERR_FAIL_V_MSG("", "Failed to get token literal."); } static bool _is_text_char(CharType c) { @@ -517,7 +516,22 @@ void GDScriptTokenizerText::_advance() { INCPOS(1); column = 1; int i = 0; - while (GETCHAR(i) == ' ' || GETCHAR(i) == '\t') { + 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++; } @@ -555,9 +569,25 @@ void GDScriptTokenizerText::_advance() { column = 1; line++; int i = 0; - while (GETCHAR(i) == ' ' || GETCHAR(i) == '\t') { + 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; @@ -1082,6 +1112,7 @@ 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,10 +1218,8 @@ Error GDScriptTokenizerBuffer::set_code_buffer(const Vector<uint8_t> &p_buffer) ERR_FAIL_COND_V(p_buffer.size() < 24 || p_buffer[0] != 'G' || p_buffer[1] != 'D' || p_buffer[2] != 'S' || p_buffer[3] != 'C', ERR_INVALID_DATA); int version = decode_uint32(&buf[4]); - if (version > BYTECODE_VERSION) { - ERR_EXPLAIN("Bytecode is too New! Please use a newer engine version."); - ERR_FAIL_V(ERR_INVALID_DATA); - } + ERR_FAIL_COND_V_MSG(version > BYTECODE_VERSION, ERR_INVALID_DATA, "Bytecode is too recent! Please use a newer engine version."); + int identifier_count = decode_uint32(&buf[8]); int constant_count = decode_uint32(&buf[12]); int line_count = decode_uint32(&buf[16]); diff --git a/modules/gdscript/gdscript_tokenizer.h b/modules/gdscript/gdscript_tokenizer.h index 7b977ff67c..89d586b912 100644 --- a/modules/gdscript/gdscript_tokenizer.h +++ b/modules/gdscript/gdscript_tokenizer.h @@ -222,6 +222,12 @@ 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; Set<String> warning_global_skips; diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index b8a13ed91b..62117dcaf3 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -32,6 +32,7 @@ #include "core/io/file_access_encrypted.h" #include "core/io/resource_loader.h" +#include "core/os/dir_access.h" #include "core/os/file_access.h" #include "editor/gdscript_highlighter.h" #include "gdscript.h" @@ -117,6 +118,9 @@ public: file = FileAccess::get_file_as_array(tmp_path); add_file(p_path.get_basename() + ".gde", file, true); + // Clean up temporary file. + DirAccess::remove_file_or_error(tmp_path); + } else { add_file(p_path.get_basename() + ".gdc", file, true); diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index 325432579f..1bd3d72066 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -210,7 +210,7 @@ </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> </member> - <member name="mesh_library" type="MeshLibrary" setter="set_mesh_library" getter="get_mesh_library" default="null"> + <member name="mesh_library" type="MeshLibrary" setter="set_mesh_library" getter="get_mesh_library"> The assigned [MeshLibrary]. </member> <member name="theme" type="MeshLibrary" setter="set_theme" getter="get_theme"> diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 994a84fbc4..b36afd4386 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -196,16 +196,14 @@ bool GridMap::get_collision_layer_bit(int p_bit) const { #ifndef DISABLE_DEPRECATED void GridMap::set_theme(const Ref<MeshLibrary> &p_theme) { - ERR_EXPLAIN("GridMap.theme/set_theme() is deprecated and will be removed in a future version. Use GridMap.mesh_library/set_mesh_library() instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("GridMap.theme/set_theme() is deprecated and will be removed in a future version. Use GridMap.mesh_library/set_mesh_library() instead."); set_mesh_library(p_theme); } Ref<MeshLibrary> GridMap::get_theme() const { - ERR_EXPLAIN("GridMap.theme/get_theme() is deprecated and will be removed in a future version. Use GridMap.mesh_library/get_mesh_library() instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("GridMap.theme/get_theme() is deprecated and will be removed in a future version. Use GridMap.mesh_library/get_mesh_library() instead."); return get_mesh_library(); } @@ -481,11 +479,6 @@ bool GridMap::_octant_update(const OctantKey &p_key) { Transform xform; - if (clip && ((clip_above && cellpos[clip_axis] > clip_floor) || (!clip_above && cellpos[clip_axis] < clip_floor))) { - - } else { - } - xform.basis.set_orthogonal_index(c.rot); xform.set_origin(cellpos * cell_size + ofs); xform.basis.scale(Vector3(cell_scale, cell_scale, cell_scale)); diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 5a21833ffa..07b4f7f596 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -863,19 +863,21 @@ void GridMapEditor::_icon_size_changed(float p_value) { void GridMapEditor::update_palette() { int selected = mesh_library_palette->get_current(); + float min_size = EDITOR_DEF("editors/grid_map/preview_size", 64); + min_size *= EDSCALE; + mesh_library_palette->clear(); if (display_mode == DISPLAY_THUMBNAIL) { mesh_library_palette->set_max_columns(0); mesh_library_palette->set_icon_mode(ItemList::ICON_MODE_TOP); + mesh_library_palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1.5)); } else if (display_mode == DISPLAY_LIST) { mesh_library_palette->set_max_columns(1); mesh_library_palette->set_icon_mode(ItemList::ICON_MODE_LEFT); + mesh_library_palette->set_fixed_column_width(0); } - float min_size = EDITOR_DEF("editors/grid_map/preview_size", 64); - min_size *= EDSCALE; mesh_library_palette->set_fixed_icon_size(Size2(min_size, min_size)); - mesh_library_palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1.5)); mesh_library_palette->set_max_text_lines(2); Ref<MeshLibrary> mesh_library = node->get_mesh_library(); @@ -1269,7 +1271,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { options->get_popup()->add_item(TTR("Fill Selection"), MENU_OPTION_SELECTION_FILL, KEY_MASK_CTRL + KEY_F); options->get_popup()->add_separator(); - options->get_popup()->add_item(TTR("Settings"), MENU_OPTION_GRIDMAP_SETTINGS); + options->get_popup()->add_item(TTR("Settings..."), MENU_OPTION_GRIDMAP_SETTINGS); settings_dialog = memnew(ConfirmationDialog); settings_dialog->set_title(TTR("GridMap Settings")); diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index b9be925ff7..d174ac1035 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -35,9 +35,6 @@ #include "editor/editor_plugin.h" #include "editor/pane_drag.h" #include "grid_map.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class SpatialEditorPlugin; diff --git a/modules/hdr/image_loader_hdr.cpp b/modules/hdr/image_loader_hdr.cpp index f75a4a926a..1abf26bfee 100644 --- a/modules/hdr/image_loader_hdr.cpp +++ b/modules/hdr/image_loader_hdr.cpp @@ -37,7 +37,7 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force String header = f->get_token(); - ERR_FAIL_COND_V(header != "#?RADIANCE" && header != "#?RGBE", ERR_FILE_UNRECOGNIZED); + ERR_FAIL_COND_V_MSG(header != "#?RADIANCE" && header != "#?RGBE", ERR_FILE_UNRECOGNIZED, "Unsupported header information in HDR: " + header + "."); while (true) { String line = f->get_line(); @@ -45,12 +45,9 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force if (line == "") // empty line indicates end of header break; if (line.begins_with("FORMAT=")) { // leave option to implement other commands - if (line != "FORMAT=32-bit_rle_rgbe") { - ERR_EXPLAIN("Only 32-bit_rle_rgbe is supported for HDR files."); - return ERR_FILE_UNRECOGNIZED; - } + ERR_FAIL_COND_V_MSG(line != "FORMAT=32-bit_rle_rgbe", ERR_FILE_UNRECOGNIZED, "Only 32-bit_rle_rgbe is supported for HDR files."); } else if (!line.begins_with("#")) { // not comment - WARN_PRINTS("Ignoring unsupported header information in HDR : " + line); + WARN_PRINTS("Ignoring unsupported header information in HDR: " + line + "."); } } @@ -102,10 +99,7 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force len <<= 8; len |= f->get_8(); - if (len != width) { - ERR_EXPLAIN("invalid decoded scanline length, corrupt HDR"); - ERR_FAIL_V(ERR_FILE_CORRUPT); - } + ERR_FAIL_COND_V_MSG(len != width, ERR_FILE_CORRUPT, "Invalid decoded scanline length, corrupt HDR."); for (int k = 0; k < 4; ++k) { int i = 0; diff --git a/modules/hdr/image_loader_hdr.h b/modules/hdr/image_loader_hdr.h index 8ebf52def7..e9575ee4fb 100644 --- a/modules/hdr/image_loader_hdr.h +++ b/modules/hdr/image_loader_hdr.h @@ -33,9 +33,6 @@ #include "core/io/image_loader.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class ImageLoaderHDR : public ImageFormatLoader { public: diff --git a/modules/jpg/image_loader_jpegd.h b/modules/jpg/image_loader_jpegd.h index 9a96fe008d..e9016ce43e 100644 --- a/modules/jpg/image_loader_jpegd.h +++ b/modules/jpg/image_loader_jpegd.h @@ -33,9 +33,6 @@ #include "core/io/image_loader.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class ImageLoaderJPG : public ImageFormatLoader { public: diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp new file mode 100644 index 0000000000..1e02084ae2 --- /dev/null +++ b/modules/mbedtls/crypto_mbedtls.cpp @@ -0,0 +1,285 @@ +/*************************************************************************/ +/* crypto_mbedtls.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "crypto_mbedtls.h" + +#include "core/os/file_access.h" + +#include "core/engine.h" +#include "core/io/certs_compressed.gen.h" +#include "core/io/compression.h" +#include "core/project_settings.h" + +#ifdef TOOLS_ENABLED +#include "editor/editor_settings.h" +#endif +#define PEM_BEGIN_CRT "-----BEGIN CERTIFICATE-----\n" +#define PEM_END_CRT "-----END CERTIFICATE-----\n" + +#include "mbedtls/pem.h" +#include <mbedtls/debug.h> + +CryptoKey *CryptoKeyMbedTLS::create() { + return memnew(CryptoKeyMbedTLS); +} + +Error CryptoKeyMbedTLS::load(String p_path) { + ERR_FAIL_COND_V_MSG(locks, ERR_ALREADY_IN_USE, "Key is in use"); + + PoolByteArray out; + FileAccess *f = FileAccess::open(p_path, FileAccess::READ); + ERR_FAIL_COND_V(!f, ERR_INVALID_PARAMETER); + + int flen = f->get_len(); + out.resize(flen + 1); + { + PoolByteArray::Write w = out.write(); + f->get_buffer(w.ptr(), flen); + w[flen] = 0; //end f string + } + memdelete(f); + + int ret = mbedtls_pk_parse_key(&pkey, out.read().ptr(), out.size(), NULL, 0); + // We MUST zeroize the memory for safety! + mbedtls_platform_zeroize(out.write().ptr(), out.size()); + ERR_FAIL_COND_V_MSG(ret, FAILED, "Error parsing private key: " + itos(ret)); + + return OK; +} + +Error CryptoKeyMbedTLS::save(String p_path) { + FileAccess *f = FileAccess::open(p_path, FileAccess::WRITE); + ERR_FAIL_COND_V(!f, ERR_INVALID_PARAMETER); + + unsigned char w[16000]; + memset(w, 0, sizeof(w)); + + int ret = mbedtls_pk_write_key_pem(&pkey, w, sizeof(w)); + if (ret != 0) { + memdelete(f); + memset(w, 0, sizeof(w)); // Zeroize anything we might have written. + ERR_FAIL_V_MSG(FAILED, "Error writing key: " + itos(ret)); + } + + size_t len = strlen((char *)w); + f->store_buffer(w, len); + memdelete(f); + memset(w, 0, sizeof(w)); // Zeroize temporary buffer. + return OK; +} + +X509Certificate *X509CertificateMbedTLS::create() { + return memnew(X509CertificateMbedTLS); +} + +Error X509CertificateMbedTLS::load(String p_path) { + ERR_FAIL_COND_V_MSG(locks, ERR_ALREADY_IN_USE, "Certificate is in use"); + + PoolByteArray out; + FileAccess *f = FileAccess::open(p_path, FileAccess::READ); + ERR_FAIL_COND_V(!f, ERR_INVALID_PARAMETER); + + int flen = f->get_len(); + out.resize(flen + 1); + { + PoolByteArray::Write w = out.write(); + f->get_buffer(w.ptr(), flen); + w[flen] = 0; //end f string + } + memdelete(f); + + int ret = mbedtls_x509_crt_parse(&cert, out.read().ptr(), out.size()); + ERR_FAIL_COND_V_MSG(ret, FAILED, "Error parsing some certificates: " + itos(ret)); + + return OK; +} + +Error X509CertificateMbedTLS::load_from_memory(const uint8_t *p_buffer, int p_len) { + ERR_FAIL_COND_V_MSG(locks, ERR_ALREADY_IN_USE, "Certificate is in use"); + + int ret = mbedtls_x509_crt_parse(&cert, p_buffer, p_len); + ERR_FAIL_COND_V_MSG(ret, FAILED, "Error parsing certificates: " + itos(ret)); + return OK; +} + +Error X509CertificateMbedTLS::save(String p_path) { + FileAccess *f = FileAccess::open(p_path, FileAccess::WRITE); + ERR_FAIL_COND_V(!f, ERR_INVALID_PARAMETER); + + mbedtls_x509_crt *crt = &cert; + while (crt) { + unsigned char w[4096]; + size_t wrote = 0; + int ret = mbedtls_pem_write_buffer(PEM_BEGIN_CRT, PEM_END_CRT, cert.raw.p, cert.raw.len, w, sizeof(w), &wrote); + if (ret != 0 || wrote == 0) { + memdelete(f); + ERR_FAIL_V_MSG(FAILED, "Error writing certificate: " + itos(ret)); + } + + f->store_buffer(w, wrote - 1); // don't write the string terminator + crt = crt->next; + } + memdelete(f); + return OK; +} + +Crypto *CryptoMbedTLS::create() { + return memnew(CryptoMbedTLS); +} + +void CryptoMbedTLS::initialize_crypto() { + +#ifdef DEBUG_ENABLED + mbedtls_debug_set_threshold(1); +#endif + + Crypto::_create = create; + Crypto::_load_default_certificates = load_default_certificates; + X509CertificateMbedTLS::make_default(); + CryptoKeyMbedTLS::make_default(); +} + +void CryptoMbedTLS::finalize_crypto() { + Crypto::_create = NULL; + Crypto::_load_default_certificates = NULL; + if (default_certs) { + memdelete(default_certs); + default_certs = NULL; + } + X509CertificateMbedTLS::finalize(); + CryptoKeyMbedTLS::finalize(); +} + +CryptoMbedTLS::CryptoMbedTLS() { + mbedtls_ctr_drbg_init(&ctr_drbg); + mbedtls_entropy_init(&entropy); + int ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, NULL, 0); + if (ret != 0) { + ERR_PRINTS(" failed\n ! mbedtls_ctr_drbg_seed returned an error" + itos(ret)); + } +} + +CryptoMbedTLS::~CryptoMbedTLS() { + mbedtls_ctr_drbg_free(&ctr_drbg); + mbedtls_entropy_free(&entropy); +} + +X509CertificateMbedTLS *CryptoMbedTLS::default_certs = NULL; + +X509CertificateMbedTLS *CryptoMbedTLS::get_default_certificates() { + return default_certs; +} + +void CryptoMbedTLS::load_default_certificates(String p_path) { + ERR_FAIL_COND(default_certs != NULL); + + default_certs = memnew(X509CertificateMbedTLS); + ERR_FAIL_COND(default_certs == NULL); + + String certs_path = GLOBAL_DEF("network/ssl/certificates", ""); + + if (p_path != "") { + // Use certs defined in project settings. + default_certs->load(p_path); + } +#ifdef BUILTIN_CERTS_ENABLED + else { + // Use builtin certs only if user did not override it in project settings. + PoolByteArray out; + out.resize(_certs_uncompressed_size + 1); + PoolByteArray::Write w = out.write(); + Compression::decompress(w.ptr(), _certs_uncompressed_size, _certs_compressed, _certs_compressed_size, Compression::MODE_DEFLATE); + w[_certs_uncompressed_size] = 0; // Make sure it ends with string terminator +#ifdef DEBUG_ENABLED + print_verbose("Loaded builtin certs"); +#endif + default_certs->load_from_memory(out.read().ptr(), out.size()); + } +#endif +} + +Ref<CryptoKey> CryptoMbedTLS::generate_rsa(int p_bytes) { + Ref<CryptoKeyMbedTLS> out; + out.instance(); + int ret = mbedtls_pk_setup(&(out->pkey), mbedtls_pk_info_from_type(MBEDTLS_PK_RSA)); + ERR_FAIL_COND_V(ret != 0, NULL); + ret = mbedtls_rsa_gen_key(mbedtls_pk_rsa(out->pkey), mbedtls_ctr_drbg_random, &ctr_drbg, p_bytes, 65537); + ERR_FAIL_COND_V(ret != 0, NULL); + return out; +} + +Ref<X509Certificate> CryptoMbedTLS::generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after) { + Ref<CryptoKeyMbedTLS> key = static_cast<Ref<CryptoKeyMbedTLS> >(p_key); + mbedtls_x509write_cert crt; + mbedtls_x509write_crt_init(&crt); + + mbedtls_x509write_crt_set_subject_key(&crt, &(key->pkey)); + mbedtls_x509write_crt_set_issuer_key(&crt, &(key->pkey)); + mbedtls_x509write_crt_set_subject_name(&crt, p_issuer_name.utf8().get_data()); + mbedtls_x509write_crt_set_issuer_name(&crt, p_issuer_name.utf8().get_data()); + mbedtls_x509write_crt_set_version(&crt, MBEDTLS_X509_CRT_VERSION_3); + mbedtls_x509write_crt_set_md_alg(&crt, MBEDTLS_MD_SHA256); + + mbedtls_mpi serial; + mbedtls_mpi_init(&serial); + uint8_t rand_serial[20]; + mbedtls_ctr_drbg_random(&ctr_drbg, rand_serial, 20); + ERR_FAIL_COND_V(mbedtls_mpi_read_binary(&serial, rand_serial, 20), NULL); + mbedtls_x509write_crt_set_serial(&crt, &serial); + + mbedtls_x509write_crt_set_validity(&crt, p_not_before.utf8().get_data(), p_not_after.utf8().get_data()); + mbedtls_x509write_crt_set_basic_constraints(&crt, 1, -1); + mbedtls_x509write_crt_set_basic_constraints(&crt, 1, 0); + + unsigned char buf[4096]; + memset(buf, 0, 4096); + Ref<X509CertificateMbedTLS> out; + out.instance(); + mbedtls_x509write_crt_pem(&crt, buf, 4096, mbedtls_ctr_drbg_random, &ctr_drbg); + + int err = mbedtls_x509_crt_parse(&(out->cert), buf, 4096); + if (err != 0) { + mbedtls_mpi_free(&serial); + mbedtls_x509write_crt_free(&crt); + ERR_PRINTS("Generated invalid certificate: " + itos(err)); + return NULL; + } + + mbedtls_mpi_free(&serial); + mbedtls_x509write_crt_free(&crt); + return out; +} + +PoolByteArray CryptoMbedTLS::generate_random_bytes(int p_bytes) { + PoolByteArray out; + out.resize(p_bytes); + mbedtls_ctr_drbg_random(&ctr_drbg, out.write().ptr(), p_bytes); + return out; +} diff --git a/modules/mbedtls/crypto_mbedtls.h b/modules/mbedtls/crypto_mbedtls.h new file mode 100644 index 0000000000..06b3ecd234 --- /dev/null +++ b/modules/mbedtls/crypto_mbedtls.h @@ -0,0 +1,124 @@ +/*************************************************************************/ +/* crypto_mbedtls.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef CRYPTO_MBEDTLS_H +#define CRYPTO_MBEDTLS_H + +#include "core/crypto/crypto.h" +#include "core/resource.h" + +#include <mbedtls/ctr_drbg.h> +#include <mbedtls/entropy.h> +#include <mbedtls/ssl.h> + +class CryptoMbedTLS; +class SSLContextMbedTLS; +class CryptoKeyMbedTLS : public CryptoKey { + +private: + mbedtls_pk_context pkey; + int locks; + +public: + static CryptoKey *create(); + static void make_default() { CryptoKey::_create = create; } + static void finalize() { CryptoKey::_create = NULL; } + + virtual Error load(String p_path); + virtual Error save(String p_path); + + CryptoKeyMbedTLS() { + mbedtls_pk_init(&pkey); + locks = 0; + } + ~CryptoKeyMbedTLS() { + mbedtls_pk_free(&pkey); + } + + _FORCE_INLINE_ void lock() { locks++; } + _FORCE_INLINE_ void unlock() { locks--; } + + friend class CryptoMbedTLS; + friend class SSLContextMbedTLS; +}; + +class X509CertificateMbedTLS : public X509Certificate { + +private: + mbedtls_x509_crt cert; + int locks; + +public: + static X509Certificate *create(); + static void make_default() { X509Certificate::_create = create; } + static void finalize() { X509Certificate::_create = NULL; } + + virtual Error load(String p_path); + virtual Error load_from_memory(const uint8_t *p_buffer, int p_len); + virtual Error save(String p_path); + + X509CertificateMbedTLS() { + mbedtls_x509_crt_init(&cert); + locks = 0; + } + ~X509CertificateMbedTLS() { + mbedtls_x509_crt_free(&cert); + } + + _FORCE_INLINE_ void lock() { locks++; } + _FORCE_INLINE_ void unlock() { locks--; } + + friend class CryptoMbedTLS; + friend class SSLContextMbedTLS; +}; + +class CryptoMbedTLS : public Crypto { + +private: + mbedtls_entropy_context entropy; + mbedtls_ctr_drbg_context ctr_drbg; + static X509CertificateMbedTLS *default_certs; + +public: + static Crypto *create(); + static void initialize_crypto(); + static void finalize_crypto(); + static X509CertificateMbedTLS *get_default_certificates(); + static void load_default_certificates(String p_path); + + virtual PoolByteArray generate_random_bytes(int p_bytes); + virtual Ref<CryptoKey> generate_rsa(int p_bytes); + virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after); + + CryptoMbedTLS(); + ~CryptoMbedTLS(); +}; + +#endif // CRYPTO_MBEDTLS_H diff --git a/modules/mbedtls/register_types.cpp b/modules/mbedtls/register_types.cpp index 121ed5eb02..f7dc6c785f 100755 --- a/modules/mbedtls/register_types.cpp +++ b/modules/mbedtls/register_types.cpp @@ -30,15 +30,17 @@ #include "register_types.h" -#include "stream_peer_mbed_tls.h" +#include "crypto_mbedtls.h" +#include "stream_peer_mbedtls.h" void register_mbedtls_types() { - ClassDB::register_class<StreamPeerMbedTLS>(); + CryptoMbedTLS::initialize_crypto(); StreamPeerMbedTLS::initialize_ssl(); } void unregister_mbedtls_types() { StreamPeerMbedTLS::finalize_ssl(); + CryptoMbedTLS::finalize_crypto(); } diff --git a/modules/mbedtls/ssl_context_mbedtls.cpp b/modules/mbedtls/ssl_context_mbedtls.cpp new file mode 100644 index 0000000000..97b5e23f58 --- /dev/null +++ b/modules/mbedtls/ssl_context_mbedtls.cpp @@ -0,0 +1,151 @@ +/*************************************************************************/ +/* ssl_context_mbed_tls.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "ssl_context_mbedtls.h" + +static void my_debug(void *ctx, int level, + const char *file, int line, + const char *str) { + + printf("%s:%04d: %s", file, line, str); + fflush(stdout); +} + +Error SSLContextMbedTLS::_setup(int p_endpoint, int p_transport, int p_authmode) { + ERR_FAIL_COND_V_MSG(inited, ERR_ALREADY_IN_USE, "This SSL context is already active"); + + mbedtls_ssl_init(&ssl); + mbedtls_ssl_config_init(&conf); + mbedtls_ctr_drbg_init(&ctr_drbg); + mbedtls_entropy_init(&entropy); + inited = true; + + int ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, NULL, 0); + if (ret != 0) { + clear(); // Never leave unusable resources around. + ERR_FAIL_V_MSG(FAILED, "mbedtls_ctr_drbg_seed returned an error" + itos(ret)); + } + + ret = mbedtls_ssl_config_defaults(&conf, p_endpoint, p_transport, MBEDTLS_SSL_PRESET_DEFAULT); + if (ret != 0) { + clear(); + ERR_FAIL_V_MSG(FAILED, "mbedtls_ssl_config_defaults returned an error" + itos(ret)); + } + mbedtls_ssl_conf_authmode(&conf, p_authmode); + mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg); + mbedtls_ssl_conf_dbg(&conf, my_debug, stdout); + return OK; +} + +Error SSLContextMbedTLS::init_server(int p_transport, int p_authmode, Ref<CryptoKeyMbedTLS> p_pkey, Ref<X509CertificateMbedTLS> p_cert) { + ERR_FAIL_COND_V(!p_pkey.is_valid(), ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(!p_cert.is_valid(), ERR_INVALID_PARAMETER); + + Error err = _setup(MBEDTLS_SSL_IS_SERVER, p_transport, p_authmode); + ERR_FAIL_COND_V(err != OK, err); + + // Locking key and certificate(s) + pkey = p_pkey; + certs = p_cert; + if (pkey.is_valid()) + pkey->lock(); + if (certs.is_valid()) + certs->lock(); + + // Adding key and certificate + int ret = mbedtls_ssl_conf_own_cert(&conf, &(certs->cert), &(pkey->pkey)); + if (ret != 0) { + clear(); + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Invalid cert/key combination " + itos(ret)); + } + // Adding CA chain if available. + if (certs->cert.next) { + mbedtls_ssl_conf_ca_chain(&conf, certs->cert.next, NULL); + } + mbedtls_ssl_setup(&ssl, &conf); + return OK; +} + +Error SSLContextMbedTLS::init_client(int p_transport, int p_authmode, Ref<X509CertificateMbedTLS> p_valid_cas) { + Error err = _setup(MBEDTLS_SSL_IS_CLIENT, p_transport, p_authmode); + ERR_FAIL_COND_V(err != OK, err); + + X509CertificateMbedTLS *cas = NULL; + + if (p_valid_cas.is_valid()) { + // Locking CA certificates + certs = p_valid_cas; + certs->lock(); + cas = certs.ptr(); + } else { + // Fall back to default certificates (no need to lock those). + cas = CryptoMbedTLS::get_default_certificates(); + if (cas == NULL) { + clear(); + ERR_FAIL_V_MSG(ERR_UNCONFIGURED, "SSL module failed to initialize!"); + } + } + + // Set valid CAs + mbedtls_ssl_conf_ca_chain(&conf, &(cas->cert), NULL); + mbedtls_ssl_setup(&ssl, &conf); + return OK; +} + +void SSLContextMbedTLS::clear() { + if (!inited) + return; + mbedtls_ssl_free(&ssl); + mbedtls_ssl_config_free(&conf); + mbedtls_ctr_drbg_free(&ctr_drbg); + mbedtls_entropy_free(&entropy); + + // Unlock and key and certificates + if (certs.is_valid()) + certs->unlock(); + certs = Ref<X509Certificate>(); + if (pkey.is_valid()) + pkey->unlock(); + pkey = Ref<CryptoKeyMbedTLS>(); + inited = false; +} + +mbedtls_ssl_context *SSLContextMbedTLS::get_context() { + ERR_FAIL_COND_V(!inited, NULL); + return &ssl; +} + +SSLContextMbedTLS::SSLContextMbedTLS() { + inited = false; +} + +SSLContextMbedTLS::~SSLContextMbedTLS() { + clear(); +} diff --git a/modules/mbedtls/ssl_context_mbedtls.h b/modules/mbedtls/ssl_context_mbedtls.h new file mode 100644 index 0000000000..b78ee37b03 --- /dev/null +++ b/modules/mbedtls/ssl_context_mbedtls.h @@ -0,0 +1,73 @@ +/*************************************************************************/ +/* ssl_context_mbed_tls.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef SSL_CONTEXT_MBED_TLS_H +#define SSL_CONTEXT_MBED_TLS_H + +#include "crypto_mbedtls.h" + +#include "core/os/file_access.h" +#include "core/pool_vector.h" +#include "core/reference.h" + +#include <mbedtls/config.h> +#include <mbedtls/ctr_drbg.h> +#include <mbedtls/debug.h> +#include <mbedtls/entropy.h> +#include <mbedtls/ssl.h> + +class SSLContextMbedTLS : public Reference { + +protected: + bool inited; + + static PoolByteArray _read_file(String p_path); + +public: + Ref<X509CertificateMbedTLS> certs; + mbedtls_entropy_context entropy; + mbedtls_ctr_drbg_context ctr_drbg; + mbedtls_ssl_context ssl; + mbedtls_ssl_config conf; + + Ref<CryptoKeyMbedTLS> pkey; + + Error _setup(int p_endpoint, int p_transport, int p_authmode); + Error init_server(int p_transport, int p_authmode, Ref<CryptoKeyMbedTLS> p_pkey, Ref<X509CertificateMbedTLS> p_cert); + Error init_client(int p_transport, int p_authmode, Ref<X509CertificateMbedTLS> p_valid_cas); + void clear(); + + mbedtls_ssl_context *get_context(); + + SSLContextMbedTLS(); + ~SSLContextMbedTLS(); +}; + +#endif // SSL_CONTEXT_MBED_TLS_H diff --git a/modules/mbedtls/stream_peer_mbed_tls.cpp b/modules/mbedtls/stream_peer_mbedtls.cpp index 4bb7557150..e2eb19fc74 100755 --- a/modules/mbedtls/stream_peer_mbed_tls.cpp +++ b/modules/mbedtls/stream_peer_mbedtls.cpp @@ -28,19 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "stream_peer_mbed_tls.h" +#include "stream_peer_mbedtls.h" #include "core/io/stream_peer_tcp.h" #include "core/os/file_access.h" -static void my_debug(void *ctx, int level, - const char *file, int line, - const char *str) { - - printf("%s:%04d: %s", file, line, str); - fflush(stdout); -} - void _print_error(int ret) { printf("mbedtls error: returned -0x%x\n\n", -ret); fflush(stdout); @@ -86,18 +78,14 @@ int StreamPeerMbedTLS::bio_recv(void *ctx, unsigned char *buf, size_t len) { void StreamPeerMbedTLS::_cleanup() { - mbedtls_ssl_free(&ssl); - mbedtls_ssl_config_free(&conf); - mbedtls_ctr_drbg_free(&ctr_drbg); - mbedtls_entropy_free(&entropy); - + ssl_ctx->clear(); base = Ref<StreamPeer>(); status = STATUS_DISCONNECTED; } Error StreamPeerMbedTLS::_do_handshake() { int ret = 0; - while ((ret = mbedtls_ssl_handshake(&ssl)) != 0) { + while ((ret = mbedtls_ssl_handshake(ssl_ctx->get_context())) != 0) { if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { // An error occurred. ERR_PRINTS("TLS handshake error: " + itos(ret)); @@ -118,7 +106,7 @@ Error StreamPeerMbedTLS::_do_handshake() { return OK; } -Error StreamPeerMbedTLS::connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs, const String &p_for_hostname) { +Error StreamPeerMbedTLS::connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs, const String &p_for_hostname, Ref<X509Certificate> p_ca_certs) { ERR_FAIL_COND_V(p_base.is_null(), ERR_INVALID_PARAMETER); @@ -126,31 +114,11 @@ Error StreamPeerMbedTLS::connect_to_stream(Ref<StreamPeer> p_base, bool p_valida int ret = 0; int authmode = p_validate_certs ? MBEDTLS_SSL_VERIFY_REQUIRED : MBEDTLS_SSL_VERIFY_NONE; - mbedtls_ssl_init(&ssl); - mbedtls_ssl_config_init(&conf); - mbedtls_ctr_drbg_init(&ctr_drbg); - mbedtls_entropy_init(&entropy); - - ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, NULL, 0); - if (ret != 0) { - ERR_PRINTS(" failed\n ! mbedtls_ctr_drbg_seed returned an error" + itos(ret)); - _cleanup(); - return FAILED; - } + Error err = ssl_ctx->init_client(MBEDTLS_SSL_TRANSPORT_STREAM, authmode, p_ca_certs); + ERR_FAIL_COND_V(err != OK, err); - mbedtls_ssl_config_defaults(&conf, - MBEDTLS_SSL_IS_CLIENT, - MBEDTLS_SSL_TRANSPORT_STREAM, - MBEDTLS_SSL_PRESET_DEFAULT); - - mbedtls_ssl_conf_authmode(&conf, authmode); - mbedtls_ssl_conf_ca_chain(&conf, &cacert, NULL); - mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg); - mbedtls_ssl_conf_dbg(&conf, my_debug, stdout); - mbedtls_ssl_setup(&ssl, &conf); - mbedtls_ssl_set_hostname(&ssl, p_for_hostname.utf8().get_data()); - - mbedtls_ssl_set_bio(&ssl, this, bio_send, bio_recv, NULL); + mbedtls_ssl_set_hostname(ssl_ctx->get_context(), p_for_hostname.utf8().get_data()); + mbedtls_ssl_set_bio(ssl_ctx->get_context(), this, bio_send, bio_recv, NULL); status = STATUS_HANDSHAKING; @@ -162,11 +130,26 @@ Error StreamPeerMbedTLS::connect_to_stream(Ref<StreamPeer> p_base, bool p_valida return OK; } -Error StreamPeerMbedTLS::accept_stream(Ref<StreamPeer> p_base) { +Error StreamPeerMbedTLS::accept_stream(Ref<StreamPeer> p_base, Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain) { + + ERR_FAIL_COND_V(p_base.is_null(), ERR_INVALID_PARAMETER); + + Error err = ssl_ctx->init_server(MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_VERIFY_NONE, p_key, p_cert); + ERR_FAIL_COND_V(err != OK, err); + + base = p_base; + + mbedtls_ssl_set_bio(ssl_ctx->get_context(), this, bio_send, bio_recv, NULL); + + status = STATUS_HANDSHAKING; + + if ((err = _do_handshake()) != OK) { + return FAILED; + } + status = STATUS_CONNECTED; return OK; } - Error StreamPeerMbedTLS::put_data(const uint8_t *p_data, int p_bytes) { ERR_FAIL_COND_V(status != STATUS_CONNECTED, ERR_UNCONFIGURED); @@ -197,7 +180,7 @@ Error StreamPeerMbedTLS::put_partial_data(const uint8_t *p_data, int p_bytes, in if (p_bytes == 0) return OK; - int ret = mbedtls_ssl_write(&ssl, p_data, p_bytes); + int ret = mbedtls_ssl_write(ssl_ctx->get_context(), p_data, p_bytes); if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) { // Non blocking IO ret = 0; @@ -243,7 +226,7 @@ Error StreamPeerMbedTLS::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r r_received = 0; - int ret = mbedtls_ssl_read(&ssl, p_buffer, p_bytes); + int ret = mbedtls_ssl_read(ssl_ctx->get_context(), p_buffer, p_bytes); if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) { ret = 0; // non blocking io } else if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) { @@ -273,7 +256,7 @@ void StreamPeerMbedTLS::poll() { // We could pass NULL as second parameter, but some behaviour sanitizers doesn't seem to like that. // Passing a 1 byte buffer to workaround it. uint8_t byte; - int ret = mbedtls_ssl_read(&ssl, &byte, 0); + int ret = mbedtls_ssl_read(ssl_ctx->get_context(), &byte, 0); if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) { // Nothing to read/write (non blocking IO) @@ -298,10 +281,11 @@ int StreamPeerMbedTLS::get_available_bytes() const { ERR_FAIL_COND_V(status != STATUS_CONNECTED, 0); - return mbedtls_ssl_get_bytes_avail(&ssl); + return mbedtls_ssl_get_bytes_avail(&(ssl_ctx->ssl)); } StreamPeerMbedTLS::StreamPeerMbedTLS() { + ssl_ctx.instance(); status = STATUS_DISCONNECTED; } @@ -317,7 +301,7 @@ void StreamPeerMbedTLS::disconnect_from_stream() { Ref<StreamPeerTCP> tcp = base; if (tcp.is_valid() && tcp->get_status() == StreamPeerTCP::STATUS_CONNECTED) { // We are still connected on the socket, try to send close notify. - mbedtls_ssl_close_notify(&ssl); + mbedtls_ssl_close_notify(ssl_ctx->get_context()); } _cleanup(); @@ -333,28 +317,9 @@ StreamPeerSSL *StreamPeerMbedTLS::_create_func() { return memnew(StreamPeerMbedTLS); } -mbedtls_x509_crt StreamPeerMbedTLS::cacert; - -void StreamPeerMbedTLS::_load_certs(const PoolByteArray &p_array) { - int arr_len = p_array.size(); - PoolByteArray::Read r = p_array.read(); - int err = mbedtls_x509_crt_parse(&cacert, &r[0], arr_len); - if (err != 0) { - WARN_PRINTS("Error parsing some certificates: " + itos(err)); - } -} - void StreamPeerMbedTLS::initialize_ssl() { _create = _create_func; - load_certs_func = _load_certs; - - mbedtls_x509_crt_init(&cacert); - -#ifdef DEBUG_ENABLED - mbedtls_debug_set_threshold(1); -#endif - available = true; } @@ -362,6 +327,4 @@ void StreamPeerMbedTLS::finalize_ssl() { available = false; _create = NULL; - load_certs_func = NULL; - mbedtls_x509_crt_free(&cacert); } diff --git a/modules/mbedtls/stream_peer_mbed_tls.h b/modules/mbedtls/stream_peer_mbedtls.h index ab87b779c1..060e76b4f3 100755 --- a/modules/mbedtls/stream_peer_mbed_tls.h +++ b/modules/mbedtls/stream_peer_mbedtls.h @@ -32,15 +32,7 @@ #define STREAM_PEER_OPEN_SSL_H #include "core/io/stream_peer_ssl.h" - -#include <mbedtls/config.h> -#include <mbedtls/ctr_drbg.h> -#include <mbedtls/debug.h> -#include <mbedtls/entropy.h> -#include <mbedtls/ssl.h> - -#include <stdio.h> -#include <stdlib.h> +#include "ssl_context_mbedtls.h" class StreamPeerMbedTLS : public StreamPeerSSL { private: @@ -50,19 +42,13 @@ private: Ref<StreamPeer> base; static StreamPeerSSL *_create_func(); - static void _load_certs(const PoolByteArray &p_array); static int bio_recv(void *ctx, unsigned char *buf, size_t len); static int bio_send(void *ctx, const unsigned char *buf, size_t len); void _cleanup(); protected: - static mbedtls_x509_crt cacert; - - mbedtls_entropy_context entropy; - mbedtls_ctr_drbg_context ctr_drbg; - mbedtls_ssl_context ssl; - mbedtls_ssl_config conf; + Ref<SSLContextMbedTLS> ssl_ctx; static void _bind_methods(); @@ -70,8 +56,8 @@ protected: public: virtual void poll(); - virtual Error accept_stream(Ref<StreamPeer> p_base); - virtual Error connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs = false, const String &p_for_hostname = String()); + virtual Error accept_stream(Ref<StreamPeer> p_base, Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain = Ref<X509Certificate>()); + virtual Error connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs = false, const String &p_for_hostname = String(), Ref<X509Certificate> p_valid_cert = Ref<X509Certificate>()); virtual Status get_status() const; virtual void disconnect_from_stream(); diff --git a/modules/mono/.gitignore b/modules/mono/.gitignore new file mode 100644 index 0000000000..fa6d00cbbb --- /dev/null +++ b/modules/mono/.gitignore @@ -0,0 +1,2 @@ +# Do not ignore solution files inside the mono module. Overrides Godot's global gitignore. +!*.sln diff --git a/modules/mono/build_scripts/godot_tools_build.py b/modules/mono/build_scripts/godot_tools_build.py index c47cfc8a38..35daa6d307 100644 --- a/modules/mono/build_scripts/godot_tools_build.py +++ b/modules/mono/build_scripts/godot_tools_build.py @@ -84,10 +84,16 @@ def build(env_mono): source_filenames = ['GodotSharp.dll', 'GodotSharpEditor.dll'] sources = [os.path.join(editor_api_dir, filename) for filename in source_filenames] - target_filenames = ['GodotTools.dll', 'GodotTools.BuildLogger.dll', 'GodotTools.ProjectEditor.dll', 'DotNet.Glob.dll', 'GodotTools.Core.dll'] + target_filenames = [ + 'GodotTools.dll', 'GodotTools.IdeConnection.dll', 'GodotTools.BuildLogger.dll', + 'GodotTools.ProjectEditor.dll', 'DotNet.Glob.dll', 'GodotTools.Core.dll' + ] if env_mono['target'] == 'debug': - target_filenames += ['GodotTools.pdb', 'GodotTools.BuildLogger.pdb', 'GodotTools.ProjectEditor.pdb', 'GodotTools.Core.pdb'] + target_filenames += [ + 'GodotTools.pdb', 'GodotTools.IdeConnection.pdb', 'GodotTools.BuildLogger.pdb', + 'GodotTools.ProjectEditor.pdb', 'GodotTools.Core.pdb' + ] targets = [os.path.join(editor_tools_dir, filename) for filename in target_filenames] diff --git a/modules/mono/build_scripts/mono_configure.py b/modules/mono/build_scripts/mono_configure.py index 9f0eb58896..f751719531 100644 --- a/modules/mono/build_scripts/mono_configure.py +++ b/modules/mono/build_scripts/mono_configure.py @@ -113,8 +113,8 @@ def configure(env, env_mono): else: env.Append(LINKFLAGS=os.path.join(mono_lib_path, mono_static_lib_name + lib_suffix)) - env.Append(LIBS='psapi') - env.Append(LIBS='version') + env.Append(LIBS=['psapi']) + env.Append(LIBS=['version']) else: mono_lib_name = find_file_in_dir(mono_lib_path, mono_lib_names, extension='.lib') @@ -124,7 +124,7 @@ def configure(env, env_mono): if env.msvc: env.Append(LINKFLAGS=mono_lib_name + Environment()['LIBSUFFIX']) else: - env.Append(LIBS=mono_lib_name) + env.Append(LIBS=[mono_lib_name]) mono_bin_path = os.path.join(mono_root, 'bin') diff --git a/modules/mono/class_db_api_json.cpp b/modules/mono/class_db_api_json.cpp index 71ccdb7aab..4a6637434a 100644 --- a/modules/mono/class_db_api_json.cpp +++ b/modules/mono/class_db_api_json.cpp @@ -30,6 +30,8 @@ #include "class_db_api_json.h" +#ifdef DEBUG_METHODS_ENABLED + #include "core/io/json.h" #include "core/os/file_access.h" #include "core/project_settings.h" @@ -240,3 +242,5 @@ void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) { print_line(String() + "ClassDB API JSON written to: " + ProjectSettings::get_singleton()->globalize_path(p_output_file)); } + +#endif // DEBUG_METHODS_ENABLED diff --git a/modules/mono/class_db_api_json.h b/modules/mono/class_db_api_json.h index 0aa9c20930..ddfe2debea 100644 --- a/modules/mono/class_db_api_json.h +++ b/modules/mono/class_db_api_json.h @@ -31,9 +31,16 @@ #ifndef CLASS_DB_API_JSON_H #define CLASS_DB_API_JSON_H +// 'core/method_bind.h' defines DEBUG_METHODS_ENABLED, but it looks like we +// cannot include it here. That's why we include it through 'core/class_db.h'. #include "core/class_db.h" + +#ifdef DEBUG_METHODS_ENABLED + #include "core/ustring.h" void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api); +#endif // DEBUG_METHODS_ENABLED + #endif // CLASS_DB_API_JSON_H diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 1add697997..8c17bac3c9 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -114,15 +114,20 @@ void CSharpLanguage::init() { gdmono = memnew(GDMono); gdmono->initialize(); -#ifndef MONO_GLUE_ENABLED - WARN_PRINT("This binary is built with `mono_glue=no` and cannot be used for scripting"); -#endif - #if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED) + // Generate bindings here, before loading assemblies. 'initialize_load_assemblies' aborts + // the applications if the api assemblies or the main tools assembly is missing, but this + // is not a problem for BindingsGenerator as it only needs the tools project editor assembly. List<String> cmdline_args = OS::get_singleton()->get_cmdline_args(); BindingsGenerator::handle_cmdline_args(cmdline_args); #endif +#ifndef MONO_GLUE_ENABLED + print_line("Run this binary with '--generate-mono-glue path/to/modules/mono/glue'"); +#endif + + gdmono->initialize_load_assemblies(); + #ifdef TOOLS_ENABLED EditorNode::add_init_callback(&_editor_init_callback); @@ -624,7 +629,6 @@ void CSharpLanguage::frame() { if (exc) { GDMonoUtils::debug_unhandled_exception(exc); - GD_UNREACHABLE(); } } } @@ -710,14 +714,6 @@ bool CSharpLanguage::is_assembly_reloading_needed() { return false; // No assembly to load } -#ifdef TOOLS_ENABLED - if (!gdmono->get_core_api_assembly() && gdmono->metadata_is_api_assembly_invalidated(APIAssembly::API_CORE)) - return false; // The core API assembly to load is invalidated - - if (!gdmono->get_editor_api_assembly() && gdmono->metadata_is_api_assembly_invalidated(APIAssembly::API_EDITOR)) - return false; // The editor API assembly to load is invalidated -#endif - return true; } @@ -1040,6 +1036,7 @@ void CSharpLanguage::_load_scripts_metadata() { String old_json; Error ferr = read_all_file_utf8(scripts_metadata_path, old_json); + ERR_FAIL_COND(ferr != OK); Variant old_dict_var; @@ -1047,7 +1044,7 @@ void CSharpLanguage::_load_scripts_metadata() { int err_line; Error json_err = JSON::parse(old_json, old_dict_var, err_str, err_line); if (json_err != OK) { - ERR_PRINTS("Failed to parse metadata file: '" + err_str + "' (" + String::num_int64(err_line) + ")"); + ERR_PRINTS("Failed to parse metadata file: '" + err_str + "' (" + String::num_int64(err_line) + ")."); return; } @@ -1057,7 +1054,7 @@ void CSharpLanguage::_load_scripts_metadata() { print_verbose("Successfully loaded scripts metadata"); } else { if (!Engine::get_singleton()->is_editor_hint()) { - ERR_PRINT("Missing scripts metadata file"); + ERR_PRINT("Missing scripts metadata file."); } } } @@ -1772,12 +1769,8 @@ MonoObject *CSharpInstance::_internal_new_managed() { // Search the constructor first, to fail with an error if it's not found before allocating anything else. GDMonoMethod *ctor = script->script_class->get_method(CACHED_STRING_NAME(dotctor), 0); - if (ctor == NULL) { - ERR_PRINTS("Cannot create script instance because the class does not define a parameterless constructor: " + script->get_path()); - - ERR_EXPLAIN("Constructor not found"); - ERR_FAIL_V(NULL); - } + ERR_FAIL_NULL_V_MSG(ctor, NULL, + "Cannot create script instance because the class does not define a parameterless constructor: '" + script->get_path() + "'."); CSharpLanguage::get_singleton()->release_script_gchandle(gchandle); @@ -1796,8 +1789,7 @@ MonoObject *CSharpInstance::_internal_new_managed() { owner = NULL; - ERR_EXPLAIN("Failed to allocate memory for the object"); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Failed to allocate memory for the object."); } // Tie managed to unmanaged @@ -2237,7 +2229,7 @@ bool CSharpScript::_update_exports() { MonoObject *tmp_object = mono_object_new(mono_domain_get(), script_class->get_mono_ptr()); if (!tmp_object) { - ERR_PRINT("Failed to allocate temporary MonoObject"); + ERR_PRINT("Failed to allocate temporary MonoObject."); return false; } @@ -2245,12 +2237,8 @@ bool CSharpScript::_update_exports() { GDMonoMethod *ctor = script_class->get_method(CACHED_STRING_NAME(dotctor), 0); - if (ctor == NULL) { - ERR_PRINTS("Cannot construct temporary MonoObject because the class does not define a parameterless constructor: " + get_path()); - - ERR_EXPLAIN("Constructor not found"); - ERR_FAIL_V(NULL); - } + ERR_FAIL_NULL_V_MSG(ctor, NULL, + "Cannot construct temporary MonoObject because the class does not define a parameterless constructor: '" + get_path() + "'."); MonoException *ctor_exc = NULL; ctor->invoke(tmp_object, NULL, &ctor_exc); @@ -2403,7 +2391,7 @@ bool CSharpScript::_get_signal(GDMonoClass *p_class, GDMonoClass *p_delegate, Ve arg.type = GDMonoMarshal::managed_to_variant_type(types[i]); if (arg.type == Variant::NIL) { - ERR_PRINTS("Unknown type of signal parameter: " + arg.name + " in " + p_class->get_full_name()); + ERR_PRINTS("Unknown type of signal parameter: '" + arg.name + "' in '" + p_class->get_full_name() + "'."); return false; } @@ -2431,7 +2419,7 @@ bool CSharpScript::_get_member_export(IMonoClassMember *p_member, bool p_inspect if (p_member->is_static()) { if (p_member->has_attribute(CACHED_CLASS(ExportAttribute))) - ERR_PRINTS("Cannot export member because it is static: " + MEMBER_FULL_QUALIFIED_NAME(p_member)); + ERR_PRINTS("Cannot export member because it is static: '" + MEMBER_FULL_QUALIFIED_NAME(p_member) + "'."); return false; } @@ -2454,12 +2442,12 @@ bool CSharpScript::_get_member_export(IMonoClassMember *p_member, bool p_inspect GDMonoProperty *property = static_cast<GDMonoProperty *>(p_member); if (!property->has_getter()) { if (exported) - ERR_PRINTS("Read-only property cannot be exported: " + MEMBER_FULL_QUALIFIED_NAME(p_member)); + ERR_PRINTS("Read-only property cannot be exported: '" + MEMBER_FULL_QUALIFIED_NAME(p_member) + "'."); return false; } if (!property->has_setter()) { if (exported) - ERR_PRINTS("Write-only property (without getter) cannot be exported: " + MEMBER_FULL_QUALIFIED_NAME(p_member)); + ERR_PRINTS("Write-only property (without getter) cannot be exported: '" + MEMBER_FULL_QUALIFIED_NAME(p_member) + "'."); return false; } } @@ -2478,16 +2466,15 @@ bool CSharpScript::_get_member_export(IMonoClassMember *p_member, bool p_inspect String hint_string; if (variant_type == Variant::NIL) { - ERR_PRINTS("Unknown exported member type: " + MEMBER_FULL_QUALIFIED_NAME(p_member)); + ERR_PRINTS("Unknown exported member type: '" + MEMBER_FULL_QUALIFIED_NAME(p_member) + "'."); return false; } int hint_res = _try_get_member_export_hint(p_member, type, variant_type, /* allow_generics: */ true, hint, hint_string); - if (hint_res == -1) { - ERR_EXPLAIN("Error while trying to determine information about the exported member: " + MEMBER_FULL_QUALIFIED_NAME(p_member)); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(hint_res == -1, false, + "Error while trying to determine information about the exported member: '" + + MEMBER_FULL_QUALIFIED_NAME(p_member) + "'."); if (hint_res == 0) { hint = PropertyHint(CACHED_FIELD(ExportAttribute, hint)->get_int_value(attr)); @@ -2536,17 +2523,11 @@ int CSharpScript::_try_get_member_export_hint(IMonoClassMember *p_member, Manage MonoObject *val_obj = mono_field_get_value_object(mono_domain_get(), field, NULL); - if (val_obj == NULL) { - ERR_EXPLAIN("Failed to get '" + enum_field_name + "' constant enum value"); - ERR_FAIL_V(-1); - } + ERR_FAIL_NULL_V_MSG(val_obj, -1, "Failed to get '" + enum_field_name + "' constant enum value."); bool r_error; uint64_t val = GDMonoUtils::unbox_enum_value(val_obj, enum_basetype, r_error); - if (r_error) { - ERR_EXPLAIN("Failed to unbox '" + enum_field_name + "' constant enum value"); - ERR_FAIL_V(-1); - } + ERR_FAIL_COND_V_MSG(r_error, -1, "Failed to unbox '" + enum_field_name + "' constant enum value."); if (val != (unsigned int)i) { uses_default_values = false; @@ -2581,17 +2562,11 @@ int CSharpScript::_try_get_member_export_hint(IMonoClassMember *p_member, Manage PropertyHint elem_hint = PROPERTY_HINT_NONE; String elem_hint_string; - if (elem_variant_type == Variant::NIL) { - ERR_EXPLAIN("Unknown array element type"); - ERR_FAIL_V(-1); - } + ERR_FAIL_COND_V_MSG(elem_variant_type == Variant::NIL, -1, "Unknown array element type."); int hint_res = _try_get_member_export_hint(p_member, elem_type, elem_variant_type, /* allow_generics: */ false, elem_hint, elem_hint_string); - if (hint_res == -1) { - ERR_EXPLAIN("Error while trying to determine information about the array element type"); - ERR_FAIL_V(-1); - } + ERR_FAIL_COND_V_MSG(hint_res == -1, -1, "Error while trying to determine information about the array element type."); // Format: type/hint:hint_string r_hint_string = itos(elem_variant_type) + "/" + itos(elem_hint) + ":" + elem_hint_string; @@ -2779,7 +2754,7 @@ bool CSharpScript::can_instance() const { "Compile", ProjectSettings::get_singleton()->globalize_path(get_path())); } else { - ERR_PRINTS("Cannot add " + get_path() + " to the C# project because it could not be created."); + ERR_PRINTS("C# project could not be created; cannot add file: '" + get_path() + "'."); } } } @@ -2797,12 +2772,10 @@ bool CSharpScript::can_instance() const { if (extra_cond && !script_class) { if (GDMono::get_singleton()->get_project_assembly() == NULL) { // The project assembly is not loaded - ERR_EXPLAIN("Cannot instance script because the project assembly is not loaded. Script: " + get_path()); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Cannot instance script because the project assembly is not loaded. Script: '" + get_path() + "'."); } else { // The project assembly is loaded, but the class could not found - ERR_EXPLAIN("Cannot instance script because the class '" + name + "' could not be found. Script: " + get_path()); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Cannot instance script because the class '" + name + "' could not be found. Script: '" + get_path() + "'."); } } @@ -2824,14 +2797,12 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg // Search the constructor first, to fail with an error if it's not found before allocating anything else. GDMonoMethod *ctor = script_class->get_method(CACHED_STRING_NAME(dotctor), p_argcount); if (ctor == NULL) { - if (p_argcount == 0) { - String path = get_path(); - ERR_PRINTS("Cannot create script instance. The class '" + script_class->get_full_name() + - "' does not define a parameterless constructor." + (path.empty() ? String() : ". Path: " + path)); - } + ERR_FAIL_COND_V_MSG(p_argcount == 0, NULL, + "Cannot create script instance. The class '" + script_class->get_full_name() + + "' does not define a parameterless constructor." + + (get_path().empty() ? String() : " Path: '" + get_path() + "'.")); - ERR_EXPLAIN("Constructor not found"); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Constructor not found."); } Ref<Reference> ref; @@ -2882,8 +2853,7 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg p_owner->set_script_instance(NULL); r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; - ERR_EXPLAIN("Failed to allocate memory for the object"); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Failed to allocate memory for the object."); } // Tie managed to unmanaged @@ -2917,11 +2887,10 @@ Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Variant::Call r_error.error = Variant::CallError::CALL_OK; REF ref; - Object *owner = NULL; ERR_FAIL_NULL_V(native, Variant()); - owner = ClassDB::instance(NATIVE_GDMONOCLASS_NAME(native)); + Object *owner = ClassDB::instance(NATIVE_GDMONOCLASS_NAME(native)); Reference *r = Object::cast_to<Reference>(owner); if (r) { @@ -2955,8 +2924,8 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) { if (ScriptDebugger::get_singleton()) { CSharpLanguage::get_singleton()->debug_break_parse(get_path(), 0, "Script inherits from native type '" + native_name + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"); } - ERR_EXPLAIN("Script inherits from native type '" + native_name + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + native_name + + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'."); } } @@ -3208,12 +3177,12 @@ int CSharpScript::get_member_line(const StringName &p_member) const { Error CSharpScript::load_source_code(const String &p_path) { Error ferr = read_all_file_utf8(p_path, source); - if (ferr != OK) { - if (ferr == ERR_INVALID_DATA) { - ERR_EXPLAIN("Script '" + p_path + "' contains invalid unicode (utf-8), so it was not loaded. Please ensure that scripts are saved in valid utf-8 unicode."); - } - ERR_FAIL_V(ferr); - } + + ERR_FAIL_COND_V_MSG(ferr != OK, ferr, + ferr == ERR_INVALID_DATA ? + "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded." + " Please ensure that scripts are saved in valid UTF-8 unicode." : + "Failed to read file: '" + p_path + "'."); #ifdef TOOLS_ENABLED source_changed_cache = true; @@ -3282,8 +3251,7 @@ RES ResourceFormatLoaderCSharpScript::load(const String &p_path, const String &p #ifdef DEBUG_ENABLED // User is responsible for thread attach/detach - ERR_EXPLAIN("Thread is not attached"); - CRASH_COND(mono_domain_get() == NULL); + CRASH_COND_MSG(mono_domain_get() == NULL, "Thread is not attached."); #endif #endif @@ -3350,8 +3318,7 @@ Error ResourceFormatSaverCSharpScript::save(const String &p_path, const RES &p_r "Compile", ProjectSettings::get_singleton()->globalize_path(p_path)); } else { - ERR_PRINTS("Failed to create C# project"); - ERR_PRINTS("Cannot add " + p_path + " to the C# project"); + ERR_PRINTS("C# project could not be created; cannot add file: '" + p_path + "'."); } } #endif diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/ConsoleLogger.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/ConsoleLogger.cs new file mode 100644 index 0000000000..7a2ff2ca56 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/ConsoleLogger.cs @@ -0,0 +1,33 @@ +using System; + +namespace GodotTools.IdeConnection +{ + public class ConsoleLogger : ILogger + { + public void LogDebug(string message) + { + Console.WriteLine("DEBUG: " + message); + } + + public void LogInfo(string message) + { + Console.WriteLine("INFO: " + message); + } + + public void LogWarning(string message) + { + Console.WriteLine("WARN: " + message); + } + + public void LogError(string message) + { + Console.WriteLine("ERROR: " + message); + } + + public void LogError(string message, Exception e) + { + Console.WriteLine("EXCEPTION: " + message); + Console.WriteLine(e); + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeBase.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeBase.cs new file mode 100644 index 0000000000..be89638241 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeBase.cs @@ -0,0 +1,94 @@ +using System; +using Path = System.IO.Path; + +namespace GodotTools.IdeConnection +{ + public class GodotIdeBase : IDisposable + { + private ILogger logger; + + public ILogger Logger + { + get => logger ?? (logger = new ConsoleLogger()); + set => logger = value; + } + + private readonly string projectMetadataDir; + + protected const string MetaFileName = "ide_server_meta.txt"; + protected string MetaFilePath => Path.Combine(projectMetadataDir, MetaFileName); + + private GodotIdeConnection connection; + protected readonly object ConnectionLock = new object(); + + public bool IsDisposed { get; private set; } = false; + + public bool IsConnected => connection != null && !connection.IsDisposed && connection.IsConnected; + + public event Action Connected + { + add + { + if (connection != null && !connection.IsDisposed) + connection.Connected += value; + } + remove + { + if (connection != null && !connection.IsDisposed) + connection.Connected -= value; + } + } + + protected GodotIdeConnection Connection + { + get => connection; + set + { + connection?.Dispose(); + connection = value; + } + } + + protected GodotIdeBase(string projectMetadataDir) + { + this.projectMetadataDir = projectMetadataDir; + } + + protected void DisposeConnection() + { + lock (ConnectionLock) + { + connection?.Dispose(); + } + } + + ~GodotIdeBase() + { + Dispose(disposing: false); + } + + public void Dispose() + { + if (IsDisposed) + return; + + lock (ConnectionLock) + { + if (IsDisposed) // lock may not be fair + return; + IsDisposed = true; + } + + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + connection?.Dispose(); + } + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeClient.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeClient.cs new file mode 100644 index 0000000000..4f56a8d71b --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeClient.cs @@ -0,0 +1,219 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Threading; + +namespace GodotTools.IdeConnection +{ + public abstract class GodotIdeClient : GodotIdeBase + { + protected GodotIdeMetadata GodotIdeMetadata; + + private readonly FileSystemWatcher fsWatcher; + + protected GodotIdeClient(string projectMetadataDir) : base(projectMetadataDir) + { + messageHandlers = InitializeMessageHandlers(); + + // FileSystemWatcher requires an existing directory + if (!File.Exists(projectMetadataDir)) + Directory.CreateDirectory(projectMetadataDir); + + fsWatcher = new FileSystemWatcher(projectMetadataDir, MetaFileName); + } + + private void OnMetaFileChanged(object sender, FileSystemEventArgs e) + { + if (IsDisposed) + return; + + lock (ConnectionLock) + { + if (IsDisposed) + return; + + if (!File.Exists(MetaFilePath)) + return; + + var metadata = ReadMetadataFile(); + + if (metadata != null && metadata != GodotIdeMetadata) + { + GodotIdeMetadata = metadata.Value; + ConnectToServer(); + } + } + } + + private void OnMetaFileDeleted(object sender, FileSystemEventArgs e) + { + if (IsDisposed) + return; + + if (IsConnected) + DisposeConnection(); + + // The file may have been re-created + + lock (ConnectionLock) + { + if (IsDisposed) + return; + + if (IsConnected || !File.Exists(MetaFilePath)) + return; + + var metadata = ReadMetadataFile(); + + if (metadata != null) + { + GodotIdeMetadata = metadata.Value; + ConnectToServer(); + } + } + } + + private GodotIdeMetadata? ReadMetadataFile() + { + using (var reader = File.OpenText(MetaFilePath)) + { + string portStr = reader.ReadLine(); + + if (portStr == null) + return null; + + string editorExecutablePath = reader.ReadLine(); + + if (editorExecutablePath == null) + return null; + + if (!int.TryParse(portStr, out int port)) + return null; + + return new GodotIdeMetadata(port, editorExecutablePath); + } + } + + private void ConnectToServer() + { + var tcpClient = new TcpClient(); + + Connection = new GodotIdeConnectionClient(tcpClient, HandleMessage); + Connection.Logger = Logger; + + try + { + Logger.LogInfo("Connecting to Godot Ide Server"); + + tcpClient.Connect(IPAddress.Loopback, GodotIdeMetadata.Port); + + Logger.LogInfo("Connection open with Godot Ide Server"); + + var clientThread = new Thread(Connection.Start) + { + IsBackground = true, + Name = "Godot Ide Connection Client" + }; + clientThread.Start(); + } + catch (SocketException e) + { + if (e.SocketErrorCode == SocketError.ConnectionRefused) + Logger.LogError("The connection to the Godot Ide Server was refused"); + else + throw; + } + } + + public void Start() + { + Logger.LogInfo("Starting Godot Ide Client"); + + fsWatcher.Changed += OnMetaFileChanged; + fsWatcher.Deleted += OnMetaFileDeleted; + fsWatcher.EnableRaisingEvents = true; + + lock (ConnectionLock) + { + if (IsDisposed) + return; + + if (!File.Exists(MetaFilePath)) + { + Logger.LogInfo("There is no Godot Ide Server running"); + return; + } + + var metadata = ReadMetadataFile(); + + if (metadata != null) + { + GodotIdeMetadata = metadata.Value; + ConnectToServer(); + } + else + { + Logger.LogError("Failed to read Godot Ide metadata file"); + } + } + } + + public bool WriteMessage(Message message) + { + return Connection.WriteMessage(message); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (disposing) + { + fsWatcher?.Dispose(); + } + } + + protected virtual bool HandleMessage(Message message) + { + if (messageHandlers.TryGetValue(message.Id, out var action)) + { + action(message.Arguments); + return true; + } + + return false; + } + + private readonly Dictionary<string, Action<string[]>> messageHandlers; + + private Dictionary<string, Action<string[]>> InitializeMessageHandlers() + { + return new Dictionary<string, Action<string[]>> + { + ["OpenFile"] = args => + { + switch (args.Length) + { + case 1: + OpenFile(file: args[0]); + return; + case 2: + OpenFile(file: args[0], line: int.Parse(args[1])); + return; + case 3: + OpenFile(file: args[0], line: int.Parse(args[1]), column: int.Parse(args[2])); + return; + default: + throw new ArgumentException(); + } + } + }; + } + + protected abstract void OpenFile(string file); + protected abstract void OpenFile(string file, int line); + protected abstract void OpenFile(string file, int line, int column); + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnection.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnection.cs new file mode 100644 index 0000000000..e7e81f175e --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnection.cs @@ -0,0 +1,207 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Net.Sockets; +using System.Text; + +namespace GodotTools.IdeConnection +{ + public abstract class GodotIdeConnection : IDisposable + { + protected const string Version = "1.0"; + + protected static readonly string ClientHandshake = $"Godot Ide Client Version {Version}"; + protected static readonly string ServerHandshake = $"Godot Ide Server Version {Version}"; + + private const int ClientWriteTimeout = 8000; + private readonly TcpClient tcpClient; + + private TextReader clientReader; + private TextWriter clientWriter; + + private readonly object writeLock = new object(); + + private readonly Func<Message, bool> messageHandler; + + public event Action Connected; + + private ILogger logger; + + public ILogger Logger + { + get => logger ?? (logger = new ConsoleLogger()); + set => logger = value; + } + + public bool IsDisposed { get; private set; } = false; + + public bool IsConnected => tcpClient.Client != null && tcpClient.Client.Connected; + + protected GodotIdeConnection(TcpClient tcpClient, Func<Message, bool> messageHandler) + { + this.tcpClient = tcpClient; + this.messageHandler = messageHandler; + } + + public void Start() + { + try + { + if (!StartConnection()) + return; + + string messageLine; + while ((messageLine = ReadLine()) != null) + { + if (!MessageParser.TryParse(messageLine, out Message msg)) + { + Logger.LogError($"Received message with invalid format: {messageLine}"); + continue; + } + + Logger.LogDebug($"Received message: {msg}"); + + if (msg.Id == "close") + { + Logger.LogInfo("Closing connection"); + return; + } + + try + { + try + { + Debug.Assert(messageHandler != null); + + if (!messageHandler(msg)) + Logger.LogError($"Received unknown message: {msg}"); + } + catch (Exception e) + { + Logger.LogError($"Message handler for '{msg}' failed with exception", e); + } + } + catch (Exception e) + { + Logger.LogError($"Exception thrown from message handler. Message: {msg}", e); + } + } + } + catch (Exception e) + { + Logger.LogError($"Unhandled exception in the Godot Ide Connection thread", e); + } + finally + { + Dispose(); + } + } + + private bool StartConnection() + { + NetworkStream clientStream = tcpClient.GetStream(); + + clientReader = new StreamReader(clientStream, Encoding.UTF8); + + lock (writeLock) + clientWriter = new StreamWriter(clientStream, Encoding.UTF8); + + clientStream.WriteTimeout = ClientWriteTimeout; + + if (!WriteHandshake()) + { + Logger.LogError("Could not write handshake"); + return false; + } + + if (!IsValidResponseHandshake(ReadLine())) + { + Logger.LogError("Received invalid handshake"); + return false; + } + + Connected?.Invoke(); + + Logger.LogInfo("Godot Ide connection started"); + + return true; + } + + private string ReadLine() + { + try + { + return clientReader?.ReadLine(); + } + catch (Exception e) + { + if (IsDisposed) + { + var se = e as SocketException ?? e.InnerException as SocketException; + if (se != null && se.SocketErrorCode == SocketError.Interrupted) + return null; + } + + throw; + } + } + + public bool WriteMessage(Message message) + { + Logger.LogDebug($"Sending message {message}"); + + var messageComposer = new MessageComposer(); + + messageComposer.AddArgument(message.Id); + foreach (string argument in message.Arguments) + messageComposer.AddArgument(argument); + + return WriteLine(messageComposer.ToString()); + } + + protected bool WriteLine(string text) + { + if (clientWriter == null || IsDisposed || !IsConnected) + return false; + + lock (writeLock) + { + try + { + clientWriter.WriteLine(text); + clientWriter.Flush(); + } + catch (Exception e) + { + if (!IsDisposed) + { + var se = e as SocketException ?? e.InnerException as SocketException; + if (se != null && se.SocketErrorCode == SocketError.Shutdown) + Logger.LogInfo("Client disconnected ungracefully"); + else + Logger.LogError("Exception thrown when trying to write to client", e); + + Dispose(); + } + } + } + + return true; + } + + protected abstract bool WriteHandshake(); + protected abstract bool IsValidResponseHandshake(string handshakeLine); + + public void Dispose() + { + if (IsDisposed) + return; + + IsDisposed = true; + + clientReader?.Dispose(); + clientWriter?.Dispose(); + ((IDisposable) tcpClient)?.Dispose(); + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnectionClient.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnectionClient.cs new file mode 100644 index 0000000000..1b11a14358 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnectionClient.cs @@ -0,0 +1,24 @@ +using System; +using System.Net.Sockets; +using System.Threading.Tasks; + +namespace GodotTools.IdeConnection +{ + public class GodotIdeConnectionClient : GodotIdeConnection + { + public GodotIdeConnectionClient(TcpClient tcpClient, Func<Message, bool> messageHandler) + : base(tcpClient, messageHandler) + { + } + + protected override bool WriteHandshake() + { + return WriteLine(ClientHandshake); + } + + protected override bool IsValidResponseHandshake(string handshakeLine) + { + return handshakeLine == ServerHandshake; + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnectionServer.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnectionServer.cs new file mode 100644 index 0000000000..aa98dc7ca3 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnectionServer.cs @@ -0,0 +1,24 @@ +using System; +using System.Net.Sockets; +using System.Threading.Tasks; + +namespace GodotTools.IdeConnection +{ + public class GodotIdeConnectionServer : GodotIdeConnection + { + public GodotIdeConnectionServer(TcpClient tcpClient, Func<Message, bool> messageHandler) + : base(tcpClient, messageHandler) + { + } + + protected override bool WriteHandshake() + { + return WriteLine(ServerHandshake); + } + + protected override bool IsValidResponseHandshake(string handshakeLine) + { + return handshakeLine == ClientHandshake; + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeMetadata.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeMetadata.cs new file mode 100644 index 0000000000..d16daba0e2 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeMetadata.cs @@ -0,0 +1,45 @@ +namespace GodotTools.IdeConnection +{ + public struct GodotIdeMetadata + { + public int Port { get; } + public string EditorExecutablePath { get; } + + public GodotIdeMetadata(int port, string editorExecutablePath) + { + Port = port; + EditorExecutablePath = editorExecutablePath; + } + + public static bool operator ==(GodotIdeMetadata a, GodotIdeMetadata b) + { + return a.Port == b.Port && a.EditorExecutablePath == b.EditorExecutablePath; + } + + public static bool operator !=(GodotIdeMetadata a, GodotIdeMetadata b) + { + return !(a == b); + } + + public override bool Equals(object obj) + { + if (obj is GodotIdeMetadata metadata) + return metadata == this; + + return false; + } + + public bool Equals(GodotIdeMetadata other) + { + return Port == other.Port && EditorExecutablePath == other.EditorExecutablePath; + } + + public override int GetHashCode() + { + unchecked + { + return (Port * 397) ^ (EditorExecutablePath != null ? EditorExecutablePath.GetHashCode() : 0); + } + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj new file mode 100644 index 0000000000..84c08251ab --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{92600954-25F0-4291-8E11-1FEE9FC4BE20}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>GodotTools.IdeConnection</RootNamespace> + <AssemblyName>GodotTools.IdeConnection</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>portable</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>portable</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ConsoleLogger.cs" /> + <Compile Include="GodotIdeMetadata.cs" /> + <Compile Include="GodotIdeBase.cs" /> + <Compile Include="GodotIdeClient.cs" /> + <Compile Include="GodotIdeConnection.cs" /> + <Compile Include="GodotIdeConnectionClient.cs" /> + <Compile Include="GodotIdeConnectionServer.cs" /> + <Compile Include="ILogger.cs" /> + <Compile Include="Message.cs" /> + <Compile Include="MessageComposer.cs" /> + <Compile Include="MessageParser.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/ILogger.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/ILogger.cs new file mode 100644 index 0000000000..614bb30271 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/ILogger.cs @@ -0,0 +1,13 @@ +using System; + +namespace GodotTools.IdeConnection +{ + public interface ILogger + { + void LogDebug(string message); + void LogInfo(string message); + void LogWarning(string message); + void LogError(string message); + void LogError(string message, Exception e); + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/Message.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/Message.cs new file mode 100644 index 0000000000..f24d324ae3 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/Message.cs @@ -0,0 +1,21 @@ +using System.Linq; + +namespace GodotTools.IdeConnection +{ + public struct Message + { + public string Id { get; set; } + public string[] Arguments { get; set; } + + public Message(string id, params string[] arguments) + { + Id = id; + Arguments = arguments; + } + + public override string ToString() + { + return $"(Id: '{Id}', Arguments: '{string.Join(",", Arguments)}')"; + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageComposer.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageComposer.cs new file mode 100644 index 0000000000..9e4cd6ec1a --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageComposer.cs @@ -0,0 +1,46 @@ +using System.Linq; +using System.Text; + +namespace GodotTools.IdeConnection +{ + public class MessageComposer + { + private readonly StringBuilder stringBuilder = new StringBuilder(); + + private static readonly char[] CharsToEscape = { '\\', '"' }; + + public void AddArgument(string argument) + { + AddArgument(argument, quoted: argument.Contains(",")); + } + + public void AddArgument(string argument, bool quoted) + { + if (stringBuilder.Length > 0) + stringBuilder.Append(','); + + if (quoted) + { + stringBuilder.Append('"'); + + foreach (char @char in argument) + { + if (CharsToEscape.Contains(@char)) + stringBuilder.Append('\\'); + stringBuilder.Append(@char); + } + + stringBuilder.Append('"'); + } + else + { + stringBuilder.Append(argument); + } + } + + public override string ToString() + { + return stringBuilder.ToString(); + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageParser.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageParser.cs new file mode 100644 index 0000000000..ed691e481f --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageParser.cs @@ -0,0 +1,88 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace GodotTools.IdeConnection +{ + public static class MessageParser + { + public static bool TryParse(string messageLine, out Message message) + { + var arguments = new List<string>(); + var stringBuilder = new StringBuilder(); + + bool expectingArgument = true; + + for (int i = 0; i < messageLine.Length; i++) + { + char @char = messageLine[i]; + + if (@char == ',') + { + if (expectingArgument) + arguments.Add(string.Empty); + + expectingArgument = true; + continue; + } + + bool quoted = false; + + if (messageLine[i] == '"') + { + quoted = true; + i++; + } + + while (i < messageLine.Length) + { + @char = messageLine[i]; + + if (quoted && @char == '"') + { + i++; + break; + } + + if (@char == '\\') + { + i++; + if (i < messageLine.Length) + break; + + stringBuilder.Append(messageLine[i]); + } + else if (!quoted && @char == ',') + { + break; // We don't increment the counter to allow the colon to be parsed after this + } + else + { + stringBuilder.Append(@char); + } + + i++; + } + + arguments.Add(stringBuilder.ToString()); + stringBuilder.Clear(); + + expectingArgument = false; + } + + if (arguments.Count == 0) + { + message = new Message(); + return false; + } + + message = new Message + { + Id = arguments[0], + Arguments = arguments.Skip(1).ToArray() + }; + + return true; + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/Properties/AssemblyInfo.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..c7c00e66a2 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GodotTools.IdeConnection")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Godot Engine contributors")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("92600954-25F0-4291-8E11-1FEE9FC4BE20")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs index 1edc426e00..233aab45b3 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs @@ -85,7 +85,7 @@ namespace GodotTools.ProjectEditor void AddPropertyIfNotPresent(string name, string condition, string value) { if (root.PropertyGroups - .Any(g => g.Condition == string.Empty || g.Condition == condition && + .Any(g => (g.Condition == string.Empty || g.Condition == condition) && g.Properties .Any(p => p.Name == name && p.Value == value && diff --git a/modules/mono/editor/GodotTools/GodotTools.sln b/modules/mono/editor/GodotTools/GodotTools.sln index 6f7d44bec2..a3438ea5f3 100644 --- a/modules/mono/editor/GodotTools/GodotTools.sln +++ b/modules/mono/editor/GodotTools/GodotTools.sln @@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotTools.Core", "GodotToo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotTools.BuildLogger", "GodotTools.BuildLogger\GodotTools.BuildLogger.csproj", "{6CE9A984-37B1-4F8A-8FE9-609F05F071B3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotTools.IdeConnection", "GodotTools.IdeConnection\GodotTools.IdeConnection.csproj", "{92600954-25F0-4291-8E11-1FEE9FC4BE20}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -31,5 +33,9 @@ Global {6CE9A984-37B1-4F8A-8FE9-609F05F071B3}.Debug|Any CPU.Build.0 = Debug|Any CPU {6CE9A984-37B1-4F8A-8FE9-609F05F071B3}.Release|Any CPU.ActiveCfg = Release|Any CPU {6CE9A984-37B1-4F8A-8FE9-609F05F071B3}.Release|Any CPU.Build.0 = Release|Any CPU + {92600954-25F0-4291-8E11-1FEE9FC4BE20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92600954-25F0-4291-8E11-1FEE9FC4BE20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92600954-25F0-4291-8E11-1FEE9FC4BE20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92600954-25F0-4291-8E11-1FEE9FC4BE20}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/modules/mono/editor/GodotTools/GodotTools/MonoBottomPanel.cs b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs index 300cf7fcb9..44813f962c 100644 --- a/modules/mono/editor/GodotTools/GodotTools/MonoBottomPanel.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs @@ -3,12 +3,13 @@ using System; using System.IO; using Godot.Collections; using GodotTools.Internals; +using static GodotTools.Internals.Globals; using File = GodotTools.Utils.File; using Path = System.IO.Path; namespace GodotTools { - public class MonoBottomPanel : VBoxContainer + public class BottomPanel : VBoxContainer { private EditorInterface editorInterface; @@ -33,7 +34,7 @@ namespace GodotTools for (int i = 0; i < buildTabs.GetChildCount(); i++) { - var tab = (MonoBuildTab) buildTabs.GetChild(i); + var tab = (BuildTab) buildTabs.GetChild(i); if (tab == null) continue; @@ -48,11 +49,11 @@ namespace GodotTools itemTooltip += "\nStatus: "; if (tab.BuildExited) - itemTooltip += tab.BuildResult == MonoBuildTab.BuildResults.Success ? "Succeeded" : "Errored"; + itemTooltip += tab.BuildResult == BuildTab.BuildResults.Success ? "Succeeded" : "Errored"; else itemTooltip += "Running"; - if (!tab.BuildExited || tab.BuildResult == MonoBuildTab.BuildResults.Error) + if (!tab.BuildExited || tab.BuildResult == BuildTab.BuildResults.Error) itemTooltip += $"\nErrors: {tab.ErrorCount}"; itemTooltip += $"\nWarnings: {tab.WarningCount}"; @@ -67,15 +68,15 @@ namespace GodotTools } } - public MonoBuildTab GetBuildTabFor(MonoBuildInfo buildInfo) + public BuildTab GetBuildTabFor(BuildInfo buildInfo) { - foreach (var buildTab in new Array<MonoBuildTab>(buildTabs.GetChildren())) + foreach (var buildTab in new Array<BuildTab>(buildTabs.GetChildren())) { if (buildTab.BuildInfo.Equals(buildInfo)) return buildTab; } - var newBuildTab = new MonoBuildTab(buildInfo); + var newBuildTab = new BuildTab(buildInfo); AddBuildTab(newBuildTab); return newBuildTab; @@ -119,7 +120,7 @@ namespace GodotTools if (currentTab < 0 || currentTab >= buildTabs.GetTabCount()) throw new InvalidOperationException("No tab selected"); - var buildTab = (MonoBuildTab) buildTabs.GetChild(currentTab); + var buildTab = (BuildTab) buildTabs.GetChild(currentTab); buildTab.WarningsVisible = pressed; buildTab.UpdateIssuesList(); } @@ -131,7 +132,7 @@ namespace GodotTools if (currentTab < 0 || currentTab >= buildTabs.GetTabCount()) throw new InvalidOperationException("No tab selected"); - var buildTab = (MonoBuildTab) buildTabs.GetChild(currentTab); + var buildTab = (BuildTab) buildTabs.GetChild(currentTab); buildTab.ErrorsVisible = pressed; buildTab.UpdateIssuesList(); } @@ -144,7 +145,7 @@ namespace GodotTools string editorScriptsMetadataPath = Path.Combine(GodotSharpDirs.ResMetadataDir, "scripts_metadata.editor"); string playerScriptsMetadataPath = Path.Combine(GodotSharpDirs.ResMetadataDir, "scripts_metadata.editor_player"); - CSharpProject.GenerateScriptsMetadata(GodotSharpDirs.ProjectCsProjPath, editorScriptsMetadataPath); + CsProjOperations.GenerateScriptsMetadata(GodotSharpDirs.ProjectCsProjPath, editorScriptsMetadataPath); if (File.Exists(editorScriptsMetadataPath)) { @@ -165,7 +166,7 @@ namespace GodotTools Internal.GodotIs32Bits() ? "32" : "64" }; - bool buildSuccess = GodotSharpBuilds.BuildProjectBlocking("Tools", godotDefines); + bool buildSuccess = BuildManager.BuildProjectBlocking("Tools", godotDefines); if (!buildSuccess) return; @@ -192,9 +193,9 @@ namespace GodotTools int selectedItem = selectedItems[0]; - var buildTab = (MonoBuildTab) buildTabs.GetTabControl(selectedItem); + var buildTab = (BuildTab) buildTabs.GetTabControl(selectedItem); - OS.ShellOpen(Path.Combine(buildTab.BuildInfo.LogsDirPath, GodotSharpBuilds.MsBuildLogFileName)); + OS.ShellOpen(Path.Combine(buildTab.BuildInfo.LogsDirPath, BuildManager.MsBuildLogFileName)); } public override void _Notification(int what) @@ -210,13 +211,13 @@ namespace GodotTools } } - public void AddBuildTab(MonoBuildTab buildTab) + public void AddBuildTab(BuildTab buildTab) { buildTabs.AddChild(buildTab); RaiseBuildTab(buildTab); } - public void RaiseBuildTab(MonoBuildTab buildTab) + public void RaiseBuildTab(BuildTab buildTab) { if (buildTab.GetParent() != buildTabs) throw new InvalidOperationException("Build tab is not in the tabs list"); @@ -254,7 +255,7 @@ namespace GodotTools panelTabs = new TabContainer { TabAlign = TabContainer.TabAlignEnum.Left, - RectMinSize = new Vector2(0, 228) * Internal.EditorScale, + RectMinSize = new Vector2(0, 228) * EditorScale, SizeFlagsVertical = (int) SizeFlags.ExpandFill }; panelTabs.AddStyleboxOverride("panel", editorBaseControl.GetStylebox("DebuggerPanel", "EditorStyles")); @@ -266,7 +267,7 @@ namespace GodotTools // Builds tab panelBuildsTab = new VBoxContainer { - Name = "Builds", // TTR + Name = "Builds".TTR(), SizeFlagsHorizontal = (int) SizeFlags.ExpandFill }; panelTabs.AddChild(panelBuildsTab); @@ -276,7 +277,7 @@ namespace GodotTools var buildProjectBtn = new Button { - Text = "Build Project", // TTR + Text = "Build Project".TTR(), FocusMode = FocusModeEnum.None }; buildProjectBtn.Connect("pressed", this, nameof(BuildProjectPressed)); @@ -286,7 +287,7 @@ namespace GodotTools warningsBtn = new ToolButton { - Text = "Warnings", // TTR + Text = "Warnings".TTR(), ToggleMode = true, Pressed = true, Visible = false, @@ -297,7 +298,7 @@ namespace GodotTools errorsBtn = new ToolButton { - Text = "Errors", // TTR + Text = "Errors".TTR(), ToggleMode = true, Pressed = true, Visible = false, @@ -310,7 +311,7 @@ namespace GodotTools viewLogBtn = new Button { - Text = "View log", // TTR + Text = "View log".TTR(), FocusMode = FocusModeEnum.None, Visible = false }; diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs index f849356919..9a2b2e3a26 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs @@ -46,8 +46,8 @@ namespace GodotTools.Build { if (OS.IsWindows()) { - return (GodotSharpBuilds.BuildTool) EditorSettings.GetSetting("mono/builds/build_tool") - == GodotSharpBuilds.BuildTool.MsBuildMono; + return (BuildManager.BuildTool) EditorSettings.GetSetting("mono/builds/build_tool") + == BuildManager.BuildTool.MsBuildMono; } return false; @@ -103,16 +103,16 @@ namespace GodotTools.Build return process; } - public static int Build(MonoBuildInfo monoBuildInfo) + public static int Build(BuildInfo buildInfo) { - return Build(monoBuildInfo.Solution, monoBuildInfo.Configuration, - monoBuildInfo.LogsDirPath, monoBuildInfo.CustomProperties); + return Build(buildInfo.Solution, buildInfo.Configuration, + buildInfo.LogsDirPath, buildInfo.CustomProperties); } - public static async Task<int> BuildAsync(MonoBuildInfo monoBuildInfo) + public static async Task<int> BuildAsync(BuildInfo buildInfo) { - return await BuildAsync(monoBuildInfo.Solution, monoBuildInfo.Configuration, - monoBuildInfo.LogsDirPath, monoBuildInfo.CustomProperties); + return await BuildAsync(buildInfo.Solution, buildInfo.Configuration, + buildInfo.LogsDirPath, buildInfo.CustomProperties); } public static int Build(string solution, string config, string loggerOutputDir, IEnumerable<string> customProperties = null) @@ -137,7 +137,7 @@ namespace GodotTools.Build private static string BuildArguments(string solution, string config, string loggerOutputDir, List<string> customProperties) { - string arguments = $@"""{solution}"" /v:normal /t:Rebuild ""/p:{"Configuration=" + config}"" " + + string arguments = $@"""{solution}"" /v:normal /t:Build ""/p:{"Configuration=" + config}"" " + $@"""/l:{typeof(GodotBuildLogger).FullName},{GodotBuildLogger.AssemblyPath};{loggerOutputDir}"""; foreach (string customProperty in customProperties) diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs index f0068385f4..4c1e47ecad 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs @@ -15,18 +15,17 @@ namespace GodotTools.Build { private static string _msbuildToolsPath = string.Empty; private static string _msbuildUnixPath = string.Empty; - private static string _xbuildUnixPath = string.Empty; public static string FindMsBuild() { var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings(); - var buildTool = (GodotSharpBuilds.BuildTool) editorSettings.GetSetting("mono/builds/build_tool"); + var buildTool = (BuildManager.BuildTool) editorSettings.GetSetting("mono/builds/build_tool"); if (OS.IsWindows()) { switch (buildTool) { - case GodotSharpBuilds.BuildTool.MsBuildVs: + case BuildManager.BuildTool.MsBuildVs: { if (_msbuildToolsPath.Empty() || !File.Exists(_msbuildToolsPath)) { @@ -35,7 +34,7 @@ namespace GodotTools.Build if (_msbuildToolsPath.Empty()) { - throw new FileNotFoundException($"Cannot find executable for '{GodotSharpBuilds.PropNameMsbuildVs}'. Tried with path: {_msbuildToolsPath}"); + throw new FileNotFoundException($"Cannot find executable for '{BuildManager.PropNameMsbuildVs}'. Tried with path: {_msbuildToolsPath}"); } } @@ -44,31 +43,17 @@ namespace GodotTools.Build return Path.Combine(_msbuildToolsPath, "MSBuild.exe"); } - - case GodotSharpBuilds.BuildTool.MsBuildMono: + case BuildManager.BuildTool.MsBuildMono: { string msbuildPath = Path.Combine(Internal.MonoWindowsInstallRoot, "bin", "msbuild.bat"); if (!File.Exists(msbuildPath)) { - throw new FileNotFoundException($"Cannot find executable for '{GodotSharpBuilds.PropNameMsbuildMono}'. Tried with path: {msbuildPath}"); + throw new FileNotFoundException($"Cannot find executable for '{BuildManager.PropNameMsbuildMono}'. Tried with path: {msbuildPath}"); } return msbuildPath; } - - case GodotSharpBuilds.BuildTool.XBuild: - { - string xbuildPath = Path.Combine(Internal.MonoWindowsInstallRoot, "bin", "xbuild.bat"); - - if (!File.Exists(xbuildPath)) - { - throw new FileNotFoundException($"Cannot find executable for '{GodotSharpBuilds.PropNameXbuild}'. Tried with path: {xbuildPath}"); - } - - return xbuildPath; - } - default: throw new IndexOutOfRangeException("Invalid build tool in editor settings"); } @@ -76,20 +61,7 @@ namespace GodotTools.Build if (OS.IsUnix()) { - if (buildTool == GodotSharpBuilds.BuildTool.XBuild) - { - if (_xbuildUnixPath.Empty() || !File.Exists(_xbuildUnixPath)) - { - // Try to search it again if it wasn't found last time or if it was removed from its location - _xbuildUnixPath = FindBuildEngineOnUnix("msbuild"); - } - - if (_xbuildUnixPath.Empty()) - { - throw new FileNotFoundException($"Cannot find binary for '{GodotSharpBuilds.PropNameXbuild}'"); - } - } - else + if (buildTool == BuildManager.BuildTool.MsBuildMono) { if (_msbuildUnixPath.Empty() || !File.Exists(_msbuildUnixPath)) { @@ -99,11 +71,15 @@ namespace GodotTools.Build if (_msbuildUnixPath.Empty()) { - throw new FileNotFoundException($"Cannot find binary for '{GodotSharpBuilds.PropNameMsbuildMono}'"); + throw new FileNotFoundException($"Cannot find binary for '{BuildManager.PropNameMsbuildMono}'"); } - } - return buildTool != GodotSharpBuilds.BuildTool.XBuild ? _msbuildUnixPath : _xbuildUnixPath; + return _msbuildUnixPath; + } + else + { + throw new IndexOutOfRangeException("Invalid build tool in editor settings"); + } } throw new PlatformNotSupportedException(); diff --git a/modules/mono/editor/GodotTools/GodotTools/MonoBuildInfo.cs b/modules/mono/editor/GodotTools/GodotTools/BuildInfo.cs index 858e852392..70bd552f2f 100644 --- a/modules/mono/editor/GodotTools/GodotTools/MonoBuildInfo.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BuildInfo.cs @@ -7,7 +7,7 @@ using Path = System.IO.Path; namespace GodotTools { [Serializable] - public sealed class MonoBuildInfo : Reference // TODO Remove Reference once we have proper serialization + public sealed class BuildInfo : Reference // TODO Remove Reference once we have proper serialization { public string Solution { get; } public string Configuration { get; } @@ -17,7 +17,7 @@ namespace GodotTools public override bool Equals(object obj) { - if (obj is MonoBuildInfo other) + if (obj is BuildInfo other) return other.Solution == Solution && other.Configuration == Configuration; return false; @@ -34,11 +34,11 @@ namespace GodotTools } } - private MonoBuildInfo() + private BuildInfo() { } - public MonoBuildInfo(string solution, string configuration) + public BuildInfo(string solution, string configuration) { Solution = solution; Configuration = configuration; diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs new file mode 100644 index 0000000000..417032da54 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs @@ -0,0 +1,259 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using GodotTools.Build; +using GodotTools.Internals; +using GodotTools.Utils; +using static GodotTools.Internals.Globals; +using File = GodotTools.Utils.File; + +namespace GodotTools +{ + public static class BuildManager + { + private static readonly List<BuildInfo> BuildsInProgress = new List<BuildInfo>(); + + public const string PropNameMsbuildMono = "MSBuild (Mono)"; + public const string PropNameMsbuildVs = "MSBuild (VS Build Tools)"; + + public const string MsBuildIssuesFileName = "msbuild_issues.csv"; + public const string MsBuildLogFileName = "msbuild_log.txt"; + + public enum BuildTool + { + MsBuildMono, + MsBuildVs + } + + private static void RemoveOldIssuesFile(BuildInfo buildInfo) + { + var issuesFile = GetIssuesFilePath(buildInfo); + + if (!File.Exists(issuesFile)) + return; + + File.Delete(issuesFile); + } + + private static void ShowBuildErrorDialog(string message) + { + GodotSharpEditor.Instance.ShowErrorDialog(message, "Build error"); + GodotSharpEditor.Instance.BottomPanel.ShowBuildTab(); + } + + public static void RestartBuild(BuildTab buildTab) => throw new NotImplementedException(); + public static void StopBuild(BuildTab buildTab) => throw new NotImplementedException(); + + private static string GetLogFilePath(BuildInfo buildInfo) + { + return Path.Combine(buildInfo.LogsDirPath, MsBuildLogFileName); + } + + private static string GetIssuesFilePath(BuildInfo buildInfo) + { + return Path.Combine(buildInfo.LogsDirPath, MsBuildIssuesFileName); + } + + private static void PrintVerbose(string text) + { + if (Godot.OS.IsStdoutVerbose()) + Godot.GD.Print(text); + } + + public static bool Build(BuildInfo buildInfo) + { + if (BuildsInProgress.Contains(buildInfo)) + throw new InvalidOperationException("A build is already in progress"); + + BuildsInProgress.Add(buildInfo); + + try + { + BuildTab buildTab = GodotSharpEditor.Instance.BottomPanel.GetBuildTabFor(buildInfo); + buildTab.OnBuildStart(); + + // Required in order to update the build tasks list + Internal.GodotMainIteration(); + + try + { + RemoveOldIssuesFile(buildInfo); + } + catch (IOException e) + { + buildTab.OnBuildExecFailed($"Cannot remove issues file: {GetIssuesFilePath(buildInfo)}"); + Console.Error.WriteLine(e); + } + + try + { + int exitCode = BuildSystem.Build(buildInfo); + + if (exitCode != 0) + PrintVerbose($"MSBuild exited with code: {exitCode}. Log file: {GetLogFilePath(buildInfo)}"); + + buildTab.OnBuildExit(exitCode == 0 ? BuildTab.BuildResults.Success : BuildTab.BuildResults.Error); + + return exitCode == 0; + } + catch (Exception e) + { + buildTab.OnBuildExecFailed($"The build method threw an exception.\n{e.GetType().FullName}: {e.Message}"); + Console.Error.WriteLine(e); + return false; + } + } + finally + { + BuildsInProgress.Remove(buildInfo); + } + } + + public static async Task<bool> BuildAsync(BuildInfo buildInfo) + { + if (BuildsInProgress.Contains(buildInfo)) + throw new InvalidOperationException("A build is already in progress"); + + BuildsInProgress.Add(buildInfo); + + try + { + BuildTab buildTab = GodotSharpEditor.Instance.BottomPanel.GetBuildTabFor(buildInfo); + + try + { + RemoveOldIssuesFile(buildInfo); + } + catch (IOException e) + { + buildTab.OnBuildExecFailed($"Cannot remove issues file: {GetIssuesFilePath(buildInfo)}"); + Console.Error.WriteLine(e); + } + + try + { + int exitCode = await BuildSystem.BuildAsync(buildInfo); + + if (exitCode != 0) + PrintVerbose($"MSBuild exited with code: {exitCode}. Log file: {GetLogFilePath(buildInfo)}"); + + buildTab.OnBuildExit(exitCode == 0 ? BuildTab.BuildResults.Success : BuildTab.BuildResults.Error); + + return exitCode == 0; + } + catch (Exception e) + { + buildTab.OnBuildExecFailed($"The build method threw an exception.\n{e.GetType().FullName}: {e.Message}"); + Console.Error.WriteLine(e); + return false; + } + } + finally + { + BuildsInProgress.Remove(buildInfo); + } + } + + public static bool BuildProjectBlocking(string config, IEnumerable<string> godotDefines) + { + if (!File.Exists(GodotSharpDirs.ProjectSlnPath)) + return true; // No solution to build + + // Make sure to update the API assemblies if they happen to be missing. Just in + // case the user decided to delete them at some point after they were loaded. + Internal.UpdateApiAssembliesFromPrebuilt(); + + var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings(); + var buildTool = (BuildTool) editorSettings.GetSetting("mono/builds/build_tool"); + + using (var pr = new EditorProgress("mono_project_debug_build", "Building project solution...", 1)) + { + pr.Step("Building project solution", 0); + + var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, config); + + // Add Godot defines + string constants = buildTool == BuildTool.MsBuildVs ? "GodotDefineConstants=\"" : "GodotDefineConstants=\\\""; + + foreach (var godotDefine in godotDefines) + constants += $"GODOT_{godotDefine.ToUpper().Replace("-", "_").Replace(" ", "_").Replace(";", "_")};"; + + if (Internal.GodotIsRealTDouble()) + constants += "GODOT_REAL_T_IS_DOUBLE;"; + + constants += buildTool == BuildTool.MsBuildVs ? "\"" : "\\\""; + + buildInfo.CustomProperties.Add(constants); + + if (!Build(buildInfo)) + { + ShowBuildErrorDialog("Failed to build project solution"); + return false; + } + } + + return true; + } + + public static bool EditorBuildCallback() + { + if (!File.Exists(GodotSharpDirs.ProjectSlnPath)) + return true; // No solution to build + + string editorScriptsMetadataPath = Path.Combine(GodotSharpDirs.ResMetadataDir, "scripts_metadata.editor"); + string playerScriptsMetadataPath = Path.Combine(GodotSharpDirs.ResMetadataDir, "scripts_metadata.editor_player"); + + CsProjOperations.GenerateScriptsMetadata(GodotSharpDirs.ProjectCsProjPath, editorScriptsMetadataPath); + + if (File.Exists(editorScriptsMetadataPath)) + File.Copy(editorScriptsMetadataPath, playerScriptsMetadataPath); + + var currentPlayRequest = GodotSharpEditor.Instance.GodotIdeManager.GodotIdeServer.CurrentPlayRequest; + + if (currentPlayRequest != null) + { + if (currentPlayRequest.Value.HasDebugger) + { + // Set the environment variable that will tell the player to connect to the IDE debugger + // TODO: We should probably add a better way to do this + Environment.SetEnvironmentVariable("GODOT_MONO_DEBUGGER_AGENT", + "--debugger-agent=transport=dt_socket" + + $",address={currentPlayRequest.Value.DebuggerHost}:{currentPlayRequest.Value.DebuggerPort}" + + ",server=n"); + } + + return true; // Requested play from an external editor/IDE which already built the project + } + + var godotDefines = new[] + { + Godot.OS.GetName(), + Internal.GodotIs32Bits() ? "32" : "64" + }; + + return BuildProjectBlocking("Tools", godotDefines); + } + + public static void Initialize() + { + // Build tool settings + + EditorDef("mono/builds/build_tool", OS.IsWindows() ? BuildTool.MsBuildVs : BuildTool.MsBuildMono); + + var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings(); + + editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary + { + ["type"] = Godot.Variant.Type.Int, + ["name"] = "mono/builds/build_tool", + ["hint"] = Godot.PropertyHint.Enum, + ["hint_string"] = OS.IsWindows() ? + $"{PropNameMsbuildMono},{PropNameMsbuildVs}" : + $"{PropNameMsbuildMono}" + }); + + EditorDef("mono/builds/print_build_output", false); + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools/MonoBuildTab.cs b/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs index 75fdacc0da..807a20d9a1 100644 --- a/modules/mono/editor/GodotTools/GodotTools/MonoBuildTab.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs @@ -7,7 +7,7 @@ using Path = System.IO.Path; namespace GodotTools { - public class MonoBuildTab : VBoxContainer + public class BuildTab : VBoxContainer { public enum BuildResults { @@ -55,47 +55,54 @@ namespace GodotTools } } - public MonoBuildInfo BuildInfo { get; private set; } + public BuildInfo BuildInfo { get; private set; } private void _LoadIssuesFromFile(string csvFile) { using (var file = new Godot.File()) { - Error openError = file.Open(csvFile, Godot.File.ModeFlags.Read); - - if (openError != Error.Ok) - return; - - while (!file.EofReached()) + try { - string[] csvColumns = file.GetCsvLine(); + Error openError = file.Open(csvFile, Godot.File.ModeFlags.Read); - if (csvColumns.Length == 1 && csvColumns[0].Empty()) + if (openError != Error.Ok) return; - if (csvColumns.Length != 7) + while (!file.EofReached()) { - GD.PushError($"Expected 7 columns, got {csvColumns.Length}"); - continue; + string[] csvColumns = file.GetCsvLine(); + + if (csvColumns.Length == 1 && csvColumns[0].Empty()) + return; + + if (csvColumns.Length != 7) + { + GD.PushError($"Expected 7 columns, got {csvColumns.Length}"); + continue; + } + + var issue = new BuildIssue + { + Warning = csvColumns[0] == "warning", + File = csvColumns[1], + Line = int.Parse(csvColumns[2]), + Column = int.Parse(csvColumns[3]), + Code = csvColumns[4], + Message = csvColumns[5], + ProjectFile = csvColumns[6] + }; + + if (issue.Warning) + WarningCount += 1; + else + ErrorCount += 1; + + issues.Add(issue); } - - var issue = new BuildIssue - { - Warning = csvColumns[0] == "warning", - File = csvColumns[1], - Line = int.Parse(csvColumns[2]), - Column = int.Parse(csvColumns[3]), - Code = csvColumns[4], - Message = csvColumns[5], - ProjectFile = csvColumns[6] - }; - - if (issue.Warning) - WarningCount += 1; - else - ErrorCount += 1; - - issues.Add(issue); + } + finally + { + file.Close(); // Disposing it is not enough. We need to call Close() } } } @@ -192,7 +199,7 @@ namespace GodotTools ErrorCount = 0; UpdateIssuesList(); - GodotSharpEditor.Instance.MonoBottomPanel.RaiseBuildTab(this); + GodotSharpEditor.Instance.BottomPanel.RaiseBuildTab(this); } public void OnBuildExit(BuildResults result) @@ -200,10 +207,10 @@ namespace GodotTools BuildExited = true; BuildResult = result; - _LoadIssuesFromFile(Path.Combine(BuildInfo.LogsDirPath, GodotSharpBuilds.MsBuildIssuesFileName)); + _LoadIssuesFromFile(Path.Combine(BuildInfo.LogsDirPath, BuildManager.MsBuildIssuesFileName)); UpdateIssuesList(); - GodotSharpEditor.Instance.MonoBottomPanel.RaiseBuildTab(this); + GodotSharpEditor.Instance.BottomPanel.RaiseBuildTab(this); } public void OnBuildExecFailed(string cause) @@ -220,7 +227,7 @@ namespace GodotTools UpdateIssuesList(); - GodotSharpEditor.Instance.MonoBottomPanel.RaiseBuildTab(this); + GodotSharpEditor.Instance.BottomPanel.RaiseBuildTab(this); } public void RestartBuild() @@ -228,7 +235,7 @@ namespace GodotTools if (!BuildExited) throw new InvalidOperationException("Build already started"); - GodotSharpBuilds.RestartBuild(this); + BuildManager.RestartBuild(this); } public void StopBuild() @@ -236,7 +243,7 @@ namespace GodotTools if (!BuildExited) throw new InvalidOperationException("Build is not in progress"); - GodotSharpBuilds.StopBuild(this); + BuildManager.StopBuild(this); } public override void _Ready() @@ -248,11 +255,11 @@ namespace GodotTools AddChild(issuesList); } - private MonoBuildTab() + private BuildTab() { } - public MonoBuildTab(MonoBuildInfo buildInfo) + public BuildTab(BuildInfo buildInfo) { BuildInfo = buildInfo; } diff --git a/modules/mono/editor/GodotTools/GodotTools/CSharpProject.cs b/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs index e216d30462..c021a9051e 100644 --- a/modules/mono/editor/GodotTools/GodotTools/CSharpProject.cs +++ b/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs @@ -1,15 +1,15 @@ using Godot; using System; -using System.Collections.Generic; using Godot.Collections; using GodotTools.Internals; using GodotTools.ProjectEditor; +using static GodotTools.Internals.Globals; using File = GodotTools.Utils.File; using Directory = GodotTools.Utils.Directory; namespace GodotTools { - public static class CSharpProject + public static class CsProjOperations { public static string GenerateGameProject(string dir, string name) { @@ -26,7 +26,7 @@ namespace GodotTools public static void AddItem(string projectPath, string itemType, string include) { - if (!(bool) Internal.GlobalDef("mono/project/auto_update_project", true)) + if (!(bool) GlobalDef("mono/project/auto_update_project", true)) return; ProjectUtils.AddItemToProjectChecked(projectPath, itemType, include); diff --git a/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs b/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs new file mode 100644 index 0000000000..4312ca0230 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs @@ -0,0 +1,11 @@ +namespace GodotTools +{ + public enum ExternalEditorId + { + None, + VisualStudio, // TODO (Windows-only) + VisualStudioForMac, // Mac-only + MonoDevelop, + VsCode + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpBuilds.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpBuilds.cs deleted file mode 100644 index 433a931941..0000000000 --- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpBuilds.cs +++ /dev/null @@ -1,396 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using GodotTools.Build; -using GodotTools.Internals; -using GodotTools.Utils; -using Error = Godot.Error; -using File = GodotTools.Utils.File; -using Directory = GodotTools.Utils.Directory; - -namespace GodotTools -{ - public static class GodotSharpBuilds - { - private static readonly List<MonoBuildInfo> BuildsInProgress = new List<MonoBuildInfo>(); - - public const string PropNameMsbuildMono = "MSBuild (Mono)"; - public const string PropNameMsbuildVs = "MSBuild (VS Build Tools)"; - public const string PropNameXbuild = "xbuild (Deprecated)"; - - public const string MsBuildIssuesFileName = "msbuild_issues.csv"; - public const string MsBuildLogFileName = "msbuild_log.txt"; - - public enum BuildTool - { - MsBuildMono, - MsBuildVs, - XBuild // Deprecated - } - - private static void RemoveOldIssuesFile(MonoBuildInfo buildInfo) - { - var issuesFile = GetIssuesFilePath(buildInfo); - - if (!File.Exists(issuesFile)) - return; - - File.Delete(issuesFile); - } - - private static string _ApiFolderName(ApiAssemblyType apiType) - { - ulong apiHash = apiType == ApiAssemblyType.Core ? - Internal.GetCoreApiHash() : - Internal.GetEditorApiHash(); - return $"{apiHash}_{BindingsGenerator.Version}_{BindingsGenerator.CsGlueVersion}"; - } - - private static void ShowBuildErrorDialog(string message) - { - GodotSharpEditor.Instance.ShowErrorDialog(message, "Build error"); - GodotSharpEditor.Instance.MonoBottomPanel.ShowBuildTab(); - } - - public static void RestartBuild(MonoBuildTab buildTab) => throw new NotImplementedException(); - public static void StopBuild(MonoBuildTab buildTab) => throw new NotImplementedException(); - - private static string GetLogFilePath(MonoBuildInfo buildInfo) - { - return Path.Combine(buildInfo.LogsDirPath, MsBuildLogFileName); - } - - private static string GetIssuesFilePath(MonoBuildInfo buildInfo) - { - return Path.Combine(Godot.ProjectSettings.LocalizePath(buildInfo.LogsDirPath), MsBuildIssuesFileName); - } - - private static void PrintVerbose(string text) - { - if (Godot.OS.IsStdoutVerbose()) - Godot.GD.Print(text); - } - - public static bool Build(MonoBuildInfo buildInfo) - { - if (BuildsInProgress.Contains(buildInfo)) - throw new InvalidOperationException("A build is already in progress"); - - BuildsInProgress.Add(buildInfo); - - try - { - MonoBuildTab buildTab = GodotSharpEditor.Instance.MonoBottomPanel.GetBuildTabFor(buildInfo); - buildTab.OnBuildStart(); - - // Required in order to update the build tasks list - Internal.GodotMainIteration(); - - try - { - RemoveOldIssuesFile(buildInfo); - } - catch (IOException e) - { - buildTab.OnBuildExecFailed($"Cannot remove issues file: {GetIssuesFilePath(buildInfo)}"); - Console.Error.WriteLine(e); - } - - try - { - int exitCode = BuildSystem.Build(buildInfo); - - if (exitCode != 0) - PrintVerbose($"MSBuild exited with code: {exitCode}. Log file: {GetLogFilePath(buildInfo)}"); - - buildTab.OnBuildExit(exitCode == 0 ? MonoBuildTab.BuildResults.Success : MonoBuildTab.BuildResults.Error); - - return exitCode == 0; - } - catch (Exception e) - { - buildTab.OnBuildExecFailed($"The build method threw an exception.\n{e.GetType().FullName}: {e.Message}"); - Console.Error.WriteLine(e); - return false; - } - } - finally - { - BuildsInProgress.Remove(buildInfo); - } - } - - public static async Task<bool> BuildAsync(MonoBuildInfo buildInfo) - { - if (BuildsInProgress.Contains(buildInfo)) - throw new InvalidOperationException("A build is already in progress"); - - BuildsInProgress.Add(buildInfo); - - try - { - MonoBuildTab buildTab = GodotSharpEditor.Instance.MonoBottomPanel.GetBuildTabFor(buildInfo); - - try - { - RemoveOldIssuesFile(buildInfo); - } - catch (IOException e) - { - buildTab.OnBuildExecFailed($"Cannot remove issues file: {GetIssuesFilePath(buildInfo)}"); - Console.Error.WriteLine(e); - } - - try - { - int exitCode = await BuildSystem.BuildAsync(buildInfo); - - if (exitCode != 0) - PrintVerbose($"MSBuild exited with code: {exitCode}. Log file: {GetLogFilePath(buildInfo)}"); - - buildTab.OnBuildExit(exitCode == 0 ? MonoBuildTab.BuildResults.Success : MonoBuildTab.BuildResults.Error); - - return exitCode == 0; - } - catch (Exception e) - { - buildTab.OnBuildExecFailed($"The build method threw an exception.\n{e.GetType().FullName}: {e.Message}"); - Console.Error.WriteLine(e); - return false; - } - } - finally - { - BuildsInProgress.Remove(buildInfo); - } - } - - public static bool BuildApiSolution(string apiSlnDir, string config) - { - string apiSlnFile = Path.Combine(apiSlnDir, $"{ApiAssemblyNames.SolutionName}.sln"); - - string coreApiAssemblyDir = Path.Combine(apiSlnDir, ApiAssemblyNames.Core, "bin", config); - string coreApiAssemblyFile = Path.Combine(coreApiAssemblyDir, $"{ApiAssemblyNames.Core}.dll"); - - string editorApiAssemblyDir = Path.Combine(apiSlnDir, ApiAssemblyNames.Editor, "bin", config); - string editorApiAssemblyFile = Path.Combine(editorApiAssemblyDir, $"{ApiAssemblyNames.Editor}.dll"); - - if (File.Exists(coreApiAssemblyFile) && File.Exists(editorApiAssemblyFile)) - return true; // The assemblies are in the output folder; assume the solution is already built - - var apiBuildInfo = new MonoBuildInfo(apiSlnFile, config); - - // TODO Replace this global NoWarn with '#pragma warning' directives on generated files, - // once we start to actively document manually maintained C# classes - apiBuildInfo.CustomProperties.Add("NoWarn=1591"); // Ignore missing documentation warnings - - if (Build(apiBuildInfo)) - return true; - - ShowBuildErrorDialog($"Failed to build {ApiAssemblyNames.SolutionName} solution."); - return false; - } - - private static bool CopyApiAssembly(string srcDir, string dstDir, string assemblyName, ApiAssemblyType apiType) - { - // Create destination directory if needed - if (!Directory.Exists(dstDir)) - { - try - { - Directory.CreateDirectory(dstDir); - } - catch (IOException e) - { - ShowBuildErrorDialog($"Failed to create destination directory for the API assemblies. Exception message: {e.Message}"); - return false; - } - } - - string assemblyFile = assemblyName + ".dll"; - string assemblySrc = Path.Combine(srcDir, assemblyFile); - string assemblyDst = Path.Combine(dstDir, assemblyFile); - - if (!File.Exists(assemblyDst) || File.GetLastWriteTime(assemblySrc) > File.GetLastWriteTime(assemblyDst) || - Internal.MetadataIsApiAssemblyInvalidated(apiType)) - { - string xmlFile = $"{assemblyName}.xml"; - string pdbFile = $"{assemblyName}.pdb"; - - try - { - File.Copy(Path.Combine(srcDir, xmlFile), Path.Combine(dstDir, xmlFile)); - } - catch (IOException e) - { - Godot.GD.PushWarning(e.ToString()); - } - - try - { - File.Copy(Path.Combine(srcDir, pdbFile), Path.Combine(dstDir, pdbFile)); - } - catch (IOException e) - { - Godot.GD.PushWarning(e.ToString()); - } - - try - { - File.Copy(assemblySrc, assemblyDst); - } - catch (IOException e) - { - ShowBuildErrorDialog($"Failed to copy {assemblyFile}. Exception message: {e.Message}"); - return false; - } - - Internal.MetadataSetApiAssemblyInvalidated(apiType, false); - } - - return true; - } - - public static bool MakeApiAssembly(ApiAssemblyType apiType, string config) - { - string apiName = apiType == ApiAssemblyType.Core ? ApiAssemblyNames.Core : ApiAssemblyNames.Editor; - - string editorPrebuiltApiDir = Path.Combine(GodotSharpDirs.DataEditorPrebuiltApiDir, config); - string resAssembliesDir = Path.Combine(GodotSharpDirs.ResAssembliesBaseDir, config); - - if (File.Exists(Path.Combine(editorPrebuiltApiDir, $"{apiName}.dll"))) - { - using (var copyProgress = new EditorProgress("mono_copy_prebuilt_api_assembly", $"Copying prebuilt {apiName} assembly...", 1)) - { - copyProgress.Step($"Copying {apiName} assembly", 0); - return CopyApiAssembly(editorPrebuiltApiDir, resAssembliesDir, apiName, apiType); - } - } - - const string apiSolutionName = ApiAssemblyNames.SolutionName; - - using (var pr = new EditorProgress($"mono_build_release_{apiSolutionName}", $"Building {apiSolutionName} solution...", 3)) - { - pr.Step($"Generating {apiSolutionName} solution", 0); - - string apiSlnDir = Path.Combine(GodotSharpDirs.MonoSolutionsDir, _ApiFolderName(ApiAssemblyType.Core)); - string apiSlnFile = Path.Combine(apiSlnDir, $"{apiSolutionName}.sln"); - - if (!Directory.Exists(apiSlnDir) || !File.Exists(apiSlnFile)) - { - var bindingsGenerator = new BindingsGenerator(); - - if (!Godot.OS.IsStdoutVerbose()) - bindingsGenerator.LogPrintEnabled = false; - - Error err = bindingsGenerator.GenerateCsApi(apiSlnDir); - if (err != Error.Ok) - { - ShowBuildErrorDialog($"Failed to generate {apiSolutionName} solution. Error: {err}"); - return false; - } - } - - pr.Step($"Building {apiSolutionName} solution", 1); - - if (!BuildApiSolution(apiSlnDir, config)) - return false; - - pr.Step($"Copying {apiName} assembly", 2); - - // Copy the built assembly to the assemblies directory - string apiAssemblyDir = Path.Combine(apiSlnDir, apiName, "bin", config); - if (!CopyApiAssembly(apiAssemblyDir, resAssembliesDir, apiName, apiType)) - return false; - } - - return true; - } - - public static bool BuildProjectBlocking(string config, IEnumerable<string> godotDefines) - { - if (!File.Exists(GodotSharpDirs.ProjectSlnPath)) - return true; // No solution to build - - string apiConfig = config == "Release" ? "Release" : "Debug"; - - if (!MakeApiAssembly(ApiAssemblyType.Core, apiConfig)) - return false; - - if (!MakeApiAssembly(ApiAssemblyType.Editor, apiConfig)) - return false; - - using (var pr = new EditorProgress("mono_project_debug_build", "Building project solution...", 1)) - { - pr.Step("Building project solution", 0); - - var buildInfo = new MonoBuildInfo(GodotSharpDirs.ProjectSlnPath, config); - - // Add Godot defines - string constants = OS.IsWindows() ? "GodotDefineConstants=\"" : "GodotDefineConstants=\\\""; - - foreach (var godotDefine in godotDefines) - constants += $"GODOT_{godotDefine.ToUpper().Replace("-", "_").Replace(" ", "_").Replace(";", "_")};"; - - if (Internal.GodotIsRealTDouble()) - constants += "GODOT_REAL_T_IS_DOUBLE;"; - - constants += OS.IsWindows() ? "\"" : "\\\""; - - buildInfo.CustomProperties.Add(constants); - - if (!Build(buildInfo)) - { - ShowBuildErrorDialog("Failed to build project solution"); - return false; - } - } - - return true; - } - - public static bool EditorBuildCallback() - { - if (!File.Exists(GodotSharpDirs.ProjectSlnPath)) - return true; // No solution to build - - string editorScriptsMetadataPath = Path.Combine(GodotSharpDirs.ResMetadataDir, "scripts_metadata.editor"); - string playerScriptsMetadataPath = Path.Combine(GodotSharpDirs.ResMetadataDir, "scripts_metadata.editor_player"); - - CSharpProject.GenerateScriptsMetadata(GodotSharpDirs.ProjectCsProjPath, editorScriptsMetadataPath); - - if (File.Exists(editorScriptsMetadataPath)) - File.Copy(editorScriptsMetadataPath, playerScriptsMetadataPath); - - var godotDefines = new[] - { - Godot.OS.GetName(), - Internal.GodotIs32Bits() ? "32" : "64" - }; - - return BuildProjectBlocking("Tools", godotDefines); - } - - public static void Initialize() - { - // Build tool settings - - Internal.EditorDef("mono/builds/build_tool", OS.IsWindows() ? BuildTool.MsBuildVs : BuildTool.MsBuildMono); - - var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings(); - - editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary - { - ["type"] = Godot.Variant.Type.Int, - ["name"] = "mono/builds/build_tool", - ["hint"] = Godot.PropertyHint.Enum, - ["hint_string"] = OS.IsWindows() ? - $"{PropNameMsbuildMono},{PropNameMsbuildVs},{PropNameXbuild}" : - $"{PropNameMsbuildMono},{PropNameXbuild}" - }); - - Internal.EditorDef("mono/builds/print_build_output", false); - } - } -} diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs index da439b8d6f..099c7fcb56 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs +++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs @@ -2,15 +2,18 @@ using Godot; using GodotTools.Utils; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; +using GodotTools.Ides; using GodotTools.Internals; using GodotTools.ProjectEditor; +using static GodotTools.Internals.Globals; using File = GodotTools.Utils.File; -using Path = System.IO.Path; using OS = GodotTools.Utils.OS; namespace GodotTools { + [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] public class GodotSharpEditor : EditorPlugin, ISerializationListener { private EditorSettings editorSettings; @@ -23,18 +26,17 @@ namespace GodotTools private ToolButton bottomPanelBtn; - private MonoDevelopInstance monoDevelopInstance; - private MonoDevelopInstance visualStudioForMacInstance; + public GodotIdeManager GodotIdeManager { get; private set; } - private WeakReference<GodotSharpExport> exportPluginWeak; + private WeakRef exportPluginWeak; // TODO Use WeakReference once we have proper serialization - public MonoBottomPanel MonoBottomPanel { get; private set; } + public BottomPanel BottomPanel { get; private set; } private bool CreateProjectSolution() { - using (var pr = new EditorProgress("create_csharp_solution", "Generating solution...", 2)) // TTR("Generating solution...") + using (var pr = new EditorProgress("create_csharp_solution", "Generating solution...".TTR(), 2)) { - pr.Step("Generating C# project..."); // TTR("Generating C# project...") + pr.Step("Generating C# project...".TTR()); string resourceDir = ProjectSettings.GlobalizePath("res://"); @@ -43,7 +45,7 @@ namespace GodotTools if (name.Empty()) name = "UnnamedProject"; - string guid = CSharpProject.GenerateGameProject(path, name); + string guid = CsProjOperations.GenerateGameProject(path, name); if (guid.Length > 0) { @@ -67,96 +69,28 @@ namespace GodotTools } catch (IOException e) { - ShowErrorDialog($"Failed to save solution. Exception message: {e.Message}"); // TTR + ShowErrorDialog("Failed to save solution. Exception message: ".TTR() + e.Message); return false; } - string apiConfig = "Debug"; + // Make sure to update the API assemblies if they happen to be missing. Just in + // case the user decided to delete them at some point after they were loaded. + Internal.UpdateApiAssembliesFromPrebuilt(); - if (!GodotSharpBuilds.MakeApiAssembly(ApiAssemblyType.Core, apiConfig)) - return false; - - if (!GodotSharpBuilds.MakeApiAssembly(ApiAssemblyType.Editor, apiConfig)) - return false; - - pr.Step("Done"); // TTR("Done") + pr.Step("Done".TTR()); // Here, after all calls to progress_task_step CallDeferred(nameof(_RemoveCreateSlnMenuOption)); } else { - ShowErrorDialog("Failed to create C# project."); // TTR + ShowErrorDialog("Failed to create C# project.".TTR()); } return true; } } - private static int _makeApiSolutionsAttempts = 100; - private static bool _makeApiSolutionsRecursionGuard = false; - - private void _MakeApiSolutionsIfNeeded() - { - // I'm sick entirely of ProgressDialog - - if (Internal.IsMessageQueueFlushing() || Engine.GetMainLoop() == null) - { - if (_makeApiSolutionsAttempts == 0) // This better never happen or I swear... - throw new TimeoutException(); - - if (Engine.GetMainLoop() != null) - { - if (!Engine.GetMainLoop().IsConnected("idle_frame", this, nameof(_MakeApiSolutionsIfNeeded))) - Engine.GetMainLoop().Connect("idle_frame", this, nameof(_MakeApiSolutionsIfNeeded)); - } - else - { - CallDeferred(nameof(_MakeApiSolutionsIfNeededImpl)); - } - - _makeApiSolutionsAttempts--; - return; - } - - // Recursion guard needed because signals don't play well with ProgressDialog either, but unlike - // the message queue, with signals the collateral damage should be minimal in the worst case. - if (!_makeApiSolutionsRecursionGuard) - { - _makeApiSolutionsRecursionGuard = true; - - // Oneshot signals don't play well with ProgressDialog either, so we do it this way instead - if (Engine.GetMainLoop().IsConnected("idle_frame", this, nameof(_MakeApiSolutionsIfNeeded))) - Engine.GetMainLoop().Disconnect("idle_frame", this, nameof(_MakeApiSolutionsIfNeeded)); - - _MakeApiSolutionsIfNeededImpl(); - - _makeApiSolutionsRecursionGuard = false; - } - } - - private void _MakeApiSolutionsIfNeededImpl() - { - // If the project has a solution and C# project make sure the API assemblies are present and up to date - - string api_config = "Debug"; - string resAssembliesDir = Path.Combine(GodotSharpDirs.ResAssembliesBaseDir, api_config); - - if (!File.Exists(Path.Combine(resAssembliesDir, $"{ApiAssemblyNames.Core}.dll")) || - Internal.MetadataIsApiAssemblyInvalidated(ApiAssemblyType.Core)) - { - if (!GodotSharpBuilds.MakeApiAssembly(ApiAssemblyType.Core, api_config)) - return; - } - - if (!File.Exists(Path.Combine(resAssembliesDir, $"{ApiAssemblyNames.Editor}.dll")) || - Internal.MetadataIsApiAssemblyInvalidated(ApiAssemblyType.Editor)) - { - if (!GodotSharpBuilds.MakeApiAssembly(ApiAssemblyType.Editor, api_config)) - return; // Redundant? I don't think so! - } - } - private void _RemoveCreateSlnMenuOption() { menuPopup.RemoveItem(menuPopup.GetItemIndex((int) MenuOptions.CreateSln)); @@ -200,7 +134,7 @@ namespace GodotTools return; // Failed to create solution } - Instance.MonoBottomPanel.BuildProjectPressed(); + Instance.BottomPanel.BuildProjectPressed(); } public override void _Notification(int what) @@ -220,21 +154,12 @@ namespace GodotTools } } - public enum MenuOptions + private enum MenuOptions { CreateSln, AboutCSharp, } - public enum ExternalEditor - { - None, - VisualStudio, // TODO (Windows-only) - VisualStudioForMac, // Mac-only - MonoDevelop, - VsCode - } - public void ShowErrorDialog(string message, string title = "Error") { errorDialog.WindowTitle = title; @@ -251,11 +176,30 @@ namespace GodotTools public Error OpenInExternalEditor(Script script, int line, int col) { - var editor = (ExternalEditor) editorSettings.GetSetting("mono/editor/external_editor"); + var editor = (ExternalEditorId) editorSettings.GetSetting("mono/editor/external_editor"); switch (editor) { - case ExternalEditor.VsCode: + case ExternalEditorId.None: + // Tells the caller to fallback to the global external editor settings or the built-in editor + return Error.Unavailable; + case ExternalEditorId.VisualStudio: + throw new NotSupportedException(); + case ExternalEditorId.VisualStudioForMac: + goto case ExternalEditorId.MonoDevelop; + case ExternalEditorId.MonoDevelop: + { + string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); + + if (line >= 0) + GodotIdeManager.SendOpenFile(scriptPath, line + 1, col); + else + GodotIdeManager.SendOpenFile(scriptPath); + + break; + } + + case ExternalEditorId.VsCode: { if (_vsCodePath.Empty() || !File.Exists(_vsCodePath)) { @@ -340,38 +284,6 @@ namespace GodotTools break; } - case ExternalEditor.VisualStudioForMac: - goto case ExternalEditor.MonoDevelop; - case ExternalEditor.MonoDevelop: - { - MonoDevelopInstance GetMonoDevelopInstance(string solutionPath) - { - if (OS.IsOSX() && editor == ExternalEditor.VisualStudioForMac) - { - if (visualStudioForMacInstance == null) - visualStudioForMacInstance = new MonoDevelopInstance(solutionPath, MonoDevelopInstance.EditorId.VisualStudioForMac); - - return visualStudioForMacInstance; - } - - if (monoDevelopInstance == null) - monoDevelopInstance = new MonoDevelopInstance(solutionPath, MonoDevelopInstance.EditorId.MonoDevelop); - - return monoDevelopInstance; - } - - string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); - - if (line >= 0) - scriptPath += $";{line + 1};{col}"; - - GetMonoDevelopInstance(GodotSharpDirs.ProjectSlnPath).Execute(scriptPath); - - break; - } - - case ExternalEditor.None: - return Error.Unavailable; default: throw new ArgumentOutOfRangeException(); } @@ -381,12 +293,12 @@ namespace GodotTools public bool OverridesExternalEditor() { - return (ExternalEditor) editorSettings.GetSetting("mono/editor/external_editor") != ExternalEditor.None; + return (ExternalEditorId) editorSettings.GetSetting("mono/editor/external_editor") != ExternalEditorId.None; } public override bool Build() { - return GodotSharpBuilds.EditorBuildCallback(); + return BuildManager.EditorBuildCallback(); } public override void EnablePlugin() @@ -405,9 +317,9 @@ namespace GodotTools errorDialog = new AcceptDialog(); editorBaseControl.AddChild(errorDialog); - MonoBottomPanel = new MonoBottomPanel(); + BottomPanel = new BottomPanel(); - bottomPanelBtn = AddControlToBottomPanel(MonoBottomPanel, "Mono"); // TTR("Mono") + bottomPanelBtn = AddControlToBottomPanel(BottomPanel, "Mono".TTR()); AddChild(new HotReloadAssemblyWatcher {Name = "HotReloadAssemblyWatcher"}); @@ -419,7 +331,7 @@ namespace GodotTools // TODO: Remove or edit this info dialog once Mono support is no longer in alpha { - menuPopup.AddItem("About C# support", (int) MenuOptions.AboutCSharp); // TTR("About C# support") + menuPopup.AddItem("About C# support".TTR(), (int) MenuOptions.AboutCSharp); aboutDialog = new AcceptDialog(); editorBaseControl.AddChild(aboutDialog); aboutDialog.WindowTitle = "Important: C# support is not feature-complete"; @@ -441,7 +353,7 @@ namespace GodotTools var aboutLabel = new Label(); aboutHBox.AddChild(aboutLabel); - aboutLabel.RectMinSize = new Vector2(600, 150) * Internal.EditorScale; + aboutLabel.RectMinSize = new Vector2(600, 150) * EditorScale; aboutLabel.SizeFlagsVertical = (int) Control.SizeFlags.ExpandFill; aboutLabel.Autowrap = true; aboutLabel.Text = @@ -454,7 +366,7 @@ namespace GodotTools " https://github.com/godotengine/godot/issues\n\n" + "Your critical feedback at this stage will play a great role in shaping the C# support in future releases, so thank you!"; - Internal.EditorDef("mono/editor/show_info_on_start", true); + EditorDef("mono/editor/show_info_on_start", true); // CheckBox in main container aboutDialogCheckBox = new CheckBox {Text = "Show this warning when starting the editor"}; @@ -464,16 +376,13 @@ namespace GodotTools if (File.Exists(GodotSharpDirs.ProjectSlnPath) && File.Exists(GodotSharpDirs.ProjectCsProjPath)) { - // Defer this task because EditorProgress calls Main::iterarion() and the main loop is not yet initialized. - CallDeferred(nameof(_MakeApiSolutionsIfNeeded)); - // Make sure the existing project has Api assembly references configured correctly - CSharpProject.FixApiHintPath(GodotSharpDirs.ProjectCsProjPath); + CsProjOperations.FixApiHintPath(GodotSharpDirs.ProjectCsProjPath); } else { bottomPanelBtn.Hide(); - menuPopup.AddItem("Create C# solution", (int) MenuOptions.CreateSln); // TTR("Create C# solution") + menuPopup.AddItem("Create C# solution".TTR(), (int) MenuOptions.CreateSln); } menuPopup.Connect("id_pressed", this, nameof(_MenuOptionPressed)); @@ -488,25 +397,25 @@ namespace GodotTools AddControlToContainer(CustomControlContainer.Toolbar, buildButton); // External editor settings - Internal.EditorDef("mono/editor/external_editor", ExternalEditor.None); + EditorDef("mono/editor/external_editor", ExternalEditorId.None); string settingsHintStr = "Disabled"; if (OS.IsWindows()) { - settingsHintStr += $",MonoDevelop:{(int) ExternalEditor.MonoDevelop}" + - $",Visual Studio Code:{(int) ExternalEditor.VsCode}"; + settingsHintStr += $",MonoDevelop:{(int) ExternalEditorId.MonoDevelop}" + + $",Visual Studio Code:{(int) ExternalEditorId.VsCode}"; } else if (OS.IsOSX()) { - settingsHintStr += $",Visual Studio:{(int) ExternalEditor.VisualStudioForMac}" + - $",MonoDevelop:{(int) ExternalEditor.MonoDevelop}" + - $",Visual Studio Code:{(int) ExternalEditor.VsCode}"; + settingsHintStr += $",Visual Studio:{(int) ExternalEditorId.VisualStudioForMac}" + + $",MonoDevelop:{(int) ExternalEditorId.MonoDevelop}" + + $",Visual Studio Code:{(int) ExternalEditorId.VsCode}"; } else if (OS.IsUnix()) { - settingsHintStr += $",MonoDevelop:{(int) ExternalEditor.MonoDevelop}" + - $",Visual Studio Code:{(int) ExternalEditor.VsCode}"; + settingsHintStr += $",MonoDevelop:{(int) ExternalEditorId.MonoDevelop}" + + $",Visual Studio Code:{(int) ExternalEditorId.VsCode}"; } editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary @@ -520,23 +429,30 @@ namespace GodotTools // Export plugin var exportPlugin = new GodotSharpExport(); AddExportPlugin(exportPlugin); - exportPluginWeak = new WeakReference<GodotSharpExport>(exportPlugin); + exportPluginWeak = WeakRef(exportPlugin); + + BuildManager.Initialize(); - GodotSharpBuilds.Initialize(); + GodotIdeManager = new GodotIdeManager(); + AddChild(GodotIdeManager); } protected override void Dispose(bool disposing) { base.Dispose(disposing); - if (exportPluginWeak.TryGetTarget(out var exportPlugin)) + if (exportPluginWeak != null) { // We need to dispose our export plugin before the editor destroys EditorSettings. // Otherwise, if the GC disposes it at a later time, EditorExportPlatformAndroid // will be freed after EditorSettings already was, and its device polling thread // will try to access the EditorSettings singleton, resulting in null dereferencing. - exportPlugin.Dispose(); + (exportPluginWeak.GetRef() as GodotSharpExport)?.Dispose(); + + exportPluginWeak.Dispose(); } + + GodotIdeManager?.Dispose(); } public void OnBeforeSerialize() diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpExport.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpExport.cs index b80fe1fab7..aefc51545e 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpExport.cs +++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpExport.cs @@ -65,14 +65,14 @@ namespace GodotTools string buildConfig = isDebug ? "Debug" : "Release"; string scriptsMetadataPath = Path.Combine(GodotSharpDirs.ResMetadataDir, $"scripts_metadata.{(isDebug ? "debug" : "release")}"); - CSharpProject.GenerateScriptsMetadata(GodotSharpDirs.ProjectCsProjPath, scriptsMetadataPath); + CsProjOperations.GenerateScriptsMetadata(GodotSharpDirs.ProjectCsProjPath, scriptsMetadataPath); AddFile(scriptsMetadataPath, scriptsMetadataPath); // Turn export features into defines var godotDefines = features; - if (!GodotSharpBuilds.BuildProjectBlocking(buildConfig, godotDefines)) + if (!BuildManager.BuildProjectBlocking(buildConfig, godotDefines)) { GD.PushError("Failed to build project"); return; diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj index a0ff8a0df1..e2d576caef 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj +++ b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj @@ -39,25 +39,31 @@ </ItemGroup> <ItemGroup> <Compile Include="Build\MsBuildFinder.cs" /> + <Compile Include="ExternalEditorId.cs" /> + <Compile Include="Ides\GodotIdeManager.cs" /> + <Compile Include="Ides\GodotIdeServer.cs" /> + <Compile Include="Ides\MonoDevelop\EditorId.cs" /> + <Compile Include="Ides\MonoDevelop\Instance.cs" /> <Compile Include="Internals\BindingsGenerator.cs" /> <Compile Include="Internals\EditorProgress.cs" /> <Compile Include="Internals\GodotSharpDirs.cs" /> <Compile Include="Internals\Internal.cs" /> <Compile Include="Internals\ScriptClassParser.cs" /> - <Compile Include="MonoDevelopInstance.cs" /> + <Compile Include="Internals\Globals.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Build\BuildSystem.cs" /> <Compile Include="Utils\Directory.cs" /> <Compile Include="Utils\File.cs" /> + <Compile Include="Utils\NotifyAwaiter.cs" /> <Compile Include="Utils\OS.cs" /> <Compile Include="GodotSharpEditor.cs" /> - <Compile Include="GodotSharpBuilds.cs" /> + <Compile Include="BuildManager.cs" /> <Compile Include="HotReloadAssemblyWatcher.cs" /> - <Compile Include="MonoBuildInfo.cs" /> - <Compile Include="MonoBuildTab.cs" /> - <Compile Include="MonoBottomPanel.cs" /> + <Compile Include="BuildInfo.cs" /> + <Compile Include="BuildTab.cs" /> + <Compile Include="BottomPanel.cs" /> <Compile Include="GodotSharpExport.cs" /> - <Compile Include="CSharpProject.cs" /> + <Compile Include="CsProjOperations.cs" /> <Compile Include="Utils\CollectionExtensions.cs" /> </ItemGroup> <ItemGroup> @@ -65,6 +71,10 @@ <Project>{6ce9a984-37b1-4f8a-8fe9-609f05f071b3}</Project> <Name>GodotTools.BuildLogger</Name> </ProjectReference> + <ProjectReference Include="..\GodotTools.IdeConnection\GodotTools.IdeConnection.csproj"> + <Project>{92600954-25f0-4291-8e11-1fee9fc4be20}</Project> + <Name>GodotTools.IdeConnection</Name> + </ProjectReference> <ProjectReference Include="..\GodotTools.ProjectEditor\GodotTools.ProjectEditor.csproj"> <Project>{A8CDAD94-C6D4-4B19-A7E7-76C53CC92984}</Project> <Name>GodotTools.ProjectEditor</Name> @@ -74,8 +84,5 @@ <Name>GodotTools.Core</Name> </ProjectReference> </ItemGroup> - <ItemGroup> - <Folder Include="Editor" /> - </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs b/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs index aa52079cf4..0f6f5ffadc 100644 --- a/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs +++ b/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs @@ -1,5 +1,6 @@ using Godot; using GodotTools.Internals; +using static GodotTools.Internals.Globals; namespace GodotTools { @@ -37,7 +38,7 @@ namespace GodotTools watchTimer = new Timer { OneShot = false, - WaitTime = (float) Internal.EditorDef("mono/assembly_watch_interval_sec", 0.5) + WaitTime = (float) EditorDef("mono/assembly_watch_interval_sec", 0.5) }; watchTimer.Connect("timeout", this, nameof(TimerTimeout)); AddChild(watchTimer); diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs new file mode 100644 index 0000000000..9e24138143 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs @@ -0,0 +1,166 @@ +using System; +using System.IO; +using Godot; +using GodotTools.IdeConnection; +using GodotTools.Internals; + +namespace GodotTools.Ides +{ + public class GodotIdeManager : Node, ISerializationListener + { + public GodotIdeServer GodotIdeServer { get; private set; } + + private MonoDevelop.Instance monoDevelInstance; + private MonoDevelop.Instance vsForMacInstance; + + private GodotIdeServer GetRunningServer() + { + if (GodotIdeServer != null && !GodotIdeServer.IsDisposed) + return GodotIdeServer; + StartServer(); + return GodotIdeServer; + } + + public override void _Ready() + { + StartServer(); + } + + public void OnBeforeSerialize() + { + GodotIdeServer?.Dispose(); + } + + public void OnAfterDeserialize() + { + StartServer(); + } + + private ILogger logger; + + protected ILogger Logger + { + get => logger ?? (logger = new ConsoleLogger()); + set => logger = value; + } + + private void StartServer() + { + GodotIdeServer?.Dispose(); + GodotIdeServer = new GodotIdeServer(LaunchIde, + OS.GetExecutablePath(), + ProjectSettings.GlobalizePath(GodotSharpDirs.ResMetadataDir)); + + GodotIdeServer.Logger = Logger; + + GodotIdeServer.StartServer(); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + GodotIdeServer?.Dispose(); + } + + private void LaunchIde() + { + var editor = (ExternalEditorId) GodotSharpEditor.Instance.GetEditorInterface() + .GetEditorSettings().GetSetting("mono/editor/external_editor"); + + switch (editor) + { + case ExternalEditorId.None: + case ExternalEditorId.VisualStudio: + case ExternalEditorId.VsCode: + throw new NotSupportedException(); + case ExternalEditorId.VisualStudioForMac: + goto case ExternalEditorId.MonoDevelop; + case ExternalEditorId.MonoDevelop: + { + MonoDevelop.Instance GetMonoDevelopInstance(string solutionPath) + { + if (Utils.OS.IsOSX() && editor == ExternalEditorId.VisualStudioForMac) + { + vsForMacInstance = vsForMacInstance ?? + new MonoDevelop.Instance(solutionPath, MonoDevelop.EditorId.VisualStudioForMac); + return vsForMacInstance; + } + + monoDevelInstance = monoDevelInstance ?? + new MonoDevelop.Instance(solutionPath, MonoDevelop.EditorId.MonoDevelop); + return monoDevelInstance; + } + + try + { + var instance = GetMonoDevelopInstance(GodotSharpDirs.ProjectSlnPath); + + if (!instance.IsRunning) + instance.Execute(); + } + catch (FileNotFoundException) + { + string editorName = editor == ExternalEditorId.VisualStudioForMac ? "Visual Studio" : "MonoDevelop"; + GD.PushError($"Cannot find code editor: {editorName}"); + } + + break; + } + + default: + throw new ArgumentOutOfRangeException(); + } + } + + private void WriteMessage(string id, params string[] arguments) + { + GetRunningServer().WriteMessage(new Message(id, arguments)); + } + + public void SendOpenFile(string file) + { + WriteMessage("OpenFile", file); + } + + public void SendOpenFile(string file, int line) + { + WriteMessage("OpenFile", file, line.ToString()); + } + + public void SendOpenFile(string file, int line, int column) + { + WriteMessage("OpenFile", file, line.ToString(), column.ToString()); + } + + private class GodotLogger : ILogger + { + public void LogDebug(string message) + { + if (OS.IsStdoutVerbose()) + Console.WriteLine(message); + } + + public void LogInfo(string message) + { + if (OS.IsStdoutVerbose()) + Console.WriteLine(message); + } + + public void LogWarning(string message) + { + GD.PushWarning(message); + } + + public void LogError(string message) + { + GD.PushError(message); + } + + public void LogError(string message, Exception e) + { + GD.PushError(message + "\n" + e); + } + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeServer.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeServer.cs new file mode 100644 index 0000000000..309b917c71 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeServer.cs @@ -0,0 +1,212 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using GodotTools.IdeConnection; +using GodotTools.Internals; +using GodotTools.Utils; +using Directory = System.IO.Directory; +using File = System.IO.File; +using Thread = System.Threading.Thread; + +namespace GodotTools.Ides +{ + public class GodotIdeServer : GodotIdeBase + { + private readonly TcpListener listener; + private readonly FileStream metaFile; + private readonly Action launchIdeAction; + private readonly NotifyAwaiter<bool> clientConnectedAwaiter = new NotifyAwaiter<bool>(); + + private async Task<bool> AwaitClientConnected() + { + return await clientConnectedAwaiter.Reset(); + } + + public GodotIdeServer(Action launchIdeAction, string editorExecutablePath, string projectMetadataDir) + : base(projectMetadataDir) + { + messageHandlers = InitializeMessageHandlers(); + + this.launchIdeAction = launchIdeAction; + + // Make sure the directory exists + Directory.CreateDirectory(projectMetadataDir); + + // The Godot editor's file system thread can keep the file open for writing, so we are forced to allow write sharing... + const FileShare metaFileShare = FileShare.ReadWrite; + + metaFile = File.Open(MetaFilePath, FileMode.Create, FileAccess.Write, metaFileShare); + + listener = new TcpListener(new IPEndPoint(IPAddress.Loopback, port: 0)); + listener.Start(); + + int port = ((IPEndPoint) listener.Server.LocalEndPoint).Port; + using (var metaFileWriter = new StreamWriter(metaFile, Encoding.UTF8)) + { + metaFileWriter.WriteLine(port); + metaFileWriter.WriteLine(editorExecutablePath); + } + + StartServer(); + } + + public void StartServer() + { + var serverThread = new Thread(RunServerThread) {Name = "Godot Ide Connection Server"}; + serverThread.Start(); + } + + private void RunServerThread() + { + SynchronizationContext.SetSynchronizationContext(Godot.Dispatcher.SynchronizationContext); + + try + { + while (!IsDisposed) + { + TcpClient tcpClient = listener.AcceptTcpClient(); + + Logger.LogInfo("Connection open with Ide Client"); + + lock (ConnectionLock) + { + Connection = new GodotIdeConnectionServer(tcpClient, HandleMessage); + Connection.Logger = Logger; + } + + Connected += () => clientConnectedAwaiter.SetResult(true); + + Connection.Start(); + } + } + catch (Exception e) + { + if (!IsDisposed && !(e is SocketException se && se.SocketErrorCode == SocketError.Interrupted)) + throw; + } + } + + public async void WriteMessage(Message message) + { + async Task LaunchIde() + { + if (IsConnected) + return; + + launchIdeAction(); + await Task.WhenAny(Task.Delay(10000), AwaitClientConnected()); + } + + await LaunchIde(); + + if (!IsConnected) + { + Logger.LogError("Cannot write message: Godot Ide Server not connected"); + return; + } + + Connection.WriteMessage(message); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (disposing) + { + listener?.Stop(); + + metaFile?.Dispose(); + + File.Delete(MetaFilePath); + } + } + + protected virtual bool HandleMessage(Message message) + { + if (messageHandlers.TryGetValue(message.Id, out var action)) + { + action(message.Arguments); + return true; + } + + return false; + } + + private readonly Dictionary<string, Action<string[]>> messageHandlers; + + private Dictionary<string, Action<string[]>> InitializeMessageHandlers() + { + return new Dictionary<string, Action<string[]>> + { + ["Play"] = args => + { + switch (args.Length) + { + case 0: + Play(); + return; + case 2: + Play(debuggerHost: args[0], debuggerPort: int.Parse(args[1])); + return; + default: + throw new ArgumentException(); + } + }, + ["ReloadScripts"] = args => ReloadScripts() + }; + } + + private void DispatchToMainThread(Action action) + { + var d = new SendOrPostCallback(state => action()); + Godot.Dispatcher.SynchronizationContext.Post(d, null); + } + + private void Play() + { + DispatchToMainThread(() => + { + CurrentPlayRequest = new PlayRequest(); + Internal.EditorRunPlay(); + CurrentPlayRequest = null; + }); + } + + private void Play(string debuggerHost, int debuggerPort) + { + DispatchToMainThread(() => + { + CurrentPlayRequest = new PlayRequest(debuggerHost, debuggerPort); + Internal.EditorRunPlay(); + CurrentPlayRequest = null; + }); + } + + private void ReloadScripts() + { + DispatchToMainThread(Internal.ScriptEditorDebugger_ReloadScripts); + } + + public PlayRequest? CurrentPlayRequest { get; private set; } + + public struct PlayRequest + { + public bool HasDebugger { get; } + public string DebuggerHost { get; } + public int DebuggerPort { get; } + + public PlayRequest(string debuggerHost, int debuggerPort) + { + HasDebugger = true; + DebuggerHost = debuggerHost; + DebuggerPort = debuggerPort; + } + } + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/EditorId.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/EditorId.cs new file mode 100644 index 0000000000..1dfc91d6d1 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/EditorId.cs @@ -0,0 +1,8 @@ +namespace GodotTools.Ides.MonoDevelop +{ + public enum EditorId + { + MonoDevelop = 0, + VisualStudioForMac = 1 + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools/MonoDevelopInstance.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs index 0c8d86e799..1fdccf5bbd 100644 --- a/modules/mono/editor/GodotTools/GodotTools/MonoDevelopInstance.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs @@ -1,26 +1,22 @@ -using GodotTools.Core; using System; using System.IO; using System.Collections.Generic; using System.Diagnostics; using GodotTools.Internals; +using GodotTools.Utils; -namespace GodotTools +namespace GodotTools.Ides.MonoDevelop { - public class MonoDevelopInstance + public class Instance { - public enum EditorId - { - MonoDevelop = 0, - VisualStudioForMac = 1 - } - private readonly string solutionFile; private readonly EditorId editorId; private Process process; - public void Execute(params string[] files) + public bool IsRunning => process != null && !process.HasExited; + + public void Execute() { bool newWindow = process == null || process.HasExited; @@ -28,9 +24,9 @@ namespace GodotTools string command; - if (Utils.OS.IsOSX()) + if (OS.IsOSX()) { - string bundleId = CodeEditorBundleIds[editorId]; + string bundleId = BundleIds[editorId]; if (Internal.IsOsxAppBundleInstalled(bundleId)) { @@ -47,12 +43,12 @@ namespace GodotTools } else { - command = CodeEditorPaths[editorId]; + command = OS.PathWhich(ExecutableNames[editorId]); } } else { - command = CodeEditorPaths[editorId]; + command = OS.PathWhich(ExecutableNames[editorId]); } args.Add("--ipc-tcp"); @@ -60,15 +56,8 @@ namespace GodotTools if (newWindow) args.Add("\"" + Path.GetFullPath(solutionFile) + "\""); - foreach (var file in files) - { - int semicolonIndex = file.IndexOf(';'); - - string filePath = semicolonIndex < 0 ? file : file.Substring(0, semicolonIndex); - string cursor = semicolonIndex < 0 ? string.Empty : file.Substring(semicolonIndex); - - args.Add("\"" + Path.GetFullPath(filePath.NormalizePath()) + cursor + "\""); - } + if (command == null) + throw new FileNotFoundException(); if (newWindow) { @@ -76,7 +65,7 @@ namespace GodotTools { FileName = command, Arguments = string.Join(" ", args), - UseShellExecute = false + UseShellExecute = true }); } else @@ -85,42 +74,42 @@ namespace GodotTools { FileName = command, Arguments = string.Join(" ", args), - UseShellExecute = false + UseShellExecute = true })?.Dispose(); } } - public MonoDevelopInstance(string solutionFile, EditorId editorId) + public Instance(string solutionFile, EditorId editorId) { - if (editorId == EditorId.VisualStudioForMac && !Utils.OS.IsOSX()) + if (editorId == EditorId.VisualStudioForMac && !OS.IsOSX()) throw new InvalidOperationException($"{nameof(EditorId.VisualStudioForMac)} not supported on this platform"); this.solutionFile = solutionFile; this.editorId = editorId; } - private static readonly IReadOnlyDictionary<EditorId, string> CodeEditorPaths; - private static readonly IReadOnlyDictionary<EditorId, string> CodeEditorBundleIds; + private static readonly IReadOnlyDictionary<EditorId, string> ExecutableNames; + private static readonly IReadOnlyDictionary<EditorId, string> BundleIds; - static MonoDevelopInstance() + static Instance() { - if (Utils.OS.IsOSX()) + if (OS.IsOSX()) { - CodeEditorPaths = new Dictionary<EditorId, string> + ExecutableNames = new Dictionary<EditorId, string> { // Rely on PATH {EditorId.MonoDevelop, "monodevelop"}, {EditorId.VisualStudioForMac, "VisualStudio"} }; - CodeEditorBundleIds = new Dictionary<EditorId, string> + BundleIds = new Dictionary<EditorId, string> { // TODO EditorId.MonoDevelop {EditorId.VisualStudioForMac, "com.microsoft.visual-studio"} }; } - else if (Utils.OS.IsWindows()) + else if (OS.IsWindows()) { - CodeEditorPaths = new Dictionary<EditorId, string> + ExecutableNames = new Dictionary<EditorId, string> { // XamarinStudio is no longer a thing, and the latest version is quite old // MonoDevelop is available from source only on Windows. The recommendation @@ -129,9 +118,9 @@ namespace GodotTools {EditorId.MonoDevelop, "MonoDevelop.exe"} }; } - else if (Utils.OS.IsUnix()) + else if (OS.IsUnix()) { - CodeEditorPaths = new Dictionary<EditorId, string> + ExecutableNames = new Dictionary<EditorId, string> { // Rely on PATH {EditorId.MonoDevelop, "monodevelop"} diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/Globals.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/Globals.cs new file mode 100644 index 0000000000..793f84fd77 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/Internals/Globals.cs @@ -0,0 +1,33 @@ +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; + +namespace GodotTools.Internals +{ + public static class Globals + { + public static float EditorScale => internal_EditorScale(); + + public static object GlobalDef(string setting, object defaultValue, bool restartIfChanged = false) => + internal_GlobalDef(setting, defaultValue, restartIfChanged); + + public static object EditorDef(string setting, object defaultValue, bool restartIfChanged = false) => + internal_EditorDef(setting, defaultValue, restartIfChanged); + + [SuppressMessage("ReSharper", "InconsistentNaming")] + public static string TTR(this string text) => internal_TTR(text); + + // Internal Calls + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern float internal_EditorScale(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern object internal_GlobalDef(string setting, object defaultValue, bool restartIfChanged); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern object internal_EditorDef(string setting, object defaultValue, bool restartIfChanged); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern string internal_TTR(string text); + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs index 5c7ce832cd..7783576910 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs @@ -10,13 +10,8 @@ namespace GodotTools.Internals public const string CSharpLanguageType = "CSharpScript"; public const string CSharpLanguageExtension = "cs"; - public static float EditorScale => internal_EditorScale(); - - public static object GlobalDef(string setting, object defaultValue, bool restartIfChanged = false) => - internal_GlobalDef(setting, defaultValue, restartIfChanged); - - public static object EditorDef(string setting, object defaultValue, bool restartIfChanged = false) => - internal_EditorDef(setting, defaultValue, restartIfChanged); + public static string UpdateApiAssembliesFromPrebuilt() => + internal_UpdateApiAssembliesFromPrebuilt(); public static string FullTemplatesDir => internal_FullTemplatesDir(); @@ -25,14 +20,6 @@ namespace GodotTools.Internals public static bool IsOsxAppBundleInstalled(string bundleId) => internal_IsOsxAppBundleInstalled(bundleId); - public static bool MetadataIsApiAssemblyInvalidated(ApiAssemblyType apiType) => - internal_MetadataIsApiAssemblyInvalidated(apiType); - - public static void MetadataSetApiAssemblyInvalidated(ApiAssemblyType apiType, bool invalidated) => - internal_MetadataSetApiAssemblyInvalidated(apiType, invalidated); - - public static bool IsMessageQueueFlushing() => internal_IsMessageQueueFlushing(); - public static bool GodotIs32Bits() => internal_GodotIs32Bits(); public static bool GodotIsRealTDouble() => internal_GodotIsRealTDouble(); @@ -59,16 +46,16 @@ namespace GodotTools.Internals public static string MonoWindowsInstallRoot => internal_MonoWindowsInstallRoot(); - // Internal Calls + public static void EditorRunPlay() => internal_EditorRunPlay(); - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern float internal_EditorScale(); + public static void EditorRunStop() => internal_EditorRunStop(); - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern object internal_GlobalDef(string setting, object defaultValue, bool restartIfChanged); + public static void ScriptEditorDebugger_ReloadScripts() => internal_ScriptEditorDebugger_ReloadScripts(); + + // Internal Calls [MethodImpl(MethodImplOptions.InternalCall)] - private static extern object internal_EditorDef(string setting, object defaultValue, bool restartIfChanged); + private static extern string internal_UpdateApiAssembliesFromPrebuilt(); [MethodImpl(MethodImplOptions.InternalCall)] private static extern string internal_FullTemplatesDir(); @@ -80,15 +67,6 @@ namespace GodotTools.Internals private static extern bool internal_IsOsxAppBundleInstalled(string bundleId); [MethodImpl(MethodImplOptions.InternalCall)] - private static extern bool internal_MetadataIsApiAssemblyInvalidated(ApiAssemblyType apiType); - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void internal_MetadataSetApiAssemblyInvalidated(ApiAssemblyType apiType, bool invalidated); - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern bool internal_IsMessageQueueFlushing(); - - [MethodImpl(MethodImplOptions.InternalCall)] private static extern bool internal_GodotIs32Bits(); [MethodImpl(MethodImplOptions.InternalCall)] @@ -123,5 +101,14 @@ namespace GodotTools.Internals [MethodImpl(MethodImplOptions.InternalCall)] private static extern string internal_MonoWindowsInstallRoot(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void internal_EditorRunPlay(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void internal_EditorRunStop(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void internal_ScriptEditorDebugger_ReloadScripts(); } } diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/CollectionExtensions.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/CollectionExtensions.cs index 3ae6c10bbf..e3c2c822a5 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Utils/CollectionExtensions.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Utils/CollectionExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; namespace GodotTools.Utils { @@ -10,11 +11,19 @@ namespace GodotTools.Utils { foreach (T elem in enumerable) { - if (predicate(elem) != null) - return elem; + T result = predicate(elem); + if (result != null) + return result; } return orElse; } + + public static IEnumerable<string> EnumerateLines(this TextReader textReader) + { + string line; + while ((line = textReader.ReadLine()) != null) + yield return line; + } } } diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/NotifyAwaiter.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/NotifyAwaiter.cs new file mode 100644 index 0000000000..a3490fa89f --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/Utils/NotifyAwaiter.cs @@ -0,0 +1,64 @@ +using System; +using System.Runtime.CompilerServices; + +namespace GodotTools.Utils +{ + public sealed class NotifyAwaiter<T> : INotifyCompletion + { + private Action continuation; + private Exception exception; + private T result; + + public bool IsCompleted { get; private set; } + + public T GetResult() + { + if (exception != null) + throw exception; + return result; + } + + public void OnCompleted(Action continuation) + { + if (this.continuation != null) + throw new InvalidOperationException("This awaiter has already been listened"); + this.continuation = continuation; + } + + public void SetResult(T result) + { + if (IsCompleted) + throw new InvalidOperationException("This awaiter is already completed"); + + IsCompleted = true; + this.result = result; + + continuation?.Invoke(); + } + + public void SetException(Exception exception) + { + if (IsCompleted) + throw new InvalidOperationException("This awaiter is already completed"); + + IsCompleted = true; + this.exception = exception; + + continuation?.Invoke(); + } + + public NotifyAwaiter<T> Reset() + { + continuation = null; + exception = null; + result = default; + IsCompleted = false; + return this; + } + + public NotifyAwaiter<T> GetAwaiter() + { + return this; + } + } +} diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 45037bf637..1888bb3cb9 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -279,7 +279,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf Vector<String> link_target_parts = link_target.split("."); if (link_target_parts.size() <= 0 || link_target_parts.size() > 2) { - ERR_PRINTS("Invalid reference format: " + tag); + ERR_PRINTS("Invalid reference format: '" + tag + "'."); xml_output.append("<c>"); xml_output.append(tag); @@ -375,7 +375,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf xml_output.append(target_enum_itype.proxy_name); // Includes nesting class if any xml_output.append("\"/>"); } else { - ERR_PRINTS("Cannot resolve enum reference in documentation: " + link_target); + ERR_PRINTS("Cannot resolve enum reference in documentation: '" + link_target + "'."); xml_output.append("<c>"); xml_output.append(link_target); @@ -424,7 +424,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf xml_output.append(target_iconst->proxy_name); xml_output.append("\"/>"); } else { - ERR_PRINTS("Cannot resolve global constant reference in documentation: " + link_target); + ERR_PRINTS("Cannot resolve global constant reference in documentation: '" + link_target + "'."); xml_output.append("<c>"); xml_output.append(link_target); @@ -464,7 +464,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf xml_output.append(target_iconst->proxy_name); xml_output.append("\"/>"); } else { - ERR_PRINTS("Cannot resolve constant reference in documentation: " + link_target); + ERR_PRINTS("Cannot resolve constant reference in documentation: '" + link_target + "'."); xml_output.append("<c>"); xml_output.append(link_target); @@ -534,7 +534,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf xml_output.append(target_itype->proxy_name); xml_output.append("\"/>"); } else { - ERR_PRINTS("Cannot resolve type reference in documentation: " + tag); + ERR_PRINTS("Cannot resolve type reference in documentation: '" + tag + "'."); xml_output.append("<c>"); xml_output.append(tag); @@ -812,7 +812,7 @@ void BindingsGenerator::_generate_global_constants(StringBuilder &p_output) { CRASH_COND(enum_class_name != "Variant"); // Hard-coded... - _log("Declaring global enum `%s` inside static class `%s`\n", enum_proxy_name.utf8().get_data(), enum_class_name.utf8().get_data()); + _log("Declaring global enum '%s' inside static class '%s'\n", enum_proxy_name.utf8().get_data(), enum_class_name.utf8().get_data()); p_output.append("\n" INDENT1 "public static partial class "); p_output.append(enum_class_name); @@ -1083,7 +1083,7 @@ Error BindingsGenerator::generate_cs_api(const String &p_output_dir) { proj_err = generate_cs_core_project(core_proj_dir, core_compile_items); if (proj_err != OK) { - ERR_PRINT("Generation of the Core API C# project failed"); + ERR_PRINT("Generation of the Core API C# project failed."); return proj_err; } @@ -1094,7 +1094,7 @@ Error BindingsGenerator::generate_cs_api(const String &p_output_dir) { proj_err = generate_cs_editor_project(editor_proj_dir, editor_compile_items); if (proj_err != OK) { - ERR_PRINT("Generation of the Editor API C# project failed"); + ERR_PRINT("Generation of the Editor API C# project failed."); return proj_err; } @@ -1112,7 +1112,7 @@ Error BindingsGenerator::generate_cs_api(const String &p_output_dir) { // FIXME: There are some members that hide other inherited members. // - In the case of both members being the same kind, the new one must be declared -// explicitly as `new` to avoid the warning (and we must print a message about it). +// explicitly as 'new' to avoid the warning (and we must print a message about it). // - In the case of both members being of a different kind, then the new one must // be renamed to avoid the name collision (and we must print a warning about it). // - Csc warning e.g.: @@ -1186,7 +1186,7 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str output.append(obj_types[itype.base_name].proxy_name); output.append("\n"); } else { - ERR_PRINTS("Base type '" + itype.base_name.operator String() + "' does not exist, for class " + itype.name); + ERR_PRINTS("Base type '" + itype.base_name.operator String() + "' does not exist, for class '" + itype.name + "'."); return ERR_INVALID_DATA; } } @@ -1273,11 +1273,9 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str for (const List<PropertyInterface>::Element *E = itype.properties.front(); E; E = E->next()) { const PropertyInterface &iprop = E->get(); Error prop_err = _generate_cs_property(itype, iprop, output); - if (prop_err != OK) { - ERR_EXPLAIN("Failed to generate property '" + iprop.cname.operator String() + - "' for class '" + itype.name + "'"); - ERR_FAIL_V(prop_err); - } + ERR_FAIL_COND_V_MSG(prop_err != OK, prop_err, + "Failed to generate property '" + iprop.cname.operator String() + + "' for class '" + itype.name + "'."); } } @@ -1340,10 +1338,8 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str for (const List<MethodInterface>::Element *E = itype.methods.front(); E; E = E->next()) { const MethodInterface &imethod = E->get(); Error method_err = _generate_cs_method(itype, imethod, method_bind_count, output); - if (method_err != OK) { - ERR_EXPLAIN("Failed to generate method '" + imethod.name + "' for class '" + itype.name + "'"); - ERR_FAIL_V(method_err); - } + ERR_FAIL_COND_V_MSG(method_err != OK, method_err, + "Failed to generate method '" + imethod.name + "' for class '" + itype.name + "'."); } if (itype.is_singleton) { @@ -1626,7 +1622,7 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf if (p_imethod.is_deprecated) { if (p_imethod.deprecation_message.empty()) - WARN_PRINTS("An empty deprecation message is discouraged. Method: " + p_imethod.proxy_name); + WARN_PRINTS("An empty deprecation message is discouraged. Method: '" + p_imethod.proxy_name + "'."); p_output.append(MEMBER_BEGIN "[Obsolete(\""); p_output.append(p_imethod.deprecation_message); @@ -1708,8 +1704,7 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf Error BindingsGenerator::generate_glue(const String &p_output_dir) { bool dir_exists = DirAccess::exists(p_output_dir); - ERR_EXPLAIN("The output directory does not exist."); - ERR_FAIL_COND_V(!dir_exists, ERR_FILE_BAD_PATH); + ERR_FAIL_COND_V_MSG(!dir_exists, ERR_FILE_BAD_PATH, "The output directory does not exist."); StringBuilder output; @@ -1742,10 +1737,8 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { for (const List<MethodInterface>::Element *E = itype.methods.front(); E; E = E->next()) { const MethodInterface &imethod = E->get(); Error method_err = _generate_glue_method(itype, imethod, output); - if (method_err != OK) { - ERR_EXPLAIN("Failed to generate method '" + imethod.name + "' for class '" + itype.name + "'"); - ERR_FAIL_V(method_err); - } + ERR_FAIL_COND_V_MSG(method_err != OK, method_err, + "Failed to generate method '" + imethod.name + "' for class '" + itype.name + "'."); } if (itype.is_singleton) { @@ -1879,8 +1872,7 @@ Error BindingsGenerator::_save_file(const String &p_path, const StringBuilder &p FileAccessRef file = FileAccess::open(p_path, FileAccess::WRITE); - ERR_EXPLAIN("Cannot open file: " + p_path); - ERR_FAIL_COND_V(!file, ERR_FILE_CANT_WRITE); + ERR_FAIL_COND_V_MSG(!file, ERR_FILE_CANT_WRITE, "Cannot open file: '" + p_path + "'."); file->store_string(p_content.as_string()); file->close(); @@ -2091,7 +2083,7 @@ const BindingsGenerator::TypeInterface *BindingsGenerator::_get_type_or_placehol if (found) return found; - ERR_PRINTS(String() + "Type not found. Creating placeholder: " + p_typeref.cname.operator String()); + ERR_PRINTS(String() + "Type not found. Creating placeholder: '" + p_typeref.cname.operator String() + "'."); const Map<StringName, TypeInterface>::Element *match = placeholder_types.find(p_typeref.cname); @@ -2175,13 +2167,13 @@ void BindingsGenerator::_populate_object_type_interfaces() { } if (!ClassDB::is_class_exposed(type_cname)) { - _log("Ignoring type `%s` because it's not exposed\n", String(type_cname).utf8().get_data()); + _log("Ignoring type '%s' because it's not exposed\n", String(type_cname).utf8().get_data()); class_list.pop_front(); continue; } if (!ClassDB::is_class_enabled(type_cname)) { - _log("Ignoring type `%s` because it's not enabled\n", String(type_cname).utf8().get_data()); + _log("Ignoring type '%s' because it's not enabled\n", String(type_cname).utf8().get_data()); class_list.pop_front(); continue; } @@ -2240,7 +2232,7 @@ void BindingsGenerator::_populate_object_type_interfaces() { // Prevent the property and its enclosing type from sharing the same name if (iprop.proxy_name == itype.proxy_name) { - _log("Name of property `%s` is ambiguous with the name of its enclosing class `%s`. Renaming property to `%s_`\n", + _log("Name of property '%s' is ambiguous with the name of its enclosing class '%s'. Renaming property to '%s_'\n", iprop.proxy_name.utf8().get_data(), itype.proxy_name.utf8().get_data(), iprop.proxy_name.utf8().get_data()); iprop.proxy_name += "_"; @@ -2298,28 +2290,26 @@ void BindingsGenerator::_populate_object_type_interfaces() { imethod.is_vararg = m && m->is_vararg(); if (!m && !imethod.is_virtual) { - if (virtual_method_list.find(method_info)) { - // A virtual method without the virtual flag. This is a special case. - - // There is no method bind, so let's fallback to Godot's object.Call(string, params) - imethod.requires_object_call = true; - - // The method Object.free is registered as a virtual method, but without the virtual flag. - // This is because this method is not supposed to be overridden, but called. - // We assume the return type is void. - imethod.return_type.cname = name_cache.type_void; - - // Actually, more methods like this may be added in the future, - // which could actually will return something different. - // Let's put this to notify us if that ever happens. - if (itype.cname != name_cache.type_Object || imethod.name != "free") { - ERR_PRINTS("Notification: New unexpected virtual non-overridable method found.\n" - "We only expected Object.free, but found " + - itype.name + "." + imethod.name); - } - } else { - ERR_EXPLAIN("Missing MethodBind for non-virtual method: " + itype.name + "." + imethod.name); - ERR_FAIL(); + ERR_FAIL_COND_MSG(!virtual_method_list.find(method_info), + "Missing MethodBind for non-virtual method: '" + itype.name + "." + imethod.name + "'."); + + // A virtual method without the virtual flag. This is a special case. + + // There is no method bind, so let's fallback to Godot's object.Call(string, params) + imethod.requires_object_call = true; + + // The method Object.free is registered as a virtual method, but without the virtual flag. + // This is because this method is not supposed to be overridden, but called. + // We assume the return type is void. + imethod.return_type.cname = name_cache.type_void; + + // Actually, more methods like this may be added in the future, + // which could actually will return something different. + // Let's put this to notify us if that ever happens. + if (itype.cname != name_cache.type_Object || imethod.name != "free") { + ERR_PRINTS("Notification: New unexpected virtual non-overridable method found." + " We only expected Object.free, but found '" + + itype.name + "." + imethod.name + "'."); } } else if (return_info.type == Variant::INT && return_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { imethod.return_type.cname = return_info.class_name; @@ -2328,8 +2318,8 @@ void BindingsGenerator::_populate_object_type_interfaces() { imethod.return_type.cname = return_info.class_name; if (!imethod.is_virtual && ClassDB::is_parent_class(return_info.class_name, name_cache.type_Reference) && return_info.hint != PROPERTY_HINT_RESOURCE_TYPE) { /* clang-format off */ - ERR_PRINTS("Return type is reference but hint is not " _STR(PROPERTY_HINT_RESOURCE_TYPE) "." - " Are you returning a reference type by pointer? Method: " + itype.name + "." + imethod.name); + ERR_PRINTS("Return type is reference but hint is not '" _STR(PROPERTY_HINT_RESOURCE_TYPE) "'." + " Are you returning a reference type by pointer? Method: '" + itype.name + "." + imethod.name + "'."); /* clang-format on */ ERR_FAIL(); } @@ -2394,7 +2384,7 @@ void BindingsGenerator::_populate_object_type_interfaces() { // Prevent the method and its enclosing type from sharing the same name if (imethod.proxy_name == itype.proxy_name) { - _log("Name of method `%s` is ambiguous with the name of its enclosing class `%s`. Renaming method to `%s_`\n", + _log("Name of method '%s' is ambiguous with the name of its enclosing class '%s'. Renaming method to '%s_'\n", imethod.proxy_name.utf8().get_data(), itype.proxy_name.utf8().get_data(), imethod.proxy_name.utf8().get_data()); imethod.proxy_name += "_"; @@ -2880,8 +2870,7 @@ void BindingsGenerator::_populate_global_constants() { if (global_constants_count > 0) { Map<String, DocData::ClassDoc>::Element *match = EditorHelp::get_doc_data()->class_list.find("@GlobalScope"); - ERR_EXPLAIN("Could not find `@GlobalScope` in DocData"); - CRASH_COND(!match); + CRASH_COND_MSG(!match, "Could not find '@GlobalScope' in DocData."); const DocData::ClassDoc &global_scope_doc = match->value(); @@ -2935,7 +2924,7 @@ void BindingsGenerator::_populate_global_constants() { // HARDCODED: The Error enum have the prefix 'ERR_' for everything except 'OK' and 'FAILED'. if (ienum.cname == name_cache.enum_Error) { if (prefix_length > 0) { // Just in case it ever changes - ERR_PRINTS("Prefix for enum 'Error' is not empty"); + ERR_PRINTS("Prefix for enum '" _STR(Error) "' is not empty."); } prefix_length = 1; // 'ERR_' @@ -3024,7 +3013,7 @@ void BindingsGenerator::handle_cmdline_args(const List<String> &p_cmdline_args) glue_dir_path = path_elem->get(); elem = elem->next(); } else { - ERR_PRINTS(generate_all_glue_option + ": No output directory specified (expected path to {GODOT_ROOT}/modules/mono/glue)"); + ERR_PRINTS(generate_all_glue_option + ": No output directory specified (expected path to '{GODOT_ROOT}/modules/mono/glue')."); } --options_left; @@ -3035,7 +3024,7 @@ void BindingsGenerator::handle_cmdline_args(const List<String> &p_cmdline_args) cs_dir_path = path_elem->get(); elem = elem->next(); } else { - ERR_PRINTS(generate_cs_glue_option + ": No output directory specified"); + ERR_PRINTS(generate_cs_glue_option + ": No output directory specified."); } --options_left; @@ -3046,7 +3035,7 @@ void BindingsGenerator::handle_cmdline_args(const List<String> &p_cmdline_args) cpp_dir_path = path_elem->get(); elem = elem->next(); } else { - ERR_PRINTS(generate_cpp_glue_option + ": No output directory specified"); + ERR_PRINTS(generate_cpp_glue_option + ": No output directory specified."); } --options_left; @@ -3061,20 +3050,20 @@ void BindingsGenerator::handle_cmdline_args(const List<String> &p_cmdline_args) if (glue_dir_path.length()) { if (bindings_generator.generate_glue(glue_dir_path) != OK) - ERR_PRINTS(generate_all_glue_option + ": Failed to generate the C++ glue"); + ERR_PRINTS(generate_all_glue_option + ": Failed to generate the C++ glue."); if (bindings_generator.generate_cs_api(glue_dir_path.plus_file("Managed/Generated")) != OK) - ERR_PRINTS(generate_all_glue_option + ": Failed to generate the C# API"); + ERR_PRINTS(generate_all_glue_option + ": Failed to generate the C# API."); } if (cs_dir_path.length()) { if (bindings_generator.generate_cs_api(cs_dir_path) != OK) - ERR_PRINTS(generate_cs_glue_option + ": Failed to generate the C# API"); + ERR_PRINTS(generate_cs_glue_option + ": Failed to generate the C# API."); } if (cpp_dir_path.length()) { if (bindings_generator.generate_glue(cpp_dir_path) != OK) - ERR_PRINTS(generate_cpp_glue_option + ": Failed to generate the C++ glue"); + ERR_PRINTS(generate_cpp_glue_option + ": Failed to generate the C++ glue."); } // Exit once done diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index 8be51a6c55..6f0c297575 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -147,7 +147,7 @@ class BindingsGenerator { bool requires_object_call; /** - * Determines if the method visibility is `internal` (visible only to files in the same assembly). + * Determines if the method visibility is 'internal' (visible only to files in the same assembly). * Currently, we only use this for methods that are not meant to be exposed, * but are required by properties as getters or setters. * Methods that are not meant to be exposed are those that begin with underscore and are not virtual. diff --git a/modules/mono/editor/csharp_project.cpp b/modules/mono/editor/csharp_project.cpp index d88b08c646..0e6c58c9d7 100644 --- a/modules/mono/editor/csharp_project.cpp +++ b/modules/mono/editor/csharp_project.cpp @@ -81,16 +81,14 @@ bool generate_api_solution(const String &p_solution_dir, const String &p_core_pr _GDMONO_SCOPE_DOMAIN_(temp_domain); - GDMonoAssembly *tools_project_editor_assembly = NULL; + GDMonoAssembly *tools_project_editor_asm = NULL; - if (!GDMono::get_singleton()->load_assembly("GodotTools.ProjectEditor", &tools_project_editor_assembly)) { - ERR_EXPLAIN("Failed to load assembly: 'GodotTools.ProjectEditor'"); - ERR_FAIL_V(false); - } + bool assembly_loaded = GDMono::get_singleton()->load_assembly(TOOLS_PROJECT_EDITOR_ASM_NAME, &tools_project_editor_asm); + ERR_FAIL_COND_V_MSG(!assembly_loaded, false, "Failed to load assembly: '" TOOLS_PROJECT_EDITOR_ASM_NAME "'."); return generate_api_solution_impl(p_solution_dir, p_core_proj_dir, p_core_compile_items, p_editor_proj_dir, p_editor_compile_items, - tools_project_editor_assembly); + tools_project_editor_asm); } } diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp index a3b5b450ef..7db1090e2a 100644 --- a/modules/mono/editor/editor_internal_calls.cpp +++ b/modules/mono/editor/editor_internal_calls.cpp @@ -30,7 +30,6 @@ #include "editor_internal_calls.h" -#include "core/message_queue.h" #include "core/os/os.h" #include "core/version.h" #include "editor/editor_node.h" @@ -231,24 +230,34 @@ uint32_t godot_icall_GodotSharpExport_GetExportedAssemblyDependencies(MonoString return GodotSharpExport::get_exported_assembly_dependencies(project_dll_name, project_dll_src_path, build_config, custom_lib_dir, dependencies); } -float godot_icall_Internal_EditorScale() { +float godot_icall_Globals_EditorScale() { return EDSCALE; } -MonoObject *godot_icall_Internal_GlobalDef(MonoString *p_setting, MonoObject *p_default_value, MonoBoolean p_restart_if_changed) { +MonoObject *godot_icall_Globals_GlobalDef(MonoString *p_setting, MonoObject *p_default_value, MonoBoolean p_restart_if_changed) { String setting = GDMonoMarshal::mono_string_to_godot(p_setting); Variant default_value = GDMonoMarshal::mono_object_to_variant(p_default_value); Variant result = _GLOBAL_DEF(setting, default_value, (bool)p_restart_if_changed); return GDMonoMarshal::variant_to_mono_object(result); } -MonoObject *godot_icall_Internal_EditorDef(MonoString *p_setting, MonoObject *p_default_value, MonoBoolean p_restart_if_changed) { +MonoObject *godot_icall_Globals_EditorDef(MonoString *p_setting, MonoObject *p_default_value, MonoBoolean p_restart_if_changed) { String setting = GDMonoMarshal::mono_string_to_godot(p_setting); Variant default_value = GDMonoMarshal::mono_object_to_variant(p_default_value); - Variant result = _GLOBAL_DEF(setting, default_value, (bool)p_restart_if_changed); + Variant result = _EDITOR_DEF(setting, default_value, (bool)p_restart_if_changed); return GDMonoMarshal::variant_to_mono_object(result); } +MonoString *godot_icall_Globals_TTR(MonoString *p_text) { + String text = GDMonoMarshal::mono_string_to_godot(p_text); + return GDMonoMarshal::mono_string_from_godot(TTR(text)); +} + +MonoString *godot_icall_Internal_UpdateApiAssembliesFromPrebuilt() { + String error_str = GDMono::get_singleton()->update_api_assemblies_from_prebuilt(); + return GDMonoMarshal::mono_string_from_godot(error_str); +} + MonoString *godot_icall_Internal_FullTemplatesDir() { String full_templates_dir = EditorSettings::get_singleton()->get_templates_dir().plus_file(VERSION_FULL_CONFIG); return GDMonoMarshal::mono_string_from_godot(full_templates_dir); @@ -269,18 +278,6 @@ MonoBoolean godot_icall_Internal_IsOsxAppBundleInstalled(MonoString *p_bundle_id #endif } -MonoBoolean godot_icall_Internal_MetadataIsApiAssemblyInvalidated(int32_t p_api_type) { - return GDMono::get_singleton()->metadata_is_api_assembly_invalidated((APIAssembly::Type)p_api_type); -} - -void godot_icall_Internal_MetadataSetApiAssemblyInvalidated(int32_t p_api_type, MonoBoolean p_invalidated) { - GDMono::get_singleton()->metadata_set_api_assembly_invalidated((APIAssembly::Type)p_api_type, (bool)p_invalidated); -} - -MonoBoolean godot_icall_Internal_IsMessageQueueFlushing() { - return (MonoBoolean)MessageQueue::get_singleton()->is_flushing(); -} - MonoBoolean godot_icall_Internal_GodotIs32Bits() { return sizeof(void *) == 4; } @@ -353,6 +350,21 @@ MonoString *godot_icall_Internal_MonoWindowsInstallRoot() { #endif } +void godot_icall_Internal_EditorRunPlay() { + EditorNode::get_singleton()->run_play(); +} + +void godot_icall_Internal_EditorRunStop() { + EditorNode::get_singleton()->run_stop(); +} + +void godot_icall_Internal_ScriptEditorDebugger_ReloadScripts() { + ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); + if (sed) { + sed->reload_scripts(); + } +} + MonoString *godot_icall_Utils_OS_GetPlatformName() { String os_name = OS::get_singleton()->get_name(); return GDMonoMarshal::mono_string_from_godot(os_name); @@ -402,15 +414,10 @@ void register_editor_internal_calls() { mono_add_internal_call("GodotTools.GodotSharpExport::internal_GetExportedAssemblyDependencies", (void *)godot_icall_GodotSharpExport_GetExportedAssemblyDependencies); // Internals - mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorScale", (void *)godot_icall_Internal_EditorScale); - mono_add_internal_call("GodotTools.Internals.Internal::internal_GlobalDef", (void *)godot_icall_Internal_GlobalDef); - mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorDef", (void *)godot_icall_Internal_EditorDef); + mono_add_internal_call("GodotTools.Internals.Internal::internal_UpdateApiAssembliesFromPrebuilt", (void *)godot_icall_Internal_UpdateApiAssembliesFromPrebuilt); mono_add_internal_call("GodotTools.Internals.Internal::internal_FullTemplatesDir", (void *)godot_icall_Internal_FullTemplatesDir); mono_add_internal_call("GodotTools.Internals.Internal::internal_SimplifyGodotPath", (void *)godot_icall_Internal_SimplifyGodotPath); mono_add_internal_call("GodotTools.Internals.Internal::internal_IsOsxAppBundleInstalled", (void *)godot_icall_Internal_IsOsxAppBundleInstalled); - mono_add_internal_call("GodotTools.Internals.Internal::internal_MetadataIsApiAssemblyInvalidated", (void *)godot_icall_Internal_MetadataIsApiAssemblyInvalidated); - mono_add_internal_call("GodotTools.Internals.Internal::internal_MetadataSetApiAssemblyInvalidated", (void *)godot_icall_Internal_MetadataSetApiAssemblyInvalidated); - mono_add_internal_call("GodotTools.Internals.Internal::internal_IsMessageQueueFlushing", (void *)godot_icall_Internal_IsMessageQueueFlushing); mono_add_internal_call("GodotTools.Internals.Internal::internal_GodotIs32Bits", (void *)godot_icall_Internal_GodotIs32Bits); mono_add_internal_call("GodotTools.Internals.Internal::internal_GodotIsRealTDouble", (void *)godot_icall_Internal_GodotIsRealTDouble); mono_add_internal_call("GodotTools.Internals.Internal::internal_GodotMainIteration", (void *)godot_icall_Internal_GodotMainIteration); @@ -422,7 +429,15 @@ void register_editor_internal_calls() { mono_add_internal_call("GodotTools.Internals.Internal::internal_ScriptEditorEdit", (void *)godot_icall_Internal_ScriptEditorEdit); mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorNodeShowScriptScreen", (void *)godot_icall_Internal_EditorNodeShowScriptScreen); mono_add_internal_call("GodotTools.Internals.Internal::internal_GetScriptsMetadataOrNothing", (void *)godot_icall_Internal_GetScriptsMetadataOrNothing); - mono_add_internal_call("GodotTools.Internals.Internal::internal_MonoWindowsInstallRoot", (void *)godot_icall_Internal_MonoWindowsInstallRoot); + mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorRunPlay", (void *)godot_icall_Internal_EditorRunPlay); + mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorRunStop", (void *)godot_icall_Internal_EditorRunStop); + mono_add_internal_call("GodotTools.Internals.Internal::internal_ScriptEditorDebugger_ReloadScripts", (void *)godot_icall_Internal_ScriptEditorDebugger_ReloadScripts); + + // Globals + mono_add_internal_call("GodotTools.Internals.Globals::internal_EditorScale", (void *)godot_icall_Globals_EditorScale); + mono_add_internal_call("GodotTools.Internals.Globals::internal_GlobalDef", (void *)godot_icall_Globals_GlobalDef); + mono_add_internal_call("GodotTools.Internals.Globals::internal_EditorDef", (void *)godot_icall_Globals_EditorDef); + mono_add_internal_call("GodotTools.Internals.Globals::internal_TTR", (void *)godot_icall_Globals_TTR); // Utils.OS mono_add_internal_call("GodotTools.Utils.OS::GetPlatformName", (void *)godot_icall_Utils_OS_GetPlatformName); diff --git a/modules/mono/editor/godotsharp_export.cpp b/modules/mono/editor/godotsharp_export.cpp index 020bb70a08..80a7335b1d 100644 --- a/modules/mono/editor/godotsharp_export.cpp +++ b/modules/mono/editor/godotsharp_export.cpp @@ -85,18 +85,12 @@ Error GodotSharpExport::get_assembly_dependencies(GDMonoAssembly *p_assembly, co } } - if (!ref_assembly) { - ERR_EXPLAIN("Cannot load assembly (refonly): " + ref_name); - ERR_FAIL_V(ERR_CANT_RESOLVE); - } + ERR_FAIL_COND_V_MSG(!ref_assembly, ERR_CANT_RESOLVE, "Cannot load assembly (refonly): '" + ref_name + "'."); r_dependencies[ref_name] = ref_assembly->get_path(); Error err = get_assembly_dependencies(ref_assembly, p_search_dirs, r_dependencies); - if (err != OK) { - ERR_EXPLAIN("Cannot load one of the dependencies for the assembly: " + ref_name); - ERR_FAIL_V(err); - } + ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot load one of the dependencies for the assembly: '" + ref_name + "'."); } return OK; @@ -113,8 +107,7 @@ Error GodotSharpExport::get_exported_assembly_dependencies(const String &p_proje bool load_success = GDMono::get_singleton()->load_assembly_from(p_project_dll_name, p_project_dll_src_path, &scripts_assembly, /* refonly: */ true); - ERR_EXPLAIN("Cannot load assembly (refonly): " + p_project_dll_name); - ERR_FAIL_COND_V(!load_success, ERR_CANT_RESOLVE); + ERR_FAIL_COND_V_MSG(!load_success, ERR_CANT_RESOLVE, "Cannot load assembly (refonly): '" + p_project_dll_name + "'."); Vector<String> search_dirs; GDMonoAssembly::fill_search_dirs(search_dirs, p_build_config, p_custom_lib_dir); diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp index dfb652a7aa..dcb0ca5a80 100644 --- a/modules/mono/editor/script_class_parser.cpp +++ b/modules/mono/editor/script_class_parser.cpp @@ -162,8 +162,8 @@ ScriptClassParser::Token ScriptClassParser::get_token() { error = true; return TK_ERROR; } else if (code[idx] == begin_str) { - if (verbatim && code[idx + 1] == '"') { // `""` is verbatim string's `\"` - idx += 2; // skip next `"` as well + if (verbatim && code[idx + 1] == '"') { // '""' is verbatim string's '\"' + idx += 2; // skip next '"' as well continue; } @@ -590,7 +590,7 @@ Error ScriptClassParser::parse(const String &p_code) { name = String(value); } else if (tk == TK_CURLY_BRACKET_OPEN) { if (name.empty()) { - error_str = "Expected " + get_token_name(TK_IDENTIFIER) + " after keyword `struct`, found " + get_token_name(TK_CURLY_BRACKET_OPEN); + error_str = "Expected " + get_token_name(TK_IDENTIFIER) + " after keyword 'struct', found " + get_token_name(TK_CURLY_BRACKET_OPEN); error = true; return ERR_PARSE_ERROR; } @@ -657,12 +657,12 @@ Error ScriptClassParser::parse_file(const String &p_filepath) { String source; Error ferr = read_all_file_utf8(p_filepath, source); - if (ferr != OK) { - if (ferr == ERR_INVALID_DATA) { - ERR_EXPLAIN("File '" + p_filepath + "' contains invalid unicode (utf-8), so it was not loaded. Please ensure that scripts are saved in valid utf-8 unicode."); - } - ERR_FAIL_V(ferr); - } + + ERR_FAIL_COND_V_MSG(ferr != OK, ferr, + ferr == ERR_INVALID_DATA ? + "File '" + p_filepath + "' contains invalid unicode (UTF-8), so it was not loaded." + " Please ensure that scripts are saved in valid UTF-8 unicode." : + "Failed to read file: '" + p_filepath + "'."); return parse(source); } diff --git a/modules/mono/glue/Managed/Files/AABB.cs b/modules/mono/glue/Managed/Files/AABB.cs index a2ebbc0736..98a73382f4 100644 --- a/modules/mono/glue/Managed/Files/AABB.cs +++ b/modules/mono/glue/Managed/Files/AABB.cs @@ -5,6 +5,7 @@ // file: core/variant_call.cpp // commit: 5ad9be4c24e9d7dc5672fdc42cea896622fe5685 using System; +using System.Runtime.InteropServices; #if REAL_T_IS_DOUBLE using real_t = System.Double; #else @@ -13,6 +14,8 @@ using real_t = System.Single; namespace Godot { + [Serializable] + [StructLayout(LayoutKind.Sequential)] public struct AABB : IEquatable<AABB> { private Vector3 _position; diff --git a/modules/mono/glue/Managed/Files/Basis.cs b/modules/mono/glue/Managed/Files/Basis.cs index 9cc31a0557..0eb76e9c63 100644 --- a/modules/mono/glue/Managed/Files/Basis.cs +++ b/modules/mono/glue/Managed/Files/Basis.cs @@ -8,43 +8,10 @@ using real_t = System.Single; namespace Godot { + [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Basis : IEquatable<Basis> { - private static readonly Basis identity = new Basis - ( - 1f, 0f, 0f, - 0f, 1f, 0f, - 0f, 0f, 1f - ); - - private static readonly Basis[] orthoBases = { - new Basis(1f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 1f), - new Basis(0f, -1f, 0f, 1f, 0f, 0f, 0f, 0f, 1f), - new Basis(-1f, 0f, 0f, 0f, -1f, 0f, 0f, 0f, 1f), - new Basis(0f, 1f, 0f, -1f, 0f, 0f, 0f, 0f, 1f), - new Basis(1f, 0f, 0f, 0f, 0f, -1f, 0f, 1f, 0f), - new Basis(0f, 0f, 1f, 1f, 0f, 0f, 0f, 1f, 0f), - new Basis(-1f, 0f, 0f, 0f, 0f, 1f, 0f, 1f, 0f), - new Basis(0f, 0f, -1f, -1f, 0f, 0f, 0f, 1f, 0f), - new Basis(1f, 0f, 0f, 0f, -1f, 0f, 0f, 0f, -1f), - new Basis(0f, 1f, 0f, 1f, 0f, 0f, 0f, 0f, -1f), - new Basis(-1f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, -1f), - new Basis(0f, -1f, 0f, -1f, 0f, 0f, 0f, 0f, -1f), - new Basis(1f, 0f, 0f, 0f, 0f, 1f, 0f, -1f, 0f), - new Basis(0f, 0f, -1f, 1f, 0f, 0f, 0f, -1f, 0f), - new Basis(-1f, 0f, 0f, 0f, 0f, -1f, 0f, -1f, 0f), - new Basis(0f, 0f, 1f, -1f, 0f, 0f, 0f, -1f, 0f), - new Basis(0f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, 0f), - new Basis(0f, -1f, 0f, 0f, 0f, 1f, -1f, 0f, 0f), - new Basis(0f, 0f, -1f, 0f, -1f, 0f, -1f, 0f, 0f), - new Basis(0f, 1f, 0f, 0f, 0f, -1f, -1f, 0f, 0f), - new Basis(0f, 0f, 1f, 0f, -1f, 0f, 1f, 0f, 0f), - new Basis(0f, 1f, 0f, 0f, 0f, 1f, 1f, 0f, 0f), - new Basis(0f, 0f, -1f, 0f, 1f, 0f, 1f, 0f, 0f), - new Basis(0f, -1f, 0f, 0f, 0f, -1f, 1f, 0f, 0f) - }; - // NOTE: x, y and z are public-only. Use Column0, Column1 and Column2 internally. /// <summary> @@ -63,7 +30,6 @@ namespace Godot /// </summary> public Vector3 y { - get => Column1; set => Column1 = value; } @@ -74,7 +40,6 @@ namespace Godot /// </summary> public Vector3 z { - get => Column2; set => Column2 = value; } @@ -114,8 +79,6 @@ namespace Godot } } - public static Basis Identity => identity; - public Vector3 Scale { get @@ -225,7 +188,7 @@ namespace Godot return orthonormalizedBasis.Quat(); } - internal void SetQuantScale(Quat quat, Vector3 scale) + internal void SetQuatScale(Quat quat, Vector3 scale) { SetDiagonal(scale); Rotate(quat); @@ -241,7 +204,6 @@ namespace Godot Row0 = new Vector3(diagonal.x, 0, 0); Row1 = new Vector3(0, diagonal.y, 0); Row2 = new Vector3(0, 0, diagonal.z); - } public real_t Determinant() @@ -361,7 +323,7 @@ namespace Godot for (int i = 0; i < 24; i++) { - if (orthoBases[i] == orth) + if (orth == _orthoBases[i]) return i; } @@ -531,6 +493,43 @@ namespace Godot } } + private static readonly Basis[] _orthoBases = { + new Basis(1f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 1f), + new Basis(0f, -1f, 0f, 1f, 0f, 0f, 0f, 0f, 1f), + new Basis(-1f, 0f, 0f, 0f, -1f, 0f, 0f, 0f, 1f), + new Basis(0f, 1f, 0f, -1f, 0f, 0f, 0f, 0f, 1f), + new Basis(1f, 0f, 0f, 0f, 0f, -1f, 0f, 1f, 0f), + new Basis(0f, 0f, 1f, 1f, 0f, 0f, 0f, 1f, 0f), + new Basis(-1f, 0f, 0f, 0f, 0f, 1f, 0f, 1f, 0f), + new Basis(0f, 0f, -1f, -1f, 0f, 0f, 0f, 1f, 0f), + new Basis(1f, 0f, 0f, 0f, -1f, 0f, 0f, 0f, -1f), + new Basis(0f, 1f, 0f, 1f, 0f, 0f, 0f, 0f, -1f), + new Basis(-1f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, -1f), + new Basis(0f, -1f, 0f, -1f, 0f, 0f, 0f, 0f, -1f), + new Basis(1f, 0f, 0f, 0f, 0f, 1f, 0f, -1f, 0f), + new Basis(0f, 0f, -1f, 1f, 0f, 0f, 0f, -1f, 0f), + new Basis(-1f, 0f, 0f, 0f, 0f, -1f, 0f, -1f, 0f), + new Basis(0f, 0f, 1f, -1f, 0f, 0f, 0f, -1f, 0f), + new Basis(0f, 0f, 1f, 0f, 1f, 0f, -1f, 0f, 0f), + new Basis(0f, -1f, 0f, 0f, 0f, 1f, -1f, 0f, 0f), + new Basis(0f, 0f, -1f, 0f, -1f, 0f, -1f, 0f, 0f), + new Basis(0f, 1f, 0f, 0f, 0f, -1f, -1f, 0f, 0f), + new Basis(0f, 0f, 1f, 0f, -1f, 0f, 1f, 0f, 0f), + new Basis(0f, 1f, 0f, 0f, 0f, 1f, 1f, 0f, 0f), + new Basis(0f, 0f, -1f, 0f, 1f, 0f, 1f, 0f, 0f), + new Basis(0f, -1f, 0f, 0f, 0f, -1f, 1f, 0f, 0f) + }; + + private static readonly Basis _identity = new Basis(1, 0, 0, 0, 1, 0, 0, 0, 1); + private static readonly Basis _flipX = new Basis(-1, 0, 0, 0, 1, 0, 0, 0, 1); + private static readonly Basis _flipY = new Basis(1, 0, 0, 0, -1, 0, 0, 0, 1); + private static readonly Basis _flipZ = new Basis(1, 0, 0, 0, 1, 0, 0, 0, -1); + + public static Basis Identity { get { return _identity; } } + public static Basis FlipX { get { return _flipX; } } + public static Basis FlipY { get { return _flipY; } } + public static Basis FlipZ { get { return _flipZ; } } + public Basis(Quat quat) { real_t s = 2.0f / quat.LengthSquared; diff --git a/modules/mono/glue/Managed/Files/Color.cs b/modules/mono/glue/Managed/Files/Color.cs index 84ff19fc54..447697c671 100644 --- a/modules/mono/glue/Managed/Files/Color.cs +++ b/modules/mono/glue/Managed/Files/Color.cs @@ -1,7 +1,10 @@ using System; +using System.Runtime.InteropServices; namespace Godot { + [Serializable] + [StructLayout(LayoutKind.Sequential)] public struct Color : IEquatable<Color> { public float r; @@ -375,7 +378,7 @@ namespace Godot return c; } - public string ToHtml(bool include_alpha = true) + public string ToHtml(bool includeAlpha = true) { var txt = string.Empty; @@ -383,7 +386,7 @@ namespace Godot txt += ToHex32(g); txt += ToHex32(b); - if (include_alpha) + if (includeAlpha) txt = ToHex32(a) + txt; return txt; @@ -465,13 +468,13 @@ namespace Godot for (int i = 0; i < 2; i++) { - char[] c = { (char)0, (char)0 }; + char c; int lv = v & 0xF; if (lv < 10) - c[0] = (char)('0' + lv); + c = (char)('0' + lv); else - c[0] = (char)('a' + lv - 10); + c = (char)('a' + lv - 10); v >>= 4; ret = c + ret; @@ -490,12 +493,17 @@ namespace Godot bool alpha; - if (color.Length == 8) - alpha = true; - else if (color.Length == 6) - alpha = false; - else - return false; + switch (color.Length) + { + case 8: + alpha = true; + break; + case 6: + alpha = false; + break; + default: + return false; + } if (alpha) { diff --git a/modules/mono/glue/Managed/Files/Dispatcher.cs b/modules/mono/glue/Managed/Files/Dispatcher.cs new file mode 100644 index 0000000000..072e0f20ff --- /dev/null +++ b/modules/mono/glue/Managed/Files/Dispatcher.cs @@ -0,0 +1,13 @@ +using System.Runtime.CompilerServices; + +namespace Godot +{ + public static class Dispatcher + { + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern GodotTaskScheduler godot_icall_DefaultGodotTaskScheduler(); + + public static GodotSynchronizationContext SynchronizationContext => + godot_icall_DefaultGodotTaskScheduler().Context; + } +} diff --git a/modules/mono/glue/Managed/Files/GodotSynchronizationContext.cs b/modules/mono/glue/Managed/Files/GodotSynchronizationContext.cs index e727781d63..4b5e3f8761 100644 --- a/modules/mono/glue/Managed/Files/GodotSynchronizationContext.cs +++ b/modules/mono/glue/Managed/Files/GodotSynchronizationContext.cs @@ -6,17 +6,16 @@ namespace Godot { public class GodotSynchronizationContext : SynchronizationContext { - private readonly BlockingCollection<KeyValuePair<SendOrPostCallback, object>> queue = new BlockingCollection<KeyValuePair<SendOrPostCallback, object>>(); + private readonly BlockingCollection<KeyValuePair<SendOrPostCallback, object>> _queue = new BlockingCollection<KeyValuePair<SendOrPostCallback, object>>(); public override void Post(SendOrPostCallback d, object state) { - queue.Add(new KeyValuePair<SendOrPostCallback, object>(d, state)); + _queue.Add(new KeyValuePair<SendOrPostCallback, object>(d, state)); } public void ExecutePendingContinuations() { - KeyValuePair<SendOrPostCallback, object> workItem; - while (queue.TryTake(out workItem)) + while (_queue.TryTake(out var workItem)) { workItem.Key(workItem.Value); } diff --git a/modules/mono/glue/Managed/Files/GodotTaskScheduler.cs b/modules/mono/glue/Managed/Files/GodotTaskScheduler.cs index 9a40fef5a9..8eaeea50dc 100644 --- a/modules/mono/glue/Managed/Files/GodotTaskScheduler.cs +++ b/modules/mono/glue/Managed/Files/GodotTaskScheduler.cs @@ -8,7 +8,7 @@ namespace Godot { public class GodotTaskScheduler : TaskScheduler { - private GodotSynchronizationContext Context { get; set; } + internal GodotSynchronizationContext Context { get; } private readonly LinkedList<Task> _tasks = new LinkedList<Task>(); public GodotTaskScheduler() @@ -28,14 +28,10 @@ namespace Godot protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) { if (SynchronizationContext.Current != Context) - { return false; - } if (taskWasPreviouslyQueued) - { TryDequeue(task); - } return TryExecuteTask(task); } @@ -52,7 +48,8 @@ namespace Godot { lock (_tasks) { - return _tasks.ToArray(); + foreach (Task task in _tasks) + yield return task; } } diff --git a/modules/mono/glue/Managed/Files/Mathf.cs b/modules/mono/glue/Managed/Files/Mathf.cs index 2d8c63fe7f..15adf0a13b 100644 --- a/modules/mono/glue/Managed/Files/Mathf.cs +++ b/modules/mono/glue/Managed/Files/Mathf.cs @@ -185,6 +185,12 @@ namespace Godot return from + (to - from) * 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; + } + public static real_t Log(real_t s) { return (real_t)Math.Log(s); @@ -330,14 +336,14 @@ namespace Godot public static int Wrap(int value, int min, int max) { - int rng = max - min; - return rng != 0 ? min + ((value - min) % rng + rng) % rng : min; + int range = max - min; + return range == 0 ? min : min + ((value - min) % range + range) % range; } public static real_t Wrap(real_t value, real_t min, real_t max) { - real_t rng = max - min; - return !IsEqualApprox(rng, default(real_t)) ? min + ((value - min) % rng + rng) % rng : min; + real_t range = max - min; + return IsZeroApprox(range) ? min : min + ((value - min) % range + range) % range; } } } diff --git a/modules/mono/glue/Managed/Files/NodePath.cs b/modules/mono/glue/Managed/Files/NodePath.cs index 94a4ed1de9..4de4e1e6a9 100644 --- a/modules/mono/glue/Managed/Files/NodePath.cs +++ b/modules/mono/glue/Managed/Files/NodePath.cs @@ -55,7 +55,7 @@ namespace Godot get { return ptr; } } - public NodePath() : this(string.Empty) { } + public NodePath() : this(string.Empty) {} public NodePath(string path) { diff --git a/modules/mono/glue/Managed/Files/Plane.cs b/modules/mono/glue/Managed/Files/Plane.cs index e16d4315be..a13161d2e6 100644 --- a/modules/mono/glue/Managed/Files/Plane.cs +++ b/modules/mono/glue/Managed/Files/Plane.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.InteropServices; #if REAL_T_IS_DOUBLE using real_t = System.Double; #else @@ -7,6 +8,8 @@ using real_t = System.Single; namespace Godot { + [Serializable] + [StructLayout(LayoutKind.Sequential)] public struct Plane : IEquatable<Plane> { private Vector3 _normal; diff --git a/modules/mono/glue/Managed/Files/Quat.cs b/modules/mono/glue/Managed/Files/Quat.cs index 0d4349084a..845c7c730e 100644 --- a/modules/mono/glue/Managed/Files/Quat.cs +++ b/modules/mono/glue/Managed/Files/Quat.cs @@ -8,6 +8,7 @@ using real_t = System.Single; namespace Godot { + [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Quat : IEquatable<Quat> { @@ -95,6 +96,7 @@ namespace Godot return this / Length; } + [Obsolete("Set is deprecated. Use the Quat(" + nameof(real_t) + ", " + nameof(real_t) + ", " + nameof(real_t) + ", " + nameof(real_t) + ") constructor instead.", error: true)] public void Set(real_t x, real_t y, real_t z, real_t w) { this.x = x; @@ -103,16 +105,19 @@ namespace Godot this.w = w; } + [Obsolete("Set is deprecated. Use the Quat(" + nameof(Quat) + ") constructor instead.", error: true)] public void Set(Quat q) { this = q; } + [Obsolete("SetAxisAngle is deprecated. Use the Quat(" + nameof(Vector3) + ", " + nameof(real_t) + ") constructor instead.", error: true)] public void SetAxisAngle(Vector3 axis, real_t angle) { this = new Quat(axis, angle); } + [Obsolete("SetEuler is deprecated. Use the Quat(" + nameof(Vector3) + ") constructor instead.", error: true)] public void SetEuler(Vector3 eulerYXZ) { this = new Quat(eulerYXZ); @@ -229,9 +234,9 @@ namespace Godot public Quat(Vector3 eulerYXZ) { - real_t half_a1 = eulerYXZ.y * (real_t)0.5; - real_t half_a2 = eulerYXZ.x * (real_t)0.5; - real_t half_a3 = eulerYXZ.z * (real_t)0.5; + real_t half_a1 = eulerYXZ.y * 0.5f; + real_t half_a2 = eulerYXZ.x * 0.5f; + real_t half_a3 = eulerYXZ.z * 0.5f; // R = Y(a1).X(a2).Z(a3) convention for Euler angles. // Conversion to quaternion as listed in https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770024290.pdf (page A-6) @@ -246,7 +251,7 @@ namespace Godot x = sin_a1 * cos_a2 * sin_a3 + cos_a1 * sin_a2 * cos_a3; y = sin_a1 * cos_a2 * cos_a3 - cos_a1 * sin_a2 * sin_a3; - z = -sin_a1 * sin_a2 * cos_a3 + cos_a1 * cos_a2 * sin_a3; + z = cos_a1 * cos_a2 * sin_a3 - sin_a1 * sin_a2 * cos_a3; w = sin_a1 * sin_a2 * sin_a3 + cos_a1 * cos_a2 * cos_a3; } diff --git a/modules/mono/glue/Managed/Files/Rect2.cs b/modules/mono/glue/Managed/Files/Rect2.cs index 888f300347..f3dc9d8490 100644 --- a/modules/mono/glue/Managed/Files/Rect2.cs +++ b/modules/mono/glue/Managed/Files/Rect2.cs @@ -8,6 +8,7 @@ using real_t = System.Single; namespace Godot { + [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Rect2 : IEquatable<Rect2> { diff --git a/modules/mono/glue/Managed/Files/StringExtensions.cs b/modules/mono/glue/Managed/Files/StringExtensions.cs index b43034fbb5..6045c83e95 100644 --- a/modules/mono/glue/Managed/Files/StringExtensions.cs +++ b/modules/mono/glue/Managed/Files/StringExtensions.cs @@ -98,6 +98,66 @@ namespace Godot } // <summary> + // Return the amount of substrings in string. + // </summary> + public static int Count(this string instance, string what, bool caseSensitive = true, int from = 0, int to = 0) + { + if (what.Length == 0) + { + return 0; + } + + int len = instance.Length; + int slen = what.Length; + + if (len < slen) + { + return 0; + } + + string str; + + if (from >= 0 && to >= 0) + { + if (to == 0) + { + to = len; + } + else if (from >= to) + { + return 0; + } + if (from == 0 && to == len) + { + str = instance; + } + else + { + str = instance.Substring(from, to - from); + } + } + else + { + return 0; + } + + int c = 0; + int idx; + + do + { + idx = str.IndexOf(what, caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase); + if (idx != -1) + { + str = str.Substring(idx + slen); + ++c; + } + } while (idx != -1); + + return c; + } + + // <summary> // Return a copy of the string with special characters escaped using the C language standard. // </summary> public static string CEscape(this string instance) diff --git a/modules/mono/glue/Managed/Files/Transform.cs b/modules/mono/glue/Managed/Files/Transform.cs index bd79144873..cc4d26158d 100644 --- a/modules/mono/glue/Managed/Files/Transform.cs +++ b/modules/mono/glue/Managed/Files/Transform.cs @@ -8,6 +8,7 @@ using real_t = System.Single; namespace Godot { + [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Transform : IEquatable<Transform> { @@ -33,7 +34,7 @@ namespace Godot Vector3 destinationLocation = transform.origin; var interpolated = new Transform(); - interpolated.basis.SetQuantScale(sourceRotation.Slerp(destinationRotation, c).Normalized(), sourceScale.LinearInterpolate(destinationScale, c)); + interpolated.basis.SetQuatScale(sourceRotation.Slerp(destinationRotation, c).Normalized(), sourceScale.LinearInterpolate(destinationScale, c)); interpolated.origin = sourceLocation.LinearInterpolate(destinationLocation, c); return interpolated; diff --git a/modules/mono/glue/Managed/Files/Transform2D.cs b/modules/mono/glue/Managed/Files/Transform2D.cs index 33ff286769..814332dc07 100644 --- a/modules/mono/glue/Managed/Files/Transform2D.cs +++ b/modules/mono/glue/Managed/Files/Transform2D.cs @@ -8,6 +8,7 @@ using real_t = System.Single; namespace Godot { + [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Transform2D : IEquatable<Transform2D> { @@ -98,6 +99,8 @@ namespace Godot return x[columnIndex]; case 1: return y[columnIndex]; + case 2: + return origin[columnIndex]; default: throw new IndexOutOfRangeException(); } @@ -112,6 +115,9 @@ namespace Godot case 1: y[columnIndex] = value; return; + case 2: + origin[columnIndex] = value; + return; default: throw new IndexOutOfRangeException(); } @@ -136,7 +142,7 @@ namespace Godot inv[0] *= new Vector2(detInv, -detInv); inv[1] *= new Vector2(-detInv, detInv); - inv[2] = BasisXform(-inv[2]); + inv[2] = inv.BasisXform(-inv[2]); return inv; } diff --git a/modules/mono/glue/Managed/Files/Vector2.cs b/modules/mono/glue/Managed/Files/Vector2.cs index a7f26283a7..b1c1dae3c2 100644 --- a/modules/mono/glue/Managed/Files/Vector2.cs +++ b/modules/mono/glue/Managed/Files/Vector2.cs @@ -14,6 +14,7 @@ using real_t = System.Single; namespace Godot { + [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Vector2 : IEquatable<Vector2> { @@ -222,11 +223,13 @@ namespace Godot return new Vector2(Mathf.Round(x), Mathf.Round(y)); } + [Obsolete("Set is deprecated. Use the Vector2(" + nameof(real_t) + ", " + nameof(real_t) + ") constructor instead.", error: true)] public void Set(real_t x, real_t y) { this.x = x; this.y = y; } + [Obsolete("Set is deprecated. Use the Vector2(" + nameof(Vector2) + ") constructor instead.", error: true)] public void Set(Vector2 v) { x = v.x; diff --git a/modules/mono/glue/Managed/Files/Vector3.cs b/modules/mono/glue/Managed/Files/Vector3.cs index 16803ae55c..c2da7b8bb1 100644 --- a/modules/mono/glue/Managed/Files/Vector3.cs +++ b/modules/mono/glue/Managed/Files/Vector3.cs @@ -14,6 +14,7 @@ using real_t = System.Single; namespace Godot { + [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Vector3 : IEquatable<Vector3> { @@ -248,12 +249,14 @@ namespace Godot return new Basis(axis, phi).Xform(this); } + [Obsolete("Set is deprecated. Use the Vector3(" + nameof(real_t) + ", " + nameof(real_t) + ", " + nameof(real_t) + ") constructor instead.", error: true)] public void Set(real_t x, real_t y, real_t z) { this.x = x; this.y = y; this.z = z; } + [Obsolete("Set is deprecated. Use the Vector3(" + nameof(Vector3) + ") constructor instead.", error: true)] public void Set(Vector3 v) { x = v.x; diff --git a/modules/mono/glue/Managed/Managed.csproj b/modules/mono/glue/Managed/Managed.csproj index 61f738922b..ad55fe9539 100644 --- a/modules/mono/glue/Managed/Managed.csproj +++ b/modules/mono/glue/Managed/Managed.csproj @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -37,4 +37,4 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -</Project> +</Project>
\ No newline at end of file diff --git a/modules/mono/glue/gd_glue.cpp b/modules/mono/glue/gd_glue.cpp index 7c30092855..8b9a1380d8 100644 --- a/modules/mono/glue/gd_glue.cpp +++ b/modules/mono/glue/gd_glue.cpp @@ -167,7 +167,7 @@ MonoObject *godot_icall_GD_str2var(MonoString *p_str) { int line; Error err = VariantParser::parse(&ss, ret, errs, line); if (err != OK) { - String err_str = "Parse error at line " + itos(line) + ": " + errs; + String err_str = "Parse error at line " + itos(line) + ": " + errs + "."; ERR_PRINTS(err_str); ret = err_str; } @@ -193,8 +193,7 @@ MonoArray *godot_icall_GD_var2bytes(MonoObject *p_var, MonoBoolean p_full_object PoolByteArray barr; int len; Error err = encode_variant(var, NULL, len, p_full_objects); - ERR_EXPLAIN("Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID)."); - ERR_FAIL_COND_V(err != OK, NULL); + ERR_FAIL_COND_V_MSG(err != OK, NULL, "Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID)."); barr.resize(len); { @@ -211,6 +210,10 @@ MonoString *godot_icall_GD_var2str(MonoObject *p_var) { return GDMonoMarshal::mono_string_from_godot(vars); } +MonoObject *godot_icall_DefaultGodotTaskScheduler() { + return GDMonoUtils::mono_cache.task_scheduler_handle->get_target(); +} + void godot_register_gd_icalls() { mono_add_internal_call("Godot.GD::godot_icall_GD_bytes2var", (void *)godot_icall_GD_bytes2var); mono_add_internal_call("Godot.GD::godot_icall_GD_convert", (void *)godot_icall_GD_convert); @@ -234,6 +237,9 @@ void godot_register_gd_icalls() { mono_add_internal_call("Godot.GD::godot_icall_GD_type_exists", (void *)godot_icall_GD_type_exists); mono_add_internal_call("Godot.GD::godot_icall_GD_var2bytes", (void *)godot_icall_GD_var2bytes); mono_add_internal_call("Godot.GD::godot_icall_GD_var2str", (void *)godot_icall_GD_var2str); + + // Dispatcher + mono_add_internal_call("Godot.Dispatcher::godot_icall_DefaultGodotTaskScheduler", (void *)godot_icall_DefaultGodotTaskScheduler); } #endif // MONO_GLUE_ENABLED diff --git a/modules/mono/glue/gd_glue.h b/modules/mono/glue/gd_glue.h index d4e20e2887..a34c0bc50f 100644 --- a/modules/mono/glue/gd_glue.h +++ b/modules/mono/glue/gd_glue.h @@ -75,6 +75,8 @@ MonoArray *godot_icall_GD_var2bytes(MonoObject *p_var, MonoBoolean p_full_object MonoString *godot_icall_GD_var2str(MonoObject *p_var); +MonoObject *godot_icall_DefaultGodotTaskScheduler(); + // Register internal calls void godot_register_gd_icalls(); diff --git a/modules/mono/godotsharp_defs.h b/modules/mono/godotsharp_defs.h index 4ad4088514..4c17a6ec9d 100644 --- a/modules/mono/godotsharp_defs.h +++ b/modules/mono/godotsharp_defs.h @@ -39,8 +39,8 @@ #define API_SOLUTION_NAME "GodotSharp" #define CORE_API_ASSEMBLY_NAME "GodotSharp" #define EDITOR_API_ASSEMBLY_NAME "GodotSharpEditor" -#define TOOLS_ASSEMBLY_NAME "GodotTools" -#define TOOLS_PROJECT_EDITOR_ASSEMBLY_NAME "GodotTools.ProjectEditor" +#define TOOLS_ASM_NAME "GodotTools" +#define TOOLS_PROJECT_EDITOR_ASM_NAME "GodotTools.ProjectEditor" #define BINDINGS_CLASS_NATIVECALLS "NativeCalls" #define BINDINGS_CLASS_NATIVECALLS_EDITOR "EditorNativeCalls" diff --git a/modules/mono/icons/icon_c_#.svg b/modules/mono/icons/icon_c_#.svg new file mode 100644 index 0000000000..69664ca553 --- /dev/null +++ b/modules/mono/icons/icon_c_#.svg @@ -0,0 +1,5 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<path d="m6 1046.4c-1.6569 0-3 1.3431-3 3s1.3431 3 3 3h1v-2h-1c-0.55228 0-1-0.4478-1-1 0-0.5523 0.44772-1 1-1h1v-2zm1-9-0.56445 2.2578c-0.23643 0.076-0.46689 0.1692-0.68945 0.2793l-1.9883-1.1933-1.4141 1.414 1.1953 1.9942c-0.11191 0.2211-0.20723 0.4502-0.28516 0.6855l-2.2539 0.5625v2h5.2715c-0.17677-0.3037-0.27041-0.6486-0.27148-1 9.6e-6 -1.1046 0.89543-2 2-2s2 0.8954 2 2c-4.817e-4 0.3512-0.093442 0.6961-0.26953 1h5.2695v-2l-2.2578-0.5645c-0.07594-0.2357-0.1693-0.4655-0.2793-0.6875l1.1934-1.9902-1.4141-1.414-1.9941 1.1953c-0.22113-0.1119-0.45028-0.2073-0.68555-0.2852l-0.5625-2.2539zm4 9c-0.71466-1e-4 -1.3751 0.3811-1.7324 1-0.35727 0.6188-0.35727 1.3812 0 2 0.35733 0.6189 1.0178 1.0001 1.7324 1h-2v2h2c0.71466 1e-4 1.3751-0.3811 1.7324-1 0.35727-0.6188 0.35727-1.3812 0-2-0.35733-0.6189-1.0178-1.0001-1.7324-1h2v-2z" fill="#e0e0e0"/> +</g> +</svg> diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 06fbae019c..eed8812305 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -59,10 +59,6 @@ #include "android_mono_config.gen.h" #endif -#define OUT_OF_SYNC_ERR_MESSAGE(m_assembly_name) "The assembly '" m_assembly_name "' is out of sync. " \ - "This error is expected if you just upgraded to a newer Godot version. " \ - "Building the project will update the assembly to the correct version." - GDMono *GDMono::singleton = NULL; namespace { @@ -269,7 +265,7 @@ void GDMono::initialize() { #ifdef WINDOWS_ENABLED if (assembly_rootdir.empty() || config_dir.empty()) { - ERR_PRINT("Cannot find Mono in the registry"); + ERR_PRINT("Cannot find Mono in the registry."); // Assertion: if they are not set, then they weren't found in the registry CRASH_COND(mono_reg_info.assembly_dir.length() > 0 || mono_reg_info.config_dir.length() > 0); } @@ -287,6 +283,18 @@ void GDMono::initialize() { add_mono_shared_libs_dir_to_path(); + { + PropertyInfo exc_policy_prop = PropertyInfo(Variant::INT, "mono/unhandled_exception_policy", PROPERTY_HINT_ENUM, + vformat("Terminate Application:%s,Log Error:%s", (int)POLICY_TERMINATE_APP, (int)POLICY_LOG_ERROR)); + unhandled_exception_policy = (UnhandledExceptionPolicy)(int)GLOBAL_DEF(exc_policy_prop.name, (int)POLICY_TERMINATE_APP); + ProjectSettings::get_singleton()->set_custom_property_info(exc_policy_prop.name, exc_policy_prop); + + if (Engine::get_singleton()->is_editor_hint()) { + // Unhandled exceptions should not terminate the editor + unhandled_exception_policy = POLICY_LOG_ERROR; + } + } + GDMonoAssembly::initialize(); gdmono_profiler_init(); @@ -304,32 +312,13 @@ void GDMono::initialize() { mono_install_unhandled_exception_hook(&unhandled_exception_hook, NULL); #ifndef TOOLS_ENABLED - if (!DirAccess::exists("res://.mono")) { - // 'res://.mono/' is missing so there is nothing to load. We don't need to initialize mono, but - // we still do so unless mscorlib is missing (which is the case for projects that don't use C#). - - String mscorlib_fname("mscorlib.dll"); - - Vector<String> search_dirs; - GDMonoAssembly::fill_search_dirs(search_dirs); - - bool found = false; - for (int i = 0; i < search_dirs.size(); i++) { - if (FileAccess::exists(search_dirs[i].plus_file(mscorlib_fname))) { - found = true; - break; - } - } - - if (!found) - return; // mscorlib is missing, do not initialize mono - } + // Export templates only load the Mono runtime if the project uses it + if (!DirAccess::exists("res://.mono")) + return; #endif root_domain = mono_jit_init_version("GodotEngine.RootDomain", "v4.0.30319"); - - ERR_EXPLAIN("Mono: Failed to initialize runtime"); - ERR_FAIL_NULL(root_domain); + ERR_FAIL_NULL_MSG(root_domain, "Mono: Failed to initialize runtime."); GDMonoUtils::set_main_thread(GDMonoUtils::get_current_thread()); @@ -340,11 +329,11 @@ void GDMono::initialize() { print_verbose("Mono: Runtime initialized"); // mscorlib assembly MUST be present at initialization - ERR_EXPLAIN("Mono: Failed to load mscorlib assembly"); - ERR_FAIL_COND(!_load_corlib_assembly()); + bool corlib_loaded = _load_corlib_assembly(); + ERR_FAIL_COND_MSG(!corlib_loaded, "Mono: Failed to load mscorlib assembly."); - ERR_EXPLAIN("Mono: Failed to load scripts domain"); - ERR_FAIL_COND(_load_scripts_domain() != OK); + Error domain_load_err = _load_scripts_domain(); + ERR_FAIL_COND_MSG(domain_load_err != OK, "Mono: Failed to load scripts domain."); #ifdef DEBUG_ENABLED bool debugger_attached = _wait_for_debugger_msecs(500); @@ -354,63 +343,45 @@ void GDMono::initialize() { _register_internal_calls(); - // The following assemblies are not required at initialization -#ifdef MONO_GLUE_ENABLED - if (_load_api_assemblies()) { - // Everything is fine with the api assemblies, load the tools and project assemblies - -#if defined(TOOLS_ENABLED) - ERR_EXPLAIN("Mono: Failed to load GodotTools assemblies"); - ERR_FAIL_COND(!_load_tools_assemblies()); -#endif + print_verbose("Mono: INITIALIZED"); +} - _load_project_assembly(); +void GDMono::initialize_load_assemblies() { - } else { - if ((core_api_assembly && (core_api_assembly_out_of_sync || !GDMonoUtils::mono_cache.godot_api_cache_updated)) -#ifdef TOOLS_ENABLED - || (editor_api_assembly && editor_api_assembly_out_of_sync) +#ifndef MONO_GLUE_ENABLED + CRASH_NOW_MSG("Mono: This binary was built with 'mono_glue=no'; cannot load assemblies."); #endif - ) { -#ifdef TOOLS_ENABLED - // The assembly was successfully loaded, but the full api could not be cached. - // This is most likely an outdated assembly loaded because of an invalid version in the - // metadata, so we invalidate the version in the metadata and unload the script domain. - - if (core_api_assembly_out_of_sync) { - ERR_PRINT(OUT_OF_SYNC_ERR_MESSAGE(CORE_API_ASSEMBLY_NAME)); - metadata_set_api_assembly_invalidated(APIAssembly::API_CORE, true); - } else if (!GDMonoUtils::mono_cache.godot_api_cache_updated) { - ERR_PRINT("The loaded assembly '" CORE_API_ASSEMBLY_NAME "' is in sync, but the cache update failed"); - metadata_set_api_assembly_invalidated(APIAssembly::API_CORE, true); - } - if (editor_api_assembly_out_of_sync) { - ERR_PRINT(OUT_OF_SYNC_ERR_MESSAGE(EDITOR_API_ASSEMBLY_NAME)); - metadata_set_api_assembly_invalidated(APIAssembly::API_EDITOR, true); - } + // Load assemblies. The API and tools assemblies are required, + // the application is aborted if these assemblies cannot be loaded. - print_line("Mono: Proceeding to unload scripts domain because of invalid API assemblies."); + _load_api_assemblies(); - Error err = _unload_scripts_domain(); - if (err != OK) { - WARN_PRINT("Mono: Failed to unload scripts domain"); - } -#else - ERR_PRINT("The loaded API assembly is invalid"); - CRASH_NOW(); -#endif // TOOLS_ENABLED - } +#if defined(TOOLS_ENABLED) + bool tool_assemblies_loaded = _load_tools_assemblies(); + CRASH_COND_MSG(!tool_assemblies_loaded, "Mono: Failed to load '" TOOLS_ASM_NAME "' assemblies."); +#endif + + // Load the project's main assembly. This doesn't necessarily need to succeed. + // The game may not be using .NET at all, or if the project does use .NET and + // we're running in the editor, it may just happen to be it wasn't built yet. + if (!_load_project_assembly()) { + if (OS::get_singleton()->is_stdout_verbose()) + print_error("Mono: Failed to load project assembly"); } -#else - print_verbose("Mono: Glue disabled, ignoring script assemblies."); -#endif // MONO_GLUE_ENABLED +} - print_verbose("Mono: INITIALIZED"); +bool GDMono::_are_api_assemblies_out_of_sync() { + bool out_of_sync = core_api_assembly && (core_api_assembly_out_of_sync || !GDMonoUtils::mono_cache.godot_api_cache_updated); +#ifdef TOOLS_ENABLED + if (!out_of_sync) + out_of_sync = editor_api_assembly && editor_api_assembly_out_of_sync; +#endif + return out_of_sync; } -#ifdef MONO_GLUE_ENABLED namespace GodotSharpBindings { +#ifdef MONO_GLUE_ENABLED uint64_t get_core_api_hash(); #ifdef TOOLS_ENABLED @@ -419,25 +390,45 @@ uint64_t get_editor_api_hash(); uint32_t get_bindings_version(); void register_generated_icalls(); -} // namespace GodotSharpBindings + +#else + +uint64_t get_core_api_hash() { + CRASH_NOW(); + GD_UNREACHABLE(); +} +#ifdef TOOLS_ENABLED +uint64_t get_editor_api_hash() { + CRASH_NOW(); + GD_UNREACHABLE(); +} #endif +uint32_t get_bindings_version() { + CRASH_NOW(); + GD_UNREACHABLE(); +} + +void register_generated_icalls() { + /* Fine, just do nothing */ +} + +#endif // MONO_GLUE_ENABLED +} // namespace GodotSharpBindings void GDMono::_register_internal_calls() { -#ifdef MONO_GLUE_ENABLED GodotSharpBindings::register_generated_icalls(); -#endif } void GDMono::_initialize_and_check_api_hashes() { #ifdef MONO_GLUE_ENABLED if (get_api_core_hash() != GodotSharpBindings::get_core_api_hash()) { - ERR_PRINT("Mono: Core API hash mismatch!"); + ERR_PRINT("Mono: Core API hash mismatch."); } #ifdef TOOLS_ENABLED if (get_api_editor_hash() != GodotSharpBindings::get_editor_api_hash()) { - ERR_PRINT("Mono: Editor API hash mismatch!"); + ERR_PRINT("Mono: Editor API hash mismatch."); } #endif // TOOLS_ENABLED #endif // MONO_GLUE_ENABLED @@ -565,49 +556,103 @@ bool GDMono::_load_corlib_assembly() { } #ifdef TOOLS_ENABLED -static bool copy_api_assembly(const String &p_src_dir, const String &p_dst_dir, const String &p_assembly_name, APIAssembly::Type p_api_type) { +bool GDMono::copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config) { + + bool &api_assembly_out_of_sync = (p_api_type == APIAssembly::API_CORE) ? + GDMono::get_singleton()->core_api_assembly_out_of_sync : + GDMono::get_singleton()->editor_api_assembly_out_of_sync; + + String src_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(p_config); + String dst_dir = GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config); + + String assembly_name = p_api_type == APIAssembly::API_CORE ? CORE_API_ASSEMBLY_NAME : EDITOR_API_ASSEMBLY_NAME; // Create destination directory if needed - if (!DirAccess::exists(p_dst_dir)) { - DirAccess *da = DirAccess::create_for_path(p_dst_dir); - Error err = da->make_dir_recursive(p_dst_dir); + if (!DirAccess::exists(dst_dir)) { + DirAccess *da = DirAccess::create_for_path(dst_dir); + Error err = da->make_dir_recursive(dst_dir); memdelete(da); if (err != OK) { - ERR_PRINTS("Failed to create destination directory for the API assemblies. Error: " + itos(err)); + ERR_PRINTS("Failed to create destination directory for the API assemblies. Error: " + itos(err) + "."); return false; } } - String assembly_file = p_assembly_name + ".dll"; - String assembly_src = p_src_dir.plus_file(assembly_file); - String assembly_dst = p_dst_dir.plus_file(assembly_file); + String assembly_file = assembly_name + ".dll"; + String assembly_src = src_dir.plus_file(assembly_file); + String assembly_dst = dst_dir.plus_file(assembly_file); - if (!FileAccess::exists(assembly_dst) || - FileAccess::get_modified_time(assembly_src) > FileAccess::get_modified_time(assembly_dst) || - GDMono::get_singleton()->metadata_is_api_assembly_invalidated(p_api_type)) { + if (!FileAccess::exists(assembly_dst) || api_assembly_out_of_sync) { DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - String xml_file = p_assembly_name + ".xml"; - if (da->copy(p_src_dir.plus_file(xml_file), p_dst_dir.plus_file(xml_file)) != OK) - WARN_PRINTS("Failed to copy " + xml_file); + String xml_file = assembly_name + ".xml"; + if (da->copy(src_dir.plus_file(xml_file), dst_dir.plus_file(xml_file)) != OK) + WARN_PRINTS("Failed to copy '" + xml_file + "'."); - String pdb_file = p_assembly_name + ".pdb"; - if (da->copy(p_src_dir.plus_file(pdb_file), p_dst_dir.plus_file(pdb_file)) != OK) - WARN_PRINTS("Failed to copy " + pdb_file); + String pdb_file = assembly_name + ".pdb"; + if (da->copy(src_dir.plus_file(pdb_file), dst_dir.plus_file(pdb_file)) != OK) + WARN_PRINTS("Failed to copy '" + pdb_file + "'."); Error err = da->copy(assembly_src, assembly_dst); if (err != OK) { - ERR_PRINTS("Failed to copy " + assembly_file); + ERR_PRINTS("Failed to copy '" + assembly_file + "'."); return false; } - GDMono::get_singleton()->metadata_set_api_assembly_invalidated(p_api_type, false); + api_assembly_out_of_sync = false; } return true; } + +String GDMono::update_api_assemblies_from_prebuilt() { + +#define FAIL_REASON(m_out_of_sync, m_prebuilt_exists) \ + ( \ + (m_out_of_sync ? \ + String("The assembly is invalidated ") : \ + String("The assembly was not found ")) + \ + (m_prebuilt_exists ? \ + String("and the prebuilt assemblies are missing.") : \ + String("and we failed to copy the prebuilt assemblies."))) + + bool api_assembly_out_of_sync = core_api_assembly_out_of_sync || editor_api_assembly_out_of_sync; + + String core_assembly_path = GodotSharpDirs::get_res_assemblies_dir().plus_file(CORE_API_ASSEMBLY_NAME ".dll"); + String editor_assembly_path = GodotSharpDirs::get_res_assemblies_dir().plus_file(EDITOR_API_ASSEMBLY_NAME ".dll"); + + if (!api_assembly_out_of_sync && FileAccess::exists(core_assembly_path) && FileAccess::exists(editor_assembly_path)) + return String(); // No update needed + + const int CONFIGS_LEN = 2; + String configs[CONFIGS_LEN] = { String("Debug"), String("Release") }; + + for (int i = 0; i < CONFIGS_LEN; i++) { + String config = configs[i]; + + print_verbose("Updating '" + config + "' API assemblies"); + + String prebuilt_api_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(config); + String prebuilt_core_dll_path = prebuilt_api_dir.plus_file(CORE_API_ASSEMBLY_NAME ".dll"); + String prebuilt_editor_dll_path = prebuilt_api_dir.plus_file(EDITOR_API_ASSEMBLY_NAME ".dll"); + + if (!FileAccess::exists(prebuilt_core_dll_path) || !FileAccess::exists(prebuilt_editor_dll_path)) { + return FAIL_REASON(api_assembly_out_of_sync, /* prebuilt_exists: */ false); + } + + // Copy the prebuilt Api + if (!copy_prebuilt_api_assembly(APIAssembly::API_CORE, config) || + !copy_prebuilt_api_assembly(APIAssembly::API_EDITOR, config)) { + return FAIL_REASON(api_assembly_out_of_sync, /* prebuilt_exists: */ true); + } + } + + return String(); // Updated successfully + +#undef FAIL_REASON +} #endif bool GDMono::_load_core_api_assembly() { @@ -616,35 +661,22 @@ bool GDMono::_load_core_api_assembly() { return true; #ifdef TOOLS_ENABLED - if (metadata_is_api_assembly_invalidated(APIAssembly::API_CORE)) { - String prebuilt_api_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file("Debug"); - String prebuilt_dll_path = prebuilt_api_dir.plus_file(CORE_API_ASSEMBLY_NAME ".dll"); - String invalidated_dll_path = get_invalidated_api_assembly_path(APIAssembly::API_CORE); - - if (!FileAccess::exists(prebuilt_dll_path) || - FileAccess::get_modified_time(invalidated_dll_path) == FileAccess::get_modified_time(prebuilt_dll_path)) { - print_verbose("Mono: Skipping loading of Core API assembly because it was invalidated"); - return false; - } else { - // Copy the prebuilt Api - String res_assemblies_dir = GodotSharpDirs::get_res_assemblies_dir(); - if (!copy_api_assembly(prebuilt_api_dir, res_assemblies_dir, CORE_API_ASSEMBLY_NAME, APIAssembly::API_CORE) || - !copy_api_assembly(prebuilt_api_dir, res_assemblies_dir, EDITOR_API_ASSEMBLY_NAME, APIAssembly::API_EDITOR)) { - print_verbose("Mono: Failed to copy prebuilt API. Skipping loading of Core API assembly because it was invalidated"); - return false; - } - } - } -#endif + // For the editor and the editor player we want to load it from a specific path to make sure we can keep it up to date + + // If running the project manager, load it from the prebuilt API directory + String assembly_dir = !Main::is_project_manager() ? + GodotSharpDirs::get_res_assemblies_dir() : + GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file("Debug"); - String assembly_path = GodotSharpDirs::get_res_assemblies_dir().plus_file(CORE_API_ASSEMBLY_NAME ".dll"); + String assembly_path = assembly_dir.plus_file(CORE_API_ASSEMBLY_NAME ".dll"); - bool success = (FileAccess::exists(assembly_path) && - load_assembly_from(CORE_API_ASSEMBLY_NAME, assembly_path, &core_api_assembly)) || - load_assembly(CORE_API_ASSEMBLY_NAME, &core_api_assembly); + bool success = FileAccess::exists(assembly_path) && + load_assembly_from(CORE_API_ASSEMBLY_NAME, assembly_path, &core_api_assembly); +#else + bool success = load_assembly(CORE_API_ASSEMBLY_NAME, &core_api_assembly); +#endif if (success) { -#ifdef MONO_GLUE_ENABLED APIAssembly::Version api_assembly_ver = APIAssembly::Version::get_from_loaded_assembly(core_api_assembly, APIAssembly::API_CORE); core_api_assembly_out_of_sync = GodotSharpBindings::get_core_api_hash() != api_assembly_ver.godot_api_hash || GodotSharpBindings::get_bindings_version() != api_assembly_ver.bindings_version || @@ -654,9 +686,8 @@ bool GDMono::_load_core_api_assembly() { _install_trace_listener(); } -#else - GDMonoUtils::update_godot_api_cache(); -#endif + } else { + core_api_assembly_out_of_sync = false; } return success; @@ -668,52 +699,115 @@ bool GDMono::_load_editor_api_assembly() { if (editor_api_assembly) return true; - if (metadata_is_api_assembly_invalidated(APIAssembly::API_EDITOR)) { - String prebuilt_api_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file("Debug"); - String prebuilt_dll_path = prebuilt_api_dir.plus_file(EDITOR_API_ASSEMBLY_NAME ".dll"); - String invalidated_dll_path = get_invalidated_api_assembly_path(APIAssembly::API_EDITOR); + // For the editor and the editor player we want to load it from a specific path to make sure we can keep it up to date - if (!FileAccess::exists(prebuilt_dll_path) || - FileAccess::get_modified_time(invalidated_dll_path) == FileAccess::get_modified_time(prebuilt_dll_path)) { - print_verbose("Mono: Skipping loading of Editor API assembly because it was invalidated"); - return false; - } else { - // Copy the prebuilt editor Api (no need to copy the core api if we got to this point) - String res_assemblies_dir = GodotSharpDirs::get_res_assemblies_dir(); - if (!copy_api_assembly(prebuilt_api_dir, res_assemblies_dir, EDITOR_API_ASSEMBLY_NAME, APIAssembly::API_EDITOR)) { - print_verbose("Mono: Failed to copy prebuilt API. Skipping loading of Editor API assembly because it was invalidated"); - return false; - } - } - } + // If running the project manager, load it from the prebuilt API directory + String assembly_dir = !Main::is_project_manager() ? + GodotSharpDirs::get_res_assemblies_dir() : + GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file("Debug"); - String assembly_path = GodotSharpDirs::get_res_assemblies_dir().plus_file(EDITOR_API_ASSEMBLY_NAME ".dll"); + String assembly_path = assembly_dir.plus_file(EDITOR_API_ASSEMBLY_NAME ".dll"); - bool success = (FileAccess::exists(assembly_path) && - load_assembly_from(EDITOR_API_ASSEMBLY_NAME, assembly_path, &editor_api_assembly)) || - load_assembly(EDITOR_API_ASSEMBLY_NAME, &editor_api_assembly); + bool success = FileAccess::exists(assembly_path) && + load_assembly_from(EDITOR_API_ASSEMBLY_NAME, assembly_path, &editor_api_assembly); if (success) { -#ifdef MONO_GLUE_ENABLED APIAssembly::Version api_assembly_ver = APIAssembly::Version::get_from_loaded_assembly(editor_api_assembly, APIAssembly::API_EDITOR); editor_api_assembly_out_of_sync = GodotSharpBindings::get_editor_api_hash() != api_assembly_ver.godot_api_hash || GodotSharpBindings::get_bindings_version() != api_assembly_ver.bindings_version || CS_GLUE_VERSION != api_assembly_ver.cs_glue_version; -#endif + } else { + editor_api_assembly_out_of_sync = false; } return success; } #endif +bool GDMono::_try_load_api_assemblies() { + + if (!_load_core_api_assembly()) { + if (OS::get_singleton()->is_stdout_verbose()) + print_error("Mono: Failed to load Core API assembly"); + return false; + } + +#ifdef TOOLS_ENABLED + if (!_load_editor_api_assembly()) { + if (OS::get_singleton()->is_stdout_verbose()) + print_error("Mono: Failed to load Editor API assembly"); + return false; + } + + if (editor_api_assembly_out_of_sync) + return false; +#endif + + // Check if the core API assembly is out of sync only after trying to load the + // editor API assembly. Otherwise, if both assemblies are out of sync, we would + // only update the former as we won't know the latter also needs to be updated. + if (core_api_assembly_out_of_sync || !GDMonoUtils::mono_cache.godot_api_cache_updated) + return false; + + return true; +} + +void GDMono::_load_api_assemblies() { + + if (!_try_load_api_assemblies()) { +#ifdef TOOLS_ENABLED + // The API assemblies are out of sync. Fine, try one more time, but this time + // update them from the prebuilt assemblies directory before trying to load them. + + // Shouldn't happen. The project manager loads the prebuilt API assemblies + CRASH_COND_MSG(Main::is_project_manager(), "Failed to load one of the prebuilt API assemblies."); + + // 1. Unload the scripts domain + Error domain_unload_err = _unload_scripts_domain(); + CRASH_COND_MSG(domain_unload_err != OK, "Mono: Failed to unload scripts domain."); + + // 2. Update the API assemblies + String update_error = update_api_assemblies_from_prebuilt(); + CRASH_COND_MSG(!update_error.empty(), update_error); + + // 3. Load the scripts domain again + Error domain_load_err = _load_scripts_domain(); + CRASH_COND_MSG(domain_load_err != OK, "Mono: Failed to load scripts domain."); + + // 4. Try loading the updated assemblies + if (!_try_load_api_assemblies()) { + // welp... too bad + + if (_are_api_assemblies_out_of_sync()) { + if (core_api_assembly_out_of_sync) { + ERR_PRINT("The assembly '" CORE_API_ASSEMBLY_NAME "' is out of sync."); + } else if (!GDMonoUtils::mono_cache.godot_api_cache_updated) { + ERR_PRINT("The loaded assembly '" CORE_API_ASSEMBLY_NAME "' is in sync, but the cache update failed."); + } + + if (editor_api_assembly_out_of_sync) { + ERR_PRINT("The assembly '" EDITOR_API_ASSEMBLY_NAME "' is out of sync."); + } + + CRASH_NOW(); + } else { + CRASH_NOW_MSG("Failed to load one of the API assemblies."); + } + } +#else + CRASH_NOW_MSG("Failed to load one of the API assemblies."); +#endif + } +} + #ifdef TOOLS_ENABLED bool GDMono::_load_tools_assemblies() { if (tools_assembly && tools_project_editor_assembly) return true; - bool success = load_assembly(TOOLS_ASSEMBLY_NAME, &tools_assembly) && - load_assembly(TOOLS_PROJECT_EDITOR_ASSEMBLY_NAME, &tools_project_editor_assembly); + bool success = load_assembly(TOOLS_ASM_NAME, &tools_assembly) && + load_assembly(TOOLS_PROJECT_EDITOR_ASM_NAME, &tools_project_editor_assembly); return success; } @@ -734,39 +828,11 @@ bool GDMono::_load_project_assembly() { if (success) { mono_assembly_set_main(project_assembly->get_assembly()); - } else { - if (OS::get_singleton()->is_stdout_verbose()) - print_error("Mono: Failed to load project assembly"); } return success; } -bool GDMono::_load_api_assemblies() { - - if (!_load_core_api_assembly()) { - if (OS::get_singleton()->is_stdout_verbose()) - print_error("Mono: Failed to load Core API assembly"); - return false; - } - - if (core_api_assembly_out_of_sync || !GDMonoUtils::mono_cache.godot_api_cache_updated) - return false; - -#ifdef TOOLS_ENABLED - if (!_load_editor_api_assembly()) { - if (OS::get_singleton()->is_stdout_verbose()) - print_error("Mono: Failed to load Editor API assembly"); - return false; - } - - if (editor_api_assembly_out_of_sync) - return false; -#endif - - return true; -} - void GDMono::_install_trace_listener() { #ifdef DEBUG_ENABLED @@ -778,84 +844,12 @@ void GDMono::_install_trace_listener() { (DebuggingUtils_InstallTraceListener)debug_utils->get_method_thunk("InstallTraceListener"); install_func((MonoObject **)&exc); if (exc) { - ERR_PRINT("Failed to install System.Diagnostics.Trace listener"); + ERR_PRINT("Failed to install 'System.Diagnostics.Trace' listener."); GDMonoUtils::debug_print_unhandled_exception(exc); } #endif } -#ifdef TOOLS_ENABLED -String GDMono::_get_api_assembly_metadata_path() { - - return GodotSharpDirs::get_res_metadata_dir().plus_file("api_assemblies.cfg"); -} - -void GDMono::metadata_set_api_assembly_invalidated(APIAssembly::Type p_api_type, bool p_invalidated) { - - String section = APIAssembly::to_string(p_api_type); - String path = _get_api_assembly_metadata_path(); - - Ref<ConfigFile> metadata; - metadata.instance(); - metadata->load(path); - - metadata->set_value(section, "invalidated", p_invalidated); - - String assembly_path = GodotSharpDirs::get_res_assemblies_dir() - .plus_file(p_api_type == APIAssembly::API_CORE ? - CORE_API_ASSEMBLY_NAME ".dll" : - EDITOR_API_ASSEMBLY_NAME ".dll"); - - ERR_FAIL_COND(!FileAccess::exists(assembly_path)); - - uint64_t modified_time = FileAccess::get_modified_time(assembly_path); - - metadata->set_value(section, "invalidated_asm_modified_time", String::num_uint64(modified_time)); - - String dir = path.get_base_dir(); - if (!DirAccess::exists(dir)) { - DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - ERR_FAIL_COND(!da); - Error err = da->make_dir_recursive(ProjectSettings::get_singleton()->globalize_path(dir)); - ERR_FAIL_COND(err != OK); - } - - Error save_err = metadata->save(path); - ERR_FAIL_COND(save_err != OK); -} - -bool GDMono::metadata_is_api_assembly_invalidated(APIAssembly::Type p_api_type) { - - String section = APIAssembly::to_string(p_api_type); - - Ref<ConfigFile> metadata; - metadata.instance(); - metadata->load(_get_api_assembly_metadata_path()); - - String assembly_path = GodotSharpDirs::get_res_assemblies_dir() - .plus_file(p_api_type == APIAssembly::API_CORE ? - CORE_API_ASSEMBLY_NAME ".dll" : - EDITOR_API_ASSEMBLY_NAME ".dll"); - - if (!FileAccess::exists(assembly_path)) - return false; - - uint64_t modified_time = FileAccess::get_modified_time(assembly_path); - - uint64_t stored_modified_time = metadata->get_value(section, "invalidated_asm_modified_time", 0); - - return metadata->get_value(section, "invalidated", false) && modified_time <= stored_modified_time; -} - -String GDMono::get_invalidated_api_assembly_path(APIAssembly::Type p_api_type) { - - return GodotSharpDirs::get_res_assemblies_dir() - .plus_file(p_api_type == APIAssembly::API_CORE ? - CORE_API_ASSEMBLY_NAME ".dll" : - EDITOR_API_ASSEMBLY_NAME ".dll"); -} -#endif - Error GDMono::_load_scripts_domain() { ERR_FAIL_COND_V(scripts_domain != NULL, ERR_BUG); @@ -864,8 +858,7 @@ Error GDMono::_load_scripts_domain() { scripts_domain = GDMonoUtils::create_domain("GodotEngine.ScriptsDomain"); - ERR_EXPLAIN("Mono: Could not create scripts app domain"); - ERR_FAIL_NULL_V(scripts_domain, ERR_CANT_CREATE); + ERR_FAIL_NULL_V_MSG(scripts_domain, ERR_CANT_CREATE, "Mono: Could not create scripts app domain."); mono_domain_set(scripts_domain, true); @@ -884,7 +877,7 @@ Error GDMono::_unload_scripts_domain() { finalizing_scripts_domain = true; if (!mono_domain_finalize(scripts_domain, 2000)) { - ERR_PRINT("Mono: Domain finalization timeout"); + ERR_PRINT("Mono: Domain finalization timeout."); } finalizing_scripts_domain = false; @@ -903,11 +896,6 @@ Error GDMono::_unload_scripts_domain() { tools_project_editor_assembly = NULL; #endif - core_api_assembly_out_of_sync = false; -#ifdef TOOLS_ENABLED - editor_api_assembly_out_of_sync = false; -#endif - MonoDomain *domain = scripts_domain; scripts_domain = NULL; @@ -915,7 +903,7 @@ Error GDMono::_unload_scripts_domain() { mono_domain_try_unload(domain, (MonoObject **)&exc); if (exc) { - ERR_PRINT("Exception thrown when unloading scripts domain"); + ERR_PRINT("Exception thrown when unloading scripts domain."); GDMonoUtils::debug_unhandled_exception(exc); return FAILED; } @@ -929,72 +917,32 @@ Error GDMono::reload_scripts_domain() { ERR_FAIL_COND_V(!runtime_initialized, ERR_BUG); if (scripts_domain) { - Error err = _unload_scripts_domain(); - if (err != OK) { - ERR_PRINT("Mono: Failed to unload scripts domain"); - return err; - } + Error domain_unload_err = _unload_scripts_domain(); + ERR_FAIL_COND_V_MSG(domain_unload_err != OK, domain_unload_err, "Mono: Failed to unload scripts domain."); } CSharpLanguage::get_singleton()->_on_scripts_domain_unloaded(); - Error err = _load_scripts_domain(); - if (err != OK) { - ERR_PRINT("Mono: Failed to load scripts domain"); - return err; - } + Error domain_load_err = _load_scripts_domain(); + ERR_FAIL_COND_V_MSG(domain_load_err != OK, domain_load_err, "Mono: Failed to load scripts domain."); -#ifdef MONO_GLUE_ENABLED - if (!_load_api_assemblies()) { - if ((core_api_assembly && (core_api_assembly_out_of_sync || !GDMonoUtils::mono_cache.godot_api_cache_updated)) -#ifdef TOOLS_ENABLED - || (editor_api_assembly && editor_api_assembly_out_of_sync) -#endif - ) { -#ifdef TOOLS_ENABLED - // The assembly was successfully loaded, but the full api could not be cached. - // This is most likely an outdated assembly loaded because of an invalid version in the - // metadata, so we invalidate the version in the metadata and unload the script domain. - - if (core_api_assembly_out_of_sync) { - ERR_PRINT(OUT_OF_SYNC_ERR_MESSAGE(CORE_API_ASSEMBLY_NAME)); - metadata_set_api_assembly_invalidated(APIAssembly::API_CORE, true); - } else if (!GDMonoUtils::mono_cache.godot_api_cache_updated) { - ERR_PRINT("The loaded Core API assembly is in sync, but the cache update failed"); - metadata_set_api_assembly_invalidated(APIAssembly::API_CORE, true); - } + // Load assemblies. The API and tools assemblies are required, + // the application is aborted if these assemblies cannot be loaded. - if (editor_api_assembly_out_of_sync) { - ERR_PRINT(OUT_OF_SYNC_ERR_MESSAGE(EDITOR_API_ASSEMBLY_NAME)); - metadata_set_api_assembly_invalidated(APIAssembly::API_EDITOR, true); - } + _load_api_assemblies(); - err = _unload_scripts_domain(); - if (err != OK) { - WARN_PRINT("Mono: Failed to unload scripts domain"); - } - - return ERR_CANT_RESOLVE; -#else - ERR_PRINT("The loaded API assembly is invalid"); - CRASH_NOW(); -#endif - } else { - return ERR_CANT_OPEN; - } - } - -#ifdef TOOLS_ENABLED - ERR_EXPLAIN("Mono: Failed to load GodotTools assemblies"); - ERR_FAIL_COND_V(!_load_tools_assemblies(), ERR_CANT_OPEN); +#if defined(TOOLS_ENABLED) + bool tools_assemblies_loaded = _load_tools_assemblies(); + CRASH_COND_MSG(!tools_assemblies_loaded, "Mono: Failed to load '" TOOLS_ASM_NAME "' assemblies."); #endif + // Load the project's main assembly. Here, during hot-reloading, we do + // consider failing to load the project's main assembly to be an error. + // However, unlike the API and tools assemblies, the application can continue working. if (!_load_project_assembly()) { + print_error("Mono: Failed to load project assembly"); return ERR_CANT_OPEN; } -#else - print_verbose("Mono: Glue disabled, ignoring script assemblies."); -#endif // MONO_GLUE_ENABLED return OK; } @@ -1007,13 +955,13 @@ Error GDMono::finalize_and_unload_domain(MonoDomain *p_domain) { String domain_name = mono_domain_get_friendly_name(p_domain); - print_verbose("Mono: Unloading domain `" + domain_name + "`..."); + print_verbose("Mono: Unloading domain '" + domain_name + "'..."); if (mono_domain_get() == p_domain) mono_domain_set(root_domain, true); if (!mono_domain_finalize(p_domain, 2000)) { - ERR_PRINT("Mono: Domain finalization timeout"); + ERR_PRINT("Mono: Domain finalization timeout."); } mono_gc_collect(mono_gc_max_generation()); @@ -1024,7 +972,7 @@ Error GDMono::finalize_and_unload_domain(MonoDomain *p_domain) { mono_domain_try_unload(p_domain, (MonoObject **)&exc); if (exc) { - ERR_PRINTS("Exception thrown when unloading domain `" + domain_name + "`"); + ERR_PRINTS("Exception thrown when unloading domain '" + domain_name + "'."); GDMonoUtils::debug_print_unhandled_exception(exc); return FAILED; } @@ -1131,6 +1079,8 @@ GDMono::GDMono() { #ifdef TOOLS_ENABLED api_editor_hash = 0; #endif + + unhandled_exception_policy = POLICY_TERMINATE_APP; } GDMono::~GDMono() { @@ -1139,7 +1089,7 @@ GDMono::~GDMono() { if (scripts_domain) { Error err = _unload_scripts_domain(); if (err != OK) { - ERR_PRINT("Mono: Failed to unload scripts domain"); + ERR_PRINT("Mono: Failed to unload scripts domain."); } } diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h index a926bf4126..4f7d3791f7 100644 --- a/modules/mono/mono_gd/gd_mono.h +++ b/modules/mono/mono_gd/gd_mono.h @@ -80,6 +80,13 @@ String to_string(Type p_type); class GDMono { +public: + enum UnhandledExceptionPolicy { + POLICY_TERMINATE_APP, + POLICY_LOG_ERROR + }; + +private: bool runtime_initialized; bool finalizing_scripts_domain; @@ -102,8 +109,12 @@ class GDMono { HashMap<uint32_t, HashMap<String, GDMonoAssembly *> > assemblies; + UnhandledExceptionPolicy unhandled_exception_policy; + void _domain_assemblies_cleanup(uint32_t p_domain_id); + bool _are_api_assemblies_out_of_sync(); + bool _load_corlib_assembly(); bool _load_core_api_assembly(); #ifdef TOOLS_ENABLED @@ -112,11 +123,8 @@ class GDMono { #endif bool _load_project_assembly(); - bool _load_api_assemblies(); - -#ifdef TOOLS_ENABLED - String _get_api_assembly_metadata_path(); -#endif + bool _try_load_api_assemblies(); + void _load_api_assemblies(); void _install_trace_listener(); @@ -157,14 +165,15 @@ public: #endif #ifdef TOOLS_ENABLED - void metadata_set_api_assembly_invalidated(APIAssembly::Type p_api_type, bool p_invalidated); - bool metadata_is_api_assembly_invalidated(APIAssembly::Type p_api_type); - String get_invalidated_api_assembly_path(APIAssembly::Type p_api_type); + bool copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config); + String update_api_assemblies_from_prebuilt(); #endif static GDMono *get_singleton() { return singleton; } - static void unhandled_exception_hook(MonoObject *p_exc, void *p_user_data); + GD_NORETURN static void unhandled_exception_hook(MonoObject *p_exc, void *p_user_data); + + UnhandledExceptionPolicy get_unhandled_exception_policy() const { return unhandled_exception_policy; } // Do not use these, unless you know what you're doing void add_assembly(uint32_t p_domain_id, GDMonoAssembly *p_assembly); @@ -203,6 +212,7 @@ public: Error finalize_and_unload_domain(MonoDomain *p_domain); void initialize(); + void initialize_load_assemblies(); GDMono(); ~GDMono(); diff --git a/modules/mono/mono_gd/gd_mono_assembly.cpp b/modules/mono/mono_gd/gd_mono_assembly.cpp index 761c7f6fcb..a82bb42731 100644 --- a/modules/mono/mono_gd/gd_mono_assembly.cpp +++ b/modules/mono/mono_gd/gd_mono_assembly.cpp @@ -151,14 +151,14 @@ MonoAssembly *GDMonoAssembly::_preload_hook(MonoAssemblyName *aname, char **, vo } { - // If we find the assembly here, we load it with `mono_assembly_load_from_full`, + // If we find the assembly here, we load it with 'mono_assembly_load_from_full', // which in turn invokes load hooks before returning the MonoAssembly to us. - // One of the load hooks is `load_aot_module`. This hook can end up calling preload hooks - // again for the same assembly in certain in certain circumstances (the `do_load_image` part). + // One of the load hooks is 'load_aot_module'. This hook can end up calling preload hooks + // again for the same assembly in certain in certain circumstances (the 'do_load_image' part). // If this is the case and we return NULL due to the no_search condition below, // it will result in an internal crash later on. Therefore we need to return the assembly we didn't - // get yet from `mono_assembly_load_from_full`. Luckily we have the image, which already got it. - // This must be done here. If done in search hooks, it would cause `mono_assembly_load_from_full` + // get yet from 'mono_assembly_load_from_full'. Luckily we have the image, which already got it. + // This must be done here. If done in search hooks, it would cause 'mono_assembly_load_from_full' // to think another MonoAssembly for this assembly was already loaded, making it delete its own, // when in fact both pointers were the same... This hooks thing is confusing. if (image_corlib_loading) { diff --git a/modules/mono/mono_gd/gd_mono_class.cpp b/modules/mono/mono_gd/gd_mono_class.cpp index 1c10d3c8eb..89a88fcfb2 100644 --- a/modules/mono/mono_gd/gd_mono_class.cpp +++ b/modules/mono/mono_gd/gd_mono_class.cpp @@ -165,8 +165,8 @@ void GDMonoClass::fetch_methods_with_godot_api_checks(GDMonoClass *p_native_base #ifdef DEBUG_ENABLED String fullname = method->get_ret_type_full_name() + " " + name + "(" + method->get_signature_desc(true) + ")"; - WARN_PRINTS("Method `" + fullname + "` is hidden by Godot API method. Should be `" + - method->get_full_name_no_class() + "`. In class `" + namespace_name + "." + class_name + "`."); + WARN_PRINTS("Method '" + fullname + "' is hidden by Godot API method. Should be '" + + method->get_full_name_no_class() + "'. In class '" + namespace_name + "." + class_name + "'."); #endif continue; } @@ -184,8 +184,8 @@ void GDMonoClass::fetch_methods_with_godot_api_checks(GDMonoClass *p_native_base if (m && m->get_name() != name) { // found String fullname = m->get_ret_type_full_name() + " " + name + "(" + m->get_signature_desc(true) + ")"; - WARN_PRINTS("Method `" + fullname + "` should be `" + m->get_full_name_no_class() + - "`. In class `" + namespace_name + "." + class_name + "`."); + WARN_PRINTS("Method '" + fullname + "' should be '" + m->get_full_name_no_class() + + "'. In class '" + namespace_name + "." + class_name + "'."); break; } diff --git a/modules/mono/mono_gd/gd_mono_field.cpp b/modules/mono/mono_gd/gd_mono_field.cpp index 3999658f93..7b8e6f89e9 100644 --- a/modules/mono/mono_gd/gd_mono_field.cpp +++ b/modules/mono/mono_gd/gd_mono_field.cpp @@ -219,16 +219,14 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ break; } default: { - ERR_EXPLAIN(String() + "Attempted to convert Variant to a managed enum value of unmarshallable base type."); - ERR_FAIL(); + ERR_FAIL_MSG("Attempted to convert Variant to a managed enum value of unmarshallable base type."); } } break; } - ERR_EXPLAIN(String() + "Attempted to set the value of a field of unmarshallable type: " + tclass->get_name()); - ERR_FAIL(); + ERR_FAIL_MSG("Attempted to set the value of a field of unmarshallable type: '" + tclass->get_name() + "'."); } break; case MONO_TYPE_ARRAY: @@ -275,8 +273,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ break; } - ERR_EXPLAIN(String() + "Attempted to convert Variant to a managed array of unmarshallable element type."); - ERR_FAIL(); + ERR_FAIL_MSG("Attempted to convert Variant to a managed array of unmarshallable element type."); } break; case MONO_TYPE_CLASS: { @@ -351,8 +348,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ } } - ERR_EXPLAIN(String() + "Attempted to set the value of a field of unmarshallable type: " + type_class->get_name()); - ERR_FAIL(); + ERR_FAIL_MSG("Attempted to set the value of a field of unmarshallable type: '" + type_class->get_name() + "'."); } break; case MONO_TYPE_OBJECT: { @@ -508,7 +504,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ } break; default: { - ERR_PRINTS(String() + "Attempted to set the value of a field of unexpected type encoding: " + itos(type.type_encoding)); + ERR_PRINTS("Attempted to set the value of a field of unexpected type encoding: " + itos(type.type_encoding) + "."); } break; } diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp index a84332d4cd..3324ecb3a8 100644 --- a/modules/mono/mono_gd/gd_mono_internals.cpp +++ b/modules/mono/mono_gd/gd_mono_internals.cpp @@ -48,7 +48,7 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) { CRASH_COND(!unmanaged); - // All mono objects created from the managed world (e.g.: `new Player()`) + // All mono objects created from the managed world (e.g.: 'new Player()') // need to have a CSharpScript in order for their methods to be callable from the unmanaged side Reference *ref = Object::cast_to<Reference>(unmanaged); @@ -108,9 +108,18 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) { void unhandled_exception(MonoException *p_exc) { mono_unhandled_exception((MonoObject *)p_exc); // prints the exception as well - // Too bad 'mono_invoke_unhandled_exception_hook' is not exposed to embedders - GDMono::unhandled_exception_hook((MonoObject *)p_exc, NULL); - GD_UNREACHABLE(); + + if (GDMono::get_singleton()->get_unhandled_exception_policy() == GDMono::POLICY_TERMINATE_APP) { + // Too bad 'mono_invoke_unhandled_exception_hook' is not exposed to embedders + GDMono::unhandled_exception_hook((MonoObject *)p_exc, NULL); + GD_UNREACHABLE(); + } else { +#ifdef DEBUG_ENABLED + GDMonoUtils::debug_send_unhandled_exception_error((MonoException *)p_exc); + if (ScriptDebugger::get_singleton()) + ScriptDebugger::get_singleton()->idle_poll(); +#endif + } } } // namespace GDMonoInternals diff --git a/modules/mono/mono_gd/gd_mono_internals.h b/modules/mono/mono_gd/gd_mono_internals.h index 2d77bde27c..0d82723913 100644 --- a/modules/mono/mono_gd/gd_mono_internals.h +++ b/modules/mono/mono_gd/gd_mono_internals.h @@ -45,7 +45,7 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged); * Do not call this function directly. * Use GDMonoUtils::debug_unhandled_exception(MonoException *) instead. */ -GD_NORETURN void unhandled_exception(MonoException *p_exc); +void unhandled_exception(MonoException *p_exc); } // namespace GDMonoInternals diff --git a/modules/mono/mono_gd/gd_mono_log.cpp b/modules/mono/mono_gd/gd_mono_log.cpp index a6e04e561d..5a0d728953 100644 --- a/modules/mono/mono_gd/gd_mono_log.cpp +++ b/modules/mono/mono_gd/gd_mono_log.cpp @@ -72,7 +72,7 @@ static void mono_log_callback(const char *log_domain, const char *log_level, con } if (fatal) { - ERR_PRINTS("Mono: FATAL ERROR, ABORTING! Logfile: " + GDMonoLog::get_singleton()->get_log_file_path() + "\n"); + ERR_PRINTS("Mono: FATAL ERROR, ABORTING! Logfile: '" + GDMonoLog::get_singleton()->get_log_file_path() + "'."); // Make sure to flush before aborting f->flush(); f->close(); @@ -90,8 +90,7 @@ bool GDMonoLog::_try_create_logs_dir(const String &p_logs_dir) { DirAccessRef diraccess = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); ERR_FAIL_COND_V(!diraccess, false); Error logs_mkdir_err = diraccess->make_dir_recursive(p_logs_dir); - ERR_EXPLAIN("Failed to create mono logs directory"); - ERR_FAIL_COND_V(logs_mkdir_err != OK, false); + ERR_FAIL_COND_V_MSG(logs_mkdir_err != OK, false, "Failed to create mono logs directory."); } return true; @@ -131,7 +130,7 @@ void GDMonoLog::initialize() { CharString log_level = OS::get_singleton()->get_environment("GODOT_MONO_LOG_LEVEL").utf8(); if (log_level.length() != 0 && log_level_get_id(log_level.get_data()) == -1) { - ERR_PRINTS(String() + "Mono: Ignoring invalid log level (GODOT_MONO_LOG_LEVEL): " + log_level.get_data()); + ERR_PRINTS(String() + "Mono: Ignoring invalid log level (GODOT_MONO_LOG_LEVEL): '" + log_level.get_data() + "'."); log_level = CharString(); } @@ -160,7 +159,7 @@ void GDMonoLog::initialize() { log_file = FileAccess::open(log_file_path, FileAccess::WRITE); if (!log_file) { - ERR_PRINT("Mono: Cannot create log file"); + ERR_PRINT("Mono: Cannot create log file."); } } diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index 42102ed835..7aac691102 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -276,7 +276,7 @@ String mono_to_utf8_string(MonoString *p_mono_string) { char *utf8 = mono_string_to_utf8_checked(p_mono_string, &error); if (!mono_error_ok(&error)) { - ERR_PRINTS(String("Failed to convert MonoString* to UTF-8: ") + mono_error_get_message(&error)); + ERR_PRINTS(String() + "Failed to convert MonoString* to UTF-8: '" + mono_error_get_message(&error) + "'."); mono_error_cleanup(&error); return String(); } @@ -474,8 +474,7 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty return BOX_ENUM(enum_baseclass, val); } default: { - ERR_EXPLAIN(String() + "Attempted to convert Variant to a managed enum value of unmarshallable base type."); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Attempted to convert Variant to a managed enum value of unmarshallable base type."); } } } @@ -509,8 +508,7 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty if (array_type->eklass == CACHED_CLASS_RAW(Color)) return (MonoObject *)PoolColorArray_to_mono_array(p_var->operator PoolColorArray()); - ERR_EXPLAIN(String() + "Attempted to convert Variant to a managed array of unmarshallable element type."); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Attempted to convert Variant to a managed array of unmarshallable element type."); } break; case MONO_TYPE_CLASS: { @@ -695,9 +693,8 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty } break; } - ERR_EXPLAIN(String() + "Attempted to convert Variant to an unmarshallable managed type. Name: \'" + - p_type.type_class->get_name() + "\' Encoding: " + itos(p_type.type_encoding)); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Attempted to convert Variant to an unmarshallable managed type. Name: '" + + p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + "."); } Variant mono_object_to_variant(MonoObject *p_obj) { @@ -809,8 +806,7 @@ Variant mono_object_to_variant(MonoObject *p_obj) { if (array_type->eklass == CACHED_CLASS_RAW(Color)) return mono_array_to_PoolColorArray((MonoArray *)p_obj); - ERR_EXPLAIN(String() + "Attempted to convert a managed array of unmarshallable element type to Variant."); - ERR_FAIL_V(Variant()); + ERR_FAIL_V_MSG(Variant(), "Attempted to convert a managed array of unmarshallable element type to Variant."); } break; case MONO_TYPE_CLASS: { @@ -908,9 +904,8 @@ Variant mono_object_to_variant(MonoObject *p_obj) { } break; } - ERR_EXPLAIN(String() + "Attempted to convert an unmarshallable managed type to Variant. Name: \'" + - type.type_class->get_name() + "\' Encoding: " + itos(type.type_encoding)); - ERR_FAIL_V(Variant()); + ERR_FAIL_V_MSG(Variant(), "Attempted to convert an unmarshallable managed type to Variant. Name: '" + + type.type_class->get_name() + "' Encoding: " + itos(type.type_encoding) + "."); } MonoArray *Array_to_mono_array(const Array &p_array) { diff --git a/modules/mono/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp index 5987fa8ebb..e385f4c601 100644 --- a/modules/mono/mono_gd/gd_mono_utils.cpp +++ b/modules/mono/mono_gd/gd_mono_utils.cpp @@ -37,6 +37,10 @@ #include "core/project_settings.h" #include "core/reference.h" +#ifdef TOOLS_ENABLED +#include "editor/script_editor_debugger.h" +#endif + #include "../csharp_script.h" #include "../utils/macros.h" #include "../utils/mutex_utils.h" @@ -48,14 +52,11 @@ namespace GDMonoUtils { MonoCache mono_cache; -#define CACHE_AND_CHECK(m_var, m_val) \ - { \ - CRASH_COND(m_var != NULL); \ - m_var = m_val; \ - if (!m_var) { \ - ERR_EXPLAIN("Mono Cache: Member " #m_var " is null"); \ - ERR_FAIL(); \ - } \ +#define CACHE_AND_CHECK(m_var, m_val) \ + { \ + CRASH_COND(m_var != NULL); \ + m_var = m_val; \ + ERR_FAIL_COND_MSG(!m_var, "Mono Cache: Member " #m_var " is null."); \ } #define CACHE_CLASS_AND_CHECK(m_class, m_val) CACHE_AND_CHECK(GDMonoUtils::mono_cache.class_##m_class, m_val) @@ -449,10 +450,9 @@ GDMonoClass *get_class_native_base(GDMonoClass *p_class) { } MonoObject *create_managed_for_godot_object(GDMonoClass *p_class, const StringName &p_native, Object *p_object) { - if (!ClassDB::is_parent_class(p_object->get_class_name(), p_native)) { - ERR_EXPLAIN("Type inherits from native type '" + p_native + "', so it can't be instanced in object of type: '" + p_object->get_class() + "'"); - ERR_FAIL_V(NULL); - } + bool parent_is_object_class = ClassDB::is_parent_class(p_object->get_class_name(), p_native); + ERR_FAIL_COND_V_MSG(!parent_is_object_class, NULL, + "Type inherits from native type '" + p_native + "', so it can't be instanced in object of type: '" + p_object->get_class() + "'."); MonoObject *mono_object = mono_object_new(mono_domain_get(), p_class->get_mono_ptr()); ERR_FAIL_NULL_V(mono_object, NULL); @@ -596,8 +596,14 @@ void debug_print_unhandled_exception(MonoException *p_exc) { void debug_send_unhandled_exception_error(MonoException *p_exc) { #ifdef DEBUG_ENABLED - if (!ScriptDebugger::get_singleton()) + if (!ScriptDebugger::get_singleton()) { +#ifdef TOOLS_ENABLED + if (Engine::get_singleton()->is_editor_hint()) { + ERR_PRINTS(GDMonoUtils::get_exception_name_and_message(p_exc)); + } +#endif return; + } _TLS_RECURSION_GUARD_; @@ -621,7 +627,7 @@ void debug_send_unhandled_exception_error(MonoException *p_exc) { if (unexpected_exc) { GDMonoInternals::unhandled_exception(unexpected_exc); - GD_UNREACHABLE(); + return; } Vector<ScriptLanguage::StackInfo> _si; @@ -655,7 +661,6 @@ void debug_send_unhandled_exception_error(MonoException *p_exc) { void debug_unhandled_exception(MonoException *p_exc) { GDMonoInternals::unhandled_exception(p_exc); // prints the exception as well - GD_UNREACHABLE(); } void print_unhandled_exception(MonoException *p_exc) { @@ -665,11 +670,9 @@ void print_unhandled_exception(MonoException *p_exc) { void set_pending_exception(MonoException *p_exc) { #ifdef NO_PENDING_EXCEPTIONS debug_unhandled_exception(p_exc); - GD_UNREACHABLE(); #else if (get_runtime_invoke_count() == 0) { debug_unhandled_exception(p_exc); - GD_UNREACHABLE(); } if (!mono_runtime_set_pending_exception(p_exc, false)) { diff --git a/modules/mono/mono_gd/gd_mono_utils.h b/modules/mono/mono_gd/gd_mono_utils.h index f535fbb6d0..d73743bf0b 100644 --- a/modules/mono/mono_gd/gd_mono_utils.h +++ b/modules/mono/mono_gd/gd_mono_utils.h @@ -289,7 +289,7 @@ void set_exception_message(MonoException *p_exc, String message); void debug_print_unhandled_exception(MonoException *p_exc); void debug_send_unhandled_exception_error(MonoException *p_exc); -GD_NORETURN void debug_unhandled_exception(MonoException *p_exc); +void debug_unhandled_exception(MonoException *p_exc); void print_unhandled_exception(MonoException *p_exc); /** diff --git a/modules/mono/signal_awaiter_utils.cpp b/modules/mono/signal_awaiter_utils.cpp index 54d73c971f..189ceaab1b 100644 --- a/modules/mono/signal_awaiter_utils.cpp +++ b/modules/mono/signal_awaiter_utils.cpp @@ -67,10 +67,8 @@ Error connect_signal_awaiter(Object *p_source, const String &p_signal, Object *p Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { #ifdef DEBUG_ENABLED - if (conn_target_id && !ObjectDB::get_instance(conn_target_id)) { - ERR_EXPLAIN("Resumed after await, but class instance is gone"); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(conn_target_id && !ObjectDB::get_instance(conn_target_id), Variant(), + "Resumed after await, but class instance is gone."); #endif if (p_argcount < 1) { diff --git a/modules/mono/utils/string_utils.cpp b/modules/mono/utils/string_utils.cpp index 2b014c2a45..ae5a2cde81 100644 --- a/modules/mono/utils/string_utils.cpp +++ b/modules/mono/utils/string_utils.cpp @@ -55,10 +55,7 @@ int sfind(const String &p_text, int p_from) { for (int j = 0; j < src_len; j++) { int read_pos = i + j; - if (read_pos >= len) { - ERR_PRINT("read_pos >= len"); - return -1; - }; + ERR_FAIL_COND_V(read_pos >= len, -1); switch (j) { case 0: diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml index 4826b6cd2a..4b59a380f5 100644 --- a/modules/opensimplex/doc_classes/NoiseTexture.xml +++ b/modules/opensimplex/doc_classes/NoiseTexture.xml @@ -20,7 +20,7 @@ <member name="height" type="int" setter="set_height" getter="get_height" default="512"> Height of the generated texture. </member> - <member name="noise" type="OpenSimplexNoise" setter="set_noise" getter="get_noise" default="null"> + <member name="noise" type="OpenSimplexNoise" setter="set_noise" getter="get_noise"> The [OpenSimplexNoise] instance used to generate the noise. </member> <member name="seamless" type="bool" setter="set_seamless" getter="get_seamless" default="false"> diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp index 615081d818..d3e8d3c9bb 100644 --- a/modules/opus/audio_stream_opus.cpp +++ b/modules/opus/audio_stream_opus.cpp @@ -287,8 +287,7 @@ int AudioStreamPlaybackOpus::mix(int16_t *p_buffer, int p_frames) { int ret = op_read(opus_file, (opus_int16 *)p_buffer, todo * stream_channels, ¤t_section); if (ret < 0) { playing = false; - ERR_EXPLAIN("Error reading Opus File: " + file); - ERR_BREAK(ret < 0); + ERR_BREAK_MSG(ret < 0, "Error reading Opus file: " + file + "."); } else if (ret == 0) { // end of song, reload? op_free(opus_file); diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 8b1f21d95d..cf6b396180 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -149,8 +149,7 @@ RES ResourceFormatPVR::load(const String &p_path, const String &p_original_path, format = Image::FORMAT_ETC; break; default: - ERR_EXPLAIN("Unsupported format in PVR texture: " + itos(flags & 0xFF)); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), "Unsupported format in PVR texture: " + itos(flags & 0xFF) + "."); } w.release(); diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml index e279607d13..6dec9fc516 100644 --- a/modules/regex/doc_classes/RegExMatch.xml +++ b/modules/regex/doc_classes/RegExMatch.xml @@ -48,9 +48,7 @@ </method> </methods> <members> - <member name="names" type="Dictionary" setter="" getter="get_names" default="{ - -}"> + <member name="names" type="Dictionary" setter="" getter="get_names" default="{}"> A dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. </member> <member name="strings" type="Array" setter="" getter="get_strings" default="[ ]"> diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index 64f4c169cb..9b0a55eae3 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -57,8 +57,7 @@ void image_decompress_squish(Image *p_image) { } else if (p_image->get_format() == Image::FORMAT_RGTC_RG) { squish_flags = squish::kBc5; } else { - ERR_EXPLAIN("Squish: Can't decompress unknown format: " + itos(p_image->get_format())); - ERR_FAIL_COND(true); + ERR_FAIL_MSG("Squish: Can't decompress unknown format: " + itos(p_image->get_format()) + "."); return; } diff --git a/modules/svg/image_loader_svg.cpp b/modules/svg/image_loader_svg.cpp index b0cd648734..a2ef88d130 100644 --- a/modules/svg/image_loader_svg.cpp +++ b/modules/svg/image_loader_svg.cpp @@ -109,12 +109,10 @@ Error ImageLoaderSVG::_create_image(Ref<Image> p_image, const PoolVector<uint8_t float upscale = upsample ? 2.0 : 1.0; int w = (int)(svg_image->width * p_scale * upscale); - ERR_EXPLAIN(vformat("Can't create image from SVG with scale %s, the resulting image size exceeds max width.", rtos(p_scale))); - ERR_FAIL_COND_V(w > Image::MAX_WIDTH, ERR_PARAMETER_RANGE_ERROR); + ERR_FAIL_COND_V_MSG(w > Image::MAX_WIDTH, ERR_PARAMETER_RANGE_ERROR, vformat("Can't create image from SVG with scale %s, the resulting image size exceeds max width.", rtos(p_scale))); int h = (int)(svg_image->height * p_scale * upscale); - ERR_EXPLAIN(vformat("Can't create image from SVG with scale %s, the resulting image size exceeds max height.", rtos(p_scale))); - ERR_FAIL_COND_V(h > Image::MAX_HEIGHT, ERR_PARAMETER_RANGE_ERROR); + ERR_FAIL_COND_V_MSG(h > Image::MAX_HEIGHT, ERR_PARAMETER_RANGE_ERROR, vformat("Can't create image from SVG with scale %s, the resulting image size exceeds max height.", rtos(p_scale))); PoolVector<uint8_t> dst_image; dst_image.resize(w * h * 4); diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index ae542713ea..6a1b463305 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -499,7 +499,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) { /*If we are too slow, reduce the pp level.*/ pp_inc = pp_level > 0 ? -1 : 0; } - } else { } } else { diff --git a/modules/tinyexr/image_loader_tinyexr.h b/modules/tinyexr/image_loader_tinyexr.h index 4003fdc802..ee8479b1b4 100644 --- a/modules/tinyexr/image_loader_tinyexr.h +++ b/modules/tinyexr/image_loader_tinyexr.h @@ -33,9 +33,6 @@ #include "core/io/image_loader.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class ImageLoaderTinyEXR : public ImageFormatLoader { public: diff --git a/modules/tinyexr/image_saver_tinyexr.cpp b/modules/tinyexr/image_saver_tinyexr.cpp new file mode 100644 index 0000000000..e1d42d3217 --- /dev/null +++ b/modules/tinyexr/image_saver_tinyexr.cpp @@ -0,0 +1,279 @@ +/*************************************************************************/ +/* image_saver_tinyexr.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "image_saver_tinyexr.h" +#include "core/math/math_funcs.h" + +#include "thirdparty/tinyexr/tinyexr.h" + +static bool is_supported_format(Image::Format p_format) { + // This is checked before anything else. + // Mostly uncompressed formats are considered. + switch (p_format) { + case Image::FORMAT_RF: + case Image::FORMAT_RGF: + case Image::FORMAT_RGBF: + case Image::FORMAT_RGBAF: + case Image::FORMAT_RH: + case Image::FORMAT_RGH: + case Image::FORMAT_RGBH: + case Image::FORMAT_RGBAH: + case Image::FORMAT_R8: + case Image::FORMAT_RG8: + case Image::FORMAT_RGB8: + case Image::FORMAT_RGBA8: + return true; + default: + return false; + } +} + +enum SrcPixelType { + SRC_FLOAT, + SRC_HALF, + SRC_BYTE +}; + +static SrcPixelType get_source_pixel_type(Image::Format p_format) { + switch (p_format) { + case Image::FORMAT_RF: + case Image::FORMAT_RGF: + case Image::FORMAT_RGBF: + case Image::FORMAT_RGBAF: + return SRC_FLOAT; + case Image::FORMAT_RH: + case Image::FORMAT_RGH: + case Image::FORMAT_RGBH: + case Image::FORMAT_RGBAH: + return SRC_HALF; + case Image::FORMAT_R8: + case Image::FORMAT_RG8: + case Image::FORMAT_RGB8: + case Image::FORMAT_RGBA8: + return SRC_BYTE; + default: + CRASH_NOW(); + } +} + +static int get_target_pixel_type(Image::Format p_format) { + switch (p_format) { + case Image::FORMAT_RF: + case Image::FORMAT_RGF: + case Image::FORMAT_RGBF: + case Image::FORMAT_RGBAF: + return TINYEXR_PIXELTYPE_FLOAT; + case Image::FORMAT_RH: + case Image::FORMAT_RGH: + case Image::FORMAT_RGBH: + case Image::FORMAT_RGBAH: + // EXR doesn't support 8-bit channels so in that case we'll convert + case Image::FORMAT_R8: + case Image::FORMAT_RG8: + case Image::FORMAT_RGB8: + case Image::FORMAT_RGBA8: + return TINYEXR_PIXELTYPE_HALF; + default: + CRASH_NOW(); + } +} + +static int get_pixel_type_size(int p_pixel_type) { + switch (p_pixel_type) { + case TINYEXR_PIXELTYPE_HALF: + return 2; + case TINYEXR_PIXELTYPE_FLOAT: + return 4; + } + CRASH_NOW(); +} + +static int get_channel_count(Image::Format p_format) { + switch (p_format) { + case Image::FORMAT_RF: + case Image::FORMAT_RH: + case Image::FORMAT_R8: + return 1; + case Image::FORMAT_RGF: + case Image::FORMAT_RGH: + case Image::FORMAT_RG8: + return 2; + case Image::FORMAT_RGBF: + case Image::FORMAT_RGBH: + case Image::FORMAT_RGB8: + return 3; + case Image::FORMAT_RGBAF: + case Image::FORMAT_RGBAH: + case Image::FORMAT_RGBA8: + return 4; + default: + CRASH_NOW(); + } +} + +Error save_exr(const String &p_path, const Ref<Image> &p_img, bool p_grayscale) { + + Image::Format format = p_img->get_format(); + + if (!is_supported_format(format)) { + // Format not supported + print_error("Image format not supported for saving as EXR. Consider saving as PNG."); + return ERR_UNAVAILABLE; + } + + EXRHeader header; + InitEXRHeader(&header); + + EXRImage image; + InitEXRImage(&image); + + const int max_channels = 4; + + // Godot does not support more than 4 channels, + // so we can preallocate header infos on the stack and use only the subset we need + PoolByteArray channels[max_channels]; + unsigned char *channels_ptrs[max_channels]; + EXRChannelInfo channel_infos[max_channels]; + int pixel_types[max_channels]; + int requested_pixel_types[max_channels] = { -1 }; + + // Gimp and Blender are a bit annoying so order of channels isn't straightforward. + const int channel_mappings[4][4] = { + { 0 }, // R + { 1, 0 }, // GR + { 2, 1, 0 }, // BGR + { 2, 1, 0, 3 } // BGRA + }; + + int channel_count = get_channel_count(format); + ERR_FAIL_COND_V(p_grayscale && channel_count != 1, ERR_INVALID_PARAMETER); + + int target_pixel_type = get_target_pixel_type(format); + int target_pixel_type_size = get_pixel_type_size(target_pixel_type); + SrcPixelType src_pixel_type = get_source_pixel_type(format); + const int pixel_count = p_img->get_width() * p_img->get_height(); + + const int *channel_mapping = channel_mappings[channel_count - 1]; + + { + PoolByteArray src_data = p_img->get_data(); + PoolByteArray::Read src_r = src_data.read(); + + for (int channel_index = 0; channel_index < channel_count; ++channel_index) { + + // De-interleave channels + + PoolByteArray &dst = channels[channel_index]; + dst.resize(pixel_count * target_pixel_type_size); + + PoolByteArray::Write dst_w = dst.write(); + + if (src_pixel_type == SRC_FLOAT && target_pixel_type == TINYEXR_PIXELTYPE_FLOAT) { + + // Note: we don't save mipmaps + CRASH_COND(src_data.size() < pixel_count * channel_count * target_pixel_type_size); + + const float *src_rp = (float *)src_r.ptr(); + float *dst_wp = (float *)dst_w.ptr(); + + for (int i = 0; i < pixel_count; ++i) { + dst_wp[i] = src_rp[channel_index + i * channel_count]; + } + + } else if (src_pixel_type == SRC_HALF && target_pixel_type == TINYEXR_PIXELTYPE_HALF) { + + CRASH_COND(src_data.size() < pixel_count * channel_count * target_pixel_type_size); + + const uint16_t *src_rp = (uint16_t *)src_r.ptr(); + uint16_t *dst_wp = (uint16_t *)dst_w.ptr(); + + for (int i = 0; i < pixel_count; ++i) { + dst_wp[i] = src_rp[channel_index + i * channel_count]; + } + + } else if (src_pixel_type == SRC_BYTE && target_pixel_type == TINYEXR_PIXELTYPE_HALF) { + + CRASH_COND(src_data.size() < pixel_count * channel_count); + + const uint8_t *src_rp = (uint8_t *)src_r.ptr(); + uint16_t *dst_wp = (uint16_t *)dst_w.ptr(); + + for (int i = 0; i < pixel_count; ++i) { + dst_wp[i] = Math::make_half_float(src_rp[channel_index + i * channel_count] / 255.f); + } + + } else { + CRASH_NOW(); + } + + int remapped_index = channel_mapping[channel_index]; + + channels_ptrs[remapped_index] = dst_w.ptr(); + + // No conversion + pixel_types[remapped_index] = target_pixel_type; + requested_pixel_types[remapped_index] = target_pixel_type; + + // Write channel name + if (p_grayscale) { + channel_infos[remapped_index].name[0] = 'Y'; + channel_infos[remapped_index].name[1] = '\0'; + } else { + const char *rgba = "RGBA"; + channel_infos[remapped_index].name[0] = rgba[channel_index]; + channel_infos[remapped_index].name[1] = '\0'; + } + } + } + + image.images = channels_ptrs; + image.num_channels = channel_count; + image.width = p_img->get_width(); + image.height = p_img->get_height(); + + header.num_channels = image.num_channels; + header.channels = channel_infos; + header.pixel_types = pixel_types; + header.requested_pixel_types = requested_pixel_types; + // TODO DEBUG REMOVE + for (int i = 0; i < 4; ++i) { + print_line(String("requested_pixel_types{0}: {1}").format(varray(i, requested_pixel_types[i]))); + } + + CharString utf8_filename = p_path.utf8(); + const char *err; + int ret = SaveEXRImageToFile(&image, &header, utf8_filename.ptr(), &err); + if (ret != TINYEXR_SUCCESS) { + print_error(String("Saving EXR failed. Error: {0}").format(varray(err))); + return ERR_FILE_CANT_WRITE; + } + + return OK; +} diff --git a/modules/tinyexr/image_saver_tinyexr.h b/modules/tinyexr/image_saver_tinyexr.h new file mode 100644 index 0000000000..298bd1d21c --- /dev/null +++ b/modules/tinyexr/image_saver_tinyexr.h @@ -0,0 +1,38 @@ +/*************************************************************************/ +/* image_saver_tinyexr.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef IMAGE_SAVER_TINYEXR_H +#define IMAGE_SAVER_TINYEXR_H + +#include "core/os/os.h" + +Error save_exr(const String &p_path, const Ref<Image> &p_img, bool p_grayscale); + +#endif // IMAGE_SAVER_TINYEXR_H diff --git a/modules/tinyexr/register_types.cpp b/modules/tinyexr/register_types.cpp index 5473a55687..233b3afa08 100644 --- a/modules/tinyexr/register_types.cpp +++ b/modules/tinyexr/register_types.cpp @@ -31,6 +31,7 @@ #include "register_types.h" #include "image_loader_tinyexr.h" +#include "image_saver_tinyexr.h" static ImageLoaderTinyEXR *image_loader_tinyexr = NULL; @@ -38,9 +39,13 @@ void register_tinyexr_types() { image_loader_tinyexr = memnew(ImageLoaderTinyEXR); ImageLoader::add_image_format_loader(image_loader_tinyexr); + + Image::save_exr_func = save_exr; } void unregister_tinyexr_types() { memdelete(image_loader_tinyexr); + + Image::save_exr_func = NULL; } diff --git a/modules/vhacd/SCsub b/modules/vhacd/SCsub index e581fb7bb2..685976dc33 100644 --- a/modules/vhacd/SCsub +++ b/modules/vhacd/SCsub @@ -26,10 +26,6 @@ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] env_vhacd.Prepend(CPPPATH=[thirdparty_dir + "/inc"]) -# upstream uses c++11 -if not env.msvc: - env_vhacd.Append(CXXFLAGS="-std=c++11") - env_thirdparty = env_vhacd.Clone() env_thirdparty.disable_warnings() env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) diff --git a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml index 470a3a5e35..9e3670ec35 100644 --- a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml +++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml @@ -213,7 +213,11 @@ return t * t * (3.0 - 2.0 * t) [/codeblock] </constant> - <constant name="FUNC_MAX" value="65" enum="BuiltinFunc"> + <constant name="MATH_POSMOD" value="65" enum="BuiltinFunc"> + </constant> + <constant name="MATH_LERP_ANGLE" value="66" enum="BuiltinFunc"> + </constant> + <constant name="FUNC_MAX" value="67" enum="BuiltinFunc"> Represents the size of the [enum BuiltinFunc] enum. </constant> </constants> diff --git a/modules/visual_script/doc_classes/VisualScriptPreload.xml b/modules/visual_script/doc_classes/VisualScriptPreload.xml index 05ed0ad1e5..b3b39691c9 100644 --- a/modules/visual_script/doc_classes/VisualScriptPreload.xml +++ b/modules/visual_script/doc_classes/VisualScriptPreload.xml @@ -15,7 +15,7 @@ <methods> </methods> <members> - <member name="resource" type="Resource" setter="set_preload" getter="get_preload" default="null"> + <member name="resource" type="Resource" setter="set_preload" getter="get_preload"> The [Resource] to load. </member> </members> diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index b816e37936..3f8b2b1831 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -328,8 +328,7 @@ void VisualScript::add_node(const StringName &p_func, int p_id, const Ref<Visual if (Object::cast_to<VisualScriptFunction>(*p_node)) { //the function indeed - ERR_EXPLAIN("A function node already has been set here."); - ERR_FAIL_COND(func.function_id >= 0); + ERR_FAIL_COND_MSG(func.function_id >= 0, "A function node has already been set here."); func.function_id = p_id; } @@ -1917,8 +1916,7 @@ Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p if (!E) { r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; - ERR_EXPLAIN("No VisualScriptFunction node in function!"); - ERR_FAIL_V(Variant()); + ERR_FAIL_V_MSG(Variant(), "No VisualScriptFunction node in function."); } VisualScriptNodeInstance *node = E->get(); @@ -1974,8 +1972,7 @@ String VisualScriptInstance::to_string(bool *r_valid) { if (ret.get_type() != Variant::STRING) { if (r_valid) *r_valid = false; - ERR_EXPLAIN("Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); - ERR_FAIL_V(String()); + ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); } if (r_valid) *r_valid = true; @@ -2262,15 +2259,10 @@ Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int ERR_FAIL_COND_V(function == StringName(), Variant()); #ifdef DEBUG_ENABLED - if (instance_id && !ObjectDB::get_instance(instance_id)) { - ERR_EXPLAIN("Resumed after yield, but class instance is gone"); - ERR_FAIL_V(Variant()); - } - if (script_id && !ObjectDB::get_instance(script_id)) { - ERR_EXPLAIN("Resumed after yield, but script is gone"); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(instance_id && !ObjectDB::get_instance(instance_id), Variant(), "Resumed after yield, but class instance is gone."); + ERR_FAIL_COND_V_MSG(script_id && !ObjectDB::get_instance(script_id), Variant(), "Resumed after yield, but script is gone."); + #endif r_error.error = Variant::CallError::CALL_OK; @@ -2329,15 +2321,10 @@ Variant VisualScriptFunctionState::resume(Array p_args) { ERR_FAIL_COND_V(function == StringName(), Variant()); #ifdef DEBUG_ENABLED - if (instance_id && !ObjectDB::get_instance(instance_id)) { - ERR_EXPLAIN("Resumed after yield, but class instance is gone"); - ERR_FAIL_V(Variant()); - } - if (script_id && !ObjectDB::get_instance(script_id)) { - ERR_EXPLAIN("Resumed after yield, but script is gone"); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(instance_id && !ObjectDB::get_instance(instance_id), Variant(), "Resumed after yield, but class instance is gone."); + ERR_FAIL_COND_V_MSG(script_id && !ObjectDB::get_instance(script_id), Variant(), "Resumed after yield, but script is gone."); + #endif Variant::CallError r_error; @@ -2629,8 +2616,6 @@ void VisualScriptLanguage::debug_get_globals(List<String> *p_locals, List<Varian } String VisualScriptLanguage::debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems, int p_max_depth) { - if (_debug_parse_err_node >= 0) - return ""; return ""; } diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index 75b79f8929..8088a71198 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -104,6 +104,8 @@ const char *VisualScriptBuiltinFunc::func_name[VisualScriptBuiltinFunc::FUNC_MAX "bytes2var", "color_named", "smoothstep", + "posmod", + "lerp_angle", }; VisualScriptBuiltinFunc::BuiltinFunc VisualScriptBuiltinFunc::find_function(const String &p_string) { @@ -192,6 +194,7 @@ int VisualScriptBuiltinFunc::get_func_argument_count(BuiltinFunc p_func) { case MATH_ATAN2: case MATH_FMOD: case MATH_FPOSMOD: + case MATH_POSMOD: case MATH_POW: case MATH_EASE: case MATH_STEPIFY: @@ -205,6 +208,7 @@ int VisualScriptBuiltinFunc::get_func_argument_count(BuiltinFunc p_func) { case COLORN: return 2; case MATH_LERP: + case MATH_LERP_ANGLE: case MATH_INVERSE_LERP: case MATH_SMOOTHSTEP: case MATH_MOVE_TOWARD: @@ -261,7 +265,16 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_ASIN: case MATH_ACOS: case MATH_ATAN: - case MATH_SQRT: { + case MATH_SQRT: + case MATH_FLOOR: + case MATH_CEIL: + case MATH_ROUND: + case MATH_ABS: + case MATH_SIGN: + case MATH_LOG: + case MATH_EXP: + case MATH_ISNAN: + case MATH_ISINF: { return PropertyInfo(Variant::REAL, "s"); } break; case MATH_ATAN2: { @@ -271,32 +284,25 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const return PropertyInfo(Variant::REAL, "x"); } break; case MATH_FMOD: - case MATH_FPOSMOD: { + case MATH_FPOSMOD: + case LOGIC_MAX: + case LOGIC_MIN: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "x"); + return PropertyInfo(Variant::REAL, "a"); else - return PropertyInfo(Variant::REAL, "y"); + return PropertyInfo(Variant::REAL, "b"); } break; - case MATH_FLOOR: - case MATH_CEIL: - case MATH_ROUND: - case MATH_ABS: - case MATH_SIGN: { - return PropertyInfo(Variant::REAL, "s"); - + case MATH_POSMOD: { + if (p_idx == 0) + return PropertyInfo(Variant::INT, "a"); + else + return PropertyInfo(Variant::INT, "b"); } break; - case MATH_POW: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "x"); + return PropertyInfo(Variant::REAL, "base"); else - return PropertyInfo(Variant::REAL, "y"); - } break; - case MATH_LOG: - case MATH_EXP: - case MATH_ISNAN: - case MATH_ISINF: { - return PropertyInfo(Variant::REAL, "s"); + return PropertyInfo(Variant::REAL, "exp"); } break; case MATH_EASE: { if (p_idx == 0) @@ -313,15 +319,10 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const else return PropertyInfo(Variant::REAL, "steps"); } break; - case MATH_LERP: { - if (p_idx == 0) - return PropertyInfo(Variant::REAL, "from"); - else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "to"); - else - return PropertyInfo(Variant::REAL, "weight"); - } break; - case MATH_INVERSE_LERP: { + case MATH_LERP: + case MATH_LERP_ANGLE: + case MATH_INVERSE_LERP: + case MATH_SMOOTHSTEP: { if (p_idx == 0) return PropertyInfo(Variant::REAL, "from"); else if (p_idx == 1) @@ -341,14 +342,6 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const else return PropertyInfo(Variant::REAL, "ostop"); } break; - case MATH_SMOOTHSTEP: { - if (p_idx == 0) - return PropertyInfo(Variant::REAL, "from"); - else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "to"); - else - return PropertyInfo(Variant::REAL, "weight"); - } break; case MATH_MOVE_TOWARD: { if (p_idx == 0) return PropertyInfo(Variant::REAL, "from"); @@ -365,12 +358,8 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const else return PropertyInfo(Variant::REAL, "step"); } break; - case MATH_RANDOMIZE: { - - } break; - case MATH_RAND: { - - } break; + case MATH_RANDOMIZE: + case MATH_RAND: case MATH_RANDF: { } break; @@ -380,9 +369,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const else return PropertyInfo(Variant::REAL, "to"); } break; - case MATH_SEED: { - return PropertyInfo(Variant::INT, "seed"); - } break; + case MATH_SEED: case MATH_RANDSEED: { return PropertyInfo(Variant::INT, "seed"); } break; @@ -418,26 +405,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const else return PropertyInfo(Variant::INT, "max"); } break; - case MATH_WRAPF: { - if (p_idx == 0) - return PropertyInfo(Variant::REAL, "value"); - else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "min"); - else - return PropertyInfo(Variant::REAL, "max"); - } break; - case LOGIC_MAX: { - if (p_idx == 0) - return PropertyInfo(Variant::REAL, "a"); - else - return PropertyInfo(Variant::REAL, "b"); - } break; - case LOGIC_MIN: { - if (p_idx == 0) - return PropertyInfo(Variant::REAL, "a"); - else - return PropertyInfo(Variant::REAL, "b"); - } break; + case MATH_WRAPF: case LOGIC_CLAMP: { if (p_idx == 0) return PropertyInfo(Variant::REAL, "value"); @@ -450,20 +418,15 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const return PropertyInfo(Variant::INT, "value"); } break; case OBJ_WEAKREF: { - return PropertyInfo(Variant::OBJECT, "source"); - } break; case FUNC_FUNCREF: { - if (p_idx == 0) return PropertyInfo(Variant::OBJECT, "instance"); else return PropertyInfo(Variant::STRING, "funcname"); - } break; case TYPE_CONVERT: { - if (p_idx == 0) return PropertyInfo(Variant::NIL, "what"); else @@ -471,45 +434,24 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const } break; case TYPE_OF: { return PropertyInfo(Variant::NIL, "what"); - } break; case TYPE_EXISTS: { - return PropertyInfo(Variant::STRING, "type"); - } break; case TEXT_CHAR: { - return PropertyInfo(Variant::INT, "ascii"); - - } break; - case TEXT_STR: { - - return PropertyInfo(Variant::NIL, "value"); - - } break; - case TEXT_PRINT: { - - return PropertyInfo(Variant::NIL, "value"); - - } break; - case TEXT_PRINTERR: { - return PropertyInfo(Variant::NIL, "value"); - } break; + case TEXT_STR: + case TEXT_PRINT: + case TEXT_PRINTERR: case TEXT_PRINTRAW: { - return PropertyInfo(Variant::NIL, "value"); - - } break; - case VAR_TO_STR: { - return PropertyInfo(Variant::NIL, "var"); - } break; case STR_TO_VAR: { return PropertyInfo(Variant::STRING, "string"); } break; + case VAR_TO_STR: case VAR_TO_BYTES: { if (p_idx == 0) return PropertyInfo(Variant::NIL, "var"); @@ -525,12 +467,10 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const return PropertyInfo(Variant::BOOL, "allow_objects"); } break; case COLORN: { - if (p_idx == 0) return PropertyInfo(Variant::STRING, "name"); else return PropertyInfo(Variant::REAL, "alpha"); - } break; case FUNC_MAX: { } @@ -561,6 +501,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_CEIL: { t = Variant::REAL; } break; + case MATH_POSMOD: case MATH_ROUND: { t = Variant::INT; } break; @@ -587,6 +528,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons } break; case MATH_STEPIFY: case MATH_LERP: + case MATH_LERP_ANGLE: case MATH_INVERSE_LERP: case MATH_RANGE_LERP: case MATH_SMOOTHSTEP: @@ -806,6 +748,12 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in VALIDATE_ARG_NUM(1); *r_return = Math::fposmod((double)*p_inputs[0], (double)*p_inputs[1]); } break; + case VisualScriptBuiltinFunc::MATH_POSMOD: { + + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + *r_return = Math::posmod((int)*p_inputs[0], (int)*p_inputs[1]); + } break; case VisualScriptBuiltinFunc::MATH_FLOOR: { VALIDATE_ARG_NUM(0); @@ -905,6 +853,13 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in VALIDATE_ARG_NUM(2); *r_return = Math::lerp((double)*p_inputs[0], (double)*p_inputs[1], (double)*p_inputs[2]); } break; + case VisualScriptBuiltinFunc::MATH_LERP_ANGLE: { + + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + VALIDATE_ARG_NUM(2); + *r_return = Math::lerp_angle((double)*p_inputs[0], (double)*p_inputs[1], (double)*p_inputs[2]); + } break; case VisualScriptBuiltinFunc::MATH_INVERSE_LERP: { VALIDATE_ARG_NUM(0); @@ -1417,6 +1372,8 @@ void VisualScriptBuiltinFunc::_bind_methods() { BIND_ENUM_CONSTANT(BYTES_TO_VAR); BIND_ENUM_CONSTANT(COLORN); BIND_ENUM_CONSTANT(MATH_SMOOTHSTEP); + BIND_ENUM_CONSTANT(MATH_POSMOD); + BIND_ENUM_CONSTANT(MATH_LERP_ANGLE); BIND_ENUM_CONSTANT(FUNC_MAX); } @@ -1454,6 +1411,7 @@ void register_visual_script_builtin_func_node() { VisualScriptLanguage::singleton->add_register_func("functions/built_in/sqrt", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_SQRT>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/fmod", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_FMOD>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/fposmod", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_FPOSMOD>); + VisualScriptLanguage::singleton->add_register_func("functions/built_in/posmod", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_POSMOD>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/floor", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_FLOOR>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/ceil", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_CEIL>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/round", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_ROUND>); @@ -1469,6 +1427,7 @@ void register_visual_script_builtin_func_node() { VisualScriptLanguage::singleton->add_register_func("functions/built_in/decimals", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_DECIMALS>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/stepify", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_STEPIFY>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/lerp", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_LERP>); + VisualScriptLanguage::singleton->add_register_func("functions/built_in/lerp_angle", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_LERP_ANGLE>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/inverse_lerp", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_INVERSE_LERP>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/range_lerp", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RANGE_LERP>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/smoothstep", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_SMOOTHSTEP>); diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h index f009f49b5b..cf475d675d 100644 --- a/modules/visual_script/visual_script_builtin_funcs.h +++ b/modules/visual_script/visual_script_builtin_funcs.h @@ -104,6 +104,8 @@ public: BYTES_TO_VAR, COLORN, MATH_SMOOTHSTEP, + MATH_POSMOD, + MATH_LERP_ANGLE, FUNC_MAX }; diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 31d5e4665a..eef3f0f8ae 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -776,8 +776,8 @@ void VisualScriptEditor::_update_members() { TreeItem *functions = members->create_item(root); functions->set_selectable(0, false); functions->set_text(0, TTR("Functions:")); - functions->add_button(0, Control::get_icon("Override", "EditorIcons"), 1); - functions->add_button(0, Control::get_icon("Add", "EditorIcons"), 0); + functions->add_button(0, Control::get_icon("Override", "EditorIcons"), 1, false, TTR("Override an existing built-in function.")); + functions->add_button(0, Control::get_icon("Add", "EditorIcons"), 0, false, TTR("Create a new function.")); functions->set_custom_color(0, Control::get_color("mono_color", "Editor")); List<StringName> func_names; @@ -795,7 +795,7 @@ void VisualScriptEditor::_update_members() { TreeItem *variables = members->create_item(root); variables->set_selectable(0, false); variables->set_text(0, TTR("Variables:")); - variables->add_button(0, Control::get_icon("Add", "EditorIcons")); + variables->add_button(0, Control::get_icon("Add", "EditorIcons"), -1, false, TTR("Create a new variable.")); variables->set_custom_color(0, Control::get_color("mono_color", "Editor")); Ref<Texture> type_icons[Variant::VARIANT_MAX] = { @@ -848,7 +848,7 @@ void VisualScriptEditor::_update_members() { TreeItem *_signals = members->create_item(root); _signals->set_selectable(0, false); _signals->set_text(0, TTR("Signals:")); - _signals->add_button(0, Control::get_icon("Add", "EditorIcons")); + _signals->add_button(0, Control::get_icon("Add", "EditorIcons"), -1, false, TTR("Create a new signal.")); _signals->set_custom_color(0, Control::get_color("mono_color", "Editor")); List<StringName> signal_names; @@ -3670,7 +3670,6 @@ VisualScriptEditor::VisualScriptEditor() { new_virtual_method_select = memnew(VisualScriptPropertySelector); add_child(new_virtual_method_select); new_virtual_method_select->connect("selected", this, "_selected_new_virtual_method"); - new_virtual_method_select->get_cancel(); member_popup = memnew(PopupMenu); add_child(member_popup); diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 0413bbf303..c330fa1bc0 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -1026,7 +1026,6 @@ void VisualScriptPropertySet::_adjust_input_index(PropertyInfo &pinfo) const { } PropertyInfo VisualScriptPropertySet::get_input_value_port_info(int p_idx) const { - if (call_mode == CALL_MODE_INSTANCE || call_mode == CALL_MODE_BASIC_TYPE) { if (p_idx == 0) { PropertyInfo pi; @@ -1037,6 +1036,16 @@ PropertyInfo VisualScriptPropertySet::get_input_value_port_info(int p_idx) const } } + List<PropertyInfo> props; + ClassDB::get_property_list(_get_base_type(), &props, true); + for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { + if (E->get().name == property) { + PropertyInfo pinfo = PropertyInfo(E->get().type, "value", PROPERTY_HINT_TYPE_STRING, E->get().hint_string); + _adjust_input_index(pinfo); + return pinfo; + } + } + PropertyInfo pinfo = type_cache; pinfo.name = "value"; _adjust_input_index(pinfo); @@ -1047,6 +1056,13 @@ PropertyInfo VisualScriptPropertySet::get_output_value_port_info(int p_idx) cons if (call_mode == CALL_MODE_BASIC_TYPE) { return PropertyInfo(basic_type, "out"); } else if (call_mode == CALL_MODE_INSTANCE) { + List<PropertyInfo> props; + ClassDB::get_property_list(_get_base_type(), &props, true); + for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { + if (E->get().name == property) { + return PropertyInfo(E->get().type, "pass", PROPERTY_HINT_TYPE_STRING, E->get().hint_string); + } + } return PropertyInfo(Variant::OBJECT, "pass", PROPERTY_HINT_TYPE_STRING, get_base_type()); } else { return PropertyInfo(); @@ -1796,14 +1812,12 @@ PropertyInfo VisualScriptPropertyGet::get_input_value_port_info(int p_idx) const } PropertyInfo VisualScriptPropertyGet::get_output_value_port_info(int p_idx) const { - - if (index != StringName()) { - - Variant v; - Variant::CallError ce; - v = Variant::construct(type_cache, NULL, 0, ce); - Variant i = v.get(index); - return PropertyInfo(i.get_type(), "value." + String(index)); + List<PropertyInfo> props; + ClassDB::get_property_list(_get_base_type(), &props, true); + for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { + if (E->get().name == property) { + return PropertyInfo(E->get().type, "value." + String(index)); + } } return PropertyInfo(type_cache, "value"); diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 1b0e41b2de..65820b4c15 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -197,7 +197,6 @@ String VisualScriptFunction::get_output_sequence_port_text(int p_port) const { PropertyInfo VisualScriptFunction::get_input_value_port_info(int p_idx) const { ERR_FAIL_V(PropertyInfo()); - return PropertyInfo(); } PropertyInfo VisualScriptFunction::get_output_value_port_info(int p_idx) const { @@ -418,7 +417,7 @@ PropertyInfo VisualScriptOperator::get_input_value_port_info(int p_idx) const { { Variant::NIL, Variant::NIL } //OP_IN, }; - ERR_FAIL_INDEX_V(p_idx, Variant::OP_MAX, PropertyInfo()); + ERR_FAIL_INDEX_V(p_idx, 2, PropertyInfo()); PropertyInfo pinfo; pinfo.name = p_idx == 0 ? "A" : "B"; @@ -2531,7 +2530,7 @@ String VisualScriptCustomNode::get_category() const { if (get_script_instance() && get_script_instance()->has_method("_get_category")) { return get_script_instance()->call("_get_category"); } - return "custom"; + return "Custom"; } class VisualScriptNodeInstanceCustomNode : public VisualScriptNodeInstance { diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index 1e7ed3019c..764807cffd 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -130,12 +130,14 @@ void VisualScriptPropertySelector::_update_search() { { String b = String(E->get()); category = search_options->create_item(root); - category->set_text(0, b.replace_first("*", "")); - category->set_selectable(0, false); - Ref<Texture> icon; - String rep = b.replace("*", ""); - icon = EditorNode::get_singleton()->get_class_icon(rep); - category->set_icon(0, icon); + if (category) { + category->set_text(0, b.replace_first("*", "")); + category->set_selectable(0, false); + Ref<Texture> icon; + String rep = b.replace("*", ""); + icon = EditorNode::get_singleton()->get_class_icon(rep); + category->set_icon(0, icon); + } } if (properties || seq_connect) { if (instance) { @@ -405,7 +407,7 @@ void VisualScriptPropertySelector::_item_selected() { String name = item->get_metadata(0); String class_type; - if (type) { + if (type != Variant::NIL) { class_type = Variant::get_type_name(type); } else { diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 2f4a45f108..2f56e778b9 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -116,8 +116,7 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_buffer, int p_frames) { if (ret < 0) { playing = false; - ERR_EXPLAIN("Error reading OGG Vorbis File: " + file); - ERR_BREAK(ret < 0); + ERR_BREAK_MSG(ret < 0, "Error reading OGG Vorbis file: " + file + "."); } else if (ret == 0) { // end of song, reload? ov_clear(&vf); diff --git a/modules/webm/SCsub b/modules/webm/SCsub index e57437229f..32e6727656 100644 --- a/modules/webm/SCsub +++ b/modules/webm/SCsub @@ -17,10 +17,6 @@ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] env_webm.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"]) -# upstream uses c++11 -if (not env_webm.msvc): - env_webm.Append(CXXFLAGS="-std=c++11") - # also requires libogg, libvorbis and libopus if env['builtin_libogg']: env_webm.Prepend(CPPPATH=["#thirdparty/libogg"]) diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 3670edc9ea..fa3602ad27 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -53,8 +53,7 @@ public: file = FileAccess::open(p_file, FileAccess::READ); - ERR_EXPLAIN("Failed loading resource: '" + p_file + "';"); - ERR_FAIL_COND(!file); + ERR_FAIL_COND_MSG(!file, "Failed loading resource: '" + p_file + "'."); } ~MkvReader() { diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp index 630c15f140..d1bfa20842 100644 --- a/modules/webp/image_loader_webp.cpp +++ b/modules/webp/image_loader_webp.cpp @@ -84,8 +84,7 @@ static Ref<Image> _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) { ERR_FAIL_COND_V(r[0] != 'W' || r[1] != 'E' || r[2] != 'B' || r[3] != 'P', Ref<Image>()); WebPBitstreamFeatures features; if (WebPGetFeatures(&r[4], size, &features) != VP8_STATUS_OK) { - ERR_EXPLAIN("Error unpacking WEBP image:"); - ERR_FAIL_V(Ref<Image>()); + ERR_FAIL_V_MSG(Ref<Image>(), "Error unpacking WEBP image."); } /* @@ -107,8 +106,7 @@ static Ref<Image> _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) { errdec = WebPDecodeRGBInto(&r[4], size, dst_w.ptr(), datasize, 3 * features.width) == NULL; } - //ERR_EXPLAIN("Error decoding webp! - "+p_file); - ERR_FAIL_COND_V(errdec, Ref<Image>()); + ERR_FAIL_COND_V_MSG(errdec, Ref<Image>(), "Failed decoding WebP image."); dst_w.release(); @@ -122,7 +120,6 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p WebPBitstreamFeatures features; if (WebPGetFeatures(p_buffer, p_buffer_len, &features) != VP8_STATUS_OK) { - // ERR_EXPLAIN("Error decoding WEBP image"); ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -139,8 +136,7 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p } dst_w.release(); - //ERR_EXPLAIN("Error decoding webp!"); - ERR_FAIL_COND_V(errdec, ERR_FILE_CORRUPT); + ERR_FAIL_COND_V_MSG(errdec, ERR_FILE_CORRUPT, "Failed decoding WebP image."); p_image->create(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image); diff --git a/modules/webp/image_loader_webp.h b/modules/webp/image_loader_webp.h index 0c4e54df09..5a5c038017 100644 --- a/modules/webp/image_loader_webp.h +++ b/modules/webp/image_loader_webp.h @@ -33,9 +33,6 @@ #include "core/io/image_loader.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class ImageLoaderWEBP : public ImageFormatLoader { public: diff --git a/modules/webrtc/register_types.cpp b/modules/webrtc/register_types.cpp index 58b68d926b..6f97842064 100644 --- a/modules/webrtc/register_types.cpp +++ b/modules/webrtc/register_types.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "register_types.h" +#include "core/project_settings.h" #include "webrtc_data_channel.h" #include "webrtc_peer_connection.h" @@ -43,6 +44,12 @@ #include "webrtc_multiplayer.h" void register_webrtc_types() { +#define _SET_HINT(NAME, _VAL_, _MAX_) \ + GLOBAL_DEF(NAME, _VAL_); \ + ProjectSettings::get_singleton()->set_custom_property_info(NAME, PropertyInfo(Variant::INT, NAME, PROPERTY_HINT_RANGE, "2," #_MAX_ ",1,or_greater")); + + _SET_HINT(WRTC_IN_BUF, 64, 4096); + #ifdef JAVASCRIPT_ENABLED WebRTCPeerConnectionJS::make_default(); #elif defined(WEBRTC_GDNATIVE_ENABLED) diff --git a/modules/webrtc/webrtc_data_channel.cpp b/modules/webrtc/webrtc_data_channel.cpp index 2bd30e68f5..7b3843410a 100644 --- a/modules/webrtc/webrtc_data_channel.cpp +++ b/modules/webrtc/webrtc_data_channel.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "webrtc_data_channel.h" +#include "core/project_settings.h" void WebRTCDataChannel::_bind_methods() { ClassDB::bind_method(D_METHOD("poll"), &WebRTCDataChannel::poll); @@ -58,6 +59,7 @@ void WebRTCDataChannel::_bind_methods() { } WebRTCDataChannel::WebRTCDataChannel() { + _in_buffer_shift = nearest_shift((int)GLOBAL_GET(WRTC_IN_BUF) - 1) + 10; } WebRTCDataChannel::~WebRTCDataChannel() { diff --git a/modules/webrtc/webrtc_data_channel.h b/modules/webrtc/webrtc_data_channel.h index 0b161da784..7e2c08d9d7 100644 --- a/modules/webrtc/webrtc_data_channel.h +++ b/modules/webrtc/webrtc_data_channel.h @@ -33,6 +33,8 @@ #include "core/io/packet_peer.h" +#define WRTC_IN_BUF "network/limits/webrtc/max_channel_in_buffer_kb" + class WebRTCDataChannel : public PacketPeer { GDCLASS(WebRTCDataChannel, PacketPeer); @@ -50,6 +52,8 @@ public: }; protected: + unsigned int _in_buffer_shift; + static void _bind_methods(); public: diff --git a/modules/webrtc/webrtc_data_channel_js.cpp b/modules/webrtc/webrtc_data_channel_js.cpp index 069918cc9c..2edd212a50 100644 --- a/modules/webrtc/webrtc_data_channel_js.cpp +++ b/modules/webrtc/webrtc_data_channel_js.cpp @@ -56,7 +56,7 @@ EMSCRIPTEN_KEEPALIVE void _emrtc_on_ch_message(void *obj, uint8_t *p_data, uint3 } void WebRTCDataChannelJS::_on_open() { - in_buffer.resize(16); + in_buffer.resize(_in_buffer_shift); } void WebRTCDataChannelJS::_on_close() { @@ -68,10 +68,8 @@ void WebRTCDataChannelJS::_on_error() { } void WebRTCDataChannelJS::_on_message(uint8_t *p_data, uint32_t p_size, bool p_is_string) { - if (in_buffer.space_left() < (int)(p_size + 5)) { - ERR_EXPLAIN("Buffer full! Dropping data"); - ERR_FAIL(); - } + + ERR_FAIL_COND_MSG(in_buffer.space_left() < (int)(p_size + 5), "Buffer full! Dropping data."); uint8_t is_string = p_is_string ? 1 : 0; in_buffer.write((uint8_t *)&p_size, 4); diff --git a/modules/webrtc/webrtc_multiplayer.cpp b/modules/webrtc/webrtc_multiplayer.cpp index 17dafff93a..a759b17b83 100644 --- a/modules/webrtc/webrtc_multiplayer.cpp +++ b/modules/webrtc/webrtc_multiplayer.cpp @@ -321,10 +321,8 @@ Error WebRTCMultiplayer::put_packet(const uint8_t *p_buffer, int p_buffer_size) if (target_peer > 0) { E = peer_map.find(target_peer); - if (!E) { - ERR_EXPLAIN("Invalid Target Peer: " + itos(target_peer)); - ERR_FAIL_V(ERR_INVALID_PARAMETER); - } + ERR_FAIL_COND_V_MSG(!E, ERR_INVALID_PARAMETER, "Invalid target peer: " + itos(target_peer) + "."); + ERR_FAIL_COND_V(E->value()->channels.size() <= ch, ERR_BUG); ERR_FAIL_COND_V(!E->value()->channels[ch].is_valid(), ERR_BUG); return E->value()->channels[ch]->put_packet(p_buffer, p_buffer_size); diff --git a/modules/webrtc/webrtc_peer_connection_gdnative.cpp b/modules/webrtc/webrtc_peer_connection_gdnative.cpp index af98aa750a..5e9dcb5366 100644 --- a/modules/webrtc/webrtc_peer_connection_gdnative.cpp +++ b/modules/webrtc/webrtc_peer_connection_gdnative.cpp @@ -51,13 +51,11 @@ Error WebRTCPeerConnectionGDNative::set_default_library(const godot_net_webrtc_l WebRTCPeerConnection *WebRTCPeerConnectionGDNative::_create() { WebRTCPeerConnectionGDNative *obj = memnew(WebRTCPeerConnectionGDNative); - ERR_EXPLAIN("Default GDNative WebRTC implementation not defined."); - ERR_FAIL_COND_V(!default_library, obj); + ERR_FAIL_COND_V_MSG(!default_library, obj, "Default GDNative WebRTC implementation not defined."); // Call GDNative constructor Error err = (Error)default_library->create_peer_connection(obj); - ERR_EXPLAIN("GDNative default library constructor returned an error"); - ERR_FAIL_COND_V(err != OK, obj); + ERR_FAIL_COND_V_MSG(err != OK, obj, "GDNative default library constructor returned an error."); return obj; } diff --git a/modules/websocket/emws_peer.cpp b/modules/websocket/emws_peer.cpp index a9f38f1a82..58d4c52688 100644 --- a/modules/websocket/emws_peer.cpp +++ b/modules/websocket/emws_peer.cpp @@ -131,14 +131,12 @@ void EMWSPeer::close(int p_code, String p_reason) { IP_Address EMWSPeer::get_connected_host() const { - ERR_EXPLAIN("Not supported in HTML5 export"); - ERR_FAIL_V(IP_Address()); + ERR_FAIL_V_MSG(IP_Address(), "Not supported in HTML5 export."); }; uint16_t EMWSPeer::get_connected_port() const { - ERR_EXPLAIN("Not supported in HTML5 export"); - ERR_FAIL_V(0); + ERR_FAIL_V_MSG(0, "Not supported in HTML5 export."); }; EMWSPeer::EMWSPeer() { diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp index e24cb850ec..dd86c758bf 100644 --- a/modules/websocket/websocket_multiplayer_peer.cpp +++ b/modules/websocket/websocket_multiplayer_peer.cpp @@ -98,16 +98,14 @@ void WebSocketMultiplayerPeer::_bind_methods() { // int WebSocketMultiplayerPeer::get_available_packet_count() const { - ERR_EXPLAIN("Please use get_peer(ID).get_available_packet_count to get available packet count from peers when not using the MultiplayerAPI."); - ERR_FAIL_COND_V(!_is_multiplayer, ERR_UNCONFIGURED); + ERR_FAIL_COND_V_MSG(!_is_multiplayer, ERR_UNCONFIGURED, "Please use get_peer(ID).get_available_packet_count to get available packet count from peers when not using the MultiplayerAPI."); return _incoming_packets.size(); } Error WebSocketMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { - ERR_EXPLAIN("Please use get_peer(ID).get_packet/var to communicate with peers when not using the MultiplayerAPI."); - ERR_FAIL_COND_V(!_is_multiplayer, ERR_UNCONFIGURED); + ERR_FAIL_COND_V_MSG(!_is_multiplayer, ERR_UNCONFIGURED, "Please use get_peer(ID).get_packet/var to communicate with peers when not using the MultiplayerAPI."); r_buffer_size = 0; @@ -127,8 +125,7 @@ Error WebSocketMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buff Error WebSocketMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size) { - ERR_EXPLAIN("Please use get_peer(ID).put_packet/var to communicate with peers when not using the MultiplayerAPI."); - ERR_FAIL_COND_V(!_is_multiplayer, ERR_UNCONFIGURED); + ERR_FAIL_COND_V_MSG(!_is_multiplayer, ERR_UNCONFIGURED, "Please use get_peer(ID).put_packet/var to communicate with peers when not using the MultiplayerAPI."); PoolVector<uint8_t> buffer = _make_pkt(SYS_NONE, get_unique_id(), _target_peer, p_buffer, p_buffer_size); @@ -160,8 +157,7 @@ void WebSocketMultiplayerPeer::set_target_peer(int p_target_peer) { int WebSocketMultiplayerPeer::get_packet_peer() const { - ERR_EXPLAIN("This function is not available when not using the MultiplayerAPI."); - ERR_FAIL_COND_V(!_is_multiplayer, 1); + ERR_FAIL_COND_V_MSG(!_is_multiplayer, 1, "This function is not available when not using the MultiplayerAPI."); ERR_FAIL_COND_V(_incoming_packets.size() == 0, 1); return _incoming_packets.front()->get().source; @@ -269,7 +265,10 @@ Error WebSocketMultiplayerPeer::_server_relay(int32_t p_from, int32_t p_to, cons ERR_FAIL_COND_V(p_to == p_from, FAILED); - return get_peer(p_to)->put_packet(p_buffer, p_buffer_size); // Sending to specific peer + Ref<WebSocketPeer> peer_to = get_peer(p_to); + ERR_FAIL_COND_V(peer_to.is_null(), FAILED); + + return peer_to->put_packet(p_buffer, p_buffer_size); // Sending to specific peer } } @@ -300,8 +299,6 @@ void WebSocketMultiplayerPeer::_process_multiplayer(Ref<WebSocketPeer> p_peer, u ERR_FAIL_COND(type != SYS_NONE); // Only server sends sys messages ERR_FAIL_COND(from != p_peer_id); // Someone is cheating - _server_relay(from, to, in_buffer, size); // Relay if needed - if (to == 1) { // This is for the server _store_pkt(from, to, in_buffer, data_size); @@ -316,13 +313,9 @@ void WebSocketMultiplayerPeer::_process_multiplayer(Ref<WebSocketPeer> p_peer, u // All but one, for us if not excluded if (_peer_id != -(int32_t)p_peer_id) _store_pkt(from, to, in_buffer, data_size); - - } else { - - // Send to specific peer - ERR_FAIL_COND(!_peer_map.has(to)); - get_peer(to)->put_packet(in_buffer, size); } + // Relay if needed (i.e. "to" includes a peer that is not the server) + _server_relay(from, to, in_buffer, size); } else { @@ -354,8 +347,7 @@ void WebSocketMultiplayerPeer::_process_multiplayer(Ref<WebSocketPeer> p_peer, u _peer_id = id; break; default: - ERR_EXPLAIN("Invalid multiplayer message"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid multiplayer message."); break; } } diff --git a/modules/websocket/wsl_client.cpp b/modules/websocket/wsl_client.cpp index 86374e8f80..0006a057e0 100644 --- a/modules/websocket/wsl_client.cpp +++ b/modules/websocket/wsl_client.cpp @@ -53,8 +53,7 @@ void WSLClient::_do_handshake() { // Header is too big disconnect_from_host(); _on_error(); - ERR_EXPLAIN("Response headers too big"); - ERR_FAIL(); + ERR_FAIL_MSG("Response headers too big."); } Error err = _connection->get_partial_data(&_resp_buf[_resp_pos], 1, read); if (err == ERR_FILE_EOF) { @@ -81,8 +80,7 @@ void WSLClient::_do_handshake() { if (!_verify_headers(protocol)) { disconnect_from_host(); _on_error(); - ERR_EXPLAIN("Invalid response headers"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid response headers."); } // Create peer. WSLPeer::PeerData *data = memnew(struct WSLPeer::PeerData); @@ -103,29 +101,18 @@ bool WSLClient::_verify_headers(String &r_protocol) { String s = (char *)_resp_buf; Vector<String> psa = s.split("\r\n"); int len = psa.size(); - if (len < 4) { - ERR_EXPLAIN("Not enough response headers."); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(len < 4, false, "Not enough response headers, got: " + itos(len) + ", expected >= 4."); Vector<String> req = psa[0].split(" ", false); - if (req.size() < 2) { - ERR_EXPLAIN("Invalid protocol or status code."); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(req.size() < 2, false, "Invalid protocol or status code."); + // Wrong protocol - if (req[0] != "HTTP/1.1" || req[1] != "101") { - ERR_EXPLAIN("Invalid protocol or status code."); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(req[0] != "HTTP/1.1" || req[1] != "101", false, "Invalid protocol or status code."); Map<String, String> headers; for (int i = 1; i < len; i++) { Vector<String> header = psa[i].split(":", false, 1); - if (header.size() != 2) { - ERR_EXPLAIN("Invalid header -> " + psa[i]); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(header.size() != 2, false, "Invalid header -> " + psa[i] + "."); String name = header[0].to_lower(); String value = header[1].strip_edges(); if (headers.has(name)) @@ -134,17 +121,17 @@ bool WSLClient::_verify_headers(String &r_protocol) { headers[name] = value; } -#define _WLS_EXPLAIN(NAME, VALUE) \ - ERR_EXPLAIN("Missing or invalid header '" + String(NAME) + "'. Expected value '" + VALUE + "'"); -#define _WLS_CHECK(NAME, VALUE) \ - _WLS_EXPLAIN(NAME, VALUE); \ - ERR_FAIL_COND_V(!headers.has(NAME) || headers[NAME].to_lower() != VALUE, false); -#define _WLS_CHECK_NC(NAME, VALUE) \ - _WLS_EXPLAIN(NAME, VALUE); \ - ERR_FAIL_COND_V(!headers.has(NAME) || headers[NAME] != VALUE, false); - _WLS_CHECK("connection", "upgrade"); - _WLS_CHECK("upgrade", "websocket"); - _WLS_CHECK_NC("sec-websocket-accept", WSLPeer::compute_key_response(_key)); +#define _WSL_CHECK(NAME, VALUE) \ + ERR_FAIL_COND_V_MSG(!headers.has(NAME) || headers[NAME].to_lower() != VALUE, false, \ + "Missing or invalid header '" + String(NAME) + "'. Expected value '" + VALUE + "'."); +#define _WSL_CHECK_NC(NAME, VALUE) \ + ERR_FAIL_COND_V_MSG(!headers.has(NAME) || headers[NAME] != VALUE, false, \ + "Missing or invalid header '" + String(NAME) + "'. Expected value '" + VALUE + "'."); + _WSL_CHECK("connection", "upgrade"); + _WSL_CHECK("upgrade", "websocket"); + _WSL_CHECK_NC("sec-websocket-accept", WSLPeer::compute_key_response(_key)); +#undef _WSL_CHECK_NC +#undef _WSL_CHECK if (_protocols.size() == 0) { // We didn't request a custom protocol ERR_FAIL_COND_V(headers.has("sec-websocket-protocol"), false); @@ -161,10 +148,6 @@ bool WSLClient::_verify_headers(String &r_protocol) { if (!valid) return false; } -#undef _WLS_CHECK_NC -#undef _WLS_CHECK -#undef _WLS_EXPLAIN - return true; } @@ -190,8 +173,8 @@ Error WSLClient::connect_to_host(String p_host, String p_path, uint16_t p_port, Error err = _tcp->connect_to_host(addr, p_port); if (err != OK) { - _on_error(); _tcp->disconnect_from_host(); + _on_error(); return err; } _connection = _tcp; @@ -230,8 +213,8 @@ void WSLClient::poll() { if (_peer->is_connected_to_host()) { _peer->poll(); if (!_peer->is_connected_to_host()) { - _on_disconnect(_peer->close_code != -1); disconnect_from_host(); + _on_disconnect(_peer->close_code != -1); } return; } @@ -242,8 +225,8 @@ void WSLClient::poll() { switch (_tcp->get_status()) { case StreamPeerTCP::STATUS_NONE: // Clean close - _on_error(); disconnect_from_host(); + _on_error(); break; case StreamPeerTCP::STATUS_CONNECTED: { Ref<StreamPeerSSL> ssl; @@ -251,12 +234,11 @@ void WSLClient::poll() { if (_connection == _tcp) { // Start SSL handshake ssl = Ref<StreamPeerSSL>(StreamPeerSSL::create()); - ERR_EXPLAIN("SSL is not available in this build"); - ERR_FAIL_COND(ssl.is_null()); + ERR_FAIL_COND_MSG(ssl.is_null(), "SSL is not available in this build."); ssl->set_blocking_handshake_enabled(false); if (ssl->connect_to_stream(_tcp, verify_ssl, _host) != OK) { - _on_error(); disconnect_from_host(); + _on_error(); return; } _connection = ssl; @@ -268,8 +250,8 @@ void WSLClient::poll() { if (ssl->get_status() == StreamPeerSSL::STATUS_HANDSHAKING) return; // Need more polling. else if (ssl->get_status() != StreamPeerSSL::STATUS_CONNECTED) { - _on_error(); disconnect_from_host(); + _on_error(); return; // Error. } } @@ -277,8 +259,8 @@ void WSLClient::poll() { _do_handshake(); } break; case StreamPeerTCP::STATUS_ERROR: - _on_error(); disconnect_from_host(); + _on_error(); break; case StreamPeerTCP::STATUS_CONNECTING: break; // Wait for connection @@ -332,8 +314,7 @@ uint16_t WSLClient::get_connected_port() const { } Error WSLClient::set_buffers(int p_in_buffer, int p_in_packets, int p_out_buffer, int p_out_packets) { - ERR_EXPLAIN("Buffers sizes can only be set before listening or connecting"); - ERR_FAIL_COND_V(_connection.is_valid(), FAILED); + ERR_FAIL_COND_V_MSG(_connection.is_valid(), FAILED, "Buffers sizes can only be set before listening or connecting."); _in_buf_size = nearest_shift(p_in_buffer - 1) + 10; _in_pkt_size = nearest_shift(p_in_packets - 1); diff --git a/modules/websocket/wsl_peer.cpp b/modules/websocket/wsl_peer.cpp index b11bd2b70f..f94f3dfff7 100644 --- a/modules/websocket/wsl_peer.cpp +++ b/modules/websocket/wsl_peer.cpp @@ -35,7 +35,7 @@ #include "wsl_client.h" #include "wsl_server.h" -#include "core/math/crypto_core.h" +#include "core/crypto/crypto_core.h" #include "core/math/random_number_generator.h" #include "core/os/os.h" diff --git a/modules/websocket/wsl_server.cpp b/modules/websocket/wsl_server.cpp index 0d09a4d74e..efb526eed1 100644 --- a/modules/websocket/wsl_server.cpp +++ b/modules/websocket/wsl_server.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* lws_server.cpp */ +/* wsl_server.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -45,29 +45,18 @@ WSLServer::PendingPeer::PendingPeer() { bool WSLServer::PendingPeer::_parse_request(const PoolStringArray p_protocols) { Vector<String> psa = String((char *)req_buf).split("\r\n"); int len = psa.size(); - if (len < 4) { - ERR_EXPLAIN("Not enough response headers."); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(len < 4, false, "Not enough response headers, got: " + itos(len) + ", expected >= 4."); Vector<String> req = psa[0].split(" ", false); - if (req.size() < 2) { - ERR_EXPLAIN("Invalid protocol or status code."); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(req.size() < 2, false, "Invalid protocol or status code."); + // Wrong protocol - if (req[0] != "GET" || req[2] != "HTTP/1.1") { - ERR_EXPLAIN("Invalid method or HTTP version."); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(req[0] != "GET" || req[2] != "HTTP/1.1", false, "Invalid method or HTTP version."); Map<String, String> headers; for (int i = 1; i < len; i++) { Vector<String> header = psa[i].split(":", false, 1); - if (header.size() != 2) { - ERR_EXPLAIN("Invalid header -> " + psa[i]); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(header.size() != 2, false, "Invalid header -> " + psa[i]); String name = header[0].to_lower(); String value = header[1].strip_edges(); if (headers.has(name)) @@ -75,18 +64,17 @@ bool WSLServer::PendingPeer::_parse_request(const PoolStringArray p_protocols) { else headers[name] = value; } -#define _WLS_CHECK(NAME, VALUE) \ - ERR_EXPLAIN("Missing or invalid header '" + String(NAME) + "'. Expected value '" + VALUE + "'"); \ - ERR_FAIL_COND_V(!headers.has(NAME) || headers[NAME].to_lower() != VALUE, false); -#define _WLS_CHECK_EX(NAME) \ - ERR_EXPLAIN("Missing header '" + String(NAME) + "'."); \ - ERR_FAIL_COND_V(!headers.has(NAME), false); - _WLS_CHECK("upgrade", "websocket"); - _WLS_CHECK("sec-websocket-version", "13"); - _WLS_CHECK_EX("sec-websocket-key"); - _WLS_CHECK_EX("connection"); -#undef _WLS_CHECK_EX -#undef _WLS_CHECK +#define _WSL_CHECK(NAME, VALUE) \ + ERR_FAIL_COND_V_MSG(!headers.has(NAME) || headers[NAME].to_lower() != VALUE, false, \ + "Missing or invalid header '" + String(NAME) + "'. Expected value '" + VALUE + "'."); +#define _WSL_CHECK_EX(NAME) \ + ERR_FAIL_COND_V_MSG(!headers.has(NAME), false, "Missing header '" + String(NAME) + "'."); + _WSL_CHECK("upgrade", "websocket"); + _WSL_CHECK("sec-websocket-version", "13"); + _WSL_CHECK_EX("sec-websocket-key"); + _WSL_CHECK_EX("connection"); +#undef _WSL_CHECK_EX +#undef _WSL_CHECK key = headers["sec-websocket-key"]; if (headers.has("sec-websocket-protocol")) { Vector<String> protos = headers["sec-websocket-protocol"].split(","); @@ -115,11 +103,7 @@ Error WSLServer::PendingPeer::do_handshake(PoolStringArray p_protocols) { if (!has_request) { int read = 0; while (true) { - if (req_pos >= WSL_MAX_HEADER_SIZE) { - // Header is too big - ERR_EXPLAIN("Response headers too big"); - ERR_FAIL_V(ERR_OUT_OF_MEMORY); - } + ERR_FAIL_COND_V_MSG(req_pos >= WSL_MAX_HEADER_SIZE, ERR_OUT_OF_MEMORY, "Response headers too big."); Error err = connection->get_partial_data(&req_buf[req_pos], 1, read); if (err != OK) // Got an error return FAILED; @@ -277,8 +261,7 @@ void WSLServer::disconnect_peer(int p_peer_id, int p_code, String p_reason) { } Error WSLServer::set_buffers(int p_in_buffer, int p_in_packets, int p_out_buffer, int p_out_packets) { - ERR_EXPLAIN("Buffers sizes can only be set before listening or connecting"); - ERR_FAIL_COND_V(_server->is_listening(), FAILED); + ERR_FAIL_COND_V_MSG(_server->is_listening(), FAILED, "Buffers sizes can only be set before listening or connecting."); _in_buf_size = nearest_shift(p_in_buffer - 1) + 10; _in_pkt_size = nearest_shift(p_in_packets - 1); diff --git a/modules/xatlas_unwrap/SCsub b/modules/xatlas_unwrap/SCsub index 50e3cb1551..b242fd4673 100644 --- a/modules/xatlas_unwrap/SCsub +++ b/modules/xatlas_unwrap/SCsub @@ -15,10 +15,6 @@ if env['builtin_xatlas']: env_xatlas_unwrap.Prepend(CPPPATH=[thirdparty_dir]) - # upstream uses c++11 - if (not env.msvc): - env_xatlas_unwrap.Append(CXXFLAGS="-std=c++11") - env_thirdparty = env_xatlas_unwrap.Clone() env_thirdparty.disable_warnings() env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp index c18aa04336..04911301ff 100644 --- a/modules/xatlas_unwrap/register_types.cpp +++ b/modules/xatlas_unwrap/register_types.cpp @@ -29,11 +29,14 @@ /*************************************************************************/ #include "register_types.h" + #include "core/error_macros.h" + #include "thirdparty/xatlas/xatlas.h" #include <stdio.h> #include <stdlib.h> + extern bool (*array_mesh_lightmap_unwrap_callback)(float p_texel_size, const float *p_vertices, const float *p_normals, int p_vertex_count, const int *p_indices, const int *p_face_materials, int p_index_count, float **r_uv, int **r_vertex, int *r_vertex_count, int **r_index, int *r_index_count, int *r_size_hint_x, int *r_size_hint_y); bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_vertices, const float *p_normals, int p_vertex_count, const int *p_indices, const int *p_face_materials, int p_index_count, float **r_uv, int **r_vertex, int *r_vertex_count, int **r_index, int *r_index_count, int *r_size_hint_x, int *r_size_hint_y) { diff --git a/platform/SCsub b/platform/SCsub index aa83154ee0..38bab59d74 100644 --- a/platform/SCsub +++ b/platform/SCsub @@ -3,7 +3,8 @@ from compat import open_utf8 Import('env') -platform_sources = [] + +env.platform_sources = [] # Register platform-exclusive APIs reg_apis_inc = '#include "register_platform_apis.h"\n' @@ -11,7 +12,7 @@ reg_apis = 'void register_platform_apis() {\n' unreg_apis = 'void unregister_platform_apis() {\n' for platform in env.platform_apis: platform_dir = env.Dir(platform) - platform_sources.append(platform_dir.File('api/api.cpp')) + env.add_source_files(env.platform_sources, platform + '/api/api.cpp') reg_apis += '\tregister_' + platform + '_api();\n' unreg_apis += '\tunregister_' + platform + '_api();\n' reg_apis_inc += '#include "' + platform + '/api/api.h"\n' @@ -25,7 +26,7 @@ with open_utf8('register_platform_apis.gen.cpp', 'w') as f: f.write(reg_apis) f.write(unreg_apis) -platform_sources.append('register_platform_apis.gen.cpp') +env.add_source_files(env.platform_sources, 'register_platform_apis.gen.cpp') -lib = env.add_library('platform', platform_sources) -env.Prepend(LIBS=lib) +lib = env.add_library('platform', env.platform_sources) +env.Prepend(LIBS=[lib]) diff --git a/platform/android/SCsub b/platform/android/SCsub index cf6752fa54..e355caf0f9 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -2,7 +2,6 @@ Import('env') -from compat import open_utf8 from distutils.version import LooseVersion from detect import get_ndk_version @@ -54,7 +53,6 @@ if lib_arch_dir != '': out_dir = '#platform/android/java/libs/' + lib_type_dir + '/' + lib_arch_dir env_android.Command(out_dir + '/libgodot_android.so', '#bin/libgodot' + env['SHLIBSUFFIX'], Move("$TARGET", "$SOURCE")) - ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"]) - if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"): - stl_lib_path = str(env['ANDROID_NDK_ROOT']) + '/sources/cxx-stl/llvm-libc++/libs/' + lib_arch_dir + '/libc++_shared.so' - env_android.Command(out_dir + '/libc++_shared.so', stl_lib_path, Copy("$TARGET", "$SOURCE")) + + stl_lib_path = str(env['ANDROID_NDK_ROOT']) + '/sources/cxx-stl/llvm-libc++/libs/' + lib_arch_dir + '/libc++_shared.so' + env_android.Command(out_dir + '/libc++_shared.so', stl_lib_path, Copy("$TARGET", "$SOURCE")) diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp index 1232fc7453..711088c158 100644 --- a/platform/android/audio_driver_opensl.cpp +++ b/platform/android/audio_driver_opensl.cpp @@ -97,17 +97,10 @@ Error AudioDriverOpenSL::init() { { (SLuint32)SL_ENGINEOPTION_THREADSAFE, (SLuint32)SL_BOOLEAN_TRUE } }; res = slCreateEngine(&sl, 1, EngineOption, 0, NULL, NULL); - if (res != SL_RESULT_SUCCESS) { + ERR_FAIL_COND_V_MSG(res != SL_RESULT_SUCCESS, ERR_INVALID_PARAMETER, "Could not initialize OpenSL."); - ERR_EXPLAIN("Could not Initialize OpenSL"); - ERR_FAIL_V(ERR_INVALID_PARAMETER); - } res = (*sl)->Realize(sl, SL_BOOLEAN_FALSE); - if (res != SL_RESULT_SUCCESS) { - - ERR_EXPLAIN("Could not Realize OpenSL"); - ERR_FAIL_V(ERR_INVALID_PARAMETER); - } + ERR_FAIL_COND_V_MSG(res != SL_RESULT_SUCCESS, ERR_INVALID_PARAMETER, "Could not realize OpenSL."); return OK; } @@ -215,8 +208,8 @@ void AudioDriverOpenSL::_record_buffer_callback(SLAndroidSimpleBufferQueueItf qu for (int i = 0; i < rec_buffer.size(); i++) { int32_t sample = rec_buffer[i] << 16; - input_buffer_write(sample); - input_buffer_write(sample); // call twice to convert to Stereo + capture_buffer_write(sample); + capture_buffer_write(sample); // call twice to convert to Stereo } SLresult res = (*recordBufferQueueItf)->Enqueue(recordBufferQueueItf, rec_buffer.ptrw(), rec_buffer.size() * sizeof(int16_t)); @@ -287,7 +280,7 @@ Error AudioDriverOpenSL::capture_init_device() { const int rec_buffer_frames = 2048; rec_buffer.resize(rec_buffer_frames); - input_buffer_init(rec_buffer_frames); + capture_buffer_init(rec_buffer_frames); res = (*recordBufferQueueItf)->Enqueue(recordBufferQueueItf, rec_buffer.ptrw(), rec_buffer.size() * sizeof(int16_t)); ERR_FAIL_COND_V(res != SL_RESULT_SUCCESS, ERR_CANT_OPEN); diff --git a/platform/android/detect.py b/platform/android/detect.py index 3f179e3a65..283791f336 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -28,7 +28,6 @@ def get_opts(): ('ndk_platform', 'Target platform (android-<api>, e.g. "android-18")', "android-18"), EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'arm64v8', 'x86', 'x86_64')), BoolVariable('android_neon', 'Enable NEON support (armv7 only)', True), - BoolVariable('android_stl', 'Enable Android STL support (for modules)', True) ] @@ -205,31 +204,29 @@ def configure(env): common_opts = ['-fno-integrated-as', '-gcc-toolchain', gcc_toolchain_path] - lib_sysroot = env["ANDROID_NDK_ROOT"] + "/platforms/" + env['ndk_platform'] + "/" + env['ARCH'] - ## Compile flags + + env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/include"]) + env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++abi/include"]) + env.Append(CXXFLAGS=["-std=gnu++14"]) + # Disable exceptions and rtti on non-tools (template) builds - if env['tools'] or env['android_stl']: - env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/include"]) - env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++abi/include"]) - env.Append(CXXFLAGS=['-frtti', "-std=gnu++14"]) + if env['tools']: + env.Append(CXXFLAGS=['-frtti']) else: env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions']) # Don't use dynamic_cast, necessary with no-rtti. env.Append(CPPDEFINES=['NO_SAFE_CAST']) - ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"]) - if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"): - print("Using NDK unified headers") - sysroot = env["ANDROID_NDK_ROOT"] + "/sysroot" - env.Append(CPPFLAGS=["--sysroot=" + sysroot]) - env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include/" + abi_subpath]) - env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/android/support/include"]) - # For unified headers this define has to be set manually - env.Append(CPPDEFINES=[('__ANDROID_API__', str(get_platform(env['ndk_platform'])))]) - else: - print("Using NDK deprecated headers") - env.Append(CPPFLAGS=["-isystem", lib_sysroot + "/usr/include"]) + lib_sysroot = env["ANDROID_NDK_ROOT"] + "/platforms/" + env['ndk_platform'] + "/" + env['ARCH'] + + # Using NDK unified headers (NDK r15+) + sysroot = env["ANDROID_NDK_ROOT"] + "/sysroot" + env.Append(CPPFLAGS=["--sysroot=" + sysroot]) + env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include/" + abi_subpath]) + env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/android/support/include"]) + # For unified headers this define has to be set manually + env.Append(CPPDEFINES=[('__ANDROID_API__', str(get_platform(env['ndk_platform'])))]) env.Append(CCFLAGS='-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'.split()) env.Append(CPPDEFINES=['NO_STATVFS', 'GLES_ENABLED']) @@ -263,18 +260,15 @@ def configure(env): env.Append(CCFLAGS=common_opts) ## Link flags - if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"): - if LooseVersion(ndk_version) >= LooseVersion("17.1.4828580"): - env.Append(LINKFLAGS=['-Wl,--exclude-libs,libgcc.a', '-Wl,--exclude-libs,libatomic.a', '-nostdlib++']) - else: - env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libandroid_support.a"]) - env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel']) - env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/"]) - env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libc++_shared.so"]) + + ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"]) + if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("17.1.4828580"): + env.Append(LINKFLAGS=['-Wl,--exclude-libs,libgcc.a', '-Wl,--exclude-libs,libatomic.a', '-nostdlib++']) else: - env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel']) - if mt_link: - env.Append(LINKFLAGS=['-Wl,--threads']) + env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libandroid_support.a"]) + env.Append(LINKFLAGS=['-shared', '--sysroot=' + lib_sysroot, '-Wl,--warn-shared-textrel']) + env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/"]) + env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"] +"/sources/cxx-stl/llvm-libc++/libs/" + arch_subpath + "/libc++_shared.so"]) if env["android_arch"] == "armv7": env.Append(LINKFLAGS='-Wl,--fix-cortex-a8'.split()) diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 1b9d31d752..16e49e8a38 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -32,6 +32,7 @@ #include "core/io/marshalls.h" #include "core/io/zip_io.h" +#include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" #include "core/project_settings.h" @@ -725,8 +726,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { uint32_t string_at = decode_uint32(&p_manifest[st_offset + i * 4]); string_at += st_offset + string_count * 4; - ERR_EXPLAIN("Unimplemented, can't read utf8 string table."); - ERR_FAIL_COND(string_flags & UTF8_FLAG); + ERR_FAIL_COND_MSG(string_flags & UTF8_FLAG, "Unimplemented, can't read UTF-8 string table."); if (string_flags & UTF8_FLAG) { @@ -847,6 +847,136 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { uint32_t name = decode_uint32(&p_manifest[iofs + 12]); String tname = string_table[name]; + int dof_index = p_preset->get("graphics/degrees_of_freedom"); // 0: none, 1: 3dof and 6dof, 2: 6dof + + if (tname == "uses-feature" && dof_index > 0) { + if (xr_mode_index == 0) { + WARN_PRINT("VR DOF feature setting is only valid for oculus HMDs with an XR mode set to VR"); + } + ofs += 24; // skip over end tag + + // save manifest ending so we can restore it + Vector<uint8_t> manifest_end; + uint32_t manifest_cur_size = p_manifest.size(); + + manifest_end.resize(p_manifest.size() - ofs); + memcpy(manifest_end.ptrw(), &p_manifest[ofs], manifest_end.size()); + + int32_t attr_name_string = string_table.find("name"); + ERR_FAIL_COND_MSG(attr_name_string == -1, "Template does not have 'name' attribute."); + + int32_t ns_android_string = string_table.find("http://schemas.android.com/apk/res/android"); + if (ns_android_string == -1) { + string_table.push_back("http://schemas.android.com/apk/res/android"); + ns_android_string = string_table.size() - 1; + } + + int32_t attr_uses_permission_string = string_table.find("uses-feature"); + if (attr_uses_permission_string == -1) { + string_table.push_back("uses-feature"); + attr_uses_permission_string = string_table.size() - 1; + } + + int32_t attr_required_string = string_table.find("required"); + if (attr_required_string == -1) { + string_table.push_back("required"); + attr_required_string = string_table.size() - 1; + } + + int32_t attr_version_string = string_table.find("version"); + if (attr_version_string == -1) { + string_table.push_back("version"); + attr_version_string = string_table.size() - 1; + } + + String required_value_string; + if (dof_index == 1) { + required_value_string = "false"; + } else if (dof_index == 2) { + required_value_string = "true"; + } else { + ERR_FAIL_MSG("Unknown DoF index: " + itos(dof_index) + "."); + } + int32_t required_value = string_table.find(required_value_string); + if (required_value == -1) { + string_table.push_back(required_value_string); + required_value = string_table.size() - 1; + } + + int32_t version_value = string_table.find("1"); + if (version_value == -1) { + string_table.push_back("1"); + version_value = string_table.size() - 1; + } + + int32_t feature_string = string_table.find("android.hardware.vr.headtracking"); + if (feature_string == -1) { + string_table.push_back("android.hardware.vr.headtracking"); + feature_string = string_table.size() - 1; + } + + { + manifest_cur_size += 96 + 20; // node and three attrs + end node + p_manifest.resize(manifest_cur_size); + + // start tag + encode_uint16(0x102, &p_manifest.write[ofs]); // type + encode_uint16(16, &p_manifest.write[ofs + 2]); // headersize + encode_uint32(96, &p_manifest.write[ofs + 4]); // size + encode_uint32(0, &p_manifest.write[ofs + 8]); // lineno + encode_uint32(-1, &p_manifest.write[ofs + 12]); // comment + encode_uint32(-1, &p_manifest.write[ofs + 16]); // ns + encode_uint32(attr_uses_permission_string, &p_manifest.write[ofs + 20]); // name + encode_uint16(20, &p_manifest.write[ofs + 24]); // attr_start + encode_uint16(20, &p_manifest.write[ofs + 26]); // attr_size + encode_uint16(3, &p_manifest.write[ofs + 28]); // num_attrs + encode_uint16(0, &p_manifest.write[ofs + 30]); // id_index + encode_uint16(0, &p_manifest.write[ofs + 32]); // class_index + encode_uint16(0, &p_manifest.write[ofs + 34]); // style_index + + // android:name attribute + encode_uint32(ns_android_string, &p_manifest.write[ofs + 36]); // ns + encode_uint32(attr_name_string, &p_manifest.write[ofs + 40]); // 'name' + encode_uint32(feature_string, &p_manifest.write[ofs + 44]); // raw_value + encode_uint16(8, &p_manifest.write[ofs + 48]); // typedvalue_size + p_manifest.write[ofs + 50] = 0; // typedvalue_always0 + p_manifest.write[ofs + 51] = 0x03; // typedvalue_type (string) + encode_uint32(feature_string, &p_manifest.write[ofs + 52]); // typedvalue reference + + // android:required attribute + encode_uint32(ns_android_string, &p_manifest.write[ofs + 56]); // ns + encode_uint32(attr_required_string, &p_manifest.write[ofs + 60]); // 'name' + encode_uint32(required_value, &p_manifest.write[ofs + 64]); // raw_value + encode_uint16(8, &p_manifest.write[ofs + 68]); // typedvalue_size + p_manifest.write[ofs + 70] = 0; // typedvalue_always0 + p_manifest.write[ofs + 71] = 0x03; // typedvalue_type (string) + encode_uint32(required_value, &p_manifest.write[ofs + 72]); // typedvalue reference + + // android:version attribute + encode_uint32(ns_android_string, &p_manifest.write[ofs + 76]); // ns + encode_uint32(attr_version_string, &p_manifest.write[ofs + 80]); // 'name' + encode_uint32(version_value, &p_manifest.write[ofs + 84]); // raw_value + encode_uint16(8, &p_manifest.write[ofs + 88]); // typedvalue_size + p_manifest.write[ofs + 90] = 0; // typedvalue_always0 + p_manifest.write[ofs + 91] = 0x03; // typedvalue_type (string) + encode_uint32(version_value, &p_manifest.write[ofs + 92]); // typedvalue reference + + ofs += 96; + + // end tag + encode_uint16(0x103, &p_manifest.write[ofs]); // type + encode_uint16(16, &p_manifest.write[ofs + 2]); // headersize + encode_uint32(24, &p_manifest.write[ofs + 4]); // size + encode_uint32(0, &p_manifest.write[ofs + 8]); // lineno + encode_uint32(-1, &p_manifest.write[ofs + 12]); // comment + encode_uint32(-1, &p_manifest.write[ofs + 16]); // ns + encode_uint32(attr_uses_permission_string, &p_manifest.write[ofs + 20]); // name + + ofs += 24; + } + memcpy(&p_manifest.write[ofs], manifest_end.ptr(), manifest_end.size()); + ofs -= 24; // go back over back end + } if (tname == "manifest") { // save manifest ending so we can restore it @@ -857,12 +987,10 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { memcpy(manifest_end.ptrw(), &p_manifest[ofs], manifest_end.size()); int32_t attr_name_string = string_table.find("name"); - ERR_EXPLAIN("Template does not have 'name' attribute"); - ERR_FAIL_COND(attr_name_string == -1); + ERR_FAIL_COND_MSG(attr_name_string == -1, "Template does not have 'name' attribute."); int32_t ns_android_string = string_table.find("android"); - ERR_EXPLAIN("Template does not have 'android' namespace"); - ERR_FAIL_COND(ns_android_string == -1); + ERR_FAIL_COND_MSG(ns_android_string == -1, "Template does not have 'android' namespace."); int32_t attr_uses_permission_string = string_table.find("uses-permission"); if (attr_uses_permission_string == -1) { @@ -1156,6 +1284,7 @@ public: virtual void get_export_options(List<ExportOption> *r_options) { r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "graphics/xr_mode", PROPERTY_HINT_ENUM, "Regular,Oculus Mobile VR"), 0)); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "graphics/degrees_of_freedom", PROPERTY_HINT_ENUM, "None,3DOF and 6DOF,6DOF"), 0)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/32_bits_framebuffer"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "one_click_deploy/clear_previous_install"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "*.apk"), "")); @@ -1270,8 +1399,9 @@ public: return ERR_UNCONFIGURED; } - //export_temp + // Export_temp APK. if (ep.step("Exporting APK", 0)) { + device_lock->unlock(); return ERR_SKIP; } @@ -1281,11 +1411,20 @@ public: if (use_reverse) p_debug_flags |= DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST; - String export_to = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpexport.apk"); - Error err = export_project(p_preset, true, export_to, p_debug_flags); - if (err) { - device_lock->unlock(); - return err; + String tmp_export_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpexport.apk"); + +#define CLEANUP_AND_RETURN(m_err) \ + { \ + DirAccess::remove_file_or_error(tmp_export_path); \ + device_lock->unlock(); \ + return m_err; \ + } + + // Export to temporary APK before sending to device. + Error err = export_project(p_preset, true, tmp_export_path, p_debug_flags); + + if (err != OK) { + CLEANUP_AND_RETURN(err); } List<String> args; @@ -1297,7 +1436,7 @@ public: if (remove_prev) { if (ep.step("Uninstalling...", 1)) { - return ERR_SKIP; + CLEANUP_AND_RETURN(ERR_SKIP); } print_line("Uninstalling previous version: " + devices[p_device].name); @@ -1312,7 +1451,7 @@ public: print_line("Installing to device (please wait...): " + devices[p_device].name); if (ep.step("Installing to device (please wait...)", 2)) { - return ERR_SKIP; + CLEANUP_AND_RETURN(ERR_SKIP); } args.clear(); @@ -1320,13 +1459,12 @@ public: args.push_back(devices[p_device].id); args.push_back("install"); args.push_back("-r"); - args.push_back(export_to); + args.push_back(tmp_export_path); err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv); if (err || rv != 0) { EditorNode::add_io_error("Could not install to device."); - device_lock->unlock(); - return ERR_CANT_CREATE; + CLEANUP_AND_RETURN(ERR_CANT_CREATE); } if (use_remote) { @@ -1380,7 +1518,7 @@ public: } if (ep.step("Running on Device...", 3)) { - return ERR_SKIP; + CLEANUP_AND_RETURN(ERR_SKIP); } args.clear(); args.push_back("-s"); @@ -1400,11 +1538,11 @@ public: err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv); if (err || rv != 0) { EditorNode::add_io_error("Could not execute on device."); - device_lock->unlock(); - return ERR_CANT_CREATE; + CLEANUP_AND_RETURN(ERR_CANT_CREATE); } - device_lock->unlock(); - return OK; + + CLEANUP_AND_RETURN(OK); +#undef CLEANUP_AND_RETURN } virtual Ref<Texture> get_run_icon() const { @@ -1895,8 +2033,16 @@ public: zlib_filefunc_def io2 = io; FileAccess *dst_f = NULL; io2.opaque = &dst_f; - String unaligned_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpexport-unaligned.apk"); - zipFile unaligned_apk = zipOpen2(unaligned_path.utf8().get_data(), APPEND_STATUS_CREATE, NULL, &io2); + + String tmp_unaligned_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpexport-unaligned.apk"); + +#define CLEANUP_AND_RETURN(m_err) \ + { \ + DirAccess::remove_file_or_error(tmp_unaligned_path); \ + return m_err; \ + } + + zipFile unaligned_apk = zipOpen2(tmp_unaligned_path.utf8().get_data(), APPEND_STATUS_CREATE, NULL, &io2); bool use_32_fb = p_preset->get("graphics/32_bits_framebuffer"); bool immersive = p_preset->get("screen/immersive_mode"); @@ -2024,7 +2170,7 @@ public: } if (ep.step("Adding Files...", 1)) { - return ERR_SKIP; + CLEANUP_AND_RETURN(ERR_SKIP); } Error err = OK; Vector<String> cl = cmdline.strip_edges().split(" "); @@ -2056,7 +2202,7 @@ public: unzClose(pkg); EditorNode::add_io_error("Could not write expansion package file: " + apkfname); - return OK; + CLEANUP_AND_RETURN(ERR_SKIP); } cl.push_back("--use_apk_expansion"); @@ -2143,8 +2289,8 @@ public: zipClose(unaligned_apk, NULL); unzClose(pkg); - if (err) { - return err; + if (err != OK) { + CLEANUP_AND_RETURN(err); } if (_signed) { @@ -2152,7 +2298,7 @@ public: String jarsigner = EditorSettings::get_singleton()->get("export/android/jarsigner"); if (!FileAccess::exists(jarsigner)) { EditorNode::add_io_error("'jarsigner' could not be found.\nPlease supply a path in the Editor Settings.\nThe resulting APK is unsigned."); - return OK; + CLEANUP_AND_RETURN(OK); } String keystore; @@ -2172,7 +2318,7 @@ public: } if (ep.step("Signing debug APK...", 103)) { - return ERR_SKIP; + CLEANUP_AND_RETURN(ERR_SKIP); } } else { @@ -2181,13 +2327,13 @@ public: user = release_username; if (ep.step("Signing release APK...", 103)) { - return ERR_SKIP; + CLEANUP_AND_RETURN(ERR_SKIP); } } if (!FileAccess::exists(keystore)) { EditorNode::add_io_error("Could not find keystore, unable to export."); - return ERR_FILE_CANT_OPEN; + CLEANUP_AND_RETURN(ERR_FILE_CANT_OPEN); } List<String> args; @@ -2205,30 +2351,30 @@ public: args.push_back(keystore); args.push_back("-storepass"); args.push_back(password); - args.push_back(unaligned_path); + args.push_back(tmp_unaligned_path); args.push_back(user); int retval; OS::get_singleton()->execute(jarsigner, args, true, NULL, NULL, &retval); if (retval) { EditorNode::add_io_error("'jarsigner' returned with error #" + itos(retval)); - return ERR_CANT_CREATE; + CLEANUP_AND_RETURN(ERR_CANT_CREATE); } if (ep.step("Verifying APK...", 104)) { - return ERR_SKIP; + CLEANUP_AND_RETURN(ERR_SKIP); } args.clear(); args.push_back("-verify"); args.push_back("-keystore"); args.push_back(keystore); - args.push_back(unaligned_path); + args.push_back(tmp_unaligned_path); args.push_back("-verbose"); OS::get_singleton()->execute(jarsigner, args, true, NULL, NULL, &retval); if (retval) { EditorNode::add_io_error("'jarsigner' verification of APK failed. Make sure to use a jarsigner from OpenJDK 8."); - return ERR_CANT_CREATE; + CLEANUP_AND_RETURN(ERR_CANT_CREATE); } } @@ -2237,14 +2383,14 @@ public: static const int ZIP_ALIGNMENT = 4; if (ep.step("Aligning APK...", 105)) { - return ERR_SKIP; + CLEANUP_AND_RETURN(ERR_SKIP); } - unzFile tmp_unaligned = unzOpen2(unaligned_path.utf8().get_data(), &io); + unzFile tmp_unaligned = unzOpen2(tmp_unaligned_path.utf8().get_data(), &io); if (!tmp_unaligned) { - EditorNode::add_io_error("Could not find temp unaligned APK."); - return ERR_FILE_NOT_FOUND; + EditorNode::add_io_error("Could not unzip temporary unaligned APK."); + CLEANUP_AND_RETURN(ERR_FILE_NOT_FOUND); } ret = unzGoToFirstFile(tmp_unaligned); @@ -2314,7 +2460,7 @@ public: zipClose(final_apk, NULL); unzClose(tmp_unaligned); - return OK; + CLEANUP_AND_RETURN(OK); } virtual void get_platform_features(List<String> *r_features) { diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 6e1841fa8b..f493b5f33f 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -56,6 +56,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.os.Messenger; +import android.os.Vibrator; import android.provider.Settings.Secure; import android.support.v4.content.ContextCompat; import android.view.Display; @@ -98,6 +99,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC 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 IDownloaderService mRemoteService; private TextView mStatusText; @@ -324,6 +326,15 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC }); } + public void vibrate(int p_duration_ms) { + if (requestPermission("VIBRATE")) { + Vibrator v = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE); + if (v != null) { + v.vibrate(p_duration_ms); + } + } + } + public void restart() { // HACK: // @@ -625,6 +636,10 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC GodotLib.ondestroy(this); super.onDestroy(); + + // TODO: This is a temp solution. The proper fix will involve tracking down and properly shutting down each + // native Godot components that is started in Godot#onVideoInit. + forceQuit(); } @Override @@ -985,6 +1000,13 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC return false; } } + + 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; } diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index 77f077456e..1159e93166 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -686,20 +686,11 @@ static void _initialize_java_modules() { print_line("Loading Android module: " + m); jstring strClassName = env->NewStringUTF(m.utf8().get_data()); jclass singletonClass = (jclass)env->CallObjectMethod(cls, findClass, strClassName); - - if (!singletonClass) { - - ERR_EXPLAIN("Couldn't find singleton for class: " + m); - ERR_CONTINUE(!singletonClass); - } + ERR_CONTINUE_MSG(!singletonClass, "Couldn't find singleton for class: " + m + "."); jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lorg/godotengine/godot/Godot$SingletonBase;"); + ERR_CONTINUE_MSG(!initialize, "Couldn't find proper initialize function 'public static Godot.SingletonBase Class::initialize(Activity p_activity)' initializer for singleton class: " + m + "."); - if (!initialize) { - - ERR_EXPLAIN("Couldn't find proper initialize function 'public static Godot.SingletonBase Class::initialize(Activity p_activity)' initializer for singleton class: " + m); - ERR_CONTINUE(!initialize); - } jobject obj = env->CallStaticObjectMethod(singletonClass, initialize, godot_java->get_activity()); env->NewGlobalRef(obj); } diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index 339b14974c..c7dc1d124c 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -62,6 +62,7 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_godot_instance) { _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"); + _vibrate = p_env->GetMethodID(cls, "vibrate", "(I)V"); } GodotJavaWrapper::~GodotJavaWrapper() { @@ -211,3 +212,10 @@ bool GodotJavaWrapper::is_activity_resumed() { return false; } } + +void GodotJavaWrapper::vibrate(int p_duration_ms) { + if (_vibrate) { + JNIEnv *env = ThreadAndroid::get_env(); + env->CallVoidMethod(godot_instance, _vibrate, p_duration_ms); + } +} diff --git a/platform/android/java_godot_wrapper.h b/platform/android/java_godot_wrapper.h index 82c2a5d122..3e0e950180 100644 --- a/platform/android/java_godot_wrapper.h +++ b/platform/android/java_godot_wrapper.h @@ -57,6 +57,7 @@ private: jmethodID _init_input_devices = 0; jmethodID _get_surface = 0; jmethodID _is_activity_resumed = 0; + jmethodID _vibrate = 0; public: GodotJavaWrapper(JNIEnv *p_env, jobject p_godot_instance); @@ -82,6 +83,7 @@ public: void init_input_devices(); jobject get_surface(); bool is_activity_resumed(); + void vibrate(int p_duration_ms); }; #endif /* !JAVA_GODOT_WRAPPER_H */ diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index ebc319e57d..9b2df50f6c 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -71,8 +71,7 @@ const char *OS_Android::get_video_driver_name(int p_driver) const { case VIDEO_DRIVER_GLES2: return "GLES2"; } - ERR_EXPLAIN("Invalid video driver index " + itos(p_driver)); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Invalid video driver index: " + itos(p_driver) + "."); } int OS_Android::get_audio_driver_count() const { @@ -223,10 +222,7 @@ bool OS_Android::request_permission(const String &p_name) { 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); - if (!p_library_handle) { - ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror()); - ERR_FAIL_V(ERR_CANT_OPEN); - } + ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ", error: " + dlerror() + "."); return OK; } @@ -704,6 +700,10 @@ String OS_Android::get_joy_guid(int p_device) const { return input->get_joy_guid_remapped(p_device); } +void OS_Android::vibrate_handheld(int p_duration_ms) { + godot_java->vibrate(p_duration_ms); +} + bool OS_Android::_check_internal_feature_support(const String &p_feature) { if (p_feature == "mobile") { //TODO support etc2 only if GLES3 driver is selected diff --git a/platform/android/os_android.h b/platform/android/os_android.h index e74d4cfd43..a17941f7c0 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -198,6 +198,7 @@ public: virtual bool is_joy_known(int p_device); virtual String get_joy_guid(int p_device) const; void joy_connection_changed(int p_device, bool p_connected, String p_name); + void vibrate_handheld(int p_duration_ms); virtual bool _check_internal_feature_support(const String &p_feature); OS_Android(GodotJavaWrapper *p_godot_java, GodotIOJavaWrapper *p_godot_io_java, bool p_use_apk_expansion); diff --git a/platform/android/thread_jandroid.h b/platform/android/thread_jandroid.h index 1e1c00ab39..0b6e1f4b4a 100644 --- a/platform/android/thread_jandroid.h +++ b/platform/android/thread_jandroid.h @@ -31,10 +31,6 @@ #ifndef THREAD_POSIX_H #define THREAD_POSIX_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #include "core/os/thread.h" #include <jni.h> #include <pthread.h> diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 64405bfa5b..3f1230faa8 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -37,6 +37,7 @@ #include "os_iphone.h" #import "GameController/GameController.h" +#import <AudioToolbox/AudioServices.h> #define kFilteringFactor 0.1 #define kRenderingFrequency 60 @@ -61,6 +62,10 @@ void _set_keep_screen_on(bool p_enabled) { [[UIApplication sharedApplication] setIdleTimerDisabled:(BOOL)p_enabled]; }; +void _vibrate() { + AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); +}; + @implementation AppDelegate @synthesize window; diff --git a/platform/iphone/camera_ios.mm b/platform/iphone/camera_ios.mm index 029ce6debf..ff84df66ff 100644 --- a/platform/iphone/camera_ios.mm +++ b/platform/iphone/camera_ios.mm @@ -158,7 +158,7 @@ } else if (dataCbCr == NULL) { print_line("Couldn't access CbCr pixel buffer data"); } else { - UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; Ref<Image> img[2]; { diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 85a45d62f8..1cbf4d6a70 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -768,7 +768,7 @@ Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir DirAccess *da = DirAccess::create_for_path(asset); if (!da) { memdelete(filesystem_da); - ERR_FAIL_COND_V(!da, ERR_CANT_CREATE); + ERR_FAIL_V_MSG(ERR_CANT_CREATE, "Can't create directory: " + asset + "."); } bool file_exists = da->file_exists(asset); bool dir_exists = da->dir_exists(asset); @@ -847,8 +847,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p EditorProgress ep("export", "Exporting for iOS", 5, true); String team_id = p_preset->get("application/app_store_team_id"); - ERR_EXPLAIN("App Store Team ID not specified - cannot configure the project."); - ERR_FAIL_COND_V(team_id.length() == 0, ERR_CANT_OPEN); + ERR_FAIL_COND_V_MSG(team_id.length() == 0, ERR_CANT_OPEN, "App Store Team ID not specified - cannot configure the project."); if (p_debug) src_pkg_name = p_preset->get("custom_package/debug"); diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index f5fce66059..353078c51c 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -64,8 +64,7 @@ const char *OSIPhone::get_video_driver_name(int p_driver) const { case VIDEO_DRIVER_GLES2: return "GLES2"; } - ERR_EXPLAIN("Invalid video driver index " + itos(p_driver)); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Invalid video driver index: " + itos(p_driver) + "."); }; OSIPhone *OSIPhone::get_singleton() { @@ -471,6 +470,7 @@ extern void _show_keyboard(String p_existing); extern void _hide_keyboard(); extern Error _shell_open(String p_uri); extern void _set_keep_screen_on(bool p_enabled); +extern void _vibrate(); void OSIPhone::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) { _show_keyboard(p_existing_text); @@ -586,6 +586,11 @@ void OSIPhone::native_video_stop() { _stop_video(); } +void OSIPhone::vibrate_handheld(int p_duration_ms) { + // iOS does not support duration for vibration + _vibrate(); +} + bool OSIPhone::_check_internal_feature_support(const String &p_feature) { return p_feature == "mobile"; diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index c16c29a858..804ba0b1af 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -195,6 +195,7 @@ public: virtual void native_video_unpause(); virtual void native_video_focus_out(); virtual void native_video_stop(); + virtual void vibrate_handheld(int p_duration_ms = 500); virtual bool _check_internal_feature_support(const String &p_feature); OSIPhone(int width, int height, String p_data_dir); diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp index 163826f828..b359699d3a 100644 --- a/platform/javascript/audio_driver_javascript.cpp +++ b/platform/javascript/audio_driver_javascript.cpp @@ -63,7 +63,7 @@ void AudioDriverJavaScript::mix_to_js() { void AudioDriverJavaScript::process_capture(float sample) { int32_t sample32 = int32_t(sample * 32768.f) * (1U << 16); - input_buffer_write(sample32); + capture_buffer_write(sample32); } Error AudioDriverJavaScript::init() { @@ -198,7 +198,7 @@ void AudioDriverJavaScript::finish() { Error AudioDriverJavaScript::capture_start() { - input_buffer_init(buffer_length); + capture_buffer_init(buffer_length); /* clang-format off */ EM_ASM({ @@ -245,8 +245,6 @@ Error AudioDriverJavaScript::capture_stop() { }); /* clang-format on */ - input_buffer.clear(); - return OK; } diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 10680ad1f5..a0d6ac9214 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -128,7 +128,6 @@ def configure(env): ## Link flags env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) - env.Append(LINKFLAGS=['-s', 'BINARYEN_TRAP_MODE=\'clamp\'']) # Allow increasing memory buffer size during runtime. This is efficient # when using WebAssembly (in comparison to asm.js) and works well for @@ -142,3 +141,6 @@ def configure(env): # TODO: Reevaluate usage of this setting now that engine.js manages engine runtime. env.Append(LINKFLAGS=['-s', 'NO_EXIT_RUNTIME=1']) + + #adding flag due to issue with emscripten 1.38.41 callMain method https://github.com/emscripten-core/emscripten/blob/incoming/ChangeLog.md#v13841-08072019 + env.Append(LINKFLAGS=['-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["callMain"]']) diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index c68b420c61..69dd038709 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -362,12 +362,21 @@ int EditorExportPlatformJavaScript::get_device_count() const { Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) { - String path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_export.html"); + String basepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_js_export"); + String path = basepath + ".html"; Error err = export_project(p_preset, true, path, p_debug_flags); - if (err) { + if (err != OK) { + // Export generates several files, clean them up on failure. + DirAccess::remove_file_or_error(basepath + ".html"); + DirAccess::remove_file_or_error(basepath + ".js"); + DirAccess::remove_file_or_error(basepath + ".pck"); + DirAccess::remove_file_or_error(basepath + ".png"); + DirAccess::remove_file_or_error(basepath + ".wasm"); return err; } OS::get_singleton()->shell_open(String("file://") + path); + // FIXME: Find out how to clean up export files after running the successfully + // exported game. Might not be trivial. return OK; } diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp index b4bab9a999..e6e933811f 100644 --- a/platform/javascript/http_client_javascript.cpp +++ b/platform/javascript/http_client_javascript.cpp @@ -68,21 +68,18 @@ Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl, void HTTPClient::set_connection(const Ref<StreamPeer> &p_connection) { - ERR_EXPLAIN("Accessing an HTTPClient's StreamPeer is not supported for the HTML5 platform"); - ERR_FAIL(); + ERR_FAIL_MSG("Accessing an HTTPClient's StreamPeer is not supported for the HTML5 platform."); } Ref<StreamPeer> HTTPClient::get_connection() const { - ERR_EXPLAIN("Accessing an HTTPClient's StreamPeer is not supported for the HTML5 platform"); - ERR_FAIL_V(REF()); + ERR_FAIL_V_MSG(REF(), "Accessing an HTTPClient's StreamPeer is not supported for the HTML5 platform."); } Error HTTPClient::prepare_request(Method p_method, const String &p_url, const Vector<String> &p_headers) { ERR_FAIL_INDEX_V(p_method, METHOD_MAX, ERR_INVALID_PARAMETER); - ERR_EXPLAIN("HTTP methods TRACE and CONNECT are not supported for the HTML5 platform"); - ERR_FAIL_COND_V(p_method == METHOD_TRACE || p_method == METHOD_CONNECT, ERR_UNAVAILABLE); + ERR_FAIL_COND_V_MSG(p_method == METHOD_TRACE || p_method == METHOD_CONNECT, ERR_UNAVAILABLE, "HTTP methods TRACE and CONNECT are not supported for the HTML5 platform."); ERR_FAIL_COND_V(status != STATUS_CONNECTED, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V(host.empty(), ERR_UNCONFIGURED); ERR_FAIL_COND_V(port < 0, ERR_UNCONFIGURED); @@ -201,8 +198,7 @@ PoolByteArray HTTPClient::read_response_body_chunk() { void HTTPClient::set_blocking_mode(bool p_enable) { - ERR_EXPLAIN("HTTPClient blocking mode is not supported for the HTML5 platform"); - ERR_FAIL_COND(p_enable); + ERR_FAIL_COND_MSG(p_enable, "HTTPClient blocking mode is not supported for the HTML5 platform."); } bool HTTPClient::is_blocking_mode_enabled() const { diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 5363cd4af7..0179bf813d 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -192,9 +192,8 @@ void OS_JavaScript::set_window_fullscreen(bool p_enabled) { strategy.filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT; strategy.canvasResizedCallback = NULL; EMSCRIPTEN_RESULT result = emscripten_request_fullscreen_strategy(NULL, false, &strategy); - ERR_EXPLAIN("Enabling fullscreen is only possible from an input callback for the HTML5 platform"); - ERR_FAIL_COND(result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED); - ERR_FAIL_COND(result != EMSCRIPTEN_RESULT_SUCCESS); + ERR_FAIL_COND_MSG(result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED, "Enabling fullscreen is only possible from an input callback for the HTML5 platform."); + ERR_FAIL_COND_MSG(result != EMSCRIPTEN_RESULT_SUCCESS, "Enabling fullscreen is only possible from an input callback for the HTML5 platform."); // Not fullscreen yet, so prevent "windowed" canvas dimensions from // being overwritten. entering_fullscreen = true; @@ -582,8 +581,7 @@ void OS_JavaScript::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_s void OS_JavaScript::set_mouse_mode(OS::MouseMode p_mode) { - ERR_EXPLAIN("MOUSE_MODE_CONFINED is not supported for the HTML5 platform"); - ERR_FAIL_COND(p_mode == MOUSE_MODE_CONFINED); + ERR_FAIL_COND_MSG(p_mode == MOUSE_MODE_CONFINED, "MOUSE_MODE_CONFINED is not supported for the HTML5 platform."); if (p_mode == get_mouse_mode()) return; @@ -602,9 +600,8 @@ void OS_JavaScript::set_mouse_mode(OS::MouseMode p_mode) { } else if (p_mode == MOUSE_MODE_CAPTURED) { EMSCRIPTEN_RESULT result = emscripten_request_pointerlock("canvas", false); - ERR_EXPLAIN("MOUSE_MODE_CAPTURED can only be entered from within an appropriate input callback"); - ERR_FAIL_COND(result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED); - ERR_FAIL_COND(result != EMSCRIPTEN_RESULT_SUCCESS); + ERR_FAIL_COND_MSG(result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED, "MOUSE_MODE_CAPTURED can only be entered from within an appropriate input callback."); + ERR_FAIL_COND_MSG(result != EMSCRIPTEN_RESULT_SUCCESS, "MOUSE_MODE_CAPTURED can only be entered from within an appropriate input callback."); // set_css_cursor must be called before set_cursor_shape to make the cursor visible set_css_cursor(godot2dom_cursor(cursor_shape)); set_cursor_shape(cursor_shape); @@ -810,8 +807,7 @@ const char *OS_JavaScript::get_video_driver_name(int p_driver) const { case VIDEO_DRIVER_GLES2: return "GLES2"; } - ERR_EXPLAIN("Invalid video driver index " + itos(p_driver)); - ERR_FAIL_V(NULL); + ERR_FAIL_V_MSG(NULL, "Invalid video driver index: " + itos(p_driver) + "."); } // Audio @@ -846,8 +842,7 @@ void OS_JavaScript::set_clipboard(const String &p_text) { return 0; }, p_text.utf8().get_data()); /* clang-format on */ - ERR_EXPLAIN("Clipboard API is not supported."); - ERR_FAIL_COND(err); + ERR_FAIL_COND_MSG(err, "Clipboard API is not supported."); } String OS_JavaScript::get_clipboard() const { @@ -1117,20 +1112,17 @@ void OS_JavaScript::finalize() { Error OS_JavaScript::execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id, String *r_pipe, int *r_exitcode, bool read_stderr, Mutex *p_pipe_mutex) { - ERR_EXPLAIN("OS::execute() is not available on the HTML5 platform"); - ERR_FAIL_V(ERR_UNAVAILABLE); + ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "OS::execute() is not available on the HTML5 platform."); } Error OS_JavaScript::kill(const ProcessID &p_pid) { - ERR_EXPLAIN("OS::kill() is not available on the HTML5 platform"); - ERR_FAIL_V(ERR_UNAVAILABLE); + ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "OS::kill() is not available on the HTML5 platform."); } int OS_JavaScript::get_process_id() const { - ERR_EXPLAIN("OS::get_process_id() is not available on the HTML5 platform"); - ERR_FAIL_V(0); + ERR_FAIL_V_MSG(0, "OS::get_process_id() is not available on the HTML5 platform."); } extern "C" EMSCRIPTEN_KEEPALIVE void send_notification(int p_notification) { diff --git a/platform/osx/dir_access_osx.h b/platform/osx/dir_access_osx.h index e1aa038c61..c5951a570e 100644 --- a/platform/osx/dir_access_osx.h +++ b/platform/osx/dir_access_osx.h @@ -41,9 +41,6 @@ #include "core/os/dir_access.h" #include "drivers/unix/dir_access_unix.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class DirAccessOSX : public DirAccessUnix { protected: virtual String fix_unicode_name(const char *p_name) const; diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 8cabc45250..56b0a44dbc 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -29,9 +29,11 @@ /*************************************************************************/ #include "export.h" + #include "core/io/marshalls.h" #include "core/io/resource_saver.h" #include "core/io/zip_io.h" +#include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" #include "core/project_settings.h" @@ -244,13 +246,17 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_ copy->resize(icon_infos[i].size, icon_infos[i].size); if (icon_infos[i].is_png) { - //encode png icon + // Encode PNG icon. it->create_from_image(copy); String path = EditorSettings::get_singleton()->get_cache_dir().plus_file("icon.png"); ResourceSaver::save(path, it); FileAccess *f = FileAccess::open(path, FileAccess::READ); - ERR_FAIL_COND(!f); + if (!f) { + // Clean up generated file. + DirAccess::remove_file_or_error(path); + ERR_FAIL(); + } int ofs = data.size(); uint32_t len = f->get_len(); @@ -261,6 +267,10 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_ len = BSWAP32(len); copymem(&data.write[ofs], icon_infos[i].name, 4); encode_uint32(len, &data.write[ofs + 4]); + + // Clean up generated file. + DirAccess::remove_file_or_error(path); + } else { PoolVector<uint8_t> src_data = copy->get_data(); @@ -561,7 +571,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p } } } - //bleh? } if (data.size() > 0) { @@ -687,7 +696,8 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p // Clean up temporary .app dir OS::get_singleton()->move_to_trash(tmp_app_path_name); - } else { + + } else { // pck String pack_path = EditorSettings::get_singleton()->get_cache_dir().plus_file(pkg_name + ".pck"); @@ -747,6 +757,9 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p zipCloseFileInZip(dst_pkg_zip); } } + + // Clean up generated file. + DirAccess::remove_file_or_error(pack_path); } } diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index a83d5084ed..9cb2915701 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -51,9 +51,6 @@ #include <CoreVideo/CoreVideo.h> #undef CursorShape -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class OS_OSX : public OS_Unix { public: diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 726882438b..ab77897b08 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1599,6 +1599,7 @@ void OS_OSX::finalize() { memdelete(joypad_osx); memdelete(input); + cursors_cache.clear(); visual_server->finish(); memdelete(visual_server); //memdelete(rasterizer); @@ -1718,10 +1719,7 @@ Error OS_OSX::open_dynamic_library(const String p_path, void *&p_library_handle, } p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW); - if (!p_library_handle) { - ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror()); - ERR_FAIL_V(ERR_CANT_OPEN); - } + ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ", error: " + dlerror() + "."); return OK; } @@ -1961,15 +1959,10 @@ void OS_OSX::set_native_icon(const String &p_filename) { memdelete(f); NSData *icon_data = [[[NSData alloc] initWithBytes:&data.write[0] length:len] autorelease]; - if (!icon_data) { - ERR_EXPLAIN("Error reading icon data"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!icon_data, "Error reading icon data."); + NSImage *icon = [[[NSImage alloc] initWithData:icon_data] autorelease]; - if (!icon) { - ERR_EXPLAIN("Error loading icon"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!icon, "Error loading icon."); [NSApp setApplicationIconImage:icon]; } @@ -2410,7 +2403,7 @@ Size2 OS_OSX::get_min_window_size() const { void OS_OSX::set_min_window_size(const Size2 p_size) { if ((p_size != Size2()) && (max_size != Size2()) && ((p_size.x > max_size.x) || (p_size.y > max_size.y))) { - WARN_PRINT("Minimum window size can't be larger than maximum window size!"); + ERR_PRINT("Minimum window size can't be larger than maximum window size!"); return; } min_size = p_size; @@ -2426,7 +2419,7 @@ void OS_OSX::set_min_window_size(const Size2 p_size) { void OS_OSX::set_max_window_size(const Size2 p_size) { if ((p_size != Size2()) && ((p_size.x < min_size.x) || (p_size.y < min_size.y))) { - WARN_PRINT("Maximum window size can't be smaller than minimum window size!"); + ERR_PRINT("Maximum window size can't be smaller than minimum window size!"); return; } max_size = p_size; diff --git a/platform/server/detect.py b/platform/server/detect.py index 185dce8128..b6028c20e3 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -35,6 +35,7 @@ def get_opts(): BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), BoolVariable('use_asan', 'Use LLVM/GCC compiler address sanitizer (ASAN))', False), BoolVariable('use_lsan', 'Use LLVM/GCC compiler leak sanitizer (LSAN))', False), + BoolVariable('use_tsan', 'Use LLVM/GCC compiler thread sanitizer (TSAN))', False), EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')), BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False), BoolVariable('execinfo', 'Use libexecinfo on systems where glibc is not available', False), @@ -99,7 +100,7 @@ def configure(env): env.extra_suffix = ".llvm" + env.extra_suffix - if env['use_ubsan'] or env['use_asan'] or env['use_lsan']: + if env['use_ubsan'] or env['use_asan'] or env['use_lsan'] or env['use_tsan']: env.extra_suffix += "s" if env['use_ubsan']: @@ -114,6 +115,10 @@ def configure(env): env.Append(CCFLAGS=['-fsanitize=leak']) env.Append(LINKFLAGS=['-fsanitize=leak']) + if env['use_tsan']: + env.Append(CCFLAGS=['-fsanitize=thread']) + env.Append(LINKFLAGS=['-fsanitize=thread']) + if env['use_lto']: env.Append(CCFLAGS=['-flto']) if not env['use_llvm'] and env.GetOption("num_jobs") > 1: diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 12e53054bc..87dc6421ac 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -88,6 +88,8 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int visual_server = memnew(VisualServerRaster); visual_server->init(); + camera_server = memnew(CameraServer); + AudioDriverManager::initialize(p_audio_driver); input = memnew(InputDefault); @@ -117,6 +119,8 @@ void OS_Server::finalize() { memdelete(input); + memdelete(camera_server); + memdelete(power_manager); ResourceLoader::remove_resource_format_loader(resource_loader_dummy); diff --git a/platform/server/os_server.h b/platform/server/os_server.h index e3488a693d..b8119288ff 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -47,9 +47,6 @@ #include "servers/visual_server.h" #undef CursorShape -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class OS_Server : public OS_Unix { @@ -74,6 +71,7 @@ class OS_Server : public OS_Unix { #endif CrashHandler crash_handler; + CameraServer *camera_server; int video_driver_index; diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index abb7b391d3..ea110b11ca 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -30,10 +30,11 @@ #include "export.h" #include "core/bind/core_bind.h" +#include "core/crypto/crypto_core.h" #include "core/io/marshalls.h" #include "core/io/zip_io.h" -#include "core/math/crypto_core.h" #include "core/object.h" +#include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/project_settings.h" #include "core/version.h" @@ -133,8 +134,6 @@ class AppxPackager { String progress_task; FileAccess *package; - String tmp_blockmap_file_path; - String tmp_content_types_file_path; Set<String> mime_types; @@ -146,8 +145,8 @@ class AppxPackager { String hash_block(const uint8_t *p_block_data, size_t p_block_len); - void make_block_map(); - void make_content_types(); + void make_block_map(const String &p_path); + void make_content_types(const String &p_path); _FORCE_INLINE_ unsigned int buf_put_int16(uint16_t p_val, uint8_t *p_buf) { for (int i = 0; i < 2; i++) { @@ -208,9 +207,9 @@ String AppxPackager::hash_block(const uint8_t *p_block_data, size_t p_block_len) return String(base64); } -void AppxPackager::make_block_map() { +void AppxPackager::make_block_map(const String &p_path) { - FileAccess *tmp_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::WRITE); + FileAccess *tmp_file = FileAccess::open(p_path, FileAccess::WRITE); tmp_file->store_string("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"); tmp_file->store_string("<BlockMap xmlns=\"http://schemas.microsoft.com/appx/2010/blockmap\" HashMethod=\"http://www.w3.org/2001/04/xmlenc#sha256\">"); @@ -253,9 +252,9 @@ String AppxPackager::content_type(String p_extension) { return "application/octet-stream"; } -void AppxPackager::make_content_types() { +void AppxPackager::make_content_types(const String &p_path) { - FileAccess *tmp_file = FileAccess::open(tmp_content_types_file_path, FileAccess::WRITE); + FileAccess *tmp_file = FileAccess::open(p_path, FileAccess::WRITE); tmp_file->store_string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); tmp_file->store_string("<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">"); @@ -458,8 +457,6 @@ void AppxPackager::init(FileAccess *p_fa) { package = p_fa; central_dir_offset = 0; end_of_central_dir_offset = 0; - tmp_blockmap_file_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpblockmap.xml"); - tmp_content_types_file_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpcontenttypes.xml"); } Error AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress) { @@ -519,7 +516,9 @@ Error AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t int total_out_before = strm.total_out; - deflate(&strm, Z_FULL_FLUSH); + int err = deflate(&strm, Z_FULL_FLUSH); + ERR_FAIL_COND_V(err >= 0, ERR_BUG); // Negative means bug + bh.compressed_size = strm.total_out - total_out_before; //package->store_buffer(strm_out.ptr(), strm.total_out - total_out_before); @@ -589,7 +588,9 @@ void AppxPackager::finish() { // Create and add block map file EditorNode::progress_task_step("export", "Creating block map...", 4); - make_block_map(); + const String &tmp_blockmap_file_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpblockmap.xml"); + make_block_map(tmp_blockmap_file_path); + FileAccess *blockmap_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::READ); Vector<uint8_t> blockmap_buffer; blockmap_buffer.resize(blockmap_file->get_len()); @@ -602,8 +603,11 @@ void AppxPackager::finish() { memdelete(blockmap_file); // Add content types + EditorNode::progress_task_step("export", "Setting content types...", 5); - make_content_types(); + + const String &tmp_content_types_file_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmpcontenttypes.xml"); + make_content_types(tmp_content_types_file_path); FileAccess *types_file = FileAccess::open(tmp_content_types_file_path, FileAccess::READ); Vector<uint8_t> types_buffer; @@ -616,6 +620,10 @@ void AppxPackager::finish() { types_file->close(); memdelete(types_file); + // Cleanup generated files. + DirAccess::remove_file_or_error(tmp_blockmap_file_path); + DirAccess::remove_file_or_error(tmp_content_types_file_path); + // Pre-process central directory before signing for (int i = 0; i < file_metadata.size(); i++) { store_central_dir_header(file_metadata[i]); @@ -899,8 +907,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform { String err_string = "Couldn't save temp logo file."; EditorNode::add_io_error(err_string); - ERR_EXPLAIN(err_string); - ERR_FAIL_V(data); + ERR_FAIL_V_MSG(data, err_string); } FileAccess *f = FileAccess::open(tmp_path, FileAccess::READ, &err); @@ -908,10 +915,10 @@ class EditorExportPlatformUWP : public EditorExportPlatform { if (err != OK) { String err_string = "Couldn't open temp logo file."; - + // Cleanup generated file. + DirAccess::remove_file_or_error(tmp_path); EditorNode::add_io_error(err_string); - ERR_EXPLAIN(err_string); - ERR_FAIL_V(data); + ERR_FAIL_V_MSG(data, err_string); } data.resize(f->get_len()); @@ -919,31 +926,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform { f->close(); memdelete(f); - - // Delete temp file - DirAccess *dir = DirAccess::open(tmp_path.get_base_dir(), &err); - - if (err != OK) { - - String err_string = "Couldn't open temp path to remove temp logo file."; - - EditorNode::add_io_error(err_string); - ERR_EXPLAIN(err_string); - ERR_FAIL_V(data); - } - - err = dir->remove(tmp_path); - - memdelete(dir); - - if (err != OK) { - - String err_string = "Couldn't remove temp logo file."; - - EditorNode::add_io_error(err_string); - ERR_EXPLAIN(err_string); - ERR_FAIL_V(data); - } + DirAccess::remove_file_or_error(tmp_path); return data; } diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 9d9be44ce5..60f2290355 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -835,11 +835,7 @@ Error OS_UWP::open_dynamic_library(const String p_path, void *&p_library_handle, String full_path = "game/" + p_path; p_library_handle = (void *)LoadPackagedLibrary(full_path.c_str(), 0); - - if (!p_library_handle) { - ERR_EXPLAIN("Can't open dynamic library: " + full_path + ". Error: " + format_error_message(GetLastError())); - ERR_FAIL_V(ERR_CANT_OPEN); - } + ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + full_path + ", error: " + format_error_message(GetLastError()) + "."); return OK; } @@ -854,8 +850,7 @@ Error OS_UWP::get_dynamic_library_symbol_handle(void *p_library_handle, const St p_symbol_handle = (void *)GetProcAddress((HMODULE)p_library_handle, p_name.utf8().get_data()); if (!p_symbol_handle) { if (!p_optional) { - ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + String::num(GetLastError())); - ERR_FAIL_V(ERR_CANT_RESOLVE); + ERR_FAIL_V_MSG(ERR_CANT_RESOLVE, "Can't resolve symbol " + p_name + ", error: " + String::num(GetLastError()) + "."); } else { return ERR_CANT_RESOLVE; } diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index b7a7248f19..370cab6a9b 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -50,9 +50,6 @@ #include <stdio.h> #include <windows.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class OS_UWP : public OS { public: diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 745f3ce379..be325381bb 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -719,7 +719,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) pressrc = 0; } } - } else if (mouse_mode != MOUSE_MODE_CAPTURED) { + } else { // for reasons unknown to mankind, wheel comes in screen coordinates POINT coords; coords.x = mb->get_position().x; @@ -1435,16 +1435,13 @@ void OS_Windows::set_clipboard(const String &p_text) { String text = p_text.replace("\n", "\r\n"); if (!OpenClipboard(hWnd)) { - ERR_EXPLAIN("Unable to open clipboard."); - ERR_FAIL(); - }; + ERR_FAIL_MSG("Unable to open clipboard."); + } EmptyClipboard(); HGLOBAL mem = GlobalAlloc(GMEM_MOVEABLE, (text.length() + 1) * sizeof(CharType)); - if (mem == NULL) { - ERR_EXPLAIN("Unable to allocate memory for clipboard contents."); - ERR_FAIL(); - }; + ERR_FAIL_COND_MSG(mem == NULL, "Unable to allocate memory for clipboard contents."); + LPWSTR lptstrCopy = (LPWSTR)GlobalLock(mem); memcpy(lptstrCopy, text.c_str(), (text.length() + 1) * sizeof(CharType)); GlobalUnlock(mem); @@ -1454,10 +1451,8 @@ void OS_Windows::set_clipboard(const String &p_text) { // set the CF_TEXT version (not needed?) CharString utf8 = text.utf8(); mem = GlobalAlloc(GMEM_MOVEABLE, utf8.length() + 1); - if (mem == NULL) { - ERR_EXPLAIN("Unable to allocate memory for clipboard contents."); - ERR_FAIL(); - }; + ERR_FAIL_COND_MSG(mem == NULL, "Unable to allocate memory for clipboard contents."); + LPTSTR ptr = (LPTSTR)GlobalLock(mem); memcpy(ptr, utf8.get_data(), utf8.length()); ptr[utf8.length()] = 0; @@ -1472,8 +1467,7 @@ String OS_Windows::get_clipboard() const { String ret; if (!OpenClipboard(hWnd)) { - ERR_EXPLAIN("Unable to open clipboard."); - ERR_FAIL_V(""); + ERR_FAIL_V_MSG("", "Unable to open clipboard."); }; if (IsClipboardFormatAvailable(CF_UNICODETEXT)) { @@ -1537,6 +1531,7 @@ void OS_Windows::finalize() { memdelete(camera_server); touch_state.clear(); + cursors_cache.clear(); visual_server->finish(); memdelete(visual_server); #ifdef OPENGL_ENABLED @@ -1812,7 +1807,7 @@ Size2 OS_Windows::get_min_window_size() const { void OS_Windows::set_min_window_size(const Size2 p_size) { if ((p_size != Size2()) && (max_size != Size2()) && ((p_size.x > max_size.x) || (p_size.y > max_size.y))) { - WARN_PRINT("Minimum window size can't be larger than maximum window size!"); + ERR_PRINT("Minimum window size can't be larger than maximum window size!"); return; } min_size = p_size; @@ -1821,7 +1816,7 @@ void OS_Windows::set_min_window_size(const Size2 p_size) { void OS_Windows::set_max_window_size(const Size2 p_size) { if ((p_size != Size2()) && ((p_size.x < min_size.x) || (p_size.y < min_size.y))) { - WARN_PRINT("Maximum window size can't be smaller than minimum window size!"); + ERR_PRINT("Maximum window size can't be smaller than minimum window size!"); return; } max_size = p_size; @@ -2134,15 +2129,12 @@ Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_han } p_library_handle = (void *)LoadLibraryExW(path.c_str(), NULL, (p_also_set_library_path && has_dll_directory_api) ? LOAD_LIBRARY_SEARCH_DEFAULT_DIRS : 0); + ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ", error: " + format_error_message(GetLastError()) + "."); if (cookie) { remove_dll_directory(cookie); } - if (!p_library_handle) { - ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + format_error_message(GetLastError())); - ERR_FAIL_V(ERR_CANT_OPEN); - } return OK; } @@ -2157,8 +2149,7 @@ Error OS_Windows::get_dynamic_library_symbol_handle(void *p_library_handle, cons p_symbol_handle = (void *)GetProcAddress((HMODULE)p_library_handle, p_name.utf8().get_data()); if (!p_symbol_handle) { if (!p_optional) { - ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + String::num(GetLastError())); - ERR_FAIL_V(ERR_CANT_RESOLVE); + ERR_FAIL_V_MSG(ERR_CANT_RESOLVE, "Can't resolve symbol " + p_name + ", error: " + String::num(GetLastError()) + "."); } else { return ERR_CANT_RESOLVE; } @@ -2251,9 +2242,17 @@ uint64_t OS_Windows::get_unix_time() const { FILETIME fep; SystemTimeToFileTime(&ep, &fep); - // FIXME: dereferencing type-punned pointer will break strict-aliasing rules (GCC warning) + // Type punning through unions (rather than pointer cast) as per: // https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime#remarks - return (*(uint64_t *)&ft - *(uint64_t *)&fep) / 10000000; + ULARGE_INTEGER ft_punning; + ft_punning.LowPart = ft.dwLowDateTime; + ft_punning.HighPart = ft.dwHighDateTime; + + ULARGE_INTEGER fep_punning; + fep_punning.LowPart = fep.dwLowDateTime; + fep_punning.HighPart = fep.dwHighDateTime; + + return (ft_punning.QuadPart - fep_punning.QuadPart) / 10000000; }; uint64_t OS_Windows::get_system_time_secs() const { @@ -2677,10 +2676,7 @@ void OS_Windows::set_native_icon(const String &p_filename) { pos += sizeof(WORD); f->seek(pos); - if (icon_dir->idType != 1) { - ERR_EXPLAIN("Invalid icon file format!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(icon_dir->idType != 1, "Invalid icon file format!"); icon_dir->idCount = f->get_32(); pos += sizeof(WORD); @@ -2713,10 +2709,7 @@ void OS_Windows::set_native_icon(const String &p_filename) { } } - if (big_icon_index == -1) { - ERR_EXPLAIN("No valid icons found!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(big_icon_index == -1, "No valid icons found!"); if (small_icon_index == -1) { WARN_PRINTS("No small icon found, reusing " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon!"); @@ -2732,10 +2725,7 @@ void OS_Windows::set_native_icon(const String &p_filename) { f->seek(pos); f->get_buffer((uint8_t *)&data_big.write[0], bytecount_big); HICON icon_big = CreateIconFromResource((PBYTE)&data_big.write[0], bytecount_big, TRUE, 0x00030000); - if (!icon_big) { - ERR_EXPLAIN("Could not create " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon, error: " + format_error_message(GetLastError())); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!icon_big, "Could not create " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon, error: " + format_error_message(GetLastError()) + "."); // Read the small icon DWORD bytecount_small = icon_dir->idEntries[small_icon_index].dwBytesInRes; @@ -2745,10 +2735,7 @@ void OS_Windows::set_native_icon(const String &p_filename) { f->seek(pos); f->get_buffer((uint8_t *)&data_small.write[0], bytecount_small); HICON icon_small = CreateIconFromResource((PBYTE)&data_small.write[0], bytecount_small, TRUE, 0x00030000); - if (!icon_small) { - ERR_EXPLAIN("Could not create 16x16 @" + itos(small_icon_cc) + " icon, error: " + format_error_message(GetLastError())); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!icon_small, "Could not create 16x16 @" + itos(small_icon_cc) + " icon, error: " + format_error_message(GetLastError()) + "."); // Online tradition says to be sure last error is cleared and set the small icon first int err = 0; @@ -2756,17 +2743,11 @@ void OS_Windows::set_native_icon(const String &p_filename) { SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)icon_small); err = GetLastError(); - if (err) { - ERR_EXPLAIN("Error setting ICON_SMALL: " + format_error_message(err)); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(err, "Error setting ICON_SMALL: " + format_error_message(err) + "."); SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)icon_big); err = GetLastError(); - if (err) { - ERR_EXPLAIN("Error setting ICON_BIG: " + format_error_message(err)); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(err, "Error setting ICON_BIG: " + format_error_message(err) + "."); memdelete(f); memdelete(icon_dir); diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index ce55328173..915d025e3b 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -56,10 +56,6 @@ #include <windows.h> #include <windowsx.h> -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - typedef struct { BYTE bWidth; // Width, in pixels, of the image BYTE bHeight; // Height, in pixels, of the image diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h index 46420df48b..095ce2154b 100644 --- a/platform/x11/context_gl_x11.h +++ b/platform/x11/context_gl_x11.h @@ -31,9 +31,6 @@ #ifndef CONTEXT_GL_X11_H #define CONTEXT_GL_X11_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ #ifdef X11_ENABLED #if defined(OPENGL_ENABLED) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index f3a486df02..b8ff97279d 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -64,6 +64,7 @@ def get_opts(): BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), BoolVariable('use_asan', 'Use LLVM/GCC compiler address sanitizer (ASAN))', False), BoolVariable('use_lsan', 'Use LLVM/GCC compiler leak sanitizer (LSAN))', False), + BoolVariable('use_tsan', 'Use LLVM/GCC compiler thread sanitizer (TSAN))', False), BoolVariable('pulseaudio', 'Detect and use PulseAudio', True), BoolVariable('udev', 'Use udev for gamepad connection callbacks', False), EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')), @@ -140,7 +141,7 @@ def configure(env): print("Using LLD with GCC is not supported yet, try compiling with 'use_llvm=yes'.") sys.exit(255) - if env['use_ubsan'] or env['use_asan'] or env['use_lsan']: + if env['use_ubsan'] or env['use_asan'] or env['use_lsan'] or env['use_tsan']: env.extra_suffix += "s" if env['use_ubsan']: @@ -155,6 +156,10 @@ def configure(env): env.Append(CCFLAGS=['-fsanitize=leak']) env.Append(LINKFLAGS=['-fsanitize=leak']) + if env['use_tsan']: + env.Append(CCFLAGS=['-fsanitize=thread']) + env.Append(LINKFLAGS=['-fsanitize=thread']) + if env['use_lto']: if not env['use_llvm'] and env.GetOption("num_jobs") > 1: env.Append(CCFLAGS=['-flto']) diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp index 8767aac517..6e66173463 100644 --- a/platform/x11/export/export.cpp +++ b/platform/x11/export/export.cpp @@ -85,8 +85,7 @@ static Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, if (bits == 32 && p_embedded_size >= 0x100000000) { f->close(); - ERR_EXPLAIN("32-bit executables cannot have embedded data >= 4 GiB"); - ERR_FAIL_V(ERR_INVALID_DATA); + ERR_FAIL_V_MSG(ERR_INVALID_DATA, "32-bit executables cannot have embedded data >= 4 GiB."); } // Get info about the section header table diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index e6328ee14d..4242952374 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -513,6 +513,8 @@ void JoypadLinux::process_joypads() { break; default: + if (ev.code >= MAX_ABS) + return; if (joy->abs_map[ev.code] != -1 && joy->abs_info[ev.code]) { InputDefault::JoyAxis value = axis_correct(joy->abs_info[ev.code], ev.value); joy->curr_axis[joy->abs_map[ev.code]] = value; diff --git a/platform/x11/key_mapping_x11.h b/platform/x11/key_mapping_x11.h index 853fe7954a..4e25d6a6ed 100644 --- a/platform/x11/key_mapping_x11.h +++ b/platform/x11/key_mapping_x11.h @@ -31,9 +31,6 @@ #ifndef KEY_MAPPING_X11_H #define KEY_MAPPING_X11_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ #include <X11/XF86keysym.h> #include <X11/Xlib.h> #define XK_MISCELLANY diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 9b35648046..ca72393e43 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -788,6 +788,7 @@ void OS_X11::finalize() { memdelete(camera_server); + cursors_cache.clear(); visual_server->finish(); memdelete(visual_server); //memdelete(rasterizer); @@ -1265,7 +1266,7 @@ Size2 OS_X11::get_min_window_size() const { void OS_X11::set_min_window_size(const Size2 p_size) { if ((p_size != Size2()) && (max_size != Size2()) && ((p_size.x > max_size.x) || (p_size.y > max_size.y))) { - WARN_PRINT("Minimum window size can't be larger than maximum window size!"); + ERR_PRINT("Minimum window size can't be larger than maximum window size!"); return; } min_size = p_size; @@ -1294,7 +1295,7 @@ void OS_X11::set_min_window_size(const Size2 p_size) { void OS_X11::set_max_window_size(const Size2 p_size) { if ((p_size != Size2()) && ((p_size.x < min_size.x) || (p_size.y < min_size.y))) { - WARN_PRINT("Maximum window size can't be smaller than minimum window size!"); + ERR_PRINT("Maximum window size can't be smaller than minimum window size!"); return; } max_size = p_size; @@ -1517,9 +1518,12 @@ void OS_X11::set_window_maximized(bool p_enabled) { XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); - if (is_window_maximize_allowed()) { - while (p_enabled && !is_window_maximized()) { - // Wait for effective resizing (so the GLX context is too). + if (p_enabled && is_window_maximize_allowed()) { + // Wait for effective resizing (so the GLX context is too). + // Give up after 0.5s, it's not going to happen on this WM. + // https://github.com/godotengine/godot/issues/19978 + for (int attempt = 0; !is_window_maximized() && attempt < 50; attempt++) { + usleep(10000); } } diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index a4c22cf08a..e6c2effacf 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -77,9 +77,6 @@ typedef struct _xrr_monitor_info { } xrr_monitor_info; #undef CursorShape -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class OS_X11 : public OS_Unix { diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp index 758bd84114..c33c77e16b 100644 --- a/platform/x11/power_x11.cpp +++ b/platform/x11/power_x11.cpp @@ -268,9 +268,7 @@ bool PowerX11::GetPowerInfo_Linux_proc_acpi() { check_proc_acpi_battery(node.utf8().get_data(), &have_battery, &charging /*, seconds, percent*/); node = dirp->get_next(); } - memdelete(dirp); } - dirp->change_dir(proc_acpi_ac_adapter_path); err = dirp->list_dir_begin(); if (err != OK) { @@ -281,7 +279,6 @@ bool PowerX11::GetPowerInfo_Linux_proc_acpi() { check_proc_acpi_ac_adapter(node.utf8().get_data(), &have_ac); node = dirp->get_next(); } - memdelete(dirp); } if (!have_battery) { @@ -294,6 +291,7 @@ bool PowerX11::GetPowerInfo_Linux_proc_acpi() { this->power_state = OS::POWERSTATE_ON_BATTERY; } + memdelete(dirp); return true; /* definitive answer. */ } diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index c7f622dee3..0b20b781f0 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "animated_sprite.h" + #include "core/os/os.h" #include "scene/scene_string_names.h" @@ -356,12 +357,11 @@ void AnimatedSprite::_validate_property(PropertyInfo &property) const { } if (property.name == "frame") { - - property.hint = PROPERTY_HINT_SPRITE_FRAME; - + property.hint = PROPERTY_HINT_RANGE; if (frames->has_animation(animation) && frames->get_frame_count(animation) > 1) { property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1"; } + property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } } @@ -642,9 +642,8 @@ void AnimatedSprite::_reset_timeout() { void AnimatedSprite::set_animation(const StringName &p_animation) { - ERR_EXPLAIN(vformat("There is no animation with name '%s'.", p_animation)); - ERR_FAIL_COND(frames == NULL); - ERR_FAIL_COND(frames->get_animation_names().find(p_animation) == -1); + ERR_FAIL_COND_MSG(frames == NULL, vformat("There is no animation with name '%s'.", p_animation)); + ERR_FAIL_COND_MSG(frames->get_animation_names().find(p_animation) == -1, vformat("There is no animation with name '%s'.", p_animation)); if (animation == p_animation) return; @@ -709,7 +708,7 @@ void AnimatedSprite::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation"), "set_animation", "get_animation"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "frame", PROPERTY_HINT_SPRITE_FRAME), "set_frame", "get_frame"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing"), "_set_playing", "_is_playing"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered"); diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index b701e84a9c..a636eea285 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -321,10 +321,7 @@ void Area2D::_area_inout(int p_status, const RID &p_area, int p_instance, int p_ void Area2D::_clear_monitoring() { - if (locked) { - ERR_EXPLAIN("This function can't be used during the in/out signal."); - } - ERR_FAIL_COND(locked); + ERR_FAIL_COND_MSG(locked, "This function can't be used during the in/out signal."); { Map<ObjectID, BodyState> bmcopy = body_map; @@ -401,10 +398,7 @@ void Area2D::set_monitoring(bool p_enable) { if (p_enable == monitoring) return; - if (locked) { - ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitoring\",true/false)"); - } - ERR_FAIL_COND(locked); + ERR_FAIL_COND_MSG(locked, "Function blocked during in/out signal. Use set_deferred(\"monitoring\", true/false)."); monitoring = p_enable; @@ -427,10 +421,7 @@ bool Area2D::is_monitoring() const { void Area2D::set_monitorable(bool p_enable) { - if (locked || (is_inside_tree() && Physics2DServer::get_singleton()->is_flushing_queries())) { - ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitorable\",true/false)"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(locked || (is_inside_tree() && Physics2DServer::get_singleton()->is_flushing_queries()), "Function blocked during in/out signal. Use set_deferred(\"monitorable\", true/false)."); if (p_enable == monitorable) return; @@ -672,8 +663,8 @@ void Area2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "gravity_vec"), "set_gravity_vector", "get_gravity_vector"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.001"), "set_gravity", "get_gravity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.01,or_greater"), "set_linear_damp", "get_linear_damp"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.01,or_greater"), "set_angular_damp", "get_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable"); diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 6011941142..3e8902314c 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -106,7 +106,7 @@ Transform2D Camera2D::get_camera_transform() { if (anchor_mode == ANCHOR_MODE_DRAG_CENTER) { - if (h_drag_enabled && !Engine::get_singleton()->is_editor_hint()) { + if (h_drag_enabled && !Engine::get_singleton()->is_editor_hint() && !h_offset_changed) { camera_pos.x = MIN(camera_pos.x, (new_camera_pos.x + screen_size.x * 0.5 * zoom.x * drag_margin[MARGIN_LEFT])); camera_pos.x = MAX(camera_pos.x, (new_camera_pos.x - screen_size.x * 0.5 * zoom.x * drag_margin[MARGIN_RIGHT])); } else { @@ -116,9 +116,11 @@ Transform2D Camera2D::get_camera_transform() { } else { camera_pos.x = new_camera_pos.x + screen_size.x * 0.5 * drag_margin[MARGIN_LEFT] * h_ofs; } + + h_offset_changed = false; } - if (v_drag_enabled && !Engine::get_singleton()->is_editor_hint()) { + if (v_drag_enabled && !Engine::get_singleton()->is_editor_hint() && !v_offset_changed) { camera_pos.y = MIN(camera_pos.y, (new_camera_pos.y + screen_size.y * 0.5 * zoom.y * drag_margin[MARGIN_TOP])); camera_pos.y = MAX(camera_pos.y, (new_camera_pos.y - screen_size.y * 0.5 * zoom.y * drag_margin[MARGIN_BOTTOM])); @@ -130,6 +132,8 @@ Transform2D Camera2D::get_camera_transform() { } else { camera_pos.y = new_camera_pos.y + screen_size.y * 0.5 * drag_margin[MARGIN_BOTTOM] * v_ofs; } + + v_offset_changed = false; } } else if (anchor_mode == ANCHOR_MODE_FIXED_TOP_LEFT) { @@ -554,6 +558,7 @@ bool Camera2D::is_v_drag_enabled() const { void Camera2D::set_v_offset(float p_offset) { v_ofs = p_offset; + v_offset_changed = true; _update_scroll(); } @@ -565,6 +570,7 @@ float Camera2D::get_v_offset() const { void Camera2D::set_h_offset(float p_offset) { h_ofs = p_offset; + h_offset_changed = true; _update_scroll(); } float Camera2D::get_h_offset() const { @@ -750,8 +756,8 @@ void Camera2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "smoothing_speed"), "set_follow_smoothing", "get_follow_smoothing"); ADD_GROUP("Offset", "offset_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset_v", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_v_offset", "get_v_offset"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset_h", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_h_offset", "get_h_offset"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset_v", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_v_offset", "get_v_offset"); ADD_GROUP("Drag Margin", "drag_margin_"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_LEFT); @@ -799,9 +805,12 @@ Camera2D::Camera2D() { limit_drawing_enabled = false; margin_drawing_enabled = false; - h_drag_enabled = true; - v_drag_enabled = true; + h_drag_enabled = false; + v_drag_enabled = false; h_ofs = 0; v_ofs = 0; + h_offset_changed = false; + v_offset_changed = false; + set_notify_transform(true); } diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h index 7f16ecff41..bb3c76b30c 100644 --- a/scene/2d/camera_2d.h +++ b/scene/2d/camera_2d.h @@ -77,6 +77,9 @@ protected: float h_ofs; float v_ofs; + bool h_offset_changed; + bool v_offset_changed; + Point2 camera_screen_center; void _update_process_mode(); void _update_scroll(); diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 7368efd21a..b605be47df 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -707,20 +707,14 @@ void CanvasItem::item_rect_changed(bool p_size_changed) { void CanvasItem::draw_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width, bool p_antialiased) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); VisualServer::get_singleton()->canvas_item_add_line(canvas_item, p_from, p_to, p_color, p_width, p_antialiased); } void CanvasItem::draw_polyline(const Vector<Point2> &p_points, const Color &p_color, float p_width, bool p_antialiased) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); Vector<Color> colors; colors.push_back(p_color); @@ -729,20 +723,14 @@ void CanvasItem::draw_polyline(const Vector<Point2> &p_points, const Color &p_co void CanvasItem::draw_polyline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width, bool p_antialiased) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); VisualServer::get_singleton()->canvas_item_add_polyline(canvas_item, p_points, p_colors, p_width, p_antialiased); } void CanvasItem::draw_multiline(const Vector<Point2> &p_points, const Color &p_color, float p_width, bool p_antialiased) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); Vector<Color> colors; colors.push_back(p_color); @@ -751,20 +739,14 @@ void CanvasItem::draw_multiline(const Vector<Point2> &p_points, const Color &p_c void CanvasItem::draw_multiline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, float p_width, bool p_antialiased) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); VisualServer::get_singleton()->canvas_item_add_multiline(canvas_item, p_points, p_colors, p_width, p_antialiased); } void CanvasItem::draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_filled, float p_width, bool p_antialiased) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); if (p_filled) { if (p_width != 1.0) { @@ -819,20 +801,14 @@ void CanvasItem::draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_fil void CanvasItem::draw_circle(const Point2 &p_pos, float p_radius, const Color &p_color) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); VisualServer::get_singleton()->canvas_item_add_circle(canvas_item, p_pos, p_radius, p_color); } void CanvasItem::draw_texture(const Ref<Texture> &p_texture, const Point2 &p_pos, const Color &p_modulate, const Ref<Texture> &p_normal_map) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); ERR_FAIL_COND(p_texture.is_null()); @@ -841,29 +817,20 @@ void CanvasItem::draw_texture(const Ref<Texture> &p_texture, const Point2 &p_pos void CanvasItem::draw_texture_rect(const Ref<Texture> &p_texture, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); ERR_FAIL_COND(p_texture.is_null()); p_texture->draw_rect(canvas_item, p_rect, p_tile, p_modulate, p_transpose, p_normal_map); } void CanvasItem::draw_texture_rect_region(const Ref<Texture> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map, bool p_clip_uv) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); ERR_FAIL_COND(p_texture.is_null()); p_texture->draw_rect_region(canvas_item, p_rect, p_src_rect, p_modulate, p_transpose, p_normal_map, p_clip_uv); } void CanvasItem::draw_style_box(const Ref<StyleBox> &p_style_box, const Rect2 &p_rect) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); ERR_FAIL_COND(p_style_box.is_null()); @@ -871,10 +838,7 @@ void CanvasItem::draw_style_box(const Ref<StyleBox> &p_style_box, const Rect2 &p } void CanvasItem::draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture> p_texture, float p_width, const Ref<Texture> &p_normal_map) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); RID rid_normal = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID(); @@ -883,10 +847,7 @@ void CanvasItem::draw_primitive(const Vector<Point2> &p_points, const Vector<Col } void CanvasItem::draw_set_transform(const Point2 &p_offset, float p_rot, const Size2 &p_scale) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); Transform2D xform(p_rot, p_offset); xform.scale_basis(p_scale); @@ -895,20 +856,14 @@ void CanvasItem::draw_set_transform(const Point2 &p_offset, float p_rot, const S void CanvasItem::draw_set_transform_matrix(const Transform2D &p_matrix) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item, p_matrix); } void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture> p_texture, const Ref<Texture> &p_normal_map, bool p_antialiased) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); RID rid_normal = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID(); @@ -918,10 +873,7 @@ void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color void CanvasItem::draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs, Ref<Texture> p_texture, const Ref<Texture> &p_normal_map, bool p_antialiased) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); Vector<Color> colors; colors.push_back(p_color); @@ -949,10 +901,7 @@ void CanvasItem::draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Tex void CanvasItem::draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate, int p_clip_w) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); ERR_FAIL_COND(p_font.is_null()); p_font->draw(canvas_item, p_pos, p_text, p_modulate, p_clip_w); @@ -960,10 +909,7 @@ void CanvasItem::draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const float CanvasItem::draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, const String &p_next, const Color &p_modulate) { - if (!drawing) { - ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL_V(0); - } + ERR_FAIL_COND_V_MSG(!drawing, 0, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); ERR_FAIL_COND_V(p_char.length() != 1, 0); ERR_FAIL_COND_V(p_font.is_null(), 0); diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 5440a1d8c3..f79d79d039 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -97,15 +97,8 @@ void CollisionShape2D::_notification(int p_what) { } owner_id = 0; parent = NULL; - } break; - /* - case NOTIFICATION_TRANSFORM_CHANGED: { - - if (!is_inside_scene()) - break; - _update_parent(); - } break;*/ + } break; case NOTIFICATION_DRAW: { if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { @@ -131,10 +124,13 @@ void CollisionShape2D::_notification(int p_what) { rect = rect.grow(3); if (one_way_collision) { - Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4); - dcol.a = 1.0; + // Draw an arrow indicating the one-way collision direction + draw_col = get_tree()->get_debug_collisions_color().inverted(); + if (disabled) { + draw_col = draw_col.darkened(0.25); + } Vector2 line_to(0, 20); - draw_line(Vector2(), line_to, dcol, 3); + draw_line(Vector2(), line_to, draw_col, 2, true); Vector<Vector2> pts; float tsize = 8; pts.push_back(line_to + (Vector2(0, tsize))); @@ -142,9 +138,9 @@ void CollisionShape2D::_notification(int p_what) { pts.push_back(line_to + (Vector2(-0.707 * tsize, 0))); Vector<Color> cols; for (int i = 0; i < 3; i++) - cols.push_back(dcol); + cols.push_back(draw_col); - draw_primitive(pts, cols, Vector<Vector2>()); //small arrow + draw_primitive(pts, cols, Vector<Vector2>()); } } break; } diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 591933d972..f9f273d494 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -83,6 +83,10 @@ void CPUParticles2D::set_randomness_ratio(float p_ratio) { randomness_ratio = p_ratio; } +void CPUParticles2D::set_lifetime_randomness(float p_random) { + + lifetime_randomness = p_random; +} void CPUParticles2D::set_use_local_coordinates(bool p_enable) { local_coords = p_enable; @@ -123,6 +127,10 @@ float CPUParticles2D::get_randomness_ratio() const { return randomness_ratio; } +float CPUParticles2D::get_lifetime_randomness() const { + + return lifetime_randomness; +} bool CPUParticles2D::get_use_local_coordinates() const { @@ -611,6 +619,10 @@ void CPUParticles2D::_particles_process(float p_delta) { } } + if (p.time * (1.0 - explosiveness_ratio) > p.lifetime) { + restart = true; + } + if (restart) { if (!emitting) { @@ -654,6 +666,7 @@ void CPUParticles2D::_particles_process(float p_delta) { p.custom[3] = 0.0; p.transform = Transform2D(); p.time = 0; + p.lifetime = lifetime * (1.0 - Math::randf() * lifetime_randomness); p.base_color = Color(1, 1, 1, 1); switch (emission_shape) { @@ -696,6 +709,8 @@ void CPUParticles2D::_particles_process(float p_delta) { } else if (!p.active) { continue; + } else if (p.time > p.lifetime) { + p.active = false; } else { uint32_t alt_seed = p.seed; @@ -947,9 +962,13 @@ void CPUParticles2D::_set_redraw(bool p_redraw) { if (redraw) { VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), true); + + VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1); } else { 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); } #ifndef NO_THREADS update_mutex->unlock(); @@ -980,9 +999,6 @@ void CPUParticles2D::_notification(int p_what) { _set_redraw(false); } - if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) { - } - if (p_what == NOTIFICATION_DRAW) { if (!redraw) return; // don't add to render list @@ -1153,6 +1169,7 @@ void CPUParticles2D::convert_from_particles(Node *p_particles) { Vector2 gravity = Vector2(material->get_gravity().x, material->get_gravity().y); set_gravity(gravity); + set_lifetime_randomness(material->get_lifetime_randomness()); #define CONVERT_PARAM(m_param) \ set_param(m_param, material->get_param(ParticlesMaterial::m_param)); \ @@ -1187,6 +1204,7 @@ void CPUParticles2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pre_process_time", "secs"), &CPUParticles2D::set_pre_process_time); ClassDB::bind_method(D_METHOD("set_explosiveness_ratio", "ratio"), &CPUParticles2D::set_explosiveness_ratio); ClassDB::bind_method(D_METHOD("set_randomness_ratio", "ratio"), &CPUParticles2D::set_randomness_ratio); + ClassDB::bind_method(D_METHOD("set_lifetime_randomness", "random"), &CPUParticles2D::set_lifetime_randomness); ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &CPUParticles2D::set_use_local_coordinates); ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &CPUParticles2D::set_fixed_fps); ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &CPUParticles2D::set_fractional_delta); @@ -1199,6 +1217,7 @@ void CPUParticles2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_pre_process_time"), &CPUParticles2D::get_pre_process_time); ClassDB::bind_method(D_METHOD("get_explosiveness_ratio"), &CPUParticles2D::get_explosiveness_ratio); ClassDB::bind_method(D_METHOD("get_randomness_ratio"), &CPUParticles2D::get_randomness_ratio); + ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &CPUParticles2D::get_lifetime_randomness); ClassDB::bind_method(D_METHOD("get_use_local_coordinates"), &CPUParticles2D::get_use_local_coordinates); ClassDB::bind_method(D_METHOD("get_fixed_fps"), &CPUParticles2D::get_fixed_fps); ClassDB::bind_method(D_METHOD("get_fractional_delta"), &CPUParticles2D::get_fractional_delta); @@ -1225,6 +1244,7 @@ void CPUParticles2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); @@ -1404,6 +1424,7 @@ CPUParticles2D::CPUParticles2D() { set_pre_process_time(0); set_explosiveness_ratio(0); set_randomness_ratio(0); + set_lifetime_randomness(0); set_use_local_coordinates(true); set_draw_order(DRAW_ORDER_INDEX); diff --git a/scene/2d/cpu_particles_2d.h b/scene/2d/cpu_particles_2d.h index 8613a185b4..da668664b9 100644 --- a/scene/2d/cpu_particles_2d.h +++ b/scene/2d/cpu_particles_2d.h @@ -35,10 +35,6 @@ #include "scene/2d/node_2d.h" #include "scene/resources/texture.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class CPUParticles2D : public Node2D { private: GDCLASS(CPUParticles2D, Node2D); @@ -96,6 +92,7 @@ private: float hue_rot_rand; float anim_offset_rand; float time; + float lifetime; Color base_color; uint32_t seed; @@ -139,6 +136,7 @@ private: float pre_process_time; float explosiveness_ratio; float randomness_ratio; + float lifetime_randomness; float speed_scale; bool local_coords; int fixed_fps; @@ -200,6 +198,7 @@ public: void set_pre_process_time(float p_time); void set_explosiveness_ratio(float p_ratio); void set_randomness_ratio(float p_ratio); + void set_lifetime_randomness(float p_random); void set_visibility_aabb(const Rect2 &p_aabb); void set_use_local_coordinates(bool p_enable); void set_speed_scale(float p_scale); @@ -211,6 +210,7 @@ public: float get_pre_process_time() const; float get_explosiveness_ratio() const; float get_randomness_ratio() const; + float get_lifetime_randomness() const; Rect2 get_visibility_aabb() const; bool get_use_local_coordinates() const; float get_speed_scale() const; diff --git a/scene/2d/navigation_2d.cpp b/scene/2d/navigation_2d.cpp index f644db462b..5cf28d6c89 100644 --- a/scene/2d/navigation_2d.cpp +++ b/scene/2d/navigation_2d.cpp @@ -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() || !Math::is_zero_approx(path[path.size() - 1].distance_to(apex_point))) + if (!path.size() || path[path.size() - 1] != apex_point) path.push_back(apex_point); skip = true; } @@ -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() || !Math::is_zero_approx(path[path.size() - 1].distance_to(apex_point))) + if (!path.size() || path[path.size() - 1] != apex_point) path.push_back(apex_point); } } diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 9a6b63b9a3..0823e09110 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -69,6 +69,9 @@ Size2 ParallaxLayer::get_motion_offset() const { void ParallaxLayer::_update_mirroring() { + if (!is_inside_tree()) + return; + ParallaxBackground *pb = Object::cast_to<ParallaxBackground>(get_parent()); if (pb) { diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index f2f53d4354..55c8c7f229 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -110,7 +110,7 @@ void Path2D::_notification(int p_what) { real_t frac = j / 8.0; Vector2 p = curve->interpolate(i, frac); - draw_line(prev_p, p, color, line_width); + draw_line(prev_p, p, color, line_width, true); prev_p = p; } } diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 39b3375f09..0d9df3dae9 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -157,10 +157,7 @@ void PhysicsBody2D::add_collision_exception_with(Node *p_node) { ERR_FAIL_NULL(p_node); PhysicsBody2D *physics_body = Object::cast_to<PhysicsBody2D>(p_node); - if (!physics_body) { - ERR_EXPLAIN("Collision exception only works between two objects of PhysicsBody type"); - } - ERR_FAIL_COND(!physics_body); + ERR_FAIL_COND_MSG(!physics_body, "Collision exception only works between two objects of PhysicsBody type."); Physics2DServer::get_singleton()->body_add_collision_exception(get_rid(), physics_body->get_rid()); } @@ -168,10 +165,7 @@ void PhysicsBody2D::remove_collision_exception_with(Node *p_node) { ERR_FAIL_NULL(p_node); PhysicsBody2D *physics_body = Object::cast_to<PhysicsBody2D>(p_node); - if (!physics_body) { - ERR_EXPLAIN("Collision exception only works between two objects of PhysicsBody type"); - } - ERR_FAIL_COND(!physics_body); + ERR_FAIL_COND_MSG(!physics_body, "Collision exception only works between two objects of PhysicsBody type."); Physics2DServer::get_singleton()->body_remove_collision_exception(get_rid(), physics_body->get_rid()); } @@ -203,8 +197,7 @@ void StaticBody2D::set_friction(real_t p_friction) { return; } - ERR_EXPLAIN("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); ERR_FAIL_COND(p_friction < 0 || p_friction > 1); @@ -217,8 +210,7 @@ void StaticBody2D::set_friction(real_t p_friction) { real_t StaticBody2D::get_friction() const { - ERR_EXPLAIN("The method get_friction has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method get_friction has been deprecated and will be removed in the future, use physics material instead."); if (physics_material_override.is_null()) { return 1; @@ -233,8 +225,7 @@ void StaticBody2D::set_bounce(real_t p_bounce) { return; } - ERR_EXPLAIN("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); ERR_FAIL_COND(p_bounce < 0 || p_bounce > 1); @@ -247,8 +238,7 @@ void StaticBody2D::set_bounce(real_t p_bounce) { real_t StaticBody2D::get_bounce() const { - ERR_EXPLAIN("The method get_bounce has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method get_bounce has been deprecated and will be removed in the future, use physics material instead."); if (physics_material_override.is_null()) { return 0; @@ -604,7 +594,7 @@ real_t RigidBody2D::get_mass() const { void RigidBody2D::set_inertia(real_t p_inertia) { - ERR_FAIL_COND(p_inertia <= 0); + ERR_FAIL_COND(p_inertia < 0); Physics2DServer::get_singleton()->body_set_param(get_rid(), Physics2DServer::BODY_PARAM_INERTIA, p_inertia); } @@ -630,8 +620,7 @@ void RigidBody2D::set_friction(real_t p_friction) { return; } - ERR_EXPLAIN("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); ERR_FAIL_COND(p_friction < 0 || p_friction > 1); @@ -643,8 +632,7 @@ void RigidBody2D::set_friction(real_t p_friction) { } real_t RigidBody2D::get_friction() const { - ERR_EXPLAIN("The method get_friction has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method get_friction has been deprecated and will be removed in the future, use physics material instead."); if (physics_material_override.is_null()) { return 1; @@ -659,8 +647,7 @@ void RigidBody2D::set_bounce(real_t p_bounce) { return; } - ERR_EXPLAIN("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); ERR_FAIL_COND(p_bounce < 0 || p_bounce > 1); @@ -672,8 +659,7 @@ void RigidBody2D::set_bounce(real_t p_bounce) { } real_t RigidBody2D::get_bounce() const { - ERR_EXPLAIN("The method get_bounce has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method get_bounce has been deprecated and will be removed in the future, use physics material instead."); if (physics_material_override.is_null()) { return 0; @@ -905,10 +891,7 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { if (!p_enabled) { - if (contact_monitor->locked) { - ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead"); - } - ERR_FAIL_COND(contact_monitor->locked); + ERR_FAIL_COND_MSG(contact_monitor->locked, "Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\", false) instead."); for (Map<ObjectID, BodyState>::Element *E = contact_monitor->body_map.front(); E; E = E->next()) { @@ -1074,10 +1057,10 @@ void RigidBody2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "can_sleep"), "set_can_sleep", "is_able_to_sleep"); ADD_GROUP("Linear", "linear_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "linear_velocity"), "set_linear_velocity", "get_linear_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "-1,128,0.01"), "set_linear_damp", "get_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); ADD_GROUP("Angular", "angular_"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_velocity"), "set_angular_velocity", "get_angular_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "-1,128,0.01"), "set_angular_damp", "get_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); ADD_GROUP("Applied Forces", "applied_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "applied_force"), "set_applied_force", "get_applied_force"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "applied_torque"), "set_applied_torque", "get_applied_torque"); diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 57dfe5176d..bf8d008bb2 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -100,6 +100,7 @@ Vector2 RayCast2D::get_collision_normal() const { void RayCast2D::set_enabled(bool p_enabled) { enabled = p_enabled; + update(); if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) set_physics_process_internal(p_enabled); if (!p_enabled) @@ -167,19 +168,25 @@ void RayCast2D::_notification(int p_what) { xf.rotate(cast_to.angle()); xf.translate(Vector2(cast_to.length(), 0)); - //Vector2 tip = Vector2(0,s->get_length()); - Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4); - draw_line(Vector2(), cast_to, dcol, 3); + // Draw an arrow indicating where the RayCast is pointing to + Color draw_col = get_tree()->get_debug_collisions_color(); + if (!enabled) { + float g = draw_col.get_v(); + draw_col.r = g; + draw_col.g = g; + draw_col.b = g; + } + draw_line(Vector2(), cast_to, draw_col, 2, true); Vector<Vector2> pts; - float tsize = 4; + float tsize = 8; pts.push_back(xf.xform(Vector2(tsize, 0))); pts.push_back(xf.xform(Vector2(0, 0.707 * tsize))); pts.push_back(xf.xform(Vector2(0, -0.707 * tsize))); Vector<Color> cols; for (int i = 0; i < 3; i++) - cols.push_back(dcol); + cols.push_back(draw_col); - draw_primitive(pts, cols, Vector<Vector2>()); //small arrow + draw_primitive(pts, cols, Vector<Vector2>()); } break; diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 6626fccf1c..d7a8005187 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -259,6 +259,7 @@ void Sprite::set_frame(int p_frame) { frame = p_frame; _change_notify("frame"); + _change_notify("frame_coords"); emit_signal(SceneStringNames::get_singleton()->frame_changed); } @@ -267,6 +268,17 @@ int Sprite::get_frame() const { return frame; } +void Sprite::set_frame_coords(const Vector2 &p_coord) { + ERR_FAIL_INDEX(int(p_coord.x), vframes); + ERR_FAIL_INDEX(int(p_coord.y), hframes); + + set_frame(int(p_coord.y) * hframes + int(p_coord.x)); +} + +Vector2 Sprite::get_frame_coords() const { + return Vector2(frame % hframes, frame / hframes); +} + void Sprite::set_vframes(int p_amount) { ERR_FAIL_COND(p_amount < 1); @@ -371,10 +383,9 @@ Rect2 Sprite::get_rect() const { void Sprite::_validate_property(PropertyInfo &property) const { if (property.name == "frame") { - - property.hint = PROPERTY_HINT_SPRITE_FRAME; - + property.hint = PROPERTY_HINT_RANGE; property.hint_string = "0," + itos(vframes * hframes - 1) + ",1"; + property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } } @@ -421,6 +432,9 @@ void Sprite::_bind_methods() { ClassDB::bind_method(D_METHOD("set_frame", "frame"), &Sprite::set_frame); ClassDB::bind_method(D_METHOD("get_frame"), &Sprite::get_frame); + ClassDB::bind_method(D_METHOD("set_frame_coords", "coords"), &Sprite::set_frame_coords); + ClassDB::bind_method(D_METHOD("get_frame_coords"), &Sprite::get_frame_coords); + ClassDB::bind_method(D_METHOD("set_vframes", "vframes"), &Sprite::set_vframes); ClassDB::bind_method(D_METHOD("get_vframes"), &Sprite::get_vframes); @@ -442,7 +456,8 @@ void Sprite::_bind_methods() { ADD_GROUP("Animation", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "vframes", PROPERTY_HINT_RANGE, "1,16384,1"), "set_vframes", "get_vframes"); ADD_PROPERTY(PropertyInfo(Variant::INT, "hframes", PROPERTY_HINT_RANGE, "1,16384,1"), "set_hframes", "get_hframes"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "frame", PROPERTY_HINT_SPRITE_FRAME), "set_frame", "get_frame"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "frame_coords", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_frame_coords", "get_frame_coords"); ADD_GROUP("Region", "region_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "region_enabled"), "set_region", "is_region"); diff --git a/scene/2d/sprite.h b/scene/2d/sprite.h index e38db3a299..5e6717a3f5 100644 --- a/scene/2d/sprite.h +++ b/scene/2d/sprite.h @@ -110,6 +110,9 @@ public: void set_frame(int p_frame); int get_frame() const; + void set_frame_coords(const Vector2 &p_coord); + Vector2 get_frame_coords() const; + void set_vframes(int p_amount); int get_vframes() const; diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index c79cd80e2e..2cd05b5c50 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1203,6 +1203,8 @@ void TileMap::clear() { void TileMap::_set_tile_data(const PoolVector<int> &p_data) { + ERR_FAIL_COND(format > FORMAT_2); + int c = p_data.size(); PoolVector<int>::Read r = p_data.read(); @@ -1245,8 +1247,6 @@ void TileMap::_set_tile_data(const PoolVector<int> &p_data) { set_cell(x, y, v, flip_h, flip_v, transpose, Vector2(coord_x, coord_y)); } - - format = FORMAT_2; } PoolVector<int> TileMap::_get_tile_data() const { @@ -1255,7 +1255,7 @@ PoolVector<int> TileMap::_get_tile_data() const { data.resize(tile_map.size() * 3); PoolVector<int>::Write w = data.write(); - format = FORMAT_2; + // Save in highest format int idx = 0; for (const Map<PosKey, Cell>::Element *E = tile_map.front(); E; E = E->next()) { @@ -1560,7 +1560,7 @@ bool TileMap::_set(const StringName &p_name, const Variant &p_value) { if (p_name == "format") { if (p_value.get_type() == Variant::INT) { - format = (DataFormat)(p_value.operator int64_t()); + format = (DataFormat)(p_value.operator int64_t()); // Set format used for loading return true; } } else if (p_name == "tile_data") { @@ -1576,7 +1576,7 @@ bool TileMap::_set(const StringName &p_name, const Variant &p_value) { bool TileMap::_get(const StringName &p_name, Variant &r_ret) const { if (p_name == "format") { - r_ret = format; + r_ret = FORMAT_2; // When saving, always save highest format return true; } else if (p_name == "tile_data") { r_ret = _get_tile_data(); @@ -1909,6 +1909,8 @@ void TileMap::_bind_methods() { ADD_GROUP("Occluder", "occluder_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "occluder_light_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_occluder_light_mask", "get_occluder_light_mask"); + ADD_PROPERTY_DEFAULT("format", FORMAT_1); + ADD_SIGNAL(MethodInfo("settings_changed")); BIND_CONSTANT(INVALID_CELL); @@ -1957,7 +1959,7 @@ TileMap::TileMap() { centered_textures = false; occluder_light_mask = 1; clip_uv = false; - format = FORMAT_1; //Always initialize with the lowest format + format = FORMAT_1; // Assume lowest possible format if none is present fp_adjust = 0.00001; tile_origin = TILE_ORIGIN_TOP_LEFT; diff --git a/scene/3d/SCsub b/scene/3d/SCsub index 200cf4316f..31a443bad1 100644 --- a/scene/3d/SCsub +++ b/scene/3d/SCsub @@ -3,10 +3,10 @@ Import('env') if env['disable_3d']: - env.scene_sources.append("3d/spatial.cpp") - env.scene_sources.append("3d/skeleton.cpp") - env.scene_sources.append("3d/particles.cpp") - env.scene_sources.append("3d/visual_instance.cpp") - env.scene_sources.append("3d/world_environment.cpp") + env.add_source_files(env.scene_sources, "spatial.cpp") + env.add_source_files(env.scene_sources, "skeleton.cpp") + env.add_source_files(env.scene_sources, "particles.cpp") + env.add_source_files(env.scene_sources, "visual_instance.cpp") + env.add_source_files(env.scene_sources, "world_environment.cpp") else: env.add_source_files(env.scene_sources, "*.cpp") diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 4247266e3d..77682abcb3 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -218,10 +218,7 @@ void Area::_body_inout(int p_status, const RID &p_body, int p_instance, int p_bo void Area::_clear_monitoring() { - if (locked) { - ERR_EXPLAIN("This function can't be used during the in/out signal."); - } - ERR_FAIL_COND(locked); + ERR_FAIL_COND_MSG(locked, "This function can't be used during the in/out signal."); { Map<ObjectID, BodyState> bmcopy = body_map; @@ -291,10 +288,7 @@ void Area::_notification(int p_what) { void Area::set_monitoring(bool p_enable) { - if (locked) { - ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitoring\",true/false)"); - } - ERR_FAIL_COND(locked); + ERR_FAIL_COND_MSG(locked, "Function blocked during in/out signal. Use set_deferred(\"monitoring\", true/false)."); if (p_enable == monitoring) return; @@ -441,10 +435,7 @@ Array Area::get_overlapping_bodies() const { void Area::set_monitorable(bool p_enable) { - if (locked || (is_inside_tree() && PhysicsServer::get_singleton()->is_flushing_queries())) { - ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitorable\",true/false)"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(locked || (is_inside_tree() && PhysicsServer::get_singleton()->is_flushing_queries()), "Function blocked during in/out signal. Use set_deferred(\"monitorable\", true/false)."); if (p_enable == monitorable) return; @@ -718,8 +709,8 @@ void Area::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "gravity_vec"), "set_gravity_vector", "get_gravity_vector"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_gravity", "get_gravity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,1024,0.001"), "set_linear_damp", "get_linear_damp"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,1024,0.001"), "set_angular_damp", "get_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable"); diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index 263a2d8de6..4c0449b68e 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -78,10 +78,7 @@ Vector3 ARVRCamera::project_local_ray_normal(const Point2 &p_pos) const { return Camera::project_local_ray_normal(p_pos); } - if (!is_inside_tree()) { - ERR_EXPLAIN("Camera is not inside scene."); - ERR_FAIL_COND_V(!is_inside_tree(), Vector3()); - }; + ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector3(), "Camera is not inside scene."); Size2 viewport_size = get_viewport()->get_camera_rect_size(); Vector2 cpos = get_viewport()->get_camera_coords(p_pos); @@ -106,10 +103,7 @@ Point2 ARVRCamera::unproject_position(const Vector3 &p_pos) const { return Camera::unproject_position(p_pos); } - if (!is_inside_tree()) { - ERR_EXPLAIN("Camera is not inside scene."); - ERR_FAIL_COND_V(!is_inside_tree(), Vector2()); - }; + ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector2(), "Camera is not inside scene."); Size2 viewport_size = get_viewport()->get_visible_rect().size; @@ -138,10 +132,7 @@ Vector3 ARVRCamera::project_position(const Point2 &p_point, float p_z_depth) con return Camera::project_position(p_point, p_z_depth); } - if (!is_inside_tree()) { - ERR_EXPLAIN("Camera is not inside scene."); - ERR_FAIL_COND_V(!is_inside_tree(), Vector3()); - }; + ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector3(), "Camera is not inside scene."); Size2 viewport_size = get_viewport()->get_visible_rect().size; diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index ff28f60d4f..27f16f7601 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -35,6 +35,99 @@ #include "scene/3d/listener.h" #include "scene/main/viewport.h" +// Based on "A Novel Multichannel Panning Method for Standard and Arbitrary Loudspeaker Configurations" by Ramy Sadek and Chris Kyriakakis (2004) +// Speaker-Placement Correction Amplitude Panning (SPCAP) +class Spcap { +private: + struct Speaker { + Vector3 direction; + real_t effective_number_of_speakers; // precalculated + mutable real_t squared_gain; // temporary + }; + + PoolVector<Speaker> speakers; + +public: + Spcap(unsigned int speaker_count, const Vector3 *speaker_directions) { + this->speakers.resize(speaker_count); + PoolVector<Speaker>::Write w = this->speakers.write(); + for (unsigned int speaker_num = 0; speaker_num < speaker_count; speaker_num++) { + w[speaker_num].direction = speaker_directions[speaker_num]; + w[speaker_num].squared_gain = 0.0; + w[speaker_num].effective_number_of_speakers = 0.0; + for (unsigned int other_speaker_num = 0; other_speaker_num < speaker_count; other_speaker_num++) { + w[speaker_num].effective_number_of_speakers += 0.5 * (1.0 + w[speaker_num].direction.dot(w[other_speaker_num].direction)); + } + } + } + + unsigned int get_speaker_count() const { + return (unsigned int)this->speakers.size(); + } + + Vector3 get_speaker_direction(unsigned int index) const { + return this->speakers.read()[index].direction; + } + + void calculate(const Vector3 &source_direction, real_t tightness, unsigned int volume_count, real_t *volumes) const { + PoolVector<Speaker>::Read r = this->speakers.read(); + real_t sum_squared_gains = 0.0; + for (unsigned int speaker_num = 0; speaker_num < (unsigned int)this->speakers.size(); speaker_num++) { + real_t initial_gain = 0.5 * powf(1.0 + r[speaker_num].direction.dot(source_direction), tightness) / r[speaker_num].effective_number_of_speakers; + r[speaker_num].squared_gain = initial_gain * initial_gain; + sum_squared_gains += r[speaker_num].squared_gain; + } + + for (unsigned int speaker_num = 0; speaker_num < MIN(volume_count, (unsigned int)this->speakers.size()); speaker_num++) { + volumes[speaker_num] = sqrtf(r[speaker_num].squared_gain / sum_squared_gains); + } + } +}; + +//TODO: hardcoded main speaker directions for 2, 3.1, 5.1 and 7.1 setups - these are simplified and could also be made configurable +static const Vector3 speaker_directions[7] = { + Vector3(-1.0, 0.0, -1.0).normalized(), // front-left + Vector3(1.0, 0.0, -1.0).normalized(), // front-right + Vector3(0.0, 0.0, -1.0).normalized(), // center + Vector3(-1.0, 0.0, 1.0).normalized(), // rear-left + Vector3(1.0, 0.0, 1.0).normalized(), // rear-right + Vector3(-1.0, 0.0, 0.0).normalized(), // side-left + Vector3(1.0, 0.0, 0.0).normalized(), // side-right +}; + +void AudioStreamPlayer3D::_calc_output_vol(const Vector3 &source_dir, real_t tightness, AudioStreamPlayer3D::Output &output) { + unsigned int speaker_count; // only main speakers (no LFE) + switch (AudioServer::get_singleton()->get_speaker_mode()) { + default: //fallthrough + case AudioServer::SPEAKER_MODE_STEREO: speaker_count = 2; break; + case AudioServer::SPEAKER_SURROUND_31: speaker_count = 3; break; + case AudioServer::SPEAKER_SURROUND_51: speaker_count = 5; break; + case AudioServer::SPEAKER_SURROUND_71: speaker_count = 7; break; + } + + Spcap spcap(speaker_count, speaker_directions); //TODO: should only be created/recreated once the speaker mode / speaker positions changes + real_t volumes[7]; + spcap.calculate(source_dir, tightness, speaker_count, volumes); + + switch (AudioServer::get_singleton()->get_speaker_mode()) { + case AudioServer::SPEAKER_SURROUND_71: + output.vol[3].l = volumes[5]; // side-left + output.vol[3].r = volumes[6]; // side-right + //fallthrough + case AudioServer::SPEAKER_SURROUND_51: + output.vol[2].l = volumes[3]; // rear-left + output.vol[2].r = volumes[4]; // rear-right + //fallthrough + case AudioServer::SPEAKER_SURROUND_31: + output.vol[1].r = 1.0; // LFE - always full power + output.vol[1].l = volumes[2]; // center + //fallthrough + case AudioServer::SPEAKER_MODE_STEREO: + output.vol[0].r = volumes[1]; // front-right + output.vol[0].l = volumes[0]; // front-left + } +} + void AudioStreamPlayer3D::_mix_audio() { if (!stream_playback.is_valid() || !active || @@ -381,59 +474,11 @@ void AudioStreamPlayer3D::_notification(int p_what) { output.filter_gain = Math::db2linear(db_att); - Vector3 flat_pos = local_pos; - flat_pos.y = 0; - flat_pos.normalize(); + //TODO: The lower the second parameter (tightness) the more the sound will "enclose" the listener (more undirected / playing from + // speakers not facing the source) - this could be made distance dependent. + _calc_output_vol(local_pos.normalized(), 4.0, output); unsigned int cc = AudioServer::get_singleton()->get_channel_count(); - if (cc == 1) { - // Stereo pair - float c = flat_pos.x * 0.5 + 0.5; - - output.vol[0].l = 1.0 - c; - output.vol[0].r = c; - } else { - Vector3 listenertopos = global_pos - listener_node->get_global_transform().origin; - float c = listenertopos.normalized().dot(get_global_transform().basis.get_axis(2).normalized()); //it's z negative - float angle = Math::rad2deg(Math::acos(c)); - float av = angle * (flat_pos.x < 0 ? -1 : 1) / 180.0; - - if (cc >= 1) { - // Stereo pair - float fl = Math::abs(1.0 - Math::abs(-0.8 - av)); - float fr = Math::abs(1.0 - Math::abs(0.8 - av)); - - output.vol[0].l = fl; - output.vol[0].r = fr; - } - - if (cc >= 2) { - // Center pair - float center = 1.0 - Math::sin(Math::acos(c)); - - output.vol[1].l = center; - output.vol[1].r = center; - } - - if (cc >= 3) { - // Side pair - float sleft = Math::abs(1.0 - Math::abs(-0.4 - av)); - float sright = Math::abs(1.0 - Math::abs(0.4 - av)); - - output.vol[2].l = sleft; - output.vol[2].r = sright; - } - - if (cc >= 4) { - // Rear pair - float rleft = Math::abs(1.0 - Math::abs(-0.2 - av)); - float rright = Math::abs(1.0 - Math::abs(0.2 - av)); - - output.vol[3].l = rleft; - output.vol[3].r = rright; - } - } - for (unsigned int k = 0; k < cc; k++) { output.vol[k] *= multiplier; } @@ -974,7 +1019,7 @@ void AudioStreamPlayer3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_degrees", PROPERTY_HINT_RANGE, "0.1,90,0.1"), "set_emission_angle", "get_emission_angle"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_filter_attenuation_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_emission_angle_filter_attenuation_db", "get_emission_angle_filter_attenuation_db"); ADD_GROUP("Attenuation Filter", "attenuation_filter_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "50,50000,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_attenuation_filter_db", "get_attenuation_filter_db"); ADD_GROUP("Doppler", "doppler_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Physics"), "set_doppler_tracking", "get_doppler_tracking"); diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h index 93954e758a..494aa70097 100644 --- a/scene/3d/audio_stream_player_3d.h +++ b/scene/3d/audio_stream_player_3d.h @@ -115,6 +115,7 @@ private: bool stream_paused_fade_out; StringName bus; + static void _calc_output_vol(const Vector3 &source_dir, real_t tightness, Output &output); void _mix_audio(); static void _mix_audios(void *self) { reinterpret_cast<AudioStreamPlayer3D *>(self)->_mix_audio(); } diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index c7d6919a2b..9f8510248c 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -279,10 +279,7 @@ Vector3 Camera::project_ray_normal(const Point2 &p_pos) const { Vector3 Camera::project_local_ray_normal(const Point2 &p_pos) const { - if (!is_inside_tree()) { - ERR_EXPLAIN("Camera is not inside scene."); - ERR_FAIL_COND_V(!is_inside_tree(), Vector3()); - } + ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector3(), "Camera is not inside scene."); Size2 viewport_size = get_viewport()->get_camera_rect_size(); Vector2 cpos = get_viewport()->get_camera_coords(p_pos); @@ -304,10 +301,7 @@ Vector3 Camera::project_local_ray_normal(const Point2 &p_pos) const { Vector3 Camera::project_ray_origin(const Point2 &p_pos) const { - if (!is_inside_tree()) { - ERR_EXPLAIN("Camera is not inside scene."); - ERR_FAIL_COND_V(!is_inside_tree(), Vector3()); - } + ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector3(), "Camera is not inside scene."); Size2 viewport_size = get_viewport()->get_camera_rect_size(); Vector2 cpos = get_viewport()->get_camera_coords(p_pos); @@ -345,10 +339,7 @@ bool Camera::is_position_behind(const Vector3 &p_pos) const { } Vector<Vector3> Camera::get_near_plane_points() const { - if (!is_inside_tree()) { - ERR_EXPLAIN("Camera is not inside scene."); - ERR_FAIL_COND_V(!is_inside_tree(), Vector<Vector3>()); - } + ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector<Vector3>(), "Camera is not inside scene."); Size2 viewport_size = get_viewport()->get_visible_rect().size; @@ -372,10 +363,7 @@ Vector<Vector3> Camera::get_near_plane_points() const { Point2 Camera::unproject_position(const Vector3 &p_pos) const { - if (!is_inside_tree()) { - ERR_EXPLAIN("Camera is not inside scene."); - ERR_FAIL_COND_V(!is_inside_tree(), Vector2()); - } + ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector2(), "Camera is not inside scene."); Size2 viewport_size = get_viewport()->get_visible_rect().size; @@ -400,10 +388,7 @@ Point2 Camera::unproject_position(const Vector3 &p_pos) const { Vector3 Camera::project_position(const Point2 &p_point, float p_z_depth) const { - if (!is_inside_tree()) { - ERR_EXPLAIN("Camera is not inside scene."); - ERR_FAIL_COND_V(!is_inside_tree(), Vector3()); - } + ERR_FAIL_COND_V_MSG(!is_inside_tree(), Vector3(), "Camera is not inside scene."); if (p_z_depth == 0) { return get_global_transform().origin; diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 6460f17e85..22223880c1 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -35,9 +35,7 @@ #include "scene/3d/spatial_velocity_tracker.h" #include "scene/main/viewport.h" #include "scene/resources/environment.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class Camera : public Spatial { GDCLASS(Camera, Spatial); diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 9d3e2983c4..63301fc226 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -370,7 +370,7 @@ String CollisionObject::get_configuration_warning() const { String warning = Spatial::get_configuration_warning(); if (shapes.empty()) { - if (warning == String()) { + if (!warning.empty()) { warning += "\n\n"; } warning += TTR("This node has no shape, so it can't collide or interact with other objects.\nConsider adding a CollisionShape or CollisionPolygon as a child to define its shape."); diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index db07059b32..37aa95fb43 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -151,6 +151,8 @@ float CollisionPolygon::get_depth() const { void CollisionPolygon::set_disabled(bool p_disabled) { disabled = p_disabled; + update_gizmo(); + if (parent) { parent->shape_owner_set_disabled(owner_id, p_disabled); } diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index 86b407b9e6..fc16bc36cb 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -92,6 +92,10 @@ void CPUParticles::set_randomness_ratio(float p_ratio) { randomness_ratio = p_ratio; } +void CPUParticles::set_lifetime_randomness(float p_random) { + + lifetime_randomness = p_random; +} void CPUParticles::set_use_local_coordinates(bool p_enable) { local_coords = p_enable; @@ -130,6 +134,10 @@ float CPUParticles::get_randomness_ratio() const { return randomness_ratio; } +float CPUParticles::get_lifetime_randomness() const { + + return lifetime_randomness; +} bool CPUParticles::get_use_local_coordinates() const { @@ -583,6 +591,10 @@ void CPUParticles::_particles_process(float p_delta) { } } + if (p.time * (1.0 - explosiveness_ratio) > p.lifetime) { + restart = true; + } + if (restart) { if (!emitting) { @@ -636,6 +648,7 @@ void CPUParticles::_particles_process(float p_delta) { p.custom[2] = (parameters[PARAM_ANIM_OFFSET] + tex_anim_offset) * Math::lerp(1.0f, p.anim_offset_rand, randomness[PARAM_ANIM_OFFSET]); //animation offset (0-1) p.transform = Transform(); p.time = 0; + p.lifetime = lifetime * (1.0 - Math::randf() * lifetime_randomness); p.base_color = Color(1, 1, 1, 1); switch (emission_shape) { @@ -701,6 +714,8 @@ void CPUParticles::_particles_process(float p_delta) { } else if (!p.active) { continue; + } else if (p.time > p.lifetime) { + p.active = false; } else { uint32_t alt_seed = p.seed; @@ -1059,9 +1074,6 @@ void CPUParticles::_notification(int p_what) { _set_redraw(false); } - if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) { - } - if (p_what == NOTIFICATION_INTERNAL_PROCESS) { if (particles.size() == 0 || !is_visible_in_tree()) { @@ -1221,6 +1233,7 @@ void CPUParticles::convert_from_particles(Node *p_particles) { set_emission_box_extents(material->get_emission_box_extents()); set_gravity(material->get_gravity()); + set_lifetime_randomness(material->get_lifetime_randomness()); #define CONVERT_PARAM(m_param) \ set_param(m_param, material->get_param(ParticlesMaterial::m_param)); \ @@ -1255,6 +1268,7 @@ void CPUParticles::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pre_process_time", "secs"), &CPUParticles::set_pre_process_time); ClassDB::bind_method(D_METHOD("set_explosiveness_ratio", "ratio"), &CPUParticles::set_explosiveness_ratio); ClassDB::bind_method(D_METHOD("set_randomness_ratio", "ratio"), &CPUParticles::set_randomness_ratio); + ClassDB::bind_method(D_METHOD("set_lifetime_randomness", "random"), &CPUParticles::set_lifetime_randomness); ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &CPUParticles::set_use_local_coordinates); ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &CPUParticles::set_fixed_fps); ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &CPUParticles::set_fractional_delta); @@ -1267,6 +1281,7 @@ void CPUParticles::_bind_methods() { ClassDB::bind_method(D_METHOD("get_pre_process_time"), &CPUParticles::get_pre_process_time); ClassDB::bind_method(D_METHOD("get_explosiveness_ratio"), &CPUParticles::get_explosiveness_ratio); ClassDB::bind_method(D_METHOD("get_randomness_ratio"), &CPUParticles::get_randomness_ratio); + ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &CPUParticles::get_lifetime_randomness); ClassDB::bind_method(D_METHOD("get_use_local_coordinates"), &CPUParticles::get_use_local_coordinates); ClassDB::bind_method(D_METHOD("get_fixed_fps"), &CPUParticles::get_fixed_fps); ClassDB::bind_method(D_METHOD("get_fractional_delta"), &CPUParticles::get_fractional_delta); @@ -1290,6 +1305,7 @@ void CPUParticles::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); @@ -1472,6 +1488,7 @@ CPUParticles::CPUParticles() { set_pre_process_time(0); set_explosiveness_ratio(0); set_randomness_ratio(0); + set_lifetime_randomness(0); set_use_local_coordinates(true); set_draw_order(DRAW_ORDER_INDEX); diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h index 517df8490d..66b37f359a 100644 --- a/scene/3d/cpu_particles.h +++ b/scene/3d/cpu_particles.h @@ -34,10 +34,6 @@ #include "core/rid.h" #include "scene/3d/visual_instance.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class CPUParticles : public GeometryInstance { private: GDCLASS(CPUParticles, GeometryInstance); @@ -95,6 +91,7 @@ private: float hue_rot_rand; float anim_offset_rand; float time; + float lifetime; Color base_color; uint32_t seed; @@ -137,6 +134,7 @@ private: float pre_process_time; float explosiveness_ratio; float randomness_ratio; + float lifetime_randomness; float speed_scale; bool local_coords; int fixed_fps; @@ -200,6 +198,7 @@ public: void set_pre_process_time(float p_time); void set_explosiveness_ratio(float p_ratio); void set_randomness_ratio(float p_ratio); + void set_lifetime_randomness(float p_random); void set_visibility_aabb(const AABB &p_aabb); void set_use_local_coordinates(bool p_enable); void set_speed_scale(float p_scale); @@ -211,6 +210,7 @@ public: float get_pre_process_time() const; float get_explosiveness_ratio() const; float get_randomness_ratio() const; + float get_lifetime_randomness() const; AABB get_visibility_aabb() const; bool get_use_local_coordinates() const; float get_speed_scale() const; diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 4ef945ab8d..85ee925248 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -200,9 +200,6 @@ void Light::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { _update_visibility(); } - - if (p_what == NOTIFICATION_EXIT_TREE) { - } } void Light::set_editor_only(bool p_editor_only) { @@ -413,7 +410,7 @@ DirectionalLight::DirectionalLight() : set_param(PARAM_SHADOW_NORMAL_BIAS, 0.8); set_param(PARAM_SHADOW_BIAS, 0.1); - set_param(PARAM_SHADOW_MAX_DISTANCE, 200); + set_param(PARAM_SHADOW_MAX_DISTANCE, 100); set_param(PARAM_SHADOW_BIAS_SPLIT_SCALE, 0.25); set_shadow_mode(SHADOW_PARALLEL_4_SPLITS); set_shadow_depth_range(SHADOW_DEPTH_RANGE_STABLE); diff --git a/scene/3d/light.h b/scene/3d/light.h index 5d365758b5..cc8675ead1 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -35,10 +35,6 @@ #include "scene/resources/texture.h" #include "servers/visual_server.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Light : public VisualInstance { GDCLASS(Light, VisualInstance); diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h index 022ef15aad..8b690b0c21 100644 --- a/scene/3d/mesh_instance.h +++ b/scene/3d/mesh_instance.h @@ -34,9 +34,6 @@ #include "scene/3d/visual_instance.h" #include "scene/resources/mesh.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class MeshInstance : public GeometryInstance { GDCLASS(MeshInstance, GeometryInstance); diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h index 8f41aa8fd2..ca69c73251 100644 --- a/scene/3d/multimesh_instance.h +++ b/scene/3d/multimesh_instance.h @@ -34,10 +34,6 @@ #include "scene/3d/visual_instance.h" #include "scene/resources/multimesh.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class MultiMeshInstance : public GeometryInstance { GDCLASS(MultiMeshInstance, GeometryInstance); diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 42c68010db..391491e8b8 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -35,10 +35,6 @@ #include "scene/3d/visual_instance.h" #include "scene/resources/material.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Particles : public GeometryInstance { private: GDCLASS(Particles, GeometryInstance); diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 2f8b2ecc5c..19d5f1dd3c 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -129,10 +129,7 @@ void PhysicsBody::add_collision_exception_with(Node *p_node) { ERR_FAIL_NULL(p_node); CollisionObject *collision_object = Object::cast_to<CollisionObject>(p_node); - if (!collision_object) { - ERR_EXPLAIN("Collision exception only works between two CollisionObject"); - } - ERR_FAIL_COND(!collision_object); + ERR_FAIL_COND_MSG(!collision_object, "Collision exception only works between two CollisionObject."); PhysicsServer::get_singleton()->body_add_collision_exception(get_rid(), collision_object->get_rid()); } @@ -140,10 +137,7 @@ void PhysicsBody::remove_collision_exception_with(Node *p_node) { ERR_FAIL_NULL(p_node); CollisionObject *collision_object = Object::cast_to<CollisionObject>(p_node); - if (!collision_object) { - ERR_EXPLAIN("Collision exception only works between two CollisionObject"); - } - ERR_FAIL_COND(!collision_object); + ERR_FAIL_COND_MSG(!collision_object, "Collision exception only works between two CollisionObject."); PhysicsServer::get_singleton()->body_remove_collision_exception(get_rid(), collision_object->get_rid()); } @@ -192,8 +186,7 @@ void StaticBody::set_friction(real_t p_friction) { return; } - ERR_EXPLAIN("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); ERR_FAIL_COND(p_friction < 0 || p_friction > 1); @@ -206,8 +199,7 @@ void StaticBody::set_friction(real_t p_friction) { real_t StaticBody::get_friction() const { - ERR_EXPLAIN("The method get_friction has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method get_friction has been deprecated and will be removed in the future, use physics material instead."); if (physics_material_override.is_null()) { return 1; @@ -222,8 +214,7 @@ void StaticBody::set_bounce(real_t p_bounce) { return; } - ERR_EXPLAIN("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); ERR_FAIL_COND(p_bounce < 0 || p_bounce > 1); @@ -236,8 +227,7 @@ void StaticBody::set_bounce(real_t p_bounce) { real_t StaticBody::get_bounce() const { - ERR_EXPLAIN("The method get_bounce has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method get_bounce has been deprecated and will be removed in the future, use physics material instead."); if (physics_material_override.is_null()) { return 0; @@ -636,8 +626,7 @@ void RigidBody::set_friction(real_t p_friction) { return; } - ERR_EXPLAIN("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method set_friction has been deprecated and will be removed in the future, use physics material instead."); ERR_FAIL_COND(p_friction < 0 || p_friction > 1); @@ -649,8 +638,7 @@ void RigidBody::set_friction(real_t p_friction) { } real_t RigidBody::get_friction() const { - ERR_EXPLAIN("The method get_friction has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method get_friction has been deprecated and will be removed in the future, use physics material instead."); if (physics_material_override.is_null()) { return 1; @@ -665,8 +653,7 @@ void RigidBody::set_bounce(real_t p_bounce) { return; } - ERR_EXPLAIN("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method set_bounce has been deprecated and will be removed in the future, use physics material instead."); ERR_FAIL_COND(p_bounce < 0 || p_bounce > 1); @@ -677,8 +664,7 @@ void RigidBody::set_bounce(real_t p_bounce) { physics_material_override->set_bounce(p_bounce); } real_t RigidBody::get_bounce() const { - ERR_EXPLAIN("The method get_bounce has been deprecated and will be removed in the future, use physics material instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("The method get_bounce has been deprecated and will be removed in the future, use physics material instead."); if (physics_material_override.is_null()) { return 0; } @@ -867,10 +853,7 @@ void RigidBody::set_contact_monitor(bool p_enabled) { if (!p_enabled) { - if (contact_monitor->locked) { - ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead"); - } - ERR_FAIL_COND(contact_monitor->locked); + ERR_FAIL_COND_MSG(contact_monitor->locked, "Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\", false) instead."); for (Map<ObjectID, BodyState>::Element *E = contact_monitor->body_map.front(); E; E = E->next()) { @@ -1044,10 +1027,10 @@ void RigidBody::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_angular_z"), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_ANGULAR_Z); ADD_GROUP("Linear", "linear_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "linear_velocity"), "set_linear_velocity", "get_linear_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "-1,128,0.01"), "set_linear_damp", "get_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); ADD_GROUP("Angular", "angular_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "angular_velocity"), "set_angular_velocity", "get_angular_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "-1,128,0.01"), "set_angular_damp", "get_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape"))); ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape"))); diff --git a/scene/3d/portal.h b/scene/3d/portal.h index f053867917..04af3a750c 100644 --- a/scene/3d/portal.h +++ b/scene/3d/portal.h @@ -32,9 +32,6 @@ #define PORTAL_H #include "scene/3d/visual_instance.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ /* Portal Logic: If a portal is placed next (very close to) a similar, opposing portal, they automatically connect, diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 10f92058e0..30eed8f1a7 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -102,6 +102,8 @@ Vector3 RayCast::get_collision_normal() const { void RayCast::set_enabled(bool p_enabled) { enabled = p_enabled; + update_gizmo(); + if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) set_physics_process_internal(p_enabled); if (!p_enabled) diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h index 9ee140d522..01efde53c9 100644 --- a/scene/3d/room_instance.h +++ b/scene/3d/room_instance.h @@ -34,10 +34,6 @@ #include "scene/3d/visual_instance.h" #include "scene/resources/room.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - /* RoomInstance Logic: a) Instances that belong to the room are drawn only if the room is visible (seen through portal, or player inside) b) Instances that don't belong to any room are considered to belong to the root room (RID empty) diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h index 5f43b3c6c3..5b55dffbc8 100644 --- a/scene/3d/skeleton.h +++ b/scene/3d/skeleton.h @@ -34,10 +34,6 @@ #include "core/rid.h" #include "scene/3d/spatial.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #ifndef _3D_DISABLED typedef int BoneId; diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp index 386e127f8b..6c3949a0a8 100644 --- a/scene/3d/soft_body.cpp +++ b/scene/3d/soft_body.cpp @@ -577,20 +577,14 @@ Array SoftBody::get_collision_exceptions() { void SoftBody::add_collision_exception_with(Node *p_node) { ERR_FAIL_NULL(p_node); CollisionObject *collision_object = Object::cast_to<CollisionObject>(p_node); - if (!collision_object) { - ERR_EXPLAIN("Collision exception only works between two CollisionObject"); - } - ERR_FAIL_COND(!collision_object); + ERR_FAIL_COND_MSG(!collision_object, "Collision exception only works between two CollisionObject."); PhysicsServer::get_singleton()->soft_body_add_collision_exception(physics_rid, collision_object->get_rid()); } void SoftBody::remove_collision_exception_with(Node *p_node) { ERR_FAIL_NULL(p_node); CollisionObject *collision_object = Object::cast_to<CollisionObject>(p_node); - if (!collision_object) { - ERR_EXPLAIN("Collision exception only works between two CollisionObject"); - } - ERR_FAIL_COND(!collision_object); + ERR_FAIL_COND_MSG(!collision_object, "Collision exception only works between two CollisionObject."); PhysicsServer::get_singleton()->soft_body_remove_collision_exception(physics_rid, collision_object->get_rid()); } diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 1a41a31253..df831f92ef 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -684,15 +684,8 @@ void Spatial::look_at(const Vector3 &p_target, const Vector3 &p_up) { void Spatial::look_at_from_position(const Vector3 &p_pos, const Vector3 &p_target, const Vector3 &p_up) { - if (p_pos == p_target) { - ERR_EXPLAIN("Node origin and target are in the same position, look_at() failed"); - ERR_FAIL(); - } - - if (p_up.cross(p_target - p_pos) == Vector3()) { - ERR_EXPLAIN("Up vector and direction between node origin and target are aligned, look_at() failed"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(p_pos == p_target, "Node origin and target are in the same position, look_at() failed."); + ERR_FAIL_COND_MSG(p_up.cross(p_target - p_pos) == Vector3(), "Up vector and direction between node origin and target are aligned, look_at() failed."); Transform lookat; lookat.origin = p_pos; diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h index 18a4a5b54d..eea2696767 100644 --- a/scene/3d/spatial.h +++ b/scene/3d/spatial.h @@ -34,10 +34,6 @@ #include "scene/main/node.h" #include "scene/main/scene_tree.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class SpatialGizmo : public Reference { GDCLASS(SpatialGizmo, Reference); diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 67c79d8b5a..fc5523633d 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -558,12 +558,15 @@ Rect2 Sprite3D::get_region_rect() const { void Sprite3D::set_frame(int p_frame) { - ERR_FAIL_INDEX(p_frame, vframes * hframes); + ERR_FAIL_INDEX(p_frame, int64_t(vframes) * hframes); if (frame != p_frame) frame = p_frame; _queue_update(); + + _change_notify("frame"); + _change_notify("frame_coords"); emit_signal(SceneStringNames::get_singleton()->frame_changed); } @@ -572,6 +575,17 @@ int Sprite3D::get_frame() const { return frame; } +void Sprite3D::set_frame_coords(const Vector2 &p_coord) { + ERR_FAIL_INDEX(int(p_coord.x), vframes); + ERR_FAIL_INDEX(int(p_coord.y), hframes); + + set_frame(int(p_coord.y) * hframes + int(p_coord.x)); +} + +Vector2 Sprite3D::get_frame_coords() const { + return Vector2(frame % hframes, frame / hframes); +} + void Sprite3D::set_vframes(int p_amount) { ERR_FAIL_COND(p_amount < 1); @@ -628,10 +642,9 @@ Rect2 Sprite3D::get_item_rect() const { void Sprite3D::_validate_property(PropertyInfo &property) const { if (property.name == "frame") { - - property.hint = PROPERTY_HINT_SPRITE_FRAME; - + property.hint = PROPERTY_HINT_RANGE; property.hint_string = "0," + itos(vframes * hframes - 1) + ",1"; + property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } } @@ -649,6 +662,9 @@ void Sprite3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_frame", "frame"), &Sprite3D::set_frame); ClassDB::bind_method(D_METHOD("get_frame"), &Sprite3D::get_frame); + ClassDB::bind_method(D_METHOD("set_frame_coords", "coords"), &Sprite3D::set_frame_coords); + ClassDB::bind_method(D_METHOD("get_frame_coords"), &Sprite3D::get_frame_coords); + ClassDB::bind_method(D_METHOD("set_vframes", "vframes"), &Sprite3D::set_vframes); ClassDB::bind_method(D_METHOD("get_vframes"), &Sprite3D::get_vframes); @@ -659,7 +675,8 @@ void Sprite3D::_bind_methods() { ADD_GROUP("Animation", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "vframes", PROPERTY_HINT_RANGE, "1,16384,1"), "set_vframes", "get_vframes"); ADD_PROPERTY(PropertyInfo(Variant::INT, "hframes", PROPERTY_HINT_RANGE, "1,16384,1"), "set_hframes", "get_hframes"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "frame", PROPERTY_HINT_SPRITE_FRAME), "set_frame", "get_frame"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "frame_coords", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_frame_coords", "get_frame_coords"); ADD_GROUP("Region", "region_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "region_enabled"), "set_region", "is_region"); ADD_PROPERTY(PropertyInfo(Variant::RECT2, "region_rect"), "set_region_rect", "get_region_rect"); @@ -851,14 +868,11 @@ void AnimatedSprite3D::_validate_property(PropertyInfo &property) const { } if (property.name == "frame") { - property.hint = PROPERTY_HINT_RANGE; - - if (frames->has_animation(animation)) { + if (frames->has_animation(animation) && frames->get_frame_count(animation) > 1) { property.hint_string = "0," + itos(frames->get_frame_count(animation) - 1) + ",1"; - } else { - property.hint_string = "0,0,0"; } + property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } } @@ -1091,7 +1105,7 @@ void AnimatedSprite3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation"), "set_animation", "get_animation"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "frame", PROPERTY_HINT_SPRITE_FRAME), "set_frame", "get_frame"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing"), "_set_playing", "_is_playing"); } diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index 0e086ef31e..97a426b5b9 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -173,6 +173,9 @@ public: void set_frame(int p_frame); int get_frame() const; + void set_frame_coords(const Vector2 &p_coord); + Vector2 get_frame_coords() const; + void set_vframes(int p_amount); int get_vframes() const; diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 89e96e0227..98e68cfbda 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -272,6 +272,20 @@ void VehicleWheel::_bind_methods() { ClassDB::bind_method(D_METHOD("get_rpm"), &VehicleWheel::get_rpm); + ClassDB::bind_method(D_METHOD("set_engine_force", "engine_force"), &VehicleWheel::set_engine_force); + ClassDB::bind_method(D_METHOD("get_engine_force"), &VehicleWheel::get_engine_force); + + ClassDB::bind_method(D_METHOD("set_brake", "brake"), &VehicleWheel::set_brake); + ClassDB::bind_method(D_METHOD("get_brake"), &VehicleWheel::get_brake); + + ClassDB::bind_method(D_METHOD("set_steering", "steering"), &VehicleWheel::set_steering); + ClassDB::bind_method(D_METHOD("get_steering"), &VehicleWheel::get_steering); + + ADD_GROUP("Per-Wheel Motion", ""); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "engine_force", PROPERTY_HINT_RANGE, "0.00,1024.0,0.01,or_greater"), "set_engine_force", "get_engine_force"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "brake", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_brake", "get_brake"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "steering", PROPERTY_HINT_RANGE, "-180,180.0,0.01"), "set_steering", "get_steering"); + ADD_GROUP("VehicleBody Motion", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_as_traction"), "set_use_as_traction", "is_used_as_traction"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_as_steering"), "set_use_as_steering", "is_used_as_steering"); ADD_GROUP("Wheel", "wheel_"); @@ -288,6 +302,34 @@ void VehicleWheel::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping_relaxation"), "set_damping_relaxation", "get_damping_relaxation"); } +void VehicleWheel::set_engine_force(float p_engine_force) { + + m_engineForce = p_engine_force; +} + +float VehicleWheel::get_engine_force() const { + + return m_engineForce; +} + +void VehicleWheel::set_brake(float p_brake) { + + m_brake = p_brake; +} +float VehicleWheel::get_brake() const { + + return m_brake; +} + +void VehicleWheel::set_steering(float p_steering) { + + m_steering = p_steering; +} +float VehicleWheel::get_steering() const { + + return m_steering; +} + void VehicleWheel::set_use_as_traction(bool p_enable) { engine_traction = p_enable; @@ -374,10 +416,7 @@ void VehicleBody::_update_wheel(int p_idx, PhysicsDirectBodyState *s) { Vector3 fwd = up.cross(right); fwd = fwd.normalized(); - //rotate around steering over de wheelAxleWS - real_t steering = wheel.steers ? m_steeringValue : 0.0; - - Basis steeringMat(up, steering); + Basis steeringMat(up, wheel.m_steering); Basis rotatingMat(right, wheel.m_rotation); @@ -723,12 +762,11 @@ void VehicleBody::_update_friction(PhysicsDirectBodyState *s) { real_t rollingFriction = 0.f; if (wheelInfo.m_raycastInfo.m_isInContact) { - if (engine_force != 0.f && wheelInfo.engine_traction) { - rollingFriction = -engine_force * s->get_step(); + if (wheelInfo.m_engineForce != 0.f) { + rollingFriction = -wheelInfo.m_engineForce * s->get_step(); } else { real_t defaultRollingFrictionImpulse = 0.f; - float cbrake = MAX(wheelInfo.m_brake, brake); - real_t maxImpulse = cbrake ? cbrake : defaultRollingFrictionImpulse; + real_t maxImpulse = wheelInfo.m_brake ? wheelInfo.m_brake : defaultRollingFrictionImpulse; btVehicleWheelContactPoint contactPt(s, wheelInfo.m_raycastInfo.m_groundObject, wheelInfo.m_raycastInfo.m_contactPointWS, m_forwardWS[wheel], maxImpulse); rollingFriction = _calc_rolling_friction(contactPt); } @@ -886,6 +924,11 @@ void VehicleBody::_direct_state_changed(Object *p_state) { void VehicleBody::set_engine_force(float p_engine_force) { engine_force = p_engine_force; + for (int i = 0; i < wheels.size(); i++) { + VehicleWheel &wheelInfo = *wheels[i]; + if (wheelInfo.engine_traction) + wheelInfo.m_engineForce = p_engine_force; + } } float VehicleBody::get_engine_force() const { @@ -896,6 +939,10 @@ float VehicleBody::get_engine_force() const { void VehicleBody::set_brake(float p_brake) { brake = p_brake; + for (int i = 0; i < wheels.size(); i++) { + VehicleWheel &wheelInfo = *wheels[i]; + wheelInfo.m_brake = p_brake; + } } float VehicleBody::get_brake() const { @@ -905,6 +952,11 @@ float VehicleBody::get_brake() const { void VehicleBody::set_steering(float p_steering) { m_steeringValue = p_steering; + for (int i = 0; i < wheels.size(); i++) { + VehicleWheel &wheelInfo = *wheels[i]; + if (wheelInfo.steers) + wheelInfo.m_steering = p_steering; + } } float VehicleBody::get_steering() const { diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h index 9e3fe72282..914bfd54bd 100644 --- a/scene/3d/vehicle_body.h +++ b/scene/3d/vehicle_body.h @@ -70,7 +70,7 @@ class VehicleWheel : public Spatial { real_t m_deltaRotation; real_t m_rpm; real_t m_rollInfluence; - //real_t m_engineForce; + real_t m_engineForce; real_t m_brake; real_t m_clippedInvContactDotSuspension; @@ -137,6 +137,15 @@ public: float get_rpm() const; + void set_engine_force(float p_engine_force); + float get_engine_force() const; + + void set_brake(float p_brake); + float get_brake() const; + + void set_steering(float p_steering); + float get_steering() const; + String get_configuration_warning() const; VehicleWheel(); diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 5141c84803..d1de0c56a7 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -215,17 +215,6 @@ float GeometryInstance::get_lod_max_hysteresis() const { } void GeometryInstance::_notification(int p_what) { - - if (p_what == NOTIFICATION_ENTER_WORLD) { - - if (flags[FLAG_USE_BAKED_LIGHT]) { - } - - } else if (p_what == NOTIFICATION_EXIT_WORLD) { - - if (flags[FLAG_USE_BAKED_LIGHT]) { - } - } } void GeometryInstance::set_flag(Flags p_flag, bool p_value) { @@ -236,8 +225,6 @@ void GeometryInstance::set_flag(Flags p_flag, bool p_value) { flags[p_flag] = p_value; VS::get_singleton()->instance_geometry_set_flag(get_instance(), (VS::InstanceFlags)p_flag, p_value); - if (p_flag == FLAG_USE_BAKED_LIGHT) { - } } bool GeometryInstance::get_flag(Flags p_flag) const { diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h index 3b924e0454..63d15680aa 100644 --- a/scene/3d/visual_instance.h +++ b/scene/3d/visual_instance.h @@ -35,9 +35,7 @@ #include "core/rid.h" #include "scene/3d/spatial.h" #include "scene/resources/material.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class VisualInstance : public Spatial { GDCLASS(VisualInstance, Spatial); diff --git a/scene/3d/world_environment.h b/scene/3d/world_environment.h index bf36a0a532..656e16371f 100644 --- a/scene/3d/world_environment.h +++ b/scene/3d/world_environment.h @@ -33,10 +33,6 @@ #include "scene/3d/spatial.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class WorldEnvironment : public Node { GDCLASS(WorldEnvironment, Node); diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp index dded44b990..416a291da1 100644 --- a/scene/animation/animation_blend_space_1d.cpp +++ b/scene/animation/animation_blend_space_1d.cpp @@ -266,7 +266,7 @@ float AnimationNodeBlendSpace1D::process(float p_time, bool p_seek) { // fill in weights - if (point_lower == -1) { + if (point_lower == -1 && point_higher != -1) { // we are on the left side, no other point to the left // we just play the next point. diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index 95d4644004..75031f0149 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -527,7 +527,7 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) { } } - if (new_closest != closest) { + if (new_closest != closest && new_closest != -1) { float from = 0; if (blend_mode == BLEND_MODE_DISCRETE_CARRY && closest != -1) { diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index 84b3f103c5..e26bd5b5a1 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -80,8 +80,7 @@ void AnimationCache::_update_cache() { if (!node) { path_cache.push_back(Path()); - ERR_EXPLAIN("Invalid Track Path in Animation: " + np); - ERR_CONTINUE(!node); + ERR_CONTINUE_MSG(!node, "Invalid track path in animation: " + np + "."); } Path path; @@ -92,8 +91,7 @@ void AnimationCache::_update_cache() { if (np.get_subname_count() > 1) { path_cache.push_back(Path()); - ERR_EXPLAIN("Transform tracks can't have a subpath: " + np); - ERR_CONTINUE(animation->track_get_type(i) == Animation::TYPE_TRANSFORM); + ERR_CONTINUE_MSG(animation->track_get_type(i) == Animation::TYPE_TRANSFORM, "Transform tracks can't have a subpath: " + np + "."); } Spatial *sp = Object::cast_to<Spatial>(node); @@ -101,8 +99,7 @@ void AnimationCache::_update_cache() { if (!sp) { path_cache.push_back(Path()); - ERR_EXPLAIN("Transform track not of type Spatial: " + np); - ERR_CONTINUE(!sp); + ERR_CONTINUE_MSG(!sp, "Transform track not of type Spatial: " + np + "."); } if (np.get_subname_count() == 1) { @@ -113,15 +110,13 @@ void AnimationCache::_update_cache() { if (!sk) { path_cache.push_back(Path()); - ERR_EXPLAIN("Property defined in Transform track, but not a Skeleton!: " + np); - ERR_CONTINUE(!sk); + ERR_CONTINUE_MSG(!sk, "Property defined in Transform track, but not a Skeleton!: " + np + "."); } int idx = sk->find_bone(ps); if (idx == -1) { path_cache.push_back(Path()); - ERR_EXPLAIN("Property defined in Transform track, but not a Skeleton Bone!: " + np); - ERR_CONTINUE(idx == -1); + ERR_CONTINUE_MSG(idx == -1, "Property defined in Transform track, but not a Skeleton Bone!: " + np + "."); } path.bone_idx = idx; @@ -161,8 +156,7 @@ void AnimationCache::_update_cache() { if (np.get_subname_count() == 0) { path_cache.push_back(Path()); - ERR_EXPLAIN("Value Track lacks property: " + np); - ERR_CONTINUE(np.get_subname_count() == 0); + ERR_CONTINUE_MSG(np.get_subname_count() == 0, "Value Track lacks property: " + np + "."); } } else if (animation->track_get_type(i) == Animation::TYPE_METHOD) { @@ -170,8 +164,7 @@ void AnimationCache::_update_cache() { if (path.subpath.size() != 0) { // Trying to call a method of a non-resource path_cache.push_back(Path()); - ERR_EXPLAIN("Method Track has property: " + np); - ERR_CONTINUE(path.subpath.size() != 0); + ERR_CONTINUE_MSG(path.subpath.size() != 0, "Method Track has property: " + np + "."); } } diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index f1ce948c43..65bf1e0134 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -235,6 +235,7 @@ bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *p_sta if (cost < least_cost) { least_cost_transition = E; + least_cost = cost; } } @@ -316,8 +317,7 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *p_st if (!playing) { String node_name = start_request; start_request = StringName(); - ERR_EXPLAIN("Can't travel to '" + node_name + "' if state machine is not playing."); - ERR_FAIL_V(0); + ERR_FAIL_V_MSG(0, "Can't travel to '" + node_name + "' if state machine is not playing."); } if (!_travel(p_state_machine, start_request)) { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 54df346374..051f832882 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -248,10 +248,7 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) { RES resource; Vector<StringName> leftover_path; Node *child = parent->get_node_and_resource(a->track_get_path(i), resource, leftover_path); - if (!child) { - ERR_EXPLAIN("On Animation: '" + p_anim->name + "', couldn't resolve track: '" + String(a->track_get_path(i)) + "'"); - } - ERR_CONTINUE(!child); // couldn't find the child node + ERR_CONTINUE_MSG(!child, "On Animation: '" + p_anim->name + "', couldn't resolve track: '" + String(a->track_get_path(i)) + "'."); // couldn't find the child node uint32_t id = resource.is_valid() ? resource->get_instance_id() : child->get_instance_id(); int bone_idx = -1; @@ -973,8 +970,7 @@ void AnimationPlayer::_animation_process(float p_delta) { Error AnimationPlayer::add_animation(const StringName &p_name, const Ref<Animation> &p_animation) { #ifdef DEBUG_ENABLED - ERR_EXPLAIN("Invalid animation name: " + String(p_name)); - ERR_FAIL_COND_V(String(p_name).find("/") != -1 || String(p_name).find(":") != -1 || String(p_name).find(",") != -1 || String(p_name).find("[") != -1, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V_MSG(String(p_name).find("/") != -1 || String(p_name).find(":") != -1 || String(p_name).find(",") != -1 || String(p_name).find("[") != -1, ERR_INVALID_PARAMETER, "Invalid animation name: " + String(p_name) + "."); #endif ERR_FAIL_COND_V(p_animation.is_null(), ERR_INVALID_PARAMETER); @@ -1158,10 +1154,7 @@ void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float if (String(name) == "") name = playback.assigned; - if (!animation_set.has(name)) { - ERR_EXPLAIN("Animation not found: " + name); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!animation_set.has(name), "Animation not found: " + name + "."); Playback &c = playback; @@ -1207,7 +1200,9 @@ void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float } } - _stop_playing_caches(); + if (get_current_animation() != p_name) { + _stop_playing_caches(); + } c.current.from = &animation_set[name]; diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index f3d38110c6..320fd2084c 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -35,9 +35,6 @@ #include "scene/3d/skeleton.h" #include "scene/3d/spatial.h" #include "scene/resources/animation.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ #ifdef TOOLS_ENABLED // To save/restore animated values diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index 5c3e123ac3..8f6d53c21c 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -403,8 +403,7 @@ void AnimationTreePlayer::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - ERR_EXPLAIN("AnimationTreePlayer has been deprecated. Use AnimationTree instead."); - WARN_DEPRECATED; + WARN_DEPRECATED_MSG("AnimationTreePlayer has been deprecated. Use AnimationTree instead."); if (!processing) { //make sure that a previous process state was not saved @@ -993,10 +992,9 @@ int AnimationTreePlayer::node_get_input_count(const StringName &p_node) const { ERR_FAIL_COND_V(!node_map.has(p_node), -1); return node_map[p_node]->inputs.size(); } -#define GET_NODE(m_type, m_cast) \ - ERR_FAIL_COND(!node_map.has(p_node)); \ - ERR_EXPLAIN("Invalid parameter for node type."); \ - ERR_FAIL_COND(node_map[p_node]->type != m_type); \ +#define GET_NODE(m_type, m_cast) \ + ERR_FAIL_COND(!node_map.has(p_node)); \ + ERR_FAIL_COND_MSG(node_map[p_node]->type != m_type, "Invalid parameter for node type."); \ m_cast *n = static_cast<m_cast *>(node_map[p_node]); void AnimationTreePlayer::animation_node_set_animation(const StringName &p_node, const Ref<Animation> &p_animation) { @@ -1209,10 +1207,9 @@ Point2 AnimationTreePlayer::node_get_position(const StringName &p_node) const { return node_map[p_node]->pos; } -#define GET_NODE_V(m_type, m_cast, m_ret) \ - ERR_FAIL_COND_V(!node_map.has(p_node), m_ret); \ - ERR_EXPLAIN("Invalid parameter for node type."); \ - ERR_FAIL_COND_V(node_map[p_node]->type != m_type, m_ret); \ +#define GET_NODE_V(m_type, m_cast, m_ret) \ + ERR_FAIL_COND_V(!node_map.has(p_node), m_ret); \ + ERR_FAIL_COND_V_MSG(node_map[p_node]->type != m_type, m_ret, "Invalid parameter for node type."); \ m_cast *n = static_cast<m_cast *>(node_map[p_node]); Ref<Animation> AnimationTreePlayer::animation_node_get_animation(const StringName &p_node) const { @@ -1367,8 +1364,7 @@ void AnimationTreePlayer::get_node_list(List<StringName> *p_node_list) const { void AnimationTreePlayer::remove_node(const StringName &p_node) { ERR_FAIL_COND(!node_map.has(p_node)); - ERR_EXPLAIN("Node 0 (output) can't be removed."); - ERR_FAIL_COND(p_node == out_name); + ERR_FAIL_COND_MSG(p_node == out_name, "Node 0 (output) can't be removed."); for (Map<StringName, NodeBase *>::Element *E = node_map.front(); E; E = E->next()) { diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 4dee4e1d12..2609924f33 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -1185,35 +1185,29 @@ bool Tween::_build_interpolation(InterpolateType p_interpolation_type, Object *p // Validate and apply interpolation data // Give it the object - ERR_EXPLAIN("Invalid object provided to Tween!"); - ERR_FAIL_COND_V(p_object == NULL, false); // Is the object real - ERR_FAIL_COND_V(!ObjectDB::instance_validate(p_object), false); // Is the object a valid instance? + ERR_FAIL_COND_V_MSG(p_object == NULL, false, "Invalid object provided to Tween."); + ERR_FAIL_COND_V_MSG(!ObjectDB::instance_validate(p_object), false, "Invalid object provided to Tween."); data.id = p_object->get_instance_id(); // Validate the initial and final values - ERR_EXPLAIN("Initial value type does not match final value type!"); // TODO: Print both types to make debugging easier - ERR_FAIL_COND_V(p_initial_val.get_type() != p_final_val.get_type(), false); // Do the initial and final value types match? + ERR_FAIL_COND_V_MSG(p_initial_val.get_type() != p_final_val.get_type(), false, "Initial value type '" + Variant::get_type_name(p_initial_val.get_type()) + "' does not match final value type '" + Variant::get_type_name(p_final_val.get_type()) + "'."); data.initial_val = p_initial_val; data.final_val = p_final_val; // Check the Duration - ERR_EXPLAIN("Only non-negative duration values allowed in Tweens!"); - ERR_FAIL_COND_V(p_duration < 0, false); // Is the tween duration non-negative + ERR_FAIL_COND_V_MSG(p_duration < 0, false, "Only non-negative duration values allowed in Tweens."); data.duration = p_duration; // Tween Delay - ERR_EXPLAIN("Only non-negative delay values allowed in Tweens!"); - ERR_FAIL_COND_V(p_delay < 0, false); // Is the delay non-negative? + ERR_FAIL_COND_V_MSG(p_delay < 0, false, "Only non-negative delay values allowed in Tweens."); data.delay = p_delay; // Transition type - ERR_EXPLAIN("Invalid transition type provided to Tween"); - ERR_FAIL_COND_V(p_trans_type < 0 || p_trans_type >= TRANS_COUNT, false); // Is the transition type valid + ERR_FAIL_COND_V_MSG(p_trans_type < 0 || p_trans_type >= TRANS_COUNT, false, "Invalid transition type provided to Tween."); data.trans_type = p_trans_type; // Easing type - ERR_EXPLAIN("Invalid easing type provided to Tween"); - ERR_FAIL_COND_V(p_ease_type < 0 || p_ease_type >= EASE_COUNT, false); // Is the easing type valid + ERR_FAIL_COND_V_MSG(p_ease_type < 0 || p_ease_type >= EASE_COUNT, false, "Invalid easing type provided to Tween."); data.ease_type = p_ease_type; // Is the property defined? @@ -1221,8 +1215,7 @@ bool Tween::_build_interpolation(InterpolateType p_interpolation_type, Object *p // Check that the object actually contains the given property bool prop_valid = false; p_object->get_indexed(p_property->get_subnames(), &prop_valid); - ERR_EXPLAIN("Tween target object has no property named: " + p_property->get_concatenated_subnames()); - ERR_FAIL_COND_V(!prop_valid, false); + ERR_FAIL_COND_V_MSG(!prop_valid, false, "Tween target object has no property named: " + p_property->get_concatenated_subnames() + "."); data.key = p_property->get_subnames(); data.concatenated_key = p_property->get_concatenated_subnames(); @@ -1231,8 +1224,7 @@ bool Tween::_build_interpolation(InterpolateType p_interpolation_type, Object *p // Is the method defined? if (p_method) { // Does the object even have the requested method? - ERR_EXPLAIN("Tween target object has no method named: " + *p_method); // TODO: Fix this error message - ERR_FAIL_COND_V(!p_object->has_method(*p_method), false); + ERR_FAIL_COND_V_MSG(!p_object->has_method(*p_method), false, "Tween target object has no method named: " + *p_method + "."); data.key.push_back(*p_method); data.concatenated_key = *p_method; @@ -1301,8 +1293,7 @@ bool Tween::interpolate_callback(Object *p_object, real_t p_duration, String p_c ERR_FAIL_COND_V(p_duration < 0, false); // Check whether the object even has the callback - ERR_EXPLAIN("Object has no callback named: %s" + p_callback); - ERR_FAIL_COND_V(!p_object->has_method(p_callback), false); + ERR_FAIL_COND_V_MSG(!p_object->has_method(p_callback), false, "Object has no callback named: " + p_callback + "."); // Build a new InterpolationData InterpolateData data; @@ -1361,8 +1352,7 @@ bool Tween::interpolate_deferred_callback(Object *p_object, real_t p_duration, S ERR_FAIL_COND_V(p_duration < 0, false); // Confirm the callback exists on the object - ERR_EXPLAIN("Object has no callback named: %s" + p_callback); - ERR_FAIL_COND_V(!p_object->has_method(p_callback), false); + ERR_FAIL_COND_V_MSG(!p_object->has_method(p_callback), false, "Object has no callback named: " + p_callback + "."); // Create a new InterpolateData for the callback InterpolateData data; @@ -1505,10 +1495,8 @@ bool Tween::follow_method(Object *p_object, StringName p_method, Variant p_initi ERR_FAIL_COND_V(p_delay < 0, false); // Confirm both objects have the target methods - ERR_EXPLAIN("Object has no method named: %s" + p_method); - ERR_FAIL_COND_V(!p_object->has_method(p_method), false); - ERR_EXPLAIN("Target has no method named: %s" + p_target_method); - ERR_FAIL_COND_V(!p_target->has_method(p_target_method), false); + ERR_FAIL_COND_V_MSG(!p_object->has_method(p_method), false, "Object has no method named: " + p_method + "."); + ERR_FAIL_COND_V_MSG(!p_target->has_method(p_target_method), false, "Target has no method named: " + p_target_method + "."); // Call the method to get the target value Variant::CallError error; @@ -1641,10 +1629,8 @@ bool Tween::targeting_method(Object *p_object, StringName p_method, Object *p_in ERR_FAIL_COND_V(p_delay < 0, false); // Make sure both objects have the given method - ERR_EXPLAIN("Object has no method named: %s" + p_method); - ERR_FAIL_COND_V(!p_object->has_method(p_method), false); - ERR_EXPLAIN("Initial Object has no method named: %s" + p_initial_method); - ERR_FAIL_COND_V(!p_initial->has_method(p_initial_method), false); + ERR_FAIL_COND_V_MSG(!p_object->has_method(p_method), false, "Object has no method named: " + p_method + "."); + ERR_FAIL_COND_V_MSG(!p_initial->has_method(p_initial_method), false, "Initial Object has no method named: " + p_initial_method + "."); // Call the method to get the initial value Variant::CallError error; diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 52fcea2a71..4f71481280 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -115,9 +115,6 @@ void BaseButton::_notification(int p_what) { } } - if (p_what == NOTIFICATION_ENTER_TREE) { - } - if (p_what == NOTIFICATION_EXIT_TREE || (p_what == NOTIFICATION_VISIBILITY_CHANGED && !is_visible_in_tree())) { if (!toggle_mode) { diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h index ffccdd69d6..2773f024df 100644 --- a/scene/gui/base_button.h +++ b/scene/gui/base_button.h @@ -32,9 +32,6 @@ #define BASE_BUTTON_H #include "scene/gui/control.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class ButtonGroup; diff --git a/scene/gui/button.h b/scene/gui/button.h index 6ba3475e5a..370809060e 100644 --- a/scene/gui/button.h +++ b/scene/gui/button.h @@ -32,9 +32,6 @@ #define BUTTON_H #include "scene/gui/base_button.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Button : public BaseButton { diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index 1d8b74d9db..8744407763 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -79,7 +79,7 @@ void CheckBox::_notification(int p_what) { Vector2 ofs; ofs.x = sb->get_margin(MARGIN_LEFT); - ofs.y = int((get_size().height - get_icon_size().height) / 2); + ofs.y = int((get_size().height - get_icon_size().height) / 2) + get_constant("check_vadjust"); if (is_pressed()) on->draw(ci, ofs); diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp index a2d0f388c4..f47547f2cc 100644 --- a/scene/gui/check_button.cpp +++ b/scene/gui/check_button.cpp @@ -76,7 +76,7 @@ void CheckButton::_notification(int p_what) { Size2 tex_size = get_icon_size(); ofs.x = get_size().width - (tex_size.width + sb->get_margin(MARGIN_RIGHT)); - ofs.y = (get_size().height - tex_size.height) / 2; + ofs.y = (get_size().height - tex_size.height) / 2 + get_constant("check_vadjust"); if (is_pressed()) on->draw(ci, ofs); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 26be17f6c1..b655feecbe 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -289,7 +289,7 @@ void Control::_update_minimum_size() { Size2 minsize = get_combined_minimum_size(); if (minsize.x > data.size_cache.x || minsize.y > data.size_cache.y) { - set_size(data.size_cache); + _size_changed(); } data.updating_last_minimum_size = false; @@ -850,6 +850,12 @@ Ref<Texture> Control::get_icon(const StringName &p_name, const StringName &p_typ theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_icon(p_name, type)) { + return Theme::get_project_default()->get_icon(p_name, type); + } + } + return Theme::get_default()->get_icon(p_name, type); } @@ -886,6 +892,12 @@ Ref<Shader> Control::get_shader(const StringName &p_name, const StringName &p_ty theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_shader(p_name, type)) { + return Theme::get_project_default()->get_shader(p_name, type); + } + } + return Theme::get_default()->get_shader(p_name, type); } @@ -925,6 +937,9 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName & } while (class_name != StringName()) { + if (Theme::get_project_default().is_valid() && Theme::get_project_default()->has_stylebox(p_name, type)) + return Theme::get_project_default()->get_stylebox(p_name, type); + if (Theme::get_default()->has_stylebox(p_name, class_name)) return Theme::get_default()->get_stylebox(p_name, class_name); @@ -1001,6 +1016,11 @@ Color Control::get_color(const StringName &p_name, const StringName &p_type) con theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_color(p_name, type)) { + return Theme::get_project_default()->get_color(p_name, type); + } + } return Theme::get_default()->get_color(p_name, type); } @@ -1036,6 +1056,11 @@ int Control::get_constant(const StringName &p_name, const StringName &p_type) co theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_constant(p_name, type)) { + return Theme::get_project_default()->get_constant(p_name, type); + } + } return Theme::get_default()->get_constant(p_name, type); } @@ -1106,6 +1131,11 @@ bool Control::has_icon(const StringName &p_name, const StringName &p_type) const theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_color(p_name, type)) { + return true; + } + } return Theme::get_default()->has_icon(p_name, type); } @@ -1140,6 +1170,11 @@ bool Control::has_shader(const StringName &p_name, const StringName &p_type) con theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_shader(p_name, type)) { + return true; + } + } return Theme::get_default()->has_shader(p_name, type); } bool Control::has_stylebox(const StringName &p_name, const StringName &p_type) const { @@ -1173,6 +1208,11 @@ bool Control::has_stylebox(const StringName &p_name, const StringName &p_type) c theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_stylebox(p_name, type)) { + return true; + } + } return Theme::get_default()->has_stylebox(p_name, type); } bool Control::has_font(const StringName &p_name, const StringName &p_type) const { @@ -1206,6 +1246,11 @@ bool Control::has_font(const StringName &p_name, const StringName &p_type) const theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_font(p_name, type)) { + return true; + } + } return Theme::get_default()->has_font(p_name, type); } @@ -1240,6 +1285,11 @@ bool Control::has_color(const StringName &p_name, const StringName &p_type) cons theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_color(p_name, type)) { + return true; + } + } return Theme::get_default()->has_color(p_name, type); } @@ -1274,6 +1324,11 @@ bool Control::has_constant(const StringName &p_name, const StringName &p_type) c theme_owner = NULL; } + if (Theme::get_project_default().is_valid()) { + if (Theme::get_project_default()->has_constant(p_name, type)) { + return true; + } + } return Theme::get_default()->has_constant(p_name, type); } @@ -1717,17 +1772,6 @@ void Control::set_global_position(const Point2 &p_point, bool p_keep_margins) { set_position(inv.xform(p_point), p_keep_margins); } -Rect2 Control::_compute_child_rect(const float p_anchors[4], const float p_margins[4]) const { - - Rect2 anchorable = get_parent_anchorable_rect(); - Rect2 result = anchorable; - for (int i = 0; i < 4; i++) { - result.grow_margin((Margin)i, p_anchors[i] * anchorable.get_size()[i % 2] + p_margins[i]); - } - - return result; -} - void Control::_compute_anchors(Rect2 p_rect, const float p_margins[4], float (&r_anchors)[4]) { Size2 parent_rect_size = get_parent_anchorable_rect().size; @@ -1951,12 +1995,7 @@ Control *Control::find_next_valid_focus() const { Node *n = get_node(data.focus_next); if (n) { from = Object::cast_to<Control>(n); - - if (!from) { - - ERR_EXPLAIN("Next focus node is not a control: " + n->get_name()); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!from, NULL, "Next focus node is not a control: " + n->get_name() + "."); } else { return NULL; } @@ -2046,12 +2085,7 @@ Control *Control::find_prev_valid_focus() const { Node *n = get_node(data.focus_prev); if (n) { from = Object::cast_to<Control>(n); - - if (!from) { - - ERR_EXPLAIN("Previous focus node is not a control: " + n->get_name()); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!from, NULL, "Previous focus node is not a control: " + n->get_name() + "."); } else { return NULL; } @@ -2333,12 +2367,7 @@ Control *Control::_get_focus_neighbour(Margin p_margin, int p_count) { Node *n = get_node(data.focus_neighbour[p_margin]); if (n) { c = Object::cast_to<Control>(n); - - if (!c) { - - ERR_EXPLAIN("Neighbour focus node is not a control: " + n->get_name()); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!c, NULL, "Neighbor focus node is not a control: " + n->get_name() + "."); } else { return NULL; } @@ -2896,10 +2925,10 @@ void Control::_bind_methods() { BIND_VMETHOD(MethodInfo(Variant::BOOL, "_clips_input")); ADD_GROUP("Anchor", "anchor_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_left", PROPERTY_HINT_RANGE, "0,1,0.01,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_LEFT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_top", PROPERTY_HINT_RANGE, "0,1,0.01,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_TOP); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_right", PROPERTY_HINT_RANGE, "0,1,0.01,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_RIGHT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_bottom", PROPERTY_HINT_RANGE, "0,1,0.01,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_BOTTOM); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_left", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_LEFT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_top", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_TOP); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_right", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_RIGHT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_bottom", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_BOTTOM); ADD_GROUP("Margin", "margin_"); ADD_PROPERTYI(PropertyInfo(Variant::INT, "margin_left", PROPERTY_HINT_RANGE, "-4096,4096"), "set_margin", "get_margin", MARGIN_LEFT); diff --git a/scene/gui/control.h b/scene/gui/control.h index 1a59a6d2e4..7305b3ce93 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -38,9 +38,6 @@ #include "scene/main/node.h" #include "scene/main/timer.h" #include "scene/resources/theme.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Viewport; class Label; @@ -230,7 +227,6 @@ private: void _update_scroll(); void _resize(const Size2 &p_size); - Rect2 _compute_child_rect(const float p_anchors[4], const float p_margins[4]) const; void _compute_margins(Rect2 p_rect, const float p_anchors[4], float (&r_margins)[4]); void _compute_anchors(Rect2 p_rect, const float p_margins[4], float (&r_anchors)[4]); diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 4da11b671e..59bbdad97a 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -219,6 +219,14 @@ void WindowDialog::_notification(int p_what) { close_button->set_begin(Point2(-get_constant("close_h_ofs", "WindowDialog"), -get_constant("close_v_ofs", "WindowDialog"))); } break; + case NOTIFICATION_TRANSLATION_CHANGED: { + String new_title = tr(title); + if (title != new_title) { + title = new_title; + update(); + } + } break; + case NOTIFICATION_MOUSE_EXIT: { // Reset the mouse cursor when leaving the resizable window border. if (resizable && !drag_type) { @@ -226,11 +234,13 @@ void WindowDialog::_notification(int p_what) { set_default_cursor_shape(CURSOR_ARROW); } } break; + #ifdef TOOLS_ENABLED case NOTIFICATION_POST_POPUP: { if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton()) EditorNode::get_singleton()->dim_editor(true); } break; + case NOTIFICATION_POPUP_HIDE: { if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton()) EditorNode::get_singleton()->dim_editor(false); @@ -272,8 +282,11 @@ int WindowDialog::_drag_hit_test(const Point2 &pos) const { void WindowDialog::set_title(const String &p_title) { - title = tr(p_title); - update(); + String new_title = tr(p_title); + if (title != new_title) { + title = new_title; + update(); + } } String WindowDialog::get_title() const { @@ -296,8 +309,8 @@ Size2 WindowDialog::get_minimum_size() const { const int padding = button_width / 2; const int button_area = button_width + padding; - // as the title gets centered, title_width + close_button_width is not enough. - // we want a width w, such that w / 2 - title_width / 2 >= button_area, i.e. + // As the title gets centered, title_width + close_button_width is not enough. + // We want a width w, such that w / 2 - title_width / 2 >= button_area, i.e. // w >= 2 * button_area + title_width return Size2(2 * button_area + title_width, 1); @@ -324,7 +337,6 @@ void WindowDialog::_bind_methods() { WindowDialog::WindowDialog() { - //title="Hello!"; drag_type = DRAG_NONE; resizable = false; close_button = memnew(TextureButton); @@ -340,7 +352,6 @@ WindowDialog::~WindowDialog() { 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())); } @@ -362,15 +373,15 @@ void AcceptDialog::_post_popup() { void AcceptDialog::_notification(int p_what) { - if (p_what == NOTIFICATION_MODAL_CLOSE) { - - cancel_pressed(); - } else if (p_what == NOTIFICATION_READY) { - - _update_child_rects(); - } else if (p_what == NOTIFICATION_RESIZED) { + switch (p_what) { + case NOTIFICATION_MODAL_CLOSE: { + cancel_pressed(); + } break; - _update_child_rects(); + case NOTIFICATION_READY: + case NOTIFICATION_RESIZED: { + _update_child_rects(); + } break; } } diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index c1a7f26a85..1a0350ba18 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -37,9 +37,6 @@ #include "scene/gui/panel.h" #include "scene/gui/popup.h" #include "scene/gui/texture_button.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class WindowDialog : public Popup { diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 04fb991f78..0c096f0d97 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -400,14 +400,14 @@ void FileDialog::update_file_list() { TreeItem *root = tree->create_item(); Ref<Texture> folder = get_icon("folder"); + const Color folder_color = get_color("folder_icon_modulate"); List<String> files; List<String> dirs; - bool is_dir; bool is_hidden; String item; - while ((item = dir_access->get_next(&is_dir)) != "") { + while ((item = dir_access->get_next()) != "") { if (item == "." || item == "..") continue; @@ -415,7 +415,7 @@ void FileDialog::update_file_list() { is_hidden = dir_access->current_is_hidden(); if (show_hidden_files || !is_hidden) { - if (!is_dir) + if (!dir_access->current_is_dir()) files.push_back(item); else dirs.push_back(item); @@ -430,6 +430,7 @@ void FileDialog::update_file_list() { TreeItem *ti = tree->create_item(root); ti->set_text(0, dir_name); ti->set_icon(0, folder); + ti->set_icon_color(0, folder_color); Dictionary d; d["name"] = dir_name; @@ -880,14 +881,14 @@ FileDialog::FileDialog() { dir->set_h_size_flags(SIZE_EXPAND_FILL); refresh = memnew(ToolButton); - refresh->set_tooltip(RTR("Refresh")); + refresh->set_tooltip(RTR("Refresh files.")); refresh->connect("pressed", this, "_update_file_list"); hbc->add_child(refresh); show_hidden = memnew(ToolButton); show_hidden->set_toggle_mode(true); show_hidden->set_pressed(is_showing_hidden_files()); - show_hidden->set_tooltip(RTR("Toggle Hidden Files")); + show_hidden->set_tooltip(RTR("Toggle the visibility of hidden files.")); show_hidden->connect("toggled", this, "set_show_hidden_files"); hbc->add_child(show_hidden); diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h index 191af5fef3..4fd6d0d13c 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -38,9 +38,7 @@ #include "scene/gui/option_button.h" #include "scene/gui/tool_button.h" #include "scene/gui/tree.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class FileDialog : public ConfirmationDialog { GDCLASS(FileDialog, ConfirmationDialog); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index f238aeb392..fdffb26cb5 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -776,10 +776,16 @@ void GraphEdit::_top_layer_draw() { _draw_cos_line(top_layer, pos, topos, col, col); } - if (box_selecting) + if (box_selecting) { top_layer->draw_rect( box_selecting_rect, - get_color("accent_color", "Editor") * Color(1, 1, 1, 0.375)); + get_color("box_selection_fill_color", "Editor")); + + top_layer->draw_rect( + box_selecting_rect, + get_color("box_selection_stroke_color", "Editor"), + false); + } } void GraphEdit::set_selected(Node *p_child) { @@ -1030,14 +1036,28 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { } Ref<InputEventKey> k = p_ev; - if (k.is_valid() && k->get_scancode() == KEY_D && k->is_pressed() && k->get_command()) { - emit_signal("duplicate_nodes_request"); - accept_event(); - } - if (k.is_valid() && k->get_scancode() == KEY_DELETE && k->is_pressed()) { - emit_signal("delete_nodes_request"); - accept_event(); + if (k.is_valid()) { + + if (k->get_scancode() == KEY_D && k->is_pressed() && k->get_command()) { + emit_signal("duplicate_nodes_request"); + accept_event(); + } + + if (k->get_scancode() == KEY_C && k->is_pressed() && k->get_command()) { + emit_signal("copy_nodes_request"); + accept_event(); + } + + if (k->get_scancode() == KEY_V && k->is_pressed() && k->get_command()) { + emit_signal("paste_nodes_request"); + accept_event(); + } + + if (k->get_scancode() == KEY_DELETE && k->is_pressed()) { + emit_signal("delete_nodes_request"); + accept_event(); + } } Ref<InputEventMagnifyGesture> magnify_gesture = p_ev; @@ -1297,6 +1317,8 @@ void GraphEdit::_bind_methods() { ADD_SIGNAL(MethodInfo("disconnection_request", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"))); ADD_SIGNAL(MethodInfo("popup_request", PropertyInfo(Variant::VECTOR2, "position"))); ADD_SIGNAL(MethodInfo("duplicate_nodes_request")); + ADD_SIGNAL(MethodInfo("copy_nodes_request")); + ADD_SIGNAL(MethodInfo("paste_nodes_request")); ADD_SIGNAL(MethodInfo("node_selected", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node"))); ADD_SIGNAL(MethodInfo("connection_to_empty", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); ADD_SIGNAL(MethodInfo("connection_from_empty", PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 6463ee5ad5..f7bef4ed39 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -592,13 +592,14 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) { Ref<InputEventMouseButton> mb = p_ev; if (mb.is_valid()) { - ERR_EXPLAIN("GraphNode must be the child of a GraphEdit node."); - ERR_FAIL_COND(get_parent_control() == NULL); + ERR_FAIL_COND_MSG(get_parent_control() == NULL, "GraphNode must be the child of a GraphEdit node."); if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { Vector2 mpos = Vector2(mb->get_position().x, mb->get_position().y); if (close_rect.size != Size2() && close_rect.has_point(mpos)) { + //send focus to parent + get_parent_control()->grab_focus(); emit_signal("close_request"); accept_event(); return; @@ -615,9 +616,7 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) { return; } - //send focus to parent emit_signal("raise_request"); - get_parent_control()->grab_focus(); } if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { diff --git a/scene/gui/label.h b/scene/gui/label.h index 561c42ef9e..2cc55a47ef 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -32,9 +32,7 @@ #define LABEL_H #include "scene/gui/control.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class Label : public Control { GDCLASS(Label, Control); diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 3dcbf64e7c..4a763844f8 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -59,6 +59,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { menu->set_scale(get_global_transform().get_scale()); menu->popup(); grab_focus(); + accept_event(); return; } @@ -999,6 +1000,8 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { Ref<StyleBox> style = get_stylebox("normal"); int pixel_ofs = 0; Size2 size = get_size(); + bool display_clear_icon = !text.empty() && is_editable() && clear_button_enabled; + int r_icon_width = Control::get_icon("clear")->get_width(); switch (align) { @@ -1013,10 +1016,16 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { pixel_ofs = int(style->get_offset().x); else pixel_ofs = int(size.width - (cached_width)) / 2; + + if (display_clear_icon) + pixel_ofs -= int(r_icon_width / 2 + style->get_margin(MARGIN_RIGHT)); } break; case ALIGN_RIGHT: { pixel_ofs = int(size.width - style->get_margin(MARGIN_RIGHT) - (cached_width)); + + if (display_clear_icon) + pixel_ofs -= int(r_icon_width + style->get_margin(MARGIN_RIGHT)); } break; } @@ -1359,18 +1368,28 @@ void LineEdit::set_editable(bool p_editable) { // Reorganize context menu. menu->clear(); - if (editable) + + if (editable) { + menu->add_item(RTR("Undo"), MENU_UNDO, KEY_MASK_CMD | KEY_Z); + menu->add_item(RTR("Redo"), MENU_REDO, KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Z); + } + + if (editable) { + menu->add_separator(); menu->add_item(RTR("Cut"), MENU_CUT, KEY_MASK_CMD | KEY_X); + } + menu->add_item(RTR("Copy"), MENU_COPY, KEY_MASK_CMD | KEY_C); - if (editable) + + if (editable) { menu->add_item(RTR("Paste"), MENU_PASTE, KEY_MASK_CMD | KEY_V); + } + menu->add_separator(); menu->add_item(RTR("Select All"), MENU_SELECT_ALL, KEY_MASK_CMD | KEY_A); + if (editable) { menu->add_item(RTR("Clear"), MENU_CLEAR); - menu->add_separator(); - menu->add_item(RTR("Undo"), MENU_UNDO, KEY_MASK_CMD | KEY_Z); - menu->add_item(RTR("Redo"), MENU_REDO, KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Z); } update(); @@ -1396,8 +1415,7 @@ void LineEdit::set_secret_character(const String &p_string) { // An empty string as the secret character would crash the engine // It also wouldn't make sense to use multiple characters as the secret character - ERR_EXPLAIN("Secret character must be exactly one character long (" + itos(p_string.length()) + " characters given)"); - ERR_FAIL_COND(p_string.length() != 1); + ERR_FAIL_COND_MSG(p_string.length() != 1, "Secret character must be exactly one character long (" + itos(p_string.length()) + " characters given)."); secret_character = p_string; update(); diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index 3002f6f637..1d33f7d4ce 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -34,9 +34,6 @@ #include "scene/gui/control.h" #include "scene/gui/popup_menu.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class LineEdit : public Control { GDCLASS(LineEdit, Control); diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h index 42e909d991..5448ff13f2 100644 --- a/scene/gui/menu_button.h +++ b/scene/gui/menu_button.h @@ -33,9 +33,7 @@ #include "scene/gui/button.h" #include "scene/gui/popup_menu.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class MenuButton : public Button { GDCLASS(MenuButton, Button); diff --git a/scene/gui/nine_patch_rect.h b/scene/gui/nine_patch_rect.h index ac17e52fc1..f31a09a482 100644 --- a/scene/gui/nine_patch_rect.h +++ b/scene/gui/nine_patch_rect.h @@ -32,9 +32,7 @@ #define NINE_PATCH_RECT_H #include "scene/gui/control.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class NinePatchRect : public Control { GDCLASS(NinePatchRect, Control); diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 58671655dc..d1840e43a3 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -43,40 +43,42 @@ Size2 OptionButton::get_minimum_size() const { void OptionButton::_notification(int p_what) { - if (p_what == NOTIFICATION_DRAW) { - - if (!has_icon("arrow")) - return; - - RID ci = get_canvas_item(); - Ref<Texture> arrow = Control::get_icon("arrow"); - Ref<StyleBox> normal = get_stylebox("normal"); - Color clr = Color(1, 1, 1); - if (get_constant("modulate_arrow")) { - switch (get_draw_mode()) { - case DRAW_PRESSED: - clr = get_color("font_color_pressed"); - break; - case DRAW_HOVER: - clr = get_color("font_color_hover"); - break; - case DRAW_DISABLED: - clr = get_color("font_color_disabled"); - break; - default: - clr = get_color("font_color"); + switch (p_what) { + case NOTIFICATION_DRAW: { + + if (!has_icon("arrow")) + return; + + RID ci = get_canvas_item(); + Ref<Texture> arrow = Control::get_icon("arrow"); + Color clr = Color(1, 1, 1); + if (get_constant("modulate_arrow")) { + switch (get_draw_mode()) { + case DRAW_PRESSED: + clr = get_color("font_color_pressed"); + break; + case DRAW_HOVER: + clr = get_color("font_color_hover"); + break; + case DRAW_DISABLED: + clr = get_color("font_color_disabled"); + break; + default: + clr = get_color("font_color"); + } } - } - Size2 size = get_size(); + Size2 size = get_size(); - Point2 ofs(size.width - arrow->get_width() - get_constant("arrow_margin"), int(Math::abs((size.height - arrow->get_height()) / 2))); - arrow->draw(ci, ofs, clr); - } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + Point2 ofs(size.width - arrow->get_width() - get_constant("arrow_margin"), int(Math::abs((size.height - arrow->get_height()) / 2))); + arrow->draw(ci, ofs, clr); + } break; + case NOTIFICATION_VISIBILITY_CHANGED: { - if (!is_visible_in_tree()) { - popup->hide(); - } + if (!is_visible_in_tree()) { + popup->hide(); + } + } break; } } diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h index 51d5fd6947..7210708042 100644 --- a/scene/gui/option_button.h +++ b/scene/gui/option_button.h @@ -33,9 +33,7 @@ #include "scene/gui/button.h" #include "scene/gui/popup_menu.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class OptionButton : public Button { GDCLASS(OptionButton, Button); diff --git a/scene/gui/panel.h b/scene/gui/panel.h index f8d15e4261..84bf6e75f5 100644 --- a/scene/gui/panel.h +++ b/scene/gui/panel.h @@ -32,9 +32,7 @@ #define PANEL_H #include "scene/gui/control.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class Panel : public Control { GDCLASS(Panel, Control); diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 3e003af396..32380b6457 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -74,7 +74,7 @@ void Popup::_fix_size() { Point2 pos = get_global_position(); Size2 size = get_size() * get_scale(); - Point2 window_size = get_viewport_rect().size; + Point2 window_size = get_viewport_rect().size - get_viewport_transform().get_origin(); if (pos.x + size.width > window_size.width) pos.x = window_size.width - size.width; @@ -207,6 +207,7 @@ bool Popup::is_exclusive() const { void Popup::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_as_minsize"), &Popup::set_as_minsize); ClassDB::bind_method(D_METHOD("popup_centered", "size"), &Popup::popup_centered, DEFVAL(Size2())); ClassDB::bind_method(D_METHOD("popup_centered_ratio", "ratio"), &Popup::popup_centered_ratio, DEFVAL(0.75)); ClassDB::bind_method(D_METHOD("popup_centered_minsize", "minsize"), &Popup::popup_centered_minsize, DEFVAL(Size2())); diff --git a/scene/gui/popup.h b/scene/gui/popup.h index d6d96dfe64..925760984e 100644 --- a/scene/gui/popup.h +++ b/scene/gui/popup.h @@ -33,9 +33,6 @@ #include "scene/gui/control.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Popup : public Control { GDCLASS(Popup, Control); diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 2cac345dae..a7c6c5ccab 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -148,11 +148,9 @@ int PopupMenu::_get_mouse_over(const Point2 &p_over) const { void PopupMenu::_activate_submenu(int over) { Node *n = get_node(items[over].submenu); - ERR_EXPLAIN("Item subnode does not exist: " + items[over].submenu); - ERR_FAIL_COND(!n); + ERR_FAIL_COND_MSG(!n, "Item subnode does not exist: " + items[over].submenu + "."); Popup *pm = Object::cast_to<Popup>(n); - ERR_EXPLAIN("Item subnode is not a Popup: " + items[over].submenu); - ERR_FAIL_COND(!pm); + ERR_FAIL_COND_MSG(!pm, "Item subnode is not a Popup: " + items[over].submenu + "."); if (pm->is_visible_in_tree()) return; //already visible! diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index babdd21281..8bfe8fc607 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -33,10 +33,6 @@ #include "scene/gui/popup.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class PopupMenu : public Popup { GDCLASS(PopupMenu, Popup); diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index 264eda4035..0154a452ad 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -60,7 +60,7 @@ void ProgressBar::_notification(int p_what) { draw_style_box(bg, Rect2(Point2(), get_size())); float r = get_as_ratio(); int mp = fg->get_minimum_size().width; - int p = r * get_size().width - mp; + int p = r * (get_size().width - mp); if (p > 0) { draw_style_box(fg, Rect2(Point2(), Size2(p + fg->get_minimum_size().width, get_size().height))); diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index e709bac377..ed5dd77f53 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -180,12 +180,12 @@ double Range::get_as_ratio() const { float value = CLAMP(get_value(), shared->min, shared->max); double v = Math::log(value) / Math::log((double)2); - return (v - exp_min) / (exp_max - exp_min); + return CLAMP((v - exp_min) / (exp_max - exp_min), 0, 1); } else { float value = CLAMP(get_value(), shared->min, shared->max); - return (value - get_min()) / (get_max() - get_min()); + return CLAMP((value - get_min()) / (get_max() - get_min()), 0, 1); } } diff --git a/scene/gui/range.h b/scene/gui/range.h index cf0add8c89..8ce450f8fc 100644 --- a/scene/gui/range.h +++ b/scene/gui/range.h @@ -32,9 +32,7 @@ #define RANGE_H #include "scene/gui/control.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class Range : public Control { GDCLASS(Range, Control); diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index d6c0981ebc..8223ea6d1e 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -821,11 +821,7 @@ void RichTextLabel::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - if (is_inside_tree() && use_bbcode) { - parse_bbcode(bbcode); - //first_invalid_line=0; //invalidate ALL - //update(); - } + update(); } break; case NOTIFICATION_DRAW: { diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index 5ceabfc06b..cbcee1dae3 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -33,10 +33,6 @@ #include "scene/gui/range.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class ScrollBar : public Range { GDCLASS(ScrollBar, Range); diff --git a/scene/gui/separator.h b/scene/gui/separator.h index 54ad9b5bb5..89039f3112 100644 --- a/scene/gui/separator.h +++ b/scene/gui/separator.h @@ -31,10 +31,6 @@ #ifndef SEPARATOR_H #define SEPARATOR_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - #include "scene/gui/control.h" class Separator : public Control { diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 279253889c..6ada0cba97 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -40,7 +40,7 @@ Size2 SpinBox::get_minimum_size() const { void SpinBox::_value_changed(double) { - String value = String::num(get_value(), Math::step_decimals(get_step())); + String value = String::num(get_value(), Math::range_step_decimals(get_step())); if (prefix != "") value = prefix + " " + value; if (suffix != "") @@ -170,6 +170,10 @@ void SpinBox::_gui_input(const Ref<InputEvent> &p_event) { void SpinBox::_line_edit_focus_exit() { + // discontinue because the focus_exit was caused by right-click context menu + if (line_edit->get_menu()->is_visible()) + return; + _text_entered(line_edit->get_text()); } diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 39c76e6646..be8f1cf36e 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -303,7 +303,7 @@ void TabContainer::_notification(int p_what) { // Draw the tab contents. Control *control = Object::cast_to<Control>(tabs[i + first_tab_cache]); - String text = control->has_meta("_tab_name") ? String(tr(String(control->get_meta("_tab_name")))) : String(control->get_name()); + String text = control->has_meta("_tab_name") ? String(tr(String(control->get_meta("_tab_name")))) : String(tr(control->get_name())); int x_content = tab_rect.position.x + tab_style->get_margin(MARGIN_LEFT); int top_margin = tab_style->get_margin(MARGIN_TOP); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ff0c723141..f8c31121be 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -129,7 +129,7 @@ void TextEdit::Text::_update_line_cache(int p_line) const { int len = text[p_line].data.length(); const CharType *str = text[p_line].data.c_str(); - //update width + // Update width. for (int i = 0; i < len; i++) { w += get_char_width(str[i], str[i + 1], w); @@ -139,7 +139,7 @@ void TextEdit::Text::_update_line_cache(int p_line) const { text.write[p_line].wrap_amount_cache = -1; - //update regions + // Update regions. text.write[p_line].region_info.clear(); @@ -148,7 +148,7 @@ void TextEdit::Text::_update_line_cache(int p_line) const { if (!_is_symbol(str[i])) continue; if (str[i] == '\\') { - i++; //skip quoted anything + i++; // Skip quoted anything. continue; } @@ -275,7 +275,7 @@ void TextEdit::Text::clear() { } int TextEdit::Text::get_max_width(bool p_exclude_hidden) const { - //quite some work.. but should be fast enough. + // Quite some work, but should be fast enough. int max = 0; for (int i = 0; i < text.size(); i++) { @@ -323,7 +323,7 @@ int TextEdit::Text::get_char_width(CharType c, CharType next_c, int px) const { if (left == 0) w = tab_w; else - w = tab_w - px % tab_w; // is right... + w = tab_w - px % tab_w; // Is right. } else { w = font->get_char_size(c, next_c).width; @@ -367,23 +367,25 @@ void TextEdit::_update_scrollbars() { total_width += cache.fold_gutter_width; } + if (draw_minimap) { + total_width += cache.minimap_width; + } + bool use_hscroll = true; bool use_vscroll = true; + // Thanks yessopie for this clever bit of logic. if (total_rows <= visible_rows && total_width <= visible_width) { - //thanks yessopie for this clever bit of logic + use_hscroll = false; use_vscroll = false; - } else { if (total_rows > visible_rows && total_width <= visible_width) { - //thanks yessopie for this clever bit of logic use_hscroll = false; } if (total_rows <= visible_rows && total_width > visible_width) { - //thanks yessopie for this clever bit of logic use_vscroll = false; } } @@ -459,6 +461,7 @@ void TextEdit::_click_selection_held() { } void TextEdit::_update_selection_mode_pointer() { + dragging_selection = true; Point2 mp = get_local_mouse_position(); int row, col; @@ -474,6 +477,7 @@ void TextEdit::_update_selection_mode_pointer() { } void TextEdit::_update_selection_mode_word() { + dragging_selection = true; Point2 mp = get_local_mouse_position(); int row, col; @@ -481,7 +485,7 @@ void TextEdit::_update_selection_mode_word() { String line = text[row]; int beg = CLAMP(col, 0, line.length()); - // if its the first selection and on whitespace make sure we grab the word instead.. + // If its the first selection and on whitespace make sure we grab the word instead. if (!selection.active) { while (beg > 0 && line[beg] <= 32) { beg--; @@ -490,7 +494,7 @@ void TextEdit::_update_selection_mode_word() { int end = beg; bool symbol = beg < line.length() && _is_symbol(line[beg]); - // get the word end and begin points + // Get the word end and begin points. while (beg > 0 && line[beg - 1] > 32 && (symbol == _is_symbol(line[beg - 1]))) { beg--; } @@ -501,7 +505,7 @@ void TextEdit::_update_selection_mode_word() { end += 1; } - // initial selection + // Initial selection. if (!selection.active) { select(row, beg, row, end); selection.selecting_column = beg; @@ -530,6 +534,7 @@ void TextEdit::_update_selection_mode_word() { } void TextEdit::_update_selection_mode_line() { + dragging_selection = true; Point2 mp = get_local_mouse_position(); int row, col; @@ -537,11 +542,11 @@ void TextEdit::_update_selection_mode_line() { col = 0; if (row < selection.selecting_line) { - // cursor is above us + // Cursor is above us. cursor_set_line(row - 1, false); selection.selecting_column = text[selection.selecting_line].length(); } else { - // cursor is below us + // Cursor is below us. cursor_set_line(row + 1, false); selection.selecting_column = 0; col = text[row].length(); @@ -554,6 +559,30 @@ void TextEdit::_update_selection_mode_line() { click_select_held->start(); } +void TextEdit::_update_minimap_scroll() { + Point2 mp = get_local_mouse_position(); + + int xmargin_end = get_size().width - cache.style_normal->get_margin(MARGIN_RIGHT); + if (!dragging_minimap && (mp.x < xmargin_end - minimap_width || mp.y > xmargin_end)) { + minimap_clicked = false; + return; + } + minimap_clicked = true; + dragging_minimap = true; + + int row; + _get_minimap_mouse_row(Point2i(mp.x, mp.y), row); + + int wi; + int first_line = row - num_lines_from_rows(row, 0, -get_visible_rows() / 2, wi) + 1; + double delta = get_scroll_pos_for_line(first_line, wi) - get_v_scroll(); + if (delta < 0) { + _scroll_up(-delta); + } else { + _scroll_down(delta); + } +} + void TextEdit::_notification(int p_what) { switch (p_what) { @@ -575,6 +604,7 @@ void TextEdit::_notification(int p_what) { _update_caches(); _update_wrap_at(); + syntax_highlighting_cache.clear(); } break; case MainLoop::NOTIFICATION_WM_FOCUS_IN: { window_has_focus = true; @@ -590,24 +620,26 @@ void TextEdit::_notification(int p_what) { if (scrolling && get_v_scroll() != target_v_scroll) { double target_y = target_v_scroll - get_v_scroll(); double dist = sqrt(target_y * target_y); - double vel = ((target_y / dist) * v_scroll_speed) * get_physics_process_delta_time(); + // To ensure minimap is responsive overide the speed setting. + double vel = ((target_y / dist) * ((minimap_clicked) ? 3000 : v_scroll_speed)) * get_physics_process_delta_time(); if (Math::abs(vel) >= dist) { set_v_scroll(target_v_scroll); scrolling = false; + minimap_clicked = false; set_physics_process_internal(false); } else { set_v_scroll(get_v_scroll() + vel); } } else { scrolling = false; + minimap_clicked = false; set_physics_process_internal(false); } } break; case NOTIFICATION_DRAW: { - if (first_draw) { - //size may not be the final one, so attempts to ensure cursor was visible may have failed + // Size may not be the final one, so attempts to ensure cursor was visible may have failed. adjust_viewport_to_cursor(); first_draw = false; } @@ -637,6 +669,11 @@ void TextEdit::_notification(int p_what) { cache.fold_gutter_width = 0; } + cache.minimap_width = 0; + if (draw_minimap) { + cache.minimap_width = minimap_width; + } + int line_number_char_count = 0; { @@ -660,8 +697,9 @@ void TextEdit::_notification(int p_what) { RID ci = get_canvas_item(); VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), true); int xmargin_beg = cache.style_normal->get_margin(MARGIN_LEFT) + cache.line_number_w + cache.breakpoint_gutter_width + cache.fold_gutter_width + cache.info_gutter_width; - int xmargin_end = size.width - cache.style_normal->get_margin(MARGIN_RIGHT); - //let's do it easy for now: + + int xmargin_end = size.width - cache.style_normal->get_margin(MARGIN_RIGHT) - cache.minimap_width; + // Let's do it easy for now. cache.style_normal->draw(ci, Rect2(Point2(), size)); if (readonly) { cache.style_readonly->draw(ci, Rect2(Point2(), size)); @@ -701,7 +739,7 @@ void TextEdit::_notification(int p_what) { if (brace_matching_enabled && cursor.line >= 0 && cursor.line < text.size() && cursor.column >= 0) { if (cursor.column < text[cursor.line].length()) { - //check for open + // Check for open. CharType c = text[cursor.line][cursor.column]; CharType closec = 0; @@ -723,7 +761,7 @@ void TextEdit::_notification(int p_what) { for (int j = from; j < text[i].length(); j++) { CharType cc = text[i][j]; - //ignore any brackets inside a string + // Ignore any brackets inside a string. if (cc == '"' || cc == '\'') { CharType quotation = cc; do { @@ -732,7 +770,7 @@ void TextEdit::_notification(int p_what) { break; } cc = text[i][j]; - //skip over escaped quotation marks inside strings + // Skip over escaped quotation marks inside strings. if (cc == '\\') { bool escaped = true; while (j + 1 < text[i].length() && text[i][j + 1] == '\\') { @@ -789,7 +827,7 @@ void TextEdit::_notification(int p_what) { for (int j = from; j >= 0; j--) { CharType cc = text[i][j]; - //ignore any brackets inside a string + // Ignore any brackets inside a string. if (cc == '"' || cc == '\'') { CharType quotation = cc; do { @@ -798,7 +836,7 @@ void TextEdit::_notification(int p_what) { break; } cc = text[i][j]; - //skip over escaped quotation marks inside strings + // Skip over escaped quotation marks inside strings. if (cc == quotation) { bool escaped = false; while (j - 1 >= 0 && text[i][j - 1] == '\\') { @@ -837,10 +875,10 @@ void TextEdit::_notification(int p_what) { Point2 cursor_pos; int cursor_insert_offset_y = 0; - // get the highlighted words + // Get the highlighted words. String highlighted_text = get_selection_text(); - // check if highlighted words contains only whitespaces (tabs or spaces) + // Check if highlighted words contains only whitespaces (tabs or spaces). bool only_whitespaces_highlighted = highlighted_text.strip_edges() == String(); String line_num_padding = line_numbers_zero_padded ? "0" : " "; @@ -849,9 +887,162 @@ void TextEdit::_notification(int p_what) { FontDrawer drawer(cache.font, Color(1, 1, 1)); - int line = get_first_visible_line() - 1; + int first_visible_line = get_first_visible_line() - 1; int draw_amount = visible_rows + (smooth_scroll_enabled ? 1 : 0); - draw_amount += times_line_wraps(line + 1); + draw_amount += times_line_wraps(first_visible_line + 1); + + // minimap + if (draw_minimap) { + int minimap_visible_lines = _get_minimap_visible_rows(); + int minimap_line_height = (minimap_char_size.y + minimap_line_spacing); + int minimap_tab_size = minimap_char_size.x * indent_size; + + // calculate viewport size and y offset + int viewport_height = (draw_amount - 1) * minimap_line_height; + int control_height = size.height; + control_height -= cache.style_normal->get_minimum_size().height; + if (h_scroll->is_visible_in_tree()) { + control_height -= h_scroll->get_size().height; + } + control_height -= viewport_height; + int viewport_offset_y = round(get_scroll_pos_for_line(first_visible_line) * control_height) / ((v_scroll->get_max() <= minimap_visible_lines) ? (minimap_visible_lines - draw_amount) : (v_scroll->get_max() - draw_amount)); + + // calculate the first line. + int num_lines_before = round((viewport_offset_y) / minimap_line_height); + int wi; + int minimap_line = (v_scroll->get_max() <= minimap_visible_lines) ? -1 : first_visible_line; + if (minimap_line >= 0) { + minimap_line -= num_lines_from_rows(first_visible_line, 0, -num_lines_before, wi); + minimap_line -= (smooth_scroll_enabled ? 1 : 0); + } + int minimap_draw_amount = minimap_visible_lines + times_line_wraps(minimap_line + 1); + + // draw the minimap + Color viewport_color = cache.current_line_color; + viewport_color.a /= 2; + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2((xmargin_end + 2), viewport_offset_y, cache.minimap_width, viewport_height), viewport_color); + for (int i = 0; i < minimap_draw_amount; i++) { + + minimap_line++; + + if (minimap_line < 0 || minimap_line >= (int)text.size()) { + break; + } + + while (is_line_hidden(minimap_line)) { + minimap_line++; + 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); + } + + Color current_color = cache.font_color; + if (readonly) { + current_color = cache.font_color_readonly; + } + + Vector<String> wrap_rows = get_wrap_rows_text(minimap_line); + int line_wrap_amount = times_line_wraps(minimap_line); + int last_wrap_column = 0; + + for (int line_wrap_index = 0; line_wrap_index < line_wrap_amount + 1; line_wrap_index++) { + if (line_wrap_index != 0) { + i++; + if (i >= minimap_draw_amount) + break; + } + + const String &str = wrap_rows[line_wrap_index]; + int indent_px = line_wrap_index != 0 ? get_indent_level(minimap_line) : 0; + if (indent_px >= wrap_at) { + indent_px = 0; + } + indent_px = minimap_char_size.x * indent_px; + + if (line_wrap_index > 0) { + last_wrap_column += wrap_rows[line_wrap_index - 1].length(); + } + + if (minimap_line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) { + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2((xmargin_end + 2), i * 3, cache.minimap_width, 2), cache.current_line_color); + } + + Color previous_color; + int characters = 0; + int tabs = 0; + for (int j = 0; j < str.length(); j++) { + if (syntax_coloring) { + if (color_map.has(last_wrap_column + j)) { + current_color = color_map[last_wrap_column + j].color; + if (readonly) { + current_color.a = cache.font_color_readonly.a; + } + } + color = current_color; + } + + if (j == 0) { + previous_color = color; + } + + int xpos = indent_px + ((xmargin_end + minimap_char_size.x) + (minimap_char_size.x * j)) + tabs; + bool out_of_bounds = (xpos >= xmargin_end + cache.minimap_width); + + bool is_whitespace = _is_whitespace(str[j]); + if (!is_whitespace) { + characters++; + + if (j < str.length() - 1 && color == previous_color && !out_of_bounds) { + continue; + } + + // If we've changed colour we are at the start of a new section, therefore we need to go back to the end + // of the previous section to draw it, we'll also add the character back on. + if (color != previous_color) { + characters--; + j--; + + if (str[j] == '\t') { + tabs -= minimap_tab_size; + } + } + } + + if (characters > 0) { + previous_color.a *= 0.6; + // take one for zero indexing, and if we hit whitespace / the end of a word. + int chars = MAX(0, (j - (characters - 1)) - (is_whitespace ? 1 : 0)) + 1; + int char_x_ofs = indent_px + ((xmargin_end + minimap_char_size.x) + (minimap_char_size.x * chars)) + tabs; + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_x_ofs, minimap_line_height * i), Point2(minimap_char_size.x * characters, minimap_char_size.y)), previous_color); + } + + if (out_of_bounds) { + break; + } + + // re-adjust if we went backwards. + if (color != previous_color && !is_whitespace) { + characters++; + } + + if (str[j] == '\t') { + tabs += minimap_tab_size; + } + + previous_color = color; + characters = 0; + } + } + } + } + + // draw main text + int line = first_visible_line; for (int i = 0; i < draw_amount; i++) { line++; @@ -875,7 +1066,7 @@ void TextEdit::_notification(int p_what) { if (syntax_coloring) { color_map = _get_line_syntax_highlighting(line); } - // ensure we at least use the font color + // Ensure we at least use the font color. Color current_color = readonly ? cache.font_color_readonly : cache.font_color; bool underlined = false; @@ -916,7 +1107,7 @@ void TextEdit::_notification(int p_what) { if (smooth_scroll_enabled) ofs_y += (-get_v_scroll_offset()) * get_row_height(); - // check if line contains highlighted word + // Check if line contains highlighted word. int highlighted_text_col = -1; int search_text_col = -1; int highlighted_word_col = -1; @@ -938,25 +1129,25 @@ void TextEdit::_notification(int p_what) { } if (str.length() == 0) { - // draw line background if empty as we won't loop at at all + // Draw line background if empty as we won't loop at at all. if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(ofs_x, ofs_y, xmargin_end, get_row_height()), cache.current_line_color); } - // give visual indication of empty selected line + // Give visual indication of empty selected line. if (selection.active && line >= selection.from_line && line <= selection.to_line && char_margin >= xmargin_beg) { int char_w = cache.font->get_char_size(' ').width; VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color); } } else { - // if it has text, then draw current line marker in the margin, as line number etc will draw over it, draw the rest of line marker later. + // If it has text, then draw current line marker in the margin, as line number etc will draw over it, draw the rest of line marker later. if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) { - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_beg, get_row_height()), cache.current_line_color); + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_beg + ofs_x, get_row_height()), cache.current_line_color); } } if (line_wrap_index == 0) { - // only do these if we are on the first wrapped part of a line + // Only do these if we are on the first wrapped part of a line. if (text.is_breakpoint(line) && !draw_breakpoint_gutter) { #ifdef TOOLS_ENABLED @@ -966,7 +1157,7 @@ void TextEdit::_notification(int p_what) { #endif } - // draw bookmark marker + // Draw bookmark marker. if (text.is_bookmark(line)) { if (draw_bookmark_gutter) { int vertical_gap = (get_row_height() * 40) / 100; @@ -976,26 +1167,26 @@ void TextEdit::_notification(int p_what) { } } - // draw breakpoint marker + // Draw breakpoint marker. if (text.is_breakpoint(line)) { if (draw_breakpoint_gutter) { int vertical_gap = (get_row_height() * 40) / 100; int horizontal_gap = (cache.breakpoint_gutter_width * 30) / 100; int marker_height = get_row_height() - (vertical_gap * 2); int marker_width = cache.breakpoint_gutter_width - (horizontal_gap * 2); - // no transparency on marker + // No transparency on marker. VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2, ofs_y + vertical_gap, marker_width, marker_height), Color(cache.breakpoint_color.r, cache.breakpoint_color.g, cache.breakpoint_color.b)); } } - // draw info icons + // Draw info icons. if (draw_info_gutter && text.has_info_icon(line)) { int vertical_gap = (get_row_height() * 40) / 100; int horizontal_gap = (cache.info_gutter_width * 30) / 100; int gutter_left = cache.style_normal->get_margin(MARGIN_LEFT) + cache.breakpoint_gutter_width; Ref<Texture> info_icon = text.get_info_icon(line); - // ensure the icon fits the gutter size + // Ensure the icon fits the gutter size. Size2i icon_size = info_icon->get_size(); if (icon_size.width > cache.info_gutter_width - horizontal_gap) { icon_size.width = cache.info_gutter_width - horizontal_gap; @@ -1013,7 +1204,7 @@ void TextEdit::_notification(int p_what) { draw_texture_rect(info_icon, Rect2(icon_pos, icon_size)); } - // draw execution marker + // Draw execution marker. if (executing_line == line) { if (draw_breakpoint_gutter) { int icon_extra_size = 4; @@ -1031,7 +1222,7 @@ void TextEdit::_notification(int p_what) { } } - // draw fold markers + // Draw fold markers. if (draw_fold_gutter) { int horizontal_gap = (cache.fold_gutter_width * 30) / 100; int gutter_left = cache.style_normal->get_margin(MARGIN_LEFT) + cache.breakpoint_gutter_width + cache.line_number_w + cache.info_gutter_width; @@ -1046,7 +1237,7 @@ void TextEdit::_notification(int p_what) { } } - // draw line numbers + // Draw line numbers. if (cache.line_number_w) { int yofs = ofs_y + (get_row_height() - cache.font->get_height()) / 2; String fc = String::num(line + 1); @@ -1058,32 +1249,35 @@ void TextEdit::_notification(int p_what) { } } - //loop through characters in one line + // Loop through characters in one line. for (int j = 0; j < str.length(); j++) { if (syntax_coloring) { if (color_map.has(last_wrap_column + j)) { - current_color = readonly ? cache.font_color_readonly : color_map[last_wrap_column + j].color; + current_color = color_map[last_wrap_column + j].color; + if (readonly && current_color.a > cache.font_color_readonly.a) { + current_color.a = cache.font_color_readonly.a; + } } color = current_color; } int char_w; - //handle tabulator + // Handle tabulator. char_w = text.get_char_width(str[j], str[j + 1], char_ofs); if ((char_ofs + char_margin) < xmargin_beg) { char_ofs += char_w; - // line highlighting handle horizontal clipping + // Line highlighting handle horizontal clipping. if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) { if (j == str.length() - 1) { - // end of line when last char is skipped + // End of line when last char is skipped. VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color); } else if ((char_ofs + char_margin) > xmargin_beg) { - // char next to margin is skipped + // Char next to margin is skipped. VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, (char_ofs + char_margin) - (xmargin_beg + ofs_x), get_row_height()), cache.current_line_color); } } @@ -1097,7 +1291,7 @@ void TextEdit::_notification(int p_what) { bool in_search_result = false; if (search_text_col != -1) { - // if we are at the end check for new search result on same line + // If we are at the end check for new search result on same line. if (j >= search_text_col + search_text.length()) search_text_col = _get_column_pos_of_word(search_text, str, search_flags, j); @@ -1108,19 +1302,19 @@ void TextEdit::_notification(int p_what) { } } - //current line highlighting + // Current line highlighting. bool in_selection = (selection.active && line >= selection.from_line && line <= selection.to_line && (line > selection.from_line || last_wrap_column + j >= selection.from_column) && (line < selection.to_line || last_wrap_column + j < selection.to_column)); if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) { - // draw the wrap indent offset highlight + // Draw the wrap indent offset highlight. if (line_wrap_index != 0 && j == 0) { - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin - indent_px, ofs_y, indent_px, get_row_height()), cache.current_line_color); + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + ofs_x - indent_px, ofs_y, indent_px, get_row_height()), cache.current_line_color); } - // if its the last char draw to end of the line + // If its the last char draw to end of the line. if (j == str.length() - 1) { - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + char_w, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color); + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + char_w + ofs_x, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color); } - // actual text + // Actual text. if (!in_selection) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.current_line_color); } @@ -1145,14 +1339,14 @@ void TextEdit::_notification(int p_what) { if (highlight_all_occurrences && !only_whitespaces_highlighted) { if (highlighted_text_col != -1) { - // if we are at the end check for new word on same line + // If we are at the end check for new word on same line. if (j > highlighted_text_col + highlighted_text.length()) { highlighted_text_col = _get_column_pos_of_word(highlighted_text, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, j); } bool in_highlighted_word = (j >= highlighted_text_col && j < highlighted_text_col + highlighted_text.length()); - // if this is the original highlighted text we don't want to highlight it again + // If this is the original highlighted text we don't want to highlight it again. if (cursor.line == line && cursor_wrap_index == line_wrap_index && (cursor.column >= highlighted_text_col && cursor.column <= highlighted_text_col + highlighted_text.length())) { in_highlighted_word = false; } @@ -1349,7 +1543,7 @@ void TextEdit::_notification(int p_what) { bool completion_below = false; if (completion_active) { - // code completion box + // Code completion box. Ref<StyleBox> csb = get_stylebox("completion"); int maxlines = get_constant("completion_lines"); int cmax_width = get_constant("completion_max_width") * cache.font->get_char_size('x').x; @@ -1371,7 +1565,7 @@ void TextEdit::_notification(int p_what) { w = cmax_width; } - // Add space for completion icons + // Add space for completion icons. const int icon_hsep = get_constant("hseparation", "ItemList"); Size2 icon_area_size(get_row_height(), get_row_height()); w += icon_area_size.width + icon_hsep; @@ -1403,7 +1597,7 @@ void TextEdit::_notification(int p_what) { } int line_from = CLAMP(completion_index - lines / 2, 0, completion_options.size() - lines); VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(completion_rect.position.x, completion_rect.position.y + (completion_index - line_from) * get_row_height()), Size2(completion_rect.size.width, get_row_height())), cache.completion_selected_color); - draw_rect(Rect2(completion_rect.position + Vector2(icon_area_size.x + icon_hsep, 0), Size2(nofs, completion_rect.size.height)), cache.completion_existing_color); + draw_rect(Rect2(completion_rect.position + Vector2(icon_area_size.x + icon_hsep, 0), Size2(MIN(nofs, completion_rect.size.width - (icon_area_size.x + icon_hsep)), completion_rect.size.height)), cache.completion_existing_color); for (int i = 0; i < lines; i++) { @@ -1418,7 +1612,7 @@ void TextEdit::_notification(int p_what) { int yofs = (get_row_height() - cache.font->get_height()) / 2; Point2 title_pos(completion_rect.position.x, completion_rect.position.y + i * get_row_height() + cache.font->get_ascent() + yofs); - //draw completion icon if it is valid + // Draw completion icon if it is valid. Ref<Texture> icon = completion_options[l].icon; Rect2 icon_area(completion_rect.position.x, completion_rect.position.y + i * get_row_height(), icon_area_size.width, icon_area_size.height); if (icon.is_valid()) { @@ -1430,11 +1624,11 @@ void TextEdit::_notification(int p_what) { } title_pos.x = icon_area.position.x + icon_area.size.width + icon_hsep; - draw_string(cache.font, title_pos, completion_options[l].display, text_color, completion_rect.size.width); + draw_string(cache.font, title_pos, completion_options[l].display, text_color, completion_rect.size.width - (icon_area_size.x + icon_hsep)); } if (scrollw) { - //draw a small scroll rectangle to show a position in the options + // Draw a small scroll rectangle to show a position in the options. float r = maxlines / (float)completion_options.size(); float o = line_from / (float)completion_options.size(); draw_rect(Rect2(completion_rect.position.x + completion_rect.size.width, completion_rect.position.y + o * completion_rect.size.y, scrollw, completion_rect.size.y * r), scrollc); @@ -1443,7 +1637,7 @@ void TextEdit::_notification(int p_what) { completion_line_ofs = line_from; } - // check to see if the hint should be drawn + // Check to see if the hint should be drawn. bool show_hint = false; if (completion_hint != "") { if (completion_active) { @@ -1520,7 +1714,6 @@ void TextEdit::_notification(int p_what) { OS::get_singleton()->set_ime_active(true); OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos + Point2(0, get_row_height())); } - } break; case NOTIFICATION_FOCUS_ENTER: { @@ -1662,9 +1855,9 @@ void TextEdit::backspace_at_cursor() { _is_pair_left_symbol(text[cursor.line][cursor.column - 1])) { _consume_backspace_for_pair_symbol(prev_line, prev_column); } else { - // handle space indentation + // Handle space indentation. if (cursor.column != 0 && indent_using_spaces) { - // check if there are no other chars before cursor, just indentation + // Check if there are no other chars before cursor, just indentation. bool unindent = true; int i = 0; while (i < cursor.column && i < text[cursor.line].length()) { @@ -1675,10 +1868,9 @@ void TextEdit::backspace_at_cursor() { i++; } - // then we can remove all spaces as a single character. + // Then we can remove all spaces as a single character. if (unindent) { - // we want to remove spaces up to closest indent - // or whole indent if cursor is pointing at it + // We want to remove spaces up to closest indent, or whole indent if cursor is pointing at it. int spaces_to_delete = _calculate_spaces_till_next_left_indent(cursor.column); prev_column = cursor.column - spaces_to_delete; _remove_text(cursor.line, prev_column, cursor.line, cursor.column); @@ -1699,8 +1891,8 @@ void TextEdit::indent_right() { int start_line; int end_line; - // this value informs us by how much we changed selection position by indenting right - // default is 1 for tab indentation + // This value informs us by how much we changed selection position by indenting right. + // Default is 1 for tab indentation. int selection_offset = 1; begin_complex_operation(); @@ -1712,7 +1904,7 @@ void TextEdit::indent_right() { end_line = start_line; } - // ignore if the cursor is not past the first column + // Ignore if the cursor is not past the first column. if (is_selection_active() && get_selection_to_column() == 0) { end_line--; } @@ -1720,10 +1912,10 @@ void TextEdit::indent_right() { for (int i = start_line; i <= end_line; i++) { String line_text = get_line(i); if (indent_using_spaces) { - // we don't really care where selection is - we just need to know indentation level at the beginning of the line + // We don't really care where selection is - we just need to know indentation level at the beginning of the line. int left = _find_first_non_whitespace_column_of_line(line_text); int spaces_to_add = _calculate_spaces_till_next_right_indent(left); - // since we will add this much spaces we want move whole selection and cursor by this much + // Since we will add this much spaces we want move whole selection and cursor by this much. selection_offset = spaces_to_add; for (int j = 0; j < spaces_to_add; j++) line_text = ' ' + line_text; @@ -1733,7 +1925,7 @@ void TextEdit::indent_right() { set_line(i, line_text); } - // fix selection and cursor being off after shifting selection right + // Fix selection and cursor being off after shifting selection right. if (is_selection_active()) { select(selection.from_line, selection.from_column + selection_offset, selection.to_line, selection.to_column + selection_offset); } @@ -1747,10 +1939,9 @@ void TextEdit::indent_left() { int start_line; int end_line; - // moving cursor and selection after unindenting can get tricky - // because changing content of line can move cursor and selection on it's own (if new line ends before previous position of either) - // therefore we just remember initial values - // and at the end of the operation offset them by number of removed characters + // Moving cursor and selection after unindenting can get tricky because + // changing content of line can move cursor and selection on it's own (if new line ends before previous position of either), + // therefore we just remember initial values and at the end of the operation offset them by number of removed characters. int removed_characters = 0; int initial_selection_end_column = selection.to_column; int initial_cursor_column = cursor.column; @@ -1765,7 +1956,7 @@ void TextEdit::indent_left() { end_line = start_line; } - // ignore if the cursor is not past the first column + // Ignore if the cursor is not past the first column. if (is_selection_active() && get_selection_to_column() == 0) { end_line--; } @@ -1779,12 +1970,12 @@ void TextEdit::indent_left() { set_line(i, line_text); removed_characters = 1; } else if (line_text.begins_with(" ")) { - // when unindenting we aim to remove spaces before line that has selection no matter what is selected + // When unindenting we aim to remove spaces before line that has selection no matter what is selected, // so we start of by finding first non whitespace character of line int left = _find_first_non_whitespace_column_of_line(line_text); - // here we remove only enough spaces to align text to nearest full multiple of indentation_size - // in case where selection begins at the start of indentation_size multiple we remove whole indentation level + // Here we remove only enough spaces to align text to nearest full multiple of indentation_size. + // In case where selection begins at the start of indentation_size multiple we remove whole indentation level. int spaces_to_remove = _calculate_spaces_till_next_left_indent(left); line_text = line_text.substr(spaces_to_remove, line_text.length()); @@ -1793,7 +1984,7 @@ void TextEdit::indent_left() { } } - // fix selection and cursor being off by one on the last line + // Fix selection and cursor being off by one on the last line. if (is_selection_active() && last_line_text != get_line(end_line)) { select(selection.from_line, selection.from_column - removed_characters, selection.to_line, initial_selection_end_column - removed_characters); @@ -1834,7 +2025,7 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co } if (row < 0) - row = 0; //todo + row = 0; // TODO. int col = 0; @@ -1848,7 +2039,7 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co colx += cursor.x_ofs; col = get_char_pos_for_line(colx, row, wrap_index); if (is_wrap_enabled() && wrap_index < times_line_wraps(row)) { - // move back one if we are at the end of the row + // Move back one if we are at the end of the row. Vector<String> rows2 = get_wrap_rows_text(row); int row_end_col = 0; for (int i = 0; i < wrap_index + 1; i++) { @@ -1863,6 +2054,66 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co r_col = col; } +void TextEdit::_get_minimap_mouse_row(const Point2i &p_mouse, int &r_row) const { + + float rows = p_mouse.y; + rows -= cache.style_normal->get_margin(MARGIN_TOP); + rows /= (minimap_char_size.y + minimap_line_spacing); + rows += get_v_scroll_offset(); + + // calculate visible lines + int minimap_visible_lines = _get_minimap_visible_rows(); + int visible_rows = get_visible_rows() + 1; + int first_visible_line = get_first_visible_line() - 1; + int draw_amount = visible_rows + (smooth_scroll_enabled ? 1 : 0); + draw_amount += times_line_wraps(first_visible_line + 1); + int minimap_line_height = (minimap_char_size.y + minimap_line_spacing); + + // calculate viewport size and y offset + int viewport_height = (draw_amount - 1) * minimap_line_height; + int control_height = get_size().height; + control_height -= cache.style_normal->get_minimum_size().height; + if (h_scroll->is_visible_in_tree()) { + control_height -= h_scroll->get_size().height; + } + control_height -= viewport_height; + int viewport_offset_y = round(get_scroll_pos_for_line(first_visible_line) * control_height) / ((v_scroll->get_max() <= minimap_visible_lines) ? (minimap_visible_lines - draw_amount) : (v_scroll->get_max() - draw_amount)); + + // calculate the first line. + int num_lines_before = round((viewport_offset_y) / minimap_line_height); + int wi; + int minimap_line = (v_scroll->get_max() <= minimap_visible_lines) ? -1 : first_visible_line; + if (first_visible_line > 0 && minimap_line >= 0) { + minimap_line -= num_lines_from_rows(first_visible_line, 0, -num_lines_before, wi); + minimap_line -= (smooth_scroll_enabled ? 1 : 0); + } else { + minimap_line = 0; + } + + int row = minimap_line + Math::floor(rows); + int wrap_index = 0; + + if (is_wrap_enabled() || is_hiding_enabled()) { + + int f_ofs = num_lines_from_rows(minimap_line, cursor.wrap_ofs, rows + (1 * SGN(rows)), wrap_index) - 1; + if (rows < 0) { + row = minimap_line - f_ofs; + } else { + row = minimap_line + f_ofs; + } + } + + if (row < 0) { + row = 0; + } + + if (row >= text.size()) { + row = text.size() - 1; + } + + r_row = row; +} + void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { double prev_v_scroll = v_scroll->get_value(); @@ -1942,7 +2193,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { return; } - // toggle breakpoint on gutter click + // Toggle breakpoint on gutter click. if (draw_breakpoint_gutter) { int gutter = cache.style_normal->get_margin(MARGIN_LEFT); if (mb->get_position().x > gutter - 6 && mb->get_position().x <= gutter + cache.breakpoint_gutter_width - 3) { @@ -1952,7 +2203,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } } - // emit info clicked + // Emit info clicked. if (draw_info_gutter && text.has_info_icon(row)) { int left_margin = cache.style_normal->get_margin(MARGIN_LEFT); int gutter_left = left_margin + cache.breakpoint_gutter_width; @@ -1962,7 +2213,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } } - // toggle fold on gutter click if can + // Toggle fold on gutter click if can. if (draw_fold_gutter) { int left_margin = cache.style_normal->get_margin(MARGIN_LEFT); @@ -1977,7 +2228,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } } - // unfold on folded icon click + // Unfold on folded icon click. if (is_folded(row)) { int line_width = text.get_line_width(row); line_width += cache.style_normal->get_margin(MARGIN_LEFT) + cache.line_number_w + cache.breakpoint_gutter_width + cache.info_gutter_width + cache.fold_gutter_width - cursor.x_ofs; @@ -1987,6 +2238,14 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } } + // minimap + if (draw_minimap) { + _update_minimap_scroll(); + if (dragging_minimap) { + return; + } + } + int prev_col = cursor.column; int prev_line = cursor.line; @@ -2044,9 +2303,6 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } else { - //if sel active and dblick last time < something - - //else selection.active = false; selection.selecting_mode = Selection::MODE_POINTER; selection.selecting_line = row; @@ -2054,14 +2310,14 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } if (!mb->is_doubleclick() && (OS::get_singleton()->get_ticks_msec() - last_dblclk) < 600 && cursor.line == prev_line) { - //tripleclick select line + + // Triple-click select line. selection.selecting_mode = Selection::MODE_LINE; _update_selection_mode_line(); last_dblclk = 0; - } else if (mb->is_doubleclick() && text[cursor.line].length()) { - //doubleclick select word + // Double-click select word. selection.selecting_mode = Selection::MODE_WORD; _update_selection_mode_word(); last_dblclk = OS::get_singleton()->get_ticks_msec(); @@ -2086,7 +2342,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { int to_column = get_selection_to_column(); if (row < from_line || row > to_line || (row == from_line && col < from_column) || (row == to_line && col > to_column)) { - // Right click is outside the selected text + // Right click is outside the selected text. deselect(); } } @@ -2104,10 +2360,13 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } } else { - if (mb->get_button_index() == BUTTON_LEFT) + if (mb->get_button_index() == BUTTON_LEFT) { + dragging_minimap = false; + dragging_selection = false; click_select_held->stop(); + } - // notify to show soft keyboard + // Notify to show soft keyboard. notification(NOTIFICATION_FOCUS_ENTER); } } @@ -2123,7 +2382,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } h_scroll->set_value(h_scroll->get_value() + pan_gesture->get_delta().x * 100); if (v_scroll->get_value() != prev_v_scroll || h_scroll->get_value() != prev_h_scroll) - accept_event(); //accept event if scroll changed + accept_event(); // Accept event if scroll changed. return; } @@ -2148,34 +2407,40 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } } - if (mm->get_button_mask() & BUTTON_MASK_LEFT && get_viewport()->gui_get_drag_data() == Variant()) { //ignore if dragging + if (mm->get_button_mask() & BUTTON_MASK_LEFT && get_viewport()->gui_get_drag_data() == Variant()) { // Ignore if dragging. _reset_caret_blink_timer(); - switch (selection.selecting_mode) { - case Selection::MODE_POINTER: { - _update_selection_mode_pointer(); - } break; - case Selection::MODE_WORD: { - _update_selection_mode_word(); - } break; - case Selection::MODE_LINE: { - _update_selection_mode_line(); - } break; - default: { - break; + if (draw_minimap && !dragging_selection) { + _update_minimap_scroll(); + } + + if (!dragging_minimap) { + switch (selection.selecting_mode) { + case Selection::MODE_POINTER: { + _update_selection_mode_pointer(); + } break; + case Selection::MODE_WORD: { + _update_selection_mode_word(); + } break; + case Selection::MODE_LINE: { + _update_selection_mode_line(); + } break; + default: { + break; + } } } } } if (v_scroll->get_value() != prev_v_scroll || h_scroll->get_value() != prev_h_scroll) - accept_event(); //accept event if scroll changed + accept_event(); // Accept event if scroll changed. Ref<InputEventKey> k = p_gui_input; if (k.is_valid()) { - k = k->duplicate(); //it will be modified later on + k = k->duplicate(); // It will be modified later on. #ifdef OSX_ENABLED if (k->get_scancode() == KEY_META) { @@ -2311,11 +2576,11 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { _consume_pair_symbol(chr[0]); } else { - // remove the old character if in insert mode + // Remove the old character if in insert mode. if (insert_mode) { begin_complex_operation(); - // make sure we don't try and remove empty space + // Make sure we don't try and remove empty space. if (cursor.column < get_line(cursor.line).length()) { _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); } @@ -2337,9 +2602,9 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { _cancel_completion(); } - /* TEST CONTROL FIRST!! */ + /* TEST CONTROL FIRST! */ - // some remaps for duplicate functions.. + // Some remaps for duplicate functions. if (k->get_command() && !k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_scancode() == KEY_INSERT) { k->set_scancode(KEY_C); @@ -2383,10 +2648,10 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { _reset_caret_blink_timer(); - // save here for insert mode, just in case it is cleared in the following section + // Save here for insert mode, just in case it is cleared in the following section. bool had_selection = selection.active; - // stuff to do when selection is active.. + // Stuff to do when selection is active. if (!readonly && selection.active) { bool clear = false; @@ -2406,7 +2671,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } break; case KEY_X: case KEY_C: - //special keys often used with control, wait... + // Special keys often used with control, wait. clear = (!k->get_command() || k->get_shift() || k->get_alt()); break; case KEY_DELETE: @@ -2431,7 +2696,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { case KEY_PAGEDOWN: case KEY_HOME: case KEY_END: - // ignore arrows if any modifiers are held (shift = selecting, others may be used for editor hotkeys) + // Ignore arrows if any modifiers are held (shift = selecting, others may be used for editor hotkeys). if (k->get_command() || k->get_shift() || k->get_alt()) break; unselect = true; @@ -2469,7 +2734,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { bool scancode_handled = true; - // special scancode test... + // Special scancode test. switch (k->get_scancode()) { @@ -2481,7 +2746,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { String ins = "\n"; - //keep indentation + // Keep indentation. int space_count = 0; for (int i = 0; i < cursor.column; i++) { if (text[cursor.line][i] == '\t') { @@ -2512,10 +2777,10 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { bool brace_indent = false; - // no need to indent if we are going upwards. + // 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 - // (i.e. colon/brace precedes current cursor position) + // Indent once again if previous line will end with ':' or '{' 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; @@ -2523,7 +2788,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { ins += "\t"; } - // no need to move the brace below if we are not taking the text with us. + // 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); @@ -2565,7 +2830,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } } break; case KEY_TAB: { - if (k->get_command()) break; // avoid tab when command + if (k->get_command()) break; // Avoid tab when command. if (readonly) break; @@ -2579,7 +2844,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } else { if (k->get_shift()) { - // simple unindent + // Simple unindent. int cc = cursor.column; const String &line = text[cursor.line]; @@ -2591,17 +2856,17 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { if (cc > 0 && cc <= text[cursor.line].length()) { if (text[cursor.line][cc - 1] == '\t') { - // tabs unindentation + // Tabs unindentation. _remove_text(cursor.line, cc - 1, cursor.line, cc); if (cursor.column >= left) cursor_set_column(MAX(0, cursor.column - 1)); update(); } else { - // spaces unindentation + // Spaces unindentation. int spaces_to_remove = _calculate_spaces_till_next_left_indent(cc); if (spaces_to_remove > 0) { _remove_text(cursor.line, cc - spaces_to_remove, cursor.line, cc); - if (cursor.column > left - spaces_to_remove) // inside text? + if (cursor.column > left - spaces_to_remove) // Inside text? cursor_set_column(MAX(0, cursor.column - spaces_to_remove)); update(); } @@ -2611,9 +2876,9 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { update(); } } else { - // simple indent + // Simple indent. if (indent_using_spaces) { - // insert only as much spaces as needed till next indentation level + // Insert only as much spaces as needed till next indentation level. int spaces_to_add = _calculate_spaces_till_next_right_indent(cursor.column); String indent_to_insert = String(); for (int i = 0; i < spaces_to_add; i++) @@ -2641,20 +2906,20 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { int line = cursor.line; int column = cursor.column; - // check if we are removing a single whitespace, if so remove it and the next char type - // else we just remove the whitespace + // Check if we are removing a single whitespace, if so remove it and the next char type, + // else we just remove the whitespace. bool only_whitespace = false; if (_is_whitespace(text[line][column - 1]) && _is_whitespace(text[line][column - 2])) { only_whitespace = true; } else if (_is_whitespace(text[line][column - 1])) { - // remove the single whitespace + // Remove the single whitespace. column--; } - // check if its a text char + // Check if its a text char. bool only_char = (_is_text_char(text[line][column - 1]) && !only_whitespace); - // if its not whitespace or char then symbol. + // If its not whitespace or char then symbol. bool only_symbols = !(only_whitespace || only_char); while (column > 0) { @@ -2940,7 +3205,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { int curline_len = text[cursor.line].length(); if (cursor.line == text.size() - 1 && cursor.column == curline_len) - break; //nothing to do + break; // Nothing to do. int next_line = cursor.column < curline_len ? cursor.line : cursor.line + 1; int next_column; @@ -2957,20 +3222,20 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { int line = cursor.line; int column = cursor.column; - // check if we are removing a single whitespace, if so remove it and the next char type - // else we just remove the whitespace + // Check if we are removing a single whitespace, if so remove it and the next char type, + // else we just remove the whitespace. bool only_whitespace = false; if (_is_whitespace(text[line][column]) && _is_whitespace(text[line][column + 1])) { only_whitespace = true; } else if (_is_whitespace(text[line][column])) { - // remove the single whitespace + // Remove the single whitespace. column++; } - // check if its a text char + // Check if its a text char. bool only_char = (_is_text_char(text[line][column]) && !only_whitespace); - // if its not whitespace or char then symbol. + // If its not whitespace or char then symbol. bool only_symbols = !(only_whitespace || only_char); while (column < curline_len) { @@ -3029,7 +3294,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { cursor_set_column(0); } else { - // move cursor column to start of wrapped row and then to start of text + // Move cursor column to start of wrapped row and then to start of text. Vector<String> rows = get_wrap_rows_text(cursor.line); int wi = get_cursor_wrap_index(); int row_start_col = 0; @@ -3037,7 +3302,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { row_start_col += rows[i].length(); } if (cursor.column == row_start_col || wi == 0) { - // compute whitespace symbols seq length + // Compute whitespace symbols seq length. int current_line_whitespace_len = 0; while (current_line_whitespace_len < text[cursor.line].length()) { CharType c = text[cursor.line][current_line_whitespace_len]; @@ -3088,7 +3353,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { if (k->get_command()) cursor_set_line(get_last_unhidden_line(), true, false, 9999); - // move cursor column to end of wrapped row and then to end of text + // Move cursor column to end of wrapped row and then to end of text. Vector<String> rows = get_wrap_rows_text(cursor.line); int wi = get_cursor_wrap_index(); int row_end_col = -1; @@ -3274,7 +3539,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } break; case KEY_SPACE: { #ifdef OSX_ENABLED - if (completion_enabled && k->get_metakey()) { //cmd-space is spotlight shortcut in OSX + if (completion_enabled && k->get_metakey()) { // cmd-space is spotlight shortcut in OSX #else if (completion_enabled && k->get_command()) { #endif @@ -3302,18 +3567,18 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { return; } - if (!scancode_handled && !k->get_command()) { //for German kbds + if (!scancode_handled && !k->get_command()) { // For German keyboards. if (k->get_unicode() >= 32) { if (readonly) return; - // remove the old character if in insert mode and no selection + // Remove the old character if in insert mode and no selection. if (insert_mode && !had_selection) { begin_complex_operation(); - // make sure we don't try and remove empty space + // Make sure we don't try and remove empty space. if (cursor.column < get_line(cursor.line).length()) { _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); } @@ -3347,8 +3612,10 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { void TextEdit::_scroll_up(real_t p_delta) { - if (scrolling && smooth_scroll_enabled && SGN(target_v_scroll - v_scroll->get_value()) != SGN(-p_delta)) + if (scrolling && smooth_scroll_enabled && SGN(target_v_scroll - v_scroll->get_value()) != SGN(-p_delta)) { scrolling = false; + minimap_clicked = false; + } if (scrolling) { target_v_scroll = (target_v_scroll - p_delta); @@ -3373,8 +3640,10 @@ void TextEdit::_scroll_up(real_t p_delta) { void TextEdit::_scroll_down(real_t p_delta) { - if (scrolling && smooth_scroll_enabled && SGN(target_v_scroll - v_scroll->get_value()) != SGN(p_delta)) + if (scrolling && smooth_scroll_enabled && SGN(target_v_scroll - v_scroll->get_value()) != SGN(p_delta)) { scrolling = false; + minimap_clicked = false; + } if (scrolling) { target_v_scroll = (target_v_scroll + p_delta); @@ -3423,11 +3692,12 @@ void TextEdit::_post_shift_selection() { void TextEdit::_scroll_lines_up() { scrolling = false; + minimap_clicked = false; - // adjust the vertical scroll + // Adjust the vertical scroll. set_v_scroll(get_v_scroll() - 1); - // adjust the cursor to viewport + // Adjust the cursor to viewport. if (!selection.active) { int cur_line = cursor.line; int cur_wrap = get_cursor_wrap_index(); @@ -3442,11 +3712,12 @@ void TextEdit::_scroll_lines_up() { void TextEdit::_scroll_lines_down() { scrolling = false; + minimap_clicked = false; - // adjust the vertical scroll + // Adjust the vertical scroll. set_v_scroll(get_v_scroll() + 1); - // adjust the cursor to viewport + // Adjust the cursor to viewport. if (!selection.active) { int cur_line = cursor.line; int cur_wrap = get_cursor_wrap_index(); @@ -3463,15 +3734,15 @@ void TextEdit::_scroll_lines_down() { void TextEdit::_base_insert_text(int p_line, int p_char, const String &p_text, int &r_end_line, int &r_end_column) { - //save for undo... + // Save for undo. ERR_FAIL_INDEX(p_line, text.size()); ERR_FAIL_COND(p_char < 0); - /* STEP 1 remove \r from source text and separate in substrings */ + /* STEP 1: Remove \r from source text and separate in substrings. */ Vector<String> substrings = p_text.replace("\r", "").split("\n"); - /* STEP 2 fire breakpoint_toggled signals */ + /* STEP 2: Fire breakpoint_toggled signals. */ // Is this just a new empty line? bool shift_first_line = p_char == 0 && p_text.replace("\r", "") == "\n"; @@ -3487,19 +3758,19 @@ void TextEdit::_base_insert_text(int p_line, int p_char, const String &p_text, i } } - /* STEP 3 add spaces if the char is greater than the end of the line */ + /* STEP 3: Add spaces if the char is greater than the end of the line. */ while (p_char > text[p_line].length()) { text.set(p_line, text[p_line] + String::chr(' ')); } - /* STEP 4 separate dest string in pre and post text */ + /* STEP 4: Separate dest string in pre and post text. */ String preinsert_text = text[p_line].substr(0, p_char); String postinsert_text = text[p_line].substr(p_char, text[p_line].size()); for (int j = 0; j < substrings.size(); j++) { - //insert the substrings + // Insert the substrings. if (j == 0) { @@ -3544,8 +3815,8 @@ String TextEdit::_base_get_text(int p_from_line, int p_from_column, int p_to_lin ERR_FAIL_INDEX_V(p_from_column, text[p_from_line].length() + 1, String()); ERR_FAIL_INDEX_V(p_to_line, text.size(), String()); ERR_FAIL_INDEX_V(p_to_column, text[p_to_line].length() + 1, String()); - ERR_FAIL_COND_V(p_to_line < p_from_line, String()); // from > to - ERR_FAIL_COND_V(p_to_line == p_from_line && p_to_column < p_from_column, String()); // from > to + ERR_FAIL_COND_V(p_to_line < p_from_line, String()); // 'from > to'. + ERR_FAIL_COND_V(p_to_line == p_from_line && p_to_column < p_from_column, String()); // 'from > to'. String ret; @@ -3568,8 +3839,8 @@ void TextEdit::_base_remove_text(int p_from_line, int p_from_column, int p_to_li ERR_FAIL_INDEX(p_from_column, text[p_from_line].length() + 1); ERR_FAIL_INDEX(p_to_line, text.size()); ERR_FAIL_INDEX(p_to_column, text[p_to_line].length() + 1); - ERR_FAIL_COND(p_to_line < p_from_line); // from > to - ERR_FAIL_COND(p_to_line == p_from_line && p_to_column < p_from_column); // from > to + ERR_FAIL_COND(p_to_line < p_from_line); // 'from > to'. + ERR_FAIL_COND(p_to_line == p_from_line && p_to_column < p_from_column); // 'from > to'. String pre_text = text[p_from_line].substr(0, p_from_column); String post_text = text[p_to_line].substr(p_to_column, text[p_to_line].length()); @@ -3631,22 +3902,22 @@ void TextEdit::_insert_text(int p_line, int p_char, const String &p_text, int *r op.chain_forward = false; op.chain_backward = false; - //see if it should just be set as current op + // See if it should just be set as current op. if (current_op.type != op.type) { op.prev_version = get_version(); _push_current_op(); current_op = op; - return; //set as current op, return + return; // Set as current op, return. } - //see if it can be merged + // See if it can be merged. if (current_op.to_line != p_line || current_op.to_column != p_char) { op.prev_version = get_version(); _push_current_op(); current_op = op; - return; //set as current op, return + return; // Set as current op, return. } - //merge current op + // Merge current op. current_op.text += p_text; current_op.to_column = retchar; @@ -3670,7 +3941,7 @@ void TextEdit::_remove_text(int p_from_line, int p_from_column, int p_to_line, i if (!undo_enabled) return; - /* UNDO!! */ + /* UNDO! */ TextOperation op; op.type = TextOperation::TYPE_REMOVE; op.from_line = p_from_line; @@ -3682,27 +3953,20 @@ void TextEdit::_remove_text(int p_from_line, int p_from_column, int p_to_line, i op.chain_forward = false; op.chain_backward = false; - //see if it should just be set as current op + // See if it should just be set as current op. if (current_op.type != op.type) { op.prev_version = get_version(); _push_current_op(); current_op = op; - return; //set as current op, return + return; // Set as current op, return. } - //see if it can be merged + // See if it can be merged. if (current_op.from_line == p_to_line && current_op.from_column == p_to_column) { - //basckace or similar + // Backspace or similar. current_op.text = text + current_op.text; current_op.from_line = p_from_line; current_op.from_column = p_from_column; - return; //update current op - } - if (current_op.from_line == p_from_line && current_op.from_column == p_from_column) { - - //current_op.text=text+current_op.text; - //current_op.from_line=p_from_line; - //current_op.from_column=p_from_column; - //return; //update current op + return; // Update current op. } op.prev_version = get_version(); @@ -3725,6 +3989,15 @@ void TextEdit::_line_edited_from(int p_line) { for (int i = p_line; i < cache_size; i++) { color_region_cache.erase(i); } + + if (syntax_highlighting_cache.size() > 0) { + cache_size = syntax_highlighting_cache.back()->key(); + for (int i = p_line - 1; i < cache_size; i++) { + if (syntax_highlighting_cache.has(i)) { + syntax_highlighting_cache.erase(i); + } + } + } } int TextEdit::get_char_count() { @@ -3734,11 +4007,11 @@ int TextEdit::get_char_count() { for (int i = 0; i < text.size(); i++) { if (i > 0) - totalsize++; // incliude \n + totalsize++; // Include \n. totalsize += text[i].length(); } - return totalsize; // omit last \n + return totalsize; // Omit last \n. } Size2 TextEdit::get_minimum_size() const { @@ -3756,9 +4029,18 @@ int TextEdit::get_visible_rows() const { return total; } +int TextEdit::_get_minimap_visible_rows() const { + int total = get_size().height; + total -= cache.style_normal->get_minimum_size().height; + if (h_scroll->is_visible_in_tree()) + total -= h_scroll->get_size().height; + total /= (minimap_char_size.y + minimap_line_spacing); + return total; +} + int TextEdit::get_total_visible_rows() const { - // returns the total amount of rows we need in the editor. + // Returns the total amount of rows we need in the editor. // This skips hidden lines and counts each wrapping of a line. if (!is_hiding_enabled() && !is_wrap_enabled()) return text.size(); @@ -3775,12 +4057,12 @@ int TextEdit::get_total_visible_rows() const { void TextEdit::_update_wrap_at() { - wrap_at = get_size().width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - cache.info_gutter_width - wrap_right_offset; + wrap_at = get_size().width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - cache.info_gutter_width - cache.minimap_width - wrap_right_offset; update_cursor_wrap_offset(); text.clear_wrap_cache(); for (int i = 0; i < text.size(); i++) { - // update all values that wrap + // Update all values that wrap. if (!line_wraps(i)) continue; Vector<String> rows = get_wrap_rows_text(i); @@ -3790,8 +4072,9 @@ void TextEdit::_update_wrap_at() { void TextEdit::adjust_viewport_to_cursor() { - // make sure cursor is visible on the screen + // Make sure cursor is visible on the screen. scrolling = false; + minimap_clicked = false; int cur_line = cursor.line; int cur_wrap = get_cursor_wrap_index(); @@ -3802,20 +4085,20 @@ void TextEdit::adjust_viewport_to_cursor() { int last_vis_wrap = get_last_visible_line_wrap_index(); if (cur_line < first_vis_line || (cur_line == first_vis_line && cur_wrap < first_vis_wrap)) { - // cursor is above screen + // Cursor is above screen. set_line_as_first_visible(cur_line, cur_wrap); } else if (cur_line > last_vis_line || (cur_line == last_vis_line && cur_wrap > last_vis_wrap)) { - // cursor is below screen + // Cursor is below screen. set_line_as_last_visible(cur_line, cur_wrap); } - int visible_width = get_size().width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - cache.info_gutter_width; + int visible_width = get_size().width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - cache.info_gutter_width - cache.minimap_width; if (v_scroll->is_visible_in_tree()) visible_width -= v_scroll->get_combined_minimum_size().width; - visible_width -= 20; // give it a little more space + visible_width -= 20; // Give it a little more space. if (!is_wrap_enabled()) { - // adjust x offset + // Adjust x offset. int cursor_x = get_column_x_offset(cursor.column, text[cursor.line]); if (cursor_x > (cursor.x_ofs + visible_width)) @@ -3833,20 +4116,21 @@ void TextEdit::adjust_viewport_to_cursor() { void TextEdit::center_viewport_to_cursor() { - // move viewport so the cursor is in the center of the screen + // Move viewport so the cursor is in the center of the screen. scrolling = false; + minimap_clicked = false; if (is_line_hidden(cursor.line)) unfold_line(cursor.line); set_line_as_center_visible(cursor.line, get_cursor_wrap_index()); - int visible_width = get_size().width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - cache.info_gutter_width; + int visible_width = get_size().width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - cache.info_gutter_width - cache.minimap_width; if (v_scroll->is_visible_in_tree()) visible_width -= v_scroll->get_combined_minimum_size().width; - visible_width -= 20; // give it a little more space + visible_width -= 20; // Give it a little more space. if (is_wrap_enabled()) { - // center x offset + // Center x offset. int cursor_x = get_column_x_offset_for_line(cursor.column, cursor.line); if (cursor_x > (cursor.x_ofs + visible_width)) @@ -3888,7 +4172,7 @@ int TextEdit::times_line_wraps(int line) const { int wrap_amount = text.get_line_wrap_amount(line); if (wrap_amount == -1) { - // update the value + // Update the value. Vector<String> rows = get_wrap_rows_text(line); wrap_amount = rows.size() - 1; text.set_line_wrap_amount(line, wrap_amount); @@ -3928,7 +4212,7 @@ Vector<String> TextEdit::get_wrap_rows_text(int p_line) const { int indent_ofs = (cur_wrap_index != 0 ? tab_offset_px : 0); if (indent_ofs + word_px + w > wrap_at) { - // not enough space to add this char; start next line + // Not enough space to add this char; start next line. wrap_substring += word_str; lines.push_back(wrap_substring); cur_wrap_index++; @@ -3942,7 +4226,7 @@ Vector<String> TextEdit::get_wrap_rows_text(int p_line) const { word_str += c; word_px += w; if (c == ' ') { - // end of a word; add this word to the substring + // End of a word; add this word to the substring. wrap_substring += word_str; px += word_px; word_str = ""; @@ -3950,9 +4234,9 @@ Vector<String> TextEdit::get_wrap_rows_text(int p_line) const { } if (indent_ofs + px + word_px > wrap_at) { - // this word will be moved to the next line + // This word will be moved to the next line. lines.push_back(wrap_substring); - // reset for next wrap + // Reset for next wrap. cur_wrap_index++; wrap_substring = ""; px = 0; @@ -3960,11 +4244,11 @@ Vector<String> TextEdit::get_wrap_rows_text(int p_line) const { } col++; } - // line ends before hit wrap_at; add this word to the substring + // Line ends before hit wrap_at; add this word to the substring. wrap_substring += word_str; lines.push_back(wrap_substring); - // update cache + // Update cache. text.set_line_wrap_amount(p_line, lines.size() - 1); return lines; @@ -3982,7 +4266,7 @@ int TextEdit::get_line_wrap_index_at_col(int p_line, int p_column) const { if (!line_wraps(p_line)) return 0; - // loop through wraps in the line text until we get to the column + // Loop through wraps in the line text until we get to the column. int wrap_index = 0; int col = 0; Vector<String> rows = get_wrap_rows_text(p_line); @@ -4123,6 +4407,7 @@ bool TextEdit::is_right_click_moving_caret() const { void TextEdit::_v_scroll_input() { scrolling = false; + minimap_clicked = false; } void TextEdit::_scroll_moved(double p_to_val) { @@ -4134,7 +4419,7 @@ void TextEdit::_scroll_moved(double p_to_val) { cursor.x_ofs = h_scroll->get_value(); if (v_scroll->is_visible_in_tree()) { - // set line ofs and wrap ofs + // Set line ofs and wrap ofs. int v_scroll_i = floor(get_v_scroll()); int sc = 0; int n_line; @@ -4289,12 +4574,12 @@ Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const { _get_mouse_pos(p_pos, row, col); int left_margin = cache.style_normal->get_margin(MARGIN_LEFT); - // breakpoint icon + // Breakpoint icon. if (draw_breakpoint_gutter && p_pos.x > left_margin - 6 && p_pos.x <= left_margin + cache.breakpoint_gutter_width - 3) { return CURSOR_POINTING_HAND; } - // info icons + // Info icons. int gutter_left = left_margin + cache.breakpoint_gutter_width + cache.info_gutter_width; if (draw_info_gutter && p_pos.x > left_margin + cache.breakpoint_gutter_width - 6 && p_pos.x <= gutter_left - 3) { if (text.has_info_icon(row)) { @@ -4303,7 +4588,7 @@ Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const { return CURSOR_ARROW; } - // fold icon + // Fold icon. if (draw_fold_gutter && p_pos.x > gutter_left + cache.line_number_w - 6 && p_pos.x <= gutter_left + cache.line_number_w + cache.fold_gutter_width - 3) { if (is_folded(row) || can_fold(row)) return CURSOR_POINTING_HAND; @@ -4313,9 +4598,14 @@ Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const { return CURSOR_ARROW; } else { + int xmargin_end = get_size().width - cache.style_normal->get_margin(MARGIN_RIGHT); + if (p_pos.x > xmargin_end - minimap_width && p_pos.x <= xmargin_end) { + return CURSOR_ARROW; + } + int row, col; _get_mouse_pos(p_pos, row, col); - // eol fold icon + // EOL fold icon. if (is_folded(row)) { int line_width = text.get_line_width(row); line_width += cache.style_normal->get_margin(MARGIN_LEFT) + cache.line_number_w + cache.breakpoint_gutter_width + cache.fold_gutter_width + cache.info_gutter_width - cursor.x_ofs; @@ -4349,8 +4639,6 @@ void TextEdit::set_text(String p_text) { update(); setting_text = false; - - //get_range()->set(0); }; String TextEdit::get_text() { @@ -4377,7 +4665,7 @@ String TextEdit::get_text_for_lookup_completion() { if (i == row) { longthing += text[i].substr(0, col); - longthing += String::chr(0xFFFF); //not unicode, represents the cursor + longthing += String::chr(0xFFFF); // Not unicode, represents the cursor. longthing += text[i].substr(col, text[i].size()); } else { @@ -4399,7 +4687,7 @@ String TextEdit::get_text_for_completion() { if (i == cursor.line) { longthing += text[i].substr(0, cursor.column); - longthing += String::chr(0xFFFF); //not unicode, represents the cursor + longthing += String::chr(0xFFFF); // Not unicode, represents the cursor. longthing += text[i].substr(cursor.column, text[i].size()); } else { @@ -4450,18 +4738,28 @@ void TextEdit::set_readonly(bool p_readonly) { // Reorganize context menu. menu->clear(); - if (!readonly) + + if (!readonly) { + menu->add_item(RTR("Undo"), MENU_UNDO, KEY_MASK_CMD | KEY_Z); + menu->add_item(RTR("Redo"), MENU_REDO, KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Z); + } + + if (!readonly) { + menu->add_separator(); menu->add_item(RTR("Cut"), MENU_CUT, KEY_MASK_CMD | KEY_X); + } + menu->add_item(RTR("Copy"), MENU_COPY, KEY_MASK_CMD | KEY_C); - if (!readonly) + + if (!readonly) { menu->add_item(RTR("Paste"), MENU_PASTE, KEY_MASK_CMD | KEY_V); + } + menu->add_separator(); menu->add_item(RTR("Select All"), MENU_SELECT_ALL, KEY_MASK_CMD | KEY_A); + if (!readonly) { menu->add_item(RTR("Clear"), MENU_CLEAR); - menu->add_separator(); - menu->add_item(RTR("Undo"), MENU_UNDO, KEY_MASK_CMD | KEY_Z); - menu->add_item(RTR("Redo"), MENU_REDO, KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Z); } update(); @@ -4572,17 +4870,18 @@ void TextEdit::_set_syntax_highlighting(SyntaxHighlighter *p_syntax_highlighter) syntax_highlighter->set_text_editor(this); syntax_highlighter->_update_cache(); } + syntax_highlighting_cache.clear(); update(); } int TextEdit::_is_line_in_region(int p_line) { - // do we have in cache? + // Do we have in cache? if (color_region_cache.has(p_line)) { return color_region_cache[p_line]; } - // if not find the closest line we have + // If not find the closest line we have. int previous_line = p_line - 1; for (; previous_line > -1; previous_line--) { if (color_region_cache.has(p_line)) { @@ -4590,7 +4889,7 @@ int TextEdit::_is_line_in_region(int p_line) { } } - // calculate up to line we need and update the cache along the way. + // Calculate up to line we need and update the cache along the way. int in_region = color_region_cache[previous_line]; if (previous_line == -1) { in_region = -1; @@ -4638,6 +4937,7 @@ void TextEdit::clear_colors() { keywords.clear(); color_regions.clear(); color_region_cache.clear(); + syntax_highlighting_cache.clear(); text.clear_width_cache(); } @@ -4718,7 +5018,7 @@ void TextEdit::cut() { OS::get_singleton()->set_clipboard(clipboard); _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); - cursor_set_line(selection.from_line); // set afterwards else it causes the view to be offset + cursor_set_line(selection.from_line); // Set afterwards else it causes the view to be offset. cursor_set_column(selection.from_column); selection.active = false; @@ -4947,7 +5247,7 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc col = p_search.findn(p_key, p_from_column); } - // whole words only + // Whole words only. if (col != -1 && p_search_flags & SEARCH_WHOLE_WORDS) { p_from_column = col; @@ -4987,14 +5287,12 @@ bool TextEdit::search(const String &p_key, uint32_t p_search_flags, int p_from_l ERR_FAIL_INDEX_V(p_from_line, text.size(), false); ERR_FAIL_INDEX_V(p_from_column, text[p_from_line].length() + 1, false); - //search through the whole document, but start by current line + // Search through the whole document, but start by current line. int line = p_from_line; int pos = -1; for (int i = 0; i < text.size() + 1; i++) { - //backwards is broken... - //int idx=(p_search_flags&SEARCH_BACKWARDS)?(text.size()-i):i; //do backwards seearch if (line < 0) { line = text.size() - 1; @@ -5008,7 +5306,7 @@ bool TextEdit::search(const String &p_key, uint32_t p_search_flags, int p_from_l if (line == p_from_line) { if (i == text.size()) { - //wrapped + // Wrapped. if (p_search_flags & SEARCH_BACKWARDS) { from_column = text_line.length(); @@ -5056,7 +5354,7 @@ bool TextEdit::search(const String &p_key, uint32_t p_search_flags, int p_from_l bool is_match = true; if (pos != -1 && (p_search_flags & SEARCH_WHOLE_WORDS)) { - //validate for whole words + // Validate for whole words. if (pos > 0 && _is_text_char(text_line[pos - 1])) is_match = false; else if (pos + p_key.length() < text_line.length() && _is_text_char(text_line[pos + p_key.length()])) @@ -5254,7 +5552,7 @@ void TextEdit::unhide_all_lines() { int TextEdit::num_lines_from(int p_line_from, int visible_amount) const { - // returns the number of lines (hidden and unhidden) from p_line_from to (p_line_from + visible_amount of unhidden lines) + // Returns the number of lines (hidden and unhidden) from p_line_from to (p_line_from + visible_amount of unhidden lines). ERR_FAIL_INDEX_V(p_line_from, text.size(), ABS(visible_amount)); if (!is_hiding_enabled()) @@ -5287,8 +5585,8 @@ int TextEdit::num_lines_from(int p_line_from, int visible_amount) const { int TextEdit::num_lines_from_rows(int p_line_from, int p_wrap_index_from, int visible_amount, int &wrap_index) const { - // returns the number of lines (hidden and unhidden) from (p_line_from + p_wrap_index_from) row to (p_line_from + visible_amount of unhidden and wrapped rows) - // wrap index is set to the wrap index of the last line + // Returns the number of lines (hidden and unhidden) from (p_line_from + p_wrap_index_from) row to (p_line_from + visible_amount of unhidden and wrapped rows). + // Wrap index is set to the wrap index of the last line. wrap_index = 0; ERR_FAIL_INDEX_V(p_line_from, text.size(), ABS(visible_amount)); @@ -5334,7 +5632,7 @@ int TextEdit::num_lines_from_rows(int p_line_from, int p_wrap_index_from, int vi int TextEdit::get_last_unhidden_line() const { - // returns the last line in the text that is not hidden + // Returns the last line in the text that is not hidden. if (!is_hiding_enabled()) return text.size() - 1; @@ -5351,7 +5649,7 @@ int TextEdit::get_indent_level(int p_line) const { ERR_FAIL_INDEX_V(p_line, text.size(), 0); - // counts number of tabs and spaces before line starts + // Counts number of tabs and spaces before line starts. int tab_count = 0; int whitespace_count = 0; int line_length = text[p_line].size(); @@ -5369,7 +5667,7 @@ int TextEdit::get_indent_level(int p_line) const { bool TextEdit::is_line_comment(int p_line) const { - // checks to see if this line is the start of a comment + // Checks to see if this line is the start of a comment. ERR_FAIL_INDEX_V(p_line, text.size(), false); const Map<int, Text::ColorRegionInfo> &cri_map = text.get_color_region_info(p_line); @@ -5449,7 +5747,7 @@ void TextEdit::fold_line(int p_line) { if (!can_fold(p_line)) return; - // hide lines below this one + // Hide lines below this one. int start_indent = get_indent_level(p_line); int last_line = start_indent; for (int i = p_line + 1; i < text.size(); i++) { @@ -5467,7 +5765,7 @@ void TextEdit::fold_line(int p_line) { set_line_as_hidden(i, true); } - // fix selection + // Fix selection. if (is_selection_active()) { if (is_line_hidden(selection.from_line) && is_line_hidden(selection.to_line)) { deselect(); @@ -5478,7 +5776,7 @@ void TextEdit::fold_line(int p_line) { } } - // reset cursor + // Reset cursor. if (is_line_hidden(cursor.line)) { cursor_set_line(p_line, false, false); cursor_set_column(get_line(p_line).length(), false); @@ -5539,8 +5837,8 @@ void TextEdit::_do_text_op(const TextOperation &p_op, bool p_reverse) { int check_line; int check_column; _base_insert_text(p_op.from_line, p_op.from_column, p_op.text, check_line, check_column); - ERR_FAIL_COND(check_line != p_op.to_line); // BUG - ERR_FAIL_COND(check_column != p_op.to_column); // BUG + ERR_FAIL_COND(check_line != p_op.to_line); // BUG. + ERR_FAIL_COND(check_column != p_op.to_column); // BUG. } else { _base_remove_text(p_op.from_line, p_op.from_column, p_op.to_line, p_op.to_column); @@ -5550,7 +5848,7 @@ void TextEdit::_do_text_op(const TextOperation &p_op, bool p_reverse) { void TextEdit::_clear_redo() { if (undo_stack_pos == NULL) - return; //nothing to clear + return; // Nothing to clear. _push_current_op(); @@ -5568,12 +5866,12 @@ void TextEdit::undo() { if (undo_stack_pos == NULL) { if (!undo_stack.size()) - return; //nothing to undo + return; // Nothing to undo. undo_stack_pos = undo_stack.back(); } else if (undo_stack_pos == undo_stack.front()) - return; // at the bottom of the undo stack + return; // At the bottom of the undo stack. else undo_stack_pos = undo_stack_pos->prev(); @@ -5614,7 +5912,7 @@ void TextEdit::redo() { _push_current_op(); if (undo_stack_pos == NULL) - return; //nothing to do. + return; // Nothing to do. deselect(); @@ -5668,7 +5966,7 @@ void TextEdit::end_complex_operation() { void TextEdit::_push_current_op() { if (current_op.type == TextOperation::TYPE_NONE) - return; // do nothing + return; // Nothing to do. if (next_operation_is_complex) { current_op.chain_forward = true; @@ -5768,7 +6066,7 @@ double TextEdit::get_scroll_pos_for_line(int p_line, int p_wrap_index) const { if (!is_wrap_enabled() && !is_hiding_enabled()) return p_line; - // count the number of visible lines up to this line + // Count the number of visible lines up to this line. double new_line_scroll_pos = 0; int to = CLAMP(p_line, 0, text.size() - 1); for (int i = 0; i < to; i++) { @@ -5969,7 +6267,7 @@ void TextEdit::_update_completion_candidates() { String s; - //look for keywords first + // Look for keywords first. bool inquote = false; int first_quote = -1; @@ -5994,7 +6292,7 @@ void TextEdit::_update_completion_candidates() { bool cancel = false; if (!inquote && first_quote == cofs - 1) { - //no completion here + // No completion here. cancel = true; } else if (inquote && first_quote != -1) { @@ -6032,11 +6330,12 @@ void TextEdit::_update_completion_candidates() { bool prev_is_prefix = false; if (cofs > 0 && completion_prefixes.has(String::chr(l[cofs - 1]))) prev_is_prefix = true; - if (cofs > 1 && l[cofs - 1] == ' ' && completion_prefixes.has(String::chr(l[cofs - 2]))) //check with one space before prefix, to allow indent + // Check with one space before prefix, to allow indent. + if (cofs > 1 && l[cofs - 1] == ' ' && completion_prefixes.has(String::chr(l[cofs - 2]))) prev_is_prefix = true; if (cancel || (!pre_keyword && s == "" && (cofs == 0 || !prev_is_prefix))) { - //none to complete, cancel + // None to complete, cancel. _cancel_completion(); return; } @@ -6086,18 +6385,18 @@ void TextEdit::_update_completion_candidates() { } if (completion_options.size() == 0) { - //no options to complete, cancel + // No options to complete, cancel. _cancel_completion(); return; } if (completion_options.size() == 1 && s == completion_options[0].display) { - // A perfect match, stop completion + // A perfect match, stop completion. _cancel_completion(); return; } - // The top of the list is the best match + // The top of the list is the best match. completion_current = completion_options[0]; completion_enabled = true; } @@ -6116,10 +6415,30 @@ void TextEdit::query_code_comple() { c--; } - if (ofs > 0 && (inquote || _is_completable(l[ofs - 1]) || completion_prefixes.has(String::chr(l[ofs - 1])))) - emit_signal("request_completion"); - else if (ofs > 1 && l[ofs - 1] == ' ' && completion_prefixes.has(String::chr(l[ofs - 2]))) //make it work with a space too, it's good enough - emit_signal("request_completion"); + bool ignored = completion_active && !completion_options.empty(); + if (ignored) { + ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_PLAIN_TEXT; + const ScriptCodeCompletionOption *previous_option = NULL; + for (int i = 0; i < completion_options.size(); i++) { + const ScriptCodeCompletionOption ¤t_option = completion_options[i]; + if (!previous_option) { + previous_option = ¤t_option; + kind = current_option.kind; + } + if (previous_option->kind != current_option.kind) { + ignored = false; + break; + } + } + ignored = ignored && (kind == ScriptCodeCompletionOption::KIND_FILE_PATH || kind == ScriptCodeCompletionOption::KIND_NODE_PATH || kind == ScriptCodeCompletionOption::KIND_SIGNAL); + } + + if (!ignored) { + if (ofs > 0 && (inquote || _is_completable(l[ofs - 1]) || completion_prefixes.has(String::chr(l[ofs - 1])))) + emit_signal("request_completion"); + else if (ofs > 1 && l[ofs - 1] == ' ' && completion_prefixes.has(String::chr(l[ofs - 2]))) // Make it work with a space too, it's good enough. + emit_signal("request_completion"); + } } void TextEdit::set_code_hint(const String &p_hint) { @@ -6314,6 +6633,24 @@ int TextEdit::get_info_gutter_width() const { return info_gutter_width; } +void TextEdit::set_draw_minimap(bool p_draw) { + draw_minimap = p_draw; + update(); +} + +bool TextEdit::is_drawing_minimap() const { + return draw_minimap; +} + +void TextEdit::set_minimap_width(int p_minimap_width) { + minimap_width = p_minimap_width; + update(); +} + +int TextEdit::get_minimap_width() const { + return minimap_width; +} + void TextEdit::set_hiding_enabled(bool p_enabled) { if (!p_enabled) unhide_all_lines(); @@ -6443,8 +6780,6 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_wrap_enabled", "enable"), &TextEdit::set_wrap_enabled); ClassDB::bind_method(D_METHOD("is_wrap_enabled"), &TextEdit::is_wrap_enabled); - // ClassDB::bind_method(D_METHOD("set_max_chars", "amount"), &TextEdit::set_max_chars); - // ClassDB::bind_method(D_METHOD("get_max_char"), &TextEdit::get_max_chars); ClassDB::bind_method(D_METHOD("set_context_menu_enabled", "enable"), &TextEdit::set_context_menu_enabled); ClassDB::bind_method(D_METHOD("is_context_menu_enabled"), &TextEdit::is_context_menu_enabled); @@ -6520,6 +6855,11 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("get_breakpoints"), &TextEdit::get_breakpoints_array); ClassDB::bind_method(D_METHOD("remove_breakpoints"), &TextEdit::remove_breakpoints); + ClassDB::bind_method(D_METHOD("draw_minimap", "draw"), &TextEdit::set_draw_minimap); + ClassDB::bind_method(D_METHOD("is_drawing_minimap"), &TextEdit::is_drawing_minimap); + ClassDB::bind_method(D_METHOD("set_minimap_width", "width"), &TextEdit::set_minimap_width); + ClassDB::bind_method(D_METHOD("get_minimap_width"), &TextEdit::get_minimap_width); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "readonly"), "set_readonly", "is_readonly"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_current_line"), "set_highlight_current_line", "is_highlight_current_line_enabled"); @@ -6536,7 +6876,10 @@ void TextEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_scroll_speed"), "set_v_scroll_speed", "get_v_scroll_speed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hiding_enabled"), "set_hiding_enabled", "is_hiding_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "wrap_enabled"), "set_wrap_enabled", "is_wrap_enabled"); - // ADD_PROPERTY(PropertyInfo(Variant::BOOL, "max_chars"), "set_max_chars", "get_max_chars"); + + ADD_GROUP("Minimap", "minimap_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "minimap_draw"), "draw_minimap", "is_drawing_minimap"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "minimap_width"), "set_minimap_width", "get_minimap_width"); ADD_GROUP("Caret", "caret_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_block_mode"), "cursor_set_block_mode", "cursor_is_block_mode"); @@ -6561,7 +6904,7 @@ void TextEdit::_bind_methods() { BIND_ENUM_CONSTANT(MENU_MAX); GLOBAL_DEF("gui/timers/text_edit_idle_detect_sec", 3); - ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/text_edit_idle_detect_sec", PropertyInfo(Variant::REAL, "gui/timers/text_edit_idle_detect_sec", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater")); // No negative numbers + ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/text_edit_idle_detect_sec", PropertyInfo(Variant::REAL, "gui/timers/text_edit_idle_detect_sec", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater")); // No negative numbers. } TextEdit::TextEdit() { @@ -6592,8 +6935,6 @@ TextEdit::TextEdit() { indent_size = 4; text.set_indent_size(indent_size); text.clear(); - //text.insert(1,"Mongolia..."); - //text.insert(2,"PAIS GENEROSO!!"); text.set_color_regions(&color_regions); h_scroll = memnew(HScrollBar); @@ -6676,13 +7017,20 @@ TextEdit::TextEdit() { select_identifiers_enabled = false; smooth_scroll_enabled = false; scrolling = false; + minimap_clicked = false; + dragging_minimap = false; + dragging_selection = false; target_v_scroll = 0; v_scroll_speed = 80; + draw_minimap = false; + minimap_width = 80; + minimap_char_size = Point2(1, 2); + minimap_line_spacing = 1; context_menu_enabled = true; menu = memnew(PopupMenu); add_child(menu); - readonly = true; // initialise to opposite first, so we get past the early-out in set_readonly + readonly = true; // Initialise to opposite first, so we get past the early-out in set_readonly. set_readonly(false); menu->connect("id_pressed", this, "menu_option"); first_draw = true; @@ -6696,8 +7044,14 @@ TextEdit::~TextEdit() { /////////////////////////////////////////////////////////////////////////////// Map<int, TextEdit::HighlighterInfo> TextEdit::_get_line_syntax_highlighting(int p_line) { + if (syntax_highlighting_cache.has(p_line)) { + return syntax_highlighting_cache[p_line]; + } + if (syntax_highlighter != NULL) { - return syntax_highlighter->_get_line_syntax_highlighting(p_line); + Map<int, HighlighterInfo> color_map = syntax_highlighter->_get_line_syntax_highlighting(p_line); + syntax_highlighting_cache[p_line] = color_map; + return color_map; } Map<int, HighlighterInfo> color_map; @@ -6743,14 +7097,14 @@ Map<int, TextEdit::HighlighterInfo> TextEdit::_get_line_syntax_highlighting(int bool is_symbol = _is_symbol(str[j]); bool is_number = _is_number(str[j]); - // allow ABCDEF in hex notation + // Allow ABCDEF in hex notation. if (is_hex_notation && (_is_hex_symbol(str[j]) || is_number)) { is_number = true; } else { is_hex_notation = false; } - // check for dot or underscore or 'x' for hex notation in floating point number or 'e' for scientific notation + // Check for dot or underscore or 'x' for hex notation in floating point number or 'e' for scientific notation. if ((str[j] == '.' || str[j] == 'x' || str[j] == '_' || str[j] == 'f' || str[j] == 'e') && !in_word && prev_is_number && !is_number) { is_number = true; is_symbol = false; @@ -6780,7 +7134,7 @@ Map<int, TextEdit::HighlighterInfo> TextEdit::_get_line_syntax_highlighting(int if (!cri.end) { in_region = cri.region; } - } else if (in_region == cri.region && !color_regions[cri.region].line_only) { //ignore otherwise + } else if (in_region == cri.region && !color_regions[cri.region].line_only) { // Ignore otherwise. if (cri.end || color_regions[cri.region].eq) { deregion = color_regions[cri.region].eq ? color_regions[cri.region].begin_key.length() : color_regions[cri.region].end_key.length(); } @@ -6808,7 +7162,7 @@ Map<int, TextEdit::HighlighterInfo> TextEdit::_get_line_syntax_highlighting(int if (col) { for (int k = j - 1; k >= 0; k--) { if (str[k] == '.') { - col = NULL; //member indexing not allowed + col = NULL; // Member indexing not allowed. break; } else if (str[k] > 32) { break; @@ -6830,7 +7184,7 @@ Map<int, TextEdit::HighlighterInfo> TextEdit::_get_line_syntax_highlighting(int k++; } - // check for space between name and bracket + // Check for space between name and bracket. while (k < str.length() && (str[k] == '\t' || str[k] == ' ')) { k++; } @@ -6879,6 +7233,7 @@ Map<int, TextEdit::HighlighterInfo> TextEdit::_get_line_syntax_highlighting(int } } + syntax_highlighting_cache[p_line] = color_map; return color_map; } diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index b47dac0902..889be3eaa5 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -211,9 +211,11 @@ private: int breakpoint_gutter_width; int fold_gutter_width; int info_gutter_width; + int minimap_width; } cache; Map<int, int> color_region_cache; + Map<int, Map<int, HighlighterInfo> > syntax_highlighting_cache; struct TextOperation { @@ -313,6 +315,10 @@ private: bool hiding_enabled; bool draw_info_gutter; int info_gutter_width; + bool draw_minimap; + int minimap_width; + Point2 minimap_char_size; + int minimap_line_spacing; bool highlight_all_occurrences; bool scroll_past_end_of_file_enabled; @@ -326,6 +332,9 @@ private: bool smooth_scroll_enabled; bool scrolling; + bool dragging_selection; + bool dragging_minimap; + bool minimap_clicked; float target_v_scroll; float v_scroll_speed; @@ -360,6 +369,8 @@ private: int get_visible_rows() const; int get_total_visible_rows() const; + int _get_minimap_visible_rows() const; + void update_cursor_wrap_offset(); void _update_wrap_at(); bool line_wraps(int line) const; @@ -395,6 +406,7 @@ private: void _update_selection_mode_word(); void _update_selection_mode_line(); + void _update_minimap_scroll(); void _scroll_up(real_t p_delta); void _scroll_down(real_t p_delta); @@ -484,6 +496,7 @@ public: 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; + void _get_minimap_mouse_row(const Point2i &p_mouse, int &r_row) const; //void delete_char(); //void delete_line(); @@ -697,6 +710,12 @@ public: void set_info_gutter_width(int p_gutter_width); int get_info_gutter_width() const; + void set_draw_minimap(bool p_draw); + bool is_drawing_minimap() const; + + void set_minimap_width(int p_minimap_width); + int get_minimap_width() const; + void set_hiding_enabled(bool p_enabled); bool is_hiding_enabled() const; diff --git a/scene/gui/texture_rect.h b/scene/gui/texture_rect.h index 3ab35324e5..1c5bd9d99c 100644 --- a/scene/gui/texture_rect.h +++ b/scene/gui/texture_rect.h @@ -32,9 +32,7 @@ #define TEXTURE_FRAME_H #include "scene/gui/control.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class TextureRect : public Control { GDCLASS(TextureRect, Control); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 4005505830..6c8aa35e3c 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1315,7 +1315,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 Ref<Texture> updown = cache.updown; - String valtext = String::num(p_item->cells[i].val, Math::step_decimals(p_item->cells[i].step)); + String valtext = String::num(p_item->cells[i].val, Math::range_step_decimals(p_item->cells[i].step)); //String valtext = rtos( p_item->cells[i].val ); if (p_item->cells[i].suffix != String()) @@ -1926,7 +1926,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool } else { - editor_text = String::num(p_item->cells[col].val, Math::step_decimals(p_item->cells[col].step)); + editor_text = String::num(p_item->cells[col].val, Math::range_step_decimals(p_item->cells[col].step)); if (select_mode == SELECT_MULTI && get_tree()->get_event_count() == focus_in_id) bring_up_editor = false; } @@ -2700,12 +2700,10 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { bool Tree::edit_selected() { TreeItem *s = get_selected(); - ERR_EXPLAIN("No item selected!"); - ERR_FAIL_COND_V(!s, false); + ERR_FAIL_COND_V_MSG(!s, false, "No item selected."); ensure_cursor_is_visible(); int col = get_selected_column(); - ERR_EXPLAIN("No item column selected!"); - ERR_FAIL_INDEX_V(col, columns.size(), false); + ERR_FAIL_INDEX_V_MSG(col, columns.size(), false, "No item column selected."); if (!s->cells[col].editable) return false; @@ -2755,7 +2753,7 @@ bool Tree::edit_selected() { text_editor->set_position(textedpos); text_editor->set_size(rect.size); text_editor->clear(); - text_editor->set_text(c.mode == TreeItem::CELL_MODE_STRING ? c.text : String::num(c.val, Math::step_decimals(c.step))); + text_editor->set_text(c.mode == TreeItem::CELL_MODE_STRING ? c.text : String::num(c.val, Math::range_step_decimals(c.step))); text_editor->select_all(); if (c.mode == TreeItem::CELL_MODE_RANGE) { @@ -2921,8 +2919,6 @@ void Tree::_notification(int p_what) { drag_touching = false; drag_touching_deaccel = false; } - - } else { } } diff --git a/scene/gui/tree.h b/scene/gui/tree.h index b6cdab766f..b57923e24b 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -37,10 +37,6 @@ #include "scene/gui/scroll_bar.h" #include "scene/gui/slider.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Tree; class TreeItem : public Object { diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 05bd911014..e21e47f8a8 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -60,14 +60,10 @@ Error HTTPRequest::_parse_url(const String &p_url) { use_ssl = true; port = 443; } else { - ERR_EXPLAIN("Malformed URL"); - ERR_FAIL_V(ERR_INVALID_PARAMETER); + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Malformed URL."); } - if (url.length() < 1) { - ERR_EXPLAIN("URL too short"); - ERR_FAIL_V(ERR_INVALID_PARAMETER); - } + ERR_FAIL_COND_V_MSG(url.length() < 1, ERR_INVALID_PARAMETER, "URL too short."); int slash_pos = url.find("/"); @@ -91,10 +87,7 @@ Error HTTPRequest::_parse_url(const String &p_url) { Error HTTPRequest::request(const String &p_url, const Vector<String> &p_custom_headers, bool p_ssl_validate_domain, HTTPClient::Method p_method, const String &p_request_data) { ERR_FAIL_COND_V(!is_inside_tree(), ERR_UNCONFIGURED); - if (requesting) { - ERR_EXPLAIN("HTTPRequest is processing a request. Wait for completion or cancel it before attempting a new one."); - ERR_FAIL_V(ERR_BUSY); - } + ERR_FAIL_COND_V_MSG(requesting, ERR_BUSY, "HTTPRequest is processing a request. Wait for completion or cancel it before attempting a new one."); if (timeout > 0) { timer->stop(); diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index 71addd6fea..99ecc8bc37 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -92,6 +92,8 @@ Node *InstancePlaceholder::create_instance(bool p_replace, const Ref<PackedScene if (!ps.is_valid()) return NULL; Node *scene = ps->instance(); + if (!scene) + return NULL; scene->set_name(get_name()); int pos = get_position_in_parent(); diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 06d6f0871c..0b3a193d18 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -210,7 +210,7 @@ void Node::_propagate_enter_tree() { } data.viewport = Object::cast_to<Viewport>(this); - if (!data.viewport) + if (!data.viewport && data.parent) data.viewport = data.parent->data.viewport; data.inside_tree = true; @@ -327,14 +327,9 @@ void Node::_propagate_exit_tree() { void Node::move_child(Node *p_child, int p_pos) { ERR_FAIL_NULL(p_child); - ERR_EXPLAIN("Invalid new child position: " + itos(p_pos)); - ERR_FAIL_INDEX(p_pos, data.children.size() + 1); - ERR_EXPLAIN("child is not a child of this node."); - ERR_FAIL_COND(p_child->data.parent != this); - if (data.blocked > 0) { - ERR_EXPLAIN("Parent node is busy setting up children, move_child() failed. Consider using call_deferred(\"move_child\") instead (or \"popup\" if this is from a popup)."); - ERR_FAIL_COND(data.blocked > 0); - } + ERR_FAIL_INDEX_MSG(p_pos, data.children.size() + 1, "Invalid new child position: " + itos(p_pos) + "."); + ERR_FAIL_COND_MSG(p_child->data.parent != this, "Child is not a child of this node."); + ERR_FAIL_COND_MSG(data.blocked > 0, "Parent node is busy setting up children, move_child() failed. Consider using call_deferred(\"move_child\") instead (or \"popup\" if this is from a popup)."); // Specifying one place beyond the end // means the same as moving to the last position @@ -408,7 +403,6 @@ void Node::set_physics_process(bool p_process) { else remove_from_group("physics_process"); - data.physics_process = p_process; _change_notify("physics_process"); } @@ -429,7 +423,6 @@ void Node::set_physics_process_internal(bool p_process_internal) { else remove_from_group("physics_process_internal"); - data.physics_process_internal = p_process_internal; _change_notify("physics_process_internal"); } @@ -811,7 +804,6 @@ void Node::set_process(bool p_idle_process) { else remove_from_group("idle_process"); - data.idle_process = p_idle_process; _change_notify("idle_process"); } @@ -832,7 +824,6 @@ void Node::set_process_internal(bool p_idle_process_internal) { else remove_from_group("idle_process_internal"); - data.idle_process_internal = p_idle_process_internal; _change_notify("idle_process_internal"); } @@ -1021,7 +1012,7 @@ void Node::_validate_child_name(Node *p_child, bool p_force_human_readable) { if (!unique) { - node_hrcr_count.ref(); + ERR_FAIL_COND(!node_hrcr_count.ref()); String name = "@" + String(p_child->get_name()) + "@" + itos(node_hrcr_count.get()); p_child->data.name = name; } @@ -1169,25 +1160,9 @@ void Node::_add_child_nocheck(Node *p_child, const StringName &p_name) { void Node::add_child(Node *p_child, bool p_legible_unique_name) { ERR_FAIL_NULL(p_child); - - if (p_child == this) { - ERR_EXPLAIN("Can't add child '" + p_child->get_name() + "' to itself."); - ERR_FAIL_COND(p_child == this); // adding to itself! - } - - /* Fail if node has a parent */ - if (p_child->data.parent) { - ERR_EXPLAIN("Can't add child '" + p_child->get_name() + "' to '" + get_name() + "', already has a parent '" + p_child->data.parent->get_name() + "'."); - ERR_FAIL_COND(p_child->data.parent); - } - - if (data.blocked > 0) { - ERR_EXPLAIN("Parent node is busy setting up children, add_node() failed. Consider using call_deferred(\"add_child\", child) instead."); - ERR_FAIL_COND(data.blocked > 0); - } - - ERR_EXPLAIN("Can't add child while a notification is happening."); - ERR_FAIL_COND(data.blocked > 0); + ERR_FAIL_COND_MSG(p_child == this, "Can't add child '" + p_child->get_name() + "' to itself."); // adding to itself! + ERR_FAIL_COND_MSG(p_child->data.parent, "Can't add child '" + p_child->get_name() + "' to '" + get_name() + "', already has a parent '" + p_child->data.parent->get_name() + "'."); //Fail if node has a parent + ERR_FAIL_COND_MSG(data.blocked > 0, "Parent node is busy setting up children, add_node() failed. Consider using call_deferred(\"add_child\", child) instead."); /* Validate name */ _validate_child_name(p_child, p_legible_unique_name); @@ -1243,10 +1218,7 @@ void Node::_propagate_validate_owner() { void Node::remove_child(Node *p_child) { ERR_FAIL_NULL(p_child); - if (data.blocked > 0) { - ERR_EXPLAIN("Parent node is busy setting up children, remove_node() failed. Consider using call_deferred(\"remove_child\",child) instead."); - ERR_FAIL_COND(data.blocked > 0); - } + ERR_FAIL_COND_MSG(data.blocked > 0, "Parent node is busy setting up children, remove_node() failed. Consider using call_deferred(\"remove_child\", child) instead."); int child_count = data.children.size(); Node **children = data.children.ptrw(); @@ -1269,7 +1241,7 @@ void Node::remove_child(Node *p_child) { } } - ERR_FAIL_COND(idx == -1); + ERR_FAIL_COND_MSG(idx == -1, "Cannot remove child node " + p_child->get_name() + " as it is not a child of this node."); //ERR_FAIL_COND( p_child->data.blocked > 0 ); //if (data.scene) { does not matter @@ -1333,10 +1305,7 @@ Node *Node::get_node_or_null(const NodePath &p_path) const { return NULL; } - if (!data.inside_tree && p_path.is_absolute()) { - ERR_EXPLAIN("Can't use get_node() with absolute paths from outside the active scene tree."); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!data.inside_tree && p_path.is_absolute(), NULL, "Can't use get_node() with absolute paths from outside the active scene tree."); Node *current = NULL; Node *root = NULL; @@ -1397,10 +1366,7 @@ Node *Node::get_node_or_null(const NodePath &p_path) const { Node *Node::get_node(const NodePath &p_path) const { Node *node = get_node_or_null(p_path); - if (!node) { - ERR_EXPLAIN("Node not found: " + p_path); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!node, NULL, "Node not found: " + p_path + "."); return node; } @@ -1668,7 +1634,7 @@ NodePath Node::get_path_to(const Node *p_node) const { NodePath Node::get_path() const { - ERR_FAIL_COND_V(!is_inside_tree(), NodePath()); + ERR_FAIL_COND_V_MSG(!is_inside_tree(), NodePath(), "Cannot get path of node as it is not in a scene tree."); if (data.path_cache) return *data.path_cache; @@ -1750,14 +1716,17 @@ void Node::get_groups(List<GroupInfo> *p_groups) const { } } -bool Node::has_persistent_groups() const { +int Node::get_persistent_group_count() const { + + int count = 0; for (const Map<StringName, GroupData>::Element *E = data.grouped.front(); E; E = E->next()) { - if (E->get().persistent) - return true; + if (E->get().persistent) { + count += 1; + } } - return false; + return count; } void Node::_print_tree_pretty(const String &prefix, const bool last) { @@ -2195,11 +2164,12 @@ void Node::_duplicate_and_reown(Node *p_new_parent, const Map<Node *, Node *> &p } else { Object *obj = ClassDB::instance(get_class()); - ERR_EXPLAIN("Node: Could not duplicate: " + String(get_class())); - ERR_FAIL_COND(!obj); + ERR_FAIL_COND_MSG(!obj, "Node: Could not duplicate: " + String(get_class()) + "."); node = Object::cast_to<Node>(obj); - if (!node) + if (!node) { memdelete(obj); + ERR_FAIL_MSG("Node: Could not duplicate: " + String(get_class()) + "."); + } } List<PropertyInfo> plist; @@ -2295,16 +2265,14 @@ Node *Node::duplicate_and_reown(const Map<Node *, Node *> &p_reown_map) const { ERR_FAIL_COND_V(get_filename() != "", NULL); - Node *node = NULL; - Object *obj = ClassDB::instance(get_class()); - ERR_EXPLAIN("Node: Could not duplicate: " + String(get_class())); - ERR_FAIL_COND_V(!obj, NULL); - node = Object::cast_to<Node>(obj); - if (!node) - memdelete(obj); - ERR_FAIL_COND_V(!node, NULL); + ERR_FAIL_COND_V_MSG(!obj, NULL, "Node: Could not duplicate: " + String(get_class()) + "."); + Node *node = Object::cast_to<Node>(obj); + if (!node) { + memdelete(obj); + ERR_FAIL_V_MSG(NULL, "Node: Could not duplicate: " + String(get_class()) + "."); + } node->set_name(get_name()); List<PropertyInfo> plist; @@ -2440,8 +2408,7 @@ void Node::_replace_connections_target(Node *p_new_target) { if (c.flags & CONNECT_PERSIST) { c.source->disconnect(c.signal, this, c.method); bool valid = p_new_target->has_method(c.method) || Ref<Script>(p_new_target->get_script()).is_null() || Ref<Script>(p_new_target->get_script())->has_method(c.method); - ERR_EXPLAIN("Attempt to connect signal \'" + c.source->get_class() + "." + c.signal + "\' to nonexistent method \'" + c.target->get_class() + "." + c.method + "\'"); - ERR_CONTINUE(!valid); + ERR_CONTINUE_MSG(!valid, "Attempt to connect signal '" + c.source->get_class() + "." + c.signal + "' to nonexistent method '" + c.target->get_class() + "." + c.method + "'."); c.source->connect(c.signal, p_new_target, c.method, c.binds, c.flags); } } diff --git a/scene/main/node.h b/scene/main/node.h index 982bfcd620..67b40f6dfc 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -300,7 +300,7 @@ public: }; void get_groups(List<GroupInfo> *p_groups) const; - bool has_persistent_groups() const; + int get_persistent_group_count() const; void move_child(Node *p_child, int p_pos); void raise(); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 5eeaff6411..98d63650d3 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -37,7 +37,6 @@ #include "core/os/os.h" #include "core/print_string.h" #include "core/project_settings.h" -#include "editor/editor_node.h" #include "main/input_default.h" #include "node.h" #include "scene/resources/dynamic_font.h" @@ -117,10 +116,7 @@ SceneTree::Group *SceneTree::add_to_group(const StringName &p_group, Node *p_nod E = group_map.insert(p_group, Group()); } - if (E->get().nodes.find(p_node) != -1) { - ERR_EXPLAIN("Already in group: " + p_group); - ERR_FAIL_V(&E->get()); - } + ERR_FAIL_COND_V_MSG(E->get().nodes.find(p_node) != -1, &E->get(), "Already in group: " + p_group + "."); E->get().nodes.push_back(p_node); //E->get().last_tree_version=0; E->get().changed = true; @@ -647,7 +643,8 @@ void SceneTree::_notification(int p_notification) { case NOTIFICATION_WM_MOUSE_ENTER: case NOTIFICATION_WM_MOUSE_EXIT: case NOTIFICATION_WM_FOCUS_IN: - case NOTIFICATION_WM_FOCUS_OUT: { + case NOTIFICATION_WM_FOCUS_OUT: + case NOTIFICATION_WM_ABOUT: { if (p_notification == NOTIFICATION_WM_FOCUS_IN) { InputDefault *id = Object::cast_to<InputDefault>(Input::get_singleton()); @@ -671,19 +668,6 @@ void SceneTree::_notification(int p_notification) { } break; - case NOTIFICATION_WM_ABOUT: { - -#ifdef TOOLS_ENABLED - if (EditorNode::get_singleton()) { - EditorNode::get_singleton()->show_about(); - } else { -#endif - get_root()->propagate_notification(p_notification); -#ifdef TOOLS_ENABLED - } -#endif - } break; - case NOTIFICATION_CRASH: { get_root()->propagate_notification(p_notification); @@ -1089,7 +1073,7 @@ 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_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()); @@ -1507,8 +1491,11 @@ void SceneTree::_live_edit_instance_node_func(const NodePath &p_parent, const St Node *n2 = n->get_node(p_parent); Node *no = ps->instance(); - no->set_name(p_name); + if (!no) { + continue; + } + no->set_name(p_name); n2->add_child(no); } } diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 98f2fe5e35..afb653e242 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -39,10 +39,6 @@ #include "scene/resources/world.h" #include "scene/resources/world_2d.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class PackedScene; class Node; class Viewport; diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 2ae950dad5..03d46fd28d 100755 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -80,8 +80,7 @@ void Timer::_notification(int p_what) { } void Timer::set_wait_time(float p_time) { - ERR_EXPLAIN("time should be greater than zero."); - ERR_FAIL_COND(p_time <= 0); + ERR_FAIL_COND_MSG(p_time <= 0, "Time should be greater than zero."); wait_time = p_time; } float Timer::get_wait_time() const { diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index d147d43f50..93eea2ad0b 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -65,13 +65,11 @@ void ViewportTexture::setup_local_to_scene() { } Node *vpn = local_scene->get_node(path); - ERR_EXPLAIN("ViewportTexture: Path to node is invalid"); - ERR_FAIL_COND(!vpn); + ERR_FAIL_COND_MSG(!vpn, "ViewportTexture: Path to node is invalid."); vp = Object::cast_to<Viewport>(vpn); - ERR_EXPLAIN("ViewportTexture: Path to node does not point to a viewport"); - ERR_FAIL_COND(!vp); + ERR_FAIL_COND_MSG(!vp, "ViewportTexture: Path to node does not point to a viewport."); vp->viewport_textures.insert(this); @@ -581,7 +579,7 @@ void Viewport::_notification(int p_what) { if (physics_object_capture != 0) { CollisionObject *co = Object::cast_to<CollisionObject>(ObjectDB::get_instance(physics_object_capture)); - if (co) { + if (co && camera) { _collision_object_input_event(co, camera, ev, Vector3(), Vector3(), 0); captured = true; if (mb.is_valid() && mb->get_button_index() == 1 && !mb->is_pressed()) { @@ -2393,8 +2391,7 @@ void Viewport::_gui_remove_from_modal_stack(List<Control *>::Element *MI, Object void Viewport::_gui_force_drag(Control *p_base, const Variant &p_data, Control *p_control) { - ERR_EXPLAIN("Drag data must be a value"); - ERR_FAIL_COND(p_data.get_type() == Variant::NIL); + ERR_FAIL_COND_MSG(p_data.get_type() == Variant::NIL, "Drag data must be a value."); gui.dragging = true; gui.drag_data = p_data; diff --git a/scene/main/viewport.h b/scene/main/viewport.h index b7160d5139..6393785b22 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -36,9 +36,6 @@ #include "scene/resources/texture.h" #include "scene/resources/world_2d.h" #include "servers/visual_server.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Camera; class Camera2D; diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 9a21da7479..53bdb4145f 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -475,6 +475,7 @@ void register_scene_types() { ClassDB::register_class<Shader>(); ClassDB::register_class<VisualShader>(); ClassDB::register_virtual_class<VisualShaderNode>(); + ClassDB::register_class<VisualShaderNodeCustom>(); ClassDB::register_class<VisualShaderNodeInput>(); ClassDB::register_virtual_class<VisualShaderNodeOutput>(); ClassDB::register_class<VisualShaderNodeGroupBase>(); @@ -509,6 +510,7 @@ void register_scene_types() { ClassDB::register_class<VisualShaderNodeVectorRefract>(); ClassDB::register_class<VisualShaderNodeScalarInterp>(); ClassDB::register_class<VisualShaderNodeVectorInterp>(); + ClassDB::register_class<VisualShaderNodeVectorScalarMix>(); ClassDB::register_class<VisualShaderNodeVectorCompose>(); ClassDB::register_class<VisualShaderNodeTransformCompose>(); ClassDB::register_class<VisualShaderNodeVectorDecompose>(); @@ -522,11 +524,13 @@ void register_scene_types() { ClassDB::register_class<VisualShaderNodeVec3Uniform>(); ClassDB::register_class<VisualShaderNodeTransformUniform>(); ClassDB::register_class<VisualShaderNodeTextureUniform>(); + ClassDB::register_class<VisualShaderNodeTextureUniformTriplanar>(); ClassDB::register_class<VisualShaderNodeCubeMapUniform>(); ClassDB::register_class<VisualShaderNodeIf>(); ClassDB::register_class<VisualShaderNodeSwitch>(); ClassDB::register_class<VisualShaderNodeFresnel>(); ClassDB::register_class<VisualShaderNodeExpression>(); + ClassDB::register_class<VisualShaderNodeGlobalExpression>(); ClassDB::register_class<VisualShaderNodeIs>(); ClassDB::register_class<VisualShaderNodeCompare>(); @@ -606,6 +610,7 @@ void register_scene_types() { ClassDB::register_class<PrismMesh>(); ClassDB::register_class<QuadMesh>(); ClassDB::register_class<SphereMesh>(); + ClassDB::register_class<PointMesh>(); ClassDB::register_virtual_class<Material>(); ClassDB::register_class<SpatialMaterial>(); SceneTree::add_idle_callback(SpatialMaterial::flush_changes); @@ -750,7 +755,7 @@ void register_scene_types() { if (theme_path != String()) { Ref<Theme> theme = ResourceLoader::load(theme_path); if (theme.is_valid()) { - Theme::set_default(theme); + Theme::set_project_default(theme); if (font.is_valid()) { Theme::set_default_font(font); } diff --git a/scene/register_scene_types.h b/scene/register_scene_types.h index 3645f88807..b551ad2ac4 100644 --- a/scene/register_scene_types.h +++ b/scene/register_scene_types.h @@ -31,10 +31,6 @@ #ifndef REGISTER_SCENE_TYPES_H #define REGISTER_SCENE_TYPES_H -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - void register_scene_types(); void unregister_scene_types(); diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 64051fe304..985b38f913 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1667,8 +1667,7 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a Vector2 pb = p_post_b; return a.cubic_interpolate(b, pa, pb, p_c); - - } break; + } case Variant::RECT2: { Rect2 a = p_a; @@ -1679,8 +1678,7 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a return Rect2( a.position.cubic_interpolate(b.position, pa.position, pb.position, p_c), a.size.cubic_interpolate(b.size, pa.size, pb.size, p_c)); - - } break; + } case Variant::VECTOR3: { Vector3 a = p_a; @@ -1689,8 +1687,7 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a Vector3 pb = p_post_b; return a.cubic_interpolate(b, pa, pb, p_c); - - } break; + } case Variant::QUAT: { Quat a = p_a; @@ -1699,8 +1696,7 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a Quat pb = p_post_b; return a.cubic_slerp(b, pa, pb, p_c); - - } break; + } case Variant::AABB: { AABB a = p_a; @@ -1711,14 +1707,12 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a return AABB( a.position.cubic_interpolate(b.position, pa.position, pb.position, p_c), a.size.cubic_interpolate(b.size, pa.size, pb.size, p_c)); - } break; + } default: { return _interpolate(p_a, p_b, p_c); } } - - return Variant(); } float Animation::_cubic_interpolate(const float &p_pre_a, const float &p_a, const float &p_b, const float &p_post_b, float p_c) const { @@ -2876,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 (Math::is_zero_approx(v0.distance_to(v2))) { + if (v0 == v2) { //0 and 2 are close, let's see if 1 is close - if (!Math::is_zero_approx(v0.distance_to(v1))) { + if (v0 != v1) { //not close, not optimizable return false; } @@ -2965,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 (Math::is_zero_approx(v0.distance_to(v2))) { + if (v0 == v2) { //0 and 2 are close, let's see if 1 is close - if (!Math::is_zero_approx(v0.distance_to(v1))) { + if (v0 != v1) { //not close, not optimizable return false; } @@ -3028,7 +3022,6 @@ bool Animation::_transform_track_optimize_key(const TKey<TransformKey> &t0, cons //this could be done as a second pass and would be //able to optimize more erase = false; - } else { } } } diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 6fff77d746..d59dfab2c8 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -32,9 +32,7 @@ #define ANIMATION_H #include "core/resource.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class Animation : public Resource { GDCLASS(Animation, Resource); diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index 4b3e392013..5b61654c5d 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -564,7 +564,8 @@ Error AudioStreamSample::save_to_wav(const String &p_path) { file->store_32(sub_chunk_2_size); //Subchunk2Size // Add data - PoolVector<uint8_t>::Read read_data = get_data().read(); + PoolVector<uint8_t> data = get_data(); + PoolVector<uint8_t>::Read read_data = data.read(); switch (format) { case AudioStreamSample::FORMAT_8_BITS: for (unsigned int i = 0; i < data_bytes; i++) { diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index cb710dde43..bb14cf3ab1 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -765,10 +765,7 @@ Vector2 Curve2D::interpolate_baked(float p_offset, bool p_cubic) const { //validate// int pc = baked_point_cache.size(); - if (pc == 0) { - ERR_EXPLAIN("No points in Curve2D."); - ERR_FAIL_V(Vector2()); - } + ERR_FAIL_COND_V_MSG(pc == 0, Vector2(), "No points in Curve2D."); if (pc == 1) return baked_point_cache.get(0); @@ -831,10 +828,7 @@ Vector2 Curve2D::get_closest_point(const Vector2 &p_to_point) const { //validate// int pc = baked_point_cache.size(); - if (pc == 0) { - ERR_EXPLAIN("No points in Curve2D."); - ERR_FAIL_V(Vector2()); - } + ERR_FAIL_COND_V_MSG(pc == 0, Vector2(), "No points in Curve2D."); if (pc == 1) return baked_point_cache.get(0); @@ -870,10 +864,7 @@ float Curve2D::get_closest_offset(const Vector2 &p_to_point) const { //validate// int pc = baked_point_cache.size(); - if (pc == 0) { - ERR_EXPLAIN("No points in Curve2D."); - ERR_FAIL_V(0.0f); - } + ERR_FAIL_COND_V_MSG(pc == 0, 0.0f, "No points in Curve2D."); if (pc == 1) return 0.0f; @@ -1336,10 +1327,7 @@ Vector3 Curve3D::interpolate_baked(float p_offset, bool p_cubic) const { //validate// int pc = baked_point_cache.size(); - if (pc == 0) { - ERR_EXPLAIN("No points in Curve3D."); - ERR_FAIL_V(Vector3()); - } + ERR_FAIL_COND_V_MSG(pc == 0, Vector3(), "No points in Curve3D."); if (pc == 1) return baked_point_cache.get(0); @@ -1381,10 +1369,7 @@ float Curve3D::interpolate_baked_tilt(float p_offset) const { //validate// int pc = baked_tilt_cache.size(); - if (pc == 0) { - ERR_EXPLAIN("No tilts in Curve3D."); - ERR_FAIL_V(0); - } + ERR_FAIL_COND_V_MSG(pc == 0, 0, "No tilts in Curve3D."); if (pc == 1) return baked_tilt_cache.get(0); @@ -1420,10 +1405,7 @@ Vector3 Curve3D::interpolate_baked_up_vector(float p_offset, bool p_apply_tilt) //validate// // curve may not have baked up vectors int count = baked_up_vector_cache.size(); - if (count == 0) { - ERR_EXPLAIN("No up vectors in Curve3D."); - ERR_FAIL_V(Vector3(0, 1, 0)); - } + ERR_FAIL_COND_V_MSG(count == 0, Vector3(0, 1, 0), "No up vectors in Curve3D."); if (count == 1) return baked_up_vector_cache.get(0); @@ -1491,10 +1473,7 @@ Vector3 Curve3D::get_closest_point(const Vector3 &p_to_point) const { //validate// int pc = baked_point_cache.size(); - if (pc == 0) { - ERR_EXPLAIN("No points in Curve3D."); - ERR_FAIL_V(Vector3()); - } + ERR_FAIL_COND_V_MSG(pc == 0, Vector3(), "No points in Curve3D."); if (pc == 1) return baked_point_cache.get(0); @@ -1530,10 +1509,7 @@ float Curve3D::get_closest_offset(const Vector3 &p_to_point) const { //validate// int pc = baked_point_cache.size(); - if (pc == 0) { - ERR_EXPLAIN("No points in Curve3D."); - ERR_FAIL_V(0.0f); - } + ERR_FAIL_COND_V_MSG(pc == 0, 0.0f, "No points in Curve3D."); if (pc == 1) return 0.0f; diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index fb0fb4f8e3..2664abdd2a 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -760,6 +760,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // FileDialog theme->set_icon("folder", "FileDialog", make_icon(icon_folder_png)); + theme->set_color("folder_icon_modulate", "FileDialog", Color(1, 1, 1)); theme->set_color("files_disabled", "FileDialog", Color(0, 0, 0, 0.7)); // colorPicker diff --git a/scene/resources/default_theme/default_theme.h b/scene/resources/default_theme/default_theme.h index cbf0cc1b79..e7d80ffb3d 100644 --- a/scene/resources/default_theme/default_theme.h +++ b/scene/resources/default_theme/default_theme.h @@ -32,9 +32,6 @@ #define DEFAULT_THEME_H #include "scene/resources/theme.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const Ref<Font> &large_font, Ref<Texture> &default_icon, Ref<StyleBox> &default_style, float p_scale); void make_default_theme(bool p_hidpi, Ref<Font> p_font); diff --git a/scene/resources/default_theme/make_header.py b/scene/resources/default_theme/make_header.py index bd5a723b23..cf0ccf1c3a 100755 --- a/scene/resources/default_theme/make_header.py +++ b/scene/resources/default_theme/make_header.py @@ -1,9 +1,14 @@ #!/usr/bin/env python import glob +import os enc = "utf-8" +# Change to the directory where the script is located, +# so that the script can be run from any location +os.chdir(os.path.dirname(os.path.realpath(__file__))) + # Generate include files f = open("theme_data.h", "wb") diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index cf37c57407..11904b7aff 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -339,7 +339,7 @@ static const unsigned char toggle_off_png[] = { }; static const unsigned char toggle_off_disabled_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x0, 0x20, 0x8, 0x6, 0x0, 0x0, 0x0, 0x4e, 0xe8, 0x1b, 0x92, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x12, 0x0, 0x0, 0xb, 0x12, 0x1, 0xd2, 0xdd, 0x7e, 0xfc, 0x0, 0x0, 0x6, 0x3e, 0x49, 0x44, 0x41, 0x54, 0x58, 0x47, 0xed, 0x59, 0x4b, 0x6f, 0x1b, 0x55, 0x14, 0x3e, 0xb6, 0xc7, 0x8e, 0xed, 0xf1, 0x2b, 0x7e, 0x84, 0xb8, 0x49, 0x8a, 0x48, 0x36, 0x55, 0x37, 0x48, 0x5d, 0x64, 0xc1, 0x3a, 0x42, 0x82, 0x14, 0x89, 0x56, 0x14, 0x16, 0x48, 0xfc, 0x1, 0xca, 0x1f, 0x40, 0x20, 0x81, 0x90, 0xf8, 0x1, 0xd0, 0x25, 0x8b, 0x8a, 0x25, 0xa0, 0x82, 0x8a, 0x10, 0x12, 0x42, 0x8, 0x29, 0x5d, 0x15, 0xa9, 0x12, 0x8b, 0x4a, 0x20, 0x51, 0x50, 0x1b, 0xcb, 0x79, 0xf8, 0xed, 0x8c, 0xdf, 0xe3, 0x31, 0xe7, 0xbb, 0x99, 0xeb, 0x4c, 0x26, 0x33, 0xb6, 0x13, 0xbb, 0xb4, 0x42, 0xbd, 0xd2, 0xc9, 0x24, 0x77, 0xee, 0x39, 0x73, 0xbf, 0x7b, 0x1e, 0xf7, 0x9c, 0x13, 0xa2, 0x67, 0xe3, 0xd9, 0x9, 0xfc, 0xaf, 0x4e, 0xc0, 0x33, 0x21, 0x1a, 0xac, 0x93, 0x4, 0x96, 0x49, 0xf9, 0x26, 0x14, 0x7f, 0xe6, 0x65, 0x3, 0x93, 0x13, 0x4f, 0x49, 0x23, 0x85, 0x8d, 0xdb, 0xb8, 0x97, 0xb9, 0x41, 0x7e, 0xb, 0xf9, 0xcc, 0xb9, 0x71, 0xbc, 0x67, 0x46, 0x31, 0x21, 0x23, 0x0, 0x1a, 0x4c, 0x7d, 0xa6, 0x9e, 0x85, 0x30, 0x7, 0x72, 0x1c, 0x6e, 0x9b, 0xc6, 0x3c, 0x80, 0x5, 0x98, 0x22, 0x4c, 0x9, 0x93, 0x62, 0xfc, 0xc, 0x99, 0xe0, 0x71, 0x10, 0x4f, 0xa, 0xb4, 0x4, 0xb, 0xa0, 0x2d, 0xa6, 0x3a, 0x53, 0xd5, 0x24, 0x8d, 0x9f, 0x5d, 0xf3, 0x20, 0xa4, 0x5, 0xc, 0xc1, 0x3b, 0x6d, 0x18, 0x40, 0x14, 0x13, 0x68, 0x86, 0x9f, 0xcb, 0xe9, 0xf4, 0x73, 0xd7, 0x22, 0x91, 0xd8, 0x6b, 0x8a, 0xe2, 0xe3, 0xbf, 0x3d, 0x78, 0xe7, 0xe1, 0x31, 0xa1, 0x22, 0x1e, 0xcf, 0xb2, 0xc1, 0x40, 0x60, 0xe1, 0x1f, 0x3, 0x5d, 0xd7, 0xfb, 0x5, 0x4d, 0xab, 0x7f, 0x5f, 0x2c, 0xee, 0x7d, 0xcd, 0x73, 0x39, 0xa6, 0x2, 0x13, 0x80, 0xeb, 0x76, 0x6d, 0xdb, 0x77, 0xd, 0xb0, 0xd0, 0x6a, 0x9c, 0xe9, 0x7c, 0x22, 0x91, 0xba, 0x92, 0x4c, 0xa6, 0xdf, 0xf3, 0x7a, 0x3d, 0x91, 0x23, 0x7c, 0x56, 0x16, 0x37, 0xd0, 0x27, 0xe, 0xf6, 0x70, 0x6f, 0xc2, 0x20, 0x60, 0x6d, 0xb3, 0x37, 0xe, 0x1c, 0x80, 0x61, 0x18, 0x5a, 0xb9, 0x5c, 0xfc, 0xbc, 0x5a, 0x2d, 0x7d, 0xcb, 0x1f, 0x79, 0xc4, 0x54, 0x33, 0xb5, 0x3d, 0x34, 0x71, 0xfb, 0xee, 0x1, 0x76, 0x9e, 0x69, 0x35, 0x9b, 0x5d, 0x7e, 0x5f, 0x55, 0x23, 0x9b, 0x0, 0xea, 0xf7, 0x7b, 0x29, 0x99, 0x4c, 0x52, 0x34, 0x1a, 0xa5, 0xb9, 0xb9, 0x39, 0xf2, 0x7a, 0xb1, 0x61, 0xe7, 0xc1, 0xc7, 0x4d, 0xb5, 0x5a, 0x8d, 0xa, 0x85, 0x2, 0xf5, 0x60, 0x70, 0xc3, 0x21, 0xf, 0x1, 0xdf, 0xc6, 0x67, 0xdd, 0x65, 0x4c, 0x63, 0x13, 0x0, 0xde, 0x68, 0x1c, 0xfc, 0xb0, 0xb3, 0x93, 0xfb, 0x94, 0xe5, 0xfc, 0xcd, 0x54, 0x31, 0x41, 0x8b, 0xd, 0x48, 0xc0, 0xd2, 0x67, 0xa1, 0xd9, 0xb5, 0x73, 0xe7, 0x56, 0x3e, 0x9, 0x87, 0xd5, 0x97, 0x61, 0xb6, 0xe9, 0x74, 0x42, 0x80, 0x5, 0x88, 0x6a, 0xb5, 0x4a, 0xdd, 0x8e, 0x21, 0x74, 0x65, 0x1f, 0x10, 0xa0, 0x70, 0x68, 0xb, 0x6, 0x83, 0xe2, 0x60, 0x40, 0xa5, 0x52, 0x89, 0xca, 0xc5, 0x9a, 0x43, 0x4, 0x91, 0xda, 0x9e, 0x6, 0x9a, 0x3b, 0x2f, 0x40, 0x37, 0x9b, 0xda, 0x4f, 0xf9, 0xfc, 0xf6, 0x87, 0xbc, 0xea, 0x81, 0xa9, 0x69, 0x4, 0xb7, 0x1, 0x2, 0x13, 0x6, 0x8e, 0x3b, 0xc8, 0x94, 0x9d, 0x9f, 0x4f, 0xbf, 0x1d, 0x8f, 0x27, 0xde, 0x1, 0xd8, 0x6c, 0x36, 0x43, 0xaa, 0xaa, 0x52, 0x3e, 0x9f, 0x67, 0xb0, 0xd, 0xea, 0xf7, 0x9d, 0xa0, 0x1e, 0x7d, 0xd8, 0x60, 0xe5, 0x75, 0xbb, 0x3a, 0x1d, 0x1c, 0x34, 0xa9, 0xdd, 0x6e, 0x88, 0x83, 0xa, 0x86, 0x2, 0xd4, 0xd4, 0x9a, 0xb6, 0x43, 0x7a, 0xbc, 0xfe, 0x8f, 0xbd, 0xfb, 0xfd, 0x81, 0x35, 0x0, 0x6d, 0xb5, 0x9a, 0x7f, 0xf2, 0xb3, 0xc1, 0x4, 0x7f, 0x1e, 0x48, 0xbb, 0xc2, 0x13, 0xd1, 0x78, 0x39, 0x99, 0x4c, 0x5d, 0x87, 0x19, 0x27, 0x93, 0x31, 0xa, 0x85, 0x42, 0x94, 0xcb, 0xe5, 0xa8, 0xd5, 0xc2, 0xda, 0xd3, 0x8d, 0x46, 0xa3, 0x2b, 0x78, 0x21, 0x23, 0x91, 0x8c, 0xfe, 0xe7, 0xe1, 0x1c, 0xa0, 0xe7, 0xe7, 0x53, 0xef, 0xf2, 0xae, 0x57, 0x4c, 0x6c, 0x50, 0xae, 0x47, 0x46, 0xf, 0xdc, 0xb3, 0xf1, 0x4c, 0x66, 0xf1, 0x2d, 0xe, 0x50, 0xa1, 0x0, 0x7, 0xe2, 0x54, 0x2a, 0x45, 0x3b, 0x3b, 0x3b, 0x36, 0x3f, 0x3c, 0x1d, 0x68, 0xf8, 0xf0, 0xee, 0xee, 0xae, 0x90, 0xe5, 0x53, 0x46, 0x5b, 0xc7, 0xe9, 0x24, 0x4f, 0xb6, 0xda, 0xeb, 0xf5, 0x85, 0x18, 0xd3, 0x9b, 0xc0, 0x6, 0x8f, 0x3, 0x97, 0xb8, 0x62, 0x98, 0x0, 0x38, 0xa1, 0xaa, 0xd1, 0x4d, 0x4c, 0x46, 0x93, 0x11, 0x76, 0xfc, 0xc6, 0x99, 0x34, 0x6b, 0xdf, 0x4a, 0xb3, 0xd9, 0x63, 0x7f, 0x6a, 0x52, 0x3c, 0x1e, 0x67, 0x9f, 0xc6, 0x75, 0xe9, 0x3c, 0x7a, 0xbd, 0x36, 0xad, 0xaf, 0xaf, 0xd3, 0xc5, 0x8b, 0x17, 0xa8, 0xd3, 0xe9, 0xd0, 0xd6, 0xd6, 0x1d, 0xda, 0xdb, 0x2b, 0xb1, 0x85, 0x4, 0xe8, 0xea, 0xd5, 0xd7, 0x8f, 0x31, 0xdd, 0xba, 0xf5, 0xdd, 0x89, 0xb9, 0xdb, 0xb7, 0x7f, 0x64, 0x57, 0x3a, 0x38, 0x21, 0x1c, 0x81, 0x97, 0xe3, 0xe7, 0x17, 0xfc, 0x62, 0x8f, 0xa9, 0x63, 0x5, 0x1c, 0xe3, 0x7b, 0x36, 0xd, 0xfc, 0xb1, 0x58, 0x8c, 0xca, 0xe5, 0xf2, 0x64, 0xc7, 0x38, 0xc1, 0x2a, 0x4d, 0xd3, 0x84, 0x3f, 0x8f, 0x2, 0xbc, 0xb1, 0xb1, 0x21, 0x80, 0xde, 0xbc, 0xf9, 0x25, 0x7, 0xca, 0x34, 0x5d, 0xbe, 0xfc, 0xaa, 0xf8, 0x1d, 0x80, 0x31, 0xac, 0x80, 0x9c, 0xe6, 0xdc, 0xb6, 0xa1, 0x28, 0xa, 0x72, 0x9, 0x24, 0x4c, 0x2, 0xab, 0xf4, 0x61, 0xd8, 0x37, 0x82, 0x96, 0x50, 0x7b, 0x20, 0xc0, 0x81, 0x86, 0xb5, 0x32, 0xab, 0x1, 0x59, 0x90, 0x39, 0x4a, 0xbb, 0xcb, 0xcb, 0xe7, 0xe8, 0xfe, 0xfd, 0x3f, 0x38, 0xd8, 0x4, 0xf9, 0x46, 0xd0, 0xe8, 0xc1, 0x83, 0x7f, 0x68, 0x75, 0x75, 0x55, 0xb0, 0xec, 0xef, 0x97, 0x4e, 0xb0, 0x3a, 0xcd, 0x39, 0xcb, 0x17, 0x89, 0x12, 0xb2, 0x43, 0xe1, 0xc3, 0x2, 0x20, 0x7e, 0x91, 0x13, 0xf8, 0x83, 0x4f, 0x85, 0xf4, 0x63, 0x77, 0xe8, 0x74, 0xd0, 0x21, 0xb, 0x32, 0xdd, 0x6, 0x2c, 0xa, 0x0, 0xac, 0x26, 0x59, 0x2c, 0x16, 0x84, 0xa6, 0x8b, 0xc5, 0x22, 0x47, 0xfe, 0xe, 0x5d, 0xba, 0xf4, 0xa2, 0x60, 0xbf, 0x77, 0xef, 0x77, 0xd2, 0xf5, 0xce, 0x89, 0x39, 0x27, 0x73, 0x16, 0xc0, 0xe, 0x33, 0xa6, 0x61, 0xa6, 0x23, 0x77, 0x21, 0x73, 0x53, 0x21, 0x14, 0xc9, 0x3, 0xee, 0xd4, 0xe3, 0x89, 0xc3, 0xd9, 0x41, 0x43, 0x16, 0x64, 0xba, 0xd, 0x45, 0x99, 0xa3, 0x85, 0x85, 0x94, 0xb8, 0xbb, 0xe5, 0xc6, 0xa3, 0xd1, 0x98, 0x0, 0x25, 0x7, 0x80, 0xca, 0x77, 0xd2, 0xa4, 0xad, 0x73, 0x6e, 0xb2, 0xcd, 0x14, 0x14, 0xd9, 0x8e, 0x88, 0x9a, 0xd2, 0xa4, 0x71, 0x29, 0x73, 0x12, 0x3e, 0xe0, 0x5d, 0xd, 0xf8, 0x43, 0x5d, 0xa, 0x87, 0xc3, 0x67, 0x47, 0x68, 0xe3, 0x84, 0x2c, 0xc8, 0x74, 0x1b, 0x0, 0x2, 0xd, 0x27, 0x12, 0x51, 0xb1, 0x4, 0xc0, 0xd7, 0xd6, 0x5e, 0x10, 0xda, 0x9d, 0x7e, 0x0, 0x93, 0x28, 0x30, 0x44, 0xe2, 0x1, 0xd, 0x3, 0x39, 0xc, 0xf8, 0x40, 0xd7, 0x8d, 0x82, 0xdf, 0xef, 0xcb, 0xd6, 0xeb, 0x75, 0x91, 0x70, 0xd4, 0x6a, 0xb3, 0xf1, 0xe3, 0x48, 0x24, 0x42, 0x90, 0x39, 0x6a, 0xdc, 0xb9, 0xb3, 0x45, 0x9b, 0x9b, 0xaf, 0xd0, 0x85, 0xb, 0x1a, 0x47, 0xf4, 0x88, 0xf0, 0x61, 0x19, 0xa5, 0xa7, 0x1, 0xcd, 0x96, 0x85, 0x42, 0x2, 0x1f, 0x17, 0x89, 0x87, 0x35, 0xd3, 0xa, 0x70, 0x76, 0xb2, 0xc0, 0xa9, 0xe1, 0xa5, 0x7e, 0x5b, 0xa7, 0xcc, 0x62, 0x86, 0xaf, 0x25, 0x8d, 0x4d, 0xd1, 0xb5, 0xb4, 0x9c, 0x68, 0x1f, 0xe1, 0xb0, 0x5f, 0xdc, 0xc3, 0xb8, 0x8f, 0xd, 0xc3, 0x3d, 0xc3, 0xe2, 0x8a, 0x87, 0xb6, 0xb7, 0xf3, 0xc4, 0x55, 0xf, 0xdd, 0xbd, 0xfb, 0x1b, 0xe7, 0x0, 0xfb, 0x42, 0x7e, 0xab, 0xd5, 0x10, 0xa6, 0xdd, 0xeb, 0xf5, 0x87, 0x56, 0xe2, 0x34, 0xe7, 0x6e, 0x3d, 0xb5, 0xaf, 0x38, 0xcd, 0xfc, 0x85, 0xdf, 0xe3, 0xda, 0xd1, 0x25, 0x60, 0x61, 0xde, 0xfc, 0xa2, 0xc0, 0xa9, 0xe5, 0x35, 0xc3, 0x33, 0x60, 0xaf, 0x33, 0x28, 0x93, 0xc9, 0x88, 0xd, 0x20, 0x65, 0x3c, 0xcb, 0xf0, 0xb3, 0x94, 0xa5, 0xa5, 0x25, 0xaa, 0x54, 0x2a, 0xd4, 0xe4, 0xcc, 0x6b, 0xdc, 0x80, 0xd9, 0xd7, 0xeb, 0x7, 0x34, 0x18, 0x1c, 0x1d, 0x8c, 0xcf, 0xa7, 0x70, 0x4e, 0xd0, 0x3a, 0xe6, 0x12, 0x4e, 0x73, 0x4e, 0xb2, 0xd, 0xa3, 0xdf, 0xca, 0xe5, 0x1e, 0x7e, 0xc0, 0xef, 0x1e, 0x32, 0x21, 0xbd, 0x34, 0xac, 0x80, 0x45, 0x46, 0xcf, 0x41, 0x4d, 0xf, 0x85, 0xc2, 0x2f, 0xb5, 0xdb, 0x5d, 0x2e, 0x4, 0x2, 0xe2, 0xfe, 0xec, 0x74, 0x9a, 0xa7, 0xd6, 0xb4, 0xaa, 0x6, 0x38, 0x17, 0xcf, 0x72, 0x4e, 0xdd, 0xa6, 0x52, 0xa1, 0xea, 0x58, 0x70, 0x8c, 0x3b, 0x80, 0x69, 0xde, 0x23, 0x58, 0x55, 0x2a, 0xc5, 0xcf, 0x38, 0x97, 0xfe, 0x95, 0xe5, 0x20, 0x18, 0xe0, 0xc4, 0x87, 0x26, 0xd, 0xd9, 0xa2, 0x5d, 0xc2, 0xb, 0x76, 0x82, 0xc1, 0xd0, 0xf3, 0x7e, 0xbf, 0x7f, 0x4d, 0xe3, 0xa4, 0x5f, 0x51, 0xbc, 0xb4, 0xb8, 0xb8, 0x28, 0x9e, 0xb8, 0xe, 0xc, 0x97, 0x2, 0x42, 0xa4, 0x6b, 0xac, 0x51, 0x55, 0xd, 0xf2, 0x75, 0x32, 0x2f, 0xac, 0x43, 0x94, 0x89, 0x7b, 0x65, 0xf7, 0x7e, 0xcb, 0x34, 0x88, 0x46, 0xf0, 0xca, 0x6a, 0x69, 0x7f, 0x7f, 0xf7, 0x6, 0x2f, 0x43, 0x43, 0x40, 0x68, 0x17, 0x2c, 0x6e, 0xf5, 0x30, 0x97, 0x88, 0xe7, 0x3f, 0xe2, 0xe8, 0xba, 0x81, 0x6b, 0x4c, 0x51, 0x3c, 0xc2, 0xf, 0xa7, 0xab, 0x87, 0x1f, 0x13, 0x3a, 0x9b, 0xd8, 0x43, 0xb0, 0x8d, 0x9f, 0xf3, 0xf9, 0x47, 0x1f, 0xf3, 0xab, 0xbf, 0x98, 0x1c, 0xeb, 0x61, 0xc9, 0x26, 0x3b, 0x1e, 0xe8, 0x61, 0x9d, 0xe7, 0x6a, 0xe3, 0xa, 0xd3, 0x75, 0x9f, 0xcf, 0xcb, 0x95, 0x94, 0xac, 0x61, 0xad, 0x25, 0xb4, 0xf5, 0x6b, 0xe3, 0x8a, 0x3, 0xc9, 0x6f, 0x97, 0x33, 0xbb, 0x83, 0xe8, 0xf7, 0xfb, 0x1a, 0x9b, 0xf1, 0x8d, 0x4a, 0x65, 0xd8, 0xf1, 0x40, 0x9f, 0xb, 0xa6, 0xec, 0xd8, 0xf1, 0xb0, 0x82, 0x46, 0x31, 0x81, 0x72, 0x91, 0x73, 0x6b, 0x5a, 0xe1, 0x9e, 0xd6, 0x1b, 0x66, 0x4f, 0x6b, 0x1, 0xd9, 0xd9, 0x93, 0xee, 0x67, 0xc9, 0x8d, 0x1e, 0x26, 0x15, 0xa2, 0xa7, 0xb5, 0x6f, 0xf6, 0xb4, 0xbe, 0xe1, 0x89, 0x6d, 0xd3, 0x67, 0xd1, 0xd3, 0xc2, 0x75, 0x7b, 0x2c, 0xe4, 0x8e, 0xeb, 0x5a, 0xce, 0x31, 0x83, 0xca, 0x4, 0x8d, 0xa3, 0xf5, 0x63, 0xef, 0x5a, 0xce, 0x4e, 0x3d, 0xa7, 0x97, 0x4, 0x20, 0xd6, 0xae, 0x25, 0x4c, 0x17, 0x1a, 0x85, 0xbf, 0x22, 0x45, 0x13, 0x89, 0x86, 0x5d, 0xec, 0xa8, 0xd6, 0x3, 0xde, 0xc9, 0x1c, 0x1b, 0x9, 0xa, 0xb2, 0x7f, 0x68, 0x5e, 0x24, 0xe1, 0x26, 0x9d, 0x7e, 0x9b, 0xb3, 0xe3, 0x90, 0x8d, 0x77, 0xd9, 0x97, 0x86, 0xe9, 0x22, 0xb9, 0x90, 0x40, 0x1d, 0x7d, 0x6c, 0xd2, 0x5e, 0x8b, 0x4, 0xf8, 0x34, 0x0, 0xb5, 0x1f, 0x99, 0xf5, 0xbf, 0xe, 0xe3, 0x2, 0xc9, 0xec, 0x8e, 0xfb, 0x99, 0xa4, 0xa7, 0xf4, 0x4, 0xfe, 0x5, 0x72, 0xf1, 0x9c, 0xca, 0xa6, 0xf4, 0x2a, 0x9a, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 + 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x20, 0x8, 0x3, 0x0, 0x0, 0x0, 0x95, 0x43, 0x8e, 0xb6, 0x0, 0x0, 0x0, 0xfc, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0x14, 0x17, 0x20, 0x20, 0x25, 0x24, 0x24, 0x28, 0x24, 0x24, 0x29, 0x24, 0x24, 0x29, 0x25, 0x25, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x10, 0x13, 0x22, 0x22, 0x27, 0x24, 0x24, 0x28, 0x25, 0x25, 0x28, 0x25, 0x25, 0x29, 0x25, 0x25, 0x27, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19, 0x19, 0x1c, 0x2b, 0x26, 0x2c, 0x40, 0x40, 0x44, 0x4e, 0x4e, 0x52, 0x1a, 0x1a, 0x1d, 0x32, 0x32, 0x37, 0x2c, 0x26, 0x2c, 0x26, 0x25, 0x2a, 0x27, 0x25, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x11, 0x14, 0x2f, 0x26, 0x2d, 0x12, 0x12, 0x14, 0x23, 0x23, 0x27, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, 0x15, 0x18, 0x20, 0x20, 0x25, 0x20, 0x20, 0x24, 0x5b, 0x5b, 0x5f, 0x84, 0x84, 0x87, 0x77, 0x77, 0x7a, 0x20, 0x20, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x69, 0x69, 0x6c, 0x24, 0x24, 0x28, 0x0, 0x0, 0x0, 0x24, 0x24, 0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x24, 0x27, 0x15, 0x15, 0x18, 0x23, 0x23, 0x28, 0x12, 0x12, 0x14, 0x0, 0x0, 0x0, 0x1a, 0x1a, 0x1e, 0x0, 0x0, 0x0, 0x11, 0x11, 0x13, 0x22, 0x22, 0x26, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x71, 0xb, 0x1b, 0xbb, 0x0, 0x0, 0x0, 0x54, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x1, 0x2, 0x3, 0x4, 0x9, 0xe, 0x13, 0x16, 0x18, 0x19, 0xa, 0x26, 0x36, 0x44, 0x4d, 0x52, 0x54, 0x55, 0x6, 0x12, 0x27, 0x43, 0x98, 0xe5, 0xfa, 0xfe, 0xff, 0xff, 0x8, 0x17, 0x35, 0x86, 0xf3, 0xff, 0xff, 0xff, 0xff, 0x7, 0x3a, 0xb4, 0xff, 0xff, 0xff, 0xb9, 0xff, 0xff, 0xff, 0xff, 0xb, 0x28, 0x8a, 0xff, 0x8b, 0xf6, 0x45, 0x5, 0x9b, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xe6, 0x37, 0xf, 0xff, 0xfb, 0x4c, 0xfe, 0x4e, 0x4f, 0x50, 0xfb, 0x9c, 0xf6, 0x8c, 0x3b, 0xbb, 0x3c, 0x87, 0xf3, 0x53, 0x14, 0xd4, 0x6d, 0x6c, 0xf9, 0x0, 0x0, 0x2, 0x3, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xdd, 0x55, 0x85, 0x9a, 0xe2, 0x30, 0x18, 0xbc, 0x7a, 0x8b, 0xbb, 0x7b, 0x2, 0xbb, 0x4d, 0x36, 0xb8, 0x3b, 0xeb, 0xae, 0xef, 0xff, 0x2e, 0x47, 0x48, 0x3f, 0xa0, 0x7a, 0xae, 0x83, 0x56, 0xfe, 0xe9, 0xfc, 0xfe, 0xe9, 0x6f, 0x2, 0xc7, 0xb, 0x82, 0xf8, 0x45, 0x8, 0x2, 0xcf, 0x39, 0x9a, 0xf3, 0xa2, 0x24, 0x2b, 0xaa, 0xe6, 0xfb, 0x2, 0x34, 0x55, 0x91, 0x25, 0x91, 0xb7, 0x3f, 0x5d, 0xf4, 0xab, 0x81, 0x60, 0x28, 0x1c, 0x89, 0xc6, 0x3c, 0x11, 0x8d, 0x84, 0x43, 0xc1, 0x80, 0xea, 0x17, 0x2d, 0x2a, 0xf8, 0x78, 0x22, 0x99, 0x4a, 0x67, 0xb2, 0xb9, 0x7c, 0xe1, 0xb, 0xc8, 0xe7, 0xb2, 0x99, 0x74, 0x2a, 0x99, 0x88, 0xf3, 0x26, 0xfb, 0x62, 0xa9, 0x5c, 0xa9, 0xd6, 0x0, 0x80, 0x10, 0xb2, 0xfb, 0x20, 0x5, 0x80, 0x75, 0xe8, 0x48, 0x52, 0xad, 0x94, 0x4b, 0xc5, 0x23, 0x6, 0xae, 0xa1, 0x9d, 0x9c, 0xd6, 0x80, 0x8e, 0xf0, 0x1e, 0x48, 0xdf, 0xb1, 0xd4, 0x81, 0x8b, 0x8e, 0xd3, 0x13, 0xad, 0xc1, 0x1d, 0xfc, 0x57, 0x82, 0x67, 0x35, 0x48, 0x30, 0x6a, 0xb6, 0x76, 0x97, 0x5b, 0x3a, 0x41, 0x98, 0xb4, 0x77, 0x4a, 0xdc, 0x3c, 0x39, 0xb, 0x2a, 0xfb, 0x38, 0xf0, 0x9d, 0x6e, 0xaf, 0x6, 0x11, 0xea, 0x1f, 0xdf, 0x41, 0x10, 0x6a, 0x7b, 0xc6, 0x62, 0xd0, 0xed, 0xf0, 0x6, 0x81, 0x58, 0xa, 0xd, 0x1, 0xa1, 0xa2, 0x8f, 0xa1, 0x23, 0xd2, 0xf2, 0x62, 0x18, 0x8e, 0x4a, 0x63, 0x26, 0x81, 0x93, 0x2, 0x13, 0xa0, 0xe3, 0xbe, 0xf5, 0xe, 0x82, 0x3d, 0x25, 0x14, 0x26, 0x1, 0x89, 0x11, 0xf0, 0x72, 0x70, 0xba, 0x15, 0x60, 0xbf, 0x3, 0x11, 0xe3, 0xcf, 0x6c, 0xbe, 0x58, 0xa2, 0x42, 0x7f, 0xb1, 0xc5, 0xee, 0x8b, 0x9d, 0x5f, 0xad, 0x37, 0xcc, 0x7, 0x41, 0x9, 0x65, 0x21, 0xbd, 0xd9, 0x8a, 0x3d, 0xe9, 0xf9, 0x7c, 0x46, 0x16, 0xb3, 0x3e, 0x35, 0xa4, 0x5f, 0x6, 0x2e, 0x46, 0x8a, 0xc0, 0x8, 0xd4, 0xcb, 0x2b, 0x88, 0x75, 0x3b, 0x81, 0x8e, 0xd, 0x1, 0xd4, 0x68, 0x8e, 0xfa, 0xe7, 0x94, 0xe0, 0x7c, 0x4f, 0x90, 0xbf, 0x56, 0x45, 0x46, 0x50, 0xba, 0xa9, 0x41, 0xec, 0x10, 0xb0, 0x96, 0x41, 0xd0, 0x3f, 0xdf, 0x7e, 0xe1, 0x79, 0xff, 0xfc, 0xfc, 0x9c, 0x6c, 0xbf, 0xf6, 0x14, 0xb7, 0x25, 0x83, 0x40, 0xd, 0xd7, 0x3c, 0x15, 0x90, 0x9d, 0x2, 0xec, 0xae, 0x40, 0x9, 0xdd, 0x1, 0xef, 0x18, 0xa0, 0x2, 0x59, 0xda, 0x5c, 0xd8, 0xc7, 0x80, 0x97, 0xd7, 0x5f, 0xc8, 0x42, 0x7f, 0x79, 0xbe, 0x9c, 0x17, 0x2c, 0x4, 0xfb, 0x2c, 0xd0, 0x3a, 0xb8, 0xff, 0x42, 0x1d, 0x10, 0x5a, 0x95, 0x33, 0x44, 0xd8, 0x97, 0x81, 0xfb, 0xa4, 0xc4, 0xed, 0x2b, 0xf1, 0x1, 0xfe, 0x40, 0x25, 0xd2, 0x5e, 0x18, 0x7c, 0x7b, 0x2f, 0x3c, 0xd2, 0x5e, 0xf8, 0x72, 0x37, 0x16, 0xbe, 0xdc, 0x8d, 0x6c, 0x1e, 0x3c, 0x3d, 0xd7, 0x40, 0xdb, 0x32, 0xf, 0xbc, 0xec, 0x9f, 0x5f, 0xf6, 0xf3, 0x80, 0x4d, 0x24, 0x2d, 0xf8, 0xfa, 0x6, 0xea, 0x80, 0xd, 0x24, 0x68, 0x0, 0x6c, 0x5f, 0x8e, 0xf6, 0xd5, 0xd7, 0xa0, 0x56, 0x34, 0xcf, 0xb4, 0x86, 0x92, 0xc, 0xa5, 0x33, 0x17, 0xf9, 0xc2, 0x17, 0x91, 0xbf, 0xc8, 0xa4, 0x43, 0x49, 0xa5, 0xc1, 0x5b, 0xa7, 0x72, 0x47, 0xd, 0xac, 0x47, 0xd7, 0xef, 0xb1, 0x2f, 0xe0, 0xfd, 0x7a, 0xb4, 0xe, 0xa8, 0x1d, 0x91, 0xb3, 0x6f, 0x95, 0xb1, 0xb4, 0xf9, 0x28, 0x7d, 0x79, 0x2f, 0x94, 0x3e, 0x36, 0xd2, 0x98, 0xe7, 0x5c, 0x36, 0x93, 0xf8, 0x15, 0xa0, 0x9b, 0xe9, 0xff, 0xc2, 0x67, 0x14, 0xf4, 0xa5, 0xb3, 0x35, 0x5e, 0x63, 0x97, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; static const unsigned char toggle_on_png[] = { @@ -347,7 +347,7 @@ static const unsigned char toggle_on_png[] = { }; static const unsigned char toggle_on_disabled_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x20, 0x8, 0x6, 0x0, 0x0, 0x0, 0xa2, 0x9d, 0x7e, 0x84, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x12, 0x0, 0x0, 0xb, 0x12, 0x1, 0xd2, 0xdd, 0x7e, 0xfc, 0x0, 0x0, 0x6, 0x54, 0x49, 0x44, 0x41, 0x54, 0x68, 0x43, 0xed, 0x59, 0x4b, 0x6f, 0x1b, 0x55, 0x14, 0x3e, 0x71, 0xfc, 0x9a, 0xd8, 0x4e, 0x9c, 0x38, 0x6e, 0x62, 0xe7, 0x21, 0xb5, 0x6e, 0x51, 0xd5, 0x5, 0xa8, 0xac, 0x93, 0x14, 0x89, 0x22, 0x84, 0xba, 0x60, 0x53, 0xb1, 0x29, 0x12, 0x42, 0xa0, 0xfe, 0x1, 0x7e, 0x1, 0x7b, 0xb6, 0x6c, 0xaa, 0x82, 0xa8, 0xc4, 0x96, 0x5f, 0x50, 0x21, 0x55, 0x34, 0x1b, 0x4a, 0x17, 0x65, 0x51, 0x9, 0x85, 0x3c, 0x9b, 0xb4, 0x4d, 0xfd, 0x76, 0xfc, 0x7e, 0xf3, 0x7d, 0x37, 0x33, 0xc6, 0x76, 0xed, 0xcc, 0x38, 0x4e, 0x52, 0x21, 0x7a, 0xa4, 0xa3, 0xc9, 0x4c, 0xee, 0x3d, 0xf7, 0xbc, 0xee, 0xb9, 0xdf, 0x3d, 0x16, 0x79, 0x4b, 0x6f, 0x3d, 0xf0, 0xbf, 0xf6, 0xc0, 0xc8, 0x80, 0xd6, 0x73, 0xbc, 0xc1, 0x9c, 0x3a, 0xe8, 0xfc, 0x1, 0x97, 0xb3, 0x3c, 0xbc, 0xa9, 0x8f, 0xe4, 0xd3, 0x60, 0x4b, 0x93, 0xad, 0x1a, 0x60, 0x83, 0x34, 0xb2, 0xa3, 0x8d, 0x47, 0xf5, 0x6f, 0x56, 0x65, 0x58, 0x52, 0xe8, 0x18, 0x83, 0x68, 0x70, 0x3, 0x5c, 0x7, 0x57, 0xdb, 0x98, 0xdf, 0xc8, 0x47, 0x92, 0x99, 0xf2, 0xfc, 0x3f, 0xd, 0x75, 0x82, 0xbd, 0x60, 0xbf, 0xce, 0xe3, 0x78, 0x6a, 0xba, 0x33, 0xe8, 0x18, 0x33, 0x39, 0x66, 0x7a, 0x1c, 0xf7, 0xff, 0x86, 0xf1, 0x34, 0xbc, 0x8, 0x3e, 0x0, 0xa7, 0x75, 0xce, 0xe1, 0x59, 0xd1, 0x1d, 0x63, 0x64, 0xc8, 0x6b, 0xeb, 0x1c, 0xa5, 0x38, 0xd, 0xb3, 0xeb, 0x86, 0x7, 0xf1, 0x9c, 0xf7, 0xf9, 0x26, 0x96, 0xc1, 0x1f, 0x39, 0x9d, 0xce, 0xb, 0x36, 0xdb, 0xe8, 0xb8, 0xcd, 0x66, 0xd3, 0x46, 0x40, 0xc7, 0xd5, 0xfe, 0x24, 0xe6, 0x35, 0x41, 0x8d, 0x46, 0xa3, 0xd8, 0x68, 0xd4, 0xf, 0x2a, 0x95, 0xca, 0x66, 0x36, 0x9b, 0xb9, 0xf, 0x7e, 0x8, 0xd9, 0x7b, 0xe0, 0x18, 0x98, 0x8e, 0xa8, 0xf5, 0xcb, 0x86, 0x7e, 0xca, 0xd3, 0x78, 0x46, 0x7d, 0x2, 0xbc, 0x38, 0x36, 0xe6, 0x5d, 0x9, 0x4, 0x82, 0xb7, 0x5d, 0x2e, 0xf7, 0x3b, 0x6f, 0xd8, 0x5e, 0x53, 0x9f, 0xc1, 0x1f, 0x52, 0x2e, 0x97, 0xd6, 0x12, 0x89, 0xd8, 0x9d, 0x42, 0x21, 0xf7, 0x1b, 0x26, 0x3c, 0x3, 0x67, 0xf4, 0x6c, 0x78, 0x6d, 0x4b, 0xf4, 0x72, 0x0, 0xbf, 0xd1, 0xf8, 0x49, 0xf0, 0x85, 0xc9, 0xc9, 0xe9, 0xcf, 0xa7, 0xa6, 0xa6, 0xbf, 0x42, 0xb4, 0xf9, 0xed, 0x4c, 0x49, 0xd3, 0xec, 0x32, 0x3b, 0x3b, 0x2b, 0x93, 0x93, 0x93, 0xa2, 0x69, 0x9a, 0x40, 0x87, 0xbe, 0xeb, 0xd7, 0x6a, 0x35, 0x89, 0xc7, 0xe3, 0xb2, 0xb7, 0xb7, 0x27, 0xc5, 0x62, 0x4d, 0x90, 0x15, 0x95, 0x64, 0x32, 0xfe, 0x43, 0x2a, 0x15, 0xff, 0x19, 0x93, 0x36, 0xc1, 0x29, 0xdd, 0x9, 0x1d, 0xdb, 0xa1, 0xdb, 0x1, 0xc6, 0x9e, 0x67, 0xe4, 0x23, 0x53, 0x53, 0xc1, 0xaf, 0x61, 0xfc, 0xd7, 0x67, 0x9e, 0xe6, 0xb6, 0x51, 0x59, 0x98, 0xb, 0xca, 0xcc, 0xcc, 0x8c, 0x24, 0x12, 0x9, 0x65, 0x58, 0x36, 0x87, 0x6d, 0xde, 0xec, 0x51, 0xd3, 0xb0, 0x3, 0x35, 0xb7, 0x4d, 0x3c, 0x1e, 0x8f, 0xf8, 0xfd, 0x7e, 0xe5, 0xac, 0xfd, 0xfd, 0x7d, 0xd9, 0x7d, 0x1e, 0x93, 0x66, 0xbd, 0xd6, 0x84, 0x13, 0xee, 0x26, 0x93, 0xb1, 0xbb, 0xb0, 0x67, 0x43, 0xcf, 0x4, 0x16, 0xcb, 0x96, 0x13, 0x58, 0xe0, 0xda, 0x89, 0x2e, 0x76, 0x83, 0x43, 0x1e, 0x8f, 0xef, 0xe3, 0x60, 0x70, 0xe6, 0x1b, 0x78, 0xbd, 0x7b, 0xcc, 0xe9, 0x66, 0x1, 0x96, 0x8b, 0x9c, 0x9f, 0x93, 0x89, 0x89, 0x9, 0xd9, 0xdc, 0xdc, 0x84, 0x31, 0x9, 0xa9, 0x54, 0xb8, 0x85, 0xfb, 0xd5, 0xb1, 0xa6, 0xd4, 0x6a, 0xd, 0x29, 0x14, 0xca, 0x92, 0x4c, 0x66, 0xf0, 0xcc, 0x4a, 0x28, 0x14, 0x12, 0xaf, 0xc7, 0x2d, 0xa9, 0x4c, 0x7e, 0xc4, 0xed, 0x72, 0xbd, 0x57, 0xa9, 0x94, 0xb7, 0xaa, 0xd5, 0xca, 0x2e, 0x84, 0xe4, 0xc1, 0x1d, 0xc2, 0xba, 0x8d, 0xe3, 0x3b, 0x2b, 0xfd, 0xa5, 0x50, 0x68, 0xfe, 0x5b, 0x87, 0xc3, 0x11, 0x38, 0x5d, 0x6b, 0xbb, 0xa4, 0x23, 0x9a, 0xe1, 0x50, 0x40, 0x45, 0x71, 0x6d, 0x6d, 0x4d, 0x72, 0xb9, 0xf2, 0xc0, 0xcb, 0x97, 0x4a, 0x55, 0x39, 0x38, 0x48, 0x29, 0x27, 0x8c, 0xda, 0x9a, 0x92, 0xcb, 0x97, 0x6c, 0x28, 0xda, 0x91, 0x4c, 0x26, 0xc5, 0x7a, 0xc0, 0x6d, 0x40, 0xa1, 0x2d, 0x6f, 0xb6, 0x6f, 0x2a, 0xa6, 0x3f, 0xcf, 0xf9, 0x89, 0xf1, 0x71, 0xff, 0xa, 0xa, 0xde, 0xf9, 0x81, 0x57, 0x1f, 0x72, 0x82, 0xcb, 0x39, 0xa2, 0x14, 0xdf, 0xd9, 0xd9, 0x51, 0xfb, 0xf8, 0xb8, 0xc4, 0xb9, 0x94, 0x11, 0xe, 0x87, 0x85, 0x32, 0x69, 0xb, 0x6c, 0x5a, 0xa6, 0x6d, 0x60, 0x9e, 0x6c, 0x2d, 0xea, 0xe5, 0x0, 0xbf, 0xd7, 0x3b, 0x7e, 0xdd, 0xea, 0xe2, 0x73, 0x73, 0x61, 0xb9, 0x7a, 0xf5, 0x5d, 0xb9, 0x75, 0xeb, 0x33, 0xb9, 0x79, 0xf3, 0x53, 0xec, 0xdb, 0xc3, 0xa4, 0xd1, 0x34, 0xa7, 0xfa, 0x66, 0x43, 0x14, 0x8c, 0xf7, 0x6b, 0xd7, 0x96, 0x8e, 0x14, 0x1b, 0xc, 0x6, 0x11, 0xbd, 0x3, 0x49, 0xa7, 0x99, 0xa9, 0xc3, 0x11, 0x65, 0x64, 0x32, 0x19, 0xa1, 0x4c, 0x92, 0xd7, 0xeb, 0xa3, 0x4d, 0x2c, 0xec, 0x2c, 0xe6, 0xad, 0xda, 0xd7, 0xcb, 0x1, 0xe3, 0x48, 0x19, 0xcb, 0xd1, 0xbf, 0x78, 0xf1, 0x2, 0x3c, 0xec, 0x92, 0x7, 0xf, 0x56, 0xe5, 0xfe, 0xfd, 0x5f, 0xe5, 0xfa, 0xf5, 0xf, 0x85, 0x4e, 0x31, 0x68, 0x79, 0x99, 0x8e, 0xb7, 0x46, 0x4c, 0xfd, 0x74, 0x9a, 0x38, 0xe6, 0x64, 0x88, 0xb2, 0x28, 0x93, 0xe4, 0x74, 0xba, 0x22, 0x78, 0x10, 0xc0, 0x31, 0x3, 0x7a, 0x3a, 0x80, 0xe3, 0x58, 0x3, 0xdc, 0x4, 0x39, 0x56, 0x54, 0xa0, 0xa1, 0xf3, 0xf3, 0x61, 0x79, 0xfa, 0xf4, 0x2f, 0x79, 0xfe, 0xfc, 0x5, 0x3c, 0x9e, 0x93, 0x8d, 0x8d, 0x2d, 0x44, 0xfd, 0x70, 0x76, 0x34, 0x9a, 0x40, 0x4, 0x2, 0x2a, 0x1b, 0xac, 0x10, 0x8f, 0xba, 0x7c, 0x7e, 0xf8, 0xe8, 0x1b, 0x6b, 0x51, 0x16, 0x65, 0x2a, 0xc3, 0x46, 0xed, 0xac, 0x6d, 0x7c, 0xa1, 0x8d, 0x7d, 0x1d, 0xa0, 0x8e, 0x41, 0x22, 0x3c, 0x2b, 0xa, 0xe3, 0x88, 0x51, 0x46, 0x66, 0xb3, 0xd9, 0xd6, 0xf0, 0x78, 0x3c, 0x26, 0xd3, 0xd3, 0xd3, 0xea, 0x1d, 0xd5, 0x57, 0x9e, 0x3c, 0xf9, 0x53, 0x96, 0x96, 0xac, 0x65, 0x1, 0x8a, 0xae, 0x14, 0x8a, 0xa6, 0xf0, 0xdd, 0x8a, 0x6a, 0x6a, 0xc, 0x65, 0x51, 0x26, 0x49, 0xc7, 0x31, 0xaf, 0xc1, 0xf6, 0x6e, 0x64, 0xa1, 0xb0, 0x35, 0xd0, 0x14, 0xb1, 0xb5, 0x29, 0xd9, 0xed, 0x2e, 0x39, 0x77, 0x2e, 0x20, 0x3e, 0x9f, 0xaf, 0x35, 0xd6, 0xe7, 0x1b, 0x57, 0x86, 0x1b, 0xb4, 0xbe, 0xbe, 0xcd, 0xf4, 0x93, 0xcb, 0x97, 0x2f, 0x9b, 0xca, 0xab, 0x56, 0xab, 0x32, 0xa6, 0xf5, 0x7, 0x3b, 0xa6, 0x2, 0xba, 0x6, 0x50, 0x16, 0x65, 0x92, 0x8, 0x8c, 0xf8, 0x0, 0x77, 0x9c, 0xa7, 0xdd, 0xab, 0x11, 0x24, 0x14, 0xeb, 0xf5, 0x9a, 0xa5, 0x8d, 0xc8, 0xc8, 0x33, 0x3, 0xfc, 0xfe, 0x43, 0x7, 0xd0, 0x11, 0x91, 0xc8, 0x79, 0x5, 0x5c, 0xda, 0xe9, 0xf1, 0xe3, 0xdf, 0xe5, 0xca, 0x15, 0x73, 0x7, 0x14, 0x8b, 0x45, 0x5, 0x68, 0x4e, 0x8a, 0x28, 0x8b, 0x32, 0x49, 0xba, 0x4d, 0x7c, 0xe9, 0x0, 0x42, 0xed, 0x47, 0x2, 0x3d, 0x43, 0x77, 0x65, 0x71, 0xa9, 0xd8, 0x70, 0x38, 0x9c, 0xe7, 0xac, 0x28, 0xb2, 0xba, 0xfa, 0x50, 0x6e, 0xdc, 0xf8, 0x4, 0x11, 0xce, 0x1, 0xbc, 0x78, 0x55, 0xd, 0x78, 0xf5, 0x2a, 0xd1, 0xb1, 0xef, 0xf9, 0x4e, 0x47, 0x99, 0x51, 0x2a, 0x95, 0x52, 0x68, 0x2e, 0x16, 0xb3, 0xe4, 0x7f, 0x33, 0x71, 0x4a, 0x16, 0x65, 0x92, 0x90, 0x95, 0x44, 0x82, 0xbc, 0x2d, 0x1e, 0x9, 0x84, 0xd4, 0x25, 0x8, 0xd0, 0xd7, 0x87, 0x63, 0x63, 0xc5, 0x74, 0x5, 0x4a, 0xab, 0xd5, 0x65, 0x77, 0xf7, 0x5, 0x40, 0xcb, 0x81, 0x3c, 0x7a, 0xf4, 0x87, 0xbc, 0x7c, 0x19, 0x55, 0xd3, 0x8, 0x63, 0xa3, 0xd1, 0x7d, 0x14, 0xb5, 0xc3, 0x8, 0x6c, 0x6f, 0x6f, 0x22, 0x1a, 0x85, 0xd6, 0x7b, 0x2f, 0xd9, 0xe5, 0x72, 0x51, 0x16, 0x16, 0x16, 0x30, 0x2e, 0x27, 0x4, 0x34, 0xc3, 0x90, 0xdf, 0xef, 0x51, 0x38, 0x60, 0x6b, 0x6b, 0xb, 0xd1, 0x6f, 0xc2, 0x11, 0x89, 0x7b, 0xb8, 0x24, 0x3d, 0x82, 0xcc, 0xa4, 0xee, 0x4, 0x25, 0xbe, 0x17, 0xcc, 0xb5, 0x61, 0x60, 0x11, 0xe, 0x58, 0xb6, 0xdb, 0xed, 0x87, 0x67, 0x88, 0x9, 0x21, 0x63, 0x70, 0x7e, 0x67, 0xa5, 0xd9, 0xfc, 0xf7, 0x6a, 0xc1, 0xed, 0x61, 0x18, 0xcf, 0xe9, 0xfc, 0x5f, 0xfb, 0x7b, 0x2f, 0x91, 0x75, 0xec, 0xd0, 0x11, 0x6c, 0x53, 0x2a, 0x4e, 0x34, 0x47, 0x88, 0x7b, 0x1c, 0xe2, 0x25, 0x2a, 0x12, 0x89, 0x20, 0x13, 0x5f, 0x49, 0x3a, 0x53, 0xe0, 0xed, 0x70, 0x2b, 0x1a, 0x7d, 0xf9, 0x3d, 0x64, 0xed, 0x80, 0x79, 0xcc, 0xb4, 0x4, 0xf7, 0x72, 0x0, 0xb7, 0xc2, 0x8, 0x6e, 0x57, 0x39, 0xdc, 0x7, 0x3e, 0x40, 0x36, 0x9c, 0x5c, 0x55, 0xb2, 0x60, 0x4d, 0x36, 0x5f, 0x56, 0x38, 0x9e, 0x88, 0xb0, 0x54, 0xca, 0x43, 0xf9, 0xc1, 0x32, 0x81, 0x91, 0xa7, 0xf1, 0xb9, 0x5c, 0x4e, 0x9e, 0xed, 0x45, 0xa5, 0x51, 0xaf, 0xd5, 0x62, 0xb1, 0xfd, 0xef, 0x70, 0x17, 0x60, 0xf4, 0x59, 0x9c, 0x58, 0xc, 0xfb, 0x5e, 0x86, 0xa8, 0xa2, 0x6a, 0x2f, 0x61, 0x42, 0x86, 0xc6, 0x6b, 0xda, 0xd8, 0xfb, 0x67, 0x7a, 0x1b, 0xc4, 0x7d, 0x3e, 0x5, 0x3c, 0xe1, 0x74, 0xd8, 0x64, 0x71, 0x71, 0x11, 0x20, 0xcb, 0x81, 0x14, 0xae, 0x48, 0xa5, 0x6a, 0xe8, 0xdc, 0xde, 0x96, 0xc4, 0xdf, 0x88, 0x8f, 0xa6, 0x8d, 0xaa, 0x42, 0x1c, 0xe, 0xcf, 0x2, 0x84, 0xcd, 0xa1, 0x86, 0xc4, 0x64, 0xfb, 0xd9, 0xbe, 0xba, 0xd, 0x22, 0xf5, 0x7f, 0x44, 0x36, 0xfd, 0x2, 0x9b, 0xd8, 0x20, 0xe9, 0x88, 0x3e, 0x8d, 0x35, 0xeb, 0x7, 0x44, 0xd0, 0x8, 0xf9, 0xd2, 0xef, 0xf, 0x7c, 0x81, 0x73, 0xb4, 0x3, 0x43, 0x5b, 0x8, 0xe6, 0xd0, 0x43, 0x86, 0xec, 0x7, 0xd4, 0xd2, 0xe9, 0xc4, 0x3d, 0x34, 0x46, 0x7e, 0x82, 0x22, 0xeb, 0x60, 0x4b, 0xfd, 0x0, 0x43, 0x69, 0xa3, 0x23, 0x44, 0xf4, 0xb4, 0xe8, 0xf1, 0x78, 0x57, 0xd0, 0x1b, 0xb8, 0xed, 0x76, 0x6b, 0x97, 0x86, 0xb6, 0xea, 0xc, 0x4, 0x94, 0x4a, 0xc5, 0xbf, 0xd1, 0x3, 0xb8, 0x93, 0xcf, 0xb7, 0x3a, 0x42, 0x3c, 0x56, 0xc, 0x1c, 0xd0, 0xa1, 0x81, 0x59, 0x4f, 0x90, 0x30, 0x8a, 0xcd, 0x50, 0x42, 0xbb, 0x5, 0xf4, 0x3, 0x97, 0xf4, 0x9e, 0xe0, 0x45, 0x42, 0xcb, 0x37, 0xd1, 0x25, 0xea, 0xe5, 0x3f, 0x82, 0x1c, 0x9e, 0xf3, 0x28, 0xc6, 0xeb, 0x7a, 0x4f, 0x70, 0x15, 0xe3, 0x78, 0xff, 0xe7, 0x9e, 0x67, 0x4f, 0x90, 0x85, 0xa4, 0x67, 0x45, 0x35, 0x6b, 0x68, 0x1a, 0x1d, 0x22, 0x17, 0x4, 0x10, 0xa1, 0x30, 0x23, 0x78, 0x32, 0x74, 0x77, 0x85, 0xcf, 0x20, 0xae, 0x7d, 0x97, 0xa0, 0x61, 0xed, 0x5d, 0x61, 0xa6, 0x3a, 0x23, 0xce, 0xfd, 0x4e, 0x48, 0xda, 0x1, 0x7c, 0xba, 0xa5, 0x98, 0x39, 0x80, 0xe3, 0x8d, 0xaa, 0xc3, 0x13, 0x83, 0x75, 0x80, 0x37, 0x1b, 0x66, 0x86, 0x71, 0xa9, 0xb0, 0x22, 0xe3, 0x34, 0x1d, 0x64, 0xfc, 0x10, 0x62, 0xfc, 0x2e, 0xc0, 0x54, 0x27, 0xd8, 0x31, 0xc, 0xef, 0xdb, 0x12, 0x37, 0x8c, 0x1b, 0x44, 0xb9, 0xae, 0x12, 0x3c, 0xc8, 0xd4, 0x53, 0x1f, 0xdb, 0xfe, 0xab, 0xd0, 0x91, 0x46, 0x9f, 0xba, 0x26, 0x6f, 0x17, 0xf8, 0xf, 0x79, 0xe0, 0x1f, 0xd, 0x80, 0x80, 0xb4, 0xad, 0xe9, 0x2a, 0x4d, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 + 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x20, 0x8, 0x3, 0x0, 0x0, 0x0, 0x95, 0x43, 0x8e, 0xb6, 0x0, 0x0, 0x1, 0x53, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xd, 0xf, 0x1a, 0x1a, 0x1e, 0x20, 0x20, 0x24, 0x22, 0x22, 0x27, 0x24, 0x24, 0x29, 0x25, 0x25, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0xa, 0xc, 0x1d, 0x1d, 0x21, 0x24, 0x24, 0x29, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x11, 0x14, 0x23, 0x23, 0x28, 0x2e, 0x2e, 0x2e, 0x46, 0x46, 0x46, 0x57, 0x57, 0x57, 0x60, 0x60, 0x60, 0x62, 0x62, 0x62, 0x5e, 0x5e, 0x5e, 0x4a, 0x4a, 0x4a, 0x12, 0x12, 0x15, 0x25, 0x27, 0x2d, 0x42, 0x42, 0x42, 0x59, 0x59, 0x59, 0x32, 0x32, 0x32, 0x25, 0x26, 0x2d, 0x25, 0x25, 0x2b, 0x25, 0x26, 0x2c, 0x39, 0x39, 0x39, 0x49, 0x49, 0x49, 0x5a, 0x5a, 0x5a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb, 0xb, 0xd, 0x23, 0x23, 0x28, 0x48, 0x48, 0x48, 0x54, 0x54, 0x54, 0x34, 0x34, 0x34, 0x35, 0x35, 0x35, 0xb, 0xb, 0xd, 0x1e, 0x1e, 0x22, 0x25, 0x26, 0x2b, 0x3f, 0x3f, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xe, 0x10, 0x2c, 0x2c, 0x2c, 0x58, 0x58, 0x58, 0x1a, 0x1a, 0x1e, 0x40, 0x40, 0x44, 0x56, 0x56, 0x58, 0x80, 0x80, 0x80, 0x79, 0x79, 0x79, 0x3c, 0x3c, 0x3d, 0x2e, 0x2e, 0x30, 0x27, 0x27, 0x29, 0x64, 0x64, 0x66, 0x41, 0x41, 0x41, 0x1a, 0x1a, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5d, 0x5d, 0x5f, 0x34, 0x34, 0x36, 0x52, 0x52, 0x52, 0x3a, 0x3a, 0x3a, 0x20, 0x20, 0x24, 0x0, 0x0, 0x0, 0x32, 0x32, 0x37, 0x42, 0x42, 0x44, 0x6a, 0x6a, 0x6d, 0x5b, 0x5b, 0x5b, 0x2f, 0x2f, 0x2f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x49, 0x49, 0x4a, 0x0, 0x0, 0x0, 0x50, 0x50, 0x51, 0x70, 0x70, 0x74, 0xe, 0xe, 0x10, 0xb, 0xb, 0xd, 0x0, 0x0, 0x0, 0x13, 0x13, 0x15, 0x0, 0x0, 0x0, 0xb, 0xb, 0xc, 0x1d, 0x1d, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xbd, 0xb, 0x85, 0x35, 0x0, 0x0, 0x0, 0x71, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x1, 0x2, 0x3, 0x4, 0x9, 0xe, 0x13, 0x16, 0x18, 0x19, 0xa, 0x26, 0x36, 0x44, 0x4d, 0x52, 0x54, 0x55, 0x6, 0x12, 0x27, 0x43, 0x80, 0xc5, 0xe7, 0xf5, 0xfe, 0xff, 0x8, 0x17, 0x35, 0x73, 0xd9, 0xff, 0x7, 0x3a, 0x96, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb, 0x28, 0x76, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x77, 0xde, 0xff, 0xff, 0x45, 0x5, 0x82, 0xff, 0xff, 0xc6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc6, 0x37, 0xf, 0xff, 0xff, 0xff, 0xff, 0xe9, 0x4c, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4e, 0x4f, 0xff, 0x50, 0xff, 0xff, 0x83, 0x78, 0x3b, 0x9c, 0x3c, 0x74, 0xda, 0x53, 0x14, 0x49, 0x96, 0x6e, 0xf, 0x0, 0x0, 0x1, 0xfa, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0x62, 0x18, 0x5e, 0x0, 0xd0, 0x5c, 0x39, 0x28, 0x49, 0x12, 0xc0, 0x60, 0xb8, 0xda, 0xdd, 0xcb, 0x31, 0x33, 0xb6, 0x6d, 0xdb, 0x5e, 0xdb, 0xd6, 0xfb, 0x17, 0x4e, 0x7d, 0x37, 0xe6, 0xf9, 0x2b, 0x23, 0x7f, 0x9c, 0x20, 0x28, 0x86, 0xe1, 0xb, 0xc1, 0x30, 0x14, 0x99, 0x6a, 0x8e, 0xe2, 0x4, 0x49, 0xd1, 0xcc, 0xda, 0x2, 0x18, 0x9a, 0x22, 0x9, 0x1c, 0x9d, 0xf4, 0x8e, 0xaf, 0xd3, 0x1b, 0x9b, 0x5b, 0xdb, 0x1c, 0x2e, 0x6f, 0x2e, 0x5c, 0xce, 0xf6, 0xd6, 0xe6, 0x6, 0xbd, 0x8e, 0x8f, 0x45, 0x81, 0xf2, 0x5, 0x42, 0x91, 0x58, 0x22, 0x95, 0xc9, 0x61, 0x1, 0x72, 0x99, 0x54, 0x22, 0x16, 0x9, 0x5, 0x7c, 0x74, 0xc4, 0x5e, 0xa1, 0x54, 0xa9, 0x35, 0x5a, 0x58, 0x12, 0xad, 0x46, 0xad, 0x52, 0x2a, 0x86, 0x14, 0x10, 0x1d, 0xa3, 0x37, 0x18, 0x61, 0x1e, 0x26, 0xb3, 0xc5, 0x6a, 0x63, 0xb1, 0x3b, 0x4c, 0x60, 0x34, 0xe8, 0x19, 0x1d, 0x32, 0xc8, 0x9f, 0xda, 0x74, 0xce, 0x8d, 0xdd, 0xe5, 0xf6, 0x98, 0xbd, 0x3e, 0xff, 0x57, 0x2, 0xa6, 0x60, 0x28, 0xec, 0x76, 0xc9, 0x9d, 0x9b, 0x54, 0xbf, 0xe, 0x68, 0x24, 0x1a, 0x8b, 0xcf, 0xb5, 0x4f, 0x24, 0x53, 0x30, 0x44, 0x3a, 0x99, 0x70, 0xc5, 0x33, 0xd1, 0xc8, 0x8f, 0x24, 0x70, 0xe5, 0x56, 0x16, 0xe6, 0x90, 0xcb, 0x27, 0x4d, 0x63, 0x9, 0x25, 0xf3, 0xb9, 0x6c, 0x41, 0x59, 0x64, 0x43, 0x40, 0x88, 0x8d, 0x12, 0xcc, 0xa3, 0x5c, 0x49, 0xc3, 0x18, 0x69, 0x4f, 0x19, 0x4a, 0x1b, 0x4, 0x2b, 0x80, 0x92, 0x9b, 0x55, 0xe8, 0x53, 0xab, 0x37, 0x9a, 0x2d, 0x68, 0x37, 0x3a, 0xd0, 0xee, 0x2, 0x4b, 0xcf, 0x1, 0x13, 0x38, 0x7a, 0xb0, 0xb3, 0xbb, 0xc7, 0xe6, 0x80, 0x51, 0x5b, 0x52, 0xe8, 0xd3, 0xdd, 0xaf, 0x1d, 0x34, 0x6a, 0xed, 0x46, 0x77, 0x20, 0x70, 0x78, 0x4, 0x13, 0x1c, 0x1d, 0xc2, 0x71, 0x81, 0xc2, 0x58, 0x1, 0xfa, 0x44, 0x36, 0x8, 0xa0, 0x71, 0xa, 0xb0, 0x7f, 0xd6, 0x3e, 0x6f, 0xb6, 0xfb, 0x2, 0x17, 0x97, 0x30, 0xc1, 0xe5, 0x5, 0x18, 0xaf, 0x68, 0x9c, 0x15, 0x50, 0x5e, 0xf, 0x7a, 0xd8, 0x3e, 0x7, 0x80, 0x9b, 0x7a, 0xbb, 0x7b, 0x73, 0xde, 0x17, 0xb0, 0xfa, 0x60, 0x2, 0x9f, 0x15, 0xe0, 0x56, 0xf9, 0x5d, 0x80, 0xde, 0x1e, 0xc, 0xd1, 0xe9, 0xd7, 0x8, 0xea, 0x77, 0xed, 0x2e, 0xdc, 0xd7, 0x97, 0x8e, 0x80, 0xda, 0x3a, 0x86, 0x3e, 0xe7, 0x67, 0x70, 0xda, 0x6c, 0xb5, 0xbb, 0xd0, 0x6a, 0x2c, 0x5b, 0x3, 0x94, 0xdc, 0xad, 0x42, 0x9f, 0x76, 0xf3, 0xbc, 0x59, 0x87, 0xaf, 0xe1, 0x9f, 0x2f, 0xd5, 0x5, 0x76, 0xe, 0x1e, 0x60, 0xc0, 0xe9, 0x59, 0x7, 0xa0, 0xd6, 0x2, 0xe8, 0xb4, 0xe6, 0xcf, 0xc1, 0x83, 0x90, 0x40, 0x7e, 0x79, 0x12, 0xfb, 0xbb, 0x90, 0x59, 0x7d, 0x17, 0x1e, 0xd9, 0x5d, 0xf8, 0xd5, 0x6d, 0xec, 0xdf, 0x83, 0xa7, 0xe7, 0xf8, 0x2a, 0xf7, 0x20, 0xfe, 0xfc, 0xc2, 0xde, 0x83, 0xfe, 0x45, 0x62, 0x36, 0x5f, 0xdf, 0x60, 0x69, 0xde, 0x5e, 0x37, 0x19, 0xc5, 0xe8, 0x4d, 0xd3, 0x51, 0xc2, 0x2d, 0xb1, 0xe4, 0xd8, 0x8, 0xb, 0x31, 0x1e, 0x4b, 0xc4, 0x5b, 0x42, 0x4a, 0x87, 0x8e, 0x5f, 0xe5, 0x8, 0xbd, 0xb1, 0x5b, 0xb8, 0x7a, 0xe7, 0x2d, 0xe0, 0xfd, 0xaa, 0xb0, 0xbb, 0x41, 0x47, 0x70, 0x64, 0xf2, 0xab, 0x14, 0x89, 0xbd, 0xf, 0xe5, 0xe2, 0xbf, 0xa0, 0xfc, 0xd8, 0x23, 0x8a, 0x28, 0x32, 0xe3, 0x33, 0xe1, 0x4b, 0xc0, 0x7e, 0xa6, 0xff, 0x87, 0xcf, 0xb, 0x94, 0xb9, 0x37, 0x3c, 0xc6, 0xd8, 0xcd, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; static const unsigned char tooltip_bg_png[] = { diff --git a/scene/resources/default_theme/toggle_off_disabled.png b/scene/resources/default_theme/toggle_off_disabled.png Binary files differindex d65a9d8e64..250cd29b66 100644 --- a/scene/resources/default_theme/toggle_off_disabled.png +++ b/scene/resources/default_theme/toggle_off_disabled.png diff --git a/scene/resources/default_theme/toggle_on_disabled.png b/scene/resources/default_theme/toggle_on_disabled.png Binary files differindex ca4dbe211f..b1dacbaf32 100644 --- a/scene/resources/default_theme/toggle_on_disabled.png +++ b/scene/resources/default_theme/toggle_on_disabled.png diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 8ee9879055..2364a4a8a3 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -118,8 +118,7 @@ Error DynamicFontAtSize::_load() { int error = FT_Init_FreeType(&library); - ERR_EXPLAIN(TTR("Error initializing FreeType.")); - ERR_FAIL_COND_V(error != 0, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(error != 0, ERR_CANT_CREATE, "Error initializing FreeType."); // FT_OPEN_STREAM is extremely slow only on Android. if (OS::get_singleton()->get_name() == "Android" && font->font_mem == NULL && font->font_path != String()) { @@ -177,32 +176,23 @@ Error DynamicFontAtSize::_load() { error = FT_Open_Face(library, &fargs, 0, &face); } else { - ERR_EXPLAIN("DynamicFont uninitialized"); - ERR_FAIL_V(ERR_UNCONFIGURED); + ERR_FAIL_V_MSG(ERR_UNCONFIGURED, "DynamicFont uninitialized."); } //error = FT_New_Face( library, src_path.utf8().get_data(),0,&face ); if (error == FT_Err_Unknown_File_Format) { - ERR_EXPLAIN(TTR("Unknown font format.")); + ERR_EXPLAIN("Unknown font format."); FT_Done_FreeType(library); } else if (error) { - ERR_EXPLAIN(TTR("Error loading font.")); + ERR_EXPLAIN("Error loading font."); FT_Done_FreeType(library); } ERR_FAIL_COND_V(error, ERR_FILE_CANT_OPEN); - /*error = FT_Set_Char_Size(face,0,64*size,512,512); - - if ( error ) { - FT_Done_FreeType( library ); - ERR_EXPLAIN(TTR("Invalid font size.")); - ERR_FAIL_COND_V( error, ERR_INVALID_PARAMETER ); - }*/ - if (FT_HAS_COLOR(face)) { int best_match = 0; int diff = ABS(id.size - ((int64_t)face->available_sizes[0].width)); @@ -494,7 +484,7 @@ DynamicFontAtSize::Character DynamicFontAtSize::_bitmap_to_character(FT_Bitmap b int byte = i * bitmap.pitch + (j >> 3); int bit = 1 << (7 - (j % 8)); wr[ofs + 0] = 255; //grayscale as 1 - wr[ofs + 1] = bitmap.buffer[byte] & bit ? 255 : 0; + wr[ofs + 1] = (bitmap.buffer[byte] & bit) ? 255 : 0; } break; case FT_PIXEL_MODE_GRAY: wr[ofs + 0] = 255; //grayscale as 1 @@ -509,8 +499,7 @@ DynamicFontAtSize::Character DynamicFontAtSize::_bitmap_to_character(FT_Bitmap b } break; // TODO: FT_PIXEL_MODE_LCD default: - ERR_EXPLAIN("Font uses unsupported pixel format: " + itos(bitmap.pixel_mode)); - ERR_FAIL_V(Character::not_found()); + ERR_FAIL_V_MSG(Character::not_found(), "Font uses unsupported pixel format: " + itos(bitmap.pixel_mode) + "."); break; } } diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 7c3867beaa..0f0974114f 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -1047,8 +1047,8 @@ void Environment::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_transmit_enabled"), "set_fog_transmit_enabled", "is_fog_transmit_enabled"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_transmit_curve", PROPERTY_HINT_EXP_EASING), "set_fog_transmit_curve", "get_fog_transmit_curve"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_height_enabled"), "set_fog_height_enabled", "is_fog_height_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_min", PROPERTY_HINT_RANGE, "-4000,4000,0.1"), "set_fog_height_min", "get_fog_height_min"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_max", PROPERTY_HINT_RANGE, "-4000,4000,0.1"), "set_fog_height_max", "get_fog_height_max"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_min", PROPERTY_HINT_RANGE, "-4000,4000,0.1,or_lesser,or_greater"), "set_fog_height_min", "get_fog_height_min"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_max", PROPERTY_HINT_RANGE, "-4000,4000,0.1,or_lesser,or_greater"), "set_fog_height_max", "get_fog_height_max"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_curve", PROPERTY_HINT_EXP_EASING), "set_fog_height_curve", "get_fog_height_curve"); ClassDB::bind_method(D_METHOD("set_tonemapper", "mode"), &Environment::set_tonemapper); @@ -1406,8 +1406,8 @@ Environment::Environment() : fog_transmit_curve = 1; fog_height_enabled = false; - fog_height_min = 0; - fog_height_max = 100; + fog_height_min = 10; + fog_height_max = 0; fog_height_curve = 1; set_fog_color(Color(0.5, 0.6, 0.7)); diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 627397f0ab..cff77acdd7 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -133,6 +133,7 @@ PoolVector<int> BitmapFont::_get_chars() const { while ((key = char_map.next(key))) { const Character *c = char_map.getptr(*key); + ERR_FAIL_COND_V(!c, PoolVector<int>()); chars.push_back(*key); chars.push_back(c->texture_idx); chars.push_back(c->rect.position.x); @@ -201,10 +202,7 @@ Error BitmapFont::create_from_fnt(const String &p_file) { FileAccess *f = FileAccess::open(p_file, FileAccess::READ); - if (!f) { - ERR_EXPLAIN("Can't open font: " + p_file); - ERR_FAIL_V(ERR_FILE_NOT_FOUND); - } + ERR_FAIL_COND_V_MSG(!f, ERR_FILE_NOT_FOUND, "Can't open font: " + p_file + "."); clear(); @@ -531,10 +529,7 @@ Size2 Font::get_wordwrap_string_size(const String &p_string, float p_width) cons void BitmapFont::set_fallback(const Ref<BitmapFont> &p_fallback) { for (Ref<BitmapFont> fallback_child = p_fallback; fallback_child != NULL; fallback_child = fallback_child->get_fallback()) { - if (fallback_child == this) { - ERR_EXPLAIN("Can't set as fallback one of its parents to prevent crashes due to recursive loop."); - ERR_FAIL_COND(fallback_child == this); - } + ERR_FAIL_COND_MSG(fallback_child == this, "Can't set as fallback one of its parents to prevent crashes due to recursive loop."); } fallback = p_fallback; diff --git a/scene/resources/font.h b/scene/resources/font.h index 436ed43c42..9b99b85d22 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -34,9 +34,6 @@ #include "core/map.h" #include "core/resource.h" #include "scene/resources/texture.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Font : public Resource { diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 197ff14b38..daa51aabd7 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -39,10 +39,7 @@ void Material::set_next_pass(const Ref<Material> &p_pass) { for (Ref<Material> pass_child = p_pass; pass_child != NULL; pass_child = pass_child->get_next_pass()) { - if (pass_child == this) { - ERR_EXPLAIN("Can't set as next_pass one of its parents to prevent crashes due to recursive loop."); - ERR_FAIL_COND(pass_child == this); - } + ERR_FAIL_COND_MSG(pass_child == this, "Can't set as next_pass one of its parents to prevent crashes due to recursive loop."); } if (next_pass == p_pass) @@ -691,9 +688,9 @@ void SpatialMaterial::_update_shader() { code += "\tTANGENT+= vec3(1.0,0.0,0.0) * abs(NORMAL.z);\n"; code += "\tTANGENT = normalize(TANGENT);\n"; - code += "\tBINORMAL = vec3(0.0,1.0,0.0) * abs(NORMAL.x);\n"; - code += "\tBINORMAL+= vec3(0.0,0.0,-1.0) * abs(NORMAL.y);\n"; - code += "\tBINORMAL+= vec3(0.0,1.0,0.0) * abs(NORMAL.z);\n"; + code += "\tBINORMAL = vec3(0.0,-1.0,0.0) * abs(NORMAL.x);\n"; + code += "\tBINORMAL+= vec3(0.0,0.0,1.0) * abs(NORMAL.y);\n"; + code += "\tBINORMAL+= vec3(0.0,-1.0,0.0) * abs(NORMAL.z);\n"; code += "\tBINORMAL = normalize(BINORMAL);\n"; } @@ -2353,8 +2350,8 @@ SpatialMaterial::SpatialMaterial() : set_ao_light_affect(0.0); - set_metallic_texture_channel(TEXTURE_CHANNEL_BLUE); - set_roughness_texture_channel(TEXTURE_CHANNEL_GREEN); + set_metallic_texture_channel(TEXTURE_CHANNEL_RED); + set_roughness_texture_channel(TEXTURE_CHANNEL_RED); set_ao_texture_channel(TEXTURE_CHANNEL_RED); set_refraction_texture_channel(TEXTURE_CHANNEL_RED); diff --git a/scene/resources/material.h b/scene/resources/material.h index 17e52527b3..4c368b3f8b 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -37,9 +37,6 @@ #include "scene/resources/texture.h" #include "servers/visual/shader_language.h" #include "servers/visual_server.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Material : public Resource { diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index aff274cd21..4afb07cb6f 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -883,10 +883,7 @@ int ArrayMesh::get_surface_count() const { void ArrayMesh::add_blend_shape(const StringName &p_name) { - if (surfaces.size()) { - ERR_EXPLAIN("Can't add a shape key count if surfaces are already created."); - ERR_FAIL_COND(surfaces.size()); - } + ERR_FAIL_COND_MSG(surfaces.size(), "Can't add a shape key count if surfaces are already created."); StringName name = p_name; @@ -914,10 +911,7 @@ StringName ArrayMesh::get_blend_shape_name(int p_index) const { } void ArrayMesh::clear_blend_shapes() { - if (surfaces.size()) { - ERR_EXPLAIN("Can't set shape key count if surfaces are already created."); - ERR_FAIL_COND(surfaces.size()); - } + ERR_FAIL_COND_MSG(surfaces.size(), "Can't set shape key count if surfaces are already created."); blend_shapes.clear(); } @@ -1109,8 +1103,7 @@ struct ArrayMeshLightmapSurface { Error ArrayMesh::lightmap_unwrap(const Transform &p_base_transform, float p_texel_size) { ERR_FAIL_COND_V(!array_mesh_lightmap_unwrap_callback, ERR_UNCONFIGURED); - ERR_EXPLAIN("Can't unwrap mesh with blend shapes"); - ERR_FAIL_COND_V(blend_shapes.size() != 0, ERR_UNAVAILABLE); + ERR_FAIL_COND_V_MSG(blend_shapes.size() != 0, ERR_UNAVAILABLE, "Can't unwrap mesh with blend shapes."); Vector<float> vertices; Vector<float> normals; @@ -1124,15 +1117,9 @@ Error ArrayMesh::lightmap_unwrap(const Transform &p_base_transform, float p_texe ArrayMeshLightmapSurface s; s.primitive = surface_get_primitive_type(i); - if (s.primitive != Mesh::PRIMITIVE_TRIANGLES) { - ERR_EXPLAIN("Only triangles are supported for lightmap unwrap"); - ERR_FAIL_V(ERR_UNAVAILABLE); - } + ERR_FAIL_COND_V_MSG(s.primitive != Mesh::PRIMITIVE_TRIANGLES, ERR_UNAVAILABLE, "Only triangles are supported for lightmap unwrap."); s.format = surface_get_format(i); - if (!(s.format & ARRAY_FORMAT_NORMAL)) { - ERR_EXPLAIN("Normals are required for lightmap unwrap"); - ERR_FAIL_V(ERR_UNAVAILABLE); - } + ERR_FAIL_COND_V_MSG(!(s.format & ARRAY_FORMAT_NORMAL), ERR_UNAVAILABLE, "Normals are required for lightmap unwrap."); Array arrays = surface_get_arrays(i); s.material = surface_get_material(i); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index b38791b9a6..6b6ee8a209 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -37,9 +37,6 @@ #include "scene/resources/material.h" #include "scene/resources/shape.h" #include "servers/visual_server.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Mesh : public Resource { GDCLASS(Mesh, Resource); diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 99286668ce..7d62873bbd 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -92,8 +92,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { if (i > 0) { - ERR_EXPLAIN(vformat("Invalid scene: node %s does not specify its parent node.", snames[n.name])); - ERR_FAIL_COND_V(n.parent == -1, NULL); + ERR_FAIL_COND_V_MSG(n.parent == -1, NULL, vformat("Invalid scene: node %s does not specify its parent node.", snames[n.name])); NODE_FROM_ID(nparent, n.parent); #ifdef DEBUG_ENABLED if (!nparent && (n.parent & FLAG_ID_IS_PATH)) { @@ -1093,10 +1092,7 @@ void SceneState::set_bundled_scene(const Dictionary &p_dictionary) { if (p_dictionary.has("version")) version = p_dictionary["version"]; - if (version > PACK_VERSION) { - ERR_EXPLAIN("Save format version too new!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(version > PACK_VERSION, "Save format version too new."); PoolVector<String> snames = p_dictionary["names"]; if (snames.size()) { @@ -1690,10 +1686,7 @@ bool PackedScene::can_instance() const { Node *PackedScene::instance(GenEditState p_edit_state) const { #ifndef TOOLS_ENABLED - if (p_edit_state != GEN_EDIT_STATE_DISABLED) { - ERR_EXPLAIN("Edit state is only for editors, does not work without tools compiled"); - ERR_FAIL_COND_V(p_edit_state != GEN_EDIT_STATE_DISABLED, NULL); - } + ERR_FAIL_COND_V_MSG(p_edit_state != GEN_EDIT_STATE_DISABLED, NULL, "Edit state is only for editors, does not work without tools compiled."); #endif Node *s = state->instance((SceneState::GenEditState)p_edit_state); diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp index b4818755b4..dc6ef2b49c 100644 --- a/scene/resources/particles_material.cpp +++ b/scene/resources/particles_material.cpp @@ -101,6 +101,8 @@ void ParticlesMaterial::init_shaders() { shader_names->trail_color_modifier = "trail_color_modifier"; shader_names->gravity = "gravity"; + + shader_names->lifetime_randomness = "lifetime_randomness"; } void ParticlesMaterial::finish_shaders() { @@ -173,6 +175,7 @@ void ParticlesMaterial::_update_shader() { code += "uniform float hue_variation_random;\n"; code += "uniform float anim_speed_random;\n"; code += "uniform float anim_offset_random;\n"; + code += "uniform float lifetime_randomness;\n"; switch (emission_shape) { case EMISSION_SHAPE_POINT: { @@ -285,7 +288,11 @@ void ParticlesMaterial::_update_shader() { code += " ivec2 emission_tex_size = textureSize(emission_texture_points, 0);\n"; code += " ivec2 emission_tex_ofs = ivec2(point % emission_tex_size.x, point / emission_tex_size.x);\n"; } - code += " if (RESTART) {\n"; + code += " bool restart = false;\n"; + code += " if (CUSTOM.y > CUSTOM.w) {\n"; + code += " restart = true;\n"; + code += " }\n\n"; + code += " if (RESTART || restart) {\n"; if (tex_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid()) code += " float tex_linear_velocity = textureLod(linear_velocity_texture, vec2(0.0, 0.0), 0.0).r;\n"; @@ -325,6 +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.z = (anim_offset + tex_anim_offset) * mix(1.0, anim_offset_rand, anim_offset_random);\n"; // animation offset (0-1) switch (emission_shape) { @@ -576,6 +584,9 @@ void ParticlesMaterial::_update_shader() { code += " VELOCITY.z = 0.0;\n"; code += " TRANSFORM[3].z = 0.0;\n"; } + code += " if (CUSTOM.y > CUSTOM.w) {"; + code += " ACTIVE = false;\n"; + code += " }\n"; code += "}\n"; code += "\n"; @@ -1014,6 +1025,17 @@ Vector3 ParticlesMaterial::get_gravity() const { return gravity; } +void ParticlesMaterial::set_lifetime_randomness(float p_lifetime) { + + lifetime_randomness = p_lifetime; + VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->lifetime_randomness, lifetime_randomness); +} + +float ParticlesMaterial::get_lifetime_randomness() const { + + return lifetime_randomness; +} + RID ParticlesMaterial::get_shader_rid() const { ERR_FAIL_COND_V(!shader_map.has(current_key), RID()); @@ -1118,6 +1140,11 @@ void ParticlesMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("get_gravity"), &ParticlesMaterial::get_gravity); ClassDB::bind_method(D_METHOD("set_gravity", "accel_vec"), &ParticlesMaterial::set_gravity); + ClassDB::bind_method(D_METHOD("set_lifetime_randomness", "randomness"), &ParticlesMaterial::set_lifetime_randomness); + ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &ParticlesMaterial::get_lifetime_randomness); + + ADD_GROUP("Time", ""); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_GROUP("Trail", "trail_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "trail_divisor", PROPERTY_HINT_RANGE, "1,1000000,1"), "set_trail_divisor", "get_trail_divisor"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "trail_size_modifier", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_trail_size_modifier", "get_trail_size_modifier"); @@ -1240,6 +1267,7 @@ ParticlesMaterial::ParticlesMaterial() : set_emission_box_extents(Vector3(1, 1, 1)); set_trail_divisor(1); set_gravity(Vector3(0, -9.8, 0)); + set_lifetime_randomness(0); emission_point_count = 1; for (int i = 0; i < PARAM_MAX; i++) { diff --git a/scene/resources/particles_material.h b/scene/resources/particles_material.h index 7f11bd794b..6fe381db0a 100644 --- a/scene/resources/particles_material.h +++ b/scene/resources/particles_material.h @@ -185,6 +185,8 @@ private: StringName trail_color_modifier; StringName gravity; + + StringName lifetime_randomness; }; static ShaderNames *shader_names; @@ -225,6 +227,8 @@ private: Vector3 gravity; + float lifetime_randomness; + //do not save emission points here protected: @@ -287,6 +291,9 @@ public: void set_gravity(const Vector3 &p_gravity); Vector3 get_gravity() const; + void set_lifetime_randomness(float p_lifetime); + float get_lifetime_randomness() const; + static void init_shaders(); static void finish_shaders(); static void flush_changes(); diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 74a493d3b5..24fdaafbe1 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -1572,3 +1572,19 @@ SphereMesh::SphereMesh() { rings = 32; is_hemisphere = false; } + +/** + PointMesh +*/ + +void PointMesh::_create_mesh_array(Array &p_arr) const { + PoolVector<Vector3> faces; + faces.resize(1); + faces.set(0, Vector3(0.0, 0.0, 0.0)); + + p_arr[VS::ARRAY_VERTEX] = faces; +} + +PointMesh::PointMesh() { + primitive_type = PRIMITIVE_POINTS; +} diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index 312899c028..fad49f9642 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -322,4 +322,19 @@ public: SphereMesh(); }; +/** + A single point for use in particle systems +*/ + +class PointMesh : public PrimitiveMesh { + + GDCLASS(PointMesh, PrimitiveMesh) + +protected: + virtual void _create_mesh_array(Array &p_arr) const; + +public: + PointMesh(); +}; + #endif diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 12bf007bb1..cd229732ba 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -1366,13 +1366,10 @@ String ResourceFormatSaverTextInstance::_write_resource(const RES &res) { String path = relative_paths ? local_path.path_to_file(res->get_path()) : res->get_path(); return "Resource( \"" + path + "\" )"; } else { - ERR_EXPLAIN("Resource was not pre cached for the resource section, bug?"); - ERR_FAIL_V("null"); + ERR_FAIL_V_MSG("null", "Resource was not pre cached for the resource section, bug?"); //internal resource } } - - return "null"; } void ResourceFormatSaverTextInstance::_find_resources(const Variant &p_variant, bool p_main) { @@ -1514,8 +1511,6 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r } } - ERR_FAIL_COND_V(err != OK, err); - { String title = packed_scene.is_valid() ? "[gd_scene " : "[gd_resource "; if (packed_scene.is_null()) diff --git a/scene/resources/room.h b/scene/resources/room.h index 8990056f46..2c53ea1aed 100644 --- a/scene/resources/room.h +++ b/scene/resources/room.h @@ -33,9 +33,6 @@ #include "core/math/bsp_tree.h" #include "core/resource.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ // FIXME: left for reference but will be removed when portals are reimplemented using Area #if 0 diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index c3965fe076..d02e107480 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -34,9 +34,7 @@ #include "core/resource.h" #include "scene/resources/texture.h" #include "servers/visual_server.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ + class CanvasItem; class StyleBox : public Resource { diff --git a/scene/resources/text_file.cpp b/scene/resources/text_file.cpp index 37bdd691b4..b84f3f1f9e 100644 --- a/scene/resources/text_file.cpp +++ b/scene/resources/text_file.cpp @@ -67,10 +67,7 @@ Error TextFile::load_text(const String &p_path) { w[len] = 0; String s; - if (s.parse_utf8((const char *)w.ptr())) { - ERR_EXPLAIN("Script '" + p_path + "' contains invalid unicode (utf-8), so it was not loaded. Please ensure that scripts are saved in valid utf-8 unicode."); - ERR_FAIL_V(ERR_INVALID_DATA); - } + ERR_FAIL_COND_V_MSG(s.parse_utf8((const char *)w.ptr()), ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); text = s; path = p_path; return OK; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index a5e9351753..e44b17584b 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -2351,8 +2351,7 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String texarr.instance(); lt = texarr; } else { - ERR_EXPLAIN("Unrecognized layered texture extension"); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), "Unrecognized layered texture extension."); } FileAccess *f = FileAccess::open(p_path, FileAccess::READ); @@ -2373,8 +2372,7 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String } } else { - ERR_EXPLAIN("Unrecognized layered texture file format: " + String((const char *)header)); - ERR_FAIL_V(RES()); + ERR_FAIL_V_MSG(RES(), "Unrecognized layered texture file format: " + String((const char *)header) + "."); } int tw = f->get_32(); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index eb7a9ff25c..e535f7544a 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -42,10 +42,6 @@ #include "servers/camera_server.h" #include "servers/visual_server.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - class Texture : public Resource { GDCLASS(Texture, Resource); diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 69258bc834..ae18be1695 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -32,8 +32,6 @@ #include "core/os/file_access.h" #include "core/print_string.h" -Ref<Theme> Theme::default_theme; - void Theme::_emit_theme_changed() { emit_changed(); @@ -186,11 +184,6 @@ void Theme::_get_property_list(List<PropertyInfo> *p_list) const { } } -Ref<Theme> Theme::get_default() { - - return default_theme; -} - void Theme::set_default_theme_font(const Ref<Font> &p_default_font) { if (default_theme_font == p_default_font) @@ -215,14 +208,31 @@ Ref<Font> Theme::get_default_theme_font() const { return default_theme_font; } +Ref<Theme> Theme::project_default_theme; +Ref<Theme> Theme::default_theme; +Ref<Texture> Theme::default_icon; +Ref<StyleBox> Theme::default_style; +Ref<Font> Theme::default_font; + +Ref<Theme> Theme::get_default() { + + return default_theme; +} + void Theme::set_default(const Ref<Theme> &p_default) { default_theme = p_default; } -Ref<Texture> Theme::default_icon; -Ref<StyleBox> Theme::default_style; -Ref<Font> Theme::default_font; +Ref<Theme> Theme::get_project_default() { + + return project_default_theme; +} + +void Theme::set_project_default(const Ref<Theme> &p_project_default) { + + project_default_theme = p_project_default; +} void Theme::set_default_icon(const Ref<Texture> &p_icon) { diff --git a/scene/resources/theme.h b/scene/resources/theme.h index fb59073cbe..187694de65 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -38,15 +38,11 @@ #include "scene/resources/style_box.h" #include "scene/resources/texture.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class Theme : public Resource { GDCLASS(Theme, Resource); RES_BASE_EXTENSION("theme"); - static Ref<Theme> default_theme; void _emit_theme_changed(); HashMap<StringName, HashMap<StringName, Ref<Texture> > > icon_map; @@ -61,6 +57,8 @@ protected: bool _get(const StringName &p_name, Variant &r_ret) const; void _get_property_list(List<PropertyInfo> *p_list) const; + static Ref<Theme> project_default_theme; + static Ref<Theme> default_theme; static Ref<Texture> default_icon; static Ref<StyleBox> default_style; static Ref<Font> default_font; @@ -137,6 +135,9 @@ public: static Ref<Theme> get_default(); static void set_default(const Ref<Theme> &p_default); + static Ref<Theme> get_project_default(); + static void set_project_default(const Ref<Theme> &p_project_default); + static void set_default_icon(const Ref<Texture> &p_icon); static void set_default_style(const Ref<StyleBox> &p_style); static void set_default_font(const Ref<Font> &p_font); diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index bd5ce91e77..24122a8d99 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -148,15 +148,20 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) { } } } else if (what == "shape") - tile_set_shape(id, 0, p_value); + for (int i = 0; i < tile_get_shape_count(id); i++) + tile_set_shape(id, i, p_value); else if (what == "shape_offset") - tile_set_shape_offset(id, 0, p_value); + for (int i = 0; i < tile_get_shape_count(id); i++) + tile_set_shape_offset(id, i, p_value); else if (what == "shape_transform") - tile_set_shape_transform(id, 0, p_value); + for (int i = 0; i < tile_get_shape_count(id); i++) + tile_set_shape_transform(id, i, p_value); else if (what == "shape_one_way") - tile_set_shape_one_way(id, 0, p_value); + for (int i = 0; i < tile_get_shape_count(id); i++) + tile_set_shape_one_way(id, i, p_value); else if (what == "shape_one_way_margin") - tile_set_shape_one_way_margin(id, 0, p_value); + for (int i = 0; i < tile_get_shape_count(id); i++) + tile_set_shape_one_way_margin(id, i, p_value); else if (what == "shapes") _tile_set_shapes(id, p_value); else if (what == "occluder") @@ -1001,8 +1006,7 @@ void TileSet::_tile_set_shapes(int p_id, const Array &p_shapes) { s.autotile_coord = default_autotile_coord; } else { - ERR_EXPLAIN("Expected an array of objects or dictionaries for tile_set_shapes"); - ERR_CONTINUE(true); + ERR_CONTINUE_MSG(true, "Expected an array of objects or dictionaries for tile_set_shapes."); } shapes_data.push_back(s); diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 7265c9b457..699410719c 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -67,6 +67,14 @@ String VisualShaderNode::generate_global(Shader::Mode p_mode, VisualShader::Type return String(); } +String VisualShaderNode::generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + return String(); +} + +String VisualShaderNode::generate_global_per_func(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + return String(); +} + Vector<StringName> VisualShaderNode::get_editable_properties() const { return Vector<StringName>(); } @@ -109,6 +117,12 @@ void VisualShaderNode::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "output_port_for_preview"), "set_output_port_for_preview", "get_output_port_for_preview"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "default_input_values", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_default_input_values", "_get_default_input_values"); ADD_SIGNAL(MethodInfo("editor_refresh_request")); + + BIND_ENUM_CONSTANT(PORT_TYPE_SCALAR); + BIND_ENUM_CONSTANT(PORT_TYPE_VECTOR); + BIND_ENUM_CONSTANT(PORT_TYPE_BOOLEAN); + BIND_ENUM_CONSTANT(PORT_TYPE_TRANSFORM); + BIND_ENUM_CONSTANT(PORT_TYPE_ICON_COLOR); } VisualShaderNode::VisualShaderNode() { @@ -117,6 +131,147 @@ VisualShaderNode::VisualShaderNode() { ///////////////////////////////////////////////////////// +void VisualShaderNodeCustom::update_ports() { + ERR_FAIL_COND(!get_script_instance()); + + input_ports.clear(); + if (get_script_instance()->has_method("_get_input_port_count")) { + int input_port_count = (int)get_script_instance()->call("_get_input_port_count"); + bool has_name = get_script_instance()->has_method("_get_input_port_name"); + bool has_type = get_script_instance()->has_method("_get_input_port_type"); + for (int i = 0; i < input_port_count; i++) { + Port port; + if (has_name) { + port.name = (String)get_script_instance()->call("_get_input_port_name", i); + } else { + port.name = "in" + itos(i); + } + if (has_type) { + port.type = (int)get_script_instance()->call("_get_input_port_type", i); + } else { + port.type = (int)PortType::PORT_TYPE_SCALAR; + } + input_ports.push_back(port); + } + } + output_ports.clear(); + if (get_script_instance()->has_method("_get_output_port_count")) { + int output_port_count = (int)get_script_instance()->call("_get_output_port_count"); + bool has_name = get_script_instance()->has_method("_get_output_port_name"); + bool has_type = get_script_instance()->has_method("_get_output_port_type"); + for (int i = 0; i < output_port_count; i++) { + Port port; + if (has_name) { + port.name = (String)get_script_instance()->call("_get_output_port_name", i); + } else { + port.name = "out" + itos(i); + } + if (has_type) { + port.type = (int)get_script_instance()->call("_get_output_port_type", i); + } else { + port.type = (int)PortType::PORT_TYPE_SCALAR; + } + output_ports.push_back(port); + } + } +} + +String VisualShaderNodeCustom::get_caption() const { + ERR_FAIL_COND_V(!get_script_instance(), ""); + if (get_script_instance()->has_method("_get_name")) { + return (String)get_script_instance()->call("_get_name"); + } + return "Unnamed"; +} + +int VisualShaderNodeCustom::get_input_port_count() const { + return input_ports.size(); +} + +VisualShaderNodeCustom::PortType VisualShaderNodeCustom::get_input_port_type(int p_port) const { + ERR_FAIL_INDEX_V(p_port, input_ports.size(), PORT_TYPE_SCALAR); + return (PortType)input_ports[p_port].type; +} + +String VisualShaderNodeCustom::get_input_port_name(int p_port) const { + ERR_FAIL_INDEX_V(p_port, input_ports.size(), ""); + return input_ports[p_port].name; +} + +int VisualShaderNodeCustom::get_output_port_count() const { + return output_ports.size(); +} + +VisualShaderNodeCustom::PortType VisualShaderNodeCustom::get_output_port_type(int p_port) const { + ERR_FAIL_INDEX_V(p_port, output_ports.size(), PORT_TYPE_SCALAR); + return (PortType)output_ports[p_port].type; +} + +String VisualShaderNodeCustom::get_output_port_name(int p_port) const { + ERR_FAIL_INDEX_V(p_port, output_ports.size(), ""); + return output_ports[p_port].name; +} + +String VisualShaderNodeCustom::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 { + + ERR_FAIL_COND_V(!get_script_instance(), ""); + ERR_FAIL_COND_V(!get_script_instance()->has_method("_get_code"), ""); + Array input_vars; + for (int i = 0; i < get_input_port_count(); i++) { + input_vars.push_back(p_input_vars[i]); + } + Array output_vars; + for (int i = 0; i < get_output_port_count(); i++) { + output_vars.push_back(p_output_vars[i]); + } + String code = "\t{\n"; + String _code = (String)get_script_instance()->call("_get_code", input_vars, output_vars, (int)p_mode, (int)p_type); + bool nend = _code.ends_with("\n"); + _code = _code.insert(0, "\t\t"); + _code = _code.replace("\n", "\n\t\t"); + code += _code; + if (!nend) { + code += "\n\t}"; + } else { + code.remove(code.size() - 1); + code += "}"; + } + return code; +} + +String VisualShaderNodeCustom::generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + ERR_FAIL_COND_V(!get_script_instance(), ""); + if (get_script_instance()->has_method("_get_global_code")) { + String code = "// " + get_caption() + "\n"; + code += (String)get_script_instance()->call("_get_global_code", (int)p_mode); + code += "\n"; + return code; + } + return ""; +} + +void VisualShaderNodeCustom::_bind_methods() { + + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_name")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_description")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_category")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_subcategory")); + BIND_VMETHOD(MethodInfo(Variant::INT, "_get_return_icon_type")); + BIND_VMETHOD(MethodInfo(Variant::INT, "_get_input_port_count")); + BIND_VMETHOD(MethodInfo(Variant::INT, "_get_input_port_type", PropertyInfo(Variant::INT, "port"))); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_input_port_name", PropertyInfo(Variant::INT, "port"))); + BIND_VMETHOD(MethodInfo(Variant::INT, "_get_output_port_count")); + BIND_VMETHOD(MethodInfo(Variant::INT, "_get_output_port_type", PropertyInfo(Variant::INT, "port"))); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_output_port_name", PropertyInfo(Variant::INT, "port"))); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_code", PropertyInfo(Variant::ARRAY, "input_vars"), PropertyInfo(Variant::ARRAY, "output_vars"), PropertyInfo(Variant::INT, "mode"), PropertyInfo(Variant::INT, "type"))); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_global_code", PropertyInfo(Variant::INT, "mode"))); +} + +VisualShaderNodeCustom::VisualShaderNodeCustom() { +} + +///////////////////////////////////////////////////////// + void VisualShader::add_node(Type p_type, const Ref<VisualShaderNode> &p_node, const Vector2 &p_position, int p_id) { ERR_FAIL_COND(p_node.is_null()); ERR_FAIL_COND(p_id < 2); @@ -142,6 +297,11 @@ void VisualShader::add_node(Type p_type, const Ref<VisualShaderNode> &p_node, co n.node->connect("changed", this, "_queue_update"); + Ref<VisualShaderNodeCustom> custom = n.node; + if (custom.is_valid()) { + custom->update_ports(); + } + g->nodes[p_id] = n; _queue_update(); @@ -299,11 +459,7 @@ Error VisualShader::connect_nodes(Type p_type, int p_from_node, int p_from_port, VisualShaderNode::PortType from_port_type = g->nodes[p_from_node].node->get_output_port_type(p_from_port); VisualShaderNode::PortType to_port_type = g->nodes[p_to_node].node->get_input_port_type(p_to_port); - if (!is_port_types_compatible(from_port_type, to_port_type)) { - ERR_EXPLAIN("Incompatible port types (scalar/vec/bool) with transform"); - ERR_FAIL_V(ERR_INVALID_PARAMETER); - return ERR_INVALID_PARAMETER; - } + ERR_FAIL_COND_V_MSG(!is_port_types_compatible(from_port_type, to_port_type), ERR_INVALID_PARAMETER, "Incompatible port types (scalar/vec/bool) with transform."); for (List<Connection>::Element *E = g->connections.front(); E; E = E->next()) { @@ -449,10 +605,32 @@ String VisualShader::generate_preview_shader(Type p_type, int p_node, int p_port ERR_FAIL_COND_V(node->get_output_port_type(p_port) == VisualShaderNode::PORT_TYPE_TRANSFORM, String()); StringBuilder global_code; + StringBuilder global_code_per_node; + Map<Type, StringBuilder> global_code_per_func; StringBuilder code; + Set<StringName> classes; global_code += String() + "shader_type canvas_item;\n"; + String global_expressions; + for (int i = 0, index = 0; i < TYPE_MAX; i++) { + for (Map<int, Node>::Element *E = graph[i].nodes.front(); E; E = E->next()) { + Ref<VisualShaderNodeGlobalExpression> global_expression = Object::cast_to<VisualShaderNodeGlobalExpression>(E->get().node.ptr()); + if (global_expression.is_valid()) { + + String expr = ""; + expr += "// " + global_expression->get_caption() + ":" + itos(index++) + "\n"; + expr += global_expression->generate_global(get_mode(), Type(i), -1); + expr = expr.replace("\n", "\n\t"); + expr += "\n"; + global_expressions += expr; + } + } + } + + global_code += "\n"; + global_code += global_expressions; + //make it faster to go around through shader VMap<ConnectionKey, const List<Connection>::Element *> input_connections; VMap<ConnectionKey, const List<Connection>::Element *> output_connections; @@ -474,7 +652,7 @@ String VisualShader::generate_preview_shader(Type p_type, int p_node, int p_port code += "\nvoid fragment() {\n"; Set<int> processed; - Error err = _write_node(p_type, global_code, code, default_tex_params, input_connections, output_connections, p_node, processed, true); + Error err = _write_node(p_type, global_code, global_code_per_node, global_code_per_func, code, default_tex_params, input_connections, output_connections, p_node, processed, true, classes); ERR_FAIL_COND_V(err != OK, String()); if (node->get_output_port_type(p_port) == VisualShaderNode::PORT_TYPE_SCALAR) { @@ -489,6 +667,7 @@ String VisualShader::generate_preview_shader(Type p_type, int p_node, int p_port //set code secretly global_code += "\n\n"; String final_code = global_code; + final_code += global_code_per_node; final_code += code; return final_code; } @@ -833,7 +1012,7 @@ void VisualShader::_get_property_list(List<PropertyInfo> *p_list) const { } } -Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBuilder &code, Vector<VisualShader::DefaultTextureParam> &def_tex_params, const VMap<ConnectionKey, const List<Connection>::Element *> &input_connections, const VMap<ConnectionKey, const List<Connection>::Element *> &output_connections, int node, Set<int> &processed, bool for_preview) const { +Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBuilder &global_code_per_node, Map<Type, StringBuilder> &global_code_per_func, StringBuilder &code, Vector<VisualShader::DefaultTextureParam> &def_tex_params, const VMap<ConnectionKey, const List<Connection>::Element *> &input_connections, const VMap<ConnectionKey, const List<Connection>::Element *> &output_connections, int node, Set<int> &processed, bool for_preview, Set<StringName> &r_classes) const { const Ref<VisualShaderNode> vsnode = graph[type].nodes[node].node; @@ -850,7 +1029,7 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui continue; } - Error err = _write_node(type, global_code, code, def_tex_params, input_connections, output_connections, from_node, processed, for_preview); + Error err = _write_node(type, global_code, global_code_per_node, global_code_per_func, code, def_tex_params, input_connections, output_connections, from_node, processed, for_preview, r_classes); if (err) return err; } @@ -957,10 +1136,18 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui bool skip_global = input.is_valid() && for_preview; if (!skip_global) { + global_code += vsnode->generate_global(get_mode(), type, node); + + if (!r_classes.has(vsnode->get_class_name())) { + global_code_per_node += vsnode->generate_global_per_node(get_mode(), type, node); + for (int i = 0; i < TYPE_MAX; i++) { + global_code_per_func[Type(i)] += vsnode->generate_global_per_func(get_mode(), Type(i), node); + } + r_classes.insert(vsnode->get_class_name()); + } } - //handle normally code += vsnode->generate_code(get_mode(), type, node, inputs, outputs, for_preview); code += "\n"; // @@ -976,8 +1163,12 @@ void VisualShader::_update_shader() const { dirty = false; StringBuilder global_code; + StringBuilder global_code_per_node; + Map<Type, StringBuilder> global_code_per_func; StringBuilder code; Vector<VisualShader::DefaultTextureParam> default_tex_params; + Set<StringName> classes; + List<int> insertion_pos; static const char *shader_mode_str[Shader::MODE_MAX] = { "spatial", "canvas_item", "particles" }; global_code += String() + "shader_type " + shader_mode_str[shader_mode] + ";\n"; @@ -1033,6 +1224,22 @@ void VisualShader::_update_shader() const { static const char *func_name[TYPE_MAX] = { "vertex", "fragment", "light" }; + String global_expressions; + for (int i = 0, index = 0; i < TYPE_MAX; i++) { + for (Map<int, Node>::Element *E = graph[i].nodes.front(); E; E = E->next()) { + Ref<VisualShaderNodeGlobalExpression> global_expression = Object::cast_to<VisualShaderNodeGlobalExpression>(E->get().node.ptr()); + if (global_expression.is_valid()) { + + String expr = ""; + expr += "// " + global_expression->get_caption() + ":" + itos(index++) + "\n"; + expr += global_expression->generate_global(get_mode(), Type(i), -1); + expr = expr.replace("\n", "\n\t"); + expr += "\n"; + global_expressions += expr; + } + } + } + for (int i = 0; i < TYPE_MAX; i++) { //make it faster to go around through shader @@ -1056,8 +1263,9 @@ void VisualShader::_update_shader() const { code += "\nvoid " + String(func_name[i]) + "() {\n"; Set<int> processed; - Error err = _write_node(Type(i), global_code, code, default_tex_params, input_connections, output_connections, NODE_ID_OUTPUT, processed, false); + Error err = _write_node(Type(i), global_code, global_code_per_node, global_code_per_func, code, default_tex_params, input_connections, output_connections, NODE_ID_OUTPUT, processed, false, classes); ERR_FAIL_COND(err != OK); + insertion_pos.push_back(code.get_string_length()); code += "}\n"; } @@ -1065,11 +1273,22 @@ void VisualShader::_update_shader() const { //set code secretly global_code += "\n\n"; String final_code = global_code; - final_code += code; + final_code += global_code_per_node; + final_code += global_expressions; + String tcode = code; + for (int i = 0; i < TYPE_MAX; i++) { + tcode = tcode.insert(insertion_pos[i], global_code_per_func[Type(i)]); + } + final_code += tcode; + const_cast<VisualShader *>(this)->set_code(final_code); for (int i = 0; i < default_tex_params.size(); i++) { const_cast<VisualShader *>(this)->set_default_texture_param(default_tex_params[i].name, default_tex_params[i].param); } + if (previous_code != final_code) { + const_cast<VisualShader *>(this)->emit_signal("changed"); + } + previous_code = final_code; } void VisualShader::_queue_update() { @@ -2154,6 +2373,14 @@ void VisualShaderNodeGroupBase::_apply_port_changes() { } } +void VisualShaderNodeGroupBase::set_editable(bool p_enabled) { + editable = p_enabled; +} + +bool VisualShaderNodeGroupBase::is_editable() const { + return editable; +} + void VisualShaderNodeGroupBase::_bind_methods() { ClassDB::bind_method(D_METHOD("set_size", "size"), &VisualShaderNodeGroupBase::set_size); @@ -2189,6 +2416,11 @@ void VisualShaderNodeGroupBase::_bind_methods() { ClassDB::bind_method(D_METHOD("set_control", "control", "index"), &VisualShaderNodeGroupBase::set_control); ClassDB::bind_method(D_METHOD("get_control", "index"), &VisualShaderNodeGroupBase::get_control); + + ClassDB::bind_method(D_METHOD("set_editable", "enabled"), &VisualShaderNodeGroupBase::set_editable); + ClassDB::bind_method(D_METHOD("is_editable"), &VisualShaderNodeGroupBase::is_editable); + + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editable"), "set_editable", "is_editable"); } String VisualShaderNodeGroupBase::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 { @@ -2199,6 +2431,7 @@ VisualShaderNodeGroupBase::VisualShaderNodeGroupBase() { size = Size2(0, 0); inputs = ""; outputs = ""; + editable = false; } ////////////// Expression @@ -2229,6 +2462,7 @@ String VisualShaderNodeExpression::generate_code(Shader::Mode p_mode, VisualShad static Vector<String> pre_symbols; if (pre_symbols.empty()) { pre_symbols.push_back("\t"); + pre_symbols.push_back(","); pre_symbols.push_back("{"); pre_symbols.push_back("["); pre_symbols.push_back("("); @@ -2324,4 +2558,19 @@ void VisualShaderNodeExpression::_bind_methods() { VisualShaderNodeExpression::VisualShaderNodeExpression() { expression = ""; + set_editable(true); +} + +////////////// Global Expression + +String VisualShaderNodeGlobalExpression::get_caption() const { + return "GlobalExpression"; +} + +String VisualShaderNodeGlobalExpression::generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + return expression; +} + +VisualShaderNodeGlobalExpression::VisualShaderNodeGlobalExpression() { + set_editable(false); } diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index 83db51b1b0..45beb8e6ca 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -73,6 +73,7 @@ private: } graph[TYPE_MAX]; Shader::Mode shader_mode; + mutable String previous_code; Array _get_node_connections(Type p_type) const; @@ -103,7 +104,7 @@ private: } }; - Error _write_node(Type p_type, StringBuilder &global_code, StringBuilder &code, Vector<DefaultTextureParam> &def_tex_params, const VMap<ConnectionKey, const List<Connection>::Element *> &input_connections, const VMap<ConnectionKey, const List<Connection>::Element *> &output_connections, int node, Set<int> &processed, bool for_preview) const; + Error _write_node(Type p_type, StringBuilder &global_code, StringBuilder &global_code_per_node, Map<Type, StringBuilder> &global_code_per_func, StringBuilder &code, Vector<DefaultTextureParam> &def_tex_params, const VMap<ConnectionKey, const List<Connection>::Element *> &input_connections, const VMap<ConnectionKey, const List<Connection>::Element *> &output_connections, int node, Set<int> &processed, bool for_preview, Set<StringName> &r_classes) const; void _input_type_changed(Type p_type, int p_id); @@ -183,7 +184,7 @@ public: PORT_TYPE_VECTOR, PORT_TYPE_BOOLEAN, PORT_TYPE_TRANSFORM, - PORT_TYPE_COLOR // just a hint for node tree icons, do not use it as actual port type ! + PORT_TYPE_ICON_COLOR // just a hint for node tree icons, do not use it as actual port type ! }; virtual String get_caption() const = 0; @@ -208,12 +209,52 @@ public: virtual Vector<VisualShader::DefaultTextureParam> get_default_texture_parameters(VisualShader::Type p_type, int p_id) const; virtual String generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String generate_global_per_func(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; virtual String 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 = false) const = 0; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty virtual String get_warning(Shader::Mode p_mode, VisualShader::Type p_type) const; VisualShaderNode(); }; + +VARIANT_ENUM_CAST(VisualShaderNode::PortType) + +class VisualShaderNodeCustom : public VisualShaderNode { + GDCLASS(VisualShaderNodeCustom, VisualShaderNode); + + struct Port { + String name; + int type; + }; + + List<Port> input_ports; + List<Port> output_ports; + + friend class VisualShaderEditor; + +protected: + virtual String get_caption() const; + + virtual int get_input_port_count() const; + virtual PortType get_input_port_type(int p_port) const; + virtual String get_input_port_name(int p_port) const; + + virtual int get_output_port_count() const; + virtual PortType get_output_port_type(int p_port) const; + virtual String get_output_port_name(int p_port) const; + +protected: + virtual String 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 = false) const; + virtual String generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + + static void _bind_methods(); + +public: + VisualShaderNodeCustom(); + void update_ports(); +}; + ///// class VisualShaderNodeInput : public VisualShaderNode { @@ -331,6 +372,7 @@ protected: Vector2 size; String inputs; String outputs; + bool editable; struct Port { PortType type; @@ -386,6 +428,9 @@ public: void set_control(Control *p_control, int p_index); Control *get_control(int p_index); + void set_editable(bool p_enabled); + bool is_editable() const; + virtual String 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 = false) const; VisualShaderNodeGroupBase(); @@ -394,10 +439,9 @@ public: class VisualShaderNodeExpression : public VisualShaderNodeGroupBase { GDCLASS(VisualShaderNodeExpression, VisualShaderNodeGroupBase); -private: +protected: String expression; -protected: static void _bind_methods(); public: @@ -413,4 +457,15 @@ public: VisualShaderNodeExpression(); }; +class VisualShaderNodeGlobalExpression : public VisualShaderNodeExpression { + GDCLASS(VisualShaderNodeGlobalExpression, VisualShaderNodeExpression); + +public: + virtual String get_caption() const; + + virtual String generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + + VisualShaderNodeGlobalExpression(); +}; + #endif // VISUAL_SHADER_H diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp index 235b56b0ce..9195d80cfc 100644 --- a/scene/resources/visual_shader_nodes.cpp +++ b/scene/resources/visual_shader_nodes.cpp @@ -2106,7 +2106,7 @@ String VisualShaderNodeOuterProduct::get_output_port_name(int p_port) const { } String VisualShaderNodeOuterProduct::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 { - return "\t" + p_output_vars[0] + " = outerProduct( " + p_input_vars[0] + ", " + p_input_vars[1] + " );\n"; + return "\t" + p_output_vars[0] + " = outerProduct( vec4(" + p_input_vars[0] + ", 0.0), vec4(" + p_input_vars[1] + ", 0.0) );\n"; } VisualShaderNodeOuterProduct::VisualShaderNodeOuterProduct() { @@ -2399,34 +2399,38 @@ VisualShaderNodeVectorRefract::VisualShaderNodeVectorRefract() { set_input_port_default_value(2, 0.0); } -////////////// Scalar Interp +////////////// Scalar Mix String VisualShaderNodeScalarInterp::get_caption() const { - return "Mix"; + return "ScalarMix"; } int VisualShaderNodeScalarInterp::get_input_port_count() const { return 3; } + VisualShaderNodeScalarInterp::PortType VisualShaderNodeScalarInterp::get_input_port_type(int p_port) const { return PORT_TYPE_SCALAR; } + String VisualShaderNodeScalarInterp::get_input_port_name(int p_port) const { if (p_port == 0) { return "a"; } else if (p_port == 1) { return "b"; } else { - return "c"; + return "weight"; } } int VisualShaderNodeScalarInterp::get_output_port_count() const { return 1; } + VisualShaderNodeScalarInterp::PortType VisualShaderNodeScalarInterp::get_output_port_type(int p_port) const { return PORT_TYPE_SCALAR; } + String VisualShaderNodeScalarInterp::get_output_port_name(int p_port) const { return "mix"; } @@ -2437,38 +2441,42 @@ String VisualShaderNodeScalarInterp::generate_code(Shader::Mode p_mode, VisualSh VisualShaderNodeScalarInterp::VisualShaderNodeScalarInterp() { set_input_port_default_value(0, 0.0); - set_input_port_default_value(1, 0.0); - set_input_port_default_value(2, 0.0); + set_input_port_default_value(1, 1.0); + set_input_port_default_value(2, 0.5); } -////////////// Vector Interp +////////////// Vector Mix String VisualShaderNodeVectorInterp::get_caption() const { - return "Mix"; + return "VectorMix"; } int VisualShaderNodeVectorInterp::get_input_port_count() const { return 3; } + VisualShaderNodeVectorInterp::PortType VisualShaderNodeVectorInterp::get_input_port_type(int p_port) const { return PORT_TYPE_VECTOR; } + String VisualShaderNodeVectorInterp::get_input_port_name(int p_port) const { if (p_port == 0) { return "a"; } else if (p_port == 1) { return "b"; } else { - return "c"; + return "weight"; } } int VisualShaderNodeVectorInterp::get_output_port_count() const { return 1; } + VisualShaderNodeVectorInterp::PortType VisualShaderNodeVectorInterp::get_output_port_type(int p_port) const { return PORT_TYPE_VECTOR; } + String VisualShaderNodeVectorInterp::get_output_port_name(int p_port) const { return "mix"; } @@ -2478,9 +2486,57 @@ String VisualShaderNodeVectorInterp::generate_code(Shader::Mode p_mode, VisualSh } VisualShaderNodeVectorInterp::VisualShaderNodeVectorInterp() { - set_input_port_default_value(0, Vector3()); - set_input_port_default_value(1, Vector3()); - set_input_port_default_value(2, Vector3()); + set_input_port_default_value(0, Vector3(0.0, 0.0, 0.0)); + set_input_port_default_value(1, Vector3(1.0, 1.0, 1.0)); + set_input_port_default_value(2, Vector3(0.5, 0.5, 0.5)); +} + +////////////// Vector Mix (by scalar) + +String VisualShaderNodeVectorScalarMix::get_caption() const { + return "VectorScalarMix"; +} + +int VisualShaderNodeVectorScalarMix::get_input_port_count() const { + return 3; +} + +VisualShaderNodeVectorScalarMix::PortType VisualShaderNodeVectorScalarMix::get_input_port_type(int p_port) const { + if (p_port == 2) + return PORT_TYPE_SCALAR; + return PORT_TYPE_VECTOR; +} + +String VisualShaderNodeVectorScalarMix::get_input_port_name(int p_port) const { + if (p_port == 0) { + return "a"; + } else if (p_port == 1) { + return "b"; + } else { + return "weight"; + } +} + +int VisualShaderNodeVectorScalarMix::get_output_port_count() const { + return 1; +} + +VisualShaderNodeVectorScalarMix::PortType VisualShaderNodeVectorScalarMix::get_output_port_type(int p_port) const { + return PORT_TYPE_VECTOR; +} + +String VisualShaderNodeVectorScalarMix::get_output_port_name(int p_port) const { + return "mix"; +} + +String VisualShaderNodeVectorScalarMix::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 { + return "\t" + p_output_vars[0] + " = mix( " + p_input_vars[0] + " , " + p_input_vars[1] + " , " + p_input_vars[2] + " );\n"; +} + +VisualShaderNodeVectorScalarMix::VisualShaderNodeVectorScalarMix() { + set_input_port_default_value(0, Vector3(0.0, 0.0, 0.0)); + set_input_port_default_value(1, Vector3(1.0, 1.0, 1.0)); + set_input_port_default_value(2, 0.5); } ////////////// Vector Compose @@ -2968,6 +3024,98 @@ VisualShaderNodeTextureUniform::VisualShaderNodeTextureUniform() { color_default = COLOR_DEFAULT_WHITE; } +////////////// Texture Uniform (Triplanar) + +String VisualShaderNodeTextureUniformTriplanar::get_caption() const { + return "TextureUniformTriplanar"; +} + +int VisualShaderNodeTextureUniformTriplanar::get_input_port_count() const { + return 2; +} + +VisualShaderNodeTextureUniform::PortType VisualShaderNodeTextureUniformTriplanar::get_input_port_type(int p_port) const { + if (p_port == 0) { + return PORT_TYPE_VECTOR; + } else if (p_port == 1) { + return PORT_TYPE_VECTOR; + } + return PORT_TYPE_SCALAR; +} + +String VisualShaderNodeTextureUniformTriplanar::get_input_port_name(int p_port) const { + if (p_port == 0) { + return "weights"; + } else if (p_port == 1) { + return "pos"; + } + return ""; +} + +String VisualShaderNodeTextureUniformTriplanar::generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + + String code; + + code += "// TRIPLANAR FUNCTION GLOBAL CODE\n"; + code += "\tvec4 triplanar_texture(sampler2D p_sampler, vec3 p_weights, vec3 p_triplanar_pos) {\n"; + code += "\t\tvec4 samp = vec4(0.0);\n"; + code += "\t\tsamp += texture(p_sampler, p_triplanar_pos.xy) * p_weights.z;\n"; + code += "\t\tsamp += texture(p_sampler, p_triplanar_pos.xz) * p_weights.y;\n"; + code += "\t\tsamp += texture(p_sampler, p_triplanar_pos.zy * vec2(-1.0, 1.0)) * p_weights.x;\n"; + code += "\t\treturn samp;\n"; + code += "\t}\n"; + code += "\n"; + code += "\tuniform vec3 triplanar_scale = vec3(1.0, 1.0, 1.0);\n"; + code += "\tuniform vec3 triplanar_offset;\n"; + code += "\tuniform float triplanar_sharpness = 0.5;\n"; + code += "\n"; + code += "\tvarying vec3 triplanar_power_normal;\n"; + code += "\tvarying vec3 triplanar_pos;\n"; + + return code; +} + +String VisualShaderNodeTextureUniformTriplanar::generate_global_per_func(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + + String code; + + if (p_type == VisualShader::TYPE_VERTEX) { + + code += "\t// TRIPLANAR FUNCTION VERTEX CODE\n"; + code += "\t\ttriplanar_power_normal = pow(abs(NORMAL), vec3(triplanar_sharpness));\n"; + code += "\t\ttriplanar_power_normal /= dot(triplanar_power_normal, vec3(1.0));\n"; + code += "\t\ttriplanar_pos = VERTEX * triplanar_scale + triplanar_offset;\n"; + code += "\t\ttriplanar_pos *= vec3(1.0, -1.0, 1.0);\n"; + } + + return code; +} + +String VisualShaderNodeTextureUniformTriplanar::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 { + + String id = get_uniform_name(); + String code = "\t{\n"; + + if (p_input_vars[0] == String() && p_input_vars[1] == String()) { + code += "\t\tvec4 n_tex_read = triplanar_texture( " + id + ", triplanar_power_normal, triplanar_pos );\n"; + } else if (p_input_vars[0] != String() && p_input_vars[1] == String()) { + code += "\t\tvec4 n_tex_read = triplanar_texture( " + id + ", " + p_input_vars[0] + ", triplanar_pos );\n"; + } else if (p_input_vars[0] == String() && p_input_vars[1] != String()) { + code += "\t\tvec4 n_tex_read = triplanar_texture( " + id + ", triplanar_power_normal," + p_input_vars[1] + " );\n"; + } else { + code += "\t\tvec4 n_tex_read = triplanar_texture( " + id + ", " + p_input_vars[0] + ", " + p_input_vars[1] + " );\n"; + } + + code += "\t\t" + p_output_vars[0] + " = n_tex_read.rgb;\n"; + code += "\t\t" + p_output_vars[1] + " = n_tex_read.a;\n"; + code += "\t}\n"; + + return code; +} + +VisualShaderNodeTextureUniformTriplanar::VisualShaderNodeTextureUniformTriplanar() { +} + ////////////// CubeMap Uniform String VisualShaderNodeCubeMapUniform::get_caption() const { @@ -3345,7 +3493,7 @@ String VisualShaderNodeCompare::get_warning(Shader::Mode p_mode, VisualShader::T if (ctype == CTYPE_BOOLEAN || ctype == CTYPE_TRANSFORM) { if (func > FUNC_NOT_EQUAL) { - return TTR("Invalid comparsion function for that type."); + return TTR("Invalid comparison function for that type."); } } diff --git a/scene/resources/visual_shader_nodes.h b/scene/resources/visual_shader_nodes.h index dca0ebe033..f7efa396dc 100644 --- a/scene/resources/visual_shader_nodes.h +++ b/scene/resources/visual_shader_nodes.h @@ -1171,6 +1171,27 @@ public: }; /////////////////////////////////////// + +class VisualShaderNodeVectorScalarMix : public VisualShaderNode { + GDCLASS(VisualShaderNodeVectorScalarMix, VisualShaderNode); + +public: + virtual String get_caption() const; + + virtual int get_input_port_count() const; + virtual PortType get_input_port_type(int p_port) const; + virtual String get_input_port_name(int p_port) const; + + virtual int get_output_port_count() const; + virtual PortType get_output_port_type(int p_port) const; + virtual String get_output_port_name(int p_port) const; + + virtual String 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 = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty + + VisualShaderNodeVectorScalarMix(); +}; + +/////////////////////////////////////// /// COMPOSE /////////////////////////////////////// @@ -1425,6 +1446,25 @@ VARIANT_ENUM_CAST(VisualShaderNodeTextureUniform::ColorDefault) /////////////////////////////////////// +class VisualShaderNodeTextureUniformTriplanar : public VisualShaderNodeTextureUniform { + GDCLASS(VisualShaderNodeTextureUniformTriplanar, VisualShaderNodeTextureUniform); + +public: + virtual String get_caption() const; + + virtual int get_input_port_count() const; + virtual PortType get_input_port_type(int p_port) const; + virtual String get_input_port_name(int p_port) const; + + virtual String generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String generate_global_per_func(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String 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 = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty + + VisualShaderNodeTextureUniformTriplanar(); +}; + +/////////////////////////////////////// + class VisualShaderNodeCubeMapUniform : public VisualShaderNode { GDCLASS(VisualShaderNodeCubeMapUniform, VisualShaderNode); @@ -1605,13 +1645,13 @@ public: virtual String 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 = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty - void set_comparsion_type(ComparsionType p_func); + void set_comparsion_type(ComparsionType p_type); ComparsionType get_comparsion_type() const; void set_function(Function p_func); Function get_function() const; - void set_condition(Condition p_mode); + void set_condition(Condition p_cond); Condition get_condition() const; virtual Vector<StringName> get_editable_properties() const; diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index 17f5e158a7..c651c177b5 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -134,31 +134,31 @@ AudioStreamMicrophone::AudioStreamMicrophone() { void AudioStreamPlaybackMicrophone::_mix_internal(AudioFrame *p_buffer, int p_frames) { - AudioDriver::get_singleton()->lock(); + AudioServer::get_singleton()->lock(); - Vector<int32_t> buf = AudioDriver::get_singleton()->get_input_buffer(); - unsigned int input_size = AudioDriver::get_singleton()->get_input_size(); - int mix_rate = AudioDriver::get_singleton()->get_mix_rate(); - unsigned int playback_delay = MIN(((50 * mix_rate) / 1000) * 2, buf.size() >> 1); + PoolVector<int32_t> capture_buffer = AudioServer::get_singleton()->get_capture_buffer(); + unsigned int capture_size = AudioServer::get_singleton()->get_capture_size(); + int mix_rate = AudioServer::get_singleton()->get_mix_rate(); + unsigned int playback_delay = MIN(((50 * mix_rate) / 1000) * 2, capture_buffer.size() >> 1); #ifdef DEBUG_ENABLED - unsigned int input_position = AudioDriver::get_singleton()->get_input_position(); + unsigned int capture_position = AudioServer::get_singleton()->get_capture_position(); #endif - if (playback_delay > input_size) { + if (playback_delay > capture_size) { for (int i = 0; i < p_frames; i++) { p_buffer[i] = AudioFrame(0.0f, 0.0f); } - input_ofs = 0; + capture_ofs = 0; } else { for (int i = 0; i < p_frames; i++) { - if (input_size > input_ofs && (int)input_ofs < buf.size()) { - float l = (buf[input_ofs++] >> 16) / 32768.f; - if ((int)input_ofs >= buf.size()) { - input_ofs = 0; + if (capture_size > capture_ofs && (int)capture_ofs < capture_buffer.size()) { + float l = (capture_buffer[capture_ofs++] >> 16) / 32768.f; + if ((int)capture_ofs >= capture_buffer.size()) { + capture_ofs = 0; } - float r = (buf[input_ofs++] >> 16) / 32768.f; - if ((int)input_ofs >= buf.size()) { - input_ofs = 0; + float r = (capture_buffer[capture_ofs++] >> 16) / 32768.f; + if ((int)capture_ofs >= capture_buffer.size()) { + capture_ofs = 0; } p_buffer[i] = AudioFrame(l, r); @@ -169,12 +169,12 @@ void AudioStreamPlaybackMicrophone::_mix_internal(AudioFrame *p_buffer, int p_fr } #ifdef DEBUG_ENABLED - if (input_ofs > input_position && (int)(input_ofs - input_position) < (p_frames * 2)) { - print_verbose(String(get_class_name()) + " buffer underrun: input_position=" + itos(input_position) + " input_ofs=" + itos(input_ofs) + " input_size=" + itos(input_size)); + if (capture_ofs > capture_position && (int)(capture_ofs - capture_position) < (p_frames * 2)) { + print_verbose(String(get_class_name()) + " buffer underrun: capture_position=" + itos(capture_position) + " capture_ofs=" + itos(capture_ofs) + " capture_size=" + itos(capture_size)); } #endif - AudioDriver::get_singleton()->unlock(); + AudioServer::get_singleton()->unlock(); } void AudioStreamPlaybackMicrophone::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) { @@ -196,9 +196,9 @@ void AudioStreamPlaybackMicrophone::start(float p_from_pos) { return; } - input_ofs = 0; + capture_ofs = 0; - if (AudioDriver::get_singleton()->capture_start() == OK) { + if (AudioServer::get_singleton()->capture_start() == OK) { active = true; _begin_resample(); } @@ -206,7 +206,7 @@ void AudioStreamPlaybackMicrophone::start(float p_from_pos) { void AudioStreamPlaybackMicrophone::stop() { if (active) { - AudioDriver::get_singleton()->capture_stop(); + AudioServer::get_singleton()->capture_stop(); active = false; } } diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h index ef9f8ea92a..4548f8f036 100644 --- a/servers/audio/audio_stream.h +++ b/servers/audio/audio_stream.h @@ -123,7 +123,7 @@ class AudioStreamPlaybackMicrophone : public AudioStreamPlaybackResampled { friend class AudioStreamMicrophone; bool active; - unsigned int input_ofs; + unsigned int capture_ofs; Ref<AudioStreamMicrophone> microphone; diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp index c2f8b97c1a..216a0a4aa6 100644 --- a/servers/audio/effects/audio_effect_chorus.cpp +++ b/servers/audio/effects/audio_effect_chorus.cpp @@ -333,28 +333,28 @@ void AudioEffectChorus::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 0); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 0); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/cutoff_hz", PROPERTY_HINT_RANGE, "1,16000,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 0); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 0); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 0); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/cutoff_hz", PROPERTY_HINT_RANGE, "1,16000,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 1); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/cutoff_hz", PROPERTY_HINT_RANGE, "1,16000,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 2); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 3); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 3); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 3); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/cutoff_hz", PROPERTY_HINT_RANGE, "1,16000,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 3); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 3); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 3); } diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp index 37305bd7f4..278647c304 100644 --- a/servers/audio/effects/audio_effect_distortion.cpp +++ b/servers/audio/effects/audio_effect_distortion.cpp @@ -173,7 +173,7 @@ void AudioEffectDistortion::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Clip,ATan,LoFi,Overdrive,WaveShape"), "set_mode", "get_mode"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "pre_gain", PROPERTY_HINT_RANGE, "-60,60,0.01"), "set_pre_gain", "get_pre_gain"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "keep_hf_hz", PROPERTY_HINT_RANGE, "1,20000,1"), "set_keep_hf_hz", "get_keep_hf_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "keep_hf_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_keep_hf_hz", "get_keep_hf_hz"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "drive", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drive", "get_drive"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "post_gain", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_post_gain", "get_post_gain"); diff --git a/servers/audio/effects/audio_effect_filter.cpp b/servers/audio/effects/audio_effect_filter.cpp index dc86d6ffbb..3841f2b5a0 100644 --- a/servers/audio/effects/audio_effect_filter.cpp +++ b/servers/audio/effects/audio_effect_filter.cpp @@ -156,7 +156,7 @@ void AudioEffectFilter::_bind_methods() { ClassDB::bind_method(D_METHOD("set_db", "amount"), &AudioEffectFilter::set_db); ClassDB::bind_method(D_METHOD("get_db"), &AudioEffectFilter::get_db); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cutoff_hz", PROPERTY_HINT_RANGE, "1,40000,0.1"), "set_cutoff", "get_cutoff"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_cutoff", "get_cutoff"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "resonance", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_resonance", "get_resonance"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "gain", PROPERTY_HINT_RANGE, "0,4,0.01"), "set_gain", "get_gain"); ADD_PROPERTY(PropertyInfo(Variant::INT, "db", PROPERTY_HINT_ENUM, "6 dB,12 dB,18 dB,24 dB"), "set_db", "get_db"); diff --git a/servers/audio/effects/audio_effect_pitch_shift.cpp b/servers/audio/effects/audio_effect_pitch_shift.cpp index c250f2e2bd..ec3182685f 100644 --- a/servers/audio/effects/audio_effect_pitch_shift.cpp +++ b/servers/audio/effects/audio_effect_pitch_shift.cpp @@ -70,7 +70,7 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice and this license appear in all source copies. * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF -* ANY KIND. See http://www.dspguru.com/wol.htm for more information. +* ANY KIND. See https://dspguru.com/wide-open-license/ for more information. * *****************************************************************************/ diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp index acf27d2bbf..1390ab55c4 100644 --- a/servers/audio/effects/audio_effect_record.cpp +++ b/servers/audio/effects/audio_effect_record.cpp @@ -217,7 +217,7 @@ Ref<AudioStreamSample> AudioEffectRecord::get_recording() const { PoolVector<uint8_t> dst_data; ERR_FAIL_COND_V(current_instance.is_null(), NULL); - ERR_FAIL_COND_V(current_instance->recording_data.size(), NULL); + ERR_FAIL_COND_V(current_instance->recording_data.size() == 0, NULL); if (dst_format == AudioStreamSample::FORMAT_8_BITS) { int data_size = current_instance->recording_data.size(); diff --git a/servers/audio/voice_rb_sw.h b/servers/audio/voice_rb_sw.h index 0a39c536ae..1f0c88ed30 100644 --- a/servers/audio/voice_rb_sw.h +++ b/servers/audio/voice_rb_sw.h @@ -125,8 +125,7 @@ public: if (full) { #ifdef DEBUG_ENABLED if (OS::get_singleton()->is_stdout_verbose()) { - ERR_EXPLAIN("Audio Ring Buffer Full (too many commands"); - ERR_FAIL_COND(((write_pos + 1) % VOICE_RB_SIZE) == read_pos); + ERR_FAIL_COND_MSG(((write_pos + 1) % VOICE_RB_SIZE) == read_pos, "Audio ring buffer full (too many commands)."); } #endif return; diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index a6473d69c0..2cf6a67bef 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -85,26 +85,26 @@ double AudioDriver::get_time_to_next_mix() const { return mix_buffer - total; } -void AudioDriver::input_buffer_init(int driver_buffer_frames) { +void AudioDriver::capture_buffer_init(int driver_buffer_frames) { - const int input_buffer_channels = 2; - input_buffer.resize(driver_buffer_frames * input_buffer_channels * 4); - input_position = 0; - input_size = 0; + const int capture_buffer_channels = 2; + capture_buffer.resize(driver_buffer_frames * capture_buffer_channels * 4); + capture_position = 0; + capture_size = 0; } -void AudioDriver::input_buffer_write(int32_t sample) { +void AudioDriver::capture_buffer_write(int32_t sample) { - if ((int)input_position < input_buffer.size()) { - input_buffer.write[input_position++] = sample; - if ((int)input_position >= input_buffer.size()) { - input_position = 0; + if ((int)capture_position < capture_buffer.size()) { + capture_buffer.write()[capture_position++] = sample; + if ((int)capture_position >= capture_buffer.size()) { + capture_position = 0; } - if ((int)input_size < input_buffer.size()) { - input_size++; + if ((int)capture_size < capture_buffer.size()) { + capture_size++; } } else { - WARN_PRINTS("input_buffer_write: Invalid input_position=" + itos(input_position) + " input_buffer.size()=" + itos(input_buffer.size())); + WARN_PRINTS("capture_buffer_write: Invalid capture_position=" + itos(capture_position) + " capture_buffer.size()=" + itos(capture_buffer.size())); } } @@ -154,8 +154,8 @@ AudioDriver::AudioDriver() { _last_mix_time = 0; _last_mix_frames = 0; - input_position = 0; - input_size = 0; + capture_position = 0; + capture_size = 0; #ifdef DEBUG_ENABLED prof_time = 0; @@ -338,6 +338,8 @@ void AudioServer::_mix_step() { E->get().callback(E->get().userdata); } + emit_signal("audio_mix_callback"); + for (int i = buses.size() - 1; i >= 0; i--) { //go bus by bus Bus *bus = buses[i]; @@ -1057,6 +1059,8 @@ void AudioServer::update() { E->get().callback(E->get().userdata); } + + emit_signal("audio_update_callback"); } void AudioServer::load_default_bus_layout() { @@ -1302,6 +1306,14 @@ void AudioServer::set_device(String device) { AudioDriver::get_singleton()->set_device(device); } +Error AudioServer::capture_start() { + return AudioDriver::get_singleton()->capture_start(); +} + +Error AudioServer::capture_stop() { + return AudioDriver::get_singleton()->capture_stop(); +} + Array AudioServer::capture_get_device_list() { return AudioDriver::get_singleton()->capture_get_device_list(); @@ -1317,6 +1329,18 @@ void AudioServer::capture_set_device(const String &p_name) { AudioDriver::get_singleton()->capture_set_device(p_name); } +PoolVector<int32_t> AudioServer::get_capture_buffer() { + return AudioDriver::get_singleton()->get_capture_buffer(); +} + +unsigned int AudioServer::get_capture_position() { + return AudioDriver::get_singleton()->get_capture_position(); +} + +unsigned int AudioServer::get_capture_size() { + return AudioDriver::get_singleton()->get_capture_size(); +} + void AudioServer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bus_count", "amount"), &AudioServer::set_bus_count); @@ -1377,18 +1401,28 @@ void AudioServer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_time_since_last_mix"), &AudioServer::get_time_since_last_mix); ClassDB::bind_method(D_METHOD("get_output_latency"), &AudioServer::get_output_latency); + ClassDB::bind_method(D_METHOD("capture_start"), &AudioServer::capture_start); + ClassDB::bind_method(D_METHOD("capture_stop"), &AudioServer::capture_stop); + ClassDB::bind_method(D_METHOD("capture_get_device_list"), &AudioServer::capture_get_device_list); ClassDB::bind_method(D_METHOD("capture_get_device"), &AudioServer::capture_get_device); ClassDB::bind_method(D_METHOD("capture_set_device", "name"), &AudioServer::capture_set_device); + ClassDB::bind_method(D_METHOD("get_capture_buffer"), &AudioServer::get_capture_buffer); + ClassDB::bind_method(D_METHOD("get_capture_position"), &AudioServer::get_capture_position); + ClassDB::bind_method(D_METHOD("get_capture_size"), &AudioServer::get_capture_size); + ClassDB::bind_method(D_METHOD("set_bus_layout", "bus_layout"), &AudioServer::set_bus_layout); ClassDB::bind_method(D_METHOD("generate_bus_layout"), &AudioServer::generate_bus_layout); ADD_PROPERTY(PropertyInfo(Variant::INT, "bus_count"), "set_bus_count", "get_bus_count"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "device"), "set_device", "get_device"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "capture_device"), "capture_set_device", "capture_get_device"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rate_scale"), "set_global_rate_scale", "get_global_rate_scale"); ADD_SIGNAL(MethodInfo("bus_layout_changed")); + ADD_SIGNAL(MethodInfo("audio_mix_callback")); + ADD_SIGNAL(MethodInfo("audio_update_callback")); BIND_ENUM_CONSTANT(SPEAKER_MODE_STEREO); BIND_ENUM_CONSTANT(SPEAKER_SURROUND_31); diff --git a/servers/audio_server.h b/servers/audio_server.h index b0fff9d4b7..72bb6faf42 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -53,14 +53,14 @@ class AudioDriver { #endif protected: - Vector<int32_t> input_buffer; - unsigned int input_position; - unsigned int input_size; + PoolVector<int32_t> capture_buffer; + unsigned int capture_position; + unsigned int capture_size; void audio_server_process(int p_frames, int32_t *p_buffer, bool p_update_mix_time = true); void update_mix_time(int p_frames); - void input_buffer_init(int driver_buffer_frames); - void input_buffer_write(int32_t sample); + void capture_buffer_init(int driver_buffer_frames); + void capture_buffer_write(int32_t sample); #ifdef DEBUG_ENABLED _FORCE_INLINE_ void start_counting_ticks() { prof_ticks = OS::get_singleton()->get_ticks_usec(); } @@ -111,9 +111,9 @@ public: SpeakerMode get_speaker_mode_by_total_channels(int p_channels) const; int get_total_channels_by_speaker_mode(SpeakerMode) const; - Vector<int32_t> get_input_buffer() { return input_buffer; } - unsigned int get_input_position() { return input_position; } - unsigned int get_input_size() { return input_size; } + PoolVector<int32_t> get_capture_buffer() { return capture_buffer; } + unsigned int get_capture_position() { return capture_position; } + unsigned int get_capture_size() { return capture_size; } #ifdef DEBUG_ENABLED uint64_t get_profiling_time() const { return prof_time; } @@ -384,10 +384,17 @@ public: String get_device(); void set_device(String device); + Error capture_start(); + Error capture_stop(); + Array capture_get_device_list(); String capture_get_device(); void capture_set_device(const String &p_name); + PoolVector<int32_t> get_capture_buffer(); + unsigned int get_capture_position(); + unsigned int get_capture_size(); + AudioServer(); virtual ~AudioServer(); }; diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index 172a2a3429..a3bb581cb5 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -266,6 +266,7 @@ void BodySW::set_mode(PhysicsServer::BodyMode p_mode) { _inv_mass = mass > 0 ? (1.0 / mass) : 0; _set_static(false); + angular_velocity = Vector3(); } break; } diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h index 895eda8528..b9912f0ba2 100644 --- a/servers/physics/collision_object_sw.h +++ b/servers/physics/collision_object_sw.h @@ -86,13 +86,9 @@ protected: void _unregister_shapes(); _FORCE_INLINE_ void _set_transform(const Transform &p_transform, bool p_update_shapes = true) { - #ifdef DEBUG_ENABLED - if (p_transform.origin.length_squared() > MAX_OBJECT_DISTANCE_X2) { - ERR_EXPLAIN("Object went too far away (more than " + itos(MAX_OBJECT_DISTANCE) + "mts from origin)."); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(p_transform.origin.length_squared() > MAX_OBJECT_DISTANCE_X2, "Object went too far away (more than " + itos(MAX_OBJECT_DISTANCE) + " units from origin)."); #endif transform = p_transform; diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics/collision_solver_sw.cpp index 0d10dae8cc..d970dd39fb 100644 --- a/servers/physics/collision_solver_sw.cpp +++ b/servers/physics/collision_solver_sw.cpp @@ -233,8 +233,6 @@ bool CollisionSolverSW::solve_static(const ShapeSW *p_shape_A, const Transform & return collision_solver(p_shape_A, p_transform_A, p_shape_B, p_transform_B, p_result_callback, p_userdata, false, r_sep_axis, p_margin_A, p_margin_B); } - - return false; } void CollisionSolverSW::concave_distance_callback(void *p_userdata, ShapeSW *p_convex) { @@ -371,6 +369,4 @@ bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A, const Transform return gjk_epa_calculate_distance(p_shape_A, p_transform_A, p_shape_B, p_transform_B, r_point_A, r_point_B); //should pass sepaxis.. } - - return false; } diff --git a/servers/physics/gjk_epa.h b/servers/physics/gjk_epa.h index 0b7885c9a5..d3fa192804 100644 --- a/servers/physics/gjk_epa.h +++ b/servers/physics/gjk_epa.h @@ -31,11 +31,8 @@ #ifndef GJK_EPA_H #define GJK_EPA_H -#include "shape_sw.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ #include "collision_solver_sw.h" +#include "shape_sw.h" bool gjk_epa_calculate_penetration(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, CollisionSolverSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap = false); bool gjk_epa_calculate_distance(const ShapeSW *p_shape_A, const Transform &p_transform_A, const ShapeSW *p_shape_B, const Transform &p_transform_B, Vector3 &r_result_A, Vector3 &r_result_B); diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp index 1d1b30286e..209cddda5e 100644 --- a/servers/physics/joints/hinge_joint_sw.cpp +++ b/servers/physics/joints/hinge_joint_sw.cpp @@ -198,7 +198,6 @@ bool HingeJointSW::setup(real_t p_step) { plane_space(m_rbAFrame.basis.get_axis(2), jointAxis0local, jointAxis1local); - A->get_transform().basis.xform(m_rbAFrame.basis.get_axis(2)); Vector3 jointAxis0 = A->get_transform().basis.xform(jointAxis0local); Vector3 jointAxis1 = A->get_transform().basis.xform(jointAxis1local); Vector3 hingeAxisWorld = A->get_transform().basis.xform(m_rbAFrame.basis.get_axis(2)); diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index 7b982e7015..09872977b6 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -40,11 +40,8 @@ #include "joints/pin_joint_sw.h" #include "joints/slider_joint_sw.h" -#define FLUSH_QUERY_CHECK(m_object) \ - if (m_object->get_space() && flushing_queries) { \ - ERR_EXPLAIN("Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead"); \ - ERR_FAIL(); \ - } +#define FLUSH_QUERY_CHECK(m_object) \ + ERR_FAIL_COND_MSG(m_object->get_space() && flushing_queries, "Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead."); RID PhysicsServerSW::shape_create(ShapeType p_shape) { @@ -73,8 +70,7 @@ RID PhysicsServerSW::shape_create(ShapeType p_shape) { } break; case SHAPE_CYLINDER: { - ERR_EXPLAIN("CylinderShape is not supported in GodotPhysics. Please switch to Bullet in the Project Settings."); - ERR_FAIL_V(RID()); + ERR_FAIL_V_MSG(RID(), "CylinderShape is not supported in GodotPhysics. Please switch to Bullet in the Project Settings."); } break; case SHAPE_CONVEX_POLYGON: { @@ -200,11 +196,7 @@ PhysicsDirectSpaceState *PhysicsServerSW::space_get_direct_state(RID p_space) { SpaceSW *space = space_owner.get(p_space); ERR_FAIL_COND_V(!space, NULL); - if (!doing_sync || space->is_locked()) { - - ERR_EXPLAIN("Space state is inaccessible right now, wait for iteration or physics process notification."); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!doing_sync || space->is_locked(), NULL, "Space state is inaccessible right now, wait for iteration or physics process notification."); return space->get_direct_state(); } @@ -987,12 +979,7 @@ PhysicsDirectBodyState *PhysicsServerSW::body_get_direct_state(RID p_body) { BodySW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body, NULL); - - if (!doing_sync || body->get_space()->is_locked()) { - - ERR_EXPLAIN("Body state is inaccessible right now, wait for iteration or physics process notification."); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(!doing_sync || body->get_space()->is_locked(), NULL, "Body state is inaccessible right now, wait for iteration or physics process notification."); direct_state->body = body; return direct_state; @@ -1410,8 +1397,7 @@ void PhysicsServerSW::free(RID p_rid) { } else { - ERR_EXPLAIN("Invalid ID"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid ID."); } }; diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index 8a52f29729..f01caefdce 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -543,16 +543,6 @@ void CapsuleShapeSW::project_range(const Vector3 &p_normal, const Transform &p_t r_max = p_normal.dot(p_transform.xform(n)); r_min = p_normal.dot(p_transform.xform(-n)); - return; - - n = p_transform.basis.xform(n); - - real_t distance = p_normal.dot(p_transform.origin); - real_t length = Math::abs(p_normal.dot(n)); - r_min = distance - length; - r_max = distance + length; - - ERR_FAIL_COND(r_max < r_min); } Vector3 CapsuleShapeSW::get_support(const Vector3 &p_normal) const { diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index f3a4cbed24..410b6e59a0 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -348,11 +348,9 @@ bool PhysicsDirectSpaceStateSW::collide_shape(RID p_shape, const Transform &p_sh cbk.max = p_result_max; cbk.amount = 0; cbk.ptr = r_results; - CollisionSolverSW::CallbackResult cbkres = NULL; + CollisionSolverSW::CallbackResult cbkres = PhysicsServerSW::_shape_col_cbk; - PhysicsServerSW::CollCbkData *cbkptr = NULL; - cbkptr = &cbk; - cbkres = PhysicsServerSW::_shape_col_cbk; + PhysicsServerSW::CollCbkData *cbkptr = &cbk; for (int i = 0; i < amount; i++) { diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 60bbcef4b6..60fb3a3a95 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -47,8 +47,10 @@ void Body2DSW::update_inertias() { case Physics2DServer::BODY_MODE_RIGID: { - if (user_inertia) break; - + if (user_inertia) { + _inv_inertia = inertia > 0 ? (1.0 / inertia) : 0; + break; + } //update tensor for allshapes, not the best way but should be somehow OK. (inspired from bullet) real_t total_area = 0; @@ -57,7 +59,7 @@ void Body2DSW::update_inertias() { total_area += get_shape_aabb(i).get_area(); } - real_t _inertia = 0; + inertia = 0; for (int i = 0; i < get_shape_count(); i++) { @@ -73,15 +75,10 @@ void Body2DSW::update_inertias() { Transform2D mtx = get_shape_transform(i); Vector2 scale = mtx.get_scale(); - _inertia += shape->get_moment_of_inertia(mass, scale) + mass * mtx.get_origin().length_squared(); - //Rect2 ab = get_shape_aabb(i); - //_inertia+=mass*ab.size.dot(ab.size)/12.0f; + inertia += shape->get_moment_of_inertia(mass, scale) + mass * mtx.get_origin().length_squared(); } - if (_inertia != 0) - _inv_inertia = 1.0 / _inertia; - else - _inv_inertia = 0.0; //wathever + _inv_inertia = inertia > 0 ? (1.0 / inertia) : 0; if (mass) _inv_mass = 1.0 / mass; @@ -160,6 +157,7 @@ void Body2DSW::set_param(Physics2DServer::BodyParameter p_param, real_t p_value) _update_inertia(); } else { user_inertia = true; + inertia = p_value; _inv_inertia = 1.0 / p_value; } } break; @@ -185,28 +183,28 @@ real_t Body2DSW::get_param(Physics2DServer::BodyParameter p_param) const { case Physics2DServer::BODY_PARAM_BOUNCE: { return bounce; - } break; + } case Physics2DServer::BODY_PARAM_FRICTION: { return friction; - } break; + } case Physics2DServer::BODY_PARAM_MASS: { return mass; - } break; + } case Physics2DServer::BODY_PARAM_INERTIA: { - return _inv_inertia == 0 ? 0 : 1.0 / _inv_inertia; - } break; + return inertia; + } case Physics2DServer::BODY_PARAM_GRAVITY_SCALE: { return gravity_scale; - } break; + } case Physics2DServer::BODY_PARAM_LINEAR_DAMP: { return linear_damp; - } break; + } case Physics2DServer::BODY_PARAM_ANGULAR_DAMP: { return angular_damp; - } break; + } default: { } } @@ -226,6 +224,7 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) { _set_inv_transform(get_transform().affine_inverse()); _inv_mass = 0; + _inv_inertia = 0; _set_static(p_mode == Physics2DServer::BODY_MODE_STATIC); set_active(p_mode == Physics2DServer::BODY_MODE_KINEMATIC && contacts.size()); linear_velocity = Vector2(); @@ -237,17 +236,21 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) { case Physics2DServer::BODY_MODE_RIGID: { _inv_mass = mass > 0 ? (1.0 / mass) : 0; + _inv_inertia = inertia > 0 ? (1.0 / inertia) : 0; _set_static(false); } break; case Physics2DServer::BODY_MODE_CHARACTER: { _inv_mass = mass > 0 ? (1.0 / mass) : 0; + _inv_inertia = 0; _set_static(false); + angular_velocity = 0; } break; } - - _update_inertia(); + if (p_mode == Physics2DServer::BODY_MODE_RIGID && _inv_inertia == 0) { + _update_inertia(); + } /* if (get_space()) _update_queries(); @@ -343,19 +346,19 @@ Variant Body2DSW::get_state(Physics2DServer::BodyState p_state) const { switch (p_state) { case Physics2DServer::BODY_STATE_TRANSFORM: { return get_transform(); - } break; + } case Physics2DServer::BODY_STATE_LINEAR_VELOCITY: { return linear_velocity; - } break; + } case Physics2DServer::BODY_STATE_ANGULAR_VELOCITY: { return angular_velocity; - } break; + } case Physics2DServer::BODY_STATE_SLEEPING: { return !is_active(); - } break; + } case Physics2DServer::BODY_STATE_CAN_SLEEP: { return can_sleep; - } break; + } } return Variant(); @@ -608,7 +611,7 @@ void Body2DSW::call_queries() { set_force_integration_callback(0, StringName()); } else { Variant::CallError ce; - if (fi_callback->callback_udata.get_type()) { + if (fi_callback->callback_udata.get_type() != Variant::NIL) { obj->call(fi_callback->method, vp, 2, ce); diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h index 8c64dc9230..5df184c894 100644 --- a/servers/physics_2d/body_2d_sw.h +++ b/servers/physics_2d/body_2d_sw.h @@ -52,6 +52,7 @@ class Body2DSW : public CollisionObject2DSW { real_t gravity_scale; real_t mass; + real_t inertia; real_t bounce; real_t friction; diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 1bbb50c974..6dd19c2868 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -673,7 +673,7 @@ public IEnumerable<Point3D> GetCellsOnRay(Ray ray, int maxDepth) // "A Fast Voxel Traversal Algorithm for Ray Tracing" // John Amanatides, Andrew Woo // http://www.cse.yorku.ca/~amana/research/grid.pdf - // http://www.devmaster.net/articles/raytracing_series/A%20faster%20voxel%20traversal%20algorithm%20for%20ray%20tracing.pdf + // https://web.archive.org/web/20100616193049/http://www.devmaster.net/articles/raytracing_series/A%20faster%20voxel%20traversal%20algorithm%20for%20ray%20tracing.pdf // NOTES: // * This code assumes that the ray's position and direction are in 'cell coordinates', which means diff --git a/servers/physics_2d/collision_solver_2d_sat.cpp b/servers/physics_2d/collision_solver_2d_sat.cpp index f4bff66389..19e4b8c1d9 100644 --- a/servers/physics_2d/collision_solver_2d_sat.cpp +++ b/servers/physics_2d/collision_solver_2d_sat.cpp @@ -172,8 +172,8 @@ static void _generate_contacts_from_supports(const Vector2 *p_points_A, int p_po points_B = p_points_B; } - int version_A = (pointcount_A > 3 ? 3 : pointcount_A) - 1; - int version_B = (pointcount_B > 3 ? 3 : pointcount_B) - 1; + int version_A = (pointcount_A > 2 ? 2 : pointcount_A) - 1; + int version_B = (pointcount_B > 2 ? 2 : pointcount_B) - 1; GenerateContactsFunc contacts_func = generate_contacts_func_table[version_A][version_B]; ERR_FAIL_COND(!contacts_func); @@ -313,10 +313,12 @@ public: if (best_axis == Vector2(0.0, 0.0)) return; - callback->collided = true; + if (callback) { + callback->collided = true; - if (!callback->callback) - return; //only collide, no callback + if (!callback->callback) + return; //only collide, no callback + } static const int max_supports = 2; Vector2 supports_A[max_supports]; @@ -354,12 +356,13 @@ public: supports_B[i] += best_axis * margin_B; } } + if (callback) { + callback->normal = best_axis; + _generate_contacts_from_supports(supports_A, support_count_A, supports_B, support_count_B, callback); - callback->normal = best_axis; - _generate_contacts_from_supports(supports_A, support_count_A, supports_B, support_count_B, callback); - - if (callback && callback->sep_axis && *callback->sep_axis != Vector2()) - *callback->sep_axis = Vector2(); //invalidate previous axis (no test) + if (callback->sep_axis && *callback->sep_axis != Vector2()) + *callback->sep_axis = Vector2(); //invalidate previous axis (no test) + } } _FORCE_INLINE_ SeparatorAxisTest2D(const ShapeA *p_shape_A, const Transform2D &p_transform_a, const ShapeB *p_shape_B, const Transform2D &p_transform_b, _CollectorCallback2D *p_collector, const Vector2 &p_motion_A = Vector2(), const Vector2 &p_motion_B = Vector2(), real_t p_margin_A = 0, real_t p_margin_B = 0) { diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index e49961c048..03c0fd5981 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -249,6 +249,4 @@ bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A, const Transform2D &p return collision_solver(p_shape_A, p_transform_A, p_motion_A, p_shape_B, p_transform_B, p_motion_B, p_result_callback, p_userdata, false, sep_axis, margin_A, margin_B); } - - return false; } diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index cc656d3b73..80e204087a 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -36,11 +36,8 @@ #include "core/project_settings.h" #include "core/script_language.h" -#define FLUSH_QUERY_CHECK(m_object) \ - if (m_object->get_space() && flushing_queries) { \ - ERR_EXPLAIN("Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead"); \ - ERR_FAIL(); \ - } +#define FLUSH_QUERY_CHECK(m_object) \ + ERR_FAIL_COND_MSG(m_object->get_space() && flushing_queries, "Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead."); RID Physics2DServerSW::_shape_create(ShapeType p_shape) { @@ -316,11 +313,7 @@ Physics2DDirectSpaceState *Physics2DServerSW::space_get_direct_state(RID p_space Space2DSW *space = space_owner.get(p_space); ERR_FAIL_COND_V(!space, NULL); - if ((using_threads && !doing_sync) || space->is_locked()) { - - ERR_EXPLAIN("Space state is inaccessible right now, wait for iteration or physics process notification."); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG((using_threads && !doing_sync) || space->is_locked(), NULL, "Space state is inaccessible right now, wait for iteration or physics process notification."); return space->get_direct_state(); } @@ -1075,10 +1068,7 @@ int Physics2DServerSW::body_test_ray_separation(RID p_body, const Transform2D &p Physics2DDirectBodyState *Physics2DServerSW::body_get_direct_state(RID p_body) { - if ((using_threads && !doing_sync)) { - ERR_EXPLAIN("Body state is inaccessible right now, wait for iteration or physics process notification."); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG((using_threads && !doing_sync), NULL, "Body state is inaccessible right now, wait for iteration or physics process notification."); if (!body_owner.owns(p_body)) return NULL; @@ -1086,12 +1076,7 @@ Physics2DDirectBodyState *Physics2DServerSW::body_get_direct_state(RID p_body) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body, NULL); ERR_FAIL_COND_V(!body->get_space(), NULL); - - if (body->get_space()->is_locked()) { - - ERR_EXPLAIN("Body state is inaccessible right now, wait for iteration or physics process notification."); - ERR_FAIL_V(NULL); - } + ERR_FAIL_COND_V_MSG(body->get_space()->is_locked(), NULL, "Body state is inaccessible right now, wait for iteration or physics process notification."); direct_state->body = body; return direct_state; @@ -1321,8 +1306,7 @@ void Physics2DServerSW::free(RID p_rid) { } else { - ERR_EXPLAIN("Invalid ID"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid ID."); } }; diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index 71c00c0abf..c698290fd9 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -54,8 +54,6 @@ void Physics2DServerWrapMT::thread_loop() { server_thread = Thread::get_caller_id(); - OS::get_singleton()->make_rendering_thread(); - physics_2d_server->init(); exit = false; diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.h b/servers/physics_2d/physics_2d_server_wrap_mt.h index b61e1faad2..33a184ba3f 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.h +++ b/servers/physics_2d/physics_2d_server_wrap_mt.h @@ -327,11 +327,11 @@ public: static Physics2DServer *init_server() { int tm = GLOBAL_DEF("physics/2d/thread_model", 1); - if (tm == 0) //single unsafe + if (tm == 0) // single unsafe return memnew(T); - else if (tm == 1) //single saef + else if (tm == 1) // single safe return memnew(Physics2DServerWrapMT(memnew(T), false)); - else //single unsafe + else // multi threaded return memnew(Physics2DServerWrapMT(memnew(T), true)); } diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 7c89c43f36..2778775446 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -330,11 +330,9 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D & cbk.amount = 0; cbk.passed = 0; cbk.ptr = r_results; - CollisionSolver2DSW::CallbackResult cbkres = NULL; + CollisionSolver2DSW::CallbackResult cbkres = Physics2DServerSW::_shape_col_cbk; - Physics2DServerSW::CollCbkData *cbkptr = NULL; - cbkptr = &cbk; - cbkres = Physics2DServerSW::_shape_col_cbk; + Physics2DServerSW::CollCbkData *cbkptr = &cbk; for (int i = 0; i < amount; i++) { diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index e0be58d0c1..1dd6699851 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -785,6 +785,17 @@ ShaderLanguage::DataPrecision ShaderLanguage::get_token_precision(TokenType p_ty return PRECISION_MEDIUMP; } +String ShaderLanguage::get_precision_name(DataPrecision p_type) { + switch (p_type) { + case PRECISION_LOWP: return "lowp"; + case PRECISION_MEDIUMP: return "mediump"; + case PRECISION_HIGHP: return "highp"; + default: + break; + } + return ""; +} + String ShaderLanguage::get_datatype_name(DataType p_type) { switch (p_type) { @@ -849,7 +860,7 @@ void ShaderLanguage::clear() { } } -bool ShaderLanguage::_find_identifier(const BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, const StringName &p_identifier, DataType *r_data_type, IdentifierType *r_type) { +bool ShaderLanguage::_find_identifier(const BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, const StringName &p_identifier, DataType *r_data_type, IdentifierType *r_type, bool *r_is_const, int *r_array_size) { if (p_builtin_types.has(p_identifier)) { @@ -871,6 +882,12 @@ bool ShaderLanguage::_find_identifier(const BlockNode *p_block, const Map<String if (r_data_type) { *r_data_type = p_block->variables[p_identifier].type; } + if (r_is_const) { + *r_is_const = p_block->variables[p_identifier].is_const; + } + if (r_array_size) { + *r_array_size = p_block->variables[p_identifier].array_size; + } if (r_type) { *r_type = IDENTIFIER_LOCAL_VAR; } @@ -944,6 +961,7 @@ bool ShaderLanguage::_find_identifier(const BlockNode *p_block, const Map<String if (r_type) { *r_type = IDENTIFIER_FUNCTION; } + return true; } } @@ -953,7 +971,7 @@ bool ShaderLanguage::_find_identifier(const BlockNode *p_block, const Map<String bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type) { bool valid = false; - DataType ret_type; + DataType ret_type = TYPE_VOID; switch (p_op->op) { case OP_EQUAL: @@ -1328,721 +1346,730 @@ 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 } }, - { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_BOOL, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_BVEC2, TYPE_BOOL, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BVEC2, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC2, TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BOOL, TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BVEC2, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC3, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC3, TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID } }, - - { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - - { "int", TYPE_INT, { TYPE_INT, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_IVEC2, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_IVEC2, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC3, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - - { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UVEC2, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC2, TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UVEC2, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC3, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - - { "mat2", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "mat3", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "mat4", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "mat2", TYPE_MAT2, { TYPE_FLOAT, TYPE_VOID } }, - { "mat3", TYPE_MAT3, { TYPE_FLOAT, TYPE_VOID } }, - { "mat4", TYPE_MAT4, { TYPE_FLOAT, TYPE_VOID } }, + { "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 }, //conversion scalars - { "int", TYPE_INT, { TYPE_BOOL, TYPE_VOID } }, - { "int", TYPE_INT, { TYPE_INT, TYPE_VOID } }, - { "int", TYPE_INT, { TYPE_UINT, TYPE_VOID } }, - { "int", TYPE_INT, { TYPE_FLOAT, TYPE_VOID } }, + { "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 }, - { "float", TYPE_FLOAT, { TYPE_BOOL, TYPE_VOID } }, - { "float", TYPE_FLOAT, { TYPE_INT, TYPE_VOID } }, - { "float", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID } }, - { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, + { "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 }, - { "uint", TYPE_UINT, { TYPE_BOOL, TYPE_VOID } }, - { "uint", TYPE_UINT, { TYPE_INT, TYPE_VOID } }, - { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID } }, - { "uint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID } }, + { "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 }, - { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID } }, - { "bool", TYPE_BOOL, { TYPE_INT, TYPE_VOID } }, - { "bool", TYPE_BOOL, { TYPE_UINT, TYPE_VOID } }, - { "bool", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID } }, + { "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 }, //conversion vectors - { "ivec2", TYPE_IVEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID } }, - - { "vec2", TYPE_VEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - - { "uvec2", TYPE_UVEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID } }, - - { "bvec2", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID } }, - - { "ivec3", TYPE_IVEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID } }, - - { "vec3", TYPE_VEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - - { "uvec3", TYPE_UVEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID } }, - - { "bvec3", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID } }, - - { "ivec4", TYPE_IVEC4, { TYPE_BVEC4, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_UVEC4, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "vec4", TYPE_VEC4, { TYPE_BVEC4, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "uvec4", TYPE_UVEC4, { TYPE_BVEC4, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_IVEC4, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC4, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "bvec4", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_IVEC4, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_UVEC4, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID } }, + { "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 }, //conversion between matrixes - { "mat2", TYPE_MAT2, { TYPE_MAT3, TYPE_VOID } }, - { "mat2", TYPE_MAT2, { TYPE_MAT4, TYPE_VOID } }, - { "mat3", TYPE_MAT3, { TYPE_MAT2, TYPE_VOID } }, - { "mat3", TYPE_MAT3, { TYPE_MAT4, TYPE_VOID } }, - { "mat4", TYPE_MAT4, { TYPE_MAT2, TYPE_VOID } }, - { "mat4", TYPE_MAT4, { TYPE_MAT3, TYPE_VOID } }, + { "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 }, //builtins - trigonometry - { "radians", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "radians", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "radians", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "radians", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "degrees", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "degrees", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "degrees", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "degrees", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "sin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "sin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "sin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "sin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "cos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "cos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "cos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "cos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "tan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "tan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "tan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "tan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "asin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "asin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "asin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "asin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "acos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "acos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "acos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "acos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "sinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "sinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "sinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "sinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "cosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "cosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "cosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "cosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "tanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "tanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "tanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "tanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "asinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "asinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "asinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "asinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "acosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "acosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "acosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "acosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "atanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "atanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "atanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "atanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, + { "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 }, //builtins - exponential - { "pow", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "pow", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "pow", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "pow", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "exp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "exp", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "exp", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "exp", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "log", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "log", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "log", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "log", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "exp2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "exp2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "exp2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "exp2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "log2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "log2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "log2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "log2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "sqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "sqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "sqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "sqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "inversesqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "inversesqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "inversesqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "inversesqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, + { "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 }, //builtins - common - { "abs", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "abs", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "abs", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "abs", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "abs", TYPE_INT, { TYPE_INT, TYPE_VOID } }, - { "abs", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "abs", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "abs", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID } }, - - { "sign", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "sign", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "sign", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "sign", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "sign", TYPE_INT, { TYPE_INT, TYPE_VOID } }, - { "sign", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "sign", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "sign", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID } }, - - { "floor", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "floor", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "floor", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "floor", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "trunc", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "trunc", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "trunc", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "trunc", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "round", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "round", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "round", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "round", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "roundEven", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "roundEven", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "roundEven", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "roundEven", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "ceil", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "ceil", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "ceil", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "ceil", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "fract", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "fract", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "fract", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "fract", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "mod", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "modf", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "modf", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "modf", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "modf", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "min", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "min", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID } }, - - { "min", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID } }, - { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID } }, - { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID } }, - - { "max", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "max", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID } }, - - { "max", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID } }, - { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID } }, - { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID } }, - - { "clamp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - - { "clamp", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_INT, TYPE_VOID } }, - - { "clamp", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - - { "mix", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_BVEC2, TYPE_VOID } }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_BVEC3, TYPE_VOID } }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_BVEC4, TYPE_VOID } }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "step", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "step", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "step", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "step", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "step", TYPE_VEC2, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID } }, - { "step", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID } }, - { "step", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC4, TYPE_VOID } }, - { "smoothstep", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "smoothstep", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "smoothstep", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "smoothstep", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "smoothstep", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID } }, - { "smoothstep", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC3, TYPE_VOID } }, - { "smoothstep", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC4, TYPE_VOID } }, - - { "isnan", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID } }, - { "isnan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID } }, - { "isnan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID } }, - { "isnan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "isinf", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID } }, - { "isinf", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID } }, - { "isinf", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID } }, - { "isinf", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "floatBitsToInt", TYPE_INT, { TYPE_FLOAT, TYPE_VOID } }, - { "floatBitsToInt", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID } }, - { "floatBitsToInt", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID } }, - { "floatBitsToInt", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "floatBitsToUint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID } }, - { "floatBitsToUint", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID } }, - { "floatBitsToUint", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID } }, - { "floatBitsToUint", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "intBitsToFloat", TYPE_FLOAT, { TYPE_INT, TYPE_VOID } }, - { "intBitsToFloat", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "intBitsToFloat", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "intBitsToFloat", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID } }, - - { "uintBitsToFloat", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID } }, - { "uintBitsToFloat", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "uintBitsToFloat", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "uintBitsToFloat", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID } }, + { "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 }, //builtins - geometric - { "length", TYPE_FLOAT, { TYPE_VEC2, TYPE_VOID } }, - { "length", TYPE_FLOAT, { TYPE_VEC3, TYPE_VOID } }, - { "length", TYPE_FLOAT, { TYPE_VEC4, TYPE_VOID } }, - { "distance", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "distance", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "distance", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "dot", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "dot", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "dot", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "cross", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "normalize", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "normalize", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "normalize", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "reflect", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "refract", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "faceforward", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "faceforward", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "faceforward", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "matrixCompMult", TYPE_MAT2, { TYPE_MAT2, TYPE_MAT2, TYPE_VOID } }, - { "matrixCompMult", TYPE_MAT3, { TYPE_MAT3, TYPE_MAT3, TYPE_VOID } }, - { "matrixCompMult", TYPE_MAT4, { TYPE_MAT4, TYPE_MAT4, TYPE_VOID } }, - - { "outerProduct", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "outerProduct", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "outerProduct", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "transpose", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID } }, - { "transpose", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID } }, - { "transpose", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID } }, - - { "determinant", TYPE_FLOAT, { TYPE_MAT2, TYPE_VOID } }, - { "determinant", TYPE_FLOAT, { TYPE_MAT3, TYPE_VOID } }, - { "determinant", TYPE_FLOAT, { TYPE_MAT4, TYPE_VOID } }, - - { "inverse", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID } }, - { "inverse", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID } }, - { "inverse", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID } }, - - { "lessThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "lessThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "lessThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "lessThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "lessThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "lessThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "lessThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "lessThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "lessThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "greaterThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "greaterThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "greaterThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "equal", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "equal", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "equal", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "equal", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "equal", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "equal", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "equal", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "equal", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "equal", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "equal", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID } }, - { "equal", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID } }, - { "equal", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID } }, - - { "notEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "notEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "notEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "notEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "notEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "notEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, + { "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 }, - { "notEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "notEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "notEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, + { "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_BVEC2, TYPE_BVEC2, TYPE_VOID } }, - { "notEqual", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID } }, - { "notEqual", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID } }, + { "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 }, - { "any", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID } }, - { "any", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID } }, - { "any", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID } }, + { "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 }, - { "all", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID } }, - { "all", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID } }, - { "all", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID } }, + { "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 }, - { "not", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "not", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "not", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID } }, + { "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 }, //builtins - texture - { "textureSize", TYPE_IVEC2, { TYPE_SAMPLER2D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC2, { TYPE_ISAMPLER2D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC2, { TYPE_USAMPLER2D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER2DARRAY, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER2DARRAY, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER2DARRAY, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER3D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER3D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER3D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC2, { TYPE_SAMPLERCUBE, TYPE_INT, TYPE_VOID } }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VOID } }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VOID } }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VOID } }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_VOID } }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_VOID } }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_VOID } }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - - { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, + { "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 }, - { "dFdx", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "dFdx", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "dFdx", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "dFdx", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, + { "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 }, + + //sub-functions - { "dFdy", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "dFdy", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "dFdy", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "dFdy", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "fwidth", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "fwidth", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "fwidth", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "fwidth", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, + //array + { "length", TYPE_INT, { TYPE_VOID }, TAG_ARRAY }, - { NULL, TYPE_VOID, { TYPE_VOID } } + { NULL, TYPE_VOID, { TYPE_VOID }, TAG_GLOBAL } }; @@ -2076,6 +2103,11 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p while (builtin_func_defs[idx].name) { + if (completion_class != builtin_func_defs[idx].tag) { + idx++; + continue; + } + if (name == builtin_func_defs[idx].name) { failed_builtin = true; @@ -2707,7 +2739,7 @@ bool ShaderLanguage::_validate_assign(Node *p_node, const Map<StringName, BuiltI return false; } - if (shader->constants.has(var->name)) { + if (shader->constants.has(var->name) || var->is_const) { if (r_message) *r_message = RTR("Constants cannot be modified."); return false; @@ -2716,6 +2748,17 @@ bool ShaderLanguage::_validate_assign(Node *p_node, const Map<StringName, BuiltI if (!(p_builtin_types.has(var->name) && p_builtin_types[var->name].constant)) { return true; } + } else if (p_node->type == Node::TYPE_ARRAY) { + + ArrayNode *arr = static_cast<ArrayNode *>(p_node); + + if (arr->is_const) { + if (r_message) + *r_message = RTR("Constants cannot be modified."); + return false; + } + + return true; } if (r_message) @@ -2726,6 +2769,7 @@ bool ShaderLanguage::_validate_assign(Node *p_node, const Map<StringName, BuiltI ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types) { Vector<Expression> expression; + //Vector<TokenType> operators; while (true) { @@ -2834,7 +2878,6 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons _set_error("No matching constructor found for: '" + String(funcname->name) + "'"); return NULL; } - //validate_Function_call() expr = _reduce_expression(p_block, func); @@ -2890,6 +2933,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons _set_error("No matching function found for: '" + String(funcname->name) + "'"); return NULL; } + completion_class = TAG_GLOBAL; // reset sub-class expr = func; @@ -2900,8 +2944,10 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons DataType data_type; IdentifierType ident_type; + bool is_const = false; + int array_size = 0; - if (!_find_identifier(p_block, p_builtin_types, identifier, &data_type, &ident_type)) { + if (!_find_identifier(p_block, p_builtin_types, identifier, &data_type, &ident_type, &is_const, &array_size)) { _set_error("Unknown identifier in expression: " + String(identifier)); return NULL; } @@ -2911,10 +2957,70 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons return NULL; } - VariableNode *varname = alloc_node<VariableNode>(); - varname->name = identifier; - varname->datatype_cache = data_type; - expr = varname; + Node *index_expression = NULL; + Node *call_expression = NULL; + + if (array_size > 0) { + tk = _get_token(); + + if (tk.type != TK_BRACKET_OPEN && tk.type != TK_PERIOD) { + _set_error("Expected '[' or '.'"); + return NULL; + } + + if (tk.type == TK_PERIOD) { + completion_class = TAG_ARRAY; + call_expression = _parse_and_reduce_expression(p_block, p_builtin_types); + if (!call_expression) + return NULL; + data_type = call_expression->get_datatype(); + } else { // indexing + + index_expression = _parse_and_reduce_expression(p_block, p_builtin_types); + if (!index_expression) + return NULL; + + if (index_expression->get_datatype() != TYPE_INT && index_expression->get_datatype() != TYPE_UINT) { + _set_error("Only integer expressions are allowed for indexing"); + return NULL; + } + + if (index_expression->type == Node::TYPE_CONSTANT) { + ConstantNode *cnode = (ConstantNode *)index_expression; + if (cnode) { + if (!cnode->values.empty()) { + int value = cnode->values[0].sint; + if (value < 0 || value >= array_size) { + _set_error(vformat("Index [%s] out of range [%s..%s]", value, 0, array_size - 1)); + return NULL; + } + } + } + } + + tk = _get_token(); + if (tk.type != TK_BRACKET_CLOSE) { + _set_error("Expected ']'"); + return NULL; + } + } + + ArrayNode *arrname = alloc_node<ArrayNode>(); + arrname->name = identifier; + arrname->datatype_cache = data_type; + arrname->index_expression = index_expression; + arrname->call_expression = call_expression; + arrname->is_const = is_const; + expr = arrname; + + } else { + + VariableNode *varname = alloc_node<VariableNode>(); + varname->name = identifier; + varname->datatype_cache = data_type; + varname->is_const = is_const; + expr = varname; + } } } else if (tk.type == TK_OP_ADD) { @@ -2965,12 +3071,11 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons _set_error("Expected identifier as member"); return NULL; } - DataType dt = expr->get_datatype(); String ident = identifier; bool ok = true; - DataType member_type; + DataType member_type = TYPE_VOID; switch (dt) { case TYPE_BVEC2: case TYPE_IVEC2: @@ -3681,7 +3786,15 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui return OK; - } else if (is_token_precision(tk.type) || is_token_nonvoid_datatype(tk.type)) { + } else if (tk.type == TK_CONST || is_token_precision(tk.type) || is_token_nonvoid_datatype(tk.type)) { + + bool is_const = false; + + if (tk.type == TK_CONST) { + is_const = true; + tk = _get_token(); + } + DataPrecision precision = PRECISION_DEFAULT; if (is_token_precision(tk.type)) { precision = get_token_precision(tk.type); @@ -3701,11 +3814,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui tk = _get_token(); - VariableDeclarationNode *vardecl = alloc_node<VariableDeclarationNode>(); - vardecl->datatype = type; - vardecl->precision = precision; - - p_block->statements.push_back(vardecl); + Node *vardecl = NULL; while (true) { @@ -3724,15 +3833,213 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui var.type = type; var.precision = precision; var.line = tk_line; + var.array_size = 0; + var.is_const = is_const; + + tk = _get_token(); - VariableDeclarationNode::Declaration decl; + if (tk.type == TK_BRACKET_OPEN) { + bool unknown_size = false; - decl.name = name; - decl.initializer = NULL; + ArrayDeclarationNode *node = alloc_node<ArrayDeclarationNode>(); + node->datatype = type; + node->precision = precision; + node->is_const = is_const; + vardecl = (Node *)node; - tk = _get_token(); + ArrayDeclarationNode::Declaration decl; + decl.name = name; + decl.size = 0U; + + tk = _get_token(); + + if (tk.type == TK_BRACKET_CLOSE) { + unknown_size = true; + } else { + + if (tk.type != TK_INT_CONSTANT || ((int)tk.constant) <= 0) { + _set_error("Expected integer constant > 0 or ']'"); + return ERR_PARSE_ERROR; + } + + decl.size = ((uint32_t)tk.constant); + tk = _get_token(); + + if (tk.type != TK_BRACKET_CLOSE) { + _set_error("Expected ']'"); + return ERR_PARSE_ERROR; + } + var.array_size = decl.size; + } + + bool full_def = false; + + tk = _get_token(); + if (tk.type == TK_OP_ASSIGN) { + tk = _get_token(); + + if (tk.type != TK_CURLY_BRACKET_OPEN) { + + if (unknown_size) { + _set_error("Expected '{'"); + return ERR_PARSE_ERROR; + } + + full_def = true; + + DataPrecision precision2 = PRECISION_DEFAULT; + if (is_token_precision(tk.type)) { + precision2 = get_token_precision(tk.type); + tk = _get_token(); + if (!is_token_nonvoid_datatype(tk.type)) { + _set_error("Expected datatype after precision"); + return ERR_PARSE_ERROR; + } + } + if (!is_token_variable_datatype(tk.type)) { + _set_error("Invalid data type for array"); + return ERR_PARSE_ERROR; + } + DataType type2 = get_token_datatype(tk.type); + + int array_size2 = 0; + + tk = _get_token(); + if (tk.type == TK_BRACKET_OPEN) { + Node *n = _parse_and_reduce_expression(p_block, p_builtin_types); + if (!n || n->type != Node::TYPE_CONSTANT || n->get_datatype() != TYPE_INT) { + _set_error("Expected single integer constant > 0"); + return ERR_PARSE_ERROR; + } + + ConstantNode *cnode = (ConstantNode *)n; + if (cnode->values.size() == 1) { + array_size2 = cnode->values[0].sint; + if (array_size2 <= 0) { + _set_error("Expected single integer constant > 0"); + return ERR_PARSE_ERROR; + } + } else { + _set_error("Expected single integer constant > 0"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + if (tk.type != TK_BRACKET_CLOSE) { + _set_error("Expected ']"); + return ERR_PARSE_ERROR; + } else { + tk = _get_token(); + } + } else { + _set_error("Expected '["); + return ERR_PARSE_ERROR; + } + + if (precision != precision2 || type != type2 || var.array_size != array_size2) { + String error_str = "Cannot convert from '"; + if (precision2 != PRECISION_DEFAULT) { + error_str += get_precision_name(precision2); + error_str += " "; + } + error_str += get_datatype_name(type2); + error_str += "["; + error_str += itos(array_size2); + error_str += "]'"; + error_str += " to '"; + if (precision != PRECISION_DEFAULT) { + error_str += get_precision_name(precision); + error_str += " "; + } + error_str += get_datatype_name(type); + error_str += "["; + error_str += itos(var.array_size); + error_str += "]'"; + _set_error(error_str); + return ERR_PARSE_ERROR; + } + } + + bool curly = tk.type == TK_CURLY_BRACKET_OPEN; + + if (unknown_size) { + if (!curly) { + _set_error("Expected '{'"); + return ERR_PARSE_ERROR; + } + } else { + if (full_def) { + if (curly) { + _set_error("Expected '('"); + return ERR_PARSE_ERROR; + } + } + } + + if (tk.type == TK_PARENTHESIS_OPEN || curly) { // initialization + while (true) { + + Node *n = _parse_and_reduce_expression(p_block, p_builtin_types); + if (!n) { + return ERR_PARSE_ERROR; + } + + if (var.type != n->get_datatype()) { + _set_error("Invalid assignment of '" + get_datatype_name(n->get_datatype()) + "' to '" + get_datatype_name(var.type) + "'"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + if (tk.type == TK_COMMA) { + decl.initializer.push_back(n); + continue; + } else if (!curly && tk.type == TK_PARENTHESIS_CLOSE) { + decl.initializer.push_back(n); + break; + } else if (curly && tk.type == TK_CURLY_BRACKET_CLOSE) { + decl.initializer.push_back(n); + break; + } else { + if (curly) + _set_error("Expected '}' or ','"); + else + _set_error("Expected ')' or ','"); + return ERR_PARSE_ERROR; + } + } + if (unknown_size) { + decl.size = decl.initializer.size(); + var.array_size = decl.initializer.size(); + } else if (decl.initializer.size() != var.array_size) { + _set_error("Array size mismatch"); + return ERR_PARSE_ERROR; + } + tk = _get_token(); + } + } else { + if (unknown_size) { + _set_error("Expected array initialization"); + return ERR_PARSE_ERROR; + } + if (is_const) { + _set_error("Expected initialization of constant"); + return ERR_PARSE_ERROR; + } + } + + node->declarations.push_back(decl); + } else if (tk.type == TK_OP_ASSIGN) { + + VariableDeclarationNode *node = alloc_node<VariableDeclarationNode>(); + node->datatype = type; + node->precision = precision; + node->is_const = is_const; + vardecl = (Node *)node; + + VariableDeclarationNode::Declaration decl; + decl.name = name; + decl.initializer = NULL; - if (tk.type == TK_OP_ASSIGN) { //variable created with assignment! must parse an expression Node *n = _parse_and_reduce_expression(p_block, p_builtin_types); if (!n) @@ -3745,11 +4052,27 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui return ERR_PARSE_ERROR; } tk = _get_token(); + node->declarations.push_back(decl); + } else { + if (is_const) { + _set_error("Expected initialization of constant"); + return ERR_PARSE_ERROR; + } + + VariableDeclarationNode *node = alloc_node<VariableDeclarationNode>(); + node->datatype = type; + node->precision = precision; + vardecl = (Node *)node; + + VariableDeclarationNode::Declaration decl; + decl.name = name; + decl.initializer = NULL; + node->declarations.push_back(decl); } - p_block->variables[name] = var; + p_block->statements.push_back(vardecl); - vardecl->declarations.push_back(decl); + p_block->variables[name] = var; if (tk.type == TK_COMMA) { tk = _get_token(); @@ -3809,16 +4132,40 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui } else { _set_tkpos(pos); //rollback } - } else if (tk.type == TK_CF_WHILE) { - //if () {} + } else if (tk.type == TK_CF_DO || tk.type == TK_CF_WHILE) { + // do {} while() + // while() {} + bool is_do = tk.type == TK_CF_DO; + + BlockNode *do_block = NULL; + if (is_do) { + + do_block = alloc_node<BlockNode>(); + do_block->parent_block = p_block; + + Error err = _parse_block(do_block, p_builtin_types, true, true, true); + if (err) + return err; + + tk = _get_token(); + if (tk.type != TK_CF_WHILE) { + _set_error("Expected while after do"); + return ERR_PARSE_ERROR; + } + } tk = _get_token(); + if (tk.type != TK_PARENTHESIS_OPEN) { _set_error("Expected '(' after while"); return ERR_PARSE_ERROR; } ControlFlowNode *cf = alloc_node<ControlFlowNode>(); - cf->flow_op = FLOW_OP_WHILE; + if (is_do) { + cf->flow_op = FLOW_OP_DO; + } else { + cf->flow_op = FLOW_OP_WHILE; + } Node *n = _parse_and_reduce_expression(p_block, p_builtin_types); if (!n) return ERR_PARSE_ERROR; @@ -3828,18 +4175,30 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui _set_error("Expected ')' after expression"); return ERR_PARSE_ERROR; } + if (!is_do) { + BlockNode *block = alloc_node<BlockNode>(); + block->parent_block = p_block; + cf->expressions.push_back(n); + cf->blocks.push_back(block); + p_block->statements.push_back(cf); - BlockNode *block = alloc_node<BlockNode>(); - block->parent_block = p_block; - cf->expressions.push_back(n); - cf->blocks.push_back(block); - p_block->statements.push_back(cf); + Error err = _parse_block(block, p_builtin_types, true, true, true); + if (err) + return err; + } else { - Error err = _parse_block(block, p_builtin_types, true, true, true); - if (err) - return err; + cf->expressions.push_back(n); + cf->blocks.push_back(do_block); + p_block->statements.push_back(cf); + + tk = _get_token(); + if (tk.type != TK_SEMICOLON) { + _set_error("Expected ';'"); + return ERR_PARSE_ERROR; + } + } } else if (tk.type == TK_CF_FOR) { - //if () {} + // for() {} tk = _get_token(); if (tk.type != TK_PARENTHESIS_OPEN) { _set_error("Expected '(' after for"); @@ -4365,6 +4724,14 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct type = get_token_datatype(tk.type); + TkPos prev_pos = _get_tkpos(); + tk = _get_token(); + if (tk.type == TK_BRACKET_OPEN) { + _set_error("Cannot use arrays as return types"); + return ERR_PARSE_ERROR; + } + _set_tkpos(prev_pos); + _get_completable_identifier(NULL, COMPLETION_MAIN_FUNCTION, name); if (name == StringName()) { @@ -4518,6 +4885,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct tk = _get_token(); + if (tk.type == TK_BRACKET_OPEN) { + _set_error("Arrays as parameters are not implemented yet"); + return ERR_PARSE_ERROR; + } if (tk.type != TK_IDENTIFIER) { _set_error("Expected identifier for argument name"); return ERR_PARSE_ERROR; @@ -4538,6 +4909,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct func_node->arguments.push_back(arg); tk = _get_token(); + if (tk.type == TK_BRACKET_OPEN) { + _set_error("Arrays as parameters are not implemented yet"); + return ERR_PARSE_ERROR; + } if (tk.type == TK_COMMA) { tk = _get_token(); @@ -4724,60 +5099,71 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct StringName skip_function; BlockNode *block = completion_block; - while (block) { - - if (comp_ident) { - for (const Map<StringName, BlockNode::Variable>::Element *E = block->variables.front(); E; E = E->next()) { + if (completion_class == TAG_GLOBAL) { + while (block) { + if (comp_ident) { + for (const Map<StringName, BlockNode::Variable>::Element *E = block->variables.front(); E; E = E->next()) { - if (E->get().line < completion_line) { - matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE); + if (E->get().line < completion_line) { + matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE); + } } } - } - if (block->parent_function) { - if (comp_ident) { - for (int i = 0; i < block->parent_function->arguments.size(); i++) { - matches.insert(block->parent_function->arguments[i].name, ScriptCodeCompletionOption::KIND_FUNCTION); + if (block->parent_function) { + if (comp_ident) { + for (int i = 0; i < block->parent_function->arguments.size(); i++) { + matches.insert(block->parent_function->arguments[i].name, ScriptCodeCompletionOption::KIND_FUNCTION); + } } + skip_function = block->parent_function->name; } - skip_function = block->parent_function->name; + block = block->parent_block; } - block = block->parent_block; - } - if (comp_ident && skip_function != StringName() && p_functions.has(skip_function)) { + if (comp_ident && skip_function != StringName() && p_functions.has(skip_function)) { - for (Map<StringName, BuiltInInfo>::Element *E = p_functions[skip_function].built_ins.front(); E; E = E->next()) { - ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_MEMBER; - if (E->get().constant) { - kind = ScriptCodeCompletionOption::KIND_CONSTANT; + for (Map<StringName, BuiltInInfo>::Element *E = p_functions[skip_function].built_ins.front(); E; E = E->next()) { + ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_MEMBER; + if (E->get().constant) { + kind = ScriptCodeCompletionOption::KIND_CONSTANT; + } + matches.insert(E->key(), kind); } - matches.insert(E->key(), kind); } - } - if (comp_ident) { - for (const Map<StringName, ShaderNode::Varying>::Element *E = shader->varyings.front(); E; E = E->next()) { - matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE); + if (comp_ident) { + for (const Map<StringName, ShaderNode::Varying>::Element *E = shader->varyings.front(); E; E = E->next()) { + matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE); + } + for (const Map<StringName, ShaderNode::Uniform>::Element *E = shader->uniforms.front(); E; E = E->next()) { + matches.insert(E->key(), ScriptCodeCompletionOption::KIND_MEMBER); + } } - for (const Map<StringName, ShaderNode::Uniform>::Element *E = shader->uniforms.front(); E; E = E->next()) { - matches.insert(E->key(), ScriptCodeCompletionOption::KIND_MEMBER); + + for (int i = 0; i < shader->functions.size(); i++) { + if (!shader->functions[i].callable || shader->functions[i].name == skip_function) + continue; + matches.insert(String(shader->functions[i].name), ScriptCodeCompletionOption::KIND_FUNCTION); } - } - for (int i = 0; i < shader->functions.size(); i++) { - if (!shader->functions[i].callable || shader->functions[i].name == skip_function) - continue; - matches.insert(String(shader->functions[i].name), ScriptCodeCompletionOption::KIND_FUNCTION); - } + int idx = 0; - int idx = 0; + while (builtin_func_defs[idx].name) { - while (builtin_func_defs[idx].name) { + matches.insert(String(builtin_func_defs[idx].name), ScriptCodeCompletionOption::KIND_FUNCTION); + idx++; + } - matches.insert(String(builtin_func_defs[idx].name), ScriptCodeCompletionOption::KIND_FUNCTION); - idx++; + } else { // sub-class + int idx = 0; + + while (builtin_func_defs[idx].name) { + if (builtin_func_defs[idx].tag == completion_class) { + matches.insert(String(builtin_func_defs[idx].name), ScriptCodeCompletionOption::KIND_FUNCTION); + } + idx++; + } } for (Map<String, ScriptCodeCompletionOption::Kind>::Element *E = matches.front(); E; E = E->next()) { @@ -4789,7 +5175,6 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct } return OK; - } break; case COMPLETION_CALL_ARGUMENTS: { @@ -4842,6 +5227,11 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct if (completion_function == builtin_func_defs[idx].name) { + if (builtin_func_defs[idx].tag != completion_class) { + idx++; + continue; + } + if (calltip.length()) calltip += "\n"; @@ -4953,6 +5343,7 @@ ShaderLanguage::ShaderNode *ShaderLanguage::get_shader() { ShaderLanguage::ShaderLanguage() { nodes = NULL; + completion_class = TAG_GLOBAL; } ShaderLanguage::~ShaderLanguage() { diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h index 65bf78bddd..36c691c3ae 100644 --- a/servers/visual/shader_language.h +++ b/servers/visual/shader_language.h @@ -288,7 +288,9 @@ public: TYPE_CONSTANT, TYPE_OPERATOR, TYPE_CONTROL_FLOW, - TYPE_MEMBER + TYPE_MEMBER, + TYPE_ARRAY, + TYPE_ARRAY_DECLARATION, }; Type type; @@ -328,15 +330,18 @@ public: DataType datatype_cache; StringName name; virtual DataType get_datatype() const { return datatype_cache; } + bool is_const; VariableNode() : Node(TYPE_VARIABLE), - datatype_cache(TYPE_VOID) {} + datatype_cache(TYPE_VOID), + is_const(false) {} }; struct VariableDeclarationNode : public Node { DataPrecision precision; DataType datatype; + bool is_const; struct Declaration { StringName name; @@ -349,7 +354,46 @@ public: VariableDeclarationNode() : Node(TYPE_VARIABLE_DECLARATION), precision(PRECISION_DEFAULT), - datatype(TYPE_VOID) {} + datatype(TYPE_VOID), + is_const(false) {} + }; + + struct ArrayNode : public Node { + DataType datatype_cache; + StringName name; + Node *index_expression; + Node *call_expression; + bool is_const; + + virtual DataType get_datatype() const { return datatype_cache; } + + ArrayNode() : + Node(TYPE_ARRAY), + datatype_cache(TYPE_VOID), + index_expression(NULL), + call_expression(NULL), + is_const(false) {} + }; + + struct ArrayDeclarationNode : public Node { + DataPrecision precision; + DataType datatype; + bool is_const; + + struct Declaration { + StringName name; + uint32_t size; + Vector<Node *> initializer; + }; + + Vector<Declaration> declarations; + virtual DataType get_datatype() const { return datatype; } + + ArrayDeclarationNode() : + Node(TYPE_ARRAY_DECLARATION), + precision(PRECISION_DEFAULT), + datatype(TYPE_VOID), + is_const(false) {} }; struct ConstantNode : public Node { @@ -380,6 +424,8 @@ public: DataType type; DataPrecision precision; int line; //for completion + int array_size; + bool is_const; }; Map<StringName, Variable> variables; @@ -552,6 +598,7 @@ public: static DataInterpolation get_token_interpolation(TokenType p_type); static bool is_token_precision(TokenType p_type); static DataPrecision get_token_precision(TokenType p_type); + static String get_precision_name(DataPrecision p_type); static String get_datatype_name(DataType p_type); static bool is_token_nonvoid_datatype(TokenType p_type); static bool is_token_operator(TokenType p_type); @@ -645,16 +692,22 @@ private: IDENTIFIER_CONSTANT, }; - bool _find_identifier(const BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, const StringName &p_identifier, DataType *r_data_type = NULL, IdentifierType *r_type = NULL); + bool _find_identifier(const BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, const StringName &p_identifier, DataType *r_data_type = NULL, IdentifierType *r_type = NULL, bool *r_is_const = NULL, int *r_array_size = NULL); bool _is_operator_assign(Operator p_op) const; bool _validate_assign(Node *p_node, const Map<StringName, BuiltInInfo> &p_builtin_types, String *r_message = NULL); bool _validate_operator(OperatorNode *p_op, DataType *r_ret_type = NULL); + enum SubClassTag { + TAG_GLOBAL, + TAG_ARRAY + }; + struct BuiltinFuncDef { enum { MAX_ARGS = 5 }; const char *name; DataType rettype; const DataType args[MAX_ARGS]; + SubClassTag tag; }; struct BuiltinFuncOutArgs { //arguments used as out in built in functions @@ -666,6 +719,7 @@ private: int completion_line; BlockNode *completion_block; DataType completion_base; + SubClassTag completion_class; StringName completion_function; int completion_argument; diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index fc75fda583..f5a1276c27 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -386,8 +386,7 @@ void VisualServerCanvas::canvas_item_set_parent(RID p_item, RID p_parent) { } else { - ERR_EXPLAIN("Invalid parent"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid parent."); } } @@ -754,12 +753,7 @@ void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2 ERR_FAIL_COND(uv_size != 0 && (uv_size != pointcount)); #endif Vector<int> indices = Geometry::triangulate_polygon(p_points); - - if (indices.empty()) { - - ERR_EXPLAIN("Bad Polygon!"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(indices.empty(), "Invalid polygon data, triangulation failed."); Item::CommandPolygon *polygon = memnew(Item::CommandPolygon); ERR_FAIL_COND(!polygon); diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index f37d651dee..dcfbd28dd6 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -38,9 +38,6 @@ #include "visual_server_globals.h" #include "visual_server_scene.h" #include "visual_server_viewport.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class VisualServerRaster : public VisualServer { diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index f8ed035766..0863d5c2e3 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -63,7 +63,10 @@ static Transform2D _canvas_get_transform(VisualServerViewport::Viewport *p_viewp } void VisualServerViewport::_draw_3d(Viewport *p_viewport, ARVRInterface::Eyes p_eye) { - Ref<ARVRInterface> arvr_interface = ARVRServer::get_singleton()->get_primary_interface(); + Ref<ARVRInterface> arvr_interface; + if (ARVRServer::get_singleton() != NULL) { + arvr_interface = ARVRServer::get_singleton()->get_primary_interface(); + } if (p_viewport->use_arvr && arvr_interface.is_valid()) { VSG::scene->render_camera(arvr_interface, p_eye, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas); @@ -82,6 +85,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E if (!p_viewport->hide_canvas && !p_viewport->disable_environment && VSG::scene->scenario_owner.owns(p_viewport->scenario)) { VisualServerScene::Scenario *scenario = VSG::scene->scenario_owner.get(p_viewport->scenario); + ERR_FAIL_COND(!scenario); if (VSG::scene_render->is_environment(scenario->environment)) { scenario_draw_canvas_bg = VSG::scene_render->environment_get_background(scenario->environment) == VS::ENV_BG_CANVAS; @@ -260,11 +264,16 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E } void VisualServerViewport::draw_viewports() { + // get our arvr interface in case we need it - Ref<ARVRInterface> arvr_interface = ARVRServer::get_singleton()->get_primary_interface(); + Ref<ARVRInterface> arvr_interface; - // process all our active interfaces - ARVRServer::get_singleton()->_process(); + if (ARVRServer::get_singleton() != NULL) { + arvr_interface = ARVRServer::get_singleton()->get_primary_interface(); + + // process all our active interfaces + ARVRServer::get_singleton()->_process(); + } if (Engine::get_singleton()->is_editor_hint()) { clear_color = GLOBAL_GET("rendering/environment/default_clear_color"); diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 24e50eb99e..41993d7c88 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -35,9 +35,6 @@ #include "core/os/thread.h" #include "servers/visual_server.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class VisualServerWrapMT : public VisualServer { // the real visual server diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index c6468694fd..13fcda2402 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -1118,7 +1118,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim } offsets[i] = elem_size; continue; - } break; + } default: { ERR_FAIL(); } @@ -1145,11 +1145,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim Vector<AABB> bone_aabb; Error err = _surface_set_data(p_arrays, format, offsets, total_elem_size, vertex_array, array_len, index_array, index_array_len, aabb, bone_aabb); - - if (err) { - ERR_EXPLAIN("Invalid array format for surface"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(err, "Invalid array format for surface."); Vector<PoolVector<uint8_t> > blend_shape_data; @@ -1162,10 +1158,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim AABB laabb; Error err2 = _surface_set_data(p_blend_shapes[i], format & ~ARRAY_FORMAT_INDEX, offsets, total_elem_size, vertex_array_shape, array_len, noindex, 0, laabb, bone_aabb); aabb.merge_with(laabb); - if (err2 != OK) { - ERR_EXPLAIN("Invalid blend shape array format for surface"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(err2 != OK, "Invalid blend shape array format for surface."); blend_shape_data.push_back(vertex_array_shape); } @@ -1286,7 +1279,7 @@ Array VisualServer::_get_array_from_surface(uint32_t p_format, PoolVector<uint8_ } offsets[i] = elem_size; continue; - } break; + } default: { ERR_FAIL_V(Array()); } diff --git a/servers/visual_server.h b/servers/visual_server.h index a84d395e3f..1b0164e5ca 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -39,9 +39,6 @@ #include "core/rid.h" #include "core/variant.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ class VisualServer : public Object { GDCLASS(VisualServer, Object); diff --git a/thirdparty/README.md b/thirdparty/README.md index cb29eadeca..99f917dbc1 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -4,7 +4,7 @@ ## assimp - Upstream: http://github.com/assimp/assimp -- Version: git (d3d98a7ec0c8d38e1952b46dfe53f7e9233dc92d) +- Version: git (1d565b0aab5a2ee00462f18c5b8a81f6a5454a48) - License: BSD-3-Clause @@ -200,6 +200,7 @@ Important: Some files have Godot-made changes. They are marked with `// -- GODOT start --` and `// -- GODOT end --` comments. + ## libtheora - Upstream: https://www.theora.org @@ -262,18 +263,6 @@ changes to ensure they build for Javascript/HTML5. Those changes are marked with `// -- GODOT --` comments. -## wslay - -- Upstream: https://github.com/tatsuhiro-t/wslay -- Version: 1.1.0 -- License: MIT - -File extracted from upstream release tarball: - -- All `*.c` and `*.h` in `lib/` and `lib/includes/` -- `wslay.h` has a small Godot addition to fix MSVC build. - See `thirdparty/wslay/msvcfix.diff` - ## mbedtls - Upstream: https://tls.mbed.org/ @@ -508,10 +497,23 @@ They can be reapplied using the patches included in the `vhacd` folder. +## wslay + +- Upstream: https://github.com/tatsuhiro-t/wslay +- Version: 1.1.0 +- License: MIT + +File extracted from upstream release tarball: + +- All `*.c` and `*.h` in `lib/` and `lib/includes/` +- `wslay.h` has a small Godot addition to fix MSVC build. + See `thirdparty/wslay/msvcfix.diff` + + ## xatlas - Upstream: https://github.com/jpcy/xatlas -- Version: git (b7d7bb, 2019) +- Version: git (f65a664, 2019) - License: MIT Files extracted from upstream source: @@ -536,7 +538,7 @@ Files extracted from upstream source: ## zstd - Upstream: https://github.com/facebook/zstd -- Version: 1.4.0 +- Version: 1.4.1 - License: BSD-3-Clause Files extracted from upstream source: diff --git a/thirdparty/assimp/assimp/config.h b/thirdparty/assimp/assimp/config.h index 8b0634d28b..382a698268 100644 --- a/thirdparty/assimp/assimp/config.h +++ b/thirdparty/assimp/assimp/config.h @@ -647,6 +647,21 @@ enum aiComponent { "AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING" // --------------------------------------------------------------------------- +/** @brief Set wether the FBX importer shall not remove empty bones. + * + * + * Empty bone are often used to define connections for other models. + */ +#define AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES \ + "AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES" + +// --------------------------------------------------------------------------- +/** @brief Set wether the FBX importer shall convert the unit from cm to m. + */ +#define AI_CONFIG_FBX_CONVERT_TO_M \ + "AI_CONFIG_FBX_CONVERT_TO_M" + +// --------------------------------------------------------------------------- /** @brief Set the vertex animation keyframe to be imported * * ASSIMP does not support vertex keyframes (only bone animation is supported). @@ -978,3 +993,4 @@ enum aiComponent { /* #cmakedefine ASSIMP_DOUBLE_PRECISION 1 */ #endif // !! AI_CONFIG_H_INC + diff --git a/thirdparty/assimp/code/CApi/AssimpCExport.cpp b/thirdparty/assimp/code/CApi/AssimpCExport.cpp new file mode 100644 index 0000000000..7557edcfc6 --- /dev/null +++ b/thirdparty/assimp/code/CApi/AssimpCExport.cpp @@ -0,0 +1,156 @@ +/* +--------------------------------------------------------------------------- +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. +--------------------------------------------------------------------------- +*/ + +/** @file AssimpCExport.cpp +Assimp C export interface. See Exporter.cpp for some notes. +*/ + +#ifndef ASSIMP_BUILD_NO_EXPORT + +#include "CInterfaceIOWrapper.h" +#include <assimp/SceneCombiner.h> +#include "Common/ScenePrivate.h" +#include <assimp/Exporter.hpp> + +using namespace Assimp; + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API size_t aiGetExportFormatCount(void) +{ + return Exporter().GetExportFormatCount(); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API const aiExportFormatDesc* aiGetExportFormatDescription( size_t index) +{ + // Note: this is valid as the index always pertains to a built-in exporter, + // for which the returned structure is guaranteed to be of static storage duration. + Exporter exporter; + const aiExportFormatDesc* orig( exporter.GetExportFormatDescription( index ) ); + if (NULL == orig) { + return NULL; + } + + aiExportFormatDesc *desc = new aiExportFormatDesc; + desc->description = new char[ strlen( orig->description ) + 1 ](); + ::strncpy( (char*) desc->description, orig->description, strlen( orig->description ) ); + desc->fileExtension = new char[ strlen( orig->fileExtension ) + 1 ](); + ::strncpy( ( char* ) desc->fileExtension, orig->fileExtension, strlen( orig->fileExtension ) ); + desc->id = new char[ strlen( orig->id ) + 1 ](); + ::strncpy( ( char* ) desc->id, orig->id, strlen( orig->id ) ); + + return desc; +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiReleaseExportFormatDescription( const aiExportFormatDesc *desc ) { + if (NULL == desc) { + return; + } + + delete [] desc->description; + delete [] desc->fileExtension; + delete [] desc->id; + delete desc; +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiCopyScene(const aiScene* pIn, aiScene** pOut) +{ + if (!pOut || !pIn) { + return; + } + + SceneCombiner::CopyScene(pOut,pIn,true); + ScenePriv(*pOut)->mIsCopy = true; +} + + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiFreeScene(const C_STRUCT aiScene* pIn) +{ + // note: aiReleaseImport() is also able to delete scene copies, but in addition + // it also handles scenes with import metadata. + delete pIn; +} + + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API aiReturn aiExportScene( const aiScene* pScene, const char* pFormatId, const char* pFileName, unsigned int pPreprocessing ) +{ + return ::aiExportSceneEx(pScene,pFormatId,pFileName,NULL,pPreprocessing); +} + + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API aiReturn aiExportSceneEx( const aiScene* pScene, const char* pFormatId, const char* pFileName, aiFileIO* pIO, unsigned int pPreprocessing ) +{ + Exporter exp; + + if (pIO) { + exp.SetIOHandler(new CIOSystemWrapper(pIO)); + } + return exp.Export(pScene,pFormatId,pFileName,pPreprocessing); +} + + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API const C_STRUCT aiExportDataBlob* aiExportSceneToBlob( const aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing ) +{ + Exporter exp; + if (!exp.ExportToBlob(pScene,pFormatId,pPreprocessing)) { + return NULL; + } + const aiExportDataBlob* blob = exp.GetOrphanedBlob(); + ai_assert(blob); + + return blob; +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API C_STRUCT void aiReleaseExportBlob( const aiExportDataBlob* pData ) +{ + delete pData; +} + +#endif // !ASSIMP_BUILD_NO_EXPORT diff --git a/thirdparty/assimp/code/CInterfaceIOWrapper.cpp b/thirdparty/assimp/code/CApi/CInterfaceIOWrapper.cpp index 5a3a49565a..5a3a49565a 100644 --- a/thirdparty/assimp/code/CInterfaceIOWrapper.cpp +++ b/thirdparty/assimp/code/CApi/CInterfaceIOWrapper.cpp diff --git a/thirdparty/assimp/code/CInterfaceIOWrapper.h b/thirdparty/assimp/code/CApi/CInterfaceIOWrapper.h index 2162320302..2162320302 100644 --- a/thirdparty/assimp/code/CInterfaceIOWrapper.h +++ b/thirdparty/assimp/code/CApi/CInterfaceIOWrapper.h diff --git a/thirdparty/assimp/code/Common/Assimp.cpp b/thirdparty/assimp/code/Common/Assimp.cpp new file mode 100644 index 0000000000..178b2c01d0 --- /dev/null +++ b/thirdparty/assimp/code/Common/Assimp.cpp @@ -0,0 +1,695 @@ +/* +--------------------------------------------------------------------------- +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. +--------------------------------------------------------------------------- +*/ +/** @file Assimp.cpp + * @brief Implementation of the Plain-C API + */ + +#include <assimp/cimport.h> +#include <assimp/LogStream.hpp> +#include <assimp/DefaultLogger.hpp> +#include <assimp/Importer.hpp> +#include <assimp/importerdesc.h> +#include <assimp/scene.h> +#include <assimp/GenericProperty.h> +#include <assimp/Exceptional.h> +#include <assimp/BaseImporter.h> + +#include "CApi/CInterfaceIOWrapper.h" +#include "Importer.h" +#include "ScenePrivate.h" + +#include <list> + +// ------------------------------------------------------------------------------------------------ +#ifndef ASSIMP_BUILD_SINGLETHREADED +# include <thread> +# include <mutex> +#endif +// ------------------------------------------------------------------------------------------------ +using namespace Assimp; + +namespace Assimp { + // underlying structure for aiPropertyStore + typedef BatchLoader::PropertyMap PropertyMap; + + /** Stores the LogStream objects for all active C log streams */ + struct mpred { + bool operator () (const aiLogStream& s0, const aiLogStream& s1) const { + return s0.callback<s1.callback&&s0.user<s1.user; + } + }; + typedef std::map<aiLogStream, Assimp::LogStream*, mpred> LogStreamMap; + + /** Stores the LogStream objects allocated by #aiGetPredefinedLogStream */ + typedef std::list<Assimp::LogStream*> PredefLogStreamMap; + + /** Local storage of all active log streams */ + static LogStreamMap gActiveLogStreams; + + /** Local storage of LogStreams allocated by #aiGetPredefinedLogStream */ + static PredefLogStreamMap gPredefinedStreams; + + /** Error message of the last failed import process */ + static std::string gLastErrorString; + + /** Verbose logging active or not? */ + static aiBool gVerboseLogging = false; + + /** will return all registered importers. */ + void GetImporterInstanceList(std::vector< BaseImporter* >& out); + + /** will delete all registered importers. */ + void DeleteImporterInstanceList(std::vector< BaseImporter* >& out); +} // namespace assimp + + +#ifndef ASSIMP_BUILD_SINGLETHREADED +/** Global mutex to manage the access to the log-stream map */ +static std::mutex gLogStreamMutex; +#endif + +// ------------------------------------------------------------------------------------------------ +// Custom LogStream implementation for the C-API +class LogToCallbackRedirector : public LogStream { +public: + explicit LogToCallbackRedirector(const aiLogStream& s) + : stream (s) { + ai_assert(NULL != s.callback); + } + + ~LogToCallbackRedirector() { +#ifndef ASSIMP_BUILD_SINGLETHREADED + std::lock_guard<std::mutex> lock(gLogStreamMutex); +#endif + // (HACK) Check whether the 'stream.user' pointer points to a + // custom LogStream allocated by #aiGetPredefinedLogStream. + // In this case, we need to delete it, too. Of course, this + // might cause strange problems, but the chance is quite low. + + PredefLogStreamMap::iterator it = std::find(gPredefinedStreams.begin(), + gPredefinedStreams.end(), (Assimp::LogStream*)stream.user); + + if (it != gPredefinedStreams.end()) { + delete *it; + gPredefinedStreams.erase(it); + } + } + + /** @copydoc LogStream::write */ + void write(const char* message) { + stream.callback(message,stream.user); + } + +private: + aiLogStream stream; +}; + +// ------------------------------------------------------------------------------------------------ +void ReportSceneNotFoundError() { + ASSIMP_LOG_ERROR("Unable to find the Assimp::Importer for this aiScene. " + "The C-API does not accept scenes produced by the C++ API and vice versa"); + + ai_assert(false); +} + +// ------------------------------------------------------------------------------------------------ +// Reads the given file and returns its content. +const aiScene* aiImportFile( const char* pFile, unsigned int pFlags) { + return aiImportFileEx(pFile,pFlags,NULL); +} + +// ------------------------------------------------------------------------------------------------ +const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags, aiFileIO* pFS) { + return aiImportFileExWithProperties(pFile, pFlags, pFS, NULL); +} + +// ------------------------------------------------------------------------------------------------ +const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFlags, + aiFileIO* pFS, const aiPropertyStore* props) { + ai_assert(NULL != pFile); + + const aiScene* scene = NULL; + ASSIMP_BEGIN_EXCEPTION_REGION(); + + // create an Importer for this file + Assimp::Importer* imp = new Assimp::Importer(); + + // copy properties + if(props) { + const PropertyMap* pp = reinterpret_cast<const PropertyMap*>(props); + ImporterPimpl* pimpl = imp->Pimpl(); + pimpl->mIntProperties = pp->ints; + pimpl->mFloatProperties = pp->floats; + pimpl->mStringProperties = pp->strings; + pimpl->mMatrixProperties = pp->matrices; + } + // setup a custom IO system if necessary + if (pFS) { + imp->SetIOHandler( new CIOSystemWrapper (pFS) ); + } + + // and have it read the file + scene = imp->ReadFile( pFile, pFlags); + + // if succeeded, store the importer in the scene and keep it alive + if( scene) { + ScenePrivateData* priv = const_cast<ScenePrivateData*>( ScenePriv(scene) ); + priv->mOrigImporter = imp; + } else { + // if failed, extract error code and destroy the import + gLastErrorString = imp->GetErrorString(); + delete imp; + } + + // return imported data. If the import failed the pointer is NULL anyways + ASSIMP_END_EXCEPTION_REGION(const aiScene*); + + return scene; +} + +// ------------------------------------------------------------------------------------------------ +const aiScene* aiImportFileFromMemory( + const char* pBuffer, + unsigned int pLength, + unsigned int pFlags, + const char* pHint) +{ + return aiImportFileFromMemoryWithProperties(pBuffer, pLength, pFlags, pHint, NULL); +} + +// ------------------------------------------------------------------------------------------------ +const aiScene* aiImportFileFromMemoryWithProperties( + const char* pBuffer, + unsigned int pLength, + unsigned int pFlags, + const char* pHint, + const aiPropertyStore* props) +{ + ai_assert( NULL != pBuffer ); + ai_assert( 0 != pLength ); + + const aiScene* scene = NULL; + ASSIMP_BEGIN_EXCEPTION_REGION(); + + // create an Importer for this file + Assimp::Importer* imp = new Assimp::Importer(); + + // copy properties + if(props) { + const PropertyMap* pp = reinterpret_cast<const PropertyMap*>(props); + ImporterPimpl* pimpl = imp->Pimpl(); + pimpl->mIntProperties = pp->ints; + pimpl->mFloatProperties = pp->floats; + pimpl->mStringProperties = pp->strings; + pimpl->mMatrixProperties = pp->matrices; + } + + // and have it read the file from the memory buffer + scene = imp->ReadFileFromMemory( pBuffer, pLength, pFlags,pHint); + + // if succeeded, store the importer in the scene and keep it alive + if( scene) { + ScenePrivateData* priv = const_cast<ScenePrivateData*>( ScenePriv(scene) ); + priv->mOrigImporter = imp; + } + else { + // if failed, extract error code and destroy the import + gLastErrorString = imp->GetErrorString(); + delete imp; + } + // return imported data. If the import failed the pointer is NULL anyways + ASSIMP_END_EXCEPTION_REGION(const aiScene*); + return scene; +} + +// ------------------------------------------------------------------------------------------------ +// Releases all resources associated with the given import process. +void aiReleaseImport( const aiScene* pScene) +{ + if (!pScene) { + return; + } + + ASSIMP_BEGIN_EXCEPTION_REGION(); + + // find the importer associated with this data + const ScenePrivateData* priv = ScenePriv(pScene); + if( !priv || !priv->mOrigImporter) { + delete pScene; + } + else { + // deleting the Importer also deletes the scene + // Note: the reason that this is not written as 'delete priv->mOrigImporter' + // is a suspected bug in gcc 4.4+ (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339) + Importer* importer = priv->mOrigImporter; + delete importer; + } + + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API const aiScene* aiApplyPostProcessing(const aiScene* pScene, + unsigned int pFlags) +{ + const aiScene* sc = NULL; + + + ASSIMP_BEGIN_EXCEPTION_REGION(); + + // find the importer associated with this data + const ScenePrivateData* priv = ScenePriv(pScene); + if( !priv || !priv->mOrigImporter) { + ReportSceneNotFoundError(); + return NULL; + } + + sc = priv->mOrigImporter->ApplyPostProcessing(pFlags); + + if (!sc) { + aiReleaseImport(pScene); + return NULL; + } + + ASSIMP_END_EXCEPTION_REGION(const aiScene*); + return sc; +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API const aiScene *aiApplyCustomizedPostProcessing( const aiScene *scene, + BaseProcess* process, + bool requestValidation ) { + const aiScene* sc( NULL ); + + ASSIMP_BEGIN_EXCEPTION_REGION(); + + // find the importer associated with this data + const ScenePrivateData* priv = ScenePriv( scene ); + if ( NULL == priv || NULL == priv->mOrigImporter ) { + ReportSceneNotFoundError(); + return NULL; + } + + sc = priv->mOrigImporter->ApplyCustomizedPostProcessing( process, requestValidation ); + + if ( !sc ) { + aiReleaseImport( scene ); + return NULL; + } + + ASSIMP_END_EXCEPTION_REGION( const aiScene* ); + + return sc; +} + +// ------------------------------------------------------------------------------------------------ +void CallbackToLogRedirector (const char* msg, char* dt) +{ + ai_assert( NULL != msg ); + ai_assert( NULL != dt ); + LogStream* s = (LogStream*)dt; + + s->write(msg); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API aiLogStream aiGetPredefinedLogStream(aiDefaultLogStream pStream,const char* file) +{ + aiLogStream sout; + + ASSIMP_BEGIN_EXCEPTION_REGION(); + LogStream* stream = LogStream::createDefaultStream(pStream,file); + if (!stream) { + sout.callback = NULL; + sout.user = NULL; + } + else { + sout.callback = &CallbackToLogRedirector; + sout.user = (char*)stream; + } + gPredefinedStreams.push_back(stream); + ASSIMP_END_EXCEPTION_REGION(aiLogStream); + return sout; +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiAttachLogStream( const aiLogStream* stream ) +{ + ASSIMP_BEGIN_EXCEPTION_REGION(); + +#ifndef ASSIMP_BUILD_SINGLETHREADED + std::lock_guard<std::mutex> lock(gLogStreamMutex); +#endif + + LogStream* lg = new LogToCallbackRedirector(*stream); + gActiveLogStreams[*stream] = lg; + + if (DefaultLogger::isNullLogger()) { + DefaultLogger::create(NULL,(gVerboseLogging == AI_TRUE ? Logger::VERBOSE : Logger::NORMAL)); + } + DefaultLogger::get()->attachStream(lg); + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API aiReturn aiDetachLogStream( const aiLogStream* stream) +{ + ASSIMP_BEGIN_EXCEPTION_REGION(); + +#ifndef ASSIMP_BUILD_SINGLETHREADED + std::lock_guard<std::mutex> lock(gLogStreamMutex); +#endif + // find the log-stream associated with this data + LogStreamMap::iterator it = gActiveLogStreams.find( *stream); + // it should be there... else the user is playing fools with us + if( it == gActiveLogStreams.end()) { + return AI_FAILURE; + } + DefaultLogger::get()->detatchStream( it->second ); + delete it->second; + + gActiveLogStreams.erase( it); + + if (gActiveLogStreams.empty()) { + DefaultLogger::kill(); + } + ASSIMP_END_EXCEPTION_REGION(aiReturn); + return AI_SUCCESS; +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiDetachAllLogStreams(void) +{ + ASSIMP_BEGIN_EXCEPTION_REGION(); +#ifndef ASSIMP_BUILD_SINGLETHREADED + std::lock_guard<std::mutex> lock(gLogStreamMutex); +#endif + Logger *logger( DefaultLogger::get() ); + if ( NULL == logger ) { + return; + } + + for (LogStreamMap::iterator it = gActiveLogStreams.begin(); it != gActiveLogStreams.end(); ++it) { + logger->detatchStream( it->second ); + delete it->second; + } + gActiveLogStreams.clear(); + DefaultLogger::kill(); + + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiEnableVerboseLogging(aiBool d) +{ + if (!DefaultLogger::isNullLogger()) { + DefaultLogger::get()->setLogSeverity((d == AI_TRUE ? Logger::VERBOSE : Logger::NORMAL)); + } + gVerboseLogging = d; +} + +// ------------------------------------------------------------------------------------------------ +// Returns the error text of the last failed import process. +const char* aiGetErrorString() +{ + return gLastErrorString.c_str(); +} + +// ----------------------------------------------------------------------------------------------- +// Return the description of a importer given its index +const aiImporterDesc* aiGetImportFormatDescription( size_t pIndex) +{ + return Importer().GetImporterInfo(pIndex); +} + +// ----------------------------------------------------------------------------------------------- +// Return the number of importers +size_t aiGetImportFormatCount(void) +{ + return Importer().GetImporterCount(); +} + +// ------------------------------------------------------------------------------------------------ +// Returns the error text of the last failed import process. +aiBool aiIsExtensionSupported(const char* szExtension) +{ + ai_assert(NULL != szExtension); + aiBool candoit=AI_FALSE; + ASSIMP_BEGIN_EXCEPTION_REGION(); + + // FIXME: no need to create a temporary Importer instance just for that .. + Assimp::Importer tmp; + candoit = tmp.IsExtensionSupported(std::string(szExtension)) ? AI_TRUE : AI_FALSE; + + ASSIMP_END_EXCEPTION_REGION(aiBool); + return candoit; +} + +// ------------------------------------------------------------------------------------------------ +// Get a list of all file extensions supported by ASSIMP +void aiGetExtensionList(aiString* szOut) +{ + ai_assert(NULL != szOut); + ASSIMP_BEGIN_EXCEPTION_REGION(); + + // FIXME: no need to create a temporary Importer instance just for that .. + Assimp::Importer tmp; + tmp.GetExtensionList(*szOut); + + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +// Get the memory requirements for a particular import. +void aiGetMemoryRequirements(const C_STRUCT aiScene* pIn, + C_STRUCT aiMemoryInfo* in) +{ + ASSIMP_BEGIN_EXCEPTION_REGION(); + + // find the importer associated with this data + const ScenePrivateData* priv = ScenePriv(pIn); + if( !priv || !priv->mOrigImporter) { + ReportSceneNotFoundError(); + return; + } + + return priv->mOrigImporter->GetMemoryRequirements(*in); + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API aiPropertyStore* aiCreatePropertyStore(void) +{ + return reinterpret_cast<aiPropertyStore*>( new PropertyMap() ); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiReleasePropertyStore(aiPropertyStore* p) +{ + delete reinterpret_cast<PropertyMap*>(p); +} + +// ------------------------------------------------------------------------------------------------ +// Importer::SetPropertyInteger +ASSIMP_API void aiSetImportPropertyInteger(aiPropertyStore* p, const char* szName, int value) +{ + ASSIMP_BEGIN_EXCEPTION_REGION(); + PropertyMap* pp = reinterpret_cast<PropertyMap*>(p); + SetGenericProperty<int>(pp->ints,szName,value); + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +// Importer::SetPropertyFloat +ASSIMP_API void aiSetImportPropertyFloat(aiPropertyStore* p, const char* szName, ai_real value) +{ + ASSIMP_BEGIN_EXCEPTION_REGION(); + PropertyMap* pp = reinterpret_cast<PropertyMap*>(p); + SetGenericProperty<ai_real>(pp->floats,szName,value); + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +// Importer::SetPropertyString +ASSIMP_API void aiSetImportPropertyString(aiPropertyStore* p, const char* szName, + const C_STRUCT aiString* st) +{ + if (!st) { + return; + } + ASSIMP_BEGIN_EXCEPTION_REGION(); + PropertyMap* pp = reinterpret_cast<PropertyMap*>(p); + SetGenericProperty<std::string>(pp->strings,szName,std::string(st->C_Str())); + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +// Importer::SetPropertyMatrix +ASSIMP_API void aiSetImportPropertyMatrix(aiPropertyStore* p, const char* szName, + const C_STRUCT aiMatrix4x4* mat) +{ + if (!mat) { + return; + } + ASSIMP_BEGIN_EXCEPTION_REGION(); + PropertyMap* pp = reinterpret_cast<PropertyMap*>(p); + SetGenericProperty<aiMatrix4x4>(pp->matrices,szName,*mat); + ASSIMP_END_EXCEPTION_REGION(void); +} + +// ------------------------------------------------------------------------------------------------ +// Rotation matrix to quaternion +ASSIMP_API void aiCreateQuaternionFromMatrix(aiQuaternion* quat,const aiMatrix3x3* mat) +{ + ai_assert( NULL != quat ); + ai_assert( NULL != mat ); + *quat = aiQuaternion(*mat); +} + +// ------------------------------------------------------------------------------------------------ +// Matrix decomposition +ASSIMP_API void aiDecomposeMatrix(const aiMatrix4x4* mat,aiVector3D* scaling, + aiQuaternion* rotation, + aiVector3D* position) +{ + ai_assert( NULL != rotation ); + ai_assert( NULL != position ); + ai_assert( NULL != scaling ); + ai_assert( NULL != mat ); + mat->Decompose(*scaling,*rotation,*position); +} + +// ------------------------------------------------------------------------------------------------ +// Matrix transpose +ASSIMP_API void aiTransposeMatrix3(aiMatrix3x3* mat) +{ + ai_assert(NULL != mat); + mat->Transpose(); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiTransposeMatrix4(aiMatrix4x4* mat) +{ + ai_assert(NULL != mat); + mat->Transpose(); +} + +// ------------------------------------------------------------------------------------------------ +// Vector transformation +ASSIMP_API void aiTransformVecByMatrix3(aiVector3D* vec, + const aiMatrix3x3* mat) +{ + ai_assert( NULL != mat ); + ai_assert( NULL != vec); + *vec *= (*mat); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiTransformVecByMatrix4(aiVector3D* vec, + const aiMatrix4x4* mat) +{ + ai_assert( NULL != mat ); + ai_assert( NULL != vec ); + + *vec *= (*mat); +} + +// ------------------------------------------------------------------------------------------------ +// Matrix multiplication +ASSIMP_API void aiMultiplyMatrix4( + aiMatrix4x4* dst, + const aiMatrix4x4* src) +{ + ai_assert( NULL != dst ); + ai_assert( NULL != src ); + *dst = (*dst) * (*src); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiMultiplyMatrix3( + aiMatrix3x3* dst, + const aiMatrix3x3* src) +{ + ai_assert( NULL != dst ); + ai_assert( NULL != src ); + *dst = (*dst) * (*src); +} + +// ------------------------------------------------------------------------------------------------ +// Matrix identity +ASSIMP_API void aiIdentityMatrix3( + aiMatrix3x3* mat) +{ + ai_assert(NULL != mat); + *mat = aiMatrix3x3(); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API void aiIdentityMatrix4( + aiMatrix4x4* mat) +{ + ai_assert(NULL != mat); + *mat = aiMatrix4x4(); +} + +// ------------------------------------------------------------------------------------------------ +ASSIMP_API C_STRUCT const aiImporterDesc* aiGetImporterDesc( const char *extension ) { + if( NULL == extension ) { + return NULL; + } + const aiImporterDesc *desc( NULL ); + std::vector< BaseImporter* > out; + GetImporterInstanceList( out ); + for( size_t i = 0; i < out.size(); ++i ) { + if( 0 == strncmp( out[ i ]->GetInfo()->mFileExtensions, extension, strlen( extension ) ) ) { + desc = out[ i ]->GetInfo(); + break; + } + } + + DeleteImporterInstanceList(out); + + return desc; +} + +// ------------------------------------------------------------------------------------------------ diff --git a/thirdparty/assimp/code/BaseImporter.cpp b/thirdparty/assimp/code/Common/BaseImporter.cpp index 4803c6d6f2..0a5694aa0e 100644 --- a/thirdparty/assimp/code/BaseImporter.cpp +++ b/thirdparty/assimp/code/Common/BaseImporter.cpp @@ -320,7 +320,11 @@ std::string BaseImporter::GetExtension( const std::string& file ) { return false; } -#include "../contrib/utf8cpp/source/utf8.h" +#ifdef ASSIMP_USE_HUNTER +# include <utf8/utf8.h> +#else +# include "../contrib/utf8cpp/source/utf8.h" +#endif // ------------------------------------------------------------------------------------------------ // Convert to UTF8 data diff --git a/thirdparty/assimp/code/BaseProcess.cpp b/thirdparty/assimp/code/Common/BaseProcess.cpp index 18872c3693..e247be418d 100644 --- a/thirdparty/assimp/code/BaseProcess.cpp +++ b/thirdparty/assimp/code/Common/BaseProcess.cpp @@ -89,7 +89,7 @@ void BaseProcess::ExecuteOnScene( Importer* pImp) // and kill the partially imported data delete pImp->Pimpl()->mScene; - pImp->Pimpl()->mScene = NULL; + pImp->Pimpl()->mScene = nullptr; } } diff --git a/thirdparty/assimp/code/BaseProcess.h b/thirdparty/assimp/code/Common/BaseProcess.h index 4d5c7a76be..4d5c7a76be 100644 --- a/thirdparty/assimp/code/BaseProcess.h +++ b/thirdparty/assimp/code/Common/BaseProcess.h diff --git a/thirdparty/assimp/code/Bitmap.cpp b/thirdparty/assimp/code/Common/Bitmap.cpp index b22b71ea9e..b22b71ea9e 100644 --- a/thirdparty/assimp/code/Bitmap.cpp +++ b/thirdparty/assimp/code/Common/Bitmap.cpp diff --git a/thirdparty/assimp/code/CreateAnimMesh.cpp b/thirdparty/assimp/code/Common/CreateAnimMesh.cpp index 1a052849bb..98b60e5319 100644 --- a/thirdparty/assimp/code/CreateAnimMesh.cpp +++ b/thirdparty/assimp/code/Common/CreateAnimMesh.cpp @@ -47,10 +47,6 @@ namespace Assimp { aiAnimMesh *aiCreateAnimMesh(const aiMesh *mesh) { aiAnimMesh *animesh = new aiAnimMesh; - animesh->mVertices = NULL; - animesh->mNormals = NULL; - animesh->mTangents = NULL; - animesh->mBitangents = NULL; animesh->mNumVertices = mesh->mNumVertices; if (mesh->mVertices) { animesh->mVertices = new aiVector3D[animesh->mNumVertices]; diff --git a/thirdparty/assimp/code/DefaultIOStream.cpp b/thirdparty/assimp/code/Common/DefaultIOStream.cpp index 1c100b6189..1c100b6189 100644 --- a/thirdparty/assimp/code/DefaultIOStream.cpp +++ b/thirdparty/assimp/code/Common/DefaultIOStream.cpp diff --git a/thirdparty/assimp/code/DefaultIOSystem.cpp b/thirdparty/assimp/code/Common/DefaultIOSystem.cpp index d40b67de32..d40b67de32 100644 --- a/thirdparty/assimp/code/DefaultIOSystem.cpp +++ b/thirdparty/assimp/code/Common/DefaultIOSystem.cpp diff --git a/thirdparty/assimp/code/DefaultLogger.cpp b/thirdparty/assimp/code/Common/DefaultLogger.cpp index de3528d2b4..de3528d2b4 100644 --- a/thirdparty/assimp/code/DefaultLogger.cpp +++ b/thirdparty/assimp/code/Common/DefaultLogger.cpp diff --git a/thirdparty/assimp/code/DefaultProgressHandler.h b/thirdparty/assimp/code/Common/DefaultProgressHandler.h index bd2cce00be..bd2cce00be 100644 --- a/thirdparty/assimp/code/DefaultProgressHandler.h +++ b/thirdparty/assimp/code/Common/DefaultProgressHandler.h diff --git a/thirdparty/assimp/code/Exporter.cpp b/thirdparty/assimp/code/Common/Exporter.cpp index 8848e87f5b..090b561ae0 100644 --- a/thirdparty/assimp/code/Exporter.cpp +++ b/thirdparty/assimp/code/Common/Exporter.cpp @@ -61,15 +61,16 @@ Here we implement only the C++ interface (Assimp::Exporter). #include <assimp/mesh.h> #include <assimp/postprocess.h> #include <assimp/scene.h> - -#include "DefaultProgressHandler.h" -#include "BaseProcess.h" -#include "JoinVerticesProcess.h" -#include "MakeVerboseFormat.h" -#include "ConvertToLHProcess.h" -#include "PretransformVertices.h" #include <assimp/Exceptional.h> -#include "ScenePrivate.h" + +#include "Common/DefaultProgressHandler.h" +#include "Common/BaseProcess.h" +#include "Common/ScenePrivate.h" +#include "PostProcessing/CalcTangentsProcess.h" +#include "PostProcessing/MakeVerboseFormat.h" +#include "PostProcessing/JoinVerticesProcess.h" +#include "PostProcessing/ConvertToLHProcess.h" +#include "PostProcessing/PretransformVertices.h" #include <memory> @@ -101,6 +102,7 @@ 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 ExportAssimp2Json(const char* , IOSystem*, const aiScene* , const Assimp::ExportProperties*); // ------------------------------------------------------------------------------------------------ // global array of all export formats which Assimp supports in its current build @@ -161,11 +163,11 @@ Exporter::ExportFormatEntry gExporters[] = #endif #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER - Exporter::ExportFormatEntry( "assbin", "Assimp Binary", "assbin" , &ExportSceneAssbin, 0 ), + Exporter::ExportFormatEntry( "assbin", "Assimp Binary File", "assbin" , &ExportSceneAssbin, 0 ), #endif #ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER - Exporter::ExportFormatEntry( "assxml", "Assxml Document", "assxml" , &ExportSceneAssxml, 0 ), + Exporter::ExportFormatEntry( "assxml", "Assimp XML Document", "assxml" , &ExportSceneAssxml, 0 ), #endif #ifndef ASSIMP_BUILD_NO_X3D_EXPORTER @@ -178,7 +180,11 @@ Exporter::ExportFormatEntry gExporters[] = #endif #ifndef ASSIMP_BUILD_NO_3MF_EXPORTER - Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 ) + Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 ), +#endif + +#ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER + Exporter::ExportFormatEntry( "assjson", "Assimp JSON Document", "json", &ExportAssimp2Json, 0) #endif }; @@ -288,7 +294,7 @@ void Exporter::SetProgressHandler(ProgressHandler* pHandler) { // ------------------------------------------------------------------------------------------------ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId, - unsigned int, const ExportProperties* /*pProperties*/ ) { + unsigned int pPreprocessing, const ExportProperties* pProperties) { if (pimpl->blob) { delete pimpl->blob; pimpl->blob = nullptr; @@ -298,7 +304,7 @@ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const cha BlobIOSystem* blobio = new BlobIOSystem(); pimpl->mIOSystem = std::shared_ptr<IOSystem>( blobio ); - if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName())) { + if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName(), pPreprocessing, pProperties)) { pimpl->mIOSystem = old; return nullptr; } diff --git a/thirdparty/assimp/code/FileLogStream.h b/thirdparty/assimp/code/Common/FileLogStream.h index 740c503192..740c503192 100644 --- a/thirdparty/assimp/code/FileLogStream.h +++ b/thirdparty/assimp/code/Common/FileLogStream.h diff --git a/thirdparty/assimp/code/FileSystemFilter.h b/thirdparty/assimp/code/Common/FileSystemFilter.h index 9923cdbdd3..9923cdbdd3 100644 --- a/thirdparty/assimp/code/FileSystemFilter.h +++ b/thirdparty/assimp/code/Common/FileSystemFilter.h diff --git a/thirdparty/assimp/code/Common/IFF.h b/thirdparty/assimp/code/Common/IFF.h new file mode 100644 index 0000000000..91d7d48289 --- /dev/null +++ b/thirdparty/assimp/code/Common/IFF.h @@ -0,0 +1,102 @@ +// Definitions for the Interchange File Format (IFF) +// Alexander Gessler, 2006 +// Adapted to Assimp August 2008 + +#ifndef AI_IFF_H_INCLUDED +#define AI_IFF_H_INCLUDED + +#include <assimp/ByteSwapper.h> + +namespace Assimp { +namespace IFF { + +///////////////////////////////////////////////////////////////////////////////// +//! Describes an IFF chunk header +///////////////////////////////////////////////////////////////////////////////// +struct ChunkHeader +{ + //! Type of the chunk header - FourCC + uint32_t type; + + //! Length of the chunk data, in bytes + uint32_t length; +}; + + +///////////////////////////////////////////////////////////////////////////////// +//! Describes an IFF sub chunk header +///////////////////////////////////////////////////////////////////////////////// +struct SubChunkHeader +{ + //! Type of the chunk header - FourCC + uint32_t type; + + //! Length of the chunk data, in bytes + uint16_t length; +}; + + +#define AI_IFF_FOURCC(a,b,c,d) ((uint32_t) (((uint8_t)a << 24u) | \ + ((uint8_t)b << 16u) | ((uint8_t)c << 8u) | ((uint8_t)d))) + + +#define AI_IFF_FOURCC_FORM AI_IFF_FOURCC('F','O','R','M') + + +///////////////////////////////////////////////////////////////////////////////// +//! Load a chunk header +//! @param outFile Pointer to the file data - points to the chunk data afterwards +//! @return Copy of the chunk header +///////////////////////////////////////////////////////////////////////////////// +inline ChunkHeader LoadChunk(uint8_t*& outFile) +{ + ChunkHeader head; + ::memcpy(&head.type, outFile, 4); + outFile += 4; + ::memcpy(&head.length, outFile, 4); + outFile += 4; + AI_LSWAP4(head.length); + AI_LSWAP4(head.type); + return head; +} + +///////////////////////////////////////////////////////////////////////////////// +//! Load a sub chunk header +//! @param outFile Pointer to the file data - points to the chunk data afterwards +//! @return Copy of the sub chunk header +///////////////////////////////////////////////////////////////////////////////// +inline SubChunkHeader LoadSubChunk(uint8_t*& outFile) +{ + SubChunkHeader head; + ::memcpy(&head.type, outFile, 4); + outFile += 4; + ::memcpy(&head.length, outFile, 2); + outFile += 2; + AI_LSWAP2(head.length); + AI_LSWAP4(head.type); + return head; +} + +///////////////////////////////////////////////////////////////////////////////// +//! Read the file header and return the type of the file and its size +//! @param outFile Pointer to the file data. The buffer must at +//! least be 12 bytes large. +//! @param fileType Receives the type of the file +//! @return 0 if everything was OK, otherwise an error message +///////////////////////////////////////////////////////////////////////////////// +inline const char* ReadHeader(uint8_t* outFile, uint32_t& fileType) +{ + ChunkHeader head = LoadChunk(outFile); + if(AI_IFF_FOURCC_FORM != head.type) + { + return "The file is not an IFF file: FORM chunk is missing"; + } + ::memcpy(&fileType, outFile, 4); + AI_LSWAP4(fileType); + return 0; +} + + +}} + +#endif // !! AI_IFF_H_INCLUDED diff --git a/thirdparty/assimp/code/Importer.cpp b/thirdparty/assimp/code/Common/Importer.cpp index 65b16471cc..91b50859a0 100644 --- a/thirdparty/assimp/code/Importer.cpp +++ b/thirdparty/assimp/code/Common/Importer.cpp @@ -64,15 +64,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ------------------------------------------------------------------------------------------------ // Internal headers // ------------------------------------------------------------------------------------------------ -#include "Importer.h" -#include <assimp/BaseImporter.h> -#include "BaseProcess.h" +#include "Common/Importer.h" +#include "Common/BaseProcess.h" +#include "Common/DefaultProgressHandler.h" +#include "PostProcessing/ProcessHelper.h" +#include "Common/ScenePreprocessor.h" +#include "Common/ScenePrivate.h" -#include "DefaultProgressHandler.h" +#include <assimp/BaseImporter.h> #include <assimp/GenericProperty.h> -#include "ProcessHelper.h" -#include "ScenePreprocessor.h" -#include "ScenePrivate.h" #include <assimp/MemoryIOWrapper.h> #include <assimp/Profiler.h> #include <assimp/TinyFormatter.h> @@ -86,7 +86,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assimp/DefaultIOSystem.h> #ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS -# include "ValidateDataStructure.h" +# include "PostProcessing/ValidateDataStructure.h" #endif using namespace Assimp::Profiling; @@ -590,10 +590,12 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) // Find an worker class which can handle the file BaseImporter* imp = NULL; + SetPropertyInteger("importerIndex", -1); for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) { if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, false)) { imp = pimpl->mImporter[a]; + SetPropertyInteger("importerIndex", a); break; } } @@ -606,6 +608,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) { if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, true)) { imp = pimpl->mImporter[a]; + SetPropertyInteger("importerIndex", a); break; } } diff --git a/thirdparty/assimp/code/Importer.h b/thirdparty/assimp/code/Common/Importer.h index a439d99c2f..a439d99c2f 100644 --- a/thirdparty/assimp/code/Importer.h +++ b/thirdparty/assimp/code/Common/Importer.h diff --git a/thirdparty/assimp/code/ImporterRegistry.cpp b/thirdparty/assimp/code/Common/ImporterRegistry.cpp index 747815fa6f..32ac3b4168 100644 --- a/thirdparty/assimp/code/ImporterRegistry.cpp +++ b/thirdparty/assimp/code/Common/ImporterRegistry.cpp @@ -56,146 +56,146 @@ corresponding preprocessor flag to selectively disable formats. // (include_new_importers_here) // ------------------------------------------------------------------------------------------------ #ifndef ASSIMP_BUILD_NO_X_IMPORTER -# include "XFileImporter.h" +# include "X/XFileImporter.h" #endif #ifndef ASSIMP_BUILD_NO_AMF_IMPORTER -# include "AMFImporter.hpp" +# include "AMF/AMFImporter.hpp" #endif #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER -# include "3DSLoader.h" +# include "3DS/3DSLoader.h" #endif #ifndef ASSIMP_BUILD_NO_MD3_IMPORTER -# include "MD3Loader.h" +# include "MD3/MD3Loader.h" #endif #ifndef ASSIMP_BUILD_NO_MDL_IMPORTER -# include "MDLLoader.h" +# include "MDL/MDLLoader.h" #endif #ifndef ASSIMP_BUILD_NO_MD2_IMPORTER -# include "MD2Loader.h" +# include "MD2/MD2Loader.h" #endif #ifndef ASSIMP_BUILD_NO_PLY_IMPORTER -# include "PlyLoader.h" +# include "Ply/PlyLoader.h" #endif #ifndef ASSIMP_BUILD_NO_ASE_IMPORTER -# include "ASELoader.h" +# include "ASE/ASELoader.h" #endif #ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER -# include "ObjFileImporter.h" +# include "Obj/ObjFileImporter.h" #endif #ifndef ASSIMP_BUILD_NO_HMP_IMPORTER -# include "HMPLoader.h" +# include "HMP/HMPLoader.h" #endif #ifndef ASSIMP_BUILD_NO_SMD_IMPORTER -# include "SMDLoader.h" +# include "SMD/SMDLoader.h" #endif #ifndef ASSIMP_BUILD_NO_MDC_IMPORTER -# include "MDCLoader.h" +# include "MDC/MDCLoader.h" #endif #ifndef ASSIMP_BUILD_NO_MD5_IMPORTER -# include "MD5Loader.h" +# include "MD5/MD5Loader.h" #endif #ifndef ASSIMP_BUILD_NO_STL_IMPORTER -# include "STLLoader.h" +# include "STL/STLLoader.h" #endif #ifndef ASSIMP_BUILD_NO_LWO_IMPORTER -# include "LWOLoader.h" +# include "LWO/LWOLoader.h" #endif #ifndef ASSIMP_BUILD_NO_DXF_IMPORTER -# include "DXFLoader.h" +# include "DXF/DXFLoader.h" #endif #ifndef ASSIMP_BUILD_NO_NFF_IMPORTER -# include "NFFLoader.h" +# include "NFF/NFFLoader.h" #endif #ifndef ASSIMP_BUILD_NO_RAW_IMPORTER -# include "RawLoader.h" +# include "Raw/RawLoader.h" #endif #ifndef ASSIMP_BUILD_NO_SIB_IMPORTER -# include "SIBImporter.h" +# include "SIB/SIBImporter.h" #endif #ifndef ASSIMP_BUILD_NO_OFF_IMPORTER -# include "OFFLoader.h" +# include "OFF/OFFLoader.h" #endif #ifndef ASSIMP_BUILD_NO_AC_IMPORTER -# include "ACLoader.h" +# include "AC/ACLoader.h" #endif #ifndef ASSIMP_BUILD_NO_BVH_IMPORTER -# include "BVHLoader.h" +# include "BVH/BVHLoader.h" #endif #ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER -# include "IRRMeshLoader.h" +# include "Irr/IRRMeshLoader.h" #endif #ifndef ASSIMP_BUILD_NO_IRR_IMPORTER -# include "IRRLoader.h" +# include "Irr/IRRLoader.h" #endif #ifndef ASSIMP_BUILD_NO_Q3D_IMPORTER -# include "Q3DLoader.h" +# include "Q3D/Q3DLoader.h" #endif #ifndef ASSIMP_BUILD_NO_B3D_IMPORTER -# include "B3DImporter.h" +# include "B3D/B3DImporter.h" #endif #ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER -# include "ColladaLoader.h" +# include "Collada/ColladaLoader.h" #endif #ifndef ASSIMP_BUILD_NO_TERRAGEN_IMPORTER -# include "TerragenLoader.h" +# include "Terragen/TerragenLoader.h" #endif #ifndef ASSIMP_BUILD_NO_CSM_IMPORTER -# include "CSMLoader.h" +# include "CSM/CSMLoader.h" #endif #ifndef ASSIMP_BUILD_NO_3D_IMPORTER -# include "UnrealLoader.h" +# include "Unreal/UnrealLoader.h" #endif #ifndef ASSIMP_BUILD_NO_LWS_IMPORTER -# include "LWSLoader.h" +# include "LWS/LWSLoader.h" #endif #ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER -# include "OgreImporter.h" +# include "Ogre/OgreImporter.h" #endif #ifndef ASSIMP_BUILD_NO_OPENGEX_IMPORTER -# include "OpenGEXImporter.h" +# include "OpenGEX/OpenGEXImporter.h" #endif #ifndef ASSIMP_BUILD_NO_MS3D_IMPORTER -# include "MS3DLoader.h" +# include "MS3D/MS3DLoader.h" #endif #ifndef ASSIMP_BUILD_NO_COB_IMPORTER -# include "COBLoader.h" +# include "COB/COBLoader.h" #endif #ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER -# include "BlenderLoader.h" +# include "Blender/BlenderLoader.h" #endif #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER -# include "Q3BSPFileImporter.h" +# include "Q3BSP/Q3BSPFileImporter.h" #endif #ifndef ASSIMP_BUILD_NO_NDO_IMPORTER -# include "NDOLoader.h" +# include "NDO/NDOLoader.h" #endif #ifndef ASSIMP_BUILD_NO_IFC_IMPORTER # include "Importer/IFC/IFCLoader.h" #endif #ifndef ASSIMP_BUILD_NO_XGL_IMPORTER -# include "XGLLoader.h" +# include "XGL/XGLLoader.h" #endif #ifndef ASSIMP_BUILD_NO_FBX_IMPORTER -# include "FBXImporter.h" +# include "FBX/FBXImporter.h" #endif #ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER -# include "AssbinLoader.h" +# include "Assbin/AssbinLoader.h" #endif #ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER -# include "glTFImporter.h" -# include "glTF2Importer.h" +# include "glTF/glTFImporter.h" +# include "glTF2/glTF2Importer.h" #endif #ifndef ASSIMP_BUILD_NO_C4D_IMPORTER -# include "C4DImporter.h" +# include "C4D/C4DImporter.h" #endif #ifndef ASSIMP_BUILD_NO_3MF_IMPORTER -# include "D3MFImporter.h" +# include "3MF/D3MFImporter.h" #endif #ifndef ASSIMP_BUILD_NO_X3D_IMPORTER -# include "X3DImporter.hpp" +# include "X3D/X3DImporter.hpp" #endif #ifndef ASSIMP_BUILD_NO_MMD_IMPORTER -# include "MMDImporter.h" +# include "MMD/MMDImporter.h" #endif #ifndef ASSIMP_BUILD_NO_STEP_IMPORTER # include "Importer/StepFile/StepFileImporter.h" @@ -364,7 +364,7 @@ void GetImporterInstanceList(std::vector< BaseImporter* >& out) void DeleteImporterInstanceList(std::vector< BaseImporter* >& deleteList){ for(size_t i= 0; i<deleteList.size();++i){ delete deleteList[i]; - deleteList[i]=NULL; + deleteList[i]=nullptr; }//for } diff --git a/thirdparty/assimp/code/PolyTools.h b/thirdparty/assimp/code/Common/PolyTools.h index fbbda0e7d1..fbbda0e7d1 100644 --- a/thirdparty/assimp/code/PolyTools.h +++ b/thirdparty/assimp/code/Common/PolyTools.h diff --git a/thirdparty/assimp/code/PostStepRegistry.cpp b/thirdparty/assimp/code/Common/PostStepRegistry.cpp index 15b4a28843..ef58f8ddfd 100644 --- a/thirdparty/assimp/code/PostStepRegistry.cpp +++ b/thirdparty/assimp/code/Common/PostStepRegistry.cpp @@ -48,89 +48,93 @@ directly (unless you are adding new steps), instead use the corresponding preprocessor flag to selectively disable steps. */ -#include "ProcessHelper.h" +#include "PostProcessing/ProcessHelper.h" #ifndef ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS -# include "CalcTangentsProcess.h" +# include "PostProcessing/CalcTangentsProcess.h" #endif #ifndef ASSIMP_BUILD_NO_JOINVERTICES_PROCESS -# include "JoinVerticesProcess.h" +# include "PostProcessing/JoinVerticesProcess.h" #endif #if !(defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS && defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS && defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS) -# include "ConvertToLHProcess.h" +# include "PostProcessing/ConvertToLHProcess.h" #endif #ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS -# include "TriangulateProcess.h" +# include "PostProcessing/TriangulateProcess.h" #endif #ifndef ASSIMP_BUILD_NO_DROPFACENORMALS_PROCESS -# include "DropFaceNormalsProcess.h" +# include "PostProcessing/DropFaceNormalsProcess.h" #endif #ifndef ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS -# include "GenFaceNormalsProcess.h" +# include "PostProcessing/GenFaceNormalsProcess.h" #endif #ifndef ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS -# include "GenVertexNormalsProcess.h" +# include "PostProcessing/GenVertexNormalsProcess.h" #endif #ifndef ASSIMP_BUILD_NO_REMOVEVC_PROCESS -# include "RemoveVCProcess.h" +# include "PostProcessing/RemoveVCProcess.h" #endif #ifndef ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS -# include "SplitLargeMeshes.h" +# include "PostProcessing/SplitLargeMeshes.h" #endif #ifndef ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS -# include "PretransformVertices.h" +# include "PostProcessing/PretransformVertices.h" #endif #ifndef ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS -# include "LimitBoneWeightsProcess.h" +# include "PostProcessing/LimitBoneWeightsProcess.h" #endif #ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS -# include "ValidateDataStructure.h" +# include "PostProcessing/ValidateDataStructure.h" #endif #ifndef ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS -# include "ImproveCacheLocality.h" +# include "PostProcessing/ImproveCacheLocality.h" #endif #ifndef ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS -# include "FixNormalsStep.h" +# include "PostProcessing/FixNormalsStep.h" #endif #ifndef ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS -# include "RemoveRedundantMaterials.h" +# include "PostProcessing/RemoveRedundantMaterials.h" #endif #if (!defined ASSIMP_BUILD_NO_EMBEDTEXTURES_PROCESS) -# include "EmbedTexturesProcess.h" +# include "PostProcessing/EmbedTexturesProcess.h" #endif #ifndef ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS -# include "FindInvalidDataProcess.h" +# include "PostProcessing/FindInvalidDataProcess.h" #endif #ifndef ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS -# include "FindDegenerates.h" +# include "PostProcessing/FindDegenerates.h" #endif #ifndef ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS -# include "SortByPTypeProcess.h" +# include "PostProcessing/SortByPTypeProcess.h" #endif #ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS -# include "ComputeUVMappingProcess.h" +# include "PostProcessing/ComputeUVMappingProcess.h" #endif #ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS -# include "TextureTransform.h" +# include "PostProcessing/TextureTransform.h" #endif #ifndef ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS -# include "FindInstancesProcess.h" +# include "PostProcessing/FindInstancesProcess.h" #endif #ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS -# include "OptimizeMeshes.h" +# include "PostProcessing/OptimizeMeshes.h" #endif #ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS -# include "OptimizeGraph.h" +# include "PostProcessing/OptimizeGraph.h" #endif #ifndef ASSIMP_BUILD_NO_SPLITBYBONECOUNT_PROCESS -# include "SplitByBoneCountProcess.h" +# include "Common/SplitByBoneCountProcess.h" #endif #ifndef ASSIMP_BUILD_NO_DEBONE_PROCESS -# include "DeboneProcess.h" +# include "PostProcessing/DeboneProcess.h" #endif #if (!defined ASSIMP_BUILD_NO_GLOBALSCALE_PROCESS) -# include "ScaleProcess.h" +# include "PostProcessing/ScaleProcess.h" #endif +#if (!defined ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS) +# include "PostProcessing/GenBoundingBoxesProcess.h" +#endif + namespace Assimp { @@ -246,6 +250,9 @@ void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out) #if (!defined ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS) out.push_back( new ImproveCacheLocalityProcess()); #endif +#if (!defined ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS) + out.push_back(new GenBoundingBoxesProcess); +#endif } } diff --git a/thirdparty/assimp/code/RemoveComments.cpp b/thirdparty/assimp/code/Common/RemoveComments.cpp index 91700a7699..91700a7699 100644 --- a/thirdparty/assimp/code/RemoveComments.cpp +++ b/thirdparty/assimp/code/Common/RemoveComments.cpp diff --git a/thirdparty/assimp/code/SGSpatialSort.cpp b/thirdparty/assimp/code/Common/SGSpatialSort.cpp index 120070b0aa..120070b0aa 100644 --- a/thirdparty/assimp/code/SGSpatialSort.cpp +++ b/thirdparty/assimp/code/Common/SGSpatialSort.cpp diff --git a/thirdparty/assimp/code/SceneCombiner.cpp b/thirdparty/assimp/code/Common/SceneCombiner.cpp index e445bd7434..e445bd7434 100644 --- a/thirdparty/assimp/code/SceneCombiner.cpp +++ b/thirdparty/assimp/code/Common/SceneCombiner.cpp diff --git a/thirdparty/assimp/code/ScenePreprocessor.cpp b/thirdparty/assimp/code/Common/ScenePreprocessor.cpp index 432a3d7666..432a3d7666 100644 --- a/thirdparty/assimp/code/ScenePreprocessor.cpp +++ b/thirdparty/assimp/code/Common/ScenePreprocessor.cpp diff --git a/thirdparty/assimp/code/ScenePreprocessor.h b/thirdparty/assimp/code/Common/ScenePreprocessor.h index 3f4c8d7c3f..3f4c8d7c3f 100644 --- a/thirdparty/assimp/code/ScenePreprocessor.h +++ b/thirdparty/assimp/code/Common/ScenePreprocessor.h diff --git a/thirdparty/assimp/code/ScenePrivate.h b/thirdparty/assimp/code/Common/ScenePrivate.h index f336aafc9a..f336aafc9a 100644 --- a/thirdparty/assimp/code/ScenePrivate.h +++ b/thirdparty/assimp/code/Common/ScenePrivate.h diff --git a/thirdparty/assimp/code/SkeletonMeshBuilder.cpp b/thirdparty/assimp/code/Common/SkeletonMeshBuilder.cpp index 06cfe034e9..06cfe034e9 100644 --- a/thirdparty/assimp/code/SkeletonMeshBuilder.cpp +++ b/thirdparty/assimp/code/Common/SkeletonMeshBuilder.cpp diff --git a/thirdparty/assimp/code/SpatialSort.cpp b/thirdparty/assimp/code/Common/SpatialSort.cpp index a4f3a4e4b8..a4f3a4e4b8 100644 --- a/thirdparty/assimp/code/SpatialSort.cpp +++ b/thirdparty/assimp/code/Common/SpatialSort.cpp diff --git a/thirdparty/assimp/code/SplitByBoneCountProcess.cpp b/thirdparty/assimp/code/Common/SplitByBoneCountProcess.cpp index 2ef66a9afc..2ef66a9afc 100644 --- a/thirdparty/assimp/code/SplitByBoneCountProcess.cpp +++ b/thirdparty/assimp/code/Common/SplitByBoneCountProcess.cpp diff --git a/thirdparty/assimp/code/SplitByBoneCountProcess.h b/thirdparty/assimp/code/Common/SplitByBoneCountProcess.h index 6c904a9df4..6c904a9df4 100644 --- a/thirdparty/assimp/code/SplitByBoneCountProcess.h +++ b/thirdparty/assimp/code/Common/SplitByBoneCountProcess.h diff --git a/thirdparty/assimp/code/StandardShapes.cpp b/thirdparty/assimp/code/Common/StandardShapes.cpp index 2e5100130f..2e5100130f 100644 --- a/thirdparty/assimp/code/StandardShapes.cpp +++ b/thirdparty/assimp/code/Common/StandardShapes.cpp diff --git a/thirdparty/assimp/code/StdOStreamLogStream.h b/thirdparty/assimp/code/Common/StdOStreamLogStream.h index 893e261a2b..893e261a2b 100644 --- a/thirdparty/assimp/code/StdOStreamLogStream.h +++ b/thirdparty/assimp/code/Common/StdOStreamLogStream.h diff --git a/thirdparty/assimp/code/Subdivision.cpp b/thirdparty/assimp/code/Common/Subdivision.cpp index 19db223a55..60c54939f5 100644 --- a/thirdparty/assimp/code/Subdivision.cpp +++ b/thirdparty/assimp/code/Common/Subdivision.cpp @@ -43,9 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assimp/Subdivision.h> #include <assimp/SceneCombiner.h> #include <assimp/SpatialSort.h> -#include "ProcessHelper.h" #include <assimp/Vertex.h> #include <assimp/ai_assert.h> + +#include "PostProcessing/ProcessHelper.h" + #include <stdio.h> using namespace Assimp; @@ -56,8 +58,7 @@ void mydummy() {} * implementation is basing on recursive refinement. Directly evaluating the result is also * possible and much quicker, but it depends on lengthy matrix lookup tables. */ // ------------------------------------------------------------------------------------------------ -class CatmullClarkSubdivider : public Subdivider -{ +class CatmullClarkSubdivider : public Subdivider { public: void Subdivide (aiMesh* mesh, aiMesh*& out, unsigned int num, bool discard_input); void Subdivide (aiMesh** smesh, size_t nmesh, diff --git a/thirdparty/assimp/code/TargetAnimation.cpp b/thirdparty/assimp/code/Common/TargetAnimation.cpp index b8062499ff..b8062499ff 100644 --- a/thirdparty/assimp/code/TargetAnimation.cpp +++ b/thirdparty/assimp/code/Common/TargetAnimation.cpp diff --git a/thirdparty/assimp/code/TargetAnimation.h b/thirdparty/assimp/code/Common/TargetAnimation.h index 91634ab5aa..91634ab5aa 100644 --- a/thirdparty/assimp/code/TargetAnimation.h +++ b/thirdparty/assimp/code/Common/TargetAnimation.h diff --git a/thirdparty/assimp/code/Version.cpp b/thirdparty/assimp/code/Common/Version.cpp index 0381037ff1..cc94340ac8 100644 --- a/thirdparty/assimp/code/Version.cpp +++ b/thirdparty/assimp/code/Common/Version.cpp @@ -134,7 +134,7 @@ ASSIMP_API aiScene::aiScene() , mCameras(nullptr) , mMetaData(nullptr) , mPrivate(new Assimp::ScenePrivateData()) { - // empty + // empty } // ------------------------------------------------------------------------------------------------ diff --git a/thirdparty/assimp/code/VertexTriangleAdjacency.cpp b/thirdparty/assimp/code/Common/VertexTriangleAdjacency.cpp index 7cfd1a3505..7cfd1a3505 100644 --- a/thirdparty/assimp/code/VertexTriangleAdjacency.cpp +++ b/thirdparty/assimp/code/Common/VertexTriangleAdjacency.cpp diff --git a/thirdparty/assimp/code/VertexTriangleAdjacency.h b/thirdparty/assimp/code/Common/VertexTriangleAdjacency.h index f3be47612d..f3be47612d 100644 --- a/thirdparty/assimp/code/VertexTriangleAdjacency.h +++ b/thirdparty/assimp/code/Common/VertexTriangleAdjacency.h diff --git a/thirdparty/assimp/code/Win32DebugLogStream.h b/thirdparty/assimp/code/Common/Win32DebugLogStream.h index a6063a261e..a6063a261e 100644 --- a/thirdparty/assimp/code/Win32DebugLogStream.h +++ b/thirdparty/assimp/code/Common/Win32DebugLogStream.h diff --git a/thirdparty/assimp/code/Common/assbin_chunks.h b/thirdparty/assimp/code/Common/assbin_chunks.h new file mode 100644 index 0000000000..15e4af5e7d --- /dev/null +++ b/thirdparty/assimp/code/Common/assbin_chunks.h @@ -0,0 +1,196 @@ +#ifndef INCLUDED_ASSBIN_CHUNKS_H +#define INCLUDED_ASSBIN_CHUNKS_H + +#define ASSBIN_VERSION_MAJOR 1 +#define ASSBIN_VERSION_MINOR 0 + +/** +@page assfile .ASS File formats + +@section over Overview +Assimp provides its own interchange format, which is intended to applications which need +to serialize 3D-models and to reload them quickly. Assimp's file formats are designed to +be read by Assimp itself. They encode additional information needed by Assimp to optimize +its postprocessing pipeline. If you once apply specific steps to a scene, then save it +and reread it from an ASS format using the same post processing settings, they won't +be executed again. + +The format comes in two flavours: XML and binary - both of them hold a complete dump of +the 'aiScene' data structure returned by the APIs. The focus for the binary format +(<tt>.assbin</tt>) is fast loading. Optional deflate compression helps reduce file size. The XML +flavour, <tt>.assxml</tt> or simply .xml, is just a plain-to-xml conversion of aiScene. + +ASSBIN is Assimp's binary interchange format. assimp_cmd (<tt><root>/tools/assimp_cmd</tt>) is able to +write it and the core library provides a loader for it. + +@section assxml XML File format + +The format is pretty much self-explanatory due to its similarity to the in-memory aiScene structure. +With few exceptions, C structures are wrapped in XML elements. + +The DTD for ASSXML can be found in <tt><root>/doc/AssXML_Scheme.xml</tt>. Or have look +at the output files generated by assimp_cmd. + +@section assbin Binary file format + +The ASSBIN file format is composed of chunks to represent the hierarchical aiScene data structure. +This makes the format extensible and allows backward-compatibility with future data structure +versions. The <tt><root>/code/assbin_chunks.h</tt> header contains some magic constants +for use by stand-alone ASSBIN loaders. Also, Assimp's own file writer can be found +in <tt><root>/tools/assimp_cmd/WriteDumb.cpp</tt> (yes, the 'b' is no typo ...). + +@verbatim + +------------------------------------------------------------------------------- +1. File structure: +------------------------------------------------------------------------------- + +---------------------- +| Header (512 bytes) | +---------------------- +| Variable chunks | +---------------------- + +------------------------------------------------------------------------------- +2. Definitions: +------------------------------------------------------------------------------- + +integer is four bytes wide, stored in little-endian byte order. +short is two bytes wide, stored in little-endian byte order. +byte is a single byte. +string is an integer n followed by n UTF-8 characters, not terminated by zero +float is an IEEE 754 single-precision floating-point value +double is an IEEE 754 double-precision floating-point value +t[n] is an array of n elements of type t + +------------------------------------------------------------------------------- +2. Header: +------------------------------------------------------------------------------- + +byte[44] Magic identification string for ASSBIN files. + 'ASSIMP.binary' + +integer Major version of the Assimp library which wrote the file +integer Minor version of the Assimp library which wrote the file + match these against ASSBIN_VERSION_MAJOR and ASSBIN_VERSION_MINOR + +integer SVN revision of the Assimp library (intended for our internal + debugging - if you write Ass files from your own APPs, set this value to 0. +integer Assimp compile flags + +short 0 for normal files, 1 for shortened dumps for regression tests + these should have the file extension assbin.regress + +short 1 if the data after the header is compressed with the DEFLATE algorithm, + 0 for uncompressed files. + For compressed files, the first integer after the header is + always the uncompressed data size + +byte[256] Zero-terminated source file name, UTF-8 +byte[128] Zero-terminated command line parameters passed to assimp_cmd, UTF-8 + +byte[64] Reserved for future use +---> Total length: 512 bytes + +------------------------------------------------------------------------------- +3. Chunks: +------------------------------------------------------------------------------- + +integer Magic chunk ID (ASSBIN_CHUNK_XXX) +integer Chunk data length, in bytes + (unknown chunks are possible, a good reader skips over them) + (chunk-data-length does not include the first two integers) + +byte[n] chunk-data-length bytes of data, depending on the chunk type + +Chunks can contain nested chunks. Nested chunks are ALWAYS at the end of the chunk, +their size is included in chunk-data-length. + +The chunk layout for all ASSIMP data structures is derived from their C declarations. +The general 'rule' to get from Assimp headers to the serialized layout is: + + 1. POD members (i.e. aiMesh::mPrimitiveTypes, aiMesh::mNumVertices), + in order of declaration. + + 2. Array-members (aiMesh::mFaces, aiMesh::mVertices, aiBone::mWeights), + in order of declaration. + + 2. Object array members (i.e aiMesh::mBones, aiScene::mMeshes) are stored in + subchunks directly following the data written in 1.) and 2.) + + + Of course, there are some exceptions to this general order: + +[[aiScene]] + + - The root node holding the scene structure is naturally stored in + a ASSBIN_CHUNK_AINODE subchunk following 1.) and 2.) (which is + empty for aiScene). + +[[aiMesh]] + + - mTextureCoords and mNumUVComponents are serialized as follows: + + [number of used uv channels times] + integer mNumUVComponents[n] + float mTextureCoords[n][3] + + -> more than AI_MAX_TEXCOORD_CHANNELS can be stored. This allows Assimp + builds with different settings for AI_MAX_TEXCOORD_CHANNELS to exchange + data. + -> the on-disk format always uses 3 floats to write UV coordinates. + If mNumUVComponents[0] is 1, the corresponding mTextureCoords array + consists of 3 floats. + + - The array member block of aiMesh is prefixed with an integer that specifies + the kinds of vertex components actually present in the mesh. This is a + bitwise combination of the ASSBIN_MESH_HAS_xxx constants. + +[[aiFace]] + + - mNumIndices is stored as short + - mIndices are written as short, if aiMesh::mNumVertices<65536 + +[[aiNode]] + + - mParent is omitted + +[[aiLight]] + + - mAttenuationXXX not written if aiLight::mType == aiLightSource_DIRECTIONAL + - mAngleXXX not written if aiLight::mType != aiLightSource_SPOT + +[[aiMaterial]] + + - mNumAllocated is omitted, for obvious reasons :-) + + + @endverbatim*/ + + +#define ASSBIN_HEADER_LENGTH 512 + +// these are the magic chunk identifiers for the binary ASS file format +#define ASSBIN_CHUNK_AICAMERA 0x1234 +#define ASSBIN_CHUNK_AILIGHT 0x1235 +#define ASSBIN_CHUNK_AITEXTURE 0x1236 +#define ASSBIN_CHUNK_AIMESH 0x1237 +#define ASSBIN_CHUNK_AINODEANIM 0x1238 +#define ASSBIN_CHUNK_AISCENE 0x1239 +#define ASSBIN_CHUNK_AIBONE 0x123a +#define ASSBIN_CHUNK_AIANIMATION 0x123b +#define ASSBIN_CHUNK_AINODE 0x123c +#define ASSBIN_CHUNK_AIMATERIAL 0x123d +#define ASSBIN_CHUNK_AIMATERIALPROPERTY 0x123e + +#define ASSBIN_MESH_HAS_POSITIONS 0x1 +#define ASSBIN_MESH_HAS_NORMALS 0x2 +#define ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS 0x4 +#define ASSBIN_MESH_HAS_TEXCOORD_BASE 0x100 +#define ASSBIN_MESH_HAS_COLOR_BASE 0x10000 + +#define ASSBIN_MESH_HAS_TEXCOORD(n) (ASSBIN_MESH_HAS_TEXCOORD_BASE << n) +#define ASSBIN_MESH_HAS_COLOR(n) (ASSBIN_MESH_HAS_COLOR_BASE << n) + + +#endif // INCLUDED_ASSBIN_CHUNKS_H diff --git a/thirdparty/assimp/code/scene.cpp b/thirdparty/assimp/code/Common/scene.cpp index 2acb348d81..2acb348d81 100644 --- a/thirdparty/assimp/code/scene.cpp +++ b/thirdparty/assimp/code/Common/scene.cpp diff --git a/thirdparty/assimp/code/simd.cpp b/thirdparty/assimp/code/Common/simd.cpp index 04615f408e..04615f408e 100644 --- a/thirdparty/assimp/code/simd.cpp +++ b/thirdparty/assimp/code/Common/simd.cpp diff --git a/thirdparty/assimp/code/simd.h b/thirdparty/assimp/code/Common/simd.h index 3eecdd4581..3eecdd4581 100644 --- a/thirdparty/assimp/code/simd.h +++ b/thirdparty/assimp/code/Common/simd.h diff --git a/thirdparty/assimp/code/FBXAnimation.cpp b/thirdparty/assimp/code/FBX/FBXAnimation.cpp index 874914431b..874914431b 100644 --- a/thirdparty/assimp/code/FBXAnimation.cpp +++ b/thirdparty/assimp/code/FBX/FBXAnimation.cpp diff --git a/thirdparty/assimp/code/FBXBinaryTokenizer.cpp b/thirdparty/assimp/code/FBX/FBXBinaryTokenizer.cpp index 7138df4315..a4a2bc8e79 100644 --- a/thirdparty/assimp/code/FBXBinaryTokenizer.cpp +++ b/thirdparty/assimp/code/FBX/FBXBinaryTokenizer.cpp @@ -98,7 +98,7 @@ namespace FBX { // return (flags & to_check) != 0; //} // ------------------------------------------------------------------------------------------------ -Token::Token(const char* sbegin, const char* send, TokenType type, unsigned int offset) +Token::Token(const char* sbegin, const char* send, TokenType type, size_t offset) : #ifdef DEBUG contents(sbegin, static_cast<size_t>(send-sbegin)), @@ -122,18 +122,18 @@ namespace { // ------------------------------------------------------------------------------------------------ // signal tokenization error, this is always unrecoverable. Throws DeadlyImportError. -AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int offset) AI_WONT_RETURN_SUFFIX; -AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int offset) +AI_WONT_RETURN void TokenizeError(const std::string& message, size_t offset) AI_WONT_RETURN_SUFFIX; +AI_WONT_RETURN void TokenizeError(const std::string& message, size_t offset) { throw DeadlyImportError(Util::AddOffset("FBX-Tokenize",message,offset)); } // ------------------------------------------------------------------------------------------------ -uint32_t Offset(const char* begin, const char* cursor) { +size_t Offset(const char* begin, const char* cursor) { ai_assert(begin <= cursor); - return static_cast<unsigned int>(cursor - begin); + return cursor - begin; } // ------------------------------------------------------------------------------------------------ @@ -424,7 +424,7 @@ bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor, // ------------------------------------------------------------------------------------------------ // TODO: Test FBX Binary files newer than the 7500 version to check if the 64 bits address behaviour is consistent -void TokenizeBinary(TokenList& output_tokens, const char* input, unsigned int length) +void TokenizeBinary(TokenList& output_tokens, const char* input, size_t length) { ai_assert(input); diff --git a/thirdparty/assimp/code/FBXCommon.h b/thirdparty/assimp/code/FBX/FBXCommon.h index fcb20a5cad..e516449130 100644 --- a/thirdparty/assimp/code/FBXCommon.h +++ b/thirdparty/assimp/code/FBX/FBXCommon.h @@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_FBX_EXPORTER - +namespace Assimp { namespace FBX { const std::string NULL_RECORD = { // 13 null bytes @@ -80,7 +80,7 @@ namespace FBX TransformInheritance_MAX // end-of-enum sentinel }; } - +} #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // AI_FBXCOMMON_H_INC diff --git a/thirdparty/assimp/code/FBXCompileConfig.h b/thirdparty/assimp/code/FBX/FBXCompileConfig.h index 3a3841fa5b..3a3841fa5b 100644 --- a/thirdparty/assimp/code/FBXCompileConfig.h +++ b/thirdparty/assimp/code/FBX/FBXCompileConfig.h diff --git a/thirdparty/assimp/code/FBXConverter.cpp b/thirdparty/assimp/code/FBX/FBXConverter.cpp index 09ae06a64f..9f940d3226 100644 --- a/thirdparty/assimp/code/FBXConverter.cpp +++ b/thirdparty/assimp/code/FBX/FBXConverter.cpp @@ -67,6 +67,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <sstream> #include <iomanip> + namespace Assimp { namespace FBX { @@ -76,20 +77,21 @@ namespace Assimp { #define CONVERT_FBX_TIME(time) static_cast<double>(time) / 46186158000L - FBXConverter::FBXConverter(aiScene* out, const Document& doc) - : defaultMaterialIndex() - , lights() - , cameras() - , textures() - , materials_converted() - , textures_converted() - , meshes_converted() - , node_anim_chain_bits() - , mNodeNameInstances() - , mNodeNames() - , anim_fps() - , out(out) - , doc(doc) { + FBXConverter::FBXConverter(aiScene* out, const Document& doc, bool removeEmptyBones, FbxUnit unit ) + : defaultMaterialIndex() + , lights() + , cameras() + , textures() + , materials_converted() + , textures_converted() + , meshes_converted() + , node_anim_chain_bits() + , mNodeNames() + , anim_fps() + , out(out) + , doc(doc) + , mRemoveEmptyBones( removeEmptyBones ) + , mCurrentUnit(FbxUnit::cm) { // animations need to be converted first since this will // populate the node_anim_chain_bits map, which is needed // to determine which nodes need to be generated. @@ -117,6 +119,7 @@ namespace Assimp { ConvertGlobalSettings(); TransferDataToScene(); + ConvertToUnitScale(unit); // if we didn't read any meshes set the AI_SCENE_FLAGS_INCOMPLETE // to make sure the scene passes assimp's validation. FBX files @@ -138,12 +141,46 @@ namespace Assimp { void FBXConverter::ConvertRootNode() { out->mRootNode = new aiNode(); - out->mRootNode->mName.Set("RootNode"); + std::string unique_name; + GetUniqueName("RootNode", unique_name); + out->mRootNode->mName.Set(unique_name); // root has ID 0 ConvertNodes(0L, *out->mRootNode); } + static std::string getAncestorBaseName(const aiNode* node) + { + const char* nodeName = nullptr; + size_t length = 0; + while (node && (!nodeName || length == 0)) + { + nodeName = node->mName.C_Str(); + length = node->mName.length; + node = node->mParent; + } + + if (!nodeName || length == 0) + { + return {}; + } + // could be std::string_view if c++17 available + return std::string(nodeName, length); + } + + // Make unique name + std::string FBXConverter::MakeUniqueNodeName(const Model* const model, const aiNode& parent) + { + std::string original_name = FixNodeName(model->Name()); + if (original_name.empty()) + { + original_name = getAncestorBaseName(&parent); + } + std::string unique_name; + GetUniqueName(original_name, unique_name); + return unique_name; + } + void FBXConverter::ConvertNodes(uint64_t id, aiNode& parent, const aiMatrix4x4& parent_transform) { const std::vector<const Connection*>& conns = doc.GetConnectionsByDestinationSequenced(id, "Model"); @@ -175,35 +212,18 @@ namespace Assimp { aiMatrix4x4 new_abs_transform = parent_transform; + std::string unique_name = MakeUniqueNodeName(model, parent); + // 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. - GenerateTransformationNodeChain(*model, nodes_chain, post_nodes_chain); + const bool need_additional_node = GenerateTransformationNodeChain(*model, unique_name, nodes_chain, post_nodes_chain); ai_assert(nodes_chain.size()); - std::string original_name = FixNodeName(model->Name()); - - // check if any of the nodes in the chain has the name the fbx node - // is supposed to have. If there is none, add another node to - // preserve the name - people might have scripts etc. that rely - // on specific node names. - aiNode* name_carrier = NULL; - for (aiNode* prenode : nodes_chain) { - if (!strcmp(prenode->mName.C_Str(), original_name.c_str())) { - name_carrier = prenode; - break; - } - } - - if (!name_carrier) { - std::string old_original_name = original_name; - GetUniqueName(old_original_name, original_name); - nodes_chain.push_back(new aiNode(original_name)); - } - else { - original_name = nodes_chain.back()->mName.C_Str(); + if (need_additional_node) { + nodes_chain.push_back(new aiNode(unique_name)); } //setup metadata on newest node @@ -265,11 +285,11 @@ namespace Assimp { ConvertNodes(model->ID(), *last_parent, new_abs_transform); if (doc.Settings().readLights) { - ConvertLights(*model, original_name); + ConvertLights(*model, unique_name); } if (doc.Settings().readCameras) { - ConvertCameras(*model, original_name); + ConvertCameras(*model, unique_name); } nodes.push_back(nodes_chain.front()); @@ -387,6 +407,7 @@ namespace Assimp { break; default: ai_assert(false); + break; } } @@ -399,11 +420,6 @@ namespace Assimp { out_camera->mAspect = cam.AspectWidth() / cam.AspectHeight(); - //cameras are defined along positive x direction - /*out_camera->mPosition = cam.Position(); - out_camera->mLookAt = (cam.InterestPosition() - out_camera->mPosition).Normalize(); - out_camera->mUp = cam.UpVector();*/ - out_camera->mPosition = aiVector3D(0.0f); out_camera->mLookAt = aiVector3D(1.0f, 0.0f, 0.0f); out_camera->mUp = aiVector3D(0.0f, 1.0f, 0.0f); @@ -421,21 +437,16 @@ namespace Assimp { void FBXConverter::GetUniqueName(const std::string &name, std::string &uniqueName) { uniqueName = name; - int i = 0; - auto it = mNodeNameInstances.find(name); // duplicate node name instance count - if (it != mNodeNameInstances.end()) + auto it_pair = mNodeNames.insert({ name, 0 }); // duplicate node name instance count + unsigned int& i = it_pair.first->second; + while (!it_pair.second) { - i = it->second; - while (mNodeNames.find(uniqueName) != mNodeNames.end()) - { - i++; - std::stringstream ext; - ext << name << std::setfill('0') << std::setw(3) << i; - uniqueName = ext.str(); - } + i++; + std::ostringstream ext; + ext << name << std::setfill('0') << std::setw(3) << i; + uniqueName = ext.str(); + it_pair = mNodeNames.insert({ uniqueName, 0 }); } - mNodeNameInstances[name] = i; - mNodeNames.insert(uniqueName); } const char* FBXConverter::NameTransformationComp(TransformationComp comp) { @@ -651,8 +662,7 @@ namespace Assimp { if ((v - all_ones).SquareLength() > zero_epsilon) { return true; } - } - else if (ok) { + } else if (ok) { if (v.SquareLength() > zero_epsilon) { return true; } @@ -667,7 +677,7 @@ namespace Assimp { return name + std::string(MAGIC_NODE_TAG) + "_" + NameTransformationComp(comp); } - void FBXConverter::GenerateTransformationNodeChain(const Model& model, std::vector<aiNode*>& output_nodes, + bool FBXConverter::GenerateTransformationNodeChain(const Model& model, const std::string& name, std::vector<aiNode*>& output_nodes, std::vector<aiNode*>& post_output_nodes) { const PropertyTable& props = model.Props(); const Model::RotOrder rot = model.RotationOrder(); @@ -782,8 +792,6 @@ namespace Assimp { // not be guaranteed. ai_assert(NeedsComplexTransformationChain(model) == is_complex); - std::string name = FixNodeName(model.Name()); - // now, if we have more than just Translation, Scaling and Rotation, // we need to generate a full node chain to accommodate for assimp's // lack to express pivots and offsets. @@ -825,20 +833,20 @@ namespace Assimp { } ai_assert(output_nodes.size()); - return; + return true; } // else, we can just multiply the matrices together aiNode* nd = new aiNode(); output_nodes.push_back(nd); - std::string uniqueName; - GetUniqueName(name, uniqueName); - nd->mName.Set(uniqueName); + // name passed to the method is already unique + nd->mName.Set(name); for (const auto &transform : chain) { nd->mTransformation = nd->mTransformation * transform; } + return false; } void FBXConverter::SetupNodeMetadata(const Model& model, aiNode& nd) @@ -977,7 +985,9 @@ namespace Assimp { unsigned int epcount = 0; for (unsigned i = 0; i < indices.size(); i++) { - if (indices[i] < 0) epcount++; + if (indices[i] < 0) { + epcount++; + } } unsigned int pcount = static_cast<unsigned int>( indices.size() ); unsigned int scount = out_mesh->mNumFaces = pcount - epcount; @@ -1237,10 +1247,10 @@ namespace Assimp { ai_assert(count_faces); ai_assert(count_vertices); - // mapping from output indices to DOM indexing, needed to resolve weights + // mapping from output indices to DOM indexing, needed to resolve weights or blendshapes std::vector<unsigned int> reverseMapping; - - if (process_weights) { + std::map<unsigned int, unsigned int> translateIndexMap; + if (process_weights || mesh.GetBlendShapes().size() > 0) { reverseMapping.resize(count_vertices); } @@ -1347,6 +1357,7 @@ namespace Assimp { if (reverseMapping.size()) { reverseMapping[cursor] = in_cursor; + translateIndexMap[in_cursor] = cursor; } out_mesh->mVertices[cursor] = vertices[in_cursor]; @@ -1378,6 +1389,50 @@ namespace Assimp { ConvertWeights(out_mesh, model, mesh, node_global_transform, index, &reverseMapping); } + std::vector<aiAnimMesh*> animMeshes; + for (const BlendShape* blendShape : mesh.GetBlendShapes()) { + for (const BlendShapeChannel* blendShapeChannel : blendShape->BlendShapeChannels()) { + const std::vector<const ShapeGeometry*>& shapeGeometries = blendShapeChannel->GetShapeGeometries(); + for (size_t i = 0; i < shapeGeometries.size(); i++) { + aiAnimMesh* animMesh = aiCreateAnimMesh(out_mesh); + const ShapeGeometry* shapeGeometry = shapeGeometries.at(i); + const std::vector<aiVector3D>& vertices = shapeGeometry->GetVertices(); + const std::vector<aiVector3D>& normals = shapeGeometry->GetNormals(); + const std::vector<unsigned int>& indices = shapeGeometry->GetIndices(); + animMesh->mName.Set(FixAnimMeshName(shapeGeometry->Name())); + for (size_t j = 0; j < indices.size(); j++) { + unsigned int index = indices.at(j); + aiVector3D vertex = vertices.at(j); + aiVector3D normal = normals.at(j); + unsigned int count = 0; + const unsigned int* outIndices = mesh.ToOutputVertexIndex(index, count); + for (unsigned int k = 0; k < count; k++) { + unsigned int outIndex = outIndices[k]; + if (translateIndexMap.find(outIndex) == translateIndexMap.end()) + continue; + unsigned int index = translateIndexMap[outIndex]; + animMesh->mVertices[index] += vertex; + if (animMesh->mNormals != nullptr) { + animMesh->mNormals[index] += normal; + animMesh->mNormals[index].NormalizeSafe(); + } + } + } + animMesh->mWeight = shapeGeometries.size() > 1 ? blendShapeChannel->DeformPercent() / 100.0f : 1.0f; + animMeshes.push_back(animMesh); + } + } + } + + const size_t numAnimMeshes = animMeshes.size(); + if (numAnimMeshes > 0) { + out_mesh->mNumAnimMeshes = static_cast<unsigned int>(numAnimMeshes); + out_mesh->mAnimMeshes = new aiAnimMesh*[numAnimMeshes]; + for (size_t i = 0; i < numAnimMeshes; i++) { + out_mesh->mAnimMeshes[i] = animMeshes.at(i); + } + } + return static_cast<unsigned int>(meshes.size() - 1); } @@ -1407,7 +1462,7 @@ namespace Assimp { const WeightIndexArray& indices = cluster->GetIndices(); - if (indices.empty()) { + if (indices.empty() && mRemoveEmptyBones ) { continue; } @@ -1439,13 +1494,11 @@ namespace Assimp { if (index_out_indices.back() == no_index_sentinel) { index_out_indices.back() = out_indices.size(); - } if (no_mat_check) { out_indices.push_back(out_idx[i]); - } - else { + } else { // this extra lookup is in O(logn), so the entire algorithm becomes O(nlogn) const std::vector<unsigned int>::iterator it = std::lower_bound( outputVertStartIndices->begin(), @@ -1461,11 +1514,11 @@ 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. - if (ok) { + if (ok && mRemoveEmptyBones) { ConvertCluster(bones, model, *cluster, out_indices, index_out_indices, count_out_indices, node_global_transform); } @@ -1596,6 +1649,13 @@ namespace Assimp { out_mat->AddProperty(&str, AI_MATKEY_NAME); } + // Set the shading mode as best we can: The FBX specification only mentions Lambert and Phong, and only Phong is mentioned in Assimp's aiShadingMode enum. + if (material.GetShadingModel() == "phong") + { + aiShadingMode shadingMode = aiShadingMode_Phong; + out_mat->AddProperty<aiShadingMode>(&shadingMode, 1, AI_MATKEY_SHADING_MODEL); + } + // shading stuff and colors SetShadingPropertiesCommon(out_mat, props); SetShadingPropertiesRaw( out_mat, props, material.Textures(), mesh ); @@ -1621,7 +1681,7 @@ namespace Assimp { out_tex->pcData = reinterpret_cast<aiTexel*>(const_cast<Video&>(video).RelinquishContent()); // try to extract a hint from the file extension - const std::string& filename = video.FileName().empty() ? video.RelativeFilename() : video.FileName(); + const std::string& filename = video.RelativeFilename().empty() ? video.FileName() : video.RelativeFilename(); std::string ext = BaseImporter::GetExtension(filename); if (ext == "jpeg") { @@ -1632,7 +1692,7 @@ namespace Assimp { memcpy(out_tex->achFormatHint, ext.c_str(), ext.size()); } - out_tex->mFilename.Set(video.FileName().c_str()); + out_tex->mFilename.Set(filename.c_str()); return static_cast<unsigned int>(textures.size() - 1); } @@ -1678,9 +1738,8 @@ namespace Assimp { } void FBXConverter::TrySetTextureProperties(aiMaterial* out_mat, const TextureMap& textures, - const std::string& propName, - aiTextureType target, const MeshGeometry* const mesh) - { + const std::string& propName, + aiTextureType target, const MeshGeometry* const mesh) { TextureMap::const_iterator it = textures.find(propName); if (it == textures.end()) { return; @@ -3407,8 +3466,9 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa na->mNumScalingKeys = static_cast<unsigned int>(keys.size()); na->mScalingKeys = new aiVectorKey[keys.size()]; - if (keys.size() > 0) + if (keys.size() > 0) { InterpolateKeys(na->mScalingKeys, keys, inputs, aiVector3D(1.0f, 1.0f, 1.0f), maxTime, minTime); + } } void FBXConverter::ConvertTranslationKeys(aiNodeAnim* na, const std::vector<const AnimationCurveNode*>& nodes, @@ -3472,6 +3532,46 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa out->mMetaData->Set(14, "CustomFrameRate", doc.GlobalSettings().CustomFrameRate()); } + void FBXConverter::ConvertToUnitScale( FbxUnit unit ) { + if (mCurrentUnit == unit) { + return; + } + + ai_real scale = 1.0; + if (mCurrentUnit == FbxUnit::cm) { + if (unit == FbxUnit::m) { + scale = (ai_real)0.01; + } else if (unit == FbxUnit::km) { + scale = (ai_real)0.00001; + } + } else if (mCurrentUnit == FbxUnit::m) { + if (unit == FbxUnit::cm) { + scale = (ai_real)100.0; + } else if (unit == FbxUnit::km) { + scale = (ai_real)0.001; + } + } else if (mCurrentUnit == FbxUnit::km) { + if (unit == FbxUnit::cm) { + scale = (ai_real)100000.0; + } else if (unit == FbxUnit::m) { + scale = (ai_real)1000.0; + } + } + + for (auto mesh : meshes) { + if (nullptr == mesh) { + continue; + } + + if (mesh->HasPositions()) { + for (unsigned int i = 0; i < mesh->mNumVertices; ++i) { + aiVector3D &pos = mesh->mVertices[i]; + pos *= scale; + } + } + } + } + void FBXConverter::TransferDataToScene() { ai_assert(!out->mMeshes); @@ -3525,9 +3625,9 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa } // ------------------------------------------------------------------------------------------------ - void ConvertToAssimpScene(aiScene* out, const Document& doc) + void ConvertToAssimpScene(aiScene* out, const Document& doc, bool removeEmptyBones, FbxUnit unit) { - FBXConverter converter(out, doc); + FBXConverter converter(out, doc, removeEmptyBones, unit); } } // !FBX diff --git a/thirdparty/assimp/code/FBXConverter.h b/thirdparty/assimp/code/FBX/FBXConverter.h index 50637468b9..17a7bc56b7 100644 --- a/thirdparty/assimp/code/FBXConverter.h +++ b/thirdparty/assimp/code/FBX/FBXConverter.h @@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXUtil.h" #include "FBXProperties.h" #include "FBXImporter.h" + #include <assimp/anim.h> #include <assimp/material.h> #include <assimp/light.h> @@ -76,12 +77,22 @@ 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 - * @param doc Parsed FBX document + * @param doc Parsed FBX document + * @param removeEmptyBones Will remove bones, which do not have any references to vertices. */ -void ConvertToAssimpScene(aiScene* out, const Document& doc); +void ConvertToAssimpScene(aiScene* out, const Document& doc, bool removeEmptyBones, FbxUnit unit); /** Dummy class to encapsulate the conversion process */ class FBXConverter { @@ -112,7 +123,7 @@ public: }; public: - FBXConverter(aiScene* out, const Document& doc); + FBXConverter(aiScene* out, const Document& doc, bool removeEmptyBones, FbxUnit unit); ~FBXConverter(); private: @@ -145,6 +156,11 @@ private: const char* NameTransformationComp(TransformationComp comp); // ------------------------------------------------------------------------------------------------ + // Returns an unique name for a node or traverses up a hierarchy until a non-empty name is found and + // then makes this name unique + std::string MakeUniqueNodeName(const Model* const model, const aiNode& parent); + + // ------------------------------------------------------------------------------------------------ // note: this returns the REAL fbx property names const char* NameTransformationCompProperty(TransformationComp comp); @@ -167,7 +183,7 @@ private: /** * note: memory for output_nodes will be managed by the caller */ - void GenerateTransformationNodeChain(const Model& model, std::vector<aiNode*>& output_nodes, std::vector<aiNode*>& post_output_nodes); + bool GenerateTransformationNodeChain(const Model& model, const std::string& name, std::vector<aiNode*>& output_nodes, std::vector<aiNode*>& post_output_nodes); // ------------------------------------------------------------------------------------------------ void SetupNodeMetadata(const Model& model, aiNode& nd); @@ -415,6 +431,10 @@ private: void ConvertGlobalSettings(); // ------------------------------------------------------------------------------------------------ + // Will perform the conversion from a given unit to the requested unit. + void ConvertToUnitScale(FbxUnit unit); + + // ------------------------------------------------------------------------------------------------ // copy generated meshes, animations, lights, cameras and textures to the output scene void TransferDataToScene(); @@ -443,16 +463,17 @@ private: NodeAnimBitMap node_anim_chain_bits; // number of nodes with the same name - using NodeAnimNameMap = std::unordered_map<std::string, unsigned int>; - NodeAnimNameMap mNodeNameInstances; - - using NodeNameCache = std::unordered_set<std::string>; + using NodeNameCache = std::unordered_map<std::string, unsigned int>; NodeNameCache mNodeNames; double anim_fps; aiScene* const out; const FBX::Document& doc; + + bool mRemoveEmptyBones; + + FbxUnit mCurrentUnit; }; } diff --git a/thirdparty/assimp/code/FBXDeformer.cpp b/thirdparty/assimp/code/FBX/FBXDeformer.cpp index 6927553450..6927553450 100644 --- a/thirdparty/assimp/code/FBXDeformer.cpp +++ b/thirdparty/assimp/code/FBX/FBXDeformer.cpp diff --git a/thirdparty/assimp/code/FBXDocument.cpp b/thirdparty/assimp/code/FBX/FBXDocument.cpp index 1af08fe6d8..1af08fe6d8 100644 --- a/thirdparty/assimp/code/FBXDocument.cpp +++ b/thirdparty/assimp/code/FBX/FBXDocument.cpp diff --git a/thirdparty/assimp/code/FBXDocument.h b/thirdparty/assimp/code/FBX/FBXDocument.h index c849defdcd..18e5c38f13 100644 --- a/thirdparty/assimp/code/FBXDocument.h +++ b/thirdparty/assimp/code/FBX/FBXDocument.h @@ -627,7 +627,7 @@ public: return content; } - uint32_t ContentLength() const { + uint64_t ContentLength() const { return contentLength; } @@ -643,7 +643,7 @@ private: std::string fileName; std::shared_ptr<const PropertyTable> props; - uint32_t contentLength; + uint64_t contentLength; uint8_t* content; }; diff --git a/thirdparty/assimp/code/FBXDocumentUtil.cpp b/thirdparty/assimp/code/FBX/FBXDocumentUtil.cpp index f84691479a..f84691479a 100644 --- a/thirdparty/assimp/code/FBXDocumentUtil.cpp +++ b/thirdparty/assimp/code/FBX/FBXDocumentUtil.cpp diff --git a/thirdparty/assimp/code/FBXDocumentUtil.h b/thirdparty/assimp/code/FBX/FBXDocumentUtil.h index 2450109e59..2450109e59 100644 --- a/thirdparty/assimp/code/FBXDocumentUtil.h +++ b/thirdparty/assimp/code/FBX/FBXDocumentUtil.h diff --git a/thirdparty/assimp/code/FBXExportNode.cpp b/thirdparty/assimp/code/FBX/FBXExportNode.cpp index e5215466a1..06c89cee46 100644 --- a/thirdparty/assimp/code/FBXExportNode.cpp +++ b/thirdparty/assimp/code/FBX/FBXExportNode.cpp @@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <sstream> // ostringstream #include <memory> // shared_ptr +namespace Assimp { // AddP70<type> helpers... there's no usable pattern here, // so all are defined as separate functions. // Even "animatable" properties are often completely different @@ -252,7 +253,8 @@ void FBX::Node::DumpChildren( } else { std::ostringstream ss; DumpChildrenAscii(ss, indent); - s.PutString(ss.str()); + if (ss.tellp() > 0) + s.PutString(ss.str()); } } @@ -266,7 +268,8 @@ void FBX::Node::End( } else { std::ostringstream ss; EndAscii(ss, indent, has_children); - s.PutString(ss.str()); + if (ss.tellp() > 0) + s.PutString(ss.str()); } } @@ -367,7 +370,7 @@ void FBX::Node::EndBinary( bool has_children ) { // if there were children, add a null record - if (has_children) { s.PutString(FBX::NULL_RECORD); } + if (has_children) { s.PutString(Assimp::FBX::NULL_RECORD); } // now go back and write initial pos this->end_pos = s.Tell(); @@ -563,6 +566,6 @@ void FBX::Node::WritePropertyNode( FBX::Node::WritePropertyNodeAscii(name, v, s, indent); } } - +} #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // ASSIMP_BUILD_NO_EXPORT diff --git a/thirdparty/assimp/code/FBXExportNode.h b/thirdparty/assimp/code/FBX/FBXExportNode.h index e1ebc36969..ef3bc781a4 100644 --- a/thirdparty/assimp/code/FBXExportNode.h +++ b/thirdparty/assimp/code/FBX/FBXExportNode.h @@ -54,16 +54,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <string> #include <vector> +namespace Assimp { namespace FBX { class Node; } -class FBX::Node -{ -public: // public data members +class FBX::Node { +public: // TODO: accessors std::string name; // node name - std::vector<FBX::Property> properties; // node properties + std::vector<FBX::FBXExportProperty> properties; // node properties std::vector<FBX::Node> children; // child nodes // some nodes always pretend they have children... @@ -214,7 +214,7 @@ public: // static member functions Assimp::StreamWriterLE& s, bool binary, int indent ) { - FBX::Property p(value); + FBX::FBXExportProperty p(value); FBX::Node node(name, p); node.Dump(s, binary, indent); } @@ -264,7 +264,7 @@ private: // static helper functions ); }; - +} #endif // ASSIMP_BUILD_NO_FBX_EXPORTER diff --git a/thirdparty/assimp/code/FBXExportProperty.cpp b/thirdparty/assimp/code/FBX/FBXExportProperty.cpp index 9981d6b1c6..f8593e6295 100644 --- a/thirdparty/assimp/code/FBXExportProperty.cpp +++ b/thirdparty/assimp/code/FBX/FBXExportProperty.cpp @@ -52,187 +52,210 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <locale> #include <sstream> // ostringstream +namespace Assimp { +namespace FBX { // constructors for single element properties -FBX::Property::Property(bool v) - : type('C'), data(1) -{ - data = {uint8_t(v)}; +FBXExportProperty::FBXExportProperty(bool v) +: type('C') +, data(1) { + data = { + uint8_t(v) + }; } -FBX::Property::Property(int16_t v) : type('Y'), data(2) -{ +FBXExportProperty::FBXExportProperty(int16_t v) +: type('Y') +, data(2) { uint8_t* d = data.data(); (reinterpret_cast<int16_t*>(d))[0] = v; } -FBX::Property::Property(int32_t v) : type('I'), data(4) -{ +FBXExportProperty::FBXExportProperty(int32_t v) +: type('I') +, data(4) { uint8_t* d = data.data(); (reinterpret_cast<int32_t*>(d))[0] = v; } -FBX::Property::Property(float v) : type('F'), data(4) -{ +FBXExportProperty::FBXExportProperty(float v) +: type('F') +, data(4) { uint8_t* d = data.data(); (reinterpret_cast<float*>(d))[0] = v; } -FBX::Property::Property(double v) : type('D'), data(8) -{ +FBXExportProperty::FBXExportProperty(double v) +: type('D') +, data(8) { uint8_t* d = data.data(); (reinterpret_cast<double*>(d))[0] = v; } -FBX::Property::Property(int64_t v) : type('L'), data(8) -{ +FBXExportProperty::FBXExportProperty(int64_t v) +: type('L') +, data(8) { uint8_t* d = data.data(); (reinterpret_cast<int64_t*>(d))[0] = v; } - // constructors for array-type properties -FBX::Property::Property(const char* c, bool raw) - : Property(std::string(c), raw) -{} +FBXExportProperty::FBXExportProperty(const char* c, bool raw) +: FBXExportProperty(std::string(c), raw) { + // empty +} // strings can either be saved as "raw" (R) data, or "string" (S) data -FBX::Property::Property(const std::string& s, bool raw) - : type(raw ? 'R' : 'S'), data(s.size()) -{ +FBXExportProperty::FBXExportProperty(const std::string& s, bool raw) +: type(raw ? 'R' : 'S') +, data(s.size()) { for (size_t i = 0; i < s.size(); ++i) { data[i] = uint8_t(s[i]); } } -FBX::Property::Property(const std::vector<uint8_t>& r) - : type('R'), data(r) -{} +FBXExportProperty::FBXExportProperty(const std::vector<uint8_t>& r) +: type('R') +, data(r) { + // empty +} -FBX::Property::Property(const std::vector<int32_t>& va) - : type('i'), data(4*va.size()) -{ +FBXExportProperty::FBXExportProperty(const std::vector<int32_t>& va) +: type('i') +, data(4 * va.size() ) { int32_t* d = reinterpret_cast<int32_t*>(data.data()); - for (size_t i = 0; i < va.size(); ++i) { d[i] = va[i]; } + for (size_t i = 0; i < va.size(); ++i) { + d[i] = va[i]; + } } -FBX::Property::Property(const std::vector<int64_t>& va) - : type('l'), data(8*va.size()) -{ +FBXExportProperty::FBXExportProperty(const std::vector<int64_t>& va) +: type('l') +, data(8 * va.size()) { int64_t* d = reinterpret_cast<int64_t*>(data.data()); - for (size_t i = 0; i < va.size(); ++i) { d[i] = va[i]; } + for (size_t i = 0; i < va.size(); ++i) { + d[i] = va[i]; + } } -FBX::Property::Property(const std::vector<float>& va) - : type('f'), data(4*va.size()) -{ +FBXExportProperty::FBXExportProperty(const std::vector<float>& va) +: type('f') +, data(4 * va.size()) { float* d = reinterpret_cast<float*>(data.data()); - for (size_t i = 0; i < va.size(); ++i) { d[i] = va[i]; } + for (size_t i = 0; i < va.size(); ++i) { + d[i] = va[i]; + } } -FBX::Property::Property(const std::vector<double>& va) - : type('d'), data(8*va.size()) -{ +FBXExportProperty::FBXExportProperty(const std::vector<double>& va) +: type('d') +, data(8 * va.size()) { double* d = reinterpret_cast<double*>(data.data()); - for (size_t i = 0; i < va.size(); ++i) { d[i] = va[i]; } + for (size_t i = 0; i < va.size(); ++i) { + d[i] = va[i]; + } } -FBX::Property::Property(const aiMatrix4x4& vm) - : type('d'), data(8*16) -{ +FBXExportProperty::FBXExportProperty(const aiMatrix4x4& vm) +: type('d') +, data(8 * 16) { double* d = reinterpret_cast<double*>(data.data()); for (unsigned int c = 0; c < 4; ++c) { for (unsigned int r = 0; r < 4; ++r) { - d[4*c+r] = vm[r][c]; + d[4 * c + r] = vm[r][c]; } } } // public member functions -size_t FBX::Property::size() -{ +size_t FBXExportProperty::size() { switch (type) { - case 'C': case 'Y': case 'I': case 'F': case 'D': case 'L': - return data.size() + 1; - case 'S': case 'R': - return data.size() + 5; - case 'i': case 'd': - return data.size() + 13; - default: - throw DeadlyExportError("Requested size on property of unknown type"); + case 'C': + case 'Y': + case 'I': + case 'F': + case 'D': + case 'L': + return data.size() + 1; + case 'S': + case 'R': + return data.size() + 5; + case 'i': + case 'd': + return data.size() + 13; + default: + throw DeadlyExportError("Requested size on property of unknown type"); } } -void FBX::Property::DumpBinary(Assimp::StreamWriterLE &s) -{ +void FBXExportProperty::DumpBinary(Assimp::StreamWriterLE& s) { s.PutU1(type); uint8_t* d = data.data(); size_t N; switch (type) { - case 'C': s.PutU1(*(reinterpret_cast<uint8_t*>(d))); return; - case 'Y': s.PutI2(*(reinterpret_cast<int16_t*>(d))); return; - case 'I': s.PutI4(*(reinterpret_cast<int32_t*>(d))); return; - case 'F': s.PutF4(*(reinterpret_cast<float*>(d))); return; - case 'D': s.PutF8(*(reinterpret_cast<double*>(d))); return; - case 'L': s.PutI8(*(reinterpret_cast<int64_t*>(d))); return; - case 'S': - case 'R': - s.PutU4(uint32_t(data.size())); - for (size_t i = 0; i < data.size(); ++i) { s.PutU1(data[i]); } - return; - case 'i': - N = data.size() / 4; - s.PutU4(uint32_t(N)); // number of elements - s.PutU4(0); // no encoding (1 would be zip-compressed) - // TODO: compress if large? - s.PutU4(uint32_t(data.size())); // data size - for (size_t i = 0; i < N; ++i) { - s.PutI4((reinterpret_cast<int32_t*>(d))[i]); - } - return; - case 'l': - N = data.size() / 8; - s.PutU4(uint32_t(N)); // number of elements - s.PutU4(0); // no encoding (1 would be zip-compressed) - // TODO: compress if large? - s.PutU4(uint32_t(data.size())); // data size - for (size_t i = 0; i < N; ++i) { - s.PutI8((reinterpret_cast<int64_t*>(d))[i]); - } - return; - case 'f': - N = data.size() / 4; - s.PutU4(uint32_t(N)); // number of elements - s.PutU4(0); // no encoding (1 would be zip-compressed) - // TODO: compress if large? - s.PutU4(uint32_t(data.size())); // data size - for (size_t i = 0; i < N; ++i) { - s.PutF4((reinterpret_cast<float*>(d))[i]); - } - return; - case 'd': - N = data.size() / 8; - s.PutU4(uint32_t(N)); // number of elements - s.PutU4(0); // no encoding (1 would be zip-compressed) - // TODO: compress if large? - s.PutU4(uint32_t(data.size())); // data size - for (size_t i = 0; i < N; ++i) { - s.PutF8((reinterpret_cast<double*>(d))[i]); - } - return; - default: - std::ostringstream err; - err << "Tried to dump property with invalid type '"; - err << type << "'!"; - throw DeadlyExportError(err.str()); + case 'C': s.PutU1(*(reinterpret_cast<uint8_t*>(d))); return; + case 'Y': s.PutI2(*(reinterpret_cast<int16_t*>(d))); return; + case 'I': s.PutI4(*(reinterpret_cast<int32_t*>(d))); return; + case 'F': s.PutF4(*(reinterpret_cast<float*>(d))); return; + case 'D': s.PutF8(*(reinterpret_cast<double*>(d))); return; + case 'L': s.PutI8(*(reinterpret_cast<int64_t*>(d))); return; + case 'S': + case 'R': + s.PutU4(uint32_t(data.size())); + for (size_t i = 0; i < data.size(); ++i) { s.PutU1(data[i]); } + return; + case 'i': + N = data.size() / 4; + s.PutU4(uint32_t(N)); // number of elements + s.PutU4(0); // no encoding (1 would be zip-compressed) + // TODO: compress if large? + s.PutU4(uint32_t(data.size())); // data size + for (size_t i = 0; i < N; ++i) { + s.PutI4((reinterpret_cast<int32_t*>(d))[i]); + } + return; + case 'l': + N = data.size() / 8; + s.PutU4(uint32_t(N)); // number of elements + s.PutU4(0); // no encoding (1 would be zip-compressed) + // TODO: compress if large? + s.PutU4(uint32_t(data.size())); // data size + for (size_t i = 0; i < N; ++i) { + s.PutI8((reinterpret_cast<int64_t*>(d))[i]); + } + return; + case 'f': + N = data.size() / 4; + s.PutU4(uint32_t(N)); // number of elements + s.PutU4(0); // no encoding (1 would be zip-compressed) + // TODO: compress if large? + s.PutU4(uint32_t(data.size())); // data size + for (size_t i = 0; i < N; ++i) { + s.PutF4((reinterpret_cast<float*>(d))[i]); + } + return; + case 'd': + N = data.size() / 8; + s.PutU4(uint32_t(N)); // number of elements + s.PutU4(0); // no encoding (1 would be zip-compressed) + // TODO: compress if large? + s.PutU4(uint32_t(data.size())); // data size + for (size_t i = 0; i < N; ++i) { + s.PutF8((reinterpret_cast<double*>(d))[i]); + } + return; + default: + std::ostringstream err; + err << "Tried to dump property with invalid type '"; + err << type << "'!"; + throw DeadlyExportError(err.str()); } } -void FBX::Property::DumpAscii(Assimp::StreamWriterLE &outstream, int indent) -{ +void FBXExportProperty::DumpAscii(Assimp::StreamWriterLE& outstream, int indent) { std::ostringstream ss; ss.imbue(std::locale::classic()); ss.precision(15); // this seems to match official FBX SDK exports @@ -240,8 +263,7 @@ void FBX::Property::DumpAscii(Assimp::StreamWriterLE &outstream, int indent) outstream.PutString(ss.str()); } -void FBX::Property::DumpAscii(std::ostream& s, int indent) -{ +void FBXExportProperty::DumpAscii(std::ostream& s, int indent) { // no writing type... or anything. just shove it into the stream. uint8_t* d = data.data(); size_t N; @@ -360,5 +382,8 @@ void FBX::Property::DumpAscii(std::ostream& s, int indent) } } +} // Namespace FBX +} // Namespace Assimp + #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // ASSIMP_BUILD_NO_EXPORT diff --git a/thirdparty/assimp/code/FBXExportProperty.h b/thirdparty/assimp/code/FBX/FBXExportProperty.h index 9c9d37c362..d692fe6ee3 100644 --- a/thirdparty/assimp/code/FBXExportProperty.h +++ b/thirdparty/assimp/code/FBX/FBXExportProperty.h @@ -47,7 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_FBX_EXPORTER - #include <assimp/types.h> // aiMatrix4x4 #include <assimp/StreamWriter.h> // StreamWriterLE @@ -56,11 +55,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <ostream> #include <type_traits> // is_void +namespace Assimp { namespace FBX { - class Property; -} -/** FBX::Property +/** @brief FBX::Property * * Holds a value of any of FBX's recognized types, * each represented by a particular one-character code. @@ -78,35 +76,34 @@ namespace FBX { * S : string (array of 1-byte char) * R : raw data (array of bytes) */ -class FBX::Property -{ +class FBXExportProperty { public: // constructors for basic types. // all explicit to avoid accidental typecasting - explicit Property(bool v); + explicit FBXExportProperty(bool v); // TODO: determine if there is actually a byte type, // or if this always means <bool>. 'C' seems to imply <char>, // so possibly the above was intended to represent both. - explicit Property(int16_t v); - explicit Property(int32_t v); - explicit Property(float v); - explicit Property(double v); - explicit Property(int64_t v); + explicit FBXExportProperty(int16_t v); + explicit FBXExportProperty(int32_t v); + explicit FBXExportProperty(float v); + explicit FBXExportProperty(double v); + explicit FBXExportProperty(int64_t v); // strings can either be stored as 'R' (raw) or 'S' (string) type - explicit Property(const char* c, bool raw=false); - explicit Property(const std::string& s, bool raw=false); - explicit Property(const std::vector<uint8_t>& r); - explicit Property(const std::vector<int32_t>& va); - explicit Property(const std::vector<int64_t>& va); - explicit Property(const std::vector<double>& va); - explicit Property(const std::vector<float>& va); - explicit Property(const aiMatrix4x4& vm); + explicit FBXExportProperty(const char* c, bool raw = false); + explicit FBXExportProperty(const std::string& s, bool raw = false); + explicit FBXExportProperty(const std::vector<uint8_t>& r); + explicit FBXExportProperty(const std::vector<int32_t>& va); + explicit FBXExportProperty(const std::vector<int64_t>& va); + explicit FBXExportProperty(const std::vector<double>& va); + explicit FBXExportProperty(const std::vector<float>& va); + explicit FBXExportProperty(const aiMatrix4x4& vm); // this will catch any type not defined above, // so that we don't accidentally convert something we don't want. // for example (const char*) --> (bool)... seriously wtf C++ template <class T> - explicit Property(T v) : type('X') { + explicit FBXExportProperty(T v) : type('X') { static_assert(std::is_void<T>::value, "TRIED TO CREATE FBX PROPERTY WITH UNSUPPORTED TYPE, CHECK YOUR PROPERTY INSTANTIATION"); } // note: no line wrap so it appears verbatim on the compiler error @@ -114,9 +111,9 @@ public: size_t size(); // write this property node as binary data to the given stream - void DumpBinary(Assimp::StreamWriterLE &s); - void DumpAscii(Assimp::StreamWriterLE &s, int indent=0); - void DumpAscii(std::ostream &s, int indent=0); + void DumpBinary(Assimp::StreamWriterLE& s); + void DumpAscii(Assimp::StreamWriterLE& s, int indent = 0); + void DumpAscii(std::ostream& s, int indent = 0); // note: make sure the ostream is in classic "C" locale private: @@ -124,6 +121,9 @@ private: std::vector<uint8_t> data; }; +} // Namespace FBX +} // Namespace Assimp + #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // AI_FBXEXPORTPROPERTY_H_INC diff --git a/thirdparty/assimp/code/FBXExporter.cpp b/thirdparty/assimp/code/FBX/FBXExporter.cpp index acb1227144..153e676506 100644 --- a/thirdparty/assimp/code/FBXExporter.cpp +++ b/thirdparty/assimp/code/FBX/FBXExporter.cpp @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXExportNode.h" #include "FBXExportProperty.h" #include "FBXCommon.h" +#include "FBXUtil.h" #include <assimp/version.h> // aiGetVersion #include <assimp/IOSystem.hpp> @@ -73,7 +74,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. const ai_real DEG = ai_real( 57.29577951308232087679815481 ); // degrees per radian +using namespace Assimp; +using namespace Assimp::FBX; + // some constants that we'll use for writing metadata +namespace Assimp { namespace FBX { const std::string EXPORT_VERSION_STR = "7.4.0"; const uint32_t EXPORT_VERSION_INT = 7400; // 7.4 == 2014/2015 @@ -92,11 +97,6 @@ namespace FBX { ";------------------------------------------------------------------"; } -using namespace Assimp; -using namespace FBX; - -namespace Assimp { - // --------------------------------------------------------------------- // Worker function for exporting a scene to binary FBX. // Prototyped and registered in Exporter.cpp @@ -121,6 +121,7 @@ namespace Assimp { IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties + ){ // initialize the exporter FBXExporter exporter(pScene, pProperties); @@ -1218,6 +1219,16 @@ void FBXExporter::WriteObjects () layer.AddChild(le); layer.Dump(outstream, binary, indent); + for(unsigned int lr = 1; lr < m->GetNumUVChannels(); ++ lr) + { + FBX::Node layerExtra("Layer", int32_t(1)); + layerExtra.AddChild("Version", int32_t(100)); + FBX::Node leExtra("LayerElement"); + leExtra.AddChild("Type", "LayerElementUV"); + leExtra.AddChild("TypedIndex", int32_t(lr)); + layerExtra.AddChild(leExtra); + layerExtra.Dump(outstream, binary, indent); + } // finish the node record indent = 1; n.End(outstream, binary, indent, true); @@ -1393,10 +1404,6 @@ void FBXExporter::WriteObjects () // FbxVideo - stores images used by textures. for (const auto &it : uid_by_image) { - if (it.first.compare(0, 1, "*") == 0) { - // TODO: embedded textures - continue; - } FBX::Node n("Video"); const int64_t& uid = it.second; const std::string name = ""; // TODO: ... name??? @@ -1406,7 +1413,33 @@ void FBXExporter::WriteObjects () // TODO: get full path... relative path... etc... ugh... // for now just use the same path for everything, // and hopefully one of them will work out. - const std::string& path = it.first; + std::string path = it.first; + // try get embedded texture + const aiTexture* embedded_texture = mScene->GetEmbeddedTexture(it.first.c_str()); + if (embedded_texture != nullptr) { + // change the path (use original filename, if available. If name is empty, concatenate texture index with file extension) + std::stringstream newPath; + if (embedded_texture->mFilename.length > 0) { + newPath << embedded_texture->mFilename.C_Str(); + } else if (embedded_texture->achFormatHint[0]) { + int texture_index = std::stoi(path.substr(1, path.size() - 1)); + newPath << texture_index << "." << embedded_texture->achFormatHint; + } + path = newPath.str(); + // embed the texture + size_t texture_size = static_cast<size_t>(embedded_texture->mWidth * std::max(embedded_texture->mHeight, 1u)); + if (binary) { + // embed texture as binary data + std::vector<uint8_t> tex_data; + tex_data.resize(texture_size); + memcpy(&tex_data[0], (char*)embedded_texture->pcData, texture_size); + n.AddChild("Content", tex_data); + } else { + // embed texture in base64 encoding + std::string encoded_texture = FBX::Util::EncodeBase64((char*)embedded_texture->pcData, texture_size); + n.AddChild("Content", encoded_texture); + } + } p.AddP70("Path", "KString", "XRefUrl", "", path); n.AddChild(p); n.AddChild("UseMipMap", int32_t(0)); @@ -1419,17 +1452,17 @@ void FBXExporter::WriteObjects () // referenced by material_index/texture_type pairs. std::map<std::pair<size_t,size_t>,int64_t> texture_uids; const std::map<aiTextureType,std::string> prop_name_by_tt = { - {aiTextureType_DIFFUSE, "DiffuseColor"}, - {aiTextureType_SPECULAR, "SpecularColor"}, - {aiTextureType_AMBIENT, "AmbientColor"}, - {aiTextureType_EMISSIVE, "EmissiveColor"}, - {aiTextureType_HEIGHT, "Bump"}, - {aiTextureType_NORMALS, "NormalMap"}, - {aiTextureType_SHININESS, "ShininessExponent"}, - {aiTextureType_OPACITY, "TransparentColor"}, + {aiTextureType_DIFFUSE, "DiffuseColor"}, + {aiTextureType_SPECULAR, "SpecularColor"}, + {aiTextureType_AMBIENT, "AmbientColor"}, + {aiTextureType_EMISSIVE, "EmissiveColor"}, + {aiTextureType_HEIGHT, "Bump"}, + {aiTextureType_NORMALS, "NormalMap"}, + {aiTextureType_SHININESS, "ShininessExponent"}, + {aiTextureType_OPACITY, "TransparentColor"}, {aiTextureType_DISPLACEMENT, "DisplacementColor"}, //{aiTextureType_LIGHTMAP, "???"}, - {aiTextureType_REFLECTION, "ReflectionColor"} + {aiTextureType_REFLECTION, "ReflectionColor"} //{aiTextureType_UNKNOWN, ""} }; for (size_t i = 0; i < mScene->mNumMaterials; ++i) { @@ -1575,19 +1608,41 @@ void FBXExporter::WriteObjects () // one sticky point is that the number of vertices may not match, // because assimp splits vertices by normal, uv, etc. + // functor for aiNode sorting + struct SortNodeByName + { + bool operator()(const aiNode *lhs, const aiNode *rhs) const + { + return strcmp(lhs->mName.C_Str(), rhs->mName.C_Str()) < 0; + } + }; + // first we should mark the skeleton for each mesh. // the skeleton must include not only the aiBones, // but also all their parent nodes. // anything that affects the position of any bone node must be included. - std::vector<std::set<const aiNode*>> skeleton_by_mesh(mScene->mNumMeshes); + // Use SorNodeByName to make sure the exported result will be the same across all systems + // Otherwise the aiNodes of the skeleton would be sorted based on the pointer address, which isn't consistent + std::vector<std::set<const aiNode*, SortNodeByName>> skeleton_by_mesh(mScene->mNumMeshes); // at the same time we can build a list of all the skeleton nodes, // which will be used later to mark them as type "limbNode". std::unordered_set<const aiNode*> limbnodes; + + //actual bone nodes in fbx, without parenting-up + std::unordered_set<std::string> setAllBoneNamesInScene; + for(unsigned int m = 0; m < mScene->mNumMeshes; ++ m) + { + aiMesh* pMesh = mScene->mMeshes[m]; + for(unsigned int b = 0; b < pMesh->mNumBones; ++ b) + setAllBoneNamesInScene.insert(pMesh->mBones[b]->mName.data); + } + aiMatrix4x4 mxTransIdentity; + // and a map of nodes by bone name, as finding them is annoying. std::map<std::string,aiNode*> node_by_bone; for (size_t mi = 0; mi < mScene->mNumMeshes; ++mi) { const aiMesh* m = mScene->mMeshes[mi]; - std::set<const aiNode*> skeleton; + std::set<const aiNode*, SortNodeByName> skeleton; for (size_t bi =0; bi < m->mNumBones; ++bi) { const aiBone* b = m->mBones[bi]; const std::string name(b->mName.C_Str()); @@ -1626,6 +1681,11 @@ void FBXExporter::WriteObjects () if (node_name.find(MAGIC_NODE_TAG) != std::string::npos) { continue; } + //not a bone in scene && no effect in transform + if(setAllBoneNamesInScene.find(node_name)==setAllBoneNamesInScene.end() + && parent->mTransformation == mxTransIdentity) { + continue; + } // otherwise check if this is the root of the skeleton bool end = false; // is the mesh part of this node? @@ -1728,7 +1788,7 @@ void FBXExporter::WriteObjects () aiMatrix4x4 mesh_xform = get_world_transform(mesh_node, mScene); // now make a subdeformer for each bone in the skeleton - const std::set<const aiNode*> &skeleton = skeleton_by_mesh[mi]; + const std::set<const aiNode*, SortNodeByName> skeleton= skeleton_by_mesh[mi]; for (const aiNode* bone_node : skeleton) { // if there's a bone for this node, find it const aiBone* b = nullptr; @@ -1790,7 +1850,10 @@ void FBXExporter::WriteObjects () // this should be the same as the bone's mOffsetMatrix. // if it's not the same, the skeleton isn't in the bind pose. - const float epsilon = 1e-4f; // some error is to be expected + float epsilon = 1e-4f; // some error is to be expected + float epsilon_custom = mProperties->GetPropertyFloat("BINDPOSE_EPSILON", -1); + if(epsilon_custom > 0) + epsilon = epsilon_custom; bool bone_xform_okay = true; if (b && ! tr.Equal(b->mOffsetMatrix, epsilon)) { not_in_bind_pose.insert(b); @@ -2237,8 +2300,8 @@ void FBXExporter::WriteModelNode( // not sure what these are for, // but they seem to be omnipresent - m.AddChild("Shading", Property(true)); - m.AddChild("Culling", Property("CullingOff")); + m.AddChild("Shading", FBXExportProperty(true)); + m.AddChild("Culling", FBXExportProperty("CullingOff")); m.Dump(outstream, binary, 1); } @@ -2351,7 +2414,7 @@ void FBXExporter::WriteModelNodes( na.AddProperties( node_attribute_uid, FBX::SEPARATOR + "NodeAttribute", "LimbNode" ); - na.AddChild("TypeFlags", Property("Skeleton")); + na.AddChild("TypeFlags", FBXExportProperty("Skeleton")); na.Dump(outstream, binary, 1); // and connect them connections.emplace_back("C", "OO", node_attribute_uid, node_uid); diff --git a/thirdparty/assimp/code/FBXExporter.h b/thirdparty/assimp/code/FBX/FBXExporter.h index 71fb55c57f..71fb55c57f 100644 --- a/thirdparty/assimp/code/FBXExporter.h +++ b/thirdparty/assimp/code/FBX/FBXExporter.h diff --git a/thirdparty/assimp/code/FBXImportSettings.h b/thirdparty/assimp/code/FBX/FBXImportSettings.h index d5e1c20608..1a4c80f8b2 100644 --- a/thirdparty/assimp/code/FBXImportSettings.h +++ b/thirdparty/assimp/code/FBX/FBXImportSettings.h @@ -53,19 +53,22 @@ namespace FBX { struct ImportSettings { ImportSettings() - : strictMode(true) - , readAllLayers(true) - , readAllMaterials(false) - , readMaterials(true) - , readTextures(true) - , readCameras(true) - , readLights(true) - , readAnimations(true) - , readWeights(true) - , preservePivots(true) - , optimizeEmptyAnimationCurves(true) - , useLegacyEmbeddedTextureNaming(false) - {} + : strictMode(true) + , readAllLayers(true) + , readAllMaterials(false) + , readMaterials(true) + , readTextures(true) + , readCameras(true) + , readLights(true) + , readAnimations(true) + , readWeights(true) + , preservePivots(true) + , optimizeEmptyAnimationCurves(true) + , useLegacyEmbeddedTextureNaming(false) + , removeEmptyBones( true ) + , convertToMeters( false ) { + // empty + } /** enable strict mode: @@ -141,8 +144,16 @@ struct ImportSettings bool optimizeEmptyAnimationCurves; /** use legacy naming for embedded textures eg: (*0, *1, *2) - **/ + */ bool useLegacyEmbeddedTextureNaming; + + /** Empty bones shall be removed + */ + bool removeEmptyBones; + + /** Set to true to perform a conversion from cm to meter after the import + */ + bool convertToMeters; }; diff --git a/thirdparty/assimp/code/FBXImporter.cpp b/thirdparty/assimp/code/FBX/FBXImporter.cpp index 2cc8bffc29..ec8bbd2b47 100644 --- a/thirdparty/assimp/code/FBXImporter.cpp +++ b/thirdparty/assimp/code/FBX/FBXImporter.cpp @@ -140,6 +140,8 @@ void FBXImporter::SetupProperties(const Importer* pImp) 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); } // ------------------------------------------------------------------------------------------------ @@ -170,7 +172,7 @@ void FBXImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS bool is_binary = false; if (!strncmp(begin,"Kaydara FBX Binary",18)) { is_binary = true; - TokenizeBinary(tokens,begin,static_cast<unsigned int>(contents.size())); + TokenizeBinary(tokens,begin,contents.size()); } else { Tokenize(tokens,begin); @@ -183,8 +185,12 @@ void FBXImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS // 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); + ConvertToAssimpScene(pScene,doc, settings.removeEmptyBones, unit); std::for_each(tokens.begin(),tokens.end(),Util::delete_fun<Token>()); } diff --git a/thirdparty/assimp/code/FBXImporter.h b/thirdparty/assimp/code/FBX/FBXImporter.h index c365b2cddf..c365b2cddf 100644 --- a/thirdparty/assimp/code/FBXImporter.h +++ b/thirdparty/assimp/code/FBX/FBXImporter.h diff --git a/thirdparty/assimp/code/FBXMaterial.cpp b/thirdparty/assimp/code/FBX/FBXMaterial.cpp index f16f134404..f43a8b84b0 100644 --- a/thirdparty/assimp/code/FBXMaterial.cpp +++ b/thirdparty/assimp/code/FBX/FBXMaterial.cpp @@ -316,7 +316,7 @@ Video::Video(uint64_t id, const Element& element, const Document& doc, const std relativeFileName = ParseTokenAsString(GetRequiredToken(*RelativeFilename,0)); } - if(Content) { + if(Content && !Content->Tokens().empty()) { //this field is omitted when the embedded texture is already loaded, let's ignore if it's not found try { const Token& token = GetRequiredToken(*Content, 0); @@ -326,16 +326,40 @@ Video::Video(uint64_t id, const Element& element, const Document& doc, const std DOMError("embedded content is not surrounded by quotation marks", &element); } else { - const char* encodedData = data + 1; - size_t encodedDataLen = static_cast<size_t>(token.end() - token.begin()); - // search for last quotation mark - while (encodedDataLen > 1 && encodedData[encodedDataLen] != '"') - encodedDataLen--; - if (encodedDataLen % 4 != 0) { - DOMError("embedded content is invalid, needs to be in base64", &element); + size_t targetLength = 0; + auto numTokens = Content->Tokens().size(); + // First time compute size (it could be large like 64Gb and it is good to allocate it once) + for (uint32_t tokenIdx = 0; tokenIdx < numTokens; ++tokenIdx) + { + const Token& dataToken = GetRequiredToken(*Content, tokenIdx); + size_t tokenLength = dataToken.end() - dataToken.begin() - 2; // ignore double quotes + const char* base64data = dataToken.begin() + 1; + const size_t outLength = Util::ComputeDecodedSizeBase64(base64data, tokenLength); + if (outLength == 0) + { + DOMError("Corrupted embedded content found", &element); + } + targetLength += outLength; } - else { - contentLength = Util::DecodeBase64(encodedData, encodedDataLen, content); + if (targetLength == 0) + { + DOMError("Corrupted embedded content found", &element); + } + content = new uint8_t[targetLength]; + contentLength = static_cast<uint64_t>(targetLength); + size_t dst_offset = 0; + for (uint32_t tokenIdx = 0; tokenIdx < numTokens; ++tokenIdx) + { + const Token& dataToken = GetRequiredToken(*Content, tokenIdx); + size_t tokenLength = dataToken.end() - dataToken.begin() - 2; // ignore double quotes + const char* base64data = dataToken.begin() + 1; + dst_offset += Util::DecodeBase64(base64data, tokenLength, content + dst_offset, targetLength - dst_offset); + } + if (targetLength != dst_offset) + { + delete[] content; + contentLength = 0; + DOMError("Corrupted embedded content found", &element); } } } diff --git a/thirdparty/assimp/code/FBXMeshGeometry.cpp b/thirdparty/assimp/code/FBX/FBXMeshGeometry.cpp index d75476b826..44a0264ca0 100644 --- a/thirdparty/assimp/code/FBXMeshGeometry.cpp +++ b/thirdparty/assimp/code/FBX/FBXMeshGeometry.cpp @@ -568,15 +568,15 @@ void MeshGeometry::ReadVertexDataColors(std::vector<aiColor4D>& colors_out, cons } // ------------------------------------------------------------------------------------------------ -static const std::string TangentIndexToken = "TangentIndex"; -static const std::string TangentsIndexToken = "TangentsIndex"; +static const char *TangentIndexToken = "TangentIndex"; +static const char *TangentsIndexToken = "TangentsIndex"; void MeshGeometry::ReadVertexDataTangents(std::vector<aiVector3D>& tangents_out, const Scope& source, const std::string& MappingInformationType, const std::string& ReferenceInformationType) { const char * str = source.Elements().count( "Tangents" ) > 0 ? "Tangents" : "Tangent"; - const char * strIdx = source.Elements().count( "Tangents" ) > 0 ? TangentsIndexToken.c_str() : TangentIndexToken.c_str(); + const char * strIdx = source.Elements().count( "Tangents" ) > 0 ? TangentsIndexToken : TangentIndexToken; ResolveVertexDataArray(tangents_out,source,MappingInformationType,ReferenceInformationType, str, strIdx, @@ -630,10 +630,11 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons materials_out.clear(); } - m_materials.assign(m_vertices.size(),materials_out[0]); + materials_out.resize(m_vertices.size()); + std::fill(materials_out.begin(), materials_out.end(), materials_out.at(0)); } else if (MappingInformationType == "ByPolygon" && ReferenceInformationType == "IndexToDirect") { - m_materials.resize(face_count); + materials_out.resize(face_count); if(materials_out.size() != face_count) { FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygon mapping: ") diff --git a/thirdparty/assimp/code/FBXMeshGeometry.h b/thirdparty/assimp/code/FBX/FBXMeshGeometry.h index d6d4512177..d6d4512177 100644 --- a/thirdparty/assimp/code/FBXMeshGeometry.h +++ b/thirdparty/assimp/code/FBX/FBXMeshGeometry.h diff --git a/thirdparty/assimp/code/FBXModel.cpp b/thirdparty/assimp/code/FBX/FBXModel.cpp index 589af36ac7..589af36ac7 100644 --- a/thirdparty/assimp/code/FBXModel.cpp +++ b/thirdparty/assimp/code/FBX/FBXModel.cpp diff --git a/thirdparty/assimp/code/FBXNodeAttribute.cpp b/thirdparty/assimp/code/FBX/FBXNodeAttribute.cpp index b72e5637ee..b72e5637ee 100644 --- a/thirdparty/assimp/code/FBXNodeAttribute.cpp +++ b/thirdparty/assimp/code/FBX/FBXNodeAttribute.cpp diff --git a/thirdparty/assimp/code/FBXParser.cpp b/thirdparty/assimp/code/FBX/FBXParser.cpp index b255c47347..4a9346040d 100644 --- a/thirdparty/assimp/code/FBXParser.cpp +++ b/thirdparty/assimp/code/FBX/FBXParser.cpp @@ -117,7 +117,7 @@ namespace FBX { Element::Element(const Token& key_token, Parser& parser) : key_token(key_token) { - TokenPtr n = NULL; + TokenPtr n = nullptr; do { n = parser.AdvanceToNextToken(); if(!n) { @@ -643,9 +643,9 @@ void ParseVectorDataArray(std::vector<aiVector3D>& out, const Element& el) if (type == 'd') { const double* d = reinterpret_cast<const double*>(&buff[0]); for (unsigned int i = 0; i < count3; ++i, d += 3) { - out.push_back(aiVector3D(static_cast<float>(d[0]), - static_cast<float>(d[1]), - static_cast<float>(d[2]))); + out.push_back(aiVector3D(static_cast<ai_real>(d[0]), + static_cast<ai_real>(d[1]), + static_cast<ai_real>(d[2]))); } // for debugging /*for ( size_t i = 0; i < out.size(); i++ ) { @@ -963,7 +963,6 @@ void ParseVectorDataArray(std::vector<float>& out, const Element& el) } } - // ------------------------------------------------------------------------------------------------ // read an array of uints void ParseVectorDataArray(std::vector<unsigned int>& out, const Element& el) @@ -1280,7 +1279,6 @@ float ParseTokenAsFloat(const Token& t) return i; } - // ------------------------------------------------------------------------------------------------ // wrapper around ParseTokenAsInt() with ParseError handling int ParseTokenAsInt(const Token& t) @@ -1293,8 +1291,6 @@ int ParseTokenAsInt(const Token& t) return i; } - - // ------------------------------------------------------------------------------------------------ // wrapper around ParseTokenAsInt64() with ParseError handling int64_t ParseTokenAsInt64(const Token& t) diff --git a/thirdparty/assimp/code/FBXParser.h b/thirdparty/assimp/code/FBX/FBXParser.h index 7b0cf72039..7b0cf72039 100644 --- a/thirdparty/assimp/code/FBXParser.h +++ b/thirdparty/assimp/code/FBX/FBXParser.h diff --git a/thirdparty/assimp/code/FBXProperties.cpp b/thirdparty/assimp/code/FBX/FBXProperties.cpp index 8d7036b6a9..8d7036b6a9 100644 --- a/thirdparty/assimp/code/FBXProperties.cpp +++ b/thirdparty/assimp/code/FBX/FBXProperties.cpp diff --git a/thirdparty/assimp/code/FBXProperties.h b/thirdparty/assimp/code/FBX/FBXProperties.h index 58755542fc..58755542fc 100644 --- a/thirdparty/assimp/code/FBXProperties.h +++ b/thirdparty/assimp/code/FBX/FBXProperties.h diff --git a/thirdparty/assimp/code/FBXTokenizer.cpp b/thirdparty/assimp/code/FBX/FBXTokenizer.cpp index 252cce3557..252cce3557 100644 --- a/thirdparty/assimp/code/FBXTokenizer.cpp +++ b/thirdparty/assimp/code/FBX/FBXTokenizer.cpp diff --git a/thirdparty/assimp/code/FBXTokenizer.h b/thirdparty/assimp/code/FBX/FBXTokenizer.h index 2af29743f4..afa588a470 100644 --- a/thirdparty/assimp/code/FBXTokenizer.h +++ b/thirdparty/assimp/code/FBX/FBXTokenizer.h @@ -93,7 +93,7 @@ public: Token(const char* sbegin, const char* send, TokenType type, unsigned int line, unsigned int column); /** construct a binary token */ - Token(const char* sbegin, const char* send, TokenType type, unsigned int offset); + Token(const char* sbegin, const char* send, TokenType type, size_t offset); ~Token(); @@ -118,14 +118,14 @@ public: return type; } - unsigned int Offset() const { + size_t Offset() const { ai_assert(IsBinary()); return offset; } unsigned int Line() const { ai_assert(!IsBinary()); - return line; + return static_cast<unsigned int>(line); } unsigned int Column() const { @@ -147,8 +147,8 @@ private: const TokenType type; union { - const unsigned int line; - unsigned int offset; + size_t line; + size_t offset; }; const unsigned int column; }; @@ -178,7 +178,7 @@ void Tokenize(TokenList& output_tokens, const char* input); * @param input_buffer Binary input buffer to be processed. * @param length Length of input buffer, in bytes. There is no 0-terminal. * @throw DeadlyImportError if something goes wrong */ -void TokenizeBinary(TokenList& output_tokens, const char* input, unsigned int length); +void TokenizeBinary(TokenList& output_tokens, const char* input, size_t length); } // ! FBX diff --git a/thirdparty/assimp/code/FBXUtil.cpp b/thirdparty/assimp/code/FBX/FBXUtil.cpp index fb483161b2..c10e057c8c 100644 --- a/thirdparty/assimp/code/FBXUtil.cpp +++ b/thirdparty/assimp/code/FBX/FBXUtil.cpp @@ -86,7 +86,7 @@ const char* TokenTypeString(TokenType t) // ------------------------------------------------------------------------------------------------ -std::string AddOffset(const std::string& prefix, const std::string& text, unsigned int offset) +std::string AddOffset(const std::string& prefix, const std::string& text, size_t offset) { return static_cast<std::string>( (Formatter::format() << prefix << " (offset 0x" << std::hex << offset << ") " << text) ); } @@ -114,47 +114,126 @@ std::string AddTokenText(const std::string& prefix, const std::string& text, con text) ); } +// Generated by this formula: T["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]] = i; static const uint8_t base64DecodeTable[128] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 64, 0, 0, - 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, - 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0 + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 255, 255, 255, + 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, + 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 255, 255, 255, 255, 255 }; uint8_t DecodeBase64(char ch) { - return base64DecodeTable[size_t(ch)]; + const auto idx = static_cast<uint8_t>(ch); + if (idx > 127) + return 255; + return base64DecodeTable[idx]; } -size_t DecodeBase64(const char* in, size_t inLength, uint8_t*& out) +size_t ComputeDecodedSizeBase64(const char* in, size_t inLength) { - if (inLength < 4) { - out = 0; + if (inLength < 2) + { + return 0; + } + const size_t equals = size_t(in[inLength - 1] == '=') + size_t(in[inLength - 2] == '='); + const size_t full_length = (inLength * 3) >> 2; // div by 4 + if (full_length < equals) + { + return 0; + } + return full_length - equals; +} + +size_t DecodeBase64(const char* in, size_t inLength, uint8_t* out, size_t maxOutLength) +{ + if (maxOutLength == 0 || inLength < 2) { return 0; } + const size_t realLength = inLength - size_t(in[inLength - 1] == '=') - size_t(in[inLength - 2] == '='); + size_t dst_offset = 0; + int val = 0, valb = -8; + for (size_t src_offset = 0; src_offset < realLength; ++src_offset) + { + const uint8_t table_value = Util::DecodeBase64(in[src_offset]); + if (table_value == 255) + { + return 0; + } + val = (val << 6) + table_value; + valb += 6; + if (valb >= 0) + { + out[dst_offset++] = static_cast<uint8_t>((val >> valb) & 0xFF); + valb -= 8; + val &= 0xFFF; + } + } + return dst_offset; +} - const size_t outLength = (inLength * 3) / 4; - out = new uint8_t[outLength]; - memset(out, 0, outLength); +static const char to_base64_string[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +char EncodeBase64(char byte) +{ + return to_base64_string[(size_t)byte]; +} - size_t i = 0; - size_t j = 0; - for (i = 0; i < inLength - 4; i += 4) +/** Encodes a block of 4 bytes to base64 encoding +* +* @param bytes Bytes to encode. +* @param out_string String to write encoded values to. +* @param string_pos Position in out_string.*/ +void EncodeByteBlock(const char* bytes, std::string& out_string, size_t string_pos) +{ + char b0 = (bytes[0] & 0xFC) >> 2; + char b1 = (bytes[0] & 0x03) << 4 | ((bytes[1] & 0xF0) >> 4); + char b2 = (bytes[1] & 0x0F) << 2 | ((bytes[2] & 0xC0) >> 6); + char b3 = (bytes[2] & 0x3F); + + out_string[string_pos + 0] = EncodeBase64(b0); + out_string[string_pos + 1] = EncodeBase64(b1); + out_string[string_pos + 2] = EncodeBase64(b2); + out_string[string_pos + 3] = EncodeBase64(b3); +} + +std::string EncodeBase64(const char* data, size_t length) +{ + // calculate extra bytes needed to get a multiple of 3 + size_t extraBytes = 3 - length % 3; + + // number of base64 bytes + size_t encodedBytes = 4 * (length + extraBytes) / 3; + + std::string encoded_string(encodedBytes, '='); + + // read blocks of 3 bytes + for (size_t ib3 = 0; ib3 < length / 3; ib3++) { - uint8_t b0 = Util::DecodeBase64(in[i]); - uint8_t b1 = Util::DecodeBase64(in[i + 1]); - uint8_t b2 = Util::DecodeBase64(in[i + 2]); - uint8_t b3 = Util::DecodeBase64(in[i + 3]); - - out[j++] = (uint8_t)((b0 << 2) | (b1 >> 4)); - out[j++] = (uint8_t)((b1 << 4) | (b2 >> 2)); - out[j++] = (uint8_t)((b2 << 6) | b3); + const size_t iByte = ib3 * 3; + const size_t iEncodedByte = ib3 * 4; + const char* currData = &data[iByte]; + + EncodeByteBlock(currData, encoded_string, iEncodedByte); + } + + // if size of data is not a multiple of 3, also encode the final bytes (and add zeros where needed) + if (extraBytes > 0) + { + char finalBytes[4] = { 0,0,0,0 }; + memcpy(&finalBytes[0], &data[length - length % 3], length % 3); + + const size_t iEncodedByte = encodedBytes - 4; + EncodeByteBlock(&finalBytes[0], encoded_string, iEncodedByte); + + // add '=' at the end + for (size_t i = 0; i < 4 * extraBytes / 3; i++) + encoded_string[encodedBytes - i - 1] = '='; } - return outLength; + return encoded_string; } } // !Util diff --git a/thirdparty/assimp/code/FBXUtil.h b/thirdparty/assimp/code/FBX/FBXUtil.h index 6890e015ba..b634418858 100644 --- a/thirdparty/assimp/code/FBXUtil.h +++ b/thirdparty/assimp/code/FBX/FBXUtil.h @@ -78,7 +78,7 @@ const char* TokenTypeString(TokenType t); * @param line Line index, 1-based * @param column Column index, 1-based * @return A string of the following format: {prefix} (offset 0x{offset}) {text}*/ -std::string AddOffset(const std::string& prefix, const std::string& text, unsigned int offset); +std::string AddOffset(const std::string& prefix, const std::string& text, size_t offset); /** Format log/error messages using a given line location in the source file. @@ -105,13 +105,30 @@ std::string AddTokenText(const std::string& prefix, const std::string& text, con * @return decoded byte value*/ uint8_t DecodeBase64(char ch); +/** Compute decoded size of a Base64-encoded string +* +* @param in Characters to decode. +* @param inLength Number of characters to decode. +* @return size of the decoded data (number of bytes)*/ +size_t ComputeDecodedSizeBase64(const char* in, size_t inLength); + /** Decode a Base64-encoded string * * @param in Characters to decode. * @param inLength Number of characters to decode. -* @param out Reference to pointer where we will store the decoded data. +* @param out Pointer where we will store the decoded data. +* @param maxOutLength Size of output buffer. * @return size of the decoded data (number of bytes)*/ -size_t DecodeBase64(const char* in, size_t inLength, uint8_t*& out); +size_t DecodeBase64(const char* in, size_t inLength, uint8_t* out, size_t maxOutLength); + +char EncodeBase64(char byte); + +/** Encode bytes in base64-encoding +* +* @param data Binary data to encode. +* @param inLength Number of bytes to encode. +* @return base64-encoded string*/ +std::string EncodeBase64(const char* data, size_t length); } } diff --git a/thirdparty/assimp/code/FIReader.cpp b/thirdparty/assimp/code/FIReader.cpp deleted file mode 100644 index 2116316ca3..0000000000 --- a/thirdparty/assimp/code/FIReader.cpp +++ /dev/null @@ -1,1834 +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. - ----------------------------------------------------------------------- -*/ -/// \file FIReader.cpp -/// \brief Reader for Fast Infoset encoded binary XML files. -/// \date 2017 -/// \author Patrick Daehne - -#ifndef ASSIMP_BUILD_NO_X3D_IMPORTER - -#include "FIReader.hpp" -#include <assimp/StringUtils.h> - -// Workaround for issue #1361 -// https://github.com/assimp/assimp/issues/1361 -#ifdef __ANDROID__ -# define _GLIBCXX_USE_C99 1 -#endif - -#include <assimp/Exceptional.h> -#include <assimp/IOStream.hpp> -#include <assimp/types.h> -#include <assimp/MemoryIOWrapper.h> -#include <assimp/irrXMLWrapper.h> -#include "../contrib/utf8cpp/source/utf8.h" -#include <assimp/fast_atof.h> -#include <stack> -#include <map> -#include <iostream> -#include <sstream> -#include <iomanip> - -namespace Assimp { - -static const std::string parseErrorMessage = "Fast Infoset parse error"; - -static const char *xmlDeclarations[] = { - "<?xml encoding='finf'?>", - "<?xml encoding='finf' standalone='yes'?>", - "<?xml encoding='finf' standalone='no'?>", - "<?xml version='1.0' encoding='finf'?>", - "<?xml version='1.0' encoding='finf' standalone='yes'?>", - "<?xml version='1.0' encoding='finf' standalone='no'?>", - "<?xml version='1.1' encoding='finf'?>", - "<?xml version='1.1' encoding='finf' standalone='yes'?>", - "<?xml version='1.1' encoding='finf' standalone='no'?>" -}; - -static size_t parseMagic(const uint8_t *data, const uint8_t *dataEnd) { - if (dataEnd - data < 4) { - return 0; - } - uint32_t magic = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; - switch (magic) { - case 0xe0000001: - return 4; - case 0x3c3f786d: // "<?xm" - { - size_t xmlDeclarationsLength = sizeof(xmlDeclarations) / sizeof(xmlDeclarations[0]); - for (size_t i = 0; i < xmlDeclarationsLength; ++i) { - auto xmlDeclaration = xmlDeclarations[i]; - ptrdiff_t xmlDeclarationLength = strlen(xmlDeclaration); - if ((dataEnd - data >= xmlDeclarationLength) && (memcmp(xmlDeclaration, data, xmlDeclarationLength) == 0)) { - data += xmlDeclarationLength; - if (dataEnd - data < 4) { - return 0; - } - magic = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; - return magic == 0xe0000001 ? xmlDeclarationLength + 4 : 0; - } - } - return 0; - } - default: - return 0; - } -} - -static std::string parseUTF8String(const uint8_t *data, size_t len) { - return std::string((char*)data, len); -} - -static std::string parseUTF16String(const uint8_t *data, size_t len) { - if (len & 1) { - throw DeadlyImportError(parseErrorMessage); - } - size_t numShorts = len / 2; - std::vector<short> utf16; - utf16.reserve(numShorts); - for (size_t i = 0; i < numShorts; ++i) { - short v = (data[0] << 8) | data[1]; - utf16.push_back(v); - data += 2; - } - std::string result; - utf8::utf16to8(utf16.begin(), utf16.end(), back_inserter(result)); - return result; -} - -struct FIStringValueImpl: public FIStringValue { - inline FIStringValueImpl(std::string &&value_) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { return value; } -}; - -std::shared_ptr<FIStringValue> FIStringValue::create(std::string &&value) { - return std::make_shared<FIStringValueImpl>(std::move(value)); -} - -struct FIHexValueImpl: public FIHexValue { - mutable std::string strValue; - mutable bool strValueValid; - inline FIHexValueImpl(std::vector<uint8_t> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - os << std::hex << std::uppercase << std::setfill('0'); - std::for_each(value.begin(), value.end(), [&](uint8_t c) { os << std::setw(2) << static_cast<int>(c); }); - strValue = os.str(); - } - return strValue; - }; -}; - -std::shared_ptr<FIHexValue> FIHexValue::create(std::vector<uint8_t> &&value) { - return std::make_shared<FIHexValueImpl>(std::move(value)); -} - -struct FIBase64ValueImpl: public FIBase64Value { - mutable std::string strValue; - mutable bool strValueValid; - inline FIBase64ValueImpl(std::vector<uint8_t> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - uint8_t c1 = 0, c2; - int imod3 = 0; - std::vector<uint8_t>::size_type valueSize = value.size(); - for (std::vector<uint8_t>::size_type i = 0; i < valueSize; ++i) { - c2 = value[i]; - switch (imod3) { - case 0: - os << basis_64[c2 >> 2]; - imod3 = 1; - break; - case 1: - os << basis_64[((c1 & 0x03) << 4) | ((c2 & 0xf0) >> 4)]; - imod3 = 2; - break; - case 2: - os << basis_64[((c1 & 0x0f) << 2) | ((c2 & 0xc0) >> 6)] << basis_64[c2 & 0x3f]; - imod3 = 0; - break; - } - c1 = c2; - } - switch (imod3) { - case 1: - os << basis_64[(c1 & 0x03) << 4] << "=="; - break; - case 2: - os << basis_64[(c1 & 0x0f) << 2] << '='; - break; - } - strValue = os.str(); - } - return strValue; - }; - static const char basis_64[]; -}; - -const char FIBase64ValueImpl::basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -std::shared_ptr<FIBase64Value> FIBase64Value::create(std::vector<uint8_t> &&value) { - return std::make_shared<FIBase64ValueImpl>(std::move(value)); -} - -struct FIShortValueImpl: public FIShortValue { - mutable std::string strValue; - mutable bool strValueValid; - inline FIShortValueImpl(std::vector<int16_t> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - int n = 0; - std::for_each(value.begin(), value.end(), [&](int16_t s) { if (++n > 1) os << ' '; os << s; }); - strValue = os.str(); - } - return strValue; - } -}; - -std::shared_ptr<FIShortValue> FIShortValue::create(std::vector<int16_t> &&value) { - return std::make_shared<FIShortValueImpl>(std::move(value)); -} - -struct FIIntValueImpl: public FIIntValue { - mutable std::string strValue; - mutable bool strValueValid; - inline FIIntValueImpl(std::vector<int32_t> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - int n = 0; - std::for_each(value.begin(), value.end(), [&](int32_t i) { if (++n > 1) os << ' '; os << i; }); - strValue = os.str(); - } - return strValue; - }; -}; - -std::shared_ptr<FIIntValue> FIIntValue::create(std::vector<int32_t> &&value) { - return std::make_shared<FIIntValueImpl>(std::move(value)); -} - -struct FILongValueImpl: public FILongValue { - mutable std::string strValue; - mutable bool strValueValid; - inline FILongValueImpl(std::vector<int64_t> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - int n = 0; - std::for_each(value.begin(), value.end(), [&](int64_t l) { if (++n > 1) os << ' '; os << l; }); - strValue = os.str(); - } - return strValue; - }; -}; - -std::shared_ptr<FILongValue> FILongValue::create(std::vector<int64_t> &&value) { - return std::make_shared<FILongValueImpl>(std::move(value)); -} - -struct FIBoolValueImpl: public FIBoolValue { - mutable std::string strValue; - mutable bool strValueValid; - inline FIBoolValueImpl(std::vector<bool> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - os << std::boolalpha; - int n = 0; - std::for_each(value.begin(), value.end(), [&](bool b) { if (++n > 1) os << ' '; os << b; }); - strValue = os.str(); - } - return strValue; - }; -}; - -std::shared_ptr<FIBoolValue> FIBoolValue::create(std::vector<bool> &&value) { - return std::make_shared<FIBoolValueImpl>(std::move(value)); -} - -struct FIFloatValueImpl: public FIFloatValue { - mutable std::string strValue; - mutable bool strValueValid; - inline FIFloatValueImpl(std::vector<float> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - int n = 0; - std::for_each(value.begin(), value.end(), [&](float f) { if (++n > 1) os << ' '; os << f; }); - strValue = os.str(); - } - return strValue; - } -}; - -std::shared_ptr<FIFloatValue> FIFloatValue::create(std::vector<float> &&value) { - return std::make_shared<FIFloatValueImpl>(std::move(value)); -} - -struct FIDoubleValueImpl: public FIDoubleValue { - mutable std::string strValue; - mutable bool strValueValid; - inline FIDoubleValueImpl(std::vector<double> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - int n = 0; - std::for_each(value.begin(), value.end(), [&](double d) { if (++n > 1) os << ' '; os << d; }); - strValue = os.str(); - } - return strValue; - } -}; - -std::shared_ptr<FIDoubleValue> FIDoubleValue::create(std::vector<double> &&value) { - return std::make_shared<FIDoubleValueImpl>(std::move(value)); -} - -struct FIUUIDValueImpl: public FIUUIDValue { - mutable std::string strValue; - mutable bool strValueValid; - inline FIUUIDValueImpl(std::vector<uint8_t> &&value_): strValueValid(false) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { - if (!strValueValid) { - strValueValid = true; - std::ostringstream os; - os << std::hex << std::uppercase << std::setfill('0'); - std::vector<uint8_t>::size_type valueSize = value.size(); - for (std::vector<uint8_t>::size_type i = 0; i < valueSize; ++i) { - switch (i & 15) { - case 0: - if (i > 0) { - os << ' '; - } - os << std::setw(2) << static_cast<int>(value[i]); - break; - case 4: - case 6: - case 8: - case 10: - os << '-'; - // intentionally fall through! - case 1: - case 2: - case 3: - case 5: - case 7: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: - os << std::setw(2) << static_cast<int>(value[i]); - break; - } - } - strValue = os.str(); - } - return strValue; - }; -}; - -std::shared_ptr<FIUUIDValue> FIUUIDValue::create(std::vector<uint8_t> &&value) { - return std::make_shared<FIUUIDValueImpl>(std::move(value)); -} - -struct FICDATAValueImpl: public FICDATAValue { - inline FICDATAValueImpl(std::string &&value_) { value = std::move(value_); } - virtual const std::string &toString() const /*override*/ { return value; } -}; - -std::shared_ptr<FICDATAValue> FICDATAValue::create(std::string &&value) { - return std::make_shared<FICDATAValueImpl>(std::move(value)); -} - -struct FIHexDecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - return FIHexValue::create(std::vector<uint8_t>(data, data + len)); - } -}; - -struct FIBase64Decoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - return FIBase64Value::create(std::vector<uint8_t>(data, data + len)); - } -}; - -struct FIShortDecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - if (len & 1) { - throw DeadlyImportError(parseErrorMessage); - } - std::vector<int16_t> value; - size_t numShorts = len / 2; - value.reserve(numShorts); - for (size_t i = 0; i < numShorts; ++i) { - int16_t v = (data[0] << 8) | data[1]; - value.push_back(v); - data += 2; - } - return FIShortValue::create(std::move(value)); - } -}; - -struct FIIntDecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - if (len & 3) { - throw DeadlyImportError(parseErrorMessage); - } - std::vector<int32_t> value; - size_t numInts = len / 4; - value.reserve(numInts); - for (size_t i = 0; i < numInts; ++i) { - int32_t v = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; - value.push_back(v); - data += 4; - } - return FIIntValue::create(std::move(value)); - } -}; - -struct FILongDecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - if (len & 7) { - throw DeadlyImportError(parseErrorMessage); - } - std::vector<int64_t> value; - size_t numLongs = len / 8; - value.reserve(numLongs); - for (size_t i = 0; i < numLongs; ++i) { - int64_t b0 = data[0], b1 = data[1], b2 = data[2], b3 = data[3], b4 = data[4], b5 = data[5], b6 = data[6], b7 = data[7]; - int64_t v = (b0 << 56) | (b1 << 48) | (b2 << 40) | (b3 << 32) | (b4 << 24) | (b5 << 16) | (b6 << 8) | b7; - value.push_back(v); - data += 8; - } - return FILongValue::create(std::move(value)); - } -}; - -struct FIBoolDecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - if (len < 1) { - throw DeadlyImportError(parseErrorMessage); - } - std::vector<bool> value; - uint8_t b = *data++; - size_t unusedBits = b >> 4; - size_t numBools = (len * 8) - 4 - unusedBits; - value.reserve(numBools); - uint8_t mask = 1 << 3; - for (size_t i = 0; i < numBools; ++i) { - if (!mask) { - mask = 1 << 7; - b = *data++; - } - value.push_back((b & mask) != 0); - } - return FIBoolValue::create(std::move(value)); - } -}; - -struct FIFloatDecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - if (len & 3) { - throw DeadlyImportError(parseErrorMessage); - } - std::vector<float> value; - size_t numFloats = len / 4; - value.reserve(numFloats); - for (size_t i = 0; i < numFloats; ++i) { - int v = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; - float f; - memcpy(&f, &v, 4); - value.push_back(f); - data += 4; - } - return FIFloatValue::create(std::move(value)); - } -}; - -struct FIDoubleDecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - if (len & 7) { - throw DeadlyImportError(parseErrorMessage); - } - std::vector<double> value; - size_t numDoubles = len / 8; - value.reserve(numDoubles); - for (size_t i = 0; i < numDoubles; ++i) { - long long b0 = data[0], b1 = data[1], b2 = data[2], b3 = data[3], b4 = data[4], b5 = data[5], b6 = data[6], b7 = data[7]; - long long v = (b0 << 56) | (b1 << 48) | (b2 << 40) | (b3 << 32) | (b4 << 24) | (b5 << 16) | (b6 << 8) | b7; - double f; - memcpy(&f, &v, 8); - value.push_back(f); - data += 8; - } - return FIDoubleValue::create(std::move(value)); - } -}; - -struct FIUUIDDecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - if (len & 15) { - throw DeadlyImportError(parseErrorMessage); - } - return FIUUIDValue::create(std::vector<uint8_t>(data, data + len)); - } -}; - -struct FICDATADecoder: public FIDecoder { - virtual std::shared_ptr<const FIValue> decode(const uint8_t *data, size_t len) /*override*/ { - return FICDATAValue::create(parseUTF8String(data, len)); - } -}; - -class CFIReaderImpl: public FIReader { -public: - - CFIReaderImpl(std::unique_ptr<uint8_t[]> data_, size_t size): - data(std::move(data_)), dataP(data.get()), dataEnd(data.get() + size), currentNodeType(irr::io::EXN_NONE), - emptyElement(false), headerPending(true), terminatorPending(false) - {} - - virtual ~CFIReaderImpl() {} - - virtual bool read() /*override*/ { - if (headerPending) { - headerPending = false; - parseHeader(); - } - if (terminatorPending) { - terminatorPending = false; - if (elementStack.empty()) { - return false; - } - else { - nodeName = elementStack.top(); - elementStack.pop(); - currentNodeType = nodeName.empty() ? irr::io::EXN_UNKNOWN : irr::io::EXN_ELEMENT_END; - return true; - } - } - if (dataP >= dataEnd) { - return false; - } - uint8_t b = *dataP; - if (b < 0x80) { // Element (C.2.11.2, C.3.7.2) - // C.3 - parseElement(); - return true; - } - else if (b < 0xc0) { // Characters (C.3.7.5) - // C.7 - auto chars = parseNonIdentifyingStringOrIndex3(vocabulary.charactersTable); - nodeName = chars->toString(); - currentNodeType = irr::io::EXN_TEXT; - return true; - } - else if (b < 0xe0) { - if ((b & 0xfc) == 0xc4) { // DTD (C.2.11.5) - // C.9 - ++dataP; - if (b & 0x02) { - /*const std::string &systemID =*/ parseIdentifyingStringOrIndex(vocabulary.otherURITable); - } - if (b & 0x01) { - /*const std::string &publicID =*/ parseIdentifyingStringOrIndex(vocabulary.otherURITable); - } - elementStack.push(EmptyString); - currentNodeType = irr::io::EXN_UNKNOWN; - return true; - } - else if ((b & 0xfc) == 0xc8) { // Unexpanded entity reference (C.3.7.4) - // C.6 - ++dataP; - /*const std::string &name =*/ parseIdentifyingStringOrIndex(vocabulary.otherNCNameTable); - if (b & 0x02) { - /*const std::string &systemID =*/ parseIdentifyingStringOrIndex(vocabulary.otherURITable); - } - if (b & 0x01) { - /*const std::string &publicID =*/ parseIdentifyingStringOrIndex(vocabulary.otherURITable); - } - currentNodeType = irr::io::EXN_UNKNOWN; - return true; - } - } - else if (b < 0xf0) { - if (b == 0xe1) { // Processing instruction (C.2.11.3, C.3.7.3) - // C.5 - ++dataP; - /*const std::string &target =*/ parseIdentifyingStringOrIndex(vocabulary.otherNCNameTable); - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - /*std::shared_ptr<const FIValue> data =*/ parseNonIdentifyingStringOrIndex1(vocabulary.otherStringTable); - currentNodeType = irr::io::EXN_UNKNOWN; - return true; - } - else if (b == 0xe2) { // Comment (C.2.11.4, C.3.7.6) - // C.8 - ++dataP; - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - std::shared_ptr<const FIValue> comment = parseNonIdentifyingStringOrIndex1(vocabulary.otherStringTable); - nodeName = comment->toString(); - currentNodeType = irr::io::EXN_COMMENT; - return true; - } - } - else { // Terminator (C.2.12, C.3.8) - ++dataP; - if (b == 0xff) { - terminatorPending = true; - } - if (elementStack.empty()) { - return false; - } - else { - nodeName = elementStack.top(); - elementStack.pop(); - currentNodeType = nodeName.empty() ? irr::io::EXN_UNKNOWN : irr::io::EXN_ELEMENT_END; - return true; - } - } - throw DeadlyImportError(parseErrorMessage); - } - - virtual irr::io::EXML_NODE getNodeType() const /*override*/ { - return currentNodeType; - } - - virtual int getAttributeCount() const /*override*/ { - return static_cast<int>(attributes.size()); - } - - virtual const char* getAttributeName(int idx) const /*override*/ { - if (idx < 0 || idx >= (int)attributes.size()) { - return nullptr; - } - return attributes[idx].name.c_str(); - } - - virtual const char* getAttributeValue(int idx) const /*override*/ { - if (idx < 0 || idx >= (int)attributes.size()) { - return nullptr; - } - return attributes[idx].value->toString().c_str(); - } - - virtual const char* getAttributeValue(const char* name) const /*override*/ { - const Attribute* attr = getAttributeByName(name); - if (!attr) { - return nullptr; - } - return attr->value->toString().c_str(); - } - - virtual const char* getAttributeValueSafe(const char* name) const /*override*/ { - const Attribute* attr = getAttributeByName(name); - if (!attr) { - return EmptyString.c_str(); - } - return attr->value->toString().c_str(); - } - - virtual int getAttributeValueAsInt(const char* name) const /*override*/ { - const Attribute* attr = getAttributeByName(name); - if (!attr) { - return 0; - } - std::shared_ptr<const FIIntValue> intValue = std::dynamic_pointer_cast<const FIIntValue>(attr->value); - if (intValue) { - return intValue->value.size() == 1 ? intValue->value.front() : 0; - } - return atoi(attr->value->toString().c_str()); - } - - virtual int getAttributeValueAsInt(int idx) const /*override*/ { - if (idx < 0 || idx >= (int)attributes.size()) { - return 0; - } - std::shared_ptr<const FIIntValue> intValue = std::dynamic_pointer_cast<const FIIntValue>(attributes[idx].value); - if (intValue) { - return intValue->value.size() == 1 ? intValue->value.front() : 0; - } - return atoi(attributes[idx].value->toString().c_str()); - } - - virtual float getAttributeValueAsFloat(const char* name) const /*override*/ { - const Attribute* attr = getAttributeByName(name); - if (!attr) { - return 0; - } - std::shared_ptr<const FIFloatValue> floatValue = std::dynamic_pointer_cast<const FIFloatValue>(attr->value); - if (floatValue) { - return floatValue->value.size() == 1 ? floatValue->value.front() : 0; - } - - return fast_atof(attr->value->toString().c_str()); - } - - virtual float getAttributeValueAsFloat(int idx) const /*override*/ { - if (idx < 0 || idx >= (int)attributes.size()) { - return 0; - } - std::shared_ptr<const FIFloatValue> floatValue = std::dynamic_pointer_cast<const FIFloatValue>(attributes[idx].value); - if (floatValue) { - return floatValue->value.size() == 1 ? floatValue->value.front() : 0; - } - return fast_atof(attributes[idx].value->toString().c_str()); - } - - virtual const char* getNodeName() const /*override*/ { - return nodeName.c_str(); - } - - virtual const char* getNodeData() const /*override*/ { - return nodeName.c_str(); - } - - virtual bool isEmptyElement() const /*override*/ { - return emptyElement; - } - - virtual irr::io::ETEXT_FORMAT getSourceFormat() const /*override*/ { - return irr::io::ETF_UTF8; - } - - virtual irr::io::ETEXT_FORMAT getParserFormat() const /*override*/ { - return irr::io::ETF_UTF8; - } - - virtual std::shared_ptr<const FIValue> getAttributeEncodedValue(int idx) const /*override*/ { - if (idx < 0 || idx >= (int)attributes.size()) { - return nullptr; - } - return attributes[idx].value; - } - - virtual std::shared_ptr<const FIValue> getAttributeEncodedValue(const char* name) const /*override*/ { - const Attribute* attr = getAttributeByName(name); - if (!attr) { - return nullptr; - } - return attr->value; - } - - virtual void registerDecoder(const std::string &algorithmUri, std::unique_ptr<FIDecoder> decoder) /*override*/ { - decoderMap[algorithmUri] = std::move(decoder); - } - - virtual void registerVocabulary(const std::string &vocabularyUri, const FIVocabulary *vocabulary) /*override*/ { - vocabularyMap[vocabularyUri] = vocabulary; - } - -private: - - struct QName { - std::string prefix; - std::string uri; - std::string name; - inline QName() {} - inline QName(const FIQName &qname): prefix(qname.prefix ? qname.prefix : ""), uri(qname.uri ? qname.uri : ""), name(qname.name) {} - }; - - struct Attribute { - QName qname; - std::string name; - std::shared_ptr<const FIValue> value; - }; - - struct Vocabulary { - std::vector<std::string> restrictedAlphabetTable; - std::vector<std::string> encodingAlgorithmTable; - std::vector<std::string> prefixTable; - std::vector<std::string> namespaceNameTable; - std::vector<std::string> localNameTable; - std::vector<std::string> otherNCNameTable; - std::vector<std::string> otherURITable; - std::vector<std::shared_ptr<const FIValue>> attributeValueTable; - std::vector<std::shared_ptr<const FIValue>> charactersTable; - std::vector<std::shared_ptr<const FIValue>> otherStringTable; - std::vector<QName> elementNameTable; - std::vector<QName> attributeNameTable; - Vocabulary() { - prefixTable.push_back("xml"); - namespaceNameTable.push_back("http://www.w3.org/XML/1998/namespace"); - } - }; - - const Attribute* getAttributeByName(const char* name) const { - if (!name) { - return 0; - } - std::string n = name; - for (int i=0; i<(int)attributes.size(); ++i) { - if (attributes[i].name == n) { - return &attributes[i]; - } - } - return 0; - } - - size_t parseInt2() { // C.25 - uint8_t b = *dataP++; - if (!(b & 0x40)) { // x0...... (C.25.2) - return b & 0x3f; - } - else if ((b & 0x60) == 0x40) { // x10..... ........ (C.25.3) - if (dataEnd - dataP > 0) { - return (((b & 0x1f) << 8) | *dataP++) + 0x40; - } - } - else if ((b & 0x70) == 0x60) { // x110.... ........ ........ (C.25.4) - if (dataEnd - dataP > 1) { - size_t result = (((b & 0x0f) << 16) | (dataP[0] << 8) | dataP[1]) + 0x2040; - dataP += 2; - return result; - } - } - throw DeadlyImportError(parseErrorMessage); - } - - size_t parseInt3() { // C.27 - uint8_t b = *dataP++; - if (!(b & 0x20)) { // xx0..... (C.27.2) - return b & 0x1f; - } - else if ((b & 0x38) == 0x20) { // xx100... ........ (C.27.3) - if (dataEnd - dataP > 0) { - return (((b & 0x07) << 8) | *dataP++) + 0x20; - } - } - else if ((b & 0x38) == 0x28) { // xx101... ........ ........ (C.27.4) - if (dataEnd - dataP > 1) { - size_t result = (((b & 0x07) << 16) | (dataP[0] << 8) | dataP[1]) + 0x820; - dataP += 2; - return result; - } - } - else if ((b & 0x3f) == 0x30) { // xx110000 0000.... ........ ........ (C.27.5) - if ((dataEnd - dataP > 2) && !(dataP[0] & 0xf0)) { - size_t result = (((dataP[0] & 0x0f) << 16) | (dataP[1] << 8) | dataP[2]) + 0x80820; - dataP += 3; - return result; - } - } - throw DeadlyImportError(parseErrorMessage); - } - - size_t parseInt4() { // C.28 - uint8_t b = *dataP++; - if (!(b & 0x10)) { // xxx0.... (C.28.2) - return b & 0x0f; - } - else if ((b & 0x1c) == 0x10) { // xxx100.. ........ (C.28.3) - if (dataEnd - dataP > 0) { - return (((b & 0x03) << 8) | *dataP++) + 0x10; - } - } - else if ((b & 0x1c) == 0x14) { // xxx101.. ........ ........ (C.28.4) - if (dataEnd - dataP > 1) { - size_t result = (((b & 0x03) << 16) | (dataP[0] << 8) | dataP[1]) + 0x410; - dataP += 2; - return result; - } - } - else if ((b & 0x1f) == 0x18) { // xxx11000 0000.... ........ ........ (C.28.5) - if ((dataEnd - dataP > 2) && !(dataP[0] & 0xf0)) { - size_t result = (((dataP[0] & 0x0f) << 16) | (dataP[1] << 8) | dataP[2]) + 0x40410; - dataP += 3; - return result; - } - } - throw DeadlyImportError(parseErrorMessage); - } - - size_t parseSequenceLen() { // C.21 - if (dataEnd - dataP > 0) { - uint8_t b = *dataP++; - if (b < 0x80) { // 0....... (C.21.2) - return b; - } - else if ((b & 0xf0) == 0x80) { // 1000.... ........ ........ (C.21.3) - if (dataEnd - dataP > 1) { - size_t result = (((b & 0x0f) << 16) | (dataP[0] << 8) | dataP[1]) + 0x80; - dataP += 2; - return result; - } - } - } - throw DeadlyImportError(parseErrorMessage); - } - - std::string parseNonEmptyOctetString2() { // C.22 - // Parse the length of the string - uint8_t b = *dataP++ & 0x7f; - size_t len; - if (!(b & 0x40)) { // x0...... (C.22.3.1) - len = b + 1; - } - else if (b == 0x40) { // x1000000 ........ (C.22.3.2) - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - len = *dataP++ + 0x41; - } - else if (b == 0x60) { // x1100000 ........ ........ ........ ........ (C.22.3.3) - if (dataEnd - dataP < 4) { - throw DeadlyImportError(parseErrorMessage); - } - len = ((dataP[0] << 24) | (dataP[1] << 16) | (dataP[2] << 8) | dataP[3]) + 0x141; - dataP += 4; - } - else { - throw DeadlyImportError(parseErrorMessage); - } - - // Parse the string (C.22.4) - if (dataEnd - dataP < static_cast<ptrdiff_t>(len)) { - throw DeadlyImportError(parseErrorMessage); - } - std::string s = parseUTF8String(dataP, len); - dataP += len; - - return s; - } - - size_t parseNonEmptyOctetString5Length() { // C.23 - // Parse the length of the string - size_t b = *dataP++ & 0x0f; - if (!(b & 0x08)) { // xxxx0... (C.23.3.1) - return b + 1; - } - else if (b == 0x08) { // xxxx1000 ........ (C.23.3.2) - if (dataEnd - dataP > 0) { - return *dataP++ + 0x09; - } - } - else if (b == 0x0c) { // xxxx1100 ........ ........ ........ ........ (C.23.3.3) - if (dataEnd - dataP > 3) { - size_t result = ((dataP[0] << 24) | (dataP[1] << 16) | (dataP[2] << 8) | dataP[3]) + 0x109; - dataP += 4; - return result; - } - } - throw DeadlyImportError(parseErrorMessage); - } - - size_t parseNonEmptyOctetString7Length() { // C.24 - // Parse the length of the string - size_t b = *dataP++ & 0x03; - if (!(b & 0x02)) { // xxxxxx0. (C.24.3.1) - return b + 1; - } - else if (b == 0x02) { // xxxxxx10 ........ (C.24.3.2) - if (dataEnd - dataP > 0) { - return *dataP++ + 0x3; - } - } - else if (b == 0x03) { // xxxxxx11 ........ ........ ........ ........ (C.24.3.3) - if (dataEnd - dataP > 3) { - size_t result = ((dataP[0] << 24) | (dataP[1] << 16) | (dataP[2] << 8) | dataP[3]) + 0x103; - dataP += 4; - return result; - } - } - throw DeadlyImportError(parseErrorMessage); - } - - std::shared_ptr<const FIValue> parseEncodedData(size_t index, size_t len) { - if (index < 32) { - FIDecoder *decoder = defaultDecoder[index]; - if (!decoder) { - throw DeadlyImportError("Invalid encoding algorithm index " + to_string(index)); - } - return decoder->decode(dataP, len); - } - else { - if (index - 32 >= vocabulary.encodingAlgorithmTable.size()) { - throw DeadlyImportError("Invalid encoding algorithm index " + to_string(index)); - } - std::string uri = vocabulary.encodingAlgorithmTable[index - 32]; - auto it = decoderMap.find(uri); - if (it == decoderMap.end()) { - throw DeadlyImportError("Unsupported encoding algorithm " + uri); - } - else { - return it->second->decode(dataP, len); - } - } - } - - std::shared_ptr<const FIValue> parseRestrictedAlphabet(size_t index, size_t len) { - std::string alphabet; - if (index < 16) { - switch (index) { - case 0: // numeric - alphabet = "0123456789-+.e "; - break; - case 1: // date and time - alphabet = "0123456789-:TZ "; - break; - default: - throw DeadlyImportError("Invalid restricted alphabet index " + to_string(index)); - } - } - else { - if (index - 16 >= vocabulary.restrictedAlphabetTable.size()) { - throw DeadlyImportError("Invalid restricted alphabet index " + to_string(index)); - } - alphabet = vocabulary.restrictedAlphabetTable[index - 16]; - } - std::vector<uint32_t> alphabetUTF32; - utf8::utf8to32(alphabet.begin(), alphabet.end(), back_inserter(alphabetUTF32)); - std::string::size_type alphabetLength = alphabetUTF32.size(); - if (alphabetLength < 2) { - throw DeadlyImportError("Invalid restricted alphabet length " + to_string(alphabetLength)); - } - std::string::size_type bitsPerCharacter = 1; - while ((1ull << bitsPerCharacter) <= alphabetLength) { - ++bitsPerCharacter; - } - size_t bitsAvail = 0; - uint8_t mask = (1 << bitsPerCharacter) - 1; - uint32_t bits = 0; - std::string s; - for (size_t i = 0; i < len; ++i) { - bits = (bits << 8) | dataP[i]; - bitsAvail += 8; - while (bitsAvail >= bitsPerCharacter) { - bitsAvail -= bitsPerCharacter; - size_t charIndex = (bits >> bitsAvail) & mask; - if (charIndex < alphabetLength) { - s.push_back(alphabetUTF32[charIndex]); - } - else if (charIndex != mask) { - throw DeadlyImportError(parseErrorMessage); - } - } - } - return FIStringValue::create(std::move(s)); - } - - std::shared_ptr<const FIValue> parseEncodedCharacterString3() { // C.19 - std::shared_ptr<const FIValue> result; - size_t len; - uint8_t b = *dataP; - if (b & 0x20) { - ++dataP; - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - size_t index = ((b & 0x0f) << 4) | ((*dataP & 0xf0) >> 4); // C.29 - len = parseNonEmptyOctetString5Length(); - if (dataEnd - dataP < static_cast<ptrdiff_t>(len)) { - throw DeadlyImportError(parseErrorMessage); - } - if (b & 0x10) { - // encoding algorithm (C.19.3.4) - result = parseEncodedData(index, len); - } - else { - // Restricted alphabet (C.19.3.3) - result = parseRestrictedAlphabet(index, len); - } - } - else { - len = parseNonEmptyOctetString5Length(); - if (dataEnd - dataP < static_cast<ptrdiff_t>(len)) { - throw DeadlyImportError(parseErrorMessage); - } - if (b & 0x10) { - // UTF-16 (C.19.3.2) - if (len & 1) { - throw DeadlyImportError(parseErrorMessage); - } - result = FIStringValue::create(parseUTF16String(dataP, len)); - } - else { - // UTF-8 (C.19.3.1) - result = FIStringValue::create(parseUTF8String(dataP, len)); - } - } - dataP += len; - return result; - } - - std::shared_ptr<const FIValue> parseEncodedCharacterString5() { // C.20 - std::shared_ptr<const FIValue> result; - size_t len; - uint8_t b = *dataP; - if (b & 0x08) { - ++dataP; - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - size_t index = ((b & 0x03) << 6) | ((*dataP & 0xfc) >> 2); /* C.29 */ - len = parseNonEmptyOctetString7Length(); - if (dataEnd - dataP < static_cast<ptrdiff_t>(len)) { - throw DeadlyImportError(parseErrorMessage); - } - if (b & 0x04) { - // encoding algorithm (C.20.3.4) - result = parseEncodedData(index, len); - } - else { - // Restricted alphabet (C.20.3.3) - result = parseRestrictedAlphabet(index, len); - } - } - else { - len = parseNonEmptyOctetString7Length(); - if (dataEnd - dataP < static_cast<ptrdiff_t>(len)) { - throw DeadlyImportError(parseErrorMessage); - } - if (b & 0x04) { - // UTF-16 (C.20.3.2) - if (len & 1) { - throw DeadlyImportError(parseErrorMessage); - } - result = FIStringValue::create(parseUTF16String(dataP, len)); - } - else { - // UTF-8 (C.20.3.1) - result = FIStringValue::create(parseUTF8String(dataP, len)); - } - } - dataP += len; - return result; - } - - const std::string &parseIdentifyingStringOrIndex(std::vector<std::string> &stringTable) { // C.13 - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - uint8_t b = *dataP; - if (b & 0x80) { - // We have an index (C.13.4) - size_t index = parseInt2(); - if (index >= stringTable.size()) { - throw DeadlyImportError(parseErrorMessage); - } - return stringTable[index]; - } - else { - // We have a string (C.13.3) - stringTable.push_back(parseNonEmptyOctetString2()); - return stringTable.back(); - } - } - - QName parseNameSurrogate() { // C.16 - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - uint8_t b = *dataP++; - if (b & 0xfc) { // Padding '000000' C.2.5.5 - throw DeadlyImportError(parseErrorMessage); - } - QName result; - size_t index; - if (b & 0x02) { // prefix (C.16.3) - if ((dataEnd - dataP < 1) || (*dataP & 0x80)) { - throw DeadlyImportError(parseErrorMessage); - } - index = parseInt2(); - if (index >= vocabulary.prefixTable.size()) { - throw DeadlyImportError(parseErrorMessage); - } - result.prefix = vocabulary.prefixTable[index]; - } - if (b & 0x01) { // namespace-name (C.16.4) - if ((dataEnd - dataP < 1) || (*dataP & 0x80)) { - throw DeadlyImportError(parseErrorMessage); - } - index = parseInt2(); - if (index >= vocabulary.namespaceNameTable.size()) { - throw DeadlyImportError(parseErrorMessage); - } - result.uri = vocabulary.namespaceNameTable[index]; - } - // local-name - if ((dataEnd - dataP < 1) || (*dataP & 0x80)) { - throw DeadlyImportError(parseErrorMessage); - } - index = parseInt2(); - if (index >= vocabulary.localNameTable.size()) { - throw DeadlyImportError(parseErrorMessage); - } - result.name = vocabulary.localNameTable[index]; - return result; - } - - const QName &parseQualifiedNameOrIndex2(std::vector<QName> &qNameTable) { // C.17 - uint8_t b = *dataP; - if ((b & 0x7c) == 0x78) { // x11110.. - // We have a literal (C.17.3) - ++dataP; - QName result; - // prefix (C.17.3.1) - result.prefix = b & 0x02 ? parseIdentifyingStringOrIndex(vocabulary.prefixTable) : std::string(); - // namespace-name (C.17.3.1) - result.uri = b & 0x01 ? parseIdentifyingStringOrIndex(vocabulary.namespaceNameTable) : std::string(); - // local-name - result.name = parseIdentifyingStringOrIndex(vocabulary.localNameTable); - qNameTable.push_back(result); - return qNameTable.back(); - } - else { - // We have an index (C.17.4) - size_t index = parseInt2(); - if (index >= qNameTable.size()) { - throw DeadlyImportError(parseErrorMessage); - } - return qNameTable[index]; - } - } - - const QName &parseQualifiedNameOrIndex3(std::vector<QName> &qNameTable) { // C.18 - uint8_t b = *dataP; - if ((b & 0x3c) == 0x3c) { // xx1111.. - // We have a literal (C.18.3) - ++dataP; - QName result; - // prefix (C.18.3.1) - result.prefix = b & 0x02 ? parseIdentifyingStringOrIndex(vocabulary.prefixTable) : std::string(); - // namespace-name (C.18.3.1) - result.uri = b & 0x01 ? parseIdentifyingStringOrIndex(vocabulary.namespaceNameTable) : std::string(); - // local-name - result.name = parseIdentifyingStringOrIndex(vocabulary.localNameTable); - qNameTable.push_back(result); - return qNameTable.back(); - } - else { - // We have an index (C.18.4) - size_t index = parseInt3(); - if (index >= qNameTable.size()) { - throw DeadlyImportError(parseErrorMessage); - } - return qNameTable[index]; - } - } - - std::shared_ptr<const FIValue> parseNonIdentifyingStringOrIndex1(std::vector<std::shared_ptr<const FIValue>> &valueTable) { // C.14 - uint8_t b = *dataP; - if (b == 0xff) { // C.26.2 - // empty string - ++dataP; - return EmptyFIString; - } - else if (b & 0x80) { // C.14.4 - // We have an index - size_t index = parseInt2(); - if (index >= valueTable.size()) { - throw DeadlyImportError(parseErrorMessage); - } - return valueTable[index]; - } - else { // C.14.3 - // We have a literal - std::shared_ptr<const FIValue> result = parseEncodedCharacterString3(); - if (b & 0x40) { // C.14.3.1 - valueTable.push_back(result); - } - return result; - } - } - - std::shared_ptr<const FIValue> parseNonIdentifyingStringOrIndex3(std::vector<std::shared_ptr<const FIValue>> &valueTable) { // C.15 - uint8_t b = *dataP; - if (b & 0x20) { // C.15.4 - // We have an index - size_t index = parseInt4(); - if (index >= valueTable.size()) { - throw DeadlyImportError(parseErrorMessage); - } - return valueTable[index]; - } - else { // C.15.3 - // We have a literal - std::shared_ptr<const FIValue> result = parseEncodedCharacterString5(); - if (b & 0x10) { // C.15.3.1 - valueTable.push_back(result); - } - return result; - } - } - - void parseElement() { - // C.3 - - attributes.clear(); - - uint8_t b = *dataP; - bool hasAttributes = (b & 0x40) != 0; // C.3.3 - if ((b & 0x3f) == 0x38) { // C.3.4.1 - // Parse namespaces - ++dataP; - for (;;) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - b = *dataP++; - if (b == 0xf0) { // C.3.4.3 - break; - } - if ((b & 0xfc) != 0xcc) { // C.3.4.2 - throw DeadlyImportError(parseErrorMessage); - } - // C.12 - Attribute attr; - attr.qname.prefix = "xmlns"; - attr.qname.name = b & 0x02 ? parseIdentifyingStringOrIndex(vocabulary.prefixTable) : std::string(); - attr.qname.uri = b & 0x01 ? parseIdentifyingStringOrIndex(vocabulary.namespaceNameTable) : std::string(); - attr.name = attr.qname.name.empty() ? "xmlns" : "xmlns:" + attr.qname.name; - attr.value = FIStringValue::create(std::string(attr.qname.uri)); - attributes.push_back(attr); - } - if ((dataEnd - dataP < 1) || (*dataP & 0xc0)) { - throw DeadlyImportError(parseErrorMessage); - } - } - - // Parse Element name (C.3.5) - const QName &elemName = parseQualifiedNameOrIndex3(vocabulary.elementNameTable); - nodeName = elemName.prefix.empty() ? elemName.name : elemName.prefix + ':' + elemName.name; - - if (hasAttributes) { - for (;;) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - b = *dataP; - if (b < 0x80) { // C.3.6.1 - // C.4 - Attribute attr; - attr.qname = parseQualifiedNameOrIndex2(vocabulary.attributeNameTable); - attr.name = attr.qname.prefix.empty() ? attr.qname.name : attr.qname.prefix + ':' + attr.qname.name; - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - attr.value = parseNonIdentifyingStringOrIndex1(vocabulary.attributeValueTable); - attributes.push_back(attr); - } - else { - if ((b & 0xf0) != 0xf0) { // C.3.6.2 - throw DeadlyImportError(parseErrorMessage); - } - emptyElement = b == 0xff; // C.3.6.2, C.3.8 - ++dataP; - break; - } - } - } - else { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - b = *dataP; - switch (b) { - case 0xff: - terminatorPending = true; - // Intentionally fall through - case 0xf0: - emptyElement = true; - ++dataP; - break; - default: - emptyElement = false; - } - } - if (!emptyElement) { - elementStack.push(nodeName); - } - - currentNodeType = irr::io::EXN_ELEMENT; - } - - void parseHeader() { - // Parse header (C.1.3) - size_t magicSize = parseMagic(dataP, dataEnd); - if (!magicSize) { - throw DeadlyImportError(parseErrorMessage); - } - dataP += magicSize; - // C.2.3 - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - uint8_t b = *dataP++; - if (b & 0x40) { - // Parse additional data (C.2.4) - size_t len = parseSequenceLen(); - for (size_t i = 0; i < len; ++i) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - /*std::string id =*/ parseNonEmptyOctetString2(); - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - /*std::string data =*/ parseNonEmptyOctetString2(); - } - } - if (b & 0x20) { - // Parse initial vocabulary (C.2.5) - if (dataEnd - dataP < 2) { - throw DeadlyImportError(parseErrorMessage); - } - uint16_t b1 = (dataP[0] << 8) | dataP[1]; - dataP += 2; - if (b1 & 0x1000) { - // External vocabulary (C.2.5.2) - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - std::string uri = parseNonEmptyOctetString2(); - auto it = vocabularyMap.find(uri); - if (it == vocabularyMap.end()) { - throw DeadlyImportError("Unknown vocabulary " + uri); - } - const FIVocabulary *externalVocabulary = it->second; - if (externalVocabulary->restrictedAlphabetTable) { - std::copy(externalVocabulary->restrictedAlphabetTable, externalVocabulary->restrictedAlphabetTable + externalVocabulary->restrictedAlphabetTableSize, std::back_inserter(vocabulary.restrictedAlphabetTable)); - } - if (externalVocabulary->encodingAlgorithmTable) { - std::copy(externalVocabulary->encodingAlgorithmTable, externalVocabulary->encodingAlgorithmTable + externalVocabulary->encodingAlgorithmTableSize, std::back_inserter(vocabulary.encodingAlgorithmTable)); - } - if (externalVocabulary->prefixTable) { - std::copy(externalVocabulary->prefixTable, externalVocabulary->prefixTable + externalVocabulary->prefixTableSize, std::back_inserter(vocabulary.prefixTable)); - } - if (externalVocabulary->namespaceNameTable) { - std::copy(externalVocabulary->namespaceNameTable, externalVocabulary->namespaceNameTable + externalVocabulary->namespaceNameTableSize, std::back_inserter(vocabulary.namespaceNameTable)); - } - if (externalVocabulary->localNameTable) { - std::copy(externalVocabulary->localNameTable, externalVocabulary->localNameTable + externalVocabulary->localNameTableSize, std::back_inserter(vocabulary.localNameTable)); - } - if (externalVocabulary->otherNCNameTable) { - std::copy(externalVocabulary->otherNCNameTable, externalVocabulary->otherNCNameTable + externalVocabulary->otherNCNameTableSize, std::back_inserter(vocabulary.otherNCNameTable)); - } - if (externalVocabulary->otherURITable) { - std::copy(externalVocabulary->otherURITable, externalVocabulary->otherURITable + externalVocabulary->otherURITableSize, std::back_inserter(vocabulary.otherURITable)); - } - if (externalVocabulary->attributeValueTable) { - std::copy(externalVocabulary->attributeValueTable, externalVocabulary->attributeValueTable + externalVocabulary->attributeValueTableSize, std::back_inserter(vocabulary.attributeValueTable)); - } - if (externalVocabulary->charactersTable) { - std::copy(externalVocabulary->charactersTable, externalVocabulary->charactersTable + externalVocabulary->charactersTableSize, std::back_inserter(vocabulary.charactersTable)); - } - if (externalVocabulary->otherStringTable) { - std::copy(externalVocabulary->otherStringTable, externalVocabulary->otherStringTable + externalVocabulary->otherStringTableSize, std::back_inserter(vocabulary.otherStringTable)); - } - if (externalVocabulary->elementNameTable) { - std::copy(externalVocabulary->elementNameTable, externalVocabulary->elementNameTable + externalVocabulary->elementNameTableSize, std::back_inserter(vocabulary.elementNameTable)); - } - if (externalVocabulary->attributeNameTable) { - std::copy(externalVocabulary->attributeNameTable, externalVocabulary->attributeNameTable + externalVocabulary->attributeNameTableSize, std::back_inserter(vocabulary.attributeNameTable)); - } - } - if (b1 & 0x0800) { - // Parse restricted alphabets (C.2.5.3) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.restrictedAlphabetTable.push_back(parseNonEmptyOctetString2()); - } - } - if (b1 & 0x0400) { - // Parse encoding algorithms (C.2.5.3) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.encodingAlgorithmTable.push_back(parseNonEmptyOctetString2()); - } - } - if (b1 & 0x0200) { - // Parse prefixes (C.2.5.3) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.prefixTable.push_back(parseNonEmptyOctetString2()); - } - } - if (b1 & 0x0100) { - // Parse namespace names (C.2.5.3) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.namespaceNameTable.push_back(parseNonEmptyOctetString2()); - } - } - if (b1 & 0x0080) { - // Parse local names (C.2.5.3) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.localNameTable.push_back(parseNonEmptyOctetString2()); - } - } - if (b1 & 0x0040) { - // Parse other ncnames (C.2.5.3) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.otherNCNameTable.push_back(parseNonEmptyOctetString2()); - } - } - if (b1 & 0x0020) { - // Parse other uris (C.2.5.3) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.otherURITable.push_back(parseNonEmptyOctetString2()); - } - } - if (b1 & 0x0010) { - // Parse attribute values (C.2.5.4) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.attributeValueTable.push_back(parseEncodedCharacterString3()); - } - } - if (b1 & 0x0008) { - // Parse content character chunks (C.2.5.4) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.charactersTable.push_back(parseEncodedCharacterString3()); - } - } - if (b1 & 0x0004) { - // Parse other strings (C.2.5.4) - for (size_t len = parseSequenceLen(); len > 0; --len) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - vocabulary.otherStringTable.push_back(parseEncodedCharacterString3()); - } - } - if (b1 & 0x0002) { - // Parse element name surrogates (C.2.5.5) - for (size_t len = parseSequenceLen(); len > 0; --len) { - vocabulary.elementNameTable.push_back(parseNameSurrogate()); - } - } - if (b1 & 0x0001) { - // Parse attribute name surrogates (C.2.5.5) - for (size_t len = parseSequenceLen(); len > 0; --len) { - vocabulary.attributeNameTable.push_back(parseNameSurrogate()); - } - } - } - if (b & 0x10) { - // Parse notations (C.2.6) - for (;;) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - uint8_t b1 = *dataP++; - if (b1 == 0xf0) { - break; - } - if ((b1 & 0xfc) != 0xc0) { - throw DeadlyImportError(parseErrorMessage); - } - /* C.11 */ - /*const std::string &name =*/ parseIdentifyingStringOrIndex(vocabulary.otherNCNameTable); - if (b1 & 0x02) { - /*const std::string &systemId =*/ parseIdentifyingStringOrIndex(vocabulary.otherURITable); - } - if (b1 & 0x01) { - /*const std::string &publicId =*/ parseIdentifyingStringOrIndex(vocabulary.otherURITable); - } - } - } - if (b & 0x08) { - // Parse unparsed entities (C.2.7) - for (;;) { - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - uint8_t b1 = *dataP++; - if (b1 == 0xf0) { - break; - } - if ((b1 & 0xfe) != 0xd0) { - throw DeadlyImportError(parseErrorMessage); - } - /* C.10 */ - /*const std::string &name =*/ parseIdentifyingStringOrIndex(vocabulary.otherNCNameTable); - /*const std::string &systemId =*/ parseIdentifyingStringOrIndex(vocabulary.otherURITable); - if (b1 & 0x01) { - /*const std::string &publicId =*/ parseIdentifyingStringOrIndex(vocabulary.otherURITable); - } - /*const std::string ¬ationName =*/ parseIdentifyingStringOrIndex(vocabulary.otherNCNameTable); - } - } - if (b & 0x04) { - // Parse character encoding scheme (C.2.8) - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - /*std::string characterEncodingScheme =*/ parseNonEmptyOctetString2(); - } - if (b & 0x02) { - // Parse standalone flag (C.2.9) - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - uint8_t b1 = *dataP++; - if (b1 & 0xfe) { - throw DeadlyImportError(parseErrorMessage); - } - //bool standalone = b1 & 0x01; - } - if (b & 0x01) { - // Parse version (C.2.10) - if (dataEnd - dataP < 1) { - throw DeadlyImportError(parseErrorMessage); - } - /*std::shared_ptr<const FIValue> version =*/ parseNonIdentifyingStringOrIndex1(vocabulary.otherStringTable); - } - } - - std::unique_ptr<uint8_t[]> data; - uint8_t *dataP, *dataEnd; - irr::io::EXML_NODE currentNodeType; - bool emptyElement; - bool headerPending; - bool terminatorPending; - Vocabulary vocabulary; - std::vector<Attribute> attributes; - std::stack<std::string> elementStack; - std::string nodeName; - std::map<std::string, std::unique_ptr<FIDecoder>> decoderMap; - std::map<std::string, const FIVocabulary*> vocabularyMap; - - static const std::string EmptyString; - static std::shared_ptr<const FIValue> EmptyFIString; - - static FIHexDecoder hexDecoder; - static FIBase64Decoder base64Decoder; - static FIShortDecoder shortDecoder; - static FIIntDecoder intDecoder; - static FILongDecoder longDecoder; - static FIBoolDecoder boolDecoder; - static FIFloatDecoder floatDecoder; - static FIDoubleDecoder doubleDecoder; - static FIUUIDDecoder uuidDecoder; - static FICDATADecoder cdataDecoder; - static FIDecoder *defaultDecoder[32]; -}; - -const std::string CFIReaderImpl::EmptyString; -std::shared_ptr<const FIValue> CFIReaderImpl::EmptyFIString = FIStringValue::create(std::string()); - -FIHexDecoder CFIReaderImpl::hexDecoder; -FIBase64Decoder CFIReaderImpl::base64Decoder; -FIShortDecoder CFIReaderImpl::shortDecoder; -FIIntDecoder CFIReaderImpl::intDecoder; -FILongDecoder CFIReaderImpl::longDecoder; -FIBoolDecoder CFIReaderImpl::boolDecoder; -FIFloatDecoder CFIReaderImpl::floatDecoder; -FIDoubleDecoder CFIReaderImpl::doubleDecoder; -FIUUIDDecoder CFIReaderImpl::uuidDecoder; -FICDATADecoder CFIReaderImpl::cdataDecoder; - -FIDecoder *CFIReaderImpl::defaultDecoder[32] = { - &hexDecoder, - &base64Decoder, - &shortDecoder, - &intDecoder, - &longDecoder, - &boolDecoder, - &floatDecoder, - &doubleDecoder, - &uuidDecoder, - &cdataDecoder -}; - -class CXMLReaderImpl : public FIReader -{ -public: - - //! Constructor - CXMLReaderImpl(std::unique_ptr<irr::io::IIrrXMLReader<char, irr::io::IXMLBase>> reader_) - : reader(std::move(reader_)) - {} - - virtual ~CXMLReaderImpl() {} - - virtual bool read() /*override*/ { - return reader->read(); - } - - virtual irr::io::EXML_NODE getNodeType() const /*override*/ { - return reader->getNodeType(); - } - - virtual int getAttributeCount() const /*override*/ { - return reader->getAttributeCount(); - } - - virtual const char* getAttributeName(int idx) const /*override*/ { - return reader->getAttributeName(idx); - } - - virtual const char* getAttributeValue(int idx) const /*override*/ { - return reader->getAttributeValue(idx); - } - - virtual const char* getAttributeValue(const char* name) const /*override*/ { - return reader->getAttributeValue(name); - } - - virtual const char* getAttributeValueSafe(const char* name) const /*override*/ { - return reader->getAttributeValueSafe(name); - } - - virtual int getAttributeValueAsInt(const char* name) const /*override*/ { - return reader->getAttributeValueAsInt(name); - } - - virtual int getAttributeValueAsInt(int idx) const /*override*/ { - return reader->getAttributeValueAsInt(idx); - } - - virtual float getAttributeValueAsFloat(const char* name) const /*override*/ { - return reader->getAttributeValueAsFloat(name); - } - - virtual float getAttributeValueAsFloat(int idx) const /*override*/ { - return reader->getAttributeValueAsFloat(idx); - } - - virtual const char* getNodeName() const /*override*/ { - return reader->getNodeName(); - } - - virtual const char* getNodeData() const /*override*/ { - return reader->getNodeData(); - } - - virtual bool isEmptyElement() const /*override*/ { - return reader->isEmptyElement(); - } - - virtual irr::io::ETEXT_FORMAT getSourceFormat() const /*override*/ { - return reader->getSourceFormat(); - } - - virtual irr::io::ETEXT_FORMAT getParserFormat() const /*override*/ { - return reader->getParserFormat(); - } - - virtual std::shared_ptr<const FIValue> getAttributeEncodedValue(int /*idx*/) const /*override*/ { - return nullptr; - } - - virtual std::shared_ptr<const FIValue> getAttributeEncodedValue(const char* /*name*/) const /*override*/ { - return nullptr; - } - - virtual void registerDecoder(const std::string & /*algorithmUri*/, std::unique_ptr<FIDecoder> /*decoder*/) /*override*/ {} - - - virtual void registerVocabulary(const std::string &/*vocabularyUri*/, const FIVocabulary * /*vocabulary*/) /*override*/ {} - -private: - - std::unique_ptr<irr::io::IIrrXMLReader<char, irr::io::IXMLBase>> reader; -}; - -static std::unique_ptr<uint8_t[]> readFile(IOStream *stream, size_t &size, bool &isFI) { - size = stream->FileSize(); - std::unique_ptr<uint8_t[]> data = std::unique_ptr<uint8_t[]>(new uint8_t[size]); - if (stream->Read(data.get(), size, 1) != 1) { - size = 0; - data.reset(); - } - isFI = parseMagic(data.get(), data.get() + size) > 0; - return data; -} - -std::unique_ptr<FIReader> FIReader::create(IOStream *stream) -{ - size_t size; - bool isFI; - auto data = readFile(stream, size, isFI); - if (isFI) { - return std::unique_ptr<FIReader>(new CFIReaderImpl(std::move(data), size)); - } - else { - auto memios = std::unique_ptr<MemoryIOStream>(new MemoryIOStream(data.release(), size, true)); - auto callback = std::unique_ptr<CIrrXML_IOStreamReader>(new CIrrXML_IOStreamReader(memios.get())); - return std::unique_ptr<FIReader>(new CXMLReaderImpl(std::unique_ptr<irr::io::IIrrXMLReader<char, irr::io::IXMLBase>>(createIrrXMLReader(callback.get())))); - } -} - -}// namespace Assimp - -#endif // !ASSIMP_BUILD_NO_X3D_IMPORTER diff --git a/thirdparty/assimp/code/MMDCpp14.h b/thirdparty/assimp/code/MMD/MMDCpp14.h index 638b0bfd2f..638b0bfd2f 100644 --- a/thirdparty/assimp/code/MMDCpp14.h +++ b/thirdparty/assimp/code/MMD/MMDCpp14.h diff --git a/thirdparty/assimp/code/MMDImporter.cpp b/thirdparty/assimp/code/MMD/MMDImporter.cpp index 84b9e35a6b..e7744e4cd0 100644 --- a/thirdparty/assimp/code/MMDImporter.cpp +++ b/thirdparty/assimp/code/MMD/MMDImporter.cpp @@ -41,15 +41,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_MMD_IMPORTER -#include "MMDImporter.h" -#include "MMDPmdParser.h" -#include "MMDPmxParser.h" -#include "MMDVmdParser.h" -#include "ConvertToLHProcess.h" +#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> diff --git a/thirdparty/assimp/code/MMDImporter.h b/thirdparty/assimp/code/MMD/MMDImporter.h index 4ee94eeb00..4ee94eeb00 100644 --- a/thirdparty/assimp/code/MMDImporter.h +++ b/thirdparty/assimp/code/MMD/MMDImporter.h diff --git a/thirdparty/assimp/code/MMDPmdParser.h b/thirdparty/assimp/code/MMD/MMDPmdParser.h index d2f2224aa1..d2f2224aa1 100644 --- a/thirdparty/assimp/code/MMDPmdParser.h +++ b/thirdparty/assimp/code/MMD/MMDPmdParser.h diff --git a/thirdparty/assimp/code/MMDPmxParser.cpp b/thirdparty/assimp/code/MMD/MMDPmxParser.cpp index 7425ceac22..80f0986dd7 100644 --- a/thirdparty/assimp/code/MMDPmxParser.cpp +++ b/thirdparty/assimp/code/MMD/MMDPmxParser.cpp @@ -42,7 +42,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <utility> #include "MMDPmxParser.h" #include <assimp/StringUtils.h> -#include "../contrib/utf8cpp/source/utf8.h" +#ifdef ASSIMP_USE_HUNTER +# include <utf8/utf8.h> +#else +# include "../contrib/utf8cpp/source/utf8.h" +#endif #include <assimp/Exceptional.h> namespace pmx diff --git a/thirdparty/assimp/code/MMDPmxParser.h b/thirdparty/assimp/code/MMD/MMDPmxParser.h index cf523a1298..cf523a1298 100644 --- a/thirdparty/assimp/code/MMDPmxParser.h +++ b/thirdparty/assimp/code/MMD/MMDPmxParser.h diff --git a/thirdparty/assimp/code/MMDVmdParser.h b/thirdparty/assimp/code/MMD/MMDVmdParser.h index 947c3a2422..947c3a2422 100644 --- a/thirdparty/assimp/code/MMDVmdParser.h +++ b/thirdparty/assimp/code/MMD/MMDVmdParser.h diff --git a/thirdparty/assimp/code/MaterialSystem.cpp b/thirdparty/assimp/code/Material/MaterialSystem.cpp index 03d5a18a34..d0b39093b6 100644 --- a/thirdparty/assimp/code/MaterialSystem.cpp +++ b/thirdparty/assimp/code/Material/MaterialSystem.cpp @@ -96,12 +96,12 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, ai_real* pOut, unsigned int* pMax) { - ai_assert( pOut != NULL ); - ai_assert( pMat != NULL ); + ai_assert( pOut != nullptr ); + ai_assert( pMat != nullptr ); const aiMaterialProperty* prop; aiGetMaterialProperty(pMat,pKey,type,index, (const aiMaterialProperty**) &prop); - if (!prop) { + if ( nullptr == prop) { return AI_FAILURE; } @@ -112,9 +112,11 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, if (pMax) { iWrite = std::min(*pMax,iWrite); ; } - for (unsigned int a = 0; a < iWrite;++a) { - pOut[a] = static_cast<ai_real> ( reinterpret_cast<float*>(prop->mData)[a] ); + + for (unsigned int a = 0; a < iWrite; ++a) { + pOut[ a ] = static_cast<ai_real> ( reinterpret_cast<float*>(prop->mData)[a] ); } + if (pMax) { *pMax = iWrite; } diff --git a/thirdparty/assimp/code/MaterialSystem.h b/thirdparty/assimp/code/Material/MaterialSystem.h index 67d53578cb..67d53578cb 100644 --- a/thirdparty/assimp/code/MaterialSystem.h +++ b/thirdparty/assimp/code/Material/MaterialSystem.h diff --git a/thirdparty/assimp/code/CalcTangentsProcess.cpp b/thirdparty/assimp/code/PostProcessing/CalcTangentsProcess.cpp index b30f39c274..b30f39c274 100644 --- a/thirdparty/assimp/code/CalcTangentsProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/CalcTangentsProcess.cpp diff --git a/thirdparty/assimp/code/CalcTangentsProcess.h b/thirdparty/assimp/code/PostProcessing/CalcTangentsProcess.h index 18775abcc7..3568a624f8 100644 --- a/thirdparty/assimp/code/CalcTangentsProcess.h +++ b/thirdparty/assimp/code/PostProcessing/CalcTangentsProcess.h @@ -42,11 +42,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Defines a post processing step to calculate tangents and - bitangents on all imported meshes.*/ + bi-tangents on all imported meshes.*/ #ifndef AI_CALCTANGENTSPROCESS_H_INC #define AI_CALCTANGENTSPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" struct aiMesh; diff --git a/thirdparty/assimp/code/ComputeUVMappingProcess.cpp b/thirdparty/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp index bb571a551b..bb571a551b 100644 --- a/thirdparty/assimp/code/ComputeUVMappingProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp diff --git a/thirdparty/assimp/code/ComputeUVMappingProcess.h b/thirdparty/assimp/code/PostProcessing/ComputeUVMappingProcess.h index 24f6bb7218..a6d36e06ea 100644 --- a/thirdparty/assimp/code/ComputeUVMappingProcess.h +++ b/thirdparty/assimp/code/PostProcessing/ComputeUVMappingProcess.h @@ -45,7 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COMPUTEUVMAPPING_H_INC #define AI_COMPUTEUVMAPPING_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/mesh.h> #include <assimp/material.h> #include <assimp/types.h> diff --git a/thirdparty/assimp/code/ConvertToLHProcess.cpp b/thirdparty/assimp/code/PostProcessing/ConvertToLHProcess.cpp index b7cd4f0bc6..b7cd4f0bc6 100644 --- a/thirdparty/assimp/code/ConvertToLHProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/ConvertToLHProcess.cpp diff --git a/thirdparty/assimp/code/ConvertToLHProcess.h b/thirdparty/assimp/code/PostProcessing/ConvertToLHProcess.h index 63351568d0..f32b91fc39 100644 --- a/thirdparty/assimp/code/ConvertToLHProcess.h +++ b/thirdparty/assimp/code/PostProcessing/ConvertToLHProcess.h @@ -52,7 +52,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_CONVERTTOLHPROCESS_H_INC #include <assimp/types.h> -#include "BaseProcess.h" + +#include "Common/BaseProcess.h" struct aiMesh; struct aiNodeAnim; diff --git a/thirdparty/assimp/code/DeboneProcess.cpp b/thirdparty/assimp/code/PostProcessing/DeboneProcess.cpp index 83b8336bc9..83b8336bc9 100644 --- a/thirdparty/assimp/code/DeboneProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/DeboneProcess.cpp diff --git a/thirdparty/assimp/code/DeboneProcess.h b/thirdparty/assimp/code/PostProcessing/DeboneProcess.h index ba77aba70e..8b64c2acc6 100644 --- a/thirdparty/assimp/code/DeboneProcess.h +++ b/thirdparty/assimp/code/PostProcessing/DeboneProcess.h @@ -44,17 +44,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_DEBONEPROCESS_H_INC #define AI_DEBONEPROCESS_H_INC -#include <vector> -#include <utility> -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include <assimp/mesh.h> #include <assimp/scene.h> +#include <vector> +#include <utility> + +#// Forward declarations class DeboneTest; -namespace Assimp -{ +namespace Assimp { #if (!defined AI_DEBONE_THRESHOLD) # define AI_DEBONE_THRESHOLD 1.0f @@ -66,14 +67,11 @@ namespace Assimp * the bone are split from the mesh. The split off (new) mesh is boneless. At any * point in time, bones without affect upon a given mesh are to be removed. */ -class DeboneProcess : public BaseProcess -{ +class DeboneProcess : public BaseProcess { public: - DeboneProcess(); ~DeboneProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag. * @param pFlags The processing flags the importer was called with. @@ -91,7 +89,6 @@ public: void SetupProperties(const Importer* pImp); protected: - // ------------------------------------------------------------------- /** Executes the post processing step on the given imported data. * At the moment a process is not supposed to fail. diff --git a/thirdparty/assimp/code/DropFaceNormalsProcess.cpp b/thirdparty/assimp/code/PostProcessing/DropFaceNormalsProcess.cpp index b11615bb82..b11615bb82 100644 --- a/thirdparty/assimp/code/DropFaceNormalsProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/DropFaceNormalsProcess.cpp diff --git a/thirdparty/assimp/code/DropFaceNormalsProcess.h b/thirdparty/assimp/code/PostProcessing/DropFaceNormalsProcess.h index 0d116663b7..c710c5a5ee 100644 --- a/thirdparty/assimp/code/DropFaceNormalsProcess.h +++ b/thirdparty/assimp/code/PostProcessing/DropFaceNormalsProcess.h @@ -44,23 +44,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_DROPFACENORMALPROCESS_H_INC #define AI_DROPFACENORMALPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/mesh.h> -namespace Assimp -{ +namespace Assimp { // --------------------------------------------------------------------------- /** The DropFaceNormalsProcess computes face normals for all faces of all meshes */ -class ASSIMP_API_WINONLY DropFaceNormalsProcess : public BaseProcess -{ +class ASSIMP_API_WINONLY DropFaceNormalsProcess : public BaseProcess { public: - DropFaceNormalsProcess(); ~DropFaceNormalsProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag field. * @param pFlags The processing flags the importer was called with. A bitwise diff --git a/thirdparty/assimp/code/EmbedTexturesProcess.cpp b/thirdparty/assimp/code/PostProcessing/EmbedTexturesProcess.cpp index 739382a057..739382a057 100644 --- a/thirdparty/assimp/code/EmbedTexturesProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/EmbedTexturesProcess.cpp diff --git a/thirdparty/assimp/code/EmbedTexturesProcess.h b/thirdparty/assimp/code/PostProcessing/EmbedTexturesProcess.h index cdf40bef74..3c4b2eab4e 100644 --- a/thirdparty/assimp/code/EmbedTexturesProcess.h +++ b/thirdparty/assimp/code/PostProcessing/EmbedTexturesProcess.h @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include <string> diff --git a/thirdparty/assimp/code/FindDegenerates.cpp b/thirdparty/assimp/code/PostProcessing/FindDegenerates.cpp index 365f5d7447..50fac46dba 100644 --- a/thirdparty/assimp/code/FindDegenerates.cpp +++ b/thirdparty/assimp/code/PostProcessing/FindDegenerates.cpp @@ -228,6 +228,7 @@ bool FindDegeneratesProcess::ExecuteOnMesh( aiMesh* mesh) { if ( area < 1e-6 ) { if ( mConfigRemoveDegenerates ) { remove_me[ a ] = true; + ++deg; goto evil_jump_outside; } diff --git a/thirdparty/assimp/code/FindDegenerates.h b/thirdparty/assimp/code/PostProcessing/FindDegenerates.h index 880f5f16a2..7a15e77cf1 100644 --- a/thirdparty/assimp/code/FindDegenerates.h +++ b/thirdparty/assimp/code/PostProcessing/FindDegenerates.h @@ -45,7 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FINDDEGENERATESPROCESS_H_INC #define AI_FINDDEGENERATESPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/mesh.h> class FindDegeneratesProcessTest; diff --git a/thirdparty/assimp/code/FindInstancesProcess.cpp b/thirdparty/assimp/code/PostProcessing/FindInstancesProcess.cpp index be1138116e..64907458a1 100644 --- a/thirdparty/assimp/code/FindInstancesProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/FindInstancesProcess.cpp @@ -137,6 +137,11 @@ void FindInstancesProcess::Execute( aiScene* pScene) aiMesh* inst = pScene->mMeshes[i]; hashes[i] = GetMeshHash(inst); + // Find an appropriate epsilon + // to compare position differences against + float epsilon = ComputePositionEpsilon(inst); + epsilon *= epsilon; + for (int a = i-1; a >= 0; --a) { if (hashes[i] == hashes[a]) { @@ -154,12 +159,7 @@ void FindInstancesProcess::Execute( aiScene* pScene) orig->mPrimitiveTypes != inst->mPrimitiveTypes) continue; - // up to now the meshes are equal. find an appropriate - // epsilon to compare position differences against - float epsilon = ComputePositionEpsilon(inst); - epsilon *= epsilon; - - // now compare vertex positions, normals, + // up to now the meshes are equal. Now compare vertex positions, normals, // tangents and bitangents using this epsilon. if (orig->HasPositions()) { if(!CompareArrays(orig->mVertices,inst->mVertices,orig->mNumVertices,epsilon)) diff --git a/thirdparty/assimp/code/FindInstancesProcess.h b/thirdparty/assimp/code/PostProcessing/FindInstancesProcess.h index ab4a371c71..64b838d7cc 100644 --- a/thirdparty/assimp/code/FindInstancesProcess.h +++ b/thirdparty/assimp/code/PostProcessing/FindInstancesProcess.h @@ -46,8 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FINDINSTANCES_H_INC #define AI_FINDINSTANCES_H_INC -#include "BaseProcess.h" -#include "ProcessHelper.h" +#include "Common/BaseProcess.h" +#include "PostProcessing/ProcessHelper.h" class FindInstancesProcessTest; namespace Assimp { diff --git a/thirdparty/assimp/code/FindInvalidDataProcess.cpp b/thirdparty/assimp/code/PostProcessing/FindInvalidDataProcess.cpp index 433f042448..433f042448 100644 --- a/thirdparty/assimp/code/FindInvalidDataProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/FindInvalidDataProcess.cpp diff --git a/thirdparty/assimp/code/FindInvalidDataProcess.h b/thirdparty/assimp/code/PostProcessing/FindInvalidDataProcess.h index 8504fb7b1f..ce7375f34f 100644 --- a/thirdparty/assimp/code/FindInvalidDataProcess.h +++ b/thirdparty/assimp/code/PostProcessing/FindInvalidDataProcess.h @@ -46,7 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FINDINVALIDDATA_H_INC #define AI_FINDINVALIDDATA_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/types.h> #include <assimp/anim.h> diff --git a/thirdparty/assimp/code/FixNormalsStep.cpp b/thirdparty/assimp/code/PostProcessing/FixNormalsStep.cpp index bbbe6899b4..bbbe6899b4 100644 --- a/thirdparty/assimp/code/FixNormalsStep.cpp +++ b/thirdparty/assimp/code/PostProcessing/FixNormalsStep.cpp diff --git a/thirdparty/assimp/code/FixNormalsStep.h b/thirdparty/assimp/code/PostProcessing/FixNormalsStep.h index 6be27faef6..f60ce596a4 100644 --- a/thirdparty/assimp/code/FixNormalsStep.h +++ b/thirdparty/assimp/code/PostProcessing/FixNormalsStep.h @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FIXNORMALSPROCESS_H_INC #define AI_FIXNORMALSPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" struct aiMesh; diff --git a/thirdparty/assimp/code/PostProcessing/GenBoundingBoxesProcess.cpp b/thirdparty/assimp/code/PostProcessing/GenBoundingBoxesProcess.cpp new file mode 100644 index 0000000000..c013454fc3 --- /dev/null +++ b/thirdparty/assimp/code/PostProcessing/GenBoundingBoxesProcess.cpp @@ -0,0 +1,115 @@ +/* +--------------------------------------------------------------------------- +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 ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS + +#include "PostProcessing/GenBoundingBoxesProcess.h" + +#include <assimp/postprocess.h> +#include <assimp/scene.h> + +namespace Assimp { + +GenBoundingBoxesProcess::GenBoundingBoxesProcess() +: BaseProcess() { + +} + +GenBoundingBoxesProcess::~GenBoundingBoxesProcess() { + // empty +} + +bool GenBoundingBoxesProcess::IsActive(unsigned int pFlags) const { + return 0 != ( pFlags & aiProcess_GenBoundingBoxes ); +} + +void checkMesh(aiMesh* mesh, aiVector3D& min, aiVector3D& max) { + ai_assert(nullptr != mesh); + + if (0 == mesh->mNumVertices) { + return; + } + + for (unsigned int i = 0; i < mesh->mNumVertices; ++i) { + const aiVector3D &pos = mesh->mVertices[i]; + if (pos.x < min.x) { + min.x = pos.x; + } + if (pos.y < min.y) { + min.y = pos.y; + } + if (pos.z < min.z) { + min.z = pos.z; + } + + if (pos.x > max.x) { + max.x = pos.x; + } + if (pos.y > max.y) { + max.y = pos.y; + } + if (pos.z > max.z) { + max.z = pos.z; + } + } +} + +void GenBoundingBoxesProcess::Execute(aiScene* pScene) { + if (nullptr == pScene) { + return; + } + + for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) { + aiMesh* mesh = pScene->mMeshes[i]; + if (nullptr == mesh) { + continue; + } + + aiVector3D min(999999, 999999, 999999), max(-999999, -999999, -999999); + checkMesh(mesh, min, max); + mesh->mAABB.mMin = min; + mesh->mAABB.mMax = max; + } +} + +} // Namespace Assimp + +#endif // ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS diff --git a/thirdparty/assimp/code/PostProcessing/GenBoundingBoxesProcess.h b/thirdparty/assimp/code/PostProcessing/GenBoundingBoxesProcess.h new file mode 100644 index 0000000000..4b43c82a42 --- /dev/null +++ b/thirdparty/assimp/code/PostProcessing/GenBoundingBoxesProcess.h @@ -0,0 +1,76 @@ +/* +--------------------------------------------------------------------------- +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. +--------------------------------------------------------------------------- +*/ + +/** @file Defines a post-processing step to generate Axis-aligned bounding + * volumes for all meshes. + */ + +#pragma once + +#ifndef AI_GENBOUNDINGBOXESPROCESS_H_INC +#define AI_GENBOUNDINGBOXESPROCESS_H_INC + +#ifndef ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS + +#include "Common/BaseProcess.h" + +namespace Assimp { + +/** Post-processing process to find axis-aligned bounding volumes for amm meshes + * used in a scene + */ +class ASSIMP_API GenBoundingBoxesProcess : public BaseProcess { +public: + /// The class constructor. + GenBoundingBoxesProcess(); + /// The class destructor. + ~GenBoundingBoxesProcess(); + /// Will return true, if aiProcess_GenBoundingBoxes is defined. + bool IsActive(unsigned int pFlags) const override; + /// The execution callback. + void Execute(aiScene* pScene) override; +}; + +} // Namespace Assimp + +#endif // #ifndef ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS + +#endif // AI_GENBOUNDINGBOXESPROCESS_H_INC diff --git a/thirdparty/assimp/code/GenFaceNormalsProcess.cpp b/thirdparty/assimp/code/PostProcessing/GenFaceNormalsProcess.cpp index 028334dec7..028334dec7 100644 --- a/thirdparty/assimp/code/GenFaceNormalsProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/GenFaceNormalsProcess.cpp diff --git a/thirdparty/assimp/code/GenFaceNormalsProcess.h b/thirdparty/assimp/code/PostProcessing/GenFaceNormalsProcess.h index c80ec9fddc..c641fd6353 100644 --- a/thirdparty/assimp/code/GenFaceNormalsProcess.h +++ b/thirdparty/assimp/code/PostProcessing/GenFaceNormalsProcess.h @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_GENFACENORMALPROCESS_H_INC #define AI_GENFACENORMALPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include <assimp/mesh.h> namespace Assimp diff --git a/thirdparty/assimp/code/GenVertexNormalsProcess.cpp b/thirdparty/assimp/code/PostProcessing/GenVertexNormalsProcess.cpp index 3f6c2f86bd..3f6c2f86bd 100644 --- a/thirdparty/assimp/code/GenVertexNormalsProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/GenVertexNormalsProcess.cpp diff --git a/thirdparty/assimp/code/GenVertexNormalsProcess.h b/thirdparty/assimp/code/PostProcessing/GenVertexNormalsProcess.h index 9142ad26f5..2ceee17e85 100644 --- a/thirdparty/assimp/code/GenVertexNormalsProcess.h +++ b/thirdparty/assimp/code/PostProcessing/GenVertexNormalsProcess.h @@ -45,24 +45,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_GENVERTEXNORMALPROCESS_H_INC #define AI_GENVERTEXNORMALPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/assbin_chunks.h" +#include "Common/BaseProcess.h" + #include <assimp/mesh.h> +// Forward declarations class GenNormalsTest; namespace Assimp { // --------------------------------------------------------------------------- -/** The GenFaceNormalsProcess computes vertex normals for all vertizes +/** The GenFaceNormalsProcess computes vertex normals for all vertices */ -class ASSIMP_API GenVertexNormalsProcess : public BaseProcess -{ +class ASSIMP_API GenVertexNormalsProcess : public BaseProcess { public: - GenVertexNormalsProcess(); ~GenVertexNormalsProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag. * @param pFlags The processing flags the importer was called with. @@ -88,13 +88,10 @@ public: // setter for configMaxAngle - inline void SetMaxSmoothAngle(ai_real f) - { + inline void SetMaxSmoothAngle(ai_real f) { configMaxAngle =f; } -public: - // ------------------------------------------------------------------- /** Computes normals for a specific mesh * @param pcMesh Mesh @@ -104,7 +101,6 @@ public: bool GenMeshVertexNormals (aiMesh* pcMesh, unsigned int meshIndex); private: - /** Configuration option: maximum smoothing angle, in radians*/ ai_real configMaxAngle; mutable bool force_ = false; diff --git a/thirdparty/assimp/code/ImproveCacheLocality.cpp b/thirdparty/assimp/code/PostProcessing/ImproveCacheLocality.cpp index ace9d95ff8..d0a016fa42 100644 --- a/thirdparty/assimp/code/ImproveCacheLocality.cpp +++ b/thirdparty/assimp/code/PostProcessing/ImproveCacheLocality.cpp @@ -45,14 +45,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * <br> * The algorithm is roughly basing on this paper: * http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf - * .. although overdraw rduction isn't implemented yet ... + * .. although overdraw reduction isn't implemented yet ... */ - - // internal headers -#include "ImproveCacheLocality.h" -#include "VertexTriangleAdjacency.h" +#include "PostProcessing/ImproveCacheLocality.h" +#include "Common/VertexTriangleAdjacency.h" + #include <assimp/StringUtils.h> #include <assimp/postprocess.h> #include <assimp/scene.h> @@ -64,36 +63,33 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer -ImproveCacheLocalityProcess::ImproveCacheLocalityProcess() { - configCacheDepth = PP_ICL_PTCACHE_SIZE; +ImproveCacheLocalityProcess::ImproveCacheLocalityProcess() +: mConfigCacheDepth(PP_ICL_PTCACHE_SIZE) { + // empty } // ------------------------------------------------------------------------------------------------ // Destructor, private as well -ImproveCacheLocalityProcess::~ImproveCacheLocalityProcess() -{ +ImproveCacheLocalityProcess::~ImproveCacheLocalityProcess() { // nothing to do here } // ------------------------------------------------------------------------------------------------ // Returns whether the processing step is present in the given flag field. -bool ImproveCacheLocalityProcess::IsActive( unsigned int pFlags) const -{ +bool ImproveCacheLocalityProcess::IsActive( unsigned int pFlags) const { return (pFlags & aiProcess_ImproveCacheLocality) != 0; } // ------------------------------------------------------------------------------------------------ // Setup configuration -void ImproveCacheLocalityProcess::SetupProperties(const Importer* pImp) -{ +void ImproveCacheLocalityProcess::SetupProperties(const Importer* pImp) { // AI_CONFIG_PP_ICL_PTCACHE_SIZE controls the target cache size for the optimizer - configCacheDepth = pImp->GetPropertyInteger(AI_CONFIG_PP_ICL_PTCACHE_SIZE,PP_ICL_PTCACHE_SIZE); + mConfigCacheDepth = pImp->GetPropertyInteger(AI_CONFIG_PP_ICL_PTCACHE_SIZE,PP_ICL_PTCACHE_SIZE); } // ------------------------------------------------------------------------------------------------ // Executes the post processing step on the given imported data. -void ImproveCacheLocalityProcess::Execute( aiScene* pScene) -{ +void ImproveCacheLocalityProcess::Execute( aiScene* pScene) { if (!pScene->mNumMeshes) { ASSIMP_LOG_DEBUG("ImproveCacheLocalityProcess skipped; there are no meshes"); return; @@ -103,7 +99,7 @@ void ImproveCacheLocalityProcess::Execute( aiScene* pScene) float out = 0.f; unsigned int numf = 0, numm = 0; - for( unsigned int a = 0; a < pScene->mNumMeshes; a++){ + for( unsigned int a = 0; a < pScene->mNumMeshes; ++a ){ const float res = ProcessMesh( pScene->mMeshes[a],a); if (res) { numf += pScene->mMeshes[a]->mNumFaces; @@ -121,44 +117,41 @@ void ImproveCacheLocalityProcess::Execute( aiScene* pScene) // ------------------------------------------------------------------------------------------------ // Improves the cache coherency of a specific mesh -float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshNum) -{ +ai_real ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshNum) { // TODO: rewrite this to use std::vector or boost::shared_array - ai_assert(NULL != pMesh); + ai_assert(nullptr != pMesh); // Check whether the input data is valid // - there must be vertices and faces // - all faces must be triangulated or we can't operate on them if (!pMesh->HasFaces() || !pMesh->HasPositions()) - return 0.f; + return static_cast<ai_real>(0.f); if (pMesh->mPrimitiveTypes != aiPrimitiveType_TRIANGLE) { ASSIMP_LOG_ERROR("This algorithm works on triangle meshes only"); - return 0.f; + return static_cast<ai_real>(0.f); } - if(pMesh->mNumVertices <= configCacheDepth) { - return 0.f; + if(pMesh->mNumVertices <= mConfigCacheDepth) { + return static_cast<ai_real>(0.f); } - float fACMR = 3.f; + ai_real fACMR = 3.f; const aiFace* const pcEnd = pMesh->mFaces+pMesh->mNumFaces; // Input ACMR is for logging purposes only if (!DefaultLogger::isNullLogger()) { - unsigned int* piFIFOStack = new unsigned int[configCacheDepth]; - memset(piFIFOStack,0xff,configCacheDepth*sizeof(unsigned int)); + unsigned int* piFIFOStack = new unsigned int[mConfigCacheDepth]; + memset(piFIFOStack,0xff,mConfigCacheDepth*sizeof(unsigned int)); unsigned int* piCur = piFIFOStack; - const unsigned int* const piCurEnd = piFIFOStack + configCacheDepth; + const unsigned int* const piCurEnd = piFIFOStack + mConfigCacheDepth; // count the number of cache misses unsigned int iCacheMisses = 0; for (const aiFace* pcFace = pMesh->mFaces;pcFace != pcEnd;++pcFace) { - for (unsigned int qq = 0; qq < 3;++qq) { bool bInCache = false; - for (unsigned int* pp = piFIFOStack;pp < piCurEnd;++pp) { if (*pp == pcFace->mIndices[qq]) { // the vertex is in cache @@ -176,7 +169,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh } } delete[] piFIFOStack; - fACMR = (float)iCacheMisses / pMesh->mNumFaces; + fACMR = (ai_real) iCacheMisses / pMesh->mNumFaces; if (3.0 == fACMR) { char szBuff[128]; // should be sufficiently large in every case @@ -185,7 +178,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh // smaller than 3.0 ... ai_snprintf(szBuff,128,"Mesh %u: Not suitable for vcache optimization",meshNum); ASSIMP_LOG_WARN(szBuff); - return 0.f; + return static_cast<ai_real>(0.f); } } @@ -258,7 +251,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh int ivdx = 0; int ics = 1; - int iStampCnt = configCacheDepth+1; + int iStampCnt = mConfigCacheDepth+1; while (ivdx >= 0) { unsigned int icnt = piNumTriPtrNoModify[ivdx]; @@ -294,7 +287,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh *piCSIter++ = dp; // if the vertex is not yet in cache, set its cache count - if (iStampCnt-piCachingStamps[dp] > configCacheDepth) { + if (iStampCnt-piCachingStamps[dp] > mConfigCacheDepth) { piCachingStamps[dp] = iStampCnt++; ++iCacheMisses; } @@ -319,7 +312,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh // will the vertex be in cache, even after fanning occurs? unsigned int tmp; - if ((tmp = iStampCnt-piCachingStamps[dp]) + 2*piNumTriPtr[dp] <= configCacheDepth) { + if ((tmp = iStampCnt-piCachingStamps[dp]) + 2*piNumTriPtr[dp] <= mConfigCacheDepth) { priority = tmp; } @@ -356,7 +349,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh } } } - float fACMR2 = 0.0f; + ai_real fACMR2 = 0.0f; if (!DefaultLogger::isNullLogger()) { fACMR2 = (float)iCacheMisses / pMesh->mNumFaces; diff --git a/thirdparty/assimp/code/ImproveCacheLocality.h b/thirdparty/assimp/code/PostProcessing/ImproveCacheLocality.h index 1b29ee0d6e..de25ecd9fb 100644 --- a/thirdparty/assimp/code/ImproveCacheLocality.h +++ b/thirdparty/assimp/code/PostProcessing/ImproveCacheLocality.h @@ -45,7 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_IMPROVECACHELOCALITY_H_INC #define AI_IMPROVECACHELOCALITY_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/types.h> struct aiMesh; @@ -87,12 +88,12 @@ protected: * @param pMesh The mesh to process. * @param meshNum Index of the mesh to process */ - float ProcessMesh( aiMesh* pMesh, unsigned int meshNum); + ai_real ProcessMesh( aiMesh* pMesh, unsigned int meshNum); private: //! Configuration parameter: specifies the size of the cache to //! optimize the vertex data for. - unsigned int configCacheDepth; + unsigned int mConfigCacheDepth; }; } // end of namespace Assimp diff --git a/thirdparty/assimp/code/JoinVerticesProcess.cpp b/thirdparty/assimp/code/PostProcessing/JoinVerticesProcess.cpp index 914ec05b46..914ec05b46 100644 --- a/thirdparty/assimp/code/JoinVerticesProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/JoinVerticesProcess.cpp diff --git a/thirdparty/assimp/code/JoinVerticesProcess.h b/thirdparty/assimp/code/PostProcessing/JoinVerticesProcess.h index 66fa362de2..e017ae62db 100644 --- a/thirdparty/assimp/code/JoinVerticesProcess.h +++ b/thirdparty/assimp/code/PostProcessing/JoinVerticesProcess.h @@ -45,7 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_JOINVERTICESPROCESS_H_INC #define AI_JOINVERTICESPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/types.h> struct aiMesh; @@ -61,13 +62,11 @@ namespace Assimp * erases all but one of the copies. This usually reduces the number of vertices * in a mesh by a serious amount and is the standard form to render a mesh. */ -class ASSIMP_API JoinVerticesProcess : public BaseProcess -{ +class ASSIMP_API JoinVerticesProcess : public BaseProcess { public: JoinVerticesProcess(); ~JoinVerticesProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag field. * @param pFlags The processing flags the importer was called with. A bitwise @@ -83,15 +82,12 @@ public: */ void Execute( aiScene* pScene); -public: // ------------------------------------------------------------------- /** Unites identical vertices in the given mesh. * @param pMesh The mesh to process. * @param meshIndex Index of the mesh to process */ int ProcessMesh( aiMesh* pMesh, unsigned int meshIndex); - -private: }; } // end of namespace Assimp diff --git a/thirdparty/assimp/code/LimitBoneWeightsProcess.cpp b/thirdparty/assimp/code/PostProcessing/LimitBoneWeightsProcess.cpp index d560f19287..d560f19287 100644 --- a/thirdparty/assimp/code/LimitBoneWeightsProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/LimitBoneWeightsProcess.cpp diff --git a/thirdparty/assimp/code/LimitBoneWeightsProcess.h b/thirdparty/assimp/code/PostProcessing/LimitBoneWeightsProcess.h index 3602fd8edf..73c2a68d53 100644 --- a/thirdparty/assimp/code/LimitBoneWeightsProcess.h +++ b/thirdparty/assimp/code/PostProcessing/LimitBoneWeightsProcess.h @@ -44,14 +44,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_LIMITBONEWEIGHTSPROCESS_H_INC #define AI_LIMITBONEWEIGHTSPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" +// Forward declarations struct aiMesh; class LimitBoneWeightsTest; -namespace Assimp -{ +namespace Assimp { // NOTE: If you change these limits, don't forget to change the // corresponding values in all Assimp ports @@ -72,14 +72,11 @@ namespace Assimp * The other weights on this bone are then renormalized to assure the sum weight * to be 1. */ -class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess -{ +class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess { public: - LimitBoneWeightsProcess(); ~LimitBoneWeightsProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag. * @param pFlags The processing flags the importer was called with. @@ -96,8 +93,6 @@ public: */ void SetupProperties(const Importer* pImp); -public: - // ------------------------------------------------------------------- /** Limits the bone weight count for all vertices in the given mesh. * @param pMesh The mesh to process. @@ -111,34 +106,29 @@ public: */ void Execute( aiScene* pScene); - -public: - // ------------------------------------------------------------------- /** Describes a bone weight on a vertex */ - struct Weight - { + struct Weight { unsigned int mBone; ///< Index of the bone float mWeight; ///< Weight of that bone on this vertex Weight() AI_NO_EXCEPT : mBone(0) - , mWeight(0.0f) - { } + , mWeight(0.0f) { + // empty + } Weight( unsigned int pBone, float pWeight) - { - mBone = pBone; - mWeight = pWeight; + : mBone(pBone) + , mWeight(pWeight) { + // empty } /** Comparison operator to sort bone weights by descending weight */ - bool operator < (const Weight& pWeight) const - { + bool operator < (const Weight& pWeight) const { return mWeight > pWeight.mWeight; } }; -public: /** Maximum number of bones influencing any single vertex. */ unsigned int mMaxWeights; }; diff --git a/thirdparty/assimp/code/MakeVerboseFormat.cpp b/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.cpp index 50ff5ed93d..50ff5ed93d 100644 --- a/thirdparty/assimp/code/MakeVerboseFormat.cpp +++ b/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.cpp diff --git a/thirdparty/assimp/code/MakeVerboseFormat.h b/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.h index d12db63ae1..1adf8e2f69 100644 --- a/thirdparty/assimp/code/MakeVerboseFormat.h +++ b/thirdparty/assimp/code/PostProcessing/MakeVerboseFormat.h @@ -46,7 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MAKEVERBOSEFORMAT_H_INC #define AI_MAKEVERBOSEFORMAT_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + struct aiMesh; namespace Assimp { diff --git a/thirdparty/assimp/code/OptimizeGraph.cpp b/thirdparty/assimp/code/PostProcessing/OptimizeGraph.cpp index add9ab79e1..5db51f58b6 100644 --- a/thirdparty/assimp/code/OptimizeGraph.cpp +++ b/thirdparty/assimp/code/PostProcessing/OptimizeGraph.cpp @@ -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, diff --git a/thirdparty/assimp/code/OptimizeGraph.h b/thirdparty/assimp/code/PostProcessing/OptimizeGraph.h index e5bbed7679..82cc5db3fe 100644 --- a/thirdparty/assimp/code/OptimizeGraph.h +++ b/thirdparty/assimp/code/PostProcessing/OptimizeGraph.h @@ -46,13 +46,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_OPTIMIZEGRAPHPROCESS_H_INC #define AI_OPTIMIZEGRAPHPROCESS_H_INC -#include "BaseProcess.h" -#include "ProcessHelper.h" +#include "Common/BaseProcess.h" +#include "PostProcessing/ProcessHelper.h" + #include <assimp/types.h> + #include <set> +// Forward declarations struct aiMesh; + class OptimizeGraphProcessTest; + namespace Assimp { // ----------------------------------------------------------------------------- @@ -64,14 +69,11 @@ namespace Assimp { * @see aiProcess_OptimizeGraph for a detailed description of the * algorithm being applied. */ -class OptimizeGraphProcess : public BaseProcess -{ +class OptimizeGraphProcess : public BaseProcess { public: - OptimizeGraphProcess(); ~OptimizeGraphProcess(); -public: // ------------------------------------------------------------------- bool IsActive( unsigned int pFlags) const; @@ -81,14 +83,12 @@ public: // ------------------------------------------------------------------- void SetupProperties(const Importer* pImp); - // ------------------------------------------------------------------- /** @brief Add a list of node names to be locked and not modified. * @param in List of nodes. See #AI_CONFIG_PP_OG_EXCLUDE_LIST for * format explanations. */ - inline void AddLockedNodeList(std::string& in) - { + inline void AddLockedNodeList(std::string& in) { ConvertListToStrings (in,locked_nodes); } @@ -96,8 +96,7 @@ public: /** @brief Add another node to be locked and not modified. * @param name Name to be locked */ - inline void AddLockedNode(std::string& name) - { + inline void AddLockedNode(std::string& name) { locked_nodes.push_back(name); } @@ -105,25 +104,21 @@ public: /** @brief Remove a node from the list of locked nodes. * @param name Name to be unlocked */ - inline void RemoveLockedNode(std::string& name) - { + inline void RemoveLockedNode(std::string& name) { locked_nodes.remove(name); } protected: - void CollectNewChildren(aiNode* nd, std::list<aiNode*>& nodes); void FindInstancedMeshes (aiNode* pNode); private: - #ifdef AI_OG_USE_HASHING typedef std::set<unsigned int> LockedSetType; #else typedef std::set<std::string> LockedSetType; #endif - //! Scene we're working with aiScene* mScene; diff --git a/thirdparty/assimp/code/OptimizeMeshes.cpp b/thirdparty/assimp/code/PostProcessing/OptimizeMeshes.cpp index 3f6765f6ca..3f6765f6ca 100644 --- a/thirdparty/assimp/code/OptimizeMeshes.cpp +++ b/thirdparty/assimp/code/PostProcessing/OptimizeMeshes.cpp diff --git a/thirdparty/assimp/code/OptimizeMeshes.h b/thirdparty/assimp/code/PostProcessing/OptimizeMeshes.h index 9f46f349b4..dec4ab52de 100644 --- a/thirdparty/assimp/code/OptimizeMeshes.h +++ b/thirdparty/assimp/code/PostProcessing/OptimizeMeshes.h @@ -46,8 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_OPTIMIZEMESHESPROCESS_H_INC #define AI_OPTIMIZEMESHESPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/types.h> + #include <vector> struct aiMesh; @@ -64,16 +66,14 @@ namespace Assimp { * * @note Instanced meshes are currently not processed. */ -class OptimizeMeshesProcess : public BaseProcess -{ +class OptimizeMeshesProcess : public BaseProcess { public: /// @brief The class constructor. OptimizeMeshesProcess(); - /// @brief The class destcructor, + /// @brief The class destructor. ~OptimizeMeshesProcess(); - /** @brief Internal utility to store additional mesh info */ struct MeshInfo { diff --git a/thirdparty/assimp/code/PretransformVertices.cpp b/thirdparty/assimp/code/PostProcessing/PretransformVertices.cpp index 52001a0578..52001a0578 100644 --- a/thirdparty/assimp/code/PretransformVertices.cpp +++ b/thirdparty/assimp/code/PostProcessing/PretransformVertices.cpp diff --git a/thirdparty/assimp/code/PretransformVertices.h b/thirdparty/assimp/code/PostProcessing/PretransformVertices.h index b7329af130..b2982951e0 100644 --- a/thirdparty/assimp/code/PretransformVertices.h +++ b/thirdparty/assimp/code/PostProcessing/PretransformVertices.h @@ -47,13 +47,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_PRETRANSFORMVERTICES_H_INC #define AI_PRETRANSFORMVERTICES_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/mesh.h> + #include <list> #include <vector> +// Forward declarations struct aiNode; + class PretransformVerticesTest; + namespace Assimp { // --------------------------------------------------------------------------- @@ -80,10 +85,10 @@ public: // ------------------------------------------------------------------- /** @brief Toggle the 'keep hierarchy' option - * @param d hm ... difficult to guess what this means, hu!? + * @param keep true for keep configuration. */ - void KeepHierarchy(bool d) { - configKeepHierarchy = d; + void KeepHierarchy(bool keep) { + configKeepHierarchy = keep; } // ------------------------------------------------------------------- @@ -148,8 +153,6 @@ private: // Build reference counters for all meshes void BuildMeshRefCountArray(aiNode* nd, unsigned int * refs); - - //! Configuration option: keep scene hierarchy as long as possible bool configKeepHierarchy; bool configNormalize; diff --git a/thirdparty/assimp/code/ProcessHelper.cpp b/thirdparty/assimp/code/PostProcessing/ProcessHelper.cpp index 59869fdff7..59869fdff7 100644 --- a/thirdparty/assimp/code/ProcessHelper.cpp +++ b/thirdparty/assimp/code/PostProcessing/ProcessHelper.cpp diff --git a/thirdparty/assimp/code/ProcessHelper.h b/thirdparty/assimp/code/PostProcessing/ProcessHelper.h index c59f3217bf..0afcc41420 100644 --- a/thirdparty/assimp/code/ProcessHelper.h +++ b/thirdparty/assimp/code/PostProcessing/ProcessHelper.h @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assimp/scene.h> #include <assimp/SpatialSort.h> -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include <assimp/ParsingUtils.h> #include <list> diff --git a/thirdparty/assimp/code/RemoveRedundantMaterials.cpp b/thirdparty/assimp/code/PostProcessing/RemoveRedundantMaterials.cpp index 632bdca3fe..49ec8f5c47 100644 --- a/thirdparty/assimp/code/RemoveRedundantMaterials.cpp +++ b/thirdparty/assimp/code/PostProcessing/RemoveRedundantMaterials.cpp @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "RemoveRedundantMaterials.h" #include <assimp/ParsingUtils.h> #include "ProcessHelper.h" -#include "MaterialSystem.h" +#include "Material/MaterialSystem.h" #include <stdio.h> using namespace Assimp; @@ -57,7 +57,7 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer RemoveRedundantMatsProcess::RemoveRedundantMatsProcess() -: configFixedMaterials() { +: mConfigFixedMaterials() { // nothing to do here } @@ -80,7 +80,7 @@ bool RemoveRedundantMatsProcess::IsActive( unsigned int pFlags) const void RemoveRedundantMatsProcess::SetupProperties(const Importer* pImp) { // Get value of AI_CONFIG_PP_RRM_EXCLUDE_LIST - configFixedMaterials = pImp->GetPropertyString(AI_CONFIG_PP_RRM_EXCLUDE_LIST,""); + mConfigFixedMaterials = pImp->GetPropertyString(AI_CONFIG_PP_RRM_EXCLUDE_LIST,""); } // ------------------------------------------------------------------------------------------------ @@ -100,10 +100,10 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene) // If a list of materials to be excluded was given, match the list with // our imported materials and 'salt' all positive matches to ensure that // we get unique hashes later. - if (configFixedMaterials.length()) { + if (mConfigFixedMaterials.length()) { std::list<std::string> strings; - ConvertListToStrings(configFixedMaterials,strings); + ConvertListToStrings(mConfigFixedMaterials,strings); for (unsigned int i = 0; i < pScene->mNumMaterials;++i) { aiMaterial* mat = pScene->mMaterials[i]; diff --git a/thirdparty/assimp/code/RemoveRedundantMaterials.h b/thirdparty/assimp/code/PostProcessing/RemoveRedundantMaterials.h index dbd4d44cc0..1f32a0abfb 100644 --- a/thirdparty/assimp/code/RemoveRedundantMaterials.h +++ b/thirdparty/assimp/code/PostProcessing/RemoveRedundantMaterials.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_REMOVEREDUNDANTMATERIALS_H_INC #define AI_REMOVEREDUNDANTMATERIALS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include <assimp/mesh.h> class RemoveRedundantMatsTest; @@ -57,8 +57,7 @@ namespace Assimp { /** RemoveRedundantMatsProcess: Post-processing step to remove redundant * materials from the imported scene. */ -class ASSIMP_API RemoveRedundantMatsProcess : public BaseProcess -{ +class ASSIMP_API RemoveRedundantMatsProcess : public BaseProcess { public: /// The default class constructor. RemoveRedundantMatsProcess(); @@ -66,7 +65,6 @@ public: /// The class destructor. ~RemoveRedundantMatsProcess(); -public: // ------------------------------------------------------------------- // Check whether step is active bool IsActive( unsigned int pFlags) const; @@ -79,27 +77,25 @@ public: // Setup import settings void SetupProperties(const Importer* pImp); - // ------------------------------------------------------------------- - /** @brief Set list of fixed (unmutable) materials + /** @brief Set list of fixed (inmutable) materials * @param fixed See #AI_CONFIG_PP_RRM_EXCLUDE_LIST */ void SetFixedMaterialsString(const std::string& fixed = "") { - configFixedMaterials = fixed; + mConfigFixedMaterials = fixed; } // ------------------------------------------------------------------- - /** @brief Get list of fixed (unmutable) materials + /** @brief Get list of fixed (inmutable) materials * @return See #AI_CONFIG_PP_RRM_EXCLUDE_LIST */ const std::string& GetFixedMaterialsString() const { - return configFixedMaterials; + return mConfigFixedMaterials; } private: - //! Configuration option: list of all fixed materials - std::string configFixedMaterials; + std::string mConfigFixedMaterials; }; } // end of namespace Assimp diff --git a/thirdparty/assimp/code/RemoveVCProcess.cpp b/thirdparty/assimp/code/PostProcessing/RemoveVCProcess.cpp index 99fd47a3aa..99fd47a3aa 100644 --- a/thirdparty/assimp/code/RemoveVCProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/RemoveVCProcess.cpp diff --git a/thirdparty/assimp/code/RemoveVCProcess.h b/thirdparty/assimp/code/PostProcessing/RemoveVCProcess.h index 617d7b9b20..7bb21a8330 100644 --- a/thirdparty/assimp/code/RemoveVCProcess.h +++ b/thirdparty/assimp/code/PostProcessing/RemoveVCProcess.h @@ -44,7 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_REMOVEVCPROCESS_H_INCLUDED #define AI_REMOVEVCPROCESS_H_INCLUDED -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include <assimp/mesh.h> class RemoveVCProcessTest; diff --git a/thirdparty/assimp/code/ScaleProcess.cpp b/thirdparty/assimp/code/PostProcessing/ScaleProcess.cpp index 6d458c4b11..6d458c4b11 100644 --- a/thirdparty/assimp/code/ScaleProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/ScaleProcess.cpp diff --git a/thirdparty/assimp/code/ScaleProcess.h b/thirdparty/assimp/code/PostProcessing/ScaleProcess.h index 55146ae064..2567378759 100644 --- a/thirdparty/assimp/code/ScaleProcess.h +++ b/thirdparty/assimp/code/PostProcessing/ScaleProcess.h @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once -#include "BaseProcess.h" +#include "Common/BaseProcess.h" struct aiNode; diff --git a/thirdparty/assimp/code/SortByPTypeProcess.cpp b/thirdparty/assimp/code/PostProcessing/SortByPTypeProcess.cpp index 2e0cc54004..be8405a17b 100644 --- a/thirdparty/assimp/code/SortByPTypeProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/SortByPTypeProcess.cpp @@ -57,8 +57,8 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer SortByPTypeProcess::SortByPTypeProcess() -{ - configRemoveMeshes = 0; +: mConfigRemoveMeshes( 0 ) { + // empty } // ------------------------------------------------------------------------------------------------ @@ -78,7 +78,7 @@ bool SortByPTypeProcess::IsActive( unsigned int pFlags) const // ------------------------------------------------------------------------------------------------ void SortByPTypeProcess::SetupProperties(const Importer* pImp) { - configRemoveMeshes = pImp->GetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE,0); + mConfigRemoveMeshes = pImp->GetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE,0); } // ------------------------------------------------------------------------------------------------ @@ -172,7 +172,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene) { } if (1 == num) { - if (!(configRemoveMeshes & mesh->mPrimitiveTypes)) { + if (!(mConfigRemoveMeshes & mesh->mPrimitiveTypes)) { *meshIdx = static_cast<unsigned int>( outMeshes.size() ); outMeshes.push_back(mesh); } else { @@ -206,7 +206,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene) { VertexWeightTable* avw = ComputeVertexBoneWeightTable(mesh); for (unsigned int real = 0; real < 4; ++real,++meshIdx) { - if ( !aiNumPerPType[real] || configRemoveMeshes & (1u << real)) + if ( !aiNumPerPType[real] || mConfigRemoveMeshes & (1u << real)) { continue; } @@ -392,10 +392,10 @@ void SortByPTypeProcess::Execute( aiScene* pScene) { { char buffer[1024]; ::ai_snprintf(buffer,1024,"Points: %u%s, Lines: %u%s, Triangles: %u%s, Polygons: %u%s (Meshes, X = removed)", - aiNumMeshesPerPType[0], ((configRemoveMeshes & aiPrimitiveType_POINT) ? "X" : ""), - aiNumMeshesPerPType[1], ((configRemoveMeshes & aiPrimitiveType_LINE) ? "X" : ""), - aiNumMeshesPerPType[2], ((configRemoveMeshes & aiPrimitiveType_TRIANGLE) ? "X" : ""), - aiNumMeshesPerPType[3], ((configRemoveMeshes & aiPrimitiveType_POLYGON) ? "X" : "")); + aiNumMeshesPerPType[0], ((mConfigRemoveMeshes & aiPrimitiveType_POINT) ? "X" : ""), + aiNumMeshesPerPType[1], ((mConfigRemoveMeshes & aiPrimitiveType_LINE) ? "X" : ""), + aiNumMeshesPerPType[2], ((mConfigRemoveMeshes & aiPrimitiveType_TRIANGLE) ? "X" : ""), + aiNumMeshesPerPType[3], ((mConfigRemoveMeshes & aiPrimitiveType_POLYGON) ? "X" : "")); ASSIMP_LOG_INFO(buffer); ASSIMP_LOG_DEBUG("SortByPTypeProcess finished"); } diff --git a/thirdparty/assimp/code/SortByPTypeProcess.h b/thirdparty/assimp/code/PostProcessing/SortByPTypeProcess.h index c9d9924d8f..1d7ccfc152 100644 --- a/thirdparty/assimp/code/SortByPTypeProcess.h +++ b/thirdparty/assimp/code/PostProcessing/SortByPTypeProcess.h @@ -45,10 +45,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_SORTBYPTYPEPROCESS_H_INC #define AI_SORTBYPTYPEPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include <assimp/mesh.h> class SortByPTypeProcessTest; + namespace Assimp { @@ -57,14 +58,11 @@ namespace Assimp { * A mesh with 5 lines, 3 points and 145 triangles would be split in 3 * submeshes. */ -class ASSIMP_API SortByPTypeProcess : public BaseProcess -{ +class ASSIMP_API SortByPTypeProcess : public BaseProcess { public: - SortByPTypeProcess(); ~SortByPTypeProcess(); -public: // ------------------------------------------------------------------- bool IsActive( unsigned int pFlags) const; @@ -75,8 +73,7 @@ public: void SetupProperties(const Importer* pImp); private: - - int configRemoveMeshes; + int mConfigRemoveMeshes; }; diff --git a/thirdparty/assimp/code/SplitLargeMeshes.cpp b/thirdparty/assimp/code/PostProcessing/SplitLargeMeshes.cpp index 1797b28d5a..1797b28d5a 100644 --- a/thirdparty/assimp/code/SplitLargeMeshes.cpp +++ b/thirdparty/assimp/code/PostProcessing/SplitLargeMeshes.cpp diff --git a/thirdparty/assimp/code/SplitLargeMeshes.h b/thirdparty/assimp/code/PostProcessing/SplitLargeMeshes.h index 77f089ce7e..3f90576ea9 100644 --- a/thirdparty/assimp/code/SplitLargeMeshes.h +++ b/thirdparty/assimp/code/PostProcessing/SplitLargeMeshes.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, @@ -40,21 +39,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -/** @file Defines a post processing step to split large meshes into submeshes +/** @file Defines a post processing step to split large meshes into sub-meshes */ #ifndef AI_SPLITLARGEMESHES_H_INC #define AI_SPLITLARGEMESHES_H_INC #include <vector> -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include <assimp/mesh.h> #include <assimp/scene.h> +// Forward declarations class SplitLargeMeshesTest; -namespace Assimp -{ +namespace Assimp { class SplitLargeMeshesProcess_Triangle; class SplitLargeMeshesProcess_Vertex; diff --git a/thirdparty/assimp/code/TextureTransform.cpp b/thirdparty/assimp/code/PostProcessing/TextureTransform.cpp index 8ae2ba7218..8ae2ba7218 100644 --- a/thirdparty/assimp/code/TextureTransform.cpp +++ b/thirdparty/assimp/code/PostProcessing/TextureTransform.cpp diff --git a/thirdparty/assimp/code/TextureTransform.h b/thirdparty/assimp/code/PostProcessing/TextureTransform.h index c556ff5d8c..2a5d623d7f 100644 --- a/thirdparty/assimp/code/TextureTransform.h +++ b/thirdparty/assimp/code/PostProcessing/TextureTransform.h @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_TEXTURE_TRANSFORM_H_INCLUDED #include <assimp/BaseImporter.h> -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include <assimp/material.h> #include <list> diff --git a/thirdparty/assimp/code/TriangulateProcess.cpp b/thirdparty/assimp/code/PostProcessing/TriangulateProcess.cpp index 0f68f47ddb..1040836bbe 100644 --- a/thirdparty/assimp/code/TriangulateProcess.cpp +++ b/thirdparty/assimp/code/PostProcessing/TriangulateProcess.cpp @@ -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, @@ -60,9 +58,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * a file */ #ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS -#include "TriangulateProcess.h" -#include "ProcessHelper.h" -#include "PolyTools.h" + +#include "PostProcessing/TriangulateProcess.h" +#include "PostProcessing/ProcessHelper.h" +#include "Common/PolyTools.h" + #include <memory> //#define AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING diff --git a/thirdparty/assimp/code/TriangulateProcess.h b/thirdparty/assimp/code/PostProcessing/TriangulateProcess.h index 47bd2115ad..916b5103dd 100644 --- a/thirdparty/assimp/code/TriangulateProcess.h +++ b/thirdparty/assimp/code/PostProcessing/TriangulateProcess.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_TRIANGULATEPROCESS_H_INC #define AI_TRIANGULATEPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" struct aiMesh; @@ -59,14 +59,11 @@ namespace Assimp { * into triangles. You usually want this to happen because the graphics cards * need their data as triangles. */ -class ASSIMP_API TriangulateProcess : public BaseProcess -{ +class ASSIMP_API TriangulateProcess : public BaseProcess { public: - TriangulateProcess(); ~TriangulateProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag field. * @param pFlags The processing flags the importer was called with. A bitwise @@ -82,7 +79,6 @@ public: */ void Execute( aiScene* pScene); -public: // ------------------------------------------------------------------- /** Triangulates the given mesh. * @param pMesh The mesh to triangulate. diff --git a/thirdparty/assimp/code/ValidateDataStructure.cpp b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp index 657b0361b7..712fd6943d 100644 --- a/thirdparty/assimp/code/ValidateDataStructure.cpp +++ b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp @@ -46,8 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * the data structure returned by Assimp. */ - - // internal headers #include "ValidateDataStructure.h" #include <assimp/BaseImporter.h> @@ -110,8 +108,8 @@ void ValidateDSProcess::ReportWarning(const char* msg,...) } // ------------------------------------------------------------------------------------------------ -inline int HasNameMatch(const aiString& in, aiNode* node) -{ +inline +int HasNameMatch(const aiString& in, aiNode* node) { int result = (node->mName == in ? 1 : 0 ); for (unsigned int i = 0; i < node->mNumChildren;++i) { result += HasNameMatch(in,node->mChildren[i]); @@ -121,9 +119,8 @@ inline int HasNameMatch(const aiString& in, aiNode* node) // ------------------------------------------------------------------------------------------------ template <typename T> -inline void ValidateDSProcess::DoValidation(T** parray, unsigned int size, - const char* firstName, const char* secondName) -{ +inline +void ValidateDSProcess::DoValidation(T** parray, unsigned int size, const char* firstName, const char* secondName) { // validate all entries if (size) { @@ -181,7 +178,8 @@ inline void ValidateDSProcess::DoValidationEx(T** parray, unsigned int size, // ------------------------------------------------------------------------------------------------ template <typename T> inline -void ValidateDSProcess::DoValidationWithNameCheck(T** array, unsigned int size, const char* firstName, const char* secondName) { +void ValidateDSProcess::DoValidationWithNameCheck(T** array, unsigned int size, const char* firstName, + const char* secondName) { // validate all entries DoValidationEx(array,size,firstName,secondName); @@ -201,9 +199,8 @@ void ValidateDSProcess::DoValidationWithNameCheck(T** array, unsigned int size, // ------------------------------------------------------------------------------------------------ // Executes the post processing step on the given imported data. -void ValidateDSProcess::Execute( aiScene* pScene) -{ - this->mScene = pScene; +void ValidateDSProcess::Execute( aiScene* pScene) { + mScene = pScene; ASSIMP_LOG_DEBUG("ValidateDataStructureProcess begin"); // validate the node graph of the scene @@ -516,13 +513,11 @@ void ValidateDSProcess::Validate( const aiMesh* pMesh) } // ------------------------------------------------------------------------------------------------ -void ValidateDSProcess::Validate( const aiMesh* pMesh, - const aiBone* pBone,float* afSum) -{ +void ValidateDSProcess::Validate( const aiMesh* pMesh, const aiBone* pBone,float* afSum) { this->Validate(&pBone->mName); if (!pBone->mNumWeights) { - ReportError("aiBone::mNumWeights is zero"); + //ReportError("aiBone::mNumWeights is zero"); } // check whether all vertices affected by this bone are valid @@ -563,9 +558,6 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation) else { ReportError("aiAnimation::mNumChannels is 0. At least one node animation channel must be there."); } - - // Animation duration is allowed to be zero in cases where the anim contains only a single key frame. - // if (!pAnimation->mDuration)this->ReportError("aiAnimation::mDuration is zero"); } // ------------------------------------------------------------------------------------------------ @@ -746,8 +738,9 @@ void ValidateDSProcess::Validate( const aiMaterial* pMaterial) "AI_MATKEY_SHININESS_STRENGTH key is 0.0"); } break; - default: ; - }; + default: + break; + } } if (AI_SUCCESS == aiGetMaterialFloat( pMaterial,AI_MATKEY_OPACITY,&fTemp) && (!fTemp || fTemp > 1.01)) { diff --git a/thirdparty/assimp/code/ValidateDataStructure.h b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.h index bd21e88545..0b891ef414 100644 --- a/thirdparty/assimp/code/ValidateDataStructure.h +++ b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.h @@ -48,7 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assimp/types.h> #include <assimp/material.h> -#include "BaseProcess.h" + +#include "Common/BaseProcess.h" struct aiBone; struct aiMesh; diff --git a/thirdparty/assimp/code/RawLoader.cpp b/thirdparty/assimp/code/RawLoader.cpp deleted file mode 100644 index d0da247e47..0000000000 --- a/thirdparty/assimp/code/RawLoader.cpp +++ /dev/null @@ -1,331 +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. ---------------------------------------------------------------------------- -*/ - -/** @file RawLoader.cpp - * @brief Implementation of the RAW importer class - */ - - -#ifndef ASSIMP_BUILD_NO_RAW_IMPORTER - -// internal headers -#include "RawLoader.h" -#include <assimp/ParsingUtils.h> -#include <assimp/fast_atof.h> -#include <memory> -#include <assimp/IOSystem.hpp> -#include <assimp/DefaultLogger.hpp> -#include <assimp/scene.h> -#include <assimp/importerdesc.h> - -using namespace Assimp; - -static const aiImporterDesc desc = { - "Raw Importer", - "", - "", - "", - aiImporterFlags_SupportTextFlavour, - 0, - 0, - 0, - 0, - "raw" -}; - -// ------------------------------------------------------------------------------------------------ -// Constructor to be privately used by Importer -RAWImporter::RAWImporter() -{} - -// ------------------------------------------------------------------------------------------------ -// Destructor, private as well -RAWImporter::~RAWImporter() -{} - -// ------------------------------------------------------------------------------------------------ -// Returns whether the class can handle the format of the given file. -bool RAWImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, bool /*checkSig*/) const -{ - return SimpleExtensionCheck(pFile,"raw"); -} - -// ------------------------------------------------------------------------------------------------ -const aiImporterDesc* RAWImporter::GetInfo () const -{ - return &desc; -} - -// ------------------------------------------------------------------------------------------------ -// Imports the given file into the given scene structure. -void RAWImporter::InternReadFile( const std::string& pFile, - aiScene* pScene, IOSystem* pIOHandler) -{ - std::unique_ptr<IOStream> file( pIOHandler->Open( pFile, "rb")); - - // Check whether we can read from the file - if( file.get() == NULL) { - throw DeadlyImportError( "Failed to open RAW file " + pFile + "."); - } - - // allocate storage and copy the contents of the file to a memory buffer - // (terminate it with zero) - std::vector<char> mBuffer2; - TextFileToBuffer(file.get(),mBuffer2); - const char* buffer = &mBuffer2[0]; - - // list of groups loaded from the file - std::vector< GroupInformation > outGroups(1,GroupInformation("<default>")); - std::vector< GroupInformation >::iterator curGroup = outGroups.begin(); - - // now read all lines - char line[4096]; - while (GetNextLine(buffer,line)) - { - // if the line starts with a non-numeric identifier, it marks - // the beginning of a new group - const char* sz = line;SkipSpaces(&sz); - if (IsLineEnd(*sz))continue; - if (!IsNumeric(*sz)) - { - const char* sz2 = sz; - while (!IsSpaceOrNewLine(*sz2))++sz2; - const unsigned int length = (unsigned int)(sz2-sz); - - // find an existing group with this name - for (std::vector< GroupInformation >::iterator it = outGroups.begin(), end = outGroups.end(); - it != end;++it) - { - if (length == (*it).name.length() && !::strcmp(sz,(*it).name.c_str())) - { - curGroup = it;sz2 = NULL; - break; - } - } - if (sz2) - { - outGroups.push_back(GroupInformation(std::string(sz,length))); - curGroup = outGroups.end()-1; - } - } - else - { - // there can be maximally 12 floats plus an extra texture file name - float data[12]; - unsigned int num; - for (num = 0; num < 12;++num) - { - if(!SkipSpaces(&sz) || !IsNumeric(*sz))break; - sz = fast_atoreal_move<float>(sz,data[num]); - } - if (num != 12 && num != 9) - { - ASSIMP_LOG_ERROR("A line may have either 9 or 12 floats and an optional texture"); - continue; - } - - MeshInformation* output = NULL; - - const char* sz2 = sz; - unsigned int length; - if (!IsLineEnd(*sz)) - { - while (!IsSpaceOrNewLine(*sz2))++sz2; - length = (unsigned int)(sz2-sz); - } - else if (9 == num) - { - sz = "%default%"; - length = 9; - } - else - { - sz = ""; - length = 0; - } - - // search in the list of meshes whether we have one with this texture - for (auto &mesh : (*curGroup).meshes) - { - if (length == mesh.name.length() && (length ? !::strcmp(sz, mesh.name.c_str()) : true)) - { - output = &mesh; - break; - } - } - // if we don't have the mesh, create it - if (!output) - { - (*curGroup).meshes.push_back(MeshInformation(std::string(sz,length))); - output = &((*curGroup).meshes.back()); - } - if (12 == num) - { - aiColor4D v(data[0],data[1],data[2],1.0f); - output->colors.push_back(v); - output->colors.push_back(v); - output->colors.push_back(v); - - output->vertices.push_back(aiVector3D(data[3],data[4],data[5])); - output->vertices.push_back(aiVector3D(data[6],data[7],data[8])); - output->vertices.push_back(aiVector3D(data[9],data[10],data[11])); - } - else - { - output->vertices.push_back(aiVector3D(data[0],data[1],data[2])); - output->vertices.push_back(aiVector3D(data[3],data[4],data[5])); - output->vertices.push_back(aiVector3D(data[6],data[7],data[8])); - } - } - } - - pScene->mRootNode = new aiNode(); - pScene->mRootNode->mName.Set("<RawRoot>"); - - // count the number of valid groups - // (meshes can't be empty) - for (auto & outGroup : outGroups) - { - if (!outGroup.meshes.empty()) - { - ++pScene->mRootNode->mNumChildren; - pScene->mNumMeshes += (unsigned int) outGroup.meshes.size(); - } - } - - if (!pScene->mNumMeshes) - { - throw DeadlyImportError("RAW: No meshes loaded. The file seems to be corrupt or empty."); - } - - pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]; - aiNode** cc; - if (1 == pScene->mRootNode->mNumChildren) - { - cc = &pScene->mRootNode; - pScene->mRootNode->mNumChildren = 0; - } else { - cc = new aiNode*[pScene->mRootNode->mNumChildren]; - memset(cc, 0, sizeof(aiNode*) * pScene->mRootNode->mNumChildren); - pScene->mRootNode->mChildren = cc; - } - - pScene->mNumMaterials = pScene->mNumMeshes; - aiMaterial** mats = pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials]; - - unsigned int meshIdx = 0; - for (auto & outGroup : outGroups) - { - if (outGroup.meshes.empty())continue; - - aiNode* node; - if (pScene->mRootNode->mNumChildren) - { - node = *cc = new aiNode(); - node->mParent = pScene->mRootNode; - } - else node = *cc; - node->mName.Set(outGroup.name); - - // add all meshes - node->mNumMeshes = (unsigned int) outGroup.meshes.size(); - unsigned int* pi = node->mMeshes = new unsigned int[ node->mNumMeshes ]; - for (std::vector< MeshInformation >::iterator it2 = outGroup.meshes.begin(), - end2 = outGroup.meshes.end(); it2 != end2; ++it2) - { - ai_assert(!(*it2).vertices.empty()); - - // allocate the mesh - *pi++ = meshIdx; - aiMesh* mesh = pScene->mMeshes[meshIdx] = new aiMesh(); - mesh->mMaterialIndex = meshIdx++; - - mesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE; - - // allocate storage for the vertex components and copy them - mesh->mNumVertices = (unsigned int)(*it2).vertices.size(); - mesh->mVertices = new aiVector3D[ mesh->mNumVertices ]; - ::memcpy(mesh->mVertices,&(*it2).vertices[0],sizeof(aiVector3D)*mesh->mNumVertices); - - if ((*it2).colors.size()) - { - ai_assert((*it2).colors.size() == mesh->mNumVertices); - - mesh->mColors[0] = new aiColor4D[ mesh->mNumVertices ]; - ::memcpy(mesh->mColors[0],&(*it2).colors[0],sizeof(aiColor4D)*mesh->mNumVertices); - } - - // generate triangles - ai_assert(0 == mesh->mNumVertices % 3); - aiFace* fc = mesh->mFaces = new aiFace[ mesh->mNumFaces = mesh->mNumVertices/3 ]; - aiFace* const fcEnd = fc + mesh->mNumFaces; - unsigned int n = 0; - while (fc != fcEnd) - { - aiFace& f = *fc++; - f.mIndices = new unsigned int[f.mNumIndices = 3]; - for (unsigned int m = 0; m < 3;++m) - f.mIndices[m] = n++; - } - - // generate a material for the mesh - aiMaterial* mat = new aiMaterial(); - - aiColor4D clr(1.0f,1.0f,1.0f,1.0f); - if ("%default%" == (*it2).name) // a gray default material - { - clr.r = clr.g = clr.b = 0.6f; - } - else if ((*it2).name.length() > 0) // a texture - { - aiString s; - s.Set((*it2).name); - mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(0)); - } - mat->AddProperty<aiColor4D>(&clr,1,AI_MATKEY_COLOR_DIFFUSE); - *mats++ = mat; - } - } -} - -#endif // !! ASSIMP_BUILD_NO_RAW_IMPORTER diff --git a/thirdparty/assimp/include/assimp/Exporter.hpp b/thirdparty/assimp/include/assimp/Exporter.hpp index bf0096e7e9..ea0303e804 100644 --- a/thirdparty/assimp/include/assimp/Exporter.hpp +++ b/thirdparty/assimp/include/assimp/Exporter.hpp @@ -190,7 +190,7 @@ public: * @note Use aiCopyScene() to get a modifiable copy of a previously * imported scene. */ const aiExportDataBlob* ExportToBlob(const aiScene* pScene, const char* pFormatId, - unsigned int pPreprocessing = 0u, const ExportProperties* = nullptr); + unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = nullptr); const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const std::string& pFormatId, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = nullptr); diff --git a/thirdparty/assimp/include/assimp/ParsingUtils.h b/thirdparty/assimp/include/assimp/ParsingUtils.h index ca30ce13b0..6b9574fc67 100644 --- a/thirdparty/assimp/include/assimp/ParsingUtils.h +++ b/thirdparty/assimp/include/assimp/ParsingUtils.h @@ -196,8 +196,7 @@ bool GetNextLine( const char_t*& buffer, char_t out[ BufferSize ] ) { // --------------------------------------------------------------------------------- template <class char_t> -AI_FORCE_INLINE bool IsNumeric( char_t in) -{ +AI_FORCE_INLINE bool IsNumeric( char_t in) { return ( in >= '0' && in <= '9' ) || '-' == in || '+' == in; } diff --git a/thirdparty/assimp/include/assimp/aabb.h b/thirdparty/assimp/include/assimp/aabb.h new file mode 100644 index 0000000000..a20f317424 --- /dev/null +++ b/thirdparty/assimp/include/assimp/aabb.h @@ -0,0 +1,76 @@ +/* +--------------------------------------------------------------------------- +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 AI_AABB_H_INC +#define AI_AABB_H_INC + +#include <assimp/vector3.h> + +struct aiAABB { + C_STRUCT aiVector3D mMin; + C_STRUCT aiVector3D mMax; + +#ifdef __cplusplus + + aiAABB() + : mMin() + , mMax() { + // empty + } + + aiAABB(const aiVector3D &min, const aiVector3D &max ) + : mMin(min) + , mMax(max) { + // empty + } + + ~aiAABB() { + // empty + } + +#endif +}; + + +#endif diff --git a/thirdparty/assimp/include/assimp/camera.h b/thirdparty/assimp/include/assimp/camera.h index 99daf69934..e573eea5d1 100644 --- a/thirdparty/assimp/include/assimp/camera.h +++ b/thirdparty/assimp/include/assimp/camera.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, @@ -60,7 +58,7 @@ extern "C" { * * Cameras have a representation in the node graph and can be animated. * An important aspect is that the camera itself is also part of the - * scenegraph. This means, any values such as the look-at vector are not + * scene-graph. This means, any values such as the look-at vector are not * *absolute*, they're <b>relative</b> to the coordinate system defined * by the node which corresponds to the camera. This allows for camera * animations. For static cameras parameters like the 'look-at' or 'up' vectors @@ -162,7 +160,6 @@ struct aiCamera */ float mClipPlaneFar; - /** Screen aspect ratio. * * This is the ration between the width and the height of the diff --git a/thirdparty/assimp/include/assimp/color4.inl b/thirdparty/assimp/include/assimp/color4.inl index 3192d55f39..afa53dcb5b 100644 --- a/thirdparty/assimp/include/assimp/color4.inl +++ b/thirdparty/assimp/include/assimp/color4.inl @@ -85,6 +85,8 @@ AI_FORCE_INLINE TReal aiColor4t<TReal>::operator[](unsigned int i) const { return g; case 2: return b; + case 3: + return a; default: break; } @@ -100,6 +102,8 @@ AI_FORCE_INLINE TReal& aiColor4t<TReal>::operator[](unsigned int i) { return g; case 2: return b; + case 3: + return a; default: break; } diff --git a/thirdparty/assimp/include/assimp/config.h.in b/thirdparty/assimp/include/assimp/config.h.in index a37ff0b8c8..d08b929a10 100644 --- a/thirdparty/assimp/include/assimp/config.h.in +++ b/thirdparty/assimp/include/assimp/config.h.in @@ -142,7 +142,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @brief Specifies the maximum angle that may be between two vertex tangents * that their tangents and bi-tangents are smoothed. * - * This applies to the CalcTangentSpace-Step. The angle is specified + * This applies to the CalcTangentSpace-Step. TFvhe angle is specified * in degrees. The maximum value is 175. * Property type: float. Default value: 45 degrees */ @@ -651,13 +651,28 @@ enum aiComponent // --------------------------------------------------------------------------- /** @brief Set whether the fbx importer will use the legacy embedded texture naming. -* -* The default value is false (0) -* Property type: bool -*/ + * + * The default value is false (0) + * Property type: bool + */ #define AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING \ "AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING" - + +// --------------------------------------------------------------------------- +/** @brief Set wether the importer shall not remove empty bones. + * + * Empty bone are often used to define connections for other models. + */ +#define AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES \ + "AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES" + + +// --------------------------------------------------------------------------- +/** @brief Set wether the FBX importer shall convert the unit from cm to m. + */ +#define AI_CONFIG_FBX_CONVERT_TO_M \ + "AI_CONFIG_FBX_CONVERT_TO_M" + // --------------------------------------------------------------------------- /** @brief Set the vertex animation keyframe to be imported * @@ -966,8 +981,12 @@ enum aiComponent #define AI_CONFIG_EXPORT_XFILE_64BIT "EXPORT_XFILE_64BIT" -/** - * +/** @brief Specifies whether the assimp export shall be able to export point clouds + * + * When this flag is not defined the render data has to contain valid faces. + * Point clouds are only a collection of vertices which have nor spatial organization + * by a face and the validation process will remove them. Enabling this feature will + * switch off the flag and enable the functionality to export pure point clouds. */ #define AI_CONFIG_EXPORT_POINT_CLOUDS "EXPORT_POINT_CLOUDS" diff --git a/thirdparty/assimp/include/assimp/defs.h b/thirdparty/assimp/include/assimp/defs.h index 4a177e3c3e..05a5e3fd4b 100644 --- a/thirdparty/assimp/include/assimp/defs.h +++ b/thirdparty/assimp/include/assimp/defs.h @@ -122,7 +122,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OPTIMIZEANIMS * OPTIMIZEGRAPH * GENENTITYMESHES - * FIXTEXTUREPATHS */ + * FIXTEXTUREPATHS + * GENBOUNDINGBOXES */ ////////////////////////////////////////////////////////////////////////// #ifdef _MSC_VER @@ -214,10 +215,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif #if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__)) -#error Currently, Borland is unsupported. Feel free to port Assimp. - -// "W8059 Packgröße der Struktur geändert" - +# error Currently, Borland is unsupported. Feel free to port Assimp. #endif @@ -243,10 +241,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. typedef double ai_real; typedef signed long long int ai_int; typedef unsigned long long int ai_uint; +#ifndef ASSIMP_AI_REAL_TEXT_PRECISION +#define ASSIMP_AI_REAL_TEXT_PRECISION 16 +#endif // ASSIMP_AI_REAL_TEXT_PRECISION #else // ASSIMP_DOUBLE_PRECISION typedef float ai_real; typedef signed int ai_int; typedef unsigned int ai_uint; +#ifndef ASSIMP_AI_REAL_TEXT_PRECISION +#define ASSIMP_AI_REAL_TEXT_PRECISION 8 +#endif // ASSIMP_AI_REAL_TEXT_PRECISION #endif // ASSIMP_DOUBLE_PRECISION ////////////////////////////////////////////////////////////////////////// @@ -267,6 +271,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_DEG_TO_RAD(x) ((x)*(ai_real)0.0174532925) #define AI_RAD_TO_DEG(x) ((x)*(ai_real)57.2957795) +/* Numerical limits */ +static const ai_real ai_epsilon = (ai_real) 0.00001; + /* Support for big-endian builds */ #if defined(__BYTE_ORDER__) # if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) @@ -293,11 +300,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef _MSC_VER # define AI_NO_EXCEPT noexcept #else -# if (_MSC_VER == 1915 ) +# if (_MSC_VER >= 1915 ) # define AI_NO_EXCEPT noexcept # else # define AI_NO_EXCEPT # endif -#endif +#endif // _MSC_VER #endif // !! AI_DEFINES_H_INC diff --git a/thirdparty/assimp/include/assimp/mesh.h b/thirdparty/assimp/include/assimp/mesh.h index 36f3ed2afd..f1628f1f54 100644 --- a/thirdparty/assimp/include/assimp/mesh.h +++ b/thirdparty/assimp/include/assimp/mesh.h @@ -48,7 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MESH_H_INC #define AI_MESH_H_INC -#include "types.h" +#include <assimp/types.h> +#include <assimp/aabb.h> #ifdef __cplusplus extern "C" { @@ -714,6 +715,11 @@ struct aiMesh * Method of morphing when animeshes are specified. */ unsigned int mMethod; + + /** + * + */ + C_STRUCT aiAABB mAABB; #ifdef __cplusplus @@ -735,7 +741,8 @@ struct aiMesh , mMaterialIndex( 0 ) , mNumAnimMeshes( 0 ) , mAnimMeshes(nullptr) - , mMethod( 0 ) { + , mMethod( 0 ) + , mAABB() { for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) { mNumUVComponents[a] = 0; mTextureCoords[a] = nullptr; diff --git a/thirdparty/assimp/include/assimp/postprocess.h b/thirdparty/assimp/include/assimp/postprocess.h index c23a5490a5..2a74414216 100644 --- a/thirdparty/assimp/include/assimp/postprocess.h +++ b/thirdparty/assimp/include/assimp/postprocess.h @@ -438,7 +438,7 @@ enum aiPostProcessSteps aiProcess_FindInstances = 0x100000, // ------------------------------------------------------------------------- - /** <hr>A postprocessing step to reduce the number of meshes. + /** <hr>A post-processing step to reduce the number of meshes. * * This will, in fact, reduce the number of draw calls. * @@ -450,7 +450,7 @@ enum aiPostProcessSteps // ------------------------------------------------------------------------- - /** <hr>A postprocessing step to optimize the scene hierarchy. + /** <hr>A post-processing step to optimize the scene hierarchy. * * Nodes without animations, bones, lights or cameras assigned are * collapsed and joined. @@ -514,7 +514,7 @@ enum aiPostProcessSteps // ------------------------------------------------------------------------- /** <hr>This step splits meshes with many bones into sub-meshes so that each - * su-bmesh has fewer or as many bones as a given limit. + * sub-mesh has fewer or as many bones as a given limit. */ aiProcess_SplitByBoneCount = 0x2000000, @@ -541,7 +541,7 @@ enum aiPostProcessSteps * global scaling from your importer settings like in FBX. Use the flag * AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY from the global property table to configure this. * - * Use <tt>#AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY</tt> to setup the global scaing factor. + * Use <tt>#AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY</tt> to setup the global scaling factor. */ aiProcess_GlobalScale = 0x8000000, @@ -574,6 +574,11 @@ enum aiPostProcessSteps * This process gives sense back to aiProcess_JoinIdenticalVertices */ aiProcess_DropNormals = 0x40000000, + + // ------------------------------------------------------------------------- + /** + */ + aiProcess_GenBoundingBoxes = 0x80000000 }; diff --git a/thirdparty/assimp/include/assimp/scene.h b/thirdparty/assimp/include/assimp/scene.h index de0239702d..df5d6f3b5e 100644 --- a/thirdparty/assimp/include/assimp/scene.h +++ b/thirdparty/assimp/include/assimp/scene.h @@ -56,6 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "material.h" #include "anim.h" #include "metadata.h" +#include <cstdlib> #ifdef __cplusplus extern "C" { @@ -389,6 +390,14 @@ struct aiScene //! Returns an embedded texture const aiTexture* GetEmbeddedTexture(const char* filename) const { + // lookup using texture ID (if referenced like: "*1", "*2", etc.) + if ('*' == *filename) { + int index = std::atoi(filename + 1); + if (0 > index || mNumTextures <= static_cast<unsigned>(index)) + return nullptr; + return mTextures[index]; + } + // lookup using filename const char* shortFilename = GetShortFilename(filename); for (unsigned int i = 0; i < mNumTextures; i++) { const char* shortTextureFilename = GetShortFilename(mTextures[i]->mFilename.C_Str()); diff --git a/thirdparty/jpeg-compressor/jpgd.cpp b/thirdparty/jpeg-compressor/jpgd.cpp index fad9a37a9a..62fbd1b72d 100644 --- a/thirdparty/jpeg-compressor/jpgd.cpp +++ b/thirdparty/jpeg-compressor/jpgd.cpp @@ -29,6 +29,10 @@ #define JPGD_MAX(a,b) (((a)>(b)) ? (a) : (b)) #define JPGD_MIN(a,b) (((a)<(b)) ? (a) : (b)) +// TODO: Move to header and use these constants when declaring the arrays. +#define JPGD_HUFF_TREE_MAX_LENGTH 512 +#define JPGD_HUFF_CODE_SIZE_MAX_LENGTH 256 + namespace jpgd { static inline void *jpgd_malloc(size_t nSize) { return malloc(nSize); } @@ -491,8 +495,9 @@ inline uint jpeg_decoder::get_bits_no_markers(int num_bits) // Decodes a Huffman encoded symbol. inline int jpeg_decoder::huff_decode(huff_tables *pH) { - int symbol; + JPGD_ASSERT(pH); + int symbol; // Check first 8-bits: do we have a complete symbol? if ((symbol = pH->look_up[m_bit_buf >> 24]) < 0) { @@ -500,14 +505,19 @@ inline int jpeg_decoder::huff_decode(huff_tables *pH) int ofs = 23; do { - symbol = pH->tree[-(int)(symbol + ((m_bit_buf >> ofs) & 1))]; + unsigned int idx = -(int)(symbol + ((m_bit_buf >> ofs) & 1)); + JPGD_ASSERT(idx < JPGD_HUFF_TREE_MAX_LENGTH); + symbol = pH->tree[idx]; ofs--; } while (symbol < 0); get_bits_no_markers(8 + (23 - ofs)); } else + { + JPGD_ASSERT(symbol < JPGD_HUFF_CODE_SIZE_MAX_LENGTH); get_bits_no_markers(pH->code_size[symbol]); + } return symbol; } @@ -517,6 +527,8 @@ inline int jpeg_decoder::huff_decode(huff_tables *pH, int& extra_bits) { int symbol; + JPGD_ASSERT(pH); + // Check first 8-bits: do we have a complete symbol? if ((symbol = pH->look_up2[m_bit_buf >> 24]) < 0) { @@ -524,7 +536,9 @@ inline int jpeg_decoder::huff_decode(huff_tables *pH, int& extra_bits) int ofs = 23; do { - symbol = pH->tree[-(int)(symbol + ((m_bit_buf >> ofs) & 1))]; + unsigned int idx = -(int)(symbol + ((m_bit_buf >> ofs) & 1)); + JPGD_ASSERT(idx < JPGD_HUFF_TREE_MAX_LENGTH); + symbol = pH->tree[idx]; ofs--; } while (symbol < 0); @@ -1495,6 +1509,12 @@ void jpeg_decoder::fix_in_buffer() void jpeg_decoder::transform_mcu(int mcu_row) { jpgd_block_t* pSrc_ptr = m_pMCU_coefficients; + if (m_freq_domain_chroma_upsample) { + JPGD_ASSERT(mcu_row * m_blocks_per_mcu < m_expanded_blocks_per_row); + } + else { + JPGD_ASSERT(mcu_row * m_blocks_per_mcu < m_max_blocks_per_row); + } uint8* pDst_ptr = m_pSample_buf + mcu_row * m_blocks_per_mcu * 64; for (int mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++) @@ -1650,6 +1670,7 @@ void jpeg_decoder::load_next_row() for (mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++) { component_id = m_mcu_org[mcu_block]; + JPGD_ASSERT(m_comp_quant[component_id] < JPGD_MAX_QUANT_TABLES); q = m_quant[m_comp_quant[component_id]]; p = m_pMCU_coefficients + 64 * mcu_block; @@ -1770,6 +1791,7 @@ void jpeg_decoder::decode_next_row() for (int mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++, p += 64) { int component_id = m_mcu_org[mcu_block]; + JPGD_ASSERT(m_comp_quant[component_id] < JPGD_MAX_QUANT_TABLES); jpgd_quant_t* q = m_quant[m_comp_quant[component_id]]; int r, s; @@ -2229,7 +2251,10 @@ void jpeg_decoder::make_huff_table(int index, huff_tables *pH) for (l = 1; l <= 16; l++) { for (i = 1; i <= m_huff_num[index][l]; i++) + { + JPGD_ASSERT(p < 257); huffsize[p++] = static_cast<uint8>(l); + } } huffsize[p] = 0; @@ -2244,6 +2269,7 @@ void jpeg_decoder::make_huff_table(int index, huff_tables *pH) { while (huffsize[p] == si) { + JPGD_ASSERT(p < 257); huffcode[p++] = code; code++; } @@ -2275,7 +2301,8 @@ void jpeg_decoder::make_huff_table(int index, huff_tables *pH) for (l = 1 << (8 - code_size); l > 0; l--) { - JPGD_ASSERT(i < 256); + JPGD_ASSERT(i < JPGD_HUFF_CODE_SIZE_MAX_LENGTH); + JPGD_ASSERT(code < JPGD_HUFF_CODE_SIZE_MAX_LENGTH); pH->look_up[code] = i; @@ -2325,16 +2352,19 @@ void jpeg_decoder::make_huff_table(int index, huff_tables *pH) if ((code & 0x8000) == 0) currententry--; - if (pH->tree[-currententry - 1] == 0) + unsigned int idx = -currententry - 1; + JPGD_ASSERT(idx < JPGD_HUFF_TREE_MAX_LENGTH); + if (pH->tree[idx] == 0) { - pH->tree[-currententry - 1] = nextfreeentry; + pH->tree[idx] = nextfreeentry; currententry = nextfreeentry; nextfreeentry -= 2; } - else - currententry = pH->tree[-currententry - 1]; + else { + currententry = pH->tree[idx]; + } code <<= 1; } @@ -2636,7 +2666,9 @@ void jpeg_decoder::decode_block_ac_first(jpeg_decoder *pD, int component_id, int for (k = pD->m_spectral_start; k <= pD->m_spectral_end; k++) { - s = pD->huff_decode(pD->m_pHuff_tabs[pD->m_comp_ac_tab[component_id]]); + unsigned int idx = pD->m_comp_ac_tab[component_id]; + JPGD_ASSERT(idx < JPGD_MAX_HUFF_TABLES); + s = pD->huff_decode(pD->m_pHuff_tabs[idx]); r = s >> 4; s &= 15; @@ -2679,7 +2711,6 @@ void jpeg_decoder::decode_block_ac_refine(jpeg_decoder *pD, int component_id, in int p1 = 1 << pD->m_successive_low; int m1 = (-1) << pD->m_successive_low; jpgd_block_t *p = pD->coeff_buf_getp(pD->m_ac_coeffs[component_id], block_x, block_y); - JPGD_ASSERT(pD->m_spectral_end <= 63); k = pD->m_spectral_start; @@ -2688,7 +2719,9 @@ void jpeg_decoder::decode_block_ac_refine(jpeg_decoder *pD, int component_id, in { for ( ; k <= pD->m_spectral_end; k++) { - s = pD->huff_decode(pD->m_pHuff_tabs[pD->m_comp_ac_tab[component_id]]); + unsigned int idx = pD->m_comp_ac_tab[component_id]; + JPGD_ASSERT(idx < JPGD_MAX_HUFF_TABLES); + s = pD->huff_decode(pD->m_pHuff_tabs[idx]); r = s >> 4; s &= 15; diff --git a/thirdparty/xatlas/xatlas.cpp b/thirdparty/xatlas/xatlas.cpp index c62be4e73a..1b30305cd4 100644 --- a/thirdparty/xatlas/xatlas.cpp +++ b/thirdparty/xatlas/xatlas.cpp @@ -299,29 +299,30 @@ static void *Realloc(void *ptr, size_t size, int /*tag*/, const char * /*file*/, #if XA_PROFILE #define XA_PROFILE_START(var) const clock_t var##Start = clock(); #define XA_PROFILE_END(var) internal::s_profile.var += clock() - var##Start; -#define XA_PROFILE_PRINT(label, var) XA_PRINT("%s%.2f seconds (%g ms)\n", label, internal::clockToSeconds(internal::s_profile.var), internal::clockToMs(internal::s_profile.var)); +#define XA_PROFILE_PRINT_AND_RESET(label, var) XA_PRINT("%s%.2f seconds (%g ms)\n", label, internal::clockToSeconds(internal::s_profile.var), internal::clockToMs(internal::s_profile.var)); internal::s_profile.var = 0; struct ProfileData { - clock_t addMeshConcurrent; - std::atomic<clock_t> addMesh; + clock_t addMeshReal; + std::atomic<clock_t> addMeshThread; std::atomic<clock_t> addMeshCreateColocals; std::atomic<clock_t> addMeshCreateFaceGroups; std::atomic<clock_t> addMeshCreateBoundaries; - std::atomic<clock_t> addMeshCreateChartGroupsConcurrent; - std::atomic<clock_t> addMeshCreateChartGroups; - clock_t computeChartsConcurrent; - std::atomic<clock_t> computeCharts; + std::atomic<clock_t> addMeshCreateChartGroupsReal; + std::atomic<clock_t> addMeshCreateChartGroupsThread; + clock_t computeChartsReal; + std::atomic<clock_t> computeChartsThread; std::atomic<clock_t> atlasBuilder; std::atomic<clock_t> atlasBuilderInit; std::atomic<clock_t> atlasBuilderCreateInitialCharts; std::atomic<clock_t> atlasBuilderGrowCharts; std::atomic<clock_t> atlasBuilderMergeCharts; - std::atomic<clock_t> createChartMeshes; + std::atomic<clock_t> createChartMeshesReal; + std::atomic<clock_t> createChartMeshesThread; std::atomic<clock_t> fixChartMeshTJunctions; std::atomic<clock_t> closeChartMeshHoles; - clock_t parameterizeChartsConcurrent; - std::atomic<clock_t> parameterizeCharts; + clock_t parameterizeChartsReal; + std::atomic<clock_t> parameterizeChartsThread; std::atomic<clock_t> parameterizeChartsOrthogonal; std::atomic<clock_t> parameterizeChartsLSCM; std::atomic<clock_t> parameterizeChartsEvaluateQuality; @@ -329,6 +330,7 @@ struct ProfileData clock_t packChartsRasterize; clock_t packChartsDilate; clock_t packChartsFindLocation; + std::atomic<clock_t> packChartsFindLocationThread; clock_t packChartsBlit; }; @@ -346,7 +348,7 @@ static double clockToSeconds(clock_t c) #else #define XA_PROFILE_START(var) #define XA_PROFILE_END(var) -#define XA_PROFILE_PRINT(label, var) +#define XA_PROFILE_PRINT_AND_RESET(label, var) #endif static constexpr float kPi = 3.14159265358979323846f; @@ -641,6 +643,7 @@ static bool linesIntersect(const Vector2 &a1, const Vector2 &a2, const Vector2 & struct Vector2i { + Vector2i() {} Vector2i(int32_t x, int32_t y) : x(x), y(y) {} int32_t x, y; @@ -3528,6 +3531,15 @@ private: std::mutex m_mutex; }; +struct Spinlock +{ + void lock() { while(m_lock.test_and_set(std::memory_order_acquire)) {} } + void unlock() { m_lock.clear(std::memory_order_release); } + +private: + std::atomic_flag m_lock = ATOMIC_FLAG_INIT; +}; + struct TaskGroupHandle { uint32_t value = UINT32_MAX; @@ -3545,6 +3557,14 @@ class TaskScheduler public: TaskScheduler() : m_shutdown(false) { + // Max with current task scheduler usage is 1 per thread + 1 deep nesting, but allow for some slop. + m_maxGroups = std::thread::hardware_concurrency() * 4; + m_groups = XA_ALLOC_ARRAY(MemTag::Default, TaskGroup, m_maxGroups); + for (uint32_t i = 0; i < m_maxGroups; i++) { + new (&m_groups[i]) TaskGroup(); + m_groups[i].free = true; + m_groups[i].ref = 0; + } m_workers.resize(std::thread::hardware_concurrency() <= 1 ? 1 : std::thread::hardware_concurrency() - 1); for (uint32_t i = 0; i < m_workers.size(); i++) { m_workers[i].wakeup = false; @@ -3565,36 +3585,42 @@ public: worker.thread->~thread(); XA_FREE(worker.thread); } - for (uint32_t i = 0; i < m_groups.size(); i++) - destroyGroup(i); + for (uint32_t i = 0; i < m_maxGroups; i++) + m_groups[i].~TaskGroup(); + XA_FREE(m_groups); } - void run(TaskGroupHandle *handle, Task task) + TaskGroupHandle createTaskGroup(uint32_t reserveSize = 0) { - // Allocate a task group if this is the first time using this handle. - TaskGroup *group; - if (handle->value == UINT32_MAX) { - group = XA_NEW(MemTag::Default, TaskGroup); - group->ref = 0; - std::lock_guard<std::mutex> lock(m_groupsMutex); - for (uint32_t i = 0; i < m_groups.size(); i++) { - if (!m_groups[i]) { - m_groups[i] = group; - handle->value = i; - break; - } - } - if (handle->value == UINT32_MAX) { - m_groups.push_back(group); - handle->value = m_groups.size() - 1; - } - } - group = m_groups[handle->value]; - { - std::lock_guard<std::mutex> lock(group->queueMutex); - group->queue.push_back(task); - } - group->ref++; + // Claim the first free group. + for (uint32_t i = 0; i < m_maxGroups; i++) { + TaskGroup &group = m_groups[i]; + bool expected = true; + if (!group.free.compare_exchange_strong(expected, false)) + continue; + group.queueLock.lock(); + group.queueHead = 0; + group.queue.clear(); + group.queue.reserve(reserveSize); + group.queueLock.unlock(); + TaskGroupHandle handle; + handle.value = i; + return handle; + } + XA_DEBUG_ASSERT(false); + TaskGroupHandle handle; + handle.value = UINT32_MAX; + return handle; + } + + void run(TaskGroupHandle handle, Task task) + { + XA_DEBUG_ASSERT(handle.value != UINT32_MAX); + TaskGroup &group = m_groups[handle.value]; + group.queueLock.lock(); + group.queue.push_back(task); + group.queueLock.unlock(); + group.ref++; // Wake up a worker to run this task. for (uint32_t i = 0; i < m_workers.size(); i++) { m_workers[i].wakeup = true; @@ -3609,33 +3635,32 @@ public: return; } // Run tasks from the group queue until empty. - TaskGroup *group = m_groups[handle->value]; + TaskGroup &group = m_groups[handle->value]; for (;;) { Task *task = nullptr; - { - std::lock_guard<std::mutex> lock(group->queueMutex); - if (group->queueHead < group->queue.size()) - task = &group->queue[group->queueHead++]; - } + group.queueLock.lock(); + if (group.queueHead < group.queue.size()) + task = &group.queue[group.queueHead++]; + group.queueLock.unlock(); if (!task) break; task->func(task->userData); - group->ref--; + group.ref--; } // Even though the task queue is empty, workers can still be running tasks. - while (group->ref > 0) + while (group.ref > 0) std::this_thread::yield(); - std::lock_guard<std::mutex> lock(m_groupsMutex); - destroyGroup(handle->value); + group.free = true; handle->value = UINT32_MAX; } private: struct TaskGroup { + std::atomic<bool> free; Array<Task> queue; // Items are never removed. queueHead is incremented to pop items. uint32_t queueHead = 0; - std::mutex queueMutex; + Spinlock queueLock; std::atomic<uint32_t> ref; // Increment when a task is enqueued, decrement when a task finishes. }; @@ -3647,21 +3672,11 @@ private: std::atomic<bool> wakeup; }; - Array<TaskGroup *> m_groups; - std::mutex m_groupsMutex; + TaskGroup *m_groups; + uint32_t m_maxGroups; Array<Worker> m_workers; std::atomic<bool> m_shutdown; - void destroyGroup(uint32_t index) - { - TaskGroup *group = m_groups[index]; - m_groups[index] = nullptr; - if (group) { - group->~TaskGroup(); - XA_FREE(group); - } - } - static void workerThread(TaskScheduler *scheduler, Worker *worker) { std::unique_lock<std::mutex> lock(worker->mutex); @@ -3674,18 +3689,17 @@ private: // Look for a task in any of the groups and run it. TaskGroup *group = nullptr; Task *task = nullptr; - { - std::lock_guard<std::mutex> groupsLock(scheduler->m_groupsMutex); - for (uint32_t i = 0; i < scheduler->m_groups.size(); i++) { - group = scheduler->m_groups[i]; - if (!group) - continue; - std::lock_guard<std::mutex> queueLock(group->queueMutex); - if (group->queueHead < group->queue.size()) { - task = &group->queue[group->queueHead++]; - break; - } + for (uint32_t i = 0; i < scheduler->m_maxGroups; i++) { + group = &scheduler->m_groups[i]; + if (group->free || group->ref == 0) + continue; + group->queueLock.lock(); + if (group->queueHead < group->queue.size()) { + task = &group->queue[group->queueHead++]; + group->queueLock.unlock(); + break; } + group->queueLock.unlock(); } if (!task) break; @@ -3705,23 +3719,19 @@ public: destroyGroup({ i }); } - void run(TaskGroupHandle *handle, Task task) + TaskGroupHandle createTaskGroup(uint32_t reserveSize = 0) { - if (handle->value == UINT32_MAX) { - TaskGroup *group = XA_NEW(MemTag::Default, TaskGroup); - for (uint32_t i = 0; i < m_groups.size(); i++) { - if (!m_groups[i]) { - m_groups[i] = group; - handle->value = i; - break; - } - } - if (handle->value == UINT32_MAX) { - m_groups.push_back(group); - handle->value = m_groups.size() - 1; - } - } - m_groups[handle->value]->queue.push_back(task); + TaskGroup *group = XA_NEW(MemTag::Default, TaskGroup); + group->queue.reserve(reserveSize); + m_groups.push_back(group); + TaskGroupHandle handle; + handle.value = m_groups.size() - 1; + return handle; + } + + void run(TaskGroupHandle handle, Task task) + { + m_groups[handle.value]->queue.push_back(task); } void wait(TaskGroupHandle *handle) @@ -5967,6 +5977,58 @@ private: #endif }; +struct CreateChartTaskArgs +{ + const Mesh *mesh; + const Array<uint32_t> *faceArray; + const Basis *basis; + uint32_t meshId; + uint32_t chartGroupId; + uint32_t chartId; + Chart **chart; +}; + +static void runCreateChartTask(void *userData) +{ + XA_PROFILE_START(createChartMeshesThread) + auto args = (CreateChartTaskArgs *)userData; + *(args->chart) = XA_NEW(MemTag::Default, Chart, args->mesh, *(args->faceArray), *(args->basis), args->meshId, args->chartGroupId, args->chartId); + XA_PROFILE_END(createChartMeshesThread) +} + +struct ParameterizeChartTaskArgs +{ + Chart *chart; + ParameterizeFunc func; +}; + +static void runParameterizeChartTask(void *userData) +{ + auto args = (ParameterizeChartTaskArgs *)userData; + Mesh *mesh = args->chart->unifiedMesh(); + XA_PROFILE_START(parameterizeChartsOrthogonal) +#if 1 + computeOrthogonalProjectionMap(mesh); +#else + for (uint32_t i = 0; i < vertexCount; i++) + mesh->texcoord(i) = Vector2(dot(args->chart->basis().tangent, mesh->position(i)), dot(args->chart->basis().bitangent, mesh->position(i))); +#endif + XA_PROFILE_END(parameterizeChartsOrthogonal) + args->chart->evaluateOrthoParameterizationQuality(); + if (!args->chart->isOrtho() && !args->chart->isPlanar()) { + XA_PROFILE_START(parameterizeChartsLSCM) + if (args->func) + args->func(&mesh->position(0).x, &mesh->texcoord(0).x, mesh->vertexCount(), mesh->indices(), mesh->indexCount()); + else if (args->chart->isDisk()) + computeLeastSquaresConformalMap(mesh); + XA_PROFILE_END(parameterizeChartsLSCM) + args->chart->evaluateParameterizationQuality(); + } + // @@ Check that parameterization quality is above a certain threshold. + // Transfer parameterization from unified mesh to chart mesh. + args->chart->transferParameterization(); +} + // Set of charts corresponding to mesh faces in the same face group. class ChartGroup { @@ -6107,7 +6169,7 @@ public: - emphasize roundness metrics to prevent those cases. - If interior self-overlaps: preserve boundary parameterization and use mean-value map. */ - void computeCharts(const ChartOptions &options) + void computeCharts(TaskScheduler *taskScheduler, const ChartOptions &options) { m_chartOptions = options; // This function may be called multiple times, so destroy existing charts. @@ -6128,13 +6190,30 @@ public: AtlasBuilder builder(m_mesh, nullptr, options); runAtlasBuilder(builder, options); XA_PROFILE_END(atlasBuilder) - XA_PROFILE_START(createChartMeshes) const uint32_t chartCount = builder.chartCount(); + m_chartArray.resize(chartCount); + Array<CreateChartTaskArgs> taskArgs; + taskArgs.resize(chartCount); + for (uint32_t i = 0; i < chartCount; i++) { + CreateChartTaskArgs &args = taskArgs[i]; + args.mesh = m_mesh; + args.faceArray = &builder.chartFaces(i); + args.basis = &builder.chartBasis(i); + args.meshId = m_sourceId; + args.chartGroupId = m_id; + args.chartId = i; + args.chart = &m_chartArray[i]; + } + XA_PROFILE_START(createChartMeshesReal) + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartCount); for (uint32_t i = 0; i < chartCount; i++) { - Chart *chart = XA_NEW(MemTag::Default, Chart, m_mesh, builder.chartFaces(i), builder.chartBasis(i), m_sourceId, m_id, i); - m_chartArray.push_back(chart); + Task task; + task.userData = &taskArgs[i]; + task.func = runCreateChartTask; + taskScheduler->run(taskGroup, task); } - XA_PROFILE_END(createChartMeshes) + taskScheduler->wait(&taskGroup); + XA_PROFILE_END(createChartMeshesReal) #endif #if XA_DEBUG_EXPORT_OBJ_CHARTS char filename[256]; @@ -6157,18 +6236,33 @@ public: #endif } - void parameterizeCharts(ParameterizeFunc func) + void parameterizeCharts(TaskScheduler *taskScheduler, ParameterizeFunc func) { + const uint32_t chartCount = m_chartArray.size(); + Array<ParameterizeChartTaskArgs> taskArgs; + taskArgs.resize(chartCount); + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartCount); + for (uint32_t i = 0; i < chartCount; i++) { + ParameterizeChartTaskArgs &args = taskArgs[i]; + args.chart = m_chartArray[i]; + args.func = func; + Task task; + task.userData = &args; + task.func = runParameterizeChartTask; + taskScheduler->run(taskGroup, task); + } + taskScheduler->wait(&taskGroup); #if XA_RECOMPUTE_CHARTS + // Find charts with invalid parameterizations. Array<Chart *> invalidCharts; - const uint32_t chartCount = m_chartArray.size(); for (uint32_t i = 0; i < chartCount; i++) { Chart *chart = m_chartArray[i]; - parameterizeChart(chart, func); const ParameterizationQuality &quality = chart->paramQuality(); if (quality.boundaryIntersection || quality.flippedTriangleCount > 0) invalidCharts.push_back(chart); } + if (invalidCharts.isEmpty()) + return; // Recompute charts with invalid parameterizations. Array<uint32_t> meshFaces; for (uint32_t i = 0; i < invalidCharts.size(); i++) { @@ -6211,8 +6305,18 @@ public: #endif } // Parameterize the new charts. - for (uint32_t i = chartCount; i < m_chartArray.size(); i++) - parameterizeChart(m_chartArray[i], func); + taskGroup = taskScheduler->createTaskGroup(m_chartArray.size() - chartCount); + taskArgs.resize(m_chartArray.size() - chartCount); + for (uint32_t i = chartCount; i < m_chartArray.size(); i++) { + ParameterizeChartTaskArgs &args = taskArgs[i - chartCount]; + args.chart = m_chartArray[i]; + args.func = func; + Task task; + task.userData = &args; + task.func = runParameterizeChartTask; + taskScheduler->run(taskGroup, task); + } + taskScheduler->wait(&taskGroup); // Remove and delete the invalid charts. for (uint32_t i = 0; i < invalidCharts.size(); i++) { Chart *chart = invalidCharts[i]; @@ -6221,12 +6325,6 @@ public: XA_FREE(chart); m_paramDeletedChartsCount++; } -#else - const uint32_t chartCount = m_chartArray.size(); - for (uint32_t i = 0; i < chartCount; i++) { - Chart *chart = m_chartArray[i]; - parameterizeChart(chart, func); - } #endif } @@ -6269,32 +6367,6 @@ private: XA_DEBUG_ASSERT(builder.facesLeft() == 0); } - void parameterizeChart(Chart *chart, ParameterizeFunc func) - { - Mesh *mesh = chart->unifiedMesh(); - XA_PROFILE_START(parameterizeChartsOrthogonal) -#if 1 - computeOrthogonalProjectionMap(mesh); -#else - for (uint32_t i = 0; i < vertexCount; i++) - mesh->texcoord(i) = Vector2(dot(chart->basis().tangent, mesh->position(i)), dot(chart->basis().bitangent, mesh->position(i))); -#endif - XA_PROFILE_END(parameterizeChartsOrthogonal) - chart->evaluateOrthoParameterizationQuality(); - if (!chart->isOrtho() && !chart->isPlanar()) { - XA_PROFILE_START(parameterizeChartsLSCM) - if (func) - func(&mesh->position(0).x, &mesh->texcoord(0).x, mesh->vertexCount(), mesh->indices(), mesh->indexCount()); - else if (chart->isDisk()) - computeLeastSquaresConformalMap(mesh); - XA_PROFILE_END(parameterizeChartsLSCM) - chart->evaluateParameterizationQuality(); - } - // @@ Check that parameterization quality is above a certain threshold. - // Transfer parameterization from unified mesh to chart mesh. - chart->transferParameterization(); - } - void removeChart(const Chart *chart) { for (uint32_t i = 0; i < m_chartArray.size(); i++) { @@ -6326,14 +6398,15 @@ struct CreateChartGroupTaskArgs static void runCreateChartGroupTask(void *userData) { - XA_PROFILE_START(addMeshCreateChartGroups) + XA_PROFILE_START(addMeshCreateChartGroupsThread) auto args = (CreateChartGroupTaskArgs *)userData; *(args->chartGroup) = XA_NEW(MemTag::Default, ChartGroup, args->groupId, args->mesh, args->faceGroup); - XA_PROFILE_END(addMeshCreateChartGroups) + XA_PROFILE_END(addMeshCreateChartGroupsThread) } struct ComputeChartsTaskArgs { + TaskScheduler *taskScheduler; ChartGroup *chartGroup; const ChartOptions *options; Progress *progress; @@ -6341,18 +6414,19 @@ struct ComputeChartsTaskArgs static void runComputeChartsJob(void *userData) { - ComputeChartsTaskArgs *args = (ComputeChartsTaskArgs *)userData; + auto args = (ComputeChartsTaskArgs *)userData; if (args->progress->cancel) return; - XA_PROFILE_START(computeCharts) - args->chartGroup->computeCharts(*args->options); - XA_PROFILE_END(computeCharts) + XA_PROFILE_START(computeChartsThread) + args->chartGroup->computeCharts(args->taskScheduler, *args->options); + XA_PROFILE_END(computeChartsThread) args->progress->value++; args->progress->update(); } struct ParameterizeChartsTaskArgs { + TaskScheduler *taskScheduler; ChartGroup *chartGroup; ParameterizeFunc func; Progress *progress; @@ -6360,12 +6434,12 @@ struct ParameterizeChartsTaskArgs static void runParameterizeChartsJob(void *userData) { - ParameterizeChartsTaskArgs *args = (ParameterizeChartsTaskArgs *)userData; + auto args = (ParameterizeChartsTaskArgs *)userData; if (args->progress->cancel) return; - XA_PROFILE_START(parameterizeCharts) - args->chartGroup->parameterizeCharts(args->func); - XA_PROFILE_END(parameterizeCharts) + XA_PROFILE_START(parameterizeChartsThread) + args->chartGroup->parameterizeCharts(args->taskScheduler, args->func); + XA_PROFILE_END(parameterizeChartsThread) args->progress->value++; args->progress->update(); } @@ -6460,12 +6534,12 @@ public: args.groupId = g; args.mesh = mesh; } - TaskGroupHandle taskGroup; + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartGroups.size()); for (uint32_t g = 0; g < chartGroups.size(); g++) { Task task; task.userData = &taskArgs[g]; task.func = runCreateChartGroupTask; - taskScheduler->run(&taskGroup, task); + taskScheduler->run(taskGroup, task); } taskScheduler->wait(&taskGroup); // Thread-safe append. @@ -6481,29 +6555,39 @@ public: { m_chartsComputed = false; m_chartsParameterized = false; - uint32_t taskCount = 0; + // Ignore vertex maps. + uint32_t chartGroupCount = 0; for (uint32_t i = 0; i < m_chartGroups.size(); i++) { if (!m_chartGroups[i]->isVertexMap()) - taskCount++; + chartGroupCount++; } - Progress progress(ProgressCategory::ComputeCharts, progressFunc, progressUserData, taskCount); + Progress progress(ProgressCategory::ComputeCharts, progressFunc, progressUserData, chartGroupCount); Array<ComputeChartsTaskArgs> taskArgs; - taskArgs.reserve(taskCount); + taskArgs.reserve(chartGroupCount); for (uint32_t i = 0; i < m_chartGroups.size(); i++) { if (!m_chartGroups[i]->isVertexMap()) { ComputeChartsTaskArgs args; + args.taskScheduler = taskScheduler; args.chartGroup = m_chartGroups[i]; args.options = &options; args.progress = &progress; taskArgs.push_back(args); } } - TaskGroupHandle taskGroup; - for (uint32_t i = 0; i < taskCount; i++) { + // Sort chart groups by mesh indexCount. + m_chartGroupsRadix = RadixSort(); + Array<float> chartGroupSortData; + chartGroupSortData.resize(chartGroupCount); + for (uint32_t i = 0; i < chartGroupCount; i++) + chartGroupSortData[i] = (float)taskArgs[i].chartGroup->mesh()->indexCount(); + m_chartGroupsRadix.sort(chartGroupSortData); + // Larger chart group meshes are added first to reduce the chance of thread starvation. + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartGroupCount); + for (uint32_t i = 0; i < chartGroupCount; i++) { Task task; - task.userData = &taskArgs[i]; + task.userData = &taskArgs[m_chartGroupsRadix.ranks()[chartGroupCount - i - 1]]; task.func = runComputeChartsJob; - taskScheduler->run(&taskGroup, task); + taskScheduler->run(taskGroup, task); } taskScheduler->wait(&taskGroup); if (progress.cancel) @@ -6515,29 +6599,32 @@ public: bool parameterizeCharts(TaskScheduler *taskScheduler, ParameterizeFunc func, ProgressFunc progressFunc, void *progressUserData) { m_chartsParameterized = false; - uint32_t taskCount = 0; + // Ignore vertex maps. + uint32_t chartGroupCount = 0; for (uint32_t i = 0; i < m_chartGroups.size(); i++) { if (!m_chartGroups[i]->isVertexMap()) - taskCount++; + chartGroupCount++; } - Progress progress(ProgressCategory::ParameterizeCharts, progressFunc, progressUserData, taskCount); + Progress progress(ProgressCategory::ParameterizeCharts, progressFunc, progressUserData, chartGroupCount); Array<ParameterizeChartsTaskArgs> taskArgs; - taskArgs.reserve(taskCount); + taskArgs.reserve(chartGroupCount); for (uint32_t i = 0; i < m_chartGroups.size(); i++) { if (!m_chartGroups[i]->isVertexMap()) { ParameterizeChartsTaskArgs args; + args.taskScheduler = taskScheduler; args.chartGroup = m_chartGroups[i]; args.func = func; args.progress = &progress; taskArgs.push_back(args); } } - TaskGroupHandle taskGroup; - for (uint32_t i = 0; i < taskCount; i++) { + // Larger chart group meshes are added first to reduce the chance of thread starvation. + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartGroupCount); + for (uint32_t i = 0; i < chartGroupCount; i++) { Task task; - task.userData = &taskArgs[i]; + task.userData = &taskArgs[m_chartGroupsRadix.ranks()[chartGroupCount - i - 1]]; task.func = runParameterizeChartsJob; - taskScheduler->run(&taskGroup, task); + taskScheduler->run(taskGroup, task); } taskScheduler->wait(&taskGroup); if (progress.cancel) @@ -6570,6 +6657,7 @@ private: bool m_chartsComputed; bool m_chartsParameterized; Array<ChartGroup *> m_chartGroups; + RadixSort m_chartGroupsRadix; // By mesh indexCount. Array<uint32_t> m_chartGroupSourceMeshes; Array<Array<Vector2> > m_originalChartTexcoords; }; @@ -6734,6 +6822,71 @@ struct Chart uint32_t uniqueVertexCount() const { return uniqueVertices.isEmpty() ? vertexCount : uniqueVertices.size(); } }; +struct FindChartLocationBruteForceTaskArgs +{ + std::atomic<bool> *finished; // One of the tasks found a location that doesn't expand the atlas. + Vector2i startPosition; + const BitImage *atlasBitImage; + const BitImage *chartBitImage; + const BitImage *chartBitImageRotated; + int w, h; + bool blockAligned, resizableAtlas, allowRotate; + // out + bool best_insideAtlas; + int best_metric, best_x, best_y, best_w, best_h, best_r; +}; + +static void runFindChartLocationBruteForceTask(void *userData) +{ + XA_PROFILE_START(packChartsFindLocationThread) + auto args = (FindChartLocationBruteForceTaskArgs *)userData; + args->best_metric = INT_MAX; + if (args->finished->load()) + return; + // Try two different orientations. + for (int r = 0; r < 2; r++) { + int cw = args->chartBitImage->width(); + int ch = args->chartBitImage->height(); + if (r == 1) { + if (args->allowRotate) + swap(cw, ch); + else + break; + } + const int y = args->startPosition.y; + const int stepSize = args->blockAligned ? 4 : 1; + for (int x = args->startPosition.x; x <= args->w + stepSize; x += stepSize) { // + 1 not really necessary here. + if (!args->resizableAtlas && (x > (int)args->atlasBitImage->width() - cw || y > (int)args->atlasBitImage->height() - ch)) + continue; + if (args->finished->load()) + break; + // Early out if metric not better. + const int area = max(args->w, x + cw) * max(args->h, y + ch); + const int extents = max(max(args->w, x + cw), max(args->h, y + ch)); + const int metric = extents * extents + area; + if (metric > args->best_metric) + continue; + // If metric is the same, pick the one closest to the origin. + if (metric == args->best_metric && max(x, y) >= max(args->best_x, args->best_y)) + continue; + if (!args->atlasBitImage->canBlit(r == 1 ? *(args->chartBitImageRotated) : *(args->chartBitImage), x, y)) + continue; + args->best_metric = metric; + args->best_insideAtlas = area == args->w * args->h; + args->best_x = x; + args->best_y = y; + args->best_w = cw; + args->best_h = ch; + args->best_r = r; + if (args->best_insideAtlas) { + args->finished->store(true); + break; + } + } + } + XA_PROFILE_END(packChartsFindLocationThread) +} + struct Atlas { ~Atlas() @@ -6854,7 +7007,7 @@ struct Atlas } // Pack charts in the smallest possible rectangle. - bool packCharts(const PackOptions &options, ProgressFunc progressFunc, void *progressUserData) + bool packCharts(TaskScheduler *taskScheduler, const PackOptions &options, ProgressFunc progressFunc, void *progressUserData) { if (progressFunc) { if (!progressFunc(ProgressCategory::PackCharts, 0, progressUserData)) @@ -7069,7 +7222,7 @@ struct Atlas chartStartPositions.push_back(Vector2i(0, 0)); } XA_PROFILE_START(packChartsFindLocation) - const bool foundLocation = findChartLocation(chartStartPositions[currentAtlas], options.bruteForce, m_bitImages[currentAtlas], &chartBitImage, &chartBitImageRotated, atlasWidth, atlasHeight, &best_x, &best_y, &best_cw, &best_ch, &best_r, options.blockAlign, resizableAtlas, chart->allowRotate); + const bool foundLocation = findChartLocation(taskScheduler, chartStartPositions[currentAtlas], options.bruteForce, m_bitImages[currentAtlas], &chartBitImage, &chartBitImageRotated, atlasWidth, atlasHeight, &best_x, &best_y, &best_cw, &best_ch, &best_r, options.blockAlign, resizableAtlas, chart->allowRotate); XA_PROFILE_END(packChartsFindLocation) if (firstChartInBitImage && !foundLocation) { // Chart doesn't fit in an empty, newly allocated bitImage. texelsPerUnit must be too large for the resolution. @@ -7181,65 +7334,66 @@ private: // is occupied at this point. At the end we have many small charts and a large atlas with sparse holes. Finding those holes randomly is slow. A better approach would be to // start stacking large charts as if they were tetris pieces. Once charts get small try to place them randomly. It may be interesting to try a intermediate strategy, first try // along one axis and then try exhaustively along that axis. - bool findChartLocation(const Vector2i &startPosition, bool bruteForce, const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, bool blockAligned, bool resizableAtlas, bool allowRotate) + bool findChartLocation(TaskScheduler *taskScheduler, const Vector2i &startPosition, bool bruteForce, const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, bool blockAligned, bool resizableAtlas, bool allowRotate) { const int attempts = 4096; if (bruteForce || attempts >= w * h) - return findChartLocation_bruteForce(startPosition, atlasBitImage, chartBitImage, chartBitImageRotated, w, h, best_x, best_y, best_w, best_h, best_r, blockAligned, resizableAtlas, allowRotate); + return findChartLocation_bruteForce(taskScheduler, startPosition, atlasBitImage, chartBitImage, chartBitImageRotated, w, h, best_x, best_y, best_w, best_h, best_r, blockAligned, resizableAtlas, allowRotate); return findChartLocation_random(atlasBitImage, chartBitImage, chartBitImageRotated, w, h, best_x, best_y, best_w, best_h, best_r, attempts, blockAligned, resizableAtlas, allowRotate); } - bool findChartLocation_bruteForce(const Vector2i &startPosition, const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, bool blockAligned, bool resizableAtlas, bool allowRotate) + bool findChartLocation_bruteForce(TaskScheduler *taskScheduler, const Vector2i &startPosition, const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, bool blockAligned, bool resizableAtlas, bool allowRotate) { - bool result = false; - const int BLOCK_SIZE = 4; + const int stepSize = blockAligned ? 4 : 1; + uint32_t taskCount = 0; + for (int y = startPosition.y; y <= h + stepSize; y += stepSize) + taskCount++; + Array<FindChartLocationBruteForceTaskArgs> taskArgs; + taskArgs.resize(taskCount); + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(taskCount); + std::atomic<bool> finished(false); // One of the tasks found a location that doesn't expand the atlas. + uint32_t i = 0; + for (int y = startPosition.y; y <= h + stepSize; y += stepSize) { + FindChartLocationBruteForceTaskArgs &args = taskArgs[i]; + args.finished = &finished; + args.startPosition = Vector2i(y == startPosition.y ? startPosition.x : 0, y); + args.atlasBitImage = atlasBitImage; + args.chartBitImage = chartBitImage; + args.chartBitImageRotated = chartBitImageRotated; + args.w = w; + args.h = h; + args.blockAligned = blockAligned; + args.resizableAtlas = resizableAtlas; + args.allowRotate = allowRotate; + Task task; + task.userData = &taskArgs[i]; + task.func = runFindChartLocationBruteForceTask; + taskScheduler->run(taskGroup, task); + i++; + } + taskScheduler->wait(&taskGroup); + // Find the task result with the best metric. int best_metric = INT_MAX; - int step_size = blockAligned ? BLOCK_SIZE : 1; - // Try two different orientations. - for (int r = 0; r < 2; r++) { - int cw = chartBitImage->width(); - int ch = chartBitImage->height(); - if (r == 1) { - if (allowRotate) - swap(cw, ch); - else - break; - } - for (int y = startPosition.y; y <= h + step_size; y += step_size) { // + 1 to extend atlas in case atlas full. - for (int x = (y == startPosition.y ? startPosition.x : 0); x <= w + step_size; x += step_size) { // + 1 not really necessary here. - if (!resizableAtlas && (x > (int)atlasBitImage->width() - cw || y > (int)atlasBitImage->height() - ch)) - continue; - // Early out. - int area = max(w, x + cw) * max(h, y + ch); - //int perimeter = max(w, x+cw) + max(h, y+ch); - int extents = max(max(w, x + cw), max(h, y + ch)); - int metric = extents * extents + area; - if (metric > best_metric) { - continue; - } - if (metric == best_metric && max(x, y) >= max(*best_x, *best_y)) { - // If metric is the same, pick the one closest to the origin. - continue; - } - if (atlasBitImage->canBlit(r == 1 ? *chartBitImageRotated : *chartBitImage, x, y)) { - result = true; - best_metric = metric; - *best_x = x; - *best_y = y; - *best_w = cw; - *best_h = ch; - *best_r = r; - if (area == w * h) { - // Chart is completely inside, do not look at any other location. - goto done; - } - } - } - } + bool best_insideAtlas = false; + for (i = 0; i < taskCount; i++) { + FindChartLocationBruteForceTaskArgs &args = taskArgs[i]; + if (args.best_metric > best_metric) + continue; + // A location that doesn't expand the atlas is always preferred. + if (!args.best_insideAtlas && best_insideAtlas) + continue; + // If metric is the same, pick the one closest to the origin. + if (args.best_insideAtlas == best_insideAtlas && args.best_metric == best_metric && max(args.best_x, args.best_y) >= max(*best_x, *best_y)) + continue; + best_metric = args.best_metric; + best_insideAtlas = args.best_insideAtlas; + *best_x = args.best_x; + *best_y = args.best_y; + *best_w = args.best_w; + *best_h = args.best_h; + *best_r = args.best_r; } - done: - XA_DEBUG_ASSERT (best_metric != INT_MAX); - return result; + return best_metric != INT_MAX; } bool findChartLocation_random(const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, int minTrialCount, bool blockAligned, bool resizableAtlas, bool allowRotate) @@ -7439,25 +7593,31 @@ struct AddMeshTaskArgs static void runAddMeshTask(void *userData) { - XA_PROFILE_START(addMesh) + XA_PROFILE_START(addMeshThread) auto args = (AddMeshTaskArgs *)userData; // Responsible for freeing this. internal::Mesh *mesh = args->mesh; internal::Progress *progress = args->ctx->addMeshProgress; if (progress->cancel) goto cleanup; - XA_PROFILE_START(addMeshCreateColocals) - mesh->createColocals(); - XA_PROFILE_END(addMeshCreateColocals) + { + XA_PROFILE_START(addMeshCreateColocals) + mesh->createColocals(); + XA_PROFILE_END(addMeshCreateColocals) + } if (progress->cancel) goto cleanup; - XA_PROFILE_START(addMeshCreateFaceGroups) - mesh->createFaceGroups(); - XA_PROFILE_END(addMeshCreateFaceGroups) + { + XA_PROFILE_START(addMeshCreateFaceGroups) + mesh->createFaceGroups(); + XA_PROFILE_END(addMeshCreateFaceGroups) + } if (progress->cancel) goto cleanup; - XA_PROFILE_START(addMeshCreateBoundaries) - mesh->createBoundaries(); - XA_PROFILE_END(addMeshCreateBoundaries) + { + XA_PROFILE_START(addMeshCreateBoundaries) + mesh->createBoundaries(); + XA_PROFILE_END(addMeshCreateBoundaries) + } if (progress->cancel) goto cleanup; #if XA_DEBUG_EXPORT_OBJ_SOURCE_MESHES @@ -7491,9 +7651,11 @@ static void runAddMeshTask(void *userData) fclose(file); } #endif - XA_PROFILE_START(addMeshCreateChartGroupsConcurrent) - args->ctx->paramAtlas.addMesh(args->ctx->taskScheduler, mesh); // addMesh is thread safe - XA_PROFILE_END(addMeshCreateChartGroupsConcurrent) + { + XA_PROFILE_START(addMeshCreateChartGroupsReal) + args->ctx->paramAtlas.addMesh(args->ctx->taskScheduler, mesh); // addMesh is thread safe + XA_PROFILE_END(addMeshCreateChartGroupsReal) + } if (progress->cancel) goto cleanup; progress->value++; @@ -7503,7 +7665,7 @@ cleanup: XA_FREE(mesh); args->~AddMeshTaskArgs(); XA_FREE(args); - XA_PROFILE_END(addMesh) + XA_PROFILE_END(addMeshThread) } static internal::Vector3 DecodePosition(const MeshDecl &meshDecl, uint32_t index) @@ -7547,12 +7709,13 @@ AddMeshError::Enum AddMesh(Atlas *atlas, const MeshDecl &meshDecl, uint32_t mesh XA_PRINT_WARNING("AddMesh: Meshes and UV meshes cannot be added to the same atlas.\n"); return AddMeshError::Error; } +#if XA_PROFILE + if (ctx->meshCount == 0) + internal::s_profile.addMeshReal = clock(); +#endif // Don't know how many times AddMesh will be called, so progress needs to adjusted each time. if (!ctx->addMeshProgress) { ctx->addMeshProgress = XA_NEW(internal::MemTag::Default, internal::Progress, ProgressCategory::AddMesh, ctx->progressFunc, ctx->progressUserData, 1); -#if XA_PROFILE - internal::s_profile.addMeshConcurrent = clock(); -#endif } else { ctx->addMeshProgress->setMaxValue(internal::max(ctx->meshCount + 1, meshCountHint)); @@ -7560,7 +7723,6 @@ AddMeshError::Enum AddMesh(Atlas *atlas, const MeshDecl &meshDecl, uint32_t mesh bool decoded = (meshDecl.indexCount <= 0); uint32_t indexCount = decoded ? meshDecl.vertexCount : meshDecl.indexCount; XA_PRINT("Adding mesh %d: %u vertices, %u triangles\n", ctx->meshCount, meshDecl.vertexCount, indexCount / 3); - XA_PROFILE_START(addMesh) // Expecting triangle faces. if ((indexCount % 3) != 0) return AddMeshError::InvalidIndexCount; @@ -7629,15 +7791,16 @@ AddMeshError::Enum AddMesh(Atlas *atlas, const MeshDecl &meshDecl, uint32_t mesh ignore = true; mesh->addFace(tri[0], tri[1], tri[2], ignore); } + if (ctx->addMeshTaskGroup.value == UINT32_MAX) + ctx->addMeshTaskGroup = ctx->taskScheduler->createTaskGroup(); AddMeshTaskArgs *taskArgs = XA_NEW(internal::MemTag::Default, AddMeshTaskArgs); // The task frees this. taskArgs->ctx = ctx; taskArgs->mesh = mesh; internal::Task task; task.userData = taskArgs; task.func = runAddMeshTask; - ctx->taskScheduler->run(&ctx->addMeshTaskGroup, task); + ctx->taskScheduler->run(ctx->addMeshTaskGroup, task); ctx->meshCount++; - XA_PROFILE_END(addMesh) return AddMeshError::Success; } @@ -7657,15 +7820,15 @@ void AddMeshJoin(Atlas *atlas) ctx->addMeshProgress = nullptr; #if XA_PROFILE XA_PRINT("Added %u meshes\n", ctx->meshCount); - internal::s_profile.addMeshConcurrent = clock() - internal::s_profile.addMeshConcurrent; + internal::s_profile.addMeshReal = clock() - internal::s_profile.addMeshReal; #endif - XA_PROFILE_PRINT(" Total (concurrent): ", addMeshConcurrent) - XA_PROFILE_PRINT(" Total: ", addMesh) - XA_PROFILE_PRINT(" Create colocals: ", addMeshCreateColocals) - XA_PROFILE_PRINT(" Create face groups: ", addMeshCreateFaceGroups) - XA_PROFILE_PRINT(" Create boundaries: ", addMeshCreateBoundaries) - XA_PROFILE_PRINT(" Create chart groups (concurrent): ", addMeshCreateChartGroupsConcurrent) - XA_PROFILE_PRINT(" Create chart groups: ", addMeshCreateChartGroups) + XA_PROFILE_PRINT_AND_RESET(" Total (real): ", addMeshReal) + XA_PROFILE_PRINT_AND_RESET(" Total (thread): ", addMeshThread) + XA_PROFILE_PRINT_AND_RESET(" Create colocals: ", addMeshCreateColocals) + XA_PROFILE_PRINT_AND_RESET(" Create face groups: ", addMeshCreateFaceGroups) + XA_PROFILE_PRINT_AND_RESET(" Create boundaries: ", addMeshCreateBoundaries) + XA_PROFILE_PRINT_AND_RESET(" Create chart groups (real): ", addMeshCreateChartGroupsReal) + XA_PROFILE_PRINT_AND_RESET(" Create chart groups (thread): ", addMeshCreateChartGroupsThread) XA_PRINT_MEM_USAGE } @@ -7815,12 +7978,12 @@ void ComputeCharts(Atlas *atlas, ChartOptions chartOptions) } XA_PRINT("Computing charts\n"); uint32_t chartCount = 0, chartsWithHolesCount = 0, holesCount = 0, chartsWithTJunctionsCount = 0, tJunctionsCount = 0; - XA_PROFILE_START(computeChartsConcurrent) + XA_PROFILE_START(computeChartsReal) if (!ctx->paramAtlas.computeCharts(ctx->taskScheduler, chartOptions, ctx->progressFunc, ctx->progressUserData)) { XA_PRINT(" Cancelled by user\n"); return; } - XA_PROFILE_END(computeChartsConcurrent) + XA_PROFILE_END(computeChartsReal) // Count charts and print warnings. for (uint32_t i = 0; i < ctx->meshCount; i++) { for (uint32_t j = 0; j < ctx->paramAtlas.chartGroupCount(i); j++) { @@ -7854,16 +8017,17 @@ void ComputeCharts(Atlas *atlas, ChartOptions chartOptions) if (tJunctionsCount > 0) XA_PRINT(" Fixed %u t-junctions in %u charts\n", tJunctionsCount, chartsWithTJunctionsCount); XA_PRINT(" %u charts\n", chartCount); - XA_PROFILE_PRINT(" Total (concurrent): ", computeChartsConcurrent) - XA_PROFILE_PRINT(" Total: ", computeCharts) - XA_PROFILE_PRINT(" Atlas builder: ", atlasBuilder) - XA_PROFILE_PRINT(" Init: ", atlasBuilderInit) - XA_PROFILE_PRINT(" Create initial charts: ", atlasBuilderCreateInitialCharts) - XA_PROFILE_PRINT(" Grow charts: ", atlasBuilderGrowCharts) - XA_PROFILE_PRINT(" Merge charts: ", atlasBuilderMergeCharts) - XA_PROFILE_PRINT(" Create chart meshes: ", createChartMeshes) - XA_PROFILE_PRINT(" Fix t-junctions: ", fixChartMeshTJunctions); - XA_PROFILE_PRINT(" Close holes: ", closeChartMeshHoles) + XA_PROFILE_PRINT_AND_RESET(" Total (real): ", computeChartsReal) + XA_PROFILE_PRINT_AND_RESET(" Total (thread): ", computeChartsThread) + XA_PROFILE_PRINT_AND_RESET(" Atlas builder: ", atlasBuilder) + XA_PROFILE_PRINT_AND_RESET(" Init: ", atlasBuilderInit) + XA_PROFILE_PRINT_AND_RESET(" Create initial charts: ", atlasBuilderCreateInitialCharts) + XA_PROFILE_PRINT_AND_RESET(" Grow charts: ", atlasBuilderGrowCharts) + XA_PROFILE_PRINT_AND_RESET(" Merge charts: ", atlasBuilderMergeCharts) + XA_PROFILE_PRINT_AND_RESET(" Create chart meshes (real): ", createChartMeshesReal) + XA_PROFILE_PRINT_AND_RESET(" Create chart meshes (thread): ", createChartMeshesThread) + XA_PROFILE_PRINT_AND_RESET(" Fix t-junctions: ", fixChartMeshTJunctions) + XA_PROFILE_PRINT_AND_RESET(" Close holes: ", closeChartMeshHoles) XA_PRINT_MEM_USAGE } @@ -7896,12 +8060,12 @@ void ParameterizeCharts(Atlas *atlas, ParameterizeFunc func) } DestroyOutputMeshes(ctx); XA_PRINT("Parameterizing charts\n"); - XA_PROFILE_START(parameterizeChartsConcurrent) + XA_PROFILE_START(parameterizeChartsReal) if (!ctx->paramAtlas.parameterizeCharts(ctx->taskScheduler, func, ctx->progressFunc, ctx->progressUserData)) { XA_PRINT(" Cancelled by user\n"); return; } - XA_PROFILE_END(parameterizeChartsConcurrent) + XA_PROFILE_END(parameterizeChartsReal) uint32_t chartCount = 0, orthoChartsCount = 0, planarChartsCount = 0, chartsAddedCount = 0, chartsDeletedCount = 0; for (uint32_t i = 0; i < ctx->meshCount; i++) { for (uint32_t j = 0; j < ctx->paramAtlas.chartGroupCount(i); j++) { @@ -7982,11 +8146,11 @@ void ParameterizeCharts(Atlas *atlas, ParameterizeFunc func) } if (invalidParamCount > 0) XA_PRINT_WARNING(" %u charts with invalid parameterizations\n", invalidParamCount); - XA_PROFILE_PRINT(" Total (concurrent): ", parameterizeChartsConcurrent) - XA_PROFILE_PRINT(" Total: ", parameterizeCharts) - XA_PROFILE_PRINT(" Orthogonal: ", parameterizeChartsOrthogonal) - XA_PROFILE_PRINT(" LSCM: ", parameterizeChartsLSCM) - XA_PROFILE_PRINT(" Evaluate quality: ", parameterizeChartsEvaluateQuality) + XA_PROFILE_PRINT_AND_RESET(" Total (real): ", parameterizeChartsReal) + XA_PROFILE_PRINT_AND_RESET(" Total (thread): ", parameterizeChartsThread) + XA_PROFILE_PRINT_AND_RESET(" Orthogonal: ", parameterizeChartsOrthogonal) + XA_PROFILE_PRINT_AND_RESET(" LSCM: ", parameterizeChartsLSCM) + XA_PROFILE_PRINT_AND_RESET(" Evaluate quality: ", parameterizeChartsEvaluateQuality) XA_PRINT_MEM_USAGE } @@ -8039,7 +8203,7 @@ void PackCharts(Atlas *atlas, PackOptions packOptions) packAtlas.addChart(ctx->paramAtlas.chartAt(i)); } XA_PROFILE_START(packCharts) - if (!packAtlas.packCharts(packOptions, ctx->progressFunc, ctx->progressUserData)) + if (!packAtlas.packCharts(ctx->taskScheduler, packOptions, ctx->progressFunc, ctx->progressUserData)) return; XA_PROFILE_END(packCharts) // Populate atlas object with pack results. @@ -8058,19 +8222,13 @@ void PackCharts(Atlas *atlas, PackOptions packOptions) for (uint32_t i = 0; i < atlas->atlasCount; i++) packAtlas.getImages()[i]->copyTo(&atlas->image[atlas->width * atlas->height * i], atlas->width, atlas->height); } - XA_PROFILE_PRINT(" Total: ", packCharts) - XA_PROFILE_PRINT(" Rasterize: ", packChartsRasterize) - XA_PROFILE_PRINT(" Dilate (padding): ", packChartsDilate) - XA_PROFILE_PRINT(" Find location: ", packChartsFindLocation) - XA_PROFILE_PRINT(" Blit: ", packChartsBlit) + XA_PROFILE_PRINT_AND_RESET(" Total: ", packCharts) + XA_PROFILE_PRINT_AND_RESET(" Rasterize: ", packChartsRasterize) + XA_PROFILE_PRINT_AND_RESET(" Dilate (padding): ", packChartsDilate) + XA_PROFILE_PRINT_AND_RESET(" Find location (real): ", packChartsFindLocation) + XA_PROFILE_PRINT_AND_RESET(" Find location (thread): ", packChartsFindLocationThread) + XA_PROFILE_PRINT_AND_RESET(" Blit: ", packChartsBlit) XA_PRINT_MEM_USAGE -#if XA_PROFILE - internal::s_profile.packCharts = 0; - internal::s_profile.packChartsRasterize = 0; - internal::s_profile.packChartsDilate = 0; - internal::s_profile.packChartsFindLocation = 0; - internal::s_profile.packChartsBlit = 0; -#endif XA_PRINT("Building output meshes\n"); int progress = 0; if (ctx->progressFunc) { diff --git a/thirdparty/zstd/common/compiler.h b/thirdparty/zstd/common/compiler.h index 0836e3ed27..87bf51ae8c 100644 --- a/thirdparty/zstd/common/compiler.h +++ b/thirdparty/zstd/common/compiler.h @@ -127,6 +127,13 @@ } \ } +/* vectorization */ +#if !defined(__clang__) && defined(__GNUC__) +# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) +#else +# define DONT_VECTORIZE +#endif + /* disable warnings */ #ifdef _MSC_VER /* Visual Studio */ # include <intrin.h> /* For Visual 2005 */ diff --git a/thirdparty/zstd/common/zstd_internal.h b/thirdparty/zstd/common/zstd_internal.h index 31f756ab58..81b16eac2e 100644 --- a/thirdparty/zstd/common/zstd_internal.h +++ b/thirdparty/zstd/common/zstd_internal.h @@ -34,7 +34,6 @@ #endif #include "xxhash.h" /* XXH_reset, update, digest */ - #if defined (__cplusplus) extern "C" { #endif @@ -193,19 +192,72 @@ static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG; * Shared functions to include for inlining *********************************************/ static void ZSTD_copy8(void* dst, const void* src) { memcpy(dst, src, 8); } + #define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=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 + +typedef enum { + ZSTD_no_overlap, + 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) */ -#define WILDCOPY_OVERLENGTH 8 -MEM_STATIC void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length) +MEM_STATIC FORCE_INLINE_ATTR DONT_VECTORIZE +void ZSTD_wildcopy(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; - do - COPY8(op, ip) - while (op < oend); + + 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 { + 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); + } } 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 */ diff --git a/thirdparty/zstd/compress/zstd_compress.c b/thirdparty/zstd/compress/zstd_compress.c index 2e163c8bf3..1476512580 100644 --- a/thirdparty/zstd/compress/zstd_compress.c +++ b/thirdparty/zstd/compress/zstd_compress.c @@ -385,6 +385,11 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) bounds.upperBound = ZSTD_lcm_uncompressed; return bounds; + case ZSTD_c_targetCBlockSize: + bounds.lowerBound = ZSTD_TARGETCBLOCKSIZE_MIN; + bounds.upperBound = ZSTD_TARGETCBLOCKSIZE_MAX; + return bounds; + default: { ZSTD_bounds const boundError = { ERROR(parameter_unsupported), 0, 0 }; return boundError; @@ -452,6 +457,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter param) case ZSTD_c_ldmHashRateLog: case ZSTD_c_forceAttachDict: case ZSTD_c_literalCompressionMode: + case ZSTD_c_targetCBlockSize: default: return 0; } @@ -497,6 +503,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value) case ZSTD_c_ldmHashLog: case ZSTD_c_ldmMinMatch: case ZSTD_c_ldmBucketSizeLog: + case ZSTD_c_targetCBlockSize: break; default: RETURN_ERROR(parameter_unsupported); @@ -671,6 +678,12 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams, CCtxParams->ldmParams.hashRateLog = value; return CCtxParams->ldmParams.hashRateLog; + case ZSTD_c_targetCBlockSize : + if (value!=0) /* 0 ==> default */ + BOUNDCHECK(ZSTD_c_targetCBlockSize, value); + CCtxParams->targetCBlockSize = value; + return CCtxParams->targetCBlockSize; + default: RETURN_ERROR(parameter_unsupported, "unknown parameter"); } } @@ -692,13 +705,13 @@ size_t ZSTD_CCtxParams_getParameter( *value = CCtxParams->compressionLevel; break; case ZSTD_c_windowLog : - *value = CCtxParams->cParams.windowLog; + *value = (int)CCtxParams->cParams.windowLog; break; case ZSTD_c_hashLog : - *value = CCtxParams->cParams.hashLog; + *value = (int)CCtxParams->cParams.hashLog; break; case ZSTD_c_chainLog : - *value = CCtxParams->cParams.chainLog; + *value = (int)CCtxParams->cParams.chainLog; break; case ZSTD_c_searchLog : *value = CCtxParams->cParams.searchLog; @@ -773,6 +786,9 @@ size_t ZSTD_CCtxParams_getParameter( case ZSTD_c_ldmHashRateLog : *value = CCtxParams->ldmParams.hashRateLog; break; + case ZSTD_c_targetCBlockSize : + *value = (int)CCtxParams->targetCBlockSize; + break; default: RETURN_ERROR(parameter_unsupported, "unknown parameter"); } return 0; @@ -930,12 +946,12 @@ size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset) @return : 0, or an error code if one value is beyond authorized range */ size_t ZSTD_checkCParams(ZSTD_compressionParameters cParams) { - BOUNDCHECK(ZSTD_c_windowLog, cParams.windowLog); - BOUNDCHECK(ZSTD_c_chainLog, cParams.chainLog); - BOUNDCHECK(ZSTD_c_hashLog, cParams.hashLog); - BOUNDCHECK(ZSTD_c_searchLog, cParams.searchLog); - BOUNDCHECK(ZSTD_c_minMatch, cParams.minMatch); - BOUNDCHECK(ZSTD_c_targetLength,cParams.targetLength); + BOUNDCHECK(ZSTD_c_windowLog, (int)cParams.windowLog); + BOUNDCHECK(ZSTD_c_chainLog, (int)cParams.chainLog); + BOUNDCHECK(ZSTD_c_hashLog, (int)cParams.hashLog); + BOUNDCHECK(ZSTD_c_searchLog, (int)cParams.searchLog); + BOUNDCHECK(ZSTD_c_minMatch, (int)cParams.minMatch); + BOUNDCHECK(ZSTD_c_targetLength,(int)cParams.targetLength); BOUNDCHECK(ZSTD_c_strategy, cParams.strategy); return 0; } @@ -951,7 +967,7 @@ ZSTD_clampCParams(ZSTD_compressionParameters cParams) if ((int)val<bounds.lowerBound) val=(type)bounds.lowerBound; \ else if ((int)val>bounds.upperBound) val=(type)bounds.upperBound; \ } -# define CLAMP(cParam, val) CLAMP_TYPE(cParam, val, int) +# define CLAMP(cParam, val) CLAMP_TYPE(cParam, val, unsigned) CLAMP(ZSTD_c_windowLog, cParams.windowLog); CLAMP(ZSTD_c_chainLog, cParams.chainLog); CLAMP(ZSTD_c_hashLog, cParams.hashLog); @@ -1282,15 +1298,14 @@ static void ZSTD_reset_compressedBlockState(ZSTD_compressedBlockState_t* bs) } /*! ZSTD_invalidateMatchState() - * Invalidate all the matches in the match finder tables. - * Requires nextSrc and base to be set (can be NULL). + * Invalidate all the matches in the match finder tables. + * Requires nextSrc and base to be set (can be NULL). */ static void ZSTD_invalidateMatchState(ZSTD_matchState_t* ms) { ZSTD_window_clear(&ms->window); ms->nextToUpdate = ms->window.dictLimit; - ms->nextToUpdate3 = ms->window.dictLimit; ms->loadedDictEnd = 0; ms->opt.litLengthSum = 0; /* force reset of btopt stats */ ms->dictMatchState = NULL; @@ -1327,15 +1342,17 @@ static size_t ZSTD_continueCCtx(ZSTD_CCtx* cctx, ZSTD_CCtx_params params, U64 pl typedef enum { ZSTDcrp_continue, ZSTDcrp_noMemset } ZSTD_compResetPolicy_e; +typedef enum { ZSTD_resetTarget_CDict, ZSTD_resetTarget_CCtx } ZSTD_resetTarget_e; + static void* ZSTD_reset_matchState(ZSTD_matchState_t* ms, void* ptr, const ZSTD_compressionParameters* cParams, - ZSTD_compResetPolicy_e const crp, U32 const forCCtx) + ZSTD_compResetPolicy_e const crp, ZSTD_resetTarget_e const 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 = (forCCtx && cParams->minMatch==3) ? MIN(ZSTD_HASHLOG3_MAX, cParams->windowLog) : 0; + 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); @@ -1349,7 +1366,7 @@ ZSTD_reset_matchState(ZSTD_matchState_t* ms, ZSTD_invalidateMatchState(ms); /* opt parser space */ - if (forCCtx && (cParams->strategy >= ZSTD_btopt)) { + 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); @@ -1377,6 +1394,19 @@ ZSTD_reset_matchState(ZSTD_matchState_t* ms, return ptr; } +/* ZSTD_indexTooCloseToMax() : + * minor optimization : prefer memset() rather than reduceIndex() + * which is measurably slow in some circumstances (reported for Visual Studio). + * Works when re-using a context for a lot of smallish inputs : + * if all inputs are smaller than ZSTD_INDEXOVERFLOW_MARGIN, + * memset() will be triggered before reduceIndex(). + */ +#define ZSTD_INDEXOVERFLOW_MARGIN (16 MB) +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, @@ -1388,7 +1418,7 @@ ZSTD_reset_matchState(ZSTD_matchState_t* ms, note : `params` are assumed fully validated at this stage */ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, ZSTD_CCtx_params params, - U64 pledgedSrcSize, + U64 const pledgedSrcSize, ZSTD_compResetPolicy_e const crp, ZSTD_buffered_policy_e const zbuff) { @@ -1400,13 +1430,21 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, if (ZSTD_equivalentParams(zc->appliedParams, params, zc->inBuffSize, zc->seqStore.maxNbSeq, zc->seqStore.maxNbLit, - zbuff, pledgedSrcSize)) { - DEBUGLOG(4, "ZSTD_equivalentParams()==1 -> continue mode (wLog1=%u, blockSize1=%zu)", - zc->appliedParams.cParams.windowLog, zc->blockSize); + 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) + 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"); if (params.ldmParams.enableLdm) { @@ -1449,7 +1487,7 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, DEBUGLOG(4, "windowSize: %zu - blockSize: %zu", windowSize, blockSize); if (workSpaceTooSmall || workSpaceWasteful) { - DEBUGLOG(4, "Need to resize workSpaceSize from %zuKB to %zuKB", + DEBUGLOG(4, "Resize workSpaceSize from %zuKB to %zuKB", zc->workSpaceSize >> 10, neededSpace >> 10); @@ -1491,7 +1529,10 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, ZSTD_reset_compressedBlockState(zc->blockState.prevCBlock); - ptr = zc->entropyWorkspace + HUF_WORKSPACE_SIZE_U32; + 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 */ @@ -1509,8 +1550,6 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, } assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */ - ptr = ZSTD_reset_matchState(&zc->blockState.matchState, ptr, ¶ms.cParams, crp, /* forCCtx */ 1); - /* sequences storage */ zc->seqStore.maxNbSeq = maxNbSeq; zc->seqStore.sequencesStart = (seqDef*)ptr; @@ -1587,15 +1626,14 @@ static int ZSTD_shouldAttachDict(const ZSTD_CDict* cdict, * handled in _enforceMaxDist */ } -static size_t ZSTD_resetCCtx_byAttachingCDict( - ZSTD_CCtx* cctx, - const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, - U64 pledgedSrcSize, - ZSTD_buffered_policy_e zbuff) +static size_t +ZSTD_resetCCtx_byAttachingCDict(ZSTD_CCtx* cctx, + const ZSTD_CDict* cdict, + ZSTD_CCtx_params params, + U64 pledgedSrcSize, + ZSTD_buffered_policy_e zbuff) { - { - const ZSTD_compressionParameters *cdict_cParams = &cdict->matchState.cParams; + { const ZSTD_compressionParameters* const cdict_cParams = &cdict->matchState.cParams; unsigned const windowLog = params.cParams.windowLog; assert(windowLog != 0); /* Resize working context table params for input only, since the dict @@ -1607,8 +1645,7 @@ static size_t ZSTD_resetCCtx_byAttachingCDict( assert(cctx->appliedParams.cParams.strategy == cdict_cParams->strategy); } - { - const U32 cdictEnd = (U32)( cdict->matchState.window.nextSrc + { const U32 cdictEnd = (U32)( cdict->matchState.window.nextSrc - cdict->matchState.window.base); const U32 cdictLen = cdictEnd - cdict->matchState.window.dictLimit; if (cdictLen == 0) { @@ -1625,9 +1662,9 @@ static size_t ZSTD_resetCCtx_byAttachingCDict( cctx->blockState.matchState.window.base + cdictEnd; ZSTD_window_clear(&cctx->blockState.matchState.window); } + /* loadedDictEnd is expressed within the referential of the active context */ cctx->blockState.matchState.loadedDictEnd = cctx->blockState.matchState.window.dictLimit; - } - } + } } cctx->dictID = cdict->dictID; @@ -1681,7 +1718,6 @@ static size_t ZSTD_resetCCtx_byCopyingCDict(ZSTD_CCtx* cctx, ZSTD_matchState_t* dstMatchState = &cctx->blockState.matchState; dstMatchState->window = srcMatchState->window; dstMatchState->nextToUpdate = srcMatchState->nextToUpdate; - dstMatchState->nextToUpdate3= srcMatchState->nextToUpdate3; dstMatchState->loadedDictEnd= srcMatchState->loadedDictEnd; } @@ -1761,7 +1797,6 @@ static size_t ZSTD_copyCCtx_internal(ZSTD_CCtx* dstCCtx, ZSTD_matchState_t* dstMatchState = &dstCCtx->blockState.matchState; dstMatchState->window = srcMatchState->window; dstMatchState->nextToUpdate = srcMatchState->nextToUpdate; - dstMatchState->nextToUpdate3= srcMatchState->nextToUpdate3; dstMatchState->loadedDictEnd= srcMatchState->loadedDictEnd; } dstCCtx->dictID = srcCCtx->dictID; @@ -1831,16 +1866,15 @@ static void ZSTD_reduceTable_btlazy2(U32* const table, U32 const size, U32 const /*! ZSTD_reduceIndex() : * rescale all indexes to avoid future overflow (indexes are U32) */ -static void ZSTD_reduceIndex (ZSTD_CCtx* zc, const U32 reducerValue) +static void ZSTD_reduceIndex (ZSTD_matchState_t* ms, ZSTD_CCtx_params const* params, const U32 reducerValue) { - ZSTD_matchState_t* const ms = &zc->blockState.matchState; - { U32 const hSize = (U32)1 << zc->appliedParams.cParams.hashLog; + { U32 const hSize = (U32)1 << params->cParams.hashLog; ZSTD_reduceTable(ms->hashTable, hSize, reducerValue); } - if (zc->appliedParams.cParams.strategy != ZSTD_fast) { - U32 const chainSize = (U32)1 << zc->appliedParams.cParams.chainLog; - if (zc->appliedParams.cParams.strategy == ZSTD_btlazy2) + if (params->cParams.strategy != ZSTD_fast) { + U32 const chainSize = (U32)1 << params->cParams.chainLog; + if (params->cParams.strategy == ZSTD_btlazy2) ZSTD_reduceTable_btlazy2(ms->chainTable, chainSize, reducerValue); else ZSTD_reduceTable(ms->chainTable, chainSize, reducerValue); @@ -2524,6 +2558,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, 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)); @@ -2532,6 +2567,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, /* seqHead : flags for FSE encoding type */ seqHead = op++; + assert(op <= oend); /* convert length/distances into codes */ ZSTD_seqToCodes(seqStorePtr); @@ -2555,6 +2591,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, if (LLtype == set_compressed) lastNCount = op; op += countSize; + assert(op <= oend); } } /* build CTable for Offsets */ { unsigned max = MaxOff; @@ -2577,6 +2614,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, if (Offtype == set_compressed) lastNCount = op; op += countSize; + assert(op <= oend); } } /* build CTable for MatchLengths */ { unsigned max = MaxML; @@ -2597,6 +2635,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, if (MLtype == set_compressed) lastNCount = op; op += countSize; + assert(op <= oend); } } *seqHead = (BYTE)((LLtype<<6) + (Offtype<<4) + (MLtype<<2)); @@ -2610,6 +2649,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, longOffsets, bmi2); FORWARD_IF_ERROR(bitstreamSize); op += bitstreamSize; + assert(op <= oend); /* zstd versions <= 1.3.4 mistakenly report corruption when * FSE_readNCount() receives a buffer < 4 bytes. * Fixed by https://github.com/facebook/zstd/pull/1146. @@ -2721,30 +2761,24 @@ void ZSTD_resetSeqStore(seqStore_t* ssPtr) ssPtr->longLengthID = 0; } -static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, - void* dst, size_t dstCapacity, - const void* src, size_t srcSize) +typedef enum { ZSTDbss_compress, ZSTDbss_noCompress } ZSTD_buildSeqStore_e; + +static size_t ZSTD_buildSeqStore(ZSTD_CCtx* zc, const void* src, size_t srcSize) { ZSTD_matchState_t* const ms = &zc->blockState.matchState; - size_t cSize; - DEBUGLOG(5, "ZSTD_compressBlock_internal (dstCapacity=%u, dictLimit=%u, nextToUpdate=%u)", - (unsigned)dstCapacity, (unsigned)ms->window.dictLimit, (unsigned)ms->nextToUpdate); + DEBUGLOG(5, "ZSTD_buildSeqStore (srcSize=%zu)", srcSize); assert(srcSize <= ZSTD_BLOCKSIZE_MAX); - /* Assert that we have correctly flushed the ctx params into the ms's copy */ ZSTD_assertEqualCParams(zc->appliedParams.cParams, ms->cParams); - if (srcSize < MIN_CBLOCK_SIZE+ZSTD_blockHeaderSize+1) { ZSTD_ldm_skipSequences(&zc->externSeqStore, srcSize, zc->appliedParams.cParams.minMatch); - cSize = 0; - goto out; /* don't even attempt compression below a certain srcSize */ + return ZSTDbss_noCompress; /* don't even attempt compression below a certain srcSize */ } ZSTD_resetSeqStore(&(zc->seqStore)); /* required for optimal parser to read stats from dictionary */ ms->opt.symbolCosts = &zc->blockState.prevCBlock->entropy; /* tell the optimal parser how we expect to compress literals */ ms->opt.literalCompressionMode = zc->appliedParams.literalCompressionMode; - /* a gap between an attached dict and the current window is not safe, * they must remain adjacent, * and when that stops being the case, the dict must be unset */ @@ -2798,6 +2832,21 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, { const BYTE* const lastLiterals = (const BYTE*)src + srcSize - lastLLSize; ZSTD_storeLastLiterals(&zc->seqStore, lastLiterals, lastLLSize); } } + return ZSTDbss_compress; +} + +static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize) +{ + size_t cSize; + DEBUGLOG(5, "ZSTD_compressBlock_internal (dstCapacity=%u, dictLimit=%u, nextToUpdate=%u)", + (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; } + } /* encode sequences and literals */ cSize = ZSTD_compressSequences(&zc->seqStore, @@ -2826,6 +2875,25 @@ out: } +static void ZSTD_overflowCorrectIfNeeded(ZSTD_matchState_t* ms, 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; + U32 const cycleLog = ZSTD_cycleLog(params->cParams.chainLog, params->cParams.strategy); + U32 const correction = ZSTD_window_correctOverflow(&ms->window, cycleLog, maxDist, ip); + ZSTD_STATIC_ASSERT(ZSTD_CHAINLOG_MAX <= 30); + ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_32 <= 30); + ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31); + ZSTD_reduceIndex(ms, params, correction); + if (ms->nextToUpdate < correction) ms->nextToUpdate = 0; + else ms->nextToUpdate -= correction; + /* invalidate dictionaries on overflow correction */ + ms->loadedDictEnd = 0; + ms->dictMatchState = NULL; + } +} + + /*! ZSTD_compress_frameChunk() : * Compress a chunk of data into one or multiple blocks. * All blocks will be terminated, all input will be consumed. @@ -2844,7 +2912,7 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, BYTE* const ostart = (BYTE*)dst; BYTE* op = ostart; U32 const maxDist = (U32)1 << cctx->appliedParams.cParams.windowLog; - assert(cctx->appliedParams.cParams.windowLog <= 31); + assert(cctx->appliedParams.cParams.windowLog <= ZSTD_WINDOWLOG_MAX); DEBUGLOG(5, "ZSTD_compress_frameChunk (blockSize=%u)", (unsigned)blockSize); if (cctx->appliedParams.fParams.checksumFlag && srcSize) @@ -2859,19 +2927,10 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, "not enough space to store compressed block"); if (remaining < blockSize) blockSize = remaining; - if (ZSTD_window_needOverflowCorrection(ms->window, ip + blockSize)) { - U32 const cycleLog = ZSTD_cycleLog(cctx->appliedParams.cParams.chainLog, cctx->appliedParams.cParams.strategy); - U32 const correction = ZSTD_window_correctOverflow(&ms->window, cycleLog, maxDist, ip); - ZSTD_STATIC_ASSERT(ZSTD_CHAINLOG_MAX <= 30); - ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_32 <= 30); - ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31); - ZSTD_reduceIndex(cctx, correction); - if (ms->nextToUpdate < correction) ms->nextToUpdate = 0; - else ms->nextToUpdate -= correction; - ms->loadedDictEnd = 0; - ms->dictMatchState = NULL; - } - ZSTD_window_enforceMaxDist(&ms->window, ip + blockSize, maxDist, &ms->loadedDictEnd, &ms->dictMatchState); + ZSTD_overflowCorrectIfNeeded(ms, &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 */ if (ms->nextToUpdate < ms->window.lowLimit) ms->nextToUpdate = ms->window.lowLimit; { size_t cSize = ZSTD_compressBlock_internal(cctx, @@ -2899,7 +2958,7 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, } } if (lastFrameChunk && (op>ostart)) cctx->stage = ZSTDcs_ending; - return op-ostart; + return (size_t)(op-ostart); } @@ -2991,6 +3050,7 @@ static size_t ZSTD_compressContinue_internal (ZSTD_CCtx* cctx, fhSize = ZSTD_writeFrameHeader(dst, dstCapacity, cctx->appliedParams, cctx->pledgedSrcSizePlusOne-1, cctx->dictID); FORWARD_IF_ERROR(fhSize); + assert(fhSize <= dstCapacity); dstCapacity -= fhSize; dst = (char*)dst + fhSize; cctx->stage = ZSTDcs_ongoing; @@ -3007,18 +3067,7 @@ static size_t ZSTD_compressContinue_internal (ZSTD_CCtx* cctx, if (!frame) { /* overflow check and correction for block mode */ - if (ZSTD_window_needOverflowCorrection(ms->window, (const char*)src + srcSize)) { - U32 const cycleLog = ZSTD_cycleLog(cctx->appliedParams.cParams.chainLog, cctx->appliedParams.cParams.strategy); - U32 const correction = ZSTD_window_correctOverflow(&ms->window, cycleLog, 1 << cctx->appliedParams.cParams.windowLog, src); - ZSTD_STATIC_ASSERT(ZSTD_CHAINLOG_MAX <= 30); - ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_32 <= 30); - ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31); - ZSTD_reduceIndex(cctx, correction); - if (ms->nextToUpdate < correction) ms->nextToUpdate = 0; - else ms->nextToUpdate -= correction; - ms->loadedDictEnd = 0; - ms->dictMatchState = NULL; - } + ZSTD_overflowCorrectIfNeeded(ms, &cctx->appliedParams, src, (BYTE const*)src + srcSize); } DEBUGLOG(5, "ZSTD_compressContinue_internal (blockSize=%u)", (unsigned)cctx->blockSize); @@ -3074,7 +3123,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms, const void* src, size_t srcSize, ZSTD_dictTableLoadMethod_e dtlm) { - const BYTE* const ip = (const BYTE*) src; + const BYTE* ip = (const BYTE*) src; const BYTE* const iend = ip + srcSize; ZSTD_window_update(&ms->window, src, srcSize); @@ -3085,32 +3134,42 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms, if (srcSize <= HASH_READ_SIZE) return 0; - switch(params->cParams.strategy) - { - case ZSTD_fast: - ZSTD_fillHashTable(ms, iend, dtlm); - break; - case ZSTD_dfast: - ZSTD_fillDoubleHashTable(ms, iend, dtlm); - break; + while (iend - ip > HASH_READ_SIZE) { + size_t const remaining = iend - ip; + size_t const chunk = MIN(remaining, ZSTD_CHUNKSIZE_MAX); + const BYTE* const ichunk = ip + chunk; - case ZSTD_greedy: - case ZSTD_lazy: - case ZSTD_lazy2: - if (srcSize >= HASH_READ_SIZE) - ZSTD_insertAndFindFirstIndex(ms, iend-HASH_READ_SIZE); - break; + ZSTD_overflowCorrectIfNeeded(ms, params, ip, ichunk); - case ZSTD_btlazy2: /* we want the dictionary table fully sorted */ - case ZSTD_btopt: - case ZSTD_btultra: - case ZSTD_btultra2: - if (srcSize >= HASH_READ_SIZE) - ZSTD_updateTree(ms, iend-HASH_READ_SIZE, iend); - break; + switch(params->cParams.strategy) + { + case ZSTD_fast: + ZSTD_fillHashTable(ms, ichunk, dtlm); + break; + case ZSTD_dfast: + ZSTD_fillDoubleHashTable(ms, ichunk, dtlm); + break; - default: - assert(0); /* not possible : not a valid strategy id */ + case ZSTD_greedy: + case ZSTD_lazy: + case ZSTD_lazy2: + if (chunk >= HASH_READ_SIZE) + ZSTD_insertAndFindFirstIndex(ms, ichunk-HASH_READ_SIZE); + break; + + case ZSTD_btlazy2: /* we want the dictionary table fully sorted */ + case ZSTD_btopt: + case ZSTD_btultra: + case ZSTD_btultra2: + if (chunk >= HASH_READ_SIZE) + ZSTD_updateTree(ms, ichunk-HASH_READ_SIZE, ichunk); + break; + + default: + assert(0); /* not possible : not a valid strategy id */ + } + + ip = ichunk; } ms->nextToUpdate = (U32)(iend - ms->window.base); @@ -3297,12 +3356,11 @@ static size_t ZSTD_compressBegin_internal(ZSTD_CCtx* cctx, FORWARD_IF_ERROR( ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize, ZSTDcrp_continue, zbuff) ); - { - size_t const dictID = ZSTD_compress_insertDictionary( + { size_t const dictID = ZSTD_compress_insertDictionary( cctx->blockState.prevCBlock, &cctx->blockState.matchState, ¶ms, dict, dictSize, dictContentType, dtlm, cctx->entropyWorkspace); FORWARD_IF_ERROR(dictID); - assert(dictID <= (size_t)(U32)-1); + assert(dictID <= UINT_MAX); cctx->dictID = (U32)dictID; } return 0; @@ -3555,10 +3613,10 @@ static size_t ZSTD_initCDict_internal( /* 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, /* forCCtx */ 0); + { 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; } @@ -4068,7 +4126,7 @@ static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs, case zcss_flush: DEBUGLOG(5, "flush stage"); { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize; - size_t const flushed = ZSTD_limitCopy(op, oend-op, + size_t const flushed = ZSTD_limitCopy(op, (size_t)(oend-op), zcs->outBuff + zcs->outBuffFlushedSize, toFlush); DEBUGLOG(5, "toFlush: %u into %u ==> flushed: %u", (unsigned)toFlush, (unsigned)(oend-op), (unsigned)flushed); @@ -4262,7 +4320,7 @@ size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) if (zcs->appliedParams.nbWorkers > 0) return remainingToFlush; /* minimal estimation */ /* single thread mode : attempt to calculate remaining to flush more precisely */ { size_t const lastBlockSize = zcs->frameEnded ? 0 : ZSTD_BLOCKHEADERSIZE; - size_t const checksumSize = zcs->frameEnded ? 0 : zcs->appliedParams.fParams.checksumFlag * 4; + size_t const checksumSize = (size_t)(zcs->frameEnded ? 0 : zcs->appliedParams.fParams.checksumFlag * 4); size_t const toFlush = remainingToFlush + lastBlockSize + checksumSize; DEBUGLOG(4, "ZSTD_endStream : remaining to flush : %u", (unsigned)toFlush); return toFlush; diff --git a/thirdparty/zstd/compress/zstd_compress_internal.h b/thirdparty/zstd/compress/zstd_compress_internal.h index cc3cbb9da9..5495899be3 100644 --- a/thirdparty/zstd/compress/zstd_compress_internal.h +++ b/thirdparty/zstd/compress/zstd_compress_internal.h @@ -33,13 +33,13 @@ extern "C" { ***************************************/ #define kSearchStrength 8 #define HASH_READ_SIZE 8 -#define ZSTD_DUBT_UNSORTED_MARK 1 /* For btlazy2 strategy, index 1 now means "unsorted". +#define ZSTD_DUBT_UNSORTED_MARK 1 /* For btlazy2 strategy, index ZSTD_DUBT_UNSORTED_MARK==1 means "unsorted". It could be confused for a real successor at index "1", if sorted as larger than its predecessor. It's not a big deal though : candidate will just be sorted again. Additionally, candidate position 1 will be lost. But candidate 1 cannot hide a large tree of candidates, so it's a minimal loss. - The benefit is that ZSTD_DUBT_UNSORTED_MARK cannot be mishandled after table re-use with a different strategy - Constant required by ZSTD_compressBlock_btlazy2() and ZSTD_reduceTable_internal() */ + The benefit is that ZSTD_DUBT_UNSORTED_MARK cannot be mishandled after table re-use with a different strategy. + This constant is required by ZSTD_compressBlock_btlazy2() and ZSTD_reduceTable_internal() */ /*-************************************* @@ -128,21 +128,20 @@ typedef struct { BYTE const* base; /* All regular indexes relative to this position */ BYTE const* dictBase; /* extDict indexes relative to this position */ U32 dictLimit; /* below that point, need extDict */ - U32 lowLimit; /* below that point, no more data */ + U32 lowLimit; /* below that point, no more valid data */ } ZSTD_window_t; 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 */ + 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 nextToUpdate; /* index from which to continue table update */ - U32 nextToUpdate3; /* index from which to continue table update */ U32 hashLog3; /* dispatch table : larger == faster, more memory */ U32* hashTable; U32* hashTable3; U32* chainTable; optState_t opt; /* optimal parser state */ - const ZSTD_matchState_t * dictMatchState; + const ZSTD_matchState_t* dictMatchState; ZSTD_compressionParameters cParams; }; @@ -195,6 +194,9 @@ struct ZSTD_CCtx_params_s { int compressionLevel; int forceWindow; /* force back-references to respect limit of * 1<<wLog, even for dictionary */ + 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 */ ZSTD_dictAttachPref_e attachDictPref; ZSTD_literalCompressionMode_e literalCompressionMode; @@ -324,7 +326,7 @@ MEM_STATIC void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const v /* copy Literals */ assert(seqStorePtr->maxNbLit <= 128 KB); assert(seqStorePtr->lit + litLength <= seqStorePtr->litStart + seqStorePtr->maxNbLit); - ZSTD_wildcopy(seqStorePtr->lit, literals, litLength); + ZSTD_wildcopy(seqStorePtr->lit, literals, litLength, ZSTD_no_overlap); seqStorePtr->lit += litLength; /* literal Length */ @@ -564,6 +566,9 @@ MEM_STATIC U64 ZSTD_rollingHash_rotate(U64 hash, BYTE toRemove, BYTE toAdd, U64 /*-************************************* * Round buffer management ***************************************/ +#if (ZSTD_WINDOWLOG_MAX_64 > 31) +# error "ZSTD_WINDOWLOG_MAX is too large : would overflow ZSTD_CURRENT_MAX" +#endif /* Max current allowed */ #define ZSTD_CURRENT_MAX ((3U << 29) + (1U << ZSTD_WINDOWLOG_MAX)) /* Maximum chunk size before overflow correction needs to be called again */ @@ -675,31 +680,49 @@ MEM_STATIC U32 ZSTD_window_correctOverflow(ZSTD_window_t* window, U32 cycleLog, * Updates lowLimit so that: * (srcEnd - base) - lowLimit == maxDist + loadedDictEnd * - * This allows a simple check that index >= lowLimit to see if index is valid. - * This must be called before a block compression call, with srcEnd as the block - * source end. + * It ensures index is valid as long as index >= lowLimit. + * This must be called before a block compression call. + * + * loadedDictEnd is only defined if a dictionary is in use for current compression. + * As the name implies, loadedDictEnd represents the index at end of dictionary. + * The value lies within context's referential, it can be directly compared to blockEndIdx. * - * If loadedDictEndPtr is not NULL, we set it to zero once we update lowLimit. - * This is because dictionaries are allowed to be referenced as long as the last - * byte of the dictionary is in the window, but once they are out of range, - * they cannot be referenced. If loadedDictEndPtr is NULL, we use - * loadedDictEnd == 0. + * If loadedDictEndPtr is NULL, no dictionary is in use, and we use loadedDictEnd == 0. + * If loadedDictEndPtr is not NULL, we set it to zero after updating lowLimit. + * This is because dictionaries are allowed to be referenced fully + * as long as the last byte of the dictionary is in the window. + * Once input has progressed beyond window size, dictionary cannot be referenced anymore. * - * In normal dict mode, the dict is between lowLimit and dictLimit. In - * dictMatchState mode, lowLimit and dictLimit are the same, and the dictionary - * is below them. forceWindow and dictMatchState are therefore incompatible. + * In normal dict mode, the dictionary lies between lowLimit and dictLimit. + * In dictMatchState mode, lowLimit and dictLimit are the same, + * and the dictionary is below them. + * forceWindow and dictMatchState are therefore incompatible. */ MEM_STATIC void ZSTD_window_enforceMaxDist(ZSTD_window_t* window, - void const* srcEnd, - U32 maxDist, - U32* loadedDictEndPtr, + const void* blockEnd, + U32 maxDist, + U32* loadedDictEndPtr, const ZSTD_matchState_t** dictMatchStatePtr) { - U32 const blockEndIdx = (U32)((BYTE const*)srcEnd - window->base); - U32 loadedDictEnd = (loadedDictEndPtr != NULL) ? *loadedDictEndPtr : 0; - DEBUGLOG(5, "ZSTD_window_enforceMaxDist: blockEndIdx=%u, maxDist=%u", - (unsigned)blockEndIdx, (unsigned)maxDist); + U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base); + U32 const loadedDictEnd = (loadedDictEndPtr != NULL) ? *loadedDictEndPtr : 0; + DEBUGLOG(5, "ZSTD_window_enforceMaxDist: blockEndIdx=%u, maxDist=%u, loadedDictEnd=%u", + (unsigned)blockEndIdx, (unsigned)maxDist, (unsigned)loadedDictEnd); + + /* - When there is no dictionary : loadedDictEnd == 0. + In which case, the test (blockEndIdx > maxDist) is merely to avoid + overflowing next operation `newLowLimit = blockEndIdx - maxDist`. + - When there is a standard dictionary : + Index referential is copied from the dictionary, + which means it starts from 0. + In which case, loadedDictEnd == dictSize, + and it makes sense to compare `blockEndIdx > maxDist + dictSize` + since `blockEndIdx` also starts from zero. + - When there is an attached dictionary : + loadedDictEnd is expressed within the referential of the context, + so it can be directly compared against blockEndIdx. + */ if (blockEndIdx > maxDist + loadedDictEnd) { U32 const newLowLimit = blockEndIdx - maxDist; if (window->lowLimit < newLowLimit) window->lowLimit = newLowLimit; @@ -708,10 +731,31 @@ ZSTD_window_enforceMaxDist(ZSTD_window_t* window, (unsigned)window->dictLimit, (unsigned)window->lowLimit); window->dictLimit = window->lowLimit; } - if (loadedDictEndPtr) - *loadedDictEndPtr = 0; - if (dictMatchStatePtr) - *dictMatchStatePtr = NULL; + /* On reaching window size, dictionaries are invalidated */ + if (loadedDictEndPtr) *loadedDictEndPtr = 0; + if (dictMatchStatePtr) *dictMatchStatePtr = NULL; + } +} + +/* Similar to ZSTD_window_enforceMaxDist(), + * but only invalidates dictionary + * when input progresses beyond window size. */ +MEM_STATIC void +ZSTD_checkDictValidity(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; } } diff --git a/thirdparty/zstd/compress/zstd_double_fast.c b/thirdparty/zstd/compress/zstd_double_fast.c index 47faf6d641..5957255d90 100644 --- a/thirdparty/zstd/compress/zstd_double_fast.c +++ b/thirdparty/zstd/compress/zstd_double_fast.c @@ -43,8 +43,7 @@ void ZSTD_fillDoubleHashTable(ZSTD_matchState_t* ms, /* Only load extra positions for ZSTD_dtlm_full */ if (dtlm == ZSTD_dtlm_fast) break; - } - } + } } } @@ -63,7 +62,10 @@ size_t ZSTD_compressBlock_doubleFast_generic( const BYTE* const istart = (const BYTE*)src; const BYTE* ip = istart; const BYTE* anchor = istart; - const U32 prefixLowestIndex = ms->window.dictLimit; + const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); + const U32 lowestValid = ms->window.dictLimit; + const U32 maxDistance = 1U << cParams->windowLog; + const U32 prefixLowestIndex = (endIndex - lowestValid > maxDistance) ? endIndex - maxDistance : lowestValid; const BYTE* const prefixLowest = base + prefixLowestIndex; const BYTE* const iend = istart + srcSize; const BYTE* const ilimit = iend - HASH_READ_SIZE; @@ -95,8 +97,15 @@ size_t ZSTD_compressBlock_doubleFast_generic( dictCParams->chainLog : hBitsS; const U32 dictAndPrefixLength = (U32)(ip - prefixLowest + dictEnd - dictStart); + DEBUGLOG(5, "ZSTD_compressBlock_doubleFast_generic"); + assert(dictMode == ZSTD_noDict || dictMode == ZSTD_dictMatchState); + /* if a dictionary is attached, it must be within window range */ + if (dictMode == ZSTD_dictMatchState) { + assert(lowestValid + maxDistance >= endIndex); + } + /* init */ ip += (dictAndPrefixLength == 0); if (dictMode == ZSTD_noDict) { @@ -138,7 +147,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, ip-anchor, anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); goto _match_stored; } @@ -147,7 +156,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, ip-anchor, anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); goto _match_stored; } @@ -170,8 +179,7 @@ size_t ZSTD_compressBlock_doubleFast_generic( offset = (U32)(current - dictMatchIndexL - dictIndexDelta); while (((ip>anchor) & (dictMatchL>dictStart)) && (ip[-1] == dictMatchL[-1])) { ip--; dictMatchL--; mLength++; } /* catch up */ goto _match_found; - } - } + } } if (matchIndexS > prefixLowestIndex) { /* check prefix short match */ @@ -186,16 +194,14 @@ size_t ZSTD_compressBlock_doubleFast_generic( if (match > dictStart && MEM_read32(match) == MEM_read32(ip)) { goto _search_next_long; - } - } + } } ip += ((ip-anchor) >> kSearchStrength) + 1; continue; _search_next_long: - { - size_t const hl3 = ZSTD_hashPtr(ip+1, hBitsL, 8); + { size_t const hl3 = ZSTD_hashPtr(ip+1, hBitsL, 8); size_t const dictHLNext = ZSTD_hashPtr(ip+1, dictHBitsL, 8); U32 const matchIndexL3 = hashLong[hl3]; const BYTE* matchL3 = base + matchIndexL3; @@ -221,9 +227,7 @@ _search_next_long: offset = (U32)(current + 1 - dictMatchIndexL3 - dictIndexDelta); while (((ip>anchor) & (dictMatchL3>dictStart)) && (ip[-1] == dictMatchL3[-1])) { ip--; dictMatchL3--; mLength++; } /* catch up */ goto _match_found; - } - } - } + } } } /* if no long +1 match, explore the short match we found */ if (dictMode == ZSTD_dictMatchState && matchIndexS < prefixLowestIndex) { @@ -242,7 +246,7 @@ _match_found: offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); _match_stored: /* match found */ @@ -250,11 +254,14 @@ _match_stored: anchor = ip; if (ip <= ilimit) { - /* Fill Table */ - hashLong[ZSTD_hashPtr(base+current+2, hBitsL, 8)] = - hashSmall[ZSTD_hashPtr(base+current+2, hBitsS, mls)] = current+2; /* here because current+2 could be > iend-8 */ - hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = - hashSmall[ZSTD_hashPtr(ip-2, hBitsS, mls)] = (U32)(ip-2-base); + /* Complementary insertion */ + /* done after iLimit test, as candidates could be > iend-8 */ + { U32 const indexToInsert = current+2; + hashLong[ZSTD_hashPtr(base+indexToInsert, hBitsL, 8)] = indexToInsert; + hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base); + hashSmall[ZSTD_hashPtr(base+indexToInsert, hBitsS, mls)] = indexToInsert; + hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base); + } /* check immediate repcode */ if (dictMode == ZSTD_dictMatchState) { @@ -278,8 +285,7 @@ _match_stored: continue; } break; - } - } + } } if (dictMode == ZSTD_noDict) { while ( (ip <= ilimit) @@ -294,14 +300,15 @@ _match_stored: ip += rLength; anchor = ip; continue; /* faster when present ... (?) */ - } } } } + } } } + } /* while (ip < ilimit) */ /* save reps for next block */ rep[0] = offset_1 ? offset_1 : offsetSaved; rep[1] = offset_2 ? offset_2 : offsetSaved; /* Return the last literals size */ - return iend - anchor; + return (size_t)(iend - anchor); } @@ -360,10 +367,15 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( const BYTE* anchor = istart; const BYTE* const iend = istart + srcSize; const BYTE* const ilimit = iend - 8; - const U32 prefixStartIndex = ms->window.dictLimit; 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 dictStartIndex = lowLimit; + const U32 dictLimit = ms->window.dictLimit; + const U32 prefixStartIndex = (dictLimit > lowLimit) ? dictLimit : lowLimit; const BYTE* const prefixStart = base + prefixStartIndex; - const U32 dictStartIndex = ms->window.lowLimit; const BYTE* const dictBase = ms->window.dictBase; const BYTE* const dictStart = dictBase + dictStartIndex; const BYTE* const dictEnd = dictBase + prefixStartIndex; @@ -371,6 +383,10 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( DEBUGLOG(5, "ZSTD_compressBlock_doubleFast_extDict_generic (srcSize=%zu)", srcSize); + /* if extDict is invalidated due to maxDistance, switch to "regular" variant */ + if (prefixStartIndex == dictStartIndex) + return ZSTD_compressBlock_doubleFast_generic(ms, seqStore, rep, src, srcSize, mls, ZSTD_noDict); + /* Search Loop */ while (ip < ilimit) { /* < instead of <=, because (ip+1) */ const size_t hSmall = ZSTD_hashPtr(ip, hBitsS, mls); @@ -396,7 +412,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, ip-anchor, anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); } else { if ((matchLongIndex > dictStartIndex) && (MEM_read64(matchLong) == MEM_read64(ip))) { const BYTE* const matchEnd = matchLongIndex < prefixStartIndex ? dictEnd : iend; @@ -407,7 +423,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, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 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); @@ -432,23 +448,27 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( } offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); } else { ip += ((ip-anchor) >> kSearchStrength) + 1; continue; } } - /* found a match : store it */ + /* move to next sequence start */ ip += mLength; anchor = ip; if (ip <= ilimit) { - /* Fill Table */ - hashSmall[ZSTD_hashPtr(base+current+2, hBitsS, mls)] = current+2; - hashLong[ZSTD_hashPtr(base+current+2, hBitsL, 8)] = current+2; - hashSmall[ZSTD_hashPtr(ip-2, hBitsS, mls)] = (U32)(ip-2-base); - hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base); + /* Complementary insertion */ + /* done after iLimit test, as candidates could be > iend-8 */ + { U32 const indexToInsert = current+2; + hashLong[ZSTD_hashPtr(base+indexToInsert, hBitsL, 8)] = indexToInsert; + hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base); + hashSmall[ZSTD_hashPtr(base+indexToInsert, hBitsS, mls)] = indexToInsert; + hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base); + } + /* check immediate repcode */ while (ip <= ilimit) { U32 const current2 = (U32)(ip-base); @@ -475,7 +495,7 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( rep[1] = offset_2; /* Return the last literals size */ - return iend - anchor; + return (size_t)(iend - anchor); } diff --git a/thirdparty/zstd/compress/zstd_fast.c b/thirdparty/zstd/compress/zstd_fast.c index ed997b441c..a05b8a47f1 100644 --- a/thirdparty/zstd/compress/zstd_fast.c +++ b/thirdparty/zstd/compress/zstd_fast.c @@ -13,7 +13,8 @@ void ZSTD_fillHashTable(ZSTD_matchState_t* ms, - void const* end, ZSTD_dictTableLoadMethod_e dtlm) + const void* const end, + ZSTD_dictTableLoadMethod_e dtlm) { const ZSTD_compressionParameters* const cParams = &ms->cParams; U32* const hashTable = ms->hashTable; @@ -41,6 +42,7 @@ void ZSTD_fillHashTable(ZSTD_matchState_t* ms, } } } } } + FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_fast_generic( ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], @@ -58,7 +60,10 @@ size_t ZSTD_compressBlock_fast_generic( const BYTE* ip0 = istart; const BYTE* ip1; const BYTE* anchor = istart; - const U32 prefixStartIndex = ms->window.dictLimit; + const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); + const U32 maxDistance = 1U << cParams->windowLog; + const U32 validStartIndex = ms->window.dictLimit; + const U32 prefixStartIndex = (endIndex - validStartIndex > maxDistance) ? endIndex - maxDistance : validStartIndex; const BYTE* const prefixStart = base + prefixStartIndex; const BYTE* const iend = istart + srcSize; const BYTE* const ilimit = iend - HASH_READ_SIZE; @@ -165,7 +170,7 @@ _match: /* Requires: ip0, match0, offcode */ rep[1] = offset_2 ? offset_2 : offsetSaved; /* Return the last literals size */ - return iend - anchor; + return (size_t)(iend - anchor); } @@ -222,8 +227,15 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( const U32 dictAndPrefixLength = (U32)(ip - prefixStart + dictEnd - dictStart); const U32 dictHLog = dictCParams->hashLog; - /* otherwise, we would get index underflow when translating a dict index - * into a local index */ + /* if a dictionary is still attached, it necessarily means that + * it is within window size. So we just check it. */ + const U32 maxDistance = 1U << cParams->windowLog; + const U32 endIndex = (U32)((size_t)(ip - base) + srcSize); + assert(endIndex - prefixStartIndex <= maxDistance); + (void)maxDistance; (void)endIndex; /* these variables are not used when assert() is disabled */ + + /* ensure there will be no no underflow + * when translating a dict index into a local index */ assert(prefixStartIndex >= (U32)(dictEnd - dictBase)); /* init */ @@ -251,7 +263,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, ip-anchor, anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); } else if ( (matchIndex <= prefixStartIndex) ) { size_t const dictHash = ZSTD_hashPtr(ip, dictHLog, mls); U32 const dictMatchIndex = dictHashTable[dictHash]; @@ -271,7 +283,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( } /* catch up */ offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 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 */ @@ -286,7 +298,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, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); } /* match found */ @@ -327,7 +339,7 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic( rep[1] = offset_2 ? offset_2 : offsetSaved; /* Return the last literals size */ - return iend - anchor; + return (size_t)(iend - anchor); } size_t ZSTD_compressBlock_fast_dictMatchState( @@ -366,15 +378,24 @@ static size_t ZSTD_compressBlock_fast_extDict_generic( const BYTE* const istart = (const BYTE*)src; const BYTE* ip = istart; const BYTE* anchor = istart; - const U32 dictStartIndex = ms->window.lowLimit; + 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 dictStartIndex = lowLimit; const BYTE* const dictStart = dictBase + dictStartIndex; - const U32 prefixStartIndex = ms->window.dictLimit; + const U32 dictLimit = ms->window.dictLimit; + const U32 prefixStartIndex = dictLimit < lowLimit ? lowLimit : dictLimit; const BYTE* const prefixStart = base + prefixStartIndex; const BYTE* const dictEnd = dictBase + prefixStartIndex; const BYTE* const iend = istart + srcSize; const BYTE* const ilimit = iend - 8; U32 offset_1=rep[0], offset_2=rep[1]; + /* 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); + /* Search Loop */ while (ip < ilimit) { /* < instead of <=, because (ip+1) */ const size_t h = ZSTD_hashPtr(ip, hlog, mls); @@ -394,7 +415,7 @@ static size_t ZSTD_compressBlock_fast_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, ip-anchor, anchor, 0, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, 0, mLength-MINMATCH); } else { if ( (matchIndex < dictStartIndex) || (MEM_read32(match) != MEM_read32(ip)) ) { @@ -410,7 +431,7 @@ static size_t ZSTD_compressBlock_fast_extDict_generic( offset = current - matchIndex; offset_2 = offset_1; offset_1 = offset; - ZSTD_storeSeq(seqStore, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); } } /* found a match : store it */ @@ -445,7 +466,7 @@ static size_t ZSTD_compressBlock_fast_extDict_generic( rep[1] = offset_2; /* Return the last literals size */ - return iend - anchor; + return (size_t)(iend - anchor); } diff --git a/thirdparty/zstd/compress/zstd_lazy.c b/thirdparty/zstd/compress/zstd_lazy.c index 53f998a437..94d906c01f 100644 --- a/thirdparty/zstd/compress/zstd_lazy.c +++ b/thirdparty/zstd/compress/zstd_lazy.c @@ -83,7 +83,10 @@ ZSTD_insertDUBT1(ZSTD_matchState_t* ms, U32* largerPtr = smallerPtr + 1; U32 matchIndex = *smallerPtr; /* this candidate is unsorted : next sorted candidate is reached through *smallerPtr, while *largerPtr contains previous unsorted candidate (which is already saved and can be overwritten) */ U32 dummy32; /* to be nullified at the end */ - U32 const windowLow = ms->window.lowLimit; + U32 const windowValid = ms->window.lowLimit; + U32 const maxDistance = 1U << cParams->windowLog; + U32 const windowLow = (current - windowValid > maxDistance) ? current - maxDistance : windowValid; + DEBUGLOG(8, "ZSTD_insertDUBT1(%u) (dictLimit=%u, lowLimit=%u)", current, dictLimit, windowLow); @@ -239,7 +242,9 @@ ZSTD_DUBT_findBestMatch(ZSTD_matchState_t* ms, const BYTE* const base = ms->window.base; U32 const current = (U32)(ip-base); - U32 const windowLow = ms->window.lowLimit; + U32 const maxDistance = 1U << cParams->windowLog; + U32 const windowValid = ms->window.lowLimit; + U32 const windowLow = (current - windowValid > maxDistance) ? current - maxDistance : windowValid; U32* const bt = ms->chainTable; U32 const btLog = cParams->chainLog - 1; @@ -490,8 +495,10 @@ size_t ZSTD_HcFindBestMatch_generic ( const U32 dictLimit = ms->window.dictLimit; const BYTE* const prefixStart = base + dictLimit; const BYTE* const dictEnd = dictBase + dictLimit; - const U32 lowLimit = ms->window.lowLimit; 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 minChain = current > chainSize ? current - chainSize : 0; U32 nbAttempts = 1U << cParams->searchLog; size_t ml=4-1; @@ -653,7 +660,6 @@ size_t ZSTD_compressBlock_lazy_generic( /* init */ ip += (dictAndPrefixLength == 0); - ms->nextToUpdate3 = ms->nextToUpdate; if (dictMode == ZSTD_noDict) { U32 const maxRep = (U32)(ip - prefixLowest); if (offset_2 > maxRep) savedOffset = offset_2, offset_2 = 0; @@ -933,7 +939,6 @@ size_t ZSTD_compressBlock_lazy_extDict_generic( U32 offset_1 = rep[0], offset_2 = rep[1]; /* init */ - ms->nextToUpdate3 = ms->nextToUpdate; ip += (ip == prefixStart); /* Match Loop */ diff --git a/thirdparty/zstd/compress/zstd_ldm.c b/thirdparty/zstd/compress/zstd_ldm.c index 784d20f3ab..3dcf86e6e8 100644 --- a/thirdparty/zstd/compress/zstd_ldm.c +++ b/thirdparty/zstd/compress/zstd_ldm.c @@ -447,7 +447,7 @@ size_t ZSTD_ldm_generateSequences( if (ZSTD_window_needOverflowCorrection(ldmState->window, chunkEnd)) { U32 const ldmHSize = 1U << params->hashLog; U32 const correction = ZSTD_window_correctOverflow( - &ldmState->window, /* cycleLog */ 0, maxDist, src); + &ldmState->window, /* cycleLog */ 0, maxDist, chunkStart); ZSTD_ldm_reduceTable(ldmState->hashTable, ldmHSize, correction); } /* 2. We enforce the maximum offset allowed. diff --git a/thirdparty/zstd/compress/zstd_opt.c b/thirdparty/zstd/compress/zstd_opt.c index efb69d3267..e32e542e02 100644 --- a/thirdparty/zstd/compress/zstd_opt.c +++ b/thirdparty/zstd/compress/zstd_opt.c @@ -255,13 +255,13 @@ static U32 ZSTD_litLengthPrice(U32 const litLength, const optState_t* const optP * to provide a cost which is directly comparable to a match ending at same position */ static int ZSTD_litLengthContribution(U32 const litLength, const optState_t* const optPtr, int optLevel) { - if (optPtr->priceType >= zop_predef) return WEIGHT(litLength, optLevel); + if (optPtr->priceType >= zop_predef) return (int)WEIGHT(litLength, optLevel); /* dynamic statistics */ { U32 const llCode = ZSTD_LLcode(litLength); - int const contribution = (LL_bits[llCode] * BITCOST_MULTIPLIER) - + WEIGHT(optPtr->litLengthFreq[0], optLevel) /* note: log2litLengthSum cancel out */ - - WEIGHT(optPtr->litLengthFreq[llCode], optLevel); + int const contribution = (int)(LL_bits[llCode] * BITCOST_MULTIPLIER) + + (int)WEIGHT(optPtr->litLengthFreq[0], optLevel) /* note: log2litLengthSum cancel out */ + - (int)WEIGHT(optPtr->litLengthFreq[llCode], optLevel); #if 1 return contribution; #else @@ -278,7 +278,7 @@ static int ZSTD_literalsContribution(const BYTE* const literals, U32 const litLe const optState_t* const optPtr, int optLevel) { - int const contribution = ZSTD_rawLiteralsCost(literals, litLength, optPtr, optLevel) + int const contribution = (int)ZSTD_rawLiteralsCost(literals, litLength, optPtr, optLevel) + ZSTD_litLengthContribution(litLength, optPtr, optLevel); return contribution; } @@ -372,13 +372,15 @@ MEM_STATIC U32 ZSTD_readMINMATCH(const void* memPtr, U32 length) /* Update hashTable3 up to ip (excluded) Assumption : always within prefix (i.e. not within extDict) */ -static U32 ZSTD_insertAndFindFirstIndexHash3 (ZSTD_matchState_t* ms, const BYTE* const ip) +static U32 ZSTD_insertAndFindFirstIndexHash3 (ZSTD_matchState_t* ms, + U32* nextToUpdate3, + const BYTE* const ip) { U32* const hashTable3 = ms->hashTable3; U32 const hashLog3 = ms->hashLog3; const BYTE* const base = ms->window.base; - U32 idx = ms->nextToUpdate3; - U32 const target = ms->nextToUpdate3 = (U32)(ip - base); + U32 idx = *nextToUpdate3; + U32 const target = (U32)(ip - base); size_t const hash3 = ZSTD_hash3Ptr(ip, hashLog3); assert(hashLog3 > 0); @@ -387,6 +389,7 @@ static U32 ZSTD_insertAndFindFirstIndexHash3 (ZSTD_matchState_t* ms, const BYTE* idx++; } + *nextToUpdate3 = target; return hashTable3[hash3]; } @@ -503,9 +506,11 @@ static U32 ZSTD_insertBt1( } } *smallerPtr = *largerPtr = 0; - if (bestLength > 384) return MIN(192, (U32)(bestLength - 384)); /* speed optimization */ - assert(matchEndIdx > current + 8); - return matchEndIdx - (current + 8); + { U32 positions = 0; + if (bestLength > 384) positions = MIN(192, (U32)(bestLength - 384)); /* speed optimization */ + assert(matchEndIdx > current + 8); + return MAX(positions, matchEndIdx - (current + 8)); + } } FORCE_INLINE_TEMPLATE @@ -520,8 +525,13 @@ void ZSTD_updateTree_internal( DEBUGLOG(6, "ZSTD_updateTree_internal, from %u to %u (dictMode:%u)", idx, target, dictMode); - while(idx < target) - idx += ZSTD_insertBt1(ms, base+idx, iend, mls, dictMode == ZSTD_extDict); + while(idx < target) { + U32 const forward = ZSTD_insertBt1(ms, base+idx, iend, mls, dictMode == ZSTD_extDict); + assert(idx < (U32)(idx + forward)); + idx += forward; + } + assert((size_t)(ip - base) <= (size_t)(U32)(-1)); + assert((size_t)(iend - base) <= (size_t)(U32)(-1)); ms->nextToUpdate = target; } @@ -531,16 +541,18 @@ void ZSTD_updateTree(ZSTD_matchState_t* ms, const BYTE* ip, const BYTE* iend) { FORCE_INLINE_TEMPLATE U32 ZSTD_insertBtAndGetAllMatches ( + ZSTD_match_t* matches, /* store result (found matches) in this table (presumed large enough) */ ZSTD_matchState_t* ms, + U32* nextToUpdate3, const BYTE* const ip, const BYTE* const iLimit, const ZSTD_dictMode_e dictMode, - U32 rep[ZSTD_REP_NUM], + const U32 rep[ZSTD_REP_NUM], U32 const ll0, /* tells if associated literal length is 0 or not. This value must be 0 or 1 */ - ZSTD_match_t* matches, const U32 lengthToBeat, U32 const mls /* template */) { 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; @@ -556,8 +568,9 @@ U32 ZSTD_insertBtAndGetAllMatches ( U32 const dictLimit = ms->window.dictLimit; const BYTE* const dictEnd = dictBase + dictLimit; const BYTE* const prefixStart = base + dictLimit; - U32 const btLow = btMask >= current ? 0 : current - btMask; - U32 const windowLow = ms->window.lowLimit; + 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 matchLow = windowLow ? windowLow : 1; U32* smallerPtr = bt + 2*(current&btMask); U32* largerPtr = bt + 2*(current&btMask) + 1; @@ -627,7 +640,7 @@ U32 ZSTD_insertBtAndGetAllMatches ( /* HC3 match finder */ if ((mls == 3) /*static*/ && (bestLength < mls)) { - U32 const matchIndex3 = ZSTD_insertAndFindFirstIndexHash3(ms, ip); + U32 const matchIndex3 = ZSTD_insertAndFindFirstIndexHash3(ms, nextToUpdate3, ip); if ((matchIndex3 >= matchLow) & (current - matchIndex3 < (1<<18)) /*heuristic : longer distance likely too expensive*/ ) { size_t mlen; @@ -653,9 +666,7 @@ U32 ZSTD_insertBtAndGetAllMatches ( (ip+mlen == iLimit) ) { /* best possible length */ ms->nextToUpdate = current+1; /* skip insertion */ return 1; - } - } - } + } } } /* no dictMatchState lookup: dicts don't have a populated HC3 table */ } @@ -760,10 +771,13 @@ U32 ZSTD_insertBtAndGetAllMatches ( FORCE_INLINE_TEMPLATE U32 ZSTD_BtGetAllMatches ( + ZSTD_match_t* matches, /* store result (match found, increasing size) in this table */ ZSTD_matchState_t* ms, + U32* nextToUpdate3, const BYTE* ip, const BYTE* const iHighLimit, const ZSTD_dictMode_e dictMode, - U32 rep[ZSTD_REP_NUM], U32 const ll0, - ZSTD_match_t* matches, U32 const lengthToBeat) + const U32 rep[ZSTD_REP_NUM], + U32 const ll0, + U32 const lengthToBeat) { const ZSTD_compressionParameters* const cParams = &ms->cParams; U32 const matchLengthSearch = cParams->minMatch; @@ -772,12 +786,12 @@ FORCE_INLINE_TEMPLATE U32 ZSTD_BtGetAllMatches ( ZSTD_updateTree_internal(ms, ip, iHighLimit, matchLengthSearch, dictMode); switch(matchLengthSearch) { - case 3 : return ZSTD_insertBtAndGetAllMatches(ms, ip, iHighLimit, dictMode, rep, ll0, matches, lengthToBeat, 3); + case 3 : return ZSTD_insertBtAndGetAllMatches(matches, ms, nextToUpdate3, ip, iHighLimit, dictMode, rep, ll0, lengthToBeat, 3); default : - case 4 : return ZSTD_insertBtAndGetAllMatches(ms, ip, iHighLimit, dictMode, rep, ll0, matches, lengthToBeat, 4); - case 5 : return ZSTD_insertBtAndGetAllMatches(ms, ip, iHighLimit, dictMode, rep, ll0, matches, lengthToBeat, 5); + case 4 : return ZSTD_insertBtAndGetAllMatches(matches, ms, nextToUpdate3, ip, iHighLimit, dictMode, rep, ll0, lengthToBeat, 4); + case 5 : return ZSTD_insertBtAndGetAllMatches(matches, ms, nextToUpdate3, ip, iHighLimit, dictMode, rep, ll0, lengthToBeat, 5); case 7 : - case 6 : return ZSTD_insertBtAndGetAllMatches(ms, ip, iHighLimit, dictMode, rep, ll0, matches, lengthToBeat, 6); + case 6 : return ZSTD_insertBtAndGetAllMatches(matches, ms, nextToUpdate3, ip, iHighLimit, dictMode, rep, ll0, lengthToBeat, 6); } } @@ -853,6 +867,7 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms, U32 const sufficient_len = MIN(cParams->targetLength, ZSTD_OPT_NUM -1); U32 const minMatch = (cParams->minMatch == 3) ? 3 : 4; + U32 nextToUpdate3 = ms->nextToUpdate; ZSTD_optimal_t* const opt = optStatePtr->priceTable; ZSTD_match_t* const matches = optStatePtr->matchTable; @@ -862,7 +877,6 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms, DEBUGLOG(5, "ZSTD_compressBlock_opt_generic: current=%u, prefix=%u, nextToUpdate=%u", (U32)(ip - base), ms->window.dictLimit, ms->nextToUpdate); assert(optLevel <= 2); - ms->nextToUpdate3 = ms->nextToUpdate; ZSTD_rescaleFreqs(optStatePtr, (const BYTE*)src, srcSize, optLevel); ip += (ip==prefixStart); @@ -873,7 +887,7 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms, /* find first match */ { U32 const litlen = (U32)(ip - anchor); U32 const ll0 = !litlen; - U32 const nbMatches = ZSTD_BtGetAllMatches(ms, ip, iend, dictMode, rep, ll0, matches, minMatch); + U32 const nbMatches = ZSTD_BtGetAllMatches(matches, ms, &nextToUpdate3, ip, iend, dictMode, rep, ll0, minMatch); if (!nbMatches) { ip++; continue; } /* initialize opt[0] */ @@ -970,7 +984,7 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms, U32 const litlen = (opt[cur].mlen == 0) ? opt[cur].litlen : 0; U32 const previousPrice = opt[cur].price; U32 const basePrice = previousPrice + ZSTD_litLengthPrice(0, optStatePtr, optLevel); - U32 const nbMatches = ZSTD_BtGetAllMatches(ms, inr, iend, dictMode, opt[cur].rep, ll0, matches, minMatch); + U32 const nbMatches = ZSTD_BtGetAllMatches(matches, ms, &nextToUpdate3, inr, iend, dictMode, opt[cur].rep, ll0, minMatch); U32 matchNb; if (!nbMatches) { DEBUGLOG(7, "rPos:%u : no match found", cur); @@ -1094,7 +1108,7 @@ _shortestPath: /* cur, last_pos, best_mlen, best_off have to be set */ } /* while (ip < ilimit) */ /* Return the last literals size */ - return iend - anchor; + return (size_t)(iend - anchor); } @@ -1158,7 +1172,6 @@ ZSTD_initStats_ultra(ZSTD_matchState_t* ms, ms->window.dictLimit += (U32)srcSize; ms->window.lowLimit = ms->window.dictLimit; ms->nextToUpdate = ms->window.dictLimit; - ms->nextToUpdate3 = ms->window.dictLimit; /* re-inforce weight of collected statistics */ ZSTD_upscaleStats(&ms->opt); diff --git a/thirdparty/zstd/compress/zstdmt_compress.c b/thirdparty/zstd/compress/zstdmt_compress.c index 38fbb90768..9e537b8848 100644 --- a/thirdparty/zstd/compress/zstdmt_compress.c +++ b/thirdparty/zstd/compress/zstdmt_compress.c @@ -1129,9 +1129,14 @@ size_t ZSTDMT_toFlushNow(ZSTDMT_CCtx* mtctx) size_t const produced = ZSTD_isError(cResult) ? 0 : cResult; size_t const flushed = ZSTD_isError(cResult) ? 0 : jobPtr->dstFlushed; assert(flushed <= produced); + assert(jobPtr->consumed <= jobPtr->src.size); toFlush = produced - flushed; - if (toFlush==0 && (jobPtr->consumed >= jobPtr->src.size)) { - /* doneJobID is not-fully-flushed, but toFlush==0 : doneJobID should be compressing some more data */ + /* if toFlush==0, nothing is available to flush. + * However, jobID is expected to still be active: + * if jobID was already completed and fully flushed, + * ZSTDMT_flushProduced() should have already moved onto next job. + * Therefore, some input has not yet been consumed. */ + if (toFlush==0) { assert(jobPtr->consumed < jobPtr->src.size); } } @@ -1148,12 +1153,16 @@ size_t ZSTDMT_toFlushNow(ZSTDMT_CCtx* mtctx) static unsigned ZSTDMT_computeTargetJobLog(ZSTD_CCtx_params const params) { - if (params.ldmParams.enableLdm) + unsigned jobLog; + 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. */ - return MAX(21, params.cParams.chainLog + 4); - return MAX(20, params.cParams.windowLog + 2); + jobLog = MAX(21, params.cParams.chainLog + 4); + } else { + jobLog = MAX(20, params.cParams.windowLog + 2); + } + return MIN(jobLog, (unsigned)ZSTDMT_JOBLOG_MAX); } static int ZSTDMT_overlapLog_default(ZSTD_strategy strat) @@ -1197,7 +1206,7 @@ static size_t ZSTDMT_computeOverlapSize(ZSTD_CCtx_params const params) ovLog = MIN(params.cParams.windowLog, ZSTDMT_computeTargetJobLog(params) - 2) - overlapRLog; } - assert(0 <= ovLog && ovLog <= 30); + assert(0 <= ovLog && ovLog <= ZSTD_WINDOWLOG_MAX); DEBUGLOG(4, "overlapLog : %i", params.overlapLog); DEBUGLOG(4, "overlap size : %i", 1 << ovLog); return (ovLog==0) ? 0 : (size_t)1 << ovLog; @@ -1391,7 +1400,7 @@ size_t ZSTDMT_initCStream_internal( FORWARD_IF_ERROR( ZSTDMT_resize(mtctx, params.nbWorkers) ); if (params.jobSize != 0 && params.jobSize < ZSTDMT_JOBSIZE_MIN) params.jobSize = ZSTDMT_JOBSIZE_MIN; - if (params.jobSize > (size_t)ZSTDMT_JOBSIZE_MAX) params.jobSize = ZSTDMT_JOBSIZE_MAX; + if (params.jobSize > (size_t)ZSTDMT_JOBSIZE_MAX) params.jobSize = (size_t)ZSTDMT_JOBSIZE_MAX; mtctx->singleBlockingThread = (pledgedSrcSize <= ZSTDMT_JOBSIZE_MIN); /* do not trigger multi-threading when srcSize is too small */ if (mtctx->singleBlockingThread) { @@ -1432,6 +1441,8 @@ size_t ZSTDMT_initCStream_internal( if (mtctx->targetSectionSize == 0) { mtctx->targetSectionSize = 1ULL << ZSTDMT_computeTargetJobLog(params); } + assert(mtctx->targetSectionSize <= (size_t)ZSTDMT_JOBSIZE_MAX); + if (params.rsyncable) { /* Aim for the targetsectionSize as the average job size. */ U32 const jobSizeMB = (U32)(mtctx->targetSectionSize >> 20); diff --git a/thirdparty/zstd/compress/zstdmt_compress.h b/thirdparty/zstd/compress/zstdmt_compress.h index 12e6bcb3a3..12a526087d 100644 --- a/thirdparty/zstd/compress/zstdmt_compress.h +++ b/thirdparty/zstd/compress/zstdmt_compress.h @@ -50,6 +50,7 @@ #ifndef ZSTDMT_JOBSIZE_MIN # define ZSTDMT_JOBSIZE_MIN (1 MB) #endif +#define ZSTDMT_JOBLOG_MAX (MEM_32bits() ? 29 : 30) #define ZSTDMT_JOBSIZE_MAX (MEM_32bits() ? (512 MB) : (1024 MB)) diff --git a/thirdparty/zstd/decompress/zstd_decompress.c b/thirdparty/zstd/decompress/zstd_decompress.c index 675596f5aa..e42872ad96 100644 --- a/thirdparty/zstd/decompress/zstd_decompress.c +++ b/thirdparty/zstd/decompress/zstd_decompress.c @@ -360,8 +360,11 @@ static size_t readSkippableFrameSize(void const* src, size_t srcSize) sizeU32 = MEM_readLE32((BYTE const*)src + ZSTD_FRAMEIDSIZE); RETURN_ERROR_IF((U32)(sizeU32 + ZSTD_SKIPPABLEHEADERSIZE) < sizeU32, frameParameter_unsupported); - - return skippableHeaderSize + sizeU32; + { + size_t const skippableSize = skippableHeaderSize + sizeU32; + RETURN_ERROR_IF(skippableSize > srcSize, srcSize_wrong); + return skippableSize; + } } /** ZSTD_findDecompressedSize() : @@ -378,11 +381,10 @@ unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize) if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { size_t const skippableSize = readSkippableFrameSize(src, srcSize); - if (ZSTD_isError(skippableSize)) - return skippableSize; - if (srcSize < skippableSize) { + if (ZSTD_isError(skippableSize)) { return ZSTD_CONTENTSIZE_ERROR; } + assert(skippableSize <= srcSize); src = (const BYTE *)src + skippableSize; srcSize -= skippableSize; @@ -467,6 +469,8 @@ static ZSTD_frameSizeInfo ZSTD_findFrameSizeInfo(const void* src, size_t srcSize if ((srcSize >= ZSTD_SKIPPABLEHEADERSIZE) && (MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { frameSizeInfo.compressedSize = readSkippableFrameSize(src, srcSize); + assert(ZSTD_isError(frameSizeInfo.compressedSize) || + frameSizeInfo.compressedSize <= srcSize); return frameSizeInfo; } else { const BYTE* ip = (const BYTE*)src; @@ -529,7 +533,6 @@ size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize) return frameSizeInfo.compressedSize; } - /** ZSTD_decompressBound() : * compatible with legacy mode * `src` must point to the start of a ZSTD frame or a skippeable frame @@ -546,6 +549,7 @@ unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize) unsigned long long const decompressedBound = frameSizeInfo.decompressedBound; if (ZSTD_isError(compressedSize) || decompressedBound == ZSTD_CONTENTSIZE_ERROR) return ZSTD_CONTENTSIZE_ERROR; + assert(srcSize >= compressedSize); src = (const BYTE*)src + compressedSize; srcSize -= compressedSize; bound += decompressedBound; @@ -738,9 +742,8 @@ static size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx, (unsigned)magicNumber, ZSTD_MAGICNUMBER); if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { size_t const skippableSize = readSkippableFrameSize(src, srcSize); - if (ZSTD_isError(skippableSize)) - return skippableSize; - RETURN_ERROR_IF(srcSize < skippableSize, srcSize_wrong); + FORWARD_IF_ERROR(skippableSize); + assert(skippableSize <= srcSize); src = (const BYTE *)src + skippableSize; srcSize -= skippableSize; diff --git a/thirdparty/zstd/decompress/zstd_decompress_block.c b/thirdparty/zstd/decompress/zstd_decompress_block.c index a2a7eedcf2..24f4859c56 100644 --- a/thirdparty/zstd/decompress/zstd_decompress_block.c +++ b/thirdparty/zstd/decompress/zstd_decompress_block.c @@ -505,7 +505,7 @@ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, *nbSeqPtr = nbSeq; /* FSE table descriptors */ - RETURN_ERROR_IF(ip+4 > iend, srcSize_wrong); /* minimum possible size */ + RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong); /* minimum possible size: 1 byte for symbol encoding types */ { symbolEncodingType_e const LLtype = (symbolEncodingType_e)(*ip >> 6); symbolEncodingType_e const OFtype = (symbolEncodingType_e)((*ip >> 4) & 3); symbolEncodingType_e const MLtype = (symbolEncodingType_e)((*ip >> 2) & 3); @@ -637,9 +637,10 @@ size_t ZSTD_execSequence(BYTE* op, if (oLitEnd>oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd); /* copy Literals */ - ZSTD_copy8(op, *litPtr); if (sequence.litLength > 8) - ZSTD_wildcopy(op+8, (*litPtr)+8, sequence.litLength - 8); /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */ + 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); op = oLitEnd; *litPtr = iLitEnd; /* update for next sequence */ @@ -686,13 +687,13 @@ size_t ZSTD_execSequence(BYTE* op, if (oMatchEnd > oend-(16-MINMATCH)) { if (op < oend_w) { - ZSTD_wildcopy(op, match, oend_w - op); + 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); /* works even if matchLength < 8 */ + ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst); /* works even if matchLength < 8 */ } return sequenceLength; } @@ -717,9 +718,11 @@ size_t ZSTD_execSequenceLong(BYTE* op, if (oLitEnd > oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, prefixStart, dictStart, dictEnd); /* copy Literals */ - ZSTD_copy8(op, *litPtr); /* note : op <= oLitEnd <= oend_w == oend - 8 */ if (sequence.litLength > 8) - ZSTD_wildcopy(op+8, (*litPtr)+8, sequence.litLength - 8); /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */ + 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 */ + op = oLitEnd; *litPtr = iLitEnd; /* update for next sequence */ @@ -766,13 +769,13 @@ size_t ZSTD_execSequenceLong(BYTE* op, if (oMatchEnd > oend-(16-MINMATCH)) { if (op < oend_w) { - ZSTD_wildcopy(op, match, oend_w - op); + 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); /* works even if matchLength < 8 */ + ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst); /* works even if matchLength < 8 */ } return sequenceLength; } @@ -889,6 +892,7 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) } FORCE_INLINE_TEMPLATE size_t +DONT_VECTORIZE ZSTD_decompressSequences_body( ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, @@ -918,6 +922,11 @@ ZSTD_decompressSequences_body( ZSTD_DCtx* dctx, ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr); ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr); + ZSTD_STATIC_ASSERT( + BIT_DStream_unfinished < BIT_DStream_completed && + BIT_DStream_endOfBuffer < BIT_DStream_completed && + BIT_DStream_completed < BIT_DStream_overflow); + for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && nbSeq ; ) { nbSeq--; { seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset); @@ -930,6 +939,7 @@ ZSTD_decompressSequences_body( ZSTD_DCtx* dctx, /* check if reached exact end */ DEBUGLOG(5, "ZSTD_decompressSequences_body: after decode loop, remaining nbSeq : %i", nbSeq); RETURN_ERROR_IF(nbSeq, corruption_detected); + RETURN_ERROR_IF(BIT_reloadDStream(&seqState.DStream) < BIT_DStream_completed, corruption_detected); /* save reps for next block */ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); } } @@ -1131,6 +1141,7 @@ ZSTD_decompressSequencesLong_default(ZSTD_DCtx* dctx, #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG static TARGET_ATTRIBUTE("bmi2") size_t +DONT_VECTORIZE ZSTD_decompressSequences_bmi2(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, diff --git a/thirdparty/zstd/zstd.h b/thirdparty/zstd/zstd.h index 53470c18f3..a1910ee223 100644 --- a/thirdparty/zstd/zstd.h +++ b/thirdparty/zstd/zstd.h @@ -71,7 +71,7 @@ extern "C" { /*------ Version ------*/ #define ZSTD_VERSION_MAJOR 1 #define ZSTD_VERSION_MINOR 4 -#define ZSTD_VERSION_RELEASE 0 +#define ZSTD_VERSION_RELEASE 1 #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 */ @@ -82,16 +82,16 @@ ZSTDLIB_API unsigned ZSTD_versionNumber(void); /**< to check runtime library v #define ZSTD_VERSION_STRING ZSTD_EXPAND_AND_QUOTE(ZSTD_LIB_VERSION) ZSTDLIB_API const char* ZSTD_versionString(void); /* requires v1.3.0+ */ -/*************************************** -* Default constant -***************************************/ +/* ************************************* + * Default constant + ***************************************/ #ifndef ZSTD_CLEVEL_DEFAULT # define ZSTD_CLEVEL_DEFAULT 3 #endif -/*************************************** -* Constants -***************************************/ +/* ************************************* + * Constants + ***************************************/ /* All magic numbers are supposed read/written to/from files/memory using little-endian convention */ #define ZSTD_MAGICNUMBER 0xFD2FB528 /* valid since v0.8.0 */ @@ -183,9 +183,14 @@ ZSTDLIB_API int ZSTD_maxCLevel(void); /*!< maximum compres ***************************************/ /*= Compression context * When compressing many times, - * it is recommended to allocate a context just once, and re-use it for each successive compression operation. + * it is recommended to allocate a context just once, + * and re-use it for each successive compression operation. * This will make workload friendlier for system's memory. - * Use one context per thread for parallel execution in multi-threaded environments. */ + * Note : re-using context is just a speed / resource optimization. + * It doesn't change the compression ratio, which remains identical. + * Note 2 : In multi-threaded environments, + * use one different context per thread for parallel execution. + */ typedef struct ZSTD_CCtx_s ZSTD_CCtx; ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void); ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); @@ -380,6 +385,7 @@ typedef enum { * ZSTD_c_forceMaxWindow * ZSTD_c_forceAttachDict * ZSTD_c_literalCompressionMode + * ZSTD_c_targetCBlockSize * 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. @@ -389,6 +395,7 @@ typedef enum { ZSTD_c_experimentalParam3=1000, ZSTD_c_experimentalParam4=1001, ZSTD_c_experimentalParam5=1002, + ZSTD_c_experimentalParam6=1003, } ZSTD_cParameter; typedef struct { @@ -657,17 +664,33 @@ ZSTDLIB_API size_t ZSTD_compressStream2( ZSTD_CCtx* cctx, ZSTD_inBuffer* input, ZSTD_EndDirective endOp); + +/* These buffer sizes are softly recommended. + * They are not required : ZSTD_compressStream*() happily accepts any buffer size, for both input and output. + * Respecting the recommended size just makes it a bit easier for ZSTD_compressStream*(), + * reducing the amount of memory shuffling and buffering, resulting in minor performance savings. + * + * However, note that these recommendations are from the perspective of a C caller program. + * If the streaming interface is invoked from some other language, + * especially managed ones such as Java or Go, through a foreign function interface such as jni or cgo, + * a major performance rule is to reduce crossing such interface to an absolute minimum. + * It's not rare that performance ends being spent more into the interface, rather than compression itself. + * In which cases, prefer using large buffers, as large as practical, + * for both input and output, to reduce the nb of roundtrips. + */ ZSTDLIB_API size_t ZSTD_CStreamInSize(void); /**< recommended size for input buffer */ -ZSTDLIB_API size_t ZSTD_CStreamOutSize(void); /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block in all circumstances. */ +ZSTDLIB_API size_t ZSTD_CStreamOutSize(void); /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block. */ -/******************************************************************************* - * This is a legacy streaming API, and can be replaced by ZSTD_CCtx_reset() and - * ZSTD_compressStream2(). It is redundant, but is still fully supported. + +/* ***************************************************************************** + * This following is a legacy streaming API. + * It can be replaced by ZSTD_CCtx_reset() and ZSTD_compressStream2(). + * It is redundant, but remains fully supported. * Advanced parameters and dictionary compression can only be used through the * new API. ******************************************************************************/ -/** +/*! * Equivalent to: * * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); @@ -675,16 +698,16 @@ ZSTDLIB_API size_t ZSTD_CStreamOutSize(void); /**< recommended size for output * ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); */ ZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel); -/** +/*! * Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue). * NOTE: The return value is different. ZSTD_compressStream() returns a hint for * the next read size (if non-zero and not an error). ZSTD_compressStream2() - * returns the number of bytes left to flush (if non-zero and not an error). + * returns the minimum nb of bytes left to flush (if non-zero and not an error). */ ZSTDLIB_API size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input); -/** Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush). */ +/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush). */ ZSTDLIB_API size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output); -/** Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end). */ +/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end). */ ZSTDLIB_API size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output); @@ -969,7 +992,7 @@ ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); #endif /* ZSTD_H_235446 */ -/**************************************************************************************** +/* ************************************************************************************** * ADVANCED AND EXPERIMENTAL FUNCTIONS **************************************************************************************** * The definitions in the following section are considered experimental. @@ -1037,6 +1060,10 @@ ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); #define ZSTD_LDM_HASHRATELOG_MIN 0 #define ZSTD_LDM_HASHRATELOG_MAX (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN) +/* Advanced parameter bounds */ +#define ZSTD_TARGETCBLOCKSIZE_MIN 64 +#define ZSTD_TARGETCBLOCKSIZE_MAX ZSTD_BLOCKSIZE_MAX + /* internal */ #define ZSTD_HASHLOG3_MAX 17 @@ -1162,7 +1189,7 @@ typedef enum { * however it does mean that all frame data must be present and valid. */ ZSTDLIB_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize); -/** ZSTD_decompressBound() : +/*! ZSTD_decompressBound() : * `src` should point to the start of a series of ZSTD encoded and/or skippable frames * `srcSize` must be the _exact_ size of this series * (i.e. there should be a frame boundary at `src + srcSize`) @@ -1409,6 +1436,11 @@ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* pre */ #define ZSTD_c_literalCompressionMode ZSTD_c_experimentalParam5 +/* Tries to fit compressed block size to be around targetCBlockSize. + * No target when targetCBlockSize == 0. + * There is no guarantee on compressed block size (default:0) */ +#define ZSTD_c_targetCBlockSize ZSTD_c_experimentalParam6 + /*! ZSTD_CCtx_getParameter() : * Get the requested compression parameter value, selected by enum ZSTD_cParameter, * and store it into int* value. @@ -1843,7 +1875,7 @@ typedef struct { unsigned checksumFlag; } ZSTD_frameHeader; -/** ZSTD_getFrameHeader() : +/*! ZSTD_getFrameHeader() : * decode Frame Header, or requires larger `srcSize`. * @return : 0, `zfhPtr` is correctly filled, * >0, `srcSize` is too small, value is wanted `srcSize` amount, |