diff options
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 40 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.h | 5 | ||||
-rw-r--r-- | platform/x11/detect.py | 22 | ||||
-rw-r--r-- | scene/2d/cpu_particles_2d.cpp | 3 |
5 files changed, 57 insertions, 15 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 182738cf14..9e65d9de10 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -301,7 +301,7 @@ void ScriptEditor::_goto_script_line2(int p_line) { void ScriptEditor::_goto_script_line(REF p_script, int p_line) { Ref<Script> script = Object::cast_to<Script>(*p_script); - if (!script.is_null() && script->has_source_code()) { + if (script.is_valid() && (script->has_source_code() || script->get_path().is_resource_file())) { if (edit(p_script, p_line, 0)) { editor->push_item(p_script.ptr()); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 6bd0309d17..3eeb871380 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -51,6 +51,8 @@ void TextureRegionEditor::_region_draw() { Ref<Texture> base_tex = NULL; if (node_sprite) base_tex = node_sprite->get_texture(); + else if (node_sprite_3d) + base_tex = node_sprite_3d->get_texture(); else if (node_ninepatch) base_tex = node_ninepatch->get_texture(); else if (obj_styleBox.is_valid()) @@ -285,6 +287,8 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { Rect2 r; if (node_sprite) r = node_sprite->get_region_rect(); + else if (node_sprite_3d) + r = node_sprite_3d->get_region_rect(); else if (node_ninepatch) r = node_ninepatch->get_region_rect(); else if (obj_styleBox.is_valid()) @@ -298,6 +302,9 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (node_sprite) { undo_redo->add_do_method(node_sprite, "set_region_rect", rect); undo_redo->add_undo_method(node_sprite, "set_region_rect", node_sprite->get_region_rect()); + } else if (node_sprite_3d) { + undo_redo->add_do_method(node_sprite_3d, "set_region_rect", rect); + undo_redo->add_undo_method(node_sprite_3d, "set_region_rect", node_sprite_3d->get_region_rect()); } else if (node_ninepatch) { undo_redo->add_do_method(node_ninepatch, "set_region_rect", rect); undo_redo->add_undo_method(node_ninepatch, "set_region_rect", node_ninepatch->get_region_rect()); @@ -325,6 +332,8 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { drag = true; if (node_sprite) rect_prev = node_sprite->get_region_rect(); + else if (node_sprite_3d) + rect_prev = node_sprite_3d->get_region_rect(); else if (node_ninepatch) rect_prev = node_ninepatch->get_region_rect(); else if (obj_styleBox.is_valid()) @@ -363,6 +372,9 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (node_sprite) { undo_redo->add_do_method(node_sprite, "set_region_rect", node_sprite->get_region_rect()); undo_redo->add_undo_method(node_sprite, "set_region_rect", rect_prev); + } else if (node_sprite_3d) { + undo_redo->add_do_method(node_sprite_3d, "set_region_rect", node_sprite_3d->get_region_rect()); + undo_redo->add_undo_method(node_sprite_3d, "set_region_rect", rect_prev); } else if (atlas_tex.is_valid()) { undo_redo->add_do_method(atlas_tex.ptr(), "set_region", atlas_tex->get_region()); undo_redo->add_undo_method(atlas_tex.ptr(), "set_region", rect_prev); @@ -590,6 +602,8 @@ void TextureRegionEditor::_zoom_out() { void TextureRegionEditor::apply_rect(const Rect2 &p_rect) { if (node_sprite) node_sprite->set_region_rect(p_rect); + else if (node_sprite_3d) + node_sprite_3d->set_region_rect(p_rect); else if (node_ninepatch) node_ninepatch->set_region_rect(p_rect); else if (obj_styleBox.is_valid()) @@ -601,6 +615,8 @@ void TextureRegionEditor::apply_rect(const Rect2 &p_rect) { void TextureRegionEditor::_update_rect() { if (node_sprite) rect = node_sprite->get_region_rect(); + else if (node_sprite_3d) + rect = node_sprite_3d->get_region_rect(); else if (node_ninepatch) rect = node_ninepatch->get_region_rect(); else if (obj_styleBox.is_valid()) @@ -616,6 +632,8 @@ void TextureRegionEditor::_update_autoslice() { Ref<Texture> texture = NULL; if (node_sprite) texture = node_sprite->get_texture(); + else if (node_sprite_3d) + texture = node_sprite_3d->get_texture(); else if (node_ninepatch) texture = node_ninepatch->get_texture(); else if (obj_styleBox.is_valid()) @@ -702,9 +720,10 @@ void TextureRegionEditor::_notification(int p_what) { } void TextureRegionEditor::_node_removed(Object *p_obj) { - if (p_obj == node_sprite || p_obj == node_ninepatch || p_obj == obj_styleBox.ptr() || p_obj == atlas_tex.ptr()) { - node_ninepatch = NULL; + if (p_obj == node_sprite || p_obj == node_sprite_3d || p_obj == node_ninepatch || p_obj == obj_styleBox.ptr() || p_obj == atlas_tex.ptr()) { node_sprite = NULL; + node_sprite_3d = NULL; + node_ninepatch = NULL; obj_styleBox = Ref<StyleBox>(NULL); atlas_tex = Ref<AtlasTexture>(NULL); hide(); @@ -743,6 +762,10 @@ bool TextureRegionEditor::is_ninepatch() { return node_ninepatch != NULL; } +Sprite3D *TextureRegionEditor::get_sprite_3d() { + return node_sprite_3d; +} + Sprite *TextureRegionEditor::get_sprite() { return node_sprite; } @@ -750,6 +773,8 @@ Sprite *TextureRegionEditor::get_sprite() { void TextureRegionEditor::edit(Object *p_obj) { if (node_sprite) node_sprite->remove_change_receptor(this); + if (node_sprite_3d) + node_sprite_3d->remove_change_receptor(this); if (node_ninepatch) node_ninepatch->remove_change_receptor(this); if (obj_styleBox.is_valid()) @@ -758,6 +783,7 @@ void TextureRegionEditor::edit(Object *p_obj) { atlas_tex->remove_change_receptor(this); if (p_obj) { node_sprite = Object::cast_to<Sprite>(p_obj); + node_sprite_3d = Object::cast_to<Sprite3D>(p_obj); node_ninepatch = Object::cast_to<NinePatchRect>(p_obj); if (Object::cast_to<StyleBoxTexture>(p_obj)) obj_styleBox = Ref<StyleBoxTexture>(Object::cast_to<StyleBoxTexture>(p_obj)); @@ -767,12 +793,13 @@ void TextureRegionEditor::edit(Object *p_obj) { _edit_region(); } else { node_sprite = NULL; + node_sprite_3d = NULL; node_ninepatch = NULL; obj_styleBox = Ref<StyleBoxTexture>(NULL); atlas_tex = Ref<AtlasTexture>(NULL); } edit_draw->update(); - if (node_sprite && !node_sprite->is_region()) { + if ((node_sprite && !node_sprite->is_region()) || (node_sprite_3d && !node_sprite_3d->is_region())) { set_process(true); } if (!p_obj) { @@ -792,6 +819,8 @@ void TextureRegionEditor::_edit_region() { Ref<Texture> texture = NULL; if (node_sprite) texture = node_sprite->get_texture(); + else if (node_sprite_3d) + texture = node_sprite_3d->get_texture(); else if (node_ninepatch) texture = node_ninepatch->get_texture(); else if (obj_styleBox.is_valid()) @@ -834,6 +863,7 @@ Vector2 TextureRegionEditor::snap_point(Vector2 p_target) const { TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { node_sprite = NULL; + node_sprite_3d = NULL; node_ninepatch = NULL; obj_styleBox = Ref<StyleBoxTexture>(NULL); atlas_tex = Ref<AtlasTexture>(NULL); @@ -976,13 +1006,13 @@ void TextureRegionEditorPlugin::edit(Object *p_object) { } bool TextureRegionEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Sprite") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture"); + return p_object->is_class("Sprite") || p_object->is_class("Sprite3D") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture"); } void TextureRegionEditorPlugin::make_visible(bool p_visible) { if (p_visible) { texture_region_button->show(); - if (region_editor->is_stylebox() || region_editor->is_atlas_texture() || region_editor->is_ninepatch() || (region_editor->get_sprite() && region_editor->get_sprite()->is_region()) || texture_region_button->is_pressed()) { + if (region_editor->is_stylebox() || region_editor->is_atlas_texture() || region_editor->is_ninepatch() || (region_editor->get_sprite() && region_editor->get_sprite()->is_region()) || (region_editor->get_sprite_3d() && region_editor->get_sprite_3d()->is_region()) || texture_region_button->is_pressed()) { editor->make_bottom_panel_item_visible(region_editor); } } else { diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h index e4d7971160..19eaef9bc3 100644 --- a/editor/plugins/texture_region_editor_plugin.h +++ b/editor/plugins/texture_region_editor_plugin.h @@ -35,6 +35,7 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/sprite.h" +#include "scene/3d/sprite_3d.h" #include "scene/gui/nine_patch_rect.h" #include "scene/resources/style_box.h" #include "scene/resources/texture.h" @@ -83,8 +84,9 @@ class TextureRegionEditor : public VBoxContainer { Vector2 snap_step; Vector2 snap_separation; - NinePatchRect *node_ninepatch; Sprite *node_sprite; + Sprite3D *node_sprite_3d; + NinePatchRect *node_ninepatch; Ref<StyleBoxTexture> obj_styleBox; Ref<AtlasTexture> atlas_tex; @@ -132,6 +134,7 @@ public: bool is_stylebox(); bool is_atlas_texture(); bool is_ninepatch(); + Sprite3D *get_sprite_3d(); Sprite *get_sprite(); void edit(Object *p_obj); diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 415e8ceaa6..72139538b7 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -61,8 +61,9 @@ def get_opts(): return [ BoolVariable('use_llvm', 'Use the LLVM compiler', False), BoolVariable('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', False), - BoolVariable('use_sanitizer', 'Use LLVM compiler address sanitizer', False), - BoolVariable('use_leak_sanitizer', 'Use LLVM compiler memory leaks sanitizer (implies use_sanitizer)', False), + BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), + BoolVariable('use_asan', 'Use LLVM/GCC compiler address sanitizer (ASAN))', False), + BoolVariable('use_lsan', 'Use LLVM/GCC compiler leak sanitizer (LSAN))', False), BoolVariable('pulseaudio', 'Detect & use pulseaudio', True), BoolVariable('udev', 'Use udev for gamepad connection callbacks', False), EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')), @@ -131,12 +132,19 @@ def configure(env): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) env.extra_suffix = ".llvm" + env.extra_suffix - # leak sanitizer requires (address) sanitizer - if env['use_sanitizer'] or env['use_leak_sanitizer']: - env.Append(CCFLAGS=['-fsanitize=address', '-fno-omit-frame-pointer']) - env.Append(LINKFLAGS=['-fsanitize=address']) + + if env['use_ubsan'] or env['use_asan'] or env['use_lsan']: env.extra_suffix += "s" - if env['use_leak_sanitizer']: + + if env['use_ubsan']: + env.Append(CCFLAGS=['-fsanitize=undefined']) + env.Append(LINKFLAGS=['-fsanitize=undefined']) + + if env['use_asan']: + env.Append(CCFLAGS=['-fsanitize=address']) + env.Append(LINKFLAGS=['-fsanitize=address']) + + if env['use_lsan']: env.Append(CCFLAGS=['-fsanitize=leak']) env.Append(LINKFLAGS=['-fsanitize=leak']) diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 36b900bf82..21feb6e226 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -840,7 +840,7 @@ void CPUParticles2D::_particles_process(float p_delta) { if (flags[FLAG_ALIGN_Y_TO_VELOCITY]) { if (p.velocity.length() > 0.0) { - p.transform.elements[0] = p.velocity.normalized(); + p.transform.elements[1] = p.velocity.normalized(); p.transform.elements[0] = p.transform.elements[1].tangent(); } @@ -1378,6 +1378,7 @@ CPUParticles2D::CPUParticles2D() { set_param(PARAM_INITIAL_LINEAR_VELOCITY, 1); //set_param(PARAM_ORBIT_VELOCITY, 0); set_param(PARAM_LINEAR_ACCEL, 0); + set_param(PARAM_ANGULAR_VELOCITY, 0); set_param(PARAM_RADIAL_ACCEL, 0); set_param(PARAM_TANGENTIAL_ACCEL, 0); set_param(PARAM_DAMPING, 0); |