diff options
-rw-r--r-- | core/list.h | 6 | ||||
-rw-r--r-- | core/math/rect2.h | 2 | ||||
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 12 | ||||
-rw-r--r-- | modules/gdscript/gdscript.h | 5 | ||||
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 11 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 13 | ||||
-rw-r--r-- | platform/android/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/iphone/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 1 | ||||
-rw-r--r-- | platform/x11/crash_handler_x11.cpp | 10 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 54 | ||||
-rw-r--r-- | platform/x11/power_x11.cpp | 2 | ||||
-rw-r--r-- | scene/resources/animation.h | 1 |
14 files changed, 60 insertions, 73 deletions
diff --git a/core/list.h b/core/list.h index c21c20ba34..103a82a31d 100644 --- a/core/list.h +++ b/core/list.h @@ -503,8 +503,7 @@ public: if (p_I->prev_ptr) p_I->prev_ptr->next_ptr = p_I->next_ptr; - if (p_I->next_ptr) - p_I->next_ptr->prev_ptr = p_I->prev_ptr; + p_I->next_ptr->prev_ptr = p_I->prev_ptr; _data->last->next_ptr = p_I; p_I->prev_ptr = _data->last; @@ -538,8 +537,7 @@ public: if (_data->last == p_I) _data->last = p_I->prev_ptr; - if (p_I->prev_ptr) - p_I->prev_ptr->next_ptr = p_I->next_ptr; + p_I->prev_ptr->next_ptr = p_I->next_ptr; if (p_I->next_ptr) p_I->next_ptr->prev_ptr = p_I->prev_ptr; diff --git a/core/math/rect2.h b/core/math/rect2.h index 3b66617c83..d636aa223f 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -67,7 +67,7 @@ struct Rect2 { if (p_point.x < position.x) { real_t d = position.x - p_point.x; - dist = inside ? d : MIN(dist, d); + dist = d; inside = false; } if (p_point.y < position.y) { diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 41f35c3bed..7c075b5635 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -846,6 +846,12 @@ void AnimationPlayerEditor::_update_player() { onion_skinning->set_disabled(player == NULL); pin->set_disabled(player == NULL); + if (!player) { + AnimationPlayerEditor::singleton->get_track_editor()->update_keying(); + EditorNode::get_singleton()->update_keying(); + return; + } + int active_idx = -1; for (List<StringName>::Element *E = animlist.front(); E; E = E->next()) { @@ -858,12 +864,6 @@ void AnimationPlayerEditor::_update_player() { active_idx = animation->get_item_count() - 1; } - if (!player) { - AnimationPlayerEditor::singleton->get_track_editor()->update_keying(); - EditorNode::get_singleton()->update_keying(); - return; - } - updating = false; if (active_idx != -1) { animation->select(active_idx); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 88bb8e38fe..c0f2410636 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1471,10 +1471,14 @@ bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) { if (!use_single_axis || use_y) control->set_anchor(MARGIN_BOTTOM, new_anchor.y, false, false); break; case DRAG_ANCHOR_ALL: - if (!use_single_axis || !use_y) control->set_anchor(MARGIN_LEFT, new_anchor.x, false, true); - if (!use_single_axis || !use_y) control->set_anchor(MARGIN_RIGHT, new_anchor.x, false, true); - if (!use_single_axis || use_y) control->set_anchor(MARGIN_TOP, new_anchor.y, false, true); - if (!use_single_axis || use_y) control->set_anchor(MARGIN_BOTTOM, new_anchor.y, false, true); + if (!use_single_axis || !use_y) { + control->set_anchor(MARGIN_LEFT, new_anchor.x, false, true); + control->set_anchor(MARGIN_RIGHT, new_anchor.x, false, true); + } + if (!use_single_axis || use_y) { + control->set_anchor(MARGIN_TOP, new_anchor.y, false, true); + control->set_anchor(MARGIN_BOTTOM, new_anchor.y, false, true); + } break; default: break; diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 1d75d9e2fe..38009b878d 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -407,9 +407,10 @@ public: csi.resize(_debug_call_stack_pos); for (int i = 0; i < _debug_call_stack_pos; i++) { csi.write[_debug_call_stack_pos - i - 1].line = _call_stack[i].line ? *_call_stack[i].line : 0; - if (_call_stack[i].function) + if (_call_stack[i].function) { csi.write[_debug_call_stack_pos - i - 1].func = _call_stack[i].function->get_name(); - csi.write[_debug_call_stack_pos - i - 1].file = _call_stack[i].function->get_script()->get_path(); + csi.write[_debug_call_stack_pos - i - 1].file = _call_stack[i].function->get_script()->get_path(); + } } return csi; } diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 69bf114c8e..bcf3140fa6 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2178,7 +2178,6 @@ static void _find_identifiers(const GDScriptCompletionContext &p_context, bool p static void _find_call_arguments(const GDScriptCompletionContext &p_context, const GDScriptCompletionIdentifier &p_base, const StringName &p_method, int p_argidx, bool p_static, Set<String> &r_result, String &r_arghint) { Variant base = p_base.value; GDScriptParser::DataType base_type = p_base.type; - bool _static = false; const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; @@ -2191,12 +2190,10 @@ static void _find_call_arguments(const GDScriptCompletionContext &p_context, con return; } } - if (!_static) { - for (int i = 0; i < base_type.class_type->functions.size(); i++) { - if (base_type.class_type->functions[i]->name == p_method) { - r_arghint = _make_arguments_hint(base_type.class_type->functions[i], p_argidx); - return; - } + for (int i = 0; i < base_type.class_type->functions.size(); i++) { + if (base_type.class_type->functions[i]->name == p_method) { + r_arghint = _make_arguments_hint(base_type.class_type->functions[i], p_argidx); + return; } } diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 80af094c2c..51ec0c1442 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -282,7 +282,6 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s switch (tokenizer->get_token()) { case GDScriptTokenizer::TK_CURSOR: { - completion_cursor = StringName(); completion_type = COMPLETION_GET_NODE; completion_class = current_class; completion_function = current_function; @@ -2870,8 +2869,6 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { lv->assign_op = op; lv->assign = assigned; - lv->assign_op = op; - if (!_end_statement()) { _set_error("Expected end of statement (var)"); return; @@ -6226,8 +6223,8 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { return DataType(); } #ifdef DEBUG_ENABLED - if (var_op == Variant::OP_DIVIDE && argument_a_type.has_type && argument_a_type.kind == DataType::BUILTIN && argument_a_type.builtin_type == Variant::INT && - argument_b_type.has_type && argument_b_type.kind == DataType::BUILTIN && argument_b_type.builtin_type == Variant::INT) { + if (var_op == Variant::OP_DIVIDE && argument_a_type.kind == DataType::BUILTIN && argument_a_type.builtin_type == Variant::INT && + argument_b_type.kind == DataType::BUILTIN && argument_b_type.builtin_type == Variant::INT) { _add_warning(GDScriptWarning::INTEGER_DIVISION, op->line); } #endif // DEBUG_ENABLED @@ -6938,10 +6935,8 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat #ifdef DEBUG_ENABLED if (current_function && !for_completion && !is_static && p_call->arguments[0]->type == Node::TYPE_SELF && current_function->_static) { - if (current_function && current_function->_static && p_call->arguments[0]->type == Node::TYPE_SELF) { - _set_error("Can't call non-static function from a static function.", p_call->line); - return DataType(); - } + _set_error("Can't call non-static function from a static function.", p_call->line); + return DataType(); } if (check_types && !is_static && !is_initializer && base_type.is_meta_type) { diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 2a3d0843a8..f45644f1eb 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1864,7 +1864,6 @@ public: return ERR_FILE_NOT_FOUND; } - ERR_FAIL_COND_V(!pkg, ERR_CANT_OPEN); int ret = unzGoToFirstFile(pkg); zlib_filefunc_def io2 = io; @@ -2204,7 +2203,6 @@ public: return ERR_FILE_NOT_FOUND; } - ERR_FAIL_COND_V(!tmp_unaligned, ERR_CANT_OPEN); ret = unzGoToFirstFile(tmp_unaligned); io2 = io; diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 85d4b9e847..e1083aeefc 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -920,7 +920,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p EditorNode::add_io_error("Could not open export template (not a zip file?):\n" + src_pkg_name); return ERR_CANT_OPEN; } - ERR_FAIL_COND_V(!src_pkg_zip, ERR_CANT_OPEN); + int ret = unzGoToFirstFile(src_pkg_zip); Vector<uint8_t> project_file_data; while (ret == UNZ_OK) { diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 1a63d6ff75..89212b0e5e 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -441,7 +441,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p return ERR_FILE_NOT_FOUND; } - ERR_FAIL_COND_V(!src_pkg_zip, ERR_CANT_OPEN); int ret = unzGoToFirstFile(src_pkg_zip); String binary_to_use = "godot_osx_" + String(p_debug ? "debug" : "release") + ".64"; diff --git a/platform/x11/crash_handler_x11.cpp b/platform/x11/crash_handler_x11.cpp index 1e7f393bdd..44d3cf1910 100644 --- a/platform/x11/crash_handler_x11.cpp +++ b/platform/x11/crash_handler_x11.cpp @@ -96,12 +96,10 @@ static void handle_crash(int sig) { String output = ""; // Try to get the file/line number using addr2line - if (OS::get_singleton()) { - int ret; - Error err = OS::get_singleton()->execute(String("addr2line"), args, true, NULL, &output, &ret); - if (err == OK) { - output.erase(output.length() - 1, 1); - } + int ret; + Error err = OS::get_singleton()->execute(String("addr2line"), args, true, NULL, &output, &ret); + if (err == OK) { + output.erase(output.length() - 1, 1); } fprintf(stderr, "[%ld] %s (%ls)\n", i, fname, output.c_str()); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 267ac08a72..5a3d3acb12 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -503,35 +503,33 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a current_cursor = CURSOR_ARROW; - if (cursor_theme) { - for (int i = 0; i < CURSOR_MAX; i++) { - - static const char *cursor_file[] = { - "left_ptr", - "xterm", - "hand2", - "cross", - "watch", - "left_ptr_watch", - "fleur", - "hand1", - "X_cursor", - "sb_v_double_arrow", - "sb_h_double_arrow", - "size_bdiag", - "size_fdiag", - "hand1", - "sb_v_double_arrow", - "sb_h_double_arrow", - "question_arrow" - }; + for (int i = 0; i < CURSOR_MAX; i++) { - img[i] = XcursorLibraryLoadImage(cursor_file[i], cursor_theme, cursor_size); - if (img[i]) { - cursors[i] = XcursorImageLoadCursor(x11_display, img[i]); - } else { - print_verbose("Failed loading custom cursor: " + String(cursor_file[i])); - } + static const char *cursor_file[] = { + "left_ptr", + "xterm", + "hand2", + "cross", + "watch", + "left_ptr_watch", + "fleur", + "hand1", + "X_cursor", + "sb_v_double_arrow", + "sb_h_double_arrow", + "size_bdiag", + "size_fdiag", + "hand1", + "sb_v_double_arrow", + "sb_h_double_arrow", + "question_arrow" + }; + + img[i] = XcursorLibraryLoadImage(cursor_file[i], cursor_theme, cursor_size); + if (img[i]) { + cursors[i] = XcursorImageLoadCursor(x11_display, img[i]); + } else { + print_verbose("Failed loading custom cursor: " + String(cursor_file[i])); } } diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp index 943c2b1383..50da6a4967 100644 --- a/platform/x11/power_x11.cpp +++ b/platform/x11/power_x11.cpp @@ -115,7 +115,7 @@ bool PowerX11::make_proc_acpi_key_val(char **_ptr, char **_key, char **_val) { *(ptr++) = '\0'; /* terminate the key. */ - while ((*ptr == ' ') && (*ptr != '\0')) { + while (*ptr == ' ') { ptr++; /* skip whitespace. */ } diff --git a/scene/resources/animation.h b/scene/resources/animation.h index b66ae184e9..3d38a8902f 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -93,7 +93,6 @@ private: template <class T> struct TKey : public Key { - float time; T value; }; |