diff options
-rw-r--r-- | core/io/resource_loader.cpp | 26 | ||||
-rw-r--r-- | doc/classes/ResourceImporterWAV.xml | 4 | ||||
-rw-r--r-- | editor/editor_resource_picker.cpp | 6 | ||||
-rw-r--r-- | editor/gui/scene_tree_editor.cpp | 1 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 1 | ||||
-rw-r--r-- | editor/themes/editor_theme_manager.cpp | 4 | ||||
-rw-r--r-- | platform/windows/windows_utils.cpp | 2 | ||||
-rw-r--r-- | servers/xr/xr_vrs.cpp | 7 |
8 files changed, 33 insertions, 18 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 0dcde5509a..eb3b117297 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -463,25 +463,23 @@ Ref<Resource> ResourceLoader::load(const String &p_path, const String &p_type_hi Ref<ResourceLoader::LoadToken> ResourceLoader::_load_start(const String &p_path, const String &p_type_hint, LoadThreadMode p_thread_mode, ResourceFormatLoader::CacheMode p_cache_mode) { String local_path = _validate_local_path(p_path); + bool ignoring_cache = p_cache_mode == ResourceFormatLoader::CACHE_MODE_IGNORE || p_cache_mode == ResourceFormatLoader::CACHE_MODE_IGNORE_DEEP; + Ref<LoadToken> load_token; - bool must_not_register = false; ThreadLoadTask unregistered_load_task; // Once set, must be valid up to the call to do the load. ThreadLoadTask *load_task_ptr = nullptr; bool run_on_current_thread = false; { MutexLock thread_load_lock(thread_load_mutex); - if (thread_load_tasks.has(local_path)) { + if (!ignoring_cache && thread_load_tasks.has(local_path)) { load_token = Ref<LoadToken>(thread_load_tasks[local_path].load_token); if (!load_token.is_valid()) { // The token is dying (reached 0 on another thread). // Ensure it's killed now so the path can be safely reused right away. thread_load_tasks[local_path].load_token->clear(); - } else { - if (p_cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) { - return load_token; - } } + return load_token; } load_token.instantiate(); @@ -509,19 +507,19 @@ Ref<ResourceLoader::LoadToken> ResourceLoader::_load_start(const String &p_path, } } - // If we want to ignore cache, but there's another task loading it, we can't add this one to the map and we also have to finish unconditionally synchronously. - must_not_register = thread_load_tasks.has(local_path) && p_cache_mode == ResourceFormatLoader::CACHE_MODE_IGNORE; - if (must_not_register) { + // Cache-ignoring tasks aren't registered in the map and so must finish within scope. + if (ignoring_cache) { load_token->local_path.clear(); unregistered_load_task = load_task; + load_task_ptr = &unregistered_load_task; } else { - thread_load_tasks[local_path] = load_task; + DEV_ASSERT(!thread_load_tasks.has(local_path)); + HashMap<String, ResourceLoader::ThreadLoadTask>::Iterator E = thread_load_tasks.insert(local_path, load_task); + load_task_ptr = &E->value; } - - load_task_ptr = must_not_register ? &unregistered_load_task : &thread_load_tasks[local_path]; } - run_on_current_thread = must_not_register || p_thread_mode == LOAD_THREAD_FROM_CURRENT; + run_on_current_thread = ignoring_cache || p_thread_mode == LOAD_THREAD_FROM_CURRENT; if (run_on_current_thread) { load_task_ptr->thread_id = Thread::get_caller_id(); @@ -532,7 +530,7 @@ Ref<ResourceLoader::LoadToken> ResourceLoader::_load_start(const String &p_path, if (run_on_current_thread) { _thread_load_function(load_task_ptr); - if (must_not_register) { + if (ignoring_cache) { load_token->res_if_unregistered = load_task_ptr->resource; } } diff --git a/doc/classes/ResourceImporterWAV.xml b/doc/classes/ResourceImporterWAV.xml index d3dafb03b6..8f118ace03 100644 --- a/doc/classes/ResourceImporterWAV.xml +++ b/doc/classes/ResourceImporterWAV.xml @@ -17,10 +17,10 @@ [b]QOA ([url=https://qoaformat.org/]Quite OK Audio[/url]):[/b] Performs lossy compression on import. CPU cost is slightly higher than IMA-ADPCM, but quality is much higher. </member> <member name="edit/loop_begin" type="int" setter="" getter="" default="0"> - The begin loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b] or [b]Backward[/b]. This is set in seconds after the beginning of the audio file. + The begin loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b], or [b]Backward[/b]. This is set in samples after the beginning of the audio file. </member> <member name="edit/loop_end" type="int" setter="" getter="" default="-1"> - The end loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b] or [b]Backward[/b]. This is set in seconds after the beginning of the audio file. A value of [code]-1[/code] uses the end of the audio file as the end loop point. + The end loop point to use when [member edit/loop_mode] is [b]Forward[/b], [b]Ping-Pong[/b], or [b]Backward[/b]. This is set in samples after the beginning of the audio file. A value of [code]-1[/code] uses the end of the audio file as the end loop point. </member> <member name="edit/loop_mode" type="int" setter="" getter="" default="0"> Controls how audio should loop. This is automatically read from the WAV metadata on import. diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 46fe2225d0..a895219e6f 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -31,6 +31,7 @@ #include "editor_resource_picker.h" #include "editor/audio_stream_preview.h" +#include "editor/editor_help.h" #include "editor/editor_node.h" #include "editor/editor_quick_open.h" #include "editor/editor_resource_preview.h" @@ -504,6 +505,11 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) { int id = TYPE_BASE_ID + idx; edit_menu->add_icon_item(icon, vformat(TTR("New %s"), t), id); + HashMap<String, DocData::ClassDoc>::Iterator class_doc = EditorHelp::get_doc_data()->class_list.find(t); + if (class_doc) { + edit_menu->set_item_tooltip(-1, DTR(class_doc->value.brief_description)); + } + idx++; } diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index eea2511cc5..a3e62c298f 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -589,7 +589,6 @@ void SceneTreeEditor::_node_removed(Node *p_node) { if (p_node == selected) { selected = nullptr; - emit_signal(SNAME("node_selected")); } } diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 566b460bca..7f60fbbdb9 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -4495,6 +4495,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec scene_tree->set_v_size_flags(SIZE_EXPAND | SIZE_FILL); scene_tree->connect("rmb_pressed", callable_mp(this, &SceneTreeDock::_tree_rmb)); + scene_tree->connect("node_selected", callable_mp(this, &SceneTreeDock::_node_selected), CONNECT_DEFERRED); scene_tree->connect("node_renamed", callable_mp(this, &SceneTreeDock::_node_renamed), CONNECT_DEFERRED); scene_tree->connect("node_prerename", callable_mp(this, &SceneTreeDock::_node_prerenamed)); scene_tree->connect("open", callable_mp(this, &SceneTreeDock::_load_request)); diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp index 86a184903c..9f0865d950 100644 --- a/editor/themes/editor_theme_manager.cpp +++ b/editor/themes/editor_theme_manager.cpp @@ -1817,9 +1817,13 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme main_screen_button_hover->set_content_margin((Side)i, p_config.button_style_hover->get_content_margin((Side)i)); } p_theme->set_stylebox(CoreStringName(normal), "MainScreenButton", menu_transparent_style); + p_theme->set_stylebox("normal_mirrored", "MainScreenButton", menu_transparent_style); p_theme->set_stylebox(SceneStringName(pressed), "MainScreenButton", menu_transparent_style); + p_theme->set_stylebox("pressed_mirrored", "MainScreenButton", menu_transparent_style); p_theme->set_stylebox("hover", "MainScreenButton", main_screen_button_hover); + p_theme->set_stylebox("hover_mirrored", "MainScreenButton", main_screen_button_hover); p_theme->set_stylebox("hover_pressed", "MainScreenButton", main_screen_button_hover); + p_theme->set_stylebox("hover_pressed_mirrored", "MainScreenButton", main_screen_button_hover); p_theme->set_type_variation("MainMenuBar", "FlatMenuButton"); p_theme->set_stylebox(CoreStringName(normal), "MainMenuBar", menu_transparent_style); diff --git a/platform/windows/windows_utils.cpp b/platform/windows/windows_utils.cpp index 9b53252b07..9e0b9eed8a 100644 --- a/platform/windows/windows_utils.cpp +++ b/platform/windows/windows_utils.cpp @@ -220,7 +220,7 @@ Error WindowsUtils::copy_and_rename_pdb(const String &p_dll_path) { int original_path_size = pdb_info.path.utf8().length(); // Double-check file bounds. - ERR_FAIL_INDEX_V_MSG(pdb_info.address + original_path_size, file->get_length(), FAILED, vformat("Failed to write a new PDB path. Probably '%s' has been changed.", p_dll_path)); + ERR_FAIL_UNSIGNED_INDEX_V_MSG(pdb_info.address + original_path_size, file->get_length(), FAILED, vformat("Failed to write a new PDB path. Probably '%s' has been changed.", p_dll_path)); Vector<uint8_t> u8 = new_pdb_name.to_utf8_buffer(); file->seek(pdb_info.address); diff --git a/servers/xr/xr_vrs.cpp b/servers/xr/xr_vrs.cpp index 9d1e2f2068..3e283a42f0 100644 --- a/servers/xr/xr_vrs.cpp +++ b/servers/xr/xr_vrs.cpp @@ -94,7 +94,14 @@ RID XRVRS::make_vrs_texture(const Size2 &p_target_size, const PackedVector2Array int32_t texel_width = RD::get_singleton()->limit_get(RD::LIMIT_VRS_TEXEL_WIDTH); int32_t texel_height = RD::get_singleton()->limit_get(RD::LIMIT_VRS_TEXEL_HEIGHT); + // Should return sensible data or graphics API does not support VRS. + ERR_FAIL_COND_V(texel_width < 1 || texel_height < 1, RID()); + Size2 vrs_size = Size2(0.5 + p_target_size.x / texel_width, 0.5 + p_target_size.y / texel_height).round(); + + // Make sure we have at least one pixel. + vrs_size = vrs_size.maxf(1.0); + float max_radius = 0.5 * MIN(vrs_size.x, vrs_size.y); // Maximum radius that fits inside of our image float min_radius = vrs_min_radius * max_radius / 100.0; // Minimum radius as a percentage of our size real_t outer_radius = MAX(1.0, (max_radius - min_radius) / vrs_strength); |