summaryrefslogtreecommitdiffstats
path: root/core/os/os.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-07-19 17:00:46 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-07-19 17:06:03 -0300
commit25678b1876816b9ccb14b2c92aef62f3b009f88f (patch)
tree189f082d788f78e16f620b056d21249118883fc5 /core/os/os.cpp
parent89588d43349e496a9e05756d42ae87323d31269e (diff)
downloadredot-engine-25678b1876816b9ccb14b2c92aef62f3b009f88f.tar.gz
-Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
Diffstat (limited to 'core/os/os.cpp')
-rw-r--r--core/os/os.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 48463722cf..5a9766891d 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -30,9 +30,9 @@
#include "os.h"
#include "dir_access.h"
-#include "global_config.h"
#include "input.h"
#include "os/file_access.h"
+#include "project_settings.h"
#include <stdarg.h>
@@ -260,7 +260,7 @@ String OS::get_locale() const {
String OS::get_resource_dir() const {
- return GlobalConfig::get_singleton()->get_resource_path();
+ return ProjectSettings::get_singleton()->get_resource_path();
}
String OS::get_system_dir(SystemDir p_dir) const {
@@ -269,7 +269,7 @@ String OS::get_system_dir(SystemDir p_dir) const {
}
String OS::get_safe_application_name() const {
- String an = GlobalConfig::get_singleton()->get("application/config/name");
+ String an = ProjectSettings::get_singleton()->get("application/config/name");
Vector<String> invalid_char = String("\\ / : * ? \" < > |").split(" ");
for (int i = 0; i < invalid_char.size(); i++) {
an = an.replace(invalid_char[i], "-");
@@ -494,6 +494,24 @@ int OS::get_power_percent_left() {
return -1;
}
+bool OS::check_feature_support(const String &p_feature) {
+
+ if (p_feature == get_name())
+ return true;
+#ifdef DEBUG_ENABLED
+ if (p_feature == "debug")
+ return true;
+#else
+ if (p_feature == "release")
+ return true;
+#endif
+
+ if (_check_internal_feature_support(p_feature))
+ return true;
+
+ return false;
+}
+
OS::OS() {
last_error = NULL;
singleton = this;