diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/io/logger.cpp | 5 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 3 | ||||
-rw-r--r-- | core/io/resource_loader.cpp | 2 | ||||
-rw-r--r-- | core/os/os.cpp | 2 | ||||
-rw-r--r-- | core/project_settings.cpp | 16 | ||||
-rw-r--r-- | core/project_settings.h | 5 | ||||
-rw-r--r-- | core/string_db.h | 3 | ||||
-rw-r--r-- | core/translation.cpp | 2 |
8 files changed, 29 insertions, 9 deletions
diff --git a/core/io/logger.cpp b/core/io/logger.cpp index 7ea5f06d7e..b94007d316 100644 --- a/core/io/logger.cpp +++ b/core/io/logger.cpp @@ -177,11 +177,14 @@ void RotatedFileLogger::logv(const char *p_format, va_list p_list, bool p_err) { const int static_buf_size = 512; char static_buf[static_buf_size]; char *buf = static_buf; + va_list list_copy; + va_copy(list_copy, p_list); int len = vsnprintf(buf, static_buf_size, p_format, p_list); if (len >= static_buf_size) { buf = (char *)Memory::alloc_static(len + 1); - vsnprintf(buf, len + 1, p_format, p_list); + vsnprintf(buf, len + 1, p_format, list_copy); } + va_end(list_copy); file->store_buffer((uint8_t *)buf, len); if (len >= static_buf_size) { Memory::free_static(buf); diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 0834d6c321..d388a622de 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -1140,8 +1140,9 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo if (buf) { encode_uint32(0, buf); buf += 4; - r_len += 4; } + r_len += 4; + } else { _encode_string(obj->get_class(), buf, r_len); diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 89cb4a22c2..ed0d491679 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -492,7 +492,7 @@ void ResourceLoader::reload_translation_remaps() { void ResourceLoader::load_translation_remaps() { - if (!ProjectSettings::get_singleton()->has("locale/translation_remaps")) + if (!ProjectSettings::get_singleton()->has_setting("locale/translation_remaps")) return; Dictionary remaps = ProjectSettings::get_singleton()->get("locale/translation_remaps"); diff --git a/core/os/os.cpp b/core/os/os.cpp index 4accd65bab..eb5d5be33d 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -541,7 +541,7 @@ OS::OS() { _render_thread_mode = RENDER_THREAD_SAFE; - _allow_hidpi = true; + _allow_hidpi = false; _stack_bottom = (void *)(&stack_bottom); _logger = NULL; diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 3e27597e74..ff2be87b07 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -420,7 +420,7 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack) { return OK; } -bool ProjectSettings::has(String p_var) const { +bool ProjectSettings::has_setting(String p_var) const { _THREAD_SAFE_METHOD_ @@ -800,7 +800,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default) { Variant ret; - if (ProjectSettings::get_singleton()->has(p_var)) { + if (ProjectSettings::get_singleton()->has_setting(p_var)) { ret = ProjectSettings::get_singleton()->get(p_var); } else { ProjectSettings::get_singleton()->set(p_var, p_default); @@ -907,9 +907,19 @@ Variant ProjectSettings::property_get_revert(const String &p_name) { return props[p_name].initial; } +void ProjectSettings::set_setting(const String &p_setting, const Variant &p_value) { + set(p_setting, p_value); +} + +Variant ProjectSettings::get_setting(const String &p_setting) const { + return get(p_setting); +} + void ProjectSettings::_bind_methods() { - ClassDB::bind_method(D_METHOD("has", "name"), &ProjectSettings::has); + ClassDB::bind_method(D_METHOD("has_setting", "name"), &ProjectSettings::has_setting); + ClassDB::bind_method(D_METHOD("set_setting", "name", "value"), &ProjectSettings::set_setting); + ClassDB::bind_method(D_METHOD("get_setting", "name"), &ProjectSettings::get_setting); ClassDB::bind_method(D_METHOD("set_order", "name", "position"), &ProjectSettings::set_order); ClassDB::bind_method(D_METHOD("get_order", "name"), &ProjectSettings::get_order); ClassDB::bind_method(D_METHOD("set_initial_value", "name", "value"), &ProjectSettings::set_initial_value); diff --git a/core/project_settings.h b/core/project_settings.h index 718ab2a011..ea6034dc84 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -119,7 +119,10 @@ protected: static void _bind_methods(); public: - bool has(String p_var) const; + void set_setting(const String &p_setting, const Variant &p_value); + Variant get_setting(const String &p_setting) const; + + bool has_setting(String p_var) const; String localize_path(const String &p_path) const; String globalize_path(const String &p_path) const; diff --git a/core/string_db.h b/core/string_db.h index 2bef29fab8..de91e2abd8 100644 --- a/core/string_db.h +++ b/core/string_db.h @@ -113,6 +113,9 @@ public: else return 0; } + _FORCE_INLINE_ const void *data_unique_pointer() const { + return (void *)_data; + } bool operator!=(const StringName &p_name) const; _FORCE_INLINE_ operator String() const { diff --git a/core/translation.cpp b/core/translation.cpp index f1f9c72b85..27e3b202d0 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -1052,7 +1052,7 @@ TranslationServer *TranslationServer::singleton = NULL; bool TranslationServer::_load_translations(const String &p_from) { - if (ProjectSettings::get_singleton()->has(p_from)) { + if (ProjectSettings::get_singleton()->has_setting(p_from)) { PoolVector<String> translations = ProjectSettings::get_singleton()->get(p_from); int tcount = translations.size(); |