summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
Diffstat (limited to 'core/os')
-rw-r--r--core/os/dir_access.cpp8
-rw-r--r--core/os/file_access.cpp6
-rw-r--r--core/os/input.cpp4
-rw-r--r--core/os/input_event.cpp2
-rw-r--r--core/os/os.cpp24
-rw-r--r--core/os/os.h3
6 files changed, 33 insertions, 14 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index aa03b764ef..484942bad5 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "dir_access.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/file_access.h"
#include "os/memory.h"
#include "os/os.h"
@@ -37,7 +37,7 @@ String DirAccess::_get_root_path() const {
switch (_access_type) {
- case ACCESS_RESOURCES: return GlobalConfig::get_singleton()->get_resource_path();
+ case ACCESS_RESOURCES: return ProjectSettings::get_singleton()->get_resource_path();
case ACCESS_USERDATA: return OS::get_singleton()->get_data_dir();
default: return "";
}
@@ -200,10 +200,10 @@ String DirAccess::fix_path(String p_path) const {
case ACCESS_RESOURCES: {
- if (GlobalConfig::get_singleton()) {
+ if (ProjectSettings::get_singleton()) {
if (p_path.begins_with("res://")) {
- String resource_path = GlobalConfig::get_singleton()->get_resource_path();
+ String resource_path = ProjectSettings::get_singleton()->get_resource_path();
if (resource_path != "") {
return p_path.replace_first("res:/", resource_path);
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index 805b66b983..2bb676381f 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -31,7 +31,7 @@
#include "core/io/file_access_pack.h"
#include "core/io/marshalls.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/os.h"
#include "thirdparty/misc/md5.h"
@@ -135,10 +135,10 @@ String FileAccess::fix_path(const String &p_path) const {
case ACCESS_RESOURCES: {
- if (GlobalConfig::get_singleton()) {
+ if (ProjectSettings::get_singleton()) {
if (r_path.begins_with("res://")) {
- String resource_path = GlobalConfig::get_singleton()->get_resource_path();
+ String resource_path = ProjectSettings::get_singleton()->get_resource_path();
if (resource_path != "") {
return r_path.replace("res:/", resource_path);
diff --git a/core/os/input.cpp b/core/os/input.cpp
index 587340fe91..18d644668c 100644
--- a/core/os/input.cpp
+++ b/core/os/input.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "input.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "input_map.h"
#include "os/os.h"
Input *Input::singleton = NULL;
@@ -101,7 +101,7 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
if (p_idx == 0 && (pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" || pf == "is_action_just_pressed" || pf == "is_action_just_released")) {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index 1c575aa970..0a07b6b2b7 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -103,7 +103,7 @@ bool InputEvent::is_action_type() const {
if (String(p_method) == "is_action" && p_argidx == 0) {
List<PropertyInfo> pinfo;
- GlobalConfig::get_singleton()->get_property_list(&pinfo);
+ ProjectSettings::get_singleton()->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
const PropertyInfo &pi = E->get();
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;
diff --git a/core/os/os.h b/core/os/os.h
index cafd1f4e14..362fec8a9e 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -109,6 +109,7 @@ protected:
virtual void set_cmdline(const char *p_execpath, const List<String> &p_args);
void _ensure_data_dir();
+ virtual bool _check_internal_feature_support(const String &p_feature) = 0;
public:
typedef int64_t ProcessID;
@@ -408,7 +409,7 @@ public:
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
- virtual bool check_feature_support(const String &p_feature) = 0;
+ bool check_feature_support(const String &p_feature);
bool is_hidpi_allowed() const { return _allow_hidpi; }
OS();