diff --git a/core/core_string_names.h b/core/core_string_names.h index abe751372e81..71c1521101ea 100644 --- a/core/core_string_names.h +++ b/core/core_string_names.h @@ -34,10 +34,10 @@ #include "core/string/string_name.h" class CoreStringNames { - friend void register_core_types(); - friend void unregister_core_types(); - + friend void register_core(); static void create() { singleton = memnew(CoreStringNames); } + + friend void unregister_core(); static void free() { memdelete(singleton); singleton = nullptr; diff --git a/core/object/object.h b/core/object/object.h index 448a33d3bca0..0984a5799363 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -754,13 +754,13 @@ class ObjectDB { static uint64_t validator_counter; friend class Object; - friend void unregister_core_types(); + friend void unregister_core(); static void cleanup(); static ObjectID add_instance(Object *p_object); static void remove_instance(Object *p_object); - friend void register_core_types(); + friend void register_core(); static void setup(); public: diff --git a/core/os/os.cpp b/core/os/os.cpp index ca1b798e11c9..35c6390e1475 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -364,7 +364,7 @@ String OS::get_model_name() const { return "GenericDevice"; } -void OS::set_cmdline(const char *p_execpath, const List &p_args) { +void OS::set_cmdline(const String p_execpath, const List &p_args) { _execpath = p_execpath; _cmdline = p_args; } diff --git a/core/os/os.h b/core/os/os.h index 719860723791..d54a75649768 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -103,7 +103,7 @@ class OS { virtual void finalize() = 0; virtual void finalize_core() = 0; - virtual void set_cmdline(const char *p_execpath, const List &p_args); + virtual void set_cmdline(const String p_execpath, const List &p_args); virtual bool _check_internal_feature_support(const String &p_feature) = 0; diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index f1b1b98beac3..10dd85fb3835 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -70,6 +70,7 @@ #include "core/os/main_loop.h" #include "core/string/optimized_translation.h" #include "core/string/translation.h" +#include
static Ref resource_saver_binary; static Ref resource_loader_binary; @@ -98,14 +99,13 @@ extern Mutex _global_mutex; extern void register_global_constants(); extern void unregister_global_constants(); -void register_core_types() { +void register_core() { //consistency check static_assert(sizeof(Callable) <= 16); ObjectDB::setup(); StringName::setup(); - ResourceLoader::initialize(); register_global_constants(); @@ -113,11 +113,14 @@ void register_core_types() { CoreStringNames::create(); + ResourceLoader::initialize(); + resource_format_po.instance(); ResourceLoader::add_resource_format_loader(resource_format_po); resource_saver_binary.instance(); ResourceSaver::add_resource_format_saver(resource_saver_binary); + resource_loader_binary.instance(); ResourceLoader::add_resource_format_loader(resource_loader_binary); @@ -127,6 +130,16 @@ void register_core_types() { resource_format_image.instance(); ResourceLoader::add_resource_format_loader(resource_format_image); + resource_format_loader_crypto.instance(); + ResourceLoader::add_resource_format_loader(resource_format_loader_crypto); + + resource_format_saver_crypto.instance(); + ResourceSaver::add_resource_format_saver(resource_format_saver_crypto); + + ip = IP::create(); +} + +void register_core_types() { ClassDB::register_class(); ClassDB::register_virtual_class