diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/gdnative/gdnative.cpp | 4 | ||||
-rw-r--r-- | modules/gdnative/nativescript/api_generator.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gd_script.cpp | 7 | ||||
-rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 6 | ||||
-rw-r--r-- | modules/mono/glue/glue_header.h | 2 | ||||
-rw-r--r-- | modules/mono/register_types.cpp | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_func_nodes.cpp | 16 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.cpp | 11 |
8 files changed, 28 insertions, 26 deletions
diff --git a/modules/gdnative/gdnative/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp index 0298f4c054..6dfa7ec20b 100644 --- a/modules/gdnative/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -30,10 +30,10 @@ #include "gdnative/gdnative.h" #include "class_db.h" +#include "engine.h" #include "error_macros.h" #include "global_constants.h" #include "os/os.h" -#include "project_settings.h" #include "variant.h" #ifdef __cplusplus @@ -47,7 +47,7 @@ void GDAPI godot_object_destroy(godot_object *p_o) { // Singleton API godot_object GDAPI *godot_global_get_singleton(char *p_name) { - return (godot_object *)ProjectSettings::get_singleton()->get_singleton_object(String(p_name)); + return (godot_object *)Engine::get_singleton()->get_singleton_object(String(p_name)); } // result shouldn't be freed void GDAPI *godot_get_stack_bottom() { diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index 63fb71feb6..f9d699fb59 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -32,9 +32,9 @@ #ifdef TOOLS_ENABLED #include "core/class_db.h" +#include "core/engine.h" #include "core/global_constants.h" #include "core/pair.h" -#include "core/project_settings.h" #include "os/file_access.h" // helper stuff @@ -177,7 +177,7 @@ List<ClassAPI> generate_c_api_classes() { if (name.begins_with("_")) { name.remove(0); } - class_api.is_singleton = ProjectSettings::get_singleton()->has_singleton(name); + class_api.is_singleton = Engine::get_singleton()->has_singleton(name); } class_api.is_instanciable = !class_api.is_singleton && ClassDB::can_instance(class_name); diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index e5016c59bd..ba0353ae4a 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "gd_script.h" +#include "engine.h" #include "gd_compiler.h" #include "global_constants.h" #include "io/file_access_encrypted.h" @@ -1347,9 +1348,9 @@ void GDScriptLanguage::init() { //populate singletons - List<ProjectSettings::Singleton> singletons; - ProjectSettings::get_singleton()->get_singletons(&singletons); - for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) { + List<Engine::Singleton> singletons; + Engine::get_singleton()->get_singletons(&singletons); + for (List<Engine::Singleton>::Element *E = singletons.front(); E; E = E->next()) { _add_global(E->get().name, E->get().ptr); } diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index eb504ec021..e6099c7cdf 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -31,12 +31,12 @@ #ifdef DEBUG_METHODS_ENABLED +#include "engine.h" #include "global_constants.h" #include "io/compression.h" #include "os/dir_access.h" #include "os/file_access.h" #include "os/os.h" -#include "project_settings.h" #include "ucaps.h" #include "../glue/cs_compressed.gen.h" @@ -1169,7 +1169,7 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { output.push_back("Object* "); output.push_back(singleton_icall_name); - output.push_back("() " OPEN_BLOCK "\treturn ProjectSettings::get_singleton()->get_singleton_object(\""); + output.push_back("() " OPEN_BLOCK "\treturn Engine::get_singleton()->get_singleton_object(\""); output.push_back(itype.proxy_name); output.push_back("\");\n" CLOSE_BLOCK "\n"); } @@ -1505,7 +1505,7 @@ void BindingsGenerator::_populate_object_type_interfaces() { TypeInterface itype = TypeInterface::create_object_type(type_cname, api_type); itype.base_name = ClassDB::get_parent_class(type_cname); - itype.is_singleton = ProjectSettings::get_singleton()->has_singleton(itype.proxy_name); + itype.is_singleton = Engine::get_singleton()->has_singleton(itype.proxy_name); itype.is_instantiable = ClassDB::can_instance(type_cname) && !itype.is_singleton; itype.is_reference = ClassDB::is_parent_class(type_cname, refclass_name); itype.memory_own = itype.is_reference; diff --git a/modules/mono/glue/glue_header.h b/modules/mono/glue/glue_header.h index 0751a0160f..75a4eb2b40 100644 --- a/modules/mono/glue/glue_header.h +++ b/modules/mono/glue/glue_header.h @@ -35,10 +35,10 @@ #include "bind/core_bind.h" #include "class_db.h" +#include "engine.h" #include "io/marshalls.h" #include "object.h" #include "os/os.h" -#include "project_settings.h" #include "reference.h" #include "variant_parser.h" diff --git a/modules/mono/register_types.cpp b/modules/mono/register_types.cpp index 2656de5b14..217460a439 100644 --- a/modules/mono/register_types.cpp +++ b/modules/mono/register_types.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "register_types.h" -#include "project_settings.h" +#include "engine.h" #include "csharp_script.h" @@ -45,7 +45,7 @@ void register_mono_types() { _godotsharp = memnew(_GodotSharp); ClassDB::register_class<_GodotSharp>(); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("GodotSharp", _GodotSharp::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("GodotSharp", _GodotSharp::get_singleton())); script_language_cs = memnew(CSharpLanguage); script_language_cs->set_language_index(ScriptServer::get_language_count()); diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index a5dc6ffc13..cbe4438cdf 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -29,9 +29,9 @@ /*************************************************************************/ #include "visual_script_func_nodes.h" +#include "engine.h" #include "io/resource_loader.h" #include "os/os.h" -#include "project_settings.h" #include "scene/main/node.h" #include "scene/main/scene_tree.h" #include "visual_script_nodes.h" @@ -344,7 +344,7 @@ void VisualScriptFunctionCall::set_singleton(const StringName &p_type) { return; singleton = p_type; - Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *obj = Engine::get_singleton()->get_singleton_object(singleton); if (obj) { base_type = obj->get_class(); } @@ -380,7 +380,7 @@ void VisualScriptFunctionCall::_update_method_cache() { } else if (call_mode == CALL_MODE_SINGLETON) { - Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *obj = Engine::get_singleton()->get_singleton_object(singleton); if (obj) { type = obj->get_class(); script = obj->get_script(); @@ -565,11 +565,11 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const if (call_mode != CALL_MODE_SINGLETON) { property.usage = 0; } else { - List<ProjectSettings::Singleton> names; - ProjectSettings::get_singleton()->get_singletons(&names); + List<Engine::Singleton> names; + Engine::get_singleton()->get_singletons(&names); property.hint = PROPERTY_HINT_ENUM; String sl; - for (List<ProjectSettings::Singleton>::Element *E = names.front(); E; E = E->next()) { + for (List<Engine::Singleton>::Element *E = names.front(); E; E = E->next()) { if (sl != String()) sl += ","; sl += E->get().name; @@ -603,7 +603,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const property.hint_string = itos(get_visual_script()->get_instance_id()); } else if (call_mode == CALL_MODE_SINGLETON) { - Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *obj = Engine::get_singleton()->get_singleton_object(singleton); if (obj) { property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE; property.hint_string = itos(obj->get_instance_id()); @@ -879,7 +879,7 @@ public: } break; case VisualScriptFunctionCall::CALL_MODE_SINGLETON: { - Object *object = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *object = Engine::get_singleton()->get_singleton_object(singleton); if (!object) { r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid singleton name: '" + String(singleton) + "'"; diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 3863fa7e1c..05ff629d1b 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "visual_script_nodes.h" +#include "engine.h" #include "global_constants.h" #include "os/input.h" #include "os/os.h" @@ -1976,13 +1977,13 @@ public: VisualScriptNodeInstance *VisualScriptEngineSingleton::instance(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceEngineSingleton *instance = memnew(VisualScriptNodeInstanceEngineSingleton); - instance->singleton = ProjectSettings::get_singleton()->get_singleton_object(singleton); + instance->singleton = Engine::get_singleton()->get_singleton_object(singleton); return instance; } VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output_type(TypeGuess *p_inputs, int p_output) const { - Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *obj = Engine::get_singleton()->get_singleton_object(singleton); TypeGuess tg; tg.type = Variant::OBJECT; if (obj) { @@ -2000,11 +2001,11 @@ void VisualScriptEngineSingleton::_bind_methods() { String cc; - List<ProjectSettings::Singleton> singletons; + List<Engine::Singleton> singletons; - ProjectSettings::get_singleton()->get_singletons(&singletons); + Engine::get_singleton()->get_singletons(&singletons); - for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) { + for (List<Engine::Singleton>::Element *E = singletons.front(); E; E = E->next()) { if (E->get().name == "VS" || E->get().name == "PS" || E->get().name == "PS2D" || E->get().name == "AS" || E->get().name == "TS" || E->get().name == "SS" || E->get().name == "SS2D") continue; //skip these, too simple named |