summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-11-14 20:44:55 +0100
committerGitHub <noreply@github.com>2017-11-14 20:44:55 +0100
commit61a693cf782c952dc151d8d77b1ab365888e6701 (patch)
treef6e629e3b1a4546105edcd0ea9a5bb130b9198f0 /platform
parent04edfc090b0e78f4f820977da8cb4eb2d015c5f7 (diff)
parentacb23adad37b459e64b8f9bafbbdd1185d46093d (diff)
Merge pull request #12922 from eska014/engine-singletons
Singleton management changes
Diffstat (limited to 'platform')
-rw-r--r--platform/android/godot_android.cpp3
-rw-r--r--platform/android/java_glue.cpp5
-rw-r--r--platform/android/os_android.cpp2
-rw-r--r--platform/iphone/os_iphone.cpp10
-rw-r--r--platform/javascript/os_javascript.cpp5
5 files changed, 13 insertions, 12 deletions
diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp
index abe5e3b77a..9d056bca7c 100644
--- a/platform/android/godot_android.cpp
+++ b/platform/android/godot_android.cpp
@@ -35,6 +35,7 @@
#include <EGL/egl.h>
#include <GLES2/gl2.h>
+#include "engine.h"
#include "file_access_android.h"
#include "main/main.h"
#include "os_android.h"
@@ -842,7 +843,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerSingleton(JNIEnv
s->set_instance(env->NewGlobalRef(p_object));
jni_singletons[singname] = s;
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton(singname, s));
+ Engine::get_singleton()->add_singleton(Engine::Singleton(singname, s));
}
static Variant::Type get_jni_type(const String &p_type) {
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 87f20bee91..90144d9b4d 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -34,6 +34,7 @@
#include "audio_driver_jandroid.h"
#include "core/os/keyboard.h"
#include "dir_access_jandroid.h"
+#include "engine.h"
#include "file_access_android.h"
#include "file_access_jandroid.h"
#include "java_class_wrapper.h"
@@ -953,7 +954,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jo
__android_log_print(ANDROID_LOG_INFO, "godot", "*****SETUP OK");
java_class_wrapper = memnew(JavaClassWrapper(_godot_instance));
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaClassWrapper", java_class_wrapper));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("JavaClassWrapper", java_class_wrapper));
_initialize_java_modules();
}
@@ -1426,7 +1427,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv *env
s->set_instance(env->NewGlobalRef(p_object));
jni_singletons[singname] = s;
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton(singname, s));
+ Engine::get_singleton()->add_singleton(Engine::Singleton(singname, s));
ProjectSettings::get_singleton()->set(singname, s);
}
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index a36df0675c..2578bd6d96 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -641,7 +641,7 @@ String OS_Android::get_data_dir() const {
}
return ".";
- //return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
+ //return Engine::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
}
void OS_Android::set_screen_orientation(ScreenOrientation p_orientation) {
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index 0685e961c3..d0865a35b9 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -138,28 +138,28 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_
/*
#ifdef IOS_SCORELOOP_ENABLED
scoreloop = memnew(ScoreloopIOS);
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Scoreloop", scoreloop));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("Scoreloop", scoreloop));
scoreloop->connect();
#endif
*/
#ifdef GAME_CENTER_ENABLED
game_center = memnew(GameCenter);
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("GameCenter", game_center));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("GameCenter", game_center));
game_center->connect();
#endif
#ifdef STOREKIT_ENABLED
store_kit = memnew(InAppStore);
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("InAppStore", store_kit));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("InAppStore", store_kit));
#endif
#ifdef ICLOUD_ENABLED
icloud = memnew(ICloud);
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ICloud", icloud));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("ICloud", icloud));
//icloud->connect();
#endif
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("iOS", memnew(iOS)));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("iOS", memnew(iOS)));
};
MainLoop *OSIPhone::get_main_loop() const {
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index 389d5d206e..77d81aec5d 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -29,8 +29,8 @@
/*************************************************************************/
#include "os_javascript.h"
+#include "core/engine.h"
#include "core/io/file_access_buffered_fa.h"
-#include "core/project_settings.h"
#include "dom_keys.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "drivers/unix/dir_access_unix.h"
@@ -514,7 +514,7 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i
#ifdef JAVASCRIPT_EVAL_ENABLED
javascript_eval = memnew(JavaScript);
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaScript", javascript_eval));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("JavaScript", javascript_eval));
#endif
visual_server->init();
@@ -896,7 +896,6 @@ String OS_JavaScript::get_data_dir() const {
return get_data_dir_func();
*/
return "/userfs";
- //return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
};
String OS_JavaScript::get_executable_path() const {