diff options
-rwxr-xr-x | doc/tools/makerst.py | 6 | ||||
-rw-r--r-- | editor/editor_export.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/project_export.cpp | 6 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 6 | ||||
-rw-r--r-- | methods.py | 2 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_field.cpp | 2 | ||||
-rw-r--r-- | platform/android/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/iphone/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/javascript/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/uwp/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/x11/joypad_linux.cpp | 8 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 2 | ||||
-rw-r--r-- | servers/audio_server.cpp | 6 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.h | 3 | ||||
-rw-r--r-- | version.py | 1 |
17 files changed, 56 insertions, 12 deletions
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 22c0b5d1fd..4b5785f604 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -950,6 +950,12 @@ def make_method_signature(class_def, method_def, make_ref, state): # type: (Cla if arg.default_value is not None: out += '=' + arg.default_value + if isinstance(method_def, MethodDef) and method_def.qualifiers is not None and 'vararg' in method_def.qualifiers: + if len(method_def.parameters) > 0: + out += ', ...' + else: + out += '...' + out += ' **)**' if isinstance(method_def, MethodDef) and method_def.qualifiers is not None: diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 75708431ec..249bbb2a39 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1456,6 +1456,10 @@ List<String> EditorExportPlatformPC::get_binary_extensions(const Ref<EditorExpor Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) { ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + if (!FileAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + String custom_debug = p_preset->get("custom_template/debug"); String custom_release = p_preset->get("custom_template/release"); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index ab3936407b..a9e9607bc5 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -177,6 +177,8 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const thumbnail = thumbnail->duplicate(); Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2); + // Overlay and thumbnail need the same format for `blend_rect` to work. + thumbnail->convert(Image::FORMAT_RGBA8); thumbnail->lock(); thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos); thumbnail->unlock(); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 831ebde3a6..82a6a07805 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -1012,7 +1012,11 @@ void ProjectExportDialog::_export_all(bool p_debug) { Error err = platform->export_project(preset, p_debug, preset->get_export_path(), 0); if (err != OK) { - error_dialog->set_text(TTR("Export templates for this platform are missing/corrupted:") + " " + platform->get_name()); + if (err == ERR_FILE_BAD_PATH) { + error_dialog->set_text(TTR("The given export path doesn't exist:") + "\n" + preset->get_export_path().get_base_dir()); + } else { + error_dialog->set_text(TTR("Export templates for this platform are missing/corrupted:") + " " + platform->get_name()); + } error_dialog->show(); error_dialog->popup_centered_minsize(Size2(300, 80)); ERR_PRINT("Failed to export project"); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index d931d5bb37..084830ed7b 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -336,9 +336,13 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_ATTACH_SCRIPT: { + List<Node *> selection = editor_selection->get_selected_node_list(); + if (selection.empty()) + break; + Node *selected = scene_tree->get_selected(); if (!selected) - break; + selected = selection.front()->get(); Ref<Script> existing = selected->get_script(); diff --git a/methods.py b/methods.py index 2d4dc4921f..7465962187 100644 --- a/methods.py +++ b/methods.py @@ -55,7 +55,7 @@ def update_version(module_version_string=""): f.write("#define VERSION_STATUS \"" + str(version.status) + "\"\n") f.write("#define VERSION_BUILD \"" + str(build_name) + "\"\n") f.write("#define VERSION_MODULE_CONFIG \"" + str(version.module_config) + module_version_string + "\"\n") - f.write("#define VERSION_YEAR " + str(2018) + "\n") + f.write("#define VERSION_YEAR " + str(version.year) + "\n") f.close() # NOTE: It is safe to generate this file here, since this is still executed serially diff --git a/modules/mono/mono_gd/gd_mono_field.cpp b/modules/mono/mono_gd/gd_mono_field.cpp index 48fa380456..5e9d4db122 100644 --- a/modules/mono/mono_gd/gd_mono_field.cpp +++ b/modules/mono/mono_gd/gd_mono_field.cpp @@ -49,7 +49,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ #define SET_FROM_ARRAY(m_type) \ { \ MonoArray *managed = GDMonoMarshal::m_type##_to_mono_array(p_value.operator ::m_type()); \ - mono_field_set_value(p_object, mono_field, &managed); \ + mono_field_set_value(p_object, mono_field, managed); \ } switch (type.type_encoding) { diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 8ffd355219..0f2455914d 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1489,6 +1489,10 @@ public: } } + if (!FileAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + FileAccess *src_f = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 67034388b9..05907be020 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -836,6 +836,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p } } + if (!FileAccess::exists(dest_dir)) { + return ERR_FILE_BAD_PATH; + } + DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); if (da) { String current_dir = da->get_current_dir(); diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index ec610a70fd..b7ca1eb1d7 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -211,6 +211,10 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese template_path = find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE); } + if (!FileAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + if (template_path != String() && !FileAccess::exists(template_path)) { EditorNode::get_singleton()->show_warning(TTR("Template file not found:") + "\n" + template_path); return ERR_FILE_NOT_FOUND; diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index b8f6977b39..a0eccceed0 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -425,6 +425,10 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p } } + if (!FileAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + FileAccess *src_f = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index a4655117a7..8405608dd6 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1265,6 +1265,10 @@ public: } } + if (!FileAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + Error err = OK; FileAccess *fa_pack = FileAccess::open(p_path, FileAccess::WRITE, &err); diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index 7cf0a1ef1e..c4dd8fe0e0 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -367,12 +367,12 @@ void JoypadLinux::open_joypad(const char *p_path) { joy.fd = fd; joy.devpath = String(p_path); setup_joypad_properties(joy_num); - sprintf(uid, "%04x%04x", __bswap_16(inpid.bustype), 0); + sprintf(uid, "%04x%04x", BSWAP16(inpid.bustype), 0); if (inpid.vendor && inpid.product && inpid.version) { - uint16_t vendor = __bswap_16(inpid.vendor); - uint16_t product = __bswap_16(inpid.product); - uint16_t version = __bswap_16(inpid.version); + uint16_t vendor = BSWAP16(inpid.vendor); + uint16_t product = BSWAP16(inpid.product); + uint16_t version = BSWAP16(inpid.version); sprintf(uid + String(uid).length(), "%04x%04x%04x%04x%04x%04x", vendor, 0, product, 0, version, 0); input->joy_connection_changed(joy_num, true, name, uid); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f38bc62a3c..2bf2364873 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -666,7 +666,7 @@ void TextEdit::_notification(int p_what) { bool brace_close_matching = false; bool brace_close_mismatch = false; - if (brace_matching_enabled) { + if (brace_matching_enabled && cursor.line >= 0 && cursor.line < text.size() && cursor.column >= 0) { if (cursor.column < text[cursor.line].length()) { //check for open diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 14c555ab5b..8c092a02a2 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -259,11 +259,13 @@ void AudioServer::_driver_process(int p_frames, int32_t *p_buffer) { float l = CLAMP(buf[from + j].l, -1.0, 1.0); int32_t vl = l * ((1 << 20) - 1); - p_buffer[(from_buf + j) * (cs * 2) + k * 2 + 0] = vl << 11; + int32_t vl2 = (vl < 0 ? -1 : 1) * (ABS(vl) << 11); + p_buffer[(from_buf + j) * (cs * 2) + k * 2 + 0] = vl2; float r = CLAMP(buf[from + j].r, -1.0, 1.0); int32_t vr = r * ((1 << 20) - 1); - p_buffer[(from_buf + j) * (cs * 2) + k * 2 + 1] = vr << 11; + int32_t vr2 = (vr < 0 ? -1 : 1) * (ABS(vr) << 11); + p_buffer[(from_buf + j) * (cs * 2) + k * 2 + 1] = vr2; } } else { diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h index 4e3015c020..5176551540 100644 --- a/servers/visual/visual_server_viewport.h +++ b/servers/visual/visual_server_viewport.h @@ -90,7 +90,8 @@ public: } CanvasKey(const RID &p_canvas, int p_layer, int p_sublayer) { canvas = p_canvas; - stacking = ((int64_t)p_layer << 32) + p_sublayer; + int64_t sign = p_layer < 0 ? -1 : 1; + stacking = sign * (((int64_t)ABS(p_layer)) << 32) + p_sublayer; } int get_layer() const { return stacking >> 32; } }; diff --git a/version.py b/version.py index 17be155464..0d85b83b8d 100644 --- a/version.py +++ b/version.py @@ -4,3 +4,4 @@ major = 3 minor = 1 status = "beta" module_config = "" +year = 2019 |