diff options
-rw-r--r-- | SConstruct | 11 | ||||
-rw-r--r-- | platform/osx/detect.py | 7 | ||||
-rw-r--r-- | platform/windows/detect.py | 9 | ||||
-rw-r--r-- | platform/x11/detect.py | 7 | ||||
-rw-r--r-- | scene/gui/label.cpp | 8 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 6 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 2 | ||||
-rw-r--r-- | tools/editor/asset_library_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/dependency_editor.cpp | 5 | ||||
-rw-r--r-- | tools/editor/editor_help.cpp | 1 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 8 | ||||
-rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | tools/editor/plugins/shader_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | tools/editor/project_manager.cpp | 12 | ||||
-rw-r--r-- | tools/editor/scenes_dock.cpp | 1 |
15 files changed, 46 insertions, 37 deletions
diff --git a/SConstruct b/SConstruct index 0f9b046e2b..038d42f946 100644 --- a/SConstruct +++ b/SConstruct @@ -123,7 +123,7 @@ opts.Add('minizip','Build Minizip Archive Support: (yes/no)','yes') opts.Add('squish','Squish BC Texture Compression in editor (yes/no)','yes') opts.Add('theora','Theora Video (yes/no)','yes') opts.Add('theoralib','Theora Video (yes/no)','no') -opts.Add('freetype','Freetype support in editor','yes') +opts.Add('freetype','Freetype support in editor','builtin') opts.Add('speex','Speex Audio (yes/no)','yes') opts.Add('xml','XML Save/Load support (yes/no)','yes') opts.Add('png','PNG Image loader support (yes/no)','yes') @@ -190,6 +190,7 @@ elif env_base['p'] != "": env_base["platform"]=selected_platform + if selected_platform in platform_list: sys.path.append("./platform/"+selected_platform) @@ -246,6 +247,14 @@ if selected_platform in platform_list: #must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11) detect.configure(env) + + if (env["freetype"]!="no"): + env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) + if (env["freetype"]=="builtin"): + env.Append(CPPPATH=['#drivers/freetype']) + env.Append(CPPPATH=['#drivers/freetype/freetype/include']) + + #env['platform_libsuffix'] = env['LIBSUFFIX'] suffix="."+selected_platform diff --git a/platform/osx/detect.py b/platform/osx/detect.py index d1aa54b71d..1982beb10e 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -30,7 +30,6 @@ def get_flags(): return [ ('legacygl', 'yes'), ('builtin_zlib', 'no'), - ('freetype','builtin'), #use builtin freetype ('glew', 'yes'), ] @@ -56,12 +55,6 @@ def configure(env): env.Append(CCFLAGS=['-g3', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) - if (env["freetype"]!="no"): - env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) - env.Append(CPPPATH=['#drivers/freetype']) - env.Append(CPPPATH=['#drivers/freetype/freetype/include']) - - if (not os.environ.has_key("OSXCROSS_ROOT")): #regular native build diff --git a/platform/windows/detect.py b/platform/windows/detect.py index a6a949a11a..320fb9d269 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -168,7 +168,6 @@ def get_opts(): def get_flags(): return [ - ('freetype','builtin'), #use builtin freetype ('glew','yes'), ('openssl','builtin'), #use builtin openssl ] @@ -203,10 +202,6 @@ def configure(env): env.Append(CPPPATH=['#platform/windows/include']) env.Append(LIBPATH=['#platform/windows/lib']) - if (env["freetype"]!="no"): - env.Append(CCFLAGS=['/DFREETYPE_ENABLED']) - env.Append(CPPPATH=['#drivers/freetype']) - env.Append(CPPPATH=['#drivers/freetype/freetype/include']) if (env["target"]=="release"): @@ -350,10 +345,6 @@ def configure(env): env.Append(CCFLAGS=['-g', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) - if (env["freetype"]!="no"): - env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) - env.Append(CPPPATH=['#drivers/freetype']) - env.Append(CPPPATH=['#drivers/freetype/freetype/include']) env["CC"]=mingw_prefix+"gcc" diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 2561e09b9a..0362756f7c 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -67,6 +67,8 @@ def get_flags(): ('builtin_zlib', 'no'), ('glew', 'yes'), ("openssl", "yes"), + ('freetype','yes'), #use system freetype + #("theora","no"), ] @@ -141,11 +143,6 @@ def configure(env): env.ParseConfig('pkg-config freetype2 --cflags --libs') - if (env["freetype"]!="no"): - env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) - if (env["freetype"]=="builtin"): - env.Append(CPPPATH=['#drivers/freetype']) - env.Append(CPPPATH=['#drivers/freetype/freetype/include']) env.Append(CPPFLAGS=['-DOPENGL_ENABLED']) diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 09c6a77b42..2d4438c48c 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -92,7 +92,9 @@ void Label::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_set_distance_field_mode(get_canvas_item(),font.is_valid() && font->is_distance_field_hint()); int font_h = font->get_height()+line_spacing; - int lines_visible = size.y/font_h; + + int lines_visible = (size.y+line_spacing)/font_h; + int space_w=font->get_char_size(' ').width; int chars_total=0; @@ -488,9 +490,9 @@ void Label::regenerate_word_cache() { if (!autowrap) { minsize.width=width; if (max_lines_visible > 0 && line_count > max_lines_visible) { - minsize.height=(font->get_height()+line_spacing)*max_lines_visible; + minsize.height=(font->get_height() * max_lines_visible) + (line_spacing * (max_lines_visible - 1)); } else { - minsize.height=(font->get_height()+line_spacing)*line_count; + minsize.height=(font->get_height() * line_count)+(line_spacing * (line_count - 1)); } } diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 44cc798447..2a4e82a8e7 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -454,7 +454,7 @@ void LineEdit::_notification(int p_what) { } break; } - int ofs_max=width-style->get_minimum_size().width+x_ofs; + int ofs_max=width-style->get_minimum_size().width; int char_ofs=window_pos; int y_area=height-style->get_minimum_size().height; @@ -799,8 +799,8 @@ Size2 LineEdit::get_minimum_size() const { Ref<Font> font=get_font("font"); Size2 min=style->get_minimum_size(); - min+=font->get_string_size(this->text); - + min.height+=font->get_height(); + min.width+=get_constant("minimum_spaces")*font->get_char_size(' ').x; return min; } diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 4083dc893d..aef53ea230 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1210,7 +1210,7 @@ void Viewport::set_size_override_stretch(bool p_enable) { bool Viewport::is_size_override_stretch_enabled() const { - return size_override; + return size_override_stretch; } void Viewport::set_as_render_target(bool p_enable){ diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp index 0b16ca9545..928acdbcbb 100644 --- a/tools/editor/asset_library_editor_plugin.cpp +++ b/tools/editor/asset_library_editor_plugin.cpp @@ -1282,8 +1282,6 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { } - library_vb->add_child(search_hb); - HBoxContainer *search_hb2 = memnew( HBoxContainer ); library_main->add_child(search_hb2); diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index a702d3c687..6ad7704815 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -399,6 +399,7 @@ void DependencyRemoveDialog::show(const Vector<String> &to_erase) { _fill_owners(EditorFileSystem::get_singleton()->get_filesystem()); + if (exist) { owners->show(); text->set_text(TTR("The files being removed are required by other resources in order for them to work.\nRemove them anyway? (no undo)")); @@ -417,6 +418,10 @@ void DependencyRemoveDialog::ok_pressed() { DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); for (Map<String,TreeItem*>::Element *E=files.front();E;E=E->next()) { + if (ResourceCache::has(E->key())) { + Resource *res = ResourceCache::get(E->key()); + res->set_path(""); //clear reference to path + } da->remove(E->key()); EditorFileSystem::get_singleton()->update_file(E->key()); } diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index 2d0a8a80b0..ac9feacd46 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -649,6 +649,7 @@ void EditorHelp::_class_desc_input(const InputEvent& p_input) { class_desc->set_selection_enabled(false); class_desc->set_selection_enabled(true); } + set_focused(); } void EditorHelp::_add_type(const String& p_type) { diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index d63a010272..26e40cf816 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -56,7 +56,7 @@ #include "io/zip_io.h" #include "io/config_file.h" #include "animation_editor.h" - +#include "io/stream_peer_ssl.h" // plugins #include "plugins/sprite_frames_editor_plugin.h" #include "plugins/texture_region_editor_plugin.h" @@ -6381,8 +6381,12 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( CanvasItemEditorPlugin(this) ) ); add_editor_plugin( memnew( SpatialEditorPlugin(this) ) ); add_editor_plugin( memnew( ScriptEditorPlugin(this) ) ); - add_editor_plugin( memnew( AssetLibraryEditorPlugin(this) ) ); + if (StreamPeerSSL::is_available()) { + add_editor_plugin( memnew( AssetLibraryEditorPlugin(this) ) ); + } else { + WARN_PRINT("Asset Library not available, as it requires SSL to work."); + } //more visually meaningful to have this later raise_bottom_panel_item(AnimationPlayerEditor::singleton); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index d2d1f9e625..8d00f2cd8a 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -302,6 +302,7 @@ void ScriptTextEditor::_load_theme_settings() { get_text_edit()->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/breakpoint_color", Color(0.8,0.8,0.4,0.2))); get_text_edit()->add_color_override("search_result_color",EDITOR_DEF("text_editor/search_result_color",Color(0.05,0.25,0.05,1))); get_text_edit()->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/search_result_border_color",Color(0.1,0.45,0.1,1))); + get_text_edit()->add_constant_override("line_spacing", EDITOR_DEF("text_editor/line_spacing",4)); Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2)); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 0ca6a069bc..61dde9a9ef 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -375,6 +375,7 @@ void ShaderEditor::_editor_settings_changed() { vertex_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences")); vertex_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink")); vertex_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed")); + vertex_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing")); fragment_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete")); fragment_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file")); @@ -385,6 +386,7 @@ void ShaderEditor::_editor_settings_changed() { fragment_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences")); fragment_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink")); fragment_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed")); + fragment_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing")); light_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete")); light_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file")); @@ -395,6 +397,7 @@ void ShaderEditor::_editor_settings_changed() { light_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences")); light_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink")); light_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed")); + light_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing")); } void ShaderEditor::_bind_methods() { diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index c00bd0ab37..419f05f2cf 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -39,7 +39,7 @@ #include "scene/gui/line_edit.h" #include "scene/gui/panel_container.h" #include "scene/gui/center_container.h" - +#include "io/stream_peer_ssl.h" #include "scene/gui/texture_frame.h" #include "scene/gui/margin_container.h" @@ -986,10 +986,14 @@ ProjectManager::ProjectManager() { tree_vb->add_spacer(); + if (StreamPeerSSL::is_available()) { - asset_library = memnew( EditorAssetLibrary(true) ); - asset_library->set_name("Templates"); - tabs->add_child(asset_library); + asset_library = memnew( EditorAssetLibrary(true) ); + asset_library->set_name("Templates"); + tabs->add_child(asset_library); + } else { + WARN_PRINT("Asset Library not available, as it requires SSL to work."); + } CenterContainer *cc = memnew( CenterContainer ); diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp index 7c61e3d4a1..7953cf2739 100644 --- a/tools/editor/scenes_dock.cpp +++ b/tools/editor/scenes_dock.cpp @@ -1052,6 +1052,7 @@ void ScenesDock::_file_option(int p_option) { if (path.ends_with("/") || !files->is_selected(i)) continue; torem.push_back(path); + } if (torem.empty()) { |