diff --git a/core/image.cpp b/core/image.cpp index a1e7485e18a..fe32ba2d34c 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -3098,6 +3098,7 @@ Ref Image::rgbe_to_srgb() { void Image::bumpmap_to_normalmap(float bump_scale) { ERR_FAIL_COND(!_can_modify(format)); ERR_FAIL_COND_MSG(write_lock.ptr(), "Cannot modify image when it is locked."); + clear_mipmaps(); convert(Image::FORMAT_RF); PoolVector result_image; //rgba output diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index ae966a3c5d7..479b8055f6a 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -301,7 +301,7 @@ Error DirAccess::copy(String p_from, String p_to, int p_chmod_flags) { const size_t copy_buffer_limit = 65536; // 64 KB fsrc->seek_end(0); - int size = fsrc->get_position(); + uint64_t size = fsrc->get_position(); fsrc->seek(0); err = OK; size_t buffer_size = MIN(size * sizeof(uint8_t), copy_buffer_limit); diff --git a/core/os/midi_driver.cpp b/core/os/midi_driver.cpp index 9c5115a966f..2b8dbd7a648 100644 --- a/core/os/midi_driver.cpp +++ b/core/os/midi_driver.cpp @@ -87,11 +87,6 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_ if (length >= 2 + param_position) { event->set_pitch(data[param_position]); event->set_velocity(data[param_position + 1]); - - if (event->get_message() == MIDI_MESSAGE_NOTE_ON && event->get_velocity() == 0) { - // https://www.midi.org/forum/228-writing-midi-software-send-note-off,-or-zero-velocity-note-on - event->set_message(MIDI_MESSAGE_NOTE_OFF); - } } break; diff --git a/core/project_settings.cpp b/core/project_settings.cpp index b0d56085ce5..ea94f720026 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -1049,6 +1049,7 @@ ProjectSettings::ProjectSettings() { // Initialization of engine variables should be done in the setup() method, // so that the values can be overridden from project.godot or project.binary. + CRASH_COND_MSG(singleton != nullptr, "Instantiating a new ProjectSettings singleton is not supported."); singleton = this; last_order = NO_BUILTIN_ORDER_BASE; last_builtin_order = 0; diff --git a/doc/classes/AudioStreamGeneratorPlayback.xml b/doc/classes/AudioStreamGeneratorPlayback.xml index 21c0598519b..b433bb747e4 100644 --- a/doc/classes/AudioStreamGeneratorPlayback.xml +++ b/doc/classes/AudioStreamGeneratorPlayback.xml @@ -27,7 +27,7 @@ - Returns the number of audio data frames left to play. If this returned number reaches [code]0[/code], the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking. + Returns the number of frames that can be pushed to the audio sample data buffer without overflowing it. If the result is [code]0[/code], the buffer is full. diff --git a/doc/classes/InputEventMIDI.xml b/doc/classes/InputEventMIDI.xml index 894cff3cb50..9eb9f7d3c18 100644 --- a/doc/classes/InputEventMIDI.xml +++ b/doc/classes/InputEventMIDI.xml @@ -42,7 +42,7 @@ The pressure of the MIDI signal. This value ranges from 0 to 127. For many devices, this value is always zero. - The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice. + The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice. Note that some MIDI devices may send a [constant MIDI_MESSAGE_NOTE_ON] message with zero velocity and expect this to be treated the same as a [constant MIDI_MESSAGE_NOTE_OFF] message, but device implementations vary so Godot reports event data exactly as received. diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index fc87e998a00..fc22aad7706 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -493,6 +493,7 @@ Emitted when an item of some [code]id[/code] is pressed or its accelerator is activated. + [b]Note:[/b] If [code]id[/code] is negative (either explicitly or due to overflow), this will return the correponding index instead. diff --git a/drivers/gles2/shaders/tonemap.glsl b/drivers/gles2/shaders/tonemap.glsl index 11f1e037062..c048bd8a9a7 100644 --- a/drivers/gles2/shaders/tonemap.glsl +++ b/drivers/gles2/shaders/tonemap.glsl @@ -237,10 +237,10 @@ vec4 apply_fxaa(vec4 color, vec2 uv_interp, vec2 pixel_size) { const float FXAA_SPAN_MAX = 8.0; const vec3 luma = vec3(0.299, 0.587, 0.114); - vec4 rgbNW = texture2DLod(source, uv_interp + vec2(-1.0, -1.0) * pixel_size, 0.0); - vec4 rgbNE = texture2DLod(source, uv_interp + vec2(1.0, -1.0) * pixel_size, 0.0); - vec4 rgbSW = texture2DLod(source, uv_interp + vec2(-1.0, 1.0) * pixel_size, 0.0); - vec4 rgbSE = texture2DLod(source, uv_interp + vec2(1.0, 1.0) * pixel_size, 0.0); + vec4 rgbNW = textureLod(source, uv_interp + vec2(-0.5, -0.5) * pixel_size, 0.0); + vec4 rgbNE = textureLod(source, uv_interp + vec2(0.5, -0.5) * pixel_size, 0.0); + vec4 rgbSW = textureLod(source, uv_interp + vec2(-0.5, 0.5) * pixel_size, 0.0); + vec4 rgbSE = textureLod(source, uv_interp + vec2(0.5, 0.5) * pixel_size, 0.0); vec3 rgbM = color.rgb; #ifdef DISABLE_ALPHA diff --git a/drivers/gles3/shaders/tonemap.glsl b/drivers/gles3/shaders/tonemap.glsl index faede84d6eb..f6f93a32a10 100644 --- a/drivers/gles3/shaders/tonemap.glsl +++ b/drivers/gles3/shaders/tonemap.glsl @@ -325,10 +325,10 @@ vec4 apply_fxaa(vec4 color, float exposure, vec2 uv_interp, vec2 pixel_size) { const float FXAA_SPAN_MAX = 8.0; const vec3 luma = vec3(0.299, 0.587, 0.114); - vec4 rgbNW = textureLod(source, uv_interp + vec2(-1.0, -1.0) * pixel_size, 0.0); - vec4 rgbNE = textureLod(source, uv_interp + vec2(1.0, -1.0) * pixel_size, 0.0); - vec4 rgbSW = textureLod(source, uv_interp + vec2(-1.0, 1.0) * pixel_size, 0.0); - vec4 rgbSE = textureLod(source, uv_interp + vec2(1.0, 1.0) * pixel_size, 0.0); + vec4 rgbNW = textureLod(source, uv_interp + vec2(-0.5, -0.5) * pixel_size, 0.0); + vec4 rgbNE = textureLod(source, uv_interp + vec2(0.5, -0.5) * pixel_size, 0.0); + vec4 rgbSW = textureLod(source, uv_interp + vec2(-0.5, 0.5) * pixel_size, 0.0); + vec4 rgbSE = textureLod(source, uv_interp + vec2(0.5, 0.5) * pixel_size, 0.0); vec3 rgbM = color.rgb; #ifdef DISABLE_ALPHA diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index f9656f28012..d0a36d18666 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -154,7 +154,7 @@ Error DirAccessWindows::make_dir(String p_dir) { if (p_dir.is_rel_path()) p_dir = current_dir.plus_file(p_dir); - p_dir = p_dir.replace("/", "\\"); + p_dir = p_dir.simplify_path().replace("/", "\\"); bool success; int err; diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp index d45b280ec12..bd9a68cdd1c 100644 --- a/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -845,6 +845,8 @@ void Collada::_parse_curve_geometry(XMLParser &parser, String p_id, String p_nam CurveData &curvedata = state.curve_data_map[p_id]; curvedata.name = p_name; + String closed = parser.get_attribute_value_safe("closed").to_lower(); + curvedata.closed = closed == "true" || closed == "1"; COLLADA_PRINT("curve name: " + p_name); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 27fa98df786..188e895a764 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -549,7 +549,12 @@ bool EditorFileSystem::_update_scan_actions() { if (_test_for_reimport(full_path, false)) { //must reimport reimports.push_back(full_path); - reimports.append_array(_get_dependencies(full_path)); + Vector dependencies = _get_dependencies(full_path); + for (int i = 0; i < dependencies.size(); i++) { + if (import_extensions.has(dependencies[i].get_extension())) { + reimports.push_back(dependencies[i]); + } + } } else { //must not reimport, all was good //update modified times, to avoid reimport diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 88eb1469ec6..ebc078eb5f1 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3834,7 +3834,7 @@ void EditorNode::_quick_opened() { List scene_extensions; ResourceLoader::get_recognized_extensions_for_type("PackedScene", &scene_extensions); - if (open_scene_dialog || scene_extensions.find(files[i].get_extension())) { + if (open_scene_dialog || scene_extensions.find(files[i].get_extension().to_lower())) { open_request(res_path); } else { load_resource(res_path); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 16870dd6756..aeb3b600bfc 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -431,8 +431,7 @@ void FindInFilesDialog::set_find_in_files_mode(FindInFilesMode p_mode) { } String FindInFilesDialog::get_search_text() const { - String text = _search_text_line_edit->get_text(); - return text.strip_edges(); + return _search_text_line_edit->get_text(); } String FindInFilesDialog::get_replace_text() const { diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 93b76767acb..4164ef9959f 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1074,6 +1074,12 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, uint32_t p_use_com c->set_point_tilt(i, tilts->array[i]); } } + if (cd.closed && pc > 1) { + Vector3 pos = c->get_point_position(0); + Vector3 in = c->get_point_in(0); + Vector3 out = c->get_point_out(0); + c->add_point(pos, in, out, -1); + } curve_cache[ng->source] = c; path->set_curve(c); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index a1f00cb5cc9..a3c4ecc1511 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1478,16 +1478,17 @@ bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_ } static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref