diff options
-rw-r--r-- | core/core_bind.cpp | 8 | ||||
-rw-r--r-- | core/core_bind.h | 2 | ||||
-rw-r--r-- | doc/classes/Directory.xml | 8 | ||||
-rw-r--r-- | doc/classes/Resource.xml | 1 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 21 | ||||
-rw-r--r-- | editor/editor_settings.h | 2 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 4 | ||||
-rw-r--r-- | modules/csg/csg_shape.cpp | 52 | ||||
-rw-r--r-- | modules/gdscript/editor/gdscript_highlighter.cpp | 4 | ||||
-rw-r--r-- | scene/resources/tile_set.cpp | 2 |
10 files changed, 52 insertions, 52 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index b8c448dc82..05265c41ad 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -1616,11 +1616,11 @@ bool _Directory::is_open() const { return d && dir_open; } -Error _Directory::list_dir_begin(bool p_skip_navigational, bool p_skip_hidden) { +Error _Directory::list_dir_begin(bool p_show_navigational, bool p_show_hidden) { ERR_FAIL_COND_V_MSG(!is_open(), ERR_UNCONFIGURED, "Directory must be opened before use."); - _list_skip_navigational = p_skip_navigational; - _list_skip_hidden = p_skip_hidden; + _list_skip_navigational = !p_show_navigational; + _list_skip_hidden = !p_show_hidden; return d->list_dir_begin(); } @@ -1758,7 +1758,7 @@ Error _Directory::remove(String p_name) { void _Directory::_bind_methods() { ClassDB::bind_method(D_METHOD("open", "path"), &_Directory::open); - ClassDB::bind_method(D_METHOD("list_dir_begin", "skip_navigational", "skip_hidden"), &_Directory::list_dir_begin, DEFVAL(false), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("list_dir_begin", "show_navigational", "show_hidden"), &_Directory::list_dir_begin, DEFVAL(false), DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_next"), &_Directory::get_next); ClassDB::bind_method(D_METHOD("current_is_dir"), &_Directory::current_is_dir); ClassDB::bind_method(D_METHOD("list_dir_end"), &_Directory::list_dir_end); diff --git a/core/core_bind.h b/core/core_bind.h index be8b30b38d..8253040a12 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -467,7 +467,7 @@ public: bool is_open() const; - Error list_dir_begin(bool p_skip_navigational = false, bool p_skip_hidden = false); // This starts dir listing. + Error list_dir_begin(bool p_show_navigational = false, bool p_show_hidden = false); // This starts dir listing. String get_next(); bool current_is_dir() const; diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index a9d7960501..2c61d723cd 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -154,14 +154,14 @@ <method name="list_dir_begin"> <return type="int" enum="Error"> </return> - <argument index="0" name="skip_navigational" type="bool" default="false"> + <argument index="0" name="show_navigational" type="bool" default="false"> </argument> - <argument index="1" name="skip_hidden" type="bool" default="false"> + <argument index="1" name="show_hidden" type="bool" default="false"> </argument> <description> Initializes the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end]. - If [code]skip_navigational[/code] is [code]true[/code], [code].[/code] and [code]..[/code] are filtered out. - If [code]skip_hidden[/code] is [code]true[/code], hidden files are filtered out. + If [code]show_navigational[/code] is [code]true[/code], [code].[/code] and [code]..[/code] are included too. + If [code]show_hidden[/code] is [code]true[/code], hidden files are included too. </description> </method> <method name="list_dir_end"> diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index 2548f8d911..75736798fd 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -27,6 +27,7 @@ <description> Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [code]subresources[/code] argument which will copy the subresources. [b]Note:[/b] If [code]subresources[/code] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared. + [b]Note:[/b] When duplicating a resource, only [code]export[/code]ed properties are copied. Other properties will be set to their default value in the new resource. </description> </method> <method name="emit_changed"> diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 28b01c0d18..1255526a4a 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -502,12 +502,12 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { /* Text editor */ // Theme - _initial_set("text_editor/theme/color_theme", "Adaptive"); - hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Adaptive,Default,Custom"); + _initial_set("text_editor/theme/color_theme", "Default"); + hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Default,Godot 2,Custom"); _initial_set("text_editor/theme/line_spacing", 6); hints["text_editor/theme/line_spacing"] = PropertyInfo(Variant::INT, "text_editor/theme/line_spacing", PROPERTY_HINT_RANGE, "0,50,1"); - _load_default_text_editor_theme(); + _load_godot2_text_editor_theme(); // Highlighting _initial_set("text_editor/highlighting/highlight_all_occurrences", true); @@ -785,9 +785,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { }; } -void EditorSettings::_load_default_text_editor_theme() { - bool dark_theme = is_dark_theme(); - +void EditorSettings::_load_godot2_text_editor_theme() { + // Godot 2 is only a dark theme; it doesn't have a light theme counterpart. _initial_set("text_editor/highlighting/symbol_color", Color(0.73, 0.87, 1.0)); _initial_set("text_editor/highlighting/keyword_color", Color(1.0, 1.0, 0.7)); _initial_set("text_editor/highlighting/control_flow_keyword_color", Color(1.0, 0.85, 0.7)); @@ -796,7 +795,7 @@ void EditorSettings::_load_default_text_editor_theme() { _initial_set("text_editor/highlighting/user_type_color", Color(0.42, 0.67, 0.93)); _initial_set("text_editor/highlighting/comment_color", Color(0.4, 0.4, 0.4)); _initial_set("text_editor/highlighting/string_color", Color(0.94, 0.43, 0.75)); - _initial_set("text_editor/highlighting/background_color", dark_theme ? Color(0.0, 0.0, 0.0, 0.23) : Color(0.2, 0.23, 0.31)); + _initial_set("text_editor/highlighting/background_color", Color(0.13, 0.12, 0.15)); _initial_set("text_editor/highlighting/completion_background_color", Color(0.17, 0.16, 0.2)); _initial_set("text_editor/highlighting/completion_selected_color", Color(0.26, 0.26, 0.27)); _initial_set("text_editor/highlighting/completion_existing_color", Color(0.13, 0.87, 0.87, 0.87)); @@ -846,7 +845,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) { } bool EditorSettings::_is_default_text_editor_theme(String p_theme_name) { - return p_theme_name == "default" || p_theme_name == "adaptive" || p_theme_name == "custom"; + return p_theme_name == "default" || p_theme_name == "godot 2" || p_theme_name == "custom"; } static Dictionary _get_builtin_script_templates() { @@ -1367,7 +1366,7 @@ bool EditorSettings::is_dark_theme() { } void EditorSettings::list_text_editor_themes() { - String themes = "Adaptive,Default,Custom"; + String themes = "Default,Godot 2,Custom"; DirAccess *d = DirAccess::open(get_text_editor_themes_dir()); if (d) { @@ -1395,8 +1394,8 @@ void EditorSettings::load_text_editor_theme() { String p_file = get("text_editor/theme/color_theme"); if (_is_default_text_editor_theme(p_file.get_file().to_lower())) { - if (p_file == "Default") { - _load_default_text_editor_theme(); + if (p_file == "Godot 2") { + _load_godot2_text_editor_theme(); } return; // sorry for "Settings changed" console spam } diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 5c9eec34a2..4c361403a9 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -104,7 +104,7 @@ private: void _add_property_info_bind(const Dictionary &p_info); void _load_defaults(Ref<ConfigFile> p_extra_config = Ref<ConfigFile>()); - void _load_default_text_editor_theme(); + void _load_godot2_text_editor_theme(); bool _save_text_editor_theme(String p_file); bool _is_default_text_editor_theme(String p_theme_name); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 3c703f3680..7971dfc313 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1387,7 +1387,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { EditorSettings *setting = EditorSettings::get_singleton(); String text_editor_color_theme = setting->get("text_editor/theme/color_theme"); - if (text_editor_color_theme == "Adaptive") { + if (text_editor_color_theme == "Default") { setting->set_initial_value("text_editor/highlighting/symbol_color", symbol_color, true); setting->set_initial_value("text_editor/highlighting/keyword_color", keyword_color, true); setting->set_initial_value("text_editor/highlighting/control_flow_keyword_color", control_flow_keyword_color, true); @@ -1423,7 +1423,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { setting->set_initial_value("text_editor/highlighting/code_folding_color", code_folding_color, true); setting->set_initial_value("text_editor/highlighting/search_result_color", search_result_color, true); setting->set_initial_value("text_editor/highlighting/search_result_border_color", search_result_border_color, true); - } else if (text_editor_color_theme == "Default") { + } else if (text_editor_color_theme == "Godot 2") { setting->load_text_editor_theme(); } diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 541b7036ac..67dfdfb5eb 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -923,45 +923,43 @@ CSGBrush *CSGSphere3D::_build_brush() { Ref<Material> *materialsw = materials.ptrw(); bool *invertw = invert.ptrw(); + const double lat_step = 1.0 / rings; + const double lon_step = 1.0 / radial_segments; int face = 0; - const double lat_step = Math_TAU / rings; - const double lon_step = Math_TAU / radial_segments; - for (int i = 1; i <= rings; i++) { - double lat0 = lat_step * (i - 1) - Math_TAU / 4; - double z0 = Math::sin(lat0); - double zr0 = Math::cos(lat0); - double u0 = double(i - 1) / rings; - - double lat1 = lat_step * i - Math_TAU / 4; - double z1 = Math::sin(lat1); - double zr1 = Math::cos(lat1); - double u1 = double(i) / rings; - - for (int j = radial_segments; j >= 1; j--) { - double lng0 = lon_step * (j - 1); + double lat0 = Math_PI * (0.5 - (i - 1) * lat_step); + double c0 = Math::cos(lat0); + double s0 = Math::sin(lat0); + double v0 = double(i - 1) / rings; + + double lat1 = Math_PI * (0.5 - i * lat_step); + double c1 = Math::cos(lat1); + double s1 = Math::sin(lat1); + double v1 = double(i) / rings; + + for (int j = 1; j <= radial_segments; j++) { + double lng0 = Math_TAU * (0.5 - (j - 1) * lon_step); double x0 = Math::cos(lng0); double y0 = Math::sin(lng0); - double v0 = double(i - 1) / radial_segments; + double u0 = double(j - 1) / radial_segments; - double lng1 = lon_step * j; + double lng1 = Math_TAU * (0.5 - j * lon_step); double x1 = Math::cos(lng1); double y1 = Math::sin(lng1); - double v1 = double(i) / radial_segments; + double u1 = double(j) / radial_segments; Vector3 v[4] = { - Vector3(x1 * zr0, z0, y1 * zr0) * radius, - Vector3(x1 * zr1, z1, y1 * zr1) * radius, - Vector3(x0 * zr1, z1, y0 * zr1) * radius, - Vector3(x0 * zr0, z0, y0 * zr0) * radius + Vector3(x0 * c0, s0, y0 * c0) * radius, + Vector3(x1 * c0, s0, y1 * c0) * radius, + Vector3(x1 * c1, s1, y1 * c1) * radius, + Vector3(x0 * c1, s1, y0 * c1) * radius, }; Vector2 u[4] = { - Vector2(v1, u0), - Vector2(v1, u1), - Vector2(v0, u1), - Vector2(v0, u0), - + Vector2(u0, v0), + Vector2(u1, v0), + Vector2(u1, v1), + Vector2(u0, v1), }; if (i < rings) { diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index ca646dff15..d34cccb3af 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -546,7 +546,7 @@ void GDScriptSyntaxHighlighter::_update_cache() { } const String text_edit_color_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme"); - const bool default_theme = text_edit_color_theme == "Default"; + const bool default_theme = text_edit_color_theme == "Godot 2"; if (default_theme || EditorSettings::get_singleton()->is_dark_theme()) { function_definition_color = Color(0.4, 0.9, 1.0); @@ -558,7 +558,7 @@ void GDScriptSyntaxHighlighter::_update_cache() { EDITOR_DEF("text_editor/highlighting/gdscript/function_definition_color", function_definition_color); EDITOR_DEF("text_editor/highlighting/gdscript/node_path_color", node_path_color); - if (text_edit_color_theme == "Adaptive" || default_theme) { + if (text_edit_color_theme == "Default" || default_theme) { EditorSettings::get_singleton()->set_initial_value( "text_editor/highlighting/gdscript/function_definition_color", function_definition_color, diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 308f219a8d..59c1a4e915 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -1407,9 +1407,11 @@ TileSet::TileSet() { } TileSet::~TileSet() { +#ifndef DISABLE_DEPRECATED for (Map<int, CompatibilityTileData *>::Element *E = compatibility_data.front(); E; E = E->next()) { memdelete(E->get()); } +#endif // DISABLE_DEPRECATED while (!source_ids.is_empty()) { remove_source(source_ids[0]); } |