diff options
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | editor/animation_track_editor.cpp | 21 | ||||
-rw-r--r-- | editor/editor_node.cpp | 37 | ||||
-rw-r--r-- | editor/editor_node.h | 5 | ||||
-rw-r--r-- | platform/x11/detect.py | 15 |
5 files changed, 70 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore index 2697507adb..cd6785a8ec 100644 --- a/.gitignore +++ b/.gitignore @@ -40,12 +40,14 @@ gmon.out *.swo *.swp -# QT project files +# Qt project files *.config *.creator *.creator.* *.files *.includes +*.cflags +*.cxxflags # Eclipse CDT files .cproject diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index a34ced7328..2376d08077 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1022,8 +1022,14 @@ void AnimationTimelineEdit::update_values() { editing = true; if (use_fps && animation->get_step() > 0) { length->set_value(animation->get_length() / animation->get_step()); + length->set_step(1); + length->set_tooltip(TTR("Animation length (frames)")); + time_icon->set_tooltip(TTR("Animation length (frames)")); } else { length->set_value(animation->get_length()); + length->set_step(0.01); + length->set_tooltip(TTR("Animation length (seconds)")); + time_icon->set_tooltip(TTR("Animation length (seconds)")); } loop->set_pressed(animation->has_loop()); editing = false; @@ -1168,7 +1174,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() { len_hb->add_child(expander); time_icon = memnew(TextureRect); time_icon->set_v_size_flags(SIZE_SHRINK_CENTER); - time_icon->set_tooltip(TTR("Animation Length Time (seconds)")); + time_icon->set_tooltip(TTR("Animation length (seconds)")); len_hb->add_child(time_icon); length = memnew(EditorSpinSlider); length->set_min(0.001); @@ -1177,7 +1183,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() { length->set_allow_greater(true); length->set_custom_minimum_size(Vector2(70 * EDSCALE, 0)); length->set_hide_slider(true); - length->set_tooltip(TTR("Animation Length Time (seconds)")); + length->set_tooltip(TTR("Animation length (seconds)")); length->connect("value_changed", this, "_anim_length_changed"); len_hb->add_child(length); loop = memnew(ToolButton); @@ -3857,7 +3863,7 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) { ERR_FAIL_INDEX(p_track, animation->get_track_count()); if (snap->is_pressed() && step->get_value() != 0) { - p_ofs = Math::stepify(p_ofs, step->get_value()); + p_ofs = snap_time(p_ofs); } while (animation->track_find_key(p_track, p_ofs, true) != -1) { //make sure insertion point is valid p_ofs += 0.001; @@ -4889,7 +4895,14 @@ void AnimationTrackEditor::_selection_changed() { float AnimationTrackEditor::snap_time(float p_value) { if (snap->is_pressed()) { - p_value = Math::stepify(p_value, step->get_value()); + + double snap_increment; + if (timeline->is_using_fps() && step->get_value() > 0) + snap_increment = 1.0 / step->get_value(); + else + snap_increment = step->get_value(); + + p_value = Math::stepify(p_value, snap_increment); } return p_value; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index fe52e7eb7e..cbb7994635 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1937,6 +1937,21 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { open_request(previous_scenes.back()->get()); } break; + case FILE_CLOSE_OTHERS: + case FILE_CLOSE_RIGHT: + case FILE_CLOSE_ALL: { + if (editor_data.get_edited_scene_count() > 1 && (current_option != FILE_CLOSE_RIGHT || editor_data.get_edited_scene() < editor_data.get_edited_scene_count() - 1)) { + int next_tab = editor_data.get_edited_scene() + 1; + next_tab %= editor_data.get_edited_scene_count(); + _scene_tab_closed(next_tab, current_option); + } else { + if (current_option != FILE_CLOSE_ALL) + current_option = -1; + else + _scene_tab_closed(editor_data.get_edited_scene()); + } + + } break; case FILE_CLOSE_ALL_AND_QUIT: case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER: case FILE_CLOSE: { @@ -2553,6 +2568,9 @@ void EditorNode::_discard_changes(const String &p_str) { case FILE_CLOSE_ALL_AND_QUIT: case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER: case FILE_CLOSE: + case FILE_CLOSE_OTHERS: + case FILE_CLOSE_RIGHT: + case FILE_CLOSE_ALL: case SCENE_TAB_CLOSE: { _remove_scene(tab_closing); @@ -2565,6 +2583,15 @@ void EditorNode::_discard_changes(const String &p_str) { } else { _menu_option_confirm(current_option, false); } + } else if (current_option == FILE_CLOSE_OTHERS || current_option == FILE_CLOSE_RIGHT) { + if (editor_data.get_edited_scene_count() == 1 || (current_option == FILE_CLOSE_RIGHT && editor_data.get_edited_scene_count() <= editor_data.get_edited_scene() + 1)) { + current_option = -1; + save_confirmation->hide(); + } else { + _menu_option_confirm(current_option, false); + } + } else if (current_option == FILE_CLOSE_ALL && editor_data.get_edited_scene_count() > 0) { + _menu_option_confirm(current_option, false); } else { current_option = -1; save_confirmation->hide(); @@ -4192,8 +4219,8 @@ void EditorNode::_scene_tab_script_edited(int p_tab) { inspector_dock->edit_resource(script); } -void EditorNode::_scene_tab_closed(int p_tab) { - current_option = SCENE_TAB_CLOSE; +void EditorNode::_scene_tab_closed(int p_tab, int option) { + current_option = option; tab_closing = p_tab; Node *scene = editor_data.get_edited_scene_root(p_tab); if (!scene) { @@ -4266,7 +4293,11 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) { scene_tabs_context_menu->add_separator(); scene_tabs_context_menu->add_item(TTR("Show in FileSystem"), FILE_SHOW_IN_FILESYSTEM); scene_tabs_context_menu->add_item(TTR("Play This Scene"), RUN_PLAY_SCENE); + scene_tabs_context_menu->add_separator(); scene_tabs_context_menu->add_item(TTR("Close Tab"), FILE_CLOSE); + scene_tabs_context_menu->add_item(TTR("Close Other Tabs"), FILE_CLOSE_OTHERS); + scene_tabs_context_menu->add_item(TTR("Close Tabs to the Right"), FILE_CLOSE_RIGHT); + scene_tabs_context_menu->add_item(TTR("Close All Tabs"), FILE_CLOSE_ALL); } scene_tabs_context_menu->set_position(mb->get_global_position()); scene_tabs_context_menu->popup(); @@ -5523,7 +5554,7 @@ EditorNode::EditorNode() { scene_tabs->set_drag_to_rearrange_enabled(true); scene_tabs->connect("tab_changed", this, "_scene_tab_changed"); scene_tabs->connect("right_button_pressed", this, "_scene_tab_script_edited"); - scene_tabs->connect("tab_close", this, "_scene_tab_closed"); + scene_tabs->connect("tab_close", this, "_scene_tab_closed", varray(SCENE_TAB_CLOSE)); scene_tabs->connect("tab_hover", this, "_scene_tab_hover"); scene_tabs->connect("mouse_exited", this, "_scene_tab_exit"); scene_tabs->connect("gui_input", this, "_scene_tab_input"); diff --git a/editor/editor_node.h b/editor/editor_node.h index a06708eb54..0084d421f9 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -150,6 +150,9 @@ private: FILE_QUICK_OPEN_SCRIPT, FILE_OPEN_PREV, FILE_CLOSE, + FILE_CLOSE_OTHERS, + FILE_CLOSE_RIGHT, + FILE_CLOSE_ALL, FILE_CLOSE_ALL_AND_QUIT, FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER, FILE_QUIT, @@ -563,7 +566,7 @@ private: void _dock_split_dragged(int ofs); void _dock_popup_exit(); void _scene_tab_changed(int p_tab); - void _scene_tab_closed(int p_tab); + void _scene_tab_closed(int p_tab, int option = SCENE_TAB_CLOSE); void _scene_tab_hover(int p_tab); void _scene_tab_exit(); void _scene_tab_input(const Ref<InputEvent> &p_input); diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 1905b035e6..91639a0db2 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -59,6 +59,7 @@ def get_opts(): return [ BoolVariable('use_llvm', 'Use the LLVM compiler', False), BoolVariable('use_lld', 'Use the LLD linker', False), + BoolVariable('use_thinlto', 'Use ThinLTO', False), BoolVariable('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', False), BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), BoolVariable('use_asan', 'Use LLVM/GCC compiler address sanitizer (ASAN))', False), @@ -136,6 +137,9 @@ def configure(env): if env['use_lld']: if env['use_llvm']: env.Append(LINKFLAGS=['-fuse-ld=lld']) + if env['use_thinlto']: + # A convenience so you don't need to write use_lto too when using SCons + env['use_lto'] = True else: print("Using LLD with GCC is not supported yet, try compiling with 'use_llvm=yes'.") sys.exit(255) @@ -156,12 +160,17 @@ def configure(env): env.Append(LINKFLAGS=['-fsanitize=leak']) if env['use_lto']: - env.Append(CCFLAGS=['-flto']) - if not env['use_llvm'] and env.GetOption("num_jobs") > 1: + env.Append(CCFLAGS=['-flto']) env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))]) else: - env.Append(LINKFLAGS=['-flto']) + if env['use_lld'] and env['use_thinlto']: + env.Append(CCFLAGS=['-flto=thin']) + env.Append(LINKFLAGS=['-flto=thin']) + else: + env.Append(CCFLAGS=['-flto']) + env.Append(LINKFLAGS=['-flto']) + if not env['use_llvm']: env['RANLIB'] = 'gcc-ranlib' env['AR'] = 'gcc-ar' |