diff options
50 files changed, 769 insertions, 251 deletions
diff --git a/AUTHORS.md b/AUTHORS.md index bf833d1435..3fd8227fa7 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -47,9 +47,11 @@ name is available. Geequlim Gen (dbsGen) George Marques (vnen) + Gerrit Großkopf (Grosskopf) Gilles Roudiere (groud) Guilherme Felipe (guilhermefelipecgs) Hein-Pieter van Braam (hpvb) + Hiroshi Ogawa (hi-ogawa) Hubert Jarosz (Marqin) Hugo Locurcio (Calinou) Ignacio Etcheverry (neikeq) @@ -20,28 +20,38 @@ None so far, but your company could be the first! :) ## Mini sponsors - Arron Washington - Chris Phyffer + Andreas + Andreas Hirschauer Christian Uldall Pedersen + E Hewert Hein-Pieter van Braam Matthieu Huvé + Nathan Warden Neal Gompa (Conan Kudo) Olimpiu Metiu Ruslan Mustakov + Slobodan Milnovic ## Gold donors Alexander Otto + Asdf + Blair Allen + cheese65536 Jake Bo Javier - Nathan Warden + Manuele Finocchiaro + Officine Pixel S.n.c. Ranoller Rémi Verschelde Stephan Lanfermann Andreas Schüle + Austen McRae Bernhard Liebl + Gerald E Butler Jordan M Lucas + Kris Michael BanjoNode2D Chris Serino @@ -53,16 +63,20 @@ None so far, but your company could be the first! :) Henrique Alves Laurence Bannister Leo + mhilbrunner Przemysław Gołąb (n-pigeon) Robert Willes Robin Arys + ScottMakesGames summerblind Testus Maximus Thomas Bjarnelöf + Xavier Tan Amanda Haldy Andreas Haas Bryanna M + Chris Brown Cody Parker D Ezra Theunissen @@ -70,25 +84,32 @@ None so far, but your company could be the first! :) François Cantin Hendrik Mans Jeppe Zapp - Johannes Wuensch Justin Arnold Justo Delgado Baudí Leandro Voltolino + Lucien Boudy Myles - Robert Podgorski - Scott Beacon + Noah + Trent McPheron x1212 ## Silver donors + 1D_Inc + Alessandro Senese Alex Barsukov + Anthony Bongiovanni Avencherus Bastian Böhm Ben Vercammen Bryan Stevenson + Christian Baune + Christian Winter Collin Shooltz + Dominik Wetzel Fabian Becker fengjiongmax + Fredy Romero Sam Geequlim Gerrit Großkopf Guldoman @@ -96,14 +117,16 @@ None so far, but your company could be the first! :) HeartBeast Heribert Hirth Hunter Jones - imekon - Jacob McKenney Jonathon Josh 'Cheeseness' Bush + JuDelCo Julian Murgia Juraj Móza + KC Chan Kevin Boyer + Kevin Kamper Meejach Petersen Klavdij Voncina + Kobi Malul Lisandro Lorea magodev Martin Novák @@ -113,26 +136,36 @@ None so far, but your company could be the first! :) Max R.R. Collada Michael Gringauz Mikael Olsson + MoM Moritz Laass nee + Neil Blakey-Milner + Nik Lee + Niko Leopold nvgrod Pablo Seibelt Pan Ip + Patrick Nafarrete Paul Mason Paweł Kowal + Pete Goodwin Pietro Vertechi rayos Richman Stewart Roger Smith + Ryan Estes Sam Van Campenhout Sam Vila Sasori Olkof + Scott D. Yelich Sootstone Tavo Tell + TheHappieCat + Theo Cranmore Tom Larrow - Trent McPheron Troy Bonneau UltyX + Wout Standaert Xananax & karroffel ## Bronze donors diff --git a/core/error_macros.cpp b/core/error_macros.cpp index 170a22e8dd..7d85aa9001 100644 --- a/core/error_macros.cpp +++ b/core/error_macros.cpp @@ -97,3 +97,10 @@ void _err_print_error(const char *p_function, const char *p_file, int p_line, co _err_error_exists = false; } } + +void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, bool fatal) { + + String fstr(fatal ? "FATAL: " : ""); + String err(fstr + "Index" + p_index_str + "=" + itos(p_index) + " out of size (" + p_size_str + "=" + itos(p_size) + ")"); + _err_print_error(p_function, p_file, p_line, err.utf8().get_data()); +} diff --git a/core/error_macros.h b/core/error_macros.h index 1fa7f2c134..8d2f588706 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -76,6 +76,7 @@ void add_error_handler(ErrorHandlerList *p_handler); void remove_error_handler(ErrorHandlerList *p_handler); void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, ErrorHandlerType p_type = ERR_HANDLER_ERROR); +void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, bool fatal = false); #ifndef _STR #define _STR(m_x) #m_x @@ -129,13 +130,13 @@ extern bool _err_error_exists; // (*): See https://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for -#define ERR_FAIL_INDEX(m_index, m_size) \ - do { \ - if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Index " _STR(m_index) " out of size (" _STR(m_size) ")."); \ - return; \ - } else \ - _err_error_exists = false; \ +#define ERR_FAIL_INDEX(m_index, m_size) \ + do { \ + if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ + _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ + return; \ + } else \ + _err_error_exists = false; \ } while (0); // (*) /** An index has failed if m_index<0 or m_index >=m_size, the function exists. @@ -143,24 +144,24 @@ extern bool _err_error_exists; * appropriate error condition from error_macros.h */ -#define ERR_FAIL_INDEX_V(m_index, m_size, m_retval) \ - do { \ - if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Index " _STR(m_index) " out of size (" _STR(m_size) ")."); \ - return m_retval; \ - } else \ - _err_error_exists = false; \ +#define ERR_FAIL_INDEX_V(m_index, m_size, m_retval) \ + do { \ + if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ + _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \ + return m_retval; \ + } else \ + _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. */ -#define CRASH_BAD_INDEX(m_index, m_size) \ - do { \ - if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ - _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Index " _STR(m_index) " out of size (" _STR(m_size) ")."); \ - GENERATE_TRAP \ - } \ +#define CRASH_BAD_INDEX(m_index, m_size) \ + do { \ + if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \ + _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), true); \ + GENERATE_TRAP \ + } \ } while (0); // (*) /** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert(). diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 6f58af2ccf..8bddeae69a 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -86,6 +86,8 @@ static Vector<_GlobalConstant> _global_constants; VARIANT_ENUM_CAST(KeyList); VARIANT_ENUM_CAST(KeyModifierMask); +VARIANT_ENUM_CAST(ButtonList); +VARIANT_ENUM_CAST(JoystickList); void register_global_constants() { @@ -367,82 +369,82 @@ void register_global_constants() { BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_GROUP_SWITCH); // mouse - BIND_GLOBAL_CONSTANT(BUTTON_LEFT); - BIND_GLOBAL_CONSTANT(BUTTON_RIGHT); - BIND_GLOBAL_CONSTANT(BUTTON_MIDDLE); - BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_UP); - BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_DOWN); - BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_LEFT); - BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_RIGHT); - BIND_GLOBAL_CONSTANT(BUTTON_MASK_LEFT); - BIND_GLOBAL_CONSTANT(BUTTON_MASK_RIGHT); - BIND_GLOBAL_CONSTANT(BUTTON_MASK_MIDDLE); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_LEFT); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_RIGHT); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MIDDLE); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_WHEEL_UP); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_WHEEL_DOWN); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_WHEEL_LEFT); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_WHEEL_RIGHT); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_LEFT); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_RIGHT); + BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_MIDDLE); //joypads - BIND_GLOBAL_CONSTANT(JOY_BUTTON_0); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_1); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_2); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_3); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_4); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_5); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_6); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_7); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_8); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_9); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_10); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_11); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_12); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_13); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_14); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_15); - BIND_GLOBAL_CONSTANT(JOY_BUTTON_MAX); - - BIND_GLOBAL_CONSTANT(JOY_SONY_CIRCLE); - BIND_GLOBAL_CONSTANT(JOY_SONY_X); - BIND_GLOBAL_CONSTANT(JOY_SONY_SQUARE); - BIND_GLOBAL_CONSTANT(JOY_SONY_TRIANGLE); - - BIND_GLOBAL_CONSTANT(JOY_XBOX_B); - BIND_GLOBAL_CONSTANT(JOY_XBOX_A); - BIND_GLOBAL_CONSTANT(JOY_XBOX_X); - BIND_GLOBAL_CONSTANT(JOY_XBOX_Y); - - BIND_GLOBAL_CONSTANT(JOY_DS_A); - BIND_GLOBAL_CONSTANT(JOY_DS_B); - BIND_GLOBAL_CONSTANT(JOY_DS_X); - BIND_GLOBAL_CONSTANT(JOY_DS_Y); - - BIND_GLOBAL_CONSTANT(JOY_SELECT); - BIND_GLOBAL_CONSTANT(JOY_START); - BIND_GLOBAL_CONSTANT(JOY_DPAD_UP); - BIND_GLOBAL_CONSTANT(JOY_DPAD_DOWN); - BIND_GLOBAL_CONSTANT(JOY_DPAD_LEFT); - BIND_GLOBAL_CONSTANT(JOY_DPAD_RIGHT); - BIND_GLOBAL_CONSTANT(JOY_L); - BIND_GLOBAL_CONSTANT(JOY_L2); - BIND_GLOBAL_CONSTANT(JOY_L3); - BIND_GLOBAL_CONSTANT(JOY_R); - BIND_GLOBAL_CONSTANT(JOY_R2); - BIND_GLOBAL_CONSTANT(JOY_R3); - - BIND_GLOBAL_CONSTANT(JOY_AXIS_0); - BIND_GLOBAL_CONSTANT(JOY_AXIS_1); - BIND_GLOBAL_CONSTANT(JOY_AXIS_2); - BIND_GLOBAL_CONSTANT(JOY_AXIS_3); - BIND_GLOBAL_CONSTANT(JOY_AXIS_4); - BIND_GLOBAL_CONSTANT(JOY_AXIS_5); - BIND_GLOBAL_CONSTANT(JOY_AXIS_6); - BIND_GLOBAL_CONSTANT(JOY_AXIS_7); - BIND_GLOBAL_CONSTANT(JOY_AXIS_MAX); - - BIND_GLOBAL_CONSTANT(JOY_ANALOG_LX); - BIND_GLOBAL_CONSTANT(JOY_ANALOG_LY); - - BIND_GLOBAL_CONSTANT(JOY_ANALOG_RX); - BIND_GLOBAL_CONSTANT(JOY_ANALOG_RY); - - BIND_GLOBAL_CONSTANT(JOY_ANALOG_L2); - BIND_GLOBAL_CONSTANT(JOY_ANALOG_R2); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_0); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_1); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_2); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_3); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_4); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_5); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_6); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_7); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_8); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_9); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_10); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_11); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_12); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_13); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_14); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_15); + BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_MAX); + + BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_CIRCLE); + BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_X); + BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_SQUARE); + BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_TRIANGLE); + + BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_B); + BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_A); + BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_X); + BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_Y); + + BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_A); + BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_B); + BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_X); + BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_Y); + + BIND_GLOBAL_ENUM_CONSTANT(JOY_SELECT); + BIND_GLOBAL_ENUM_CONSTANT(JOY_START); + BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_UP); + BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_DOWN); + BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_LEFT); + BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_RIGHT); + BIND_GLOBAL_ENUM_CONSTANT(JOY_L); + BIND_GLOBAL_ENUM_CONSTANT(JOY_L2); + BIND_GLOBAL_ENUM_CONSTANT(JOY_L3); + BIND_GLOBAL_ENUM_CONSTANT(JOY_R); + BIND_GLOBAL_ENUM_CONSTANT(JOY_R2); + BIND_GLOBAL_ENUM_CONSTANT(JOY_R3); + + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_0); + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_1); + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_2); + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_3); + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_4); + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_5); + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_6); + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_7); + BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_MAX); + + BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_LX); + BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_LY); + + BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_RX); + BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_RY); + + BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_L2); + BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_R2); // error list diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 4f80fb2491..ffe1089965 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -443,4 +443,5 @@ AStar::AStar() { AStar::~AStar() { pass = 1; + clear(); } diff --git a/core/os/input_event.h b/core/os/input_event.h index 5dc0f91d5f..f2c8cc802d 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -44,7 +44,7 @@ * The events are pretty obvious. */ -enum { +enum ButtonList { BUTTON_LEFT = 1, BUTTON_RIGHT = 2, BUTTON_MIDDLE = 3, @@ -58,7 +58,7 @@ enum { }; -enum { +enum JoystickList { JOY_BUTTON_0 = 0, JOY_BUTTON_1 = 1, diff --git a/core/typedefs.h b/core/typedefs.h index bf5c8b0f75..c509edf9fe 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -98,11 +98,11 @@ T *_nullptr() { #undef OK #endif +#include "int_types.h" + #include "error_list.h" #include "error_macros.h" -#include "int_types.h" - /** Generic ABS function, for math uses please use Math::abs */ #ifndef ABS diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index 2ad46579b2..1b6583a834 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="BaseButton" inherits="Control" category="Core" version="3.0.alpha.custom_build"> <brief_description> - Provides a base class for different kinds of buttons. + Base class for different kinds of buttons. </brief_description> <description> - BaseButton is the abstract base class for buttons, so it shouldn't be used directly (It doesn't display anything). Other types of buttons inherit from it. + BaseButton is the abstract base class for buttons, so it shouldn't be used directly (it doesn't display anything). Other types of buttons inherit from it. </description> <tutorials> </tutorials> @@ -152,18 +152,25 @@ </methods> <members> <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="BaseButton.ActionMode"> + Determines when the button is considered clicked, one of the ACTION_MODE_* constants. </member> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled"> + If [code]true[/code] the button is in disabled state and can't be clicked or toggled. </member> <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" enum="Control.FocusMode"> + Focus access mode to use when switching between enabled/disabled (see [method Control.set_focus_mode] and [member disabled]). </member> <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group"> + [ButtonGroup] associated to the button. </member> <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed"> + 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"> + [Shortcut] associated to the button. </member> <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode"> + If [code]true[/code] the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked. </member> </members> <signals> diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index da89c37ff4..db47875050 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -1085,7 +1085,7 @@ </constant> <constant name="DIFFUSE_TOON" value="4"> </constant> - <constant name="SPECULAR_GGX" value="0"> + <constant name="SPECULAR_SCHLICK_GGX" value="0"> </constant> <constant name="SPECULAR_BLINN" value="1"> </constant> diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 6c0e4f74ff..5fe7b53a7d 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -838,7 +838,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n"; - actions[VS::SHADER_SPATIAL].render_mode_defines["specular_ggx"] = "#define SPECULAR_GGX\n"; + actions[VS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["specular_blinn"] = "#define SPECULAR_BLINN\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["specular_phong"] = "#define SPECULAR_PHONG\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["specular_toon"] = "#define SPECULAR_TOON\n"; diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index bf0ebae3e3..e4d76753cb 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1065,7 +1065,7 @@ LIGHT_SHADER_CODE #elif defined(SPECULAR_DISABLED) //none.. -#elif defined(SPECULAR_GGX) +#elif defined(SPECULAR_SCHLICK_GGX) // shlick+ggx as default vec3 H = normalize(V + L); @@ -1102,10 +1102,10 @@ LIGHT_SHADER_CODE #if defined(LIGHT_USE_CLEARCOAT) if (clearcoat_gloss > 0.0) { -# if !defined(SPECULAR_GGX) && !defined(SPECULAR_BLINN) +# if !defined(SPECULAR_SCHLICK_GGX) && !defined(SPECULAR_BLINN) vec3 H = normalize(V + L); # endif -# if !defined(SPECULAR_GGX) +# if !defined(SPECULAR_SCHLICK_GGX) float cNdotH = max(dot(N,H), 0.0); float cLdotH = max(dot(L,H), 0.0); float cLdotH5 = SchlickFresnel(cLdotH); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index ee1faf5a55..0100c221c4 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1089,6 +1089,7 @@ void CodeTextEditor::update_editor_settings() { text_editor->set_line_length_guideline_column(EditorSettings::get_singleton()->get("text_editor/line_numbers/line_length_guideline_column")); text_editor->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting")); text_editor->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_all_occurrences")); + text_editor->set_highlight_current_line(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_current_line")); text_editor->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink")); text_editor->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink_speed")); text_editor->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_breakpoint_gutter")); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b77525c0ba..3513126a9b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2670,12 +2670,12 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled) String addon_path = "res://addons/" + p_addon + "/plugin.cfg"; Error err = cf->load(addon_path); if (err != OK) { - show_warning(TTR("Unable to enable addon plugin at: '") + addon_path + TTR("' parsing of config failed.")); + show_warning(vformat(TTR("Unable to enable addon plugin at: '%s' parsing of config failed."), addon_path)); return; } if (!cf->has_section_key("plugin", "script")) { - show_warning(TTR("Unable to find script field for addon plugin at: 'res://addons/") + p_addon + "''."); + show_warning(vformat(TTR("Unable to find script field for addon plugin at: 'res://addons/%s'."), p_addon)); return; } @@ -2685,18 +2685,18 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled) Ref<Script> script = ResourceLoader::load(path); if (script.is_null()) { - show_warning(TTR("Unable to load addon script from path: '") + path + "'."); + show_warning(vformat(TTR("Unable to load addon script from path: '%s'."), path)); return; } //could check inheritance.. if (String(script->get_instance_base_type()) != "EditorPlugin") { - show_warning(TTR("Unable to load addon script from path: '") + path + "' Base type is not EditorPlugin."); + show_warning(vformat(TTR("Unable to load addon script from path: '%s' Base type is not EditorPlugin."), path)); return; } if (!script->is_tool()) { - show_warning(TTR("Unable to load addon script from path: '") + path + "' Script is not in tool mode."); + show_warning(vformat(TTR("Unable to load addon script from path: '%s' Script is not in tool mode."), path)); return; } diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index e394c6e2ad..799a8a2eb8 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -632,6 +632,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("text_editor/highlighting/syntax_highlighting", true); _initial_set("text_editor/highlighting/highlight_all_occurrences", true); + _initial_set("text_editor/highlighting/highlight_current_line", true); _initial_set("text_editor/cursor/scroll_past_end_of_file", false); _initial_set("text_editor/indent/type", 0); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 70a6954fb5..5782edd321 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -45,7 +45,7 @@ #include "scene/2d/screen_button.h" #include "scene/2d/sprite.h" #include "scene/gui/grid_container.h" -#include "scene/gui/patch_9_rect.h" +#include "scene/gui/nine_patch_rect.h" #include "scene/main/canvas_layer.h" #include "scene/main/viewport.h" #include "scene/resources/packed_scene.h" diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index b0ee1a32ca..f7dcc4b52d 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -348,6 +348,7 @@ void ShaderEditor::_editor_settings_changed() { shader_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_numbers")); shader_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting")); shader_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_all_occurrences")); + shader_editor->get_text_edit()->set_highlight_current_line(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_current_line")); shader_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink")); shader_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink_speed")); shader_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/theme/line_spacing")); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 740772e204..8870166dba 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -48,8 +48,8 @@ void TextureRegionEditor::_region_draw() { Ref<Texture> base_tex = NULL; if (node_sprite) base_tex = node_sprite->get_texture(); - else if (node_patch9) - base_tex = node_patch9->get_texture(); + else if (node_ninepatch) + base_tex = node_ninepatch->get_texture(); else if (obj_styleBox.is_valid()) base_tex = obj_styleBox->get_texture(); else if (atlas_tex.is_valid()) @@ -177,12 +177,12 @@ void TextureRegionEditor::_region_draw() { updating_scroll = false; float margins[4]; - if (node_patch9 || obj_styleBox.is_valid()) { - if (node_patch9) { - margins[0] = node_patch9->get_patch_margin(MARGIN_TOP); - margins[1] = node_patch9->get_patch_margin(MARGIN_BOTTOM); - margins[2] = node_patch9->get_patch_margin(MARGIN_LEFT); - margins[3] = node_patch9->get_patch_margin(MARGIN_RIGHT); + if (node_ninepatch || obj_styleBox.is_valid()) { + if (node_ninepatch) { + margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); + margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); + margins[2] = node_ninepatch->get_patch_margin(MARGIN_LEFT); + margins[3] = node_ninepatch->get_patch_margin(MARGIN_RIGHT); } else if (obj_styleBox.is_valid()) { margins[0] = obj_styleBox->get_margin_size(MARGIN_TOP); margins[1] = obj_styleBox->get_margin_size(MARGIN_BOTTOM); @@ -225,14 +225,14 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (mb->get_button_index() == BUTTON_LEFT) { if (mb->is_pressed()) { - if (node_patch9 || obj_styleBox.is_valid()) { + if (node_ninepatch || obj_styleBox.is_valid()) { edited_margin = -1; float margins[4]; - if (node_patch9) { - margins[0] = node_patch9->get_patch_margin(MARGIN_TOP); - margins[1] = node_patch9->get_patch_margin(MARGIN_BOTTOM); - margins[2] = node_patch9->get_patch_margin(MARGIN_LEFT); - margins[3] = node_patch9->get_patch_margin(MARGIN_RIGHT); + if (node_ninepatch) { + margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); + margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); + margins[2] = node_ninepatch->get_patch_margin(MARGIN_LEFT); + margins[3] = node_ninepatch->get_patch_margin(MARGIN_RIGHT); } else if (obj_styleBox.is_valid()) { margins[0] = obj_styleBox->get_margin_size(MARGIN_TOP); margins[1] = obj_styleBox->get_margin_size(MARGIN_BOTTOM); @@ -272,8 +272,8 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { Rect2 r; if (node_sprite) r = node_sprite->get_region_rect(); - else if (node_patch9) - r = node_patch9->get_region_rect(); + else if (node_ninepatch) + r = node_ninepatch->get_region_rect(); else if (obj_styleBox.is_valid()) r = obj_styleBox->get_region_rect(); else if (atlas_tex.is_valid()) @@ -285,9 +285,9 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (node_sprite) { undo_redo->add_do_method(node_sprite, "set_region_rect", rect); undo_redo->add_undo_method(node_sprite, "set_region_rect", node_sprite->get_region_rect()); - } else if (node_patch9) { - undo_redo->add_do_method(node_patch9, "set_region_rect", rect); - undo_redo->add_undo_method(node_patch9, "set_region_rect", node_patch9->get_region_rect()); + } else if (node_ninepatch) { + undo_redo->add_do_method(node_ninepatch, "set_region_rect", rect); + undo_redo->add_undo_method(node_ninepatch, "set_region_rect", node_ninepatch->get_region_rect()); } else if (obj_styleBox.is_valid()) { undo_redo->add_do_method(obj_styleBox.ptr(), "set_region_rect", rect); undo_redo->add_undo_method(obj_styleBox.ptr(), "set_region_rect", obj_styleBox->get_region_rect()); @@ -310,8 +310,8 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { drag = true; if (node_sprite) rect_prev = node_sprite->get_region_rect(); - else if (node_patch9) - rect_prev = node_patch9->get_region_rect(); + else if (node_ninepatch) + rect_prev = node_ninepatch->get_region_rect(); else if (obj_styleBox.is_valid()) rect_prev = obj_styleBox->get_region_rect(); else if (atlas_tex.is_valid()) @@ -334,9 +334,9 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (edited_margin >= 0) { undo_redo->create_action("Set Margin"); static Margin m[4] = { MARGIN_TOP, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT }; - if (node_patch9) { - undo_redo->add_do_method(node_patch9, "set_patch_margin", m[edited_margin], node_patch9->get_patch_margin(m[edited_margin])); - undo_redo->add_undo_method(node_patch9, "set_patch_margin", m[edited_margin], prev_margin); + if (node_ninepatch) { + undo_redo->add_do_method(node_ninepatch, "set_patch_margin", m[edited_margin], node_ninepatch->get_patch_margin(m[edited_margin])); + undo_redo->add_undo_method(node_ninepatch, "set_patch_margin", m[edited_margin], prev_margin); } else if (obj_styleBox.is_valid()) { undo_redo->add_do_method(obj_styleBox.ptr(), "set_margin_size", m[edited_margin], obj_styleBox->get_margin_size(m[edited_margin])); undo_redo->add_undo_method(obj_styleBox.ptr(), "set_margin_size", m[edited_margin], prev_margin); @@ -351,11 +351,11 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { } else if (atlas_tex.is_valid()) { undo_redo->add_do_method(atlas_tex.ptr(), "set_region", atlas_tex->get_region()); undo_redo->add_undo_method(atlas_tex.ptr(), "set_region", rect_prev); - } else if (node_patch9) { + } else if (node_ninepatch) { // FIXME: Is this intentional? - } else if (node_patch9) { - undo_redo->add_do_method(node_patch9, "set_region_rect", node_patch9->get_region_rect()); - undo_redo->add_undo_method(node_patch9, "set_region_rect", rect_prev); + } else if (node_ninepatch) { + undo_redo->add_do_method(node_ninepatch, "set_region_rect", node_ninepatch->get_region_rect()); + undo_redo->add_undo_method(node_ninepatch, "set_region_rect", rect_prev); } else if (obj_styleBox.is_valid()) { undo_redo->add_do_method(obj_styleBox.ptr(), "set_region_rect", obj_styleBox->get_region_rect()); undo_redo->add_undo_method(obj_styleBox.ptr(), "set_region_rect", rect_prev); @@ -375,8 +375,8 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { drag = false; if (edited_margin >= 0) { static Margin m[4] = { MARGIN_TOP, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT }; - if (node_patch9) - node_patch9->set_patch_margin(m[edited_margin], prev_margin); + if (node_ninepatch) + node_ninepatch->set_patch_margin(m[edited_margin], prev_margin); if (obj_styleBox.is_valid()) obj_styleBox->set_margin_size(m[edited_margin], prev_margin); edited_margin = -1; @@ -422,8 +422,8 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (new_margin < 0) new_margin = 0; static Margin m[4] = { MARGIN_TOP, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT }; - if (node_patch9) - node_patch9->set_patch_margin(m[edited_margin], new_margin); + if (node_ninepatch) + node_ninepatch->set_patch_margin(m[edited_margin], new_margin); if (obj_styleBox.is_valid()) obj_styleBox->set_margin_size(m[edited_margin], new_margin); } else { @@ -573,8 +573,8 @@ void TextureRegionEditor::_zoom_out() { void TextureRegionEditor::apply_rect(const Rect2 &rect) { if (node_sprite) node_sprite->set_region_rect(rect); - else if (node_patch9) - node_patch9->set_region_rect(rect); + else if (node_ninepatch) + node_ninepatch->set_region_rect(rect); else if (obj_styleBox.is_valid()) obj_styleBox->set_region_rect(rect); else if (atlas_tex.is_valid()) @@ -593,8 +593,8 @@ void TextureRegionEditor::_notification(int p_what) { } void TextureRegionEditor::_node_removed(Object *p_obj) { - if (p_obj == node_sprite || p_obj == node_patch9 || p_obj == obj_styleBox.ptr() || p_obj == atlas_tex.ptr()) { - node_patch9 = NULL; + if (p_obj == node_sprite || p_obj == node_ninepatch || p_obj == obj_styleBox.ptr() || p_obj == atlas_tex.ptr()) { + node_ninepatch = NULL; node_sprite = NULL; obj_styleBox = Ref<StyleBox>(NULL); atlas_tex = Ref<AtlasTexture>(NULL); @@ -623,15 +623,15 @@ void TextureRegionEditor::_bind_methods() { void TextureRegionEditor::edit(Object *p_obj) { if (node_sprite) node_sprite->remove_change_receptor(this); - if (node_patch9) - node_patch9->remove_change_receptor(this); + if (node_ninepatch) + node_ninepatch->remove_change_receptor(this); if (obj_styleBox.is_valid()) obj_styleBox->remove_change_receptor(this); if (atlas_tex.is_valid()) atlas_tex->remove_change_receptor(this); if (p_obj) { node_sprite = Object::cast_to<Sprite>(p_obj); - node_patch9 = Object::cast_to<NinePatchRect>(p_obj); + node_ninepatch = Object::cast_to<NinePatchRect>(p_obj); if (Object::cast_to<StyleBoxTexture>(p_obj)) obj_styleBox = Ref<StyleBoxTexture>(Object::cast_to<StyleBoxTexture>(p_obj)); if (Object::cast_to<AtlasTexture>(p_obj)) @@ -640,7 +640,7 @@ void TextureRegionEditor::edit(Object *p_obj) { _edit_region(); } else { node_sprite = NULL; - node_patch9 = NULL; + node_ninepatch = NULL; obj_styleBox = Ref<StyleBoxTexture>(NULL); atlas_tex = Ref<AtlasTexture>(NULL); } @@ -659,8 +659,8 @@ void TextureRegionEditor::_edit_region() { Ref<Texture> texture = NULL; if (node_sprite) texture = node_sprite->get_texture(); - else if (node_patch9) - texture = node_patch9->get_texture(); + else if (node_ninepatch) + texture = node_ninepatch->get_texture(); else if (obj_styleBox.is_valid()) texture = obj_styleBox->get_texture(); else if (atlas_tex.is_valid()) @@ -726,8 +726,8 @@ void TextureRegionEditor::_edit_region() { if (node_sprite) rect = node_sprite->get_region_rect(); - else if (node_patch9) - rect = node_patch9->get_region_rect(); + else if (node_ninepatch) + rect = node_ninepatch->get_region_rect(); else if (obj_styleBox.is_valid()) rect = obj_styleBox->get_region_rect(); else if (atlas_tex.is_valid()) @@ -747,7 +747,7 @@ Vector2 TextureRegionEditor::snap_point(Vector2 p_target) const { TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { node_sprite = NULL; - node_patch9 = NULL; + node_ninepatch = NULL; obj_styleBox = Ref<StyleBoxTexture>(NULL); atlas_tex = Ref<AtlasTexture>(NULL); editor = p_editor; diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h index 0789dde1c1..2058dad791 100644 --- a/editor/plugins/texture_region_editor_plugin.h +++ b/editor/plugins/texture_region_editor_plugin.h @@ -37,7 +37,7 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/sprite.h" -#include "scene/gui/patch_9_rect.h" +#include "scene/gui/nine_patch_rect.h" #include "scene/resources/style_box.h" #include "scene/resources/texture.h" @@ -82,7 +82,7 @@ class TextureRegionEditor : public Control { Vector2 snap_step; Vector2 snap_separation; - NinePatchRect *node_patch9; + NinePatchRect *node_ninepatch; Sprite *node_sprite; Ref<StyleBoxTexture> obj_styleBox; Ref<AtlasTexture> atlas_tex; diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index d12b3f1e0e..9235dafaa6 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -945,6 +945,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (mm.is_valid()) { Point2i new_over_tile = node->world_to_map(xform_inv.xform(mm->get_position())); + Point2i old_over_tile = over_tile; if (new_over_tile != over_tile) { @@ -963,17 +964,43 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (tool == TOOL_PAINTING) { + // Paint using bresenham line to prevent holes in painting if the user moves fast + + Vector<Point2i> points = line(old_over_tile.x, over_tile.x, old_over_tile.y, over_tile.y); int id = get_selected_tile(); - if (id != TileMap::INVALID_CELL) { + + for (int i = 0; i < points.size(); ++i) { + + Point2i pos = points[i]; if (!paint_undo.has(over_tile)) { - paint_undo[over_tile] = _get_op_from_cell(over_tile); + paint_undo[pos] = _get_op_from_cell(pos); } - _set_cell(over_tile, id, flip_h, flip_v, transpose); + _set_cell(pos, id, flip_h, flip_v, transpose); + } - return true; + return true; + } + + if (tool == TOOL_ERASING) { + + // erase using bresenham line to prevent holes in painting if the user moves fast + + Vector<Point2i> points = line(old_over_tile.x, over_tile.x, old_over_tile.y, over_tile.y); + + for (int i = 0; i < points.size(); ++i) { + + Point2i pos = points[i]; + + if (!paint_undo.has(over_tile)) { + paint_undo[pos] = _get_op_from_cell(pos); + } + + _set_cell(pos, TileMap::INVALID_CELL); } + + return true; } if (tool == TOOL_SELECTING) { @@ -1044,16 +1071,6 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { return true; } - if (tool == TOOL_ERASING) { - - if (!paint_undo.has(over_tile)) { - paint_undo[over_tile] = _get_op_from_cell(over_tile); - } - - _set_cell(over_tile, TileMap::INVALID_CELL); - - return true; - } if (tool == TOOL_PICKING && Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) { _pick_tile(over_tile); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 723d7b14ff..1284788425 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -1127,7 +1127,11 @@ void ProjectSettingsEditor::_translation_res_option_changed() { ERR_FAIL_COND(!remaps.has(key)); PoolStringArray r = remaps[key]; ERR_FAIL_INDEX(idx, r.size()); - r.set(idx, path + ":" + langs[which]); + if (translation_locales_idxs_remap.size() > 0) { + r.set(idx, path + ":" + langs[translation_locales_idxs_remap[which]]); + } else { + r.set(idx, path + ":" + langs[which]); + } remaps[key] = r; updating_translations = true; @@ -1203,6 +1207,88 @@ void ProjectSettingsEditor::_translation_res_option_delete(Object *p_item, int p undo_redo->commit_action(); } +void ProjectSettingsEditor::_translation_filter_option_changed() { + + int sel_id = translation_locale_filter_mode->get_selected_id(); + TreeItem *t = translation_filter->get_selected(); + String locale = t->get_tooltip(0); + bool checked = t->is_checked(0); + + Variant prev; + Array f_locales_all; + + if (ProjectSettings::get_singleton()->has_setting("locale/locale_filter")) { + f_locales_all = ProjectSettings::get_singleton()->get("locale/locale_filter"); + prev = f_locales_all; + + if (f_locales_all.size() != 2) { + f_locales_all.clear(); + f_locales_all.append(sel_id); + f_locales_all.append(Array()); + } + } else { + f_locales_all.append(sel_id); + f_locales_all.append(Array()); + } + + Array f_locales = f_locales_all[1]; + int l_idx = f_locales.find(locale); + + if (checked) { + if (l_idx == -1) { + f_locales.append(locale); + } + } else { + if (l_idx != -1) { + f_locales.remove(l_idx); + } + } + + f_locales = f_locales.sort(); + + undo_redo->create_action(TTR("Changed Locale Filter")); + undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/locale_filter", f_locales_all); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/locale_filter", prev); + undo_redo->add_do_method(this, "_update_translations"); + undo_redo->add_undo_method(this, "_update_translations"); + undo_redo->add_do_method(this, "_settings_changed"); + undo_redo->add_undo_method(this, "_settings_changed"); + undo_redo->commit_action(); +} + +void ProjectSettingsEditor::_translation_filter_mode_changed(int p_mode) { + + int sel_id = translation_locale_filter_mode->get_selected_id(); + + Variant prev; + Array f_locales_all; + + if (ProjectSettings::get_singleton()->has_setting("locale/locale_filter")) { + f_locales_all = ProjectSettings::get_singleton()->get("locale/locale_filter"); + prev = f_locales_all; + + if (f_locales_all.size() != 2) { + f_locales_all.clear(); + f_locales_all.append(sel_id); + f_locales_all.append(Array()); + } else { + f_locales_all[0] = sel_id; + } + } else { + f_locales_all.append(sel_id); + f_locales_all.append(Array()); + } + + undo_redo->create_action(TTR("Changed Locale Filter Mode")); + undo_redo->add_do_property(ProjectSettings::get_singleton(), "locale/locale_filter", f_locales_all); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "locale/locale_filter", prev); + undo_redo->add_do_method(this, "_update_translations"); + undo_redo->add_undo_method(this, "_update_translations"); + undo_redo->add_do_method(this, "_settings_changed"); + undo_redo->add_undo_method(this, "_settings_changed"); + undo_redo->commit_action(); +} + void ProjectSettingsEditor::_update_translations() { //update translations @@ -1229,6 +1315,61 @@ void ProjectSettingsEditor::_update_translations() { } } + Vector<String> langs = TranslationServer::get_all_locales(); + Vector<String> names = TranslationServer::get_all_locale_names(); + + //update filter tab + Array l_filter_all; + + bool is_arr_empty = true; + if (ProjectSettings::get_singleton()->has_setting("locale/locale_filter")) { + + l_filter_all = ProjectSettings::get_singleton()->get("locale/locale_filter"); + + if (l_filter_all.size() == 2) { + + translation_locale_filter_mode->select(l_filter_all[0]); + is_arr_empty = false; + } + } + if (is_arr_empty) { + + l_filter_all.append(0); + l_filter_all.append(Array()); + translation_locale_filter_mode->select(0); + } + + int filter_mode = l_filter_all[0]; + Array l_filter = l_filter_all[1]; + + int s = names.size(); + if (!translation_locales_list_created) { + + translation_locales_list_created = true; + translation_filter->clear(); + root = translation_filter->create_item(NULL); + translation_filter->set_hide_root(true); + translation_filter_treeitems.resize(s); + + for (int i = 0; i < s; i++) { + String n = names[i]; + String l = langs[i]; + TreeItem *t = translation_filter->create_item(root); + t->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); + t->set_text(0, n); + t->set_editable(0, true); + t->set_tooltip(0, l); + t->set_checked(0, l_filter.has(l)); + translation_filter_treeitems[i] = t; + } + } else { + for (int i = 0; i < s; i++) { + + TreeItem *t = translation_filter_treeitems[i]; + t->set_checked(0, l_filter.has(t->get_tooltip(0))); + } + } + //update translation remaps String remap_selected; @@ -1244,13 +1385,30 @@ void ProjectSettingsEditor::_update_translations() { translation_remap_options->set_hide_root(true); translation_res_option_add_button->set_disabled(true); - Vector<String> langs = TranslationServer::get_all_locales(); - Vector<String> names = TranslationServer::get_all_locale_names(); - String langnames; + translation_locales_idxs_remap.clear(); + translation_locales_idxs_remap.resize(l_filter.size()); + int fl_idx_count = translation_locales_idxs_remap.size(); + + String langnames = ""; + int l_idx = 0; for (int i = 0; i < names.size(); i++) { - if (i > 0) - langnames += ","; - langnames += names[i]; + + if (filter_mode == SHOW_ONLY_SELECTED_LOCALES && fl_idx_count != 0) { + if (l_filter.size() > 0) { + + if (l_filter.find(langs[i]) != -1) { + if (langnames.length() > 0) + langnames += ","; + langnames += names[i]; + translation_locales_idxs_remap[l_idx] = i; + l_idx++; + } + } + } else { + if (i > 0) + langnames += ","; + langnames += names[i]; + } } if (ProjectSettings::get_singleton()->has_setting("locale/translation_remaps")) { @@ -1295,11 +1453,18 @@ void ProjectSettingsEditor::_update_translations() { t2->set_editable(1, true); t2->set_metadata(1, path); int idx = langs.find(locale); - print_line("find " + locale + " at " + itos(idx)); + //print_line("find " + locale + " at " + itos(idx)); if (idx < 0) idx = 0; - t2->set_range(1, idx); + int f_idx = translation_locales_idxs_remap.find(idx); + if (f_idx != -1 && fl_idx_count > 0 && filter_mode == SHOW_ONLY_SELECTED_LOCALES) { + + t2->set_range(1, f_idx); + } else { + + t2->set_range(1, idx); + } } } } @@ -1381,6 +1546,9 @@ void ProjectSettingsEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_translation_res_delete"), &ProjectSettingsEditor::_translation_res_delete); ClassDB::bind_method(D_METHOD("_translation_res_option_delete"), &ProjectSettingsEditor::_translation_res_option_delete); + ClassDB::bind_method(D_METHOD("_translation_filter_option_changed"), &ProjectSettingsEditor::_translation_filter_option_changed); + ClassDB::bind_method(D_METHOD("_translation_filter_mode_changed"), &ProjectSettingsEditor::_translation_filter_mode_changed); + ClassDB::bind_method(D_METHOD("_clear_search_box"), &ProjectSettingsEditor::_clear_search_box); ClassDB::bind_method(D_METHOD("_toggle_search_bar"), &ProjectSettingsEditor::_toggle_search_bar); @@ -1601,6 +1769,8 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { translations->set_tab_align(TabContainer::ALIGN_LEFT); translations->set_name(TTR("Localization")); tab_container->add_child(translations); + //remap for properly select language in popup + translation_locales_idxs_remap = Vector<int>(); { @@ -1684,6 +1854,29 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { } { + VBoxContainer *tvb = memnew(VBoxContainer); + translations->add_child(tvb); + tvb->set_name(TTR("Locales Filter")); + VBoxContainer *tmc = memnew(VBoxContainer); + tmc->set_v_size_flags(SIZE_EXPAND_FILL); + tvb->add_child(tmc); + + translation_locale_filter_mode = memnew(OptionButton); + translation_locale_filter_mode->add_item(TTR("Show all locales"), SHOW_ALL_LOCALES); + translation_locale_filter_mode->add_item(TTR("Show only selected locales"), SHOW_ONLY_SELECTED_LOCALES); + translation_locale_filter_mode->select(0); + tmc->add_margin_child(TTR("Filter mode:"), translation_locale_filter_mode); + translation_locale_filter_mode->connect("item_selected", this, "_translation_filter_mode_changed"); + + translation_filter = memnew(Tree); + translation_filter->set_v_size_flags(SIZE_EXPAND_FILL); + translation_filter->set_columns(1); + tmc->add_child(memnew(Label(TTR("Locales:")))); + tmc->add_child(translation_filter); + translation_filter->connect("item_edited", this, "_translation_filter_option_changed"); + } + + { autoload_settings = memnew(EditorAutoloadSettings); autoload_settings->set_name(TTR("AutoLoad")); tab_container->add_child(autoload_settings); diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index 7f9b18a968..a86cfee813 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -49,6 +49,11 @@ class ProjectSettingsEditor : public AcceptDialog { INPUT_MOUSE_BUTTON }; + enum LocaleFilter { + SHOW_ALL_LOCALES, + SHOW_ONLY_SELECTED_LOCALES, + }; + TabContainer *tab_container; Timer *timer; @@ -95,6 +100,11 @@ class ProjectSettingsEditor : public AcceptDialog { EditorFileDialog *translation_res_option_file_open; Tree *translation_remap; Tree *translation_remap_options; + Tree *translation_filter; + bool translation_locales_list_created; + OptionButton *translation_locale_filter_mode; + Vector<TreeItem *> translation_filter_treeitems; + Vector<int> translation_locales_idxs_remap; EditorAutoloadSettings *autoload_settings; @@ -142,6 +152,9 @@ class ProjectSettingsEditor : public AcceptDialog { void _translation_res_option_changed(); void _translation_res_option_delete(Object *p_item, int p_column, int p_button); + void _translation_filter_option_changed(); + void _translation_filter_mode_changed(int p_mode); + void _toggle_search_bar(bool p_pressed); void _clear_search_box(); diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index ef61aad341..bc2423fffd 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -574,7 +574,38 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da for (int i = 0; i < arr.size(); i++) { p[i] = arr[i]; if (i < perf_items.size()) { - perf_items[i]->set_text(1, rtos(p[i])); + + float v = p[i]; + String vs = rtos(v); + String tt = vs; + switch (Performance::MonitorType((int)perf_items[i]->get_metadata(1))) { + case Performance::MONITOR_TYPE_MEMORY: { + // for the time being, going above GBs is a bad sign. + String unit = "B"; + if ((int)v > 1073741824) { + unit = "GB"; + v /= 1073741824.0; + } else if ((int)v > 1048576) { + unit = "MB"; + v /= 1048576.0; + } else if ((int)v > 1024) { + unit = "KB"; + v /= 1024.0; + } + tt += " bytes"; + vs = rtos(v) + " " + unit; + } break; + case Performance::MONITOR_TYPE_TIME: { + tt += " seconds"; + vs += " s"; + } break; + default: { + tt += " " + perf_items[i]->get_text(0); + } break; + } + + perf_items[i]->set_text(1, vs); + perf_items[i]->set_tooltip(1, tt); if (p[i] > perf_max[i]) perf_max[i] = p[i]; } @@ -775,7 +806,7 @@ void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType reason->set_tooltip(p_reason); } -void ScriptEditorDebugger::_performance_select(Object *, int, bool) { +void ScriptEditorDebugger::_performance_select() { perf_draw->update(); } @@ -785,7 +816,7 @@ void ScriptEditorDebugger::_performance_draw() { Vector<int> which; for (int i = 0; i < perf_items.size(); i++) { - if (perf_items[i]->is_selected(0)) + if (perf_items[i]->is_checked(0)) which.push_back(i); } @@ -816,14 +847,14 @@ void ScriptEditorDebugger::_performance_draw() { r.position += graph_sb->get_offset(); r.size -= graph_sb->get_minimum_size(); int pi = which[i]; - Color c = get_color("success_color", "Editor"); - c.set_hsv(Math::fmod(c.get_h() + pi * 0.7654, 1), c.get_s(), c.get_v()); - //c = c.linear_interpolate(get_color("base_color", "Editor"), 0.9); + Color c = get_color("accent_color", "Editor"); + float h = (float)which[i] / (float)(perf_items.size()); + c.set_hsv(Math::fmod(h + 0.4, 0.9), c.get_s() * 0.9, c.get_v() * 1.4); - c.a = 0.8; - perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x); c.a = 0.6; - perf_draw->draw_string(graph_font, r.position + Point2(graph_font->get_char_size('X').width, graph_font->get_ascent() + graph_font->get_height()), perf_items[pi]->get_text(1), c, r.size.y); + perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x); + c.a = 0.9; + perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent() + graph_font->get_height()), perf_items[pi]->get_text(1), c, r.size.y); float spacing = point_sep / float(cols); float from = r.size.width; @@ -1785,13 +1816,12 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { perf_monitors->set_column_title(1, TTR("Value")); perf_monitors->set_column_titles_visible(true); hsp->add_child(perf_monitors); - perf_monitors->set_select_mode(Tree::SELECT_MULTI); - perf_monitors->connect("multi_selected", this, "_performance_select"); + perf_monitors->connect("item_edited", this, "_performance_select"); perf_draw = memnew(Control); perf_draw->connect("draw", this, "_performance_draw"); hsp->add_child(perf_draw); hsp->set_name(TTR("Monitors")); - hsp->set_split_offset(300); + hsp->set_split_offset(340 * EDSCALE); tabs->add_child(hsp); perf_max.resize(Performance::MONITOR_MAX); @@ -1801,6 +1831,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { for (int i = 0; i < Performance::MONITOR_MAX; i++) { String n = Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)); + Performance::MonitorType mtype = Performance::get_singleton()->get_monitor_type(Performance::Monitor(i)); String base = n.get_slice("/", 0); String name = n.get_slice("/", 1); if (!bases.has(base)) { @@ -1808,12 +1839,16 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { b->set_text(0, base.capitalize()); b->set_editable(0, false); b->set_selectable(0, false); + b->set_expand_right(0, true); bases[base] = b; } TreeItem *it = perf_monitors->create_item(bases[base]); - it->set_editable(0, false); - it->set_selectable(0, true); + it->set_metadata(1, mtype); + it->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); + it->set_editable(0, true); + it->set_selectable(0, false); + it->set_selectable(1, false); it->set_text(0, name.capitalize()); perf_items.push_back(it); perf_max[i] = 0; diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index d0faab5892..d18a625eef 100644 --- a/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h @@ -142,7 +142,7 @@ class ScriptEditorDebugger : public Control { bool live_debug; void _performance_draw(); - void _performance_select(Object *, int, bool); + void _performance_select(); void _stack_dump_frame_selected(); void _output_clear(); diff --git a/main/performance.cpp b/main/performance.cpp index c4b62559c7..39b42e803c 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -153,6 +153,44 @@ float Performance::get_monitor(Monitor p_monitor) const { return 0; } +Performance::MonitorType Performance::get_monitor_type(Monitor p_monitor) const { + ERR_FAIL_INDEX_V(p_monitor, MONITOR_MAX, MONITOR_TYPE_QUANTITY); + // ugly + static const MonitorType types[MONITOR_MAX] = { + + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_TIME, + MONITOR_TYPE_TIME, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + + }; + + return types[p_monitor]; +} + void Performance::set_process_time(float p_pt) { _process_time = p_pt; diff --git a/main/performance.h b/main/performance.h index 900e6434b7..21fbd7a1d2 100644 --- a/main/performance.h +++ b/main/performance.h @@ -79,9 +79,17 @@ public: MONITOR_MAX }; + enum MonitorType { + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_TIME + }; + float get_monitor(Monitor p_monitor) const; String get_monitor_name(Monitor p_monitor) const; + MonitorType get_monitor_type(Monitor p_monitor) const; + void set_process_time(float p_pt); void set_physics_process_time(float p_pt); diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index b0408917a4..9d37703357 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -61,7 +61,11 @@ Ref<Script> GDScriptLanguage::get_template(const String &p_class_name, const Str "func _ready():\n" + "%TS%# Called every time the node is added to the scene.\n" + "%TS%# Initialization here\n" + - "%TS%pass\n"; + "%TS%pass\n\n" + + "#func _process(delta):\n" + + "#%TS%# Called every frame. Delta is time since last frame.\n" + + "#%TS%# Update game logic here.\n" + + "#%TS%pass\n"; _template = _template.replace("%BASE%", p_base_class_name); _template = _template.replace("%TS%", _get_indentation()); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index ba8c7df9cc..7143177c3f 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -277,7 +277,14 @@ Ref<Script> CSharpLanguage::get_template(const String &p_class_name, const Strin " // Initialization here\n" " \n" " }\n" - "}\n"; + "\n" + "// public override void _Process(float delta)\n" + "// {\n" + "// // Called every frame. Delta is time since last frame.\n" + "// // Update game logic here.\n" + "// \n" + "// }\n" + "//}\n"; script_template = script_template.replace("%BASE_CLASS_NAME%", p_base_class_name).replace("%CLASS_NAME%", p_class_name); diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 95e75f9103..1d1bcfb03f 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -778,8 +778,8 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str cs_file.push_back(itype.proxy_name); cs_file.push_back("(IntPtr " BINDINGS_PTR_FIELD ")\n" OPEN_BLOCK_L2 "this." BINDINGS_PTR_FIELD " = " BINDINGS_PTR_FIELD ";\n" CLOSE_BLOCK_L2); - cs_file.push_back(MEMBER_BEGIN "public bool HasValidHandle()\n" OPEN_BLOCK_L2 - "return " BINDINGS_PTR_FIELD " == IntPtr.Zero;\n" CLOSE_BLOCK_L2); + cs_file.push_back(MEMBER_BEGIN "public IntPtr NativeInstance\n" OPEN_BLOCK_L2 + "get { return " BINDINGS_PTR_FIELD "; }\n" CLOSE_BLOCK_L2); } else if (itype.is_singleton) { // Add the type name and the singleton pointer as static fields @@ -841,8 +841,8 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str // Add methods if (!is_derived_type) { - cs_file.push_back(MEMBER_BEGIN "public bool HasValidHandle()\n" OPEN_BLOCK_L2 - "return " BINDINGS_PTR_FIELD " == IntPtr.Zero;\n" CLOSE_BLOCK_L2); + cs_file.push_back(MEMBER_BEGIN "public IntPtr NativeInstance\n" OPEN_BLOCK_L2 + "get { return " BINDINGS_PTR_FIELD "; }\n" CLOSE_BLOCK_L2); cs_file.push_back(MEMBER_BEGIN "internal static IntPtr " CS_SMETHOD_GETINSTANCE "(Object instance)\n" OPEN_BLOCK_L2 "return instance == null ? IntPtr.Zero : instance." BINDINGS_PTR_FIELD ";\n" CLOSE_BLOCK_L2); diff --git a/modules/mono/editor/godotsharp_builds.cpp b/modules/mono/editor/godotsharp_builds.cpp index 1bad8a3f85..d3808769fb 100644 --- a/modules/mono/editor/godotsharp_builds.cpp +++ b/modules/mono/editor/godotsharp_builds.cpp @@ -395,10 +395,11 @@ void GodotSharpBuilds::BuildProcess::start(bool p_blocking) { } if (!exited) { - ERR_PRINT("BuildProcess::start called, but process still running"); exited = true; - build_tab->on_build_exec_failed("!exited"); - return; + String message = "Tried to start build process, but it is already running"; + build_tab->on_build_exec_failed(message); + ERR_EXPLAIN(message); + ERR_FAIL(); } exited = false; @@ -410,10 +411,12 @@ void GodotSharpBuilds::BuildProcess::start(bool p_blocking) { if (d->file_exists(issues_file)) { Error err = d->remove(issues_file); if (err != OK) { - ERR_PRINTS("Cannot remove file: " + logs_dir.plus_file(issues_file)); exited = true; - build_tab->on_build_exec_failed("Cannot remove file: " + issues_file); - return; + String file_path = ProjectSettings::get_singleton()->localize_path(logs_dir).plus_file(issues_file); + String message = "Cannot remove issues file: " + file_path; + build_tab->on_build_exec_failed(message); + ERR_EXPLAIN(message); + ERR_FAIL(); } } @@ -434,7 +437,9 @@ void GodotSharpBuilds::BuildProcess::start(bool p_blocking) { if (ex) { exited = true; - build_tab->on_build_exec_failed("The build constructor threw an exception.\n" + GDMonoUtils::get_exception_name_and_message(ex)); + String message = "The build constructor threw an exception.\n" + GDMonoUtils::get_exception_name_and_message(ex); + build_tab->on_build_exec_failed(message); + ERR_EXPLAIN(message); ERR_FAIL(); } @@ -452,7 +457,9 @@ void GodotSharpBuilds::BuildProcess::start(bool p_blocking) { if (ex) { exited = true; - build_tab->on_build_exec_failed("The build method threw an exception.\n" + GDMonoUtils::get_exception_name_and_message(ex)); + String message = "The build method threw an exception.\n" + GDMonoUtils::get_exception_name_and_message(ex); + build_tab->on_build_exec_failed(message); + ERR_EXPLAIN(message); ERR_FAIL(); } diff --git a/modules/mono/editor/mono_bottom_panel.cpp b/modules/mono/editor/mono_bottom_panel.cpp index 07109eaac7..8d6a618ee8 100644 --- a/modules/mono/editor/mono_bottom_panel.cpp +++ b/modules/mono/editor/mono_bottom_panel.cpp @@ -280,7 +280,11 @@ void MonoBuildTab::_update_issues_list() { String tooltip; tooltip += String("Message: ") + issue.message; - tooltip += String("\nCode: ") + issue.code; + + if (issue.code.length()) { + tooltip += String("\nCode: ") + issue.code; + } + tooltip += String("\nType: ") + (issue.warning ? "warning" : "error"); String text; @@ -356,23 +360,21 @@ void MonoBuildTab::on_build_exit(BuildResult result) { MonoBottomPanel::get_singleton()->raise_build_tab(this); } -void MonoBuildTab::on_build_exec_failed(const String &p_cause, const String &p_detailed) { +void MonoBuildTab::on_build_exec_failed(const String &p_cause) { build_exited = true; build_result = RESULT_ERROR; issues_list->clear(); - String tooltip; + BuildIssue issue; + issue.message = p_cause; + issue.warning = false; - tooltip += "Message: " + (p_detailed.length() ? p_detailed : p_cause); - tooltip += "\nType: error"; + error_count += 1; + issues.push_back(issue); - int line_break_idx = p_cause.find("\n"); - issues_list->add_item(line_break_idx == -1 ? p_cause : p_cause.substr(0, line_break_idx), - get_icon("Error", "EditorIcons")); - int index = issues_list->get_item_count() - 1; - issues_list->set_item_tooltip(index, tooltip); + _update_issues_list(); MonoBottomPanel::get_singleton()->raise_build_tab(this); } diff --git a/modules/mono/editor/mono_bottom_panel.h b/modules/mono/editor/mono_bottom_panel.h index 909fa4b385..83da5b9809 100644 --- a/modules/mono/editor/mono_bottom_panel.h +++ b/modules/mono/editor/mono_bottom_panel.h @@ -134,7 +134,7 @@ public: void on_build_start(); void on_build_exit(BuildResult result); - void on_build_exec_failed(const String &p_cause, const String &p_detailed = String()); + void on_build_exec_failed(const String &p_cause); void restart_build(); void stop_build(); diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index d7aedbbcf0..4b5f5eb137 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "gd_mono.h" +#include <mono/metadata/exception.h> #include <mono/metadata/mono-config.h> #include <mono/metadata/mono-debug.h> #include <mono/metadata/mono-gc.h> @@ -47,6 +48,15 @@ #include "../editor/godotsharp_editor.h" #endif +void gdmono_unhandled_exception_hook(MonoObject *exc, void *user_data) { + + (void)user_data; // UNUSED + + ERR_PRINT(GDMonoUtils::get_exception_name_and_message(exc).utf8()); + mono_print_unhandled_exception(exc); + abort(); +} + #ifdef MONO_PRINT_HANDLER_ENABLED void gdmono_MonoPrintCallback(const char *string, mono_bool is_stdout) { @@ -214,6 +224,8 @@ void GDMono::initialize() { // The following assemblies are not required at initialization _load_all_script_assemblies(); + mono_install_unhandled_exception_hook(gdmono_unhandled_exception_hook, NULL); + OS::get_singleton()->print("Mono: ALL IS GOOD\n"); } diff --git a/modules/mono/mono_gd/gd_mono_method.cpp b/modules/mono/mono_gd/gd_mono_method.cpp index 6468e0d3d9..eb97d62900 100644 --- a/modules/mono/mono_gd/gd_mono_method.cpp +++ b/modules/mono/mono_gd/gd_mono_method.cpp @@ -83,9 +83,32 @@ MonoObject *GDMonoMethod::invoke(MonoObject *p_object, const Variant **p_params, mono_array_set(params, MonoObject *, i, boxed_param); } - return mono_runtime_invoke_array(mono_method, p_object, params, r_exc); + MonoObject *exc = NULL; + MonoObject *ret = mono_runtime_invoke_array(mono_method, p_object, params, &exc); + + if (exc) { + if (r_exc) { + *r_exc = exc; + } else { + ERR_PRINT(GDMonoUtils::get_exception_name_and_message(exc).utf8()); + mono_print_unhandled_exception(exc); + } + } + + return ret; } else { - mono_runtime_invoke(mono_method, p_object, NULL, r_exc); + MonoObject *exc = NULL; + mono_runtime_invoke(mono_method, p_object, NULL, &exc); + + if (exc) { + if (r_exc) { + *r_exc = exc; + } else { + ERR_PRINT(GDMonoUtils::get_exception_name_and_message(exc).utf8()); + mono_print_unhandled_exception(exc); + } + } + return NULL; } } @@ -96,7 +119,19 @@ MonoObject *GDMonoMethod::invoke(MonoObject *p_object, MonoObject **r_exc) { } MonoObject *GDMonoMethod::invoke_raw(MonoObject *p_object, void **p_params, MonoObject **r_exc) { - return mono_runtime_invoke(mono_method, p_object, p_params, r_exc); + MonoObject *exc = NULL; + MonoObject *ret = mono_runtime_invoke(mono_method, p_object, p_params, &exc); + + if (exc) { + if (r_exc) { + *r_exc = exc; + } else { + ERR_PRINT(GDMonoUtils::get_exception_name_and_message(exc).utf8()); + mono_print_unhandled_exception(exc); + } + } + + return ret; } bool GDMonoMethod::has_attribute(GDMonoClass *p_attr_class) { diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 05adfeb0f5..420bb50af9 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -219,6 +219,9 @@ public: virtual bool _check_internal_feature_support(const String &p_feature); + virtual void set_use_vsync(bool p_enable); + virtual bool is_vsync_enabled() const; + void run(); void set_mouse_mode(MouseMode p_mode); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 2c81a02014..e1a01d2b59 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1954,6 +1954,23 @@ Error OS_OSX::move_to_trash(const String &p_path) { return OK; } +void OS_OSX::set_use_vsync(bool p_enable) { + CGLContextObj ctx = CGLGetCurrentContext(); + if (ctx) { + GLint swapInterval = p_enable ? 1 : 0; + CGLSetParameter(ctx, kCGLCPSwapInterval, &swapInterval); + } +} + +bool OS_OSX::is_vsync_enabled() const { + GLint swapInterval = 0; + CGLContextObj ctx = CGLGetCurrentContext(); + if (ctx) { + CGLGetParameter(ctx, kCGLCPSwapInterval, &swapInterval); + } + return swapInterval ? true : false; +} + OS_OSX *OS_OSX::singleton = NULL; OS_OSX::OS_OSX() { diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index fa656bdcd3..ff23b3183b 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -61,6 +61,21 @@ void RayCast2D::set_type_mask(uint32_t p_mask) { type_mask = p_mask; } +void RayCast2D::set_collision_mask_bit(int p_bit, bool p_value) { + + uint32_t mask = get_collision_mask(); + if (p_value) + mask |= 1 << p_bit; + else + mask &= ~(1 << p_bit); + set_collision_mask(mask); +} + +bool RayCast2D::get_collision_mask_bit(int p_bit) const { + + return get_collision_mask() & (1 << p_bit); +} + uint32_t RayCast2D::get_type_mask() const { return type_mask; @@ -279,6 +294,9 @@ void RayCast2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_collision_mask", "mask"), &RayCast2D::set_collision_mask); ClassDB::bind_method(D_METHOD("get_collision_mask"), &RayCast2D::get_collision_mask); + ClassDB::bind_method(D_METHOD("set_collision_mask_bit", "bit", "value"), &RayCast2D::set_collision_mask_bit); + ClassDB::bind_method(D_METHOD("get_collision_mask_bit", "bit"), &RayCast2D::get_collision_mask_bit); + ClassDB::bind_method(D_METHOD("set_type_mask", "mask"), &RayCast2D::set_type_mask); ClassDB::bind_method(D_METHOD("get_type_mask"), &RayCast2D::get_type_mask); diff --git a/scene/2d/ray_cast_2d.h b/scene/2d/ray_cast_2d.h index da1be84307..c13ddfdc58 100644 --- a/scene/2d/ray_cast_2d.h +++ b/scene/2d/ray_cast_2d.h @@ -64,6 +64,9 @@ public: void set_collision_mask(uint32_t p_mask); uint32_t get_collision_mask() const; + void set_collision_mask_bit(int p_bit, bool p_value); + bool get_collision_mask_bit(int p_bit) const; + void set_type_mask(uint32_t p_mask); uint32_t get_type_mask() const; diff --git a/scene/3d/SCsub b/scene/3d/SCsub index 72739b527e..4008f4f196 100644 --- a/scene/3d/SCsub +++ b/scene/3d/SCsub @@ -7,6 +7,9 @@ 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/scenario_fx.cpp") else: env.add_source_files(env.scene_sources, "*.cpp") diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 296bddf0a3..9f61cc64ea 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -63,6 +63,21 @@ void RayCast::set_type_mask(uint32_t p_mask) { type_mask = p_mask; } +void RayCast::set_collision_mask_bit(int p_bit, bool p_value) { + + uint32_t mask = get_collision_mask(); + if (p_value) + mask |= 1 << p_bit; + else + mask &= ~(1 << p_bit); + set_collision_mask(mask); +} + +bool RayCast::get_collision_mask_bit(int p_bit) const { + + return get_collision_mask() & (1 << p_bit); +} + uint32_t RayCast::get_type_mask() const { return type_mask; @@ -248,6 +263,9 @@ void RayCast::_bind_methods() { ClassDB::bind_method(D_METHOD("set_collision_mask", "mask"), &RayCast::set_collision_mask); ClassDB::bind_method(D_METHOD("get_collision_mask"), &RayCast::get_collision_mask); + ClassDB::bind_method(D_METHOD("set_collision_mask_bit", "bit", "value"), &RayCast::set_collision_mask_bit); + ClassDB::bind_method(D_METHOD("get_collision_mask_bit", "bit"), &RayCast::get_collision_mask_bit); + ClassDB::bind_method(D_METHOD("set_type_mask", "mask"), &RayCast::set_type_mask); ClassDB::bind_method(D_METHOD("get_type_mask"), &RayCast::get_type_mask); diff --git a/scene/3d/ray_cast.h b/scene/3d/ray_cast.h index cd3cf3c913..cac1596264 100644 --- a/scene/3d/ray_cast.h +++ b/scene/3d/ray_cast.h @@ -72,6 +72,9 @@ public: void set_collision_mask(uint32_t p_mask); uint32_t get_collision_mask() const; + void set_collision_mask_bit(int p_bit, bool p_value); + bool get_collision_mask_bit(int p_bit) const; + void set_type_mask(uint32_t p_mask); uint32_t get_type_mask() const; diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/nine_patch_rect.cpp index 92c34dd3f9..c02d80bba8 100644 --- a/scene/gui/patch_9_rect.cpp +++ b/scene/gui/nine_patch_rect.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* patch_9_rect.cpp */ +/* nine_patch_rect.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "patch_9_rect.h" +#include "nine_patch_rect.h" #include "servers/visual_server.h" diff --git a/scene/gui/patch_9_rect.h b/scene/gui/nine_patch_rect.h index 808b7a1f5d..809daf9db3 100644 --- a/scene/gui/patch_9_rect.h +++ b/scene/gui/nine_patch_rect.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* patch_9_rect.h */ +/* nine_patch_rect.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -27,8 +27,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef PATCH_9_FRAME_H -#define PATCH_9_FRAME_H +#ifndef NINE_PATCH_RECT_H +#define NINE_PATCH_RECT_H #include "scene/gui/control.h" /** @@ -81,4 +81,4 @@ public: }; VARIANT_ENUM_CAST(NinePatchRect::AxisStretchMode) -#endif // PATCH_9_FRAME_H +#endif // NINE_PATCH_RECT_H diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 977ba2da7c..acf6d55eb5 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -734,7 +734,7 @@ void TextEdit::_notification(int p_what) { if (str.length() == 0) { // draw line background if empty as we won't loop at at all - if (line == cursor.line) { + if (line == cursor.line && highlight_current_line) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_end, get_row_height()), cache.current_line_color); } @@ -965,7 +965,7 @@ void TextEdit::_notification(int p_what) { //current line highlighting bool in_selection = (selection.active && line >= selection.from_line && line <= selection.to_line && (line > selection.from_line || j >= selection.from_column) && (line < selection.to_line || j < selection.to_column)); - if (line == cursor.line) { + if (line == cursor.line && highlight_current_line) { // if its the first char draw behind line numbers if (j == 0) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, (char_ofs + char_margin), get_row_height()), cache.current_line_color); @@ -4732,6 +4732,15 @@ int TextEdit::get_breakpoint_gutter_width() const { return cache.breakpoint_gutter_width; } +void TextEdit::set_highlight_current_line(bool p_enabled) { + highlight_current_line = p_enabled; + update(); +} + +bool TextEdit::is_highlight_current_line_enabled() const { + return highlight_current_line; +} + bool TextEdit::is_text_field() const { return true; @@ -4859,6 +4868,9 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_syntax_coloring", "enable"), &TextEdit::set_syntax_coloring); ClassDB::bind_method(D_METHOD("is_syntax_coloring_enabled"), &TextEdit::is_syntax_coloring_enabled); + ClassDB::bind_method(D_METHOD("set_highlight_current_line", "enabled"), &TextEdit::set_highlight_current_line); + ClassDB::bind_method(D_METHOD("is_highlight_current_line_enabled"), &TextEdit::is_highlight_current_line_enabled); + ClassDB::bind_method(D_METHOD("set_smooth_scroll_enable", "enable"), &TextEdit::set_smooth_scroll_enabled); ClassDB::bind_method(D_METHOD("is_smooth_scroll_enabled"), &TextEdit::is_smooth_scroll_enabled); ClassDB::bind_method(D_METHOD("set_v_scroll_speed", "speed"), &TextEdit::set_v_scroll_speed); @@ -4870,6 +4882,7 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("menu_option", "option"), &TextEdit::menu_option); ClassDB::bind_method(D_METHOD("get_menu"), &TextEdit::get_menu); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_current_line"), "set_highlight_current_line", "is_highlight_current_line_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "syntax_highlighting"), "set_syntax_coloring", "is_syntax_coloring_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), "set_show_line_numbers", "is_show_line_numbers_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_all_occurrences"), "set_highlight_all_occurrences", "is_highlight_all_occurrences_enabled"); @@ -4991,6 +5004,7 @@ TextEdit::TextEdit() { auto_brace_completion_enabled = false; brace_matching_enabled = false; highlight_all_occurrences = false; + highlight_current_line = false; indent_using_spaces = false; space_indent = " "; auto_indent = false; diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 03f412729d..b4b14d0139 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -253,6 +253,7 @@ class TextEdit : public Control { bool scroll_past_end_of_file_enabled; bool auto_brace_completion_enabled; bool brace_matching_enabled; + bool highlight_current_line; bool auto_indent; bool cut_copy_line; bool insert_mode; @@ -514,6 +515,9 @@ public: void set_show_line_numbers(bool p_show); bool is_show_line_numbers_enabled() const; + void set_highlight_current_line(bool p_enabled); + bool is_highlight_current_line_enabled() const; + void set_line_numbers_zero_padded(bool p_zero_padded); void set_show_line_length_guideline(bool p_show); diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 75268aad1f..4d3e2c709c 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -86,7 +86,7 @@ #include "scene/gui/option_button.h" #include "scene/gui/panel.h" #include "scene/gui/panel_container.h" -#include "scene/gui/patch_9_rect.h" +#include "scene/gui/nine_patch_rect.h" #include "scene/gui/popup_menu.h" #include "scene/gui/progress_bar.h" #include "scene/gui/reference_rect.h" @@ -152,6 +152,10 @@ #include "scene/resources/world_2d.h" #include "scene/scene_string_names.h" +#include "scene/3d/particles.h" +#include "scene/3d/scenario_fx.h" +#include "scene/3d/spatial.h" + #ifndef _3D_DISABLED #include "scene/3d/area.h" #include "scene/3d/arvr_nodes.h" @@ -169,7 +173,6 @@ #include "scene/3d/multimesh_instance.h" #include "scene/3d/navigation.h" #include "scene/3d/navigation_mesh.h" -#include "scene/3d/particles.h" #include "scene/3d/path.h" #include "scene/3d/physics_body.h" #include "scene/3d/physics_joint.h" @@ -180,9 +183,7 @@ #include "scene/3d/reflection_probe.h" #include "scene/3d/remote_transform.h" #include "scene/3d/room_instance.h" -#include "scene/3d/scenario_fx.h" #include "scene/3d/skeleton.h" -#include "scene/3d/spatial.h" #include "scene/3d/sprite_3d.h" #include "scene/3d/vehicle_body.h" #include "scene/3d/visibility_notifier.h" @@ -551,7 +552,9 @@ void register_scene_types() { ClassDB::register_class<AudioStreamPlayer>(); ClassDB::register_class<AudioStreamPlayer2D>(); +#ifndef _3D_DISABLED ClassDB::register_class<AudioStreamPlayer3D>(); +#endif ClassDB::register_virtual_class<VideoStream>(); ClassDB::register_class<AudioStreamSample>(); diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 910a2ad2fd..232f690074 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -1165,6 +1165,11 @@ void Environment::_bind_methods() { BIND_ENUM_CONSTANT(DOF_BLUR_QUALITY_MEDIUM); BIND_ENUM_CONSTANT(DOF_BLUR_QUALITY_HIGH); + BIND_ENUM_CONSTANT(SSAO_BLUR_DISABLED); + BIND_ENUM_CONSTANT(SSAO_BLUR_1x1); + BIND_ENUM_CONSTANT(SSAO_BLUR_2x2); + BIND_ENUM_CONSTANT(SSAO_BLUR_3x3); + BIND_ENUM_CONSTANT(SSAO_QUALITY_LOW); BIND_ENUM_CONSTANT(SSAO_QUALITY_MEDIUM); BIND_ENUM_CONSTANT(SSAO_QUALITY_HIGH); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index b22a019319..898a594498 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -377,7 +377,7 @@ void SpatialMaterial::_update_shader() { case DIFFUSE_TOON: code += ",diffuse_toon"; break; } switch (specular_mode) { - case SPECULAR_GGX: code += ",specular_ggx"; break; + case SPECULAR_SCHLICK_GGX: code += ",specular_schlick_ggx"; break; case SPECULAR_BLINN: code += ",specular_blinn"; break; case SPECULAR_PHONG: code += ",specular_phong"; break; case SPECULAR_TOON: code += ",specular_toon"; break; @@ -1819,7 +1819,7 @@ void SpatialMaterial::_bind_methods() { ADD_GROUP("Parameters", "params_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_diffuse_mode", PROPERTY_HINT_ENUM, "Burley,Lambert,Lambert Wrap,Oren Nayar,Toon"), "set_diffuse_mode", "get_diffuse_mode"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "params_specular_mode", PROPERTY_HINT_ENUM, "GGX,Blinn,Phong,Toon,Disabled"), "set_specular_mode", "get_specular_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "params_specular_mode", PROPERTY_HINT_ENUM, "SchlickGGX,Blinn,Phong,Toon,Disabled"), "set_specular_mode", "get_specular_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_blend_mode", PROPERTY_HINT_ENUM, "Mix,Add,Sub,Mul"), "set_blend_mode", "get_blend_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_cull_mode", PROPERTY_HINT_ENUM, "Back,Front,Disabled"), "set_cull_mode", "get_cull_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_depth_draw_mode", PROPERTY_HINT_ENUM, "Opaque Only,Always,Never,Opaque Pre-Pass"), "set_depth_draw_mode", "get_depth_draw_mode"); @@ -2006,7 +2006,7 @@ void SpatialMaterial::_bind_methods() { BIND_ENUM_CONSTANT(DIFFUSE_OREN_NAYAR); BIND_ENUM_CONSTANT(DIFFUSE_TOON); - BIND_ENUM_CONSTANT(SPECULAR_GGX); + BIND_ENUM_CONSTANT(SPECULAR_SCHLICK_GGX); BIND_ENUM_CONSTANT(SPECULAR_BLINN); BIND_ENUM_CONSTANT(SPECULAR_PHONG); BIND_ENUM_CONSTANT(SPECULAR_TOON); @@ -2087,7 +2087,7 @@ SpatialMaterial::SpatialMaterial() flags[i] = 0; } diffuse_mode = DIFFUSE_LAMBERT; - specular_mode = SPECULAR_GGX; + specular_mode = SPECULAR_SCHLICK_GGX; for (int i = 0; i < FEATURE_MAX; i++) { features[i] = false; diff --git a/scene/resources/material.h b/scene/resources/material.h index 942fb42363..2425f1a174 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -193,7 +193,7 @@ public: }; enum SpecularMode { - SPECULAR_GGX, + SPECULAR_SCHLICK_GGX, SPECULAR_BLINN, SPECULAR_PHONG, SPECULAR_TOON, diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp index bd8a67c0a3..7489ca7e3e 100644 --- a/servers/visual/shader_types.cpp +++ b/servers/visual/shader_types.cpp @@ -159,7 +159,7 @@ ShaderTypes::ShaderTypes() { shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_burley"); shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_toon"); - shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_ggx"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_schlick_ggx"); shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_blinn"); shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_phong"); shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_toon"); |