diff options
-rw-r--r-- | CONTRIBUTING.md | 2 | ||||
-rw-r--r-- | core/hashfuncs.h | 18 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 2 | ||||
-rw-r--r-- | core/variant.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 29 | ||||
-rw-r--r-- | editor/editor_node.h | 3 | ||||
-rw-r--r-- | editor/property_editor.cpp | 8 | ||||
-rw-r--r-- | modules/gdnative/godot/godot_string.cpp | 10 | ||||
-rw-r--r-- | modules/gdnative/godot/godot_string.h | 4 | ||||
-rw-r--r-- | scene/resources/packed_scene.cpp | 2 |
10 files changed, 22 insertions, 58 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 21ce52d6e3..23ab874a2e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,7 +90,7 @@ The Godot Engine community has [many communication channels](https://godotengine To communicate with developers (e.g. to discuss a feature you want to implement or a bug you want to fix), the following channels can be used: - [GitHub issues](https://github.com/godotengine/godot/issues): If there is an existing issue about a topic you want to discuss, just add a comment to it - all developers watch the repository and will get an email notification. You can also create a new issue - please keep in mind to create issues only to discuss quite specific points about the development, and not general user feedback or support requests. -- [#godotengine-devel IRC channel on Freenode](http://webchat.freenode.net/?channels=godotengine-devel): You will find most core developers there, so it's the go-to channel for direct chat about Godot Engine development. Feel free to start discussing something there to get some early feedback before writing up a detailed proposal in a GitHub issue. +- [#godotengine-devel IRC channel on Freenode](https://webchat.freenode.net/?channels=godotengine-devel): You will find most core developers there, so it's the go-to channel for direct chat about Godot Engine development. Feel free to start discussing something there to get some early feedback before writing up a detailed proposal in a GitHub issue. - [devel@godotengine.org mailing list](https://listengine.tuxfamily.org/godotengine.org/devel/): Mailing list for Godot developers, used primarily to announce developer meetings on IRC and other important discussions that need to reach people directly in their mailbox. See the [index page](https://listengine.tuxfamily.org/godotengine.org/devel/) for subscription instructions. Thanks! diff --git a/core/hashfuncs.h b/core/hashfuncs.h index fbd2e161b3..8392984565 100644 --- a/core/hashfuncs.h +++ b/core/hashfuncs.h @@ -81,24 +81,6 @@ static inline uint32_t hash_one_uint64(const uint64_t p_int) { return (int)v; } -static inline uint32_t hash_djb2_one_float(float p_in, uint32_t p_prev = 5381) { - union { - float f; - uint32_t i; - } u; - - // Normalize +/- 0.0 and NaN values so they hash the same. - if (p_in == 0.0f) - u.f = 0.0; - else if (Math::is_nan(p_in)) - u.f = Math_NAN; - else - u.f = p_in; - - return ((p_prev << 5) + p_prev) + u.i; -} - -// Overload for real_t size changes static inline uint32_t hash_djb2_one_float(double p_in, uint32_t p_prev = 5381) { union { double d; diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 3889c8f3ae..5e66b7f7f5 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -862,7 +862,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len) { } else { if (buf) { - encode_double(p_variant.operator float(), buf); + encode_float(p_variant.operator float(), buf); } r_len += 4; diff --git a/core/variant.cpp b/core/variant.cpp index 6e675d07de..67ce8af483 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -2839,7 +2839,7 @@ uint32_t Variant::hash() const { } #define hash_compare_scalar(p_lhs, p_rhs) \ - ((p_lhs) == (p_rhs)) || (Math::is_nan(p_lhs) == Math::is_nan(p_rhs)) + ((p_lhs) == (p_rhs)) || (Math::is_nan(p_lhs) && Math::is_nan(p_rhs)) #define hash_compare_vector2(p_lhs, p_rhs) \ (hash_compare_scalar((p_lhs).x, (p_rhs).x)) && \ diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 9baa203790..cc7ee44902 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -447,18 +447,6 @@ void EditorNode::_sources_changed(bool p_exist) { void EditorNode::_vp_resized() { } -void EditorNode::_rebuild_import_menu() { - PopupMenu *p = import_menu->get_popup(); - p->clear(); -//p->add_item(TTR("Node From Scene"), FILE_IMPORT_SUBSCENE); -//p->add_separator(); -#if 0 - for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) { - p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i); - } -#endif -} - void EditorNode::_node_renamed() { if (property_editor) @@ -4862,9 +4850,9 @@ EditorNode::EditorNode() { import_wav.instance(); ResourceFormatImporter::get_singleton()->add_importer(import_wav); - //Ref<ResourceImporterOBJ> import_obj; - //import_obj.instance(); - //ResourceFormatImporter::get_singleton()->add_importer(import_obj); + Ref<ResourceImporterOBJ> import_obj; + import_obj.instance(); + ResourceFormatImporter::get_singleton()->add_importer(import_obj); Ref<ResourceImporterScene> import_scene; import_scene.instance(); @@ -5257,15 +5245,6 @@ EditorNode::EditorNode() { menu_panel->add_child( resource_menu ); #endif - import_menu = memnew(MenuButton); - import_menu->set_tooltip(TTR("Import assets to the project.")); - import_menu->set_text(TTR("Import")); - //import_menu->set_icon(gui_base->get_icon("Save","EditorIcons")); - left_menu_hb->add_child(import_menu); - - p = import_menu->get_popup(); - p->connect("id_pressed", this, "_menu_option"); - tool_menu = memnew(MenuButton); tool_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools.")); tool_menu->set_text(TTR("Tools")); @@ -5960,8 +5939,6 @@ EditorNode::EditorNode() { circle_step_frame = Engine::get_singleton()->get_frames_drawn(); circle_step = 0; - _rebuild_import_menu(); - editor_plugin_screen = NULL; editor_plugins_over = memnew(EditorPluginList); diff --git a/editor/editor_node.h b/editor/editor_node.h index e7f4085fc5..7de713eae9 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -242,7 +242,6 @@ private: HBoxContainer *menu_hb; Control *viewport; MenuButton *file_menu; - MenuButton *import_menu; MenuButton *tool_menu; ToolButton *export_button; ToolButton *prev_scene; @@ -447,8 +446,6 @@ private: void _show_messages(); void _vp_resized(); - void _rebuild_import_menu(); - void _save_scene(String p_file, int idx = -1); void _instance_request(const Vector<String> &p_files); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 86136fa78b..77de27a651 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -2388,6 +2388,10 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String &p RES res = obj->get(p_name).operator RefPtr(); if (res->is_class("Texture")) { int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width"); + Vector2 size(res->call("get_width"), res->call("get_height")); + if (size.width < size.height) { + tw = MAX((size.width / size.height) * tw, 1); + } p_item->set_icon_max_width(1, tw); p_item->set_icon(1, res); p_item->set_text(1, ""); @@ -3618,6 +3622,10 @@ void PropertyEditor::update_tree() { if (res->is_class("Texture")) { int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width"); + Vector2 size(res->call("get_width"), res->call("get_height")); + if (size.width < size.height) { + tw = MAX((size.width / size.height) * tw, 1); + } item->set_icon_max_width(1, tw); item->set_icon(1, res); item->set_text(1, ""); diff --git a/modules/gdnative/godot/godot_string.cpp b/modules/gdnative/godot/godot_string.cpp index 2a78b2c96f..757b8510cf 100644 --- a/modules/gdnative/godot/godot_string.cpp +++ b/modules/gdnative/godot/godot_string.cpp @@ -53,13 +53,13 @@ void GDAPI godot_string_new_data(godot_string *p_str, const char *p_contents, co *p = String::utf8(p_contents, p_size); } -void GDAPI godot_string_get_data(const godot_string *p_str, wchar_t *p_dest, int *p_size) { +void GDAPI godot_string_get_data(const godot_string *p_str, char *p_dest, int *p_size) { String *p = (String *)p_str; if (p_size != NULL) { - *p_size = p->length(); + *p_size = p->utf8().length(); } if (p_dest != NULL) { - memcpy(p_dest, p->ptr(), *p_size * sizeof(CharType)); + memcpy(p_dest, p->utf8().get_data(), *p_size); } } @@ -75,9 +75,9 @@ wchar_t GDAPI *godot_string_operator_index(godot_string *p_str, const godot_int return &(s->operator[](p_idx)); } -const wchar_t GDAPI *godot_string_c_str(const godot_string *p_str) { +const char GDAPI *godot_string_c_str(const godot_string *p_str) { const String *s = (const String *)p_str; - return s->c_str(); + return s->utf8().get_data(); } godot_bool GDAPI godot_string_operator_equal(const godot_string *p_a, const godot_string *p_b) { diff --git a/modules/gdnative/godot/godot_string.h b/modules/gdnative/godot/godot_string.h index 7cde482cce..9289531c5e 100644 --- a/modules/gdnative/godot/godot_string.h +++ b/modules/gdnative/godot/godot_string.h @@ -47,12 +47,12 @@ typedef struct godot_string { void GDAPI godot_string_new(godot_string *p_str); void GDAPI godot_string_new_data(godot_string *p_str, const char *p_contents, const int p_size); -void GDAPI godot_string_get_data(const godot_string *p_str, wchar_t *p_dest, int *p_size); +void GDAPI godot_string_get_data(const godot_string *p_str, char *p_dest, int *p_size); void GDAPI godot_string_copy_string(const godot_string *p_dest, const godot_string *p_src); wchar_t GDAPI *godot_string_operator_index(godot_string *p_str, const godot_int p_idx); -const wchar_t GDAPI *godot_string_c_str(const godot_string *p_str); +const char GDAPI *godot_string_c_str(const godot_string *p_str); godot_bool GDAPI godot_string_operator_equal(const godot_string *p_a, const godot_string *p_b); godot_bool GDAPI godot_string_operator_less(const godot_string *p_a, const godot_string *p_b); diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 7738157330..50fbb6a162 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1775,7 +1775,7 @@ void PackedScene::set_path(const String &p_path, bool p_take_over) { void PackedScene::_bind_methods() { ClassDB::bind_method(D_METHOD("pack", "path:Node"), &PackedScene::pack); - ClassDB::bind_method(D_METHOD("instance:Node", "edit_state"), &PackedScene::instance, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("instance:Node", "edit_state"), &PackedScene::instance, DEFVAL(GEN_EDIT_STATE_DISABLED)); ClassDB::bind_method(D_METHOD("can_instance"), &PackedScene::can_instance); ClassDB::bind_method(D_METHOD("_set_bundled_scene"), &PackedScene::_set_bundled_scene); ClassDB::bind_method(D_METHOD("_get_bundled_scene"), &PackedScene::_get_bundled_scene); |