diff options
-rw-r--r-- | COPYRIGHT.txt | 40 | ||||
-rw-r--r-- | doc/classes/String.xml | 6 | ||||
-rw-r--r-- | drivers/dummy/rasterizer_dummy.h | 77 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 61 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.h | 9 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 9 | ||||
-rw-r--r-- | modules/regex/doc_classes/RegEx.xml | 4 | ||||
-rw-r--r-- | modules/webxr/native/library_godot_webxr.js | 8 | ||||
-rw-r--r-- | modules/webxr/webxr_interface_js.cpp | 6 | ||||
-rw-r--r-- | platform/javascript/SCsub | 17 | ||||
-rw-r--r-- | platform/javascript/detect.py | 5 | ||||
-rw-r--r-- | platform/javascript/emscripten_helpers.py | 6 | ||||
-rw-r--r-- | platform/javascript/http_client_javascript.cpp | 4 | ||||
-rw-r--r-- | platform/javascript/javascript_main.cpp | 2 |
14 files changed, 166 insertions, 88 deletions
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index d0055f3687..655c008083 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -30,7 +30,7 @@ # (e.g. a public domain dedication), but as far as Godot Engine is concerned # the library is considered as a whole under the Zlib license. # -# Nota: When linking dynamically against thirdparty libraries instead of +# Note: When linking dynamically against thirdparty libraries instead of # building them into the Godot binary, you may remove the corresponding # license details from this file. @@ -62,40 +62,34 @@ Copyright: 2006-2020, assimp team 2014-2021, Godot Engine contributors. License: BSD-3-clause -Files: ./platform/android/java/lib/aidl/com/android/vending/licensing/ +Files: ./platform/android/java/lib/aidl/com/android/* ./platform/android/java/lib/res/layout/status_bar_ongoing_event_progress_bar.xml - ./platform/android/java/lib/src/com/google/android/vending/expansion/downloader/ - ./platform/android/java/lib/src/com/google/android/vending/licensing/ + ./platform/android/java/lib/src/com/google/android/* ./platform/android/java/lib/src/org/godotengine/godot/input/InputManagerCompat.java ./platform/android/java/lib/src/org/godotengine/godot/input/InputManagerV16.java Comment: The Android Open Source Project -Copyright: 2008-2013, The Android Open Source Project +Copyright: 2008-2016, The Android Open Source Project + 2002, Google, Inc. License: Apache-2.0 -Files: ./platform/android/java/src/com/android/vending/licensing/util/Base64.java - ./platform/android/java/src/com/android/vending/licensing/util/Base64DecoderException.java -Comment: The Android Open Source Project -Copyright: 2002, Google Inc. -License: Apache-2.0 - -Files: ./servers/physics/gjk_epa.cpp - ./servers/physics/joints/generic_6dof_joint_sw.cpp - ./servers/physics/joints/generic_6dof_joint_sw.h - ./servers/physics/joints/hinge_joint_sw.cpp - ./servers/physics/joints/hinge_joint_sw.h - ./servers/physics/joints/jacobian_entry_sw.h - ./servers/physics/joints/pin_joint_sw.cpp - ./servers/physics/joints/pin_joint_sw.h - ./servers/physics/joints/slider_joint_sw.cpp - ./servers/physics/joints/slider_joint_sw.h +Files: ./servers/physics_3d/gjk_epa.cpp + ./servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp + ./servers/physics_3d/joints/generic_6dof_joint_3d_sw.h + ./servers/physics_3d/joints/hinge_joint_3d_sw.cpp + ./servers/physics_3d/joints/hinge_joint_3d_sw.h + ./servers/physics_3d/joints/jacobian_entry_3d_sw.h + ./servers/physics_3d/joints/pin_joint_3d_sw.cpp + ./servers/physics_3d/joints/pin_joint_3d_sw.h + ./servers/physics_3d/joints/slider_joint_3d_sw.cpp + ./servers/physics_3d/joints/slider_joint_3d_sw.h Comment: Bullet Continuous Collision Detection and Physics Library Copyright: 2003-2008, Erwin Coumans 2007-2021, Juan Linietsky, Ariel Manzur. 2014-2021, Godot Engine contributors. License: Expat and Zlib -Files: ./servers/physics/joints/cone_twist_joint_sw.cpp - ./servers/physics/joints/cone_twist_joint_sw.h +Files: ./servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp + ./servers/physics_3d/joints/cone_twist_joint_3d_sw.h Comment: Bullet Continuous Collision Detection and Physics Library Copyright: 2007, Starbreeze Studios 2007-2021, Juan Linietsky, Ariel Manzur. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 79f21a0e70..fcc70d166e 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -406,7 +406,8 @@ <argument index="0" name="chars" type="String"> </argument> <description> - Returns a copy of the string with characters removed from the left. + Returns a copy of the string with characters removed from the left. The [code]chars[/code] argument is a string specifying the set of characters to be removed. + [b]Note:[/b] The [code]chars[/code] is not a prefix. See [method trim_prefix] method that will remove a single prefix string rather than a set of characters. </description> </method> <method name="match"> @@ -698,7 +699,8 @@ <argument index="0" name="chars" type="String"> </argument> <description> - Returns a copy of the string with characters removed from the right. + Returns a copy of the string with characters removed from the right. The [code]chars[/code] argument is a string specifying the set of characters to be removed. + [b]Note:[/b] The [code]chars[/code] is not a suffix. See [method trim_suffix] method that will remove a single suffix string rather than a set of characters. </description> </method> <method name="sha1_buffer"> diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h index 2c95c7dbec..2507add506 100644 --- a/drivers/dummy/rasterizer_dummy.h +++ b/drivers/dummy/rasterizer_dummy.h @@ -40,6 +40,29 @@ class RasterizerSceneDummy : public RendererSceneRender { public: + GeometryInstance *geometry_instance_create(RID p_base) override { return nullptr; } + void geometry_instance_set_skeleton(GeometryInstance *p_geometry_instance, RID p_skeleton) override {} + void geometry_instance_set_material_override(GeometryInstance *p_geometry_instance, RID p_override) override {} + void geometry_instance_set_surface_materials(GeometryInstance *p_geometry_instance, const Vector<RID> &p_material) override {} + void geometry_instance_set_mesh_instance(GeometryInstance *p_geometry_instance, RID p_mesh_instance) override {} + void geometry_instance_set_transform(GeometryInstance *p_geometry_instance, const Transform &p_transform, const AABB &p_aabb, const AABB &p_transformed_aabbb) override {} + void geometry_instance_set_layer_mask(GeometryInstance *p_geometry_instance, uint32_t p_layer_mask) override {} + void geometry_instance_set_lod_bias(GeometryInstance *p_geometry_instance, float p_lod_bias) override {} + void geometry_instance_set_use_baked_light(GeometryInstance *p_geometry_instance, bool p_enable) override {} + void geometry_instance_set_use_dynamic_gi(GeometryInstance *p_geometry_instance, bool p_enable) override {} + void geometry_instance_set_use_lightmap(GeometryInstance *p_geometry_instance, RID p_lightmap_instance, const Rect2 &p_lightmap_uv_scale, int p_lightmap_slice_index) override {} + void geometry_instance_set_lightmap_capture(GeometryInstance *p_geometry_instance, const Color *p_sh9) override {} + void geometry_instance_set_instance_shader_parameters_offset(GeometryInstance *p_geometry_instance, int32_t p_offset) override {} + void geometry_instance_set_cast_double_sided_shadows(GeometryInstance *p_geometry_instance, bool p_enable) override {} + + uint32_t geometry_instance_get_pair_mask() override { return 0; } + void geometry_instance_pair_light_instances(GeometryInstance *p_geometry_instance, const RID *p_light_instances, uint32_t p_light_instance_count) override {} + void geometry_instance_pair_reflection_probe_instances(GeometryInstance *p_geometry_instance, const RID *p_reflection_probe_instances, uint32_t p_reflection_probe_instance_count) override {} + void geometry_instance_pair_decal_instances(GeometryInstance *p_geometry_instance, const RID *p_decal_instances, uint32_t p_decal_instance_count) override {} + void geometry_instance_pair_gi_probe_instances(GeometryInstance *p_geometry_instance, const RID *p_gi_probe_instances, uint32_t p_gi_probe_instance_count) override {} + + void geometry_instance_free(GeometryInstance *p_geometry_instance) override {} + /* SHADOW ATLAS API */ RID shadow_atlas_create() override { return RID(); } @@ -57,7 +80,7 @@ public: int sdfgi_get_pending_region_count(RID p_render_buffers) const override { return 0; } AABB sdfgi_get_pending_region_bounds(RID p_render_buffers, int p_region) const override { return AABB(); } uint32_t sdfgi_get_pending_region_cascade(RID p_render_buffers, int p_region) const override { return 0; } - void sdfgi_update_probes(RID p_render_buffers, RID p_environment, const RID *p_directional_light_instances, uint32_t p_directional_light_count, const RID *p_positional_light_instances, uint32_t p_positional_light_count) override {} + void sdfgi_update_probes(RID p_render_buffers, RID p_environment, const Vector<RID> &p_directional_lights, const RID *p_positional_light_instances, uint32_t p_positional_light_count) override {} /* SKY API */ @@ -129,6 +152,7 @@ public: void light_instance_mark_visible(RID p_light_instance) override {} RID reflection_atlas_create() override { return RID(); } + int reflection_atlas_get_size(RID p_ref_atlas) const override { return 0; } void reflection_atlas_set_size(RID p_ref_atlas, int p_reflection_size, int p_reflection_count) override {} RID reflection_probe_instance_create(RID p_probe) override { return RID(); } @@ -142,19 +166,22 @@ public: RID decal_instance_create(RID p_decal) override { return RID(); } void decal_instance_set_transform(RID p_decal, const Transform &p_transform) override {} + RID lightmap_instance_create(RID p_lightmap) override { return RID(); } + void lightmap_instance_set_transform(RID p_lightmap, const Transform &p_transform) override {} + RID gi_probe_instance_create(RID p_gi_probe) override { return RID(); } void gi_probe_instance_set_transform_to_data(RID p_probe, const Transform &p_xform) override {} bool gi_probe_needs_update(RID p_probe) const override { return false; } - void gi_probe_update(RID p_probe, bool p_update_light_instances, const Vector<RID> &p_light_instances, int p_dynamic_object_count, InstanceBase **p_dynamic_objects) override {} + void gi_probe_update(RID p_probe, bool p_update_light_instances, const Vector<RID> &p_light_instances, const PagedArray<RendererSceneRender::GeometryInstance *> &p_dynamic_objects) override {} void gi_probe_set_quality(RS::GIProbeQuality) override {} - void render_scene(RID p_render_buffers, const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, RID *p_light_cull_result, int p_light_cull_count, RID *p_reflection_probe_cull_result, int p_reflection_probe_cull_count, RID *p_gi_probe_cull_result, int p_gi_probe_cull_count, RID *p_decal_cull_result, int p_decal_cull_count, InstanceBase **p_lightmap_cull_result, int p_lightmap_cull_count, RID p_environment, RID p_camera_effects, RID p_shadow_atlas, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass) override {} - void render_shadow(RID p_light, RID p_shadow_atlas, int p_pass, InstanceBase **p_cull_result, int p_cull_count) override {} - void render_material(const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, RID p_framebuffer, const Rect2i &p_region) override {} - void render_sdfgi(RID p_render_buffers, int p_region, InstanceBase **p_cull_result, int p_cull_count) override {} - void render_sdfgi_static_lights(RID p_render_buffers, uint32_t p_cascade_count, const uint32_t *p_cascade_indices, const RID **p_positional_light_cull_result, const uint32_t *p_positional_light_cull_count) override {} - void render_particle_collider_heightfield(RID p_collider, const Transform &p_transform, InstanceBase **p_cull_result, int p_cull_count) override {} + void render_scene(RID p_render_buffers, const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, const PagedArray<GeometryInstance *> &p_instances, const PagedArray<RID> &p_lights, const PagedArray<RID> &p_reflection_probes, const PagedArray<RID> &p_gi_probes, const PagedArray<RID> &p_decals, const PagedArray<RID> &p_lightmaps, RID p_environment, RID p_camera_effects, RID p_shadow_atlas, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass, float p_screen_lod_threshold) override {} + void render_shadow(RID p_light, RID p_shadow_atlas, int p_pass, const PagedArray<GeometryInstance *> &p_instances, const Plane &p_camera_plane = Plane(), float p_lod_distance_multiplier = 0, float p_screen_lod_threshold = 0.0) override {} + void render_material(const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, const PagedArray<GeometryInstance *> &p_instances, RID p_framebuffer, const Rect2i &p_region) override {} + void render_sdfgi(RID p_render_buffers, int p_region, const PagedArray<GeometryInstance *> &p_instances) override {} + void render_sdfgi_static_lights(RID p_render_buffers, uint32_t p_cascade_count, const uint32_t *p_cascade_indices, const PagedArray<RID> *p_positional_lights) override {} + void render_particle_collider_heightfield(RID p_collider, const Transform &p_transform, const PagedArray<GeometryInstance *> &p_instances) override {} void set_scene_pass(uint64_t p_pass) override {} void set_time(double p_time, double p_step) override {} @@ -370,6 +397,8 @@ public: RID shader_get_default_texture_param(RID p_shader, const StringName &p_name) const override { return RID(); } Variant shader_get_param_default(RID p_material, const StringName &p_param) const override { return Variant(); } + RS::ShaderNativeSourceCode shader_get_native_source_code(RID p_shader) const override { return RS::ShaderNativeSourceCode(); }; + /* COMMON MATERIAL API */ RID material_create() override { return RID(); } @@ -385,7 +414,7 @@ public: bool material_is_animated(RID p_material) override { return false; } bool material_casts_shadows(RID p_material) override { return false; } void material_get_instance_shader_parameters(RID p_material, List<InstanceShaderParam> *r_parameters) override {} - void material_update_dependency(RID p_material, InstanceBaseDependency *p_instance) override {} + void material_update_dependency(RID p_material, DependencyTracker *p_instance) override {} /* MESH API */ @@ -397,6 +426,16 @@ public: return mesh_owner.make_rid(mesh); } + void mesh_set_blend_shape_count(RID p_mesh, int p_blend_shape_count) override {} + bool mesh_needs_instance(RID p_mesh, bool p_has_skeleton) override { return false; } + RID mesh_instance_create(RID p_base) override { return RID(); } + void mesh_instance_set_skeleton(RID p_mesh_instance, RID p_skeleton) override {} + void mesh_instance_set_blend_shape_weight(RID p_mesh_instance, int p_shape, float p_weight) override {} + void mesh_instance_check_for_update(RID p_mesh_instance) override {} + void update_mesh_instances() override {} + void reflection_probe_set_lod_threshold(RID p_probe, float p_ratio) override {} + float reflection_probe_get_lod_threshold(RID p_probe) const override { return 0.0; } + void mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface) override {} #if 0 @@ -644,8 +683,8 @@ public: float reflection_probe_get_origin_max_distance(RID p_probe) const override { return 0.0; } bool reflection_probe_renders_shadows(RID p_probe) const override { return false; } - void base_update_dependency(RID p_base, InstanceBaseDependency *p_instance) override {} - void skeleton_update_dependency(RID p_base, InstanceBaseDependency *p_instance) override {} + void base_update_dependency(RID p_base, DependencyTracker *p_instance) override {} + void skeleton_update_dependency(RID p_base, DependencyTracker *p_instance) override {} /* DECAL API */ @@ -712,10 +751,10 @@ public: /* LIGHTMAP CAPTURE */ #if 0 struct Instantiable { - SelfList<RendererSceneRender::InstanceBase>::List instance_list; + SelfList<RendererSceneRender::GeometryInstance>::List instance_list; _FORCE_INLINE_ void instance_change_notify(bool p_aabb = true, bool p_materials = true) override { - SelfList<RendererSceneRender::InstanceBase> *instances = instance_list.first(); + SelfList<RendererSceneRender::GeometryInstance> *instances = instance_list.first(); while (instances) override { //instances->self()->base_changed(p_aabb, p_materials); instances = instances->next(); @@ -723,9 +762,9 @@ public: } _FORCE_INLINE_ void instance_remove_deps() override { - SelfList<RendererSceneRender::InstanceBase> *instances = instance_list.first(); + SelfList<RendererSceneRender::GeometryInstance> *instances = instance_list.first(); while (instances) override { - SelfList<RendererSceneRender::InstanceBase> *next = instances->next(); + SelfList<RendererSceneRender::GeometryInstance> *next = instances->next(); //instances->self()->base_removed(); instances = next; } @@ -828,8 +867,8 @@ public: int particles_get_draw_passes(RID p_particles) const override { return 0; } RID particles_get_draw_pass_mesh(RID p_particles, int p_pass) const override { return RID(); } - void particles_add_collision(RID p_particles, InstanceBaseDependency *p_instance) override {} - void particles_remove_collision(RID p_particles, InstanceBaseDependency *p_instance) override {} + void particles_add_collision(RID p_particles, RID p_instance) override {} + void particles_remove_collision(RID p_particles, RID p_instance) override {} void update_particles() override {} @@ -850,6 +889,10 @@ public: bool particles_collision_is_heightfield(RID p_particles_collision) const override { return false; } RID particles_collision_get_heightfield_framebuffer(RID p_particles_collision) const override { return RID(); } + RID particles_collision_instance_create(RID p_collision) override { return RID(); }; + void particles_collision_instance_set_transform(RID p_collision_instance, const Transform &p_transform) override{}; + void particles_collision_instance_set_active(RID p_collision_instance, bool p_active) override{}; + /* GLOBAL VARIABLES */ void global_variable_add(const StringName &p_name, RS::GlobalVariableType p_type, const Variant &p_value) override {} diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 056562a7a7..58ae115b26 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -2799,15 +2799,35 @@ void VisualShaderEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da void VisualShaderEditor::_show_preview_text() { preview_showed = !preview_showed; - preview_vbox->set_visible(preview_showed); if (preview_showed) { + if (preview_first) { + preview_window->set_size(Size2(400 * EDSCALE, 600 * EDSCALE)); + preview_window->popup_centered(); + preview_first = false; + } else { + preview_window->popup(); + } + _preview_size_changed(); + if (pending_update_preview) { _update_preview(); pending_update_preview = false; } + } else { + preview_window->hide(); } } +void VisualShaderEditor::_preview_close_requested() { + preview_showed = false; + preview_window->hide(); + preview_shader->set_pressed(false); +} + +void VisualShaderEditor::_preview_size_changed() { + preview_vbox->set_custom_minimum_size(preview_window->get_size()); +} + static ShaderLanguage::DataType _get_global_variable_type(const StringName &p_variable) { RS::GlobalVariableType gvt = RS::get_singleton()->global_variable_get_type(p_variable); return RS::global_variable_type_get_shader_datatype(gvt); @@ -2843,6 +2863,16 @@ void VisualShaderEditor::_update_preview() { } } +void VisualShaderEditor::_visibility_changed() { + if (!is_visible()) { + if (preview_window->is_visible()) { + preview_shader->set_pressed(false); + preview_window->hide(); + preview_showed = false; + } + } +} + void VisualShaderEditor::_bind_methods() { ClassDB::bind_method("_update_graph", &VisualShaderEditor::_update_graph); ClassDB::bind_method("_update_options_menu", &VisualShaderEditor::_update_options_menu); @@ -2873,7 +2903,6 @@ VisualShaderEditor::VisualShaderEditor() { saved_node_pos = Point2(0, 0); ShaderLanguage::get_keyword_list(&keyword_list); - preview_showed = false; pending_update_preview = false; shader_error = false; @@ -2882,16 +2911,11 @@ VisualShaderEditor::VisualShaderEditor() { from_node = -1; from_slot = -1; - main_box = memnew(HSplitContainer); - main_box->set_v_size_flags(SIZE_EXPAND_FILL); - main_box->set_h_size_flags(SIZE_EXPAND_FILL); - add_child(main_box); - graph = memnew(GraphEdit); graph->get_zoom_hbox()->set_h_size_flags(SIZE_EXPAND_FILL); graph->set_v_size_flags(SIZE_EXPAND_FILL); graph->set_h_size_flags(SIZE_EXPAND_FILL); - main_box->add_child(graph); + add_child(graph); graph->set_drag_forwarding(this); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR_INT); @@ -2912,6 +2936,7 @@ VisualShaderEditor::VisualShaderEditor() { graph->connect("gui_input", callable_mp(this, &VisualShaderEditor::_graph_gui_input)); graph->connect("connection_to_empty", callable_mp(this, &VisualShaderEditor::_connection_to_empty)); graph->connect("connection_from_empty", callable_mp(this, &VisualShaderEditor::_connection_from_empty)); + graph->connect("visibility_changed", callable_mp(this, &VisualShaderEditor::_visibility_changed)); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR, VisualShaderNode::PORT_TYPE_SCALAR); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR, VisualShaderNode::PORT_TYPE_SCALAR_INT); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR, VisualShaderNode::PORT_TYPE_VECTOR); @@ -2966,29 +2991,35 @@ VisualShaderEditor::VisualShaderEditor() { preview_shader = memnew(Button); preview_shader->set_flat(true); preview_shader->set_toggle_mode(true); - preview_shader->set_tooltip(TTR("Show resulted shader code.")); + preview_shader->set_tooltip(TTR("Show generated shader code.")); graph->get_zoom_hbox()->add_child(preview_shader); preview_shader->connect("pressed", callable_mp(this, &VisualShaderEditor::_show_preview_text)); /////////////////////////////////////// - // PREVIEW PANEL + // PREVIEW WINDOW /////////////////////////////////////// + preview_window = memnew(Window); + preview_window->set_title(TTR("Generated shader code")); + preview_window->set_visible(preview_showed); + preview_window->connect("close_requested", callable_mp(this, &VisualShaderEditor::_preview_close_requested)); + preview_window->connect("size_changed", callable_mp(this, &VisualShaderEditor::_preview_size_changed)); + add_child(preview_window); + preview_vbox = memnew(VBoxContainer); - preview_vbox->set_visible(preview_showed); - main_box->add_child(preview_vbox); + preview_window->add_child(preview_vbox); + preview_text = memnew(CodeEdit); syntax_highlighter.instance(); preview_vbox->add_child(preview_text); - preview_text->set_h_size_flags(SIZE_EXPAND_FILL); - preview_text->set_v_size_flags(SIZE_EXPAND_FILL); - preview_text->set_custom_minimum_size(Size2(400 * EDSCALE, 0)); + preview_text->set_v_size_flags(Control::SIZE_EXPAND_FILL); preview_text->set_syntax_highlighter(syntax_highlighter); preview_text->set_draw_line_numbers(true); preview_text->set_readonly(true); error_text = memnew(Label); preview_vbox->add_child(error_text); + error_text->set_autowrap(true); error_text->set_visible(false); /////////////////////////////////////// diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index 6e8ac92dc2..1c3296a10b 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -134,7 +134,6 @@ class VisualShaderEditor : public VBoxContainer { int editing_port; Ref<VisualShader> visual_shader; - HSplitContainer *main_box; GraphEdit *graph; Button *add_node; Button *preview_shader; @@ -148,6 +147,7 @@ class VisualShaderEditor : public VBoxContainer { bool pending_update_preview; bool shader_error; + Window *preview_window; VBoxContainer *preview_vbox; CodeEdit *preview_text; Ref<CodeHighlighter> syntax_highlighter; @@ -161,7 +161,8 @@ class VisualShaderEditor : public VBoxContainer { PopupMenu *popup_menu; MenuButton *tools; - bool preview_showed; + bool preview_first = true; + bool preview_showed = false; bool particles_mode; enum TypeFlags { @@ -277,6 +278,8 @@ class VisualShaderEditor : public VBoxContainer { void _set_mode(int p_which); void _show_preview_text(); + void _preview_close_requested(); + void _preview_size_changed(); void _update_preview(); String _get_description(int p_idx); @@ -388,6 +391,8 @@ class VisualShaderEditor : public VBoxContainer { void _update_uniforms(bool p_update_refs); void _update_uniform_refs(Set<String> &p_names); + void _visibility_changed(); + protected: void _notification(int p_what); static void _bind_methods(); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 98cdab0b70..4516180fa5 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -381,9 +381,12 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { type->set_custom_minimum_size(Size2(100, 0) * EDSCALE); hbc->add_child(type); - // Start at 1 to avoid adding "Nil" as an option - for (int i = 1; i < Variant::VARIANT_MAX; i++) { - type->add_item(Variant::get_type_name(Variant::Type(i))); + for (int i = 0; i < Variant::VARIANT_MAX; i++) { + // There's no point in adding Nil types, and Object types + // can't be serialized correctly in the project settings. + if (i != Variant::NIL && i != Variant::OBJECT) { + type->add_item(Variant::get_type_name(Variant::Type(i))); + } } l = memnew(Label); diff --git a/modules/regex/doc_classes/RegEx.xml b/modules/regex/doc_classes/RegEx.xml index 312275842a..b21f5d1e7a 100644 --- a/modules/regex/doc_classes/RegEx.xml +++ b/modules/regex/doc_classes/RegEx.xml @@ -39,8 +39,8 @@ var regex = RegEx.new() regex.compile("\\S+") # Negated whitespace character class. var results = [] - for match in regex.search_all("One Two \n\tThree"): - results.push_back(match.get_string()) + for result in regex.search_all("One Two \n\tThree"): + results.push_back(result.get_string()) # The `results` array now contains "One", "Two", "Three". [/codeblock] [b]Note:[/b] Godot's regex implementation is based on the [url=https://www.pcre.org/]PCRE2[/url] library. You can view the full pattern reference [url=https://www.pcre.org/current/doc/html/pcre2pattern.html]here[/url]. diff --git a/modules/webxr/native/library_godot_webxr.js b/modules/webxr/native/library_godot_webxr.js index 447045ed27..3041c16c79 100644 --- a/modules/webxr/native/library_godot_webxr.js +++ b/modules/webxr/native/library_godot_webxr.js @@ -601,7 +601,13 @@ const GodotWebXR = { const buf = GodotRuntime.malloc((axes_count + 1) * 4); GodotRuntime.setHeapValue(buf, axes_count, 'i32'); for (let i = 0; i < axes_count; i++) { - GodotRuntime.setHeapValue(buf + 4 + (i * 4), controller.gamepad.axes[i], 'float'); + let value = controller.gamepad.axes[i]; + if (i === 1 || i === 3) { + // Invert the Y-axis on thumbsticks and trackpads, in order to + // match OpenXR and other XR platform SDKs. + value *= -1.0; + } + GodotRuntime.setHeapValue(buf + 4 + (i * 4), value, 'float'); } return buf; }, diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp index 72dc4790ac..6594553146 100644 --- a/modules/webxr/webxr_interface_js.cpp +++ b/modules/webxr/webxr_interface_js.cpp @@ -375,11 +375,11 @@ void WebXRInterfaceJS::_update_tracker(int p_controller_id) { if (godot_webxr_is_controller_connected(p_controller_id)) { if (tracker == nullptr) { tracker = memnew(XRPositionalTracker); - tracker->set_type(XRServer::TRACKER_CONTROLLER); + tracker->set_tracker_type(XRServer::TRACKER_CONTROLLER); // Controller id's 0 and 1 are always the left and right hands. if (p_controller_id < 2) { - tracker->set_name(p_controller_id == 0 ? "Left" : "Right"); - tracker->set_hand(p_controller_id == 0 ? XRPositionalTracker::TRACKER_LEFT_HAND : XRPositionalTracker::TRACKER_RIGHT_HAND); + tracker->set_tracker_name(p_controller_id == 0 ? "Left" : "Right"); + tracker->set_tracker_hand(p_controller_id == 0 ? XRPositionalTracker::TRACKER_HAND_LEFT : XRPositionalTracker::TRACKER_HAND_RIGHT); } // Use the ids we're giving to our "virtual" gamepads. tracker->set_joy_id(p_controller_id + 100); diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index 1d3f96a6b8..b0302a5f88 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -27,8 +27,13 @@ if env["tools"]: sys_env.AddJSLibraries(["js/libs/library_godot_editor_tools.js"]) if env["javascript_eval"]: sys_env.AddJSLibraries(["js/libs/library_godot_eval.js"]) + for lib in sys_env["JS_LIBS"]: sys_env.Append(LINKFLAGS=["--js-library", lib]) +for js in env["JS_PRE"]: + sys_env.Append(LINKFLAGS=["--pre-js", env.File(js).path]) +for ext in env["JS_EXTERNS"]: + sys_env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.path build = [] if env["gdnative_enabled"]: @@ -66,16 +71,8 @@ else: build = sys_env.Program(build_targets, javascript_files + ["javascript_runtime.cpp"]) sys_env.Depends(build[0], sys_env["JS_LIBS"]) - -if "JS_PRE" in env: - for js in env["JS_PRE"]: - env.Append(LINKFLAGS=["--pre-js", env.File(js).path]) - env.Depends(build, env["JS_PRE"]) - -if "JS_EXTERNS" in env: - for ext in env["JS_EXTERNS"]: - env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.path - env.Depends(build, env["JS_EXTERNS"]) +sys_env.Depends(build[0], sys_env["JS_PRE"]) +sys_env.Depends(build[0], sys_env["JS_EXTERNS"]) engine = [ "js/engine/preloader.js", diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 7d501e94b2..0d57f8aad1 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -131,7 +131,10 @@ def configure(env): jscc = env.Builder(generator=run_closure_compiler, suffix=".cc.js", src_suffix=".js") env.Append(BUILDERS={"BuildJS": jscc}) - # Add helper method for adding libraries. + # Add helper method for adding libraries, externs, pre-js. + env["JS_LIBS"] = [] + env["JS_PRE"] = [] + env["JS_EXTERNS"] = [] env.AddMethod(add_js_libraries, "AddJSLibraries") env.AddMethod(add_js_pre, "AddJSPre") env.AddMethod(add_js_externs, "AddJSExterns") diff --git a/platform/javascript/emscripten_helpers.py b/platform/javascript/emscripten_helpers.py index 278186e4c0..8b8c492e22 100644 --- a/platform/javascript/emscripten_helpers.py +++ b/platform/javascript/emscripten_helpers.py @@ -22,18 +22,12 @@ def create_engine_file(env, target, source, externs): def add_js_libraries(env, libraries): - if "JS_LIBS" not in env: - env["JS_LIBS"] = [] env.Append(JS_LIBS=env.File(libraries)) def add_js_pre(env, js_pre): - if "JS_PRE" not in env: - env["JS_PRE"] = [] env.Append(JS_PRE=env.File(js_pre)) def add_js_externs(env, externs): - if "JS_EXTERNS" not in env: - env["JS_EXTERNS"] = [] env.Append(JS_EXTERNS=env.File(externs)) diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp index 44819c495c..c8c48dd582 100644 --- a/platform/javascript/http_client_javascript.cpp +++ b/platform/javascript/http_client_javascript.cpp @@ -220,13 +220,13 @@ Error HTTPClient::poll() { has_polled = true; } else { // forcing synchronous requests is not possible on the web - if (last_polling_frame == Engine::get_singleton()->get_idle_frames()) { + if (last_polling_frame == Engine::get_singleton()->get_process_frames()) { WARN_PRINT("HTTPClient polled multiple times in one frame, " "but request cannot progress more than once per " "frame on the HTML5 platform."); } } - last_polling_frame = Engine::get_singleton()->get_idle_frames(); + last_polling_frame = Engine::get_singleton()->get_process_frames(); #endif polled_response_code = godot_xhr_get_status(xhr_id); diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index 5656ecd7dc..0b8af70b13 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -87,7 +87,7 @@ extern EMSCRIPTEN_KEEPALIVE int godot_js_main(int argc, char *argv[]) { ResourceLoader::set_abort_on_missing_resources(false); Main::start(); - os->get_main_loop()->init(); + os->get_main_loop()->initialize(); emscripten_set_main_loop(main_loop_callback, -1, false); // Immediately run the first iteration. // We are inside an animation frame, we want to immediately draw on the newly setup canvas. |