From f6d9ca069fdfbb15632ed11d41241b47e00c0cec Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 6 Apr 2024 13:46:57 +0200 Subject: [PATCH] Fix build. --- core/string/translation.cpp | 32 ++++++++------------ core/string/translation.h | 14 ++++----- editor/editor_locale_dialog.cpp | 11 ++----- editor/editor_locale_dialog.h | 2 +- editor/editor_node.cpp | 4 +-- editor/editor_properties.cpp | 2 +- scene/3d/lod.cpp | 7 +++-- scene/resources/world_3d.cpp | 6 ++-- servers/rendering/rendering_server_scene.cpp | 5 --- 9 files changed, 32 insertions(+), 51 deletions(-) diff --git a/core/string/translation.cpp b/core/string/translation.cpp index c2c767505..191789b38 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -174,22 +174,14 @@ StringName ContextTranslation::get_context_message(const StringName &p_src_text, /////////////////////////////////////////////// -static _FORCE_INLINE_ bool is_ascii_upper_case(char32_t c) { - return (c >= 'A' && c <= 'Z'); -} - -static _FORCE_INLINE_ bool is_ascii_lower_case(char32_t c) { - return (c >= 'a' && c <= 'z'); -} - Vector TranslationServer::locale_script_info; -Map TranslationServer::language_map; -Map TranslationServer::script_map; -Map TranslationServer::locale_rename_map; -Map TranslationServer::country_name_map; -Map TranslationServer::variant_map; -Map TranslationServer::country_rename_map; +RBMap TranslationServer::language_map; +RBMap TranslationServer::script_map; +RBMap TranslationServer::locale_rename_map; +RBMap TranslationServer::country_name_map; +RBMap TranslationServer::variant_map; +RBMap TranslationServer::country_rename_map; void TranslationServer::init_locale_info() { // Init locale info. @@ -421,7 +413,7 @@ String TranslationServer::get_locale_name(const String &p_locale) const { Vector TranslationServer::get_all_languages() const { Vector languages; - for (Map::Element *E = language_map.front(); E; E = E->next()) { + for (RBMap::Element *E = language_map.front(); E; E = E->next()) { languages.push_back(E->key()); } @@ -435,7 +427,7 @@ String TranslationServer::get_language_name(const String &p_language) const { Vector TranslationServer::get_all_scripts() const { Vector scripts; - for (Map::Element *E = script_map.front(); E; E = E->next()) { + for (RBMap::Element *E = script_map.front(); E; E = E->next()) { scripts.push_back(E->key()); } @@ -449,7 +441,7 @@ String TranslationServer::get_script_name(const String &p_script) const { Vector TranslationServer::get_all_countries() const { Vector countries; - for (Map::Element *E = country_name_map.front(); E; E = E->next()) { + for (RBMap::Element *E = country_name_map.front(); E; E = E->next()) { countries.push_back(E->key()); } @@ -476,7 +468,7 @@ String TranslationServer::get_locale() const { Array TranslationServer::get_loaded_locales() const { Array locales; - for (Set>::Element *E = translations.front(); E; E = E->next()) { + for (RBSet>::Element *E = translations.front(); E; E = E->next()) { const Ref &t = E->get(); ERR_FAIL_COND_V(t.is_null(), Array()); String l = t->get_locale(); @@ -574,7 +566,7 @@ StringName TranslationServer::translate_to(const StringName &p_message, const St // same language code). StringName res; - String lang = get_language_code(p_locale); + String lang = standardize_locale(p_locale); bool near_match = false; for (const RBSet>::Element *E = translations.front(); E; E = E->next()) { @@ -587,7 +579,7 @@ StringName TranslationServer::translate_to(const StringName &p_message, const St if (near_match) { continue; // Only near-match once, but keep looking for exact matches. } - if (get_language_code(l) != lang) { + if (standardize_locale(l) != lang) { continue; // Language code does not match. } } diff --git a/core/string/translation.h b/core/string/translation.h index b0b5adc2e..650bdcaf6 100644 --- a/core/string/translation.h +++ b/core/string/translation.h @@ -99,16 +99,16 @@ class TranslationServer : public Object { String name; String script; String default_country; - Set supported_countries; + RBSet supported_countries; }; static Vector locale_script_info; - static Map language_map; - static Map script_map; - static Map locale_rename_map; - static Map country_name_map; - static Map country_rename_map; - static Map variant_map; + static RBMap language_map; + static RBMap script_map; + static RBMap locale_rename_map; + static RBMap country_name_map; + static RBMap country_rename_map; + static RBMap variant_map; void init_locale_info(); diff --git a/editor/editor_locale_dialog.cpp b/editor/editor_locale_dialog.cpp index c63502042..6badde05a 100644 --- a/editor/editor_locale_dialog.cpp +++ b/editor/editor_locale_dialog.cpp @@ -30,21 +30,14 @@ #include "editor_locale_dialog.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "scene/gui/check_button.h" #include "scene/gui/line_edit.h" #include "scene/gui/option_button.h" #include "scene/gui/tree.h" - -static _FORCE_INLINE_ bool is_ascii_upper_case(char32_t c) { - return (c >= 'A' && c <= 'Z'); -} - -static _FORCE_INLINE_ bool is_ascii_lower_case(char32_t c) { - return (c >= 'a' && c <= 'z'); -} +#include "scene/gui/label.h" void EditorLocaleDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("_filter_mode_changed"), &EditorLocaleDialog::_filter_mode_changed); diff --git a/editor/editor_locale_dialog.h b/editor/editor_locale_dialog.h index 85fb0e184..bb99f18e9 100644 --- a/editor/editor_locale_dialog.h +++ b/editor/editor_locale_dialog.h @@ -31,7 +31,7 @@ #ifndef EDITOR_LOCALE_DIALOG_H #define EDITOR_LOCALE_DIALOG_H -#include "core/translation.h" +#include "core/string/translation.h" #include "scene/gui/dialogs.h" class Button; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index a7e86ee8e..6dca762e2 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1438,12 +1438,12 @@ void EditorNode::_find_node_types(Node *p_node, int &count_2d, int &count_3d) { void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { EditorProgress save("save", TTR("Saving Scene"), 4); - Ref edited_world; + Ref edited_world; if (editor_data.get_edited_scene_root() != nullptr) { // Allow a generic mechanism for the engine to make changes prior, and after saving. if (editor_data.get_edited_scene_root()->get_tree() && editor_data.get_edited_scene_root()->get_tree()->get_root()) { - edited_world = editor_data.get_edited_scene_root()->get_tree()->get_root()->get_world(); + edited_world = editor_data.get_edited_scene_root()->get_tree()->get_root()->get_world_3d(); if (edited_world.is_valid()) { edited_world->notify_saving(true); } diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 8d2b4a2bc..05c3cfe1b 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -419,7 +419,7 @@ void EditorPropertyLocale::setup(const String &p_hint_text) { void EditorPropertyLocale::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - locale_edit->set_icon(get_icon("Translation", "EditorIcons")); + locale_edit->set_icon(get_theme_icon("Translation", "EditorIcons")); } } diff --git a/scene/3d/lod.cpp b/scene/3d/lod.cpp index 09c2e8849..41f9667e9 100644 --- a/scene/3d/lod.cpp +++ b/scene/3d/lod.cpp @@ -32,10 +32,11 @@ #include "core/config/engine.h" #include "scene/3d/visual_instance.h" +#include "scene/resources/world_3d.h" void LOD::_lod_register() { if (!data.registered) { - Ref world = get_world(); + Ref world = get_world_3d(); ERR_FAIL_COND(!world.is_valid()); world->_register_lod(this, data.queue_id); data.registered = true; @@ -44,7 +45,7 @@ void LOD::_lod_register() { void LOD::_lod_unregister() { if (data.registered) { - Ref world = get_world(); + Ref world = get_world_3d(); ERR_FAIL_COND(!world.is_valid()); world->_unregister_lod(this, data.queue_id); data.registered = false; @@ -104,7 +105,7 @@ void LOD::set_lod_priority(int p_priority) { if (is_inside_tree()) { // If already in the world, we must remove the LOD // and re-add in a different queue. - Ref world = get_world(); + Ref world = get_world_3d(); ERR_FAIL_COND(!world.is_valid()); world->_unregister_lod(this, data.queue_id); diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp index 14153b20c..4238472e3 100644 --- a/scene/resources/world_3d.cpp +++ b/scene/resources/world_3d.cpp @@ -241,13 +241,13 @@ void World3D::_remove_camera(Camera *p_camera) { #endif } -void World::_register_lod(LOD *p_lod, uint32_t p_queue_id) { +void World3D::_register_lod(LOD *p_lod, uint32_t p_queue_id) { #ifndef _3D_DISABLED lod_manager->register_lod(p_lod, p_queue_id); #endif } -void World::_unregister_lod(LOD *p_lod, uint32_t p_queue_id) { +void World3D::_unregister_lod(LOD *p_lod, uint32_t p_queue_id) { #ifndef _3D_DISABLED lod_manager->unregister_lod(p_lod, p_queue_id); #endif @@ -355,7 +355,7 @@ void World3D::move_cameras_into(Ref target) { } } -void World::notify_saving(bool p_active) { +void World3D::notify_saving(bool p_active) { #ifndef _3D_DISABLED if (lod_manager) { lod_manager->notify_saving(p_active); diff --git a/servers/rendering/rendering_server_scene.cpp b/servers/rendering/rendering_server_scene.cpp index dabe1a444..e3222388e 100644 --- a/servers/rendering/rendering_server_scene.cpp +++ b/servers/rendering/rendering_server_scene.cpp @@ -1784,11 +1784,6 @@ void RenderingServerScene::instance_geometry_set_material_overlay(RID p_instance } } -void RenderingServerScene::instance_geometry_set_draw_range(RID p_instance, float p_min, float p_max, float p_min_margin, float p_max_margin) { -} -void RenderingServerScene::instance_geometry_set_as_instance_lod(RID p_instance, RID p_as_lod_of_instance) { -} - void RenderingServerScene::_update_instance(Instance *p_instance) { p_instance->version++;