diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 15 | ||||
-rw-r--r-- | core/bind/core_bind.h | 17 | ||||
-rw-r--r-- | core/globals.cpp | 2 | ||||
-rw-r--r-- | core/io/config_file.cpp | 2 | ||||
-rw-r--r-- | core/io/resource_format_xml.cpp | 2 | ||||
-rw-r--r-- | core/os/os.cpp | 6 | ||||
-rw-r--r-- | core/os/os.h | 14 | ||||
-rw-r--r-- | core/typedefs.h | 2 |
8 files changed, 56 insertions, 4 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index f50330447c..ef943b2f7a 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -606,6 +606,12 @@ bool _OS::is_debug_build() const { #endif } + +String _OS::get_system_dir(SystemDir p_dir) const { + + return OS::get_singleton()->get_system_dir(OS::SystemDir(p_dir)); +} + String _OS::get_custom_level() const { return OS::get_singleton()->get_custom_level(); @@ -690,6 +696,7 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_dynamic_memory_usage"),&_OS::get_dynamic_memory_usage); ObjectTypeDB::bind_method(_MD("get_data_dir"),&_OS::get_data_dir); + ObjectTypeDB::bind_method(_MD("get_system_dir","dir"),&_OS::get_system_dir); ObjectTypeDB::bind_method(_MD("get_unique_ID"),&_OS::get_unique_ID); ObjectTypeDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second); @@ -728,6 +735,14 @@ void _OS::_bind_methods() { BIND_CONSTANT( MONTH_NOVEMBER ); BIND_CONSTANT( MONTH_DECEMBER ); + BIND_CONSTANT( SYSTEM_DIR_DESKTOP); + BIND_CONSTANT( SYSTEM_DIR_DCIM ); + BIND_CONSTANT( SYSTEM_DIR_DOCUMENTS ); + BIND_CONSTANT( SYSTEM_DIR_DOWNLOADS ); + BIND_CONSTANT( SYSTEM_DIR_MOVIES ); + BIND_CONSTANT( SYSTEM_DIR_MUSIC ); + BIND_CONSTANT( SYSTEM_DIR_PICTURES ); + BIND_CONSTANT( SYSTEM_DIR_RINGTONES ); } diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 101dc1ab94..a76b4aa81f 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -201,6 +201,20 @@ public: int get_processor_count() const; + enum SystemDir { + SYSTEM_DIR_DESKTOP, + SYSTEM_DIR_DCIM, + SYSTEM_DIR_DOCUMENTS, + SYSTEM_DIR_DOWNLOADS, + SYSTEM_DIR_MOVIES, + SYSTEM_DIR_MUSIC, + SYSTEM_DIR_PICTURES, + SYSTEM_DIR_RINGTONES, + }; + + String get_system_dir(SystemDir p_dir) const; + + String get_data_dir() const; void set_time_scale(float p_scale); @@ -211,6 +225,9 @@ public: _OS(); }; +VARIANT_ENUM_CAST(_OS::SystemDir); + + class _Geometry : public Object { OBJ_TYPE(_Geometry, Object); diff --git a/core/globals.cpp b/core/globals.cpp index 94fa331bed..a39ace7360 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -674,7 +674,7 @@ static Variant _decode_variant(const String& p_string) { int w=params[2].to_int(); int h=params[3].to_int(); - if (w == 0 && w == 0) { + if (w == 0 && h == 0) { //r_v = Image(w, h, imgformat); return Image(); }; diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index b707fd9c13..17ee72f2eb 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -580,7 +580,7 @@ static Variant _decode_variant(const String& p_string) { int w=params[2].to_int(); int h=params[3].to_int(); - if (w == 0 && w == 0) { + if (w == 0 && h == 0) { //r_v = Image(w, h, imgformat); return Image(); }; diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index e6eede7de6..2a79e6647d 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -571,7 +571,7 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name) int w=width.to_int(); int h=height.to_int(); - if (w == 0 && w == 0) { + if (w == 0 && h == 0) { //r_v = Image(w, h, imgformat); r_v=Image(); String sdfsdfg; diff --git a/core/os/os.cpp b/core/os/os.cpp index e56f4a4904..081f7c1c5e 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -280,6 +280,12 @@ String OS::get_resource_dir() const { return Globals::get_singleton()->get_resource_path(); } + +String OS::get_system_dir(SystemDir p_dir) const { + + return "."; +} + String OS::get_data_dir() const { return "."; diff --git a/core/os/os.h b/core/os/os.h index 5e084f6373..805d6ac57d 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -286,6 +286,20 @@ public: virtual String get_data_dir() const; virtual String get_resource_dir() const; + enum SystemDir { + SYSTEM_DIR_DESKTOP, + SYSTEM_DIR_DCIM, + SYSTEM_DIR_DOCUMENTS, + SYSTEM_DIR_DOWNLOADS, + SYSTEM_DIR_MOVIES, + SYSTEM_DIR_MUSIC, + SYSTEM_DIR_PICTURES, + SYSTEM_DIR_RINGTONES, + }; + + virtual String get_system_dir(SystemDir p_dir) const; + + virtual void set_no_window_mode(bool p_enable); virtual bool is_no_window_mode_enabled() const; diff --git a/core/typedefs.h b/core/typedefs.h index 3107ac2ff7..442ed9ae0b 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -41,7 +41,7 @@ #define _MKSTR(m_x) _STR(m_x) #endif // have to include version.h for this to work, include it in the .cpp not the .h -#define VERSION_MKSTRING _MKSTR(VERSION_MAJOR)"."_MKSTR(VERSION_MINOR)"."_MKSTR(VERSION_REVISION)"-"_MKSTR(VERSION_STATUS) +#define VERSION_MKSTRING _MKSTR(VERSION_MAJOR)"."_MKSTR(VERSION_MINOR)"."_MKSTR(VERSION_STATUS)"."_MKSTR(VERSION_REVISION) #define VERSION_FULL_NAME _MKSTR(VERSION_NAME)" v"VERSION_MKSTRING |