From 413f4db585bdf1a4680796c91d3357fa3dbc2f7c Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Tue, 28 Aug 2018 20:38:47 +0200 Subject: [PATCH 001/146] BuildSystem: Fix font list We want to add the individual strings to the list and not add a list object to the list. Without this patch, sorting failed because "str < list" is not a valid operation in python. (cherry picked from commit f3125823268c414e7538d440cffe3c8a95294cad) --- editor/SCsub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/SCsub b/editor/SCsub index 8709d8618cc..36ca0b2425e 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -448,7 +448,7 @@ if env['tools']: # Fonts flist = glob.glob(path + "/../thirdparty/fonts/*.ttf") - flist.append(glob.glob(path + "/../thirdparty/fonts/*.otf")) + flist.extend(glob.glob(path + "/../thirdparty/fonts/*.otf")) env.Depends('#editor/builtin_fonts.gen.h', flist) env.CommandNoCache('#editor/builtin_fonts.gen.h', flist, make_fonts_header) From 1fae776445fa6408deaf15db85dceea0fc5ef995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 23 Sep 2018 13:58:58 +0200 Subject: [PATCH 002/146] Fix GeometryInstance extra_cull_margin step Fixes #22369. (cherry picked from commit d4c75e608e55e955d5727369b8f9b747ea5482db) --- scene/3d/visual_instance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 7585e5c4295..2517cb72f83 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -278,7 +278,7 @@ void GeometryInstance::_bind_methods() { ADD_GROUP("Geometry", ""); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_override", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,SpatialMaterial"), "set_material_override", "get_material_override"); ADD_PROPERTY(PropertyInfo(Variant::INT, "cast_shadow", PROPERTY_HINT_ENUM, "Off,On,Double-Sided,Shadows Only"), "set_cast_shadows_setting", "get_cast_shadows_setting"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "extra_cull_margin", PROPERTY_HINT_RANGE, "0,16384,0"), "set_extra_cull_margin", "get_extra_cull_margin"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "extra_cull_margin", PROPERTY_HINT_RANGE, "0,16384,0.01"), "set_extra_cull_margin", "get_extra_cull_margin"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "use_in_baked_light"), "set_flag", "get_flag", FLAG_USE_BAKED_LIGHT); ADD_GROUP("LOD", "lod_"); From 68148b16d348884ee844079d76d5b1bce11019cd Mon Sep 17 00:00:00 2001 From: Jared Date: Wed, 5 Dec 2018 18:31:00 +0200 Subject: [PATCH 003/146] Documented set_point_cloud() for ConvexPolygonShape2D (cherry picked from commit 1d238c18351f7c2b21a989d459b88a2f5ecd1b57) --- doc/classes/ConvexPolygonShape2D.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml index 84eb809151e..e14544c8306 100644 --- a/doc/classes/ConvexPolygonShape2D.xml +++ b/doc/classes/ConvexPolygonShape2D.xml @@ -18,7 +18,7 @@ - Currently, this method does nothing. + Based on the set of points provided, this creates and assigns the [member points] property using the convex hull algorithm. Removing all unneeded points. See [method Geometry.convex_hull_2d] for details. From 3daca13f72d9d8dbe5f76d05e3e175670932c6cc Mon Sep 17 00:00:00 2001 From: Poommetee Ketson Date: Fri, 11 Jan 2019 10:12:13 +0700 Subject: [PATCH 004/146] Fix error explanation in core_bind Thread::_start_func (cherry picked from commit 2caaa7c97d5b320bf0ee71a46be2f06b02163740) --- core/bind/core_bind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index c44da6757fb..409a6fe3d2c 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -2302,7 +2302,7 @@ void _Thread::_start_func(void *ud) { } break; case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { - reason = "Too Many Arguments"; + reason = "Too Few Arguments"; } break; case Variant::CallError::CALL_ERROR_INVALID_METHOD: { From adb9815199b3416fc841b453e2a53dde622300fa Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 20 Mar 2019 17:55:09 +0100 Subject: [PATCH 005/146] Add support for new MSBuild directory naming introduced in VS 2019. (cherry picked from commit 7440295ad1cd94b4066733cc20680429ca690f2d) --- modules/mono/utils/mono_reg_utils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp index 14401f02ef0..fe4f73e0275 100644 --- a/modules/mono/utils/mono_reg_utils.cpp +++ b/modules/mono/utils/mono_reg_utils.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "mono_reg_utils.h" +#include "core/os/dir_access.h" #ifdef WINDOWS_ENABLED @@ -202,6 +203,13 @@ String find_msbuild_tools_path() { val += "\\"; } + // Since VS2019, the directory is simply named "Current" + String msBuildDirectory = val + "MSBuild\\Current\\Bin"; + if (DirAccess::exists(msBuildDirectory)) { + return msBuildDirectory; + } + + // Directory name "15.0" is used in VS 2017 return val + "MSBuild\\15.0\\Bin"; } } From 64a7a6b2f4e8501af92b66ef026c47fc1184d16d Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Sat, 6 Apr 2019 01:32:41 +0200 Subject: [PATCH 006/146] Mono: Buildsystem support for finding MSBuild from VS2019 (cherry picked from commit e82b2def8e8eabe7c1be37743bd8f0f7bd671763) --- modules/mono/mono_reg_utils.py | 14 ++++++++++---- modules/mono/utils/mono_reg_utils.cpp | 6 +++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/mono/mono_reg_utils.py b/modules/mono/mono_reg_utils.py index c8ebb54ded9..583708bf072 100644 --- a/modules/mono/mono_reg_utils.py +++ b/modules/mono/mono_reg_utils.py @@ -40,7 +40,7 @@ def _reg_open_key_bits(key, subkey, bits): def _find_mono_in_reg(subkey, bits): try: with _reg_open_key_bits(winreg.HKEY_LOCAL_MACHINE, subkey, bits) as hKey: - value, regtype = winreg.QueryValueEx(hKey, 'SdkInstallRoot') + value = winreg.QueryValueEx(hKey, 'SdkInstallRoot')[0] return value except (WindowsError, OSError): return None @@ -49,7 +49,7 @@ def _find_mono_in_reg(subkey, bits): def _find_mono_in_reg_old(subkey, bits): try: with _reg_open_key_bits(winreg.HKEY_LOCAL_MACHINE, subkey, bits) as hKey: - default_clr, regtype = winreg.QueryValueEx(hKey, 'DefaultCLR') + default_clr = winreg.QueryValueEx(hKey, 'DefaultCLR')[0] if default_clr: return _find_mono_in_reg(subkey + '\\' + default_clr, bits) return None @@ -91,7 +91,13 @@ def find_msbuild_tools_path_reg(): if not val: raise ValueError('Value of `installationPath` entry is empty') - return os.path.join(val, "MSBuild\\15.0\\Bin") + # Since VS2019, the directory is simply named "Current" + msbuild_dir = os.path.join(val, 'MSBuild\\Current\\Bin') + if os.path.isdir(msbuild_dir): + return msbuild_dir + + # Directory name "15.0" is used in VS 2017 + return os.path.join(val, 'MSBuild\\15.0\\Bin') raise ValueError('Cannot find `installationPath` entry') except ValueError as e: @@ -106,7 +112,7 @@ def find_msbuild_tools_path_reg(): try: subkey = r'SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0' with _reg_open_key(winreg.HKEY_LOCAL_MACHINE, subkey) as hKey: - value, regtype = winreg.QueryValueEx(hKey, 'MSBuildToolsPath') + value = winreg.QueryValueEx(hKey, 'MSBuildToolsPath')[0] return value except (WindowsError, OSError): return '' diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp index fe4f73e0275..9d4df413243 100644 --- a/modules/mono/utils/mono_reg_utils.cpp +++ b/modules/mono/utils/mono_reg_utils.cpp @@ -204,9 +204,9 @@ String find_msbuild_tools_path() { } // Since VS2019, the directory is simply named "Current" - String msBuildDirectory = val + "MSBuild\\Current\\Bin"; - if (DirAccess::exists(msBuildDirectory)) { - return msBuildDirectory; + String msbuild_dir = val + "MSBuild\\Current\\Bin"; + if (DirAccess::exists(msbuild_dir)) { + return msbuild_dir; } // Directory name "15.0" is used in VS 2017 From 67a72a27592ddf3f363f7af252a6a627993bc5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 15 Apr 2019 17:10:33 +0200 Subject: [PATCH 007/146] doc: Add note about VisibilityNotifier.is_on_screen after instantiation Fixes #9430. (cherry picked from commit 3fc1f7dfbeb038ca7db8da637b67282c800b492e) --- doc/classes/VisibilityNotifier.xml | 3 ++- doc/classes/VisibilityNotifier2D.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/classes/VisibilityNotifier.xml b/doc/classes/VisibilityNotifier.xml index c689017aff0..c5dfc5b51bc 100644 --- a/doc/classes/VisibilityNotifier.xml +++ b/doc/classes/VisibilityNotifier.xml @@ -15,7 +15,8 @@ - If [code]true[/code] the bounding box is on the screen. + If [code]true[/code], the bounding box is on the screen. + Note: It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass. diff --git a/doc/classes/VisibilityNotifier2D.xml b/doc/classes/VisibilityNotifier2D.xml index caf4aaa372f..7d941618bda 100644 --- a/doc/classes/VisibilityNotifier2D.xml +++ b/doc/classes/VisibilityNotifier2D.xml @@ -15,7 +15,8 @@ - If [code]true[/code] the bounding rectangle is on the screen. + If [code]true[/code], the bounding rectangle is on the screen. + Note: It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass. From 197ea385526a9403839cdcd5389b9f637cb9f9ea Mon Sep 17 00:00:00 2001 From: Soham Kar Date: Wed, 17 Apr 2019 22:51:51 +0530 Subject: [PATCH 008/146] Fixed copy&paste error #28117 Changed "left to right" in VSplitContainer to "top to bottom". (cherry picked from commit aa8b2f444801f1dccbceaab797d6aa9e0dc9af90) --- doc/classes/VSplitContainer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/VSplitContainer.xml b/doc/classes/VSplitContainer.xml index 98f71ae28fb..22666346aa4 100644 --- a/doc/classes/VSplitContainer.xml +++ b/doc/classes/VSplitContainer.xml @@ -4,7 +4,7 @@ Vertical split container. - Vertical split container. See [SplitContainer]. This goes from left to right. + Vertical split container. See [SplitContainer]. This goes from top to bottom. From 3066616e1a3c3547a949f140adab2ec7fb42b6c9 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sat, 27 Apr 2019 10:45:04 -0700 Subject: [PATCH 009/146] changed references to array types in arraymesh doc (cherry picked from commit e8858a9a44a600d0c0963fd357025f95c9e69856) --- doc/classes/ArrayMesh.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index 5cc59d1d150..1aaa4d4bb5a 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -228,31 +228,31 @@ Amount of weights/bone indices per vertex (always 4). - Vertex array (array of [Vector3] vertices). + [PoolVector3Array], [PoolVector2Array], or [Array] of vertex positions. - Normal array (array of [Vector3] normals). + [PoolVector3Array] of vertex normals. - Tangent array, array of groups of 4 floats. first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. + [PoolRealArray] of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. - Vertex array (array of [Color] colors). + [PoolColorArray] of vertex colors. - UV array (array of [Vector3] UVs or float array of groups of 2 floats (u,v)). + [PoolVector2Array] for UV coordinates. - Second UV array (array of [Vector3] UVs or float array of groups of 2 floats (u,v)). + [PoolVector2Array] for second UV coordinates. - Array of bone indices, as a float array. Each element in groups of 4 floats. + [PoolRealArray] or [PoolIntArray] of bone indices. Each element in groups of 4 floats. - Array of bone weights, as a float array. Each element in groups of 4 floats. + [PoolRealArray] of bone weights. Each element in groups of 4 floats. - [Array] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. + [PoolIntArray] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line. From 768f5fd1ac384ad92d1be295f5ca1205a69fbf01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Proch=C3=A1zka?= Date: Tue, 30 Apr 2019 22:32:02 +0200 Subject: [PATCH 010/146] Small documentation improvements (cherry picked from commit 04b49264f2d752c32a4bb771367e78ca2f44b447) --- doc/classes/Camera.xml | 2 +- doc/classes/Path2D.xml | 1 + doc/classes/Vector2.xml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml index 7e246ed079d..888ff34cd8b 100644 --- a/doc/classes/Camera.xml +++ b/doc/classes/Camera.xml @@ -156,7 +156,7 @@ Perspective Projection (object's size on the screen becomes smaller when far away). - Orthogonal Projection (objects remain the same size on the screen no matter how far away they are). + Orthogonal Projection (objects remain the same size on the screen no matter how far away they are; also known as orthographic projection). Preserves the horizontal aspect ratio. diff --git a/doc/classes/Path2D.xml b/doc/classes/Path2D.xml index 6967f96b85f..f3f04c0da5d 100644 --- a/doc/classes/Path2D.xml +++ b/doc/classes/Path2D.xml @@ -5,6 +5,7 @@ Can have [PathFollow2D] child-nodes moving along the [Curve2D]. See [PathFollow2D] for more information on this usage. + Note that the path is considered as relative to the moved nodes (children of [PathFollow2D]) - usually the curve should start with a zero vector (0, 0). diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 83358545315..877b5e27c4b 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -191,7 +191,7 @@ - Returns the vector rotated by [code]phi[/code] radians. + Returns the vector rotated by [code]phi[/code] radians. See also [method @GDScript.deg2rad]. From 2ccca78929c41ba82d8933207ade8e52d6de77c7 Mon Sep 17 00:00:00 2001 From: lopho Date: Thu, 2 May 2019 15:43:28 +0200 Subject: [PATCH 011/146] Document CollisionObject2D pickable requires collision_layer Documents CollisionObject2D mouse_entered, mouse_exited and input_event requiring at least one collision_layer to be set. (cherry picked from commit da73bcca6fcfab16dbf06ebbf62f5b34b1ee19d5) --- doc/classes/CollisionObject2D.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml index 67fd6d93147..cf0f33570b1 100644 --- a/doc/classes/CollisionObject2D.xml +++ b/doc/classes/CollisionObject2D.xml @@ -199,7 +199,7 @@ - If [code]true[/code] this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. + If [code]true[/code], this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one [code]collision_layer[/code] bit to be set. @@ -211,17 +211,17 @@ - Emitted when an input event occurs and [code]input_pickable[/code] is [code]true[/code]. See [method _input_event] for details. + 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 the mouse pointer enters any of this object's shapes. + 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 exits all this object's shapes. + 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. From b977e8ab0c752763b0972a16206dc86ca96ea9b1 Mon Sep 17 00:00:00 2001 From: Thomas Karcher Date: Fri, 3 May 2019 10:49:54 +0200 Subject: [PATCH 012/146] Update of RigidBody2D class description Added a hint in the RigidBody2D class description regarding the transformation issue mentioned in https://github.com/godotengine/godot/issues/5734 (cherry picked from commit 1170b78e2842e540f08ff40cba61eeb83324edec) --- doc/classes/RigidBody2D.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 6144773dba9..019ad9923f1 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -7,7 +7,8 @@ This node implements simulated 2D physics. You do not control a RigidBody2D directly. Instead you apply forces to it (gravity, impulses, etc.) and the physics simulation calculates the resulting movement based on its mass, friction, and other physical properties. A RigidBody2D has 4 behavior [member mode]s: Rigid, Static, Character, and Kinematic. [b]Note:[/b] You should not change a RigidBody2D's [code]position[/code] or [code]linear_velocity[/code] every frame or even very often. If you need to directly affect the body's state, use [method _integrate_forces], which allows you to directly access the physics state. - If you need to override the default physics behavior, you can write a custom force integration. See [member custom_integrator]. + Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime. + If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See [member custom_integrator]. From 5a89810238db6bac75a41102174298591fa303f7 Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Wed, 21 Mar 2018 23:58:40 -0300 Subject: [PATCH 013/146] Fix missing const in CapsuleShapeSW::get_area (cherry picked from commit 9042ef3836925e6185165668d1b1640e35879760) --- servers/physics/shape_sw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/physics/shape_sw.h b/servers/physics/shape_sw.h index dd00e5428e0..f18d99404d6 100644 --- a/servers/physics/shape_sw.h +++ b/servers/physics/shape_sw.h @@ -238,7 +238,7 @@ public: _FORCE_INLINE_ real_t get_height() const { return height; } _FORCE_INLINE_ real_t get_radius() const { return radius; } - virtual real_t get_area() { return 4.0 / 3.0 * Math_PI * radius * radius * radius + height * Math_PI * radius * radius; } + virtual real_t get_area() const { return 4.0 / 3.0 * Math_PI * radius * radius * radius + height * Math_PI * radius * radius; } virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_CAPSULE; } From ac1520325ce4b492fa734629aa34818d2b35b007 Mon Sep 17 00:00:00 2001 From: Bernhard Liebl Date: Mon, 15 Jan 2018 09:20:45 +0100 Subject: [PATCH 014/146] Catch NSException in macOS run loop to prevent crashs (cherry picked from commit 3ff18ee61e4a29c58a106b28bd0f1787f408eba8) --- platform/osx/os_osx.mm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 5bba557b926..95b8091597c 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -2219,12 +2219,21 @@ void OS_OSX::run() { //int frames=0; //uint64_t frame=0; - while (!force_quit) { + bool quit = false; - process_events(); // get rid of pending events - joypad_osx->process_joypads(); - if (Main::iteration() == true) - break; + while (!force_quit && !quit) { + + @try { + + process_events(); // get rid of pending events + joypad_osx->process_joypads(); + + if (Main::iteration() == true) { + quit = true; + } + } @catch (NSException *exception) { + ERR_PRINTS("NSException: " + String([exception reason].UTF8String)); + } }; main_loop->finish(); From 3d5c5c28d5faf9129a025f602ebb7c4a872336c4 Mon Sep 17 00:00:00 2001 From: Markus Ewald Date: Sun, 4 Mar 2018 14:20:59 +0100 Subject: [PATCH 015/146] Implement VisualServerScene::instance_set_extra_visibility_margin() method to actually apply extra culling margin and mark instance AABB dirty (cherry picked from commit fc166f3ee1c48b1064e380219342cdd6e1cfb525) --- servers/visual/visual_server_scene.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 85fb23e6fd8..c3bc5355b49 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -730,6 +730,11 @@ void VisualServerScene::instance_set_exterior(RID p_instance, bool p_enabled) { } void VisualServerScene::instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) { + Instance *instance = instance_owner.get(p_instance); + ERR_FAIL_COND(!instance); + + instance->extra_margin = p_margin; + _instance_queue_update(instance, true, false); } Vector VisualServerScene::instances_cull_aabb(const AABB &p_aabb, RID p_scenario) const { From 3fcdb3198b4dd76705f96fc9f06976f2d9e24257 Mon Sep 17 00:00:00 2001 From: sheepandshepherd Date: Tue, 10 Apr 2018 16:01:13 +0200 Subject: [PATCH 016/146] Fix NativeScript property list (cherry picked from commit bc110b37713dc41ec6b364f3d31eaf2b369e06bb) --- modules/gdnative/nativescript/nativescript.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 772a2a06543..ced60acac47 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -358,14 +358,13 @@ void NativeScript::get_script_property_list(List *p_list) const { NativeScriptDesc *script_data = get_script_desc(); Set existing_properties; + List::Element *original_back = p_list->back(); while (script_data) { - List::Element *insert_position = p_list->front(); - bool insert_before = true; + List::Element *insert_position = original_back; for (OrderedHashMap::Element E = script_data->properties.front(); E; E = E.next()) { if (!existing_properties.has(E.key())) { - insert_position = insert_before ? p_list->insert_before(insert_position, E.get().info) : p_list->insert_after(insert_position, E.get().info); - insert_before = false; + insert_position = p_list->insert_after(insert_position, E.get().info); existing_properties.insert(E.key()); } } From cc8e1e93c35dbc6a5d592f6690d8dd0a1b6805a2 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 22 Apr 2018 04:16:55 -0400 Subject: [PATCH 017/146] Fixed 2D intersect_shape limiting broadphase results Physics2DDirectSpaceStateSW was applying the result limit to broadphase collision detection instead of narrow. This is inconsistent with its 3D variant, as well as the rest of the 2D direct space state functions. Broadphase is now limited by INTERSECTION_QUERY_MAX like everything else, and narrow phase is exited early when the result limit has been reached. (cherry picked from commit 1ba106a71e6c0550ebf95d9563995d0266cfecb1) --- servers/physics_2d/space_2d_sw.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index aec73bc5c51..c35bc4f83d8 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -180,12 +180,15 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Trans Rect2 aabb = p_xform.xform(shape->get_aabb()); aabb = aabb.grow(p_margin); - int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, p_result_max, space->intersection_query_subindex_results); + int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space2DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results); int cc = 0; for (int i = 0; i < amount; i++) { + if (cc >= p_result_max) + break; + if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask)) continue; From 6c9bddef53a05873040eb3d90ff9c597a598727b Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Tue, 24 Apr 2018 10:50:05 +0700 Subject: [PATCH 018/146] Fix Node2D::global_position to have Vector2 type (cherry picked from commit 8619b0d2801b74d258c553f6dcda58e086a1a50c) --- scene/2d/node_2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index f7e71d8136b..eef0de7b187 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -443,7 +443,7 @@ void Node2D::_bind_methods() { ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2, "scale"), "set_scale", "get_scale"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform", PROPERTY_HINT_NONE, "", 0), "set_transform", "get_transform"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_position", PROPERTY_HINT_NONE, "", 0), "set_global_position", "get_global_position"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_position", PROPERTY_HINT_NONE, "", 0), "set_global_position", "get_global_position"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rotation", PROPERTY_HINT_NONE, "", 0), "set_global_rotation", "get_global_rotation"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rotation_degrees", PROPERTY_HINT_NONE, "", 0), "set_global_rotation_degrees", "get_global_rotation_degrees"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_scale", PROPERTY_HINT_NONE, "", 0), "set_global_scale", "get_global_scale"); From dfb839ebce0da290f21ae9a9e8b256524c67d37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 1 May 2018 10:46:05 +0200 Subject: [PATCH 019/146] Fix Node2D::global_scale's PropertyInfo type Was missed in #18391. (cherry picked from commit 8852ca14550d367947dfda2246865d50faa36bbe) --- scene/2d/node_2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index eef0de7b187..d225ed461cf 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -446,7 +446,7 @@ void Node2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_position", PROPERTY_HINT_NONE, "", 0), "set_global_position", "get_global_position"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rotation", PROPERTY_HINT_NONE, "", 0), "set_global_rotation", "get_global_rotation"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rotation_degrees", PROPERTY_HINT_NONE, "", 0), "set_global_rotation_degrees", "get_global_rotation_degrees"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_scale", PROPERTY_HINT_NONE, "", 0), "set_global_scale", "get_global_scale"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_scale", PROPERTY_HINT_NONE, "", 0), "set_global_scale", "get_global_scale"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform"); ADD_GROUP("Z Index", ""); From fdbef334bbe8cbf737db949c45626e3b63345b7f Mon Sep 17 00:00:00 2001 From: Brian Richardson Date: Wed, 2 May 2018 17:03:51 -0700 Subject: [PATCH 020/146] Camera::project_local_ray_normal needs to be virtual so that ARVRCamera::project_local_ray_normal gets called. (cherry picked from commit 680a5cbb0bd8a6753400facc469e3d9126ff92c4) --- scene/3d/camera.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 86bbf236ffd..e7423ddfee5 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -132,9 +132,9 @@ public: virtual Transform get_camera_transform() const; - Vector3 project_ray_normal(const Point2 &p_pos) const; + virtual Vector3 project_ray_normal(const Point2 &p_pos) const; virtual Vector3 project_ray_origin(const Point2 &p_pos) const; - Vector3 project_local_ray_normal(const Point2 &p_pos) const; + virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const; virtual Point2 unproject_position(const Vector3 &p_pos) const; bool is_position_behind(const Vector3 &p_pos) const; virtual Vector3 project_position(const Point2 &p_point) const; From e867befd469253c706215e6bee637c720477ef1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCbner?= Date: Thu, 3 May 2018 13:22:11 +0200 Subject: [PATCH 021/146] Fix delay in rename_error windows save loop, should be 100msec, not 1sec (cherry picked from commit caa887f3176b824b37c37e37e147114dc897af5b) --- drivers/windows/file_access_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index d391f1d89e6..457bd1bc0a8 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -141,7 +141,7 @@ void FileAccessWindows::close() { } if (rename_error) { attempts--; - OS::get_singleton()->delay_usec(1000000); //wait 100msec and try again + OS::get_singleton()->delay_usec(100000); // wait 100msec and try again } } From 9d006730ad852e83d9d73e569c177113069016c3 Mon Sep 17 00:00:00 2001 From: Peter Folkins Date: Fri, 4 May 2018 21:04:39 -0500 Subject: [PATCH 022/146] Fix script editor CTRL+CLICK on singleton functions (cherry picked from commit 0c1a71b0471d30138db00f9a50d3bf4157523586) --- editor/plugins/script_text_editor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 41b4201f4b5..7462970d8af 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -739,6 +739,10 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c _goto_line(p_row); + if (result.class_name.begins_with("_")) { + result.class_name = result.class_name.substr(1, result.class_name.length() - 1); + } + switch (result.type) { case ScriptLanguage::LookupResult::RESULT_SCRIPT_LOCATION: { From d1c93a0af3f9c9e924ba5552177fca2fa30a7aac Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Mon, 7 May 2018 16:05:28 -0400 Subject: [PATCH 023/146] Fix AtlasTexture usage in Sprite3D. Changes as requested in b484d5c. (cherry picked from commit 4b545e3105bb804ac5f412fcd83a9832675475d0) --- scene/3d/sprite_3d.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index dd037ac2c02..fc7a6476aa3 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -366,6 +366,16 @@ void Sprite3D::_draw() { final_rect.position * pixel_size, }; + + Vector2 src_tsize = Vector2(texture->get_width(), texture->get_height()); + + // Properly setup UVs for impostor textures (AtlasTexture). + Ref atlas_tex = texture; + if (atlas_tex != NULL) { + src_tsize[0] = atlas_tex->get_atlas()->get_width(); + src_tsize[1] = atlas_tex->get_atlas()->get_height(); + } + Vector2 uvs[4] = { final_src_rect.position / tsize, (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize, @@ -656,6 +666,16 @@ void AnimatedSprite3D::_draw() { final_rect.position * pixel_size, }; + + Vector2 src_tsize = Vector2(texture->get_width(), texture->get_height()); + + // Properly setup UVs for impostor textures (AtlasTexture). + Ref atlas_tex = texture; + if (atlas_tex != NULL) { + src_tsize[0] = atlas_tex->get_atlas()->get_width(); + src_tsize[1] = atlas_tex->get_atlas()->get_height(); + } + Vector2 uvs[4] = { final_src_rect.position / tsize, (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize, From 46f091bfcb12905e7153ba0f6e02e0823804049a Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Mon, 27 Aug 2018 15:24:56 -0400 Subject: [PATCH 024/146] AtlasTexture fixes, part 2. (cherry picked from commit c522fe05e043057c2232afb6a3385fbc2dd39933) --- scene/3d/sprite_3d.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index fc7a6476aa3..728275b4530 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -367,7 +367,7 @@ void Sprite3D::_draw() { }; - Vector2 src_tsize = Vector2(texture->get_width(), texture->get_height()); + Vector2 src_tsize = tsize; // Properly setup UVs for impostor textures (AtlasTexture). Ref atlas_tex = texture; @@ -377,10 +377,10 @@ void Sprite3D::_draw() { } Vector2 uvs[4] = { - final_src_rect.position / tsize, - (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize, - (final_src_rect.position + final_src_rect.size) / tsize, - (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize, + final_src_rect.position / src_tsize, + (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / src_tsize, + (final_src_rect.position + final_src_rect.size) / src_tsize, + (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / src_tsize, }; if (is_flipped_h()) { @@ -667,7 +667,7 @@ void AnimatedSprite3D::_draw() { }; - Vector2 src_tsize = Vector2(texture->get_width(), texture->get_height()); + Vector2 src_tsize = tsize; // Properly setup UVs for impostor textures (AtlasTexture). Ref atlas_tex = texture; @@ -677,10 +677,10 @@ void AnimatedSprite3D::_draw() { } Vector2 uvs[4] = { - final_src_rect.position / tsize, - (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize, - (final_src_rect.position + final_src_rect.size) / tsize, - (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize, + final_src_rect.position / src_tsize, + (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / src_tsize, + (final_src_rect.position + final_src_rect.size) / src_tsize, + (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / src_tsize, }; if (is_flipped_h()) { From 761bfb156d485bedd0593a20f655bd6e621f8b1b Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Tue, 15 May 2018 14:35:46 +0300 Subject: [PATCH 025/146] Fix a corner-case bug in _copy_texscreen in the gles3 renderer Fixes #17698 (cherry picked from commit ee52d12921aefd51c74ff9d50833e19569b2fb31) --- drivers/gles3/rasterizer_canvas_gles3.cpp | 8 ++++---- drivers/gles3/rasterizer_canvas_gles3.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index c27bd0936f4..5ec5f67c6bd 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -191,11 +191,11 @@ void RasterizerCanvasGLES3::canvas_end() { state.using_ninepatch = false; } -RasterizerStorageGLES3::Texture *RasterizerCanvasGLES3::_bind_canvas_texture(const RID &p_texture, const RID &p_normal_map) { +RasterizerStorageGLES3::Texture *RasterizerCanvasGLES3::_bind_canvas_texture(const RID &p_texture, const RID &p_normal_map, bool p_force) { RasterizerStorageGLES3::Texture *tex_return = NULL; - if (p_texture == state.current_tex) { + if (p_texture == state.current_tex && !p_force) { tex_return = state.current_tex_ptr; } else if (p_texture.is_valid()) { @@ -230,7 +230,7 @@ RasterizerStorageGLES3::Texture *RasterizerCanvasGLES3::_bind_canvas_texture(con state.current_tex_ptr = NULL; } - if (p_normal_map == state.current_normal) { + if (p_normal_map == state.current_normal && !p_force) { //do none state.canvas_shader.set_uniform(CanvasShaderGLES3::USE_DEFAULT_NORMAL, state.current_normal.is_valid()); @@ -997,7 +997,7 @@ void RasterizerCanvasGLES3::_copy_texscreen(const Rect2 &p_rect) { state.using_texture_rect = true; _set_texture_rect_mode(false); - _bind_canvas_texture(state.current_tex, state.current_normal); + _bind_canvas_texture(state.current_tex, state.current_normal, true); glEnable(GL_BLEND); } diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h index 6b8055bb2a8..e21edb30a89 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.h +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -120,7 +120,7 @@ public: virtual void canvas_end(); _FORCE_INLINE_ void _set_texture_rect_mode(bool p_enable, bool p_ninepatch = false); - _FORCE_INLINE_ RasterizerStorageGLES3::Texture *_bind_canvas_texture(const RID &p_texture, const RID &p_normal_map); + _FORCE_INLINE_ RasterizerStorageGLES3::Texture *_bind_canvas_texture(const RID &p_texture, const RID &p_normal_map, bool p_force = false); _FORCE_INLINE_ void _draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color *p_colors, const Vector2 *p_uvs); _FORCE_INLINE_ void _draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor); From 13a90fdd89db07447a527a92ce752c6c23f44ab1 Mon Sep 17 00:00:00 2001 From: nemerle Date: Thu, 17 May 2018 00:35:47 +0200 Subject: [PATCH 026/146] Fix PoolAllocator::resize for too large p_new_size The code had a subtle signed/unsigned bug - ```cpp if( signed - unsigned < 0) // signed - unsigned is unsigned in c++, so if( unsigned < 0) // and thus the if block will never be executed ``` Thus all the following code would be ran, including unnecessary retries of compacting the pool. (cherry picked from commit 2bbe6144ff4eb6b68b8b06144bca21bffdf1e8b5) --- core/pool_allocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index 18efadb1d7e..9f62a873490 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -359,7 +359,7 @@ Error PoolAllocator::resize(ID p_mem, int p_new_size) { //p_new_size = align(p_new_size) int _free = free_mem; // - static_area_size; - if ((_free + aligned(e->len)) - alloc_size < 0) { + if (uint32_t(_free + aligned(e->len)) < alloc_size) { mt_unlock(); ERR_FAIL_V(ERR_OUT_OF_MEMORY); }; From f85b2a62f730c1b4be29ca3bc905e9abdf7f5c1f Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Thu, 17 May 2018 09:07:25 -0300 Subject: [PATCH 027/146] Fix missing return on Navigation2D::get_closest_point_owner (cherry picked from commit b9023715e2d2f522cd4d2c38961486eae68c50af) --- scene/2d/navigation2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index c52b3bdae34..15d497caeaf 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -671,7 +671,7 @@ Object *Navigation2D::get_closest_point_owner(const Vector2 &p_point) { if (Geometry::is_point_in_triangle(p_point, _get_vertex(p.edges[0].point), _get_vertex(p.edges[i - 1].point), _get_vertex(p.edges[i].point))) { - E->get().owner; + return E->get().owner; } } } From 367bec201096b516757b8c325a7fd02f009e1c52 Mon Sep 17 00:00:00 2001 From: Chaosus Date: Thu, 17 May 2018 19:46:03 +0300 Subject: [PATCH 028/146] Fix bug in CubeMesh (cherry picked from commit b3fccc5778dca7bc948c4a9dcb24da9dbb10a846) --- scene/resources/primitive_meshes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 8fbfdafc0b3..8481a50b4c0 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -634,7 +634,7 @@ void CubeMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_subdivide_depth", "divisions"), &CubeMesh::set_subdivide_depth); ClassDB::bind_method(D_METHOD("get_subdivide_depth"), &CubeMesh::get_subdivide_depth); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "size"), "set_size", "get_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_width", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_width", "get_subdivide_width"); ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_height", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_height", "get_subdivide_height"); ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_depth", PROPERTY_HINT_RANGE, "0,100,1"), "set_subdivide_depth", "get_subdivide_depth"); From 12458ebe8cbee2bcc305692f59970aa2c438c3f7 Mon Sep 17 00:00:00 2001 From: volzhs Date: Tue, 22 May 2018 19:58:28 +0900 Subject: [PATCH 029/146] Fix updating mesh when reimporting (cherry picked from commit 9d5e1228eaa1fe0180b23969edda80d3c461f677) --- editor/import/editor_import_collada.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 3312e8e9bfb..fac0d2abbc9 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -339,7 +339,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { NodeMap nm; nm.node = node; node_map[p_node->id] = nm; - node_name_map[p_node->name] = p_node->id; + node_name_map[node->get_name()] = p_node->id; Transform xf = p_node->default_transform; xf = collada.fix_transform(xf) * p_node->post_transform; From a5a9d887da8383e66acf241c98d9c1ef1d705a99 Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 23 May 2018 17:43:56 -0300 Subject: [PATCH 030/146] Fix positive operator in GDScript compiler (cherry picked from commit 3cec24baa850019f9968b4e04e9c79fbddee3b72) --- modules/gdscript/gdscript_compiler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index add3807437c..459416c4646 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -726,6 +726,9 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser:: case GDScriptParser::OperatorNode::OP_NEG: { if (!_create_unary_operator(codegen, on, Variant::OP_NEGATE, p_stack_level)) return -1; } break; + case GDScriptParser::OperatorNode::OP_POS: { + if (!_create_unary_operator(codegen, on, Variant::OP_POSITIVE, p_stack_level)) return -1; + } break; case GDScriptParser::OperatorNode::OP_NOT: { if (!_create_unary_operator(codegen, on, Variant::OP_NOT, p_stack_level)) return -1; } break; From 793a205ae13e3496b1d686e9c4ea4fe8dd820ec0 Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Thu, 24 May 2018 16:10:25 -0400 Subject: [PATCH 031/146] Revert #14753, as it is buggy and no longer necessary. (cherry picked from commit 1198662b2b8aa7458f9d8d3afe66085fdfc0d113) --- scene/main/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 7f82f0ca7ec..5965d711001 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1540,7 +1540,7 @@ void Viewport::_gui_input_event(Ref p_event) { if (mb->is_pressed()) { Size2 pos = mpos; - if (gui.mouse_focus && mb->get_button_index() != gui.mouse_focus_button && mb->get_button_index() == BUTTON_LEFT) { + if (gui.mouse_focus && mb->get_button_index() != gui.mouse_focus_button) { //do not steal mouse focus and stuff From 82e54db588c4eae5a18caf727c4b1949a87e13e2 Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 28 May 2018 12:51:05 +0930 Subject: [PATCH 032/146] Fix for not picking up locale of some .po translation files (cherry picked from commit 1065f06eef57b9c402fb731a94a6f4e69f70804d) --- core/io/translation_loader_po.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 9d9cc136433..0e49d590f21 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -175,7 +175,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S String prop = c.substr(0, p).strip_edges(); String value = c.substr(p + 1, c.length()).strip_edges(); - if (prop == "X-Language") { + if (prop == "X-Language" || prop == "Language") { translation->set_locale(value); } } From 2107517f2fec860ec9acfb1da5467e96986c7af3 Mon Sep 17 00:00:00 2001 From: Oliver Rausch Date: Fri, 1 Jun 2018 01:34:32 +0200 Subject: [PATCH 033/146] Fix return type of isnan and isinf in the shader language (cherry picked from commit 2368b31e1e286b164637e4b379345a2d5036a64e) --- servers/visual/shader_language.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 1b040ab86c3..90c037ab687 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1630,14 +1630,14 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "smoothstep", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC4, TYPE_VOID } }, { "isnan", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID } }, - { "isnan", TYPE_BOOL, { TYPE_VEC2, TYPE_VOID } }, - { "isnan", TYPE_BOOL, { TYPE_VEC3, TYPE_VOID } }, - { "isnan", TYPE_BOOL, { TYPE_VEC4, 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_BOOL, { TYPE_VEC2, TYPE_VOID } }, - { "isinf", TYPE_BOOL, { TYPE_VEC3, TYPE_VOID } }, - { "isinf", TYPE_BOOL, { TYPE_VEC4, 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 } }, From 69f08cd2ccd799c28998856c2a64c879d27c4bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 11 Jun 2018 07:53:25 +0200 Subject: [PATCH 034/146] Fix shortcuts using KEY_MASK_CTRL instead of KEY_MASK_CMD KEY_MASK_CMD is automatically replaced by KEY_MASK_CTRL on non-OSX and KEY_MASK_META (Command key) on OSX, so it should be used for all Ctrl/Cmd + key shortcuts. Also de-hacked the macOS shortcut replacements with proper conditional definition. Not tested on macOS, cannot judge if they are good shortcuts. Fixes #10761. (cherry picked from commit 3f09cac267ad351307b4dfcc7e4276ef4347c459) --- editor/editor_node.cpp | 43 ++++++++++++++++++++++++--- editor/editor_node.h | 2 +- editor/editor_settings.cpp | 26 +--------------- editor/plugins/script_text_editor.cpp | 30 +++++++++++++------ 4 files changed, 62 insertions(+), 39 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8a443b958b2..c007a27068b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2490,7 +2490,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { export_template_manager->popup_manager(); } break; - case SETTINGS_TOGGLE_FULLSCREN: { + case SETTINGS_TOGGLE_FULLSCREEN: { OS::get_singleton()->set_window_fullscreen(!OS::get_singleton()->is_window_fullscreen()); @@ -5058,7 +5058,11 @@ EditorNode::EditorNode() { srt->add_child(tabbar_container); tabbar_container->add_child(scene_tabs); distraction_free = memnew(ToolButton); +#ifdef OSX_ENABLED + distraction_free->set_shortcut(ED_SHORTCUT("editor/distraction_free_mode", TTR("Distraction Free Mode"), KEY_MASK_CMD | KEY_MASK_CTRL | KEY_D)); +#else distraction_free->set_shortcut(ED_SHORTCUT("editor/distraction_free_mode", TTR("Distraction Free Mode"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F11)); +#endif distraction_free->set_tooltip(TTR("Toggle distraction-free mode.")); distraction_free->connect("pressed", this, "_toggle_distraction_free_mode"); distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons")); @@ -5167,7 +5171,7 @@ EditorNode::EditorNode() { 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_CTRL + KEY_W), FILE_CLOSE); + 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(); @@ -5221,7 +5225,7 @@ EditorNode::EditorNode() { #ifdef OSX_ENABLED p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_Q); #else - p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_Q); + p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Q); #endif PanelContainer *editor_region = memnew(PanelContainer); @@ -5270,7 +5274,11 @@ 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_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREN); +#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 + p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREEN); +#endif p->add_separator(); p->add_item(TTR("Manage Export Templates"), SETTINGS_MANAGE_EXPORT_TEMPLATES); @@ -5311,7 +5319,11 @@ EditorNode::EditorNode() { play_button->set_focus_mode(Control::FOCUS_NONE); play_button->connect("pressed", this, "_menu_option", make_binds(RUN_PLAY)); play_button->set_tooltip(TTR("Play the project.")); +#ifdef OSX_ENABLED + play_button->set_shortcut(ED_SHORTCUT("editor/play", TTR("Play"), KEY_MASK_CMD | KEY_B)); +#else play_button->set_shortcut(ED_SHORTCUT("editor/play", TTR("Play"), KEY_F5)); +#endif pause_button = memnew(ToolButton); pause_button->set_toggle_mode(true); @@ -5320,7 +5332,11 @@ EditorNode::EditorNode() { pause_button->set_tooltip(TTR("Pause the scene")); pause_button->set_disabled(true); play_hb->add_child(pause_button); +#ifdef OSX_ENABLED + pause_button->set_shortcut(ED_SHORTCUT("editor/pause_scene", TTR("Pause Scene"), KEY_MASK_CMD | KEY_MASK_CTRL | KEY_Y)); +#else pause_button->set_shortcut(ED_SHORTCUT("editor/pause_scene", TTR("Pause Scene"), KEY_F7)); +#endif stop_button = memnew(ToolButton); play_hb->add_child(stop_button); @@ -5329,7 +5345,11 @@ EditorNode::EditorNode() { stop_button->connect("pressed", this, "_menu_option", make_binds(RUN_STOP)); stop_button->set_tooltip(TTR("Stop the scene.")); stop_button->set_disabled(true); +#ifdef OSX_ENABLED + stop_button->set_shortcut(ED_SHORTCUT("editor/stop", TTR("Stop"), KEY_MASK_CMD | KEY_PERIOD)); +#else stop_button->set_shortcut(ED_SHORTCUT("editor/stop", TTR("Stop"), KEY_F8)); +#endif run_native = memnew(EditorRunNative); play_hb->add_child(run_native); @@ -5347,7 +5367,11 @@ EditorNode::EditorNode() { play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); play_scene_button->connect("pressed", this, "_menu_option", make_binds(RUN_PLAY_SCENE)); play_scene_button->set_tooltip(TTR("Play the edited scene.")); +#ifdef OSX_ENABLED + play_scene_button->set_shortcut(ED_SHORTCUT("editor/play_scene", TTR("Play Scene"), KEY_MASK_CMD | KEY_R)); +#else play_scene_button->set_shortcut(ED_SHORTCUT("editor/play_scene", TTR("Play Scene"), KEY_F6)); +#endif play_custom_scene_button = memnew(ToolButton); play_hb->add_child(play_custom_scene_button); @@ -5356,7 +5380,11 @@ EditorNode::EditorNode() { play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); play_custom_scene_button->connect("pressed", this, "_menu_option", make_binds(RUN_PLAY_CUSTOM_SCENE)); play_custom_scene_button->set_tooltip(TTR("Play custom scene")); +#ifdef OSX_ENABLED + play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_R)); +#else play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F5)); +#endif progress_hb = memnew(BackgroundProgress); @@ -5868,10 +5896,17 @@ EditorNode::EditorNode() { print_handler.userdata = this; add_print_handler(&print_handler); +#ifdef OSX_ENABLED + ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_MASK_ALT | KEY_1); + ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_MASK_ALT | KEY_2); + ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_MASK_ALT | KEY_3); + ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_MASK_ALT | KEY_SPACE); +#else ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_F1); ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_F2); ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_F3); //hack neded for script editor F3 search to work :) Assign like this or don't use F3 ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F4); +#endif ED_SHORTCUT("editor/editor_assetlib", TTR("Open Asset Library")); ED_SHORTCUT("editor/editor_next", TTR("Open the next Editor")); ED_SHORTCUT("editor/editor_prev", TTR("Open the previous Editor")); diff --git a/editor/editor_node.h b/editor/editor_node.h index 6395293c576..795b202e876 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -180,7 +180,7 @@ private: SETTINGS_LAYOUT_DEFAULT, SETTINGS_MANAGE_EXPORT_TEMPLATES, SETTINGS_PICK_MAIN_SCENE, - SETTINGS_TOGGLE_FULLSCREN, + SETTINGS_TOGGLE_FULLSCREEN, SETTINGS_HELP, SCENE_TAB_CLOSE, diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 6d64cc3f0ea..136bdaeb5b2 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1351,33 +1351,9 @@ struct ShortCutMapping { Ref ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p_keycode) { #ifdef OSX_ENABLED - static const ShortCutMapping macos_mappings[] = { - { "editor/play", KEY_MASK_CMD | KEY_B }, - { "editor/play_scene", KEY_MASK_CMD | KEY_R }, - { "editor/pause_scene", KEY_MASK_CMD | KEY_MASK_CTRL | KEY_Y }, - { "editor/stop", KEY_MASK_CMD | KEY_PERIOD }, - { "editor/play_custom_scene", KEY_MASK_SHIFT | KEY_MASK_CMD | KEY_R }, - { "editor/editor_2d", KEY_MASK_ALT | KEY_1 }, - { "editor/editor_3d", KEY_MASK_ALT | KEY_2 }, - { "editor/editor_script", KEY_MASK_ALT | KEY_3 }, - { "editor/editor_help", KEY_MASK_ALT | KEY_SPACE }, - { "editor/fullscreen_mode", KEY_MASK_CMD | KEY_MASK_CTRL | KEY_F }, - { "editor/distraction_free_mode", KEY_MASK_CMD | KEY_MASK_CTRL | KEY_D }, - { "script_text_editor/contextual_help", KEY_MASK_ALT | KEY_MASK_SHIFT | KEY_SPACE }, - { "script_text_editor/find_next", KEY_MASK_CMD | KEY_G }, - { "script_text_editor/find_previous", KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_G }, - { "script_text_editor/toggle_breakpoint", KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B } - }; - + // Use Cmd+Backspace as a general replacement for Delete shortcuts on macOS if (p_keycode == KEY_DELETE) { p_keycode = KEY_MASK_CMD | KEY_BACKSPACE; - } else { - for (int i = 0; i < sizeof(macos_mappings) / sizeof(ShortCutMapping); i++) { - if (p_path == macos_mappings[i].path) { - p_keycode = macos_mappings[i].keycode; - break; - } - } } #endif diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 7462970d8af..466b45a5fd9 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1664,7 +1664,7 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/select_all", TTR("Select All"), KEY_MASK_CMD | KEY_A); ED_SHORTCUT("script_text_editor/move_up", TTR("Move Up"), KEY_MASK_ALT | KEY_UP); 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_CTRL | KEY_MASK_SHIFT | KEY_K); + 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. @@ -1677,34 +1677,46 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/unfold_all_lines", TTR("Unfold All Lines"), 0); #ifdef OSX_ENABLED ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_SHIFT | KEY_MASK_CMD | KEY_C); - ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CTRL | KEY_SPACE); #else ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_CMD | KEY_B); - ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CMD | KEY_SPACE); #endif - ED_SHORTCUT("script_text_editor/trim_trailing_whitespace", TTR("Trim Trailing Whitespace"), KEY_MASK_CTRL | KEY_MASK_ALT | KEY_T); - ED_SHORTCUT("script_text_editor/convert_indent_to_spaces", TTR("Convert Indent To Spaces"), KEY_MASK_CTRL | KEY_MASK_SHIFT | KEY_Y); - ED_SHORTCUT("script_text_editor/convert_indent_to_tabs", TTR("Convert Indent To Tabs"), KEY_MASK_CTRL | KEY_MASK_SHIFT | KEY_X); + ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CMD | KEY_SPACE); + 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_X); 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); - ED_SHORTCUT("script_text_editor/remove_all_breakpoints", TTR("Remove All Breakpoints"), KEY_MASK_CTRL | KEY_MASK_SHIFT | KEY_F9); - ED_SHORTCUT("script_text_editor/goto_next_breakpoint", TTR("Goto Next Breakpoint"), KEY_MASK_CTRL | KEY_PERIOD); - ED_SHORTCUT("script_text_editor/goto_previous_breakpoint", TTR("Goto Previous Breakpoint"), KEY_MASK_CTRL | KEY_COMMA); +#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("Goto Next Breakpoint"), KEY_MASK_CMD | KEY_PERIOD); + ED_SHORTCUT("script_text_editor/goto_previous_breakpoint", TTR("Goto Previous Breakpoint"), KEY_MASK_CMD | KEY_COMMA); ED_SHORTCUT("script_text_editor/convert_to_uppercase", TTR("Convert To Uppercase"), KEY_MASK_SHIFT | KEY_F4); ED_SHORTCUT("script_text_editor/convert_to_lowercase", TTR("Convert To Lowercase"), KEY_MASK_SHIFT | KEY_F3); ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize"), KEY_MASK_SHIFT | KEY_F2); 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); + ED_SHORTCUT("script_text_editor/find_previous", TTR("Find Previous"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_G); +#else ED_SHORTCUT("script_text_editor/find_next", TTR("Find Next"), KEY_F3); ED_SHORTCUT("script_text_editor/find_previous", TTR("Find Previous"), KEY_MASK_SHIFT | KEY_F3); +#endif ED_SHORTCUT("script_text_editor/replace", TTR("Replace..."), KEY_MASK_CMD | KEY_R); ED_SHORTCUT("script_text_editor/goto_function", TTR("Goto Function..."), KEY_MASK_SHIFT | KEY_MASK_CMD | KEY_F); ED_SHORTCUT("script_text_editor/goto_line", TTR("Goto 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); +#else ED_SHORTCUT("script_text_editor/contextual_help", TTR("Contextual Help"), KEY_MASK_SHIFT | KEY_F1); +#endif ScriptEditor::register_create_script_editor_function(create_editor); } From 3808544891ef2726ab56dc025d2d73fb1ad0bebe Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Fri, 15 Jun 2018 21:16:01 +0200 Subject: [PATCH 035/146] [Pluginscript] Fix not working exports in editor (cherry picked from commit 380b85a32fab9b36f95a428e4b473b608cbd310e) --- .../pluginscript/pluginscript_script.cpp | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index 0bcddd4c562..3b965d6b855 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -84,35 +84,20 @@ StringName PluginScript::get_instance_base_type() const { } void PluginScript::update_exports() { -// TODO #ifdef TOOLS_ENABLED -#if 0 ASSERT_SCRIPT_VALID(); - if (/*changed &&*/ placeholders.size()) { //hm :( + if (placeholders.size()) { //update placeholders if any Map propdefvalues; List propinfos; - const String *props = (const String *)pybind_get_prop_list(_py_exposed_class); - for (int i = 0; props[i] != ""; ++i) { - const String propname = props[i]; - pybind_get_prop_default_value(_py_exposed_class, propname.c_str(), (godot_variant *)&propdefvalues[propname]); - pybind_prop_info raw_info; - pybind_get_prop_info(_py_exposed_class, propname.c_str(), &raw_info); - PropertyInfo info; - info.type = (Variant::Type)raw_info.type; - info.name = propname; - info.hint = (PropertyHint)raw_info.hint; - info.hint_string = *(String *)&raw_info.hint_string; - info.usage = raw_info.usage; - propinfos.push_back(info); - } + + get_script_property_list(&propinfos); for (Set::Element *E = placeholders.front(); E; E = E->next()) { - E->get()->update(propinfos, propdefvalues); + E->get()->update(propinfos, _properties_default_values); } } #endif -#endif } // TODO: rename p_this "p_owner" ? From a41f7579c8dac8116da440d25f19f4244ac15afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 16 Jun 2018 09:28:54 +0200 Subject: [PATCH 036/146] Fix property hint for ReflectionProbe extents (cherry picked from commit 2fabb813183ec6e5f9a72dc508e3b291fd18d21c) --- scene/3d/reflection_probe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index 2925235482e..b0b58dafbbf 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -241,8 +241,8 @@ void ReflectionProbe::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "update_mode", PROPERTY_HINT_ENUM, "Once,Always"), "set_update_mode", "get_update_mode"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "intensity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_intensity", "get_intensity"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_RANGE, "0,16384,0.1"), "set_max_distance", "get_max_distance"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "extents"), "set_extents", "get_extents"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "origin_offset"), "set_origin_offset", "get_origin_offset"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "extents"), "set_extents", "get_extents"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "origin_offset"), "set_origin_offset", "get_origin_offset"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "box_projection"), "set_enable_box_projection", "is_box_projection_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enable_shadows"), "set_enable_shadows", "are_shadows_enabled"); ADD_PROPERTY(PropertyInfo(Variant::INT, "cull_mask", PROPERTY_HINT_LAYERS_3D_RENDER), "set_cull_mask", "get_cull_mask"); From fab378abf5f5ebd4d36cf1511412f295a27d44bc Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Tue, 19 Jun 2018 21:42:29 -0300 Subject: [PATCH 037/146] Fix profiler not updating on realtime (cherry picked from commit 34045051d29a94797415e693204862ddf155f564) --- editor/editor_profiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 26429898485..f1107d85841 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -68,13 +68,13 @@ void EditorProfiler::add_frame_metric(const Metric &p_metric, bool p_final) { } updating_frame = false; - if (!frame_delay->is_processing()) { + if (frame_delay->is_stopped()) { frame_delay->set_wait_time(p_final ? 0.1 : 1); frame_delay->start(); } - if (!plot_delay->is_processing()) { + if (plot_delay->is_stopped()) { plot_delay->set_wait_time(0.1); plot_delay->start(); } From deef878f6fbac07cdfcba8d73e45f7aad71d3a12 Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Tue, 19 Jun 2018 22:47:34 -0300 Subject: [PATCH 038/146] Add missing NULL checks for add_child_below_node (cherry picked from commit 8c1c7ff1314bad018162c14aaff9d0124aed070e) --- scene/main/node.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index d5a92b9314a..c05d5af9557 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1357,6 +1357,10 @@ void Node::add_child(Node *p_child, bool p_legible_unique_name) { } void Node::add_child_below_node(Node *p_node, Node *p_child, bool p_legible_unique_name) { + + ERR_FAIL_NULL(p_node); + ERR_FAIL_NULL(p_child); + add_child(p_child, p_legible_unique_name); if (is_a_parent_of(p_node)) { From 56a82b473e42a70258417a71c1410b4e5cac9049 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 26 Nov 2018 16:01:38 +0200 Subject: [PATCH 039/146] Fix macOS icon export (add 1024px PNG icon and 32px/16px RLE icons). (cherry picked from commit 56b26c4369dfc9c7e227b20210b291e86a772e68) --- platform/osx/export/export.cpp | 158 ++++++++++++++++++++++++++++----- 1 file changed, 137 insertions(+), 21 deletions(-) diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 2da4705750d..16d809d6577 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -138,10 +138,76 @@ void EditorExportPlatformOSX::get_export_options(List *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), false)); } +void _rgba8_to_packbits_encode(int p_ch, int p_size, PoolVector &p_source, Vector &p_dest) { + + int src_len = p_size * p_size; + + Vector result; + result.resize(src_len * 1.25); //temp vector for rle encoded data, make it 25% larger for worst case scenario + int res_size = 0; + + uint8_t buf[128]; + int buf_size = 0; + + int i = 0; + while (i < src_len) { + uint8_t cur = p_source.read()[i * 4 + p_ch]; + + if (i < src_len - 2) { + + if ((p_source.read()[(i + 1) * 4 + p_ch] == cur) && (p_source.read()[(i + 2) * 4 + p_ch] == cur)) { + if (buf_size > 0) { + result[res_size++] = (uint8_t)(buf_size - 1); + copymem(&result[res_size], &buf, buf_size); + res_size += buf_size; + buf_size = 0; + } + + uint8_t lim = i + 130 >= src_len ? src_len - i - 1 : 130; + bool hit_lim = true; + + for (int j = 3; j <= lim; j++) { + if (p_source.read()[(i + j) * 4 + p_ch] != cur) { + hit_lim = false; + i = i + j - 1; + result[res_size++] = (uint8_t)(j - 3 + 0x80); + result[res_size++] = cur; + break; + } + } + if (hit_lim) { + result[res_size++] = (uint8_t)(lim - 3 + 0x80); + result[res_size++] = cur; + i = i + lim; + } + } else { + buf[buf_size++] = cur; + if (buf_size == 128) { + result[res_size++] = (uint8_t)(buf_size - 1); + copymem(&result[res_size], &buf, buf_size); + res_size += buf_size; + buf_size = 0; + } + } + } else { + buf[buf_size++] = cur; + result[res_size++] = (uint8_t)(buf_size - 1); + copymem(&result[res_size], &buf, buf_size); + res_size += buf_size; + buf_size = 0; + } + + i++; + } + + int ofs = p_dest.size(); + p_dest.resize(p_dest.size() + res_size); + copymem(&p_dest[ofs], result.ptr(), res_size); +} + void EditorExportPlatformOSX::_make_icon(const Ref &p_icon, Vector &p_data) { Ref it = memnew(ImageTexture); - int size = 512; Vector data; @@ -151,32 +217,82 @@ void EditorExportPlatformOSX::_make_icon(const Ref &p_icon, Vector= 16) { + static const MacOSIconInfo icon_infos[] = { + { "ic10", "", true, 1024 }, //1024x1024 32-bit PNG and 512x512@2x 32-bit "retina" PNG + { "ic09", "", true, 512 }, //512×512 32-bit PNG + { "ic14", "", true, 512 }, //256x256@2x 32-bit "retina" PNG + { "ic08", "", true, 256 }, //256×256 32-bit PNG + { "ic13", "", true, 256 }, //128x128@2x 32-bit "retina" PNG + { "ic07", "", true, 128 }, //128x128 32-bit PNG + { "ic12", "", true, 64 }, //32x32@2x 32-bit "retina" PNG + { "ic11", "", true, 32 }, //16x16@2x 32-bit "retina" PNG + { "il32", "l8mk", false, 32 }, //32x32 24-bit RLE + 8-bit uncompressed mask + { "is32", "s8mk", false, 16 } //16x16 24-bit RLE + 8-bit uncompressed mask + }; + for (unsigned int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) { Ref copy = p_icon; // does this make sense? doesn't this just increase the reference count instead of making a copy? Do we even need a copy? copy->convert(Image::FORMAT_RGBA8); - copy->resize(size, size); - it->create_from_image(copy); - String path = EditorSettings::get_singleton()->get_cache_dir().plus_file("icon.png"); - ResourceSaver::save(path, it); + copy->resize(icon_infos[i].size, icon_infos[i].size); - FileAccess *f = FileAccess::open(path, FileAccess::READ); - ERR_FAIL_COND(!f); + if (icon_infos[i].is_png) { + //encode png icon + it->create_from_image(copy); + String path = EditorSettings::get_singleton()->get_cache_dir().plus_file("icon.png"); + ResourceSaver::save(path, it); - int ofs = data.size(); - uint32_t len = f->get_len(); - data.resize(data.size() + len + 8); - f->get_buffer(&data[ofs + 8], len); - memdelete(f); - len += 8; - len = BSWAP32(len); - copymem(&data[ofs], name[index], 4); - encode_uint32(len, &data[ofs + 4]); - index++; - size /= 2; + FileAccess *f = FileAccess::open(path, FileAccess::READ); + ERR_FAIL_COND(!f); + + int ofs = data.size(); + uint32_t len = f->get_len(); + data.resize(data.size() + len + 8); + f->get_buffer(&data[ofs + 8], len); + memdelete(f); + len += 8; + len = BSWAP32(len); + copymem(&data[ofs], icon_infos[i].name, 4); + encode_uint32(len, &data[ofs + 4]); + } else { + PoolVector src_data = copy->get_data(); + + //encode 24bit RGB RLE icon + { + int ofs = data.size(); + data.resize(data.size() + 8); + + _rgba8_to_packbits_encode(0, icon_infos[i].size, src_data, data); // encode R + _rgba8_to_packbits_encode(1, icon_infos[i].size, src_data, data); // encode G + _rgba8_to_packbits_encode(2, icon_infos[i].size, src_data, data); // encode B + + int len = data.size() - ofs; + len = BSWAP32(len); + copymem(&data[ofs], icon_infos[i].name, 4); + encode_uint32(len, &data[ofs + 4]); + } + + //encode 8bit mask uncompressed icon + { + int ofs = data.size(); + int len = copy->get_width() * copy->get_height(); + data.resize(data.size() + len + 8); + + for (int j = 0; j < len; j++) { + data[ofs + 8 + j] = src_data.read()[j * 4 + 3]; + } + len += 8; + len = BSWAP32(len); + copymem(&data[ofs], icon_infos[i].mask_name, 4); + encode_uint32(len, &data[ofs + 4]); + } + } } uint32_t total_len = data.size(); From 042a74a69616f8f08f669a8a9075fc33faf14f53 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri, 17 May 2019 08:49:21 +0300 Subject: [PATCH 040/146] [macOS] Allow using user provided `.icns` files for exported app icons. (cherry picked from commit 22ee26849eeb22e894d0ae5a627e097c8d977d46) --- platform/osx/export/export.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 16d809d6577..fcee8547bdf 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -119,7 +119,7 @@ void EditorExportPlatformOSX::get_export_options(List *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/name"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/info"), "Made with Godot Engine")); - r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "png"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.png,*.icns"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/identifier"), "org.godotengine.macgame")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), "godotmacgame")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0")); @@ -542,12 +542,21 @@ Error EditorExportPlatformOSX::export_project(const Ref &p_p iconpath = ProjectSettings::get_singleton()->get("application/config/icon"); print_line("icon? " + iconpath); if (iconpath != "") { - Ref icon; - icon.instance(); - icon->load(iconpath); - if (!icon->empty()) { - print_line("loaded?"); - _make_icon(icon, data); + if (iconpath.get_extension() == "icns") { + FileAccess *icon = FileAccess::open(iconpath, FileAccess::READ); + if (icon) { + data.resize(icon->get_len()); + icon->get_buffer(&data[0], icon->get_len()); + icon->close(); + memdelete(icon); + } + } else { + Ref icon; + icon.instance(); + icon->load(iconpath); + if (!icon->empty()) { + _make_icon(icon, data); + } } } //bleh? From f27c98982927f3f9d5e3533a6a77840a77aab750 Mon Sep 17 00:00:00 2001 From: Duy-Nguyen Ta Date: Fri, 22 Jun 2018 10:42:28 -0400 Subject: [PATCH 041/146] bugfix: correct #ifdef for TOUCH_ENABLED and OPENGL_ENABLED (cherry picked from commit 25ad5f8a35ab216da98bafb1992da9b394851449) --- platform/x11/os_x11.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index c32c4ba5ced..04cf959ee9c 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1891,6 +1891,7 @@ void OS_X11::process_xevents() { // to be able to send relative motion events. Point2i pos(event.xmotion.x, event.xmotion.y); +#ifdef TOUCH_ENABLED // Avoidance of spurious mouse motion (see handling of touch) bool filter = false; // Adding some tolerance to match better Point2i to Vector2 @@ -1902,6 +1903,7 @@ void OS_X11::process_xevents() { if (filter) { break; } +#endif if (mouse_mode == MOUSE_MODE_CAPTURED) { @@ -2421,17 +2423,23 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c void OS_X11::release_rendering_thread() { +#if defined(OPENGL_ENABLED) context_gl->release_current(); +#endif } void OS_X11::make_rendering_thread() { +#if defined(OPENGL_ENABLED) context_gl->make_current(); +#endif } void OS_X11::swap_buffers() { +#if defined(OPENGL_ENABLED) context_gl->swap_buffers(); +#endif } void OS_X11::alert(const String &p_alert, const String &p_title) { @@ -2525,8 +2533,10 @@ String OS_X11::get_joy_guid(int p_device) const { } void OS_X11::_set_use_vsync(bool p_enable) { +#if defined(OPENGL_ENABLED) if (context_gl) - return context_gl->set_use_vsync(p_enable); + context_gl->set_use_vsync(p_enable); +#endif } /* bool OS_X11::is_vsync_enabled() const { From dae30964a2928a84501306736266ea55b3780da4 Mon Sep 17 00:00:00 2001 From: matthew1006 Date: Wed, 27 Jun 2018 12:37:55 +0100 Subject: [PATCH 042/146] Fixed project settings overrides not using custom feature tags. (cherry picked from commit 1844704c20c3ba74a6f18d0c781df8f006aa2d46) --- core/project_settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 99c3f66c4c0..545cdbc7f7e 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -137,7 +137,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) { else { if (p_name == CoreStringNames::get_singleton()->_custom_features) { - Vector custom_feature_array = p_value; + Vector custom_feature_array = String(p_value).split(","); for (int i = 0; i < custom_feature_array.size(); i++) { custom_features.insert(custom_feature_array[i]); From f17983e9cf03771001643d6343d0cc56881ec069 Mon Sep 17 00:00:00 2001 From: Yasha Borevich Date: Thu, 28 Jun 2018 18:40:11 +0300 Subject: [PATCH 043/146] Fix memory leak in GDScript during infinnity loops with yields (cherry picked from commit 30317296af1124e2092d3acd374ca0246afd5536) --- modules/gdscript/gdscript_function.cpp | 20 ++++++++++---------- modules/gdscript/gdscript_function.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 8c117a94fa0..70d3ae3c544 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -1537,7 +1537,7 @@ Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_ar GDScriptFunctionState *gdfs = Object::cast_to(ret); if (gdfs && gdfs->function == function) { completed = false; - gdfs->previous_state = Ref(this); + gdfs->first_state = first_state.is_valid() ? first_state : Ref(this); } } @@ -1545,10 +1545,10 @@ Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_ar state.result = Variant(); if (completed) { - GDScriptFunctionState *state = this; - while (state != NULL) { - state->emit_signal("completed", ret); - state = *(state->previous_state); + if (first_state.is_valid()) { + first_state->emit_signal("completed", ret); + } else { + emit_signal("completed", ret); } } @@ -1599,7 +1599,7 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) { GDScriptFunctionState *gdfs = Object::cast_to(ret); if (gdfs && gdfs->function == function) { completed = false; - gdfs->previous_state = Ref(this); + gdfs->first_state = first_state.is_valid() ? first_state : Ref(this); } } @@ -1607,10 +1607,10 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) { state.result = Variant(); if (completed) { - GDScriptFunctionState *state = this; - while (state != NULL) { - state->emit_signal("completed", ret); - state = *(state->previous_state); + if (first_state.is_valid()) { + first_state->emit_signal("completed", ret); + } else { + emit_signal("completed", ret); } } diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index a04054cb5e3..cfcf8805250 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -234,7 +234,7 @@ class GDScriptFunctionState : public Reference { GDScriptFunction *function; GDScriptFunction::CallState state; Variant _signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error); - Ref previous_state; + Ref first_state; protected: static void _bind_methods(); From f4db382c500e39a0cb59989a091a45d20af97ca2 Mon Sep 17 00:00:00 2001 From: Will Nations Date: Sun, 1 Jul 2018 00:15:27 -0500 Subject: [PATCH 044/146] Fix underline_meta not working in RichTextLabel (cherry picked from commit a9ea06e73a9979210491ed88a57834e51bace1b9) --- scene/gui/rich_text_label.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index e20537225d9..39e128cea12 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -272,7 +272,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & if (p_mode == PROCESS_DRAW) { color = _find_color(text, p_base_color); underline = _find_underline(text); - if (_find_meta(text, &meta)) { + if (_find_meta(text, &meta) && underline_meta) { underline = true; } From b1bb7e48ca0afb763b8ebbd2116abc82a51ad37f Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Sat, 7 Jul 2018 17:10:32 -0500 Subject: [PATCH 045/146] Changed minimum visible viewport size When the viewport's size.y becomes lower than 2, the storage->frame.current_rt->effects.mip_maps[0].sizes Vector during rendering becomes empty, resulting in crashes in at least GLES3. This is a temporary fix to stop rendering a viewport when its size is below 2 rather than below 1. (cherry picked from commit 892a4b175a54c1172ba7c8dc1b60f4ad25b968a2) --- servers/visual/visual_server_viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index 81d97e67196..2598c51a785 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -259,7 +259,7 @@ void VisualServerViewport::draw_viewports() { ERR_CONTINUE(!vp->render_target.is_valid()); bool visible = vp->viewport_to_screen_rect != Rect2() || vp->update_mode == VS::VIEWPORT_UPDATE_ALWAYS || vp->update_mode == VS::VIEWPORT_UPDATE_ONCE || (vp->update_mode == VS::VIEWPORT_UPDATE_WHEN_VISIBLE && VSG::storage->render_target_was_used(vp->render_target)); - visible = visible && vp->size.x > 0 && vp->size.y > 0; + visible = visible && vp->size.x > 1 && vp->size.y > 1; if (!visible) continue; From 16e6d6fedef6a5bf590cd0df2eb8331b4385b8d4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 19 Nov 2018 22:05:55 -0300 Subject: [PATCH 046/146] Don't post process on tiny render targets, fixes #19628 (cherry picked from commit a78b42c058cecc939b54101956b5ca9a7b415c85) --- drivers/gles3/rasterizer_scene_gles3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 3b14b27ab80..dbbaa62bc25 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -3554,7 +3554,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); } - if (!env || storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + if (!env || storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT] || storage->frame.current_rt->width < 4 || storage->frame.current_rt->height < 4) { //no post process on small render targets //no environment or transparent render, simply return and convert to SRGB glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo); glActiveTexture(GL_TEXTURE0); From 493e220ab95fbc444efc4c64898cb8507cf4b830 Mon Sep 17 00:00:00 2001 From: Saracen Date: Sun, 8 Jul 2018 18:51:20 +0100 Subject: [PATCH 047/146] Fix bits_per_pixel validation in BMP and TGA loader modules. (cherry picked from commit 115f6d14a0c1e6e108ea4b91179357eedea32173) --- modules/tga/image_loader_tga.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index 094af13c946..d5006de1b6e 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -250,8 +250,9 @@ Error ImageLoaderTGA::load_image(Ref p_image, FileAccess *f, bool p_force if (tga_header.image_width <= 0 || tga_header.image_height <= 0) err = FAILED; - if (tga_header.pixel_depth != 8 && tga_header.pixel_depth != 24 && tga_header.pixel_depth != 32) + if (!(tga_header.pixel_depth == 8 || tga_header.pixel_depth == 24 || tga_header.pixel_depth == 32)) { err = FAILED; + } if (err == OK) { f->seek(f->get_position() + tga_header.id_length); From 4b69ed4124c2ba0d0f81dff5c586ad51ef23f92b Mon Sep 17 00:00:00 2001 From: karroffel Date: Tue, 10 Jul 2018 23:13:59 +0200 Subject: [PATCH 048/146] fix wrong loop condition in MultiMesh allocation (cherry picked from commit 3d33da19bd1cd5a0d2569432a356074702095508) --- drivers/gles3/rasterizer_storage_gles3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index a28dac275ff..a653b821bb3 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -3799,7 +3799,8 @@ void RasterizerStorageGLES3::multimesh_allocate(RID p_multimesh, int p_instances int format_floats = multimesh->color_floats + multimesh->xform_floats; multimesh->data.resize(format_floats * p_instances); - for (int i = 0; i < p_instances; i += format_floats) { + + for (int i = 0; i < p_instances * format_floats; i += format_floats) { int color_from = 0; From b890ed527b6951116c50662562e2ddc7e0dae9eb Mon Sep 17 00:00:00 2001 From: Ibrahn Sahir Date: Fri, 13 Jul 2018 13:30:50 +0100 Subject: [PATCH 049/146] fixed branch on uninit and data race in editor android device polling Initialised relevant variables before stating thread, to prevent a branch on uninitialised data. Fixed race condition in polling that could miss a device change. (cherry picked from commit fe4265ad463e8fdf9bd1f8677d5e697b6ee090e0) --- platform/android/export/export.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 1a5a62972b6..e1ad86e772a 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -228,7 +228,7 @@ class EditorExportAndroid : public EditorExportPlatform { }; Vector devices; - bool devices_changed; + volatile bool devices_changed; Mutex *device_lock; Thread *device_thread; volatile bool quit_request; @@ -1156,7 +1156,10 @@ public: virtual bool poll_devices() { bool dc = devices_changed; - devices_changed = false; + if (dc) { + // don't clear unless we're reporting true, to avoid race + devices_changed = false; + } return dc; } @@ -1859,9 +1862,9 @@ public: run_icon->create_from_image(img); device_lock = Mutex::create(); - device_thread = Thread::create(_device_poll_thread, this); devices_changed = true; quit_request = false; + device_thread = Thread::create(_device_poll_thread, this); } ~EditorExportAndroid() { From 33a93311ec9933f4f5ef5688f768ec3ecef5cc82 Mon Sep 17 00:00:00 2001 From: Ibrahn Sahir Date: Sat, 14 Jul 2018 14:02:08 +0100 Subject: [PATCH 050/146] fix scrollbar icons with atlas texture. Draw scrollbar icons through their textures, rather than calling directly to the server. Allows atlas textures to manipulate the source rect as required. (cherry picked from commit e51a94905d4b866475c16fe1a2b20a7db5d61e81) --- scene/gui/scroll_bar.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 00184578d59..d946424d0fa 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -271,9 +271,7 @@ void ScrollBar::_notification(int p_what) { Point2 ofs; - VisualServer *vs = VisualServer::get_singleton(); - - vs->canvas_item_add_texture_rect(ci, Rect2(Point2(), decr->get_size()), decr->get_rid()); + decr->draw(ci, Point2()); if (orientation == HORIZONTAL) ofs.x += decr->get_width(); @@ -294,7 +292,7 @@ void ScrollBar::_notification(int p_what) { else ofs.height += area.height; - vs->canvas_item_add_texture_rect(ci, Rect2(ofs, decr->get_size()), incr->get_rid()); + incr->draw(ci, ofs); Rect2 grabber_rect; if (orientation == HORIZONTAL) { From 854fc3cb97052109d85c037c2d4ab0a9768a4c0c Mon Sep 17 00:00:00 2001 From: Overblob Date: Sat, 14 Jul 2018 19:59:11 +0200 Subject: [PATCH 051/146] Fixed error due to bad cursor handling when parsing shader code Fixed completion error log thrown on "no auto-completion found" for typings with no completion. (cherry picked from commit 7a74d310aac3bd980d1bffe9b3cd13de2539d356) --- servers/visual/shader_language.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 90c037ab687..48108d5c5e0 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2550,7 +2550,9 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons TkPos pos = _get_tkpos(); tk = _get_token(); - if (tk.type == TK_PERIOD) { + if (tk.type == TK_CURSOR) { + //do nothing + } else if (tk.type == TK_PERIOD) { StringName identifier; if (_get_completable_identifier(p_block, COMPLETION_INDEX, identifier)) { @@ -4140,8 +4142,8 @@ Error ShaderLanguage::complete(const String &p_code, const Map::Element *E = p_render_modes.front(); E; E = E->next()) { From 47c7bfd6783a3399985ef33bda13617f3b022ab5 Mon Sep 17 00:00:00 2001 From: Yar-Mukhamedov <9489533+Yar-Mukhamedov@users.noreply.github.com> Date: Mon, 16 Jul 2018 13:05:45 +0600 Subject: [PATCH 052/146] Fix export templates installation error... (cherry picked from commit bf37bd94b6c3604f760abea691973b4b2d09e622) --- editor/export_template_manager.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index ca64447559d..25325adb253 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -226,7 +226,10 @@ void ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ version = data_str; } - fc++; + if (file.get_file().size() != 0) { + fc++; + } + ret = unzGoToNextFile(pkg); } @@ -266,6 +269,11 @@ void ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ String file = String(fname).get_file(); + if (file.size() == 0) { + ret = unzGoToNextFile(pkg); + continue; + } + Vector data; data.resize(info.uncompressed_size); From fd5dca2689932160cf2f709d1f0110575cdda9b6 Mon Sep 17 00:00:00 2001 From: volzhs Date: Wed, 18 Jul 2018 01:49:57 +0900 Subject: [PATCH 053/146] Fix copying ttf, otf by DND to editor regression from d65ac7378c77648124e0e8acd09cea8fd0d104cd (cherry picked from commit 4bb85b70e1b4bf6ccfba2e2c63e38879a5f09d10) --- editor/editor_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c007a27068b..08887f92d54 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4447,7 +4447,7 @@ void EditorNode::_dropped_files(const Vector &p_files, int p_screen) { for (int i = 0; i < p_files.size(); i++) { String from = p_files[i]; - if (!ResourceFormatImporter::get_singleton()->can_be_imported(from) && (just_copy.find(from.get_extension().to_lower()) != -1)) { + if (!ResourceFormatImporter::get_singleton()->can_be_imported(from) && (just_copy.find(from.get_extension().to_lower()) == -1)) { continue; } String to = to_path.plus_file(from.get_file()); From c68a465f47d1206e26b06b04cb0b46245a168f74 Mon Sep 17 00:00:00 2001 From: matthew1006 Date: Wed, 18 Jul 2018 09:22:59 +0100 Subject: [PATCH 054/146] Fixed OS.has_feature not using custom feature tags. (cherry picked from commit 25e64ffa20a15abe6c435ae8abf517be209fea53) --- core/os/os.cpp | 3 +++ core/project_settings.cpp | 4 ++++ core/project_settings.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/core/os/os.cpp b/core/os/os.cpp index f7ff70c239e..3d0e1c23e38 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -613,6 +613,9 @@ bool OS::has_feature(const String &p_feature) { if (_check_internal_feature_support(p_feature)) return true; + if (ProjectSettings::get_singleton()->has_custom_feature(p_feature)) + return true; + return false; } diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 545cdbc7f7e..09ad1cc50af 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -886,6 +886,10 @@ Variant ProjectSettings::get_setting(const String &p_setting) const { return get(p_setting); } +bool ProjectSettings::has_custom_feature(const String &p_feature) const { + return custom_features.has(p_feature); +} + void ProjectSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("has_setting", "name"), &ProjectSettings::has_setting); diff --git a/core/project_settings.h b/core/project_settings.h index 6ae23b3bc97..8ee20408c74 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -148,6 +148,8 @@ public: void set_registering_order(bool p_enable); + bool has_custom_feature(const String &p_feature) const; + ProjectSettings(); ~ProjectSettings(); }; From 392d988228d7adcde6b4516599bc11f515948637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 18 Jul 2018 13:46:02 +0200 Subject: [PATCH 055/146] Export: Properly reload preset when opening dialog Fixes #20119 where newly installed templates were not detected. Also fix a bug with preset deletion where it would attempt to edit an already removed preset. For this I made it so that ItemList::deselect_all() also resets `current` to -1, as a manual ItemList::deselect(idx) already does. (cherry picked from commit 13239cd4cc271ba4ccac59a060012129829dfc5f) --- editor/editor_node.cpp | 4 ---- editor/editor_node.h | 1 - editor/export_template_manager.cpp | 3 --- editor/project_export.cpp | 7 ++++--- scene/gui/item_list.cpp | 2 +- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 08887f92d54..dc97358609b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2045,10 +2045,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } break; - case SETTINGS_EXPORT_PREFERENCES: { - - //project_export_settings->popup_centered_ratio(); - } break; case FILE_IMPORT_SUBSCENE: { //import_subscene->popup_centered_ratio(); diff --git a/editor/editor_node.h b/editor/editor_node.h index 795b202e876..4ec34c9f472 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -173,7 +173,6 @@ private: SETTINGS_UPDATE_ALWAYS, SETTINGS_UPDATE_CHANGES, SETTINGS_UPDATE_SPINNER_HIDE, - SETTINGS_EXPORT_PREFERENCES, SETTINGS_PREFERENCES, SETTINGS_LAYOUT_SAVE, SETTINGS_LAYOUT_DELETE, diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 25325adb253..fccc4300900 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -121,7 +121,6 @@ void ExportTemplateManager::_update_template_list() { void ExportTemplateManager::_download_template(const String &p_version) { - print_line("download " + p_version); while (template_list->get_child_count()) { memdelete(template_list->get_child(0)); } @@ -350,7 +349,6 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_ bool mirrors_found = false; Dictionary d = r; - print_line(r); if (d.has("mirrors")) { Array mirrors = d["mirrors"]; for (int i = 0; i < mirrors.size(); i++) { @@ -496,7 +494,6 @@ void ExportTemplateManager::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (!is_visible_in_tree()) { - print_line("closed"); download_templates->cancel_request(); set_process(false); } diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 95386d11b6d..38258a96c24 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -70,6 +70,9 @@ void ProjectExportDialog::popup_export() { } _update_presets(); + if (presets->get_current() >= 0) { + _edit_preset(presets->get_current()); // triggers rescan for templates if newly installed + } // Restore valid window bounds or pop up at default size. if (EditorSettings::get_singleton()->has_setting("interface/dialogs/export_bounds")) { @@ -141,7 +144,6 @@ void ProjectExportDialog::_update_presets() { if (current_idx != -1) { presets->select(current_idx); - //_edit_preset(current_idx); } updating = false; @@ -154,6 +156,7 @@ void ProjectExportDialog::_edit_preset(int p_index) { name->set_editable(false); runnable->set_disabled(true); parameters->edit(NULL); + presets->unselect_all(); delete_preset->set_disabled(true); sections->hide(); patches->clear(); @@ -425,11 +428,9 @@ void ProjectExportDialog::_delete_preset() { void ProjectExportDialog::_delete_preset_confirm() { int idx = presets->get_current(); - parameters->edit(NULL); //to avoid crash _edit_preset(-1); EditorExport::get_singleton()->remove_export_preset(idx); _update_presets(); - _edit_preset(presets->get_current()); } Variant ProjectExportDialog::get_drag_data_fw(const Point2 &p_point, Control *p_from) { diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 26eab40594e..091b59fdaf4 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -268,7 +268,7 @@ void ItemList::unselect_all() { items[i].selected = false; } - + current = -1; update(); } From f302888a478bc0ccfb11c6c14accd9594149693a Mon Sep 17 00:00:00 2001 From: karroffel Date: Wed, 18 Jul 2018 15:28:49 +0200 Subject: [PATCH 056/146] fix nameclash with MSVC (cherry picked from commit 43ae1c712fcdbe0159085386391fa1ab67aab1d7) --- core/typedefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/core/typedefs.h b/core/typedefs.h index 37186cab4d7..f96fc40cea6 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -93,6 +93,7 @@ T *_nullptr() { #undef CLAMP // override standard definition #undef Error #undef OK +#undef CONNECT_DEFERRED // override from Windows SDK, clashes with Object enum #endif #include "int_types.h" From 0572b52ba18ce5a78d3b6dd477eed11316af798c Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Sat, 21 Jul 2018 19:55:52 -0300 Subject: [PATCH 057/146] Fix upper/lower case convertion for characters >= 0x80 (cherry picked from commit ecb071b2210a5b167f078375635d9c8210b38353) --- core/ustring.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index 189a7b810c6..d3146415eec 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -885,8 +885,8 @@ String String::to_upper() const { for (int i = 0; i < upper.size(); i++) { - const char s = upper[i]; - const char t = _find_upper(s); + const CharType s = upper[i]; + const CharType t = _find_upper(s); if (s != t) // avoid copy on write upper[i] = t; } @@ -900,8 +900,8 @@ String String::to_lower() const { for (int i = 0; i < lower.size(); i++) { - const char s = lower[i]; - const char t = _find_lower(s); + const CharType s = lower[i]; + const CharType t = _find_lower(s); if (s != t) // avoid copy on write lower[i] = t; } From 754514df7e2c9761ee818caca4e78863dd63c41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 22 Jul 2018 12:42:29 +0200 Subject: [PATCH 058/146] Shader lang: Properly assign INSTANCE_ID to gl_InstanceID Note that gl_InstanceID is not supported in OpenGL ES 2.0, so in the gles2 backend we assign it to 0. Also clean up some duplicates/commented out code. Fixes #20088. (cherry picked from commit 00dfc9c8eba828ec13eea7ef976a672465d3cf6e) --- drivers/gles3/shader_compiler_gles3.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 3ecbdd81773..7e7892133d4 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -781,8 +781,6 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_CANVAS_ITEM].renames["NORMAL"] = "normal"; actions[VS::SHADER_CANVAS_ITEM].renames["NORMALMAP"] = "normal_map"; actions[VS::SHADER_CANVAS_ITEM].renames["NORMALMAP_DEPTH"] = "normal_depth"; - actions[VS::SHADER_CANVAS_ITEM].renames["UV"] = "uv_interp"; - actions[VS::SHADER_CANVAS_ITEM].renames["COLOR"] = "color"; actions[VS::SHADER_CANVAS_ITEM].renames["TEXTURE"] = "color_texture"; actions[VS::SHADER_CANVAS_ITEM].renames["TEXTURE_PIXEL_SIZE"] = "color_texpixel_size"; actions[VS::SHADER_CANVAS_ITEM].renames["NORMAL_TEXTURE"] = "normal_texture"; @@ -825,7 +823,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].renames["UV2"] = "uv2_interp"; actions[VS::SHADER_SPATIAL].renames["COLOR"] = "color_interp"; actions[VS::SHADER_SPATIAL].renames["POINT_SIZE"] = "gl_PointSize"; - //actions[VS::SHADER_SPATIAL].renames["INSTANCE_ID"]=ShaderLanguage::TYPE_INT; + actions[VS::SHADER_SPATIAL].renames["INSTANCE_ID"] = "gl_InstanceID"; //builtins @@ -847,13 +845,11 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].renames["CLEARCOAT_GLOSS"] = "clearcoat_gloss"; actions[VS::SHADER_SPATIAL].renames["ANISOTROPY"] = "anisotropy"; actions[VS::SHADER_SPATIAL].renames["ANISOTROPY_FLOW"] = "anisotropy_flow"; - //actions[VS::SHADER_SPATIAL].renames["SSS_SPREAD"] = "sss_spread"; actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength"; actions[VS::SHADER_SPATIAL].renames["TRANSMISSION"] = "transmission"; actions[VS::SHADER_SPATIAL].renames["AO"] = "ao"; actions[VS::SHADER_SPATIAL].renames["AO_LIGHT_AFFECT"] = "ao_light_affect"; actions[VS::SHADER_SPATIAL].renames["EMISSION"] = "emission"; - //actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2; actions[VS::SHADER_SPATIAL].renames["POINT_COORD"] = "gl_PointCoord"; actions[VS::SHADER_SPATIAL].renames["INSTANCE_CUSTOM"] = "instance_custom"; actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"] = "screen_uv"; @@ -895,8 +891,6 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { 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"; - actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength"; - 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"; actions[VS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n"; From 5c69f83c9629e9df935bd79b816a03669e78c46f Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Sun, 22 Jul 2018 17:41:50 -0300 Subject: [PATCH 059/146] Fix possible crash at NativeScript::get_base_script (cherry picked from commit 77f3c0b4958785c06eead36bdad79b778c5be495) --- modules/gdnative/nativescript/nativescript.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index ced60acac47..50e70a8bb1d 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -150,7 +150,10 @@ Ref