summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml3
-rw-r--r--SConstruct3
-rw-r--r--core/bind/core_bind.cpp14
-rw-r--r--core/bind/core_bind.h3
-rw-r--r--core/class_db.h9
-rw-r--r--core/io/http_client.cpp10
-rw-r--r--core/io/http_client.h1
-rw-r--r--core/io/pck_packer.cpp4
-rw-r--r--core/io/pck_packer.h2
-rw-r--r--core/io/resource_loader.cpp53
-rw-r--r--core/math/basis.cpp12
-rw-r--r--core/math/bsp_tree.cpp4
-rw-r--r--core/math/geometry.cpp2
-rw-r--r--core/message_queue.cpp3
-rw-r--r--core/os/midi_driver.cpp48
-rw-r--r--core/os/midi_driver.h1
-rw-r--r--core/os/os.cpp8
-rw-r--r--core/os/os.h10
-rw-r--r--core/translation.cpp91
-rw-r--r--core/translation.h1
-rw-r--r--core/ustring.cpp2
-rw-r--r--core/variant_call.cpp49
-rw-r--r--doc/classes/AABB.xml5
-rw-r--r--doc/classes/ARVRController.xml7
-rw-r--r--doc/classes/ARVRInterface.xml20
-rw-r--r--doc/classes/ARVRPositionalTracker.xml2
-rw-r--r--doc/classes/Animation.xml2
-rw-r--r--doc/classes/AnimationPlayer.xml15
-rw-r--r--doc/classes/AnimationTreePlayer.xml2
-rw-r--r--doc/classes/ArrayMesh.xml2
-rw-r--r--doc/classes/AudioStreamPlayer.xml2
-rw-r--r--doc/classes/AudioStreamSample.xml4
-rw-r--r--doc/classes/BaseButton.xml8
-rw-r--r--doc/classes/Basis.xml1
-rw-r--r--doc/classes/Button.xml2
-rw-r--r--doc/classes/Camera.xml17
-rw-r--r--doc/classes/Camera2D.xml2
-rw-r--r--doc/classes/CharFXTransform.xml32
-rw-r--r--doc/classes/CollisionPolygon2D.xml8
-rw-r--r--doc/classes/CollisionShape2D.xml1
-rw-r--r--doc/classes/Color.xml1
-rw-r--r--doc/classes/ConfigFile.xml6
-rw-r--r--doc/classes/CubeMap.xml10
-rw-r--r--doc/classes/Directory.xml14
-rw-r--r--doc/classes/DynamicFont.xml14
-rw-r--r--doc/classes/EditorSettings.xml5
-rw-r--r--doc/classes/Environment.xml2
-rw-r--r--doc/classes/HTTPClient.xml10
-rw-r--r--doc/classes/HTTPRequest.xml2
-rw-r--r--doc/classes/IP.xml6
-rw-r--r--doc/classes/Image.xml14
-rw-r--r--doc/classes/ImmediateGeometry.xml4
-rw-r--r--doc/classes/Input.xml2
-rw-r--r--doc/classes/JSONParseResult.xml4
-rw-r--r--doc/classes/KinematicBody.xml4
-rw-r--r--doc/classes/Label.xml4
-rw-r--r--doc/classes/Light2D.xml2
-rw-r--r--doc/classes/Line2D.xml9
-rw-r--r--doc/classes/LineEdit.xml4
-rw-r--r--doc/classes/Listener.xml8
-rw-r--r--doc/classes/MultiplayerAPI.xml2
-rw-r--r--doc/classes/OS.xml47
-rw-r--r--doc/classes/PCKPacker.xml15
-rw-r--r--doc/classes/Particles.xml2
-rw-r--r--doc/classes/Particles2D.xml2
-rw-r--r--doc/classes/ParticlesMaterial.xml2
-rw-r--r--doc/classes/Physics2DServer.xml4
-rw-r--r--doc/classes/Physics2DShapeQueryParameters.xml12
-rw-r--r--doc/classes/Physics2DShapeQueryResult.xml7
-rw-r--r--doc/classes/PhysicsServer.xml54
-rw-r--r--doc/classes/PhysicsShapeQueryParameters.xml10
-rw-r--r--doc/classes/PhysicsShapeQueryResult.xml8
-rw-r--r--doc/classes/Plane.xml1
-rw-r--r--doc/classes/PlaneShape.xml3
-rw-r--r--doc/classes/PrimitiveMesh.xml3
-rw-r--r--doc/classes/ProjectSettings.xml10
-rw-r--r--doc/classes/Quat.xml1
-rw-r--r--doc/classes/Rect2.xml3
-rw-r--r--doc/classes/RichTextEffect.xml11
-rw-r--r--doc/classes/SceneTree.xml2
-rw-r--r--doc/classes/Script.xml2
-rw-r--r--doc/classes/Shape.xml1
-rw-r--r--doc/classes/Shape2D.xml1
-rw-r--r--doc/classes/StyleBoxFlat.xml18
-rw-r--r--doc/classes/StyleBoxLine.xml7
-rw-r--r--doc/classes/StyleBoxTexture.xml15
-rw-r--r--doc/classes/SurfaceTool.xml2
-rw-r--r--doc/classes/TabContainer.xml2
-rw-r--r--doc/classes/TextureButton.xml2
-rw-r--r--doc/classes/Theme.xml68
-rw-r--r--doc/classes/Transform.xml1
-rw-r--r--doc/classes/Transform2D.xml1
-rw-r--r--doc/classes/Tree.xml4
-rw-r--r--doc/classes/TreeItem.xml2
-rw-r--r--doc/classes/Tween.xml4
-rw-r--r--doc/classes/Variant.xml2
-rw-r--r--doc/classes/Vector2.xml1
-rw-r--r--doc/classes/Vector3.xml1
-rw-r--r--doc/classes/VisualServer.xml24
-rw-r--r--doc/classes/XMLParser.xml2
-rwxr-xr-x[-rw-r--r--]doc/tools/doc_merge.py0
-rwxr-xr-x[-rw-r--r--]doc/tools/doc_status.py0
-rwxr-xr-xdoc/tools/makerst.py75
-rw-r--r--drivers/SCsub10
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp77
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.h1
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp14
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp4
-rw-r--r--drivers/gles2/shader_gles2.h6
-rw-r--r--drivers/gles2/shaders/canvas.glsl4
-rw-r--r--drivers/gles2/shaders/scene.glsl202
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp102
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.h1
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp18
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp4
-rw-r--r--drivers/gles3/shaders/canvas.glsl2
-rw-r--r--drivers/gles3/shaders/scene.glsl18
-rw-r--r--editor/animation_track_editor.cpp1
-rw-r--r--editor/code_editor.cpp32
-rw-r--r--editor/code_editor.h2
-rw-r--r--editor/collada/collada.cpp2
-rw-r--r--editor/dependency_editor.cpp1
-rw-r--r--editor/editor_data.cpp2
-rw-r--r--editor/editor_file_dialog.cpp10
-rw-r--r--editor/editor_folding.cpp3
-rw-r--r--editor/editor_node.cpp27
-rw-r--r--editor/editor_properties.cpp2
-rw-r--r--editor/editor_themes.cpp23
-rw-r--r--editor/export_template_manager.cpp2
-rw-r--r--editor/find_in_files.cpp1
-rw-r--r--editor/import/editor_import_collada.cpp2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp5
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp40
-rw-r--r--editor/plugins/script_text_editor.cpp4
-rw-r--r--editor/plugins/skeleton_editor_plugin.cpp3
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp2
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp2
-rw-r--r--editor/project_manager.cpp15
-rw-r--r--editor/script_editor_debugger.cpp2
-rw-r--r--editor/settings_config_dialog.cpp11
-rw-r--r--editor/spatial_editor_gizmos.cpp18
-rw-r--r--editor/translations/af.po9
-rw-r--r--editor/translations/ar.po9
-rw-r--r--editor/translations/bg.po9
-rw-r--r--editor/translations/bn.po9
-rw-r--r--editor/translations/ca.po9
-rw-r--r--editor/translations/cs.po9
-rw-r--r--editor/translations/da.po9
-rw-r--r--editor/translations/de.po10
-rw-r--r--editor/translations/de_CH.po9
-rw-r--r--editor/translations/editor.pot9
-rw-r--r--editor/translations/el.po9
-rw-r--r--editor/translations/eo.po10
-rw-r--r--editor/translations/es.po10
-rw-r--r--editor/translations/es_AR.po10
-rw-r--r--editor/translations/et.po9
-rw-r--r--editor/translations/eu.po19
-rw-r--r--editor/translations/fa.po9
-rw-r--r--editor/translations/fi.po10
-rw-r--r--editor/translations/fil.po9
-rw-r--r--editor/translations/fr.po19
-rw-r--r--editor/translations/ga.po9
-rw-r--r--editor/translations/he.po9
-rw-r--r--editor/translations/hi.po9
-rw-r--r--editor/translations/hr.po9
-rw-r--r--editor/translations/hu.po9
-rw-r--r--editor/translations/id.po9
-rw-r--r--editor/translations/is.po9
-rw-r--r--editor/translations/it.po10
-rw-r--r--editor/translations/ja.po10
-rw-r--r--editor/translations/ka.po9
-rw-r--r--editor/translations/ko.po10
-rw-r--r--editor/translations/lt.po9
-rw-r--r--editor/translations/lv.po9
-rw-r--r--editor/translations/mi.po9
-rw-r--r--editor/translations/ml.po9
-rw-r--r--editor/translations/ms.po9
-rw-r--r--editor/translations/nb.po9
-rw-r--r--editor/translations/nl.po9
-rw-r--r--editor/translations/or.po9
-rw-r--r--editor/translations/pl.po10
-rw-r--r--editor/translations/pr.po9
-rw-r--r--editor/translations/pt_BR.po126
-rw-r--r--editor/translations/pt_PT.po10
-rw-r--r--editor/translations/ro.po9
-rw-r--r--editor/translations/ru.po10
-rw-r--r--editor/translations/si.po9
-rw-r--r--editor/translations/sk.po9
-rw-r--r--editor/translations/sl.po9
-rw-r--r--editor/translations/sq.po9
-rw-r--r--editor/translations/sr_Cyrl.po9
-rw-r--r--editor/translations/sr_Latn.po9
-rw-r--r--editor/translations/sv.po9
-rw-r--r--editor/translations/ta.po9
-rw-r--r--editor/translations/te.po9
-rw-r--r--editor/translations/th.po9
-rw-r--r--editor/translations/tr.po10
-rw-r--r--editor/translations/uk.po10
-rw-r--r--editor/translations/ur_PK.po9
-rw-r--r--editor/translations/vi.po9
-rw-r--r--editor/translations/zh_CN.po10
-rw-r--r--editor/translations/zh_HK.po9
-rw-r--r--editor/translations/zh_TW.po9
-rw-r--r--main/main.cpp34
-rw-r--r--methods.py26
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj6
-rw-r--r--misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist4
-rw-r--r--misc/hooks/README.md8
-rwxr-xr-xmisc/hooks/pre-commit2
-rwxr-xr-xmisc/hooks/pre-commit-makerst5
-rw-r--r--modules/SCsub2
-rw-r--r--modules/arkit/SCsub8
-rw-r--r--modules/arkit/arkit_interface.mm1
-rw-r--r--modules/assimp/editor_scene_importer_assimp.cpp16
-rw-r--r--modules/assimp/import_utils.h8
-rw-r--r--modules/bullet/space_bullet.cpp4
-rw-r--r--modules/camera/SCsub22
-rw-r--r--modules/camera/camera_ios.h (renamed from platform/iphone/camera_ios.h)0
-rw-r--r--modules/camera/camera_ios.mm (renamed from platform/iphone/camera_ios.mm)2
-rw-r--r--modules/camera/camera_osx.h (renamed from platform/osx/camera_osx.h)0
-rw-r--r--modules/camera/camera_osx.mm (renamed from platform/osx/camera_osx.mm)0
-rw-r--r--modules/camera/camera_win.cpp (renamed from platform/windows/camera_win.cpp)0
-rw-r--r--modules/camera/camera_win.h (renamed from platform/windows/camera_win.h)0
-rw-r--r--modules/camera/config.py5
-rw-r--r--modules/camera/register_types.cpp56
-rw-r--r--modules/camera/register_types.h32
-rw-r--r--modules/gdnative/gdnative_library_editor_plugin.cpp1
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp5
-rw-r--r--modules/gdnative/pluginscript/pluginscript_script.cpp23
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml20
-rw-r--r--modules/gdscript/doc_classes/GDScript.xml2
-rw-r--r--modules/gdscript/gdscript.cpp3
-rw-r--r--modules/gdscript/gdscript_editor.cpp11
-rw-r--r--modules/gdscript/gdscript_functions.cpp20
-rw-r--r--modules/gdscript/gdscript_parser.cpp7
-rw-r--r--modules/gdscript/language_server/gdscript_extend_parser.cpp2
-rw-r--r--modules/gdscript/language_server/gdscript_text_document.cpp2
-rw-r--r--modules/gridmap/doc_classes/GridMap.xml3
-rw-r--r--modules/mbedtls/crypto_mbedtls.cpp2
-rwxr-xr-xmodules/mbedtls/stream_peer_mbedtls.cpp5
-rw-r--r--modules/mono/build_scripts/godot_tools_build.py3
-rw-r--r--modules/mono/build_scripts/mono_android_config.xml28
-rw-r--r--modules/mono/build_scripts/mono_configure.py7
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeClient.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnection.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageComposer.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageParser.cs6
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.ProjectEditor/packages.config4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs24
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs6
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs6
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/BuildManager.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/BuildTab.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs81
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs3
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs54
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj19
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs3
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeServer.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs416
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs117
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Internals/GodotSharpDirs.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs12
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Utils/User32Dll.cs10
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/packages.config5
-rw-r--r--modules/mono/editor/editor_internal_calls.cpp7
-rw-r--r--modules/mono/editor/godotsharp_export.cpp25
-rw-r--r--modules/mono/editor/godotsharp_export.h5
-rw-r--r--modules/mono/glue/Managed/Files/Array.cs13
-rw-r--r--modules/mono/glue/Managed/Files/Dictionary.cs13
-rw-r--r--modules/mono/glue/Managed/Files/GD.cs8
-rw-r--r--modules/mono/glue/Managed/Files/StringExtensions.cs14
-rw-r--r--modules/mono/glue/Managed/Managed.csproj2
-rw-r--r--modules/mono/glue/collections_glue.cpp10
-rw-r--r--modules/mono/glue/collections_glue.h4
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp13
-rw-r--r--modules/mono/mono_gd/gd_mono_android.cpp601
-rw-r--r--modules/mono/mono_gd/gd_mono_android.h6
-rw-r--r--modules/mono/mono_gd/gd_mono_cache.h28
-rw-r--r--modules/mono/mono_gd/gd_mono_marshal.cpp2
-rw-r--r--modules/recast/navigation_mesh_generator.cpp2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptCustomNode.xml10
-rw-r--r--modules/visual_script/visual_script_editor.cpp1
-rw-r--r--modules/visual_script/visual_script_nodes.cpp2
-rw-r--r--platform/android/os_android.cpp5
-rw-r--r--platform/android/os_android.h3
-rw-r--r--platform/haiku/os_haiku.cpp4
-rw-r--r--platform/haiku/os_haiku.h2
-rw-r--r--platform/iphone/SCsub1
-rw-r--r--platform/iphone/export/export.cpp64
-rw-r--r--platform/iphone/os_iphone.cpp7
-rw-r--r--platform/iphone/os_iphone.h3
-rw-r--r--platform/javascript/detect.py7
-rw-r--r--platform/javascript/os_javascript.cpp3
-rw-r--r--platform/javascript/os_javascript.h3
-rw-r--r--platform/osx/SCsub1
-rw-r--r--platform/osx/os_osx.h3
-rw-r--r--platform/osx/os_osx.mm15
-rw-r--r--platform/server/os_server.cpp4
-rw-r--r--platform/server/os_server.h1
-rw-r--r--platform/uwp/os_uwp.cpp5
-rw-r--r--platform/uwp/os_uwp.h3
-rw-r--r--platform/windows/SCsub1
-rw-r--r--platform/windows/context_gl_windows.cpp41
-rw-r--r--platform/windows/context_gl_windows.h3
-rw-r--r--platform/windows/detect.py14
-rw-r--r--platform/windows/export/export.cpp77
-rwxr-xr-xplatform/windows/os_windows.cpp4
-rw-r--r--platform/windows/os_windows.h2
-rw-r--r--platform/x11/os_x11.cpp5
-rw-r--r--platform/x11/os_x11.h3
-rw-r--r--scene/2d/collision_polygon_2d.cpp4
-rw-r--r--scene/2d/collision_shape_2d.cpp4
-rw-r--r--scene/2d/line_2d.cpp18
-rw-r--r--scene/2d/line_2d.h4
-rw-r--r--scene/2d/physics_body_2d.cpp34
-rw-r--r--scene/2d/polygon_2d.cpp4
-rw-r--r--scene/2d/ray_cast_2d.cpp4
-rw-r--r--scene/3d/path.cpp39
-rw-r--r--scene/3d/physics_body.cpp47
-rw-r--r--scene/3d/spatial.cpp3
-rw-r--r--scene/3d/voxel_light_baker.cpp8
-rw-r--r--scene/animation/animation_node_state_machine.cpp33
-rw-r--r--scene/animation/tween.h6
-rw-r--r--scene/gui/button.cpp7
-rw-r--r--scene/gui/file_dialog.cpp10
-rw-r--r--scene/gui/item_list.cpp4
-rw-r--r--scene/gui/line_edit.cpp39
-rw-r--r--scene/gui/line_edit.h2
-rw-r--r--scene/gui/rich_text_effect.cpp13
-rw-r--r--scene/gui/rich_text_effect.h2
-rw-r--r--scene/gui/rich_text_label.cpp3
-rw-r--r--scene/gui/spin_box.cpp4
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/gui/text_edit.h59
-rw-r--r--scene/main/scene_tree.cpp2
-rw-r--r--scene/resources/dynamic_font.cpp1
-rw-r--r--scene/resources/packed_scene.cpp3
-rw-r--r--scene/resources/segment_shape_2d.cpp6
-rw-r--r--scene/resources/texture.cpp1
-rw-r--r--scene/resources/theme.cpp15
-rw-r--r--scene/resources/visual_shader.cpp12
-rw-r--r--scene/resources/visual_shader_nodes.cpp1
-rw-r--r--servers/audio/effects/audio_effect_record.cpp5
-rw-r--r--servers/camera_server.cpp2
-rw-r--r--servers/camera_server.h19
-rw-r--r--servers/physics/joints/cone_twist_joint_sw.cpp2
-rw-r--r--servers/physics/joints/hinge_joint_sw.cpp2
-rw-r--r--servers/physics_2d/physics_2d_server_sw.cpp2
-rw-r--r--servers/visual/shader_language.cpp4
-rw-r--r--servers/visual/visual_server_canvas.cpp4
-rw-r--r--servers/visual/visual_server_canvas.h2
-rw-r--r--servers/visual/visual_server_raster.h2
-rw-r--r--servers/visual/visual_server_wrap_mt.h2
-rw-r--r--servers/visual_server.cpp5
-rw-r--r--servers/visual_server.h2
-rw-r--r--thirdparty/misc/ifaddrs-android.h19
-rw-r--r--thirdparty/vhacd/0003-fix-musl-build.patch15
-rw-r--r--thirdparty/vhacd/inc/vhacdMutex.h4
369 files changed, 3886 insertions, 1282 deletions
diff --git a/.travis.yml b/.travis.yml
index 7bf968ba4c..e7a13e3811 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,7 +20,7 @@ cache:
matrix:
include:
- - name: Static checks (clang-format)
+ - name: Static checks (clang-format) + Documentation checks
stage: check
env: STATIC_CHECKS=yes
os: linux
@@ -129,6 +129,7 @@ before_script:
script:
- if [ "$STATIC_CHECKS" = "yes" ]; then
sh ./misc/travis/clang-format.sh;
+ doc/tools/makerst.py --dry-run doc/classes modules;
else
scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS &&
if [ "$TEST_PROJECT" = "yes" ]; then
diff --git a/SConstruct b/SConstruct
index 0e282a1f12..ce13c8bd2e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -68,8 +68,6 @@ env_base.AppendENVPath('PATH', os.getenv('PATH'))
env_base.AppendENVPath('PKG_CONFIG_PATH', os.getenv('PKG_CONFIG_PATH'))
env_base.disabled_modules = []
env_base.use_ptrcall = False
-env_base.split_drivers = False
-env_base.split_modules = False
env_base.module_version_string = ""
env_base.msvc = False
@@ -129,6 +127,7 @@ opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=extra werro
opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '')
opts.Add(BoolVariable('vsproj', "Generate a Visual Studio solution", False))
opts.Add(EnumVariable('macports_clang', "Build using Clang from MacPorts", 'no', ('no', '5.0', 'devel')))
+opts.Add(BoolVariable('split_libmodules', "Split intermediate libmodules.a in smaller chunks to prevent exceeding linker command line size (forced to True when using MinGW)", False))
opts.Add(BoolVariable('disable_3d', "Disable 3D nodes for a smaller executable", False))
opts.Add(BoolVariable('disable_advanced_gui', "Disable advanced GUI nodes and behaviors", False))
opts.Add(BoolVariable('no_editor_splash', "Don't use the custom splash screen for the editor", False))
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 1544503045..4c8dcc20ea 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -584,6 +584,15 @@ bool _OS::is_vsync_enabled() const {
return OS::get_singleton()->is_vsync_enabled();
}
+void _OS::set_vsync_via_compositor(bool p_enable) {
+ OS::get_singleton()->set_vsync_via_compositor(p_enable);
+}
+
+bool _OS::is_vsync_via_compositor_enabled() const {
+
+ return OS::get_singleton()->is_vsync_via_compositor_enabled();
+}
+
_OS::PowerState _OS::get_power_state() {
return _OS::PowerState(OS::get_singleton()->get_power_state());
}
@@ -1335,6 +1344,9 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_use_vsync", "enable"), &_OS::set_use_vsync);
ClassDB::bind_method(D_METHOD("is_vsync_enabled"), &_OS::is_vsync_enabled);
+ ClassDB::bind_method(D_METHOD("set_vsync_via_compositor", "enable"), &_OS::set_vsync_via_compositor);
+ ClassDB::bind_method(D_METHOD("is_vsync_via_compositor_enabled"), &_OS::is_vsync_via_compositor_enabled);
+
ClassDB::bind_method(D_METHOD("has_feature", "tag_name"), &_OS::has_feature);
ClassDB::bind_method(D_METHOD("get_power_state"), &_OS::get_power_state);
@@ -1349,6 +1361,7 @@ void _OS::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "current_screen"), "set_current_screen", "get_current_screen");
ADD_PROPERTY(PropertyInfo(Variant::INT, "exit_code"), "set_exit_code", "get_exit_code");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vsync_enabled"), "set_use_vsync", "is_vsync_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vsync_via_compositor"), "set_vsync_via_compositor", "is_vsync_via_compositor_enabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "low_processor_usage_mode"), "set_low_processor_usage_mode", "is_in_low_processor_usage_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "low_processor_usage_mode_sleep_usec"), "set_low_processor_usage_mode_sleep_usec", "get_low_processor_usage_mode_sleep_usec");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keep_screen_on"), "set_keep_screen_on", "is_keep_screen_on");
@@ -1371,6 +1384,7 @@ void _OS::_bind_methods() {
ADD_PROPERTY_DEFAULT("current_screen", 0);
ADD_PROPERTY_DEFAULT("exit_code", 0);
ADD_PROPERTY_DEFAULT("vsync_enabled", true);
+ ADD_PROPERTY_DEFAULT("vsync_via_compositor", false);
ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false);
ADD_PROPERTY_DEFAULT("low_processor_usage_mode_sleep_usec", 6900);
ADD_PROPERTY_DEFAULT("keep_screen_on", true);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 18182860c6..d57da36ca5 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -345,6 +345,9 @@ public:
void set_use_vsync(bool p_enable);
bool is_vsync_enabled() const;
+ void set_vsync_via_compositor(bool p_enable);
+ bool is_vsync_via_compositor_enabled() const;
+
PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
diff --git a/core/class_db.h b/core/class_db.h
index 092469beb7..5df425e662 100644
--- a/core/class_db.h
+++ b/core/class_db.h
@@ -284,6 +284,15 @@ public:
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 6);
}
+ template <class N, class M>
+ static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7) {
+
+ MethodBind *bind = create_method_bind(p_method);
+ const Variant *ptr[7] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7 };
+
+ return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 7);
+ }
+
template <class M>
static MethodBind *bind_vararg_method(uint32_t p_flags, StringName p_name, M p_method, const MethodInfo &p_info = MethodInfo(), const Vector<Variant> &p_default_args = Vector<Variant>()) {
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 1904c70f42..bfa272e859 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -173,6 +173,7 @@ Error HTTPClient::request_raw(Method p_method, const String &p_url, const Vector
}
status = STATUS_REQUESTING;
+ head_request = p_method == METHOD_HEAD;
return OK;
}
@@ -228,6 +229,7 @@ Error HTTPClient::request(Method p_method, const String &p_url, const Vector<Str
}
status = STATUS_REQUESTING;
+ head_request = p_method == METHOD_HEAD;
return OK;
}
@@ -269,6 +271,7 @@ void HTTPClient::close() {
connection.unref();
status = STATUS_DISCONNECTED;
+ head_request = false;
if (resolving != IP::RESOLVER_INVALID_ID) {
IP::get_singleton()->erase_resolve_item(resolving);
@@ -470,6 +473,12 @@ Error HTTPClient::poll() {
}
}
+ // This is a HEAD request, we wont receive anything.
+ if (head_request) {
+ body_size = 0;
+ body_left = 0;
+ }
+
if (body_size != -1 || chunked) {
status = STATUS_BODY;
@@ -724,6 +733,7 @@ HTTPClient::HTTPClient() {
tcp_connection.instance();
resolving = IP::RESOLVER_INVALID_ID;
status = STATUS_DISCONNECTED;
+ head_request = false;
conn_port = -1;
body_size = -1;
chunked = false;
diff --git a/core/io/http_client.h b/core/io/http_client.h
index ce7fe0491b..27c6711bcf 100644
--- a/core/io/http_client.h
+++ b/core/io/http_client.h
@@ -166,6 +166,7 @@ private:
bool ssl_verify_host;
bool blocking;
bool handshaking;
+ bool head_request;
Vector<uint8_t> response_str;
diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp
index 443f390bb7..011ebb1812 100644
--- a/core/io/pck_packer.cpp
+++ b/core/io/pck_packer.cpp
@@ -55,9 +55,9 @@ static void _pad(FileAccess *p_file, int p_bytes) {
void PCKPacker::_bind_methods() {
- ClassDB::bind_method(D_METHOD("pck_start", "pck_name", "alignment"), &PCKPacker::pck_start);
+ ClassDB::bind_method(D_METHOD("pck_start", "pck_name", "alignment"), &PCKPacker::pck_start, DEFVAL(0));
ClassDB::bind_method(D_METHOD("add_file", "pck_path", "source_path"), &PCKPacker::add_file);
- ClassDB::bind_method(D_METHOD("flush", "verbose"), &PCKPacker::flush);
+ ClassDB::bind_method(D_METHOD("flush", "verbose"), &PCKPacker::flush, DEFVAL(false));
};
Error PCKPacker::pck_start(const String &p_file, int p_alignment) {
diff --git a/core/io/pck_packer.h b/core/io/pck_packer.h
index 4df495b11f..f5661c55a1 100644
--- a/core/io/pck_packer.h
+++ b/core/io/pck_packer.h
@@ -54,7 +54,7 @@ class PCKPacker : public Reference {
Vector<File> files;
public:
- Error pck_start(const String &p_file, int p_alignment);
+ Error pck_start(const String &p_file, int p_alignment = 0);
Error add_file(const String &p_file, const String &p_src);
Error flush(bool p_verbose = false);
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index f3eba44973..6f64543b3e 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -734,26 +734,49 @@ String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_rem
String new_path = p_path;
- if (translation_remaps.has(new_path)) {
+ if (translation_remaps.has(p_path)) {
+ // translation_remaps has the following format:
+ // { "res://path.png": PoolStringArray( "res://path-ru.png:ru", "res://path-de.png:de" ) }
+
+ // To find the path of the remapped resource, we extract the locale name after
+ // the last ':' to match the project locale.
+ // We also fall back in case of regional locales as done in TranslationServer::translate
+ // (e.g. 'ru_RU' -> 'ru' if the former has no specific mapping).
- Vector<String> &v = *translation_remaps.getptr(new_path);
String locale = TranslationServer::get_singleton()->get_locale();
- if (r_translation_remapped) {
- *r_translation_remapped = true;
- }
- for (int i = 0; i < v.size(); i++) {
+ ERR_FAIL_COND_V_MSG(locale.length() < 2, p_path, "Could not remap path '" + p_path + "' for translation as configured locale '" + locale + "' is invalid.");
+ String lang = TranslationServer::get_language_code(locale);
- int split = v[i].find_last(":");
- if (split == -1)
- continue;
- String l = v[i].right(split + 1).strip_edges();
- if (l == String())
+ Vector<String> &res_remaps = *translation_remaps.getptr(new_path);
+ bool near_match = false;
+
+ for (int i = 0; i < res_remaps.size(); i++) {
+ int split = res_remaps[i].find_last(":");
+ if (split == -1) {
continue;
+ }
- if (l.begins_with(locale)) {
- new_path = v[i].left(split);
+ String l = res_remaps[i].right(split + 1).strip_edges();
+ if (l == locale) { // Exact match.
+ new_path = res_remaps[i].left(split);
break;
+ } else if (near_match) {
+ continue; // Already found near match, keep going for potential exact match.
}
+
+ // No exact match (e.g. locale 'ru_RU' but remap is 'ru'), let's look further
+ // for a near match (same language code, i.e. first 2 or 3 letters before
+ // regional code, if included).
+ if (TranslationServer::get_language_code(l) == lang) {
+ // Language code matches, that's a near match. Keep looking for exact match.
+ near_match = true;
+ new_path = res_remaps[i].left(split);
+ continue;
+ }
+ }
+
+ if (r_translation_remapped) {
+ *r_translation_remapped = true;
}
}
@@ -761,8 +784,8 @@ String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_rem
new_path = path_remaps[new_path];
}
- if (new_path == p_path) { //did not remap
- //try file remap
+ if (new_path == p_path) { // Did not remap.
+ // Try file remap.
Error err;
FileAccess *f = FileAccess::open(p_path + ".remap", FileAccess::READ, &err);
diff --git a/core/math/basis.cpp b/core/math/basis.cpp
index d77501c0f6..09d04a8a2a 100644
--- a/core/math/basis.cpp
+++ b/core/math/basis.cpp
@@ -739,8 +739,8 @@ void Basis::get_axis_angle(Vector3 &r_axis, real_t &r_angle) const {
if ((xx > yy) && (xx > zz)) { // elements[0][0] is the largest diagonal term
if (xx < epsilon) {
x = 0;
- y = 0.7071;
- z = 0.7071;
+ y = Math_SQRT12;
+ z = Math_SQRT12;
} else {
x = Math::sqrt(xx);
y = xy / x;
@@ -748,9 +748,9 @@ void Basis::get_axis_angle(Vector3 &r_axis, real_t &r_angle) const {
}
} else if (yy > zz) { // elements[1][1] is the largest diagonal term
if (yy < epsilon) {
- x = 0.7071;
+ x = Math_SQRT12;
y = 0;
- z = 0.7071;
+ z = Math_SQRT12;
} else {
y = Math::sqrt(yy);
x = xy / y;
@@ -758,8 +758,8 @@ void Basis::get_axis_angle(Vector3 &r_axis, real_t &r_angle) const {
}
} else { // elements[2][2] is the largest diagonal term so base result on this
if (zz < epsilon) {
- x = 0.7071;
- y = 0.7071;
+ x = Math_SQRT12;
+ y = Math_SQRT12;
z = 0;
} else {
z = Math::sqrt(zz);
diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp
index ece293d036..f1d4505c35 100644
--- a/core/math/bsp_tree.cpp
+++ b/core/math/bsp_tree.cpp
@@ -192,14 +192,14 @@ int BSP_Tree::get_points_inside(const Vector3 *p_points, int p_point_count) cons
#ifdef DEBUG_ENABLED
int plane_count = planes.size();
uint16_t plane = nodesptr[idx].plane;
- ERR_FAIL_UNSIGNED_INDEX_V(plane, plane_count, false);
+ ERR_FAIL_UNSIGNED_INDEX_V(plane, plane_count, 0);
#endif
idx = planesptr[nodesptr[idx].plane].is_point_over(point) ? nodes[idx].over : nodes[idx].under;
#ifdef DEBUG_ENABLED
- ERR_FAIL_COND_V(idx < MAX_NODES && idx >= node_count, false);
+ ERR_FAIL_COND_V(idx < MAX_NODES && idx >= node_count, 0);
#endif
}
diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp
index e0ead8446f..ada5107a2c 100644
--- a/core/math/geometry.cpp
+++ b/core/math/geometry.cpp
@@ -1158,7 +1158,7 @@ Vector<Vector<Point2> > Geometry::_polypath_offset(const Vector<Point2> &p_polyp
case END_SQUARE: et = etOpenSquare; break;
case END_ROUND: et = etOpenRound; break;
}
- ClipperOffset co;
+ ClipperOffset co(2.0, 0.25 * SCALE_FACTOR); // Defaults from ClipperOffset.
Path path;
// Need to scale points (Clipper's requirement for robust computation).
diff --git a/core/message_queue.cpp b/core/message_queue.cpp
index a76b5167b6..a254da89c6 100644
--- a/core/message_queue.cpp
+++ b/core/message_queue.cpp
@@ -129,9 +129,6 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) {
uint8_t room_needed = sizeof(Message);
if ((buffer_end + room_needed) >= buffer_size) {
- String type;
- if (ObjectDB::get_instance(p_id))
- type = ObjectDB::get_instance(p_id)->get_class();
print_line("Failed notification: " + itos(p_notification) + " target ID: " + itos(p_id));
statistics();
ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings.");
diff --git a/core/os/midi_driver.cpp b/core/os/midi_driver.cpp
index 7cb7ae130f..81871d6c4f 100644
--- a/core/os/midi_driver.cpp
+++ b/core/os/midi_driver.cpp
@@ -33,6 +33,7 @@
#include "core/os/os.h"
#include "main/input_default.h"
+uint8_t MIDIDriver::last_received_message = 0x00;
MIDIDriver *MIDIDriver::singleton = NULL;
MIDIDriver *MIDIDriver::get_singleton() {
@@ -48,33 +49,42 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
Ref<InputEventMIDI> event;
event.instance();
+ uint32_t param_position = 1;
if (length >= 1) {
- event->set_channel(data[0] & 0xF);
- event->set_message(data[0] >> 4);
+ if ((data[0] & 0x80) == 0x00) {
+ // running status
+ event->set_channel(last_received_message & 0xF);
+ event->set_message(last_received_message >> 4);
+ param_position = 0;
+ } else {
+ event->set_channel(data[0] & 0xF);
+ event->set_message(data[0] >> 4);
+ param_position = 1;
+ last_received_message = data[0];
+ }
}
switch (event->get_message()) {
case MIDI_MESSAGE_AFTERTOUCH:
- if (length >= 3) {
- event->set_pitch(data[1]);
- event->set_pressure(data[2]);
+ if (length >= 2 + param_position) {
+ event->set_pitch(data[param_position]);
+ event->set_pressure(data[param_position + 1]);
}
break;
case MIDI_MESSAGE_CONTROL_CHANGE:
- if (length >= 3) {
- event->set_controller_number(data[1]);
- event->set_controller_value(data[2]);
+ if (length >= 2 + param_position) {
+ event->set_controller_number(data[param_position]);
+ event->set_controller_value(data[param_position + 1]);
}
break;
case MIDI_MESSAGE_NOTE_ON:
case MIDI_MESSAGE_NOTE_OFF:
- case MIDI_MESSAGE_PITCH_BEND:
- if (length >= 3) {
- event->set_pitch(data[1]);
- event->set_velocity(data[2]);
+ if (length >= 2 + param_position) {
+ event->set_pitch(data[param_position]);
+ event->set_velocity(data[param_position + 1]);
if (event->get_message() == MIDI_MESSAGE_NOTE_ON && event->get_velocity() == 0) {
// https://www.midi.org/forum/228-writing-midi-software-send-note-off,-or-zero-velocity-note-on
@@ -83,15 +93,21 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
}
break;
+ case MIDI_MESSAGE_PITCH_BEND:
+ if (length >= 2 + param_position) {
+ event->set_pitch((data[param_position + 1] << 7) | data[param_position]);
+ }
+ break;
+
case MIDI_MESSAGE_PROGRAM_CHANGE:
- if (length >= 2) {
- event->set_instrument(data[1]);
+ if (length >= 1 + param_position) {
+ event->set_instrument(data[param_position]);
}
break;
case MIDI_MESSAGE_CHANNEL_PRESSURE:
- if (length >= 2) {
- event->set_pressure(data[1]);
+ if (length >= 1 + param_position) {
+ event->set_pressure(data[param_position]);
}
break;
}
diff --git a/core/os/midi_driver.h b/core/os/midi_driver.h
index e0e5e2be67..33f49d19f5 100644
--- a/core/os/midi_driver.h
+++ b/core/os/midi_driver.h
@@ -41,6 +41,7 @@
class MIDIDriver {
static MIDIDriver *singleton;
+ static uint8_t last_received_message;
public:
static MIDIDriver *get_singleton();
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 25889de1b3..2d61417b4f 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -572,6 +572,14 @@ bool OS::is_vsync_enabled() const {
return _use_vsync;
}
+void OS::set_vsync_via_compositor(bool p_enable) {
+ _vsync_via_compositor = p_enable;
+}
+
+bool OS::is_vsync_via_compositor_enabled() const {
+ return _vsync_via_compositor;
+}
+
OS::PowerState OS::get_power_state() {
return POWERSTATE_UNKNOWN;
}
diff --git a/core/os/os.h b/core/os/os.h
index 687ccaaba5..26db629d7c 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -60,6 +60,9 @@ class OS {
bool _allow_hidpi;
bool _allow_layered;
bool _use_vsync;
+ bool _vsync_via_compositor;
+
+ char *last_error;
void *_stack_bottom;
@@ -98,9 +101,10 @@ public:
bool maximized;
bool always_on_top;
bool use_vsync;
+ bool vsync_via_compositor;
bool layered;
float get_aspect() const { return (float)width / (float)height; }
- VideoMode(int p_width = 1024, int p_height = 600, bool p_fullscreen = false, bool p_resizable = true, bool p_borderless_window = false, bool p_maximized = false, bool p_always_on_top = false, bool p_use_vsync = false) {
+ VideoMode(int p_width = 1024, int p_height = 600, bool p_fullscreen = false, bool p_resizable = true, bool p_borderless_window = false, bool p_maximized = false, bool p_always_on_top = false, bool p_use_vsync = false, bool p_vsync_via_compositor = false) {
width = p_width;
height = p_height;
fullscreen = p_fullscreen;
@@ -109,6 +113,7 @@ public:
maximized = p_maximized;
always_on_top = p_always_on_top;
use_vsync = p_use_vsync;
+ vsync_via_compositor = p_vsync_via_compositor;
layered = false;
}
};
@@ -507,6 +512,9 @@ public:
//real, actual overridable function to switch vsync, which needs to be called from graphics thread if needed
virtual void _set_use_vsync(bool p_enable) {}
+ void set_vsync_via_compositor(bool p_enable);
+ bool is_vsync_via_compositor_enabled() const;
+
virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/core/translation.cpp b/core/translation.cpp
index 4a1ac26433..4a662b2590 100644
--- a/core/translation.cpp
+++ b/core/translation.cpp
@@ -792,11 +792,6 @@ static const char *locale_renames[][2] = {
{ NULL, NULL }
};
-static String get_trimmed_locale(const String &p_locale) {
-
- return p_locale.substr(0, 2);
-}
-
///////////////////////////////////////////////
PoolVector<String> Translation::_get_messages() const {
@@ -846,7 +841,7 @@ void Translation::set_locale(const String &p_locale) {
String univ_locale = TranslationServer::standardize_locale(p_locale);
if (!TranslationServer::is_locale_valid(univ_locale)) {
- String trimmed_locale = get_trimmed_locale(univ_locale);
+ String trimmed_locale = TranslationServer::get_language_code(univ_locale);
ERR_FAIL_COND_MSG(!TranslationServer::is_locale_valid(trimmed_locale), "Invalid locale: " + trimmed_locale + ".");
@@ -945,12 +940,29 @@ String TranslationServer::standardize_locale(const String &p_locale) {
return univ_locale;
}
+String TranslationServer::get_language_code(const String &p_locale) {
+
+ ERR_FAIL_COND_V_MSG(p_locale.length() < 2, p_locale, "Invalid locale '" + p_locale + "'.");
+ // Most language codes are two letters, but some are three,
+ // so we have to look for a regional code separator ('_' or '-')
+ // to extract the left part.
+ // For example we get 'nah_MX' as input and should return 'nah'.
+ int split = p_locale.find("_");
+ if (split == -1) {
+ split = p_locale.find("-");
+ }
+ if (split == -1) { // No separator, so the locale is already only a language code.
+ return p_locale;
+ }
+ return p_locale.left(split);
+}
+
void TranslationServer::set_locale(const String &p_locale) {
String univ_locale = standardize_locale(p_locale);
if (!is_locale_valid(univ_locale)) {
- String trimmed_locale = get_trimmed_locale(univ_locale);
+ String trimmed_locale = get_language_code(univ_locale);
print_verbose(vformat("Unsupported locale '%s', falling back to '%s'.", p_locale, trimmed_locale));
if (!is_locale_valid(trimmed_locale)) {
@@ -1039,11 +1051,13 @@ void TranslationServer::clear() {
StringName TranslationServer::translate(const StringName &p_message) const {
- //translate using locale
+ // Match given message against the translation catalog for the project locale.
if (!enabled)
return p_message;
+ ERR_FAIL_COND_V_MSG(locale.length() < 2, p_message, "Could not translate message as configured locale '" + locale + "' is invalid.");
+
// Locale can be of the form 'll_CC', i.e. language code and regional code,
// e.g. 'en_US', 'en_GB', etc. It might also be simply 'll', e.g. 'en'.
// To find the relevant translation, we look for those with locale starting
@@ -1051,67 +1065,78 @@ StringName TranslationServer::translate(const StringName &p_message) const {
// form. If not found, we fall back to a near match (another locale with
// same language code).
+ // Note: ResourceLoader::_path_remap reproduces this locale near matching
+ // logic, so be sure to propagate changes there when changing things here.
+
StringName res;
+ String lang = get_language_code(locale);
bool near_match = false;
- const CharType *lptr = &locale[0];
for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) {
-
const Ref<Translation> &t = E->get();
- ERR_FAIL_COND_V(t.is_null(), StringName(""));
+ ERR_FAIL_COND_V(t.is_null(), p_message);
String l = t->get_locale();
- if (lptr[0] != l[0] || lptr[1] != l[1])
- continue; // Language code does not match.
bool exact_match = (l == locale);
- if (!exact_match && near_match)
- continue; // Only near-match once, but keep looking for exact matches.
+ if (!exact_match) {
+ if (near_match) {
+ continue; // Only near-match once, but keep looking for exact matches.
+ }
+ if (get_language_code(l) != lang) {
+ continue; // Language code does not match.
+ }
+ }
StringName r = t->get_message(p_message);
-
- if (!r)
+ if (!r) {
continue;
-
+ }
res = r;
- if (exact_match)
+ if (exact_match) {
break;
- else
+ } else {
near_match = true;
+ }
}
if (!res && fallback.length() >= 2) {
// Try again with the fallback locale.
- const CharType *fptr = &fallback[0];
+ String fallback_lang = get_language_code(fallback);
near_match = false;
- for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) {
+ for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) {
const Ref<Translation> &t = E->get();
- ERR_FAIL_COND_V(t.is_null(), StringName(""));
+ ERR_FAIL_COND_V(t.is_null(), p_message);
String l = t->get_locale();
- if (fptr[0] != l[0] || fptr[1] != l[1])
- continue; // Language code does not match.
bool exact_match = (l == fallback);
- if (!exact_match && near_match)
- continue; // Only near-match once, but keep looking for exact matches.
+ if (!exact_match) {
+ if (near_match) {
+ continue; // Only near-match once, but keep looking for exact matches.
+ }
+ if (get_language_code(l) != fallback_lang) {
+ continue; // Language code does not match.
+ }
+ }
StringName r = t->get_message(p_message);
-
- if (!r)
+ if (!r) {
continue;
-
+ }
res = r;
- if (exact_match)
+ if (exact_match) {
break;
- else
+ } else {
near_match = true;
+ }
}
}
- if (!res)
+ if (!res) {
return p_message;
+ }
return res;
}
diff --git a/core/translation.h b/core/translation.h
index d172b9ecf2..834374bda6 100644
--- a/core/translation.h
+++ b/core/translation.h
@@ -105,6 +105,7 @@ public:
static Vector<String> get_all_locale_names();
static bool is_locale_valid(const String &p_locale);
static String standardize_locale(const String &p_locale);
+ static String get_language_code(const String &p_locale);
void set_tool_translation(const Ref<Translation> &p_translation);
StringName tool_translate(const StringName &p_message) const;
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 25930db201..6a1dc2295f 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -1917,7 +1917,7 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
1.0e256
};
- int sign, expSign = false;
+ bool sign, expSign = false;
double fraction, dblExp;
const double *d;
const C *p;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 6e593a308d..f6ecc506a4 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -1187,31 +1187,6 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
default: return Variant();
}
- } else if (p_argcount > 1) {
-
- _VariantCall::ConstructFunc &c = _VariantCall::construct_funcs[p_type];
-
- for (List<_VariantCall::ConstructData>::Element *E = c.constructors.front(); E; E = E->next()) {
- const _VariantCall::ConstructData &cd = E->get();
-
- if (cd.arg_count != p_argcount)
- continue;
-
- //validate parameters
- for (int i = 0; i < cd.arg_count; i++) {
- if (!Variant::can_convert(p_args[i]->type, cd.arg_types[i])) {
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; //no such constructor
- r_error.argument = i;
- r_error.expected = cd.arg_types[i];
- return Variant();
- }
- }
-
- Variant v;
- cd.func(v, p_args);
- return v;
- }
-
} else if (p_argcount == 1 && p_args[0]->type == p_type) {
return *p_args[0]; //copy construct
} else if (p_argcount == 1 && (!p_strict || Variant::can_convert(p_args[0]->type, p_type))) {
@@ -1268,6 +1243,30 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
case POOL_COLOR_ARRAY: return (PoolColorArray(*p_args[0]));
default: return Variant();
}
+ } else if (p_argcount >= 1) {
+
+ _VariantCall::ConstructFunc &c = _VariantCall::construct_funcs[p_type];
+
+ for (List<_VariantCall::ConstructData>::Element *E = c.constructors.front(); E; E = E->next()) {
+ const _VariantCall::ConstructData &cd = E->get();
+
+ if (cd.arg_count != p_argcount)
+ continue;
+
+ //validate parameters
+ for (int i = 0; i < cd.arg_count; i++) {
+ if (!Variant::can_convert(p_args[i]->type, cd.arg_types[i])) {
+ r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; //no such constructor
+ r_error.argument = i;
+ r_error.expected = cd.arg_types[i];
+ return Variant();
+ }
+ }
+
+ Variant v;
+ cd.func(v, p_args);
+ return v;
+ }
}
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; //no such constructor
return Variant();
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index 61e1ea9b8d..b64f926921 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -66,7 +66,7 @@
<return type="int">
</return>
<description>
- Returns the index of the longest axis of the [AABB] (according to [Vector3]::AXIS* enum).
+ Returns the index of the longest axis of the [AABB] (according to [Vector3]'s [code]AXIS_*[/code] constants).
</description>
</method>
<method name="get_longest_axis_size">
@@ -182,6 +182,7 @@
<argument index="0" name="aabb" type="AABB">
</argument>
<description>
+ Returns [code]true[/code] if this [AABB] and [code]aabb[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="merge">
@@ -190,7 +191,7 @@
<argument index="0" name="with" type="AABB">
</argument>
<description>
- Returns a larger AABB that contains this AABB and [code]with[/code].
+ Returns a larger [AABB] that contains both this [AABB] and [code]with[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/ARVRController.xml b/doc/classes/ARVRController.xml
index 9c6cfc1d7d..24d8b48077 100644
--- a/doc/classes/ARVRController.xml
+++ b/doc/classes/ARVRController.xml
@@ -22,7 +22,7 @@
<return type="int" enum="ARVRPositionalTracker.TrackerHand">
</return>
<description>
- Returns the hand holding this controller, if known. See [code]TRACKER_*[/code] constants in [ARVRPositionalTracker].
+ Returns the hand holding this controller, if known. See [enum ARVRPositionalTracker.TrackerHand].
</description>
</method>
<method name="get_is_active" qualifiers="const">
@@ -61,7 +61,7 @@
<argument index="0" name="button" type="int">
</argument>
<description>
- Returns [code]true[/code] if the button at index [code]button[/code] is pressed.
+ Returns [code]true[/code] if the button at index [code]button[/code] is pressed. See [enum JoystickList], in particular the [code]JOY_VR_*[/code] constants.
</description>
</method>
</methods>
@@ -73,7 +73,8 @@
When a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off.
</member>
<member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0">
- The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. If changed, updates [member ARVRPositionalTracker.rumble] accordingly.
+ The degree to which the controller vibrates. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. If changed, updates [member ARVRPositionalTracker.rumble] accordingly.
+ This is a useful property to animate if you want the controller to vibrate for a limited duration.
</member>
</members>
<signals>
diff --git a/doc/classes/ARVRInterface.xml b/doc/classes/ARVRInterface.xml
index 1da1351e49..41effcaecb 100644
--- a/doc/classes/ARVRInterface.xml
+++ b/doc/classes/ARVRInterface.xml
@@ -21,7 +21,7 @@
<return type="int">
</return>
<description>
- Returns a combination of flags providing information about the capabilities of this interface.
+ Returns a combination of [enum Capabilities] flags providing information about the capabilities of this interface.
</description>
</method>
<method name="get_name" qualifiers="const">
@@ -51,9 +51,9 @@
<description>
Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output.
After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence.
- [b]Note:[/b] You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot such as for mobile VR.
- If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport and it will be used to output to the HMD leaving you free to do anything you like in the main window such as using a separate camera as a spectator camera or render out something completely different.
- While currently not used you can activate additional interfaces, you may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD.
+ [b]Note:[/b] You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR.
+ If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different.
+ While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD.
</description>
</method>
<method name="is_stereo">
@@ -73,13 +73,13 @@
</methods>
<members>
<member name="ar_is_anchor_detection_enabled" type="bool" setter="set_anchor_detection_is_enabled" getter="get_anchor_detection_is_enabled" default="false">
- On an AR interface, is our anchor detection enabled?
+ On an AR interface, [code]true[/code] if anchor detection is enabled.
</member>
<member name="interface_is_initialized" type="bool" setter="set_is_initialized" getter="is_initialized" default="false">
- Has this interface been initialized?
+ [code]true[/code] if this interface been initialized.
</member>
<member name="interface_is_primary" type="bool" setter="set_is_primary" getter="is_primary" default="false">
- Is this our primary interface?
+ [code]true[/code] if this is the primary interface.
</member>
</members>
<constants>
@@ -93,10 +93,10 @@
This interface supports stereoscopic rendering.
</constant>
<constant name="ARVR_AR" value="4" enum="Capabilities">
- This interface support AR (video background and real world tracking).
+ This interface supports AR (video background and real world tracking).
</constant>
<constant name="ARVR_EXTERNAL" value="8" enum="Capabilities">
- This interface outputs to an external device, if the main viewport is used the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [method get_render_targetsize]). Using a separate viewport node frees up the main viewport for other purposes.
+ This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [method get_render_targetsize]). Using a separate viewport node frees up the main viewport for other purposes.
</constant>
<constant name="EYE_MONO" value="0" enum="Eyes">
Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported.
@@ -111,7 +111,7 @@
Tracking is behaving as expected.
</constant>
<constant name="ARVR_EXCESSIVE_MOTION" value="1" enum="Tracking_status">
- Tracking is hindered by excessive motion, player is moving faster than tracking can keep up.
+ Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up).
</constant>
<constant name="ARVR_INSUFFICIENT_FEATURES" value="2" enum="Tracking_status">
Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc.
diff --git a/doc/classes/ARVRPositionalTracker.xml b/doc/classes/ARVRPositionalTracker.xml
index 5551d48a08..c4acfd3b51 100644
--- a/doc/classes/ARVRPositionalTracker.xml
+++ b/doc/classes/ARVRPositionalTracker.xml
@@ -15,7 +15,7 @@
<return type="int" enum="ARVRPositionalTracker.TrackerHand">
</return>
<description>
- Returns the hand holding this tracker, if known. See [code]TRACKER_*[/code] constants.
+ Returns the hand holding this tracker, if known. See [enum TrackerHand] constants.
</description>
</method>
<method name="get_joy_id" qualifiers="const">
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index 97da8c9980..9924f75289 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -656,7 +656,7 @@
<argument index="1" name="mode" type="int" enum="Animation.UpdateMode">
</argument>
<description>
- Sets the update mode ([code]UPDATE_*[/code]) of a value track.
+ Sets the update mode (see [enum UpdateMode]) of a value track.
</description>
</method>
</methods>
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml
index 60d04649a8..a47b4a590e 100644
--- a/doc/classes/AnimationPlayer.xml
+++ b/doc/classes/AnimationPlayer.xml
@@ -106,7 +106,7 @@
<return type="float">
</return>
<description>
- Gets the actual playing speed of current animation or 0 if not playing. This speed is the [code]playback_speed[/code] property multiplied by [code]custom_speed[/code] argument specified when calling the [code]play[/code] method.
+ Gets the actual playing speed of current animation or 0 if not playing. This speed is the [member playback_speed] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method.
</description>
</method>
<method name="get_queue">
@@ -144,9 +144,9 @@
<argument index="3" name="from_end" type="bool" default="false">
</argument>
<description>
- Plays the animation with key [code]name[/code]. Custom speed and blend times can be set. If [code]custom_speed[/code] is negative and [code]from_end[/code] is [code]true[/code], the animation will play backwards.
- If the animation has been paused by [method stop], it will be resumed. Calling [method play] without arguments will also resume the animation.
- [b]Note:[/b] The animation will be updated the next time the AnimationPlayer is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call [code]advance(0)[/code].
+ Plays the animation with key [code]name[/code]. Custom blend times and speed can be set. If [code]custom_speed[/code] is negative and [code]from_end[/code] is [code]true[/code], the animation will play backwards (which is equivalent to calling [method play_backwards]).
+ The [AnimationPlayer] keeps track of its current or last played animation with [member assigned_animation]. If this method is called with that same animation [code]name[/code], or with no [code]name[/code] parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see [method stop] for both pause and stop). If the animation was already playing, it will keep playing.
+ [b]Note:[/b] The animation will be updated the next time the [AnimationPlayer] is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call [code]advance(0)[/code].
</description>
</method>
<method name="play_backwards">
@@ -158,8 +158,7 @@
</argument>
<description>
Plays the animation with key [code]name[/code] in reverse.
- If the animation has been paused by [code]stop(true)[/code], it will be resumed backwards. Calling [code]play_backwards()[/code] without arguments will also resume the animation backwards.
- [b]Note:[/b] This is the same as [code]play[/code] in regards to process/update behavior.
+ This method is a shorthand for [method play] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information.
</description>
</method>
<method name="queue">
@@ -222,8 +221,8 @@
<argument index="0" name="reset" type="bool" default="true">
</argument>
<description>
- Stops the currently playing animation. If [code]reset[/code] is [code]true[/code], the animation position is reset to [code]0[/code] and the playback speed is reset to [code]1.0[/code].
- If [code]reset[/code] is [code]false[/code], then calling [method play] without arguments or [code]play("same_as_before")[/code] will resume the animation. Works the same for the [method play_backwards].
+ Stops or pauses the currently playing animation. If [code]reset[/code] is [code]true[/code], the animation position is reset to [code]0[/code] and the playback speed is reset to [code]1.0[/code].
+ If [code]reset[/code] is [code]false[/code], the [member current_animation_position] will be kept and calling [method play] or [method play_backwards] without arguments or with the same animation name as [member assigned_animation] will resume the animation.
</description>
</method>
</methods>
diff --git a/doc/classes/AnimationTreePlayer.xml b/doc/classes/AnimationTreePlayer.xml
index 3b6003b478..0d7a34b179 100644
--- a/doc/classes/AnimationTreePlayer.xml
+++ b/doc/classes/AnimationTreePlayer.xml
@@ -285,7 +285,7 @@
<argument index="0" name="id" type="String">
</argument>
<description>
- Gets the node type, will return from [code]NODE_*[/code] enum.
+ Gets the node type, will return from [enum NodeType] enum.
</description>
</method>
<method name="node_rename">
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index 9f32691e57..62ff0edbd2 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -47,7 +47,7 @@
</argument>
<description>
Creates a new surface.
- Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. See [Mesh] for details. (As a note, when using indices, it is recommended to only use points, lines or triangles). [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
+ Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
The [code]arrays[/code] argument is an array of arrays. See [enum ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant ARRAY_INDEX] if it is used.
Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices.
Godot uses clockwise winding order for front faces of triangle primitive modes.
diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml
index 4bc29335ff..89fc18476b 100644
--- a/doc/classes/AudioStreamPlayer.xml
+++ b/doc/classes/AudioStreamPlayer.xml
@@ -57,7 +57,7 @@
Bus on which this audio is playing.
</member>
<member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" enum="AudioStreamPlayer.MixTarget" default="0">
- If the audio configuration has more than two speakers, this sets the target channels. See [code]MIX_TARGET_*[/code] constants.
+ If the audio configuration has more than two speakers, this sets the target channels. See [enum MixTarget] constants.
</member>
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0">
Changes the pitch and the tempo of the audio.
diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml
index a496902ded..bb418f3c36 100644
--- a/doc/classes/AudioStreamSample.xml
+++ b/doc/classes/AudioStreamSample.xml
@@ -27,7 +27,7 @@
[b]Note:[/b] This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte.
</member>
<member name="format" type="int" setter="set_format" getter="get_format" enum="AudioStreamSample.Format" default="0">
- Audio format. See [code]FORMAT_*[/code] constants for values.
+ Audio format. See [enum Format] constants for values.
</member>
<member name="loop_begin" type="int" setter="set_loop_begin" getter="get_loop_begin" default="0">
Loop start in bytes.
@@ -36,7 +36,7 @@
Loop end in bytes.
</member>
<member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" enum="AudioStreamSample.LoopMode" default="0">
- Loop mode. See [code]LOOP_*[/code] constants for values.
+ Loop mode. See [enum LoopMode] constants for values.
</member>
<member name="mix_rate" type="int" setter="set_mix_rate" getter="get_mix_rate" default="44100">
The sample rate for mixing this audio.
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index b4f4b21afd..21f46efe84 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -22,14 +22,14 @@
<argument index="0" name="button_pressed" type="bool">
</argument>
<description>
- Called when the button is toggled (only if toggle_mode is active).
+ Called when the button is toggled (only if [member toggle_mode] is active).
</description>
</method>
<method name="get_draw_mode" qualifiers="const">
<return type="int" enum="BaseButton.DrawMode">
</return>
<description>
- Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to "draw" signal. The visual state of the button is defined by the [code]DRAW_*[/code] enum.
+ Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to "draw" signal. The visual state of the button is defined by the [enum DrawMode] enum.
</description>
</method>
<method name="is_hovered" qualifiers="const">
@@ -42,7 +42,7 @@
</methods>
<members>
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="BaseButton.ActionMode" default="1">
- Determines when the button is considered clicked, one of the [code]ACTION_MODE_*[/code] constants.
+ Determines when the button is considered clicked, one of the [enum ActionMode] constants.
</member>
<member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" default="1">
Binary mask to choose which mouse buttons this button will respond to.
@@ -62,7 +62,7 @@
If [code]true[/code], the button stays pressed when moving the cursor outside the button while pressing it.
</member>
<member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
- If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if toggle_mode is active).
+ If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if [member toggle_mode] is active).
</member>
<member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut">
[ShortCut] associated to the button.
diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml
index df9438e695..5a7fc0a41b 100644
--- a/doc/classes/Basis.xml
+++ b/doc/classes/Basis.xml
@@ -102,6 +102,7 @@
<argument index="1" name="epsilon" type="float" default="0.00001">
</argument>
<description>
+ Returns [code]true[/code] if this basis and [code]b[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="orthonormalized">
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml
index 305be8b58d..3b73580294 100644
--- a/doc/classes/Button.xml
+++ b/doc/classes/Button.xml
@@ -12,7 +12,7 @@
</methods>
<members>
<member name="align" type="int" setter="set_text_align" getter="get_text_align" enum="Button.TextAlign" default="1">
- Text alignment policy for the button's text, use one of the [code]ALIGN_*[/code] constants.
+ Text alignment policy for the button's text, use one of the [enum TextAlign] constants.
</member>
<member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" default="false">
When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text.
diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml
index 3b4313b204..aca53d4ed0 100644
--- a/doc/classes/Camera.xml
+++ b/doc/classes/Camera.xml
@@ -38,12 +38,14 @@
<argument index="0" name="layer" type="int">
</argument>
<description>
+ Returns [code]true[/code] if the given [code]layer[/code] in the [member cull_mask] is enabled, [code]false[/code] otherwise.
</description>
</method>
<method name="get_frustum" qualifiers="const">
<return type="Array">
</return>
<description>
+ Returns the camera's frustum planes in world-space units as an array of [Plane]s in the following order: near, far, left, top, right, bottom. Not to be confused with [member frustum_offset].
</description>
</method>
<method name="is_position_behind" qualifiers="const">
@@ -109,6 +111,7 @@
<argument index="1" name="enable" type="bool">
</argument>
<description>
+ Enables or disables the given [code]layer[/code] in the [member cull_mask].
</description>
</method>
<method name="set_frustum">
@@ -123,6 +126,7 @@
<argument index="3" name="z_far" type="float">
</argument>
<description>
+ Sets the camera projection to frustum mode (see [constant PROJECTION_FRUSTUM]), by specifying a [code]size[/code], an [code]offset[/code], and the [code]z_near[/code] and [code]z_far[/code] clip planes in world-space units.
</description>
</method>
<method name="set_orthogonal">
@@ -135,7 +139,7 @@
<argument index="2" name="z_far" type="float">
</argument>
<description>
- Sets the camera projection to orthogonal mode, by specifying a width and the [code]near[/code] and [code]far[/code] clip planes in worldspace units. (As a hint, 2D games often use this projection, with values specified in pixels)
+ Sets the camera projection to orthogonal mode (see [constant PROJECTION_ORTHOGONAL]), by specifying a [code]size[/code], and the [code]z_near[/code] and [code]z_far[/code] clip planes in world-space units. (As a hint, 2D games often use this projection, with values specified in pixels.)
</description>
</method>
<method name="set_perspective">
@@ -148,7 +152,7 @@
<argument index="2" name="z_far" type="float">
</argument>
<description>
- Sets the camera projection to perspective mode, by specifying a [code]fov[/code] angle in degrees (FOV means Field of View), and the [code]near[/code] and [code]far[/code] clip planes in world-space units.
+ Sets the camera projection to perspective mode (see [constant PROJECTION_PERSPECTIVE]), by specifying a [code]fov[/code] (field of view) angle in degrees, and the [code]z_near[/code] and [code]z_far[/code] clip planes in world-space units.
</description>
</method>
<method name="unproject_position" qualifiers="const">
@@ -169,7 +173,7 @@
If [code]true[/code], the ancestor [Viewport] is currently using this camera.
</member>
<member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="Camera.DopplerTracking" default="0">
- If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the Doppler effect for objects changed in particular [code]_process[/code] methods. See [enum DopplerTracking] for possible values.
+ If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular [code]_process[/code] methods. See [enum DopplerTracking] for possible values.
</member>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The [Environment] to use for this camera.
@@ -181,6 +185,7 @@
The camera's field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, [code]fov[/code] sets the other axis' field of view angle.
</member>
<member name="frustum_offset" type="Vector2" setter="set_frustum_offset" getter="get_frustum_offset" default="Vector2( 0, 0 )">
+ The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url].
</member>
<member name="h_offset" type="float" setter="set_h_offset" getter="get_h_offset" default="0.0">
The horizontal (X) offset of the camera viewport.
@@ -218,13 +223,13 @@
Preserves the vertical aspect ratio; also known as Hor+ scaling. This is usually the best option for projects running in landscape mode, as wider aspect ratios will automatically benefit from a wider horizontal FOV.
</constant>
<constant name="DOPPLER_TRACKING_DISABLED" value="0" enum="DopplerTracking">
- Disables Doppler effect simulation (default).
+ Disables [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] simulation (default).
</constant>
<constant name="DOPPLER_TRACKING_IDLE_STEP" value="1" enum="DopplerTracking">
- Simulate Doppler effect by tracking positions of objects that are changed in [code]_process[/code]. Changes in the relative velocity of this camera compared to those objects affect how Audio is perceived (changing the Audio's [code]pitch shift[/code]).
+ Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in [code]_process[/code]. Changes in the relative velocity of this camera compared to those objects affect how Audio is perceived (changing the Audio's [code]pitch shift[/code]).
</constant>
<constant name="DOPPLER_TRACKING_PHYSICS_STEP" value="2" enum="DopplerTracking">
- Simulate Doppler effect by tracking positions of objects that are changed in [code]_physics_process[/code]. Changes in the relative velocity of this camera compared to those objects affect how Audio is perceived (changing the Audio's [code]pitch shift[/code]).
+ Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in [code]_physics_process[/code]. Changes in the relative velocity of this camera compared to those objects affect how Audio is perceived (changing the Audio's [code]pitch shift[/code]).
</constant>
</constants>
</class>
diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml
index 6f1627e296..b575fa72e0 100644
--- a/doc/classes/Camera2D.xml
+++ b/doc/classes/Camera2D.xml
@@ -103,7 +103,7 @@
</methods>
<members>
<member name="anchor_mode" type="int" setter="set_anchor_mode" getter="get_anchor_mode" enum="Camera2D.AnchorMode" default="1">
- The Camera2D's anchor point. See [code]ANCHOR_MODE_*[/code] constants.
+ The Camera2D's anchor point. See [enum AnchorMode] constants.
</member>
<member name="current" type="bool" setter="_set_current" getter="is_current" default="false">
If [code]true[/code], the camera is the active camera for the current scene. Only one camera can be current, so setting a different camera [code]current[/code] will disable this one.
diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml
index e03229abe1..ef9a366c86 100644
--- a/doc/classes/CharFXTransform.xml
+++ b/doc/classes/CharFXTransform.xml
@@ -1,39 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CharFXTransform" inherits="Reference" category="Core" version="3.2">
<brief_description>
+ Controls how an individual character will be displayed in a [RichTextEffect].
</brief_description>
<description>
+ By setting various properties on this object, you can control how individual characters will be displayed in a [RichTextEffect].
</description>
<tutorials>
+ <link>http://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
+ <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
</tutorials>
<methods>
- <method name="get_value_or">
- <return type="Variant">
- </return>
- <argument index="0" name="key" type="String">
- </argument>
- <argument index="1" name="default_value" type="Variant">
- </argument>
- <description>
- </description>
- </method>
</methods>
<members>
<member name="absolute_index" type="int" setter="set_absolute_index" getter="get_absolute_index" default="0">
+ The index of the current character (starting from 0). Setting this property won't affect drawing.
</member>
<member name="character" type="int" setter="set_character" getter="get_character" default="0">
+ The Unicode codepoint the character will use. This only affects non-whitespace characters. [method @GDScript.ord] can be useful here. For example, the following will replace all characters with asterisks:
+ [codeblock]
+ # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`.
+ # See the RichTextEffect documentation for details.
+ char_fx.character = ord("*")
+ [/codeblock]
</member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )">
+ The color the character will be drawn with.
</member>
<member name="elapsed_time" type="float" setter="set_elapsed_time" getter="get_elapsed_time" default="0.0">
+ The time elapsed since the [RichTextLabel] was added to the scene tree (in seconds). Time stops when the project is paused, unless the [RichTextLabel]'s [member Node.pause_mode] is set to [constant Node.PAUSE_MODE_PROCESS].
+ [b]Note:[/b] Time still passes while the [RichTextLabel] is hidden.
</member>
<member name="env" type="Dictionary" setter="set_environment" getter="get_environment" default="{}">
+ Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as [bool], [int] or [float], they will be converted automatically. Color codes in the form [code]#rrggbb[/code] or [code]#rgb[/code] will be converted to an opaque [Color]. String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string.
+ For example, the opening BBCode tag [code][example foo=hello bar=true baz=42 color=#ffffff][/code] will map to the following [Dictionary]:
+ [codeblock]
+ {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)}
+ [/codeblock]
</member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
+ The position offset the character will be drawn with (in pixels).
</member>
<member name="relative_index" type="int" setter="set_relative_index" getter="get_relative_index" default="0">
+ The index of the current character (starting from 0). Setting this property won't affect drawing.
</member>
<member name="visible" type="bool" setter="set_visibility" getter="is_visible" default="true">
+ If [code]true[/code], the character will be drawn. If [code]false[/code], the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [member color] to [code]Color(1, 1, 1, 0)[/code] instead.
</member>
</members>
<constants>
diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml
index fe46d45f71..1d935a3e99 100644
--- a/doc/classes/CollisionPolygon2D.xml
+++ b/doc/classes/CollisionPolygon2D.xml
@@ -4,7 +4,7 @@
Defines a 2D collision polygon.
</brief_description>
<description>
- Provides a 2D collision polygon to a [CollisionObject2D] parent. Polygon can be drawn in the editor or specified by a list of vertices.
+ Provides a 2D collision polygon to a [CollisionObject2D] parent. Polygons can be drawn in the editor or specified by a list of vertices.
</description>
<tutorials>
</tutorials>
@@ -12,18 +12,18 @@
</methods>
<members>
<member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" enum="CollisionPolygon2D.BuildMode" default="0">
- Collision build mode. Use one of the [code]BUILD_*[/code] constants.
+ Collision build mode. Use one of the [enum BuildMode] constants.
</member>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false">
If [code]true[/code], no collisions will be detected.
</member>
<member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" default="false">
- If [code]true[/code], only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.
+ If [code]true[/code], only edges that face up, relative to [CollisionPolygon2D]'s rotation, will collide with other objects.
</member>
<member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0">
</member>
<member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" default="PoolVector2Array( )">
- The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the PoolVector2Array, not a reference.
+ The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the [PoolVector2Array], not a reference.
</member>
</members>
<constants>
diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml
index 5fd8826a98..4166ee31d3 100644
--- a/doc/classes/CollisionShape2D.xml
+++ b/doc/classes/CollisionShape2D.xml
@@ -19,6 +19,7 @@
Sets whether this collision shape should only detect collision on one side (top or bottom).
</member>
<member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0">
+ The margin used for one-way collision (in pixels).
</member>
<member name="shape" type="Shape2D" setter="set_shape" getter="get_shape">
The actual shape owned by this collision shape.
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index deba30712e..1d4225542a 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -157,6 +157,7 @@
<argument index="0" name="color" type="Color">
</argument>
<description>
+ Returns [code]true[/code] if this color and [code]color[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
</description>
</method>
<method name="lightened">
diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml
index 56f54e4434..d99f90d09a 100644
--- a/doc/classes/ConfigFile.xml
+++ b/doc/classes/ConfigFile.xml
@@ -104,7 +104,8 @@
<argument index="0" name="path" type="String">
</argument>
<description>
- Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object which the method was called on. Returns one of the [constant OK], [constant FAILED] or [code]ERR_*[/code] constants listed in [@GlobalScope]. If the load was successful, the return value is [constant OK].
+ Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object which the method was called on.
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
<method name="load_encrypted">
@@ -133,7 +134,8 @@
<argument index="0" name="path" type="String">
</argument>
<description>
- Saves the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the [constant OK], [constant FAILED] or [code]ERR_*[/code] constants listed in [@GlobalScope]. If the load was successful, the return value is [constant OK].
+ Saves the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure.
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
<method name="save_encrypted">
diff --git a/doc/classes/CubeMap.xml b/doc/classes/CubeMap.xml
index 2cedc78499..6db1cf2d64 100644
--- a/doc/classes/CubeMap.xml
+++ b/doc/classes/CubeMap.xml
@@ -22,7 +22,7 @@
<argument index="0" name="side" type="int" enum="CubeMap.Side">
</argument>
<description>
- Returns an [Image] for a side of the [CubeMap] using one of the [code]SIDE_*[/code] constants or an integer 0-5.
+ Returns an [Image] for a side of the [CubeMap] using one of the [enum Side] constants.
</description>
</method>
<method name="get_width" qualifiers="const">
@@ -40,19 +40,19 @@
<argument index="1" name="image" type="Image">
</argument>
<description>
- Sets an [Image] for a side of the [CubeMap] using one of the [code]SIDE_*[/code] constants or an integer 0-5.
+ Sets an [Image] for a side of the [CubeMap] using one of the [enum Side] constants.
</description>
</method>
</methods>
<members>
<member name="flags" type="int" setter="set_flags" getter="get_flags" default="7">
- The render flags for the [CubeMap]. See the [code]FLAG_*[/code] constants for details.
+ The render flags for the [CubeMap]. See the [enum Flags] constants for details.
</member>
<member name="lossy_storage_quality" type="float" setter="set_lossy_storage_quality" getter="get_lossy_storage_quality" default="0.7">
- The lossy storage quality of the [CubeMap] if the storage mode is set to STORAGE_COMPRESS_LOSSY.
+ The lossy storage quality of the [CubeMap] if the storage mode is set to [constant STORAGE_COMPRESS_LOSSY].
</member>
<member name="storage_mode" type="int" setter="set_storage" getter="get_storage" enum="CubeMap.Storage" default="0">
- The [CubeMap]'s storage mode. See [code]STORAGE_*[/code] constants.
+ The [CubeMap]'s storage mode. See [enum Storage] constants.
</member>
</members>
<constants>
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml
index 8aae85563a..754fafadbe 100644
--- a/doc/classes/Directory.xml
+++ b/doc/classes/Directory.xml
@@ -33,7 +33,7 @@
</argument>
<description>
Changes the currently opened directory to the one passed as an argument. The argument can be relative to the current directory (e.g. [code]newdir[/code] or [code]../newdir[/code]), or an absolute path (e.g. [code]/tmp/newdir[/code] or [code]res://somedir/newdir[/code]).
- The method returns one of the error code constants defined in [@GlobalScope] ([code]OK[/code] or [code]ERR_*[/code]).
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
<method name="copy">
@@ -45,7 +45,7 @@
</argument>
<description>
Copies the [code]from[/code] file to the [code]to[/code] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten.
- Returns one of the error code constants defined in [@GlobalScope] ([code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code]).
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
<method name="current_is_dir" qualifiers="const">
@@ -145,7 +145,7 @@
</argument>
<description>
Creates a directory. The argument can be relative to the current directory, or an absolute path. The target directory should be placed in an already existing directory (to create the full path recursively, see [method make_dir_recursive]).
- The method returns one of the error code constants defined in [@GlobalScope] ([code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code]).
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
<method name="make_dir_recursive">
@@ -155,7 +155,7 @@
</argument>
<description>
Creates a target directory and all necessary intermediate directories in its path, by calling [method make_dir] recursively. The argument can be relative to the current directory, or an absolute path.
- Returns one of the error code constants defined in [@GlobalScope] ([code]0K[/code], [code]FAILED[/code] or [code]ERR_*[/code]).
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
<method name="open">
@@ -165,7 +165,7 @@
</argument>
<description>
Opens an existing directory of the filesystem. The [code]path[/code] argument can be within the project tree ([code]res://folder[/code]), the user directory ([code]user://folder[/code]) or an absolute path of the user filesystem (e.g. [code]/tmp/folder[/code] or [code]C:\tmp\folder[/code]).
- The method returns one of the error code constants defined in [@GlobalScope] ([code]OK[/code] or [code]ERR_*[/code]).
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
<method name="remove">
@@ -175,7 +175,7 @@
</argument>
<description>
Deletes the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail.
- Returns one of the error code constants defined in [@GlobalScope] ([code]OK[/code] or [code]FAILED[/code]).
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
<method name="rename">
@@ -187,7 +187,7 @@
</argument>
<description>
Renames (move) the [code]from[/code] file to the [code]to[/code] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten.
- Returns one of the error code constants defined in [@GlobalScope] ([code]OK[/code] or [code]FAILED[/code]).
+ Returns one of the [enum Error] code constants ([code]OK[/code] on success).
</description>
</method>
</methods>
diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml
index 0820d4e1b6..ac8595d783 100644
--- a/doc/classes/DynamicFont.xml
+++ b/doc/classes/DynamicFont.xml
@@ -4,7 +4,8 @@
DynamicFont renders vector font files at runtime.
</brief_description>
<description>
- DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths.
+ DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallbacks fonts, which will be used when displaying a character not supported by the main font.
+ DynamicFont uses the [url=https://www.freetype.org/]FreeType[/url] library for rasterization.
[codeblock]
var dynamic_font = DynamicFont.new()
dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf")
@@ -46,6 +47,7 @@
<argument index="0" name="type" type="int">
</argument>
<description>
+ Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
</description>
</method>
<method name="remove_fallback">
@@ -76,6 +78,7 @@
<argument index="1" name="value" type="int">
</argument>
<description>
+ Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
</description>
</method>
</methods>
@@ -96,17 +99,20 @@
The font data.
</member>
<member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color( 1, 1, 1, 1 )">
+ The font outline's color.
+ [b]Note:[/b] It's recommended to leave this at the default value so that you can adjust it in individual controls. For example, if the outline is made black here, it won't be possible to change its color using a Label's font outline modulate theme item.
</member>
<member name="outline_size" type="int" setter="set_outline_size" getter="get_outline_size" default="0">
+ The font outline's thickness in pixels (not relative to the font size).
</member>
<member name="size" type="int" setter="set_size" getter="get_size" default="16">
- The font size.
+ The font size in pixels.
</member>
<member name="use_filter" type="bool" setter="set_use_filter" getter="get_use_filter" default="false">
- If [code]true[/code], filtering is used.
+ If [code]true[/code], filtering is used. This makes the font blurry instead of pixelated when scaling it if font oversampling is disabled or ineffective. It's recommended to enable this when using the font in a control whose size changes over time, unless a pixel art aesthetic is desired.
</member>
<member name="use_mipmaps" type="bool" setter="set_use_mipmaps" getter="get_use_mipmaps" default="false">
- If [code]true[/code], mipmapping is used.
+ If [code]true[/code], mipmapping is used. This improves the font's appearance when downscaling it if font oversampling is disabled or ineffective.
</member>
</members>
<constants>
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml
index 5395a8fcb0..18e8ee2d7e 100644
--- a/doc/classes/EditorSettings.xml
+++ b/doc/classes/EditorSettings.xml
@@ -21,7 +21,10 @@
<argument index="0" name="info" type="Dictionary">
</argument>
<description>
- Adds a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see [code]TYPE_*[/code] in [@GlobalScope]), and optionally hint:[int](see [code]PROPERTY_HINT_*[/code] in [@GlobalScope]), hint_string:[String].
+ Adds a custom property info to a property. The dictionary must contain:
+ - [code]name[/code]: [String] (the name of the property)
+ - [code]type[/code]: [int] (see [enum Variant.Type])
+ - optionally [code]hint[/code]: [int] (see [enum PropertyHint]) and [code]hint_string[/code]: [String]
[b]Example:[/b]
[codeblock]
editor_settings.set("category/property_name", 0)
diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml
index 0d64f0ff64..1feccec501 100644
--- a/doc/classes/Environment.xml
+++ b/doc/classes/Environment.xml
@@ -45,7 +45,7 @@
Global contrast value of the rendered scene (default value is 1).
</member>
<member name="adjustment_enabled" type="bool" setter="set_adjustment_enable" getter="is_adjustment_enabled" default="false">
- Enables the adjustment_* options provided by this resource. If [code]false[/code], adjustments modifications will have no effect on the rendered scene.
+ Enables the [code]adjustment_*[/code] options provided by this resource. If [code]false[/code], adjustments modifications will have no effect on the rendered scene.
</member>
<member name="adjustment_saturation" type="float" setter="set_adjustment_saturation" getter="get_adjustment_saturation" default="1.0">
Global color saturation value of the rendered scene (default value is 1).
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 3347eeafa7..3a63b2dc07 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -79,7 +79,7 @@
<return type="int" enum="HTTPClient.Status">
</return>
<description>
- Returns a [code]STATUS_*[/code] enum constant. Need to call [method poll] in order to get status updates.
+ Returns a [enum Status] constant. Need to call [method poll] in order to get status updates.
</description>
</method>
<method name="has_response" qualifiers="const">
@@ -112,13 +112,13 @@
Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.:
[codeblock]
var fields = {"username": "user", "password": "pass"}
- String query_string = http_client.query_string_from_dict(fields)
+ var query_string = http_client.query_string_from_dict(fields)
# Returns "username=user&amp;password=pass"
[/codeblock]
Furthermore, if a key has a [code]null[/code] value, only the key itself is added, without equal sign and value. If the value is an array, for each value in it a pair with the same key is added.
[codeblock]
var fields = {"single": 123, "not_valued": null, "multiple": [22, 33, 44]}
- String query_string = http_client.query_string_from_dict(fields)
+ var query_string = http_client.query_string_from_dict(fields)
# Returns "single=123&amp;not_valued&amp;multiple=22&amp;multiple=33&amp;multiple=44"
[/codeblock]
</description>
@@ -143,7 +143,7 @@
</argument>
<description>
Sends a request to the connected host. The URL parameter is just the part after the host, so for [code]http://somehost.com/index.php[/code], it is [code]index.php[/code].
- Headers are HTTP request headers. For available HTTP methods, see [code]METHOD_*[/code].
+ Headers are HTTP request headers. For available HTTP methods, see [enum Method].
To create a POST request with query strings to push to the server, do:
[codeblock]
var fields = {"username" : "user", "password" : "pass"}
@@ -166,7 +166,7 @@
</argument>
<description>
Sends a raw request to the connected host. The URL parameter is just the part after the host, so for [code]http://somehost.com/index.php[/code], it is [code]index.php[/code].
- Headers are HTTP request headers. For available HTTP methods, see [code]METHOD_*[/code].
+ Headers are HTTP request headers. For available HTTP methods, see [enum Method].
Sends the body data raw, as a byte array and does not encode it in any way.
</description>
</method>
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index 98ba08e6a2..2fed423a32 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -67,7 +67,7 @@
<return type="int" enum="HTTPClient.Status">
</return>
<description>
- Returns the current status of the underlying [HTTPClient]. See [code]STATUS_*[/code] enum on [HTTPClient].
+ Returns the current status of the underlying [HTTPClient]. See [enum HTTPClient.Status].
</description>
</method>
<method name="request">
diff --git a/doc/classes/IP.xml b/doc/classes/IP.xml
index b8b5f0bd39..bfc645b8e7 100644
--- a/doc/classes/IP.xml
+++ b/doc/classes/IP.xml
@@ -65,7 +65,7 @@
<argument index="0" name="id" type="int">
</argument>
<description>
- Returns a queued hostname's status as a [code]RESOLVER_STATUS_*[/code] constant, given its queue [code]id[/code].
+ Returns a queued hostname's status as a [enum ResolverStatus] constant, given its queue [code]id[/code].
</description>
</method>
<method name="resolve_hostname">
@@ -76,7 +76,7 @@
<argument index="1" name="ip_type" type="int" enum="IP.Type" default="3">
</argument>
<description>
- Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the [code]TYPE_*[/code] constant given as [code]ip_type[/code].
+ Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the [enum Type] constant given as [code]ip_type[/code].
</description>
</method>
<method name="resolve_hostname_queue_item">
@@ -87,7 +87,7 @@
<argument index="1" name="ip_type" type="int" enum="IP.Type" default="3">
</argument>
<description>
- Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the [code]TYPE_*[/code] constant given as [code]ip_type[/code]. Returns the queue ID if successful, or [constant RESOLVER_INVALID_ID] on error.
+ Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the [enum Type] constant given as [code]ip_type[/code]. Returns the queue ID if successful, or [constant RESOLVER_INVALID_ID] on error.
</description>
</method>
</methods>
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index c6d63035d1..0303585120 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -90,7 +90,7 @@
<argument index="2" name="lossy_quality" type="float">
</argument>
<description>
- Compresses the image to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available. See [code]COMPRESS_*[/code] constants.
+ Compresses the image to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available. See [enum CompressMode] and [enum CompressSource] constants.
</description>
</method>
<method name="convert">
@@ -99,7 +99,7 @@
<argument index="0" name="format" type="int" enum="Image.Format">
</argument>
<description>
- Converts the image's format. See [code]FORMAT_*[/code] constants.
+ Converts the image's format. See [enum Format] constants.
</description>
</method>
<method name="copy_from">
@@ -123,7 +123,7 @@
<argument index="3" name="format" type="int" enum="Image.Format">
</argument>
<description>
- Creates an empty image of given size and format. See [code]FORMAT_*[/code] constants. If [code]use_mipmaps[/code] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps].
+ Creates an empty image of given size and format. See [enum Format] constants. If [code]use_mipmaps[/code] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps].
</description>
</method>
<method name="create_from_data">
@@ -140,7 +140,7 @@
<argument index="4" name="data" type="PoolByteArray">
</argument>
<description>
- Creates a new image of given size and format. See [code]FORMAT_*[/code] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps].
+ Creates a new image of given size and format. See [enum Format] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps].
</description>
</method>
<method name="crop">
@@ -165,7 +165,7 @@
<return type="int" enum="Image.AlphaMode">
</return>
<description>
- Returns ALPHA_BLEND if the image has data for alpha values. Returns ALPHA_BIT if all the alpha values are below a certain threshold or the maximum value. Returns ALPHA_NONE if no data for alpha values is found.
+ Returns [constant ALPHA_BLEND] if the image has data for alpha values. Returns [constant ALPHA_BIT] if all the alpha values are below a certain threshold or the maximum value. Returns [constant ALPHA_NONE] if no data for alpha values is found.
</description>
</method>
<method name="expand_x2_hq2x">
@@ -225,7 +225,7 @@
<return type="int" enum="Image.Format">
</return>
<description>
- Returns the image's format. See [code]FORMAT_*[/code] constants.
+ Returns the image's format. See [enum Format] constants.
</description>
</method>
<method name="get_height" qualifiers="const">
@@ -491,7 +491,7 @@
</methods>
<members>
<member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{&quot;data&quot;: PoolByteArray( ),&quot;format&quot;: &quot;Lum8&quot;,&quot;height&quot;: 0,&quot;mipmaps&quot;: false,&quot;width&quot;: 0}">
- Holds all of the image's color data in a given format. See [code]FORMAT_*[/code] constants.
+ Holds all of the image's color data in a given format. See [enum Format] constants.
</member>
</members>
<constants>
diff --git a/doc/classes/ImmediateGeometry.xml b/doc/classes/ImmediateGeometry.xml
index ddfd3d74d5..e0807760f7 100644
--- a/doc/classes/ImmediateGeometry.xml
+++ b/doc/classes/ImmediateGeometry.xml
@@ -41,8 +41,8 @@
<argument index="1" name="texture" type="Texture" default="null">
</argument>
<description>
- Begin drawing (And optionally pass a texture override). When done call end(). For more information on how this works, search for glBegin() glEnd() references.
- For the type of primitive, use the [Mesh].[code]PRIMITIVE_*[/code] enumerations.
+ Begin drawing (and optionally pass a texture override). When done call [method end]. For more information on how this works, search for [code]glBegin()[/code] and [code]glEnd()[/code] references.
+ For the type of primitive, see the [enum Mesh.PrimitiveType] enum.
</description>
</method>
<method name="clear">
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml
index 6d4adfad51..3f94ad2d2c 100644
--- a/doc/classes/Input.xml
+++ b/doc/classes/Input.xml
@@ -314,7 +314,7 @@
<argument index="2" name="hotspot" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
- Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing [code]null[/code] to the image parameter resets to the system cursor. See enum [code]CURSOR_*[/code] for the list of shapes.
+ Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing [code]null[/code] to the image parameter resets to the system cursor. See [enum CursorShape] for the list of shapes.
[code]image[/code]'s size must be lower than 256×256.
[code]hotspot[/code] must be within [code]image[/code]'s size.
[b]Note:[/b] [AnimatedTexture]s aren't supported as custom mouse cursors. If using an [AnimatedTexture], only the first frame will be displayed.
diff --git a/doc/classes/JSONParseResult.xml b/doc/classes/JSONParseResult.xml
index 98db123f5b..01cffe6262 100644
--- a/doc/classes/JSONParseResult.xml
+++ b/doc/classes/JSONParseResult.xml
@@ -12,13 +12,13 @@
</methods>
<members>
<member name="error" type="int" setter="set_error" getter="get_error" enum="Error">
- The error type if the JSON source was not successfully parsed. See the [@GlobalScope] [code]ERR_*[/code] constants.
+ The error type if the JSON source was not successfully parsed. See the [enum Error] constants.
</member>
<member name="error_line" type="int" setter="set_error_line" getter="get_error_line" default="-1">
The line number where the error occurred if JSON source was not successfully parsed.
</member>
<member name="error_string" type="String" setter="set_error_string" getter="get_error_string" default="&quot;&quot;">
- The error message if JSON source was not successfully parsed. See the [@GlobalScope] [code]ERR_*[/code] constants.
+ The error message if JSON source was not successfully parsed. See the [enum Error] constants.
</member>
<member name="result" type="Variant" setter="set_result" getter="get_result">
A [Variant] containing the parsed JSON. Use [method @GDScript.typeof] or the [code]is[/code] keyword to check if it is what you expect. For example, if the JSON source starts with curly braces ([code]{}[/code]), a [Dictionary] will be returned. If the JSON source starts with braces ([code][][/code]), an [Array] will be returned.
diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml
index 2fab689f89..164932749f 100644
--- a/doc/classes/KinematicBody.xml
+++ b/doc/classes/KinematicBody.xml
@@ -18,6 +18,7 @@
<argument index="0" name="axis" type="int" enum="PhysicsServer.BodyAxis">
</argument>
<description>
+ Returns [code]true[/code] if the specified [code]axis[/code] is locked. See also [member move_lock_x], [member move_lock_y] and [member move_lock_z].
</description>
</method>
<method name="get_floor_velocity" qualifiers="const">
@@ -125,7 +126,7 @@
</argument>
<description>
Moves the body while keeping it attached to slopes. Similar to [method move_and_slide].
- As long as the [code]snap[/code] vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting[code]snap[/code] to[code](0, 0, 0)[/code] or by using [method move_and_slide] instead.
+ As long as the [code]snap[/code] vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting [code]snap[/code] to [code](0, 0, 0)[/code] or by using [method move_and_slide] instead.
</description>
</method>
<method name="set_axis_lock">
@@ -136,6 +137,7 @@
<argument index="1" name="lock" type="bool">
</argument>
<description>
+ Locks or unlocks the specified [code]axis[/code] depending on the value of [code]lock[/code]. See also [member move_lock_x], [member move_lock_y] and [member move_lock_z].
</description>
</method>
<method name="test_move">
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index 4d1584e9de..9222611090 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -41,7 +41,7 @@
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="Label.Align" default="0">
- Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the [code]ALIGN_*[/code] constants.
+ Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the [enum Align] constants.
</member>
<member name="autowrap" type="bool" setter="set_autowrap" getter="has_autowrap" default="false">
If [code]true[/code], wraps the text inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text.
@@ -67,7 +67,7 @@
If [code]true[/code], all the text displays as UPPERCASE.
</member>
<member name="valign" type="int" setter="set_valign" getter="get_valign" enum="Label.VAlign" default="0">
- Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the [code]VALIGN_*[/code] constants.
+ Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the [enum VAlign] constants.
</member>
<member name="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" default="-1">
Restricts the number of characters to display. Set to -1 to disable.
diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml
index f61be5a5af..5bb90daaf4 100644
--- a/doc/classes/Light2D.xml
+++ b/doc/classes/Light2D.xml
@@ -26,7 +26,7 @@
The Light2D's energy value. The larger the value, the stronger the light.
</member>
<member name="mode" type="int" setter="set_mode" getter="get_mode" enum="Light2D.Mode" default="0">
- The Light2D's mode. See [code]MODE_*[/code] constants for values.
+ The Light2D's mode. See [enum Mode] constants for values.
</member>
<member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )">
The offset of the Light2D's [code]texture[/code].
diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml
index 3cb04b8b89..9eaf70711e 100644
--- a/doc/classes/Line2D.xml
+++ b/doc/classes/Line2D.xml
@@ -66,14 +66,17 @@
</method>
</methods>
<members>
+ <member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false">
+ If [code]true[/code], the line's border will be anti-aliased.
+ </member>
<member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode" default="0">
- Controls the style of the line's first point. Use [code]LINE_CAP_*[/code] constants.
+ Controls the style of the line's first point. Use [enum LineCapMode] constants.
</member>
<member name="default_color" type="Color" setter="set_default_color" getter="get_default_color" default="Color( 0.4, 0.5, 1, 1 )">
The line's color. Will not be used if a gradient is set.
</member>
<member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode" default="0">
- Controls the style of the line's last point. Use [code]LINE_CAP_*[/code] constants.
+ Controls the style of the line's last point. Use [enum LineCapMode] constants.
</member>
<member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set.
@@ -94,7 +97,7 @@
The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style.
</member>
<member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode" default="0">
- The style to render the [code]texture[/code] on the line. Use [code]LINE_TEXTURE_*[/code] constants.
+ The style to render the [code]texture[/code] on the line. Use [enum LineTextureMode] constants.
</member>
<member name="width" type="float" setter="set_width" getter="get_width" default="10.0">
The line's width.
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index de216563d3..78459d2839 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -54,7 +54,7 @@
<argument index="0" name="option" type="int">
</argument>
<description>
- Executes a given action as defined in the[code]MENU_*[/code] enum.
+ Executes a given action as defined in the [enum MenuItems] enum.
</description>
</method>
<method name="select">
@@ -84,7 +84,7 @@
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align" default="0">
- Text alignment as defined in the [code]ALIGN_*[/code] enum.
+ Text alignment as defined in the [enum Align] enum.
</member>
<member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" default="false">
If [code]true[/code], the caret (visual cursor) blinks.
diff --git a/doc/classes/Listener.xml b/doc/classes/Listener.xml
index 130263a069..ae8c38198f 100644
--- a/doc/classes/Listener.xml
+++ b/doc/classes/Listener.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Listener" inherits="Spatial" category="Core" version="3.2">
<brief_description>
+ Overrides the location sounds are heard from.
</brief_description>
<description>
+ Once added to the scene tree and enabled using [method make_current], this node will override the location sounds are heard from. This can be used to listen from a location different from the [Camera].
+ [b]Note:[/b] There is no 2D equivalent for this node yet.
</description>
<tutorials>
</tutorials>
@@ -11,24 +14,29 @@
<return type="void">
</return>
<description>
+ Disables the listener to use the current camera's listener instead.
</description>
</method>
<method name="get_listener_transform" qualifiers="const">
<return type="Transform">
</return>
<description>
+ Returns the listener's global orthonormalized [Transform].
</description>
</method>
<method name="is_current" qualifiers="const">
<return type="bool">
</return>
<description>
+ Returns [code]true[/code] if the listener was made current using [method make_current], [code]false[/code] otherwise.
+ [b]Note:[/b] There may be more than one Listener marked as "current" in the scene tree, but only the one that was made current last will be used.
</description>
</method>
<method name="make_current">
<return type="void">
</return>
<description>
+ Enables the listener. This will override the current camera's listener.
</description>
</method>
</methods>
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index 5f8c7ed120..9cd3fe7bb4 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -92,7 +92,7 @@
[b]Warning:[/b] Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution.
</member>
<member name="network_peer" type="NetworkedMultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
- The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master (see [code]NETWORK_MODE_*[/code] constants in [Node]), or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
+ The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master, or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
</member>
<member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections" default="false">
If [code]true[/code], the MultiplayerAPI's [member network_peer] refuses new incoming connections.
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 6da0547352..54b4f3df64 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -45,6 +45,8 @@
<return type="void">
</return>
<description>
+ Shuts down system MIDI driver.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="delay_msec" qualifiers="const">
@@ -119,6 +121,7 @@
[codeblock]
OS.execute("CMD.exe", ["/C", "cd %TEMP% &amp;&amp; dir"], true, output)
[/codeblock]
+ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
<method name="find_scancode_from_string" qualifiers="const">
@@ -159,6 +162,7 @@
<description>
Returns an array of MIDI device names.
The returned array will be empty if the system MIDI driver has not previously been initialised with [method open_midi_inputs].
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="get_current_video_driver" qualifiers="const">
@@ -224,6 +228,7 @@
</return>
<description>
With this function you can get the list of dangerous permissions that have been granted to the Android application.
+ [b]Note:[/b] This method is implemented on Android.
</description>
</method>
<method name="get_ime_selection" qualifiers="const">
@@ -232,6 +237,7 @@
<description>
Returns the IME cursor position (the currently-edited portion of the string) relative to the characters in the composition string.
[constant MainLoop.NOTIFICATION_OS_IME_UPDATE] is sent to the application to notify it of changes to the IME cursor position.
+ [b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="get_ime_text" qualifiers="const">
@@ -240,6 +246,7 @@
<description>
Returns the IME intermediate composition string.
[constant MainLoop.NOTIFICATION_OS_IME_UPDATE] is sent to the application to notify it of changes to the IME composition string.
+ [b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="get_latin_keyboard_variant" qualifiers="const">
@@ -248,6 +255,7 @@
<description>
Returns the current latin keyboard variant as a String.
Possible return values are: [code]"QWERTY"[/code], [code]"AZERTY"[/code], [code]"QZERTY"[/code], [code]"DVORAK"[/code], [code]"NEO"[/code], [code]"COLEMAK"[/code] or [code]"ERROR"[/code].
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows. Returns [code]"QWERTY"[/code] on unsupported platforms.
</description>
</method>
<method name="get_locale" qualifiers="const">
@@ -262,6 +270,7 @@
</return>
<description>
Returns the model name of the current device.
+ [b]Note:[/b] This method is implemented on Android and iOS. Returns [code]"GenericDevice"[/code] on unsupported platforms.
</description>
</method>
<method name="get_name" qualifiers="const">
@@ -275,14 +284,16 @@
<return type="int">
</return>
<description>
- Returns the amount of battery left in the device as a percentage.
+ Returns the amount of battery left in the device as a percentage. Returns [code]-1[/code] if power state is unknown.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="get_power_seconds_left">
<return type="int">
</return>
<description>
- Returns an estimate of the time left in seconds before the device runs out of battery.
+ Returns an estimate of the time left in seconds before the device runs out of battery. Returns [code]-1[/code] if power state is unknown.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="get_power_state">
@@ -290,6 +301,7 @@
</return>
<description>
Returns the current state of the device regarding battery and power. See [enum PowerState] constants.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="get_process_id" qualifiers="const">
@@ -297,6 +309,7 @@
</return>
<description>
Returns the project's process ID.
+ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
<method name="get_processor_count" qualifiers="const">
@@ -345,6 +358,7 @@
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
[/codeblock]
+ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.
</description>
</method>
<method name="get_screen_position" qualifiers="const">
@@ -393,6 +407,7 @@
</argument>
<description>
Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum SystemDir].
+ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows.
</description>
</method>
<method name="get_system_time_msecs" qualifiers="const">
@@ -519,6 +534,7 @@
</argument>
<description>
Add a new item with text "label" to global menu. Use "_dock" menu to add item to the macOS dock icon menu.
+ [b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_add_separator">
@@ -528,6 +544,7 @@
</argument>
<description>
Add a separator between items. Separators also occupy an index.
+ [b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_clear">
@@ -537,6 +554,7 @@
</argument>
<description>
Clear the global menu, in effect removing all items.
+ [b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="global_menu_remove_item">
@@ -548,6 +566,7 @@
</argument>
<description>
Removes the item at index "idx" from the global menu. Note that the indexes of items after the removed item are going to be shifted by one.
+ [b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<method name="has_environment" qualifiers="const">
@@ -644,6 +663,7 @@
<description>
Kill (terminate) the process identified by the given process ID ([code]pid[/code]), e.g. the one returned by [method execute] in non-blocking mode.
[b]Note:[/b] This method can also be used to kill processes that were not spawned by the game.
+ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
<method name="move_window_to_foreground">
@@ -651,6 +671,7 @@
</return>
<description>
Moves the window to the front.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="native_video_is_playing">
@@ -658,6 +679,7 @@
</return>
<description>
Returns [code]true[/code] if native video is playing.
+ [b]Note:[/b] This method is implemented on Android and iOS.
</description>
</method>
<method name="native_video_pause">
@@ -665,6 +687,7 @@
</return>
<description>
Pauses native video playback.
+ [b]Note:[/b] This method is implemented on Android and iOS.
</description>
</method>
<method name="native_video_play">
@@ -680,7 +703,7 @@
</argument>
<description>
Plays native video from the specified path, at the given volume and with audio and subtitle tracks.
- [b]Note:[/b] This method is only implemented on Android and iOS, and the current Android implementation does not support the [code]volume[/code], [code]audio_track[/code] and [code]subtitle_track[/code] options.
+ [b]Note:[/b] This method is implemented on Android and iOS, and the current Android implementation does not support the [code]volume[/code], [code]audio_track[/code] and [code]subtitle_track[/code] options.
</description>
</method>
<method name="native_video_stop">
@@ -688,6 +711,7 @@
</return>
<description>
Stops native video playback.
+ [b]Note:[/b] This method is implemented on Android and iOS.
</description>
</method>
<method name="native_video_unpause">
@@ -695,6 +719,7 @@
</return>
<description>
Resumes native video playback.
+ [b]Note:[/b] This method is implemented on Android and iOS.
</description>
</method>
<method name="open_midi_inputs">
@@ -702,6 +727,7 @@
</return>
<description>
Initialises the singleton for the system MIDI driver.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="print_all_resources">
@@ -743,6 +769,7 @@
</return>
<description>
Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="request_permission">
@@ -759,6 +786,7 @@
</return>
<description>
With this function you can request dangerous permissions since normal permissions are automatically granted at install time in Android application.
+ [b]Note:[/b] This method is implemented on Android.
</description>
</method>
<method name="set_icon">
@@ -769,6 +797,7 @@
<description>
Sets the game's icon using an [Image] resource.
The same image is used for window caption, taskbar/dock and window selection dialog. Image is scaled as needed.
+ [b]Note:[/b] This method is implemented on HTML5, Linux, macOS and Windows.
</description>
</method>
<method name="set_ime_active">
@@ -781,6 +810,7 @@
If active IME handles key events before the application and creates an composition string and suggestion list.
Application can retrieve the composition status by using [method get_ime_selection] and [method get_ime_text] functions.
Completed composition string is committed when input is finished.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="set_ime_position">
@@ -790,6 +820,7 @@
</argument>
<description>
Sets position of IME suggestion list popup (in window coordinates).
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="set_native_icon">
@@ -800,7 +831,7 @@
<description>
Sets the game's icon using a multi-size platform-specific icon file ([code]*.ico[/code] on Windows and [code]*.icns[/code] on macOS).
Appropriate size sub-icons are used for window caption, taskbar/dock and window selection dialog.
- [b]Note:[/b] This method is only implemented on macOS and Windows.
+ [b]Note:[/b] This method is implemented on macOS and Windows.
</description>
</method>
<method name="set_thread_name">
@@ -828,6 +859,7 @@
</argument>
<description>
Sets whether the window should always be on top.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name="set_window_title">
@@ -838,6 +870,7 @@
<description>
Sets the window title to the specified string.
[b]Note:[/b] This should be used sporadically. Don't set this every frame, as that will negatively affect performance on some window managers.
+ [b]Note:[/b] This method is implemented on HTML5, Linux, macOS and Windows.
</description>
</method>
<method name="shell_open">
@@ -850,6 +883,7 @@
- [code]OS.shell_open("C:\\Users\name\Downloads")[/code] on Windows opens the file explorer at the user's Downloads folder.
- [code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website.
- [code]OS.shell_open("mailto:example@example.com")[/code] opens the default email client with the "To" field set to [code]example@example.com[/code]. See [url=https://blog.escapecreative.com/customizing-mailto-links/]Customizing [code]mailto:[/code] Links[/url] for a list of fields that can be added.
+ [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows.
</description>
</method>
<method name="show_virtual_keyboard">
@@ -859,6 +893,7 @@
</argument>
<description>
Shows the virtual keyboard if the platform has one. The [code]existing_text[/code] parameter is useful for implementing your own LineEdit, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
+ [b]Note:[/b] This method is implemented on Android, iOS and UWP.
</description>
</method>
</methods>
@@ -893,6 +928,9 @@
<member name="vsync_enabled" type="bool" setter="set_use_vsync" getter="is_vsync_enabled" default="true">
If [code]true[/code], vertical synchronization (Vsync) is enabled.
</member>
+ <member name="vsync_via_compositor" type="bool" setter="set_vsync_via_compositor" getter="is_vsync_via_compositor_enabled" default="false">
+ If [code]true[/code] and [code]vsync_enabled[/code] is true, the operating system's window compositor will be used for vsync when the compositor is enabled and the game is in windowed mode.
+ </member>
<member name="window_borderless" type="bool" setter="set_borderless_window" getter="get_borderless_window" default="false">
If [code]true[/code], removes the window frame.
[b]Note:[/b] Setting [code]window_borderless[/code] to [code]false[/code] disables per-pixel transparency.
@@ -910,6 +948,7 @@
If [code]true[/code], the window background is transparent and window frame is removed.
Use [code]get_tree().get_root().set_transparent_background(true)[/code] to disable main viewport background rendering.
[b]Note:[/b] This property has no effect if [b]Project &gt; Project Settings &gt; Display &gt; Window &gt; Per-pixel transparency &gt; Allowed[/b] setting is disabled.
+ [b]Note:[/b] This property is implemented on Linux, macOS and Windows.
</member>
<member name="window_position" type="Vector2" setter="set_window_position" getter="get_window_position" default="Vector2( 0, 0 )">
The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right.
diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml
index ff45ca925c..e9ff2c0916 100644
--- a/doc/classes/PCKPacker.xml
+++ b/doc/classes/PCKPacker.xml
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PCKPacker" inherits="Reference" category="Core" version="3.2">
<brief_description>
+ Creates packages that can be loaded into a running project.
</brief_description>
<description>
- The [PCKPacker] is used to create packages in application runtime.
+ The [PCKPacker] is used to create packages that can be loaded into a running project using [method ProjectSettings.load_resource_pack].
[codeblock]
var packer = PCKPacker.new()
- packer.pck_start("test.pck", 0)
+ packer.pck_start("test.pck")
packer.add_file("res://text.txt", "text.txt")
- packer.flush(false)
+ packer.flush()
[/codeblock]
- The above [PCKPacker] creates package [b]test.pck[/b], then adds a file named [b]text.txt[/b] in the root of the package.
+ The above [PCKPacker] creates package [code]test.pck[/code], then adds a file named [code]text.txt[/code] at the root of the package.
</description>
<tutorials>
</tutorials>
@@ -29,9 +30,10 @@
<method name="flush">
<return type="int" enum="Error">
</return>
- <argument index="0" name="verbose" type="bool">
+ <argument index="0" name="verbose" type="bool" default="false">
</argument>
<description>
+ Writes the files specified using all [method add_file] calls since the last flush. If [code]verbose[/code] is [code]true[/code], a list of files added will be printed to the console for easier debugging.
</description>
</method>
<method name="pck_start">
@@ -39,9 +41,10 @@
</return>
<argument index="0" name="pck_name" type="String">
</argument>
- <argument index="1" name="alignment" type="int">
+ <argument index="1" name="alignment" type="int" default="0">
</argument>
<description>
+ Creates a new PCK file with the name [code]pck_name[/code]. The [code].pck[/code] file extension isn't added automatically, so it should be part of [code]pck_name[/code] (even though it's not required).
</description>
</method>
</methods>
diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml
index 7bfea8bce4..2219be5a26 100644
--- a/doc/classes/Particles.xml
+++ b/doc/classes/Particles.xml
@@ -51,7 +51,7 @@
Number of particles to emit.
</member>
<member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="Particles.DrawOrder" default="0">
- Particle draw order. Uses [code]DRAW_ORDER_*[/code] values.
+ Particle draw order. Uses [enum DrawOrder] values.
</member>
<member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh">
[Mesh] that is drawn for the first draw pass.
diff --git a/doc/classes/Particles2D.xml b/doc/classes/Particles2D.xml
index 7c7b42ce88..100585768d 100644
--- a/doc/classes/Particles2D.xml
+++ b/doc/classes/Particles2D.xml
@@ -31,7 +31,7 @@
Number of particles emitted in one emission cycle.
</member>
<member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="Particles2D.DrawOrder" default="0">
- Particle draw order. Uses [code]DRAW_ORDER_*[/code] values.
+ Particle draw order. Uses [enum DrawOrder] values.
</member>
<member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" default="true">
If [code]true[/code], particles are being emitted.
diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml
index 64751cdf76..187ad1688d 100644
--- a/doc/classes/ParticlesMaterial.xml
+++ b/doc/classes/ParticlesMaterial.xml
@@ -157,7 +157,7 @@
Particles will be emitted at positions determined by sampling this texture at a random position. Used with [constant EMISSION_SHAPE_POINTS] and [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
</member>
<member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" enum="ParticlesMaterial.EmissionShape" default="0">
- Particles will be emitted inside this region. Use [code]EMISSION_SHAPE_*[/code] constants for values.
+ Particles will be emitted inside this region. Use [enum EmissionShape] constants for values.
</member>
<member name="emission_sphere_radius" type="float" setter="set_emission_sphere_radius" getter="get_emission_sphere_radius">
The sphere's radius if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_SPHERE].
diff --git a/doc/classes/Physics2DServer.xml b/doc/classes/Physics2DServer.xml
index a139fa4664..02e3ef5efb 100644
--- a/doc/classes/Physics2DServer.xml
+++ b/doc/classes/Physics2DServer.xml
@@ -203,7 +203,7 @@
</argument>
<description>
Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters:
- 1: AREA_BODY_ADDED or AREA_BODY_REMOVED, depending on whether the object entered or exited the area.
+ 1: [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED], depending on whether the object entered or exited the area.
2: [RID] of the object that entered/exited the area.
3: Instance ID of the object that entered/exited the area.
4: The shape index of the object that entered/exited the area.
@@ -1155,7 +1155,7 @@
Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance.
</constant>
<constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="4" enum="AreaParameter">
- This constant was used to set/get the falloff factor for point gravity. It has been superseded by AREA_PARAM_GRAVITY_DISTANCE_SCALE.
+ This constant was used to set/get the falloff factor for point gravity. It has been superseded by [constant AREA_PARAM_GRAVITY_DISTANCE_SCALE].
</constant>
<constant name="AREA_PARAM_LINEAR_DAMP" value="5" enum="AreaParameter">
Constant to set/get the linear dampening factor of an area.
diff --git a/doc/classes/Physics2DShapeQueryParameters.xml b/doc/classes/Physics2DShapeQueryParameters.xml
index 7d46dd2876..7ea00cbddc 100644
--- a/doc/classes/Physics2DShapeQueryParameters.xml
+++ b/doc/classes/Physics2DShapeQueryParameters.xml
@@ -4,7 +4,7 @@
Parameters to be sent to a 2D shape physics query.
</brief_description>
<description>
- This class contains the shape and other parameters for intersection/collision queries.
+ This class contains the shape and other parameters for 2D intersection/collision queries. See also [Physics2DShapeQueryResult].
</description>
<tutorials>
</tutorials>
@@ -21,14 +21,16 @@
</methods>
<members>
<member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false">
+ If [code]true[/code], the query will take [Area2D]s into account.
</member>
<member name="collide_with_bodies" type="bool" setter="set_collide_with_bodies" getter="is_collide_with_bodies_enabled" default="true">
+ If [code]true[/code], the query will take [PhysicsBody2D]s into account.
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="2147483647">
- The physics layer the query should be made on.
+ The physics layer(s) the query will take into account (as a bitmask).
</member>
<member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[ ]">
- The list of objects or object [RID]s, that will be excluded from collisions.
+ The list of objects or object [RID]s that will be excluded from collisions.
</member>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0">
The collision margin for the shape.
@@ -37,10 +39,10 @@
The motion of the shape being queried for.
</member>
<member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid">
- The [RID] of the queried shape. See also [method set_shape].
+ The queried shape's [RID]. See also [method set_shape].
</member>
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D( 1, 0, 0, 1, 0, 0 )">
- the transform matrix of the queried shape.
+ The queried shape's transform matrix.
</member>
</members>
<constants>
diff --git a/doc/classes/Physics2DShapeQueryResult.xml b/doc/classes/Physics2DShapeQueryResult.xml
index dd38b488f5..06f943cb6d 100644
--- a/doc/classes/Physics2DShapeQueryResult.xml
+++ b/doc/classes/Physics2DShapeQueryResult.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Physics2DShapeQueryResult" inherits="Reference" category="Core" version="3.2">
<brief_description>
+ Result of a 2D shape query in [Physics2DServer].
</brief_description>
<description>
+ The result of a 2D shape query in [Physics2DServer]. See also [Physics2DShapeQueryParameters].
</description>
<tutorials>
</tutorials>
@@ -11,6 +13,7 @@
<return type="int">
</return>
<description>
+ Returns the number of objects that intersected with the shape.
</description>
</method>
<method name="get_result_object" qualifiers="const">
@@ -19,6 +22,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the [Object] that intersected with the shape at index [code]idx[/code].
</description>
</method>
<method name="get_result_object_id" qualifiers="const">
@@ -27,6 +31,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the instance ID of the [Object] that intersected with the shape at index [code]idx[/code].
</description>
</method>
<method name="get_result_object_shape" qualifiers="const">
@@ -35,6 +40,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the child index of the object's [Shape] that intersected with the shape at index [code]idx[/code].
</description>
</method>
<method name="get_result_rid" qualifiers="const">
@@ -43,6 +49,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the [RID] of the object that intersected with the shape at index [code]idx[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml
index a779a34e6a..d7eb4c8c4f 100644
--- a/doc/classes/PhysicsServer.xml
+++ b/doc/classes/PhysicsServer.xml
@@ -68,7 +68,7 @@
<argument index="1" name="param" type="int" enum="PhysicsServer.AreaParameter">
</argument>
<description>
- Returns an area parameter value. A list of available parameters is on the [code]AREA_PARAM_*[/code] constants.
+ Returns an area parameter value. A list of available parameters is on the [enum AreaParameter] constants.
</description>
</method>
<method name="area_get_shape" qualifiers="const">
@@ -194,7 +194,7 @@
</argument>
<description>
Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters:
- 1: AREA_BODY_ADDED or AREA_BODY_REMOVED, depending on whether the object entered or exited the area.
+ 1: [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED], depending on whether the object entered or exited the area.
2: [RID] of the object that entered/exited the area.
3: Instance ID of the object that entered/exited the area.
4: The shape index of the object that entered/exited the area.
@@ -221,7 +221,7 @@
<argument index="2" name="value" type="Variant">
</argument>
<description>
- Sets the value for an area parameter. A list of available parameters is on the [code]AREA_PARAM_*[/code] constants.
+ Sets the value for an area parameter. A list of available parameters is on the [enum AreaParameter] constants.
</description>
</method>
<method name="area_set_ray_pickable">
@@ -292,7 +292,7 @@
<argument index="1" name="mode" type="int" enum="PhysicsServer.AreaSpaceOverrideMode">
</argument>
<description>
- Sets the space override mode for the area. The modes are described in the constants [code]AREA_SPACE_OVERRIDE_*[/code].
+ Sets the space override mode for the area. The modes are described in the [enum AreaSpaceOverrideMode] constants.
</description>
</method>
<method name="area_set_transform">
@@ -426,7 +426,7 @@
<argument index="1" name="init_sleeping" type="bool" default="false">
</argument>
<description>
- Creates a physics body. The first parameter can be any value from constants BODY_MODE*, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.
+ Creates a physics body. The first parameter can be any value from [enum BodyMode] constants, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.
</description>
</method>
<method name="body_get_collision_layer" qualifiers="const">
@@ -500,7 +500,7 @@
<argument index="1" name="param" type="int" enum="PhysicsServer.BodyParameter">
</argument>
<description>
- Returns the value of a body parameter. A list of available parameters is on the [code]BODY_PARAM_*[/code] constants.
+ Returns the value of a body parameter. A list of available parameters is on the [enum BodyParameter] constants.
</description>
</method>
<method name="body_get_shape" qualifiers="const">
@@ -715,7 +715,7 @@
<argument index="1" name="mode" type="int" enum="PhysicsServer.BodyMode">
</argument>
<description>
- Sets the body mode, from one of the constants BODY_MODE*.
+ Sets the body mode, from one of the [enum BodyMode] constants.
</description>
</method>
<method name="body_set_omit_force_integration">
@@ -739,7 +739,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets a body parameter. A list of available parameters is on the [code]BODY_PARAM_*[/code] constants.
+ Sets a body parameter. A list of available parameters is on the [enum BodyParameter] constants.
</description>
</method>
<method name="body_set_ray_pickable">
@@ -812,7 +812,7 @@
<argument index="2" name="value" type="Variant">
</argument>
<description>
- Sets a body state (see BODY_STATE* constants).
+ Sets a body state (see [enum BodyState] constants).
</description>
</method>
<method name="cone_twist_joint_get_param" qualifiers="const">
@@ -823,7 +823,7 @@
<argument index="1" name="param" type="int" enum="PhysicsServer.ConeTwistJointParam">
</argument>
<description>
- Gets a cone_twist_joint parameter (see CONE_TWIST_JOINT* constants).
+ Gets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants).
</description>
</method>
<method name="cone_twist_joint_set_param">
@@ -836,7 +836,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets a cone_twist_joint parameter (see CONE_TWIST_JOINT* constants).
+ Sets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants).
</description>
</method>
<method name="free_rid">
@@ -858,7 +858,7 @@
<argument index="2" name="flag" type="int" enum="PhysicsServer.G6DOFJointAxisFlag">
</argument>
<description>
- Gets a generic_6_DOF_joint flag (see G6DOF_JOINT_FLAG* constants).
+ Gets a generic_6_DOF_joint flag (see [enum G6DOFJointAxisFlag] constants).
</description>
</method>
<method name="generic_6dof_joint_get_param">
@@ -871,7 +871,7 @@
<argument index="2" name="param" type="int" enum="PhysicsServer.G6DOFJointAxisParam">
</argument>
<description>
- Gets a generic_6_DOF_joint parameter (see G6DOF_JOINT* constants without the G6DOF_JOINT_FLAG*).
+ Gets a generic_6_DOF_joint parameter (see [enum G6DOFJointAxisParam] constants).
</description>
</method>
<method name="generic_6dof_joint_set_flag">
@@ -886,7 +886,7 @@
<argument index="3" name="enable" type="bool">
</argument>
<description>
- Sets a generic_6_DOF_joint flag (see G6DOF_JOINT_FLAG* constants).
+ Sets a generic_6_DOF_joint flag (see [enum G6DOFJointAxisFlag] constants).
</description>
</method>
<method name="generic_6dof_joint_set_param">
@@ -901,7 +901,7 @@
<argument index="3" name="value" type="float">
</argument>
<description>
- Sets a generic_6_DOF_joint parameter (see G6DOF_JOINT* constants without the G6DOF_JOINT_FLAG*).
+ Sets a generic_6_DOF_joint parameter (see [enum G6DOFJointAxisParam] constants).
</description>
</method>
<method name="get_process_info">
@@ -921,7 +921,7 @@
<argument index="1" name="flag" type="int" enum="PhysicsServer.HingeJointFlag">
</argument>
<description>
- Gets a hinge_joint flag (see HINGE_JOINT_FLAG* constants).
+ Gets a hinge_joint flag (see [enum HingeJointFlag] constants).
</description>
</method>
<method name="hinge_joint_get_param" qualifiers="const">
@@ -932,7 +932,7 @@
<argument index="1" name="param" type="int" enum="PhysicsServer.HingeJointParam">
</argument>
<description>
- Gets a hinge_joint parameter (see HINGE_JOINT* constants without the HINGE_JOINT_FLAG*).
+ Gets a hinge_joint parameter (see [enum HingeJointParam]).
</description>
</method>
<method name="hinge_joint_set_flag">
@@ -945,7 +945,7 @@
<argument index="2" name="enabled" type="bool">
</argument>
<description>
- Sets a hinge_joint flag (see HINGE_JOINT_FLAG* constants).
+ Sets a hinge_joint flag (see [enum HingeJointFlag] constants).
</description>
</method>
<method name="hinge_joint_set_param">
@@ -958,7 +958,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets a hinge_joint parameter (see HINGE_JOINT* constants without the HINGE_JOINT_FLAG*).
+ Sets a hinge_joint parameter (see [enum HingeJointParam] constants).
</description>
</method>
<method name="joint_create_cone_twist">
@@ -1091,7 +1091,7 @@
<argument index="1" name="param" type="int" enum="PhysicsServer.PinJointParam">
</argument>
<description>
- Gets a pin_joint parameter (see PIN_JOINT* constants).
+ Gets a pin_joint parameter (see [enum PinJointParam] constants).
</description>
</method>
<method name="pin_joint_set_local_a">
@@ -1126,7 +1126,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets a pin_joint parameter (see PIN_JOINT* constants).
+ Sets a pin_joint parameter (see [enum PinJointParam] constants).
</description>
</method>
<method name="set_active">
@@ -1144,7 +1144,7 @@
<argument index="0" name="type" type="int" enum="PhysicsServer.ShapeType">
</argument>
<description>
- Creates a shape of type [code]SHAPE_*[/code]. Does not assign it to a body or an area. To do so, you must use [method area_set_shape] or [method body_set_shape].
+ Creates a shape of a type from [enum ShapeType]. Does not assign it to a body or an area. To do so, you must use [method area_set_shape] or [method body_set_shape].
</description>
</method>
<method name="shape_get_data" qualifiers="const">
@@ -1162,7 +1162,7 @@
<argument index="0" name="shape" type="RID">
</argument>
<description>
- Returns the type of shape (see [code]SHAPE_*[/code] constants).
+ Returns the type of shape (see [enum ShapeType] constants).
</description>
</method>
<method name="shape_set_data">
@@ -1184,7 +1184,7 @@
<argument index="1" name="param" type="int" enum="PhysicsServer.SliderJointParam">
</argument>
<description>
- Gets a slider_joint parameter (see SLIDER_JOINT* constants).
+ Gets a slider_joint parameter (see [enum SliderJointParam] constants).
</description>
</method>
<method name="slider_joint_set_param">
@@ -1197,7 +1197,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Gets a slider_joint parameter (see SLIDER_JOINT* constants).
+ Gets a slider_joint parameter (see [enum SliderJointParam] constants).
</description>
</method>
<method name="space_create">
@@ -1257,7 +1257,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets the value for a space parameter. A list of available parameters is on the [code]SPACE_PARAM_*[/code] constants.
+ Sets the value for a space parameter. A list of available parameters is on the [enum SpaceParameter] constants.
</description>
</method>
</methods>
@@ -1509,7 +1509,7 @@
Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance.
</constant>
<constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="4" enum="AreaParameter">
- This constant was used to set/get the falloff factor for point gravity. It has been superseded by AREA_PARAM_GRAVITY_DISTANCE_SCALE.
+ This constant was used to set/get the falloff factor for point gravity. It has been superseded by [constant AREA_PARAM_GRAVITY_DISTANCE_SCALE].
</constant>
<constant name="AREA_PARAM_LINEAR_DAMP" value="5" enum="AreaParameter">
Constant to set/get the linear dampening factor of an area.
diff --git a/doc/classes/PhysicsShapeQueryParameters.xml b/doc/classes/PhysicsShapeQueryParameters.xml
index 7d7307592e..d56247fcaf 100644
--- a/doc/classes/PhysicsShapeQueryParameters.xml
+++ b/doc/classes/PhysicsShapeQueryParameters.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsShapeQueryParameters" inherits="Reference" category="Core" version="3.2">
<brief_description>
+ Parameters to be sent to a 3D shape physics query.
</brief_description>
<description>
+ This class contains the shape and other parameters for 3D intersection/collision queries. See also [PhysicsShapeQueryResult].
</description>
<tutorials>
</tutorials>
@@ -13,23 +15,31 @@
<argument index="0" name="shape" type="Resource">
</argument>
<description>
+ Sets the [Shape] that will be used for collision/intersection queries.
</description>
</method>
</methods>
<members>
<member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false">
+ If [code]true[/code], the query will take [Area]s into account.
</member>
<member name="collide_with_bodies" type="bool" setter="set_collide_with_bodies" getter="is_collide_with_bodies_enabled" default="true">
+ If [code]true[/code], the query will take [PhysicsBody]s into account.
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="2147483647">
+ The physics layer(s) the query will take into account (as a bitmask).
</member>
<member name="exclude" type="Array" setter="set_exclude" getter="get_exclude" default="[ ]">
+ The list of objects or object [RID]s that will be excluded from collisions.
</member>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0">
+ The collision margin for the shape.
</member>
<member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid">
+ The queried shape's [RID]. See also [method set_shape].
</member>
<member name="transform" type="Transform" setter="set_transform" getter="get_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
+ The queried shape's transform matrix.
</member>
</members>
<constants>
diff --git a/doc/classes/PhysicsShapeQueryResult.xml b/doc/classes/PhysicsShapeQueryResult.xml
index 92a4393979..1f151ebb1a 100644
--- a/doc/classes/PhysicsShapeQueryResult.xml
+++ b/doc/classes/PhysicsShapeQueryResult.xml
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsShapeQueryResult" inherits="Reference" category="Core" version="3.2">
<brief_description>
- Result of a shape query in Physics2DServer.
+ Result of a 3D shape query in [PhysicsServer].
</brief_description>
<description>
+ The result of a 3D shape query in [PhysicsServer]. See also [PhysicsShapeQueryParameters].
</description>
<tutorials>
</tutorials>
@@ -12,6 +13,7 @@
<return type="int">
</return>
<description>
+ Returns the number of objects that intersected with the shape.
</description>
</method>
<method name="get_result_object" qualifiers="const">
@@ -20,6 +22,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the [Object] that intersected with the shape at index [code]idx[/code].
</description>
</method>
<method name="get_result_object_id" qualifiers="const">
@@ -28,6 +31,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the instance ID of the [Object] that intersected with the shape at index [code]idx[/code].
</description>
</method>
<method name="get_result_object_shape" qualifiers="const">
@@ -36,6 +40,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the child index of the object's [Shape] that intersected with the shape at index [code]idx[/code].
</description>
</method>
<method name="get_result_rid" qualifiers="const">
@@ -44,6 +49,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the [RID] of the object that intersected with the shape at index [code]idx[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml
index bb72f2734e..f179041327 100644
--- a/doc/classes/Plane.xml
+++ b/doc/classes/Plane.xml
@@ -122,6 +122,7 @@
<argument index="0" name="plane" type="Plane">
</argument>
<description>
+ Returns [code]true[/code] if this plane and [code]plane[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
</description>
</method>
<method name="is_point_over">
diff --git a/doc/classes/PlaneShape.xml b/doc/classes/PlaneShape.xml
index b94bb8e613..ee841a3cff 100644
--- a/doc/classes/PlaneShape.xml
+++ b/doc/classes/PlaneShape.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PlaneShape" inherits="Shape" category="Core" version="3.2">
<brief_description>
+ Infinite plane shape for 3D collisions.
</brief_description>
<description>
+ An infinite plane shape for 3D collisions. Note that the [Plane]'s normal matters; anything "below" the plane will collide with it. If the [PlaneShape] is used in a [PhysicsBody], it will cause colliding objects placed "below" it to teleport "above" the plane.
</description>
<tutorials>
</tutorials>
@@ -10,6 +12,7 @@
</methods>
<members>
<member name="plane" type="Plane" setter="set_plane" getter="get_plane" default="Plane( 0, 1, 0, 0 )">
+ The [Plane] used by the [PlaneShape] for collision.
</member>
</members>
<constants>
diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml
index b0e69bd089..3f07affdfd 100644
--- a/doc/classes/PrimitiveMesh.xml
+++ b/doc/classes/PrimitiveMesh.xml
@@ -22,7 +22,8 @@
Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unnexpected culling when using a shader to offset vertices.
</member>
<member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false">
- If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. Result is the same as using *CULL_BACK* in [SpatialMaterial].
+ If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn.
+ This gives the same result as using [constant SpatialMaterial.CULL_BACK] in [member SpatialMaterial.params_cull_mode].
</member>
<member name="material" type="Material" setter="set_material" getter="get_material">
The current [Material] of the primitive mesh.
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 772c2f5073..57940a2507 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -17,7 +17,10 @@
<argument index="0" name="hint" type="Dictionary">
</argument>
<description>
- Adds a custom property info to a property. The dictionary must contain: name:[String](the property's name) and type:[int](see [code]TYPE_*[/code] in [@GlobalScope]), and optionally hint:[int](see [code]PROPERTY_HINT_*[/code] in [@GlobalScope]), hint_string:[String].
+ Adds a custom property info to a property. The dictionary must contain:
+ - [code]name[/code]: [String] (the property's name)
+ - [code]type[/code]: [int] (see [enum Variant.Type])
+ - optionally [code]hint[/code]: [int] (see [enum PropertyHint]) and [code]hint_string[/code]: [String]
[b]Example:[/b]
[codeblock]
ProjectSettings.set("category/property_name", 0)
@@ -345,7 +348,7 @@
<member name="debug/gdscript/warnings/unused_argument" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a function parameter is unused.
</member>
- <member name="debug/gdscript/warnings/unused_class_variable" type="bool" setter="" getter="" default="true">
+ <member name="debug/gdscript/warnings/unused_class_variable" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables warnings when a member variable is unused.
</member>
<member name="debug/gdscript/warnings/unused_signal" type="bool" setter="" getter="" default="true">
@@ -431,6 +434,9 @@
<member name="display/window/vsync/use_vsync" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5).
</member>
+ <member name="display/window/vsync/vsync_via_compositor" type="bool" setter="" getter="" default="false">
+ If [code]Use Vsync[/code] is enabled and this setting is [code]true[/code], enables vertical synchronization via the operating system's window compositor when in windowed mode and the compositor is enabled. This will prevent stutter in certain situations. (Windows only.)
+ </member>
<member name="editor/script_templates_search_path" type="String" setter="" getter="" default="&quot;res://script_templates&quot;">
</member>
<member name="editor/search_in_file_extensions" type="PoolStringArray" setter="" getter="" default="PoolStringArray( &quot;gd&quot;, &quot;shader&quot; )">
diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml
index f5ee99d30c..eeb633f480 100644
--- a/doc/classes/Quat.xml
+++ b/doc/classes/Quat.xml
@@ -100,6 +100,7 @@
<argument index="0" name="quat" type="Quat">
</argument>
<description>
+ Returns [code]true[/code] if this quaterion and [code]quat[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
</description>
</method>
<method name="is_normalized">
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml
index 07fa7777fe..90dd996691 100644
--- a/doc/classes/Rect2.xml
+++ b/doc/classes/Rect2.xml
@@ -143,6 +143,7 @@
<argument index="0" name="rect" type="Rect2">
</argument>
<description>
+ Returns [code]true[/code] if this [Rect2] and [code]rect[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="merge">
@@ -151,7 +152,7 @@
<argument index="0" name="b" type="Rect2">
</argument>
<description>
- Returns a larger Rect2 that contains this Rect2 and [code]b[/code].
+ Returns a larger [Rect2] that contains this [Rect2] and [code]b[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/RichTextEffect.xml b/doc/classes/RichTextEffect.xml
index 5c3ffd9cff..0e043b1d50 100644
--- a/doc/classes/RichTextEffect.xml
+++ b/doc/classes/RichTextEffect.xml
@@ -1,10 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="RichTextEffect" inherits="Resource" category="Core" version="3.2">
<brief_description>
+ A custom effect for use with [RichTextLabel].
</brief_description>
<description>
+ A custom effect for use with [RichTextLabel].
+ [b]Note:[/b] For a [RichTextEffect] to be usable, a BBCode tag must be defined as a member variable called [code]bbcode[/code] in the script.
+ [codeblock]
+ # The RichTextEffect will be usable like this: `[example]Some text[/example]`
+ var bbcode = "example"
+ [/codeblock]
+ [b]Note:[/b] As soon as a [RichTextLabel] contains at least one [RichTextEffect], it will continuously process the effect unless the project is paused. This may impact battery life negatively.
</description>
<tutorials>
+ <link>http://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link>
+ <link>https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link>
</tutorials>
<methods>
<method name="_process_custom_fx" qualifiers="virtual">
@@ -13,6 +23,7 @@
<argument index="0" name="char_fx" type="CharFXTransform">
</argument>
<description>
+ Override this method to modify properties in [code]char_fx[/code]. The method must return [code]true[/code] if the character could be transformed successfully. If the method returns [code]false[/code], it will skip transformation to avoid displaying broken text.
</description>
</method>
</methods>
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index bf22b865d3..0635dd8935 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -289,7 +289,7 @@
If [code]false[/code], you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads.
</member>
<member name="network_peer" type="NetworkedMultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
- The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the [SceneTree] will become a network server (check with [method is_network_server]) and will set the root node's network mode to master (see [code]NETWORK_MODE_*[/code] constants in [Node]), or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to [SceneTree]'s signals.
+ The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the [SceneTree] will become a network server (check with [method is_network_server]) and will set the root node's network mode to master, or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to [SceneTree]'s signals.
</member>
<member name="paused" type="bool" setter="set_pause" getter="is_paused" default="false">
If [code]true[/code], the [SceneTree] is paused. Doing so will have the following behavior:
diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml
index e8a88acdb5..91014580d3 100644
--- a/doc/classes/Script.xml
+++ b/doc/classes/Script.xml
@@ -4,7 +4,7 @@
A class stored as a resource.
</brief_description>
<description>
- A class stored as a resource. A script exends the functionality of all objects that instance it.
+ A class stored as a resource. A script extends the functionality of all objects that instance it.
The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes.
</description>
<tutorials>
diff --git a/doc/classes/Shape.xml b/doc/classes/Shape.xml
index ce5947bc06..123353b59a 100644
--- a/doc/classes/Shape.xml
+++ b/doc/classes/Shape.xml
@@ -13,6 +13,7 @@
</methods>
<members>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.04">
+ The collision margin for the shape.
</member>
</members>
<constants>
diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml
index 2c3120f04d..70d55344ca 100644
--- a/doc/classes/Shape2D.xml
+++ b/doc/classes/Shape2D.xml
@@ -77,6 +77,7 @@
</methods>
<members>
<member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0">
+ The shape's custom solver bias.
</member>
</members>
<constants>
diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml
index 05ee79eef2..46b11ac010 100644
--- a/doc/classes/StyleBoxFlat.xml
+++ b/doc/classes/StyleBoxFlat.xml
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="StyleBoxFlat" inherits="StyleBox" category="Core" version="3.2">
<brief_description>
- Customizable Stylebox with a given set of parameters. (no texture required)
+ Customizable [StyleBox] with a given set of parameters (no texture required).
</brief_description>
<description>
- This stylebox can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable:
+ This [StyleBox] can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable:
- Color
- Border width (individual width for each border)
- Rounded corners (individual radius for each corner)
- - Shadow
+ - Shadow (with blur and offset)
Setting corner radius to high values is allowed. As soon as corners would overlap, the stylebox will switch to a relative system. Example:
[codeblock]
height = 30
@@ -30,12 +30,14 @@
<argument index="0" name="margin" type="int" enum="Margin">
</argument>
<description>
+ Returns the given [code]margin[/code]'s border width. See [enum Margin] for possible values.
</description>
</method>
<method name="get_border_width_min" qualifiers="const">
<return type="int">
</return>
<description>
+ Returns the smallest border width out of all four borders.
</description>
</method>
<method name="get_corner_radius" qualifiers="const">
@@ -44,6 +46,7 @@
<argument index="0" name="corner" type="int" enum="Corner">
</argument>
<description>
+ Returns the given [code]corner[/code]'s radius. See [enum Corner] for possible values.
</description>
</method>
<method name="get_expand_margin" qualifiers="const">
@@ -52,6 +55,7 @@
<argument index="0" name="margin" type="int" enum="Margin">
</argument>
<description>
+ Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values.
</description>
</method>
<method name="set_border_width">
@@ -62,6 +66,7 @@
<argument index="1" name="width" type="int">
</argument>
<description>
+ Sets the border width to [code]width[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
</description>
</method>
<method name="set_border_width_all">
@@ -70,6 +75,7 @@
<argument index="0" name="width" type="int">
</argument>
<description>
+ Sets the border width to [code]width[/code] pixels for all margins.
</description>
</method>
<method name="set_corner_radius">
@@ -80,6 +86,7 @@
<argument index="1" name="radius" type="int">
</argument>
<description>
+ Sets the corner radius to [code]radius[/code] pixels for the given [code]corner[/code]. See [enum Corner] for possible values.
</description>
</method>
<method name="set_corner_radius_all">
@@ -88,6 +95,7 @@
<argument index="0" name="radius" type="int">
</argument>
<description>
+ Sets the corner radius to [code]radius[/code] pixels for all corners.
</description>
</method>
<method name="set_corner_radius_individual">
@@ -102,6 +110,7 @@
<argument index="3" name="radius_bottom_left" type="int">
</argument>
<description>
+ Sets the corner radius for each corner to [code]radius_top_left[/code], [code]radius_top_right[/code], [code]radius_bottom_right[/code], and [code]radius_bottom_left[/code] pixels.
</description>
</method>
<method name="set_expand_margin">
@@ -112,6 +121,7 @@
<argument index="1" name="size" type="float">
</argument>
<description>
+ Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
</description>
</method>
<method name="set_expand_margin_all">
@@ -120,6 +130,7 @@
<argument index="0" name="size" type="float">
</argument>
<description>
+ Sets the expand margin to [code]size[/code] pixels for all margins.
</description>
</method>
<method name="set_expand_margin_individual">
@@ -134,6 +145,7 @@
<argument index="3" name="size_bottom" type="float">
</argument>
<description>
+ Sets the expand margin for each margin to [code]size_left[/code], [code]size_top[/code], [code]size_right[/code], and [code]size_bottom[/code] pixels.
</description>
</method>
</methods>
diff --git a/doc/classes/StyleBoxLine.xml b/doc/classes/StyleBoxLine.xml
index c0745c5f39..b5da81de79 100644
--- a/doc/classes/StyleBoxLine.xml
+++ b/doc/classes/StyleBoxLine.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="StyleBoxLine" inherits="StyleBox" category="Core" version="3.2">
<brief_description>
+ [StyleBox] that displays a single line.
</brief_description>
<description>
+ [StyleBox] that displays a single line of a given color and thickness. It can be used to draw things like separators.
</description>
<tutorials>
</tutorials>
@@ -10,14 +12,19 @@
</methods>
<members>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 0, 0, 0, 1 )">
+ The line's color.
</member>
<member name="grow_begin" type="float" setter="set_grow_begin" getter="get_grow_begin" default="1.0">
+ The number of pixels the line will extend before the [StyleBoxLine]'s bounds. If set to a negative value, the line will begin inside the [StyleBoxLine]'s bounds.
</member>
<member name="grow_end" type="float" setter="set_grow_end" getter="get_grow_end" default="1.0">
+ The number of pixels the line will extend past the [StyleBoxLine]'s bounds. If set to a negative value, the line will end inside the [StyleBoxLine]'s bounds.
</member>
<member name="thickness" type="int" setter="set_thickness" getter="get_thickness" default="1">
+ The line's thickness in pixels.
</member>
<member name="vertical" type="bool" setter="set_vertical" getter="is_vertical" default="false">
+ If [code]true[/code], the line will be vertical. If [code]false[/code], the line will be horizontal.
</member>
</members>
<constants>
diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml
index d5efc80846..af4186dcb6 100644
--- a/doc/classes/StyleBoxTexture.xml
+++ b/doc/classes/StyleBoxTexture.xml
@@ -15,6 +15,7 @@
<argument index="0" name="margin" type="int" enum="Margin">
</argument>
<description>
+ Returns the size of the given [code]margin[/code]'s expand margin. See [enum Margin] for possible values.
</description>
</method>
<method name="get_margin_size" qualifiers="const">
@@ -23,6 +24,7 @@
<argument index="0" name="margin" type="int" enum="Margin">
</argument>
<description>
+ Returns the size of the given [code]margin[/code]. See [enum Margin] for possible values.
</description>
</method>
<method name="set_expand_margin_all">
@@ -31,6 +33,7 @@
<argument index="0" name="size" type="float">
</argument>
<description>
+ Sets the expand margin to [code]size[/code] pixels for all margins.
</description>
</method>
<method name="set_expand_margin_individual">
@@ -45,6 +48,7 @@
<argument index="3" name="size_bottom" type="float">
</argument>
<description>
+ Sets the expand margin for each margin to [code]size_left[/code], [code]size_top[/code], [code]size_right[/code], and [code]size_bottom[/code] pixels.
</description>
</method>
<method name="set_expand_margin_size">
@@ -55,6 +59,7 @@
<argument index="1" name="size" type="float">
</argument>
<description>
+ Sets the expand margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
</description>
</method>
<method name="set_margin_size">
@@ -65,15 +70,19 @@
<argument index="1" name="size" type="float">
</argument>
<description>
+ Sets the margin to [code]size[/code] pixels for the given [code]margin[/code]. See [enum Margin] for possible values.
</description>
</method>
</methods>
<members>
<member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
+ Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum AxisStretchMode] for possible values.
</member>
<member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0">
+ Controls how the stylebox's texture will be stretched or tiled vertically. See [enum AxisStretchMode] for possible values.
</member>
<member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" default="true">
+ If [code]true[/code], the nine-patch texture's center tile will be drawn.
</member>
<member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" default="0.0">
Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.
@@ -114,7 +123,7 @@
The normal map to use when drawing this style box.
</member>
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )">
- Species a sub region of the texture to use.
+ Species a sub-region of the texture to use.
This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region.
</member>
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
@@ -124,15 +133,19 @@
<signals>
<signal name="texture_changed">
<description>
+ Emitted when the stylebox's texture is changed.
</description>
</signal>
</signals>
<constants>
<constant name="AXIS_STRETCH_MODE_STRETCH" value="0" enum="AxisStretchMode">
+ Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly.
</constant>
<constant name="AXIS_STRETCH_MODE_TILE" value="1" enum="AxisStretchMode">
+ Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system.
</constant>
<constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2" enum="AxisStretchMode">
+ Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike [constant AXIS_STRETCH_MODE_TILE], the texture may be slightly stretched to make the nine-patch texture tile seamlessly.
</constant>
</constants>
</class>
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index 7cfd8c6919..0c9ac9fbff 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -167,7 +167,7 @@
</argument>
<description>
Returns a constructed [ArrayMesh] from current information passed in. If an existing [ArrayMesh] is passed in as an argument, will add an extra surface to the existing [ArrayMesh].
- Default flag is [constant Mesh.ARRAY_COMPRESS_DEFAULT]. See [code]Mesh.ARRAY_COMPRESS_*[/code] constants for other flags.
+ Default flag is [constant Mesh.ARRAY_COMPRESS_DEFAULT]. See [code]ARRAY_COMPRESS_*[/code] constants in [enum Mesh.ArrayFormat] for other flags.
</description>
</method>
<method name="commit_to_arrays">
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml
index 1b9f38fc54..1f584ad317 100644
--- a/doc/classes/TabContainer.xml
+++ b/doc/classes/TabContainer.xml
@@ -144,7 +144,7 @@
If [code]true[/code], tabs can be rearranged with mouse drag.
</member>
<member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabContainer.TabAlign" default="1">
- The alignment of all tabs in the tab container. See the [code]ALIGN_*[/code] constants for details.
+ The alignment of all tabs in the tab container. See the [enum TabAlign] constants for details.
</member>
<member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible" default="true">
If [code]true[/code], tabs are visible. If [code]false[/code], tabs' content and titles are hidden.
diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml
index 899ab8b875..201f8ddb8e 100644
--- a/doc/classes/TextureButton.xml
+++ b/doc/classes/TextureButton.xml
@@ -16,7 +16,7 @@
If [code]true[/code], the texture stretches to the edges of the node's bounding rectangle using the [member stretch_mode]. If [code]false[/code], the texture will not scale with the node.
</member>
<member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureButton.StretchMode" default="0">
- Controls the texture's behavior when you resize the node's bounding rectangle, [b]only if[/b] [member expand] is [code]true[/code]. Set it to one of the [code]STRETCH_*[/code] constants. See the constants to learn more.
+ Controls the texture's behavior when you resize the node's bounding rectangle, [b]only if[/b] [member expand] is [code]true[/code]. Set it to one of the [enum StretchMode] constants. See the constants to learn more.
</member>
<member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask">
Pure black and white [BitMap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes.
diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml
index dd12c5af23..b9aa74ebb7 100644
--- a/doc/classes/Theme.xml
+++ b/doc/classes/Theme.xml
@@ -26,7 +26,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Clears the [Color] at [code]name[/code] if the Theme has [code]type[/code].
+ Clears the [Color] at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="clear_constant">
@@ -37,7 +37,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Clears the constant at [code]name[/code] if the Theme has [code]type[/code].
+ Clears the constant at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="clear_font">
@@ -48,7 +48,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Clears the [Font] at [code]name[/code] if the Theme has [code]type[/code].
+ Clears the [Font] at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="clear_icon">
@@ -59,7 +59,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Clears the icon at [code]name[/code] if the Theme has [code]type[/code].
+ Clears the icon at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="clear_stylebox">
@@ -70,14 +70,14 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Clears [StyleBox] at [code]name[/code] if the Theme has [code]type[/code].
+ Clears [StyleBox] at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="copy_default_theme">
<return type="void">
</return>
<description>
- Sets the Theme's values to a copy of the default theme values.
+ Sets the theme's values to a copy of the default theme values.
</description>
</method>
<method name="copy_theme">
@@ -86,7 +86,7 @@
<argument index="0" name="other" type="Theme">
</argument>
<description>
- Sets the Theme's values to a copy of a given theme.
+ Sets the theme's values to a copy of a given theme.
</description>
</method>
<method name="get_color" qualifiers="const">
@@ -97,7 +97,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Returns the [Color] at [code]name[/code] if the Theme has [code]type[/code].
+ Returns the [Color] at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="get_color_list" qualifiers="const">
@@ -106,7 +106,7 @@
<argument index="0" name="type" type="String">
</argument>
<description>
- Returns all the [Color]s as a [PoolStringArray] filled with each [Color]'s name, for use in [method get_color], if the Theme has [code]type[/code].
+ Returns all the [Color]s as a [PoolStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]type[/code].
</description>
</method>
<method name="get_constant" qualifiers="const">
@@ -117,7 +117,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Returns the constant at [code]name[/code] if the Theme has [code]type[/code].
+ Returns the constant at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="get_constant_list" qualifiers="const">
@@ -126,7 +126,7 @@
<argument index="0" name="type" type="String">
</argument>
<description>
- Returns all the constants as a [PoolStringArray] filled with each constant's name, for use in [method get_constant], if the Theme has [code]type[/code].
+ Returns all the constants as a [PoolStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]type[/code].
</description>
</method>
<method name="get_font" qualifiers="const">
@@ -137,7 +137,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Returns the [Font] at [code]name[/code] if the Theme has [code]type[/code].
+ Returns the [Font] at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="get_font_list" qualifiers="const">
@@ -146,7 +146,7 @@
<argument index="0" name="type" type="String">
</argument>
<description>
- Returns all the [Font]s as a [PoolStringArray] filled with each [Font]'s name, for use in [method get_font], if the Theme has [code]type[/code].
+ Returns all the [Font]s as a [PoolStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]type[/code].
</description>
</method>
<method name="get_icon" qualifiers="const">
@@ -157,7 +157,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Returns the icon [Texture] at [code]name[/code] if the Theme has [code]type[/code].
+ Returns the icon [Texture] at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="get_icon_list" qualifiers="const">
@@ -166,7 +166,7 @@
<argument index="0" name="type" type="String">
</argument>
<description>
- Returns all the icons as a [PoolStringArray] filled with each [Texture]'s name, for use in [method get_icon], if the Theme has [code]type[/code].
+ Returns all the icons as a [PoolStringArray] filled with each [Texture]'s name, for use in [method get_icon], if the theme has [code]type[/code].
</description>
</method>
<method name="get_stylebox" qualifiers="const">
@@ -177,7 +177,7 @@
<argument index="1" name="type" type="String">
</argument>
<description>
- Returns the icon [StyleBox] at [code]name[/code] if the Theme has [code]type[/code].
+ Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]type[/code].
</description>
</method>
<method name="get_stylebox_list" qualifiers="const">
@@ -186,14 +186,14 @@
<argument index="0" name="type" type="String">
</argument>
<description>
- Returns all the [StyleBox]s as a [PoolStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the Theme has [code]type[/code].
+ Returns all the [StyleBox]s as a [PoolStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]type[/code].
</description>
</method>
<method name="get_stylebox_types" qualifiers="const">
<return type="PoolStringArray">
</return>
<description>
- Returns all the [StyleBox] types as a [PoolStringArray] filled with each [StyleBox]'s type, for use in [method get_stylebox] and/or [method get_stylebox_list], if the Theme has [code]type[/code].
+ Returns all the [StyleBox] types as a [PoolStringArray] filled with each [StyleBox]'s type, for use in [method get_stylebox] and/or [method get_stylebox_list], if the theme has [code]type[/code].
</description>
</method>
<method name="get_type_list" qualifiers="const">
@@ -202,7 +202,7 @@
<argument index="0" name="type" type="String">
</argument>
<description>
- Returns all the types in [code]type[/code] as a [PoolStringArray] for use in any of the get_* functions, if the Theme has [code]type[/code].
+ Returns all the types in [code]type[/code] as a [PoolStringArray] for use in any of the [code]get_*[/code] functions, if the theme has [code]type[/code].
</description>
</method>
<method name="has_color" qualifiers="const">
@@ -214,7 +214,7 @@
</argument>
<description>
Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the Theme does not have [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
</description>
</method>
<method name="has_constant" qualifiers="const">
@@ -226,7 +226,7 @@
</argument>
<description>
Returns [code]true[/code] if constant with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the Theme does not have [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
</description>
</method>
<method name="has_font" qualifiers="const">
@@ -238,7 +238,7 @@
</argument>
<description>
Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the Theme does not have [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
</description>
</method>
<method name="has_icon" qualifiers="const">
@@ -250,7 +250,7 @@
</argument>
<description>
Returns [code]true[/code] if icon [Texture] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the Theme does not have [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
</description>
</method>
<method name="has_stylebox" qualifiers="const">
@@ -262,7 +262,7 @@
</argument>
<description>
Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]type[/code].
- Returns [code]false[/code] if the Theme does not have [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
</description>
</method>
<method name="set_color">
@@ -275,8 +275,8 @@
<argument index="2" name="color" type="Color">
</argument>
<description>
- Sets the Theme's [Color] to [code]color[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the Theme does not have [code]type[/code].
+ Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]type[/code].
+ Does nothing if the theme does not have [code]type[/code].
</description>
</method>
<method name="set_constant">
@@ -289,8 +289,8 @@
<argument index="2" name="constant" type="int">
</argument>
<description>
- Sets the Theme's constant to [code]constant[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the Theme does not have [code]type[/code].
+ Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]type[/code].
+ Does nothing if the theme does not have [code]type[/code].
</description>
</method>
<method name="set_font">
@@ -303,8 +303,8 @@
<argument index="2" name="font" type="Font">
</argument>
<description>
- Sets the Theme's [Font] to [code]font[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the Theme does not have [code]type[/code].
+ Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]type[/code].
+ Does nothing if the theme does not have [code]type[/code].
</description>
</method>
<method name="set_icon">
@@ -317,8 +317,8 @@
<argument index="2" name="texture" type="Texture">
</argument>
<description>
- Sets the Theme's icon [Texture] to [code]texture[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the Theme does not have [code]type[/code].
+ Sets the theme's icon [Texture] to [code]texture[/code] at [code]name[/code] in [code]type[/code].
+ Does nothing if the theme does not have [code]type[/code].
</description>
</method>
<method name="set_stylebox">
@@ -331,8 +331,8 @@
<argument index="2" name="texture" type="StyleBox">
</argument>
<description>
- Sets Theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]type[/code].
- Does nothing if the Theme does not have [code]type[/code].
+ Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]type[/code].
+ Does nothing if the theme does not have [code]type[/code].
</description>
</method>
</methods>
diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml
index 034a1b2f5b..4c4022b3b5 100644
--- a/doc/classes/Transform.xml
+++ b/doc/classes/Transform.xml
@@ -95,6 +95,7 @@
<argument index="0" name="transform" type="Transform">
</argument>
<description>
+ Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="looking_at">
diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml
index 89ccffc2e9..6288bb074c 100644
--- a/doc/classes/Transform2D.xml
+++ b/doc/classes/Transform2D.xml
@@ -112,6 +112,7 @@
<argument index="0" name="transform" type="Transform2D">
</argument>
<description>
+ Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="orthonormalized">
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index e0c8d0b0e8..dd4330b00b 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -229,7 +229,7 @@
The number of columns.
</member>
<member name="drop_mode_flags" type="int" setter="set_drop_mode_flags" getter="get_drop_mode_flags" default="0">
- The drop mode as an OR combination of flags. See [code]DROP_MODE_*[/code] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control.can_drop_data] is recommended.
+ The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control.can_drop_data] is recommended.
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" />
<member name="hide_folding" type="bool" setter="set_hide_folding" getter="is_folding_hidden" default="false">
@@ -240,7 +240,7 @@
</member>
<member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" override="true" default="true" />
<member name="select_mode" type="int" setter="set_select_mode" getter="get_select_mode" enum="Tree.SelectMode" default="0">
- Allows single or multiple selection. See the [code]SELECT_*[/code] constants.
+ Allows single or multiple selection. See the [enum SelectMode] constants.
</member>
</members>
<signals>
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index c77388e5f4..f32c5527fd 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -396,7 +396,7 @@
<argument index="1" name="mode" type="int" enum="TreeItem.TreeCellMode">
</argument>
<description>
- Sets the given column's cell mode to [code]mode[/code]. See [code]CELL_MODE_*[/code] constants.
+ Sets the given column's cell mode to [code]mode[/code]. See [enum TreeCellMode] constants.
</description>
</method>
<method name="set_checked">
diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml
index 0f7a93e8d5..aa995e6cbe 100644
--- a/doc/classes/Tween.xml
+++ b/doc/classes/Tween.xml
@@ -433,10 +433,10 @@
The interpolation starts quickly and slows down towards the end.
</constant>
<constant name="EASE_IN_OUT" value="2" enum="EaseType">
- A combination of EASE_IN and EASE_OUT. The interpolation is slowest at both ends.
+ A combination of [constant EASE_IN] and [constant EASE_OUT]. The interpolation is slowest at both ends.
</constant>
<constant name="EASE_OUT_IN" value="3" enum="EaseType">
- A combination of EASE_IN and EASE_OUT. The interpolation is fastest at both ends.
+ A combination of [constant EASE_IN] and [constant EASE_OUT]. The interpolation is fastest at both ends.
</constant>
</constants>
</class>
diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml
index 9d55f5846f..1976e812ba 100644
--- a/doc/classes/Variant.xml
+++ b/doc/classes/Variant.xml
@@ -17,7 +17,7 @@
- VisualScript tracks properties inside Variants as well, but it also uses static typing. The GUI interface enforces that properties have a particular type that doesn't change over time.
- C# is statically typed, but uses the Mono [code]object[/code] type in place of Godot's Variant class when it needs to represent a dynamic value. [code]object[/code] is the Mono runtime's equivalent of the same concept.
- The statically-typed language NativeScript C++ does not define a built-in Variant-like class. Godot's GDNative bindings provide their own godot::Variant class for users; Any point at which the C++ code starts interacting with the Godot runtime is a place where you might have to start wrapping data inside Variant objects.
- The global [method @GDScript.typeof] function returns the enumerated value of the Variant type stored in the current variable. These correspond to [code]TYPE_*[/code] constants in the [@GlobalScope] docs.
+ The global [method @GDScript.typeof] function returns the enumerated value of the Variant type stored in the current variable (see [enum Variant.Type]).
[codeblock]
var foo = 2
match typeof(foo):
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 8ae5caf68c..b23c69de60 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -159,6 +159,7 @@
<argument index="0" name="v" type="Vector2">
</argument>
<description>
+ Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
</description>
</method>
<method name="is_normalized">
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 29c24709e2..d838e6d2f7 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -135,6 +135,7 @@
<argument index="0" name="v" type="Vector3">
</argument>
<description>
+ Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
</description>
</method>
<method name="is_normalized">
diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml
index 895aba2473..db3fd930c6 100644
--- a/doc/classes/VisualServer.xml
+++ b/doc/classes/VisualServer.xml
@@ -411,6 +411,8 @@
</argument>
<argument index="9" name="normal_map" type="RID">
</argument>
+ <argument index="10" name="antialiased" type="bool" default="false">
+ </argument>
<description>
</description>
</method>
@@ -787,7 +789,7 @@
<argument index="1" name="mode" type="int" enum="VisualServer.CanvasLightMode">
</argument>
<description>
- The mode of the light, see [code]CANVAS_LIGHT_MODE_*[/code] constants.
+ The mode of the light, see [enum CanvasLightMode] constants.
</description>
</method>
<method name="canvas_light_set_scale">
@@ -841,7 +843,7 @@
<argument index="1" name="filter" type="int" enum="VisualServer.CanvasLightShadowFilter">
</argument>
<description>
- Sets the canvas light's shadow's filter, see [code]CANVAS_LIGHT_SHADOW_FILTER_*[/code] constants.
+ Sets the canvas light's shadow's filter, see [enum CanvasLightShadowFilter] constants.
</description>
</method>
<method name="canvas_light_set_shadow_gradient_length">
@@ -924,7 +926,7 @@
<argument index="1" name="mode" type="int" enum="VisualServer.CanvasOccluderPolygonCullMode">
</argument>
<description>
- Sets an occluder polygons cull mode. See [code]CANVAS_OCCLUDER_POLYGON_CULL_MODE_*[/code] constants.
+ Sets an occluder polygons cull mode. See [enum CanvasOccluderPolygonCullMode] constants.
</description>
</method>
<method name="canvas_occluder_polygon_set_shape">
@@ -1330,7 +1332,7 @@
<argument index="0" name="info" type="int" enum="VisualServer.RenderInfo">
</argument>
<description>
- Returns a certain information, see [code]RENDER_INFO_*[/code] for options.
+ Returns a certain information, see [enum RenderInfo] for options.
</description>
</method>
<method name="get_test_cube">
@@ -2306,7 +2308,7 @@
</return>
<argument index="0" name="mesh" type="RID">
</argument>
- <argument index="1" name="primtive" type="int" enum="VisualServer.PrimitiveType">
+ <argument index="1" name="primitive" type="int" enum="VisualServer.PrimitiveType">
</argument>
<argument index="2" name="arrays" type="Array">
</argument>
@@ -2315,7 +2317,7 @@
<argument index="4" name="compress_format" type="int" default="97280">
</argument>
<description>
- Adds a surface generated from the Arrays to a mesh. See [code]PRIMITIVE_TYPE_*[/code] constants for types.
+ Adds a surface generated from the Arrays to a mesh. See [enum PrimitiveType] constants for types.
</description>
</method>
<method name="mesh_clear">
@@ -2604,6 +2606,14 @@
<description>
</description>
</method>
+ <method name="multimesh_create">
+ <return type="RID">
+ </return>
+ <description>
+ Creates a new multimesh on the VisualServer and returns an [RID] handle.
+ Once finished with your RID, you will want to free the RID using the VisualServer's [method free_rid] static method.
+ </description>
+ </method>
<method name="multimesh_get_aabb" qualifiers="const">
<return type="AABB">
</return>
@@ -3655,7 +3665,7 @@
<argument index="1" name="info" type="int" enum="VisualServer.ViewportRenderInfo">
</argument>
<description>
- Returns a viewport's render information. For options, see the [code]VIEWPORT_RENDER_INFO*[/code] constants.
+ Returns a viewport's render information. For options, see the [enum ViewportRenderInfo] constants.
</description>
</method>
<method name="viewport_get_texture" qualifiers="const">
diff --git a/doc/classes/XMLParser.xml b/doc/classes/XMLParser.xml
index 6989246e24..4375b2eb62 100644
--- a/doc/classes/XMLParser.xml
+++ b/doc/classes/XMLParser.xml
@@ -84,7 +84,7 @@
<return type="int" enum="XMLParser.NodeType">
</return>
<description>
- Gets the type of the current node. Compare with [code]NODE_*[/code] constants.
+ Gets the type of the current node. Compare with [enum NodeType] constants.
</description>
</method>
<method name="has_attribute" qualifiers="const">
diff --git a/doc/tools/doc_merge.py b/doc/tools/doc_merge.py
index 496d5dcb74..496d5dcb74 100644..100755
--- a/doc/tools/doc_merge.py
+++ b/doc/tools/doc_merge.py
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py
index 6e34cffc05..6e34cffc05 100644..100755
--- a/doc/tools/doc_status.py
+++ b/doc/tools/doc_status.py
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py
index ef38299680..91240e9550 100755
--- a/doc/tools/makerst.py
+++ b/doc/tools/makerst.py
@@ -14,7 +14,7 @@ GODOT_DOCS_PATTERN = re.compile(r'^http(?:s)?://docs\.godotengine\.org/(?:[a-zA-
def print_error(error, state): # type: (str, State) -> None
- print(error)
+ print("ERROR: {}".format(error))
state.errored = True
@@ -148,6 +148,8 @@ class State:
setter = property.get("setter") or None # Use or None so '' gets turned into None.
getter = property.get("getter") or None
default_value = property.get("default") or None
+ if default_value is not None:
+ default_value = escape_rst(default_value)
overridden = property.get("override") or False
property_def = PropertyDef(property_name, type_name, setter, getter, property.text, default_value, overridden)
@@ -622,6 +624,40 @@ def make_class_list(class_list, columns): # type: (List[str], int) -> None
f.close()
+def escape_rst(text, until_pos=-1): # type: (str) -> str
+ # Escape \ character, otherwise it ends up as an escape character in rst
+ pos = 0
+ while True:
+ pos = text.find('\\', pos, until_pos)
+ if pos == -1:
+ break
+ text = text[:pos] + "\\\\" + text[pos + 1:]
+ pos += 2
+
+ # Escape * character to avoid interpreting it as emphasis
+ pos = 0
+ while True:
+ pos = text.find('*', pos, until_pos)
+ if pos == -1:
+ break
+ text = text[:pos] + "\*" + text[pos + 1:]
+ pos += 2
+
+ # Escape _ character at the end of a word to avoid interpreting it as an inline hyperlink
+ pos = 0
+ while True:
+ pos = text.find('_', pos, until_pos)
+ if pos == -1:
+ break
+ if not text[pos + 1].isalnum(): # don't escape within a snake_case word
+ text = text[:pos] + "\_" + text[pos + 1:]
+ pos += 2
+ else:
+ pos += 1
+
+ return text
+
+
def rstize_text(text, state): # type: (str, State) -> str
# Linebreak + tabs in the XML should become two line breaks unless in a "codeblock"
pos = 0
@@ -677,36 +713,7 @@ def rstize_text(text, state): # type: (str, State) -> str
pos += 2
next_brac_pos = text.find('[')
-
- # Escape \ character, otherwise it ends up as an escape character in rst
- pos = 0
- while True:
- pos = text.find('\\', pos, next_brac_pos)
- if pos == -1:
- break
- text = text[:pos] + "\\\\" + text[pos + 1:]
- pos += 2
-
- # Escape * character to avoid interpreting it as emphasis
- pos = 0
- while True:
- pos = text.find('*', pos, next_brac_pos)
- if pos == -1:
- break
- text = text[:pos] + "\*" + text[pos + 1:]
- pos += 2
-
- # Escape _ character at the end of a word to avoid interpreting it as an inline hyperlink
- pos = 0
- while True:
- pos = text.find('_', pos, next_brac_pos)
- if pos == -1:
- break
- if not text[pos + 1].isalnum(): # don't escape within a snake_case word
- text = text[:pos] + "\_" + text[pos + 1:]
- pos += 2
- else:
- pos += 1
+ text = escape_rst(text, next_brac_pos)
# Handle [tags]
inside_code = False
@@ -975,7 +982,11 @@ def make_enum(t, state): # type: (str, State) -> str
if c in state.classes and e in state.classes[c].enums:
return ":ref:`{0}<enum_{1}_{0}>`".format(e, c)
- print_error("Unresolved enum '{}', file: {}".format(t, state.current_class), state)
+
+ # Don't fail for `Vector3.Axis`, as this enum is a special case which is expected not to be resolved.
+ if "{}.{}".format(c, e) != "Vector3.Axis":
+ print_error("Unresolved enum '{}', file: {}".format(t, state.current_class), state)
+
return t
diff --git a/drivers/SCsub b/drivers/SCsub
index 583973c025..d7003a07ce 100644
--- a/drivers/SCsub
+++ b/drivers/SCsub
@@ -46,9 +46,7 @@ if env['vsproj']:
env.AddToVSProject(env.drivers_sources)
os.chdir(path)
-if env.split_drivers:
- env.split_lib("drivers")
-else:
- env.add_source_files(env.drivers_sources, "*.cpp")
- lib = env.add_library("drivers", env.drivers_sources)
- env.Prepend(LIBS=[lib])
+env.add_source_files(env.drivers_sources, "*.cpp")
+
+lib = env.add_library("drivers", env.drivers_sources)
+env.Prepend(LIBS=[lib])
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index ac54af722c..3b2851fbcd 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -406,6 +406,66 @@ void RasterizerCanvasGLES2::_draw_generic(GLuint p_primitive, int p_vertex_count
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
+void RasterizerCanvasGLES2::_draw_generic_indices(GLuint p_primitive, 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) {
+
+ glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
+#ifndef GLES_OVER_GL
+ // Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
+ glBufferData(GL_ARRAY_BUFFER, data.polygon_buffer_size, NULL, GL_DYNAMIC_DRAW);
+#endif
+
+ uint32_t buffer_ofs = 0;
+
+ glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vector2) * p_vertex_count, p_vertices);
+ glEnableVertexAttribArray(VS::ARRAY_VERTEX);
+ glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), NULL);
+ buffer_ofs += sizeof(Vector2) * p_vertex_count;
+
+ if (p_singlecolor) {
+ glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ Color m = *p_colors;
+ glVertexAttrib4f(VS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
+ } else if (!p_colors) {
+ glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ } else {
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
+ glEnableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ buffer_ofs += sizeof(Color) * p_vertex_count;
+ }
+
+ if (p_uvs) {
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
+ glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, GL_FALSE, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ buffer_ofs += sizeof(Vector2) * p_vertex_count;
+ } else {
+ glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
+ }
+
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
+#ifndef GLES_OVER_GL
+ // Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer_size, NULL, GL_DYNAMIC_DRAW);
+#endif
+
+ if (storage->config.support_32_bits_indices) { //should check for
+ glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(int) * p_index_count, p_indices);
+ glDrawElements(p_primitive, p_index_count, GL_UNSIGNED_INT, 0);
+ } else {
+ uint16_t *index16 = (uint16_t *)alloca(sizeof(uint16_t) * p_index_count);
+ for (int i = 0; i < p_index_count; i++) {
+ index16[i] = uint16_t(p_indices[i]);
+ }
+ glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(uint16_t) * p_index_count, index16);
+ glDrawElements(p_primitive, p_index_count, GL_UNSIGNED_SHORT, 0);
+ }
+
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+}
+
void RasterizerCanvasGLES2::_draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color *p_colors, const Vector2 *p_uvs) {
static const GLenum prim[5] = { GL_POINTS, GL_POINTS, GL_LINES, GL_TRIANGLES, GL_TRIANGLE_FAN };
@@ -973,7 +1033,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
#ifdef GLES_OVER_GL
if (polygon->antialiased) {
glEnable(GL_LINE_SMOOTH);
- _draw_generic(GL_LINE_LOOP, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
+ _draw_generic_indices(GL_LINE_STRIP, polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
glDisable(GL_LINE_SMOOTH);
}
#endif
@@ -1838,9 +1898,20 @@ void RasterizerCanvasGLES2::canvas_light_shadow_buffer_update(RID p_buffer, cons
}
state.canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES2::WORLD_MATRIX, instance->xform_cache);
- if (cull != instance->cull_cache) {
- cull = instance->cull_cache;
+ VS::CanvasOccluderPolygonCullMode transformed_cull_cache = instance->cull_cache;
+
+ if (transformed_cull_cache != VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED &&
+ (p_light_xform.basis_determinant() * instance->xform_cache.basis_determinant()) < 0) {
+ transformed_cull_cache =
+ transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
+ VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
+ VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
+ }
+
+ if (cull != transformed_cull_cache) {
+
+ cull = transformed_cull_cache;
switch (cull) {
case VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED: {
diff --git a/drivers/gles2/rasterizer_canvas_gles2.h b/drivers/gles2/rasterizer_canvas_gles2.h
index ba636a9763..5df5b10f3c 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.h
+++ b/drivers/gles2/rasterizer_canvas_gles2.h
@@ -118,6 +118,7 @@ public:
_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, const float *p_weights = NULL, const int *p_bones = NULL);
_FORCE_INLINE_ void _draw_generic(GLuint p_primitive, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor);
+ _FORCE_INLINE_ void _draw_generic_indices(GLuint p_primitive, 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);
_FORCE_INLINE_ void _canvas_item_render_commands(Item *p_item, Item *current_clip, bool &reclip, RasterizerStorageGLES2::Material *p_material);
void _copy_screen(const Rect2 &p_rect);
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 40e7f0c441..388a8423a0 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -4914,7 +4914,11 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
bool used_depth = false;
if (j == 0 && i == 0) { //use always
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0);
+ if (config.support_depth_texture) {
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0);
+ } else {
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth);
+ }
used_depth = true;
}
@@ -5807,6 +5811,13 @@ void RasterizerStorageGLES2::initialize() {
config.pvrtc_supported = config.extensions.has("IMG_texture_compression_pvrtc") || config.extensions.has("WEBGL_compressed_texture_pvrtc");
config.support_npot_repeat_mipmap = config.extensions.has("GL_OES_texture_npot");
+#ifdef JAVASCRIPT_ENABLED
+ // no way of detecting 32 or 16 bit support for renderbuffer, so default to 32
+ // if the implementation doesn't support 32, it should just quietly use 16 instead
+ // https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/
+ config.depth_buffer_internalformat = GL_DEPTH_COMPONENT;
+ config.depth_type = GL_UNSIGNED_INT;
+#else
// on mobile check for 24 bit depth support for RenderBufferStorage
if (config.extensions.has("GL_OES_depth24")) {
config.depth_buffer_internalformat = _DEPTH_COMPONENT24_OES;
@@ -5816,6 +5827,7 @@ void RasterizerStorageGLES2::initialize() {
config.depth_type = GL_UNSIGNED_SHORT;
}
#endif
+#endif
#ifndef GLES_OVER_GL
//Manually load extensions for android and ios
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index 7e9b6fdb82..94cb286b0e 100644
--- a/drivers/gles2/shader_compiler_gles2.cpp
+++ b/drivers/gles2/shader_compiler_gles2.cpp
@@ -911,7 +911,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
actions[VS::SHADER_CANVAS_ITEM].renames["VERTEX"] = "outvec.xy";
actions[VS::SHADER_CANVAS_ITEM].renames["UV"] = "uv";
- actions[VS::SHADER_CANVAS_ITEM].renames["POINT_SIZE"] = "gl_PointSize";
+ actions[VS::SHADER_CANVAS_ITEM].renames["POINT_SIZE"] = "point_size";
actions[VS::SHADER_CANVAS_ITEM].renames["WORLD_MATRIX"] = "modelview_matrix";
actions[VS::SHADER_CANVAS_ITEM].renames["PROJECTION_MATRIX"] = "projection_matrix";
@@ -986,7 +986,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
actions[VS::SHADER_SPATIAL].renames["UV"] = "uv_interp";
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["POINT_SIZE"] = "point_size";
// gl_InstanceID is not available in OpenGL ES 2.0
actions[VS::SHADER_SPATIAL].renames["INSTANCE_ID"] = "0";
diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h
index c7a6465194..fbca69e0bb 100644
--- a/drivers/gles2/shader_gles2.h
+++ b/drivers/gles2/shader_gles2.h
@@ -118,10 +118,12 @@ private:
uint32_t code_version;
bool ok;
Version() {
- code_version = 0;
+ id = 0;
+ vert_id = 0;
frag_id = 0;
- ok = false;
uniform_location = NULL;
+ code_version = 0;
+ ok = false;
}
};
diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl
index 08548ded17..afce403a9f 100644
--- a/drivers/gles2/shaders/canvas.glsl
+++ b/drivers/gles2/shaders/canvas.glsl
@@ -149,6 +149,8 @@ void main() {
uv = uv_attrib;
#endif
+ float point_size = 1.0;
+
{
vec2 src_vtx = outvec.xy;
/* clang-format off */
@@ -158,6 +160,8 @@ VERTEX_SHADER_CODE
/* clang-format on */
}
+ gl_PointSize = point_size;
+
#if !defined(SKIP_TRANSFORM_USED)
outvec = extra_matrix_instance * outvec;
outvec = modelview_matrix * outvec;
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index 25dbbf3c90..63eee4eb87 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -251,12 +251,10 @@ void light_compute(
//normalized blinn always unless disabled
vec3 H = normalize(V + L);
float cNdotH = max(dot(N, H), 0.0);
- float cVdotH = max(dot(V, H), 0.0);
- float cLdotH = max(dot(L, H), 0.0);
float shininess = exp2(15.0 * (1.0 - roughness) + 1.0) * 0.25;
- float blinn = pow(cNdotH, shininess);
+ float blinn = pow(cNdotH, shininess) * cNdotL;
blinn *= (shininess + 8.0) * (1.0 / (8.0 * M_PI));
- specular_brdf_NL = (blinn) / max(4.0 * cNdotV * cNdotL, 0.75);
+ specular_brdf_NL = blinn;
#endif
SRGB_APPROX(specular_brdf_NL)
@@ -425,6 +423,8 @@ void main() {
#define projection_matrix local_projection_matrix
#define world_transform world_matrix
+ float point_size = 1.0;
+
{
/* clang-format off */
@@ -433,6 +433,7 @@ VERTEX_SHADER_CODE
/* clang-format on */
}
+ gl_PointSize = point_size;
vec4 outvec = vertex;
// use local coordinates
@@ -1270,9 +1271,9 @@ LIGHT_SHADER_CODE
//normalized blinn
float shininess = exp2(15.0 * (1.0 - roughness) + 1.0) * 0.25;
- float blinn = pow(cNdotH, shininess);
+ float blinn = pow(cNdotH, shininess) * cNdotL;
blinn *= (shininess + 8.0) * (1.0 / (8.0 * M_PI));
- specular_brdf_NL = (blinn) / max(4.0 * cNdotV * cNdotL, 0.75);
+ specular_brdf_NL = blinn;
#elif defined(SPECULAR_PHONG)
@@ -1547,157 +1548,157 @@ FRAGMENT_SHADER_CODE
#endif // !USE_SHADOW_TO_OPACITY
#ifdef BASE_PASS
- {
- // IBL precalculations
- float ndotv = clamp(dot(normal, eye_position), 0.0, 1.0);
- vec3 f0 = F0(metallic, specular, albedo);
- vec3 F = f0 + (max(vec3(1.0 - roughness), f0) - f0) * pow(1.0 - ndotv, 5.0);
+
+ // IBL precalculations
+ float ndotv = clamp(dot(normal, eye_position), 0.0, 1.0);
+ vec3 f0 = F0(metallic, specular, albedo);
+ vec3 F = f0 + (max(vec3(1.0 - roughness), f0) - f0) * pow(1.0 - ndotv, 5.0);
#ifdef AMBIENT_LIGHT_DISABLED
- ambient_light = vec3(0.0, 0.0, 0.0);
+ ambient_light = vec3(0.0, 0.0, 0.0);
#else
#ifdef USE_RADIANCE_MAP
- vec3 ref_vec = reflect(-eye_position, N);
- ref_vec = normalize((radiance_inverse_xform * vec4(ref_vec, 0.0)).xyz);
+ vec3 ref_vec = reflect(-eye_position, N);
+ ref_vec = normalize((radiance_inverse_xform * vec4(ref_vec, 0.0)).xyz);
- ref_vec.z *= -1.0;
+ ref_vec.z *= -1.0;
- specular_light = textureCubeLod(radiance_map, ref_vec, roughness * RADIANCE_MAX_LOD).xyz * bg_energy;
+ specular_light = textureCubeLod(radiance_map, ref_vec, roughness * RADIANCE_MAX_LOD).xyz * bg_energy;
#ifndef USE_LIGHTMAP
- {
- vec3 ambient_dir = normalize((radiance_inverse_xform * vec4(normal, 0.0)).xyz);
- vec3 env_ambient = textureCubeLod(radiance_map, ambient_dir, 4.0).xyz * bg_energy;
- env_ambient *= 1.0 - F;
+ {
+ vec3 ambient_dir = normalize((radiance_inverse_xform * vec4(normal, 0.0)).xyz);
+ vec3 env_ambient = textureCubeLod(radiance_map, ambient_dir, 4.0).xyz * bg_energy;
+ env_ambient *= 1.0 - F;
- ambient_light = mix(ambient_color.rgb, env_ambient, ambient_sky_contribution);
- }
+ ambient_light = mix(ambient_color.rgb, env_ambient, ambient_sky_contribution);
+ }
#endif
#else
- ambient_light = ambient_color.rgb;
- specular_light = bg_color.rgb * bg_energy;
+ ambient_light = ambient_color.rgb;
+ specular_light = bg_color.rgb * bg_energy;
#endif
#endif // AMBIENT_LIGHT_DISABLED
- ambient_light *= ambient_energy;
+ ambient_light *= ambient_energy;
#if defined(USE_REFLECTION_PROBE1) || defined(USE_REFLECTION_PROBE2)
- vec4 ambient_accum = vec4(0.0);
- vec4 reflection_accum = vec4(0.0);
+ vec4 ambient_accum = vec4(0.0);
+ vec4 reflection_accum = vec4(0.0);
#ifdef USE_REFLECTION_PROBE1
- reflection_process(reflection_probe1,
+ reflection_process(reflection_probe1,
#ifdef USE_VERTEX_LIGHTING
- refprobe1_reflection_normal_blend.rgb,
+ refprobe1_reflection_normal_blend.rgb,
#ifndef USE_LIGHTMAP
- refprobe1_ambient_normal,
+ refprobe1_ambient_normal,
#endif
- refprobe1_reflection_normal_blend.a,
+ refprobe1_reflection_normal_blend.a,
#else
- normal_interp, vertex_interp, refprobe1_local_matrix,
- refprobe1_use_box_project, refprobe1_box_extents, refprobe1_box_offset,
+ normal_interp, vertex_interp, refprobe1_local_matrix,
+ refprobe1_use_box_project, refprobe1_box_extents, refprobe1_box_offset,
#endif
- refprobe1_exterior, refprobe1_intensity, refprobe1_ambient, roughness,
- ambient_light, specular_light, reflection_accum, ambient_accum);
+ refprobe1_exterior, refprobe1_intensity, refprobe1_ambient, roughness,
+ ambient_light, specular_light, reflection_accum, ambient_accum);
#endif // USE_REFLECTION_PROBE1
#ifdef USE_REFLECTION_PROBE2
- reflection_process(reflection_probe2,
+ reflection_process(reflection_probe2,
#ifdef USE_VERTEX_LIGHTING
- refprobe2_reflection_normal_blend.rgb,
+ refprobe2_reflection_normal_blend.rgb,
#ifndef USE_LIGHTMAP
- refprobe2_ambient_normal,
+ refprobe2_ambient_normal,
#endif
- refprobe2_reflection_normal_blend.a,
+ refprobe2_reflection_normal_blend.a,
#else
- normal_interp, vertex_interp, refprobe2_local_matrix,
- refprobe2_use_box_project, refprobe2_box_extents, refprobe2_box_offset,
+ normal_interp, vertex_interp, refprobe2_local_matrix,
+ refprobe2_use_box_project, refprobe2_box_extents, refprobe2_box_offset,
#endif
- refprobe2_exterior, refprobe2_intensity, refprobe2_ambient, roughness,
- ambient_light, specular_light, reflection_accum, ambient_accum);
+ refprobe2_exterior, refprobe2_intensity, refprobe2_ambient, roughness,
+ ambient_light, specular_light, reflection_accum, ambient_accum);
#endif // USE_REFLECTION_PROBE2
- if (reflection_accum.a > 0.0) {
- specular_light = reflection_accum.rgb / reflection_accum.a;
- }
+ if (reflection_accum.a > 0.0) {
+ specular_light = reflection_accum.rgb / reflection_accum.a;
+ }
#ifndef USE_LIGHTMAP
- if (ambient_accum.a > 0.0) {
- ambient_light = ambient_accum.rgb / ambient_accum.a;
- }
+ if (ambient_accum.a > 0.0) {
+ ambient_light = ambient_accum.rgb / ambient_accum.a;
+ }
#endif
#endif // defined(USE_REFLECTION_PROBE1) || defined(USE_REFLECTION_PROBE2)
- // environment BRDF approximation
- {
+ // environment BRDF approximation
+ {
#if defined(DIFFUSE_TOON)
- //simplify for toon, as
- specular_light *= specular * metallic * albedo * 2.0;
+ //simplify for toon, as
+ specular_light *= specular * metallic * albedo * 2.0;
#else
- // scales the specular reflections, needs to be be computed before lighting happens,
- // but after environment and reflection probes are added
- //TODO: this curve is not really designed for gammaspace, should be adjusted
- const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
- const vec4 c1 = vec4(1.0, 0.0425, 1.04, -0.04);
- vec4 r = roughness * c0 + c1;
- float a004 = min(r.x * r.x, exp2(-9.28 * ndotv)) * r.x + r.y;
- vec2 env = vec2(-1.04, 1.04) * a004 + r.zw;
- specular_light *= env.x * F + env.y;
+ // scales the specular reflections, needs to be be computed before lighting happens,
+ // but after environment and reflection probes are added
+ //TODO: this curve is not really designed for gammaspace, should be adjusted
+ const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
+ const vec4 c1 = vec4(1.0, 0.0425, 1.04, -0.04);
+ vec4 r = roughness * c0 + c1;
+ float a004 = min(r.x * r.x, exp2(-9.28 * ndotv)) * r.x + r.y;
+ vec2 env = vec2(-1.04, 1.04) * a004 + r.zw;
+ specular_light *= env.x * F + env.y;
#endif
- }
+ }
#ifdef USE_LIGHTMAP
- //ambient light will come entirely from lightmap is lightmap is used
- ambient_light = texture2D(lightmap, uv2_interp).rgb * lightmap_energy;
+ //ambient light will come entirely from lightmap is lightmap is used
+ ambient_light = texture2D(lightmap, uv2_interp).rgb * lightmap_energy;
#endif
#ifdef USE_LIGHTMAP_CAPTURE
- {
- vec3 cone_dirs[12] = vec3[](
- vec3(0.0, 0.0, 1.0),
- vec3(0.866025, 0.0, 0.5),
- vec3(0.267617, 0.823639, 0.5),
- vec3(-0.700629, 0.509037, 0.5),
- vec3(-0.700629, -0.509037, 0.5),
- vec3(0.267617, -0.823639, 0.5),
- vec3(0.0, 0.0, -1.0),
- vec3(0.866025, 0.0, -0.5),
- vec3(0.267617, 0.823639, -0.5),
- vec3(-0.700629, 0.509037, -0.5),
- vec3(-0.700629, -0.509037, -0.5),
- vec3(0.267617, -0.823639, -0.5));
-
- vec3 local_normal = normalize(camera_matrix * vec4(normal, 0.0)).xyz;
- vec4 captured = vec4(0.0);
- float sum = 0.0;
- for (int i = 0; i < 12; i++) {
- float amount = max(0.0, dot(local_normal, cone_dirs[i])); //not correct, but creates a nice wrap around effect
- captured += lightmap_captures[i] * amount;
- sum += amount;
- }
+ {
+ vec3 cone_dirs[12] = vec3[](
+ vec3(0.0, 0.0, 1.0),
+ vec3(0.866025, 0.0, 0.5),
+ vec3(0.267617, 0.823639, 0.5),
+ vec3(-0.700629, 0.509037, 0.5),
+ vec3(-0.700629, -0.509037, 0.5),
+ vec3(0.267617, -0.823639, 0.5),
+ vec3(0.0, 0.0, -1.0),
+ vec3(0.866025, 0.0, -0.5),
+ vec3(0.267617, 0.823639, -0.5),
+ vec3(-0.700629, 0.509037, -0.5),
+ vec3(-0.700629, -0.509037, -0.5),
+ vec3(0.267617, -0.823639, -0.5));
+
+ vec3 local_normal = normalize(camera_matrix * vec4(normal, 0.0)).xyz;
+ vec4 captured = vec4(0.0);
+ float sum = 0.0;
+ for (int i = 0; i < 12; i++) {
+ float amount = max(0.0, dot(local_normal, cone_dirs[i])); //not correct, but creates a nice wrap around effect
+ captured += lightmap_captures[i] * amount;
+ sum += amount;
+ }
- captured /= sum;
+ captured /= sum;
- if (lightmap_capture_sky) {
- ambient_light = mix(ambient_light, captured.rgb, captured.a);
- } else {
- ambient_light = captured.rgb;
- }
+ if (lightmap_capture_sky) {
+ ambient_light = mix(ambient_light, captured.rgb, captured.a);
+ } else {
+ ambient_light = captured.rgb;
}
-#endif
}
+#endif
+
#endif //BASE PASS
//
@@ -2052,17 +2053,6 @@ FRAGMENT_SHADER_CODE
specular_light += specular_interp * specular_blob_intensity * light_att;
diffuse_light += diffuse_interp * albedo * light_att;
- // Same as above, needed for VERTEX_LIGHTING or else lights are too bright
- const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
- const vec4 c1 = vec4(1.0, 0.0425, 1.04, -0.04);
- vec4 r = roughness * c0 + c1;
- float ndotv = clamp(dot(normal, eye_position), 0.0, 1.0);
- float a004 = min(r.x * r.x, exp2(-9.28 * ndotv)) * r.x + r.y;
- vec2 env = vec2(-1.04, 1.04) * a004 + r.zw;
-
- vec3 f0 = F0(metallic, specular, albedo);
- specular_light *= env.x * f0 + env.y;
-
#else
//fragment lighting
light_compute(
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 55d16a6c2e..1803a3dbbe 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -327,9 +327,8 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
#ifndef GLES_OVER_GL
- // Orphan the buffers to avoid CPU/GPU sync points caused by glBufferSubData
+ // Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
glBufferData(GL_ARRAY_BUFFER, data.polygon_buffer_size, NULL, GL_DYNAMIC_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer_size, NULL, GL_DYNAMIC_DRAW);
#endif
uint32_t buffer_ofs = 0;
@@ -402,6 +401,10 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
//bind the indices buffer.
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
+#ifndef GLES_OVER_GL
+ // Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer_size, NULL, GL_DYNAMIC_DRAW);
+#endif
glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(int) * p_index_count, p_indices);
//draw the triangles.
@@ -416,6 +419,7 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
}
glBindVertexArray(0);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
}
void RasterizerCanvasGLES3::_draw_generic(GLuint p_primitive, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor) {
@@ -424,9 +428,8 @@ void RasterizerCanvasGLES3::_draw_generic(GLuint p_primitive, int p_vertex_count
glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
#ifndef GLES_OVER_GL
- // Orphan the buffers to avoid CPU/GPU sync points caused by glBufferSubData
+ // Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
glBufferData(GL_ARRAY_BUFFER, data.polygon_buffer_size, NULL, GL_DYNAMIC_DRAW);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer_size, NULL, GL_DYNAMIC_DRAW);
#endif
uint32_t buffer_ofs = 0;
@@ -469,6 +472,80 @@ void RasterizerCanvasGLES3::_draw_generic(GLuint p_primitive, int p_vertex_count
storage->frame.canvas_draw_commands++;
glBindVertexArray(0);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+}
+
+void RasterizerCanvasGLES3::_draw_generic_indices(GLuint p_primitive, 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) {
+
+ glBindVertexArray(data.polygon_buffer_pointer_array);
+ glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
+
+#ifndef GLES_OVER_GL
+ // Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
+ glBufferData(GL_ARRAY_BUFFER, data.polygon_buffer_size, NULL, GL_DYNAMIC_DRAW);
+#endif
+
+ uint32_t buffer_ofs = 0;
+
+ //vertex
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_vertices);
+ glEnableVertexAttribArray(VS::ARRAY_VERTEX);
+ glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ buffer_ofs += sizeof(Vector2) * p_vertex_count;
+ //color
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size);
+#endif
+
+ if (p_singlecolor) {
+ glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ Color m = *p_colors;
+ glVertexAttrib4f(VS::ARRAY_COLOR, m.r, m.g, m.b, m.a);
+ } else if (!p_colors) {
+ glDisableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
+ } else {
+
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Color) * p_vertex_count, p_colors);
+ glEnableVertexAttribArray(VS::ARRAY_COLOR);
+ glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false, sizeof(Color), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ buffer_ofs += sizeof(Color) * p_vertex_count;
+ }
+
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size);
+#endif
+
+ if (p_uvs) {
+
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
+ glEnableVertexAttribArray(VS::ARRAY_TEX_UV);
+ glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs));
+ buffer_ofs += sizeof(Vector2) * p_vertex_count;
+
+ } else {
+ glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
+ }
+
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size);
+#endif
+
+ //bind the indices buffer.
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
+#ifndef GLES_OVER_GL
+ // Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer_size, NULL, GL_DYNAMIC_DRAW);
+#endif
+ glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(int) * p_index_count, p_indices);
+
+ //draw the triangles.
+ glDrawElements(p_primitive, p_index_count, GL_UNSIGNED_INT, 0);
+
+ storage->frame.canvas_draw_commands++;
+
+ glBindVertexArray(0);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
}
void RasterizerCanvasGLES3::_draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color *p_colors, const Vector2 *p_uvs) {
@@ -824,7 +901,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
#ifdef GLES_OVER_GL
if (polygon->antialiased) {
glEnable(GL_LINE_SMOOTH);
- _draw_generic(GL_LINE_LOOP, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
+ _draw_generic_indices(GL_LINE_STRIP, polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
glDisable(GL_LINE_SMOOTH);
}
#endif
@@ -1810,9 +1887,20 @@ void RasterizerCanvasGLES3::canvas_light_shadow_buffer_update(RID p_buffer, cons
}
state.canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES3::WORLD_MATRIX, instance->xform_cache);
- if (cull != instance->cull_cache) {
- cull = instance->cull_cache;
+ VS::CanvasOccluderPolygonCullMode transformed_cull_cache = instance->cull_cache;
+
+ if (transformed_cull_cache != VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED &&
+ (p_light_xform.basis_determinant() * instance->xform_cache.basis_determinant()) < 0) {
+ transformed_cull_cache =
+ transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
+ VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
+ VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
+ }
+
+ if (cull != transformed_cull_cache) {
+
+ cull = transformed_cull_cache;
switch (cull) {
case VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED: {
diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h
index 382b1e5640..b1671a6d1c 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.h
+++ b/drivers/gles3/rasterizer_canvas_gles3.h
@@ -132,6 +132,7 @@ public:
_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, const int *p_bones, const float *p_weights);
_FORCE_INLINE_ void _draw_generic(GLuint p_primitive, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor);
+ _FORCE_INLINE_ void _draw_generic_indices(GLuint p_primitive, 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);
_FORCE_INLINE_ void _canvas_item_render_commands(Item *p_item, Item *current_clip, bool &reclip);
_FORCE_INLINE_ void _copy_texscreen(const Rect2 &p_rect);
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 9815936d1e..66ff0a1845 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -4147,7 +4147,11 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas);
ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_reflection_atlas);
- if (shadow_atlas && shadow_atlas->size) {
+ bool use_shadows = shadow_atlas && shadow_atlas->size;
+
+ state.scene_shader.set_conditional(SceneShaderGLES3::USE_SHADOW, use_shadows);
+
+ if (use_shadows) {
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 5);
glBindTexture(GL_TEXTURE_2D, shadow_atlas->depth);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
@@ -4521,15 +4525,15 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
if (state.directional_light_count == 0) {
directional_light = NULL;
- _render_list(render_list.elements, render_list.element_count, p_cam_transform, p_cam_projection, sky, false, false, false, false, shadow_atlas != NULL);
+ _render_list(render_list.elements, render_list.element_count, p_cam_transform, p_cam_projection, sky, false, false, false, false, use_shadows);
} else {
for (int i = 0; i < state.directional_light_count; i++) {
directional_light = directional_lights[i];
if (i > 0) {
glEnable(GL_BLEND);
}
- _setup_directional_light(i, p_cam_transform.affine_inverse(), shadow_atlas != NULL && shadow_atlas->size > 0);
- _render_list(render_list.elements, render_list.element_count, p_cam_transform, p_cam_projection, sky, false, false, false, i > 0, shadow_atlas != NULL);
+ _setup_directional_light(i, p_cam_transform.affine_inverse(), use_shadows);
+ _render_list(render_list.elements, render_list.element_count, p_cam_transform, p_cam_projection, sky, false, false, false, i > 0, use_shadows);
}
}
@@ -4607,12 +4611,12 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
if (state.directional_light_count == 0) {
directional_light = NULL;
- _render_list(&render_list.elements[render_list.max_elements - render_list.alpha_element_count], render_list.alpha_element_count, p_cam_transform, p_cam_projection, sky, false, true, false, false, shadow_atlas != NULL);
+ _render_list(&render_list.elements[render_list.max_elements - render_list.alpha_element_count], render_list.alpha_element_count, p_cam_transform, p_cam_projection, sky, false, true, false, false, use_shadows);
} else {
for (int i = 0; i < state.directional_light_count; i++) {
directional_light = directional_lights[i];
- _setup_directional_light(i, p_cam_transform.affine_inverse(), shadow_atlas != NULL && shadow_atlas->size > 0);
- _render_list(&render_list.elements[render_list.max_elements - render_list.alpha_element_count], render_list.alpha_element_count, p_cam_transform, p_cam_projection, sky, false, true, false, i > 0, shadow_atlas != NULL);
+ _setup_directional_light(i, p_cam_transform.affine_inverse(), use_shadows);
+ _render_list(&render_list.elements[render_list.max_elements - render_list.alpha_element_count], render_list.alpha_element_count, p_cam_transform, p_cam_projection, sky, false, true, false, i > 0, use_shadows);
}
}
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index 7499962da3..e78ecbae34 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -913,7 +913,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_CANVAS_ITEM].renames["VERTEX"] = "outvec.xy";
actions[VS::SHADER_CANVAS_ITEM].renames["UV"] = "uv";
- actions[VS::SHADER_CANVAS_ITEM].renames["POINT_SIZE"] = "gl_PointSize";
+ actions[VS::SHADER_CANVAS_ITEM].renames["POINT_SIZE"] = "point_size";
actions[VS::SHADER_CANVAS_ITEM].renames["WORLD_MATRIX"] = "modelview_matrix";
actions[VS::SHADER_CANVAS_ITEM].renames["PROJECTION_MATRIX"] = "projection_matrix";
@@ -970,7 +970,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_SPATIAL].renames["UV"] = "uv_interp";
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["POINT_SIZE"] = "point_size";
actions[VS::SHADER_SPATIAL].renames["INSTANCE_ID"] = "gl_InstanceID";
//builtins
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl
index 7255b0425c..53f84abf51 100644
--- a/drivers/gles3/shaders/canvas.glsl
+++ b/drivers/gles3/shaders/canvas.glsl
@@ -150,6 +150,7 @@ void main() {
#define extra_matrix extra_matrix_instance
+ float point_size = 1.0;
//for compatibility with the fragment shader we need to use uv here
vec2 uv = uv_interp;
{
@@ -160,6 +161,7 @@ VERTEX_SHADER_CODE
/* clang-format on */
}
+ gl_PointSize = point_size;
uv_interp = uv;
#ifdef USE_NINEPATCH
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index e1b0e9f595..549a36817e 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -213,12 +213,10 @@ void light_compute(vec3 N, vec3 L, vec3 V, vec3 light_color, float roughness, in
//normalized blinn always unless disabled
vec3 H = normalize(V + L);
float cNdotH = max(dot(N, H), 0.0);
- float cVdotH = max(dot(V, H), 0.0);
- float cLdotH = max(dot(L, H), 0.0);
float shininess = exp2(15.0 * (1.0 - roughness) + 1.0) * 0.25;
- float blinn = pow(cNdotH, shininess);
+ float blinn = pow(cNdotH, shininess) * cNdotL;
blinn *= (shininess + 8.0) * (1.0 / (8.0 * M_PI));
- specular_brdf_NL = (blinn) / max(4.0 * cNdotV * cNdotL, 0.75);
+ specular_brdf_NL = blinn;
#endif
specular += specular_brdf_NL * light_color * (1.0 / M_PI);
@@ -434,6 +432,8 @@ void main() {
}
#endif
+ float point_size = 1.0;
+
highp mat4 modelview = camera_inverse_matrix * world_matrix;
{
/* clang-format off */
@@ -443,6 +443,8 @@ VERTEX_SHADER_CODE
/* clang-format on */
}
+ gl_PointSize = point_size;
+
// using local coordinates (default)
#if !defined(SKIP_TRANSFORM_USED) && !defined(VERTEX_WORLD_COORDS_USED)
@@ -1094,9 +1096,9 @@ LIGHT_SHADER_CODE
//normalized blinn
float shininess = exp2(15.0 * (1.0 - roughness) + 1.0) * 0.25;
- float blinn = pow(cNdotH, shininess);
+ float blinn = pow(cNdotH, shininess) * cNdotL;
blinn *= (shininess + 8.0) * (1.0 / (8.0 * M_PI));
- float intensity = (blinn) / max(4.0 * cNdotV * cNdotL, 0.75);
+ float intensity = blinn;
specular_light += light_color * intensity * specular_blob_intensity * attenuation;
@@ -1256,6 +1258,7 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
vec3 light_attenuation = vec3(omni_attenuation);
#if !defined(SHADOWS_DISABLED)
+#ifdef USE_SHADOW
if (omni_lights[idx].light_params.w > 0.5) {
// there is a shadowmap
@@ -1300,6 +1303,7 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
#endif
light_attenuation *= mix(omni_lights[idx].shadow_color_contact.rgb, vec3(1.0), shadow);
}
+#endif //USE_SHADOW
#endif //SHADOWS_DISABLED
light_compute(normal, normalize(light_rel_vec), eye_vec, binormal, tangent, omni_lights[idx].light_color_energy.rgb, light_attenuation, albedo, transmission, omni_lights[idx].light_params.z * p_blob_intensity, roughness, metallic, specular, rim * omni_attenuation, rim_tint, clearcoat, clearcoat_gloss, anisotropy, diffuse_light, specular_light, alpha);
}
@@ -1318,6 +1322,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
vec3 light_attenuation = vec3(spot_attenuation);
#if !defined(SHADOWS_DISABLED)
+#ifdef USE_SHADOW
if (spot_lights[idx].light_params.w > 0.5) {
//there is a shadowmap
highp vec4 splane = (spot_lights[idx].shadow_matrix * vec4(vertex, 1.0));
@@ -1334,6 +1339,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
#endif
light_attenuation *= mix(spot_lights[idx].shadow_color_contact.rgb, vec3(1.0), shadow);
}
+#endif //USE_SHADOW
#endif //SHADOWS_DISABLED
light_compute(normal, normalize(light_rel_vec), eye_vec, binormal, tangent, spot_lights[idx].light_color_energy.rgb, light_attenuation, albedo, transmission, spot_lights[idx].light_params.z * p_blob_intensity, roughness, metallic, specular, rim * spot_attenuation, rim_tint, clearcoat, clearcoat_gloss, anisotropy, diffuse_light, specular_light, alpha);
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 40aa9a28b2..4ec245eacf 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -266,7 +266,6 @@ public:
else
undo_redo->create_action(TTR("Anim Change Call"));
- Variant prev = animation->track_get_key_value(track, key);
setting = true;
undo_redo->add_do_method(animation.ptr(), "track_set_key_value", track, key, d_new);
undo_redo->add_undo_method(animation.ptr(), "track_set_key_value", track, key, d_old);
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 16780a795f..db44edcfcb 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1182,6 +1182,19 @@ void CodeTextEditor::move_lines_down() {
text_editor->update();
}
+void CodeTextEditor::_delete_line(int p_line) {
+ // this is currently intended to be called within delete_lines()
+ // so `begin_complex_operation` is ommitted here
+ text_editor->set_line(p_line, "");
+ if (p_line == 0 && text_editor->get_line_count() > 1) {
+ text_editor->cursor_set_line(1);
+ text_editor->cursor_set_column(0);
+ }
+ text_editor->backspace_at_cursor();
+ text_editor->unfold_line(p_line);
+ text_editor->cursor_set_line(p_line);
+}
+
void CodeTextEditor::delete_lines() {
text_editor->begin_complex_operation();
if (text_editor->is_selection_active()) {
@@ -1189,22 +1202,13 @@ void CodeTextEditor::delete_lines() {
int from_line = text_editor->get_selection_from_line();
int count = Math::abs(to_line - from_line) + 1;
- text_editor->cursor_set_line(to_line, false);
- while (count) {
- text_editor->set_line(text_editor->cursor_get_line(), "");
- text_editor->backspace_at_cursor();
- count--;
- if (count)
- text_editor->unfold_line(from_line);
+ text_editor->cursor_set_line(from_line, false);
+ for (int i = 0; i < count; i++) {
+ _delete_line(from_line);
}
- text_editor->cursor_set_line(from_line - 1);
text_editor->deselect();
} else {
- int line = text_editor->cursor_get_line();
- text_editor->set_line(text_editor->cursor_get_line(), "");
- text_editor->backspace_at_cursor();
- text_editor->unfold_line(line);
- text_editor->cursor_set_line(line);
+ _delete_line(text_editor->cursor_get_line());
}
text_editor->end_complex_operation();
}
@@ -1565,6 +1569,7 @@ void CodeTextEditor::goto_next_bookmark() {
if (bline > line) {
text_editor->unfold_line(bline);
text_editor->cursor_set_line(bline);
+ text_editor->center_viewport_to_cursor();
return;
}
}
@@ -1589,6 +1594,7 @@ void CodeTextEditor::goto_prev_bookmark() {
if (bline < line) {
text_editor->unfold_line(bline);
text_editor->cursor_set_line(bline);
+ text_editor->center_viewport_to_cursor();
return;
}
}
diff --git a/editor/code_editor.h b/editor/code_editor.h
index f2a55cfb70..a4cd521afa 100644
--- a/editor/code_editor.h
+++ b/editor/code_editor.h
@@ -185,6 +185,8 @@ class CodeTextEditor : public VBoxContainer {
void _set_show_warnings_panel(bool p_show);
void _error_pressed(const Ref<InputEvent> &p_event);
+ void _delete_line(int p_line);
+
protected:
virtual void _load_theme_settings() {}
virtual void _validate_script() {}
diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp
index 843d1006d7..745e31e18d 100644
--- a/editor/collada/collada.cpp
+++ b/editor/collada/collada.cpp
@@ -1488,7 +1488,6 @@ Collada::Node *Collada::_parse_visual_instance_geometry(XMLParser &parser) {
Collada::Node *Collada::_parse_visual_instance_camera(XMLParser &parser) {
- String type = parser.get_node_name();
NodeCamera *cam = memnew(NodeCamera);
cam->camera = _uri_to_id(parser.get_attribute_value_safe("url"));
@@ -1509,7 +1508,6 @@ Collada::Node *Collada::_parse_visual_instance_camera(XMLParser &parser) {
Collada::Node *Collada::_parse_visual_instance_light(XMLParser &parser) {
- String type = parser.get_node_name();
NodeLight *cam = memnew(NodeLight);
cam->light = _uri_to_id(parser.get_attribute_value_safe("url"));
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 1f58eda396..c6046f7e19 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -49,7 +49,6 @@ void DependencyEditor::_searched(const String &p_path) {
void DependencyEditor::_load_pressed(Object *p_item, int p_cell, int p_button) {
TreeItem *ti = Object::cast_to<TreeItem>(p_item);
- String fname = ti->get_text(0);
replacing = ti->get_text(1);
search->set_title(TTR("Search Replacement For:") + " " + replacing.get_file());
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 1cafd1d1f4..0ac7b66ae4 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -727,7 +727,7 @@ uint64_t EditorData::get_edited_scene_version() const {
return edited_scene[current_edited_scene].version;
}
uint64_t EditorData::get_scene_version(int p_idx) const {
- ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), false);
+ ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), 0);
return edited_scene[p_idx].version;
}
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 2db4f03859..7fc989b5e9 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -907,25 +907,25 @@ void EditorFileDialog::update_filters() {
const int max_filters = 5;
for (int i = 0; i < MIN(max_filters, filters.size()); i++) {
- String flt = filters[i].get_slice(";", 0);
+ String flt = filters[i].get_slice(";", 0).strip_edges();
if (i > 0)
- all_filters += ",";
+ all_filters += ", ";
all_filters += flt;
}
if (max_filters < filters.size())
all_filters += ", ...";
- filter->add_item(TTR("All Recognized") + " ( " + all_filters + " )");
+ filter->add_item(TTR("All Recognized") + " (" + all_filters + ")");
}
for (int i = 0; i < filters.size(); i++) {
String flt = filters[i].get_slice(";", 0).strip_edges();
String desc = filters[i].get_slice(";", 1).strip_edges();
if (desc.length())
- filter->add_item(desc + " ( " + flt + " )");
+ filter->add_item(desc + " (" + flt + ")");
else
- filter->add_item("( " + flt + " )");
+ filter->add_item("(" + flt + ")");
}
filter->add_item(TTR("All Files (*)"));
diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp
index 9f13049a6b..9ed74b0d84 100644
--- a/editor/editor_folding.cpp
+++ b/editor/editor_folding.cpp
@@ -55,7 +55,6 @@ void EditorFolding::save_resource_folding(const RES &p_resource, const String &p
PoolVector<String> unfolds = _get_unfolds(p_resource.ptr());
config->set_value("folding", "sections_unfolded", unfolds);
- String path = EditorSettings::get_singleton()->get_project_settings_dir();
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
config->save(file);
@@ -76,7 +75,6 @@ void EditorFolding::load_resource_folding(RES p_resource, const String &p_path)
Ref<ConfigFile> config;
config.instance();
- String path = EditorSettings::get_singleton()->get_project_settings_dir();
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
@@ -151,7 +149,6 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path
config->set_value("folding", "resource_unfolds", res_unfolds);
config->set_value("folding", "nodes_folded", nodes_folded);
- String path = EditorSettings::get_singleton()->get_project_settings_dir();
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
config->save(file);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index ab41019ac3..05f029f3c4 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -630,7 +630,7 @@ void EditorNode::_editor_select_next() {
} else {
editor++;
}
- } while (main_editor_buttons[editor]->is_visible());
+ } while (!main_editor_buttons[editor]->is_visible());
_editor_select(editor);
}
@@ -645,7 +645,7 @@ void EditorNode::_editor_select_prev() {
} else {
editor--;
}
- } while (main_editor_buttons[editor]->is_visible());
+ } while (!main_editor_buttons[editor]->is_visible());
_editor_select(editor);
}
@@ -963,7 +963,7 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj, Map<RES, bool>
int len = varray.size();
for (int i = 0; i < len; i++) {
- Variant v = varray.get(i);
+ const Variant &v = varray.get(i);
RES res = v;
if (_find_and_save_resource(res, processed, flags))
ret_changed = true;
@@ -1027,13 +1027,10 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
int c3d = 0;
_find_node_types(editor_data.get_edited_scene_root(), c2d, c3d);
- RID viewport;
bool is2d;
if (c3d < c2d) {
- viewport = scene_root->get_viewport_rid();
is2d = true;
} else {
- viewport = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_viewport_rid();
is2d = false;
}
save.step(TTR("Creating Thumbnail"), 1);
@@ -1282,7 +1279,6 @@ void EditorNode::restart_editor() {
}
_exit_editor();
- String exec = OS::get_singleton()->get_executable_path();
List<String> args;
args.push_back("--path");
@@ -2049,14 +2045,17 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER:
case FILE_CLOSE: {
- if (!p_confirmed && (unsaved_cache || p_option == FILE_CLOSE_ALL_AND_QUIT || p_option == FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER)) {
+ if (!p_confirmed) {
tab_closing = p_option == FILE_CLOSE ? editor_data.get_edited_scene() : _next_unsaved_scene(false);
- String scene_filename = editor_data.get_edited_scene_root(tab_closing)->get_filename();
- save_confirmation->get_ok()->set_text(TTR("Save & Close"));
- save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene_filename != "" ? scene_filename : "unsaved scene"));
- save_confirmation->popup_centered_minsize();
- break;
- } else {
+
+ if (unsaved_cache || p_option == FILE_CLOSE_ALL_AND_QUIT || p_option == FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER) {
+ String scene_filename = editor_data.get_edited_scene_root(tab_closing)->get_filename();
+ save_confirmation->get_ok()->set_text(TTR("Save & Close"));
+ save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene_filename != "" ? scene_filename : "unsaved scene"));
+ save_confirmation->popup_centered_minsize();
+ break;
+ }
+ } else if (p_option == FILE_CLOSE) {
tab_closing = editor_data.get_edited_scene();
}
if (!editor_data.get_edited_scene_root(tab_closing)) {
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index e14beabfa2..4bce6f34d3 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -979,8 +979,6 @@ void EditorPropertyEasing::_draw_easing() {
RID ci = easing_draw->get_canvas_item();
Size2 s = easing_draw->get_size();
- Rect2 r(Point2(), s);
- r = r.grow(3);
const int points = 48;
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index f05c7709d4..6b71ee14d5 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -587,11 +587,24 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("icon_color_pressed", "Button", icon_color_pressed);
// OptionButton
- theme->set_stylebox("normal", "OptionButton", style_widget);
- theme->set_stylebox("hover", "OptionButton", style_widget_hover);
- theme->set_stylebox("pressed", "OptionButton", style_widget_pressed);
- theme->set_stylebox("focus", "OptionButton", style_widget_focus);
- theme->set_stylebox("disabled", "OptionButton", style_widget_disabled);
+ Ref<StyleBoxFlat> style_option_button_normal = style_widget->duplicate();
+ Ref<StyleBoxFlat> style_option_button_hover = style_widget_hover->duplicate();
+ Ref<StyleBoxFlat> style_option_button_pressed = style_widget_pressed->duplicate();
+ Ref<StyleBoxFlat> style_option_button_focus = style_widget_focus->duplicate();
+ Ref<StyleBoxFlat> style_option_button_disabled = style_widget_disabled->duplicate();
+
+ int option_button_arrow_margin = theme->get_icon("GuiOptionArrow", "EditorIcons")->get_size().width + (default_margin_size + 4) * EDSCALE;
+ style_option_button_normal->set_default_margin(MARGIN_RIGHT, option_button_arrow_margin);
+ style_option_button_hover->set_default_margin(MARGIN_RIGHT, option_button_arrow_margin);
+ style_option_button_pressed->set_default_margin(MARGIN_RIGHT, option_button_arrow_margin);
+ style_option_button_focus->set_default_margin(MARGIN_RIGHT, option_button_arrow_margin);
+ style_option_button_disabled->set_default_margin(MARGIN_RIGHT, option_button_arrow_margin);
+
+ theme->set_stylebox("normal", "OptionButton", style_option_button_normal);
+ theme->set_stylebox("hover", "OptionButton", style_option_button_hover);
+ theme->set_stylebox("pressed", "OptionButton", style_option_button_pressed);
+ theme->set_stylebox("focus", "OptionButton", style_option_button_focus);
+ theme->set_stylebox("disabled", "OptionButton", style_option_button_disabled);
theme->set_color("font_color", "OptionButton", font_color);
theme->set_color("font_color_hover", "OptionButton", font_color_hl);
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index f47f9b8b92..318fee01f2 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -172,7 +172,7 @@ void ExportTemplateManager::_uninstall_template_confirm() {
ERR_FAIL_COND_MSG(err != OK, "Could not remove all templates in '" + templates_dir.plus_file(to_remove) + "'.");
da->change_dir("..");
- da->remove(to_remove);
+ err = da->remove(to_remove);
ERR_FAIL_COND_MSG(err != OK, "Could not remove templates directory at '" + templates_dir.plus_file(to_remove) + "'.");
_update_template_list();
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 752e49a932..01d645e231 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -889,7 +889,6 @@ String FindInFilesPanel::get_replace_text() {
void FindInFilesPanel::update_replace_buttons() {
- String text = get_replace_text();
bool disabled = _finder->is_searching();
_replace_all_button->set_disabled(disabled);
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index d604a95320..2eef0a07b5 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -1015,8 +1015,6 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres
Path *path = Object::cast_to<Path>(node);
- String curve = ng->source;
-
if (curve_cache.has(ng->source)) {
path->set_curve(curve_cache[ng->source]);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 80353bab01..1480cc6ac4 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -85,6 +85,9 @@ void AnimationPlayerEditor::_notification(int p_what) {
track_editor->set_anim_pos(player->get_current_animation_position());
EditorNode::get_singleton()->get_inspector()->refresh();
+ } else if (!player->is_valid()) {
+ // Reset timeline when the player has been stopped externally
+ frame->set_value(0);
} else if (last_active) {
// Need the last frame after it stopped.
frame->set_value(player->get_current_animation_position());
@@ -1089,8 +1092,6 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag)
if (!player->has_animation(player->get_assigned_animation()))
return;
- Ref<Animation> anim = player->get_animation(player->get_assigned_animation());
-
updating = true;
frame->set_value(Math::stepify(p_pos, _get_editor_step()));
updating = false;
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 9894c8c562..544e0b69f1 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -54,7 +54,7 @@
#define MIN_ZOOM 0.01
#define MAX_ZOOM 100
-#define RULER_WIDTH 15 * EDSCALE
+#define RULER_WIDTH (15 * EDSCALE)
#define SCALE_HANDLE_DISTANCE 25
class SnapDialog : public ConfirmationDialog {
@@ -1111,7 +1111,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
if (dragged_guide_index >= 0) {
vguides.remove(dragged_guide_index);
undo_redo->create_action(TTR("Remove Vertical Guide"));
- undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides);
+ if (vguides.empty()) {
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_vertical_guides_");
+ } else {
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides);
+ }
undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides);
undo_redo->add_undo_method(viewport, "update");
undo_redo->commit_action();
@@ -1140,7 +1144,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
if (dragged_guide_index >= 0) {
hguides.remove(dragged_guide_index);
undo_redo->create_action(TTR("Remove Horizontal Guide"));
- undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides);
+ if (hguides.empty()) {
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_horizontal_guides_");
+ } else {
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides);
+ }
undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides);
undo_redo->add_undo_method(viewport, "update");
undo_redo->commit_action();
@@ -3202,7 +3210,7 @@ void CanvasItemEditor::_draw_selection() {
int next = (i + 1) % 4;
Vector2 ofs = ((endpoints[i] - endpoints[prev]).normalized() + ((endpoints[i] - endpoints[next]).normalized())).normalized();
- ofs *= 1.4144 * (select_handle->get_size().width / 2);
+ ofs *= Math_SQRT2 * (select_handle->get_size().width / 2);
select_handle->draw(ci, (endpoints[i] + ofs - (select_handle->get_size() / 2)).floor());
@@ -4752,19 +4760,21 @@ void CanvasItemEditor::_popup_callback(int p_op) {
} break;
case CLEAR_GUIDES: {
- if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_horizontal_guides_") || EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_vertical_guides_")) {
+ Node *const root = EditorNode::get_singleton()->get_edited_scene();
+
+ if (root && (root->has_meta("_edit_horizontal_guides_") || root->has_meta("_edit_vertical_guides_"))) {
undo_redo->create_action(TTR("Clear Guides"));
- if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_horizontal_guides_")) {
- Array hguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_horizontal_guides_");
+ if (root->has_meta("_edit_horizontal_guides_")) {
+ Array hguides = root->get_meta("_edit_horizontal_guides_");
- undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", Array());
- undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides);
+ undo_redo->add_do_method(root, "remove_meta", "_edit_horizontal_guides_");
+ undo_redo->add_undo_method(root, "set_meta", "_edit_horizontal_guides_", hguides);
}
- if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_vertical_guides_")) {
- Array vguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_vertical_guides_");
+ if (root->has_meta("_edit_vertical_guides_")) {
+ Array vguides = root->get_meta("_edit_vertical_guides_");
- undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", Array());
- undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides);
+ undo_redo->add_do_method(root, "remove_meta", "_edit_vertical_guides_");
+ undo_redo->add_undo_method(root, "set_meta", "_edit_vertical_guides_", vguides);
}
undo_redo->add_undo_method(viewport, "update");
undo_redo->commit_action();
@@ -4928,8 +4938,8 @@ void CanvasItemEditor::_focus_selection(int p_op) {
center = rect.position + rect.size / 2;
Vector2 offset = viewport->get_size() / 2 - editor->get_scene_root()->get_global_canvas_transform().xform(center);
- view_offset.x -= offset.x / zoom;
- view_offset.y -= offset.y / zoom;
+ view_offset.x -= Math::round(offset.x / zoom);
+ view_offset.y -= Math::round(offset.y / zoom);
update_viewport();
} else { // VIEW_FRAME_TO_SELECTION
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index f63445dab8..2e41801637 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -707,6 +707,7 @@ void ScriptTextEditor::_bookmark_item_pressed(int p_idx) {
_edit_option(bookmarks_menu->get_item_id(p_idx));
} else {
code_editor->goto_line(bookmarks_menu->get_item_metadata(p_idx));
+ code_editor->get_text_edit()->call_deferred("center_viewport_to_cursor"); //Need to be deferred, because goto uses call_deferred().
}
}
@@ -856,6 +857,7 @@ void ScriptTextEditor::_breakpoint_item_pressed(int p_idx) {
_edit_option(breakpoints_menu->get_item_id(p_idx));
} else {
code_editor->goto_line(breakpoints_menu->get_item_metadata(p_idx));
+ code_editor->get_text_edit()->call_deferred("center_viewport_to_cursor"); //Need to be deferred, because goto uses call_deferred().
}
}
@@ -1307,6 +1309,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
if (bline > line) {
tx->unfold_line(bline);
tx->cursor_set_line(bline);
+ tx->center_viewport_to_cursor();
return;
}
}
@@ -1332,6 +1335,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
if (bline < line) {
tx->unfold_line(bline);
tx->cursor_set_line(bline);
+ tx->center_viewport_to_cursor();
return;
}
}
diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp
index cd360d4caf..1adf0be108 100644
--- a/editor/plugins/skeleton_editor_plugin.cpp
+++ b/editor/plugins/skeleton_editor_plugin.cpp
@@ -65,7 +65,6 @@ void SkeletonEditor::create_physical_skeleton() {
for (int bone_id = 0; bc > bone_id; ++bone_id) {
const int parent = skeleton->get_bone_parent(bone_id);
- const int parent_parent = skeleton->get_bone_parent(parent);
if (parent < 0) {
@@ -73,6 +72,8 @@ void SkeletonEditor::create_physical_skeleton() {
} else {
+ const int parent_parent = skeleton->get_bone_parent(parent);
+
bones_infos.write[bone_id].relative_rest = bones_infos[parent].relative_rest * skeleton->get_bone_rest(bone_id);
/// create physical bone on parent
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 34780af59e..a4c3ff5dcd 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -403,7 +403,6 @@ void SpriteFramesEditor::_up_pressed() {
sel = to_move;
sel -= 1;
- Ref<Texture> r = frames->get_frame(edited_anim, to_move);
undo_redo->create_action(TTR("Delete Resource"));
undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move, frames->get_frame(edited_anim, to_move - 1));
undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move - 1, frames->get_frame(edited_anim, to_move));
@@ -428,7 +427,6 @@ void SpriteFramesEditor::_down_pressed() {
sel = to_move;
sel += 1;
- Ref<Texture> r = frames->get_frame(edited_anim, to_move);
undo_redo->create_action(TTR("Delete Resource"));
undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move, frames->get_frame(edited_anim, to_move + 1));
undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move + 1, frames->get_frame(edited_anim, to_move));
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index a2f4040152..8e49bba7b2 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -150,7 +150,7 @@ void TextureRegionEditor::_region_draw() {
int next = (i + 1) % 4;
Vector2 ofs = ((endpoints[i] - endpoints[prev]).normalized() + ((endpoints[i] - endpoints[next]).normalized())).normalized();
- ofs *= 1.4144 * (select_handle->get_size().width / 2);
+ ofs *= Math_SQRT2 * (select_handle->get_size().width / 2);
edit_draw->draw_line(endpoints[i] - draw_ofs * draw_zoom, endpoints[next] - draw_ofs * draw_zoom, color, 2);
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 9eeb294fe1..66935d047b 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -2563,7 +2563,7 @@ void TileSetEditor::draw_grid_snap() {
if (i == 0 && snap_offset.y != 0) {
last_p = snap_offset.y;
}
- if (snap_separation.x != 0) {
+ if (snap_separation.y != 0) {
if (i != 0) {
workspace->draw_rect(Rect2(0, last_p, s.width, snap_separation.y), grid_color);
last_p += snap_separation.y;
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index ab62a59be1..8de4fda662 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -349,16 +349,15 @@ private:
void _path_selected(const String &p_path) {
- String p = p_path;
- String sp = p.simplify_path();
+ String sp = p_path.simplify_path();
project_path->set_text(sp);
_path_text_changed(sp);
get_ok()->call_deferred("grab_focus");
}
void _install_path_selected(const String &p_path) {
- String p = p_path;
- String sp = p.simplify_path();
+
+ String sp = p_path.simplify_path();
install_path->set_text(sp);
_path_text_changed(sp);
get_ok()->call_deferred("grab_focus");
@@ -2466,9 +2465,9 @@ ProjectManager::ProjectManager() {
sort_label->set_text(TTR("Sort:"));
sort_filters->add_child(sort_label);
Vector<String> sort_filter_titles;
- sort_filter_titles.push_back("Name");
- sort_filter_titles.push_back("Path");
- sort_filter_titles.push_back("Last Modified");
+ sort_filter_titles.push_back(TTR("Name"));
+ sort_filter_titles.push_back(TTR("Path"));
+ sort_filter_titles.push_back(TTR("Last Modified"));
project_order_filter = memnew(ProjectListFilter);
project_order_filter->add_filter_option();
project_order_filter->_setup_filters(sort_filter_titles);
@@ -2696,7 +2695,7 @@ void ProjectListFilter::_setup_filters(Vector<String> options) {
filter_option->clear();
for (int i = 0; i < options.size(); i++)
- filter_option->add_item(TTR(options[i]));
+ filter_option->add_item(options[i]);
}
void ProjectListFilter::_search_text_changed(const String &p_newtext) {
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 8e7aac896a..f854af0c8d 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -846,7 +846,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
time_vals.push_back(err[2]);
time_vals.push_back(err[3]);
bool e;
- String time = String("%d:%02d:%02d:%04d").sprintf(time_vals, &e);
+ String time = String("%d:%02d:%02d.%03d").sprintf(time_vals, &e);
// Rest of the error data.
String method = err[4];
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index a38c6b98cc..a780b117e1 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -233,14 +233,23 @@ void EditorSettingsDialog::_update_shortcuts() {
section->set_custom_bg_color(1, get_color("prop_subsection", "Editor"));
}
- if (shortcut_filter.is_subsequence_ofi(sc->get_name()) || shortcut_filter.is_subsequence_ofi(sc->get_as_text())) {
+ // Don't match unassigned shortcuts when searching for assigned keys in search results.
+ // This prevents all unassigned shortcuts from appearing when searching a string like "no".
+ if (shortcut_filter.is_subsequence_ofi(sc->get_name()) || (sc->get_as_text() != "None" && shortcut_filter.is_subsequence_ofi(sc->get_as_text()))) {
TreeItem *item = shortcuts->create_item(section);
item->set_text(0, sc->get_name());
item->set_text(1, sc->get_as_text());
+
if (!sc->is_shortcut(original) && !(sc->get_shortcut().is_null() && original.is_null())) {
item->add_button(1, get_icon("Reload", "EditorIcons"), 2);
}
+
+ if (sc->get_as_text() == "None") {
+ // Fade out unassigned shortcut labels for easier visual grepping.
+ item->set_custom_color(1, get_color("font_color", "Label") * Color(1, 1, 1, 0.5));
+ }
+
item->add_button(1, get_icon("Edit", "EditorIcons"), 0);
item->add_button(1, get_icon("Close", "EditorIcons"), 1);
item->set_tooltip(0, E->get());
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index cfd9ec19d2..fd9e44cd5f 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -202,6 +202,9 @@ void EditorSpatialGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard
}
void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard) {
+ if (p_lines.empty()) {
+ return;
+ }
ERR_FAIL_COND(!spatial_node);
Instance ins;
@@ -4190,8 +4193,19 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->clear();
- const Spatial *node_body_a = Object::cast_to<Spatial>(joint->get_node(joint->get_node_a()));
- const Spatial *node_body_b = Object::cast_to<Spatial>(joint->get_node(joint->get_node_b()));
+ Spatial *node_body_a = NULL;
+ if (!joint->get_node_a().is_empty()) {
+ node_body_a = Object::cast_to<Spatial>(joint->get_node(joint->get_node_a()));
+ }
+
+ Spatial *node_body_b = NULL;
+ if (!joint->get_node_b().is_empty()) {
+ node_body_b = Object::cast_to<Spatial>(joint->get_node(joint->get_node_b()));
+ }
+
+ if (!node_body_a && !node_body_b) {
+ return;
+ }
Ref<Material> common_material = get_material("joint_material", p_gizmo);
Ref<Material> body_a_material = get_material("joint_body_a_material", p_gizmo);
diff --git a/editor/translations/af.po b/editor/translations/af.po
index bbcaf092e7..329d165510 100644
--- a/editor/translations/af.po
+++ b/editor/translations/af.po
@@ -1009,7 +1009,7 @@ msgid "Resource"
msgstr "Hulpbron"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Pad"
@@ -1500,7 +1500,8 @@ msgid "Node Name:"
msgstr "Nodus Naam:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Naam"
@@ -9500,6 +9501,10 @@ msgid "Projects"
msgstr "Projek Stigters"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/ar.po b/editor/translations/ar.po
index 6be373b1f1..9ffb777a0f 100644
--- a/editor/translations/ar.po
+++ b/editor/translations/ar.po
@@ -1007,7 +1007,7 @@ msgid "Resource"
msgstr "مورد"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "المسار"
@@ -1488,7 +1488,8 @@ msgid "Node Name:"
msgstr "إسم العقدة:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "الأسم"
@@ -9721,6 +9722,10 @@ msgid "Projects"
msgstr "مشروع"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/bg.po b/editor/translations/bg.po
index 9f82d5e72d..da370687cb 100644
--- a/editor/translations/bg.po
+++ b/editor/translations/bg.po
@@ -990,7 +990,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1461,7 +1461,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9577,6 +9578,10 @@ msgid "Projects"
msgstr "Проект"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Сканиране"
diff --git a/editor/translations/bn.po b/editor/translations/bn.po
index da5e8b41ac..fda8528844 100644
--- a/editor/translations/bn.po
+++ b/editor/translations/bn.po
@@ -1035,7 +1035,7 @@ msgid "Resource"
msgstr "রিসোর্স"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "পথ"
@@ -1529,7 +1529,8 @@ msgid "Node Name:"
msgstr "নোডের নাম:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "নাম"
@@ -10083,6 +10084,10 @@ msgid "Projects"
msgstr "নতুন প্রকল্প"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "স্ক্যান"
diff --git a/editor/translations/ca.po b/editor/translations/ca.po
index 4740b9ac89..db3074ef51 100644
--- a/editor/translations/ca.po
+++ b/editor/translations/ca.po
@@ -978,7 +978,7 @@ msgid "Resource"
msgstr "Recurs"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Camí"
@@ -1461,7 +1461,8 @@ msgid "Node Name:"
msgstr "Nom del node:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nom"
@@ -9693,6 +9694,10 @@ msgid "Projects"
msgstr "Projecte"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Explora"
diff --git a/editor/translations/cs.po b/editor/translations/cs.po
index d359c22f28..dfe9b3b4e9 100644
--- a/editor/translations/cs.po
+++ b/editor/translations/cs.po
@@ -987,7 +987,7 @@ msgid "Resource"
msgstr "Zdroj"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Cesta"
@@ -1472,7 +1472,8 @@ msgid "Node Name:"
msgstr "Název uzlu:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Název"
@@ -9597,6 +9598,10 @@ msgid "Projects"
msgstr "Projekt"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Skenovat"
diff --git a/editor/translations/da.po b/editor/translations/da.po
index cd37bbc5f9..8c28f898aa 100644
--- a/editor/translations/da.po
+++ b/editor/translations/da.po
@@ -1014,7 +1014,7 @@ msgid "Resource"
msgstr "Ressource"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Sti"
@@ -1501,7 +1501,8 @@ msgid "Node Name:"
msgstr "Node Navn:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Navn"
@@ -9692,6 +9693,10 @@ msgid "Projects"
msgstr "Projekt"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/de.po b/editor/translations/de.po
index ab157ee779..76dc2130bc 100644
--- a/editor/translations/de.po
+++ b/editor/translations/de.po
@@ -1015,7 +1015,7 @@ msgid "Resource"
msgstr "Ressource"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Pfad"
@@ -1491,7 +1491,8 @@ msgid "Node Name:"
msgstr "Node-Name:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Name"
@@ -9562,6 +9563,11 @@ msgid "Projects"
msgstr "Projekte"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Bearbeitet"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Scannen"
diff --git a/editor/translations/de_CH.po b/editor/translations/de_CH.po
index 5b8d7da474..1ad8fb046f 100644
--- a/editor/translations/de_CH.po
+++ b/editor/translations/de_CH.po
@@ -984,7 +984,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1459,7 +1459,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9527,6 +9528,10 @@ msgid "Projects"
msgstr "Projektname:"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot
index d2a8b188f4..34ff822dc4 100644
--- a/editor/translations/editor.pot
+++ b/editor/translations/editor.pot
@@ -935,7 +935,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1400,7 +1400,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9092,6 +9093,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/el.po b/editor/translations/el.po
index 7aea9126c6..969f63fbd1 100644
--- a/editor/translations/el.po
+++ b/editor/translations/el.po
@@ -982,7 +982,7 @@ msgid "Resource"
msgstr "Πόρος"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Διαδρομή"
@@ -1457,7 +1457,8 @@ msgid "Node Name:"
msgstr "Όνομα κόμβου:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Όνομα"
@@ -9593,6 +9594,10 @@ msgid "Projects"
msgstr "Έργο"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Σάρωση"
diff --git a/editor/translations/eo.po b/editor/translations/eo.po
index 13b053c4f8..8ce8f7c298 100644
--- a/editor/translations/eo.po
+++ b/editor/translations/eo.po
@@ -971,7 +971,7 @@ msgid "Resource"
msgstr "Rimedo"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "dosierindiko"
@@ -1436,7 +1436,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nomo"
@@ -9217,6 +9218,11 @@ msgid "Projects"
msgstr "Projektoj"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Modifita"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Esplori"
diff --git a/editor/translations/es.po b/editor/translations/es.po
index a520f0c46e..0c04cb5fff 100644
--- a/editor/translations/es.po
+++ b/editor/translations/es.po
@@ -1013,7 +1013,7 @@ msgid "Resource"
msgstr "Recursos"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Ruta"
@@ -1486,7 +1486,8 @@ msgid "Node Name:"
msgstr "Nombre del Nodo:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nombre"
@@ -9549,6 +9550,11 @@ msgid "Projects"
msgstr "Proyectos"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Modificado/s"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Escanear"
diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po
index 0bf176e0af..eea6a6da6b 100644
--- a/editor/translations/es_AR.po
+++ b/editor/translations/es_AR.po
@@ -982,7 +982,7 @@ msgid "Resource"
msgstr "Recursos"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Ruta"
@@ -1455,7 +1455,8 @@ msgid "Node Name:"
msgstr "Nombre de Nodo:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nombre"
@@ -9514,6 +9515,11 @@ msgid "Projects"
msgstr "Proyectos"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Modificado/s"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Examinar"
diff --git a/editor/translations/et.po b/editor/translations/et.po
index 82bf543b18..05e6e4fb73 100644
--- a/editor/translations/et.po
+++ b/editor/translations/et.po
@@ -943,7 +943,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1408,7 +1408,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9114,6 +9115,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/eu.po b/editor/translations/eu.po
index a545199e07..af877a08a2 100644
--- a/editor/translations/eu.po
+++ b/editor/translations/eu.po
@@ -3,18 +3,19 @@
# Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
# Julen Irazoki <rktzbkr.julen@gmail.com>, 2019.
+# Osoitz <oelkoro@gmail.com>, 2019.
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2019-08-15 10:23+0000\n"
-"Last-Translator: Julen Irazoki <rktzbkr.julen@gmail.com>\n"
+"PO-Revision-Date: 2019-12-03 14:05+0000\n"
+"Last-Translator: Osoitz <oelkoro@gmail.com>\n"
"Language-Team: Basque <https://hosted.weblate.org/projects/godot-engine/"
"godot/eu/>\n"
"Language: eu\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 3.8\n"
+"X-Generator: Weblate 3.10-dev\n"
#: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -25,8 +26,7 @@ msgstr ""
#: modules/mono/glue/gd_glue.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
msgid "Not enough bytes for decoding bytes, or invalid format."
-msgstr ""
-"Ez daude byte nahikoa byte-ak dekodetzeko, edota formatua ez da zuzena."
+msgstr "Ez daude byte nahikoa byteak deskodetzeko, edo formatua ez da zuzena."
#: core/math/expression.cpp
msgid "Invalid input %i (not passed) in expression"
@@ -940,7 +940,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1405,7 +1405,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9097,6 +9098,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/fa.po b/editor/translations/fa.po
index 6ec85e861e..2376b0ac59 100644
--- a/editor/translations/fa.po
+++ b/editor/translations/fa.po
@@ -1009,7 +1009,7 @@ msgid "Resource"
msgstr "منبع"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "مسیر"
@@ -1490,7 +1490,8 @@ msgid "Node Name:"
msgstr "نام گره:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9644,6 +9645,10 @@ msgid "Projects"
msgstr "پروژه"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "پویش"
diff --git a/editor/translations/fi.po b/editor/translations/fi.po
index 517733d566..dd1d867ae2 100644
--- a/editor/translations/fi.po
+++ b/editor/translations/fi.po
@@ -967,7 +967,7 @@ msgid "Resource"
msgstr "Resurssi"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Polku"
@@ -1442,7 +1442,8 @@ msgid "Node Name:"
msgstr "Solmun nimi:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nimi"
@@ -9462,6 +9463,11 @@ msgid "Projects"
msgstr "Projektit"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Muutettu"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Tutki"
diff --git a/editor/translations/fil.po b/editor/translations/fil.po
index 6c9950261b..3568aed2ea 100644
--- a/editor/translations/fil.po
+++ b/editor/translations/fil.po
@@ -947,7 +947,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1412,7 +1412,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9113,6 +9114,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/fr.po b/editor/translations/fr.po
index 423452a065..23b73c25b0 100644
--- a/editor/translations/fr.po
+++ b/editor/translations/fr.po
@@ -68,12 +68,13 @@
# Xavier Sellier <contact@binogure-studio.com>, 2019.
# Sofiane <Sofiane-77@caramail.fr>, 2019.
# Camille Mohr-Daurat <pouleyketchoup@gmail.com>, 2019.
+# Pierre Stempin <pierre.stempin@gmail.com>, 2019.
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2019-11-29 14:49+0000\n"
-"Last-Translator: Camille Mohr-Daurat <pouleyketchoup@gmail.com>\n"
+"PO-Revision-Date: 2019-12-03 14:05+0000\n"
+"Last-Translator: Pierre Stempin <pierre.stempin@gmail.com>\n"
"Language-Team: French <https://hosted.weblate.org/projects/godot-engine/"
"godot/fr/>\n"
"Language: fr\n"
@@ -1040,7 +1041,7 @@ msgid "Resource"
msgstr "Ressource"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Chemin"
@@ -1515,7 +1516,8 @@ msgid "Node Name:"
msgstr "Nom de nœud :"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nom"
@@ -6298,7 +6300,7 @@ msgstr "Déplacer de points"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Ctrl: Rotate"
-msgstr "Contrôle : Tourner"
+msgstr "Ctrl : Tourner"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Shift: Move All"
@@ -9051,7 +9053,6 @@ msgstr ""
"et de la direction de la caméra (transmettez-lui les entrées associées)."
#: editor/plugins/visual_shader_editor_plugin.cpp
-#, fuzzy
msgid ""
"Custom Godot Shader Language expression, which is placed on top of the "
"resulted shader. You can place various function definitions inside and call "
@@ -9608,6 +9609,11 @@ msgid "Projects"
msgstr "Projets"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Modifié"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Scanner"
@@ -11436,7 +11442,6 @@ msgstr ""
"fonctions."
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Select at least one node with sequence port."
msgstr "Sélectionnez au moins un nœud avec un port de séquence."
diff --git a/editor/translations/ga.po b/editor/translations/ga.po
index 0994c769e1..8b96d258ad 100644
--- a/editor/translations/ga.po
+++ b/editor/translations/ga.po
@@ -941,7 +941,7 @@ msgid "Resource"
msgstr "Acmhainn"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Cosán"
@@ -1406,7 +1406,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9107,6 +9108,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/he.po b/editor/translations/he.po
index b438d8656d..db308bff70 100644
--- a/editor/translations/he.po
+++ b/editor/translations/he.po
@@ -1006,7 +1006,7 @@ msgid "Resource"
msgstr "משאב"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "נתיב"
@@ -1483,7 +1483,8 @@ msgid "Node Name:"
msgstr "שם המפרק:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "שם"
@@ -9610,6 +9611,10 @@ msgid "Projects"
msgstr "מיזם"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/hi.po b/editor/translations/hi.po
index 5ea73e6e98..267e705a88 100644
--- a/editor/translations/hi.po
+++ b/editor/translations/hi.po
@@ -1000,7 +1000,7 @@ msgid "Resource"
msgstr "संसाधन"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "पथ"
@@ -1489,7 +1489,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9357,6 +9358,10 @@ msgid "Projects"
msgstr "परियोजना के संस्थापक"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/hr.po b/editor/translations/hr.po
index 5467aa1523..33566267a1 100644
--- a/editor/translations/hr.po
+++ b/editor/translations/hr.po
@@ -952,7 +952,7 @@ msgid "Resource"
msgstr "Resurs"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1420,7 +1420,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9138,6 +9139,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/hu.po b/editor/translations/hu.po
index 0f20323033..244d3c903e 100644
--- a/editor/translations/hu.po
+++ b/editor/translations/hu.po
@@ -1019,7 +1019,7 @@ msgid "Resource"
msgstr "Forrás"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Útvonal"
@@ -1504,7 +1504,8 @@ msgid "Node Name:"
msgstr "Node neve:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Név"
@@ -9802,6 +9803,10 @@ msgid "Projects"
msgstr "Projekt"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/id.po b/editor/translations/id.po
index cf2c3bb271..68edb05284 100644
--- a/editor/translations/id.po
+++ b/editor/translations/id.po
@@ -987,7 +987,7 @@ msgid "Resource"
msgstr "Resource"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Path"
@@ -1459,7 +1459,8 @@ msgid "Node Name:"
msgstr "Nama Node:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nama"
@@ -9500,6 +9501,10 @@ msgid "Projects"
msgstr "Proyek"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Pindai"
diff --git a/editor/translations/is.po b/editor/translations/is.po
index 6f06c5a142..50e5bfac37 100644
--- a/editor/translations/is.po
+++ b/editor/translations/is.po
@@ -974,7 +974,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1440,7 +1440,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9211,6 +9212,10 @@ msgid "Projects"
msgstr "Verkefna Stjóri"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/it.po b/editor/translations/it.po
index 642723f8bb..77b9437753 100644
--- a/editor/translations/it.po
+++ b/editor/translations/it.po
@@ -1005,7 +1005,7 @@ msgid "Resource"
msgstr "Risorsa"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Percorso"
@@ -1479,7 +1479,8 @@ msgid "Node Name:"
msgstr "Nome nodo:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nome"
@@ -9560,6 +9561,11 @@ msgid "Projects"
msgstr "Progetti"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Modificato"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Esamina"
diff --git a/editor/translations/ja.po b/editor/translations/ja.po
index de6d6822ca..a5697f71d9 100644
--- a/editor/translations/ja.po
+++ b/editor/translations/ja.po
@@ -993,7 +993,7 @@ msgid "Resource"
msgstr "リソース"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "パス"
@@ -1465,7 +1465,8 @@ msgid "Node Name:"
msgstr "ノード名:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "名前"
@@ -9517,6 +9518,11 @@ msgid "Projects"
msgstr "プロジェクト"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "変更された箇所"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "スキャン"
diff --git a/editor/translations/ka.po b/editor/translations/ka.po
index 839ad533f5..d4710402f2 100644
--- a/editor/translations/ka.po
+++ b/editor/translations/ka.po
@@ -1012,7 +1012,7 @@ msgid "Resource"
msgstr "რესურსი"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "გზა"
@@ -1492,7 +1492,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9389,6 +9390,10 @@ msgid "Projects"
msgstr "პროექტის დამფუძნებლები"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/ko.po b/editor/translations/ko.po
index 63fd0fe16c..3aac1a2e39 100644
--- a/editor/translations/ko.po
+++ b/editor/translations/ko.po
@@ -974,7 +974,7 @@ msgid "Resource"
msgstr "리소스"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "경로"
@@ -1444,7 +1444,8 @@ msgid "Node Name:"
msgstr "노드 이름:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "이름"
@@ -9389,6 +9390,11 @@ msgid "Projects"
msgstr "프로젝트"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "수정됨"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "스캔"
diff --git a/editor/translations/lt.po b/editor/translations/lt.po
index 681bae9d5a..5971331785 100644
--- a/editor/translations/lt.po
+++ b/editor/translations/lt.po
@@ -989,7 +989,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1455,7 +1455,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9380,6 +9381,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/lv.po b/editor/translations/lv.po
index a0b68a3a64..97c80f9a22 100644
--- a/editor/translations/lv.po
+++ b/editor/translations/lv.po
@@ -976,7 +976,7 @@ msgid "Resource"
msgstr "Resurs"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1464,7 +1464,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nosaukums"
@@ -9346,6 +9347,10 @@ msgid "Projects"
msgstr "Projekta Dibinātāji"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/mi.po b/editor/translations/mi.po
index dbd85cdd3a..693a0f1535 100644
--- a/editor/translations/mi.po
+++ b/editor/translations/mi.po
@@ -933,7 +933,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1398,7 +1398,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9090,6 +9091,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/ml.po b/editor/translations/ml.po
index 255a961ea7..0ea1566617 100644
--- a/editor/translations/ml.po
+++ b/editor/translations/ml.po
@@ -943,7 +943,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1408,7 +1408,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9103,6 +9104,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/ms.po b/editor/translations/ms.po
index 7ff31a456c..cef1d6dcc0 100644
--- a/editor/translations/ms.po
+++ b/editor/translations/ms.po
@@ -961,7 +961,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1426,7 +1426,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9159,6 +9160,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/nb.po b/editor/translations/nb.po
index b7422a2f92..59a2d5553d 100644
--- a/editor/translations/nb.po
+++ b/editor/translations/nb.po
@@ -1027,7 +1027,7 @@ msgid "Resource"
msgstr "Ressurs"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Bane"
@@ -1518,7 +1518,8 @@ msgid "Node Name:"
msgstr "Nodenavn:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Navn"
@@ -9891,6 +9892,10 @@ msgid "Projects"
msgstr "Prosjekt"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Skann"
diff --git a/editor/translations/nl.po b/editor/translations/nl.po
index 10d32da522..3f5fb5908a 100644
--- a/editor/translations/nl.po
+++ b/editor/translations/nl.po
@@ -1007,7 +1007,7 @@ msgid "Resource"
msgstr "Bron"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Pad"
@@ -1481,7 +1481,8 @@ msgid "Node Name:"
msgstr "Node Naam:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Naam"
@@ -9777,6 +9778,10 @@ msgid "Projects"
msgstr "Project"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Scannen"
diff --git a/editor/translations/or.po b/editor/translations/or.po
index 6b52bb709a..9585062994 100644
--- a/editor/translations/or.po
+++ b/editor/translations/or.po
@@ -939,7 +939,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1404,7 +1404,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9096,6 +9097,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/pl.po b/editor/translations/pl.po
index fc8ae9f5dc..43b4580dd8 100644
--- a/editor/translations/pl.po
+++ b/editor/translations/pl.po
@@ -1002,7 +1002,7 @@ msgid "Resource"
msgstr "Zasoby"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Ścieżka"
@@ -1473,7 +1473,8 @@ msgid "Node Name:"
msgstr "Nazwa węzła:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nazwa"
@@ -9498,6 +9499,11 @@ msgid "Projects"
msgstr "Projekty"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Zmodyfikowany"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Skanuj"
diff --git a/editor/translations/pr.po b/editor/translations/pr.po
index f20178f8bb..fc619b3da7 100644
--- a/editor/translations/pr.po
+++ b/editor/translations/pr.po
@@ -981,7 +981,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1451,7 +1451,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9400,6 +9401,10 @@ msgid "Projects"
msgstr "Rename Function"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po
index 88953ef6e5..8ec43fd0e0 100644
--- a/editor/translations/pt_BR.po
+++ b/editor/translations/pt_BR.po
@@ -76,7 +76,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: 2016-05-30\n"
-"PO-Revision-Date: 2019-11-20 14:07+0000\n"
+"PO-Revision-Date: 2019-12-03 14:05+0000\n"
"Last-Translator: Joaquim Ferreira <joaquimferreira1996@bol.com.br>\n"
"Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
"godot-engine/godot/pt_BR/>\n"
@@ -1037,7 +1037,7 @@ msgid "Resource"
msgstr "Recurso"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Caminho"
@@ -1509,7 +1509,8 @@ msgid "Node Name:"
msgstr "Nome do nó:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nome"
@@ -2130,7 +2131,7 @@ msgstr "Nó"
#: editor/editor_network_profiler.cpp
msgid "Incoming RPC"
-msgstr "Incoming RPC"
+msgstr "RPC recebido"
#: editor/editor_network_profiler.cpp
msgid "Incoming RSET"
@@ -2952,7 +2953,7 @@ msgstr "Tocar"
#: editor/editor_node.cpp
msgid "Pause the scene execution for debugging."
-msgstr ""
+msgstr "Pausar a execução da cena para depuração."
#: editor/editor_node.cpp
msgid "Pause Scene"
@@ -3043,6 +3044,14 @@ msgid ""
"the \"Use Custom Build\" option should be enabled in the Android export "
"preset."
msgstr ""
+"Isso irá configurar seu projeto para compilações customizadas do Android "
+"instalando o modelo de origem para \"res://android/build\".\n"
+"Em seguida, você pode aplicar modificações e compilar seu próprio APK "
+"customizado na exportação (Adicionando módulos, alterando o AndroidManifest."
+"xml, etc.).\n"
+"Note que para fazer uma compilação customizada, em vez de usar APKs pre-"
+"compilados, a opção \"Usar compilação customizada\" deve estar ativa nas "
+"predefinições de exportação do Android."
#: editor/editor_node.cpp
#, fuzzy
@@ -4390,9 +4399,8 @@ msgid "Audio Clips"
msgstr "Clipes de Áudio:"
#: editor/plugins/animation_blend_tree_editor_plugin.cpp
-#, fuzzy
msgid "Functions"
-msgstr "Funções:"
+msgstr "Funções"
#: editor/plugins/animation_blend_tree_editor_plugin.cpp
#: editor/plugins/animation_state_machine_editor.cpp
@@ -5077,7 +5085,7 @@ msgstr "Passo de grade:"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Primary Line Every:"
-msgstr ""
+msgstr "Linha Primária a Cada:"
#: editor/plugins/canvas_item_editor_plugin.cpp
#, fuzzy
@@ -5188,6 +5196,8 @@ msgid ""
"Game Camera Override\n"
"Overrides game camera with editor viewport camera."
msgstr ""
+"Substituir Câmera do Jogo\n"
+"Substitui a câmera do jogo com a câmera de visualização do editor."
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
@@ -5195,6 +5205,8 @@ msgid ""
"Game Camera Override\n"
"No game instance running."
msgstr ""
+"Substituir Câmera do Jogo\n"
+"Nenhuma instância de jogo em execução."
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
@@ -7810,7 +7822,7 @@ msgstr "Filtrar Arquivos..."
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Give a TileSet resource to this TileMap to use its tiles."
-msgstr ""
+msgstr "Atribua um recurso TileSet a este TileMap para usar seus tiles."
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Paint Tile"
@@ -7948,6 +7960,8 @@ msgstr "Exibir nomes de mosaico (segure a tecla Alt)"
msgid ""
"Add or select a texture on the left panel to edit the tiles bound to it."
msgstr ""
+"Adicione ou selecione uma textura no painel esquerdo para editar os tiles "
+"vinculados."
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Remove selected texture? This will remove all tiles which use it."
@@ -8135,7 +8149,7 @@ msgstr "Nenhum nome fornecido"
#: editor/plugins/version_control_editor_plugin.cpp
msgid "No files added to stage"
-msgstr ""
+msgstr "Nenhum arquivo adicionado ao palco"
#: editor/plugins/version_control_editor_plugin.cpp
#, fuzzy
@@ -8144,11 +8158,11 @@ msgstr "Comunidade"
#: editor/plugins/version_control_editor_plugin.cpp
msgid "VCS Addon is not initialized"
-msgstr ""
+msgstr "Extensão VCS não inicializado"
#: editor/plugins/version_control_editor_plugin.cpp
msgid "Version Control System"
-msgstr ""
+msgstr "Sistema de Controle de Versionamento"
#: editor/plugins/version_control_editor_plugin.cpp
#, fuzzy
@@ -8157,7 +8171,7 @@ msgstr "Capitalizar"
#: editor/plugins/version_control_editor_plugin.cpp
msgid "Staging area"
-msgstr ""
+msgstr "Área Temporária"
#: editor/plugins/version_control_editor_plugin.cpp
#, fuzzy
@@ -8200,7 +8214,7 @@ msgstr "Salvar Tudo"
#: editor/plugins/version_control_editor_plugin.cpp
msgid "Add a commit message"
-msgstr ""
+msgstr "Adicione uma mensagem de confirmação"
#: editor/plugins/version_control_editor_plugin.cpp
#, fuzzy
@@ -8214,7 +8228,7 @@ msgstr "Estado"
#: editor/plugins/version_control_editor_plugin.cpp
msgid "View file diffs before committing them to the latest version"
-msgstr ""
+msgstr "Ver aquivos diff antes do commit para a última versão"
#: editor/plugins/version_control_editor_plugin.cpp
#, fuzzy
@@ -8223,7 +8237,7 @@ msgstr "Nenhum arquivo selecionado!"
#: editor/plugins/version_control_editor_plugin.cpp
msgid "Detect changes in file diff"
-msgstr ""
+msgstr "Detectar mudanças no arquivo diff"
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid "(GLES3 only)"
@@ -8761,14 +8775,12 @@ msgid "Multiplies scalar by scalar."
msgstr "Multiplica escalar por escalar."
#: editor/plugins/visual_shader_editor_plugin.cpp
-#, fuzzy
msgid "Returns the remainder of the two scalars."
-msgstr "Retorna o resto de dois escalares."
+msgstr "Retorna o resto dos dois escalares."
#: editor/plugins/visual_shader_editor_plugin.cpp
-#, fuzzy
msgid "Subtracts scalar from scalar."
-msgstr "Subtrai escalar de escalar."
+msgstr "Subtrai o escalar do escalar."
#: editor/plugins/visual_shader_editor_plugin.cpp
#, fuzzy
@@ -8781,9 +8793,8 @@ msgid "Scalar uniform."
msgstr "Alterar Uniforme Escalar"
#: editor/plugins/visual_shader_editor_plugin.cpp
-#, fuzzy
msgid "Perform the cubic texture lookup."
-msgstr "Faça a pesquisa da textura cúbica."
+msgstr "Execute a pesquisa de textura cúbica."
#: editor/plugins/visual_shader_editor_plugin.cpp
#, fuzzy
@@ -8852,14 +8863,12 @@ msgid "Calculates the transpose of a transform."
msgstr "(Somente em GLES3) Calcula a transposta da transform."
#: editor/plugins/visual_shader_editor_plugin.cpp
-#, fuzzy
msgid "Multiplies transform by transform."
-msgstr "Multiplica transform por transform."
+msgstr "Multiplica a transformação por transformação."
#: editor/plugins/visual_shader_editor_plugin.cpp
-#, fuzzy
msgid "Multiplies vector by transform."
-msgstr "Multiplica vetor por transform."
+msgstr "Multiplica vetor por transformação."
#: editor/plugins/visual_shader_editor_plugin.cpp
#, fuzzy
@@ -9062,50 +9071,64 @@ msgid ""
"it later in the Expressions. You can also declare varyings, uniforms and "
"constants."
msgstr ""
+"Expressão customizada da Godot Shader Language, que é colocada em cima do "
+"shader resultante. Você pode colocar várias definições de funções dentro e "
+"chamá-lo posteriormente nas Expressões. Você também pode declarar variações, "
+"uniformes e constantes."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid "(Fragment/Light mode only) Scalar derivative function."
-msgstr ""
+msgstr "(Apenas modo Fragmento/Luz) Função derivada escalar."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid "(Fragment/Light mode only) Vector derivative function."
-msgstr ""
+msgstr "(Apenas modo Fragmento/Luz) Função derivada de vetor."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid ""
"(Fragment/Light mode only) (Vector) Derivative in 'x' using local "
"differencing."
msgstr ""
+"(Apenas modo Fragmento/Luz) (Vetor) Derivada em 'x' usando diferenciação "
+"local."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid ""
"(Fragment/Light mode only) (Scalar) Derivative in 'x' using local "
"differencing."
msgstr ""
+"(Apenas modo Fragmento/Luz) (Escalar) Derivada em 'x' usando diferenciação "
+"local."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid ""
"(Fragment/Light mode only) (Vector) Derivative in 'y' using local "
"differencing."
msgstr ""
+"(Apenas modo Fragmento/Luz) (Vetor) Derivada em 'y' usando diferenciação "
+"local."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid ""
"(Fragment/Light mode only) (Scalar) Derivative in 'y' using local "
"differencing."
msgstr ""
+"(Apenas modo Fragmento/Luz) (Escalar) Derivada em 'y' usando diferenciação "
+"local."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid ""
"(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and "
"'y'."
msgstr ""
+"(Apenas modo Fragmento/Luz) (Vetor) Soma da derivada absoluta em 'x' e 'y'."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid ""
"(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and "
"'y'."
msgstr ""
+"(Apenas modo Fragmento/Luz) (Escalar) Soma da derivada absoluta em 'x' e 'y'."
#: editor/plugins/visual_shader_editor_plugin.cpp
msgid "VisualShader"
@@ -9180,6 +9203,9 @@ msgid ""
"If checked, the preset will be available for use in one-click deploy.\n"
"Only one preset per platform may be marked as runnable."
msgstr ""
+"Se marcada, a predefinição estará disponível para uso na implantação em um "
+"clique.\n"
+"Somente uma predefinição por plataforma pode ser marcada como executável."
#: editor/project_export.cpp
msgid "Export Path"
@@ -9461,7 +9487,7 @@ msgstr "Importar Projeto Existente"
#: editor/project_manager.cpp
msgid "Error: Project is missing on the filesystem."
-msgstr ""
+msgstr "Erro: O Projeto está ausente no sistema de arquivos."
#: editor/project_manager.cpp
msgid "Can't open project at '%s'."
@@ -9595,6 +9621,11 @@ msgid "Projects"
msgstr "Projeto"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Modificado"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Escanear"
@@ -9950,7 +9981,7 @@ msgstr "Idiomas:"
#: editor/project_settings_editor.cpp
msgid "AutoLoad"
-msgstr "AutoLoad"
+msgstr "Carregamento Automático"
#: editor/project_settings_editor.cpp
msgid "Plugins"
@@ -10244,7 +10275,7 @@ msgstr "Deletar Nó(s) de Shader Graph(s)"
#: editor/scene_tree_dock.cpp
msgid "Delete node \"%s\" and its children?"
-msgstr ""
+msgstr "Deletar nó \"%s\" e seus filhos?"
#: editor/scene_tree_dock.cpp
#, fuzzy
@@ -10746,9 +10777,8 @@ msgid "Profiler"
msgstr "Profilador"
#: editor/script_editor_debugger.cpp
-#, fuzzy
msgid "Network Profiler"
-msgstr "Exportar Perfil"
+msgstr "Perfis de rede"
#: editor/script_editor_debugger.cpp
msgid "Monitor"
@@ -10951,9 +10981,8 @@ msgid "GDNativeLibrary"
msgstr "GDNativeLibrary"
#: modules/gdnative/gdnative_library_singleton_editor.cpp
-#, fuzzy
msgid "Enabled GDNative Singleton"
-msgstr "Singleton GDBNative ativado"
+msgstr "Singleton GDNative ativado"
#: modules/gdnative/gdnative_library_singleton_editor.cpp
#, fuzzy
@@ -10974,7 +11003,7 @@ msgstr "GDNative"
#: modules/gdscript/gdscript_functions.cpp
msgid "Expected a string of length 1 (a character)."
-msgstr ""
+msgstr "Esperado string de comprimento 1 (a caractere)."
#: modules/gdscript/gdscript_functions.cpp
msgid "Step argument is zero!"
@@ -11138,7 +11167,7 @@ msgstr "Métodos de filtragem"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Give a MeshLibrary resource to this GridMap to use its meshes."
-msgstr ""
+msgstr "Atribua um recurso MeshLibrary a este GridMap para usar seus meshes."
#: modules/mono/csharp_script.cpp
msgid "Class name can't be a reserved keyword"
@@ -11396,6 +11425,7 @@ msgstr "Adicionar Nó de Pré-carregamento"
#: modules/visual_script/visual_script_editor.cpp
msgid "Can't drop nodes because script '%s' is not used in this scene."
msgstr ""
+"Não é possível descartar nós porque o script '% s' não é usado nesta cena."
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Node(s) From Tree"
@@ -11406,6 +11436,9 @@ msgid ""
"Can't drop properties because script '%s' is not used in this scene.\n"
"Drop holding 'Shift' to just copy the signature."
msgstr ""
+"Não é possível descartar as propriedades porque o script '% s' não é usado "
+"nesta cena.\n"
+"Solte segurando 'Shift' para copiar apenas a assinatura."
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Getter Property"
@@ -11476,14 +11509,15 @@ msgstr "Não é possível copiar o nó de função."
#: modules/visual_script/visual_script_editor.cpp
msgid "Can't create function of nodes from nodes of multiple functions."
msgstr ""
+"Não é possível criar uma função de nós a partir de nós de múltiplas funções."
#: modules/visual_script/visual_script_editor.cpp
msgid "Select at least one node with sequence port."
-msgstr ""
+msgstr "Selecione pelo menos um nó com porta de sequência."
#: modules/visual_script/visual_script_editor.cpp
msgid "Try to only have one sequence input in selection."
-msgstr ""
+msgstr "Tente ter apenas uma entrada de sequência na seleção."
#: modules/visual_script/visual_script_editor.cpp
#, fuzzy
@@ -11677,10 +11711,14 @@ msgstr ""
#: platform/android/export/export.cpp
msgid "Custom build requires a valid Android SDK path in Editor Settings."
msgstr ""
+"Compilação personalizada requer um caminho do Android SDK válido para as "
+"Configurações do Editor."
#: platform/android/export/export.cpp
msgid "Invalid Android SDK path for custom build in Editor Settings."
msgstr ""
+"Caminho SDK do Android inválido para a compilação personalizada nas "
+"Configurações do Editor."
#: platform/android/export/export.cpp
#, fuzzy
@@ -11704,6 +11742,9 @@ msgid ""
"Trying to build from a custom built template, but no version info for it "
"exists. Please reinstall from the 'Project' menu."
msgstr ""
+"Tentando compilar a partir de um modelo compilado personalizado, mas nenhuma "
+"informação de versão para ele existe. Por favor, reinstale pelo menu "
+"'Projeto'."
#: platform/android/export/export.cpp
msgid ""
@@ -11712,6 +11753,10 @@ msgid ""
" Godot Version: %s\n"
"Please reinstall Android build template from 'Project' menu."
msgstr ""
+"Diferença de versão da compilação do Android:\n"
+" Modelo instalado: %s\n"
+" Versão do Godot: %s\n"
+"Por favor reinstale o modelo de compilação do Android pelo menu 'Projeto'."
#: platform/android/export/export.cpp
msgid "Building Android Project (gradle)"
@@ -12406,6 +12451,9 @@ msgid ""
"The Hint Tooltip won't be displayed as the control's Mouse Filter is set to "
"\"Ignore\". To solve this, set the Mouse Filter to \"Stop\" or \"Pass\"."
msgstr ""
+"A Dica não será exibida quando o controle de Filtro do Mouse estiver "
+"definido como \"Ignorar\". Para resolver, defina o Filtro do Mouse como "
+"\"Parar\" ou \"Continuar\"."
#: scene/gui/dialogs.cpp
msgid "Alert!"
diff --git a/editor/translations/pt_PT.po b/editor/translations/pt_PT.po
index 03976ebf0c..f739893486 100644
--- a/editor/translations/pt_PT.po
+++ b/editor/translations/pt_PT.po
@@ -979,7 +979,7 @@ msgid "Resource"
msgstr "Recurso"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Caminho"
@@ -1452,7 +1452,8 @@ msgid "Node Name:"
msgstr "Nome do Nó:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nome"
@@ -9467,6 +9468,11 @@ msgid "Projects"
msgstr "Projetos"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Modificado"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Analisar"
diff --git a/editor/translations/ro.po b/editor/translations/ro.po
index 266f95691e..f16520008f 100644
--- a/editor/translations/ro.po
+++ b/editor/translations/ro.po
@@ -1012,7 +1012,7 @@ msgid "Resource"
msgstr "Resursă"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Cale"
@@ -1502,7 +1502,8 @@ msgid "Node Name:"
msgstr "Nume Nod:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Nume"
@@ -9773,6 +9774,10 @@ msgid "Projects"
msgstr "Proiect"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/ru.po b/editor/translations/ru.po
index 0f8b7da452..3cfe0f6353 100644
--- a/editor/translations/ru.po
+++ b/editor/translations/ru.po
@@ -1028,7 +1028,7 @@ msgid "Resource"
msgstr "Ресурс"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Путь"
@@ -1499,7 +1499,8 @@ msgid "Node Name:"
msgstr "Имя Узла:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Название"
@@ -9544,6 +9545,11 @@ msgid "Projects"
msgstr "Проекты"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Изменён"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Сканировать"
diff --git a/editor/translations/si.po b/editor/translations/si.po
index 85973b455c..357ae506ad 100644
--- a/editor/translations/si.po
+++ b/editor/translations/si.po
@@ -962,7 +962,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1427,7 +1427,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9162,6 +9163,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/sk.po b/editor/translations/sk.po
index 62811488f9..ec290311e0 100644
--- a/editor/translations/sk.po
+++ b/editor/translations/sk.po
@@ -985,7 +985,7 @@ msgid "Resource"
msgstr "Prostriedok"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Cesta"
@@ -1461,7 +1461,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9430,6 +9431,10 @@ msgid "Projects"
msgstr "Zakladatelia Projektu"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/sl.po b/editor/translations/sl.po
index 238d4da365..ad23f0c63b 100644
--- a/editor/translations/sl.po
+++ b/editor/translations/sl.po
@@ -1023,7 +1023,7 @@ msgid "Resource"
msgstr "Viri"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Pot"
@@ -1509,7 +1509,8 @@ msgid "Node Name:"
msgstr "Ime Gradnika:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Ime"
@@ -9747,6 +9748,10 @@ msgid "Projects"
msgstr "Projekt"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Preglej"
diff --git a/editor/translations/sq.po b/editor/translations/sq.po
index 49b45241ed..1c78705413 100644
--- a/editor/translations/sq.po
+++ b/editor/translations/sq.po
@@ -962,7 +962,7 @@ msgid "Resource"
msgstr "Resursi"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Rrugë"
@@ -1446,7 +1446,8 @@ msgid "Node Name:"
msgstr "Emri i Nyjes:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Emri"
@@ -9411,6 +9412,10 @@ msgid "Projects"
msgstr "Projekti"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po
index e868067d39..24eb88b805 100644
--- a/editor/translations/sr_Cyrl.po
+++ b/editor/translations/sr_Cyrl.po
@@ -1023,7 +1023,7 @@ msgid "Resource"
msgstr "Ресурс"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Пут"
@@ -1510,7 +1510,8 @@ msgid "Node Name:"
msgstr "Име чвора:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Име"
@@ -9866,6 +9867,10 @@ msgid "Projects"
msgstr "Пројекат"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po
index e4298b2aa5..22b3059a68 100644
--- a/editor/translations/sr_Latn.po
+++ b/editor/translations/sr_Latn.po
@@ -971,7 +971,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1436,7 +1436,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9234,6 +9235,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/sv.po b/editor/translations/sv.po
index c1cc6a8a62..02197303ce 100644
--- a/editor/translations/sv.po
+++ b/editor/translations/sv.po
@@ -1010,7 +1010,7 @@ msgid "Resource"
msgstr "Resurs"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Sökväg"
@@ -1501,7 +1501,8 @@ msgid "Node Name:"
msgstr "Node Namn:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Namn"
@@ -9690,6 +9691,10 @@ msgid "Projects"
msgstr "Projekt"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Skanna"
diff --git a/editor/translations/ta.po b/editor/translations/ta.po
index 5035e886c5..7015199f0c 100644
--- a/editor/translations/ta.po
+++ b/editor/translations/ta.po
@@ -963,7 +963,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1428,7 +1428,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9166,6 +9167,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/te.po b/editor/translations/te.po
index 4ad5ae8777..d9136f04b0 100644
--- a/editor/translations/te.po
+++ b/editor/translations/te.po
@@ -941,7 +941,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1406,7 +1406,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9099,6 +9100,10 @@ msgid "Projects"
msgstr ""
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/th.po b/editor/translations/th.po
index af1bb53b9e..db9cd3f577 100644
--- a/editor/translations/th.po
+++ b/editor/translations/th.po
@@ -1025,7 +1025,7 @@ msgid "Resource"
msgstr "รีซอร์ส"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "ตำแหน่ง"
@@ -1508,7 +1508,8 @@ msgid "Node Name:"
msgstr "ชื่อโหนด:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "ชื่อ"
@@ -9820,6 +9821,10 @@ msgid "Projects"
msgstr "โปรเจกต์"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "สแกน"
diff --git a/editor/translations/tr.po b/editor/translations/tr.po
index 6ef831b3be..1cbce49f6d 100644
--- a/editor/translations/tr.po
+++ b/editor/translations/tr.po
@@ -1005,7 +1005,7 @@ msgid "Resource"
msgstr "Kaynak"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Yol"
@@ -1477,7 +1477,8 @@ msgid "Node Name:"
msgstr "Düğüm adı:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "İsim"
@@ -9460,6 +9461,11 @@ msgid "Projects"
msgstr "Proje"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Değişti"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Tara"
diff --git a/editor/translations/uk.po b/editor/translations/uk.po
index 881e8f1911..1b8d883ca1 100644
--- a/editor/translations/uk.po
+++ b/editor/translations/uk.po
@@ -981,7 +981,7 @@ msgid "Resource"
msgstr "Ресурс"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Шлях"
@@ -1454,7 +1454,8 @@ msgid "Node Name:"
msgstr "Ім'я Вузла:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Назва"
@@ -9497,6 +9498,11 @@ msgid "Projects"
msgstr "Проєкти"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "Змінено"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Сканувати"
diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po
index 74a0013d39..e0c20b597a 100644
--- a/editor/translations/ur_PK.po
+++ b/editor/translations/ur_PK.po
@@ -959,7 +959,7 @@ msgid "Resource"
msgstr ""
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr ""
@@ -1429,7 +1429,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr ""
@@ -9317,6 +9318,10 @@ msgid "Projects"
msgstr ".تمام کا انتخاب"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/vi.po b/editor/translations/vi.po
index d92251b862..c20e09409b 100644
--- a/editor/translations/vi.po
+++ b/editor/translations/vi.po
@@ -978,7 +978,7 @@ msgid "Resource"
msgstr "Tài nguyên"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "Đường dẫn"
@@ -1452,7 +1452,8 @@ msgid "Node Name:"
msgstr "Tên Node:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "Tên"
@@ -9419,6 +9420,10 @@ msgid "Projects"
msgstr "Dự án"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "Quét"
diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po
index 0436963e5a..397f17a1cd 100644
--- a/editor/translations/zh_CN.po
+++ b/editor/translations/zh_CN.po
@@ -1008,7 +1008,7 @@ msgid "Resource"
msgstr "资源"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "路径"
@@ -1475,7 +1475,8 @@ msgid "Node Name:"
msgstr "节点名称:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "名称"
@@ -9327,6 +9328,11 @@ msgid "Projects"
msgstr "工程"
#: editor/project_manager.cpp
+#, fuzzy
+msgid "Last Modified"
+msgstr "已修改"
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr "扫描"
diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po
index c05494212b..59b5a5b7a2 100644
--- a/editor/translations/zh_HK.po
+++ b/editor/translations/zh_HK.po
@@ -1026,7 +1026,7 @@ msgid "Resource"
msgstr "資源"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "路徑"
@@ -1532,7 +1532,8 @@ msgid "Node Name:"
msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "名稱"
@@ -9773,6 +9774,10 @@ msgid "Projects"
msgstr "專案"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po
index 622e04b34f..5b360169e1 100644
--- a/editor/translations/zh_TW.po
+++ b/editor/translations/zh_TW.po
@@ -1022,7 +1022,7 @@ msgid "Resource"
msgstr "資源"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
-#: editor/project_settings_editor.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
msgid "Path"
msgstr "路徑"
@@ -1523,7 +1523,8 @@ msgid "Node Name:"
msgstr "節點名稱:"
#: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp
-#: editor/editor_profiler.cpp editor/settings_config_dialog.cpp
+#: editor/editor_profiler.cpp editor/project_manager.cpp
+#: editor/settings_config_dialog.cpp
msgid "Name"
msgstr "名稱"
@@ -9742,6 +9743,10 @@ msgid "Projects"
msgstr "專案"
#: editor/project_manager.cpp
+msgid "Last Modified"
+msgstr ""
+
+#: editor/project_manager.cpp
msgid "Scan"
msgstr ""
diff --git a/main/main.cpp b/main/main.cpp
index 22a31d597e..cdaee06135 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -65,6 +65,7 @@
#include "scene/resources/packed_scene.h"
#include "servers/arvr_server.h"
#include "servers/audio_server.h"
+#include "servers/camera_server.h"
#include "servers/physics_2d_server.h"
#include "servers/physics_server.h"
#include "servers/register_server_types.h"
@@ -97,6 +98,7 @@ static MessageQueue *message_queue = NULL;
// Initialized in setup2()
static AudioServer *audio_server = NULL;
+static CameraServer *camera_server = NULL;
static ARVRServer *arvr_server = NULL;
static PhysicsServer *physics_server = NULL;
static Physics2DServer *physics_2d_server = NULL;
@@ -257,6 +259,8 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --position <X>,<Y> Request window position.\n");
OS::get_singleton()->print(" --low-dpi Force low-DPI mode (macOS and Windows only).\n");
OS::get_singleton()->print(" --no-window Disable window creation (Windows only). Useful together with --script.\n");
+ OS::get_singleton()->print(" --enable-vsync-via-compositor When vsync is enabled, vsync via the OS' window compositor (Windows only).\n");
+ OS::get_singleton()->print(" --disable-vsync-via-compositor Disable vsync via the OS' window compositor (Windows only).\n");
OS::get_singleton()->print("\n");
#endif
@@ -397,6 +401,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
Vector<String> breakpoints;
bool use_custom_res = true;
bool force_res = false;
+ bool saw_vsync_via_compositor_override = false;
#ifdef TOOLS_ENABLED
bool found_project = false;
#endif
@@ -588,6 +593,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "--no-window") { // disable window creation (Windows only)
OS::get_singleton()->set_no_window_mode(true);
+ } else if (I->get() == "--enable-vsync-via-compositor") {
+
+ video_mode.vsync_via_compositor = true;
+ saw_vsync_via_compositor_override = true;
+ } else if (I->get() == "--disable-vsync-via-compositor") {
+
+ video_mode.vsync_via_compositor = false;
+ saw_vsync_via_compositor_override = true;
#endif
} else if (I->get() == "--profiling") { // enable profiling
@@ -1007,6 +1020,16 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
video_mode.use_vsync = GLOBAL_DEF_RST("display/window/vsync/use_vsync", true);
OS::get_singleton()->_use_vsync = video_mode.use_vsync;
+ if (!saw_vsync_via_compositor_override) {
+ // If one of the command line options to enable/disable vsync via the
+ // window compositor ("--enable-vsync-via-compositor" or
+ // "--disable-vsync-via-compositor") was present then it overrides the
+ // project setting.
+ video_mode.vsync_via_compositor = GLOBAL_DEF("display/window/vsync/vsync_via_compositor", false);
+ }
+
+ OS::get_singleton()->_vsync_via_compositor = video_mode.vsync_via_compositor;
+
OS::get_singleton()->_allow_layered = GLOBAL_DEF("display/window/per_pixel_transparency/allowed", false);
video_mode.layered = GLOBAL_DEF("display/window/per_pixel_transparency/enabled", false);
@@ -1318,6 +1341,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
register_platform_apis();
register_module_types();
+ camera_server = CameraServer::create();
+
initialize_physics();
register_server_singletons();
@@ -2090,6 +2115,11 @@ void Main::cleanup() {
ERR_FAIL_COND(!_start_success);
+ if (script_debugger) {
+ // Flush any remaining messages
+ script_debugger->idle_poll();
+ }
+
ResourceLoader::remove_custom_loaders();
ResourceSaver::remove_custom_savers();
@@ -2137,6 +2167,10 @@ void Main::cleanup() {
memdelete(audio_server);
}
+ if (camera_server) {
+ memdelete(camera_server);
+ }
+
OS::get_singleton()->finalize();
finalize_physics();
diff --git a/methods.py b/methods.py
index 86ab7cd9af..84074db0eb 100644
--- a/methods.py
+++ b/methods.py
@@ -307,7 +307,7 @@ def split_lib(self, libname, src_list = None, env_lib = None):
else:
fname = env.File(f)[0].path
fname = fname.replace("\\", "/")
- base = string.join(fname.split("/")[:2], "/")
+ base = "/".join(fname.split("/")[:2])
if base != cur_base and len(list) > max_src:
if num > 0:
lib = env_lib.add_library(libname + str(num), list)
@@ -320,12 +320,6 @@ def split_lib(self, libname, src_list = None, env_lib = None):
lib = env_lib.add_library(libname + str(num), list)
lib_list.append(lib)
- if len(lib_list) > 0:
- if os.name == 'posix' and sys.platform == 'msys':
- env.Replace(ARFLAGS=['rcsT'])
- lib = env_lib.add_library(libname + "_collated", lib_list)
- lib_list = [lib]
-
lib_base = []
env_lib.add_source_files(lib_base, "*.cpp")
lib = env_lib.add_library(libname, lib_base)
@@ -333,6 +327,24 @@ def split_lib(self, libname, src_list = None, env_lib = None):
env.Prepend(LIBS=lib_list)
+ # When we split modules into arbitrary chunks, we end up with linking issues
+ # due to symbol dependencies split over several libs, which may not be linked
+ # in the required order. We use --start-group and --end-group to tell the
+ # linker that those archives should be searched repeatedly to resolve all
+ # undefined references.
+ # As SCons doesn't give us much control over how inserting libs in LIBS
+ # impacts the linker call, we need to hack our way into the linking commands
+ # LINKCOM and SHLINKCOM to set those flags.
+
+ if '-Wl,--start-group' in env['LINKCOM'] and '-Wl,--start-group' in env['SHLINKCOM']:
+ # Already added by a previous call, skip.
+ return
+
+ env['LINKCOM'] = str(env['LINKCOM']).replace('$_LIBFLAGS',
+ '-Wl,--start-group $_LIBFLAGS -Wl,--end-group')
+ env['SHLINKCOM'] = str(env['LINKCOM']).replace('$_LIBFLAGS',
+ '-Wl,--start-group $_LIBFLAGS -Wl,--end-group')
+
def save_active_platforms(apnames, ap):
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
index b375293ca6..0b8a508d2f 100644
--- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
@@ -19,6 +19,7 @@
1FE926A11FBBF86D00F53A6F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE9268F1FBBF77F00F53A6F /* CoreAudio.framework */; };
E360193721F32F38009258C1 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E360193621F32F37009258C1 /* CoreVideo.framework */; };
DEADBEEF2F582BE20003B888 /* $binary.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DEADBEEF1F582BE20003B888 /* $binary.a */; };
+ $modules_buildfile
1FF8DBB11FBA9DE1009DE660 /* dummy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FF8DBB01FBA9DE1009DE660 /* dummy.cpp */; };
1FF4C1851F584E3F00A41E41 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1841F584E3F00A41E41 /* GameKit.framework */; };
1FF4C1871F584E5600A41E41 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1861F584E5600A41E41 /* StoreKit.framework */; };
@@ -45,6 +46,7 @@
1FE926951FBBF7C400F53A6F /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
1FE926961FBBF7D400F53A6F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
DEADBEEF1F582BE20003B888 /* $binary.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = godot; path = "$binary.a"; sourceTree = "<group>"; };
+ $modules_fileref
1FF4C1841F584E3F00A41E41 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
1FF4C1861F584E5600A41E41 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
1FF4C1881F584E7600A41E41 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
@@ -89,6 +91,7 @@
D0BCFE3E18AEBDA2004A7AAE /* GLKit.framework in Frameworks */,
D0BCFE3818AEBDA2004A7AAE /* Foundation.framework in Frameworks */,
DEADBEEF2F582BE20003B888 /* $binary.a */,
+ $modules_buildphase
$additional_pbx_frameworks_build
);
runOnlyForDeploymentPostprocessing = 0;
@@ -138,6 +141,7 @@
D0BCFE3D18AEBDA2004A7AAE /* GLKit.framework */,
D0BCFE3F18AEBDA2004A7AAE /* OpenGLES.framework */,
DEADBEEF1F582BE20003B888 /* $binary.a */,
+ $modules_buildgrp
$additional_pbx_frameworks_refs
);
name = Frameworks;
@@ -427,6 +431,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
+ "$(PROJECT_DIR)",
);
PRODUCT_BUNDLE_IDENTIFIER = $identifier;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -452,6 +457,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
+ "$(PROJECT_DIR)",
);
PRODUCT_BUNDLE_IDENTIFIER = $identifier;
PRODUCT_NAME = "$(TARGET_NAME)";
diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
index e7c4f8f340..add2f6c084 100644
--- a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
+++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
@@ -28,6 +28,10 @@
<string>$version</string>
<key>LSRequiresIPhoneOS</key>
<true/>
+ <key>LSSupportsOpeningDocumentsInPlace</key>
+ $docs_in_place
+ <key>UIFileSharingEnabled</key>
+ $docs_sharing
<key>UIRequiredDeviceCapabilities</key>
<array>
$required_device_capabilities
diff --git a/misc/hooks/README.md b/misc/hooks/README.md
index 6ec90fcc54..b18ba7df38 100644
--- a/misc/hooks/README.md
+++ b/misc/hooks/README.md
@@ -1,6 +1,6 @@
# Git hooks for Godot Engine
-This folder contains git hooks meant to be installed locally by Godot Engine
+This folder contains Git hooks meant to be installed locally by Godot Engine
contributors to make sure they comply with our requirements.
## List of hooks
@@ -9,10 +9,12 @@ contributors to make sure they comply with our requirements.
before accepting a commit; blocks the commit and generates a patch if the
style is not respected.
Should work on Linux and macOS. You may need to edit the file if your
- clang-format binary is not in the $PATH, or if you want to enable colored
+ clang-format binary is not in the `$PATH`, or if you want to enable colored
output with pygmentize.
+- Pre-commit hook for makerst: Checks the class reference syntax using `makerst.py`.
+ Should work on Linux and macOS.
## Installation
-Copy all the files from this folder into your .git/hooks folder, and make sure
+Copy all the files from this folder into your `.git/hooks` folder, and make sure
the hooks and helper scripts are executable.
diff --git a/misc/hooks/pre-commit b/misc/hooks/pre-commit
index fc50ed70e7..36e9935785 100755
--- a/misc/hooks/pre-commit
+++ b/misc/hooks/pre-commit
@@ -14,7 +14,7 @@
# as this script. Hooks should return 0 if successful and nonzero to cancel the
# commit. They are executed in the order in which they are listed.
#HOOKS="pre-commit-compile pre-commit-uncrustify"
-HOOKS="pre-commit-clang-format"
+HOOKS="pre-commit-clang-format pre-commit-makerst"
###########################################################
# There should be no need to change anything below this line.
diff --git a/misc/hooks/pre-commit-makerst b/misc/hooks/pre-commit-makerst
new file mode 100755
index 0000000000..d9b684e73b
--- /dev/null
+++ b/misc/hooks/pre-commit-makerst
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+# Git pre-commit hook that checks the class reference syntax using makerst.py.
+
+doc/tools/makerst.py doc/classes modules --dry-run
diff --git a/modules/SCsub b/modules/SCsub
index 42d89d6ce2..dc0420616c 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -16,7 +16,7 @@ for x in env.module_list:
env_modules.Append(CPPDEFINES=["MODULE_" + x.upper() + "_ENABLED"])
SConscript(x + "/SCsub")
-if env.split_modules:
+if env['split_libmodules']:
env.split_lib("modules", env_lib = env_modules)
else:
lib = env_modules.add_library("modules", env.modules_sources)
diff --git a/modules/arkit/SCsub b/modules/arkit/SCsub
index b43d936768..e605703a72 100644
--- a/modules/arkit/SCsub
+++ b/modules/arkit/SCsub
@@ -5,6 +5,8 @@ Import('env_modules')
env_arkit = env_modules.Clone()
-# Add source files
-env_arkit.add_source_files(env.modules_sources, "*.cpp")
-env_arkit.add_source_files(env.modules_sources, "*.mm")
+# (iOS) Build as separate static library
+modules_sources = []
+env_arkit.add_source_files(modules_sources, "*.cpp")
+env_arkit.add_source_files(modules_sources, "*.mm")
+mod_lib = env_modules.add_library('#bin/libgodot_arkit_module' + env['LIBSUFFIX'], modules_sources) \ No newline at end of file
diff --git a/modules/arkit/arkit_interface.mm b/modules/arkit/arkit_interface.mm
index 71642cfc30..3408477458 100644
--- a/modules/arkit/arkit_interface.mm
+++ b/modules/arkit/arkit_interface.mm
@@ -28,7 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "camera_ios.h"
#include "core/os/input.h"
#include "core/os/os.h"
#include "scene/resources/surface_tool.h"
diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp
index 2cb2a71f1e..752b74b9f2 100644
--- a/modules/assimp/editor_scene_importer_assimp.cpp
+++ b/modules/assimp/editor_scene_importer_assimp.cpp
@@ -364,8 +364,6 @@ EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScene *scene,
}
} else if (bone != NULL) {
continue;
- } else if (element_assimp_node->mNumMeshes > 0) {
- spatial = memnew(Spatial);
} else {
spatial = memnew(Spatial);
}
@@ -393,16 +391,11 @@ EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScene *scene,
ERR_FAIL_COND_V_MSG(parent_node == NULL, state.root,
"Parent node invalid even though lookup successful, out of ram?")
- if (parent_node && spatial != state.root) {
+ if (spatial != state.root) {
parent_node->add_child(spatial);
spatial->set_owner(state.root);
- } else if (spatial == state.root) {
+ } else {
// required - think about it root never has a parent yet is valid, anything else without a parent is not valid.
- } else // Safety for instances
- {
- WARN_PRINT(
- "Failed to find parent node instance after lookup, serious warning report to godot with model");
- memdelete(spatial); // this node is broken
}
} else if (spatial != state.root) {
// if the ainode is not in the tree
@@ -477,11 +470,12 @@ EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScene *scene,
for (Map<const aiNode *, Spatial *>::Element *key_value_pair = state.flat_node_map.front(); key_value_pair; key_value_pair = key_value_pair->next()) {
const aiNode *assimp_node = key_value_pair->key();
Spatial *mesh_template = key_value_pair->value();
- Node *parent_node = mesh_template->get_parent();
ERR_CONTINUE(assimp_node == NULL);
ERR_CONTINUE(mesh_template == NULL);
+ Node *parent_node = mesh_template->get_parent();
+
if (mesh_template == state.root) {
continue;
}
@@ -1009,7 +1003,6 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
}
}
- const String mesh_name = AssimpUtils::get_assimp_string(ai_mesh->mName);
aiString mat_name;
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_NAME, mat_name)) {
mat->set_name(AssimpUtils::get_assimp_string(mat_name));
@@ -1495,7 +1488,6 @@ void EditorSceneImporterAssimp::_generate_node(
ERR_FAIL_COND(assimp_node == NULL);
state.nodes.push_back(assimp_node);
- String node_name = AssimpUtils::get_assimp_string(assimp_node->mName);
String parent_name = AssimpUtils::get_assimp_string(assimp_node->mParent->mName);
// please note
diff --git a/modules/assimp/import_utils.h b/modules/assimp/import_utils.h
index 8135b352c6..bf7552e7db 100644
--- a/modules/assimp/import_utils.h
+++ b/modules/assimp/import_utils.h
@@ -309,9 +309,7 @@ public:
if (r_found) {
return;
}
- if (r_found == false) {
- find_texture_path(r_p_path, dir, r_path, r_found, "." + exts[i]);
- }
+ find_texture_path(r_p_path, dir, r_path, r_found, "." + exts[i]);
}
}
@@ -322,9 +320,7 @@ public:
static void set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<ImageTexture> texture) {
ERR_FAIL_COND(texture.is_null());
ERR_FAIL_COND(map_mode == NULL);
- aiTextureMapMode tex_mode = aiTextureMapMode::aiTextureMapMode_Wrap;
-
- tex_mode = map_mode[0];
+ aiTextureMapMode tex_mode = map_mode[0];
int32_t flags = Texture::FLAGS_DEFAULT;
if (tex_mode == aiTextureMapMode_Wrap) {
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp
index e74c29769f..d73930775d 100644
--- a/modules/bullet/space_bullet.cpp
+++ b/modules/bullet/space_bullet.cpp
@@ -945,8 +945,8 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
btVector3 motion;
G_TO_B(p_motion, motion);
-
- { /// phase two - sweep test, from a secure position without margin
+ if (!motion.fuzzyZero()) {
+ // Phase two - sweep test, from a secure position without margin
const int shape_count(p_body->get_shape_count());
diff --git a/modules/camera/SCsub b/modules/camera/SCsub
new file mode 100644
index 0000000000..23f031f06e
--- /dev/null
+++ b/modules/camera/SCsub
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+Import('env')
+Import('env_modules')
+
+env_camera = env_modules.Clone()
+
+if env["platform"] == "iphone":
+ # (iOS) Build as separate static library
+ modules_sources = []
+ env_camera.add_source_files(modules_sources, "register_types.cpp")
+ env_camera.add_source_files(modules_sources, "camera_ios.mm")
+ mod_lib = env_modules.add_library('#bin/libgodot_camera_module' + env['LIBSUFFIX'], modules_sources)
+
+elif env["platform"] == "windows":
+ env_camera.add_source_files(env.modules_sources, "register_types.cpp")
+ env_camera.add_source_files(env.modules_sources, "camera_win.cpp")
+
+elif env["platform"] == "osx":
+ env_camera.add_source_files(env.modules_sources, "register_types.cpp")
+ env_camera.add_source_files(env.modules_sources, "camera_osx.mm")
+
diff --git a/platform/iphone/camera_ios.h b/modules/camera/camera_ios.h
index ceabdba6a3..ceabdba6a3 100644
--- a/platform/iphone/camera_ios.h
+++ b/modules/camera/camera_ios.h
diff --git a/platform/iphone/camera_ios.mm b/modules/camera/camera_ios.mm
index 5636ed6262..dcf09b28fd 100644
--- a/platform/iphone/camera_ios.mm
+++ b/modules/camera/camera_ios.mm
@@ -359,7 +359,7 @@ void CameraIOS::update_feeds() {
// this way of doing things is deprecated but still works,
// rewrite to using AVCaptureDeviceDiscoverySession
- AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:[NSArray arrayWithObjects:AVCaptureDeviceTypeBuiltInTelephotoCamera, AVCaptureDeviceTypeBuiltInDualCamera, AVCaptureDeviceTypeBuiltInTrueDepthCamera, AVCaptureDeviceTypeBuiltInWideAngleCamera] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
+ AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:[NSArray arrayWithObjects:AVCaptureDeviceTypeBuiltInTelephotoCamera, AVCaptureDeviceTypeBuiltInDualCamera, AVCaptureDeviceTypeBuiltInTrueDepthCamera, AVCaptureDeviceTypeBuiltInWideAngleCamera, nil] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
// remove devices that are gone..
for (int i = feeds.size() - 1; i >= 0; i--) {
diff --git a/platform/osx/camera_osx.h b/modules/camera/camera_osx.h
index 7477d8e647..7477d8e647 100644
--- a/platform/osx/camera_osx.h
+++ b/modules/camera/camera_osx.h
diff --git a/platform/osx/camera_osx.mm b/modules/camera/camera_osx.mm
index 2b0f4906fc..2b0f4906fc 100644
--- a/platform/osx/camera_osx.mm
+++ b/modules/camera/camera_osx.mm
diff --git a/platform/windows/camera_win.cpp b/modules/camera/camera_win.cpp
index 10787d0d0a..10787d0d0a 100644
--- a/platform/windows/camera_win.cpp
+++ b/modules/camera/camera_win.cpp
diff --git a/platform/windows/camera_win.h b/modules/camera/camera_win.h
index 22ce9aa43f..22ce9aa43f 100644
--- a/platform/windows/camera_win.h
+++ b/modules/camera/camera_win.h
diff --git a/modules/camera/config.py b/modules/camera/config.py
new file mode 100644
index 0000000000..d308c04195
--- /dev/null
+++ b/modules/camera/config.py
@@ -0,0 +1,5 @@
+def can_build(env, platform):
+ return platform == 'iphone' or platform == 'osx' or platform == 'windows'
+
+def configure(env):
+ pass
diff --git a/modules/camera/register_types.cpp b/modules/camera/register_types.cpp
new file mode 100644
index 0000000000..313df40112
--- /dev/null
+++ b/modules/camera/register_types.cpp
@@ -0,0 +1,56 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "register_types.h"
+
+#if defined(WINDOWS_ENABLED)
+#include "camera_win.h"
+#endif
+#if defined(IPHONE_ENABLED)
+#include "camera_ios.h"
+#endif
+#if defined(OSX_ENABLED)
+#include "camera_osx.h"
+#endif
+
+void register_camera_types() {
+#if defined(WINDOWS_ENABLED)
+ CameraServer::make_default<CameraWindows>();
+#endif
+#if defined(IPHONE_ENABLED)
+ CameraServer::make_default<CameraIOS>();
+#endif
+#if defined(OSX_ENABLED)
+ CameraServer::make_default<CameraOSX>();
+#endif
+}
+
+void unregister_camera_types() {
+}
diff --git a/modules/camera/register_types.h b/modules/camera/register_types.h
new file mode 100644
index 0000000000..0ccb0885d0
--- /dev/null
+++ b/modules/camera/register_types.h
@@ -0,0 +1,32 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+void register_camera_types();
+void unregister_camera_types();
diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp
index 5d272a6cdc..5c84222797 100644
--- a/modules/gdnative/gdnative_library_editor_plugin.cpp
+++ b/modules/gdnative/gdnative_library_editor_plugin.cpp
@@ -224,7 +224,6 @@ void GDNativeLibraryEditor::_erase_entry(const String &platform, const String &e
if (List<String>::Element *E = platforms[platform].entries.find(entry)) {
String target = platform + "." + entry;
- Ref<ConfigFile> config = library->get_config_file();
platforms[platform].entries.erase(E);
_set_target_value("entry", target, "");
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp
index 7c313c983f..768b12baea 100644
--- a/modules/gdnative/nativescript/nativescript.cpp
+++ b/modules/gdnative/nativescript/nativescript.cpp
@@ -119,7 +119,10 @@ String NativeScript::get_class_name() const {
void NativeScript::set_library(Ref<GDNativeLibrary> p_library) {
if (!library.is_null()) {
- WARN_PRINT("library on NativeScript already set. Do nothing.");
+ WARN_PRINT("Library in NativeScript already set. Do nothing.");
+ return;
+ }
+ if (p_library.is_null()) {
return;
}
library = p_library;
diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp
index f7c961d38b..6bb521173f 100644
--- a/modules/gdnative/pluginscript/pluginscript_script.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_script.cpp
@@ -251,7 +251,19 @@ Error PluginScript::reload(bool p_keep_state) {
(godot_string *)&_path,
(godot_string *)&_source,
(godot_error *)&err);
+// Manifest's attributes must be explicitly freed
+#define FREE_SCRIPT_MANIFEST(manifest) \
+ { \
+ godot_string_name_destroy(&manifest.name); \
+ godot_string_name_destroy(&manifest.base); \
+ godot_dictionary_destroy(&manifest.member_lines); \
+ godot_array_destroy(&manifest.methods); \
+ godot_array_destroy(&manifest.signals); \
+ godot_array_destroy(&manifest.properties); \
+ }
+
if (err) {
+ FREE_SCRIPT_MANIFEST(manifest);
// TODO: GDscript uses `ScriptDebugger` here to jump into the parsing error
return err;
}
@@ -269,6 +281,7 @@ Error PluginScript::reload(bool p_keep_state) {
_ref_base_parent = res;
} else {
String name = *(StringName *)&manifest.name;
+ FREE_SCRIPT_MANIFEST(manifest);
ERR_FAIL_V_MSG(ERR_PARSE_ERROR, _path + ": Script '" + name + "' has an invalid parent '" + *base_name + "'.");
}
}
@@ -317,13 +330,6 @@ Error PluginScript::reload(bool p_keep_state) {
_methods_rpc_mode[pi.name] = MultiplayerAPI::RPCMode(int(var));
}
}
- // Manifest's attributes must be explicitly freed
- godot_string_name_destroy(&manifest.name);
- godot_string_name_destroy(&manifest.base);
- godot_dictionary_destroy(&manifest.member_lines);
- godot_array_destroy(&manifest.methods);
- godot_array_destroy(&manifest.signals);
- godot_array_destroy(&manifest.properties);
#ifdef TOOLS_ENABLED
/*for (Set<PlaceHolderScriptInstance*>::Element *E=placeholders.front();E;E=E->next()) {
@@ -331,7 +337,10 @@ Error PluginScript::reload(bool p_keep_state) {
_update_placeholder(E->get());
}*/
#endif
+
+ FREE_SCRIPT_MANIFEST(manifest);
return OK;
+#undef FREE_SCRIPT_MANIFEST
}
void PluginScript::get_script_method_list(List<MethodInfo> *r_methods) const {
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index a22d18b970..502a68cd61 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -208,7 +208,7 @@
<argument index="1" name="type" type="int">
</argument>
<description>
- Converts from a type to another in the best way possible. The [code]type[/code] parameter uses the enum [code]TYPE_*[/code] in [@GlobalScope].
+ Converts from a type to another in the best way possible. The [code]type[/code] parameter uses the [enum Variant.Type] values.
[codeblock]
a = Vector2(1, 0)
# Prints 1
@@ -336,11 +336,12 @@
<description>
Rounds [code]s[/code] to the closest smaller integer and returns it.
[codeblock]
- # a is 2
+ # a is 2.0
a = floor(2.99)
- # a is -3
+ # a is -3.0
a = floor(-2.99)
[/codeblock]
+ [b]Note:[/b] This method returns a float. If you need an integer, you can use [code]int(s)[/code] directly.
</description>
</method>
<method name="fmod">
@@ -502,7 +503,7 @@
<argument index="1" name="b" type="float">
</argument>
<description>
- Returns True/False whether [code]a[/code] and [code]b[/code] are approximately equal to each other.
+ Returns [code]true[/code] if [code]a[/code] and [code]b[/code] are approximately equal to each other.
</description>
</method>
<method name="is_inf">
@@ -538,7 +539,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Returns True/False whether [code]s[/code] is zero or almost zero.
+ Returns [code]true[/code] if [code]s[/code] is zero or almost zero.
</description>
</method>
<method name="len">
@@ -615,9 +616,10 @@
Loads a resource from the filesystem located at [code]path[/code].
[b]Note:[/b] Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing [b]Copy Path[/b].
[codeblock]
- # Load a scene called main located in the root of the project directory
+ # Load a scene called main located in the root of the project directory.
var main = load("res://main.tscn")
[/codeblock]
+ [b]Important:[/b] The path must be absolute, a local path will just return [code]null[/code].
</description>
</method>
<method name="log">
@@ -785,7 +787,7 @@
Returns a resource from the filesystem that is loaded during script parsing.
[b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path".
[codeblock]
- # Load a scene called main located in the root of the project directory
+ # Load a scene called main located in the root of the project directory.
var main = preload("res://main.tscn")
[/codeblock]
</description>
@@ -1216,7 +1218,7 @@
<argument index="0" name="what" type="Variant">
</argument>
<description>
- Returns the internal type of the given Variant object, using the [code]TYPE_*[/code] enum in [@GlobalScope].
+ Returns the internal type of the given Variant object, using the [enum Variant.Type] values.
[codeblock]
p = parse_json('["a", "b", "c"]')
if typeof(p) == TYPE_ARRAY:
@@ -1232,7 +1234,7 @@
<argument index="0" name="json" type="String">
</argument>
<description>
- Checks that [code]json[/code] is valid JSON data. Returns empty string if valid. Returns error message if not valid.
+ Checks that [code]json[/code] is valid JSON data. Returns an empty string if valid, or an error message otherwise.
[codeblock]
j = to_json([1, 2, 3])
v = validate_json(j)
diff --git a/modules/gdscript/doc_classes/GDScript.xml b/modules/gdscript/doc_classes/GDScript.xml
index 6f43361914..8e175a7ab8 100644
--- a/modules/gdscript/doc_classes/GDScript.xml
+++ b/modules/gdscript/doc_classes/GDScript.xml
@@ -4,7 +4,7 @@
A script implemented in the GDScript programming language.
</brief_description>
<description>
- A script implemented in the GDScript programming language. The script exends the functionality of all objects that instance it.
+ A script implemented in the GDScript programming language. The script extends the functionality of all objects that instance it.
[method new] creates a new instance of the script. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes.
</description>
<tutorials>
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 563f7e2471..2f620df8fb 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -2143,7 +2143,8 @@ GDScriptLanguage::GDScriptLanguage() {
GLOBAL_DEF("debug/gdscript/completion/autocomplete_setters_and_getters", false);
for (int i = 0; i < (int)GDScriptWarning::WARNING_MAX; i++) {
String warning = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)i).to_lower();
- GLOBAL_DEF("debug/gdscript/warnings/" + warning, !warning.begins_with("unsafe_"));
+ bool default_enabled = !warning.begins_with("unsafe_") && i != GDScriptWarning::UNUSED_CLASS_VARIABLE;
+ GLOBAL_DEF("debug/gdscript/warnings/" + warning, default_enabled);
}
#endif // DEBUG_ENABLED
}
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 280bc37dc0..97b8dda6d0 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -744,6 +744,14 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G
r_type.type.kind = GDScriptParser::DataType::BUILTIN;
r_type.type.builtin_type = Variant::ARRAY;
} break;
+ case GDScriptParser::Node::TYPE_CAST: {
+ const GDScriptParser::CastNode *cn = static_cast<const GDScriptParser::CastNode *>(p_expression);
+ GDScriptCompletionIdentifier value;
+ if (_guess_expression_type(p_context, cn->source_node, r_type)) {
+ r_type.type = cn->get_datatype();
+ found = true;
+ }
+ } break;
case GDScriptParser::Node::TYPE_OPERATOR: {
const GDScriptParser::OperatorNode *op = static_cast<const GDScriptParser::OperatorNode *>(p_expression);
switch (op->op) {
@@ -1232,6 +1240,9 @@ static bool _guess_identifier_type(GDScriptCompletionContext &p_context, const S
c.line = last_assign_line;
r_type.assigned_expression = last_assigned_expression;
if (_guess_expression_type(c, last_assigned_expression, r_type)) {
+ if (var_type.has_type) {
+ r_type.type = var_type;
+ }
return true;
}
}
diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp
index bbafef68ed..9e05c7b574 100644
--- a/modules/gdscript/gdscript_functions.cpp
+++ b/modules/gdscript/gdscript_functions.cpp
@@ -1128,25 +1128,11 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
d["@subpath"] = cp;
d["@path"] = p->get_path();
- p = base.ptr();
-
- while (p) {
-
- for (Set<StringName>::Element *E = p->members.front(); E; E = E->next()) {
-
- Variant value;
- if (ins->get(E->get(), value)) {
-
- String k = E->get();
- if (!d.has(k)) {
- d[k] = value;
- }
- }
+ for (Map<StringName, GDScript::MemberInfo>::Element *E = base->member_indices.front(); E; E = E->next()) {
+ if (!d.has(E->key())) {
+ d[E->key()] = ins->members[E->get().index];
}
-
- p = p->_base;
}
-
r_ret = d;
}
}
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 6ef3ab67ae..ef1a282e51 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3349,7 +3349,12 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
}
p_block->statements.push_back(expression);
if (!_end_statement()) {
- _set_error("Expected end of statement after expression.");
+ // Attempt to guess a better error message if the user "retypes" a variable
+ if (tokenizer->get_token() == GDScriptTokenizer::TK_COLON && tokenizer->get_token(1) == GDScriptTokenizer::TK_OP_ASSIGN) {
+ _set_error("Unexpected ':=', use '=' instead. Expected end of statement after expression.");
+ } else {
+ _set_error(String() + "Expected end of statement after expression, got " + tokenizer->get_token_name(tokenizer->get_token()) + " instead");
+ }
return;
}
diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp
index 6b5c26ec81..d63f786fcb 100644
--- a/modules/gdscript/language_server/gdscript_extend_parser.cpp
+++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp
@@ -115,7 +115,7 @@ void ExtendGDScriptParser::update_document_links(const String &p_code) {
if (tokenizer.get_token() == GDScriptTokenizer::TK_EOF) {
break;
} else if (tokenizer.get_token() == GDScriptTokenizer::TK_CONSTANT) {
- Variant const_val = tokenizer.get_token_constant();
+ const Variant &const_val = tokenizer.get_token_constant();
if (const_val.get_type() == Variant::STRING) {
String path = const_val;
bool exists = fs->file_exists(path);
diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp
index b83db718b8..1ca2a50c21 100644
--- a/modules/gdscript/language_server/gdscript_text_document.cpp
+++ b/modules/gdscript/language_server/gdscript_text_document.cpp
@@ -281,8 +281,6 @@ Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) {
}
Array GDScriptTextDocument::foldingRange(const Dictionary &p_params) {
- Dictionary params = p_params["textDocument"];
- String path = params["uri"];
Array arr;
return arr;
}
diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml
index a140fc8ac6..3de971db6d 100644
--- a/modules/gridmap/doc_classes/GridMap.xml
+++ b/modules/gridmap/doc_classes/GridMap.xml
@@ -226,9 +226,6 @@
<member name="mesh_library" type="MeshLibrary" setter="set_mesh_library" getter="get_mesh_library">
The assigned [MeshLibrary].
</member>
- <member name="theme" type="MeshLibrary" setter="set_theme" getter="get_theme">
- Deprecated, use [member mesh_library] instead.
- </member>
</members>
<signals>
<signal name="cell_size_changed">
diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp
index 204f4e8905..62912d1459 100644
--- a/modules/mbedtls/crypto_mbedtls.cpp
+++ b/modules/mbedtls/crypto_mbedtls.cpp
@@ -203,8 +203,6 @@ void CryptoMbedTLS::load_default_certificates(String p_path) {
default_certs = memnew(X509CertificateMbedTLS);
ERR_FAIL_COND(default_certs == NULL);
- String certs_path = GLOBAL_DEF("network/ssl/certificates", "");
-
if (p_path != "") {
// Use certs defined in project settings.
default_certs->load(p_path);
diff --git a/modules/mbedtls/stream_peer_mbedtls.cpp b/modules/mbedtls/stream_peer_mbedtls.cpp
index a2e342e219..78e99a3a65 100755
--- a/modules/mbedtls/stream_peer_mbedtls.cpp
+++ b/modules/mbedtls/stream_peer_mbedtls.cpp
@@ -111,7 +111,6 @@ Error StreamPeerMbedTLS::connect_to_stream(Ref<StreamPeer> p_base, bool p_valida
ERR_FAIL_COND_V(p_base.is_null(), ERR_INVALID_PARAMETER);
base = p_base;
- int ret = 0;
int authmode = p_validate_certs ? MBEDTLS_SSL_VERIFY_REQUIRED : MBEDTLS_SSL_VERIFY_NONE;
Error err = ssl_ctx->init_client(MBEDTLS_SSL_TRANSPORT_STREAM, authmode, p_ca_certs);
@@ -122,7 +121,7 @@ Error StreamPeerMbedTLS::connect_to_stream(Ref<StreamPeer> p_base, bool p_valida
status = STATUS_HANDSHAKING;
- if ((ret = _do_handshake()) != OK) {
+ if (_do_handshake() != OK) {
status = STATUS_ERROR_HOSTNAME_MISMATCH;
return FAILED;
}
@@ -143,7 +142,7 @@ Error StreamPeerMbedTLS::accept_stream(Ref<StreamPeer> p_base, Ref<CryptoKey> p_
status = STATUS_HANDSHAKING;
- if ((err = _do_handshake()) != OK) {
+ if (_do_handshake() != OK) {
return FAILED;
}
diff --git a/modules/mono/build_scripts/godot_tools_build.py b/modules/mono/build_scripts/godot_tools_build.py
index 03aaa925f0..6e5273f5e0 100644
--- a/modules/mono/build_scripts/godot_tools_build.py
+++ b/modules/mono/build_scripts/godot_tools_build.py
@@ -82,7 +82,8 @@ def build(env_mono, api_sln_cmd):
target_filenames = [
'GodotTools.dll', 'GodotTools.IdeConnection.dll', 'GodotTools.BuildLogger.dll',
- 'GodotTools.ProjectEditor.dll', 'DotNet.Glob.dll', 'GodotTools.Core.dll'
+ 'GodotTools.ProjectEditor.dll', 'DotNet.Glob.dll', 'GodotTools.Core.dll',
+ 'JetBrains.Annotations.dll', 'Newtonsoft.Json.dll'
]
if env_mono['target'] == 'debug':
diff --git a/modules/mono/build_scripts/mono_android_config.xml b/modules/mono/build_scripts/mono_android_config.xml
new file mode 100644
index 0000000000..e79670afd2
--- /dev/null
+++ b/modules/mono/build_scripts/mono_android_config.xml
@@ -0,0 +1,28 @@
+<configuration>
+ <dllmap wordsize="32" dll="i:cygwin1.dll" target="/system/lib/libc.so" />
+ <dllmap wordsize="64" dll="i:cygwin1.dll" target="/system/lib64/libc.so" />
+ <dllmap wordsize="32" dll="libc" target="/system/lib/libc.so" />
+ <dllmap wordsize="64" dll="libc" target="/system/lib64/libc.so" />
+ <dllmap wordsize="32" dll="intl" target="/system/lib/libc.so" />
+ <dllmap wordsize="64" dll="intl" target="/system/lib64/libc.so" />
+ <dllmap wordsize="32" dll="libintl" target="/system/lib/libc.so" />
+ <dllmap wordsize="64" dll="libintl" target="/system/lib64/libc.so" />
+ <dllmap dll="MonoPosixHelper" target="libMonoPosixHelper.so" />
+ <dllmap dll="System.Native" target="libmono-native.so" />
+ <dllmap wordsize="32" dll="i:msvcrt" target="/system/lib/libc.so" />
+ <dllmap wordsize="64" dll="i:msvcrt" target="/system/lib64/libc.so" />
+ <dllmap wordsize="32" dll="i:msvcrt.dll" target="/system/lib/libc.so" />
+ <dllmap wordsize="64" dll="i:msvcrt.dll" target="/system/lib64/libc.so" />
+ <dllmap wordsize="32" dll="sqlite" target="/system/lib/libsqlite.so" />
+ <dllmap wordsize="64" dll="sqlite" target="/system/lib64/libsqlite.so" />
+ <dllmap wordsize="32" dll="sqlite3" target="/system/lib/libsqlite.so" />
+ <dllmap wordsize="64" dll="sqlite3" target="/system/lib64/libsqlite.so" />
+ <dllmap wordsize="32" dll="liblog" target="/system/lib/liblog.so" />
+ <dllmap wordsize="64" dll="liblog" target="/system/lib64/liblog.so" />
+ <dllmap dll="i:kernel32.dll">
+ <dllentry dll="__Internal" name="CopyMemory" target="mono_win32_compat_CopyMemory"/>
+ <dllentry dll="__Internal" name="FillMemory" target="mono_win32_compat_FillMemory"/>
+ <dllentry dll="__Internal" name="MoveMemory" target="mono_win32_compat_MoveMemory"/>
+ <dllentry dll="__Internal" name="ZeroMemory" target="mono_win32_compat_ZeroMemory"/>
+ </dllmap>
+</configuration>
diff --git a/modules/mono/build_scripts/mono_configure.py b/modules/mono/build_scripts/mono_configure.py
index c09690ba6d..89d56def7d 100644
--- a/modules/mono/build_scripts/mono_configure.py
+++ b/modules/mono/build_scripts/mono_configure.py
@@ -206,6 +206,8 @@ def configure(env, env_mono):
env_mono.Append(CPPDEFINES=['_REENTRANT'])
if mono_static:
+ env.Append(LINKFLAGS=['-rdynamic'])
+
mono_lib_file = os.path.join(mono_lib_path, 'lib' + mono_lib + '.a')
if is_apple:
@@ -281,8 +283,6 @@ def configure(env, env_mono):
libs_output_dir = get_android_out_dir(env) if is_android else '#bin'
copy_file(mono_lib_path, libs_output_dir, 'lib' + mono_so_name + sharedlib_ext)
- env.Append(LINKFLAGS='-rdynamic')
-
if not tools_enabled:
if is_desktop(env['platform']):
if not mono_root:
@@ -292,7 +292,8 @@ def configure(env, env_mono):
elif is_android:
# Compress Android Mono Config
from . import make_android_mono_config
- config_file_path = os.path.join(mono_root, 'etc', 'mono', 'config')
+ module_dir = os.getcwd()
+ config_file_path = os.path.join(module_dir, 'build_scripts', 'mono_android_config.xml')
make_android_mono_config.generate_compressed_config(config_file_path, 'mono_gd/')
# Copy the required shared libraries
diff --git a/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs b/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs
index a0f6f1ff32..6015cb22b6 100644
--- a/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs
@@ -18,7 +18,7 @@ namespace GodotTools.BuildLogger
if (null == Parameters)
throw new LoggerException("Log directory was not set.");
- var parameters = Parameters.Split(new[] {';'});
+ var parameters = Parameters.Split(new[] { ';' });
string logDir = parameters[0];
diff --git a/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj b/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj
index dcfdd83831..1eaa36c1aa 100644
--- a/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj
+++ b/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj b/modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj
index 24c7cb1573..1974220f2f 100644
--- a/modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj
+++ b/modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
index 8cd7e76303..b531b6aeee 100644
--- a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
@@ -26,7 +26,7 @@ namespace GodotTools.Core
path = path.Replace('\\', '/');
- string[] parts = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
+ string[] parts = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
path = string.Join(Path.DirectorySeparatorChar.ToString(), parts).Trim();
@@ -44,7 +44,7 @@ namespace GodotTools.Core
public static string CsvEscape(this string value, char delimiter = ',')
{
- bool hasSpecialChar = value.IndexOfAny(new char[] {'\"', '\n', '\r', delimiter}) != -1;
+ bool hasSpecialChar = value.IndexOfAny(new char[] { '\"', '\n', '\r', delimiter }) != -1;
if (hasSpecialChar)
return "\"" + value.Replace("\"", "\"\"") + "\"";
@@ -54,8 +54,8 @@ namespace GodotTools.Core
public static string ToSafeDirName(this string dirName, bool allowDirSeparator)
{
- var invalidChars = new List<string> {":", "*", "?", "\"", "<", ">", "|"};
-
+ var invalidChars = new List<string> { ":", "*", "?", "\"", "<", ">", "|" };
+
if (allowDirSeparator)
{
// Directory separators are allowed, but disallow ".." to avoid going up the filesystem
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeClient.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeClient.cs
index 4f56a8d71b..2bf3b83c75 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeClient.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeClient.cs
@@ -106,7 +106,7 @@ namespace GodotTools.IdeConnection
try
{
Logger.LogInfo("Connecting to Godot Ide Server");
-
+
tcpClient.Connect(IPAddress.Loopback, GodotIdeMetadata.Port);
Logger.LogInfo("Connection open with Godot Ide Server");
@@ -130,7 +130,7 @@ namespace GodotTools.IdeConnection
public void Start()
{
Logger.LogInfo("Starting Godot Ide Client");
-
+
fsWatcher.Changed += OnMetaFileChanged;
fsWatcher.Deleted += OnMetaFileDeleted;
fsWatcher.EnableRaisingEvents = true;
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnection.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnection.cs
index e7e81f175e..6441be8d6e 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnection.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnection.cs
@@ -149,7 +149,7 @@ namespace GodotTools.IdeConnection
public bool WriteMessage(Message message)
{
Logger.LogDebug($"Sending message {message}");
-
+
var messageComposer = new MessageComposer();
messageComposer.AddArgument(message.Id);
@@ -201,7 +201,7 @@ namespace GodotTools.IdeConnection
clientReader?.Dispose();
clientWriter?.Dispose();
- ((IDisposable) tcpClient)?.Dispose();
+ ((IDisposable)tcpClient)?.Dispose();
}
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj
index 94e525715b..427a26508f 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageComposer.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageComposer.cs
index 9e4cd6ec1a..30ffe7a06e 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageComposer.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageComposer.cs
@@ -22,14 +22,14 @@ namespace GodotTools.IdeConnection
if (quoted)
{
stringBuilder.Append('"');
-
+
foreach (char @char in argument)
{
if (CharsToEscape.Contains(@char))
stringBuilder.Append('\\');
stringBuilder.Append(@char);
}
-
+
stringBuilder.Append('"');
}
else
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageParser.cs b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageParser.cs
index ed691e481f..4365d69989 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageParser.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/MessageParser.cs
@@ -37,7 +37,7 @@ namespace GodotTools.IdeConnection
while (i < messageLine.Length)
{
@char = messageLine[i];
-
+
if (quoted && @char == '"')
{
i++;
@@ -60,10 +60,10 @@ namespace GodotTools.IdeConnection
{
stringBuilder.Append(@char);
}
-
+
i++;
}
-
+
arguments.Add(stringBuilder.ToString());
stringBuilder.Clear();
diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
index 4f21871f1a..b40d985d51 100644
--- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
@@ -26,8 +26,8 @@ namespace GodotTools.ProjectEditor
mainGroup.SetProperty("BaseIntermediateOutputPath", "obj");
GenAssemblyInfoFile(root, dir, CoreApiProjectName,
- new[] {"[assembly: InternalsVisibleTo(\"" + EditorApiProjectName + "\")]"},
- new[] {"System.Runtime.CompilerServices"});
+ new[] { "[assembly: InternalsVisibleTo(\"" + EditorApiProjectName + "\")]" },
+ new[] { "System.Runtime.CompilerServices" });
foreach (var item in compileItems)
{
diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/packages.config b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/packages.config
index 13915000e4..2db030f9d8 100644
--- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/packages.config
+++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/packages.config
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DotNet.Glob" version="2.1.1" targetFramework="net45" />
-</packages> \ No newline at end of file
+</packages>
diff --git a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
index 44813f962c..4c76d2abf1 100644
--- a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
@@ -34,7 +34,7 @@ namespace GodotTools
for (int i = 0; i < buildTabs.GetChildCount(); i++)
{
- var tab = (BuildTab) buildTabs.GetChild(i);
+ var tab = (BuildTab)buildTabs.GetChild(i);
if (tab == null)
continue;
@@ -120,7 +120,7 @@ namespace GodotTools
if (currentTab < 0 || currentTab >= buildTabs.GetTabCount())
throw new InvalidOperationException("No tab selected");
- var buildTab = (BuildTab) buildTabs.GetChild(currentTab);
+ var buildTab = (BuildTab)buildTabs.GetChild(currentTab);
buildTab.WarningsVisible = pressed;
buildTab.UpdateIssuesList();
}
@@ -132,7 +132,7 @@ namespace GodotTools
if (currentTab < 0 || currentTab >= buildTabs.GetTabCount())
throw new InvalidOperationException("No tab selected");
- var buildTab = (BuildTab) buildTabs.GetChild(currentTab);
+ var buildTab = (BuildTab)buildTabs.GetChild(currentTab);
buildTab.ErrorsVisible = pressed;
buildTab.UpdateIssuesList();
}
@@ -193,7 +193,7 @@ namespace GodotTools
int selectedItem = selectedItems[0];
- var buildTab = (BuildTab) buildTabs.GetTabControl(selectedItem);
+ var buildTab = (BuildTab)buildTabs.GetTabControl(selectedItem);
OS.ShellOpen(Path.Combine(buildTab.BuildInfo.LogsDirPath, BuildManager.MsBuildLogFileName));
}
@@ -249,14 +249,14 @@ namespace GodotTools
var editorBaseControl = editorInterface.GetBaseControl();
- SizeFlagsVertical = (int) SizeFlags.ExpandFill;
+ SizeFlagsVertical = (int)SizeFlags.ExpandFill;
SetAnchorsAndMarginsPreset(LayoutPreset.Wide);
panelTabs = new TabContainer
{
TabAlign = TabContainer.TabAlignEnum.Left,
RectMinSize = new Vector2(0, 228) * EditorScale,
- SizeFlagsVertical = (int) SizeFlags.ExpandFill
+ SizeFlagsVertical = (int)SizeFlags.ExpandFill
};
panelTabs.AddStyleboxOverride("panel", editorBaseControl.GetStylebox("DebuggerPanel", "EditorStyles"));
panelTabs.AddStyleboxOverride("tab_fg", editorBaseControl.GetStylebox("DebuggerTabFG", "EditorStyles"));
@@ -268,11 +268,11 @@ namespace GodotTools
panelBuildsTab = new VBoxContainer
{
Name = "Builds".TTR(),
- SizeFlagsHorizontal = (int) SizeFlags.ExpandFill
+ SizeFlagsHorizontal = (int)SizeFlags.ExpandFill
};
panelTabs.AddChild(panelBuildsTab);
- var toolBarHBox = new HBoxContainer {SizeFlagsHorizontal = (int) SizeFlags.ExpandFill};
+ var toolBarHBox = new HBoxContainer { SizeFlagsHorizontal = (int)SizeFlags.ExpandFill };
panelBuildsTab.AddChild(toolBarHBox);
var buildProjectBtn = new Button
@@ -320,12 +320,12 @@ namespace GodotTools
var hsc = new HSplitContainer
{
- SizeFlagsHorizontal = (int) SizeFlags.ExpandFill,
- SizeFlagsVertical = (int) SizeFlags.ExpandFill
+ SizeFlagsHorizontal = (int)SizeFlags.ExpandFill,
+ SizeFlagsVertical = (int)SizeFlags.ExpandFill
};
panelBuildsTab.AddChild(hsc);
- buildTabsList = new ItemList {SizeFlagsHorizontal = (int) SizeFlags.ExpandFill};
+ buildTabsList = new ItemList { SizeFlagsHorizontal = (int)SizeFlags.ExpandFill };
buildTabsList.Connect("item_selected", this, nameof(_BuildTabsItemSelected));
buildTabsList.Connect("nothing_selected", this, nameof(_BuildTabsNothingSelected));
hsc.AddChild(buildTabsList);
@@ -333,7 +333,7 @@ namespace GodotTools
buildTabs = new TabContainer
{
TabAlign = TabContainer.TabAlignEnum.Left,
- SizeFlagsHorizontal = (int) SizeFlags.ExpandFill,
+ SizeFlagsHorizontal = (int)SizeFlags.ExpandFill,
TabsVisible = false
};
hsc.AddChild(buildTabs);
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs
index da90c960e5..43c96d2e30 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs
@@ -46,7 +46,7 @@ namespace GodotTools.Build
{
if (OS.IsWindows)
{
- return (BuildManager.BuildTool) EditorSettings.GetSetting("mono/builds/build_tool")
+ return (BuildManager.BuildTool)EditorSettings.GetSetting("mono/builds/build_tool")
== BuildManager.BuildTool.MsBuildMono;
}
@@ -55,7 +55,7 @@ namespace GodotTools.Build
}
private static bool PrintBuildOutput =>
- (bool) EditorSettings.GetSetting("mono/builds/print_build_output");
+ (bool)EditorSettings.GetSetting("mono/builds/print_build_output");
private static Process LaunchBuild(string solution, string config, string loggerOutputDir, IEnumerable<string> customProperties = null)
{
@@ -90,7 +90,7 @@ namespace GodotTools.Build
// Needed when running from Developer Command Prompt for VS
RemovePlatformVariable(startInfo.EnvironmentVariables);
- var process = new Process {StartInfo = startInfo};
+ var process = new Process { StartInfo = startInfo };
process.Start();
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs
index ad8a6516ab..c3db52aa9e 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs
@@ -19,7 +19,7 @@ namespace GodotTools.Build
public static string FindMsBuild()
{
var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
- var buildTool = (BuildManager.BuildTool) editorSettings.GetSetting("mono/builds/build_tool");
+ var buildTool = (BuildManager.BuildTool)editorSettings.GetSetting("mono/builds/build_tool");
if (OS.IsWindows)
{
@@ -136,11 +136,11 @@ namespace GodotTools.Build
string vsWherePath = Environment.GetEnvironmentVariable(Internal.GodotIs32Bits() ? "ProgramFiles" : "ProgramFiles(x86)");
vsWherePath += "\\Microsoft Visual Studio\\Installer\\vswhere.exe";
- var vsWhereArgs = new[] {"-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild"};
+ var vsWhereArgs = new[] { "-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild" };
var outputArray = new Godot.Collections.Array<string>();
int exitCode = Godot.OS.Execute(vsWherePath, vsWhereArgs,
- blocking: true, output: (Godot.Collections.Array) outputArray);
+ blocking: true, output: (Godot.Collections.Array)outputArray);
if (exitCode != 0)
return string.Empty;
diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs
index 217bf5c144..fa6bf4dafd 100644
--- a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs
@@ -172,7 +172,7 @@ namespace GodotTools
}
var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
- var buildTool = (BuildTool) editorSettings.GetSetting("mono/builds/build_tool");
+ var buildTool = (BuildTool)editorSettings.GetSetting("mono/builds/build_tool");
using (var pr = new EditorProgress("mono_project_debug_build", "Building project solution...", 1))
{
diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs b/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs
index 807a20d9a1..727581daab 100644
--- a/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs
@@ -113,7 +113,7 @@ namespace GodotTools
throw new IndexOutOfRangeException("Item list index out of range");
// Get correct issue idx from issue list
- int issueIndex = (int) issuesList.GetItemMetadata(idx);
+ int issueIndex = (int)issuesList.GetItemMetadata(idx);
if (idx < 0 || idx >= issues.Count)
throw new IndexOutOfRangeException("Issue index out of range");
@@ -134,7 +134,7 @@ namespace GodotTools
if (file.StartsWith("res://"))
{
- var script = (Script) ResourceLoader.Load(file, typeHint: Internal.CSharpLanguageType);
+ var script = (Script)ResourceLoader.Load(file, typeHint: Internal.CSharpLanguageType);
if (script != null && Internal.ScriptEditorEdit(script, issue.Line, issue.Column))
Internal.EditorNodeShowScriptScreen();
@@ -220,7 +220,7 @@ namespace GodotTools
issuesList.Clear();
- var issue = new BuildIssue {Message = cause, Warning = false};
+ var issue = new BuildIssue { Message = cause, Warning = false };
ErrorCount += 1;
issues.Add(issue);
@@ -250,7 +250,7 @@ namespace GodotTools
{
base._Ready();
- issuesList = new ItemList {SizeFlagsVertical = (int) SizeFlags.ExpandFill};
+ issuesList = new ItemList { SizeFlagsVertical = (int)SizeFlags.ExpandFill };
issuesList.Connect("item_activated", this, nameof(_IssueActivated));
AddChild(issuesList);
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs b/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs
index c021a9051e..174509dc5b 100644
--- a/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs
@@ -26,7 +26,7 @@ namespace GodotTools
public static void AddItem(string projectPath, string itemType, string include)
{
- if (!(bool) GlobalDef("mono/project/auto_update_project", true))
+ if (!(bool)GlobalDef("mono/project/auto_update_project", true))
return;
ProjectUtils.AddItemToProjectChecked(projectPath, itemType, include);
@@ -49,7 +49,7 @@ namespace GodotTools
private static ulong ConvertToTimestamp(this DateTime value)
{
TimeSpan elapsedTime = value - Epoch;
- return (ulong) elapsedTime.TotalSeconds;
+ return (ulong)elapsedTime.TotalSeconds;
}
public static void GenerateScriptsMetadata(string projectPath, string outputPath)
@@ -68,7 +68,7 @@ namespace GodotTools
if (oldDict.TryGetValue(projectIncludeFile, out var oldFileVar))
{
- var oldFileDict = (Dictionary) oldFileVar;
+ var oldFileDict = (Dictionary)oldFileVar;
if (ulong.TryParse(oldFileDict["modified_time"] as string, out ulong storedModifiedTime))
{
@@ -108,7 +108,7 @@ namespace GodotTools
if (classDict.Count == 0)
continue; // Not found
- newDict[projectIncludeFile] = new Dictionary {["modified_time"] = $"{modifiedTime}", ["class"] = classDict};
+ newDict[projectIncludeFile] = new Dictionary { ["modified_time"] = $"{modifiedTime}", ["class"] = classDict };
}
if (newDict.Count > 0)
diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
index aed25f5ac5..b17a3f4491 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
@@ -54,7 +54,7 @@ namespace GodotTools.Export
// TODO What if the source file is not part of the game's C# project
- bool includeScriptsContent = (bool) ProjectSettings.GetSetting("mono/export/include_scripts_content");
+ bool includeScriptsContent = (bool)ProjectSettings.GetSetting("mono/export/include_scripts_content");
if (!includeScriptsContent)
{
@@ -114,7 +114,7 @@ namespace GodotTools.Export
var dependencies = new Godot.Collections.Dictionary<string, string>();
- var projectDllName = (string) ProjectSettings.GetSetting("application/config/name");
+ var projectDllName = (string)ProjectSettings.GetSetting("application/config/name");
if (projectDllName.Empty())
{
projectDllName = "UnnamedProject";
@@ -125,12 +125,20 @@ namespace GodotTools.Export
dependencies[projectDllName] = projectDllSrcPath;
+ if (platform == OS.Platforms.Android)
{
- string platformBclDir = DeterminePlatformBclDir(platform);
+ string godotAndroidExtProfileDir = GetBclProfileDir("godot_android_ext");
+ string monoAndroidAssemblyPath = Path.Combine(godotAndroidExtProfileDir, "Mono.Android.dll");
+
+ if (!File.Exists(monoAndroidAssemblyPath))
+ throw new FileNotFoundException("Assembly not found: 'Mono.Android'", monoAndroidAssemblyPath);
- internal_GetExportedAssemblyDependencies(projectDllName, projectDllSrcPath, buildConfig, platformBclDir, dependencies);
+ dependencies["Mono.Android"] = monoAndroidAssemblyPath;
}
+ var initialDependencies = dependencies.Duplicate();
+ internal_GetExportedAssemblyDependencies(initialDependencies, buildConfig, DeterminePlatformBclDir(platform), dependencies);
+
string outputDataDir = null;
if (PlatformHasTemplateDir(platform))
@@ -139,7 +147,7 @@ namespace GodotTools.Export
string apiConfig = isDebug ? "Debug" : "Release";
string resAssembliesDir = Path.Combine(GodotSharpDirs.ResAssembliesBaseDir, apiConfig);
- bool assembliesInsidePck = (bool) ProjectSettings.GetSetting("mono/export/export_assemblies_inside_pck") || outputDataDir == null;
+ bool assembliesInsidePck = (bool)ProjectSettings.GetSetting("mono/export/export_assemblies_inside_pck") || outputDataDir == null;
if (!assembliesInsidePck)
{
@@ -166,7 +174,7 @@ namespace GodotTools.Export
// AOT
- if ((bool) ProjectSettings.GetSetting("mono/export/aot/enabled"))
+ if ((bool)ProjectSettings.GetSetting("mono/export/aot/enabled"))
{
AotCompileDependencies(features, platform, isDebug, outputDir, outputDataDir, dependencies);
}
@@ -201,23 +209,25 @@ namespace GodotTools.Export
string TemplateDirName() => $"data.mono.{platform}.{bits}.{target}";
string templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName());
+ bool validTemplatePathFound = true;
if (!Directory.Exists(templateDirPath))
{
- templateDirPath = null;
+ validTemplatePathFound = false;
if (isDebug)
{
target = "debug"; // Support both 'release_debug' and 'debug' for the template data directory name
templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName());
+ validTemplatePathFound = true;
if (!Directory.Exists(templateDirPath))
- templateDirPath = null;
+ validTemplatePathFound = false;
}
}
- if (templateDirPath == null)
- throw new FileNotFoundException("Data template directory not found");
+ if (!validTemplatePathFound)
+ throw new FileNotFoundException("Data template directory not found", templateDirPath);
string outputDataDir = Path.Combine(outputDir, DataDirName);
@@ -326,7 +336,7 @@ namespace GodotTools.Export
AotCompileAssembly(platform, isDebug, data, assemblyPath, outputFilePathForThisAbi);
- AddSharedObject(outputFilePathForThisAbi, tags: new[] {abi});
+ AddSharedObject(outputFilePathForThisAbi, tags: new[] { abi });
}
}
else
@@ -367,7 +377,7 @@ namespace GodotTools.Export
string compilerCommand = Path.Combine(monoCrossBin, $"{toolPrefix}{monoExeName}{exeExt}");
- bool fullAot = (bool) ProjectSettings.GetSetting("mono/export/aot/full_aot");
+ bool fullAot = (bool)ProjectSettings.GetSetting("mono/export/aot/full_aot");
string EscapeOption(string option) => option.Contains(',') ? $"\"{option}\"" : option;
string OptionsToString(IEnumerable<string> options) => string.Join(",", options.Select(EscapeOption));
@@ -384,7 +394,7 @@ namespace GodotTools.Export
{
string abi = data["abi"];
- string androidToolchain = (string) ProjectSettings.GetSetting("mono/export/aot/android_toolchain_path");
+ string androidToolchain = (string)ProjectSettings.GetSetting("mono/export/aot/android_toolchain_path");
if (string.IsNullOrEmpty(androidToolchain))
{
@@ -409,13 +419,13 @@ namespace GodotTools.Export
aotOptions.Add("tool-prefix=" + Path.Combine(androidToolchain, "bin", androidToolPrefixes[abi]));
string triple = GetAndroidTriple(abi);
- aotOptions.Add ($"mtriple={triple}");
+ aotOptions.Add($"mtriple={triple}");
}
aotOptions.Add($"outfile={outputFilePath}");
- var extraAotOptions = (string[]) ProjectSettings.GetSetting("mono/export/aot/extra_aot_options");
- var extraOptimizerOptions = (string[]) ProjectSettings.GetSetting("mono/export/aot/extra_optimizer_options");
+ var extraAotOptions = (string[])ProjectSettings.GetSetting("mono/export/aot/extra_aot_options");
+ var extraOptimizerOptions = (string[])ProjectSettings.GetSetting("mono/export/aot/extra_optimizer_options");
if (extraAotOptions.Length > 0)
aotOptions.AddRange(extraAotOptions);
@@ -565,7 +575,7 @@ namespace GodotTools.Export
private static bool PlatformHasTemplateDir(string platform)
{
// OSX export templates are contained in a zip, so we place our custom template inside it and let Godot do the rest.
- return !new[] {OS.Platforms.OSX, OS.Platforms.Android, OS.Platforms.HTML5}.Contains(platform);
+ return !new[] { OS.Platforms.OSX, OS.Platforms.Android, OS.Platforms.HTML5 }.Contains(platform);
}
private static string DeterminePlatformFromFeatures(IEnumerable<string> features)
@@ -579,6 +589,12 @@ namespace GodotTools.Export
return null;
}
+ private static string GetBclProfileDir(string profile)
+ {
+ string templatesDir = Internal.FullTemplatesDir;
+ return Path.Combine(templatesDir, "bcl", profile);
+ }
+
private static string DeterminePlatformBclDir(string platform)
{
string templatesDir = Internal.FullTemplatesDir;
@@ -590,18 +606,45 @@ namespace GodotTools.Export
platformBclDir = Path.Combine(templatesDir, "bcl", profile);
if (!File.Exists(Path.Combine(platformBclDir, "mscorlib.dll")))
+ {
+ if (PlatformRequiresCustomBcl(platform))
+ throw new FileNotFoundException($"Missing BCL (Base Class Library) for platform: {platform}");
+
platformBclDir = null; // Use the one we're running on
+ }
}
return platformBclDir;
}
+ /// <summary>
+ /// Determines whether the BCL bundled with the Godot editor can be used for the target platform,
+ /// or if it requires a custom BCL that must be distributed with the export templates.
+ /// </summary>
+ private static bool PlatformRequiresCustomBcl(string platform)
+ {
+ if (new[] { OS.Platforms.Android, OS.Platforms.HTML5 }.Contains(platform))
+ return true;
+
+ // The 'net_4_x' BCL is not compatible between Windows and the other platforms.
+ // We use the names 'net_4_x_win' and 'net_4_x' to differentiate between the two.
+
+ bool isWinOrUwp = new[]
+ {
+ OS.Platforms.Windows,
+ OS.Platforms.UWP
+ }.Contains(platform);
+
+ return OS.IsWindows ? !isWinOrUwp : isWinOrUwp;
+ }
+
private static string DeterminePlatformBclProfile(string platform)
{
switch (platform)
{
case OS.Platforms.Windows:
case OS.Platforms.UWP:
+ return "net_4_x_win";
case OS.Platforms.OSX:
case OS.Platforms.X11:
case OS.Platforms.Server:
@@ -620,14 +663,14 @@ namespace GodotTools.Export
{
get
{
- var appName = (string) ProjectSettings.GetSetting("application/config/name");
+ var appName = (string)ProjectSettings.GetSetting("application/config/name");
string appNameSafe = appName.ToSafeDirName(allowDirSeparator: false);
return $"data_{appNameSafe}";
}
}
[MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void internal_GetExportedAssemblyDependencies(string projectDllName, string projectDllSrcPath,
+ private static extern void internal_GetExportedAssemblyDependencies(Godot.Collections.Dictionary<string, string> initialDependencies,
string buildConfig, string customBclDir, Godot.Collections.Dictionary<string, string> dependencies);
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs b/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs
index 4312ca0230..bb218c2f19 100644
--- a/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs
@@ -6,6 +6,7 @@ namespace GodotTools
VisualStudio, // TODO (Windows-only)
VisualStudioForMac, // Mac-only
MonoDevelop,
- VsCode
+ VsCode,
+ Rider
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
index 2a5d3de126..147bc95bb8 100644
--- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
@@ -6,8 +6,10 @@ using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using GodotTools.Ides;
+using GodotTools.Ides.Rider;
using GodotTools.Internals;
using GodotTools.ProjectEditor;
+using JetBrains.Annotations;
using static GodotTools.Internals.Globals;
using File = GodotTools.Utils.File;
using OS = GodotTools.Utils.OS;
@@ -42,7 +44,7 @@ namespace GodotTools
string resourceDir = ProjectSettings.GlobalizePath("res://");
string path = resourceDir;
- string name = (string) ProjectSettings.GetSetting("application/config/name");
+ string name = (string)ProjectSettings.GetSetting("application/config/name");
if (name.Empty())
name = "UnnamedProject";
@@ -59,7 +61,7 @@ namespace GodotTools
{
Guid = guid,
PathRelativeToSolution = name + ".csproj",
- Configs = new List<string> {"Debug", "Release", "Tools"}
+ Configs = new List<string> { "Debug", "Release", "Tools" }
};
solution.AddNewProject(name, projectInfo);
@@ -108,20 +110,20 @@ namespace GodotTools
private void _RemoveCreateSlnMenuOption()
{
- menuPopup.RemoveItem(menuPopup.GetItemIndex((int) MenuOptions.CreateSln));
+ menuPopup.RemoveItem(menuPopup.GetItemIndex((int)MenuOptions.CreateSln));
bottomPanelBtn.Show();
}
private void _ShowAboutDialog()
{
- bool showOnStart = (bool) editorSettings.GetSetting("mono/editor/show_info_on_start");
+ bool showOnStart = (bool)editorSettings.GetSetting("mono/editor/show_info_on_start");
aboutDialogCheckBox.Pressed = showOnStart;
aboutDialog.PopupCenteredMinsize();
}
private void _ToggleAboutDialogOnStart(bool enabled)
{
- bool showOnStart = (bool) editorSettings.GetSetting("mono/editor/show_info_on_start");
+ bool showOnStart = (bool)editorSettings.GetSetting("mono/editor/show_info_on_start");
if (showOnStart != enabled)
editorSettings.SetSetting("mono/editor/show_info_on_start", enabled);
}
@@ -158,7 +160,7 @@ namespace GodotTools
if (what == NotificationReady)
{
- bool showInfoDialog = (bool) editorSettings.GetSetting("mono/editor/show_info_on_start");
+ bool showInfoDialog = (bool)editorSettings.GetSetting("mono/editor/show_info_on_start");
if (showInfoDialog)
{
aboutDialog.PopupExclusive = true;
@@ -189,9 +191,10 @@ namespace GodotTools
"code", "code-oss", "vscode", "vscode-oss", "visual-studio-code", "visual-studio-code-oss"
};
+ [UsedImplicitly]
public Error OpenInExternalEditor(Script script, int line, int col)
{
- var editor = (ExternalEditorId) editorSettings.GetSetting("mono/editor/external_editor");
+ var editor = (ExternalEditorId)editorSettings.GetSetting("mono/editor/external_editor");
switch (editor)
{
@@ -202,6 +205,12 @@ namespace GodotTools
throw new NotSupportedException();
case ExternalEditorId.VisualStudioForMac:
goto case ExternalEditorId.MonoDevelop;
+ case ExternalEditorId.Rider:
+ {
+ string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath);
+ RiderPathManager.OpenFile(GodotSharpDirs.ProjectSlnPath, scriptPath, line);
+ return Error.Ok;
+ }
case ExternalEditorId.MonoDevelop:
{
string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath);
@@ -306,9 +315,10 @@ namespace GodotTools
return Error.Ok;
}
+ [UsedImplicitly]
public bool OverridesExternalEditor()
{
- return (ExternalEditorId) editorSettings.GetSetting("mono/editor/external_editor") != ExternalEditorId.None;
+ return (ExternalEditorId)editorSettings.GetSetting("mono/editor/external_editor") != ExternalEditorId.None;
}
public override bool Build()
@@ -336,7 +346,7 @@ namespace GodotTools
bottomPanelBtn = AddControlToBottomPanel(BottomPanel, "Mono".TTR());
- AddChild(new HotReloadAssemblyWatcher {Name = "HotReloadAssemblyWatcher"});
+ AddChild(new HotReloadAssemblyWatcher { Name = "HotReloadAssemblyWatcher" });
menuPopup = new PopupMenu();
menuPopup.Hide();
@@ -346,7 +356,7 @@ namespace GodotTools
// TODO: Remove or edit this info dialog once Mono support is no longer in alpha
{
- menuPopup.AddItem("About C# support".TTR(), (int) MenuOptions.AboutCSharp);
+ menuPopup.AddItem("About C# support".TTR(), (int)MenuOptions.AboutCSharp);
aboutDialog = new AcceptDialog();
editorBaseControl.AddChild(aboutDialog);
aboutDialog.WindowTitle = "Important: C# support is not feature-complete";
@@ -369,7 +379,7 @@ namespace GodotTools
var aboutLabel = new Label();
aboutHBox.AddChild(aboutLabel);
aboutLabel.RectMinSize = new Vector2(600, 150) * EditorScale;
- aboutLabel.SizeFlagsVertical = (int) Control.SizeFlags.ExpandFill;
+ aboutLabel.SizeFlagsVertical = (int)Control.SizeFlags.ExpandFill;
aboutLabel.Autowrap = true;
aboutLabel.Text =
"C# support in Godot Engine is in late alpha stage and, while already usable, " +
@@ -384,7 +394,7 @@ namespace GodotTools
EditorDef("mono/editor/show_info_on_start", true);
// CheckBox in main container
- aboutDialogCheckBox = new CheckBox {Text = "Show this warning when starting the editor"};
+ aboutDialogCheckBox = new CheckBox { Text = "Show this warning when starting the editor" };
aboutDialogCheckBox.Connect("toggled", this, nameof(_ToggleAboutDialogOnStart));
aboutVBox.AddChild(aboutDialogCheckBox);
}
@@ -397,7 +407,7 @@ namespace GodotTools
else
{
bottomPanelBtn.Hide();
- menuPopup.AddItem("Create C# solution".TTR(), (int) MenuOptions.CreateSln);
+ menuPopup.AddItem("Create C# solution".TTR(), (int)MenuOptions.CreateSln);
}
menuPopup.Connect("id_pressed", this, nameof(_MenuOptionPressed));
@@ -418,19 +428,22 @@ namespace GodotTools
if (OS.IsWindows)
{
- settingsHintStr += $",MonoDevelop:{(int) ExternalEditorId.MonoDevelop}" +
- $",Visual Studio Code:{(int) ExternalEditorId.VsCode}";
+ settingsHintStr += $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
+ $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
+ $",JetBrains Rider:{(int)ExternalEditorId.Rider}";
}
else if (OS.IsOSX)
{
- settingsHintStr += $",Visual Studio:{(int) ExternalEditorId.VisualStudioForMac}" +
- $",MonoDevelop:{(int) ExternalEditorId.MonoDevelop}" +
- $",Visual Studio Code:{(int) ExternalEditorId.VsCode}";
+ settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudioForMac}" +
+ $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
+ $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
+ $",JetBrains Rider:{(int)ExternalEditorId.Rider}";
}
else if (OS.IsUnixLike())
{
- settingsHintStr += $",MonoDevelop:{(int) ExternalEditorId.MonoDevelop}" +
- $",Visual Studio Code:{(int) ExternalEditorId.VsCode}";
+ settingsHintStr += $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
+ $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
+ $",JetBrains Rider:{(int)ExternalEditorId.Rider}";
}
editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary
@@ -448,6 +461,7 @@ namespace GodotTools
exportPluginWeak = WeakRef(exportPlugin);
BuildManager.Initialize();
+ RiderPathManager.Initialize();
GodotIdeManager = new GodotIdeManager();
AddChild(GodotIdeManager);
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj
index fb2cbabc8e..dbd774a66a 100644
--- a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj
+++ b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -30,7 +30,15 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="JetBrains.Annotations, Version=2019.1.3.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325">
+ <HintPath>..\packages\JetBrains.Annotations.2019.1.3\lib\net20\JetBrains.Annotations.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
<Reference Include="Mono.Posix" />
+ <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
+ <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
<Reference Include="System" />
<Reference Include="GodotSharp">
<HintPath>$(GodotSourceRootPath)/bin/GodotSharp/Api/$(GodotApiConfiguration)/GodotSharp.dll</HintPath>
@@ -47,6 +55,8 @@
<Compile Include="Ides\GodotIdeServer.cs" />
<Compile Include="Ides\MonoDevelop\EditorId.cs" />
<Compile Include="Ides\MonoDevelop\Instance.cs" />
+ <Compile Include="Ides\Rider\RiderPathLocator.cs" />
+ <Compile Include="Ides\Rider\RiderPathManager.cs" />
<Compile Include="Internals\BindingsGenerator.cs" />
<Compile Include="Internals\EditorProgress.cs" />
<Compile Include="Internals\GodotSharpDirs.cs" />
@@ -67,6 +77,7 @@
<Compile Include="BottomPanel.cs" />
<Compile Include="CsProjOperations.cs" />
<Compile Include="Utils\CollectionExtensions.cs" />
+ <Compile Include="Utils\User32Dll.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GodotTools.BuildLogger\GodotTools.BuildLogger.csproj">
@@ -86,5 +97,11 @@
<Name>GodotTools.Core</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Ides\Rider\.editorconfig" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file
diff --git a/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs b/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs
index 0f6f5ffadc..0ed567afd1 100644
--- a/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs
@@ -38,7 +38,7 @@ namespace GodotTools
watchTimer = new Timer
{
OneShot = false,
- WaitTime = (float) EditorDef("mono/assembly_watch_interval_sec", 0.5)
+ WaitTime = (float)EditorDef("mono/assembly_watch_interval_sec", 0.5)
};
watchTimer.Connect("timeout", this, nameof(TimerTimeout));
AddChild(watchTimer);
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs
index f94d6f998c..54f0ffab96 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs
@@ -64,7 +64,7 @@ namespace GodotTools.Ides
private void LaunchIde()
{
- var editor = (ExternalEditorId) GodotSharpEditor.Instance.GetEditorInterface()
+ var editor = (ExternalEditorId)GodotSharpEditor.Instance.GetEditorInterface()
.GetEditorSettings().GetSetting("mono/editor/external_editor");
switch (editor)
@@ -72,6 +72,7 @@ namespace GodotTools.Ides
case ExternalEditorId.None:
case ExternalEditorId.VisualStudio:
case ExternalEditorId.VsCode:
+ case ExternalEditorId.Rider:
throw new NotSupportedException();
case ExternalEditorId.VisualStudioForMac:
goto case ExternalEditorId.MonoDevelop;
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeServer.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeServer.cs
index 309b917c71..72676a8b24 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeServer.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeServer.cs
@@ -45,7 +45,7 @@ namespace GodotTools.Ides
listener = new TcpListener(new IPEndPoint(IPAddress.Loopback, port: 0));
listener.Start();
- int port = ((IPEndPoint) listener.Server.LocalEndPoint).Port;
+ int port = ((IPEndPoint)listener.Server.LocalEndPoint).Port;
using (var metaFileWriter = new StreamWriter(metaFile, Encoding.UTF8))
{
metaFileWriter.WriteLine(port);
@@ -57,7 +57,7 @@ namespace GodotTools.Ides
public void StartServer()
{
- var serverThread = new Thread(RunServerThread) {Name = "Godot Ide Connection Server"};
+ var serverThread = new Thread(RunServerThread) { Name = "Godot Ide Connection Server" };
serverThread.Start();
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
new file mode 100644
index 0000000000..b752535dcb
--- /dev/null
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
@@ -0,0 +1,416 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Godot;
+using JetBrains.Annotations;
+using Microsoft.Win32;
+using Newtonsoft.Json;
+using Directory = System.IO.Directory;
+using Environment = System.Environment;
+using File = System.IO.File;
+using Path = System.IO.Path;
+using OS = GodotTools.Utils.OS;
+
+namespace GodotTools.Ides.Rider
+{
+ /// <summary>
+ /// This code is a modified version of the JetBrains resharper-unity plugin listed under Apache License 2.0 license:
+ /// https://github.com/JetBrains/resharper-unity/blob/master/unity/JetBrains.Rider.Unity.Editor/EditorPlugin/RiderPathLocator.cs
+ /// </summary>
+ public static class RiderPathLocator
+ {
+ public static RiderInfo[] GetAllRiderPaths()
+ {
+ try
+ {
+ if (OS.IsWindows)
+ {
+ return CollectRiderInfosWindows();
+ }
+ if (OS.IsOSX)
+ {
+ return CollectRiderInfosMac();
+ }
+ if (OS.IsUnixLike())
+ {
+ return CollectAllRiderPathsLinux();
+ }
+ throw new Exception("Unexpected OS.");
+ }
+ catch (Exception e)
+ {
+ GD.PushWarning(e.Message);
+ }
+
+ return new RiderInfo[0];
+ }
+
+ private static RiderInfo[] CollectAllRiderPathsLinux()
+ {
+ var installInfos = new List<RiderInfo>();
+ var home = Environment.GetEnvironmentVariable("HOME");
+ if (!string.IsNullOrEmpty(home))
+ {
+ var toolboxRiderRootPath = GetToolboxBaseDir();
+ installInfos.AddRange(CollectPathsFromToolbox(toolboxRiderRootPath, "bin", "rider.sh", false)
+ .Select(a => new RiderInfo(a, true)).ToList());
+
+ //$Home/.local/share/applications/jetbrains-rider.desktop
+ var shortcut = new FileInfo(Path.Combine(home, @".local/share/applications/jetbrains-rider.desktop"));
+
+ if (shortcut.Exists)
+ {
+ var lines = File.ReadAllLines(shortcut.FullName);
+ foreach (var line in lines)
+ {
+ if (!line.StartsWith("Exec=\""))
+ continue;
+ var path = line.Split('"').Where((item, index) => index == 1).SingleOrDefault();
+ if (string.IsNullOrEmpty(path))
+ continue;
+
+ if (installInfos.Any(a => a.Path == path)) // avoid adding similar build as from toolbox
+ continue;
+ installInfos.Add(new RiderInfo(path, false));
+ }
+ }
+ }
+
+ // snap install
+ var snapInstallPath = "/snap/rider/current/bin/rider.sh";
+ if (new FileInfo(snapInstallPath).Exists)
+ installInfos.Add(new RiderInfo(snapInstallPath, false));
+
+ return installInfos.ToArray();
+ }
+
+ private static RiderInfo[] CollectRiderInfosMac()
+ {
+ var installInfos = new List<RiderInfo>();
+ // "/Applications/*Rider*.app"
+ var folder = new DirectoryInfo("/Applications");
+ if (folder.Exists)
+ {
+ installInfos.AddRange(folder.GetDirectories("*Rider*.app")
+ .Select(a => new RiderInfo(a.FullName, false))
+ .ToList());
+ }
+
+ // /Users/user/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-1/181.3870.267/Rider EAP.app
+ var toolboxRiderRootPath = GetToolboxBaseDir();
+ var paths = CollectPathsFromToolbox(toolboxRiderRootPath, "", "Rider*.app", true)
+ .Select(a => new RiderInfo(a, true));
+ installInfos.AddRange(paths);
+
+ return installInfos.ToArray();
+ }
+
+ private static RiderInfo[] CollectRiderInfosWindows()
+ {
+ var installInfos = new List<RiderInfo>();
+ var toolboxRiderRootPath = GetToolboxBaseDir();
+ var installPathsToolbox = CollectPathsFromToolbox(toolboxRiderRootPath, "bin", "rider64.exe", false).ToList();
+ installInfos.AddRange(installPathsToolbox.Select(a => new RiderInfo(a, true)).ToList());
+
+ var installPaths = new List<string>();
+ const string registryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
+ CollectPathsFromRegistry(registryKey, installPaths);
+ const string wowRegistryKey = @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall";
+ CollectPathsFromRegistry(wowRegistryKey, installPaths);
+
+ installInfos.AddRange(installPaths.Select(a => new RiderInfo(a, false)).ToList());
+
+ return installInfos.ToArray();
+ }
+
+ private static string GetToolboxBaseDir()
+ {
+ if (OS.IsWindows)
+ {
+ var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+ return Path.Combine(localAppData, @"JetBrains\Toolbox\apps\Rider");
+ }
+
+ if (OS.IsOSX)
+ {
+ var home = Environment.GetEnvironmentVariable("HOME");
+ if (!string.IsNullOrEmpty(home))
+ {
+ return Path.Combine(home, @"Library/Application Support/JetBrains/Toolbox/apps/Rider");
+ }
+ }
+
+ if (OS.IsUnixLike())
+ {
+ var home = Environment.GetEnvironmentVariable("HOME");
+ if (!string.IsNullOrEmpty(home))
+ {
+ return Path.Combine(home, @".local/share/JetBrains/Toolbox/apps/Rider");
+ }
+ }
+
+ throw new Exception("Unexpected OS.");
+ }
+
+ internal static ProductInfo GetBuildVersion(string path)
+ {
+ var buildTxtFileInfo = new FileInfo(Path.Combine(path, GetRelativePathToBuildTxt()));
+ var dir = buildTxtFileInfo.DirectoryName;
+ if (!Directory.Exists(dir))
+ return null;
+ var buildVersionFile = new FileInfo(Path.Combine(dir, "product-info.json"));
+ if (!buildVersionFile.Exists)
+ return null;
+ var json = File.ReadAllText(buildVersionFile.FullName);
+ return ProductInfo.GetProductInfo(json);
+ }
+
+ internal static Version GetBuildNumber(string path)
+ {
+ var file = new FileInfo(Path.Combine(path, GetRelativePathToBuildTxt()));
+ if (!file.Exists)
+ return null;
+ var text = File.ReadAllText(file.FullName);
+ if (text.Length <= 3)
+ return null;
+
+ var versionText = text.Substring(3);
+ return Version.TryParse(versionText, out var v) ? v : null;
+ }
+
+ internal static bool IsToolbox(string path)
+ {
+ return path.StartsWith(GetToolboxBaseDir());
+ }
+
+ private static string GetRelativePathToBuildTxt()
+ {
+ if (OS.IsWindows || OS.IsUnixLike())
+ return "../../build.txt";
+ if (OS.IsOSX)
+ return "Contents/Resources/build.txt";
+ throw new Exception("Unknown OS.");
+ }
+
+ private static void CollectPathsFromRegistry(string registryKey, List<string> installPaths)
+ {
+ using (var key = Registry.LocalMachine.OpenSubKey(registryKey))
+ {
+ if (key == null) return;
+ foreach (var subkeyName in key.GetSubKeyNames().Where(a => a.Contains("Rider")))
+ {
+ using (var subkey = key.OpenSubKey(subkeyName))
+ {
+ var folderObject = subkey?.GetValue("InstallLocation");
+ if (folderObject == null) continue;
+ var folder = folderObject.ToString();
+ var possiblePath = Path.Combine(folder, @"bin\rider64.exe");
+ if (File.Exists(possiblePath))
+ installPaths.Add(possiblePath);
+ }
+ }
+ }
+ }
+
+ private static string[] CollectPathsFromToolbox(string toolboxRiderRootPath, string dirName, string searchPattern,
+ bool isMac)
+ {
+ if (!Directory.Exists(toolboxRiderRootPath))
+ return new string[0];
+
+ var channelDirs = Directory.GetDirectories(toolboxRiderRootPath);
+ var paths = channelDirs.SelectMany(channelDir =>
+ {
+ try
+ {
+ // use history.json - last entry stands for the active build https://jetbrains.slack.com/archives/C07KNP99D/p1547807024066500?thread_ts=1547731708.057700&cid=C07KNP99D
+ var historyFile = Path.Combine(channelDir, ".history.json");
+ if (File.Exists(historyFile))
+ {
+ var json = File.ReadAllText(historyFile);
+ var build = ToolboxHistory.GetLatestBuildFromJson(json);
+ if (build != null)
+ {
+ var buildDir = Path.Combine(channelDir, build);
+ var executablePaths = GetExecutablePaths(dirName, searchPattern, isMac, buildDir);
+ if (executablePaths.Any())
+ return executablePaths;
+ }
+ }
+
+ var channelFile = Path.Combine(channelDir, ".channel.settings.json");
+ if (File.Exists(channelFile))
+ {
+ var json = File.ReadAllText(channelFile).Replace("active-application", "active_application");
+ var build = ToolboxInstallData.GetLatestBuildFromJson(json);
+ if (build != null)
+ {
+ var buildDir = Path.Combine(channelDir, build);
+ var executablePaths = GetExecutablePaths(dirName, searchPattern, isMac, buildDir);
+ if (executablePaths.Any())
+ return executablePaths;
+ }
+ }
+
+ // changes in toolbox json files format may brake the logic above, so return all found Rider installations
+ return Directory.GetDirectories(channelDir)
+ .SelectMany(buildDir => GetExecutablePaths(dirName, searchPattern, isMac, buildDir));
+ }
+ catch (Exception e)
+ {
+ // do not write to Debug.Log, just log it.
+ Logger.Warn($"Failed to get RiderPath from {channelDir}", e);
+ }
+
+ return new string[0];
+ })
+ .Where(c => !string.IsNullOrEmpty(c))
+ .ToArray();
+ return paths;
+ }
+
+ private static string[] GetExecutablePaths(string dirName, string searchPattern, bool isMac, string buildDir)
+ {
+ var folder = new DirectoryInfo(Path.Combine(buildDir, dirName));
+ if (!folder.Exists)
+ return new string[0];
+
+ if (!isMac)
+ return new[] { Path.Combine(folder.FullName, searchPattern) }.Where(File.Exists).ToArray();
+ return folder.GetDirectories(searchPattern).Select(f => f.FullName)
+ .Where(Directory.Exists).ToArray();
+ }
+
+ // Disable the "field is never assigned" compiler warning. We never assign it, but Unity does.
+ // Note that Unity disable this warning in the generated C# projects
+#pragma warning disable 0649
+
+ [Serializable]
+ class ToolboxHistory
+ {
+ public List<ItemNode> history;
+
+ public static string GetLatestBuildFromJson(string json)
+ {
+ try
+ {
+ return JsonConvert.DeserializeObject<ToolboxHistory>(json).history.LastOrDefault()?.item.build;
+ }
+ catch (Exception)
+ {
+ Logger.Warn($"Failed to get latest build from json {json}");
+ }
+
+ return null;
+ }
+ }
+
+ [Serializable]
+ class ItemNode
+ {
+ public BuildNode item;
+ }
+
+ [Serializable]
+ class BuildNode
+ {
+ public string build;
+ }
+
+ [Serializable]
+ public class ProductInfo
+ {
+ public string version;
+ public string versionSuffix;
+
+ [CanBeNull]
+ internal static ProductInfo GetProductInfo(string json)
+ {
+ try
+ {
+ var productInfo = JsonConvert.DeserializeObject<ProductInfo>(json);
+ return productInfo;
+ }
+ catch (Exception)
+ {
+ Logger.Warn($"Failed to get version from json {json}");
+ }
+
+ return null;
+ }
+ }
+
+ // ReSharper disable once ClassNeverInstantiated.Global
+ [Serializable]
+ class ToolboxInstallData
+ {
+ // ReSharper disable once InconsistentNaming
+ public ActiveApplication active_application;
+
+ [CanBeNull]
+ public static string GetLatestBuildFromJson(string json)
+ {
+ try
+ {
+ var toolbox = JsonConvert.DeserializeObject<ToolboxInstallData>(json);
+ var builds = toolbox.active_application.builds;
+ if (builds != null && builds.Any())
+ return builds.First();
+ }
+ catch (Exception)
+ {
+ Logger.Warn($"Failed to get latest build from json {json}");
+ }
+
+ return null;
+ }
+ }
+
+ [Serializable]
+ class ActiveApplication
+ {
+ // ReSharper disable once InconsistentNaming
+ public List<string> builds;
+ }
+
+#pragma warning restore 0649
+
+ public struct RiderInfo
+ {
+ public bool IsToolbox;
+ public string Presentation;
+ public Version BuildNumber;
+ public ProductInfo ProductInfo;
+ public string Path;
+
+ public RiderInfo(string path, bool isToolbox)
+ {
+ BuildNumber = GetBuildNumber(path);
+ ProductInfo = GetBuildVersion(path);
+ Path = new FileInfo(path).FullName; // normalize separators
+ var presentation = $"Rider {BuildNumber}";
+
+ if (ProductInfo != null && !string.IsNullOrEmpty(ProductInfo.version))
+ {
+ var suffix = string.IsNullOrEmpty(ProductInfo.versionSuffix) ? "" : $" {ProductInfo.versionSuffix}";
+ presentation = $"Rider {ProductInfo.version}{suffix}";
+ }
+
+ if (isToolbox)
+ presentation += " (JetBrains Toolbox)";
+
+ Presentation = presentation;
+ IsToolbox = isToolbox;
+ }
+ }
+
+ private static class Logger
+ {
+ internal static void Warn(string message, Exception e = null)
+ {
+ throw new Exception(message, e);
+ }
+ }
+ }
+}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs
new file mode 100644
index 0000000000..558a242bf9
--- /dev/null
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Godot;
+using GodotTools.Internals;
+
+namespace GodotTools.Ides.Rider
+{
+ public static class RiderPathManager
+ {
+ private static readonly string editorPathSettingName = "mono/editor/editor_path_optional";
+
+ private static string GetRiderPathFromSettings()
+ {
+ var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
+ if (editorSettings.HasSetting(editorPathSettingName))
+ return (string)editorSettings.GetSetting(editorPathSettingName);
+ return null;
+ }
+
+ public static void Initialize()
+ {
+ var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
+ var editor = (ExternalEditorId)editorSettings.GetSetting("mono/editor/external_editor");
+ if (editor == ExternalEditorId.Rider)
+ {
+ if (!editorSettings.HasSetting(editorPathSettingName))
+ {
+ Globals.EditorDef(editorPathSettingName, "Optional");
+ editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary
+ {
+ ["type"] = Variant.Type.String,
+ ["name"] = editorPathSettingName,
+ ["hint"] = PropertyHint.File,
+ ["hint_string"] = ""
+ });
+ }
+
+ var riderPath = (string)editorSettings.GetSetting(editorPathSettingName);
+ if (IsRiderAndExists(riderPath))
+ {
+ Globals.EditorDef(editorPathSettingName, riderPath);
+ return;
+ }
+
+ var paths = RiderPathLocator.GetAllRiderPaths();
+
+ if (!paths.Any())
+ return;
+
+ var newPath = paths.Last().Path;
+ Globals.EditorDef(editorPathSettingName, newPath);
+ editorSettings.SetSetting(editorPathSettingName, newPath);
+ }
+ }
+
+ private static bool IsRider(string path)
+ {
+ if (string.IsNullOrEmpty(path))
+ {
+ return false;
+ }
+
+ var fileInfo = new FileInfo(path);
+ var filename = fileInfo.Name.ToLowerInvariant();
+ return filename.StartsWith("rider", StringComparison.Ordinal);
+ }
+
+ private static string CheckAndUpdatePath(string riderPath)
+ {
+ if (IsRiderAndExists(riderPath))
+ {
+ return riderPath;
+ }
+
+ var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
+ var paths = RiderPathLocator.GetAllRiderPaths();
+
+ if (!paths.Any())
+ return null;
+
+ var newPath = paths.Last().Path;
+ editorSettings.SetSetting(editorPathSettingName, newPath);
+ Globals.EditorDef(editorPathSettingName, newPath);
+ return newPath;
+ }
+
+ private static bool IsRiderAndExists(string riderPath)
+ {
+ return !string.IsNullOrEmpty(riderPath) && IsRider(riderPath) && new FileInfo(riderPath).Exists;
+ }
+
+ public static void OpenFile(string slnPath, string scriptPath, int line)
+ {
+ var pathFromSettings = GetRiderPathFromSettings();
+ var path = CheckAndUpdatePath(pathFromSettings);
+
+ var args = new List<string>();
+ args.Add(slnPath);
+ if (line >= 0)
+ {
+ args.Add("--line");
+ args.Add(line.ToString());
+ }
+ args.Add(scriptPath);
+ try
+ {
+ Utils.OS.RunProcess(path, args);
+ }
+ catch (Exception e)
+ {
+ GD.PushError($"Error when trying to run code editor: JetBrains Rider. Exception message: '{e.Message}'");
+ }
+ }
+ }
+}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/GodotSharpDirs.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/GodotSharpDirs.cs
index ddf3b829b5..6893bc1974 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Internals/GodotSharpDirs.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Internals/GodotSharpDirs.cs
@@ -33,10 +33,10 @@ namespace GodotTools.Internals
#region Windows-only
public static string DataMonoBinDir => internal_DataMonoBinDir();
#endregion
-
-
+
+
#region Internal
-
+
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern string internal_ResDataDir();
[MethodImpl(MethodImplOptions.InternalCall)]
@@ -85,7 +85,7 @@ namespace GodotTools.Internals
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern string internal_DataMonoBinDir();
#endregion
-
+
#endregion
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
index 2497d276a9..80e45b3a3c 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
@@ -39,10 +39,10 @@ namespace GodotTools.Internals
foreach (var classDeclDict in classesArray)
{
classesList.Add(new ClassDecl(
- (string) classDeclDict["name"],
- (string) classDeclDict["namespace"],
- (bool) classDeclDict["nested"],
- (int) classDeclDict["base_count"]
+ (string)classDeclDict["name"],
+ (string)classDeclDict["namespace"],
+ (bool)classDeclDict["nested"],
+ (int)classDeclDict["base_count"]
));
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs
index 1a8c26acd7..5a867b7f8b 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs
@@ -65,7 +65,7 @@ namespace GodotTools.Utils
private static readonly Lazy<bool> _isAndroid = new Lazy<bool>(() => IsOS(Names.Android));
private static readonly Lazy<bool> _isHTML5 = new Lazy<bool>(() => IsOS(Names.HTML5));
- public static bool IsWindows => _isWindows.Value;
+ public static bool IsWindows => _isWindows.Value || IsUWP;
public static bool IsOSX => _isOSX.Value;
public static bool IsX11 => _isX11.Value;
public static bool IsServer => _isServer.Value;
@@ -75,7 +75,7 @@ namespace GodotTools.Utils
public static bool IsHTML5 => _isHTML5.Value;
private static bool? _isUnixCache;
- private static readonly string[] UnixLikePlatforms = {Names.OSX, Names.X11, Names.Server, Names.Haiku, Names.Android};
+ private static readonly string[] UnixLikePlatforms = { Names.OSX, Names.X11, Names.Server, Names.Haiku, Names.Android };
public static bool IsUnixLike()
{
@@ -113,10 +113,10 @@ namespace GodotTools.Utils
return searchDirs.Select(dir => Path.Combine(dir, name)).FirstOrDefault(File.Exists);
return (from dir in searchDirs
- select Path.Combine(dir, name)
+ select Path.Combine(dir, name)
into path
- from ext in windowsExts
- select path + ext).FirstOrDefault(File.Exists);
+ from ext in windowsExts
+ select path + ext).FirstOrDefault(File.Exists);
}
private static string PathWhichUnix(string name)
@@ -157,6 +157,8 @@ namespace GodotTools.Utils
process.BeginOutputReadLine();
process.BeginErrorReadLine();
+ if (IsWindows && process.Id > 0)
+ User32Dll.AllowSetForegroundWindow(process.Id); // allows application to focus itself
}
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/User32Dll.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/User32Dll.cs
new file mode 100644
index 0000000000..6810a991b3
--- /dev/null
+++ b/modules/mono/editor/GodotTools/GodotTools/Utils/User32Dll.cs
@@ -0,0 +1,10 @@
+using System.Runtime.InteropServices;
+
+namespace GodotTools.Utils
+{
+ public static class User32Dll
+ {
+ [DllImport("user32.dll")]
+ public static extern bool AllowSetForegroundWindow(int dwProcessId);
+ }
+}
diff --git a/modules/mono/editor/GodotTools/GodotTools/packages.config b/modules/mono/editor/GodotTools/GodotTools/packages.config
new file mode 100644
index 0000000000..dd3de2865a
--- /dev/null
+++ b/modules/mono/editor/GodotTools/GodotTools/packages.config
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="JetBrains.Annotations" version="2019.1.3" targetFramework="net45" />
+ <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
+</packages>
diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp
index 4055ec005a..443b4ba841 100644
--- a/modules/mono/editor/editor_internal_calls.cpp
+++ b/modules/mono/editor/editor_internal_calls.cpp
@@ -219,15 +219,14 @@ int32_t godot_icall_ScriptClassParser_ParseFile(MonoString *p_filepath, MonoObje
return err;
}
-uint32_t godot_icall_ExportPlugin_GetExportedAssemblyDependencies(MonoString *p_project_dll_name, MonoString *p_project_dll_src_path,
+uint32_t godot_icall_ExportPlugin_GetExportedAssemblyDependencies(MonoObject *p_initial_dependencies,
MonoString *p_build_config, MonoString *p_custom_bcl_dir, MonoObject *r_dependencies) {
- String project_dll_name = GDMonoMarshal::mono_string_to_godot(p_project_dll_name);
- String project_dll_src_path = GDMonoMarshal::mono_string_to_godot(p_project_dll_src_path);
+ Dictionary initial_dependencies = GDMonoMarshal::mono_object_to_variant(p_initial_dependencies);
String build_config = GDMonoMarshal::mono_string_to_godot(p_build_config);
String custom_bcl_dir = GDMonoMarshal::mono_string_to_godot(p_custom_bcl_dir);
Dictionary dependencies = GDMonoMarshal::mono_object_to_variant(r_dependencies);
- return GodotSharpExport::get_exported_assembly_dependencies(project_dll_name, project_dll_src_path, build_config, custom_bcl_dir, dependencies);
+ return GodotSharpExport::get_exported_assembly_dependencies(initial_dependencies, build_config, custom_bcl_dir, dependencies);
}
MonoString *godot_icall_Internal_UpdateApiAssembliesFromPrebuilt(MonoString *p_config) {
diff --git a/modules/mono/editor/godotsharp_export.cpp b/modules/mono/editor/godotsharp_export.cpp
index 9ae9399e1d..e02bd3be58 100644
--- a/modules/mono/editor/godotsharp_export.cpp
+++ b/modules/mono/editor/godotsharp_export.cpp
@@ -101,23 +101,32 @@ Error get_assembly_dependencies(GDMonoAssembly *p_assembly, const Vector<String>
return OK;
}
-Error get_exported_assembly_dependencies(const String &p_project_dll_name, const String &p_project_dll_src_path, const String &p_build_config, const String &p_custom_bcl_dir, Dictionary &r_dependencies) {
+Error get_exported_assembly_dependencies(const Dictionary &p_initial_dependencies,
+ const String &p_build_config, const String &p_custom_bcl_dir, Dictionary &r_dependencies) {
MonoDomain *export_domain = GDMonoUtils::create_domain("GodotEngine.Domain.ProjectExport");
ERR_FAIL_NULL_V(export_domain, FAILED);
_GDMONO_SCOPE_EXIT_DOMAIN_UNLOAD_(export_domain);
_GDMONO_SCOPE_DOMAIN_(export_domain);
- GDMonoAssembly *scripts_assembly = NULL;
- bool load_success = GDMono::get_singleton()->load_assembly_from(p_project_dll_name,
- p_project_dll_src_path, &scripts_assembly, /* refonly: */ true);
-
- ERR_FAIL_COND_V_MSG(!load_success, ERR_CANT_RESOLVE, "Cannot load assembly (refonly): '" + p_project_dll_name + "'.");
-
Vector<String> search_dirs;
GDMonoAssembly::fill_search_dirs(search_dirs, p_build_config, p_custom_bcl_dir);
- return get_assembly_dependencies(scripts_assembly, search_dirs, r_dependencies);
+ for (const Variant *key = p_initial_dependencies.next(); key; key = p_initial_dependencies.next(key)) {
+ String assembly_name = *key;
+ String assembly_path = p_initial_dependencies[*key];
+
+ GDMonoAssembly *assembly = NULL;
+ bool load_success = GDMono::get_singleton()->load_assembly_from(assembly_name, assembly_path, &assembly, /* refonly: */ true);
+
+ ERR_FAIL_COND_V_MSG(!load_success, ERR_CANT_RESOLVE, "Cannot load assembly (refonly): '" + assembly_name + "'.");
+
+ Error err = get_assembly_dependencies(assembly, search_dirs, r_dependencies);
+ if (err != OK)
+ return err;
+ }
+
+ return OK;
}
} // namespace GodotSharpExport
diff --git a/modules/mono/editor/godotsharp_export.h b/modules/mono/editor/godotsharp_export.h
index 58e46e2f2d..8eb5a4d9dc 100644
--- a/modules/mono/editor/godotsharp_export.h
+++ b/modules/mono/editor/godotsharp_export.h
@@ -41,9 +41,8 @@ namespace GodotSharpExport {
Error get_assembly_dependencies(GDMonoAssembly *p_assembly, const Vector<String> &p_search_dirs, Dictionary &r_dependencies);
-Error get_exported_assembly_dependencies(const String &p_project_dll_name,
- const String &p_project_dll_src_path, const String &p_build_config,
- const String &p_custom_lib_dir, Dictionary &r_dependencies);
+Error get_exported_assembly_dependencies(const Dictionary &p_initial_dependencies,
+ const String &p_build_config, const String &p_custom_lib_dir, Dictionary &r_dependencies);
} // namespace GodotSharpExport
diff --git a/modules/mono/glue/Managed/Files/Array.cs b/modules/mono/glue/Managed/Files/Array.cs
index 0e7b0362e0..aba1065498 100644
--- a/modules/mono/glue/Managed/Files/Array.cs
+++ b/modules/mono/glue/Managed/Files/Array.cs
@@ -64,6 +64,11 @@ namespace Godot.Collections
return safeHandle.DangerousGetHandle();
}
+ public Array Duplicate(bool deep = false)
+ {
+ return new Array(godot_icall_Array_Duplicate(GetPtr(), deep));
+ }
+
public Error Resize(int newSize)
{
return godot_icall_Array_Resize(GetPtr(), newSize);
@@ -179,6 +184,9 @@ namespace Godot.Collections
internal extern static void godot_icall_Array_CopyTo(IntPtr ptr, System.Array array, int arrayIndex);
[MethodImpl(MethodImplOptions.InternalCall)]
+ internal extern static IntPtr godot_icall_Array_Duplicate(IntPtr ptr, bool deep);
+
+ [MethodImpl(MethodImplOptions.InternalCall)]
internal extern static int godot_icall_Array_IndexOf(IntPtr ptr, object item);
[MethodImpl(MethodImplOptions.InternalCall)]
@@ -250,6 +258,11 @@ namespace Godot.Collections
return from.objectArray;
}
+ public Array<T> Duplicate(bool deep = false)
+ {
+ return new Array<T>(objectArray.Duplicate(deep));
+ }
+
public Error Resize(int newSize)
{
return objectArray.Resize(newSize);
diff --git a/modules/mono/glue/Managed/Files/Dictionary.cs b/modules/mono/glue/Managed/Files/Dictionary.cs
index 6ab8549a01..d72109de92 100644
--- a/modules/mono/glue/Managed/Files/Dictionary.cs
+++ b/modules/mono/glue/Managed/Files/Dictionary.cs
@@ -80,6 +80,11 @@ namespace Godot.Collections
disposed = true;
}
+ public Dictionary Duplicate(bool deep = false)
+ {
+ return new Dictionary(godot_icall_Dictionary_Duplicate(GetPtr(), deep));
+ }
+
// IDictionary
public ICollection Keys
@@ -235,6 +240,9 @@ namespace Godot.Collections
internal extern static bool godot_icall_Dictionary_ContainsKey(IntPtr ptr, object key);
[MethodImpl(MethodImplOptions.InternalCall)]
+ internal extern static IntPtr godot_icall_Dictionary_Duplicate(IntPtr ptr, bool deep);
+
+ [MethodImpl(MethodImplOptions.InternalCall)]
internal extern static bool godot_icall_Dictionary_RemoveKey(IntPtr ptr, object key);
[MethodImpl(MethodImplOptions.InternalCall)]
@@ -313,6 +321,11 @@ namespace Godot.Collections
return objectDict.GetPtr();
}
+ public Dictionary<TKey, TValue> Duplicate(bool deep = false)
+ {
+ return new Dictionary<TKey, TValue>(objectDict.Duplicate(deep));
+ }
+
// IDictionary<TKey, TValue>
public TValue this[TKey key]
diff --git a/modules/mono/glue/Managed/Files/GD.cs b/modules/mono/glue/Managed/Files/GD.cs
index 2068099ac6..19962d418a 100644
--- a/modules/mono/glue/Managed/Files/GD.cs
+++ b/modules/mono/glue/Managed/Files/GD.cs
@@ -93,22 +93,22 @@ namespace Godot
public static void PrintErr(params object[] what)
{
- godot_icall_GD_printerr(Array.ConvertAll(what, x => x.ToString()));
+ godot_icall_GD_printerr(Array.ConvertAll(what, x => x?.ToString()));
}
public static void PrintRaw(params object[] what)
{
- godot_icall_GD_printraw(Array.ConvertAll(what, x => x.ToString()));
+ godot_icall_GD_printraw(Array.ConvertAll(what, x => x?.ToString()));
}
public static void PrintS(params object[] what)
{
- godot_icall_GD_prints(Array.ConvertAll(what, x => x.ToString()));
+ godot_icall_GD_prints(Array.ConvertAll(what, x => x?.ToString()));
}
public static void PrintT(params object[] what)
{
- godot_icall_GD_printt(Array.ConvertAll(what, x => x.ToString()));
+ godot_icall_GD_printt(Array.ConvertAll(what, x => x?.ToString()));
}
public static float Randf()
diff --git a/modules/mono/glue/Managed/Files/StringExtensions.cs b/modules/mono/glue/Managed/Files/StringExtensions.cs
index 6045c83e95..079e9912d6 100644
--- a/modules/mono/glue/Managed/Files/StringExtensions.cs
+++ b/modules/mono/glue/Managed/Files/StringExtensions.cs
@@ -18,7 +18,7 @@ namespace Godot
int pos = 0;
int slices = 1;
- while ((pos = instance.Find(splitter, pos)) >= 0)
+ while ((pos = instance.Find(splitter, true, pos)) >= 0)
{
slices++;
pos += splitter.Length;
@@ -325,17 +325,17 @@ namespace Godot
// <summary>
// Find the first occurrence of a substring, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
// </summary>
- public static int Find(this string instance, string what, int from = 0)
+ public static int Find(this string instance, string what, bool caseSensitive = true, int from = 0)
{
- return instance.IndexOf(what, StringComparison.OrdinalIgnoreCase);
+ return instance.IndexOf(what, from, caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase);
}
// <summary>
// Find the last occurrence of a substring, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
// </summary>
- public static int FindLast(this string instance, string what)
+ public static int FindLast(this string instance, string what, bool caseSensitive = true, int from = 0)
{
- return instance.LastIndexOf(what, StringComparison.OrdinalIgnoreCase);
+ return instance.LastIndexOf(what, from, caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase);
}
// <summary>
@@ -343,7 +343,7 @@ namespace Godot
// </summary>
public static int FindN(this string instance, string what, int from = 0)
{
- return instance.IndexOf(what, StringComparison.Ordinal);
+ return instance.IndexOf(what, from, StringComparison.OrdinalIgnoreCase);
}
// <summary>
@@ -928,7 +928,7 @@ namespace Godot
while (true)
{
- int end = instance.Find(divisor, from);
+ int end = instance.Find(divisor, true, from);
if (end < 0)
end = len;
if (allowEmpty || end > from)
diff --git a/modules/mono/glue/Managed/Managed.csproj b/modules/mono/glue/Managed/Managed.csproj
index c8eca71199..8bde3b6d22 100644
--- a/modules/mono/glue/Managed/Managed.csproj
+++ b/modules/mono/glue/Managed/Managed.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
diff --git a/modules/mono/glue/collections_glue.cpp b/modules/mono/glue/collections_glue.cpp
index bfb7b0f775..e84a5becd6 100644
--- a/modules/mono/glue/collections_glue.cpp
+++ b/modules/mono/glue/collections_glue.cpp
@@ -103,6 +103,10 @@ void godot_icall_Array_CopyTo(Array *ptr, MonoArray *array, int array_index) {
}
}
+Array *godot_icall_Array_Duplicate(Array *ptr, MonoBoolean deep) {
+ return memnew(Array(ptr->duplicate(deep)));
+}
+
int godot_icall_Array_IndexOf(Array *ptr, MonoObject *item) {
return ptr->find(GDMonoMarshal::mono_object_to_variant(item));
}
@@ -224,6 +228,10 @@ MonoBoolean godot_icall_Dictionary_ContainsKey(Dictionary *ptr, MonoObject *key)
return ptr->has(GDMonoMarshal::mono_object_to_variant(key));
}
+Dictionary *godot_icall_Dictionary_Duplicate(Dictionary *ptr, MonoBoolean deep) {
+ return memnew(Dictionary(ptr->duplicate(deep)));
+}
+
MonoBoolean godot_icall_Dictionary_RemoveKey(Dictionary *ptr, MonoObject *key) {
return ptr->erase(GDMonoMarshal::mono_object_to_variant(key));
}
@@ -284,6 +292,7 @@ void godot_register_collections_icalls() {
mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Clear", (void *)godot_icall_Array_Clear);
mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Contains", (void *)godot_icall_Array_Contains);
mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_CopyTo", (void *)godot_icall_Array_CopyTo);
+ mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Duplicate", (void *)godot_icall_Array_Duplicate);
mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_IndexOf", (void *)godot_icall_Array_IndexOf);
mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Insert", (void *)godot_icall_Array_Insert);
mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Remove", (void *)godot_icall_Array_Remove);
@@ -304,6 +313,7 @@ void godot_register_collections_icalls() {
mono_add_internal_call("Godot.Collections.Dictionary::godot_icall_Dictionary_Clear", (void *)godot_icall_Dictionary_Clear);
mono_add_internal_call("Godot.Collections.Dictionary::godot_icall_Dictionary_Contains", (void *)godot_icall_Dictionary_Contains);
mono_add_internal_call("Godot.Collections.Dictionary::godot_icall_Dictionary_ContainsKey", (void *)godot_icall_Dictionary_ContainsKey);
+ mono_add_internal_call("Godot.Collections.Dictionary::godot_icall_Dictionary_Duplicate", (void *)godot_icall_Dictionary_Duplicate);
mono_add_internal_call("Godot.Collections.Dictionary::godot_icall_Dictionary_RemoveKey", (void *)godot_icall_Dictionary_RemoveKey);
mono_add_internal_call("Godot.Collections.Dictionary::godot_icall_Dictionary_Remove", (void *)godot_icall_Dictionary_Remove);
mono_add_internal_call("Godot.Collections.Dictionary::godot_icall_Dictionary_TryGetValue", (void *)godot_icall_Dictionary_TryGetValue);
diff --git a/modules/mono/glue/collections_glue.h b/modules/mono/glue/collections_glue.h
index 54ed42c3b6..a79a651fcd 100644
--- a/modules/mono/glue/collections_glue.h
+++ b/modules/mono/glue/collections_glue.h
@@ -59,6 +59,8 @@ MonoBoolean godot_icall_Array_Contains(Array *ptr, MonoObject *item);
void godot_icall_Array_CopyTo(Array *ptr, MonoArray *array, int array_index);
+Array *godot_icall_Array_Duplicate(Array *ptr, MonoBoolean deep);
+
int godot_icall_Array_IndexOf(Array *ptr, MonoObject *item);
void godot_icall_Array_Insert(Array *ptr, int index, MonoObject *item);
@@ -99,6 +101,8 @@ MonoBoolean godot_icall_Dictionary_Contains(Dictionary *ptr, MonoObject *key, Mo
MonoBoolean godot_icall_Dictionary_ContainsKey(Dictionary *ptr, MonoObject *key);
+Dictionary *godot_icall_Dictionary_Duplicate(Dictionary *ptr, MonoBoolean deep);
+
MonoBoolean godot_icall_Dictionary_RemoveKey(Dictionary *ptr, MonoObject *key);
MonoBoolean godot_icall_Dictionary_Remove(Dictionary *ptr, MonoObject *key, MonoObject *value);
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp
index a43311d281..33ba877352 100644
--- a/modules/mono/mono_gd/gd_mono.cpp
+++ b/modules/mono/mono_gd/gd_mono.cpp
@@ -330,7 +330,7 @@ void GDMono::initialize() {
#endif
#if defined(ANDROID_ENABLED)
- GDMonoAndroid::register_android_dl_fallback();
+ GDMonoAndroid::initialize();
#endif
GDMonoAssembly::initialize();
@@ -363,6 +363,9 @@ void GDMono::initialize() {
}
#endif
+ // NOTE: Internal calls must be registered after the Mono runtime initialization.
+ // Otherwise registration fails with the error: 'assertion 'hash != NULL' failed'.
+
root_domain = gd_initialize_mono_runtime();
ERR_FAIL_NULL_MSG(root_domain, "Mono: Failed to initialize runtime.");
@@ -376,6 +379,10 @@ void GDMono::initialize() {
print_verbose("Mono: Runtime initialized");
+#if defined(ANDROID_ENABLED)
+ GDMonoAndroid::register_internal_calls();
+#endif
+
// mscorlib assembly MUST be present at initialization
bool corlib_loaded = _load_corlib_assembly();
ERR_FAIL_COND_MSG(!corlib_loaded, "Mono: Failed to load mscorlib assembly.");
@@ -1253,6 +1260,10 @@ GDMono::~GDMono() {
mono_jit_cleanup(root_domain);
+#if defined(ANDROID_ENABLED)
+ GDMonoAndroid::cleanup();
+#endif
+
print_verbose("Mono: Finalized");
runtime_initialized = false;
diff --git a/modules/mono/mono_gd/gd_mono_android.cpp b/modules/mono/mono_gd/gd_mono_android.cpp
index 1ee035589d..86af8d1812 100644
--- a/modules/mono/mono_gd/gd_mono_android.cpp
+++ b/modules/mono/mono_gd/gd_mono_android.cpp
@@ -34,38 +34,97 @@
#include <dlfcn.h> // dlopen, dlsym
#include <mono/utils/mono-dl-fallback.h>
+#include <sys/system_properties.h>
+#include <cstddef>
+
+#if __ANDROID_API__ < 24
+#include "thirdparty/misc/ifaddrs-android.h"
+#else
+#include <ifaddrs.h>
+#endif
#include "core/os/os.h"
#include "core/ustring.h"
+#include "platform/android/java_godot_wrapper.h"
+#include "platform/android/os_android.h"
#include "platform/android/thread_jandroid.h"
#include "../utils/path_utils.h"
#include "../utils/string_utils.h"
+#include "gd_mono_cache.h"
+#include "gd_mono_marshal.h"
+
+// Warning: JNI boilerplate ahead... continue at your own risk
namespace GDMonoAndroid {
+template <typename T>
+struct ScopedLocalRef {
+ JNIEnv *env;
+ T local_ref;
+
+ _FORCE_INLINE_ T get() const { return local_ref; }
+ _FORCE_INLINE_ operator T() const { return local_ref; }
+ _FORCE_INLINE_ operator jvalue() const { return (jvalue)local_ref; }
+
+ _FORCE_INLINE_ operator bool() const { return local_ref != NULL; }
+
+ _FORCE_INLINE_ bool operator==(std::nullptr_t) const {
+ return local_ref == nullptr;
+ }
+
+ _FORCE_INLINE_ bool operator!=(std::nullptr_t) const {
+ return local_ref != nullptr;
+ }
+
+ ScopedLocalRef(const ScopedLocalRef &) = delete;
+ ScopedLocalRef &operator=(const ScopedLocalRef &) = delete;
+
+ ScopedLocalRef(JNIEnv *p_env, T p_local_ref) :
+ env(p_env), local_ref(p_local_ref) {
+ }
+
+ ~ScopedLocalRef() {
+ if (local_ref) {
+ env->DeleteLocalRef(local_ref);
+ }
+ }
+};
+
+bool jni_exception_check(JNIEnv *p_env) {
+ if (p_env->ExceptionCheck()) {
+ // Print the exception to logcat
+ p_env->ExceptionDescribe();
+
+ p_env->ExceptionClear();
+ return true;
+ }
+
+ return false;
+}
+
String app_native_lib_dir_cache;
String determine_app_native_lib_dir() {
JNIEnv *env = ThreadAndroid::get_env();
- jclass activityThreadClass = env->FindClass("android/app/ActivityThread");
+ ScopedLocalRef<jclass> activityThreadClass(env, env->FindClass("android/app/ActivityThread"));
jmethodID currentActivityThread = env->GetStaticMethodID(activityThreadClass, "currentActivityThread", "()Landroid/app/ActivityThread;");
- jobject activityThread = env->CallStaticObjectMethod(activityThreadClass, currentActivityThread);
+ ScopedLocalRef<jobject> activityThread(env, env->CallStaticObjectMethod(activityThreadClass, currentActivityThread));
jmethodID getApplication = env->GetMethodID(activityThreadClass, "getApplication", "()Landroid/app/Application;");
- jobject ctx = env->CallObjectMethod(activityThread, getApplication);
+ ScopedLocalRef<jobject> ctx(env, env->CallObjectMethod(activityThread, getApplication));
jmethodID getApplicationInfo = env->GetMethodID(env->GetObjectClass(ctx), "getApplicationInfo", "()Landroid/content/pm/ApplicationInfo;");
- jobject applicationInfo = env->CallObjectMethod(ctx, getApplicationInfo);
+ ScopedLocalRef<jobject> applicationInfo(env, env->CallObjectMethod(ctx, getApplicationInfo));
jfieldID nativeLibraryDirField = env->GetFieldID(env->GetObjectClass(applicationInfo), "nativeLibraryDir", "Ljava/lang/String;");
- jstring nativeLibraryDir = (jstring)env->GetObjectField(applicationInfo, nativeLibraryDirField);
+ ScopedLocalRef<jstring> nativeLibraryDir(env, (jstring)env->GetObjectField(applicationInfo, nativeLibraryDirField));
String result;
- const char *const nativeLibraryDir_utf8 = env->GetStringUTFChars(nativeLibraryDir, NULL);
- if (nativeLibraryDir_utf8) {
- result.parse_utf8(nativeLibraryDir_utf8);
- env->ReleaseStringUTFChars(nativeLibraryDir, nativeLibraryDir_utf8);
+ const char *const nativeLibraryDirUtf8 = env->GetStringUTFChars(nativeLibraryDir, NULL);
+ if (nativeLibraryDirUtf8) {
+ result.parse_utf8(nativeLibraryDirUtf8);
+ env->ReleaseStringUTFChars(nativeLibraryDir, nativeLibraryDirUtf8);
}
return result;
@@ -90,7 +149,53 @@ int gd_mono_convert_dl_flags(int flags) {
return lflags;
}
+#ifndef GD_MONO_ANDROID_SO_NAME
+#define GD_MONO_ANDROID_SO_NAME "libmonosgen-2.0.so"
+#endif
+
+const char *mono_so_name = GD_MONO_ANDROID_SO_NAME;
+const char *godot_so_name = "libgodot_android.so";
+
+void *mono_dl_handle = NULL;
+void *godot_dl_handle = NULL;
+
+void *try_dlopen(const String &p_so_path, int p_flags) {
+ if (!FileAccess::exists(p_so_path)) {
+ if (OS::get_singleton()->is_stdout_verbose())
+ OS::get_singleton()->print("Cannot find shared library: '%s'\n", p_so_path.utf8().get_data());
+ return NULL;
+ }
+
+ int lflags = gd_mono_convert_dl_flags(p_flags);
+
+ void *handle = dlopen(p_so_path.utf8().get_data(), lflags);
+
+ if (!handle) {
+ if (OS::get_singleton()->is_stdout_verbose())
+ OS::get_singleton()->print("Failed to open shared library: '%s'. Error: '%s'\n", p_so_path.utf8().get_data(), dlerror());
+ return NULL;
+ }
+
+ if (OS::get_singleton()->is_stdout_verbose())
+ OS::get_singleton()->print("Successfully loaded shared library: '%s'\n", p_so_path.utf8().get_data());
+
+ return handle;
+}
+
void *gd_mono_android_dlopen(const char *p_name, int p_flags, char **r_err, void *p_user_data) {
+ if (p_name == NULL) {
+ // __Internal
+
+ if (!mono_dl_handle) {
+ String app_native_lib_dir = get_app_native_lib_dir();
+ String so_path = path::join(app_native_lib_dir, mono_so_name);
+
+ mono_dl_handle = try_dlopen(so_path, p_flags);
+ }
+
+ return mono_dl_handle;
+ }
+
String name = String::utf8(p_name);
if (name.ends_with(".dll.so") || name.ends_with(".exe.so")) {
@@ -100,26 +205,7 @@ void *gd_mono_android_dlopen(const char *p_name, int p_flags, char **r_err, void
String so_name = "lib-aot-" + orig_so_name;
String so_path = path::join(app_native_lib_dir, so_name);
- if (!FileAccess::exists(so_path)) {
- if (OS::get_singleton()->is_stdout_verbose())
- OS::get_singleton()->print("Cannot find shared library: '%s'\n", so_path.utf8().get_data());
- return NULL;
- }
-
- int lflags = gd_mono_convert_dl_flags(p_flags);
-
- void *handle = dlopen(so_path.utf8().get_data(), lflags);
-
- if (!handle) {
- if (OS::get_singleton()->is_stdout_verbose())
- OS::get_singleton()->print("Failed to open shared library: '%s'. Error: '%s'\n", so_path.utf8().get_data(), dlerror());
- return NULL;
- }
-
- if (OS::get_singleton()->is_stdout_verbose())
- OS::get_singleton()->print("Successfully loaded AOT shared library: '%s'\n", so_path.utf8().get_data());
-
- return handle;
+ return try_dlopen(so_path, p_flags);
}
return NULL;
@@ -131,16 +217,469 @@ void *gd_mono_android_dlsym(void *p_handle, const char *p_name, char **r_err, vo
if (sym_addr)
return sym_addr;
+ if (p_handle == mono_dl_handle && godot_dl_handle) {
+ // Looking up for '__Internal' P/Invoke. We want to search in both the Mono and Godot shared libraries.
+ // This is needed to resolve the monodroid P/Invoke functions that are defined at the bottom of the file.
+ sym_addr = dlsym(godot_dl_handle, p_name);
+
+ if (sym_addr)
+ return sym_addr;
+ }
+
if (r_err)
*r_err = str_format_new("%s\n", dlerror());
return NULL;
}
-void register_android_dl_fallback() {
- mono_dl_fallback_register(gd_mono_android_dlopen, gd_mono_android_dlsym, NULL, NULL);
+void *gd_mono_android_dlclose(void *p_handle, void *p_user_data) {
+ dlclose(p_handle);
+
+ // Not sure if this ever happens. Does Mono close the handle for the main module?
+ if (p_handle == mono_dl_handle)
+ mono_dl_handle = NULL;
+
+ return NULL;
+}
+
+int32_t build_version_sdk_int = 0;
+
+int32_t get_build_version_sdk_int() {
+ // The JNI code is the equivalent of:
+ //
+ // android.os.Build.VERSION.SDK_INT
+
+ if (build_version_sdk_int == 0) {
+ JNIEnv *env = ThreadAndroid::get_env();
+
+ jclass versionClass = env->FindClass("android/os/Build$VERSION");
+ ERR_FAIL_NULL_V(versionClass, 0);
+
+ jfieldID sdkIntField = env->GetStaticFieldID(versionClass, "SDK_INT", "I");
+ ERR_FAIL_NULL_V(sdkIntField, 0);
+
+ build_version_sdk_int = (int32_t)env->GetStaticIntField(versionClass, sdkIntField);
+ }
+
+ return build_version_sdk_int;
+}
+
+jobject certStore = NULL; // KeyStore
+
+MonoBoolean _gd_mono_init_cert_store() {
+ // The JNI code is the equivalent of:
+ //
+ // try {
+ // certStoreLocal = KeyStore.getInstance("AndroidCAStore");
+ // certStoreLocal.load(null);
+ // certStore = certStoreLocal;
+ // return true;
+ // } catch (Exception e) {
+ // return false;
+ // }
+
+ JNIEnv *env = ThreadAndroid::get_env();
+
+ ScopedLocalRef<jclass> keyStoreClass(env, env->FindClass("java/security/KeyStore"));
+
+ jmethodID getInstance = env->GetStaticMethodID(keyStoreClass, "getInstance", "(Ljava/lang/String;)Ljava/security/KeyStore;");
+ jmethodID load = env->GetMethodID(keyStoreClass, "load", "(Ljava/security/KeyStore$LoadStoreParameter;)V");
+
+ ScopedLocalRef<jstring> androidCAStoreString(env, env->NewStringUTF("AndroidCAStore"));
+
+ ScopedLocalRef<jobject> certStoreLocal(env, env->CallStaticObjectMethod(keyStoreClass, getInstance, androidCAStoreString.get()));
+
+ if (jni_exception_check(env))
+ return 0;
+
+ env->CallVoidMethod(certStoreLocal, load, NULL);
+
+ if (jni_exception_check(env))
+ return 0;
+
+ certStore = env->NewGlobalRef(certStoreLocal);
+
+ return 1;
+}
+
+MonoArray *_gd_mono_android_cert_store_lookup(MonoString *p_alias) {
+ // The JNI code is the equivalent of:
+ //
+ // Certificate certificate = certStore.getCertificate(alias);
+ // if (certificate == null)
+ // return null;
+ // return certificate.getEncoded();
+
+ MonoError mono_error;
+ char *alias_utf8 = mono_string_to_utf8_checked(p_alias, &mono_error);
+
+ if (!mono_error_ok(&mono_error)) {
+ ERR_PRINTS(String() + "Failed to convert MonoString* to UTF-8: '" + mono_error_get_message(&mono_error) + "'.");
+ mono_error_cleanup(&mono_error);
+ return NULL;
+ }
+
+ JNIEnv *env = ThreadAndroid::get_env();
+
+ ScopedLocalRef<jstring> js_alias(env, env->NewStringUTF(alias_utf8));
+ mono_free(alias_utf8);
+
+ ScopedLocalRef<jclass> keyStoreClass(env, env->FindClass("java/security/KeyStore"));
+ ERR_FAIL_NULL_V(keyStoreClass, NULL);
+ ScopedLocalRef<jclass> certificateClass(env, env->FindClass("java/security/cert/Certificate"));
+ ERR_FAIL_NULL_V(certificateClass, NULL);
+
+ jmethodID getCertificate = env->GetMethodID(keyStoreClass, "getCertificate", "(Ljava/lang/String;)Ljava/security/cert/Certificate;");
+ ERR_FAIL_NULL_V(getCertificate, NULL);
+
+ jmethodID getEncoded = env->GetMethodID(certificateClass, "getEncoded", "()[B");
+ ERR_FAIL_NULL_V(getEncoded, NULL);
+
+ ScopedLocalRef<jobject> certificate(env, env->CallObjectMethod(certStore, getCertificate, js_alias.get()));
+
+ if (!certificate)
+ return NULL;
+
+ ScopedLocalRef<jbyteArray> encoded(env, (jbyteArray)env->CallObjectMethod(certificate, getEncoded));
+ jsize encodedLength = env->GetArrayLength(encoded);
+
+ MonoArray *encoded_ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(uint8_t), encodedLength);
+ uint8_t *dest = (uint8_t *)mono_array_addr(encoded_ret, uint8_t, 0);
+
+ env->GetByteArrayRegion(encoded, 0, encodedLength, reinterpret_cast<jbyte *>(dest));
+
+ return encoded_ret;
+}
+
+void initialize() {
+ // We need to set this environment variable to make the monodroid BCL use btls instead of legacy as the default provider
+ OS::get_singleton()->set_environment("XA_TLS_PROVIDER", "btls");
+
+ mono_dl_fallback_register(gd_mono_android_dlopen, gd_mono_android_dlsym, gd_mono_android_dlclose, NULL);
+
+ String app_native_lib_dir = get_app_native_lib_dir();
+ String so_path = path::join(app_native_lib_dir, godot_so_name);
+
+ godot_dl_handle = try_dlopen(so_path, gd_mono_convert_dl_flags(MONO_DL_LAZY));
+}
+
+void register_internal_calls() {
+ mono_add_internal_call("Android.Runtime.AndroidEnvironment::_gd_mono_init_cert_store", (void *)_gd_mono_init_cert_store);
+ mono_add_internal_call("Android.Runtime.AndroidEnvironment::_gd_mono_android_cert_store_lookup", (void *)_gd_mono_android_cert_store_lookup);
+}
+
+void cleanup() {
+ // This is called after shutting down the Mono runtime
+
+ if (mono_dl_handle)
+ gd_mono_android_dlclose(mono_dl_handle, NULL);
+
+ if (godot_dl_handle)
+ gd_mono_android_dlclose(godot_dl_handle, NULL);
+
+ JNIEnv *env = ThreadAndroid::get_env();
+
+ if (certStore) {
+ env->DeleteGlobalRef(certStore);
+ certStore = NULL;
+ }
}
} // namespace GDMonoAndroid
+using namespace GDMonoAndroid;
+
+// The following are P/Invoke functions required by the monodroid profile of the BCL.
+// These are P/Invoke functions and not internal calls, hence why they use
+// 'mono_bool' and 'const char*' instead of 'MonoBoolean' and 'MonoString*'.
+
+#define GD_PINVOKE_EXPORT extern "C" __attribute__((visibility("default")))
+
+GD_PINVOKE_EXPORT int32_t _monodroid_get_android_api_level() {
+ return get_build_version_sdk_int();
+}
+
+GD_PINVOKE_EXPORT void monodroid_free(void *ptr) {
+ free(ptr);
+}
+
+GD_PINVOKE_EXPORT int32_t monodroid_get_system_property(const char *p_name, char **r_value) {
+ char prop_value_str[PROP_VALUE_MAX + 1] = { 0 };
+
+ int len = __system_property_get(p_name, prop_value_str);
+
+ if (r_value) {
+ if (len >= 0) {
+ *r_value = (char *)malloc(len + 1);
+ if (!*r_value)
+ return -1;
+ memcpy(*r_value, prop_value_str, len);
+ (*r_value)[len] = '\0';
+ } else {
+ *r_value = NULL;
+ }
+ }
+
+ return len;
+}
+
+GD_PINVOKE_EXPORT mono_bool _monodroid_get_network_interface_up_state(const char *p_ifname, mono_bool *r_is_up) {
+ // The JNI code is the equivalent of:
+ //
+ // NetworkInterface.getByName(p_ifname).isUp()
+
+ if (!r_is_up || !p_ifname || strlen(p_ifname) == 0)
+ return 0;
+
+ *r_is_up = 0;
+
+ JNIEnv *env = ThreadAndroid::get_env();
+
+ jclass networkInterfaceClass = env->FindClass("java/net/NetworkInterface");
+ ERR_FAIL_NULL_V(networkInterfaceClass, 0);
+
+ jmethodID getByName = env->GetStaticMethodID(networkInterfaceClass, "getByName", "(Ljava/lang/String;)Ljava/net/NetworkInterface;");
+ ERR_FAIL_NULL_V(getByName, 0);
+
+ jmethodID isUp = env->GetMethodID(networkInterfaceClass, "isUp", "()Z");
+ ERR_FAIL_NULL_V(isUp, 0);
+
+ ScopedLocalRef<jstring> js_ifname(env, env->NewStringUTF(p_ifname));
+ ScopedLocalRef<jobject> networkInterface(env, env->CallStaticObjectMethod(networkInterfaceClass, getByName, js_ifname.get()));
+
+ if (!networkInterface)
+ return 0;
+
+ *r_is_up = (mono_bool)env->CallBooleanMethod(networkInterface, isUp);
+
+ return 1;
+}
+
+GD_PINVOKE_EXPORT mono_bool _monodroid_get_network_interface_supports_multicast(const char *p_ifname, mono_bool *r_supports_multicast) {
+ // The JNI code is the equivalent of:
+ //
+ // NetworkInterface.getByName(p_ifname).supportsMulticast()
+
+ if (!r_supports_multicast || !p_ifname || strlen(p_ifname) == 0)
+ return 0;
+
+ *r_supports_multicast = 0;
+
+ JNIEnv *env = ThreadAndroid::get_env();
+
+ jclass networkInterfaceClass = env->FindClass("java/net/NetworkInterface");
+ ERR_FAIL_NULL_V(networkInterfaceClass, 0);
+
+ jmethodID getByName = env->GetStaticMethodID(networkInterfaceClass, "getByName", "(Ljava/lang/String;)Ljava/net/NetworkInterface;");
+ ERR_FAIL_NULL_V(getByName, 0);
+
+ jmethodID supportsMulticast = env->GetMethodID(networkInterfaceClass, "supportsMulticast", "()Z");
+ ERR_FAIL_NULL_V(supportsMulticast, 0);
+
+ ScopedLocalRef<jstring> js_ifname(env, env->NewStringUTF(p_ifname));
+ ScopedLocalRef<jobject> networkInterface(env, env->CallStaticObjectMethod(networkInterfaceClass, getByName, js_ifname.get()));
+
+ if (!networkInterface)
+ return 0;
+
+ *r_supports_multicast = (mono_bool)env->CallBooleanMethod(networkInterface, supportsMulticast);
+
+ return 1;
+}
+
+static const int dns_servers_len = 8;
+
+static void interop_get_active_network_dns_servers(char **r_dns_servers, int *dns_servers_count) {
+ // The JNI code is the equivalent of:
+ //
+ // ConnectivityManager connectivityManager = (ConnectivityManager)getApplicationContext()
+ // .getSystemService(Context.CONNECTIVITY_SERVICE);
+ // Network activeNerwork = connectivityManager.getActiveNetwork();
+ // LinkProperties linkProperties = connectivityManager.getLinkProperties(activeNerwork);
+ // List<String> dnsServers = linkProperties.getDnsServers().stream()
+ // .map(inetAddress -> inetAddress.getHostAddress()).collect(Collectors.toList());
+
+#ifdef DEBUG_ENABLED
+ CRASH_COND(get_build_version_sdk_int() < 23);
+#endif
+
+ JNIEnv *env = ThreadAndroid::get_env();
+
+ GodotJavaWrapper *godot_java = ((OS_Android *)OS::get_singleton())->get_godot_java();
+ jobject activity = godot_java->get_activity();
+
+ ScopedLocalRef<jclass> activityClass(env, env->GetObjectClass(activity));
+ ERR_FAIL_NULL(activityClass);
+
+ jmethodID getApplicationContext = env->GetMethodID(activityClass, "getApplicationContext", "()Landroid/content/Context;");
+
+ ScopedLocalRef<jobject> applicationContext(env, env->CallObjectMethod(activity, getApplicationContext));
+
+ ScopedLocalRef<jclass> contextClass(env, env->FindClass("android/content/Context"));
+ ERR_FAIL_NULL(contextClass);
+
+ jfieldID connectivityServiceField = env->GetStaticFieldID(contextClass, "CONNECTIVITY_SERVICE", "Ljava/lang/String;");
+ ScopedLocalRef<jstring> connectivityServiceString(env, (jstring)env->GetStaticObjectField(contextClass, connectivityServiceField));
+
+ jmethodID getSystemService = env->GetMethodID(contextClass, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;");
+
+ ScopedLocalRef<jobject> connectivityManager(env, env->CallObjectMethod(applicationContext, getSystemService, connectivityServiceString.get()));
+
+ if (!connectivityManager)
+ return;
+
+ ScopedLocalRef<jclass> connectivityManagerClass(env, env->FindClass("android/net/ConnectivityManager"));
+ ERR_FAIL_NULL(connectivityManagerClass);
+
+ jmethodID getActiveNetwork = env->GetMethodID(connectivityManagerClass, "getActiveNetwork", "()Landroid/net/Network;");
+ ERR_FAIL_NULL(getActiveNetwork);
+
+ ScopedLocalRef<jobject> activeNetwork(env, env->CallObjectMethod(connectivityManager, getActiveNetwork));
+
+ if (!activeNetwork)
+ return;
+
+ jmethodID getLinkProperties = env->GetMethodID(connectivityManagerClass,
+ "getLinkProperties", "(Landroid/net/Network;)Landroid/net/LinkProperties;");
+ ERR_FAIL_NULL(getLinkProperties);
+
+ ScopedLocalRef<jobject> linkProperties(env, env->CallObjectMethod(connectivityManager, getLinkProperties, activeNetwork.get()));
+
+ if (!linkProperties)
+ return;
+
+ ScopedLocalRef<jclass> linkPropertiesClass(env, env->FindClass("android/net/LinkProperties"));
+ ERR_FAIL_NULL(linkPropertiesClass);
+
+ jmethodID getDnsServers = env->GetMethodID(linkPropertiesClass, "getDnsServers", "()Ljava/util/List;");
+ ERR_FAIL_NULL(getDnsServers);
+
+ ScopedLocalRef<jobject> dnsServers(env, env->CallObjectMethod(linkProperties, getDnsServers));
+
+ if (!dnsServers)
+ return;
+
+ ScopedLocalRef<jclass> listClass(env, env->FindClass("java/util/List"));
+ ERR_FAIL_NULL(listClass);
+
+ jmethodID listSize = env->GetMethodID(listClass, "size", "()I");
+ ERR_FAIL_NULL(listSize);
+
+ int dnsServersCount = env->CallIntMethod(dnsServers, listSize);
+
+ if (dnsServersCount > dns_servers_len)
+ dnsServersCount = dns_servers_len;
+
+ if (dnsServersCount <= 0)
+ return;
+
+ jmethodID listGet = env->GetMethodID(listClass, "get", "(I)Ljava/lang/Object;");
+ ERR_FAIL_NULL(listGet);
+
+ ScopedLocalRef<jclass> inetAddressClass(env, env->FindClass("java/net/InetAddress"));
+ ERR_FAIL_NULL(inetAddressClass);
+
+ jmethodID getHostAddress = env->GetMethodID(inetAddressClass, "getHostAddress", "()Ljava/lang/String;");
+ ERR_FAIL_NULL(getHostAddress);
+
+ for (int i = 0; i < dnsServersCount; i++) {
+ ScopedLocalRef<jobject> dnsServer(env, env->CallObjectMethod(dnsServers, listGet, (jint)i));
+ if (!dnsServer)
+ continue;
+
+ ScopedLocalRef<jstring> hostAddress(env, (jstring)env->CallObjectMethod(dnsServer, getHostAddress));
+ const char *host_address = env->GetStringUTFChars(hostAddress, 0);
+
+ r_dns_servers[i] = strdup(host_address); // freed by the BCL
+ (*dns_servers_count)++;
+
+ env->ReleaseStringUTFChars(hostAddress, host_address);
+ }
+
+ // jesus...
+}
+
+GD_PINVOKE_EXPORT int32_t _monodroid_get_dns_servers(void **r_dns_servers_array) {
+ if (!r_dns_servers_array)
+ return -1;
+
+ *r_dns_servers_array = NULL;
+
+ char *dns_servers[dns_servers_len];
+ int dns_servers_count = 0;
+
+ if (_monodroid_get_android_api_level() < 26) {
+ // The 'net.dns*' system properties are no longer available in Android 8.0 (API level 26) and greater:
+ // https://developer.android.com/about/versions/oreo/android-8.0-changes.html#o-pri
+
+ char prop_name[] = "net.dns*";
+
+ for (int i = 0; i < dns_servers_len; i++) {
+ prop_name[7] = (char)(i + 0x31);
+ char *prop_value;
+ int32_t len = monodroid_get_system_property(prop_name, &prop_value);
+
+ if (len > 0) {
+ dns_servers[dns_servers_count] = strndup(prop_value, (size_t)len); // freed by the BCL
+ dns_servers_count++;
+ free(prop_value);
+ }
+ }
+ } else {
+ // Alternative for Oreo and greater
+ interop_get_active_network_dns_servers(dns_servers, &dns_servers_count);
+ }
+
+ if (dns_servers_count > 0) {
+ size_t ret_size = sizeof(char *) * (size_t)dns_servers_count;
+ *r_dns_servers_array = malloc(ret_size); // freed by the BCL
+ memcpy(*r_dns_servers_array, dns_servers, ret_size);
+ }
+
+ return dns_servers_count;
+}
+
+GD_PINVOKE_EXPORT const char *_monodroid_timezone_get_default_id() {
+ // The JNI code is the equivalent of:
+ //
+ // TimeZone.getDefault().getID()
+
+ JNIEnv *env = ThreadAndroid::get_env();
+
+ ScopedLocalRef<jclass> timeZoneClass(env, env->FindClass("java/util/TimeZone"));
+ ERR_FAIL_NULL_V(timeZoneClass, NULL);
+
+ jmethodID getDefault = env->GetStaticMethodID(timeZoneClass, "getDefault", "()Ljava/util/TimeZone;");
+ ERR_FAIL_NULL_V(getDefault, NULL);
+
+ jmethodID getID = env->GetMethodID(timeZoneClass, "getID", "()Ljava/lang/String;");
+ ERR_FAIL_NULL_V(getID, NULL);
+
+ ScopedLocalRef<jobject> defaultTimeZone(env, env->CallStaticObjectMethod(timeZoneClass, getDefault));
+
+ if (!defaultTimeZone)
+ return NULL;
+
+ ScopedLocalRef<jstring> defaultTimeZoneID(env, (jstring)env->CallObjectMethod(defaultTimeZone, getID));
+
+ if (!defaultTimeZoneID)
+ return NULL;
+
+ const char *default_time_zone_id = env->GetStringUTFChars(defaultTimeZoneID, 0);
+
+ char *result = strdup(default_time_zone_id); // freed by the BCL
+
+ env->ReleaseStringUTFChars(defaultTimeZoneID, default_time_zone_id);
+
+ return result;
+}
+
+GD_PINVOKE_EXPORT int32_t _monodroid_getifaddrs(struct ifaddrs **p_ifap) {
+ return getifaddrs(p_ifap);
+}
+
+GD_PINVOKE_EXPORT void _monodroid_freeifaddrs(struct ifaddrs *p_ifap) {
+ freeifaddrs(p_ifap);
+}
+
#endif
diff --git a/modules/mono/mono_gd/gd_mono_android.h b/modules/mono/mono_gd/gd_mono_android.h
index 72bc799bfd..20ca266428 100644
--- a/modules/mono/mono_gd/gd_mono_android.h
+++ b/modules/mono/mono_gd/gd_mono_android.h
@@ -39,7 +39,11 @@ namespace GDMonoAndroid {
String get_app_native_lib_dir();
-void register_android_dl_fallback();
+void initialize();
+
+void register_internal_calls();
+
+void cleanup();
} // namespace GDMonoAndroid
diff --git a/modules/mono/mono_gd/gd_mono_cache.h b/modules/mono/mono_gd/gd_mono_cache.h
index b21f92cdd8..a6d6da4f2b 100644
--- a/modules/mono/mono_gd/gd_mono_cache.h
+++ b/modules/mono/mono_gd/gd_mono_cache.h
@@ -42,20 +42,20 @@ struct CachedData {
// corlib classes
// Let's use the no-namespace format for these too
- GDMonoClass *class_MonoObject;
- GDMonoClass *class_bool;
- GDMonoClass *class_int8_t;
- GDMonoClass *class_int16_t;
- GDMonoClass *class_int32_t;
- GDMonoClass *class_int64_t;
- GDMonoClass *class_uint8_t;
- GDMonoClass *class_uint16_t;
- GDMonoClass *class_uint32_t;
- GDMonoClass *class_uint64_t;
- GDMonoClass *class_float;
- GDMonoClass *class_double;
- GDMonoClass *class_String;
- GDMonoClass *class_IntPtr;
+ GDMonoClass *class_MonoObject; // object
+ GDMonoClass *class_bool; // bool
+ GDMonoClass *class_int8_t; // sbyte
+ GDMonoClass *class_int16_t; // short
+ GDMonoClass *class_int32_t; // int
+ GDMonoClass *class_int64_t; // long
+ GDMonoClass *class_uint8_t; // byte
+ GDMonoClass *class_uint16_t; // ushort
+ GDMonoClass *class_uint32_t; // uint
+ GDMonoClass *class_uint64_t; // ulong
+ GDMonoClass *class_float; // float
+ GDMonoClass *class_double; // double
+ GDMonoClass *class_String; // string
+ GDMonoClass *class_IntPtr; // System.IntPtr
GDMonoClass *class_System_Collections_IEnumerable;
GDMonoClass *class_System_Collections_IDictionary;
diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp
index 3827960e6b..f74fe5715c 100644
--- a/modules/mono/mono_gd/gd_mono_marshal.cpp
+++ b/modules/mono/mono_gd/gd_mono_marshal.cpp
@@ -935,6 +935,8 @@ Array mono_array_to_Array(MonoArray *p_array) {
return ret;
}
+// TODO: Use memcpy where possible
+
MonoArray *PoolIntArray_to_mono_array(const PoolIntArray &p_array) {
PoolIntArray::Read r = p_array.read();
diff --git a/modules/recast/navigation_mesh_generator.cpp b/modules/recast/navigation_mesh_generator.cpp
index 320591cf7c..b668085f90 100644
--- a/modules/recast/navigation_mesh_generator.cpp
+++ b/modules/recast/navigation_mesh_generator.cpp
@@ -62,7 +62,7 @@ void EditorNavigationMeshGenerator::_add_vertex(const Vector3 &p_vec3, Vector<fl
}
void EditorNavigationMeshGenerator::_add_mesh(const Ref<Mesh> &p_mesh, const Transform &p_xform, Vector<float> &p_verticies, Vector<int> &p_indices) {
- int current_vertex_count = 0;
+ int current_vertex_count;
for (int i = 0; i < p_mesh->get_surface_count(); i++) {
current_vertex_count = p_verticies.size() / 3;
diff --git a/modules/visual_script/doc_classes/VisualScriptCustomNode.xml b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
index b079653591..f70e22c7d0 100644
--- a/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
+++ b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
@@ -45,7 +45,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Return the specified input port's type. See the [code]TYPE_*[/code] enum in [@GlobalScope].
+ Return the specified input port's type. See the [enum Variant.Type] values.
</description>
</method>
<method name="_get_output_sequence_port_count" qualifiers="virtual">
@@ -86,7 +86,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Return the specified output's type. See the [code]TYPE_*[/code] enum in [@GlobalScope].
+ Return the specified output's type. See the [enum Variant.Type] values.
</description>
</method>
<method name="_get_text" qualifiers="virtual">
@@ -136,17 +136,17 @@
The start mode used the first time when [method _step] is called.
</constant>
<constant name="START_MODE_CONTINUE_SEQUENCE" value="1" enum="StartMode">
- The start mode used when [method _step] is called after coming back from a STEP_PUSH_STACK_BIT.
+ The start mode used when [method _step] is called after coming back from a [constant STEP_PUSH_STACK_BIT].
</constant>
<constant name="START_MODE_RESUME_YIELD" value="2" enum="StartMode">
- The start mode used when [method _step] is called after resuming from STEP_YIELD_BIT.
+ The start mode used when [method _step] is called after resuming from [constant STEP_YIELD_BIT].
</constant>
<constant name="STEP_PUSH_STACK_BIT" value="16777216">
Hint used by [method _step] to tell that control should return to it when there is no other node left to execute.
This is used by [VisualScriptCondition] to redirect the sequence to the "Done" port after the [code]true[/code]/[code]false[/code] branch has finished execution.
</constant>
<constant name="STEP_GO_BACK_BIT" value="33554432">
- Hint used by [method _step] to tell that control should return back, either hitting a previous STEP_PUSH_STACK_BIT or exiting the function.
+ Hint used by [method _step] to tell that control should return back, either hitting a previous [constant STEP_PUSH_STACK_BIT] or exiting the function.
</constant>
<constant name="STEP_NO_ADVANCE_BIT" value="67108864">
</constant>
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index b2791cfc8b..bf353d287f 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -3464,6 +3464,7 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri
ofs = ofs.snapped(Vector2(snap, snap));
}
ofs /= EDSCALE;
+ ofs /= graph->get_zoom();
Set<int> vn;
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index 857d640b43..2a8d67d403 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -1290,7 +1290,7 @@ public:
if (!instance->get_variable(variable, p_outputs[0])) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
r_error_str = RTR("VariableGet not found in script: ") + "'" + String(variable) + "'";
- return false;
+ return 0;
}
return 0;
}
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index defee8f1f1..9068b76cfb 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -175,9 +175,6 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
input = memnew(InputDefault);
input->set_fallback_mapping(godot_java->get_input_fallback_mapping());
- ///@TODO implement a subclass for Android and instantiate that instead
- camera_server = memnew(CameraServer);
-
//power_manager = memnew(PowerAndroid);
return OK;
@@ -196,8 +193,6 @@ void OS_Android::delete_main_loop() {
void OS_Android::finalize() {
- memdelete(camera_server);
-
memdelete(input);
}
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index a290c0cedd..16b5c8c3a3 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -39,7 +39,6 @@
#include "main/input_default.h"
//#include "power_android.h"
#include "servers/audio_server.h"
-#include "servers/camera_server.h"
#include "servers/visual/rasterizer.h"
class GodotJavaWrapper;
@@ -79,8 +78,6 @@ private:
VisualServer *visual_server;
- CameraServer *camera_server;
-
mutable String data_dir_cache;
//AudioDriverAndroid audio_driver_android;
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp
index 9c07535c85..438b50053f 100644
--- a/platform/haiku/os_haiku.cpp
+++ b/platform/haiku/os_haiku.cpp
@@ -133,8 +133,6 @@ Error OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p
window->Show();
visual_server->init();
- camera_server = memnew(CameraServer);
-
AudioDriverManager::initialize(p_audio_driver);
return OK;
@@ -150,8 +148,6 @@ void OS_Haiku::finalize() {
visual_server->finish();
memdelete(visual_server);
- memdelete(camera_server);
-
memdelete(input);
#if defined(OPENGL_ENABLED)
diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h
index 70d78a1978..e1d4cf8d87 100644
--- a/platform/haiku/os_haiku.h
+++ b/platform/haiku/os_haiku.h
@@ -38,7 +38,6 @@
#include "haiku_direct_window.h"
#include "main/input_default.h"
#include "servers/audio_server.h"
-#include "servers/camera_server.h"
#include "servers/visual_server.h"
class OS_Haiku : public OS_Unix {
@@ -50,7 +49,6 @@ private:
VisualServer *visual_server;
VideoMode current_video_mode;
int video_driver_index;
- CameraServer *camera_server;
#ifdef MEDIA_KIT_ENABLED
AudioDriverMediaKit driver_media_kit;
diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub
index 85ba56165b..fa1b124561 100644
--- a/platform/iphone/SCsub
+++ b/platform/iphone/SCsub
@@ -14,7 +14,6 @@ iphone_lib = [
'in_app_store.mm',
'icloud.mm',
'ios.mm',
- 'camera_ios.mm',
]
env_ios = env.Clone()
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index baae13c53d..4f4439bc60 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -63,6 +63,10 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
String architectures;
String linker_flags;
String cpp_code;
+ String modules_buildfile;
+ String modules_fileref;
+ String modules_buildphase;
+ String modules_buildgrp;
};
struct ExportArchitecture {
@@ -178,6 +182,7 @@ public:
return list;
}
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
+ virtual void add_module_code(const Ref<EditorExportPreset> &p_preset, IOSConfigData &p_config_data, const String &p_name, const String &p_fid, const String &p_gid);
virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const;
@@ -214,7 +219,7 @@ void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset>
Vector<EditorExportPlatformIOS::ExportArchitecture> EditorExportPlatformIOS::_get_supported_architectures() {
Vector<ExportArchitecture> archs;
- archs.push_back(ExportArchitecture("armv7", true));
+ archs.push_back(ExportArchitecture("armv7", false)); // Disabled by default, not included in official templates.
archs.push_back(ExportArchitecture("arm64", true));
return archs;
}
@@ -263,11 +268,16 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options)
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/arkit"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/camera"), false));
+
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/access_wifi"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/game_center"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/in_app_purchases"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/push_notifications"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "user_data/accessible_from_files_app"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "user_data/accessible_from_itunes_sharing"), false));
+
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/camera_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use the camera"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/microphone_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use the microphone"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/photolibrary_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need access to the photo library"), ""));
@@ -311,6 +321,14 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
for (int i = 0; i < lines.size(); i++) {
if (lines[i].find("$binary") != -1) {
strnew += lines[i].replace("$binary", p_config.binary_name) + "\n";
+ } else if (lines[i].find("$modules_buildfile") != -1) {
+ strnew += lines[i].replace("$modules_buildfile", p_config.modules_buildfile) + "\n";
+ } else if (lines[i].find("$modules_fileref") != -1) {
+ strnew += lines[i].replace("$modules_fileref", p_config.modules_fileref) + "\n";
+ } else if (lines[i].find("$modules_buildphase") != -1) {
+ strnew += lines[i].replace("$modules_buildphase", p_config.modules_buildphase) + "\n";
+ } else if (lines[i].find("$modules_buildgrp") != -1) {
+ strnew += lines[i].replace("$modules_buildgrp", p_config.modules_buildgrp) + "\n";
} else if (lines[i].find("$name") != -1) {
strnew += lines[i].replace("$name", p_config.pkg_name) + "\n";
} else if (lines[i].find("$info") != -1) {
@@ -349,6 +367,10 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
strnew += lines[i].replace("$linker_flags", p_config.linker_flags) + "\n";
} else if (lines[i].find("$cpp_code") != -1) {
strnew += lines[i].replace("$cpp_code", p_config.cpp_code) + "\n";
+ } else if (lines[i].find("$docs_in_place") != -1) {
+ strnew += lines[i].replace("$docs_in_place", ((bool)p_preset->get("user_data/accessible_from_files_app")) ? "<true/>" : "<false/>") + "\n";
+ } else if (lines[i].find("$docs_sharing") != -1) {
+ strnew += lines[i].replace("$docs_sharing", ((bool)p_preset->get("user_data/accessible_from_itunes_sharing")) ? "<true/>" : "<false/>") + "\n";
} else if (lines[i].find("$access_wifi") != -1) {
bool is_on = p_preset->get("capabilities/access_wifi");
strnew += lines[i].replace("$access_wifi", is_on ? "1" : "0") + "\n";
@@ -837,6 +859,22 @@ Vector<String> EditorExportPlatformIOS::_get_preset_architectures(const Ref<Edit
return enabled_archs;
}
+void EditorExportPlatformIOS::add_module_code(const Ref<EditorExportPreset> &p_preset, EditorExportPlatformIOS::IOSConfigData &p_config_data, const String &p_name, const String &p_fid, const String &p_gid) {
+ if ((bool)p_preset->get("capabilities/" + p_name)) {
+ //add module static library
+ print_line("ADDING MODULE: " + p_name);
+
+ p_config_data.modules_buildfile += p_gid + " /* libgodot_" + p_name + "_module.a in Frameworks */ = {isa = PBXBuildFile; fileRef = " + p_fid + " /* libgodot_" + p_name + "_module.a */; };\n\t\t";
+ p_config_data.modules_fileref += p_fid + " /* libgodot_" + p_name + "_module.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = godot_" + p_name + "_module ; path = \"libgodot_" + p_name + "_module.a\"; sourceTree = \"<group>\"; };\n\t\t";
+ p_config_data.modules_buildphase += p_gid + " /* libgodot_" + p_name + "_module.a */,\n\t\t\t\t";
+ p_config_data.modules_buildgrp += p_fid + " /* libgodot_" + p_name + "_module.a */,\n\t\t\t\t";
+ } else {
+ //add stub function for disabled module
+ p_config_data.cpp_code += "void register_" + p_name + "_types() { /*stub*/ };\n";
+ p_config_data.cpp_code += "void unregister_" + p_name + "_types() { /*stub*/ };\n";
+ }
+}
+
Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags);
@@ -934,7 +972,11 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
_get_additional_plist_content(),
String(" ").join(_get_preset_architectures(p_preset)),
_get_linker_flags(),
- _get_cpp_code()
+ _get_cpp_code(),
+ "",
+ "",
+ "",
+ ""
};
DirAccess *tmp_app_path = DirAccess::create_for_path(dest_dir);
@@ -949,6 +991,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
return ERR_CANT_OPEN;
}
+ add_module_code(p_preset, config_data, "arkit", "F9B95E6E2391205500AF0000", "F9C95E812391205C00BF0000");
+ add_module_code(p_preset, config_data, "camera", "F9B95E6E2391205500AF0001", "F9C95E812391205C00BF0001");
+
+ //export rest of the files
int ret = unzGoToFirstFile(src_pkg_zip);
Vector<uint8_t> project_file_data;
while (ret == UNZ_OK) {
@@ -988,6 +1034,20 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
is_execute = true;
#endif
file = "godot_ios.a";
+ } else if (file.begins_with("libgodot_arkit")) {
+ if ((bool)p_preset->get("capabilities/arkit") && file.ends_with(String(p_debug ? "debug" : "release") + ".fat.a")) {
+ file = "libgodot_arkit_module.a";
+ } else {
+ ret = unzGoToNextFile(src_pkg_zip);
+ continue; //ignore!
+ }
+ } else if (file.begins_with("libgodot_camera")) {
+ if ((bool)p_preset->get("capabilities/camera") && file.ends_with(String(p_debug ? "debug" : "release") + ".fat.a")) {
+ file = "libgodot_camera_module.a";
+ } else {
+ ret = unzGoToNextFile(src_pkg_zip);
+ continue; //ignore!
+ }
}
if (file == project_file) {
project_file_data = data;
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index 83b0660ef7..8984ed1d7b 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -164,8 +164,6 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p
input = memnew(InputDefault);
- camera_server = memnew(CameraIOS);
-
#ifdef GAME_CENTER_ENABLED
game_center = memnew(GameCenter);
Engine::get_singleton()->add_singleton(Engine::Singleton("GameCenter", game_center));
@@ -361,11 +359,6 @@ void OSIPhone::finalize() {
if (main_loop) // should not happen?
memdelete(main_loop);
- if (camera_server) {
- memdelete(camera_server);
- camera_server = NULL;
- }
-
visual_server->finish();
memdelete(visual_server);
// memdelete(rasterizer);
diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h
index 63799bbae8..1f49062cfc 100644
--- a/platform/iphone/os_iphone.h
+++ b/platform/iphone/os_iphone.h
@@ -37,7 +37,6 @@
#include "drivers/coreaudio/audio_driver_coreaudio.h"
#include "drivers/unix/os_unix.h"
-#include "camera_ios.h"
#include "game_center.h"
#include "icloud.h"
#include "in_app_store.h"
@@ -62,8 +61,6 @@ private:
AudioDriverCoreAudio audio_driver;
- CameraServer *camera_server;
-
#ifdef GAME_CENTER_ENABLED
GameCenter *game_center;
#endif
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index c05b765c5e..7bf3e1bc1d 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -131,6 +131,13 @@ def configure(env):
env.Append(LINKFLAGS=['-s', 'BINARYEN=1'])
+ # This needs to be defined for Emscripten using 'fastcomp' (default pre-1.39.0)
+ # and undefined if using 'upstream'. And to make things simple, earlier
+ # Emscripten versions didn't include 'fastcomp' in their path, so we check
+ # against the presence of 'upstream' to conditionally add the flag.
+ if not "upstream" in em_config['EMSCRIPTEN_ROOT']:
+ env.Append(LINKFLAGS=['-s', 'BINARYEN_TRAP_MODE=\'clamp\''])
+
# Allow increasing memory buffer size during runtime. This is efficient
# when using WebAssembly (in comparison to asm.js) and works well for
# us since we don't know requirements at compile-time.
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index 652f6a1ce1..61919bb24a 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -970,8 +970,6 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
VisualServer *visual_server = memnew(VisualServerRaster());
input = memnew(InputDefault);
- camera_server = memnew(CameraServer);
-
EMSCRIPTEN_RESULT result;
#define EM_CHECK(ev) \
if (result != EMSCRIPTEN_RESULT_SUCCESS) \
@@ -1106,7 +1104,6 @@ void OS_JavaScript::delete_main_loop() {
void OS_JavaScript::finalize() {
- memdelete(camera_server);
memdelete(input);
}
diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h
index 10676c49f7..7c97e302e9 100644
--- a/platform/javascript/os_javascript.h
+++ b/platform/javascript/os_javascript.h
@@ -35,7 +35,6 @@
#include "drivers/unix/os_unix.h"
#include "main/input_default.h"
#include "servers/audio_server.h"
-#include "servers/camera_server.h"
#include "servers/visual/rasterizer.h"
#include <emscripten/html5.h>
@@ -67,8 +66,6 @@ class OS_JavaScript : public OS_Unix {
int64_t sync_wait_time;
int64_t last_sync_check_time;
- CameraServer *camera_server;
-
static EM_BOOL fullscreen_change_callback(int p_event_type, const EmscriptenFullscreenChangeEvent *p_event, void *p_user_data);
static EM_BOOL keydown_callback(int p_event_type, const EmscriptenKeyboardEvent *p_event, void *p_user_data);
diff --git a/platform/osx/SCsub b/platform/osx/SCsub
index 9620863b96..e15b4339a7 100644
--- a/platform/osx/SCsub
+++ b/platform/osx/SCsub
@@ -13,7 +13,6 @@ files = [
'dir_access_osx.mm',
'joypad_osx.cpp',
'power_osx.cpp',
- 'camera_osx.mm',
]
prog = env.add_program('#bin/godot', files)
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index a61b9234d1..78e1aa6c0a 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -33,7 +33,6 @@
#define BitMap _QDBitMap // Suppress deprecated QuickDraw definition.
-#include "camera_osx.h"
#include "core/os/input.h"
#include "crash_handler_osx.h"
#include "drivers/coreaudio/audio_driver_coreaudio.h"
@@ -74,8 +73,6 @@ public:
//Rasterizer *rasterizer;
VisualServer *visual_server;
- CameraServer *camera_server;
-
List<String> args;
MainLoop *main_loop;
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index dac6721fb4..122e8274b9 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -340,12 +340,8 @@ static Vector2 get_mouse_pos(NSPoint locationInWindow, CGFloat backingScaleFacto
//Update context
if (OS_OSX::singleton->main_loop) {
- [OS_OSX::singleton->context update];
-
- //Force window resize ???
- NSRect frame = [OS_OSX::singleton->window_object frame];
- [OS_OSX::singleton->window_object setFrame:NSMakeRect(frame.origin.x, frame.origin.y, 1, 1) display:YES];
- [OS_OSX::singleton->window_object setFrame:frame display:YES];
+ //Force window resize event
+ [self windowDidResize:notification];
}
}
}
@@ -1632,8 +1628,6 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
visual_server->init();
AudioDriverManager::initialize(p_audio_driver);
- camera_server = memnew(CameraOSX);
-
input = memnew(InputDefault);
joypad_osx = memnew(JoypadOSX);
@@ -1663,11 +1657,6 @@ void OS_OSX::finalize() {
delete_main_loop();
- if (camera_server) {
- memdelete(camera_server);
- camera_server = NULL;
- }
-
memdelete(joypad_osx);
memdelete(input);
diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp
index 87dc6421ac..12e53054bc 100644
--- a/platform/server/os_server.cpp
+++ b/platform/server/os_server.cpp
@@ -88,8 +88,6 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int
visual_server = memnew(VisualServerRaster);
visual_server->init();
- camera_server = memnew(CameraServer);
-
AudioDriverManager::initialize(p_audio_driver);
input = memnew(InputDefault);
@@ -119,8 +117,6 @@ void OS_Server::finalize() {
memdelete(input);
- memdelete(camera_server);
-
memdelete(power_manager);
ResourceLoader::remove_resource_format_loader(resource_loader_dummy);
diff --git a/platform/server/os_server.h b/platform/server/os_server.h
index b8119288ff..6d975ca7e0 100644
--- a/platform/server/os_server.h
+++ b/platform/server/os_server.h
@@ -71,7 +71,6 @@ class OS_Server : public OS_Unix {
#endif
CrashHandler crash_handler;
- CameraServer *camera_server;
int video_driver_index;
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index 60f2290355..eb0ae96111 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -303,9 +303,6 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
visual_server->init();
- ///@TODO implement a subclass for UWP and instantiate that instead
- camera_server = memnew(CameraServer);
-
input = memnew(InputDefault);
joypad = ref new JoypadUWP(input);
@@ -404,8 +401,6 @@ void OS_UWP::finalize() {
memdelete(input);
- memdelete(camera_server);
-
joypad = nullptr;
}
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index 370cab6a9b..adca7d18cc 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -41,7 +41,6 @@
#include "main/input_default.h"
#include "power_uwp.h"
#include "servers/audio_server.h"
-#include "servers/camera_server.h"
#include "servers/visual/rasterizer.h"
#include "servers/visual_server.h"
@@ -93,8 +92,6 @@ private:
VisualServer *visual_server;
int pressrc;
- CameraServer *camera_server;
-
ContextEGL_UWP *gl_context;
Windows::UI::Core::CoreWindow ^ window;
diff --git a/platform/windows/SCsub b/platform/windows/SCsub
index 8426ccbb89..892d734734 100644
--- a/platform/windows/SCsub
+++ b/platform/windows/SCsub
@@ -8,7 +8,6 @@ import platform_windows_builders
common_win = [
"godot_windows.cpp",
- "camera_win.cpp",
"context_gl_windows.cpp",
"crash_handler_windows.cpp",
"os_windows.cpp",
diff --git a/platform/windows/context_gl_windows.cpp b/platform/windows/context_gl_windows.cpp
index e715999378..34a5698394 100644
--- a/platform/windows/context_gl_windows.cpp
+++ b/platform/windows/context_gl_windows.cpp
@@ -34,6 +34,8 @@
#include "context_gl_windows.h"
+#include <dwmapi.h>
+
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
#define WGL_CONTEXT_FLAGS_ARB 0x2094
@@ -63,16 +65,52 @@ int ContextGL_Windows::get_window_height() {
return OS::get_singleton()->get_video_mode().height;
}
+bool ContextGL_Windows::should_vsync_via_compositor() {
+
+ if (OS::get_singleton()->is_window_fullscreen() || !OS::get_singleton()->is_vsync_via_compositor_enabled()) {
+ return false;
+ }
+
+ // Note: All Windows versions supported by Godot have a compositor.
+ // It can be disabled on earlier Windows versions.
+ BOOL dwm_enabled;
+
+ if (SUCCEEDED(DwmIsCompositionEnabled(&dwm_enabled))) {
+ return dwm_enabled;
+ }
+
+ return false;
+}
+
void ContextGL_Windows::swap_buffers() {
SwapBuffers(hDC);
+
+ if (use_vsync) {
+ bool vsync_via_compositor_now = should_vsync_via_compositor();
+
+ if (vsync_via_compositor_now) {
+ DwmFlush();
+ }
+
+ if (vsync_via_compositor_now != vsync_via_compositor) {
+ // The previous frame had a different operating mode than this
+ // frame. Set the 'vsync_via_compositor' member variable and the
+ // OpenGL swap interval to their proper values.
+ set_use_vsync(true);
+ }
+ }
}
void ContextGL_Windows::set_use_vsync(bool p_use) {
+ vsync_via_compositor = p_use && should_vsync_via_compositor();
+
if (wglSwapIntervalEXT) {
- wglSwapIntervalEXT(p_use ? 1 : 0);
+ int swap_interval = (p_use && !vsync_via_compositor) ? 1 : 0;
+ wglSwapIntervalEXT(swap_interval);
}
+
use_vsync = p_use;
}
@@ -177,6 +215,7 @@ ContextGL_Windows::ContextGL_Windows(HWND hwnd, bool p_opengl_3_context) {
opengl_3_context = p_opengl_3_context;
hWnd = hwnd;
use_vsync = false;
+ vsync_via_compositor = false;
}
ContextGL_Windows::~ContextGL_Windows() {
diff --git a/platform/windows/context_gl_windows.h b/platform/windows/context_gl_windows.h
index d23fba50e1..e65ea1928f 100644
--- a/platform/windows/context_gl_windows.h
+++ b/platform/windows/context_gl_windows.h
@@ -50,9 +50,12 @@ class ContextGL_Windows {
HWND hWnd;
bool opengl_3_context;
bool use_vsync;
+ bool vsync_via_compositor;
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT;
+ static bool should_vsync_via_compositor();
+
public:
void release_current();
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 9a2b2bcb98..500736bd3f 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -151,14 +151,14 @@ def setup_msvc_auto(env):
env['bits'] = '64'
else:
env['bits'] = '32'
- print(" Found MSVC version %s, arch %s, bits=%s" % (env['MSVC_VERSION'], env['TARGET_ARCH'], env['bits']))
+ print("Found MSVC version %s, arch %s, bits=%s" % (env['MSVC_VERSION'], env['TARGET_ARCH'], env['bits']))
if env['TARGET_ARCH'] in ('amd64', 'x86_64'):
env["x86_libtheora_opt_vc"] = False
def setup_mingw(env):
"""Set up env for use with mingw"""
# Nothing to do here
- print("Using Mingw")
+ print("Using MinGW")
pass
def configure_msvc(env, manual_msvc_config):
@@ -221,7 +221,8 @@ def configure_msvc(env, manual_msvc_config):
LIBS = ['winmm', 'opengl32', 'dsound', 'kernel32', 'ole32', 'oleaut32',
'user32', 'gdi32', 'IPHLPAPI', 'Shlwapi', 'wsock32', 'Ws2_32',
- 'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt','Avrt']
+ 'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt','Avrt',
+ 'dwmapi']
env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS])
if manual_msvc_config:
@@ -293,7 +294,10 @@ def configure_mingw(env):
## Compiler configuration
if (os.name == "nt"):
- env['ENV']['TMP'] = os.environ['TMP'] # way to go scons, you can be so stupid sometimes
+ # Force splitting libmodules.a in multiple chunks to work around
+ # issues reaching the linker command line size limit, which also
+ # seem to induce huge slowdown for 'ar' (GH-30892).
+ env['split_libmodules'] = True
else:
env["PROGSUFFIX"] = env["PROGSUFFIX"] + ".exe" # for linux cross-compilation
@@ -348,7 +352,7 @@ def configure_mingw(env):
env.Append(CCFLAGS=['-mwindows'])
env.Append(CPPDEFINES=['WINDOWS_ENABLED', 'OPENGL_ENABLED', 'WASAPI_ENABLED', 'WINMIDI_ENABLED'])
env.Append(CPPDEFINES=[('WINVER', env['target_win_version']), ('_WIN32_WINNT', env['target_win_version'])])
- env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt', 'avrt', 'uuid'])
+ env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt', 'avrt', 'uuid', 'dwmapi'])
env.Append(CPPDEFINES=['MINGW_ENABLED', ('MINGW_HAS_SECURE_API', 1)])
diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp
index 3abb05b494..858453ddfd 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -39,6 +39,7 @@ static Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start,
class EditorExportPlatformWindows : public EditorExportPlatformPC {
+ void _rcedit_add_data(const Ref<EditorExportPreset> &p_preset, const String &p_path);
Error _code_sign(const Ref<EditorExportPreset> &p_preset, const String &p_path);
public:
@@ -62,15 +63,50 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset>
return err;
}
+ _rcedit_add_data(p_preset, p_path);
+
+ if (p_preset->get("codesign/enable") && err == OK) {
+ err = _code_sign(p_preset, p_path);
+ }
+
+ return err;
+}
+
+void EditorExportPlatformWindows::get_export_options(List<ExportOption> *r_options) {
+ EditorExportPlatformPC::get_export_options(r_options);
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "codesign/enable"), false));
+#ifdef WINDOWS_ENABLED
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/identity_type", PROPERTY_HINT_ENUM, "Select automatically,Use PKCS12 file (specify *.PFX/*.P12 file),Use certificate store (specify SHA1 hash)"), 0));
+#endif
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/identity", PROPERTY_HINT_GLOBAL_FILE, "*.pfx,*.p12"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/password"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "codesign/timestamp"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/timestamp_server_url"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/digest_algorithm", PROPERTY_HINT_ENUM, "SHA1,SHA256"), 1));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/description"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::POOL_STRING_ARRAY, "codesign/custom_options"), PoolStringArray()));
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.ico"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/file_version", PROPERTY_HINT_PLACEHOLDER_TEXT, "1.0.0"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/product_version", PROPERTY_HINT_PLACEHOLDER_TEXT, "1.0.0"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/company_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Company Name"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/product_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Game Name"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/file_description"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/trademarks"), ""));
+}
+
+void EditorExportPlatformWindows::_rcedit_add_data(const Ref<EditorExportPreset> &p_preset, const String &p_path) {
String rcedit_path = EditorSettings::get_singleton()->get("export/windows/rcedit");
if (rcedit_path == String()) {
- return OK;
+ return;
}
if (!FileAccess::exists(rcedit_path)) {
- ERR_PRINTS("Could not find rcedit executable at " + rcedit_path + ", aborting.");
- return ERR_FILE_NOT_FOUND;
+ ERR_PRINTS("Could not find rcedit executable at " + rcedit_path + ", no icon or app information data will be included.");
+ return;
}
#ifndef WINDOWS_ENABLED
@@ -78,8 +114,8 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset>
String wine_path = EditorSettings::get_singleton()->get("export/windows/wine");
if (wine_path != String() && !FileAccess::exists(wine_path)) {
- ERR_PRINTS("Could not find wine executable at " + wine_path + ", aborting.");
- return ERR_FILE_NOT_FOUND;
+ ERR_PRINTS("Could not find wine executable at " + wine_path + ", no icon or app information data will be included.");
+ return;
}
if (wine_path == String()) {
@@ -144,37 +180,6 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset>
args.push_front(rcedit_path);
OS::get_singleton()->execute(wine_path, args, true);
#endif
-
- if (p_preset->get("codesign/enable") && err == OK) {
- err = _code_sign(p_preset, p_path);
- }
-
- return err;
-}
-
-void EditorExportPlatformWindows::get_export_options(List<ExportOption> *r_options) {
- EditorExportPlatformPC::get_export_options(r_options);
-
- r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "codesign/enable"), false));
-#ifdef WINDOWS_ENABLED
- r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/identity_type", PROPERTY_HINT_ENUM, "Select automatically,Use PKCS12 file (specify *.PFX/*.P12 file),Use certificate store (specify SHA1 hash)"), 0));
-#endif
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/identity", PROPERTY_HINT_GLOBAL_FILE, "*.pfx,*.p12"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/password"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "codesign/timestamp"), true));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/timestamp_server_url"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/digest_algorithm", PROPERTY_HINT_ENUM, "SHA1,SHA256"), 1));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/description"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::POOL_STRING_ARRAY, "codesign/custom_options"), PoolStringArray()));
-
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.ico"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/file_version", PROPERTY_HINT_PLACEHOLDER_TEXT, "1.0.0"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/product_version", PROPERTY_HINT_PLACEHOLDER_TEXT, "1.0.0"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/company_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Company Name"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/product_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Game Name"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/file_description"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/trademarks"), ""));
}
Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_preset, const String &p_path) {
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 429657f332..f749134f3c 100755
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1480,6 +1480,7 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
video_driver_index = p_video_driver;
gl_context->set_use_vsync(video_mode.use_vsync);
+ set_vsync_via_compositor(video_mode.vsync_via_compositor);
#endif
visual_server = memnew(VisualServerRaster);
@@ -1494,8 +1495,6 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
power_manager = memnew(PowerWindows);
- camera_server = memnew(CameraWindows);
-
AudioDriverManager::initialize(p_audio_driver);
TRACKMOUSEEVENT tme;
@@ -1649,7 +1648,6 @@ void OS_Windows::finalize() {
memdelete(joypad);
memdelete(input);
- memdelete(camera_server);
touch_state.clear();
cursors_cache.clear();
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index ce279fb033..28fec27216 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -31,7 +31,6 @@
#ifndef OS_WINDOWS_H
#define OS_WINDOWS_H
-#include "camera_win.h"
#include "context_gl_windows.h"
#include "core/os/input.h"
#include "core/os/os.h"
@@ -175,7 +174,6 @@ class OS_Windows : public OS {
ContextGL_Windows *gl_context;
#endif
VisualServer *visual_server;
- CameraWindows *camera_server;
int pressrc;
HINSTANCE hInstance; // Holds The Instance Of The Application
HWND hWnd;
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 54d3759cc5..39d5c0e84e 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -596,9 +596,6 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
AudioDriverManager::initialize(p_audio_driver);
- ///@TODO implement a subclass for Linux and instantiate that instead
- camera_server = memnew(CameraServer);
-
input = memnew(InputDefault);
window_has_focus = true; // Set focus to true at init
@@ -832,8 +829,6 @@ void OS_X11::finalize() {
memdelete(input);
- memdelete(camera_server);
-
cursors_cache.clear();
visual_server->finish();
memdelete(visual_server);
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index a5576f4402..d02160fab7 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -42,7 +42,6 @@
#include "main/input_default.h"
#include "power_x11.h"
#include "servers/audio_server.h"
-#include "servers/camera_server.h"
#include "servers/visual/rasterizer.h"
#include "servers/visual_server.h"
//#include "servers/visual/visual_server_wrap_mt.h"
@@ -150,8 +149,6 @@ class OS_X11 : public OS_Unix {
void get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state);
void flush_mouse_motion();
- CameraServer *camera_server;
-
MouseMode mouse_mode;
Point2i center;
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index bb144dda96..766a8a6de4 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -169,8 +169,8 @@ void CollisionPolygon2D::_notification(int p_what) {
Vector<Vector2> pts;
float tsize = 8;
pts.push_back(line_to + (Vector2(0, tsize)));
- pts.push_back(line_to + (Vector2(0.707 * tsize, 0)));
- pts.push_back(line_to + (Vector2(-0.707 * tsize, 0)));
+ pts.push_back(line_to + (Vector2(Math_SQRT12 * tsize, 0)));
+ pts.push_back(line_to + (Vector2(-Math_SQRT12 * tsize, 0)));
Vector<Color> cols;
for (int i = 0; i < 3; i++)
cols.push_back(dcol);
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index f79d79d039..d9c1d69b53 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -134,8 +134,8 @@ void CollisionShape2D::_notification(int p_what) {
Vector<Vector2> pts;
float tsize = 8;
pts.push_back(line_to + (Vector2(0, tsize)));
- pts.push_back(line_to + (Vector2(0.707 * tsize, 0)));
- pts.push_back(line_to + (Vector2(-0.707 * tsize, 0)));
+ pts.push_back(line_to + (Vector2(Math_SQRT12 * tsize, 0)));
+ pts.push_back(line_to + (Vector2(-Math_SQRT12 * tsize, 0)));
Vector<Color> cols;
for (int i = 0; i < 3; i++)
cols.push_back(draw_col);
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index ad405fabbb..af3ed671aa 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -47,6 +47,7 @@ Line2D::Line2D() {
_texture_mode = LINE_TEXTURE_NONE;
_sharp_limit = 2.f;
_round_precision = 8;
+ _antialiased = false;
}
Rect2 Line2D::_edit_get_rect() const {
@@ -260,6 +261,15 @@ int Line2D::get_round_precision() const {
return _round_precision;
}
+void Line2D::set_antialiased(bool p_antialiased) {
+ _antialiased = p_antialiased;
+ update();
+}
+
+bool Line2D::get_antialiased() const {
+ return _antialiased;
+}
+
void Line2D::_draw() {
if (_points.size() <= 1 || _width == 0.f)
return;
@@ -305,8 +315,8 @@ void Line2D::_draw() {
lb.vertices,
lb.colors,
lb.uvs, Vector<int>(), Vector<float>(),
-
- texture_rid);
+ texture_rid, -1, RID(),
+ _antialiased);
// DEBUG
// Draw wireframe
@@ -386,6 +396,9 @@ void Line2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_round_precision", "precision"), &Line2D::set_round_precision);
ClassDB::bind_method(D_METHOD("get_round_precision"), &Line2D::get_round_precision);
+ ClassDB::bind_method(D_METHOD("set_antialiased", "antialiased"), &Line2D::set_antialiased);
+ ClassDB::bind_method(D_METHOD("get_antialiased"), &Line2D::get_antialiased);
+
ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "points"), "set_points", "get_points");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "width"), "set_width", "get_width");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "width_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve", "get_curve");
@@ -401,6 +414,7 @@ void Line2D::_bind_methods() {
ADD_GROUP("Border", "");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "sharp_limit"), "set_sharp_limit", "get_sharp_limit");
ADD_PROPERTY(PropertyInfo(Variant::INT, "round_precision"), "set_round_precision", "get_round_precision");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "antialiased"), "set_antialiased", "get_antialiased");
BIND_ENUM_CONSTANT(LINE_JOINT_SHARP);
BIND_ENUM_CONSTANT(LINE_JOINT_BEVEL);
diff --git a/scene/2d/line_2d.h b/scene/2d/line_2d.h
index 14afa463ba..10b2bf16e4 100644
--- a/scene/2d/line_2d.h
+++ b/scene/2d/line_2d.h
@@ -108,6 +108,9 @@ public:
void set_round_precision(int precision);
int get_round_precision() const;
+ void set_antialiased(bool p_antialiased);
+ bool get_antialiased() const;
+
protected:
void _notification(int p_what);
void _draw();
@@ -131,6 +134,7 @@ private:
LineTextureMode _texture_mode;
float _sharp_limit;
int _round_precision;
+ bool _antialiased;
};
#endif // LINE2D_H
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 3a4f397fe0..a57bfd4cbe 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -1214,18 +1214,20 @@ bool KinematicBody2D::move_and_collide(const Vector2 &p_motion, bool p_infinite_
Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction, bool p_stop_on_slope, int p_max_slides, float p_floor_max_angle, bool p_infinite_inertia) {
- Vector2 floor_motion = floor_velocity;
+ Vector2 body_velocity = p_linear_velocity;
+ Vector2 body_velocity_normal = body_velocity.normalized();
+
+ Vector2 current_floor_velocity = floor_velocity;
if (on_floor && on_floor_body.is_valid()) {
//this approach makes sure there is less delay between the actual body velocity and the one we saved
Physics2DDirectBodyState *bs = Physics2DServer::get_singleton()->body_get_direct_state(on_floor_body);
if (bs) {
- floor_motion = bs->get_linear_velocity();
+ current_floor_velocity = bs->get_linear_velocity();
}
}
// Hack in order to work with calling from _process as well as from _physics_process; calling from thread is risky
- Vector2 motion = (floor_motion + p_linear_velocity) * (Engine::get_singleton()->is_in_physics_frame() ? get_physics_process_delta_time() : get_process_delta_time());
- Vector2 lv = p_linear_velocity;
+ Vector2 motion = (current_floor_velocity + body_velocity) * (Engine::get_singleton()->is_in_physics_frame() ? get_physics_process_delta_time() : get_process_delta_time());
on_floor = false;
on_floor_body = RID();
@@ -1234,14 +1236,12 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const
colliders.clear();
floor_velocity = Vector2();
- Vector2 lv_n = p_linear_velocity.normalized();
-
while (p_max_slides) {
Collision collision;
bool found_collision = false;
- for (int i = 0; i < 2; i++) {
+ for (int i = 0; i < 2; ++i) {
bool collided;
if (i == 0) { //collide
collided = move_and_collide(motion, p_infinite_inertia, collision);
@@ -1273,14 +1273,13 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const
floor_velocity = collision.collider_vel;
if (p_stop_on_slope) {
- if ((lv_n + p_floor_direction).length() < 0.01 && collision.travel.length() < 1) {
+ if ((body_velocity_normal + p_floor_direction).length() < 0.01 && collision.travel.length() < 1) {
Transform2D gt = get_global_transform();
- gt.elements[2] -= collision.travel.project(p_floor_direction.tangent());
+ gt.elements[2] -= collision.travel.slide(p_floor_direction);
set_global_transform(gt);
return Vector2();
}
}
-
} else if (Math::acos(collision.normal.dot(-p_floor_direction)) <= p_floor_max_angle + FLOOR_ANGLE_THRESHOLD) { //ceiling
on_ceiling = true;
} else {
@@ -1288,21 +1287,18 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const
}
}
- Vector2 n = collision.normal;
- motion = motion.slide(n);
- lv = lv.slide(n);
+ motion = motion.slide(collision.normal);
+ body_velocity = body_velocity.slide(collision.normal);
}
}
- if (!found_collision) {
- break;
- }
- p_max_slides--;
- if (motion == Vector2())
+ if (!found_collision || motion == Vector2())
break;
+
+ --p_max_slides;
}
- return lv;
+ return body_velocity;
}
Vector2 KinematicBody2D::move_and_slide_with_snap(const Vector2 &p_linear_velocity, const Vector2 &p_snap, const Vector2 &p_floor_direction, bool p_stop_on_slope, int p_max_slides, float p_floor_max_angle, bool p_infinite_inertia) {
diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp
index 5e14959e9d..9fe67a4d7e 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -308,7 +308,7 @@ void Polygon2D::_notification(int p_what) {
if (invert || polygons.size() == 0) {
Vector<int> indices = Geometry::triangulate_polygon(points);
if (indices.size()) {
- VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID());
+ VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID(), -1, RID(), antialiased);
}
} else {
//draw individual polygons
@@ -342,7 +342,7 @@ void Polygon2D::_notification(int p_what) {
}
if (total_indices.size()) {
- VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), total_indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID());
+ VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), total_indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID(), -1, RID(), antialiased);
}
#if 0
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp
index bf8d008bb2..4f6f410bdc 100644
--- a/scene/2d/ray_cast_2d.cpp
+++ b/scene/2d/ray_cast_2d.cpp
@@ -180,8 +180,8 @@ void RayCast2D::_notification(int p_what) {
Vector<Vector2> pts;
float tsize = 8;
pts.push_back(xf.xform(Vector2(tsize, 0)));
- pts.push_back(xf.xform(Vector2(0, 0.707 * tsize)));
- pts.push_back(xf.xform(Vector2(0, -0.707 * tsize)));
+ pts.push_back(xf.xform(Vector2(0, Math_SQRT12 * tsize)));
+ pts.push_back(xf.xform(Vector2(0, -Math_SQRT12 * tsize)));
Vector<Color> cols;
for (int i = 0; i < 3; i++)
cols.push_back(draw_col);
diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp
index d55c795d38..62684bd1e1 100644
--- a/scene/3d/path.cpp
+++ b/scene/3d/path.cpp
@@ -111,18 +111,15 @@ void PathFollow::_update_transform() {
return;
}
float bi = c->get_bake_interval();
- float o = offset;
float o_next = offset + bi;
if (loop) {
- o = Math::fposmod(o, bl);
o_next = Math::fposmod(o_next, bl);
} else if (rotation_mode == ROTATION_ORIENTED && o_next >= bl) {
- o = bl - bi;
o_next = bl;
}
- Vector3 pos = c->interpolate_baked(o, cubic);
+ Vector3 pos = c->interpolate_baked(offset, cubic);
Transform t = get_transform();
// Vector3 pos_offset = Vector3(h_offset, v_offset, 0); not used in all cases
// will be replaced by "Vector3(h_offset, v_offset, 0)" where it was formerly used
@@ -136,9 +133,9 @@ void PathFollow::_update_transform() {
else
forward.normalize();
- Vector3 up = c->interpolate_baked_up_vector(o, true);
+ Vector3 up = c->interpolate_baked_up_vector(offset, true);
- if (o_next < o) {
+ if (o_next < offset) {
Vector3 up1 = c->interpolate_baked_up_vector(o_next, true);
Vector3 axis = up.cross(up1);
@@ -166,8 +163,8 @@ void PathFollow::_update_transform() {
t.origin = pos;
- Vector3 t_prev = (pos - c->interpolate_baked(o - delta_offset, cubic)).normalized();
- Vector3 t_cur = (c->interpolate_baked(o + delta_offset, cubic) - pos).normalized();
+ Vector3 t_prev = (pos - c->interpolate_baked(offset - delta_offset, cubic)).normalized();
+ Vector3 t_cur = (c->interpolate_baked(offset + delta_offset, cubic) - pos).normalized();
Vector3 axis = t_prev.cross(t_cur);
float dot = t_prev.dot(t_cur);
@@ -190,7 +187,7 @@ void PathFollow::_update_transform() {
}
// do the additional tilting
- float tilt_angle = c->interpolate_baked_tilt(o);
+ float tilt_angle = c->interpolate_baked_tilt(offset);
Vector3 tilt_axis = t_cur; // not sure what tilt is supposed to do, is this correct??
if (likely(!Math::is_zero_approx(Math::abs(tilt_angle)))) {
@@ -256,7 +253,7 @@ void PathFollow::_validate_property(PropertyInfo &property) const {
if (path && path->get_curve().is_valid())
max = path->get_curve()->get_baked_length();
- property.hint_string = "0," + rtos(max) + ",0.01,or_greater";
+ property.hint_string = "0," + rtos(max) + ",0.01,or_lesser";
}
}
@@ -300,8 +297,8 @@ void PathFollow::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_loop", "loop"), &PathFollow::set_loop);
ClassDB::bind_method(D_METHOD("has_loop"), &PathFollow::has_loop);
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_greater"), "set_offset", "get_offset");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_lesser"), "set_offset", "get_offset");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_lesser", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset");
ADD_PROPERTY(PropertyInfo(Variant::INT, "rotation_mode", PROPERTY_HINT_ENUM, "None,Y,XY,XYZ,Oriented"), "set_rotation_mode", "get_rotation_mode");
@@ -319,8 +316,24 @@ void PathFollow::set_offset(float p_offset) {
delta_offset = p_offset - offset;
offset = p_offset;
- if (path)
+ if (path) {
+ if (path->get_curve().is_valid() && path->get_curve()->get_baked_length()) {
+ float path_length = path->get_curve()->get_baked_length();
+
+ if (loop) {
+ while (offset > path_length)
+ offset -= path_length;
+
+ while (offset < 0)
+ offset += path_length;
+
+ } else {
+ offset = CLAMP(offset, 0, path_length);
+ }
+ }
+
_update_transform();
+ }
_change_notify("offset");
_change_notify("unit_offset");
}
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index a107c3bf7a..6049b6cdb4 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -1142,25 +1142,34 @@ bool KinematicBody::move_and_collide(const Vector3 &p_motion, bool p_infinite_in
Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, bool p_stop_on_slope, int p_max_slides, float p_floor_max_angle, bool p_infinite_inertia) {
- Vector3 lv = p_linear_velocity;
+ Vector3 body_velocity = p_linear_velocity;
+ Vector3 body_velocity_normal = body_velocity.normalized();
for (int i = 0; i < 3; i++) {
if (locked_axis & (1 << i)) {
- lv[i] = 0;
+ body_velocity[i] = 0;
+ }
+ }
+
+ Vector3 current_floor_velocity = floor_velocity;
+ if (on_floor && on_floor_body.is_valid()) {
+ //this approach makes sure there is less delay between the actual body velocity and the one we saved
+ PhysicsDirectBodyState *bs = PhysicsServer::get_singleton()->body_get_direct_state(on_floor_body);
+ if (bs) {
+ current_floor_velocity = bs->get_linear_velocity();
}
}
// Hack in order to work with calling from _process as well as from _physics_process; calling from thread is risky
- Vector3 motion = (floor_velocity + lv) * (Engine::get_singleton()->is_in_physics_frame() ? get_physics_process_delta_time() : get_process_delta_time());
+ Vector3 motion = (current_floor_velocity + body_velocity) * (Engine::get_singleton()->is_in_physics_frame() ? get_physics_process_delta_time() : get_process_delta_time());
on_floor = false;
+ on_floor_body = RID();
on_ceiling = false;
on_wall = false;
colliders.clear();
floor_velocity = Vector3();
- Vector3 lv_n = p_linear_velocity.normalized();
-
while (p_max_slides) {
Collision collision;
@@ -1187,7 +1196,6 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve
colliders.push_back(collision);
motion = collision.remainder;
- bool is_on_slope = false;
if (p_floor_direction == Vector3()) {
//all is a wall
on_wall = true;
@@ -1199,16 +1207,13 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve
floor_velocity = collision.collider_vel;
if (p_stop_on_slope) {
- if ((lv_n + p_floor_direction).length() < 0.01 && collision.travel.length() < 1) {
+ if ((body_velocity_normal + p_floor_direction).length() < 0.01 && collision.travel.length() < 1) {
Transform gt = get_global_transform();
gt.origin -= collision.travel.slide(p_floor_direction);
set_global_transform(gt);
return Vector3();
}
}
-
- is_on_slope = true;
-
} else if (Math::acos(collision.normal.dot(-p_floor_direction)) <= p_floor_max_angle + FLOOR_ANGLE_THRESHOLD) { //ceiling
on_ceiling = true;
} else {
@@ -1216,18 +1221,12 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve
}
}
- if (p_stop_on_slope && is_on_slope) {
- motion = motion.slide(p_floor_direction);
- lv = lv.slide(p_floor_direction);
- } else {
- Vector3 n = collision.normal;
- motion = motion.slide(n);
- lv = lv.slide(n);
- }
+ motion = motion.slide(collision.normal);
+ body_velocity = body_velocity.slide(collision.normal);
for (int j = 0; j < 3; j++) {
if (locked_axis & (1 << j)) {
- lv[j] = 0;
+ body_velocity[j] = 0;
}
}
}
@@ -1239,7 +1238,7 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve
--p_max_slides;
}
- return lv;
+ return body_velocity;
}
Vector3 KinematicBody::move_and_slide_with_snap(const Vector3 &p_linear_velocity, const Vector3 &p_snap, const Vector3 &p_floor_direction, bool p_stop_on_slope, int p_max_slides, float p_floor_max_angle, bool p_infinite_inertia) {
@@ -2161,6 +2160,9 @@ void PhysicalBone::_notification(int p_what) {
update_bone_id();
reset_to_rest_position();
_reset_physics_simulation_state();
+ if (!joint.is_valid() && joint_data) {
+ _reload_joint();
+ }
break;
case NOTIFICATION_EXIT_TREE:
if (parent_skeleton) {
@@ -2169,7 +2171,10 @@ void PhysicalBone::_notification(int p_what) {
}
}
parent_skeleton = NULL;
- update_bone_id();
+ if (joint.is_valid()) {
+ PhysicsServer::get_singleton()->free(joint);
+ joint = RID();
+ }
break;
case NOTIFICATION_TRANSFORM_CHANGED:
if (Engine::get_singleton()->is_editor_hint()) {
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index 9a659ef4af..043d5d5548 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -322,6 +322,7 @@ Transform Spatial::get_relative_transform(const Node *p_parent) const {
void Spatial::set_translation(const Vector3 &p_translation) {
data.local_transform.origin = p_translation;
+ _change_notify("transform");
_propagate_transform_changed(this);
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
@@ -337,6 +338,7 @@ void Spatial::set_rotation(const Vector3 &p_euler_rad) {
data.rotation = p_euler_rad;
data.dirty |= DIRTY_LOCAL;
+ _change_notify("transform");
_propagate_transform_changed(this);
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
@@ -357,6 +359,7 @@ void Spatial::set_scale(const Vector3 &p_scale) {
data.scale = p_scale;
data.dirty |= DIRTY_LOCAL;
+ _change_notify("transform");
_propagate_transform_changed(this);
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index 8e09930aed..3235953730 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -1594,10 +1594,10 @@ Vector3 VoxelLightBaker::_compute_pixel_light_at_pos(const Vector3 &p_pos, const
case BAKE_QUALITY_LOW: {
//default quality
static const Vector3 dirs[4] = {
- Vector3(0.707107, 0, 0.707107),
- Vector3(0, 0.707107, 0.707107),
- Vector3(-0.707107, 0, 0.707107),
- Vector3(0, -0.707107, 0.707107)
+ Vector3(Math_SQRT12, 0, Math_SQRT12),
+ Vector3(0, Math_SQRT12, Math_SQRT12),
+ Vector3(-Math_SQRT12, 0, Math_SQRT12),
+ Vector3(0, -Math_SQRT12, Math_SQRT12)
};
static const float weights[4] = { 0.25, 0.25, 0.25, 0.25 };
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp
index 65bf1e0134..a37b75d428 100644
--- a/scene/animation/animation_node_state_machine.cpp
+++ b/scene/animation/animation_node_state_machine.cpp
@@ -312,27 +312,36 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *p_st
bool play_start = false;
if (start_request != StringName()) {
-
if (start_request_travel) {
if (!playing) {
- String node_name = start_request;
- start_request = StringName();
- ERR_FAIL_V_MSG(0, "Can't travel to '" + node_name + "' if state machine is not playing.");
- }
-
- if (!_travel(p_state_machine, start_request)) {
- //can't travel, then teleport
- path.clear();
- current = start_request;
+ if (!stop_request && p_state_machine->start_node) {
+ // can restart, just postpone traveling
+ path.clear();
+ current = p_state_machine->start_node;
+ playing = true;
+ play_start = true;
+ } else {
+ // stopped, invalid state
+ String node_name = start_request;
+ start_request = StringName(); //clear start request
+ ERR_FAIL_V_MSG(0, "Can't travel to '" + node_name + "' if state machine is not playing.");
+ }
+ } else {
+ if (!_travel(p_state_machine, start_request)) {
+ // can't travel, then teleport
+ path.clear();
+ current = start_request;
+ }
+ start_request = StringName(); //clear start request
}
} else {
+ // teleport to start
path.clear();
current = start_request;
playing = true;
play_start = true;
+ start_request = StringName(); //clear start request
}
-
- start_request = StringName(); //clear start request
}
bool do_start = (p_seek && p_time == 0) || play_start || current == StringName();
diff --git a/scene/animation/tween.h b/scene/animation/tween.h
index 574238f5c9..e4c95a93d6 100644
--- a/scene/animation/tween.h
+++ b/scene/animation/tween.h
@@ -101,6 +101,12 @@ private:
int args;
Variant arg[5];
int uid;
+ InterpolateData() {
+ active = false;
+ finish = false;
+ call_deferred = false;
+ uid = 0;
+ }
};
String autoplay;
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index ca4c255855..a68462f4d4 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -190,6 +190,13 @@ void Button::_notification(int p_what) {
Point2 icon_ofs = !_icon.is_null() ? Point2(icon_region.size.width + get_constant("hseparation"), 0) : Point2();
int text_clip = size.width - style->get_minimum_size().width - icon_ofs.width;
+ if (_internal_margin[MARGIN_LEFT] > 0) {
+ text_clip -= _internal_margin[MARGIN_LEFT] + get_constant("hseparation");
+ }
+ if (_internal_margin[MARGIN_RIGHT] > 0) {
+ text_clip -= _internal_margin[MARGIN_RIGHT] + get_constant("hseparation");
+ }
+
Point2 text_ofs = (size - style->get_minimum_size() - icon_ofs - font->get_string_size(xl_text) - Point2(_internal_margin[MARGIN_RIGHT] - _internal_margin[MARGIN_LEFT], 0)) / 2.0;
switch (align) {
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 6400061309..dd9e11508f 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -558,25 +558,25 @@ void FileDialog::update_filters() {
const int max_filters = 5;
for (int i = 0; i < MIN(max_filters, filters.size()); i++) {
- String flt = filters[i].get_slice(";", 0);
+ String flt = filters[i].get_slice(";", 0).strip_edges();
if (i > 0)
- all_filters += ",";
+ all_filters += ", ";
all_filters += flt;
}
if (max_filters < filters.size())
all_filters += ", ...";
- filter->add_item(RTR("All Recognized") + " ( " + all_filters + " )");
+ filter->add_item(RTR("All Recognized") + " (" + all_filters + ")");
}
for (int i = 0; i < filters.size(); i++) {
String flt = filters[i].get_slice(";", 0).strip_edges();
String desc = filters[i].get_slice(";", 1).strip_edges();
if (desc.length())
- filter->add_item(String(tr(desc)) + " ( " + flt + " )");
+ filter->add_item(String(tr(desc)) + " (" + flt + ")");
else
- filter->add_item("( " + flt + " )");
+ filter->add_item("(" + flt + ")");
}
filter->add_item(RTR("All Files (*)"));
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 3884622942..20bbcbde80 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -973,12 +973,12 @@ void ItemList::_notification(int p_what) {
float max = MAX(page, ofs.y + max_h);
if (auto_height)
auto_height_value = ofs.y + max_h + bg->get_minimum_size().height;
+ scroll_bar->set_max(max);
+ scroll_bar->set_page(page);
if (max <= page) {
scroll_bar->set_value(0);
scroll_bar->hide();
} else {
- scroll_bar->set_max(max);
- scroll_bar->set_page(page);
scroll_bar->show();
if (do_autoscroll_to_bottom)
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index ab6f80bfa9..d96ca69c87 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -704,7 +704,7 @@ void LineEdit::_notification(int p_what) {
}
int x_ofs = 0;
- bool using_placeholder = text.empty();
+ bool using_placeholder = text.empty() && ime_text.empty();
int cached_text_width = using_placeholder ? cached_placeholder_width : cached_width;
switch (align) {
@@ -823,7 +823,7 @@ void LineEdit::_notification(int p_what) {
int yofs = y_ofs + (caret_height - font->get_height()) / 2;
drawer.draw_char(ci, Point2(x_ofs, yofs + font_ascent), cchar, next, selected ? font_color_selected : font_color);
- if (char_ofs == cursor_pos && draw_caret) {
+ if (char_ofs == cursor_pos && draw_caret && !using_placeholder) {
if (ime_text.length() == 0) {
#ifdef TOOLS_ENABLED
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(Math::round(EDSCALE), caret_height)), cursor_color);
@@ -866,12 +866,27 @@ void LineEdit::_notification(int p_what) {
}
}
- if (char_ofs == cursor_pos && draw_caret) { // May be at the end.
+ if ((char_ofs == cursor_pos || using_placeholder) && draw_caret) { // May be at the end, or placeholder.
if (ime_text.length() == 0) {
+ int caret_x_ofs = x_ofs;
+ if (using_placeholder) {
+ switch (align) {
+ case ALIGN_LEFT:
+ case ALIGN_FILL: {
+ caret_x_ofs = style->get_offset().x;
+ } break;
+ case ALIGN_CENTER: {
+ caret_x_ofs = ofs_max / 2;
+ } break;
+ case ALIGN_RIGHT: {
+ caret_x_ofs = ofs_max;
+ } break;
+ }
+ }
#ifdef TOOLS_ENABLED
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(Math::round(EDSCALE), caret_height)), cursor_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(caret_x_ofs, y_ofs), Size2(Math::round(EDSCALE), caret_height)), cursor_color);
#else
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(1, caret_height)), cursor_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(caret_x_ofs, y_ofs), Size2(1, caret_height)), cursor_color);
#endif
}
}
@@ -970,6 +985,8 @@ void LineEdit::undo() {
undo_stack_pos = undo_stack_pos->prev();
TextOperation op = undo_stack_pos->get();
text = op.text;
+ cached_width = op.cached_width;
+ window_pos = op.window_pos;
set_cursor_position(op.cursor_pos);
if (expand_to_text_length)
@@ -988,6 +1005,8 @@ void LineEdit::redo() {
undo_stack_pos = undo_stack_pos->next();
TextOperation op = undo_stack_pos->get();
text = op.text;
+ cached_width = op.cached_width;
+ window_pos = op.window_pos;
set_cursor_position(op.cursor_pos);
if (expand_to_text_length)
@@ -1169,6 +1188,10 @@ void LineEdit::delete_char() {
set_cursor_position(get_cursor_position() - 1);
+ if (align == ALIGN_CENTER || align == ALIGN_RIGHT) {
+ window_pos = CLAMP(window_pos - 1, 0, text.length() - 1);
+ }
+
_text_changed();
}
@@ -1196,6 +1219,10 @@ void LineEdit::delete_text(int p_from_column, int p_to_column) {
window_pos = cursor_pos;
}
+ if (align == ALIGN_CENTER || align == ALIGN_RIGHT) {
+ window_pos = CLAMP(window_pos - (p_to_column - p_from_column), 0, text.length() - 1);
+ }
+
if (!text_changed_dirty) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_text_changed");
@@ -1677,7 +1704,9 @@ void LineEdit::_clear_undo_stack() {
void LineEdit::_create_undo_state() {
TextOperation op;
op.text = text;
+ op.cached_width = cached_width;
op.cursor_pos = cursor_pos;
+ op.window_pos = window_pos;
undo_stack.push_back(op);
}
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h
index 3424131dad..ebe49091eb 100644
--- a/scene/gui/line_edit.h
+++ b/scene/gui/line_edit.h
@@ -106,6 +106,8 @@ private:
struct TextOperation {
int cursor_pos;
+ int window_pos;
+ int cached_width;
String text;
};
List<TextOperation> undo_stack;
diff --git a/scene/gui/rich_text_effect.cpp b/scene/gui/rich_text_effect.cpp
index f9e0be5b31..ab2f8d2172 100644
--- a/scene/gui/rich_text_effect.cpp
+++ b/scene/gui/rich_text_effect.cpp
@@ -89,8 +89,6 @@ void CharFXTransform::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_character"), &CharFXTransform::get_character);
ClassDB::bind_method(D_METHOD("set_character", "character"), &CharFXTransform::set_character);
- ClassDB::bind_method(D_METHOD("get_value_or", "key", "default_value"), &CharFXTransform::get_value_or);
-
ADD_PROPERTY(PropertyInfo(Variant::INT, "relative_index"), "set_relative_index", "get_relative_index");
ADD_PROPERTY(PropertyInfo(Variant::INT, "absolute_index"), "set_absolute_index", "get_absolute_index");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "elapsed_time"), "set_elapsed_time", "get_elapsed_time");
@@ -101,17 +99,6 @@ void CharFXTransform::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "character"), "set_character", "get_character");
}
-Variant CharFXTransform::get_value_or(String p_key, Variant p_default_value) {
- if (!this->environment.has(p_key))
- return p_default_value;
-
- Variant r = environment[p_key];
- if (r.get_type() != p_default_value.get_type())
- return p_default_value;
-
- return r;
-}
-
CharFXTransform::CharFXTransform() {
relative_index = 0;
absolute_index = 0;
diff --git a/scene/gui/rich_text_effect.h b/scene/gui/rich_text_effect.h
index 4330cebfe6..9e0065b199 100644
--- a/scene/gui/rich_text_effect.h
+++ b/scene/gui/rich_text_effect.h
@@ -82,8 +82,6 @@ public:
void set_character(int p_char) { character = (CharType)p_char; }
Dictionary get_environment() { return environment; }
void set_environment(Dictionary p_environment) { environment = p_environment; }
-
- Variant get_value_or(String p_key, Variant p_default_value);
};
#endif // RICH_TEXT_EFFECT_H
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 0331046492..abca865ae0 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -1701,6 +1701,9 @@ bool RichTextLabel::remove_line(const int p_line) {
if (!was_newline) {
current_frame->lines.remove(p_line);
+ if (current_frame->lines.size() == 0) {
+ current_frame->lines.resize(1);
+ }
}
if (p_line == 0 && current->subitems.size() > 0)
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index bf067898e6..de25d6a63d 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -211,6 +211,10 @@ void SpinBox::_notification(int p_what) {
_adjust_width_for_icon(get_icon("updown"));
_value_changed(0);
+ } else if (p_what == NOTIFICATION_THEME_CHANGED) {
+
+ call_deferred("minimum_size_changed");
+ get_line_edit()->call_deferred("minimum_size_changed");
}
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 2558a930b6..bf3ec9b05b 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4438,7 +4438,6 @@ int TextEdit::get_line_wrap_index_at_col(int p_line, int p_column) const {
}
void TextEdit::cursor_set_column(int p_col, bool p_adjust_viewport) {
-
if (p_col < 0)
p_col = 0;
@@ -7141,6 +7140,7 @@ TextEdit::TextEdit() {
max_chars = 0;
clear();
wrap_enabled = false;
+ wrap_at = 0;
wrap_right_offset = 10;
set_focus_mode(FOCUS_ALL);
syntax_highlighter = NULL;
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 594366de7d..4f11e9bb50 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -69,6 +69,10 @@ public:
int region;
bool end;
+ ColorRegionInfo() {
+ region = 0;
+ end = false;
+ }
};
struct Line {
@@ -84,6 +88,16 @@ public:
Ref<Texture> info_icon;
String info;
String data;
+ Line() {
+ width_cache = 0;
+ marked = false;
+ breakpoint = false;
+ bookmark = false;
+ hidden = false;
+ safe = false;
+ has_info = false;
+ wrap_amount_cache = 0;
+ }
};
private:
@@ -143,6 +157,14 @@ private:
int last_fit_x;
int line, column; ///< cursor
int x_ofs, line_ofs, wrap_ofs;
+ Cursor() {
+ last_fit_x = 0;
+ line = 0;
+ column = 0; ///< cursor
+ x_ofs = 0;
+ line_ofs = 0;
+ wrap_ofs = 0;
+ }
} cursor;
struct Selection {
@@ -167,7 +189,21 @@ private:
int to_line, to_column;
bool shiftclick_left;
-
+ Selection() {
+ selecting_mode = MODE_NONE;
+ selecting_line = 0;
+ selecting_column = 0;
+ selected_word_beg = 0;
+ selected_word_end = 0;
+ selected_word_origin = 0;
+ selecting_text = false;
+ active = false;
+ from_line = 0;
+ from_column = 0;
+ to_line = 0;
+ to_column = 0;
+ shiftclick_left = false;
+ }
} selection;
struct Cache {
@@ -219,6 +255,16 @@ private:
int fold_gutter_width;
int info_gutter_width;
int minimap_width;
+ Cache() {
+
+ row_height = 0;
+ line_spacing = 0;
+ line_number_w = 0;
+ breakpoint_gutter_width = 0;
+ fold_gutter_width = 0;
+ info_gutter_width = 0;
+ minimap_width = 0;
+ }
} cache;
Map<int, int> color_region_cache;
@@ -240,6 +286,17 @@ private:
uint32_t version;
bool chain_forward;
bool chain_backward;
+ TextOperation() {
+ type = TYPE_NONE;
+ from_line = 0;
+ from_column = 0;
+ to_line = 0;
+ to_column = 0;
+ prev_version = 0;
+ version = 0;
+ chain_forward = false;
+ chain_backward = false;
+ }
};
String ime_text;
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 3a6fff45c5..48f6a0cc95 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -423,7 +423,7 @@ void SceneTree::input_event(const Ref<InputEvent> &p_event) {
input_handled = false;
- Ref<InputEvent> ev = p_event;
+ const Ref<InputEvent> &ev = p_event;
MainLoop::input_event(ev);
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 99a2881d58..7524571956 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -657,6 +657,7 @@ void DynamicFont::_reload_cache() {
if (!data.is_valid()) {
data_at_size.unref();
outline_data_at_size.unref();
+ fallbacks.resize(0);
fallback_data_at_size.resize(0);
fallback_outline_data_at_size.resize(0);
return;
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 7d62873bbd..5ce269fff9 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -397,6 +397,9 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
if (p_owner->get_scene_inherited_state().is_null() && (p_node == p_owner || (p_node->get_owner() == p_owner && (p_node->get_parent() == p_owner || p_node->get_parent()->get_owner() == p_owner)))) {
//do not save index, because it belongs to saved scene and scene is not inherited
nd.index = -1;
+ } else if (p_node == p_owner) {
+ //This (hopefully) happens if the node is a scene root, so its index is irrelevant.
+ nd.index = -1;
} else {
//part of an inherited scene, or parent is from an instanced scene
nd.index = p_node->get_index();
diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp
index 62c5f9bab3..cc6ec93d74 100644
--- a/scene/resources/segment_shape_2d.cpp
+++ b/scene/resources/segment_shape_2d.cpp
@@ -120,8 +120,8 @@ void RayShape2D::draw(const RID &p_to_rid, const Color &p_color) {
Vector<Vector2> pts;
float tsize = 4;
pts.push_back(tip + Vector2(0, tsize));
- pts.push_back(tip + Vector2(0.707 * tsize, 0));
- pts.push_back(tip + Vector2(-0.707 * tsize, 0));
+ pts.push_back(tip + Vector2(Math_SQRT12 * tsize, 0));
+ pts.push_back(tip + Vector2(-Math_SQRT12 * tsize, 0));
Vector<Color> cols;
for (int i = 0; i < 3; i++)
cols.push_back(p_color);
@@ -134,7 +134,7 @@ Rect2 RayShape2D::get_rect() const {
Rect2 rect;
rect.position = Vector2();
rect.expand_to(Vector2(0, length));
- rect = rect.grow(0.707 * 4);
+ rect = rect.grow(Math_SQRT12 * 4);
return rect;
}
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 593c399f62..b21546af2f 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -1333,6 +1333,7 @@ void LargeTexture::set_piece_offset(int p_idx, const Point2 &p_offset) {
void LargeTexture::set_piece_texture(int p_idx, const Ref<Texture> &p_texture) {
ERR_FAIL_COND(p_texture == this);
+ ERR_FAIL_COND(p_texture.is_null());
ERR_FAIL_INDEX(p_idx, pieces.size());
pieces.write[p_idx].texture = p_texture;
};
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index c897365b21..bf9079c9f4 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -720,7 +720,10 @@ void Theme::clear() {
while ((K = icon_map.next(K))) {
const StringName *L = NULL;
while ((L = icon_map[*K].next(L))) {
- icon_map[*K][*L]->disconnect("changed", this, "_emit_theme_changed");
+ Ref<Texture> icon = icon_map[*K][*L];
+ if (icon.is_valid()) {
+ icon->disconnect("changed", this, "_emit_theme_changed");
+ }
}
}
}
@@ -730,7 +733,10 @@ void Theme::clear() {
while ((K = style_map.next(K))) {
const StringName *L = NULL;
while ((L = style_map[*K].next(L))) {
- style_map[*K][*L]->disconnect("changed", this, "_emit_theme_changed");
+ Ref<StyleBox> style = style_map[*K][*L];
+ if (style.is_valid()) {
+ style->disconnect("changed", this, "_emit_theme_changed");
+ }
}
}
}
@@ -740,7 +746,10 @@ void Theme::clear() {
while ((K = font_map.next(K))) {
const StringName *L = NULL;
while ((L = font_map[*K].next(L))) {
- font_map[*K][*L]->disconnect("changed", this, "_emit_theme_changed");
+ Ref<Font> font = font_map[*K][*L];
+ if (font.is_valid()) {
+ font->disconnect("changed", this, "_emit_theme_changed");
+ }
}
}
}
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index 9f99732714..797de1d863 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -2259,6 +2259,8 @@ void VisualShaderNodeGroupBase::set_input_port_type(int p_id, int p_type) {
int index = 0;
for (int i = 0; i < inputs_strings.size(); i++) {
Vector<String> arr = inputs_strings[i].split(",");
+ ERR_FAIL_COND(arr.size() != 3);
+
if (arr[0].to_int() == p_id) {
index += arr[0].size();
count = arr[1].size() - 1;
@@ -2292,6 +2294,8 @@ void VisualShaderNodeGroupBase::set_input_port_name(int p_id, const String &p_na
int index = 0;
for (int i = 0; i < inputs_strings.size(); i++) {
Vector<String> arr = inputs_strings[i].split(",");
+ ERR_FAIL_COND(arr.size() != 3);
+
if (arr[0].to_int() == p_id) {
index += arr[0].size() + arr[1].size();
count = arr[2].size() - 1;
@@ -2325,6 +2329,8 @@ void VisualShaderNodeGroupBase::set_output_port_type(int p_id, int p_type) {
int index = 0;
for (int i = 0; i < output_strings.size(); i++) {
Vector<String> arr = output_strings[i].split(",");
+ ERR_FAIL_COND(arr.size() != 3);
+
if (arr[0].to_int() == p_id) {
index += arr[0].size();
count = arr[1].size() - 1;
@@ -2358,6 +2364,8 @@ void VisualShaderNodeGroupBase::set_output_port_name(int p_id, const String &p_n
int index = 0;
for (int i = 0; i < output_strings.size(); i++) {
Vector<String> arr = output_strings[i].split(",");
+ ERR_FAIL_COND(arr.size() != 3);
+
if (arr[0].to_int() == p_id) {
index += arr[0].size() + arr[1].size();
count = arr[2].size() - 1;
@@ -2405,6 +2413,8 @@ void VisualShaderNodeGroupBase::_apply_port_changes() {
for (int i = 0; i < inputs_strings.size(); i++) {
Vector<String> arr = inputs_strings[i].split(",");
+ ERR_FAIL_COND(arr.size() != 3);
+
Port port;
port.type = (PortType)arr[1].to_int();
port.name = arr[2];
@@ -2412,6 +2422,8 @@ void VisualShaderNodeGroupBase::_apply_port_changes() {
}
for (int i = 0; i < outputs_strings.size(); i++) {
Vector<String> arr = outputs_strings[i].split(",");
+ ERR_FAIL_COND(arr.size() != 3);
+
Port port;
port.type = (PortType)arr[1].to_int();
port.name = arr[2];
diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp
index a94fdd9d7b..6e4b5d9af0 100644
--- a/scene/resources/visual_shader_nodes.cpp
+++ b/scene/resources/visual_shader_nodes.cpp
@@ -715,6 +715,7 @@ void VisualShaderNodeTexture::_bind_methods() {
BIND_ENUM_CONSTANT(SOURCE_2D_TEXTURE);
BIND_ENUM_CONSTANT(SOURCE_2D_NORMAL);
BIND_ENUM_CONSTANT(SOURCE_DEPTH);
+ BIND_ENUM_CONSTANT(SOURCE_PORT);
BIND_ENUM_CONSTANT(TYPE_DATA);
BIND_ENUM_CONSTANT(TYPE_COLOR);
BIND_ENUM_CONSTANT(TYPE_NORMALMAP);
diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp
index 83d78daff4..3b6b1de806 100644
--- a/servers/audio/effects/audio_effect_record.cpp
+++ b/servers/audio/effects/audio_effect_record.cpp
@@ -192,10 +192,11 @@ void AudioEffectRecord::set_recording_active(bool p_record) {
}
ensure_thread_stopped();
+ recording_active = true;
current_instance->init();
+ } else {
+ recording_active = false;
}
-
- recording_active = p_record;
}
bool AudioEffectRecord::is_recording_active() const {
diff --git a/servers/camera_server.cpp b/servers/camera_server.cpp
index 0f93221072..6912a37fc5 100644
--- a/servers/camera_server.cpp
+++ b/servers/camera_server.cpp
@@ -35,6 +35,8 @@
////////////////////////////////////////////////////////
// CameraServer
+CameraServer::CreateFunc CameraServer::create_func = NULL;
+
void CameraServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_feed", "index"), &CameraServer::get_feed);
ClassDB::bind_method(D_METHOD("get_feed_count"), &CameraServer::get_feed_count);
diff --git a/servers/camera_server.h b/servers/camera_server.h
index c76d046e58..aa10f4dbb9 100644
--- a/servers/camera_server.h
+++ b/servers/camera_server.h
@@ -59,17 +59,36 @@ public:
FEED_IMAGES = 2
};
+ typedef CameraServer *(*CreateFunc)();
+
private:
protected:
+ static CreateFunc create_func;
+
Vector<Ref<CameraFeed> > feeds;
static CameraServer *singleton;
static void _bind_methods();
+ template <class T>
+ static CameraServer *_create_builtin() {
+ return memnew(T);
+ }
+
public:
static CameraServer *get_singleton();
+ template <class T>
+ static void make_default() {
+ create_func = _create_builtin<T>;
+ }
+
+ static CameraServer *create() {
+ CameraServer *server = create_func ? create_func() : memnew(CameraServer);
+ return server;
+ };
+
// Right now we identify our feed by it's ID when it's used in the background.
// May see if we can change this to purely relying on CameraFeed objects or by name.
int get_free_id();
diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp
index 1b3de3e913..cd86128dc3 100644
--- a/servers/physics/joints/cone_twist_joint_sw.cpp
+++ b/servers/physics/joints/cone_twist_joint_sw.cpp
@@ -53,7 +53,7 @@ Written by: Marcus Hennix
static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) {
- if (Math::abs(n.z) > 0.707106781186547524400844362) {
+ if (Math::abs(n.z) > Math_SQRT12) {
// choose p in y-z plane
real_t a = n[1] * n[1] + n[2] * n[2];
real_t k = 1.0 / Math::sqrt(a);
diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp
index 209cddda5e..633f0b4921 100644
--- a/servers/physics/joints/hinge_joint_sw.cpp
+++ b/servers/physics/joints/hinge_joint_sw.cpp
@@ -51,7 +51,7 @@ subject to the following restrictions:
static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) {
- if (Math::abs(n.z) > 0.707106781186547524400844362) {
+ if (Math::abs(n.z) > Math_SQRT12) {
// choose p in y-z plane
real_t a = n[1] * n[1] + n[2] * n[2];
real_t k = 1.0 / Math::sqrt(a);
diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp
index 80e204087a..73baab2dd6 100644
--- a/servers/physics_2d/physics_2d_server_sw.cpp
+++ b/servers/physics_2d/physics_2d_server_sw.cpp
@@ -174,7 +174,7 @@ void Physics2DServerSW::_shape_col_cbk(const Vector2 &p_point_A, const Vector2 &
}
Vector2 rel_dir = (p_point_A - p_point_B).normalized();
- if (cbk->valid_dir.dot(rel_dir) < 0.7071) { //sqrt(2)/2.0 - 45 degrees
+ if (cbk->valid_dir.dot(rel_dir) < Math_SQRT12) { //sqrt(2)/2.0 - 45 degrees
cbk->invalid_by_dir++;
/*
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 316a94556d..1aceb8dcd8 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -2912,7 +2912,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
tk = _get_token();
if (tk.type == TK_PARENTHESIS_OPEN) {
//a function
- StringName name = identifier;
+ const StringName &name = identifier;
OperatorNode *func = alloc_node<OperatorNode>();
func->op = OP_CALL;
@@ -5099,7 +5099,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
if (!expr)
return ERR_PARSE_ERROR;
- if (expr->type != Node::TYPE_CONSTANT) {
+ if (expr->type == Node::TYPE_OPERATOR && ((OperatorNode *)expr)->op == OP_CALL) {
_set_error("Expected constant expression after '='");
return ERR_PARSE_ERROR;
}
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index 7bb97e0577..49b5562b6c 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -783,7 +783,7 @@ void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2
canvas_item->commands.push_back(polygon);
}
-void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, const Vector<int> &p_bones, const Vector<float> &p_weights, RID p_texture, int p_count, RID p_normal_map) {
+void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, const Vector<int> &p_bones, const Vector<float> &p_weights, RID p_texture, int p_count, RID p_normal_map, bool p_antialiased) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -822,7 +822,7 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector
polygon->weights = p_weights;
polygon->indices = indices;
polygon->count = count;
- polygon->antialiased = false;
+ polygon->antialiased = p_antialiased;
canvas_item->rect_dirty = true;
canvas_item->commands.push_back(polygon);
diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h
index 822e3f8ce3..cf2eefdec6 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/visual/visual_server_canvas.h
@@ -200,7 +200,7 @@ public:
void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, VS::NinePatchAxisMode p_x_axis_mode = VS::NINE_PATCH_STRETCH, VS::NinePatchAxisMode p_y_axis_mode = VS::NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1), RID p_normal_map = RID());
void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID());
void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID(), bool p_antialiased = false);
- void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID());
+ void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID(), bool p_antialiased = false);
void canvas_item_add_mesh(RID p_item, const RID &p_mesh, const Transform2D &p_transform = Transform2D(), const Color &p_modulate = Color(1, 1, 1), RID p_texture = RID(), RID p_normal_map = RID());
void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID());
void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal);
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 06096781fe..4cef86db30 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -602,7 +602,7 @@ public:
BIND11(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &, RID)
BIND7(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float, RID)
BIND7(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, RID, bool)
- BIND10(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int, RID)
+ BIND11(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int, RID, bool)
BIND6(canvas_item_add_mesh, RID, const RID &, const Transform2D &, const Color &, RID, RID)
BIND4(canvas_item_add_multimesh, RID, RID, RID, RID)
BIND4(canvas_item_add_particles, RID, RID, RID, RID)
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index 59df51ff19..ff42dcf00b 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -520,7 +520,7 @@ public:
FUNC11(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &, RID)
FUNC7(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float, RID)
FUNC7(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, RID, bool)
- FUNC10(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int, RID)
+ FUNC11(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int, RID, bool)
FUNC6(canvas_item_add_mesh, RID, const RID &, const Transform2D &, const Color &, RID, RID)
FUNC4(canvas_item_add_multimesh, RID, RID, RID, RID)
FUNC4(canvas_item_add_particles, RID, RID, RID, RID)
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index a1ba946d8c..b09a191cdc 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -1693,7 +1693,7 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("mesh_create"), &VisualServer::mesh_create);
ClassDB::bind_method(D_METHOD("mesh_surface_get_format_offset", "format", "vertex_len", "index_len", "array_index"), &VisualServer::mesh_surface_get_format_offset);
ClassDB::bind_method(D_METHOD("mesh_surface_get_format_stride", "format", "vertex_len", "index_len"), &VisualServer::mesh_surface_get_format_stride);
- ClassDB::bind_method(D_METHOD("mesh_add_surface_from_arrays", "mesh", "primtive", "arrays", "blend_shapes", "compress_format"), &VisualServer::mesh_add_surface_from_arrays, DEFVAL(Array()), DEFVAL(ARRAY_COMPRESS_DEFAULT));
+ ClassDB::bind_method(D_METHOD("mesh_add_surface_from_arrays", "mesh", "primitive", "arrays", "blend_shapes", "compress_format"), &VisualServer::mesh_add_surface_from_arrays, DEFVAL(Array()), DEFVAL(ARRAY_COMPRESS_DEFAULT));
ClassDB::bind_method(D_METHOD("mesh_set_blend_shape_count", "mesh", "amount"), &VisualServer::mesh_set_blend_shape_count);
ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_count", "mesh"), &VisualServer::mesh_get_blend_shape_count);
ClassDB::bind_method(D_METHOD("mesh_set_blend_shape_mode", "mesh", "mode"), &VisualServer::mesh_set_blend_shape_mode);
@@ -1717,6 +1717,7 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("mesh_get_custom_aabb", "mesh"), &VisualServer::mesh_get_custom_aabb);
ClassDB::bind_method(D_METHOD("mesh_clear", "mesh"), &VisualServer::mesh_clear);
+ ClassDB::bind_method(D_METHOD("multimesh_create"), &VisualServer::multimesh_create);
ClassDB::bind_method(D_METHOD("multimesh_allocate", "multimesh", "instances", "transform_format", "color_format", "custom_data_format"), &VisualServer::multimesh_allocate, DEFVAL(MULTIMESH_CUSTOM_DATA_NONE));
ClassDB::bind_method(D_METHOD("multimesh_get_instance_count", "multimesh"), &VisualServer::multimesh_get_instance_count);
ClassDB::bind_method(D_METHOD("multimesh_set_mesh", "multimesh", "mesh"), &VisualServer::multimesh_set_mesh);
@@ -1973,7 +1974,7 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("canvas_item_add_nine_patch", "item", "rect", "source", "texture", "topleft", "bottomright", "x_axis_mode", "y_axis_mode", "draw_center", "modulate", "normal_map"), &VisualServer::canvas_item_add_nine_patch, DEFVAL(NINE_PATCH_STRETCH), DEFVAL(NINE_PATCH_STRETCH), DEFVAL(true), DEFVAL(Color(1, 1, 1)), DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_primitive", "item", "points", "colors", "uvs", "texture", "width", "normal_map"), &VisualServer::canvas_item_add_primitive, DEFVAL(1.0), DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_polygon", "item", "points", "colors", "uvs", "texture", "normal_map", "antialiased"), &VisualServer::canvas_item_add_polygon, DEFVAL(Vector<Point2>()), DEFVAL(RID()), DEFVAL(RID()), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "bones", "weights", "texture", "count", "normal_map"), &VisualServer::canvas_item_add_triangle_array, DEFVAL(Vector<Point2>()), DEFVAL(Vector<int>()), DEFVAL(Vector<float>()), DEFVAL(RID()), DEFVAL(-1), DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "bones", "weights", "texture", "count", "normal_map", "antialiased"), &VisualServer::canvas_item_add_triangle_array, DEFVAL(Vector<Point2>()), DEFVAL(Vector<int>()), DEFVAL(Vector<float>()), DEFVAL(RID()), DEFVAL(-1), DEFVAL(RID()), DEFVAL(false));
ClassDB::bind_method(D_METHOD("canvas_item_add_mesh", "item", "mesh", "transform", "modulate", "texture", "normal_map"), &VisualServer::canvas_item_add_mesh, DEFVAL(Transform2D()), DEFVAL(Color(1, 1, 1)), DEFVAL(RID()), DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_multimesh", "item", "mesh", "texture", "normal_map"), &VisualServer::canvas_item_add_multimesh, DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_particles", "item", "particles", "texture", "normal_map"), &VisualServer::canvas_item_add_particles);
diff --git a/servers/visual_server.h b/servers/visual_server.h
index b1daf87e56..acf02eee56 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -903,7 +903,7 @@ public:
virtual void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, NinePatchAxisMode p_x_axis_mode = NINE_PATCH_STRETCH, NinePatchAxisMode p_y_axis_mode = NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1), RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID(), bool p_antialiased = false) = 0;
- virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID()) = 0;
+ virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID(), bool p_antialiased = false) = 0;
virtual void canvas_item_add_mesh(RID p_item, const RID &p_mesh, const Transform2D &p_transform = Transform2D(), const Color &p_modulate = Color(1, 1, 1), RID p_texture = RID(), RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map) = 0;
diff --git a/thirdparty/misc/ifaddrs-android.h b/thirdparty/misc/ifaddrs-android.h
index 6e204af26f..8de94324b8 100644
--- a/thirdparty/misc/ifaddrs-android.h
+++ b/thirdparty/misc/ifaddrs-android.h
@@ -32,6 +32,11 @@
// Fills out a list of ifaddr structs (see below) which contain information
// about every network interface available on the host.
// See 'man getifaddrs' on Linux or OS X (nb: it is not a POSIX function).
+// -- GODOT start --
+#ifdef __cplusplus
+extern "C" {
+#endif
+// -- GODOT end --
struct ifaddrs {
struct ifaddrs* ifa_next;
char* ifa_name;
@@ -40,7 +45,21 @@ struct ifaddrs {
struct sockaddr* ifa_netmask;
// Real ifaddrs has broadcast, point to point and data members.
// We don't need them (yet?).
+ // -- GODOT start --
+ // We never initialize the following members. We only define them to match the ifaddrs struct.
+ union
+ {
+ struct sockaddr *ifu_broadaddr;
+ struct sockaddr *ifu_dstaddr;
+ } ifa_ifu;
+ void *ifa_data;
+ // -- GODOT end --
};
+// -- GODOT start --
+#ifdef __cplusplus
+}
+#endif
+// -- GODOT end --
int getifaddrs(struct ifaddrs** result);
void freeifaddrs(struct ifaddrs* addrs);
#endif // TALK_BASE_IFADDRS_ANDROID_H_
diff --git a/thirdparty/vhacd/0003-fix-musl-build.patch b/thirdparty/vhacd/0003-fix-musl-build.patch
new file mode 100644
index 0000000000..67af8546f3
--- /dev/null
+++ b/thirdparty/vhacd/0003-fix-musl-build.patch
@@ -0,0 +1,15 @@
+diff --git a/thirdparty/vhacd/inc/vhacdMutex.h b/thirdparty/vhacd/inc/vhacdMutex.h
+index 6b09259200..d587dd6387 100644
+--- a/thirdparty/vhacd/inc/vhacdMutex.h
++++ b/thirdparty/vhacd/inc/vhacdMutex.h
+@@ -71,7 +71,9 @@
+ #include <pthread.h>
+ #endif
+
+-#if defined(__APPLE__)
++// -- GODOT start --
++#if defined(__APPLE__) || !defined(__GLIBC__)
++// -- GODOT end --
+ #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+ #endif
+
diff --git a/thirdparty/vhacd/inc/vhacdMutex.h b/thirdparty/vhacd/inc/vhacdMutex.h
index 6b09259200..d587dd6387 100644
--- a/thirdparty/vhacd/inc/vhacdMutex.h
+++ b/thirdparty/vhacd/inc/vhacdMutex.h
@@ -71,7 +71,9 @@
#include <pthread.h>
#endif
-#if defined(__APPLE__)
+// -- GODOT start --
+#if defined(__APPLE__) || !defined(__GLIBC__)
+// -- GODOT end --
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#endif