diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 6 | ||||
-rw-r--r-- | core/bind/core_bind.h | 6 | ||||
-rw-r--r-- | core/global_constants.cpp | 14 | ||||
-rw-r--r-- | core/os/os.h | 6 | ||||
-rw-r--r-- | core/variant_parser.cpp | 4 |
5 files changed, 17 insertions, 19 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index c69fe17049..5f534f63a8 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -978,9 +978,9 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_screen_count"), &_OS::get_screen_count); ClassDB::bind_method(D_METHOD("get_current_screen"), &_OS::get_current_screen); ClassDB::bind_method(D_METHOD("set_current_screen", "screen"), &_OS::set_current_screen); - ClassDB::bind_method(D_METHOD("get_screen_position", "screen"), &_OS::get_screen_position, DEFVAL(0)); - ClassDB::bind_method(D_METHOD("get_screen_size", "screen"), &_OS::get_screen_size, DEFVAL(0)); - ClassDB::bind_method(D_METHOD("get_screen_dpi", "screen"), &_OS::get_screen_dpi, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_screen_position", "screen"), &_OS::get_screen_position, DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("get_screen_size", "screen"), &_OS::get_screen_size, DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("get_screen_dpi", "screen"), &_OS::get_screen_dpi, DEFVAL(-1)); ClassDB::bind_method(D_METHOD("get_window_position"), &_OS::get_window_position); ClassDB::bind_method(D_METHOD("set_window_position", "position"), &_OS::set_window_position); ClassDB::bind_method(D_METHOD("get_window_size"), &_OS::get_window_size); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 41653c8846..fc280bd7ef 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -140,9 +140,9 @@ public: virtual int get_screen_count() const; virtual int get_current_screen() const; virtual void set_current_screen(int p_screen); - virtual Point2 get_screen_position(int p_screen = 0) const; - virtual Size2 get_screen_size(int p_screen = 0) const; - virtual int get_screen_dpi(int p_screen = 0) const; + virtual Point2 get_screen_position(int p_screen = -1) const; + virtual Size2 get_screen_size(int p_screen = -1) const; + virtual int get_screen_dpi(int p_screen = -1) const; virtual Point2 get_window_position() const; virtual void set_window_position(const Point2 &p_position); virtual Size2 get_window_size() const; diff --git a/core/global_constants.cpp b/core/global_constants.cpp index d296b678b9..cd9a302ba6 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -45,15 +45,15 @@ struct _GlobalConstant { _GlobalConstant() {} #ifdef DEBUG_METHODS_ENABLED - _GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) { - enum_name = p_enum_name; - name = p_name; - value = p_value; + _GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) + : enum_name(p_enum_name), + name(p_name), + value(p_value) { } #else - _GlobalConstant(const char *p_name, int p_value) { - name = p_name; - value = p_value; + _GlobalConstant(const char *p_name, int p_value) + : name(p_name), + value(p_value) { } #endif }; diff --git a/core/os/os.h b/core/os/os.h index 4d64e4a9f0..0fcf465655 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -164,9 +164,9 @@ public: virtual int get_screen_count() const { return 1; } virtual int get_current_screen() const { return 0; } virtual void set_current_screen(int p_screen) {} - virtual Point2 get_screen_position(int p_screen = 0) const { return Point2(); } - virtual Size2 get_screen_size(int p_screen = 0) const { return get_window_size(); } - virtual int get_screen_dpi(int p_screen = 0) const { return 72; } + virtual Point2 get_screen_position(int p_screen = -1) const { return Point2(); } + virtual Size2 get_screen_size(int p_screen = -1) const { return get_window_size(); } + virtual int get_screen_dpi(int p_screen = -1) const { return 72; } virtual Point2 get_window_position() const { return Vector2(); } virtual void set_window_position(const Point2 &p_position) {} virtual Size2 get_window_size() const = 0; diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 398f20caf3..5aa71f6704 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -326,6 +326,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri is_float = true; } else if (c == 'e') { reading = READING_EXP; + is_float = true; } else { reading = READING_DONE; } @@ -337,7 +338,6 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri } else if (c == 'e') { reading = READING_EXP; - } else { reading = READING_DONE; } @@ -349,8 +349,6 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri exp_beg = true; } else if ((c == '-' || c == '+') && !exp_sign && !exp_beg) { - if (c == '-') - is_float = true; exp_sign = true; } else { |